From 6a130fc742c45c169aa19d5940a3288e121fdb92 Mon Sep 17 00:00:00 2001 From: greggman Date: Wed, 25 Dec 2024 17:51:58 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20greggman?= =?UTF-8?q?/muigui@43455ec971482d442bedfe0dacfb1067d989d02e=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/0.x/controllers/Button.d.ts | 4 +- dist/0.x/controllers/Canvas.d.ts | 1 + dist/0.x/controllers/Container.d.ts | 1 + dist/0.x/muigui.js | 39 +- dist/0.x/muigui.js.map | 2 +- dist/0.x/muigui.min.js | 2 +- dist/0.x/muigui.min.js.map | 2 +- dist/0.x/muigui.module.js | 39 +- dist/0.x/muigui.module.js.map | 2 +- dist/0.x/muigui.module.min.js | 2 +- dist/0.x/muigui.module.min.js.map | 2 +- examples/js/long-hide.js | 40 + examples/js/lots.js | 130 +- examples/long-hide.html | 18 + package-lock.json | 2087 +++++++++++++-------------- package.json | 6 +- src/controllers/Button.js | 2 + src/controllers/Canvas.js | 3 + src/controllers/Container.js | 6 + src/muigui.js | 23 +- src/styles/muigui.css.js | 3 +- test/puppeteer.js | 2 + 22 files changed, 1280 insertions(+), 1136 deletions(-) create mode 100644 examples/js/long-hide.js create mode 100644 examples/long-hide.html diff --git a/dist/0.x/controllers/Button.d.ts b/dist/0.x/controllers/Button.d.ts index 36c33e7..b957542 100644 --- a/dist/0.x/controllers/Button.d.ts +++ b/dist/0.x/controllers/Button.d.ts @@ -1,7 +1,7 @@ export default class Button extends Controller { constructor(object: any, property: any, options?: {}); - name(name: any): void; - setOptions(options: any): void; + name(name: any): this; + setOptions(options: any): this; #private; } import Controller from './Controller.js'; diff --git a/dist/0.x/controllers/Canvas.d.ts b/dist/0.x/controllers/Canvas.d.ts index 0e89042..1451a71 100644 --- a/dist/0.x/controllers/Canvas.d.ts +++ b/dist/0.x/controllers/Canvas.d.ts @@ -1,6 +1,7 @@ export default class Canvas extends LabelController { constructor(name: any); get canvas(): HTMLElement; + listen(): this; #private; } import LabelController from './LabelController.js'; diff --git a/dist/0.x/controllers/Container.d.ts b/dist/0.x/controllers/Container.d.ts index 3dafbde..0e3a3cf 100644 --- a/dist/0.x/controllers/Container.d.ts +++ b/dist/0.x/controllers/Container.d.ts @@ -8,6 +8,7 @@ export default class Container extends Controller { addController(controller: any): any; pushContainer(container: any): any; popContainer(): this; + listen(): this; #private; } import Controller from './Controller.js'; diff --git a/dist/0.x/muigui.js b/dist/0.x/muigui.js index 25436e5..27347bb 100644 --- a/dist/0.x/muigui.js +++ b/dist/0.x/muigui.js @@ -1,4 +1,4 @@ -/* muigui@0.0.17, license MIT */ +/* muigui@0.0.20, license MIT */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : @@ -91,6 +91,7 @@ font-size: var(--font-size); box-sizing: border-box; line-height: 100%; + white-space: nowrap; } .muigui * { box-sizing: inherit; @@ -294,7 +295,7 @@ } .muigui-closed>.muigui-open-container>* { transition: all 0.1s ease-out; - margin-top: -100%; + margin-top: -1000%; } /* ---- popdown ---- */ @@ -1214,11 +1215,13 @@ } name(name) { this.#buttonElem.textContent = name; + return this; } setOptions(options) { copyExistingProperties(this.#options, options); const {name} = this.#options; this.#buttonElem.textContent = name; + return this; } } @@ -2626,6 +2629,9 @@ get canvas() { return this.#canvasElem; } + listen() { + return this; + } } class ColorView extends EditView { @@ -2767,6 +2773,12 @@ this.#childDestController = this.#childDestController.parent; return this; } + listen() { + this.#controllers.forEach(c => { + c.listen(); + }); + return this; + } } class Folder extends Container { @@ -3275,11 +3287,22 @@ } } + function camelCaseToSnakeCase(id) { + return id + .replace(/(.)([A-Z][a-z]+)/g, '$1_$2') + .replace(/([a-z0-9])([A-Z])/g, '$1_$2') + .toLowerCase(); + } + + function prepName(name) { + return camelCaseToSnakeCase(name.toString()).replaceAll('_', ' '); + } + class GUIFolder extends Folder { add(object, property, ...args) { const controller = object instanceof Controller ? object - : createController(object, property, ...args); + : createController(object, property, ...args).name(prepName(property)); return this.addController(controller); } addCanvas(name) { @@ -3288,9 +3311,13 @@ addColor(object, property, options = {}) { const value = object[property]; if (hasAlpha(options.format || guessFormat(value))) { - return this.addController(new ColorChooser(object, property, options)); + return this + .addController(new ColorChooser(object, property, options)) + .name(prepName(property)); } else { - return this.addController(new Color(object, property, options)); + return this + .addController(new Color(object, property, options)) + .name(prepName(property)); } } addDivider() { @@ -3304,7 +3331,7 @@ } addButton(name, fn) { const o = {fn}; - return this.add(o, 'fn').name(name); + return this.add(o, 'fn').name(prepName(name)); } } diff --git a/dist/0.x/muigui.js.map b/dist/0.x/muigui.js.map index 4dc408b..f244193 100644 --- a/dist/0.x/muigui.js.map +++ b/dist/0.x/muigui.js.map @@ -1 +1 @@ -{"version":3,"file":"muigui.js","sources":["../../src/styles/muigui.css.js","../../src/libs/elem.js","../../src/libs/utils.js","../../../src/views/View.ts","../../src/controllers/Controller.js","../../src/controllers/Button.js","../../src/views/EditView.js","../../src/views/CheckboxView.js","../../src/libs/taskrunner.js","../../src/libs/ids.js","../../src/views/ValueView.js","../../src/controllers/LabelController.js","../../src/controllers/ValueController.js","../../src/controllers/Checkbox.js","../../src/libs/conversions.js","../../src/libs/wheel.js","../../src/views/NumberView.js","../../src/controllers/TextNumber.js","../../src/views/SelectView.js","../../src/libs/key-values.js","../../src/controllers/Select.js","../../src/views/RangeView.js","../../src/controllers/Range.js","../../src/views/TextView.js","../../src/controllers/Text.js","../../src/controllers/create-controller.js","../../src/libs/color-utils.js","../../src/views/ElementView.js","../../src/controllers/Canvas.js","../../src/views/ColorView.js","../../src/controllers/Color.js","../../src/controllers/Divider.js","../../src/controllers/Container.js","../../src/controllers/Folder.js","../../src/controllers/Label.js","../../src/libs/touch.js","../../src/views/ColorChooserView.js","../../src/controllers/PopDownController.js","../../src/controllers/ColorChooser.js","../../src/layout/Layout.js","../../src/layout/Column.js","../../src/layout/Frame.js","../../src/layout/Grid.js","../../src/layout/Row.js","../../src/muigui.js","../../src/libs/keyboard.js","../../src/libs/assert.js","../../src/libs/svg.js","../../src/views/DirectionView.js","../../src/controllers/Direction.js","../../src/views/RadioGridView.js","../../src/controllers/RadioGrid.js","../../src/libs/resize-helpers.js","../../src/views/SliderView.js","../../src/controllers/Slider.js","../../src/views/Vec2View.js","../../src/controllers/Vec2.js","../../src/umd.js"],"sourcesContent":["export default {\n default: `\n.muigui {\n --bg-color: #ddd;\n --color: #222;\n --contrast-color: #eee;\n --value-color: #145 ;\n --value-bg-color: #eeee;\n --disabled-color: #999;\n --menu-bg-color: #f8f8f8;\n --menu-sep-color: #bbb;\n --hover-bg-color: #999;\n --focus-color: #8BF;\n --range-color: #AAA;\n --invalid-color: #FF0000;\n --selected-color: rgb(255, 255, 255, 0.9);\n\n --button-bg-color: var(--value-bg-color);\n\n --image-open: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjNDQ0OyIgeD0iMjAlIiB5PSI0NSUiIHdpZHRoPSI2MCUiIGhlaWdodD0iMTAlIj48L3JlY3Q+Cjwvc3ZnPg==);\n --image-closed: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjNDQ0OyIgeD0iNDUlIiB5PSIyMCUiIHdpZHRoPSIxMCUiIGhlaWdodD0iNjAlIj48L3JlY3Q+CiAgPHJlY3Qgc3R5bGU9ImZpbGw6ICM0NDQ7IiB4PSIyMCUiIHk9IjQ1JSIgd2lkdGg9IjYwJSIgaGVpZ2h0PSIxMCUiPjwvcmVjdD4KPC9zdmc+);\n --image-checkerboard: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjNDA0MDQwOyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSI+PC9yZWN0PgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjODA4MDgwOyIgeD0iMCIgeT0iMCIgd2lkdGg9IjUwJSIgaGVpZ2h0PSI1MCUiPjwvcmVjdD4KICA8cmVjdCBzdHlsZT0iZmlsbDogIzgwODA4MDsiIHg9IjUwJSIgeT0iNTAlIiB3aWR0aD0iNTAlIiBoZWlnaHQ9IjUwJSI+PC9yZWN0Pgo8L3N2Zz4=);\n\n --range-left-color: var(--value-color);\n --range-right-color: var(--value-bg-color); \n --range-right-hover-color: var(--hover-bg-color);\n --button-image: \n linear-gradient(\n rgba(255, 255, 255, 1), rgba(0, 0, 0, 0.2)\n );\n\n color: var(--color);\n background-color: var(--bg-color);\n}\n\n@media (prefers-color-scheme: dark) {\n .muigui {\n --bg-color: #222222;\n --color: #dddddd;\n --contrast-color: #000;\n --value-color: #43e5f7;\n --value-bg-color: #444444;\n --disabled-color: #666666;\n --menu-bg-color: #080808;\n --menu-sep-color: #444444;\n --hover-bg-color: #666666;\n --focus-color: #458; /*#88AAFF*/;\n --range-color: #888888;\n --invalid-color: #FF6666;\n --selected-color: rgba(255, 255, 255, 0.3);\n\n --button-bg-color: var(--value-bg-color);\n\n --range-left-color: var(--value-color);\n --range-right-color: var(--value-bg-color); \n --range-right-hover-color: var(--hover-bg-color);\n --button-image: linear-gradient(\n rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.4)\n );\n\n color: var(--color);\n background-color: var(--bg-color);\n\n --image-closed: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjREREOyIgeD0iMjAlIiB5PSI0NSUiIHdpZHRoPSI2MCUiIGhlaWdodD0iMTAlIj48L3JlY3Q+Cjwvc3ZnPg==);\n --image-open: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjREREOyIgeD0iNDUlIiB5PSIyMCUiIHdpZHRoPSIxMCUiIGhlaWdodD0iNjAlIj48L3JlY3Q+CiAgPHJlY3Qgc3R5bGU9ImZpbGw6ICNEREQ7IiB4PSIyMCUiIHk9IjQ1JSIgd2lkdGg9IjYwJSIgaGVpZ2h0PSIxMCUiPjwvcmVjdD4KPC9zdmc+);\n }\n}\n\n.muigui {\n --width: 250px;\n --label-width: 45%;\n --number-width: 40%;\n\n --font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Arial, sans-serif;\n --font-size: 11px;\n --font-family-mono: Menlo, Monaco, Consolas, \"Droid Sans Mono\", monospace;\n --font-size-mono: 11px;\n\n --line-height: 1.7em;\n --border-radius: 0px;\n\n width: var(--width);\n font-family: var(--font-family);\n font-size: var(--font-size);\n box-sizing: border-box;\n line-height: 100%;\n}\n.muigui * {\n box-sizing: inherit;\n}\n\n.muigui-no-scroll {\n touch-action: none;\n}\n.muigui-no-h-scroll {\n touch-action: pan-y;\n}\n.muigui-no-v-scroll {\n touch-action: pan-x;\n}\n\n.muigui-invalid-value {\n background-color: red !important;\n color: white !important;\n}\n\n.muigui-grid {\n display: grid;\n}\n.muigui-rows {\n display: flex;\n flex-direction: column;\n\n min-height: 20px;\n border: 2px solid red;\n}\n.muigui-columns {\n display: flex;\n flex-direction: row;\n\n height: 20px;\n border: 2px solid green;\n}\n.muigui-rows>*,\n.muigui-columns>* {\n flex: 1 1 auto;\n align-items: stretch;\n min-height: 0;\n min-width: 0;\n}\n\n.muigui-row {\n border: 2px solid yellow;\n min-height: 10px\n}\n.muigui-column {\n border: 2px solid lightgreen;\n}\n\n/* -------- */\n\n.muigui-show { /* */ }\n.muigui-hide { \n display: none !important;\n}\n.muigui-disabled {\n pointer-events: none;\n --color: var(--disabled-color) !important;\n --value-color: var(--disabled-color) !important;\n --range-left-color: var(--disabled-color) !important;\n}\n\n.muigui canvas,\n.muigui svg {\n display: block;\n border-radius: var(--border-radius);\n}\n.muigui canvas {\n background-color: var(--value-bg-color);\n}\n\n.muigui-controller {\n min-width: 0;\n min-height: var(--line-height);\n}\n.muigui-root {\n z-index: 1;\n}\n.muigui-root,\n.muigui-menu {\n display: flex;\n flex-direction: column;\n position: relative;\n user-select: none;\n height: fit-content;\n margin: 0;\n padding-bottom: 0.1em;\n border-radius: var(--border-radius);\n}\n.muigui-menu {\n border-bottom: 1px solid var(--menu-sep-color);\n}\n\n.muigui-root>button:nth-child(1),\n.muigui-menu>button:nth-child(1) {\n border-top: 1px solid var(--menu-sep-color);\n border-bottom: 1px solid var(--menu-sep-color);\n position: relative;\n text-align: left;\n color: var(--color);\n background-color: var(--menu-bg-color);\n min-height: var(--line-height);\n padding: 0.2em;\n cursor: pointer;\n border-radius: var(--border-radius);\n}\n.muigui-root>div:nth-child(2),\n.muigui-menu>div:nth-child(2) {\n flex: 1 1 auto;\n}\n\n.muigui-controller {\n margin-left: 0.2em;\n margin-right: 0.2em;\n}\n.muigui-root.muigui-controller,\n.muigui-menu.muigui-controller {\n margin-left: 0;\n margin-right: 0;\n}\n.muigui-controller>*:nth-child(1) {\n flex: 1 0 var(--label-width);\n min-width: 0;\n /* white-space: pre; why?? */\n}\n.muigui-controller>label:nth-child(1) {\n place-content: center start;\n display: inline-grid;\n overflow: hidden;\n}\n.muigui-controller>*:nth-child(2) {\n flex: 1 1 75%;\n min-width: 0;\n}\n\n/* -----------------------------------------\n a label controller is [[label][value]]\n*/\n\n.muigui-label-controller {\n display: flex;\n margin: 0.4em 0 0.4em 0;\n word-wrap: initial;\n align-items: stretch;\n}\n\n.muigui-value {\n display: flex;\n align-items: stretch;\n}\n.muigui-value>* {\n flex: 1 1 auto;\n min-width: 0;\n}\n.muigui-value>*:nth-child(1) {\n flex: 1 1 calc(100% - var(--number-width));\n}\n.muigui-value>*:nth-child(2) {\n flex: 1 1 var(--number-width);\n margin-left: 0.2em;\n}\n\n/* fix! */\n.muigui-open>button>label::before,\n.muigui-closed>button>label::before {\n content: \"X\";\n color: rgba(0, 0, 0, 0);\n background-color: var(--range-color);\n border-radius: 0.2em;\n width: 1.25em;\n margin-right: 0.25em;\n height: 1.25em; /*var(--line-height);*/\n display: inline-grid;\n place-content: center start;\n pointer-events: none;\n}\n.muigui-open>button>label::before {\n background-image: var(--image-open);\n}\n.muigui-closed>button>label::before {\n background-image: var(--image-closed);\n}\n\n.muigui-open>.muigui-open-container {\n transition: all 0.1s ease-out;\n overflow: auto;\n height: 100%;\n}\n.muigui-closed>.muigui-open-container {\n transition: all 0.1s ease-out;\n overflow: hidden;\n min-height: 0;\n}\n.muigui-open>.muigui-open-container>* {\n transition: all 0.1s ease-out;\n margin-top: 0px;\n}\n.muigui-closed>.muigui-open-container>* {\n transition: all 0.1s ease-out;\n margin-top: -100%;\n}\n\n/* ---- popdown ---- */\n\n.muigui-pop-down-top {\n display: flex;\n}\n/* fix? */\n.muigui-value>*:nth-child(1).muigui-pop-down-top {\n flex: 0;\n}\n.muigui-closed .muigui-pop-down-bottom {\n max-height: 0;\n}\n\n.muigui-value .muigui-pop-down-bottom {\n margin: 0;\n}\n\n.muigui-pop-down-values {\n min-width: 0;\n display: flex;\n}\n.muigui-pop-down-values>* {\n flex: 1 1 auto;\n min-width: 0;\n}\n\n.muigui-value.muigui-pop-down-controller {\n flex-direction: column;\n}\n\n.muigui-pop-down-top input[type=checkbox] {\n -webkit-appearance: none;\n appearance: none;\n width: auto;\n color: var(--value-color);\n background-color: var(--value-bg-color);\n background-image: var(--image-checkerboard);\n background-size: 10px 10px;\n background-position: 0 0, 0 5px, 5px -5px, -5px 0px;\n\n cursor: pointer;\n\n display: grid;\n place-content: center;\n margin: 0;\n font: inherit;\n color: currentColor;\n width: 1.7em;\n height: 1.7em;\n transform: translateY(-0.075em);\n}\n\n.muigui-pop-down-top input[type=checkbox]::before {\n content: \"+\";\n display: grid;\n place-content: center;\n border-radius: calc(var(--border-radius) + 2px);\n border-left: 1px solid rgba(255,255,255,0.3);\n border-top: 1px solid rgba(255,255,255,0.3);\n border-bottom: 1px solid rgba(0,0,0,0.2);\n border-right: 1px solid rgba(0,0,0,0.2);\n background-color: var(--range-color);\n color: var(--value-bg-color);\n width: calc(var(--line-height) - 4px);\n height: calc(var(--line-height) - 4px);\n}\n\n.muigui-pop-down-top input[type=checkbox]:checked::before {\n content: \"X\";\n}\n\n\n/* ---- select ---- */\n\n.muigui select,\n.muigui option,\n.muigui input,\n.muigui button {\n color: var(--value-color);\n background-color: var(--value-bg-color);\n font-family: var(--font-family);\n font-size: var(--font-size);\n border: none;\n margin: 0;\n border-radius: var(--border-radius);\n}\n.muigui select {\n appearance: none;\n margin: 0;\n margin-left: 0; /*?*/\n overflow: hidden; /* Safari */\n}\n\n.muigui select:focus,\n.muigui input:focus,\n.muigui button:focus {\n outline: 1px solid var(--focus-color);\n}\n\n.muigui select:hover,\n.muigui option:hover,\n.muigui input:hover,\n.muigui button:hover {\n background-color: var(--hover-bg-color); \n}\n\n/* ------ [ label ] ------ */\n\n.muigui-label {\n border-top: 1px solid var(--menu-sep-color);\n border-bottom: 1px solid var(--menu-sep-color);\n padding-top: 0.4em;\n padding-bottom: 0.3em;\n place-content: center start;\n background-color: var(--menu-bg-color);\n white-space: pre;\n border-radius: var(--border-radius);\n}\n\n/* ------ [ divider] ------ */\n\n.muigui-divider {\n min-height: 6px;\n border-top: 2px solid var(--menu-sep-color);\n margin-top: 6px;\n}\n\n/* ------ [ button ] ------ */\n\n.muigui-button {\n display: grid;\n padding: 2px 0 2px 0;\n}\n.muigui-button button {\n border: none;\n color: var(--value-color);\n background-color: var(--button-bg-color);\n background-image: var(--button-image);\n cursor: pointer;\n place-content: center center;\n height: var(--line-height);\n}\n\n/* ------ [ color ] ------ */\n\n.muigui-color>div {\n overflow: hidden;\n position: relative;\n margin-left: 0;\n margin-right: 0; /* why? */\n max-width: var(--line-height);\n border-radius: var(--border-radius);\n}\n\n.muigui-color>div:focus-within {\n outline: 1px solid var(--focus-color);\n}\n\n.muigui-color input[type=color] {\n border: none;\n padding: 0;\n background: inherit;\n cursor: pointer;\n position: absolute;\n width: 200%;\n left: -10px;\n top: -10px;\n height: 200%;\n}\n.muigui-disabled canvas,\n.muigui-disabled svg,\n.muigui-disabled img,\n.muigui-disabled .muigui-color input[type=color] {\n opacity: 0.2;\n}\n\n/* ------ [ checkbox ] ------ */\n\n.muigui-checkbox>label:nth-child(2) {\n display: grid;\n place-content: center start;\n margin: 0;\n}\n\n.muigui-checkbox input[type=checkbox] {\n -webkit-appearance: none;\n appearance: none;\n width: auto;\n color: var(--value-color);\n background-color: var(--value-bg-color);\n cursor: pointer;\n\n display: grid;\n place-content: center;\n margin: 0;\n font: inherit;\n color: currentColor;\n width: 1.7em;\n height: 1.7em;\n transform: translateY(-0.075em);\n}\n\n.muigui-checkbox input[type=checkbox]::before {\n content: \"\";\n color: var(--value-color);\n display: grid;\n place-content: center;\n}\n\n.muigui-checkbox input[type=checkbox]:checked::before {\n content: \"✔\";\n}\n\n.muigui input[type=number]::-webkit-inner-spin-button, \n.muigui input[type=number]::-webkit-outer-spin-button { \n -webkit-appearance: none;\n appearance: none;\n margin: 0; \n}\n.muigui input[type=number] {\n -moz-appearance: textfield;\n}\n\n/* ------ [ radio grid ] ------ */\n\n.muigui-radio-grid>div {\n display: grid;\n gap: 2px;\n}\n\n.muigui-radio-grid input {\n appearance: none;\n display: none;\n}\n\n.muigui-radio-grid button {\n color: var(--color);\n width: 100%;\n text-align: left;\n}\n\n.muigui-radio-grid input:checked + button {\n color: var(--value-color);\n background-color: var(--selected-color);\n}\n\n/* ------ [ color-chooser ] ------ */\n\n.muigui-color-chooser-cursor {\n stroke-width: 1px;\n stroke: white;\n fill: none;\n}\n.muigui-color-chooser-circle {\n stroke-width: 1px;\n stroke: white;\n fill: none;\n}\n\n\n/* ------ [ vec2 ] ------ */\n\n.muigui-vec2 svg {\n background-color: var(--value-bg-color);\n}\n\n.muigui-vec2-axis {\n stroke: 1px;\n stroke: var(--focus-color);\n}\n\n.muigui-vec2-line {\n stroke-width: 1px;\n stroke: var(--value-color);\n fill: var(--value-color);\n}\n\n/* ------ [ direction ] ------ */\n\n.muigui-direction svg {\n background-color: rgba(0,0,0,0.2);\n}\n\n.muigui-direction:focus-within svg {\n outline: none;\n}\n.muigui-direction-range {\n fill: var(--value-bg-color);\n}\n.muigui-direction svg:focus {\n outline: none;\n}\n.muigui-direction svg:focus .muigui-direction-range {\n stroke-width: 0.5px;\n stroke: var(--focus-color);\n}\n\n.muigui-direction-arrow {\n fill: var(--value-color);\n}\n\n/* ------ [ slider ] ------ */\n\n.muigui-slider>div {\n display: flex;\n align-items: stretch;\n height: var(--line-height);\n}\n.muigui-slider svg {\n flex: 1 1 auto;\n}\n.muigui-slider .muigui-slider-up #muigui-orientation {\n transform: scale(1, -1) translateY(-100%);\n}\n\n.muigui-slider .muigui-slider-up #muigui-number-orientation {\n transform: scale(1,-1);\n}\n\n.muigui-ticks {\n stroke: var(--range-color);\n}\n.muigui-thicks {\n stroke: var(--color);\n stroke-width: 2px;\n}\n.muigui-svg-text {\n fill: var(--color);\n font-size: 7px;\n}\n.muigui-mark {\n fill: var(--value-color);\n}\n\n/* ------ [ range ] ------ */\n\n\n.muigui-range input[type=range] {\n -webkit-appearance: none;\n appearance: none;\n background-color: transparent;\n}\n\n.muigui-range input[type=range]::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n border-radius: calc(var(--border-radius) + 2px);\n border-left: 1px solid rgba(255,255,255,0.3);\n border-top: 1px solid rgba(255,255,255,0.3);\n border-bottom: 1px solid rgba(0,0,0,0.2);\n border-right: 1px solid rgba(0,0,0,0.2);\n background-color: var(--range-color);\n margin-top: calc((var(--line-height) - 6px) / -2);\n width: calc(var(--line-height) - 6px);\n height: calc(var(--line-height) - 6px);\n}\n\n.muigui-range input[type=range]::-webkit-slider-runnable-track {\n -webkit-appearance: none;\n appearance: none;\n border: 1px solid var(--menu-sep-color);\n height: 2px;\n}\n\n\n/* dat.gui style - doesn't work on Safari iOS */\n\n/*\n.muigui-range input[type=range] {\n cursor: ew-resize;\n overflow: hidden;\n}\n\n.muigui-range input[type=range] {\n -webkit-appearance: none;\n appearance: none;\n background-color: var(--range-right-color);\n margin: 0;\n}\n.muigui-range input[type=range]:hover {\n background-color: var(--range-right-hover-color);\n}\n\n.muigui-range input[type=range]::-webkit-slider-runnable-track {\n -webkit-appearance: none;\n appearance: none;\n height: max-content;\n color: var(--range-left-color);\n margin-top: -1px;\n}\n\n.muigui-range input[type=range]::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 0px;\n height: max-content;\n box-shadow: -1000px 0 0 1000px var(--range-left-color);\n}\n*/\n\n/* FF */\n/*\n.muigui-range input[type=range]::-moz-slider-progress {\n background-color: var(--range-left-color); \n}\n.muigui-range input[type=range]::-moz-slider-thumb {\n height: max-content;\n width: 0;\n border: none;\n box-shadow: -1000px 0 0 1000px var(--range-left-color);\n box-sizing: border-box;\n}\n*/\n\n.muigui-checkered-background {\n background-color: #404040;\n background-image:\n linear-gradient(45deg, #808080 25%, transparent 25%),\n linear-gradient(-45deg, #808080 25%, transparent 25%),\n linear-gradient(45deg, transparent 75%, #808080 75%),\n linear-gradient(-45deg, transparent 75%, #808080 75%);\n background-size: 16px 16px;\n background-position: 0 0, 0 8px, 8px -8px, -8px 0px;\n}\n\n/* ---------------------------------------------------------- */\n\n/* needs to be at bottom to take precedence */\n.muigui-auto-place {\n max-height: 100%;\n position: fixed;\n top: 0;\n right: 15px;\n z-index: 100001;\n}\n\n`,\nthemes: {\n default: {\n include: ['default'],\n css: `\n `,\n },\n float: {\n include: ['default'],\n css: `\n :root {\n color-scheme: light dark,\n }\n\n .muigui {\n --width: 400px;\n --bg-color: initial;\n --label-width: 25%;\n --number-width: 20%;\n }\n\n input,\n .muigui-label-controller>label {\n text-shadow:\n -1px -1px 0 var(--contrast-color),\n 1px -1px 0 var(--contrast-color),\n -1px 1px 0 var(--contrast-color),\n 1px 1px 0 var(--contrast-color);\n }\n\n .muigui-controller > label:nth-child(1) {\n place-content: center end;\n margin-right: 1em;\n }\n\n .muigui-value > :nth-child(2) {\n margin-left: 1em;\n }\n\n .muigui-root>*:nth-child(1) {\n display: none;\n }\n\n .muigui-range input[type=range]::-webkit-slider-thumb {\n border-radius: 1em;\n }\n\n .muigui-range input[type=range]::-webkit-slider-runnable-track {\n -webkit-appearance: initial;\n appearance: none;\n border: 1px solid rgba(0, 0, 0, 0.25);\n height: 2px;\n }\n\n .muigui-colors {\n --value-color: var(--color );\n --value-bg-color: rgba(0, 0, 0, 0.1);\n --disabled-color: #cccccc;\n --menu-bg-color: rgba(0, 0, 0, 0.1);\n --menu-sep-color: #bbbbbb;\n --hover-bg-color: rgba(0, 0, 0, 0);\n --invalid-color: #FF0000;\n --selected-color: rgba(0, 0, 0, 0.3);\n --range-color: rgba(0, 0, 0, 0.125);\n }\n`,\n },\n form: {\n include: [],\n css: `\n .muigui {\n --width: 100%;\n --label-width: 45%;\n --number-width: 40%;\n }\n .muigui-root>button {\n display: none;\n }\n .muigui-controller {\n margin-top: 1em;\n }\n .muigui-label-controller {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n margin-top: 1em;\n }\n .muigui-label-controller:has(.muigui-checkbox) {\n flex-direction: row;\n }\n .muigui-value {\n display: flex;\n align-items: stretch;\n }\n .muigui-value>* {\n flex: 1 1 auto;\n min-width: 0;\n }\n .muigui-controller>*:nth-child(1) {\n flex: 1 0 var(--label-width);\n min-width: 0;\n white-space: pre;\n }\n .muigui-controller>label:nth-child(1) {\n place-content: center start;\n display: inline-grid;\n overflow: hidden;\n }\n .muigui-controller>*:nth-child(2) {\n flex: 1 1 75%;\n min-width: 0;\n }\n `,\n },\n none: {\n include: [],\n css: '',\n },\n},\n};\n","export function setElemProps(elem, attrs, children) {\n for (const [key, value] of Object.entries(attrs)) {\n if (typeof value === 'function' && key.startsWith('on')) {\n const eventName = key.substring(2).toLowerCase();\n elem.addEventListener(eventName, value, {passive: false});\n } else if (typeof value === 'object') {\n for (const [k, v] of Object.entries(value)) {\n elem[key][k] = v;\n }\n } else if (elem[key] === undefined) {\n elem.setAttribute(key, value);\n } else {\n elem[key] = value;\n }\n }\n for (const child of children) {\n elem.appendChild(child);\n }\n return elem;\n}\n\nexport function createElem(tag, attrs = {}, children = []) {\n const elem = document.createElement(tag);\n setElemProps(elem, attrs, children);\n return elem;\n}\n\nexport function addElem(tag, parent, attrs = {}, children = []) {\n const elem = createElem(tag, attrs, children);\n parent.appendChild(elem);\n return elem;\n}\n\nlet nextId = 0;\nexport function getNewId() {\n return `muigui-id-${nextId++}`;\n}\n","export function removeArrayElem(array, value) {\n const ndx = array.indexOf(value);\n if (ndx) {\n array.splice(ndx, 1);\n }\n return array;\n}\n\n/**\n * Converts an camelCase or snake_case id to \"camel case\" or \"snake case\"\n * @param {string} id\n */\nconst underscoreRE = /_/g;\nconst upperLowerRE = /([A-Z])([a-z])/g;\nexport function idToLabel(id) {\n return id.replace(underscoreRE, ' ')\n .replace(upperLowerRE, (m, m1, m2) => `${m1.toLowerCase()} ${m2}`);\n}\n\nexport function clamp(v, min, max) {\n return Math.max(min, Math.min(max, v));\n}\n\nexport const isTypedArray = typeof SharedArrayBuffer !== 'undefined'\n ? function isArrayBufferOrSharedArrayBuffer(a) {\n return a && a.buffer && (a.buffer instanceof ArrayBuffer || a.buffer instanceof SharedArrayBuffer);\n }\n : function isArrayBuffer(a) {\n return a && a.buffer && a.buffer instanceof ArrayBuffer;\n };\n\nexport const isArrayOrTypedArray = v => Array.isArray(v) || isTypedArray(v);\n\n// Yea, I know this should be `Math.round(v / step) * step\n// but try step = 0.1, newV = 19.95\n//\n// I get\n// Math.round(19.95 / 0.1) * 0.1\n// 19.900000000000002\n// vs\n// Math.round(19.95 / 0.1) / (1 / 0.1)\n// 19.9\n//\nexport const stepify = (v, from, step) => Math.round(from(v) / step) / (1 / step);\n\nexport const euclideanModulo = (v, n) => ((v % n) + n) % n;\nexport const lerp = (a, b, t) => a + (b - a) * t;\nexport function copyExistingProperties(dst, src) {\n for (const key in src) {\n if (key in dst) {\n dst[key] = src[key];\n }\n }\n return dst;\n}\n\nexport const mapRange = (v, inMin, inMax, outMin, outMax) => (v - inMin) * (outMax - outMin) / (inMax - inMin) + outMin;\n\nexport const makeRangeConverters = ({from, to}) => {\n return {\n to: v => mapRange(v, ...from, ...to),\n from: v => [true, mapRange(v, ...to, ...from)],\n };\n};\n\nexport const makeRangeOptions = ({from, to, step}) => {\n return {\n min: to[0],\n max: to[1],\n ...(step && {step}),\n converters: makeRangeConverters({from, to}),\n };\n};\n\n// TODO: remove an use one in conversions. Move makeRangeConverters there?\nexport const identity = {\n to: v => v,\n from: v => [true, v],\n};\nexport function makeMinMaxPair(gui, properties, minPropName, maxPropName, options) {\n const { converters: { from } = identity } = options;\n const { min, max } = options;\n const guiMinRange = options.minRange || 0;\n const valueMinRange = from(guiMinRange)[1];\n const minGui = gui\n .add(properties, minPropName, {\n ...options,\n min,\n max: max - guiMinRange,\n })\n .onChange(v => {\n maxGui.setValue(Math.min(max, Math.max(v + valueMinRange, properties[maxPropName])));\n });\n const maxGui = gui\n .add(properties, maxPropName, {\n ...options,\n min: min + guiMinRange,\n max,\n })\n .onChange(v => {\n minGui.setValue(Math.max(min, Math.min(v - valueMinRange, properties[minPropName])));\n });\n return [ minGui, maxGui ];\n}\n\n","import { removeArrayElem } from '../libs/utils.js';\n\nexport default class View {\n domElement: HTMLElement;\n\n #childDestElem: HTMLElement;\n #views: View[] = [];\n\n constructor(elem: HTMLElement) {\n this.domElement = elem;\n this.#childDestElem = elem;\n }\n addElem(elem: HTMLElement) {\n this.#childDestElem.appendChild(elem);\n return elem;\n }\n removeElem(elem: HTMLElement) {\n this.#childDestElem.removeChild(elem);\n return elem;\n }\n pushSubElem(elem: HTMLElement) {\n this.#childDestElem.appendChild(elem);\n this.#childDestElem = elem;\n }\n popSubElem() {\n this.#childDestElem = this.#childDestElem.parentElement!;\n }\n add(view: View) {\n this.#views.push(view);\n this.addElem(view.domElement);\n return view;\n }\n remove(view: View) {\n this.removeElem(view.domElement);\n removeArrayElem(this.#views, view);\n return view;\n }\n pushSubView(view: View) {\n this.pushSubElem(view.domElement);\n }\n popSubView() {\n this.popSubElem();\n }\n setOptions(options: any) {\n for (const view of this.#views) {\n view.setOptions(options);\n }\n }\n updateDisplayIfNeeded(newV: any, ignoreCache?: boolean) {\n for (const view of this.#views) {\n view.updateDisplayIfNeeded(newV, ignoreCache);\n }\n return this;\n }\n $(selector: string) {\n return this.domElement.querySelector(selector);\n }\n}","import { createElem } from '../libs/elem.js';\nimport { removeArrayElem } from '../libs/utils.js';\nimport View from '../views/View.js';\n\nexport default class Controller extends View {\n #changeFns;\n #finishChangeFns;\n #parent;\n\n constructor(className) {\n super(createElem('div', {className: 'muigui-controller'}));\n this.#changeFns = [];\n this.#finishChangeFns = [];\n // we need the specialization to come last so it takes precedence.\n if (className) {\n this.domElement.classList.add(className);\n }\n }\n get parent() {\n return this.#parent;\n }\n setParent(parent) {\n this.#parent = parent;\n this.enable(!this.disabled());\n }\n show(show = true) {\n this.domElement.classList.toggle('muigui-hide', !show);\n this.domElement.classList.toggle('muigui-show', show);\n return this;\n }\n hide() {\n return this.show(false);\n }\n disabled() {\n return !!this.domElement.closest('.muigui-disabled');\n }\n\n enable(enable = true) {\n this.domElement.classList.toggle('muigui-disabled', !enable);\n\n // If disabled we need to set the attribute 'disabled=true' to all\n // input/select/button/textarea's below\n //\n // If enabled we need to set the attribute 'disabled=false' to all below\n // until we hit a disabled controller.\n //\n // ATM the problem is we can find the input/select/button/textarea elements\n // but we can't easily find which controller they belong do.\n // But we don't need to? We can just check up if it or parent has\n // '.muigui-disabled'\n ['input', 'button', 'select', 'textarea'].forEach(tag => {\n this.domElement.querySelectorAll(tag).forEach(elem => {\n const disabled = !!elem.closest('.muigui-disabled');\n elem.disabled = disabled;\n });\n });\n\n return this;\n }\n disable(disable = true) {\n return this.enable(!disable);\n }\n onChange(fn) {\n this.removeChange(fn);\n this.#changeFns.push(fn);\n return this;\n }\n removeChange(fn) {\n removeArrayElem(this.#changeFns, fn);\n return this;\n }\n onFinishChange(fn) {\n this.removeFinishChange(fn);\n this.#finishChangeFns.push(fn);\n return this;\n }\n removeFinishChange(fn) {\n removeArrayElem(this.#finishChangeFns, fn);\n return this;\n }\n #callListeners(fns, newV) {\n for (const fn of fns) {\n fn.call(this, newV);\n }\n }\n emitChange(value, object, property) {\n this.#callListeners(this.#changeFns, value);\n if (this.#parent) {\n if (object === undefined) {\n this.#parent.emitChange(value);\n } else {\n this.#parent.emitChange({\n object,\n property,\n value,\n controller: this,\n });\n }\n }\n }\n emitFinalChange(value, object, property) {\n this.#callListeners(this.#finishChangeFns, value);\n if (this.#parent) {\n if (object === undefined) {\n this.#parent.emitChange(value);\n } else {\n this.#parent.emitFinalChange({\n object,\n property,\n value,\n controller: this,\n });\n }\n }\n }\n updateDisplay() {\n // placeholder. override\n }\n getColors() {\n const toCamelCase = s => s.replace(/-([a-z])/g, (m, m1) => m1.toUpperCase());\n const keys = [\n 'color',\n 'bg-color',\n 'value-color',\n 'value-bg-color',\n 'hover-bg-color',\n 'menu-bg-color',\n 'menu-sep-color',\n 'disabled-color',\n ];\n const div = createElem('div');\n this.domElement.appendChild(div);\n const colors = Object.fromEntries(keys.map(key => {\n div.style.color = `var(--${key})`;\n const s = getComputedStyle(div);\n return [toCamelCase(key), s.color];\n }));\n div.remove();\n return colors;\n }\n}\n","import {\n createElem,\n} from '../libs/elem.js';\nimport { copyExistingProperties } from '../libs/utils.js';\nimport Controller from './Controller.js';\n\nexport default class Button extends Controller {\n #object;\n #property;\n #buttonElem;\n #options = {\n name: '',\n };\n\n constructor(object, property, options = {}) {\n super('muigui-button', '');\n this.#object = object;\n this.#property = property;\n\n this.#buttonElem = this.addElem(\n createElem('button', {\n type: 'button',\n onClick: () => {\n this.#object[this.#property](this);\n },\n }));\n this.setOptions({name: property, ...options});\n }\n name(name) {\n this.#buttonElem.textContent = name;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {name} = this.#options;\n this.#buttonElem.textContent = name;\n }\n}","import { isTypedArray } from '../libs/utils.js';\nimport View from './View.js';\n\nfunction arraysEqual(a, b) {\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; ++i) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n}\n\nfunction copyArrayElementsFromTo(src, dst) {\n dst.length = src.length;\n for (let i = 0; i < src.length; ++i) {\n dst[i] = src[i];\n }\n}\n\nexport default class EditView extends View {\n #oldV;\n #updateCheck;\n\n #checkArrayNeedsUpdate(newV) {\n // It's an array, we need to compare all elements\n // Example, vec2, [r,g,b], ...\n const needUpdate = !arraysEqual(newV, this.#oldV);\n if (needUpdate) {\n copyArrayElementsFromTo(newV, this.#oldV);\n }\n return needUpdate;\n }\n\n #checkTypedArrayNeedsUpdate() {\n let once = true;\n return function checkTypedArrayNeedsUpdateImpl(newV) {\n // It's a typedarray, we need to compare all elements\n // Example: Float32Array([r, g, b])\n let needUpdate = once;\n once = false;\n if (!needUpdate) {\n needUpdate = !arraysEqual(newV, this.#oldV);\n }\n return needUpdate;\n };\n }\n\n #checkObjectNeedsUpdate(newV) {\n let needUpdate = false;\n for (const key in newV) {\n if (newV[key] !== this.#oldV[key]) {\n needUpdate = true;\n this.#oldV[key] = newV[key];\n }\n }\n return needUpdate;\n }\n\n #checkValueNeedsUpdate(newV) {\n const needUpdate = newV !== this.#oldV;\n this.#oldV = newV;\n return needUpdate;\n }\n\n #getUpdateCheckForType(newV) {\n if (Array.isArray(newV)) {\n this.#oldV = [];\n return this.#checkArrayNeedsUpdate.bind(this);\n } else if (isTypedArray(newV)) {\n this.#oldV = new newV.constructor(newV);\n return this.#checkTypedArrayNeedsUpdate(this);\n } else if (typeof newV === 'object') {\n this.#oldV = {};\n return this.#checkObjectNeedsUpdate.bind(this);\n } else {\n return this.#checkValueNeedsUpdate.bind(this);\n }\n }\n\n // The point of this is updating DOM elements\n // is slow but if we've called `listen` then\n // every frame we're going to try to update\n // things with the current value so if nothing\n // has changed then skip it.\n updateDisplayIfNeeded(newV, ignoreCache) {\n this.#updateCheck = this.#updateCheck || this.#getUpdateCheckForType(newV);\n // Note: We call #updateCheck first because it updates\n // the cache\n if (this.#updateCheck(newV) || ignoreCache) {\n this.updateDisplay(newV);\n }\n }\n setOptions(/*options*/) {\n // override this\n return this;\n }\n}\n","import { createElem } from '../libs/elem.js';\nimport EditView from './EditView.js';\n\nexport default class CheckboxView extends EditView {\n #checkboxElem;\n constructor(setter, id) {\n const checkboxElem = createElem('input', {\n type: 'checkbox',\n id,\n onInput: () => {\n setter.setValue(checkboxElem.checked);\n },\n onChange: () => {\n setter.setFinalValue(checkboxElem.checked);\n },\n });\n super(createElem('label', {}, [checkboxElem]));\n this.#checkboxElem = checkboxElem;\n }\n updateDisplay(v) {\n this.#checkboxElem.checked = v;\n }\n}\n","import { removeArrayElem } from './utils.js';\n\nconst tasks = [];\nconst tasksToRemove = new Set();\n\nlet requestId;\nlet processing;\n\nfunction removeTasks() {\n if (!tasksToRemove.size) {\n return;\n }\n\n if (processing) {\n queueProcessing();\n return;\n }\n\n tasksToRemove.forEach(task => {\n removeArrayElem(tasks, task);\n });\n tasksToRemove.clear();\n}\n\nfunction processTasks() {\n requestId = undefined;\n processing = true;\n for (const task of tasks) {\n if (!tasksToRemove.has(task)) {\n task();\n }\n }\n processing = false;\n removeTasks();\n queueProcessing();\n}\n\nfunction queueProcessing() {\n if (!requestId && tasks.length) {\n requestId = requestAnimationFrame(processTasks);\n }\n}\n\nexport function addTask(fn) {\n tasks.push(fn);\n queueProcessing();\n}\n\nexport function removeTask(fn) {\n tasksToRemove.set(fn);\n\n const ndx = tasks.indexOf(fn);\n if (ndx >= 0) {\n tasks.splice(ndx, 1);\n }\n}","let id = 0;\n\nexport function makeId() {\n return `muigui-${++id}`;\n}\n","import { createElem } from '../libs/elem.js';\nimport View from './View.js';\n\nexport default class ValueView extends View {\n constructor(className = '') {\n super(createElem('div', {className: 'muigui-value'}));\n if (className) {\n this.domElement.classList.add(className);\n }\n }\n}","import { createElem } from '../libs/elem.js';\nimport { makeId } from '../libs/ids.js';\nimport ValueView from '../views/ValueView.js';\nimport Controller from './Controller.js';\n\nexport default class LabelController extends Controller {\n #id;\n #nameElem;\n\n constructor(className = '', name = '') {\n super('muigui-label-controller');\n this.#id = makeId();\n this.#nameElem = createElem('label', {for: this.#id});\n this.domElement.appendChild(this.#nameElem);\n this.pushSubView(new ValueView(className));\n this.name(name);\n }\n get id() {\n return this.#id;\n }\n name(name) {\n if (this.#nameElem.title === this.#nameElem.textContent) {\n this.#nameElem.title = name;\n }\n this.#nameElem.textContent = name;\n return this;\n }\n tooltip(tip) {\n this.#nameElem.title = tip;\n }\n}\n\n","import {addTask, removeTask} from '../libs/taskrunner.js';\nimport { isTypedArray } from '../libs/utils.js';\nimport LabelController from './LabelController.js';\n\nexport default class ValueController extends LabelController {\n #object;\n #property;\n #initialValue;\n #listening;\n #views;\n #updateFn;\n\n constructor(object, property, className = '') {\n super(className, property);\n this.#object = object;\n this.#property = property;\n this.#initialValue = this.getValue();\n this.#listening = false;\n this.#views = [];\n }\n get initialValue() {\n return this.#initialValue;\n }\n get object() {\n return this.#object;\n }\n get property() {\n return this.#property;\n }\n add(view) {\n this.#views.push(view);\n super.add(view);\n this.updateDisplay();\n return view;\n }\n #setValueImpl(v, ignoreCache) {\n let isDifferent = false;\n if (typeof v === 'object') {\n const dst = this.#object[this.#property];\n // don't replace objects, just their values.\n if (Array.isArray(v) || isTypedArray(v)) {\n for (let i = 0; i < v.length; ++i) {\n isDifferent ||= dst[i] !== v[i];\n dst[i] = v[i];\n }\n } else {\n for (const key of Object.keys(v)) {\n isDifferent ||= dst[key] !== v[key];\n }\n Object.assign(dst, v);\n }\n } else {\n isDifferent = this.#object[this.#property] !== v;\n this.#object[this.#property] = v;\n }\n this.updateDisplay(ignoreCache);\n if (isDifferent) {\n this.emitChange(this.getValue(), this.#object, this.#property);\n }\n return isDifferent;\n }\n setValue(v) {\n this.#setValueImpl(v);\n }\n setFinalValue(v) {\n const isDifferent = this.#setValueImpl(v, true);\n if (isDifferent) {\n this.emitFinalChange(this.getValue(), this.#object, this.#property);\n }\n return this;\n }\n updateDisplay(ignoreCache) {\n const newV = this.getValue();\n for (const view of this.#views) {\n view.updateDisplayIfNeeded(newV, ignoreCache);\n }\n return this;\n }\n setOptions(options) {\n for (const view of this.#views) {\n view.setOptions(options);\n }\n this.updateDisplay();\n return this;\n }\n getValue() {\n return this.#object[this.#property];\n }\n value(v) {\n this.setValue(v);\n return this;\n }\n reset() {\n this.setValue(this.#initialValue);\n return this;\n }\n listen(listen = true) {\n if (!this.#updateFn) {\n this.#updateFn = this.updateDisplay.bind(this);\n }\n if (listen) {\n if (!this.#listening) {\n this.#listening = true;\n addTask(this.#updateFn);\n }\n } else {\n if (this.#listening) {\n this.#listening = false;\n removeTask(this.#updateFn);\n }\n }\n return this;\n }\n}\n\n","import CheckboxView from '../views/CheckboxView.js';\nimport ValueController from './ValueController.js';\n\nexport default class Checkbox extends ValueController {\n constructor(object, property) {\n super(object, property, 'muigui-checkbox');\n const id = this.id;\n this.add(new CheckboxView(this, id));\n this.updateDisplay();\n }\n}","import {\n makeRangeConverters,\n} from './utils.js';\n\nexport const identity = {\n to: v => v,\n from: v => [true, v],\n};\n\n// from: from string to value\n// to: from value to string\nexport const strToNumber = {\n to: v => v.toString(),\n from: v => {\n const newV = parseFloat(v);\n return [!Number.isNaN(newV), newV];\n },\n};\n\nexport const converters = {\n radToDeg: makeRangeConverters({to: [0, 180], from: [0, Math.PI]}),\n};\n","export function createWheelHelper() {\n let wheelAccum = 0;\n return function (e, step, wheelScale = 5) {\n wheelAccum -= e.deltaY * step / wheelScale;\n const wheelSteps = Math.floor(Math.abs(wheelAccum) / step) * Math.sign(wheelAccum);\n const delta = wheelSteps * step;\n wheelAccum -= delta;\n return delta;\n };\n}\n","import { createElem } from '../libs/elem.js';\nimport { strToNumber } from '../libs/conversions.js';\nimport { createWheelHelper } from '../libs/wheel.js';\nimport { clamp, copyExistingProperties, stepify } from '../libs/utils.js';\nimport EditView from './EditView.js';\n\nexport default class NumberView extends EditView {\n #to;\n #from;\n #step;\n #skipUpdate;\n #options = {\n step: 0.01,\n converters: strToNumber,\n min: Number.NEGATIVE_INFINITY,\n max: Number.POSITIVE_INFINITY,\n };\n\n constructor(setter, options) {\n const setValue = setter.setValue.bind(setter);\n const setFinalValue = setter.setFinalValue.bind(setter);\n const wheelHelper = createWheelHelper();\n super(createElem('input', {\n type: 'number',\n onInput: () => {\n this.#handleInput(setValue, true);\n },\n onChange: () => {\n this.#handleInput(setFinalValue, false);\n },\n onWheel: e => {\n e.preventDefault();\n const {min, max, step} = this.#options;\n const delta = wheelHelper(e, step);\n const v = parseFloat(this.domElement.value);\n const newV = clamp(stepify(v + delta, v => v, step), min, max);\n const [valid, outV] = this.#from(newV);\n if (valid) {\n setter.setValue(outV);\n }\n },\n }));\n this.setOptions(options);\n }\n #handleInput(setFn, skipUpdate) {\n const v = parseFloat(this.domElement.value);\n const [valid, newV] = this.#from(v);\n let inRange;\n if (valid && !Number.isNaN(v)) {\n const {min, max} = this.#options;\n inRange = newV >= min && newV <= max;\n this.#skipUpdate = skipUpdate;\n setFn(clamp(newV, min, max));\n }\n this.domElement.classList.toggle('muigui-invalid-value', !valid || !inRange);\n }\n updateDisplay(v) {\n if (!this.#skipUpdate) {\n this.domElement.value = stepify(v, this.#to, this.#step);\n }\n this.#skipUpdate = false;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {\n step,\n converters: {to, from},\n } = this.#options;\n this.#to = to;\n this.#from = from;\n this.#step = step;\n return this;\n }\n}\n","\nimport NumberView from '../views/NumberView.js';\nimport ValueController from './ValueController.js';\n\n// Wanted to name this `Number` but it conflicts with\n// JavaScript `Number`. It most likely wouldn't be\n// an issue? But users might `import {Number} ...` and\n// things would break.\nexport default class TextNumber extends ValueController {\n #textView;\n #step;\n\n constructor(object, property, options = {}) {\n super(object, property, 'muigui-text-number');\n this.#textView = this.add(new NumberView(this, options));\n this.updateDisplay();\n }\n}","import { createElem } from '../libs/elem.js';\nimport EditView from './EditView.js';\n\nexport default class SelectView extends EditView {\n #values;\n\n constructor(setter, keyValues) {\n const values = [];\n super(createElem('select', {\n onChange: () => {\n setter.setFinalValue(this.#values[this.domElement.selectedIndex]);\n },\n }, keyValues.map(([key, value]) => {\n values.push(value);\n return createElem('option', {textContent: key});\n })));\n this.#values = values;\n }\n updateDisplay(v) {\n const ndx = this.#values.indexOf(v);\n this.domElement.selectedIndex = ndx;\n }\n}\n","\n// 4 cases\n// (a) keyValues is array of arrays, each sub array is key value\n// (b) keyValues is array and value is number then keys = array contents, value = index\n// (c) keyValues is array and value is not number, key = array contents, value = array contents\n// (d) keyValues is object then key->value\nexport function convertToKeyValues(keyValues, valueIsNumber) {\n if (Array.isArray(keyValues)) {\n if (Array.isArray(keyValues[0])) {\n // (a) keyValues is array of arrays, each sub array is key value\n return keyValues;\n } else {\n if (valueIsNumber) {\n // (b) keyValues is array and value is number then keys = array contents, value = index\n return keyValues.map((v, ndx) => [v, ndx]);\n } else {\n // (c) keyValues is array and value is not number, key = array contents, value = array contents\n return keyValues.map(v => [v, v]);\n }\n }\n } else {\n // (d)\n return [...Object.entries(keyValues)];\n }\n}\n","import SelectView from '../views/SelectView.js';\nimport ValueController from './ValueController.js';\nimport { convertToKeyValues } from '../libs/key-values.js';\n\nexport default class Select extends ValueController {\n constructor(object, property, options) {\n super(object, property, 'muigui-select');\n const valueIsNumber = typeof this.getValue() === 'number';\n const {keyValues: keyValuesInput} = options;\n const keyValues = convertToKeyValues(keyValuesInput, valueIsNumber);\n this.add(new SelectView(this, keyValues));\n this.updateDisplay();\n }\n}","import { createElem } from '../libs/elem.js';\nimport { identity } from '../libs/conversions.js';\nimport { clamp, copyExistingProperties, stepify } from '../libs/utils.js';\nimport { createWheelHelper } from '../libs/wheel.js';\nimport EditView from './EditView.js';\n\nexport default class RangeView extends EditView {\n #to;\n #from;\n #step;\n #skipUpdate;\n #options = {\n step: 0.01,\n min: 0,\n max: 1,\n converters: identity,\n };\n\n constructor(setter, options) {\n const wheelHelper = createWheelHelper();\n super(createElem('input', {\n type: 'range',\n onInput: () => {\n this.#skipUpdate = true;\n const {min, max, step} = this.#options;\n const v = parseFloat(this.domElement.value);\n const newV = clamp(stepify(v, v => v, step), min, max);\n const [valid, validV] = this.#from(newV);\n if (valid) {\n setter.setValue(validV);\n }\n },\n onChange: () => {\n this.#skipUpdate = true;\n const {min, max, step} = this.#options;\n const v = parseFloat(this.domElement.value);\n const newV = clamp(stepify(v, v => v, step), min, max);\n const [valid, validV] = this.#from(newV);\n if (valid) {\n setter.setFinalValue(validV);\n }\n },\n onWheel: e => {\n e.preventDefault();\n const [valid, v] = this.#from(parseFloat(this.domElement.value));\n if (!valid) {\n return;\n }\n const {min, max, step} = this.#options;\n const delta = wheelHelper(e, step);\n const newV = clamp(stepify(v + delta, v => v, step), min, max);\n setter.setValue(newV);\n },\n }));\n this.setOptions(options);\n }\n updateDisplay(v) {\n if (!this.#skipUpdate) {\n this.domElement.value = stepify(v, this.#to, this.#step);\n }\n this.#skipUpdate = false;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {\n step,\n min,\n max,\n converters: {to, from},\n } = this.#options;\n this.#to = to;\n this.#from = from;\n this.#step = step;\n this.domElement.step = step;\n this.domElement.min = min;\n this.domElement.max = max;\n return this;\n }\n}","import ValueController from './ValueController.js';\nimport NumberView from '../views/NumberView.js';\nimport RangeView from '../views/RangeView.js';\n\nexport default class Range extends ValueController {\n constructor(object, property, options) {\n super(object, property, 'muigui-range');\n this.add(new RangeView(this, options));\n this.add(new NumberView(this, options));\n }\n}\n","import { createElem } from '../libs/elem.js';\nimport { identity } from '../libs/conversions.js';\nimport EditView from './EditView.js';\nimport { copyExistingProperties } from '../libs/utils.js';\n\nexport default class TextView extends EditView {\n #to;\n #from;\n #skipUpdate;\n #options = {\n converters: identity,\n };\n\n constructor(setter, options) {\n const setValue = setter.setValue.bind(setter);\n const setFinalValue = setter.setFinalValue.bind(setter);\n super(createElem('input', {\n type: 'text',\n onInput: () => {\n this.#handleInput(setValue, true);\n },\n onChange: () => {\n this.#handleInput(setFinalValue, false);\n },\n }));\n this.setOptions(options);\n }\n #handleInput(setFn, skipUpdate) {\n const [valid, newV] = this.#from(this.domElement.value);\n if (valid) {\n this.#skipUpdate = skipUpdate;\n setFn(newV);\n }\n this.domElement.style.color = valid ? '' : 'var(--invalid-color)';\n\n }\n updateDisplay(v) {\n if (!this.#skipUpdate) {\n this.domElement.value = this.#to(v);\n this.domElement.style.color = '';\n }\n this.#skipUpdate = false;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {\n converters: {to, from},\n } = this.#options;\n this.#to = to;\n this.#from = from;\n return this;\n }\n}\n","import TextView from '../views/TextView.js';\nimport ValueController from './ValueController.js';\n\nexport default class Text extends ValueController {\n constructor(object, property) {\n super(object, property, 'muigui-text');\n this.add(new TextView(this));\n this.updateDisplay();\n }\n}","import Button from './Button.js';\nimport Checkbox from './Checkbox.js';\nimport TextNumber from './TextNumber.js';\nimport Select from './Select.js';\nimport Range from './Range.js';\nimport Text from './Text.js';\n\n// const isConversion = o => typeof o.to === 'function' && typeof o.from === 'function';\n\n/**\n * possible inputs\n * add(o, p, min: number, max: number)\n * add(o, p, min: number, max: number, step: number)\n * add(o, p, array: [value])\n * add(o, p, array: [[key, value]])\n *\n * @param {*} object\n * @param {string} property\n * @param {...any} args\n * @returns {Controller}\n */\nexport function createController(object, property, ...args) {\n const [arg1] = args;\n if (Array.isArray(arg1)) {\n return new Select(object, property, {keyValues: arg1});\n }\n if (arg1 && arg1.keyValues) {\n return new Select(object, property, {keyValues: arg1.keyValues});\n }\n\n const t = typeof object[property];\n switch (t) {\n case 'number':\n if (typeof args[0] === 'number' && typeof args[1] === 'number') {\n const min = args[0];\n const max = args[1];\n const step = args[2];\n return new Range(object, property, {min, max, ...(step && {step})});\n }\n return args.length === 0\n ? new TextNumber(object, property, ...args)\n : new Range(object, property, ...args);\n case 'boolean':\n return new Checkbox(object, property, ...args);\n case 'function':\n return new Button(object, property, ...args);\n case 'string':\n return new Text(object, property, ...args);\n case 'undefined':\n throw new Error(`no property named ${property}`);\n default:\n throw new Error(`unhandled type ${t} for property ${property}`);\n }\n}","const clamp = (v, min, max) => Math.max(min, Math.min(max, v));\nconst lerp = (a, b, t) => a + (b - a) * t;\nconst fract = v => v >= 0 ? v % 1 : 1 - (v % 1);\n\nconst f0 = v => +v.toFixed(0); // converts to string (eg 1.2 => \"1\"), then converts back to number (eg, \"1.200\" => 1.2)\nconst f3 = v => +v.toFixed(3); // converts to string (eg 1.2 => \"1.200\"), then converts back to number (eg, \"1.200\" => 1.2)\n\nconst hexToUint32RGB = v => (parseInt(v.substring(1, 3), 16) << 16) |\n (parseInt(v.substring(3, 5), 16) << 8 ) |\n (parseInt(v.substring(5, 7), 16) );\nconst uint32RGBToHex = v => `#${(Math.round(v)).toString(16).padStart(6, '0')}`;\nconst hexToUint32RGBA = v => (parseInt(v.substring(1, 3), 16) * 2 ** 24) +\n (parseInt(v.substring(3, 5), 16) * 2 ** 16) +\n (parseInt(v.substring(5, 7), 16) * 2 ** 8) +\n (parseInt(v.substring(7, 9), 16) );\nconst uint32RGBAToHex = v => `#${(Math.round(v)).toString(16).padStart(8, '0')}`;\n\nexport const hexToUint8RGB = v => [\n parseInt(v.substring(1, 3), 16),\n parseInt(v.substring(3, 5), 16),\n parseInt(v.substring(5, 7), 16),\n];\nexport const uint8RGBToHex = v => `#${Array.from(v).map(v => v.toString(16).padStart(2, '0')).join('')}`;\n\nexport const hexToUint8RGBA = v => [\n parseInt(v.substring(1, 3), 16),\n parseInt(v.substring(3, 5), 16),\n parseInt(v.substring(5, 7), 16),\n parseInt(v.substring(7, 9), 16),\n];\nexport const uint8RGBAToHex = v => `#${Array.from(v).map(v => v.toString(16).padStart(2, '0')).join('')}`;\n\nexport const hexToFloatRGB = v => hexToUint8RGB(v).map(v => f3(v / 255));\nexport const floatRGBToHex = v => uint8RGBToHex(Array.from(v).map(v => Math.round(clamp(v * 255, 0, 255))));\n\nexport const hexToFloatRGBA = v => hexToUint8RGBA(v).map(v => f3(v / 255));\nexport const floatRGBAToHex = v => uint8RGBAToHex(Array.from(v).map(v => Math.round(clamp(v * 255, 0, 255))));\n\nconst scaleAndClamp = v => clamp(Math.round(v * 255), 0, 255).toString(16).padStart(2, '0');\n\nconst hexToObjectRGB = v => ({\n r: parseInt(v.substring(1, 3), 16) / 255,\n g: parseInt(v.substring(3, 5), 16) / 255,\n b: parseInt(v.substring(5, 7), 16) / 255,\n});\nconst objectRGBToHex = v => `#${scaleAndClamp(v.r)}${scaleAndClamp(v.g)}${scaleAndClamp(v.b)}`;\nconst hexToObjectRGBA = v => ({\n r: parseInt(v.substring(1, 3), 16) / 255,\n g: parseInt(v.substring(3, 5), 16) / 255,\n b: parseInt(v.substring(5, 7), 16) / 255,\n a: parseInt(v.substring(7, 9), 16) / 255,\n});\nconst objectRGBAToHex = v => `#${scaleAndClamp(v.r)}${scaleAndClamp(v.g)}${scaleAndClamp(v.b)}${scaleAndClamp(v.a)}`;\n\nconst hexToCssRGB = v => `rgb(${hexToUint8RGB(v).join(', ')})`;\nconst cssRGBRegex = /^\\s*rgb\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*\\)\\s*$/;\nconst cssRGBToHex = v => {\n const m = cssRGBRegex.exec(v);\n return uint8RGBToHex([m[1], m[2], m[3]].map(v => parseInt(v)));\n};\nconst hexToCssRGBA = v => `rgba(${hexToUint8RGBA(v).map((v, i) => i === 3 ? v / 255 : v).join(', ')})`;\nconst cssRGBARegex = /^\\s*rgba\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+\\.\\d+|\\d+)\\s*\\)\\s*$/;\nconst cssRGBAToHex = v => {\n const m = cssRGBARegex.exec(v);\n return uint8RGBAToHex([m[1], m[2], m[3], m[4]].map((v, i) => i === 3 ? (parseFloat(v) * 255 | 0) : parseInt(v)));\n};\n\nconst hexToCssHSL = v => {\n const hsl = rgbUint8ToHsl(hexToUint8RGB(v)).map(v => f0(v));\n return `hsl(${hsl[0]}, ${hsl[1]}%, ${hsl[2]}%)`;\n};\nconst hexToCssHSLA = v => {\n const hsla = rgbaUint8ToHsla(hexToUint8RGBA(v)).map((v, i) => i === 3 ? f3(v) : f0(v));\n return `hsl(${hsla[0]} ${hsla[1]}% ${hsla[2]}% / ${hsla[3]})`;\n};\nconst cssHSLRegex = /^\\s*hsl\\(\\s*(\\d+)(?:deg|)\\s*(?:,|)\\s*(\\d+)%\\s*(?:,|)\\s*(\\d+)%\\s*\\)\\s*$/;\nconst cssHSLARegex = /^\\s*hsl\\(\\s*(\\d+)(?:deg|)\\s*(?:,|)\\s*(\\d+)%\\s*(?:,|)\\s*(\\d+)%\\s*\\/\\s*(\\d+\\.\\d+|\\d+)\\s*\\)\\s*$/;\n\nconst hex3DigitTo6Digit = v => `${v[0]}${v[0]}${v[1]}${v[1]}${v[2]}${v[2]}`;\nconst cssHSLToHex = v => {\n const m = cssHSLRegex.exec(v);\n const rgb = hslToRgbUint8([m[1], m[2], m[3]].map(v => parseFloat(v)));\n return uint8RGBToHex(rgb);\n};\nconst cssHSLAToHex = v => {\n const m = cssHSLARegex.exec(v);\n const rgba = hslaToRgbaUint8([m[1], m[2], m[3], m[4]].map(v => parseFloat(v)));\n return uint8RGBAToHex(rgba);\n};\n\nconst euclideanModulo = (v, n) => ((v % n) + n) % n;\n\nexport function hslToRgbUint8([h, s, l]) {\n h = euclideanModulo(h, 360);\n s = clamp(s / 100, 0, 1);\n l = clamp(l / 100, 0, 1);\n\n const a = s * Math.min(l, 1 - l);\n\n function f(n) {\n const k = (n + h / 30) % 12;\n return l - a * Math.max(-1, Math.min(k - 3, 9 - k, 1));\n }\n\n return [f(0), f(8), f(4)].map(v => Math.round(v * 255));\n}\n\nexport function hslaToRgbaUint8([h, s, l, a]) {\n const rgb = hslToRgbUint8([h, s, l]);\n return [...rgb, a * 255 | 0];\n}\n\nexport function rgbFloatToHsl01([r, g, b]) {\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const l = (min + max) * 0.5;\n const d = max - min;\n let h = 0;\n let s = 0;\n\n if (d !== 0) {\n s = (l === 0 || l === 1)\n ? 0\n : (max - l) / Math.min(l, 1 - l);\n\n switch (max) {\n case r: h = (g - b) / d + (g < b ? 6 : 0); break;\n case g: h = (b - r) / d + 2; break;\n case b: h = (r - g) / d + 4;\n }\n }\n\n return [h / 6, s, l];\n}\n\nexport function rgbaFloatToHsla01([r, g, b, a]) {\n const hsl = rgbFloatToHsl01([r, g, b]);\n return [...hsl, a];\n}\n\nexport const rgbUint8ToHsl = (rgb) => {\n const [h, s, l] = rgbFloatToHsl01(rgb.map(v => v / 255));\n return [h * 360, s * 100, l * 100];\n};\n\nexport const rgbaUint8ToHsla = (rgba) => {\n const [h, s, l, a] = rgbaFloatToHsla01(rgba.map(v => v / 255));\n return [h * 360, s * 100, l * 100, a];\n};\n\nexport function hsv01ToRGBFloat([hue, sat, val]) {\n sat = clamp(sat, 0, 1);\n val = clamp(val, 0, 1);\n return [hue, hue + 2 / 3, hue + 1 / 3].map(\n v => lerp(1, clamp(Math.abs(fract(v) * 6 - 3.0) - 1, 0, 1), sat) * val\n );\n}\n\nexport function hsva01ToRGBAFloat([hue, sat, val, alpha]) {\n const rgb = hsv01ToRGBFloat([hue, sat, val]);\n return [...rgb, alpha];\n}\n\nconst round3 = v => Math.round(v * 1000) / 1000;\n\nexport function rgbFloatToHSV01([r, g, b]) {\n const p = b > g\n ? [b, g, -1, 2 / 3]\n : [g, b, 0, -1 / 3];\n const q = p[0] > r\n ? [p[0], p[1], p[3], r]\n : [r, p[1], p[2], p[0]];\n const d = q[0] - Math.min(q[3], q[1]);\n return [\n Math.abs(q[2] + (q[3] - q[1]) / (6 * d + Number.EPSILON)),\n d / (q[0] + Number.EPSILON),\n q[0],\n ].map(round3);\n}\n\nexport function rgbaFloatToHSVA01([r, g, b, a]) {\n const hsv = rgbFloatToHSV01([r, g, b]);\n return [...hsv, a];\n}\n\n// window.hsv01ToRGBFloat = hsv01ToRGBFloat;\n// window.rgbFloatToHSV01 = rgbFloatToHSV01;\n\n// Yea, meh!\nexport const hasAlpha = format => format.endsWith('a') || format.startsWith('hex8');\n\nconst cssStringFormats = [\n { re: /^#(?:[0-9a-f]){6}$/i, format: 'hex6' },\n { re: /^(?:[0-9a-f]){6}$/i, format: 'hex6-no-hash' },\n { re: /^#(?:[0-9a-f]){8}$/i, format: 'hex8' },\n { re: /^(?:[0-9a-f]){8}$/i, format: 'hex8-no-hash' },\n { re: /^#(?:[0-9a-f]){3}$/i, format: 'hex3' },\n { re: /^(?:[0-9a-f]){3}$/i, format: 'hex3-no-hash' },\n { re: cssRGBRegex, format: 'css-rgb' },\n { re: cssHSLRegex, format: 'css-hsl' },\n { re: cssRGBARegex, format: 'css-rgba' },\n { re: cssHSLARegex, format: 'css-hsla' },\n];\n\nfunction guessStringColorFormat(v) {\n for (const formatInfo of cssStringFormats) {\n if (formatInfo.re.test(v)) {\n return formatInfo;\n }\n }\n return undefined;\n}\n\nexport function guessFormat(v) {\n switch (typeof v) {\n case 'number':\n console.warn('can not reliably guess format based on a number. You should pass in a format like {format: \"uint32-rgb\"} or {format: \"uint32-rgb\"}');\n return v <= 0xFFFFFF ? 'uint32-rgb' : 'uint32-rgba';\n case 'string': {\n const formatInfo = guessStringColorFormat(v.trim());\n if (formatInfo) {\n return formatInfo.format;\n }\n break;\n }\n case 'object':\n if (v instanceof Uint8Array || v instanceof Uint8ClampedArray) {\n if (v.length === 3) {\n return 'uint8-rgb';\n } else if (v.length === 4) {\n return 'uint8-rgba';\n }\n } else if (v instanceof Float32Array) {\n if (v.length === 3) {\n return 'float-rgb';\n } else if (v.length === 4) {\n return 'float-rgba';\n }\n } else if (Array.isArray(v)) {\n if (v.length === 3) {\n return 'float-rgb';\n } else if (v.length === 4) {\n return 'float-rgba';\n }\n } else {\n if ('r' in v && 'g' in v && 'b' in v) {\n if ('a' in v) {\n return 'object-rgba';\n } else {\n return 'object-rgb';\n }\n }\n }\n }\n throw new Error(`unknown color format: ${v}`);\n}\n\nfunction fixHex6(v) {\n return v.trim(v);\n //const formatInfo = guessStringColorFormat(v.trim());\n //const fix = formatInfo ? formatInfo.fix : v => v;\n //return fix(v.trim());\n}\n\nfunction fixHex8(v) {\n return v.trim(v);\n //const formatInfo = guessStringColorFormat(v.trim());\n //const fix = formatInfo ? formatInfo.fix : v => v;\n //return fix(v.trim());\n}\n\nfunction hex6ToHex3(hex6) {\n return (hex6[1] === hex6[2] &&\n hex6[3] === hex6[4] &&\n hex6[5] === hex6[6])\n ? `#${hex6[1]}${hex6[3]}${hex6[5]}`\n : hex6;\n}\n\nconst hex3RE = /^(#|)([0-9a-f]{3})$/i;\nfunction hex3ToHex6(hex3) {\n const m = hex3RE.exec(hex3);\n if (m) {\n const [, , m2] = m;\n return `#${hex3DigitTo6Digit(m2)}`;\n }\n return hex3;\n}\n\nfunction fixHex3(v) {\n return hex6ToHex3(fixHex6(v));\n}\n\nconst strToRGBObject = (s) => {\n try {\n const json = s.replace(/([a-z])/g, '\"$1\"');\n const rgb = JSON.parse(json);\n if (Number.isNaN(rgb.r) || Number.isNaN(rgb.g) || Number.isNaN(rgb.b)) {\n throw new Error('not {r, g, b}');\n }\n return [true, rgb];\n } catch (e) {\n return [false];\n }\n};\n\nconst strToRGBAObject = (s) => {\n try {\n const json = s.replace(/([a-z])/g, '\"$1\"');\n const rgba = JSON.parse(json);\n if (Number.isNaN(rgba.r) || Number.isNaN(rgba.g) || Number.isNaN(rgba.b) || Number.isNaN(rgba.a)) {\n throw new Error('not {r, g, b, a}');\n }\n return [true, rgba];\n } catch (e) {\n return [false];\n }\n};\n\nconst strToCssRGB = s => {\n const m = cssRGBRegex.exec(s);\n if (!m) {\n return [false];\n }\n const v = [m[1], m[2], m[3]].map(v => parseInt(v));\n const outOfRange = v.find(v => v > 255);\n return [!outOfRange, `rgb(${v.join(', ')})`];\n};\n\nconst strToCssRGBA = s => {\n const m = cssRGBARegex.exec(s);\n if (!m) {\n return [false];\n }\n const v = [m[1], m[2], m[3], m[4]].map((v, i) => i === 3 ? parseFloat(v) : parseInt(v));\n const outOfRange = v.find(v => v > 255);\n return [!outOfRange, `rgba(${v.join(', ')})`];\n};\n\nconst strToCssHSL = s => {\n const m = cssHSLRegex.exec(s);\n if (!m) {\n return [false];\n }\n const v = [m[1], m[2], m[3]].map(v => parseFloat(v));\n const outOfRange = v.find(v => Number.isNaN(v));\n return [!outOfRange, `hsl(${v[0]}, ${v[1]}%, ${v[2]}%)`];\n};\n\nconst strToCssHSLA = s => {\n const m = cssHSLARegex.exec(s);\n if (!m) {\n return [false];\n }\n const v = [m[1], m[2], m[3], m[4]].map(v => parseFloat(v));\n const outOfRange = v.find(v => Number.isNaN(v));\n return [!outOfRange, `hsl(${v[0]} ${v[1]}% ${v[2]}% / ${v[3]})`];\n};\n\nconst rgbObjectToStr = rgb => {\n return `{r:${f3(rgb.r)}, g:${f3(rgb.g)}, b:${f3(rgb.b)}}`;\n};\nconst rgbaObjectToStr = rgba => {\n return `{r:${f3(rgba.r)}, g:${f3(rgba.g)}, b:${f3(rgba.b)}}, a:${f3(rgba.a)}}`;\n};\n\nconst strTo3IntsRE = /^\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*$/;\nconst strTo3Ints = s => {\n const m = strTo3IntsRE.exec(s);\n if (!m) {\n return [false];\n }\n const v = [m[1], m[2], m[3]].map(v => parseInt(v));\n const outOfRange = v.find(v => v > 255);\n return [!outOfRange, v];\n};\n\nconst strTo4IntsRE = /^\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*$/;\nconst strTo4Ints = s => {\n const m = strTo4IntsRE.exec(s);\n if (!m) {\n return [false];\n }\n const v = [m[1], m[2], m[3], m[4]].map(v => parseInt(v));\n const outOfRange = v.find(v => v > 255);\n return [!outOfRange, v];\n};\n\nconst strTo3Floats = s => {\n const numbers = s.split(',').map(s => s.trim());\n const v = numbers.map(v => parseFloat(v));\n if (v.length !== 3) {\n return [false];\n }\n // Note: using isNaN not Number.isNaN\n const badNdx = numbers.findIndex(v => isNaN(v));\n return [badNdx < 0, v.map(v => f3(v))];\n};\n\nconst strTo4Floats = s => {\n const numbers = s.split(',').map(s => s.trim());\n const v = numbers.map(v => parseFloat(v));\n if (v.length !== 4) {\n return [false];\n }\n // Note: using isNaN not Number.isNaN\n const badNdx = numbers.findIndex(v => isNaN(v));\n return [badNdx < 0, v.map(v => f3(v))];\n};\n\nconst strToUint32RGBRegex = /^\\s*(?:0x){0,1}([0-9a-z]{1,6})\\s*$/i;\nconst strToUint32RGB = s => {\n const m = strToUint32RGBRegex.exec(s);\n if (!m) {\n return [false];\n }\n return [true, parseInt(m[1], 16)];\n};\n\nconst strToUint32RGBARegex = /^\\s*(?:0x){0,1}([0-9a-z]{1,8})\\s*$/i;\nconst strToUint32RGBA = s => {\n const m = strToUint32RGBARegex.exec(s);\n if (!m) {\n return [false];\n }\n return [true, parseInt(m[1], 16)];\n};\n\nconst hex6RE = /^\\s*#[a-f0-9]{6}\\s*$|^\\s*#[a-f0-9]{3}\\s*$/i;\nconst hexNoHash6RE = /^\\s*[a-f0-9]{6}\\s*$/i;\nconst hex8RE = /^\\s*#[a-f0-9]{8}\\s*$/i;\nconst hexNoHash8RE = /^\\s*[a-f0-9]{8}\\s*$/i;\n\n// For each format converter\n//\n// fromHex/toHex convert from/to '#RRGGBB'\n//\n// fromHex converts from the string '#RRBBGG' to the format\n// (eg: for uint32-rgb, '#123456' becomes 0x123456)\n//\n// toHex converts from the format to '#RRGGBB'\n// (eg: for uint8-rgb, [16, 33, 50] becomes '#102132')\n//\n//\n// fromStr/toStr convert from/to what's in the input[type=text] element\n//\n// toStr converts from the format to its string representation\n// (eg, for object-rgb, {r: 1, g: 0.5, b:0} becomes \"{r: 1, g: 0.5, b:0}\")\n// ^object ^string\n//\n// fromStr converts its string representation to its format\n// (eg, for object-rgb) \"{r: 1, g: 0.5, b:0}\" becomes {r: 1, g: 0.5, b:0})\n// ^string ^object\n// fromString returns an array which is [valid, v]\n// where valid is true if the string was a valid and v is the converted\n// format if v is true.\n//\n// Note: toStr should convert to \"ideal\" form (whatever that is).\n// (eg, for css-rgb\n// \"{ r: 0.10000, g: 001, b: 0}\" becomes \"{r: 0.1, g: 1, b: 0}\"\n// notice that css-rgb is a string to a string\n// )\nexport const colorFormatConverters = {\n 'hex6': {\n color: {\n from: v => [true, v],\n to: fixHex6,\n },\n text: {\n from: v => [hex6RE.test(v), v.trim()],\n to: v => v,\n },\n },\n 'hex8': {\n color: {\n from: v => [true, v],\n to: fixHex8,\n },\n text: {\n from: v => [hex8RE.test(v), v.trim()],\n to: v => v,\n },\n },\n 'hex3': {\n color: {\n from: v => [true, fixHex3(v)],\n to: hex3ToHex6,\n },\n text: {\n from: v => [hex6RE.test(v), hex6ToHex3(v.trim())],\n to: v => v,\n },\n },\n 'hex6-no-hash': {\n color: {\n from: v => [true, v.substring(1)],\n to: v => `#${fixHex6(v)}`,\n },\n text: {\n from: v => [hexNoHash6RE.test(v), v.trim()],\n to: v => v,\n },\n },\n 'hex8-no-hash': {\n color: {\n from: v => [true, v.substring(1)],\n to: v => `#${fixHex8(v)}`,\n },\n text: {\n from: v => [hexNoHash8RE.test(v), v.trim()],\n to: v => v,\n },\n },\n 'hex3-no-hash': {\n color: {\n from: v => [true, fixHex3(v).substring(1)],\n to: hex3ToHex6,\n },\n text: {\n from: v => [hexNoHash6RE.test(v), hex6ToHex3(v.trim())],\n to: v => v,\n },\n },\n 'uint32-rgb': {\n color: {\n from: v => [true, hexToUint32RGB(v)],\n to: uint32RGBToHex,\n },\n text: {\n from: v => strToUint32RGB(v),\n to: v => `0x${v.toString(16).padStart(6, '0')}`,\n },\n },\n 'uint32-rgba': {\n color: {\n from: v => [true, hexToUint32RGBA(v)],\n to: uint32RGBAToHex,\n },\n text: {\n from: v => strToUint32RGBA(v),\n to: v => `0x${v.toString(16).padStart(8, '0')}`,\n },\n },\n 'uint8-rgb': {\n color: {\n from: v => [true, hexToUint8RGB(v)],\n to: uint8RGBToHex,\n },\n text: {\n from: strTo3Ints,\n to: v => v.join(', '),\n },\n },\n 'uint8-rgba': {\n color: {\n from: v => [true, hexToUint8RGBA(v)],\n to: uint8RGBAToHex,\n },\n text: {\n from: strTo4Ints,\n to: v => v.join(', '),\n },\n },\n 'float-rgb': {\n color: {\n from: v => [true, hexToFloatRGB(v)],\n to: floatRGBToHex,\n },\n text: {\n from: strTo3Floats,\n // need Array.from because map of Float32Array makes a Float32Array\n to: v => Array.from(v).map(v => f3(v)).join(', '),\n },\n },\n 'float-rgba': {\n color: {\n from: v => [true, hexToFloatRGBA(v)],\n to: floatRGBAToHex,\n },\n text: {\n from: strTo4Floats,\n // need Array.from because map of Float32Array makes a Float32Array\n to: v => Array.from(v).map(v => f3(v)).join(', '),\n },\n },\n 'float-hsv': {\n color: {\n from: v => [true, rgbFloatToHSV01(hexToFloatRGB(v))],\n to: v => hsv01ToRGBFloat(floatRGBToHex(v)),\n },\n text: {\n from: strTo3Floats,\n // need Array.from because map of Float32Array makes a Float32Array\n to: v => Array.from(v).map(v => f3(v)).join(', '),\n },\n },\n 'float-hsva': {\n color: {\n from: v => [true, rgbaFloatToHSVA01(hexToFloatRGB(v))],\n to: v => hsva01ToRGBAFloat(floatRGBToHex(v)),\n },\n text: {\n from: strTo4Floats,\n // need Array.from because map of Float32Array makes a Float32Array\n to: v => Array.from(v).map(v => f3(v)).join(', '),\n },\n },\n //'float-hsl': {\n // color: {\n // from: v => [true, rgbFloatToHsl01(hexToFloatRGB(v))],\n // to: v => hsl01ToRGBFloat(floatRGBToHex(v)),\n // },\n // text: {\n // from: strTo3Floats,\n // // need Array.from because map of Float32Array makes a Float32Array\n // to: v => Array.from(v).map(v => f3(v)).join(', '),\n // },\n //},\n //'float-hsla': {\n // color: {\n // from: v => [true, hexToFloatRGBA(v)],\n // to: floatRGBAToHex,\n // },\n // text: {\n // from: strTo4Floats,\n // // need Array.from because map of Float32Array makes a Float32Array\n // to: v => Array.from(v).map(v => f3(v)).join(', '),\n // },\n //},\n 'object-rgb': {\n color: {\n from: v => [true, hexToObjectRGB(v)],\n to: objectRGBToHex,\n },\n text: {\n from: strToRGBObject,\n to: rgbObjectToStr,\n },\n },\n 'object-rgba': {\n color: {\n from: v => [true, hexToObjectRGBA(v)],\n to: objectRGBAToHex,\n },\n text: {\n from: strToRGBAObject,\n to: rgbaObjectToStr,\n },\n },\n 'css-rgb': {\n color: {\n from: v => [true, hexToCssRGB(v)],\n to: cssRGBToHex,\n },\n text: {\n from: strToCssRGB,\n to: v => strToCssRGB(v)[1],\n },\n },\n 'css-rgba': {\n color: {\n from: v => [true, hexToCssRGBA(v)],\n to: cssRGBAToHex,\n },\n text: {\n from: strToCssRGBA,\n to: v => strToCssRGBA(v)[1],\n },\n },\n 'css-hsl': {\n color: {\n from: v => [true, hexToCssHSL(v)],\n to: cssHSLToHex,\n },\n text: {\n from: strToCssHSL,\n to: v => strToCssHSL(v)[1],\n },\n },\n 'css-hsla': {\n color: {\n from: v => [true, hexToCssHSLA(v)],\n to: cssHSLAToHex,\n },\n text: {\n from: strToCssHSLA,\n to: v => strToCssHSLA(v)[1],\n },\n },\n};","import { createElem } from '../libs/elem.js';\nimport View from './View.js';\n\nexport default class ElementView extends View {\n constructor(tag, className) {\n super(createElem(tag, {className}));\n }\n}","import ElementView from '../views/ElementView.js';\nimport LabelController from './LabelController.js';\n\n// TODO: remove this? Should just be user side\nexport default class Canvas extends LabelController {\n #canvasElem;\n\n constructor(name) {\n super('muigui-canvas', name);\n this.#canvasElem = this.add(\n new ElementView('canvas', 'muigui-canvas'),\n ).domElement;\n }\n get canvas() {\n return this.#canvasElem;\n }\n}","import { createElem } from '../libs/elem.js';\nimport { identity } from '../libs/conversions.js';\nimport EditView from './EditView.js';\nimport { copyExistingProperties } from '../libs/utils.js';\n\nexport default class ColorView extends EditView {\n #to;\n #from;\n #colorElem;\n #skipUpdate;\n #options = {\n converters: identity,\n };\n\n constructor(setter, options) {\n const colorElem = createElem('input', {\n type: 'color',\n onInput: () => {\n const [valid, newV] = this.#from(colorElem.value);\n if (valid) {\n this.#skipUpdate = true;\n setter.setValue(newV);\n }\n },\n onChange: () => {\n const [valid, newV] = this.#from(colorElem.value);\n if (valid) {\n this.#skipUpdate = true;\n setter.setFinalValue(newV);\n }\n },\n });\n super(createElem('div', {}, [colorElem]));\n this.setOptions(options);\n this.#colorElem = colorElem;\n }\n updateDisplay(v) {\n if (!this.#skipUpdate) {\n this.#colorElem.value = this.#to(v);\n }\n this.#skipUpdate = false;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {converters: {to, from}} = this.#options;\n this.#to = to;\n this.#from = from;\n return this;\n }\n}\n","import {\n colorFormatConverters,\n guessFormat,\n} from '../libs/color-utils.js';\nimport ValueController from './ValueController.js';\nimport TextView from '../views/TextView.js';\nimport ColorView from '../views/ColorView.js';\n\nexport default class Color extends ValueController {\n #colorView;\n #textView;\n\n constructor(object, property, options = {}) {\n super(object, property, 'muigui-color');\n const format = options.format || guessFormat(this.getValue());\n const {color, text} = colorFormatConverters[format];\n this.#colorView = this.add(new ColorView(this, {converters: color}));\n this.#textView = this.add(new TextView(this, {converters: text}));\n this.updateDisplay();\n }\n setOptions(options) {\n const {format} = options;\n if (format) {\n const {color, text} = colorFormatConverters[format];\n this.#colorView.setOptions({converters: color});\n this.#textView.setOptions({converters: text});\n }\n super.setOptions(options);\n return this;\n }\n}","import Controller from './Controller.js';\n\n// This feels like it should be something else like\n// gui.addController({className: 'muigui-divider')};\nexport default class Divider extends Controller {\n constructor() {\n super('muigui-divider');\n }\n}","import Controller from './Controller.js';\n\nexport default class Container extends Controller {\n #controllers;\n #childDestController;\n\n constructor(className) {\n super(className);\n this.#controllers = [];\n this.#childDestController = this;\n }\n get children() {\n return this.#controllers; // should we return a copy?\n }\n get controllers() {\n return this.#controllers.filter(c => !(c instanceof Container));\n }\n get folders() {\n return this.#controllers.filter(c => c instanceof Container);\n }\n reset(recursive = true) {\n for (const controller of this.#controllers) {\n if (!(controller instanceof Container) || recursive) {\n controller.reset(recursive);\n }\n }\n return this;\n }\n updateDisplay() {\n for (const controller of this.#controllers) {\n controller.updateDisplay();\n }\n return this;\n }\n remove(controller) {\n const ndx = this.#controllers.indexOf(controller);\n if (ndx >= 0) {\n const c = this.#controllers.splice(ndx, 1);\n const c0 = c[0];\n const elem = c0.domElement;\n elem.remove();\n c0.setParent(null);\n }\n return this;\n }\n #addControllerImpl(controller) {\n this.domElement.appendChild(controller.domElement);\n this.#controllers.push(controller);\n controller.setParent(this);\n return controller;\n }\n addController(controller) {\n return this.#childDestController.#addControllerImpl(controller);\n }\n pushContainer(container) {\n this.addController(container);\n this.#childDestController = container;\n return container;\n }\n popContainer() {\n this.#childDestController = this.#childDestController.parent;\n return this;\n }\n}\n","import { createElem } from '../libs/elem.js';\nimport Container from './Container.js';\n\nexport default class Folder extends Container {\n #labelElem;\n\n constructor(name = 'Controls', className = 'muigui-menu') {\n super(className);\n this.#labelElem = createElem('label');\n this.addElem(createElem('button', {\n type: 'button',\n onClick: () => this.toggleOpen(),\n }, [this.#labelElem]));\n this.pushContainer(new Container('muigui-open-container'));\n this.pushContainer(new Container());\n this.name(name);\n this.open();\n }\n open(open = true) {\n this.domElement.classList.toggle('muigui-closed', !open);\n this.domElement.classList.toggle('muigui-open', open);\n return this;\n }\n close() {\n return this.open(false);\n }\n name(name) {\n this.#labelElem.textContent = name;\n return this;\n }\n title(title) {\n return this.name(title);\n }\n toggleOpen() {\n this.open(!this.domElement.classList.contains('muigui-open'));\n return this;\n }\n}\n","import Controller from './Controller.js';\n\n// This feels like it should be something else like\n// gui.addDividing = new Controller()\nexport default class Label extends Controller {\n constructor(text) {\n super('muigui-label');\n this.text(text);\n }\n text(text) {\n this.domElement.textContent = text;\n return this;\n }\n}","function noop() {\n}\n\nexport function computeRelativePosition(elem, event, start) {\n const rect = elem.getBoundingClientRect();\n const x = event.clientX - rect.left;\n const y = event.clientY - rect.top;\n const nx = x / rect.width;\n const ny = y / rect.height;\n start = start || [x, y];\n const dx = x - start[0];\n const dy = y - start[1];\n const ndx = dx / rect.width;\n const ndy = dy / rect.width;\n return {x, y, nx, ny, dx, dy, ndx, ndy};\n}\n\nexport function addTouchEvents(elem, {onDown = noop, onMove = noop, onUp = noop}) {\n let start;\n const pointerMove = function (event) {\n const e = {\n type: 'move',\n ...computeRelativePosition(elem, event, start),\n };\n onMove(e);\n };\n\n const pointerUp = function (event) {\n elem.releasePointerCapture(event.pointerId);\n elem.removeEventListener('pointermove', pointerMove);\n elem.removeEventListener('pointerup', pointerUp);\n\n document.body.style.backgroundColor = '';\n\n onUp('up');\n };\n\n const pointerDown = function (event) {\n elem.addEventListener('pointermove', pointerMove);\n elem.addEventListener('pointerup', pointerUp);\n elem.setPointerCapture(event.pointerId);\n\n const rel = computeRelativePosition(elem, event);\n start = [rel.x, rel.y];\n onDown({\n type: 'down',\n ...rel,\n });\n };\n\n elem.addEventListener('pointerdown', pointerDown);\n\n return function () {\n elem.removeEventListener('pointerdown', pointerDown);\n };\n}","import { createElem, getNewId } from '../libs/elem.js';\nimport { addTouchEvents } from '../libs/touch.js';\nimport { identity } from '../libs/conversions.js';\nimport { clamp } from '../libs/utils.js';\nimport EditView from './EditView.js';\nimport {\n hexToFloatRGB,\n hexToFloatRGBA,\n hsv01ToRGBFloat,\n hsva01ToRGBAFloat,\n rgbFloatToHSV01,\n rgbaFloatToHSVA01,\n floatRGBToHex,\n floatRGBAToHex,\n rgbaFloatToHsla01,\n} from '../libs/color-utils.js';\nimport { copyExistingProperties } from '../libs/utils.js';\n\nconst svg = `\n\n \n \n \n \n \n \n \n \n\n \n \n \n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n \n \n \n \n \n \n \n \n\n`;\n\nfunction connectFillTargets(elem) {\n elem.querySelectorAll('[data-src]').forEach(srcElem => {\n const id = getNewId();\n srcElem.id = id;\n elem.querySelectorAll(`[data-target=${srcElem.dataset.src}]`).forEach(targetElem => {\n targetElem.setAttribute('fill', `url(#${id})`);\n });\n });\n return elem;\n}\n\n// Was originally going to make alpha an option. Issue is\n// hard coded conversions?\nexport default class ColorChooserView extends EditView {\n #to;\n #from;\n #satLevelElem;\n #circleElem;\n #hueUIElem;\n #hueElem;\n #hueCursorElem;\n #alphaUIElem;\n #alphaElem;\n #alphaCursorElem;\n #hsva;\n #skipHueUpdate;\n #skipSatLevelUpdate;\n #skipAlphaUpdate;\n #options = {\n converters: identity,\n alpha: false,\n };\n #convertInternalToHex;\n #convertHexToInternal;\n\n constructor(setter, options) {\n super(createElem('div', {\n innerHTML: svg,\n className: 'muigui-no-scroll',\n }));\n this.#satLevelElem = this.domElement.children[0];\n this.#hueUIElem = this.domElement.children[1];\n this.#alphaUIElem = this.domElement.children[2];\n connectFillTargets(this.#satLevelElem);\n connectFillTargets(this.#hueUIElem);\n connectFillTargets(this.#alphaUIElem);\n this.#circleElem = this.$('.muigui-color-chooser-circle');\n this.#hueElem = this.$('[data-src=muigui-color-chooser-hue]');\n this.#hueCursorElem = this.$('.muigui-color-chooser-hue-cursor');\n this.#alphaElem = this.$('[data-src=muigui-color-chooser-alpha]');\n this.#alphaCursorElem = this.$('.muigui-color-chooser-alpha-cursor');\n\n const handleSatLevelChange = (e) => {\n const s = clamp(e.nx, 0, 1);\n const v = clamp(e.ny, 0, 1);\n this.#hsva[1] = s;\n this.#hsva[2] = (1 - v);\n this.#skipHueUpdate = true;\n this.#skipAlphaUpdate = true;\n const [valid, newV] = this.#from(this.#convertInternalToHex(this.#hsva));\n if (valid) {\n setter.setValue(newV);\n }\n };\n\n const handleHueChange = (e) => {\n const h = clamp(e.nx, 0, 1);\n this.#hsva[0] = h;\n this.#skipSatLevelUpdate = true;\n this.#skipAlphaUpdate = true;\n const [valid, newV] = this.#from(this.#convertInternalToHex(this.#hsva));\n if (valid) {\n setter.setValue(newV);\n }\n };\n\n const handleAlphaChange = (e) => {\n const a = clamp(e.nx, 0, 1);\n this.#hsva[3] = a;\n this.#skipHueUpdate = true;\n this.#skipSatLevelUpdate = true;\n const [valid, newV] = this.#from(this.#convertInternalToHex(this.#hsva));\n if (valid) {\n setter.setValue(newV);\n }\n };\n\n addTouchEvents(this.#satLevelElem, {\n onDown: handleSatLevelChange,\n onMove: handleSatLevelChange,\n });\n addTouchEvents(this.#hueUIElem, {\n onDown: handleHueChange,\n onMove: handleHueChange,\n });\n addTouchEvents(this.#alphaUIElem, {\n onDown: handleAlphaChange,\n onMove: handleAlphaChange,\n });\n this.setOptions(options);\n }\n updateDisplay(newV) {\n if (!this.#hsva) {\n this.#hsva = this.#convertHexToInternal(this.#to(newV));\n }\n {\n const [h, s, v, a = 1] = this.#convertHexToInternal(this.#to(newV));\n // Don't copy the hue if it was un-computable.\n if (!this.#skipHueUpdate) {\n this.#hsva[0] = s > 0.001 && v > 0.001 ? h : this.#hsva[0];\n }\n if (!this.#skipSatLevelUpdate) {\n this.#hsva[1] = s;\n this.#hsva[2] = v;\n }\n if (!this.#skipAlphaUpdate) {\n this.#hsva[3] = a;\n }\n }\n {\n const [h, s, v, a] = this.#hsva;\n const [hue, sat, lum] = rgbaFloatToHsla01(hsva01ToRGBAFloat(this.#hsva));\n\n if (!this.#skipHueUpdate) {\n this.#hueCursorElem.setAttribute('transform', `translate(${h * 64}, 0)`);\n }\n this.#hueElem.children[0].setAttribute('stop-color', `hsl(${hue * 360} 0% 100% / ${a})`);\n this.#hueElem.children[1].setAttribute('stop-color', `hsl(${hue * 360} 100% 50% / ${a})`);\n if (!this.#skipAlphaUpdate) {\n this.#alphaCursorElem.setAttribute('transform', `translate(${a * 64}, 0)`);\n }\n this.#alphaElem.children[0].setAttribute('stop-color', `hsl(${hue * 360} ${sat * 100}% ${lum * 100}% / 0)`);\n this.#alphaElem.children[1].setAttribute('stop-color', `hsl(${hue * 360} ${sat * 100}% ${lum * 100}% / 1)`);\n\n if (!this.#skipSatLevelUpdate) {\n this.#circleElem.setAttribute('cx', `${s * 64}`);\n this.#circleElem.setAttribute('cy', `${(1 - v) * 48}`);\n }\n }\n this.#skipHueUpdate = false;\n this.#skipSatLevelUpdate = false;\n this.#skipAlphaUpdate = false;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {converters: {to, from}, alpha} = this.#options;\n this.#alphaUIElem.style.display = alpha ? '' : 'none';\n this.#convertInternalToHex = alpha\n ? v => floatRGBAToHex(hsva01ToRGBAFloat(v))\n : v => floatRGBToHex(hsv01ToRGBFloat(v));\n this.#convertHexToInternal = alpha\n ? v => rgbaFloatToHSVA01(hexToFloatRGBA(v))\n : v => rgbFloatToHSV01(hexToFloatRGB(v));\n this.#to = to;\n this.#from = from;\n return this;\n }\n}\n","import ElementView from '../views/ElementView.js';\nimport ValueController from './ValueController.js';\nimport { copyExistingProperties } from '../libs/utils.js';\nimport { createElem } from '../libs/elem.js';\n/*\n\nholder = new TabHolder\ntab = holder.add(new Tab(\"name\"))\ntab.add(...)\n\n\npc = new PopdownController\ntop = pc.add(new Row())\ntop.add(new Button());\nvalues = topRow.add(new Div())\nbottom = pc.add(new Row());\n\n\n\npc = new PopdownController\npc.addTop\npc.addTop\n\npc.addBottom\n\n\n*/\n\nexport default class PopDownController extends ValueController {\n #top;\n #valuesView;\n #checkboxElem;\n #bottom;\n #options = {\n open: false,\n };\n\n constructor(object, property, options = {}) {\n super(object, property, 'muigui-pop-down-controller');\n /*\n [ValueView\n [[B][values]] upper row\n [[ visual ]] lower row\n ]\n */\n this.#top = this.add(new ElementView('div', 'muigui-pop-down-top'));\n// this.#top.add(new CheckboxView(makeSetter(this.#options, 'open')));\n const checkboxElem = this.#top.addElem(createElem('input', {\n type: 'checkbox',\n onChange: () => {\n this.#options.open = checkboxElem.checked;\n this.updateDisplay();\n },\n }));\n this.#checkboxElem = checkboxElem;\n this.#valuesView = this.#top.add(new ElementView('div', 'muigui-pop-down-values'));\n const container = new ElementView('div', 'muigui-pop-down-bottom muigui-open-container');\n this.#bottom = new ElementView('div');\n container.add(this.#bottom);\n this.add(container);\n this.setOptions(options);\n }\n setKnobColor(bgCssColor/*, fgCssColor*/) {\n if (this.#checkboxElem) {\n this.#checkboxElem.style = `\n --range-color: ${bgCssColor};\n --value-bg-color: ${bgCssColor};\n `;\n }\n }\n updateDisplay() {\n super.updateDisplay();\n const {open} = this.#options;\n this.domElement.children[1].classList.toggle('muigui-open', open);\n this.domElement.children[1].classList.toggle('muigui-closed', !open);\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n super.setOptions(options);\n this.updateDisplay();\n }\n addTop(view) {\n return this.#valuesView.add(view);\n }\n addBottom(view) {\n return this.#bottom.add(view);\n }\n}","/* eslint-disable no-underscore-dangle */\nimport {\n colorFormatConverters,\n guessFormat,\n hasAlpha,\n hexToUint8RGB,\n hslToRgbUint8,\n rgbUint8ToHsl,\n uint8RGBToHex,\n} from '../libs/color-utils.js';\nimport ColorChooserView from '../views/ColorChooserView.js';\nimport TextView from '../views/TextView.js';\nimport PopDownController from './PopDownController.js';\n\nexport default class ColorChooser extends PopDownController {\n #colorView;\n #textView;\n #to;\n\n constructor(object, property, options = {}) {\n super(object, property, 'muigui-color-chooser');\n const format = options.format || guessFormat(this.getValue());\n const {color, text} = colorFormatConverters[format];\n this.#to = color.to;\n this.#textView = new TextView(this, {converters: text, alpha: hasAlpha(format)});\n this.#colorView = new ColorChooserView(this, {converters: color, alpha: hasAlpha(format)});\n this.addTop(this.#textView);\n this.addBottom(this.#colorView);\n // WTF! FIX!\n this.___setKnobHelper = true;\n this.updateDisplay();\n }\n #setKnobHelper() {\n if (this.#to) {\n const hex6Or8 = this.#to(this.getValue());\n const alpha = hex6Or8.length === 9 ? hex6Or8.substring(7, 9) : 'FF';\n const hsl = rgbUint8ToHsl(hexToUint8RGB(hex6Or8));\n hsl[2] = (hsl[2] + 50) % 100;\n const hex = uint8RGBToHex(hslToRgbUint8(hsl));\n this.setKnobColor(`${hex6Or8.substring(0, 7)}${alpha}`, hex);\n }\n }\n updateDisplay() {\n super.updateDisplay();\n if (this.___setKnobHelper) {\n this.#setKnobHelper();\n }\n }\n setOptions(options) {\n super.setOptions(options);\n return this;\n }\n}\n","import { createElem } from '../libs/elem.js';\nimport View from '../views/View.js';\n\nfunction showCSS(ob) {\n if (ob.prototype.css) {\n showCSS(ob.prototype);\n }\n}\n\nexport default class Layout extends View {\n static css = 'bar';\n constructor(tag, className) {\n super(createElem(tag, {className}));\n\n showCSS(this);\n }\n}\n\n/*\nclass ValueController ?? {\n const row = this.add(new Row());\n const label = row.add(new Label());\n const div = row.add(new Div());\n const row = div.add(new Row());\n}\n*/\n\n/*\nclass MyCustomThing extends ValueController {\n constructor(object, property, options) {\n const topRow = this.add(new Row());\n const bottomRow = this.add(new Row());\n topRow.add(new NumberView());\n topRow.add(new NumberView());\n topRow.add(new NumberView());\n topRow.add(new NumberView());\n bottomRow.add(new DirectionView());\n bottomRow.add(new DirectionView());\n bottomRow.add(new DirectionView());\n bottomRow.add(new DirectionView());\n }\n}\n new Grid([\n [new\n ]\n */","import Layout from './Layout.js';\n\nexport default class Column extends Layout {\n constructor() {\n super('div', 'muigui-row');\n }\n}\n","import Layout from './Layout.js';\n\nexport default class Frame extends Layout {\n static css = 'foo';\n constructor() {\n super('div', 'muigui-frame');\n }\n static get foo() {\n return 'boo';\n }\n}\n","import Layout from './Layout.js';\n\nexport default class Grid extends Layout {\n constructor() {\n super('div', 'muigui-grid');\n }\n}\n","import Layout from './Layout.js';\n\nexport default class Row extends Layout {\n constructor() {\n super('div', 'muigui-row');\n }\n}\n","import css from './styles/muigui.css.js';\nimport {createElem} from './libs/elem.js';\nimport {createController} from './controllers/create-controller.js';\nimport {\n mapRange,\n makeRangeConverters,\n makeRangeOptions,\n makeMinMaxPair,\n} from './libs/utils.js';\nimport {\n converters\n} from './libs/conversions.js';\nimport {\n hasAlpha,\n guessFormat,\n} from './libs/color-utils.js';\nimport Canvas from './controllers/Canvas.js';\nimport Color from './controllers/Color.js';\nimport Divider from './controllers/Divider.js';\nimport Folder from './controllers/Folder.js';\nimport Label from './controllers/Label.js';\nimport Controller from './controllers/Controller.js';\nimport ColorChooser from './controllers/ColorChooser.js';\n\nimport Column from './layout/Column.js';\nimport Frame from './layout/Frame.js';\nimport Grid from './layout/Grid.js';\nimport Row from './layout/Row.js';\n\nexport {\n Column,\n Frame,\n Grid,\n Row,\n};\n\nexport class GUIFolder extends Folder {\n add(object, property, ...args) {\n const controller = object instanceof Controller\n ? object\n : createController(object, property, ...args);\n return this.addController(controller);\n }\n addCanvas(name) {\n return this.addController(new Canvas(name));\n }\n addColor(object, property, options = {}) {\n const value = object[property];\n if (hasAlpha(options.format || guessFormat(value))) {\n return this.addController(new ColorChooser(object, property, options));\n } else {\n return this.addController(new Color(object, property, options));\n }\n }\n addDivider() {\n return this.addController(new Divider());\n }\n addFolder(name) {\n return this.addController(new GUIFolder(name));\n }\n addLabel(text) {\n return this.addController(new Label(text));\n }\n addButton(name, fn) {\n const o = {fn};\n return this.add(o, 'fn').name(name);\n }\n}\n\nclass MuiguiElement extends HTMLElement {\n constructor() {\n super();\n this.shadow = this.attachShadow({mode: 'open'});\n }\n}\n\ncustomElements.define('muigui-element', MuiguiElement);\n\nconst baseStyleSheet = new CSSStyleSheet();\n//baseStyleSheet.replaceSync(css.default);\nconst userStyleSheet = new CSSStyleSheet();\n\nfunction makeStyleSheetUpdater(styleSheet) {\n let newCss;\n let newCssPromise;\n\n function updateStyle() {\n if (newCss && !newCssPromise) {\n const s = newCss;\n newCss = undefined;\n newCssPromise = styleSheet.replace(s).then(() => {\n newCssPromise = undefined;\n updateStyle();\n });\n }\n }\n\n return function updateStyleSheet(css) {\n newCss = css;\n updateStyle();\n };\n}\n\nconst updateBaseStyle = makeStyleSheetUpdater(baseStyleSheet);\nconst updateUserStyle = makeStyleSheetUpdater(userStyleSheet);\n\nfunction getTheme(name) {\n const { include, css: cssStr } = css.themes[name];\n return `${include.map(m => css[m]).join('\\n')} : css.default}\\n${cssStr || ''}`;\n}\n\nexport class GUI extends GUIFolder {\n static converters = converters;\n static mapRange = mapRange;\n static makeRangeConverters = makeRangeConverters;\n static makeRangeOptions = makeRangeOptions;\n static makeMinMaxPair = makeMinMaxPair;\n #localStyleSheet = new CSSStyleSheet();\n\n constructor(options = {}) {\n super('Controls', 'muigui-root');\n if (options instanceof HTMLElement) {\n options = {parent: options};\n }\n const {\n autoPlace = true,\n width,\n title = 'Controls',\n } = options;\n let {\n parent,\n } = options;\n\n if (width) {\n this.domElement.style.width = /^\\d+$/.test(width) ? `${width}px` : width;\n }\n if (parent === undefined && autoPlace) {\n parent = document.body;\n this.domElement.classList.add('muigui-auto-place');\n }\n if (parent) {\n const muiguiElement = createElem('muigui-element');\n muiguiElement.shadowRoot.adoptedStyleSheets = [this.#localStyleSheet, baseStyleSheet, userStyleSheet];\n muiguiElement.shadow.appendChild(this.domElement);\n parent.appendChild(muiguiElement);\n }\n if (title) {\n this.title(title);\n }\n this.#localStyleSheet.replaceSync(css.default);\n this.domElement.classList.add('muigui', 'muigui-colors');\n }\n setStyle(css) {\n this.#localStyleSheet.replace(css);\n }\n static setBaseStyles(css) {\n updateBaseStyle(css);\n }\n static getBaseStyleSheet() {\n return baseStyleSheet;\n }\n static setUserStyles(css) {\n updateUserStyle(css);\n }\n static getUserStyleSheet() {\n return userStyleSheet;\n }\n setTheme(name) {\n this.setStyle(getTheme(name));\n }\n static setTheme(name) {\n GUI.setBaseStyles(getTheme(name));\n }\n}\n\nexport default GUI;\n","function noop() {\n}\n\nconst keyDirections = {\n ArrowLeft: [-1, 0],\n ArrowRight: [1, 0],\n ArrowUp: [0, -1],\n ArrowDown: [0, 1],\n};\n\n// This probably needs to be global\nexport function addKeyboardEvents(elem, {onDown = noop, onUp = noop}) {\n const keyDown = function (event) {\n const mult = event.shiftKey ? 10 : 1;\n const [dx, dy] = (keyDirections[event.key] || [0, 0]).map(v => v * mult);\n const fn = event.type === 'keydown' ? onDown : onUp;\n fn({\n type: event.type.substring(3),\n dx,\n dy,\n event,\n });\n };\n\n elem.addEventListener('keydown', keyDown);\n elem.addEventListener('keyup', keyDown);\n\n return function () {\n elem.removeEventListener('keydown', keyDown);\n elem.removeEventListener('keyup', keyDown);\n };\n}","export function assert(truthy, msg = '') {\n if (!truthy) {\n throw new Error(msg);\n }\n}","import { assert } from '../libs/assert.js';\n\nfunction getEllipsePointForAngle(cx, cy, rx, ry, phi, theta) {\n const m = Math.abs(rx) * Math.cos(theta);\n const n = Math.abs(ry) * Math.sin(theta);\n\n return [\n cx + Math.cos(phi) * m - Math.sin(phi) * n,\n cy + Math.sin(phi) * m + Math.cos(phi) * n,\n ];\n}\n\nfunction getEndpointParameters(cx, cy, rx, ry, phi, theta, dTheta) {\n const [x1, y1] = getEllipsePointForAngle(cx, cy, rx, ry, phi, theta);\n const [x2, y2] = getEllipsePointForAngle(cx, cy, rx, ry, phi, theta + dTheta);\n\n const fa = Math.abs(dTheta) > Math.PI ? 1 : 0;\n const fs = dTheta > 0 ? 1 : 0;\n\n return { x1, y1, x2, y2, fa, fs };\n}\n\nexport function arc(cx, cy, r, start, end) {\n assert(Math.abs(start - end) <= Math.PI * 2);\n assert(start >= -Math.PI && start <= Math.PI * 2);\n assert(start <= end);\n assert(end >= -Math.PI && end <= Math.PI * 4);\n\n const { x1, y1, x2, y2, fa, fs } = getEndpointParameters(cx, cy, r, r, 0, start, end - start);\n return Math.abs(Math.abs(start - end) - Math.PI * 2) > Number.EPSILON\n ? `M${cx} ${cy} L${x1} ${y1} A ${r} ${r} 0 ${fa} ${fs} ${x2} ${y2} L${cx} ${cy}`\n : `M${x1} ${y1} L${x1} ${y1} A ${r} ${r} 0 ${fa} ${fs} ${x2} ${y2}`;\n}\n","import { identity } from '../libs/conversions.js';\nimport { createElem } from '../libs/elem.js';\nimport { addKeyboardEvents } from '../libs/keyboard.js';\nimport { arc } from '../libs/svg.js';\nimport { addTouchEvents } from '../libs/touch.js';\nimport { createWheelHelper } from '../libs/wheel.js';\nimport { clamp, copyExistingProperties, euclideanModulo, lerp, stepify } from '../libs/utils.js';\nimport EditView from './EditView.js';\n\nconst svg = `\n\n \n \n \n \n \n \n \n\n`;\n\nconst twoPiMod = v => euclideanModulo(v + Math.PI, Math.PI * 2) - Math.PI;\n\nexport default class DirectionView extends EditView {\n #arrowElem;\n #rangeElem;\n #lastV;\n #wrap;\n #options = {\n step: 1,\n min: -180,\n max: 180,\n\n /*\n --------\n / -π/2 \\\n / | \\\n |<- -π * |\n | * 0 ->| zero is down the positive X axis\n |<- +π * |\n \\ | /\n \\ π/2 /\n --------\n */\n dirMin: -Math.PI,\n dirMax: Math.PI,\n //dirMin: Math.PI * 0.5,\n //dirMax: Math.PI * 2.5,\n //dirMin: -Math.PI * 0.75, // test 10:30 to 7:30\n //dirMax: Math.PI * 0.75,\n //dirMin: Math.PI * 0.75, // test 7:30 to 10:30\n //dirMax: -Math.PI * 0.75,\n //dirMin: -Math.PI * 0.75, // test 10:30 to 1:30\n //dirMax: -Math.PI * 0.25,\n //dirMin: Math.PI * 0.25, // test 4:30 to 7:30\n //dirMax: Math.PI * 0.75,\n //dirMin: Math.PI * 0.75, // test 4:30 to 7:30\n //dirMax: Math.PI * 0.25,\n wrap: undefined,\n converters: identity,\n };\n\n constructor(setter, options = {}) {\n const wheelHelper = createWheelHelper();\n super(createElem('div', {\n className: 'muigui-direction muigui-no-scroll',\n innerHTML: svg,\n onWheel: e => {\n e.preventDefault();\n const {min, max, step} = this.#options;\n const delta = wheelHelper(e, step);\n let tempV = this.#lastV + delta;\n if (this.#wrap) {\n tempV = euclideanModulo(tempV - min, max - min) + min;\n }\n const newV = clamp(stepify(tempV, v => v, step), min, max);\n setter.setValue(newV);\n },\n }));\n const handleTouch = (e) => {\n const {min, max, step, dirMin, dirMax} = this.#options;\n const nx = e.nx * 2 - 1;\n const ny = e.ny * 2 - 1;\n const a = Math.atan2(ny, nx);\n\n const center = (dirMin + dirMax) / 2;\n\n const centeredAngle = twoPiMod(a - center);\n const centeredStart = twoPiMod(dirMin - center);\n const diff = dirMax - dirMin;\n\n const n = clamp((centeredAngle - centeredStart) / (diff), 0, 1);\n const newV = stepify(min + (max - min) * n, v => v, step);\n setter.setValue(newV);\n };\n addTouchEvents(this.domElement, {\n onDown: handleTouch,\n onMove: handleTouch,\n });\n addKeyboardEvents(this.domElement, {\n onDown: (e) => {\n const {min, max, step} = this.#options;\n const newV = clamp(stepify(this.#lastV + e.dx * step, v => v, step), min, max);\n setter.setValue(newV);\n },\n });\n this.#arrowElem = this.$('#muigui-arrow');\n this.#rangeElem = this.$('#muigui-range');\n this.setOptions(options);\n }\n updateDisplay(v) {\n this.#lastV = v;\n const {min, max} = this.#options;\n const n = (v - min) / (max - min);\n const angle = lerp(this.#options.dirMin, this.#options.dirMax, n);\n this.#arrowElem.style.transform = `rotate(${angle}rad)`;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {dirMin, dirMax, wrap} = this.#options;\n this.#wrap = wrap !== undefined\n ? wrap\n : Math.abs(dirMin - dirMax) >= Math.PI * 2 - Number.EPSILON;\n const [min, max] = dirMin < dirMax ? [dirMin, dirMax] : [dirMax , dirMin];\n this.#rangeElem.setAttribute('d', arc(0, 0, 28.87, min, max));\n }\n}\n","import { identity } from '../libs/conversions.js';\nimport DirectionView from '../views/DirectionView.js';\nimport NumberView from '../views/NumberView.js';\n// import ValueController from './ValueController.js';\nimport PopDownController from './PopDownController.js';\n\n\n// deg2rad\n// where is 0\n// range (0, 360), (-180, +180), (0,0) Really this is a range\n\nexport default class Direction extends PopDownController {\n #options;\n constructor(object, property, options) {\n super(object, property, 'muigui-direction');\nthis.#options = options; // FIX\n this.addTop(new NumberView(this,\nidentity));\n this.addBottom(new DirectionView(this, options));\n this.updateDisplay();\n }\n}\n\n","import { createElem } from '../libs/elem.js';\nimport { makeId } from '../libs/ids.js';\nimport EditView from './EditView.js';\n\nexport default class RadioGridView extends EditView {\n #values;\n\n constructor(setter, keyValues, cols = 3) {\n const values = [];\n const name = makeId();\n super(createElem('div', {}, keyValues.map(([key, value], ndx) => {\n values.push(value);\n return createElem('label', {}, [\n createElem('input', {\n type: 'radio',\n name,\n value: ndx,\n onChange: function () {\n if (this.checked) {\n setter.setFinalValue(that.#values[this.value]);\n }\n },\n }),\n createElem('button', {\n type: 'button',\n textContent: key,\n onClick: function () {\n this.previousElementSibling.click();\n },\n }),\n ]);\n })));\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const that = this;\n this.#values = values;\n this.cols(cols);\n }\n updateDisplay(v) {\n const ndx = this.#values.indexOf(v);\n for (let i = 0; i < this.domElement.children.length; ++i) {\n this.domElement.children[i].children[0].checked = i === ndx;\n }\n }\n cols(cols) {\n this.domElement.style.gridTemplateColumns = `repeat(${cols}, 1fr)`;\n }\n}\n","import RadioGridView from '../views/RadioGridView.js';\nimport ValueController from './ValueController.js';\nimport { convertToKeyValues } from '../libs/key-values.js';\n\nexport default class RadioGrid extends ValueController {\n constructor(object, property, options) {\n super(object, property, 'muigui-radio-grid');\n const valueIsNumber = typeof this.getValue() === 'number';\n const {\n keyValues: keyValuesInput,\n cols = 3,\n } = options;\n const keyValues = convertToKeyValues(keyValuesInput, valueIsNumber);\n this.add(new RadioGridView(this, keyValues, cols));\n this.updateDisplay();\n }\n}","export function onResize(elem, callback) {\n new ResizeObserver(() => {\n callback({rect: elem.getBoundingClientRect(), elem});\n }).observe(elem);\n}\n\nexport function onResizeSVGNoScale(elem, hAnchor, vAnchor, callback) {\n onResize(elem, ({rect}) => {\n const {width, height} = rect;\n elem.setAttribute('viewBox', `-${width * hAnchor} -${height * vAnchor} ${width} ${height}`);\n callback({elem, rect});\n });\n}\n\nexport function onResizeCanvas(elem, callback) {\n onResize(elem, ({rect}) => {\n const {width, height} = rect;\n elem.width = width;\n elem.height = height;\n callback({elem, rect});\n });\n}\n","import { createElem } from '../libs/elem.js';\nimport { addKeyboardEvents } from '../libs/keyboard.js';\nimport { addTouchEvents } from '../libs/touch.js';\nimport { createWheelHelper } from '../libs/wheel.js';\nimport { onResizeSVGNoScale } from '../libs/resize-helpers.js';\nimport { clamp, copyExistingProperties, stepify } from '../libs/utils.js';\nimport EditView from './EditView.js';\n\nconst svg = `\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n`;\n\nfunction createSVGTicks(start, end, step, min, max, height) {\n const p = [];\n if (start < min) {\n start += stepify(min - start, v => v, step);\n }\n end = Math.min(end, max);\n for (let i = start; i <= end; i += step) {\n p.push(`M${i} 0 l0 ${height}`);\n }\n return p.join(' ');\n}\n\nfunction createSVGNumbers(start, end, unitSize, unit, minusSize, min, max, labelFn) {\n const texts = [];\n if (start < min) {\n start += stepify(min - start, v => v, unitSize);\n }\n end = Math.min(end, max);\n const digits = Math.max(0, -Math.log10(unit));\n const f = v => labelFn(v.toFixed(digits));\n for (let i = start; i <= end; i += unitSize) {\n texts.push(`= 0 ? i : (i - minusSize / 2) }\" y=\"0\">${f(i / unitSize * unit)}`);\n }\n return texts.join('\\n');\n}\n\nfunction computeSizeOfMinus(elem) {\n const oldHTML = elem.innerHTML;\n elem.innerHTML = '- ';\n const text = elem.querySelector('text');\n const size = text.getComputedTextLength();\n elem.innerHTML = oldHTML;\n return size;\n}\n\nexport default class SliderView extends EditView {\n #svgElem;\n #originElem;\n #ticksElem;\n #thicksElem;\n #numbersElem;\n #leftGradElem;\n #rightGradElem;\n #width;\n #height;\n #lastV;\n #minusSize;\n #options = {\n min: -100,\n max: 100,\n step: 1,\n unit: 10,\n unitSize: 10,\n ticksPerUnit: 5,\n labelFn: v => v,\n tickHeight: 1,\n limits: true,\n thicksColor: undefined,\n orientation: undefined,\n };\n\n constructor(setter, options) {\n const wheelHelper = createWheelHelper();\n super(createElem('div', {\n innerHTML: svg,\n className: 'muigui-no-v-scroll',\n onWheel: e => {\n e.preventDefault();\n const {min, max, step} = this.#options;\n const delta = wheelHelper(e, step);\n const newV = clamp(stepify(this.#lastV + delta, v => v, step), min, max);\n setter.setValue(newV);\n },\n }));\n this.#svgElem = this.$('svg');\n this.#originElem = this.$('#muigui-origin');\n this.#ticksElem = this.$('#muigui-ticks');\n this.#thicksElem = this.$('#muigui-thicks');\n this.#numbersElem = this.$('#muigui-numbers');\n this.#leftGradElem = this.$('#muigui-left-grad');\n this.#rightGradElem = this.$('#muigui-right-grad');\n this.setOptions(options);\n let startV;\n addTouchEvents(this.domElement, {\n onDown: () => {\n startV = this.#lastV;\n },\n onMove: (e) => {\n const {min, max, unitSize, unit, step} = this.#options;\n const newV = clamp(stepify(startV - e.dx / unitSize * unit, v => v, step), min, max);\n setter.setValue(newV);\n },\n });\n addKeyboardEvents(this.domElement, {\n onDown: (e) => {\n const {min, max, step} = this.#options;\n const newV = clamp(stepify(this.#lastV + e.dx * step, v => v, step), min, max);\n setter.setValue(newV);\n },\n });\n onResizeSVGNoScale(this.#svgElem, 0.5, 0, ({rect: {width}}) => {\n this.#leftGradElem.setAttribute('x', -width / 2);\n this.#rightGradElem.setAttribute('x', width / 2 - 20);\n this.#minusSize = computeSizeOfMinus(this.#numbersElem);\n this.#width = width;\n this.#updateSlider();\n });\n }\n // |--------V--------|\n // . . | . . . | . . . |\n //\n #updateSlider() {\n // There's no size if ResizeObserver has not fired yet.\n if (!this.#width || this.#lastV === undefined) {\n return;\n }\n const {\n labelFn,\n limits,\n min,\n max,\n orientation,\n tickHeight,\n ticksPerUnit,\n unit,\n unitSize,\n thicksColor,\n } = this.#options;\n const unitsAcross = Math.ceil(this.#width / unitSize);\n const center = this.#lastV;\n const centerUnitSpace = center / unit;\n const startUnitSpace = Math.round(centerUnitSpace - unitsAcross);\n const endUnitSpace = startUnitSpace + unitsAcross * 2;\n const start = startUnitSpace * unitSize;\n const end = endUnitSpace * unitSize;\n const minUnitSpace = limits ? min * unitSize / unit : start;\n const maxUnitSpace = limits ? max * unitSize / unit : end;\n const height = labelFn(1) === '' ? 10 : 5;\n if (ticksPerUnit > 1) {\n this.#ticksElem.setAttribute('d', createSVGTicks(start, end, unitSize / ticksPerUnit, minUnitSpace, maxUnitSpace, height * tickHeight));\n }\n this.#thicksElem.style.stroke = thicksColor; //setAttribute('stroke', thicksColor);\n this.#thicksElem.setAttribute('d', createSVGTicks(start, end, unitSize, minUnitSpace, maxUnitSpace, height));\n this.#numbersElem.innerHTML = createSVGNumbers(start, end, unitSize, unit, this.#minusSize, minUnitSpace, maxUnitSpace, labelFn);\n this.#originElem.setAttribute('transform', `translate(${-this.#lastV * unitSize / unit} 0)`);\n this.#svgElem.classList.toggle('muigui-slider-up', orientation === 'up');\n }\n updateDisplay(v) {\n this.#lastV = v;\n this.#updateSlider();\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n return this;\n }\n}\n","import ValueController from './ValueController.js';\nimport NumberView from '../views/NumberView.js';\nimport SliderView from '../views/SliderView.js';\n\nexport default class Slider extends ValueController {\n constructor(object, property, options = {}) {\n super(object, property, 'muigui-slider');\n this.add(new SliderView(this, options));\n this.add(new NumberView(this, options));\n this.updateDisplay();\n }\n}\n","import { createElem } from '../libs/elem.js';\nimport { addTouchEvents } from '../libs/touch.js';\nimport { onResizeSVGNoScale } from '../libs/resize-helpers.js';\nimport EditView from './EditView.js';\n\nconst svg = `\n\n \n \n \n \n \n\n`;\n\nexport default class Vec2View extends EditView {\n #svgElem;\n #arrowElem;\n #circleElem;\n #lastV = [];\n\n constructor(setter) {\n super(createElem('div', {\n innerHTML: svg,\n className: 'muigui-no-scroll',\n }));\n const onTouch = (e) => {\n const {width, height} = this.#svgElem.getBoundingClientRect();\n const nx = e.nx * 2 - 1;\n const ny = e.ny * 2 - 1;\n setter.setValue([nx * width * 0.5, ny * height * 0.5]);\n };\n addTouchEvents(this.domElement, {\n onDown: onTouch,\n onMove: onTouch,\n });\n this.#svgElem = this.$('svg');\n this.#arrowElem = this.$('#muigui-arrow');\n this.#circleElem = this.$('#muigui-circle');\n onResizeSVGNoScale(this.#svgElem, 0.5, 0.5, () => this.#updateDisplayImpl);\n }\n #updateDisplayImpl() {\n const [x, y] = this.#lastV;\n this.#arrowElem.setAttribute('d', `M0,0L${x},${y}`);\n this.#circleElem.setAttribute('transform', `translate(${x}, ${y})`);\n }\n updateDisplay(v) {\n this.#lastV[0] = v[0];\n this.#lastV[1] = v[1];\n this.#updateDisplayImpl();\n }\n}\n","import NumberView from '../views/NumberView.js';\nimport Vec2View from '../views/Vec2View.js';\nimport PopDownController from './PopDownController.js';\nimport { strToNumber } from '../libs/conversions.js';\n\n// TODO: zoom with wheel and pinch?\n// TODO: grid?\n// // options\n// scale:\n// range: number (both x and y + /)\n// range: array (min, max)\n// xRange:\n// deg/rad/turn\n\nexport default class Vec2 extends PopDownController {\n constructor(object, property) {\n super(object, property, 'muigui-vec2');\n\n const makeSetter = (ndx) => {\n return {\n setValue: (v) => {\n const newV = this.getValue();\n newV[ndx] = v;\n this.setValue(newV);\n },\n setFinalValue: (v) => {\n const newV = this.getValue();\n newV[ndx] = v;\n this.setFinalValue(newV);\n },\n };\n };\n\n this.addTop(new NumberView(makeSetter(0), {\n converters: {\n to: v => v[0],\n from: strToNumber.from,\n },\n }));\n this.addTop(new NumberView(makeSetter(1), {\n converters: {\n to: v => v[1],\n from: strToNumber.from,\n },\n }));\n this.addBottom(new Vec2View(this));\n this.updateDisplay();\n }\n}\n","import GUI from './muigui.js';\n\nimport ColorChooser from './controllers/ColorChooser.js';\nimport Direction from './controllers/Direction.js';\nimport RadioGrid from './controllers/RadioGrid.js';\nimport Range from './controllers/Range.js';\nimport Select from './controllers/Select.js';\nimport Slider from './controllers/Slider.js';\nimport TextNumber from './controllers/TextNumber.js';\nimport Vec2 from './controllers/Vec2.js';\n\nGUI.ColorChooser = ColorChooser;\nGUI.Direction = Direction;\nGUI.RadioGrid = RadioGrid;\nGUI.Range = Range;\nGUI.Select = Select;\nGUI.Slider = Slider;\nGUI.TextNumber = TextNumber;\nGUI.Vec2 = Vec2;\n\nexport default GUI;"],"names":["clamp","euclideanModulo","lerp","identity","noop","svg"],"mappings":";;;;;;;AAAA,YAAe;EACf,EAAE,OAAO,EAAE,CAAC;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;EACD,MAAM,EAAE;EACR,EAAE,OAAO,EAAE;EACX,IAAI,OAAO,EAAE,CAAC,SAAS,CAAC;EACxB,IAAI,GAAG,EAAE,CAAC;AACV,IAAI,CAAC;EACL,GAAG;EACH,EAAE,KAAK,EAAE;EACT,IAAI,OAAO,EAAE,CAAC,SAAS,CAAC;EACxB,IAAI,GAAG,EAAE,CAAC;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;EACD,GAAG;EACH,EAAE,IAAI,EAAE;EACR,IAAI,OAAO,EAAE,EAAE;EACf,IAAI,GAAG,EAAE,CAAC;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,CAAC;EACH,GAAG;EACH,EAAE,IAAI,EAAE;EACR,IAAI,OAAO,EAAE,EAAE;EACf,IAAI,GAAG,EAAE,EAAE;EACX,GAAG;EACH,CAAC;EACD,CAAC;;EC/0BM,SAAS,YAAY,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE;EACpD,EAAE,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;EACpD,IAAI,IAAI,OAAO,KAAK,KAAK,UAAU,IAAI,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;EAC7D,MAAM,MAAM,SAA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CAAC;EACzB,GAAG;EACH;;ECrCA,GAAG,CAAC,YAAY,GAAG,YAAY,CAAC;EAChC,GAAG,CAAC,SAAS,GAAG,SAAS,CAAC;EAC1B,GAAG,CAAC,SAAS,GAAG,SAAS,CAAC;EAC1B,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC;EAClB,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC;EACpB,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC;EACpB,GAAG,CAAC,UAAU,GAAG,UAAU,CAAC;EAC5B,GAAG,CAAC,IAAI,GAAG,IAAI;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"muigui.js","sources":["../../src/styles/muigui.css.js","../../src/libs/elem.js","../../src/libs/utils.js","../../../src/views/View.ts","../../src/controllers/Controller.js","../../src/controllers/Button.js","../../src/views/EditView.js","../../src/views/CheckboxView.js","../../src/libs/taskrunner.js","../../src/libs/ids.js","../../src/views/ValueView.js","../../src/controllers/LabelController.js","../../src/controllers/ValueController.js","../../src/controllers/Checkbox.js","../../src/libs/conversions.js","../../src/libs/wheel.js","../../src/views/NumberView.js","../../src/controllers/TextNumber.js","../../src/views/SelectView.js","../../src/libs/key-values.js","../../src/controllers/Select.js","../../src/views/RangeView.js","../../src/controllers/Range.js","../../src/views/TextView.js","../../src/controllers/Text.js","../../src/controllers/create-controller.js","../../src/libs/color-utils.js","../../src/views/ElementView.js","../../src/controllers/Canvas.js","../../src/views/ColorView.js","../../src/controllers/Color.js","../../src/controllers/Divider.js","../../src/controllers/Container.js","../../src/controllers/Folder.js","../../src/controllers/Label.js","../../src/libs/touch.js","../../src/views/ColorChooserView.js","../../src/controllers/PopDownController.js","../../src/controllers/ColorChooser.js","../../src/layout/Layout.js","../../src/layout/Column.js","../../src/layout/Frame.js","../../src/layout/Grid.js","../../src/layout/Row.js","../../src/muigui.js","../../src/libs/keyboard.js","../../src/libs/assert.js","../../src/libs/svg.js","../../src/views/DirectionView.js","../../src/controllers/Direction.js","../../src/views/RadioGridView.js","../../src/controllers/RadioGrid.js","../../src/libs/resize-helpers.js","../../src/views/SliderView.js","../../src/controllers/Slider.js","../../src/views/Vec2View.js","../../src/controllers/Vec2.js","../../src/umd.js"],"sourcesContent":["export default {\n default: `\n.muigui {\n --bg-color: #ddd;\n --color: #222;\n --contrast-color: #eee;\n --value-color: #145 ;\n --value-bg-color: #eeee;\n --disabled-color: #999;\n --menu-bg-color: #f8f8f8;\n --menu-sep-color: #bbb;\n --hover-bg-color: #999;\n --focus-color: #8BF;\n --range-color: #AAA;\n --invalid-color: #FF0000;\n --selected-color: rgb(255, 255, 255, 0.9);\n\n --button-bg-color: var(--value-bg-color);\n\n --image-open: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjNDQ0OyIgeD0iMjAlIiB5PSI0NSUiIHdpZHRoPSI2MCUiIGhlaWdodD0iMTAlIj48L3JlY3Q+Cjwvc3ZnPg==);\n --image-closed: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjNDQ0OyIgeD0iNDUlIiB5PSIyMCUiIHdpZHRoPSIxMCUiIGhlaWdodD0iNjAlIj48L3JlY3Q+CiAgPHJlY3Qgc3R5bGU9ImZpbGw6ICM0NDQ7IiB4PSIyMCUiIHk9IjQ1JSIgd2lkdGg9IjYwJSIgaGVpZ2h0PSIxMCUiPjwvcmVjdD4KPC9zdmc+);\n --image-checkerboard: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjNDA0MDQwOyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSI+PC9yZWN0PgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjODA4MDgwOyIgeD0iMCIgeT0iMCIgd2lkdGg9IjUwJSIgaGVpZ2h0PSI1MCUiPjwvcmVjdD4KICA8cmVjdCBzdHlsZT0iZmlsbDogIzgwODA4MDsiIHg9IjUwJSIgeT0iNTAlIiB3aWR0aD0iNTAlIiBoZWlnaHQ9IjUwJSI+PC9yZWN0Pgo8L3N2Zz4=);\n\n --range-left-color: var(--value-color);\n --range-right-color: var(--value-bg-color); \n --range-right-hover-color: var(--hover-bg-color);\n --button-image: \n linear-gradient(\n rgba(255, 255, 255, 1), rgba(0, 0, 0, 0.2)\n );\n\n color: var(--color);\n background-color: var(--bg-color);\n}\n\n@media (prefers-color-scheme: dark) {\n .muigui {\n --bg-color: #222222;\n --color: #dddddd;\n --contrast-color: #000;\n --value-color: #43e5f7;\n --value-bg-color: #444444;\n --disabled-color: #666666;\n --menu-bg-color: #080808;\n --menu-sep-color: #444444;\n --hover-bg-color: #666666;\n --focus-color: #458; /*#88AAFF*/;\n --range-color: #888888;\n --invalid-color: #FF6666;\n --selected-color: rgba(255, 255, 255, 0.3);\n\n --button-bg-color: var(--value-bg-color);\n\n --range-left-color: var(--value-color);\n --range-right-color: var(--value-bg-color); \n --range-right-hover-color: var(--hover-bg-color);\n --button-image: linear-gradient(\n rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.4)\n );\n\n color: var(--color);\n background-color: var(--bg-color);\n\n --image-closed: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjREREOyIgeD0iMjAlIiB5PSI0NSUiIHdpZHRoPSI2MCUiIGhlaWdodD0iMTAlIj48L3JlY3Q+Cjwvc3ZnPg==);\n --image-open: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjREREOyIgeD0iNDUlIiB5PSIyMCUiIHdpZHRoPSIxMCUiIGhlaWdodD0iNjAlIj48L3JlY3Q+CiAgPHJlY3Qgc3R5bGU9ImZpbGw6ICNEREQ7IiB4PSIyMCUiIHk9IjQ1JSIgd2lkdGg9IjYwJSIgaGVpZ2h0PSIxMCUiPjwvcmVjdD4KPC9zdmc+);\n }\n}\n\n.muigui {\n --width: 250px;\n --label-width: 45%;\n --number-width: 40%;\n\n --font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Arial, sans-serif;\n --font-size: 11px;\n --font-family-mono: Menlo, Monaco, Consolas, \"Droid Sans Mono\", monospace;\n --font-size-mono: 11px;\n\n --line-height: 1.7em;\n --border-radius: 0px;\n\n width: var(--width);\n font-family: var(--font-family);\n font-size: var(--font-size);\n box-sizing: border-box;\n line-height: 100%;\n white-space: nowrap;\n}\n.muigui * {\n box-sizing: inherit;\n}\n\n.muigui-no-scroll {\n touch-action: none;\n}\n.muigui-no-h-scroll {\n touch-action: pan-y;\n}\n.muigui-no-v-scroll {\n touch-action: pan-x;\n}\n\n.muigui-invalid-value {\n background-color: red !important;\n color: white !important;\n}\n\n.muigui-grid {\n display: grid;\n}\n.muigui-rows {\n display: flex;\n flex-direction: column;\n\n min-height: 20px;\n border: 2px solid red;\n}\n.muigui-columns {\n display: flex;\n flex-direction: row;\n\n height: 20px;\n border: 2px solid green;\n}\n.muigui-rows>*,\n.muigui-columns>* {\n flex: 1 1 auto;\n align-items: stretch;\n min-height: 0;\n min-width: 0;\n}\n\n.muigui-row {\n border: 2px solid yellow;\n min-height: 10px\n}\n.muigui-column {\n border: 2px solid lightgreen;\n}\n\n/* -------- */\n\n.muigui-show { /* */ }\n.muigui-hide { \n display: none !important;\n}\n.muigui-disabled {\n pointer-events: none;\n --color: var(--disabled-color) !important;\n --value-color: var(--disabled-color) !important;\n --range-left-color: var(--disabled-color) !important;\n}\n\n.muigui canvas,\n.muigui svg {\n display: block;\n border-radius: var(--border-radius);\n}\n.muigui canvas {\n background-color: var(--value-bg-color);\n}\n\n.muigui-controller {\n min-width: 0;\n min-height: var(--line-height);\n}\n.muigui-root {\n z-index: 1;\n}\n.muigui-root,\n.muigui-menu {\n display: flex;\n flex-direction: column;\n position: relative;\n user-select: none;\n height: fit-content;\n margin: 0;\n padding-bottom: 0.1em;\n border-radius: var(--border-radius);\n}\n.muigui-menu {\n border-bottom: 1px solid var(--menu-sep-color);\n}\n\n.muigui-root>button:nth-child(1),\n.muigui-menu>button:nth-child(1) {\n border-top: 1px solid var(--menu-sep-color);\n border-bottom: 1px solid var(--menu-sep-color);\n position: relative;\n text-align: left;\n color: var(--color);\n background-color: var(--menu-bg-color);\n min-height: var(--line-height);\n padding: 0.2em;\n cursor: pointer;\n border-radius: var(--border-radius);\n}\n.muigui-root>div:nth-child(2),\n.muigui-menu>div:nth-child(2) {\n flex: 1 1 auto;\n}\n\n.muigui-controller {\n margin-left: 0.2em;\n margin-right: 0.2em;\n}\n.muigui-root.muigui-controller,\n.muigui-menu.muigui-controller {\n margin-left: 0;\n margin-right: 0;\n}\n.muigui-controller>*:nth-child(1) {\n flex: 1 0 var(--label-width);\n min-width: 0;\n /* white-space: pre; why?? */\n}\n.muigui-controller>label:nth-child(1) {\n place-content: center start;\n display: inline-grid;\n overflow: hidden;\n}\n.muigui-controller>*:nth-child(2) {\n flex: 1 1 75%;\n min-width: 0;\n}\n\n/* -----------------------------------------\n a label controller is [[label][value]]\n*/\n\n.muigui-label-controller {\n display: flex;\n margin: 0.4em 0 0.4em 0;\n word-wrap: initial;\n align-items: stretch;\n}\n\n.muigui-value {\n display: flex;\n align-items: stretch;\n}\n.muigui-value>* {\n flex: 1 1 auto;\n min-width: 0;\n}\n.muigui-value>*:nth-child(1) {\n flex: 1 1 calc(100% - var(--number-width));\n}\n.muigui-value>*:nth-child(2) {\n flex: 1 1 var(--number-width);\n margin-left: 0.2em;\n}\n\n/* fix! */\n.muigui-open>button>label::before,\n.muigui-closed>button>label::before {\n content: \"X\";\n color: rgba(0, 0, 0, 0);\n background-color: var(--range-color);\n border-radius: 0.2em;\n width: 1.25em;\n margin-right: 0.25em;\n height: 1.25em; /*var(--line-height);*/\n display: inline-grid;\n place-content: center start;\n pointer-events: none;\n}\n.muigui-open>button>label::before {\n background-image: var(--image-open);\n}\n.muigui-closed>button>label::before {\n background-image: var(--image-closed);\n}\n\n.muigui-open>.muigui-open-container {\n transition: all 0.1s ease-out;\n overflow: auto;\n height: 100%;\n}\n.muigui-closed>.muigui-open-container {\n transition: all 0.1s ease-out;\n overflow: hidden;\n min-height: 0;\n}\n.muigui-open>.muigui-open-container>* {\n transition: all 0.1s ease-out;\n margin-top: 0px;\n}\n.muigui-closed>.muigui-open-container>* {\n transition: all 0.1s ease-out;\n margin-top: -1000%;\n}\n\n/* ---- popdown ---- */\n\n.muigui-pop-down-top {\n display: flex;\n}\n/* fix? */\n.muigui-value>*:nth-child(1).muigui-pop-down-top {\n flex: 0;\n}\n.muigui-closed .muigui-pop-down-bottom {\n max-height: 0;\n}\n\n.muigui-value .muigui-pop-down-bottom {\n margin: 0;\n}\n\n.muigui-pop-down-values {\n min-width: 0;\n display: flex;\n}\n.muigui-pop-down-values>* {\n flex: 1 1 auto;\n min-width: 0;\n}\n\n.muigui-value.muigui-pop-down-controller {\n flex-direction: column;\n}\n\n.muigui-pop-down-top input[type=checkbox] {\n -webkit-appearance: none;\n appearance: none;\n width: auto;\n color: var(--value-color);\n background-color: var(--value-bg-color);\n background-image: var(--image-checkerboard);\n background-size: 10px 10px;\n background-position: 0 0, 0 5px, 5px -5px, -5px 0px;\n\n cursor: pointer;\n\n display: grid;\n place-content: center;\n margin: 0;\n font: inherit;\n color: currentColor;\n width: 1.7em;\n height: 1.7em;\n transform: translateY(-0.075em);\n}\n\n.muigui-pop-down-top input[type=checkbox]::before {\n content: \"+\";\n display: grid;\n place-content: center;\n border-radius: calc(var(--border-radius) + 2px);\n border-left: 1px solid rgba(255,255,255,0.3);\n border-top: 1px solid rgba(255,255,255,0.3);\n border-bottom: 1px solid rgba(0,0,0,0.2);\n border-right: 1px solid rgba(0,0,0,0.2);\n background-color: var(--range-color);\n color: var(--value-bg-color);\n width: calc(var(--line-height) - 4px);\n height: calc(var(--line-height) - 4px);\n}\n\n.muigui-pop-down-top input[type=checkbox]:checked::before {\n content: \"X\";\n}\n\n\n/* ---- select ---- */\n\n.muigui select,\n.muigui option,\n.muigui input,\n.muigui button {\n color: var(--value-color);\n background-color: var(--value-bg-color);\n font-family: var(--font-family);\n font-size: var(--font-size);\n border: none;\n margin: 0;\n border-radius: var(--border-radius);\n}\n.muigui select {\n appearance: none;\n margin: 0;\n margin-left: 0; /*?*/\n overflow: hidden; /* Safari */\n}\n\n.muigui select:focus,\n.muigui input:focus,\n.muigui button:focus {\n outline: 1px solid var(--focus-color);\n}\n\n.muigui select:hover,\n.muigui option:hover,\n.muigui input:hover,\n.muigui button:hover {\n background-color: var(--hover-bg-color); \n}\n\n/* ------ [ label ] ------ */\n\n.muigui-label {\n border-top: 1px solid var(--menu-sep-color);\n border-bottom: 1px solid var(--menu-sep-color);\n padding-top: 0.4em;\n padding-bottom: 0.3em;\n place-content: center start;\n background-color: var(--menu-bg-color);\n white-space: pre;\n border-radius: var(--border-radius);\n}\n\n/* ------ [ divider] ------ */\n\n.muigui-divider {\n min-height: 6px;\n border-top: 2px solid var(--menu-sep-color);\n margin-top: 6px;\n}\n\n/* ------ [ button ] ------ */\n\n.muigui-button {\n display: grid;\n padding: 2px 0 2px 0;\n}\n.muigui-button button {\n border: none;\n color: var(--value-color);\n background-color: var(--button-bg-color);\n background-image: var(--button-image);\n cursor: pointer;\n place-content: center center;\n height: var(--line-height);\n}\n\n/* ------ [ color ] ------ */\n\n.muigui-color>div {\n overflow: hidden;\n position: relative;\n margin-left: 0;\n margin-right: 0; /* why? */\n max-width: var(--line-height);\n border-radius: var(--border-radius);\n}\n\n.muigui-color>div:focus-within {\n outline: 1px solid var(--focus-color);\n}\n\n.muigui-color input[type=color] {\n border: none;\n padding: 0;\n background: inherit;\n cursor: pointer;\n position: absolute;\n width: 200%;\n left: -10px;\n top: -10px;\n height: 200%;\n}\n.muigui-disabled canvas,\n.muigui-disabled svg,\n.muigui-disabled img,\n.muigui-disabled .muigui-color input[type=color] {\n opacity: 0.2;\n}\n\n/* ------ [ checkbox ] ------ */\n\n.muigui-checkbox>label:nth-child(2) {\n display: grid;\n place-content: center start;\n margin: 0;\n}\n\n.muigui-checkbox input[type=checkbox] {\n -webkit-appearance: none;\n appearance: none;\n width: auto;\n color: var(--value-color);\n background-color: var(--value-bg-color);\n cursor: pointer;\n\n display: grid;\n place-content: center;\n margin: 0;\n font: inherit;\n color: currentColor;\n width: 1.7em;\n height: 1.7em;\n transform: translateY(-0.075em);\n}\n\n.muigui-checkbox input[type=checkbox]::before {\n content: \"\";\n color: var(--value-color);\n display: grid;\n place-content: center;\n}\n\n.muigui-checkbox input[type=checkbox]:checked::before {\n content: \"✔\";\n}\n\n.muigui input[type=number]::-webkit-inner-spin-button, \n.muigui input[type=number]::-webkit-outer-spin-button { \n -webkit-appearance: none;\n appearance: none;\n margin: 0; \n}\n.muigui input[type=number] {\n -moz-appearance: textfield;\n}\n\n/* ------ [ radio grid ] ------ */\n\n.muigui-radio-grid>div {\n display: grid;\n gap: 2px;\n}\n\n.muigui-radio-grid input {\n appearance: none;\n display: none;\n}\n\n.muigui-radio-grid button {\n color: var(--color);\n width: 100%;\n text-align: left;\n}\n\n.muigui-radio-grid input:checked + button {\n color: var(--value-color);\n background-color: var(--selected-color);\n}\n\n/* ------ [ color-chooser ] ------ */\n\n.muigui-color-chooser-cursor {\n stroke-width: 1px;\n stroke: white;\n fill: none;\n}\n.muigui-color-chooser-circle {\n stroke-width: 1px;\n stroke: white;\n fill: none;\n}\n\n\n/* ------ [ vec2 ] ------ */\n\n.muigui-vec2 svg {\n background-color: var(--value-bg-color);\n}\n\n.muigui-vec2-axis {\n stroke: 1px;\n stroke: var(--focus-color);\n}\n\n.muigui-vec2-line {\n stroke-width: 1px;\n stroke: var(--value-color);\n fill: var(--value-color);\n}\n\n/* ------ [ direction ] ------ */\n\n.muigui-direction svg {\n background-color: rgba(0,0,0,0.2);\n}\n\n.muigui-direction:focus-within svg {\n outline: none;\n}\n.muigui-direction-range {\n fill: var(--value-bg-color);\n}\n.muigui-direction svg:focus {\n outline: none;\n}\n.muigui-direction svg:focus .muigui-direction-range {\n stroke-width: 0.5px;\n stroke: var(--focus-color);\n}\n\n.muigui-direction-arrow {\n fill: var(--value-color);\n}\n\n/* ------ [ slider ] ------ */\n\n.muigui-slider>div {\n display: flex;\n align-items: stretch;\n height: var(--line-height);\n}\n.muigui-slider svg {\n flex: 1 1 auto;\n}\n.muigui-slider .muigui-slider-up #muigui-orientation {\n transform: scale(1, -1) translateY(-100%);\n}\n\n.muigui-slider .muigui-slider-up #muigui-number-orientation {\n transform: scale(1,-1);\n}\n\n.muigui-ticks {\n stroke: var(--range-color);\n}\n.muigui-thicks {\n stroke: var(--color);\n stroke-width: 2px;\n}\n.muigui-svg-text {\n fill: var(--color);\n font-size: 7px;\n}\n.muigui-mark {\n fill: var(--value-color);\n}\n\n/* ------ [ range ] ------ */\n\n\n.muigui-range input[type=range] {\n -webkit-appearance: none;\n appearance: none;\n background-color: transparent;\n}\n\n.muigui-range input[type=range]::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n border-radius: calc(var(--border-radius) + 2px);\n border-left: 1px solid rgba(255,255,255,0.3);\n border-top: 1px solid rgba(255,255,255,0.3);\n border-bottom: 1px solid rgba(0,0,0,0.2);\n border-right: 1px solid rgba(0,0,0,0.2);\n background-color: var(--range-color);\n margin-top: calc((var(--line-height) - 6px) / -2);\n width: calc(var(--line-height) - 6px);\n height: calc(var(--line-height) - 6px);\n}\n\n.muigui-range input[type=range]::-webkit-slider-runnable-track {\n -webkit-appearance: none;\n appearance: none;\n border: 1px solid var(--menu-sep-color);\n height: 2px;\n}\n\n\n/* dat.gui style - doesn't work on Safari iOS */\n\n/*\n.muigui-range input[type=range] {\n cursor: ew-resize;\n overflow: hidden;\n}\n\n.muigui-range input[type=range] {\n -webkit-appearance: none;\n appearance: none;\n background-color: var(--range-right-color);\n margin: 0;\n}\n.muigui-range input[type=range]:hover {\n background-color: var(--range-right-hover-color);\n}\n\n.muigui-range input[type=range]::-webkit-slider-runnable-track {\n -webkit-appearance: none;\n appearance: none;\n height: max-content;\n color: var(--range-left-color);\n margin-top: -1px;\n}\n\n.muigui-range input[type=range]::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 0px;\n height: max-content;\n box-shadow: -1000px 0 0 1000px var(--range-left-color);\n}\n*/\n\n/* FF */\n/*\n.muigui-range input[type=range]::-moz-slider-progress {\n background-color: var(--range-left-color); \n}\n.muigui-range input[type=range]::-moz-slider-thumb {\n height: max-content;\n width: 0;\n border: none;\n box-shadow: -1000px 0 0 1000px var(--range-left-color);\n box-sizing: border-box;\n}\n*/\n\n.muigui-checkered-background {\n background-color: #404040;\n background-image:\n linear-gradient(45deg, #808080 25%, transparent 25%),\n linear-gradient(-45deg, #808080 25%, transparent 25%),\n linear-gradient(45deg, transparent 75%, #808080 75%),\n linear-gradient(-45deg, transparent 75%, #808080 75%);\n background-size: 16px 16px;\n background-position: 0 0, 0 8px, 8px -8px, -8px 0px;\n}\n\n/* ---------------------------------------------------------- */\n\n/* needs to be at bottom to take precedence */\n.muigui-auto-place {\n max-height: 100%;\n position: fixed;\n top: 0;\n right: 15px;\n z-index: 100001;\n}\n\n`,\nthemes: {\n default: {\n include: ['default'],\n css: `\n `,\n },\n float: {\n include: ['default'],\n css: `\n :root {\n color-scheme: light dark,\n }\n\n .muigui {\n --width: 400px;\n --bg-color: initial;\n --label-width: 25%;\n --number-width: 20%;\n }\n\n input,\n .muigui-label-controller>label {\n text-shadow:\n -1px -1px 0 var(--contrast-color),\n 1px -1px 0 var(--contrast-color),\n -1px 1px 0 var(--contrast-color),\n 1px 1px 0 var(--contrast-color);\n }\n\n .muigui-controller > label:nth-child(1) {\n place-content: center end;\n margin-right: 1em;\n }\n\n .muigui-value > :nth-child(2) {\n margin-left: 1em;\n }\n\n .muigui-root>*:nth-child(1) {\n display: none;\n }\n\n .muigui-range input[type=range]::-webkit-slider-thumb {\n border-radius: 1em;\n }\n\n .muigui-range input[type=range]::-webkit-slider-runnable-track {\n -webkit-appearance: initial;\n appearance: none;\n border: 1px solid rgba(0, 0, 0, 0.25);\n height: 2px;\n }\n\n .muigui-colors {\n --value-color: var(--color );\n --value-bg-color: rgba(0, 0, 0, 0.1);\n --disabled-color: #cccccc;\n --menu-bg-color: rgba(0, 0, 0, 0.1);\n --menu-sep-color: #bbbbbb;\n --hover-bg-color: rgba(0, 0, 0, 0);\n --invalid-color: #FF0000;\n --selected-color: rgba(0, 0, 0, 0.3);\n --range-color: rgba(0, 0, 0, 0.125);\n }\n`,\n },\n form: {\n include: [],\n css: `\n .muigui {\n --width: 100%;\n --label-width: 45%;\n --number-width: 40%;\n }\n .muigui-root>button {\n display: none;\n }\n .muigui-controller {\n margin-top: 1em;\n }\n .muigui-label-controller {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n margin-top: 1em;\n }\n .muigui-label-controller:has(.muigui-checkbox) {\n flex-direction: row;\n }\n .muigui-value {\n display: flex;\n align-items: stretch;\n }\n .muigui-value>* {\n flex: 1 1 auto;\n min-width: 0;\n }\n .muigui-controller>*:nth-child(1) {\n flex: 1 0 var(--label-width);\n min-width: 0;\n white-space: pre;\n }\n .muigui-controller>label:nth-child(1) {\n place-content: center start;\n display: inline-grid;\n overflow: hidden;\n }\n .muigui-controller>*:nth-child(2) {\n flex: 1 1 75%;\n min-width: 0;\n }\n `,\n },\n none: {\n include: [],\n css: '',\n },\n},\n};\n","export function setElemProps(elem, attrs, children) {\n for (const [key, value] of Object.entries(attrs)) {\n if (typeof value === 'function' && key.startsWith('on')) {\n const eventName = key.substring(2).toLowerCase();\n elem.addEventListener(eventName, value, {passive: false});\n } else if (typeof value === 'object') {\n for (const [k, v] of Object.entries(value)) {\n elem[key][k] = v;\n }\n } else if (elem[key] === undefined) {\n elem.setAttribute(key, value);\n } else {\n elem[key] = value;\n }\n }\n for (const child of children) {\n elem.appendChild(child);\n }\n return elem;\n}\n\nexport function createElem(tag, attrs = {}, children = []) {\n const elem = document.createElement(tag);\n setElemProps(elem, attrs, children);\n return elem;\n}\n\nexport function addElem(tag, parent, attrs = {}, children = []) {\n const elem = createElem(tag, attrs, children);\n parent.appendChild(elem);\n return elem;\n}\n\nlet nextId = 0;\nexport function getNewId() {\n return `muigui-id-${nextId++}`;\n}\n","export function removeArrayElem(array, value) {\n const ndx = array.indexOf(value);\n if (ndx) {\n array.splice(ndx, 1);\n }\n return array;\n}\n\n/**\n * Converts an camelCase or snake_case id to \"camel case\" or \"snake case\"\n * @param {string} id\n */\nconst underscoreRE = /_/g;\nconst upperLowerRE = /([A-Z])([a-z])/g;\nexport function idToLabel(id) {\n return id.replace(underscoreRE, ' ')\n .replace(upperLowerRE, (m, m1, m2) => `${m1.toLowerCase()} ${m2}`);\n}\n\nexport function clamp(v, min, max) {\n return Math.max(min, Math.min(max, v));\n}\n\nexport const isTypedArray = typeof SharedArrayBuffer !== 'undefined'\n ? function isArrayBufferOrSharedArrayBuffer(a) {\n return a && a.buffer && (a.buffer instanceof ArrayBuffer || a.buffer instanceof SharedArrayBuffer);\n }\n : function isArrayBuffer(a) {\n return a && a.buffer && a.buffer instanceof ArrayBuffer;\n };\n\nexport const isArrayOrTypedArray = v => Array.isArray(v) || isTypedArray(v);\n\n// Yea, I know this should be `Math.round(v / step) * step\n// but try step = 0.1, newV = 19.95\n//\n// I get\n// Math.round(19.95 / 0.1) * 0.1\n// 19.900000000000002\n// vs\n// Math.round(19.95 / 0.1) / (1 / 0.1)\n// 19.9\n//\nexport const stepify = (v, from, step) => Math.round(from(v) / step) / (1 / step);\n\nexport const euclideanModulo = (v, n) => ((v % n) + n) % n;\nexport const lerp = (a, b, t) => a + (b - a) * t;\nexport function copyExistingProperties(dst, src) {\n for (const key in src) {\n if (key in dst) {\n dst[key] = src[key];\n }\n }\n return dst;\n}\n\nexport const mapRange = (v, inMin, inMax, outMin, outMax) => (v - inMin) * (outMax - outMin) / (inMax - inMin) + outMin;\n\nexport const makeRangeConverters = ({from, to}) => {\n return {\n to: v => mapRange(v, ...from, ...to),\n from: v => [true, mapRange(v, ...to, ...from)],\n };\n};\n\nexport const makeRangeOptions = ({from, to, step}) => {\n return {\n min: to[0],\n max: to[1],\n ...(step && {step}),\n converters: makeRangeConverters({from, to}),\n };\n};\n\n// TODO: remove an use one in conversions. Move makeRangeConverters there?\nexport const identity = {\n to: v => v,\n from: v => [true, v],\n};\nexport function makeMinMaxPair(gui, properties, minPropName, maxPropName, options) {\n const { converters: { from } = identity } = options;\n const { min, max } = options;\n const guiMinRange = options.minRange || 0;\n const valueMinRange = from(guiMinRange)[1];\n const minGui = gui\n .add(properties, minPropName, {\n ...options,\n min,\n max: max - guiMinRange,\n })\n .onChange(v => {\n maxGui.setValue(Math.min(max, Math.max(v + valueMinRange, properties[maxPropName])));\n });\n const maxGui = gui\n .add(properties, maxPropName, {\n ...options,\n min: min + guiMinRange,\n max,\n })\n .onChange(v => {\n minGui.setValue(Math.max(min, Math.min(v - valueMinRange, properties[minPropName])));\n });\n return [ minGui, maxGui ];\n}\n\n","import { removeArrayElem } from '../libs/utils.js';\n\nexport default class View {\n domElement: HTMLElement;\n\n #childDestElem: HTMLElement;\n #views: View[] = [];\n\n constructor(elem: HTMLElement) {\n this.domElement = elem;\n this.#childDestElem = elem;\n }\n addElem(elem: HTMLElement) {\n this.#childDestElem.appendChild(elem);\n return elem;\n }\n removeElem(elem: HTMLElement) {\n this.#childDestElem.removeChild(elem);\n return elem;\n }\n pushSubElem(elem: HTMLElement) {\n this.#childDestElem.appendChild(elem);\n this.#childDestElem = elem;\n }\n popSubElem() {\n this.#childDestElem = this.#childDestElem.parentElement!;\n }\n add(view: View) {\n this.#views.push(view);\n this.addElem(view.domElement);\n return view;\n }\n remove(view: View) {\n this.removeElem(view.domElement);\n removeArrayElem(this.#views, view);\n return view;\n }\n pushSubView(view: View) {\n this.pushSubElem(view.domElement);\n }\n popSubView() {\n this.popSubElem();\n }\n setOptions(options: any) {\n for (const view of this.#views) {\n view.setOptions(options);\n }\n }\n updateDisplayIfNeeded(newV: any, ignoreCache?: boolean) {\n for (const view of this.#views) {\n view.updateDisplayIfNeeded(newV, ignoreCache);\n }\n return this;\n }\n $(selector: string) {\n return this.domElement.querySelector(selector);\n }\n}","import { createElem } from '../libs/elem.js';\nimport { removeArrayElem } from '../libs/utils.js';\nimport View from '../views/View.js';\n\nexport default class Controller extends View {\n #changeFns;\n #finishChangeFns;\n #parent;\n\n constructor(className) {\n super(createElem('div', {className: 'muigui-controller'}));\n this.#changeFns = [];\n this.#finishChangeFns = [];\n // we need the specialization to come last so it takes precedence.\n if (className) {\n this.domElement.classList.add(className);\n }\n }\n get parent() {\n return this.#parent;\n }\n setParent(parent) {\n this.#parent = parent;\n this.enable(!this.disabled());\n }\n show(show = true) {\n this.domElement.classList.toggle('muigui-hide', !show);\n this.domElement.classList.toggle('muigui-show', show);\n return this;\n }\n hide() {\n return this.show(false);\n }\n disabled() {\n return !!this.domElement.closest('.muigui-disabled');\n }\n\n enable(enable = true) {\n this.domElement.classList.toggle('muigui-disabled', !enable);\n\n // If disabled we need to set the attribute 'disabled=true' to all\n // input/select/button/textarea's below\n //\n // If enabled we need to set the attribute 'disabled=false' to all below\n // until we hit a disabled controller.\n //\n // ATM the problem is we can find the input/select/button/textarea elements\n // but we can't easily find which controller they belong do.\n // But we don't need to? We can just check up if it or parent has\n // '.muigui-disabled'\n ['input', 'button', 'select', 'textarea'].forEach(tag => {\n this.domElement.querySelectorAll(tag).forEach(elem => {\n const disabled = !!elem.closest('.muigui-disabled');\n elem.disabled = disabled;\n });\n });\n\n return this;\n }\n disable(disable = true) {\n return this.enable(!disable);\n }\n onChange(fn) {\n this.removeChange(fn);\n this.#changeFns.push(fn);\n return this;\n }\n removeChange(fn) {\n removeArrayElem(this.#changeFns, fn);\n return this;\n }\n onFinishChange(fn) {\n this.removeFinishChange(fn);\n this.#finishChangeFns.push(fn);\n return this;\n }\n removeFinishChange(fn) {\n removeArrayElem(this.#finishChangeFns, fn);\n return this;\n }\n #callListeners(fns, newV) {\n for (const fn of fns) {\n fn.call(this, newV);\n }\n }\n emitChange(value, object, property) {\n this.#callListeners(this.#changeFns, value);\n if (this.#parent) {\n if (object === undefined) {\n this.#parent.emitChange(value);\n } else {\n this.#parent.emitChange({\n object,\n property,\n value,\n controller: this,\n });\n }\n }\n }\n emitFinalChange(value, object, property) {\n this.#callListeners(this.#finishChangeFns, value);\n if (this.#parent) {\n if (object === undefined) {\n this.#parent.emitChange(value);\n } else {\n this.#parent.emitFinalChange({\n object,\n property,\n value,\n controller: this,\n });\n }\n }\n }\n updateDisplay() {\n // placeholder. override\n }\n getColors() {\n const toCamelCase = s => s.replace(/-([a-z])/g, (m, m1) => m1.toUpperCase());\n const keys = [\n 'color',\n 'bg-color',\n 'value-color',\n 'value-bg-color',\n 'hover-bg-color',\n 'menu-bg-color',\n 'menu-sep-color',\n 'disabled-color',\n ];\n const div = createElem('div');\n this.domElement.appendChild(div);\n const colors = Object.fromEntries(keys.map(key => {\n div.style.color = `var(--${key})`;\n const s = getComputedStyle(div);\n return [toCamelCase(key), s.color];\n }));\n div.remove();\n return colors;\n }\n}\n","import {\n createElem,\n} from '../libs/elem.js';\nimport { copyExistingProperties } from '../libs/utils.js';\nimport Controller from './Controller.js';\n\nexport default class Button extends Controller {\n #object;\n #property;\n #buttonElem;\n #options = {\n name: '',\n };\n\n constructor(object, property, options = {}) {\n super('muigui-button', '');\n this.#object = object;\n this.#property = property;\n\n this.#buttonElem = this.addElem(\n createElem('button', {\n type: 'button',\n onClick: () => {\n this.#object[this.#property](this);\n },\n }));\n this.setOptions({name: property, ...options});\n }\n name(name) {\n this.#buttonElem.textContent = name;\n return this;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {name} = this.#options;\n this.#buttonElem.textContent = name;\n return this;\n }\n}","import { isTypedArray } from '../libs/utils.js';\nimport View from './View.js';\n\nfunction arraysEqual(a, b) {\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; ++i) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n}\n\nfunction copyArrayElementsFromTo(src, dst) {\n dst.length = src.length;\n for (let i = 0; i < src.length; ++i) {\n dst[i] = src[i];\n }\n}\n\nexport default class EditView extends View {\n #oldV;\n #updateCheck;\n\n #checkArrayNeedsUpdate(newV) {\n // It's an array, we need to compare all elements\n // Example, vec2, [r,g,b], ...\n const needUpdate = !arraysEqual(newV, this.#oldV);\n if (needUpdate) {\n copyArrayElementsFromTo(newV, this.#oldV);\n }\n return needUpdate;\n }\n\n #checkTypedArrayNeedsUpdate() {\n let once = true;\n return function checkTypedArrayNeedsUpdateImpl(newV) {\n // It's a typedarray, we need to compare all elements\n // Example: Float32Array([r, g, b])\n let needUpdate = once;\n once = false;\n if (!needUpdate) {\n needUpdate = !arraysEqual(newV, this.#oldV);\n }\n return needUpdate;\n };\n }\n\n #checkObjectNeedsUpdate(newV) {\n let needUpdate = false;\n for (const key in newV) {\n if (newV[key] !== this.#oldV[key]) {\n needUpdate = true;\n this.#oldV[key] = newV[key];\n }\n }\n return needUpdate;\n }\n\n #checkValueNeedsUpdate(newV) {\n const needUpdate = newV !== this.#oldV;\n this.#oldV = newV;\n return needUpdate;\n }\n\n #getUpdateCheckForType(newV) {\n if (Array.isArray(newV)) {\n this.#oldV = [];\n return this.#checkArrayNeedsUpdate.bind(this);\n } else if (isTypedArray(newV)) {\n this.#oldV = new newV.constructor(newV);\n return this.#checkTypedArrayNeedsUpdate(this);\n } else if (typeof newV === 'object') {\n this.#oldV = {};\n return this.#checkObjectNeedsUpdate.bind(this);\n } else {\n return this.#checkValueNeedsUpdate.bind(this);\n }\n }\n\n // The point of this is updating DOM elements\n // is slow but if we've called `listen` then\n // every frame we're going to try to update\n // things with the current value so if nothing\n // has changed then skip it.\n updateDisplayIfNeeded(newV, ignoreCache) {\n this.#updateCheck = this.#updateCheck || this.#getUpdateCheckForType(newV);\n // Note: We call #updateCheck first because it updates\n // the cache\n if (this.#updateCheck(newV) || ignoreCache) {\n this.updateDisplay(newV);\n }\n }\n setOptions(/*options*/) {\n // override this\n return this;\n }\n}\n","import { createElem } from '../libs/elem.js';\nimport EditView from './EditView.js';\n\nexport default class CheckboxView extends EditView {\n #checkboxElem;\n constructor(setter, id) {\n const checkboxElem = createElem('input', {\n type: 'checkbox',\n id,\n onInput: () => {\n setter.setValue(checkboxElem.checked);\n },\n onChange: () => {\n setter.setFinalValue(checkboxElem.checked);\n },\n });\n super(createElem('label', {}, [checkboxElem]));\n this.#checkboxElem = checkboxElem;\n }\n updateDisplay(v) {\n this.#checkboxElem.checked = v;\n }\n}\n","import { removeArrayElem } from './utils.js';\n\nconst tasks = [];\nconst tasksToRemove = new Set();\n\nlet requestId;\nlet processing;\n\nfunction removeTasks() {\n if (!tasksToRemove.size) {\n return;\n }\n\n if (processing) {\n queueProcessing();\n return;\n }\n\n tasksToRemove.forEach(task => {\n removeArrayElem(tasks, task);\n });\n tasksToRemove.clear();\n}\n\nfunction processTasks() {\n requestId = undefined;\n processing = true;\n for (const task of tasks) {\n if (!tasksToRemove.has(task)) {\n task();\n }\n }\n processing = false;\n removeTasks();\n queueProcessing();\n}\n\nfunction queueProcessing() {\n if (!requestId && tasks.length) {\n requestId = requestAnimationFrame(processTasks);\n }\n}\n\nexport function addTask(fn) {\n tasks.push(fn);\n queueProcessing();\n}\n\nexport function removeTask(fn) {\n tasksToRemove.set(fn);\n\n const ndx = tasks.indexOf(fn);\n if (ndx >= 0) {\n tasks.splice(ndx, 1);\n }\n}","let id = 0;\n\nexport function makeId() {\n return `muigui-${++id}`;\n}\n","import { createElem } from '../libs/elem.js';\nimport View from './View.js';\n\nexport default class ValueView extends View {\n constructor(className = '') {\n super(createElem('div', {className: 'muigui-value'}));\n if (className) {\n this.domElement.classList.add(className);\n }\n }\n}","import { createElem } from '../libs/elem.js';\nimport { makeId } from '../libs/ids.js';\nimport ValueView from '../views/ValueView.js';\nimport Controller from './Controller.js';\n\nexport default class LabelController extends Controller {\n #id;\n #nameElem;\n\n constructor(className = '', name = '') {\n super('muigui-label-controller');\n this.#id = makeId();\n this.#nameElem = createElem('label', {for: this.#id});\n this.domElement.appendChild(this.#nameElem);\n this.pushSubView(new ValueView(className));\n this.name(name);\n }\n get id() {\n return this.#id;\n }\n name(name) {\n if (this.#nameElem.title === this.#nameElem.textContent) {\n this.#nameElem.title = name;\n }\n this.#nameElem.textContent = name;\n return this;\n }\n tooltip(tip) {\n this.#nameElem.title = tip;\n }\n}\n\n","import {addTask, removeTask} from '../libs/taskrunner.js';\nimport { isTypedArray } from '../libs/utils.js';\nimport LabelController from './LabelController.js';\n\nexport default class ValueController extends LabelController {\n #object;\n #property;\n #initialValue;\n #listening;\n #views;\n #updateFn;\n\n constructor(object, property, className = '') {\n super(className, property);\n this.#object = object;\n this.#property = property;\n this.#initialValue = this.getValue();\n this.#listening = false;\n this.#views = [];\n }\n get initialValue() {\n return this.#initialValue;\n }\n get object() {\n return this.#object;\n }\n get property() {\n return this.#property;\n }\n add(view) {\n this.#views.push(view);\n super.add(view);\n this.updateDisplay();\n return view;\n }\n #setValueImpl(v, ignoreCache) {\n let isDifferent = false;\n if (typeof v === 'object') {\n const dst = this.#object[this.#property];\n // don't replace objects, just their values.\n if (Array.isArray(v) || isTypedArray(v)) {\n for (let i = 0; i < v.length; ++i) {\n isDifferent ||= dst[i] !== v[i];\n dst[i] = v[i];\n }\n } else {\n for (const key of Object.keys(v)) {\n isDifferent ||= dst[key] !== v[key];\n }\n Object.assign(dst, v);\n }\n } else {\n isDifferent = this.#object[this.#property] !== v;\n this.#object[this.#property] = v;\n }\n this.updateDisplay(ignoreCache);\n if (isDifferent) {\n this.emitChange(this.getValue(), this.#object, this.#property);\n }\n return isDifferent;\n }\n setValue(v) {\n this.#setValueImpl(v);\n }\n setFinalValue(v) {\n const isDifferent = this.#setValueImpl(v, true);\n if (isDifferent) {\n this.emitFinalChange(this.getValue(), this.#object, this.#property);\n }\n return this;\n }\n updateDisplay(ignoreCache) {\n const newV = this.getValue();\n for (const view of this.#views) {\n view.updateDisplayIfNeeded(newV, ignoreCache);\n }\n return this;\n }\n setOptions(options) {\n for (const view of this.#views) {\n view.setOptions(options);\n }\n this.updateDisplay();\n return this;\n }\n getValue() {\n return this.#object[this.#property];\n }\n value(v) {\n this.setValue(v);\n return this;\n }\n reset() {\n this.setValue(this.#initialValue);\n return this;\n }\n listen(listen = true) {\n if (!this.#updateFn) {\n this.#updateFn = this.updateDisplay.bind(this);\n }\n if (listen) {\n if (!this.#listening) {\n this.#listening = true;\n addTask(this.#updateFn);\n }\n } else {\n if (this.#listening) {\n this.#listening = false;\n removeTask(this.#updateFn);\n }\n }\n return this;\n }\n}\n\n","import CheckboxView from '../views/CheckboxView.js';\nimport ValueController from './ValueController.js';\n\nexport default class Checkbox extends ValueController {\n constructor(object, property) {\n super(object, property, 'muigui-checkbox');\n const id = this.id;\n this.add(new CheckboxView(this, id));\n this.updateDisplay();\n }\n}","import {\n makeRangeConverters,\n} from './utils.js';\n\nexport const identity = {\n to: v => v,\n from: v => [true, v],\n};\n\n// from: from string to value\n// to: from value to string\nexport const strToNumber = {\n to: v => v.toString(),\n from: v => {\n const newV = parseFloat(v);\n return [!Number.isNaN(newV), newV];\n },\n};\n\nexport const converters = {\n radToDeg: makeRangeConverters({to: [0, 180], from: [0, Math.PI]}),\n};\n","export function createWheelHelper() {\n let wheelAccum = 0;\n return function (e, step, wheelScale = 5) {\n wheelAccum -= e.deltaY * step / wheelScale;\n const wheelSteps = Math.floor(Math.abs(wheelAccum) / step) * Math.sign(wheelAccum);\n const delta = wheelSteps * step;\n wheelAccum -= delta;\n return delta;\n };\n}\n","import { createElem } from '../libs/elem.js';\nimport { strToNumber } from '../libs/conversions.js';\nimport { createWheelHelper } from '../libs/wheel.js';\nimport { clamp, copyExistingProperties, stepify } from '../libs/utils.js';\nimport EditView from './EditView.js';\n\nexport default class NumberView extends EditView {\n #to;\n #from;\n #step;\n #skipUpdate;\n #options = {\n step: 0.01,\n converters: strToNumber,\n min: Number.NEGATIVE_INFINITY,\n max: Number.POSITIVE_INFINITY,\n };\n\n constructor(setter, options) {\n const setValue = setter.setValue.bind(setter);\n const setFinalValue = setter.setFinalValue.bind(setter);\n const wheelHelper = createWheelHelper();\n super(createElem('input', {\n type: 'number',\n onInput: () => {\n this.#handleInput(setValue, true);\n },\n onChange: () => {\n this.#handleInput(setFinalValue, false);\n },\n onWheel: e => {\n e.preventDefault();\n const {min, max, step} = this.#options;\n const delta = wheelHelper(e, step);\n const v = parseFloat(this.domElement.value);\n const newV = clamp(stepify(v + delta, v => v, step), min, max);\n const [valid, outV] = this.#from(newV);\n if (valid) {\n setter.setValue(outV);\n }\n },\n }));\n this.setOptions(options);\n }\n #handleInput(setFn, skipUpdate) {\n const v = parseFloat(this.domElement.value);\n const [valid, newV] = this.#from(v);\n let inRange;\n if (valid && !Number.isNaN(v)) {\n const {min, max} = this.#options;\n inRange = newV >= min && newV <= max;\n this.#skipUpdate = skipUpdate;\n setFn(clamp(newV, min, max));\n }\n this.domElement.classList.toggle('muigui-invalid-value', !valid || !inRange);\n }\n updateDisplay(v) {\n if (!this.#skipUpdate) {\n this.domElement.value = stepify(v, this.#to, this.#step);\n }\n this.#skipUpdate = false;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {\n step,\n converters: {to, from},\n } = this.#options;\n this.#to = to;\n this.#from = from;\n this.#step = step;\n return this;\n }\n}\n","\nimport NumberView from '../views/NumberView.js';\nimport ValueController from './ValueController.js';\n\n// Wanted to name this `Number` but it conflicts with\n// JavaScript `Number`. It most likely wouldn't be\n// an issue? But users might `import {Number} ...` and\n// things would break.\nexport default class TextNumber extends ValueController {\n #textView;\n #step;\n\n constructor(object, property, options = {}) {\n super(object, property, 'muigui-text-number');\n this.#textView = this.add(new NumberView(this, options));\n this.updateDisplay();\n }\n}","import { createElem } from '../libs/elem.js';\nimport EditView from './EditView.js';\n\nexport default class SelectView extends EditView {\n #values;\n\n constructor(setter, keyValues) {\n const values = [];\n super(createElem('select', {\n onChange: () => {\n setter.setFinalValue(this.#values[this.domElement.selectedIndex]);\n },\n }, keyValues.map(([key, value]) => {\n values.push(value);\n return createElem('option', {textContent: key});\n })));\n this.#values = values;\n }\n updateDisplay(v) {\n const ndx = this.#values.indexOf(v);\n this.domElement.selectedIndex = ndx;\n }\n}\n","\n// 4 cases\n// (a) keyValues is array of arrays, each sub array is key value\n// (b) keyValues is array and value is number then keys = array contents, value = index\n// (c) keyValues is array and value is not number, key = array contents, value = array contents\n// (d) keyValues is object then key->value\nexport function convertToKeyValues(keyValues, valueIsNumber) {\n if (Array.isArray(keyValues)) {\n if (Array.isArray(keyValues[0])) {\n // (a) keyValues is array of arrays, each sub array is key value\n return keyValues;\n } else {\n if (valueIsNumber) {\n // (b) keyValues is array and value is number then keys = array contents, value = index\n return keyValues.map((v, ndx) => [v, ndx]);\n } else {\n // (c) keyValues is array and value is not number, key = array contents, value = array contents\n return keyValues.map(v => [v, v]);\n }\n }\n } else {\n // (d)\n return [...Object.entries(keyValues)];\n }\n}\n","import SelectView from '../views/SelectView.js';\nimport ValueController from './ValueController.js';\nimport { convertToKeyValues } from '../libs/key-values.js';\n\nexport default class Select extends ValueController {\n constructor(object, property, options) {\n super(object, property, 'muigui-select');\n const valueIsNumber = typeof this.getValue() === 'number';\n const {keyValues: keyValuesInput} = options;\n const keyValues = convertToKeyValues(keyValuesInput, valueIsNumber);\n this.add(new SelectView(this, keyValues));\n this.updateDisplay();\n }\n}","import { createElem } from '../libs/elem.js';\nimport { identity } from '../libs/conversions.js';\nimport { clamp, copyExistingProperties, stepify } from '../libs/utils.js';\nimport { createWheelHelper } from '../libs/wheel.js';\nimport EditView from './EditView.js';\n\nexport default class RangeView extends EditView {\n #to;\n #from;\n #step;\n #skipUpdate;\n #options = {\n step: 0.01,\n min: 0,\n max: 1,\n converters: identity,\n };\n\n constructor(setter, options) {\n const wheelHelper = createWheelHelper();\n super(createElem('input', {\n type: 'range',\n onInput: () => {\n this.#skipUpdate = true;\n const {min, max, step} = this.#options;\n const v = parseFloat(this.domElement.value);\n const newV = clamp(stepify(v, v => v, step), min, max);\n const [valid, validV] = this.#from(newV);\n if (valid) {\n setter.setValue(validV);\n }\n },\n onChange: () => {\n this.#skipUpdate = true;\n const {min, max, step} = this.#options;\n const v = parseFloat(this.domElement.value);\n const newV = clamp(stepify(v, v => v, step), min, max);\n const [valid, validV] = this.#from(newV);\n if (valid) {\n setter.setFinalValue(validV);\n }\n },\n onWheel: e => {\n e.preventDefault();\n const [valid, v] = this.#from(parseFloat(this.domElement.value));\n if (!valid) {\n return;\n }\n const {min, max, step} = this.#options;\n const delta = wheelHelper(e, step);\n const newV = clamp(stepify(v + delta, v => v, step), min, max);\n setter.setValue(newV);\n },\n }));\n this.setOptions(options);\n }\n updateDisplay(v) {\n if (!this.#skipUpdate) {\n this.domElement.value = stepify(v, this.#to, this.#step);\n }\n this.#skipUpdate = false;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {\n step,\n min,\n max,\n converters: {to, from},\n } = this.#options;\n this.#to = to;\n this.#from = from;\n this.#step = step;\n this.domElement.step = step;\n this.domElement.min = min;\n this.domElement.max = max;\n return this;\n }\n}","import ValueController from './ValueController.js';\nimport NumberView from '../views/NumberView.js';\nimport RangeView from '../views/RangeView.js';\n\nexport default class Range extends ValueController {\n constructor(object, property, options) {\n super(object, property, 'muigui-range');\n this.add(new RangeView(this, options));\n this.add(new NumberView(this, options));\n }\n}\n","import { createElem } from '../libs/elem.js';\nimport { identity } from '../libs/conversions.js';\nimport EditView from './EditView.js';\nimport { copyExistingProperties } from '../libs/utils.js';\n\nexport default class TextView extends EditView {\n #to;\n #from;\n #skipUpdate;\n #options = {\n converters: identity,\n };\n\n constructor(setter, options) {\n const setValue = setter.setValue.bind(setter);\n const setFinalValue = setter.setFinalValue.bind(setter);\n super(createElem('input', {\n type: 'text',\n onInput: () => {\n this.#handleInput(setValue, true);\n },\n onChange: () => {\n this.#handleInput(setFinalValue, false);\n },\n }));\n this.setOptions(options);\n }\n #handleInput(setFn, skipUpdate) {\n const [valid, newV] = this.#from(this.domElement.value);\n if (valid) {\n this.#skipUpdate = skipUpdate;\n setFn(newV);\n }\n this.domElement.style.color = valid ? '' : 'var(--invalid-color)';\n\n }\n updateDisplay(v) {\n if (!this.#skipUpdate) {\n this.domElement.value = this.#to(v);\n this.domElement.style.color = '';\n }\n this.#skipUpdate = false;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {\n converters: {to, from},\n } = this.#options;\n this.#to = to;\n this.#from = from;\n return this;\n }\n}\n","import TextView from '../views/TextView.js';\nimport ValueController from './ValueController.js';\n\nexport default class Text extends ValueController {\n constructor(object, property) {\n super(object, property, 'muigui-text');\n this.add(new TextView(this));\n this.updateDisplay();\n }\n}","import Button from './Button.js';\nimport Checkbox from './Checkbox.js';\nimport TextNumber from './TextNumber.js';\nimport Select from './Select.js';\nimport Range from './Range.js';\nimport Text from './Text.js';\n\n// const isConversion = o => typeof o.to === 'function' && typeof o.from === 'function';\n\n/**\n * possible inputs\n * add(o, p, min: number, max: number)\n * add(o, p, min: number, max: number, step: number)\n * add(o, p, array: [value])\n * add(o, p, array: [[key, value]])\n *\n * @param {*} object\n * @param {string} property\n * @param {...any} args\n * @returns {Controller}\n */\nexport function createController(object, property, ...args) {\n const [arg1] = args;\n if (Array.isArray(arg1)) {\n return new Select(object, property, {keyValues: arg1});\n }\n if (arg1 && arg1.keyValues) {\n return new Select(object, property, {keyValues: arg1.keyValues});\n }\n\n const t = typeof object[property];\n switch (t) {\n case 'number':\n if (typeof args[0] === 'number' && typeof args[1] === 'number') {\n const min = args[0];\n const max = args[1];\n const step = args[2];\n return new Range(object, property, {min, max, ...(step && {step})});\n }\n return args.length === 0\n ? new TextNumber(object, property, ...args)\n : new Range(object, property, ...args);\n case 'boolean':\n return new Checkbox(object, property, ...args);\n case 'function':\n return new Button(object, property, ...args);\n case 'string':\n return new Text(object, property, ...args);\n case 'undefined':\n throw new Error(`no property named ${property}`);\n default:\n throw new Error(`unhandled type ${t} for property ${property}`);\n }\n}","const clamp = (v, min, max) => Math.max(min, Math.min(max, v));\nconst lerp = (a, b, t) => a + (b - a) * t;\nconst fract = v => v >= 0 ? v % 1 : 1 - (v % 1);\n\nconst f0 = v => +v.toFixed(0); // converts to string (eg 1.2 => \"1\"), then converts back to number (eg, \"1.200\" => 1.2)\nconst f3 = v => +v.toFixed(3); // converts to string (eg 1.2 => \"1.200\"), then converts back to number (eg, \"1.200\" => 1.2)\n\nconst hexToUint32RGB = v => (parseInt(v.substring(1, 3), 16) << 16) |\n (parseInt(v.substring(3, 5), 16) << 8 ) |\n (parseInt(v.substring(5, 7), 16) );\nconst uint32RGBToHex = v => `#${(Math.round(v)).toString(16).padStart(6, '0')}`;\nconst hexToUint32RGBA = v => (parseInt(v.substring(1, 3), 16) * 2 ** 24) +\n (parseInt(v.substring(3, 5), 16) * 2 ** 16) +\n (parseInt(v.substring(5, 7), 16) * 2 ** 8) +\n (parseInt(v.substring(7, 9), 16) );\nconst uint32RGBAToHex = v => `#${(Math.round(v)).toString(16).padStart(8, '0')}`;\n\nexport const hexToUint8RGB = v => [\n parseInt(v.substring(1, 3), 16),\n parseInt(v.substring(3, 5), 16),\n parseInt(v.substring(5, 7), 16),\n];\nexport const uint8RGBToHex = v => `#${Array.from(v).map(v => v.toString(16).padStart(2, '0')).join('')}`;\n\nexport const hexToUint8RGBA = v => [\n parseInt(v.substring(1, 3), 16),\n parseInt(v.substring(3, 5), 16),\n parseInt(v.substring(5, 7), 16),\n parseInt(v.substring(7, 9), 16),\n];\nexport const uint8RGBAToHex = v => `#${Array.from(v).map(v => v.toString(16).padStart(2, '0')).join('')}`;\n\nexport const hexToFloatRGB = v => hexToUint8RGB(v).map(v => f3(v / 255));\nexport const floatRGBToHex = v => uint8RGBToHex(Array.from(v).map(v => Math.round(clamp(v * 255, 0, 255))));\n\nexport const hexToFloatRGBA = v => hexToUint8RGBA(v).map(v => f3(v / 255));\nexport const floatRGBAToHex = v => uint8RGBAToHex(Array.from(v).map(v => Math.round(clamp(v * 255, 0, 255))));\n\nconst scaleAndClamp = v => clamp(Math.round(v * 255), 0, 255).toString(16).padStart(2, '0');\n\nconst hexToObjectRGB = v => ({\n r: parseInt(v.substring(1, 3), 16) / 255,\n g: parseInt(v.substring(3, 5), 16) / 255,\n b: parseInt(v.substring(5, 7), 16) / 255,\n});\nconst objectRGBToHex = v => `#${scaleAndClamp(v.r)}${scaleAndClamp(v.g)}${scaleAndClamp(v.b)}`;\nconst hexToObjectRGBA = v => ({\n r: parseInt(v.substring(1, 3), 16) / 255,\n g: parseInt(v.substring(3, 5), 16) / 255,\n b: parseInt(v.substring(5, 7), 16) / 255,\n a: parseInt(v.substring(7, 9), 16) / 255,\n});\nconst objectRGBAToHex = v => `#${scaleAndClamp(v.r)}${scaleAndClamp(v.g)}${scaleAndClamp(v.b)}${scaleAndClamp(v.a)}`;\n\nconst hexToCssRGB = v => `rgb(${hexToUint8RGB(v).join(', ')})`;\nconst cssRGBRegex = /^\\s*rgb\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*\\)\\s*$/;\nconst cssRGBToHex = v => {\n const m = cssRGBRegex.exec(v);\n return uint8RGBToHex([m[1], m[2], m[3]].map(v => parseInt(v)));\n};\nconst hexToCssRGBA = v => `rgba(${hexToUint8RGBA(v).map((v, i) => i === 3 ? v / 255 : v).join(', ')})`;\nconst cssRGBARegex = /^\\s*rgba\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+\\.\\d+|\\d+)\\s*\\)\\s*$/;\nconst cssRGBAToHex = v => {\n const m = cssRGBARegex.exec(v);\n return uint8RGBAToHex([m[1], m[2], m[3], m[4]].map((v, i) => i === 3 ? (parseFloat(v) * 255 | 0) : parseInt(v)));\n};\n\nconst hexToCssHSL = v => {\n const hsl = rgbUint8ToHsl(hexToUint8RGB(v)).map(v => f0(v));\n return `hsl(${hsl[0]}, ${hsl[1]}%, ${hsl[2]}%)`;\n};\nconst hexToCssHSLA = v => {\n const hsla = rgbaUint8ToHsla(hexToUint8RGBA(v)).map((v, i) => i === 3 ? f3(v) : f0(v));\n return `hsl(${hsla[0]} ${hsla[1]}% ${hsla[2]}% / ${hsla[3]})`;\n};\nconst cssHSLRegex = /^\\s*hsl\\(\\s*(\\d+)(?:deg|)\\s*(?:,|)\\s*(\\d+)%\\s*(?:,|)\\s*(\\d+)%\\s*\\)\\s*$/;\nconst cssHSLARegex = /^\\s*hsl\\(\\s*(\\d+)(?:deg|)\\s*(?:,|)\\s*(\\d+)%\\s*(?:,|)\\s*(\\d+)%\\s*\\/\\s*(\\d+\\.\\d+|\\d+)\\s*\\)\\s*$/;\n\nconst hex3DigitTo6Digit = v => `${v[0]}${v[0]}${v[1]}${v[1]}${v[2]}${v[2]}`;\nconst cssHSLToHex = v => {\n const m = cssHSLRegex.exec(v);\n const rgb = hslToRgbUint8([m[1], m[2], m[3]].map(v => parseFloat(v)));\n return uint8RGBToHex(rgb);\n};\nconst cssHSLAToHex = v => {\n const m = cssHSLARegex.exec(v);\n const rgba = hslaToRgbaUint8([m[1], m[2], m[3], m[4]].map(v => parseFloat(v)));\n return uint8RGBAToHex(rgba);\n};\n\nconst euclideanModulo = (v, n) => ((v % n) + n) % n;\n\nexport function hslToRgbUint8([h, s, l]) {\n h = euclideanModulo(h, 360);\n s = clamp(s / 100, 0, 1);\n l = clamp(l / 100, 0, 1);\n\n const a = s * Math.min(l, 1 - l);\n\n function f(n) {\n const k = (n + h / 30) % 12;\n return l - a * Math.max(-1, Math.min(k - 3, 9 - k, 1));\n }\n\n return [f(0), f(8), f(4)].map(v => Math.round(v * 255));\n}\n\nexport function hslaToRgbaUint8([h, s, l, a]) {\n const rgb = hslToRgbUint8([h, s, l]);\n return [...rgb, a * 255 | 0];\n}\n\nexport function rgbFloatToHsl01([r, g, b]) {\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const l = (min + max) * 0.5;\n const d = max - min;\n let h = 0;\n let s = 0;\n\n if (d !== 0) {\n s = (l === 0 || l === 1)\n ? 0\n : (max - l) / Math.min(l, 1 - l);\n\n switch (max) {\n case r: h = (g - b) / d + (g < b ? 6 : 0); break;\n case g: h = (b - r) / d + 2; break;\n case b: h = (r - g) / d + 4;\n }\n }\n\n return [h / 6, s, l];\n}\n\nexport function rgbaFloatToHsla01([r, g, b, a]) {\n const hsl = rgbFloatToHsl01([r, g, b]);\n return [...hsl, a];\n}\n\nexport const rgbUint8ToHsl = (rgb) => {\n const [h, s, l] = rgbFloatToHsl01(rgb.map(v => v / 255));\n return [h * 360, s * 100, l * 100];\n};\n\nexport const rgbaUint8ToHsla = (rgba) => {\n const [h, s, l, a] = rgbaFloatToHsla01(rgba.map(v => v / 255));\n return [h * 360, s * 100, l * 100, a];\n};\n\nexport function hsv01ToRGBFloat([hue, sat, val]) {\n sat = clamp(sat, 0, 1);\n val = clamp(val, 0, 1);\n return [hue, hue + 2 / 3, hue + 1 / 3].map(\n v => lerp(1, clamp(Math.abs(fract(v) * 6 - 3.0) - 1, 0, 1), sat) * val\n );\n}\n\nexport function hsva01ToRGBAFloat([hue, sat, val, alpha]) {\n const rgb = hsv01ToRGBFloat([hue, sat, val]);\n return [...rgb, alpha];\n}\n\nconst round3 = v => Math.round(v * 1000) / 1000;\n\nexport function rgbFloatToHSV01([r, g, b]) {\n const p = b > g\n ? [b, g, -1, 2 / 3]\n : [g, b, 0, -1 / 3];\n const q = p[0] > r\n ? [p[0], p[1], p[3], r]\n : [r, p[1], p[2], p[0]];\n const d = q[0] - Math.min(q[3], q[1]);\n return [\n Math.abs(q[2] + (q[3] - q[1]) / (6 * d + Number.EPSILON)),\n d / (q[0] + Number.EPSILON),\n q[0],\n ].map(round3);\n}\n\nexport function rgbaFloatToHSVA01([r, g, b, a]) {\n const hsv = rgbFloatToHSV01([r, g, b]);\n return [...hsv, a];\n}\n\n// window.hsv01ToRGBFloat = hsv01ToRGBFloat;\n// window.rgbFloatToHSV01 = rgbFloatToHSV01;\n\n// Yea, meh!\nexport const hasAlpha = format => format.endsWith('a') || format.startsWith('hex8');\n\nconst cssStringFormats = [\n { re: /^#(?:[0-9a-f]){6}$/i, format: 'hex6' },\n { re: /^(?:[0-9a-f]){6}$/i, format: 'hex6-no-hash' },\n { re: /^#(?:[0-9a-f]){8}$/i, format: 'hex8' },\n { re: /^(?:[0-9a-f]){8}$/i, format: 'hex8-no-hash' },\n { re: /^#(?:[0-9a-f]){3}$/i, format: 'hex3' },\n { re: /^(?:[0-9a-f]){3}$/i, format: 'hex3-no-hash' },\n { re: cssRGBRegex, format: 'css-rgb' },\n { re: cssHSLRegex, format: 'css-hsl' },\n { re: cssRGBARegex, format: 'css-rgba' },\n { re: cssHSLARegex, format: 'css-hsla' },\n];\n\nfunction guessStringColorFormat(v) {\n for (const formatInfo of cssStringFormats) {\n if (formatInfo.re.test(v)) {\n return formatInfo;\n }\n }\n return undefined;\n}\n\nexport function guessFormat(v) {\n switch (typeof v) {\n case 'number':\n console.warn('can not reliably guess format based on a number. You should pass in a format like {format: \"uint32-rgb\"} or {format: \"uint32-rgb\"}');\n return v <= 0xFFFFFF ? 'uint32-rgb' : 'uint32-rgba';\n case 'string': {\n const formatInfo = guessStringColorFormat(v.trim());\n if (formatInfo) {\n return formatInfo.format;\n }\n break;\n }\n case 'object':\n if (v instanceof Uint8Array || v instanceof Uint8ClampedArray) {\n if (v.length === 3) {\n return 'uint8-rgb';\n } else if (v.length === 4) {\n return 'uint8-rgba';\n }\n } else if (v instanceof Float32Array) {\n if (v.length === 3) {\n return 'float-rgb';\n } else if (v.length === 4) {\n return 'float-rgba';\n }\n } else if (Array.isArray(v)) {\n if (v.length === 3) {\n return 'float-rgb';\n } else if (v.length === 4) {\n return 'float-rgba';\n }\n } else {\n if ('r' in v && 'g' in v && 'b' in v) {\n if ('a' in v) {\n return 'object-rgba';\n } else {\n return 'object-rgb';\n }\n }\n }\n }\n throw new Error(`unknown color format: ${v}`);\n}\n\nfunction fixHex6(v) {\n return v.trim(v);\n //const formatInfo = guessStringColorFormat(v.trim());\n //const fix = formatInfo ? formatInfo.fix : v => v;\n //return fix(v.trim());\n}\n\nfunction fixHex8(v) {\n return v.trim(v);\n //const formatInfo = guessStringColorFormat(v.trim());\n //const fix = formatInfo ? formatInfo.fix : v => v;\n //return fix(v.trim());\n}\n\nfunction hex6ToHex3(hex6) {\n return (hex6[1] === hex6[2] &&\n hex6[3] === hex6[4] &&\n hex6[5] === hex6[6])\n ? `#${hex6[1]}${hex6[3]}${hex6[5]}`\n : hex6;\n}\n\nconst hex3RE = /^(#|)([0-9a-f]{3})$/i;\nfunction hex3ToHex6(hex3) {\n const m = hex3RE.exec(hex3);\n if (m) {\n const [, , m2] = m;\n return `#${hex3DigitTo6Digit(m2)}`;\n }\n return hex3;\n}\n\nfunction fixHex3(v) {\n return hex6ToHex3(fixHex6(v));\n}\n\nconst strToRGBObject = (s) => {\n try {\n const json = s.replace(/([a-z])/g, '\"$1\"');\n const rgb = JSON.parse(json);\n if (Number.isNaN(rgb.r) || Number.isNaN(rgb.g) || Number.isNaN(rgb.b)) {\n throw new Error('not {r, g, b}');\n }\n return [true, rgb];\n } catch (e) {\n return [false];\n }\n};\n\nconst strToRGBAObject = (s) => {\n try {\n const json = s.replace(/([a-z])/g, '\"$1\"');\n const rgba = JSON.parse(json);\n if (Number.isNaN(rgba.r) || Number.isNaN(rgba.g) || Number.isNaN(rgba.b) || Number.isNaN(rgba.a)) {\n throw new Error('not {r, g, b, a}');\n }\n return [true, rgba];\n } catch (e) {\n return [false];\n }\n};\n\nconst strToCssRGB = s => {\n const m = cssRGBRegex.exec(s);\n if (!m) {\n return [false];\n }\n const v = [m[1], m[2], m[3]].map(v => parseInt(v));\n const outOfRange = v.find(v => v > 255);\n return [!outOfRange, `rgb(${v.join(', ')})`];\n};\n\nconst strToCssRGBA = s => {\n const m = cssRGBARegex.exec(s);\n if (!m) {\n return [false];\n }\n const v = [m[1], m[2], m[3], m[4]].map((v, i) => i === 3 ? parseFloat(v) : parseInt(v));\n const outOfRange = v.find(v => v > 255);\n return [!outOfRange, `rgba(${v.join(', ')})`];\n};\n\nconst strToCssHSL = s => {\n const m = cssHSLRegex.exec(s);\n if (!m) {\n return [false];\n }\n const v = [m[1], m[2], m[3]].map(v => parseFloat(v));\n const outOfRange = v.find(v => Number.isNaN(v));\n return [!outOfRange, `hsl(${v[0]}, ${v[1]}%, ${v[2]}%)`];\n};\n\nconst strToCssHSLA = s => {\n const m = cssHSLARegex.exec(s);\n if (!m) {\n return [false];\n }\n const v = [m[1], m[2], m[3], m[4]].map(v => parseFloat(v));\n const outOfRange = v.find(v => Number.isNaN(v));\n return [!outOfRange, `hsl(${v[0]} ${v[1]}% ${v[2]}% / ${v[3]})`];\n};\n\nconst rgbObjectToStr = rgb => {\n return `{r:${f3(rgb.r)}, g:${f3(rgb.g)}, b:${f3(rgb.b)}}`;\n};\nconst rgbaObjectToStr = rgba => {\n return `{r:${f3(rgba.r)}, g:${f3(rgba.g)}, b:${f3(rgba.b)}}, a:${f3(rgba.a)}}`;\n};\n\nconst strTo3IntsRE = /^\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*$/;\nconst strTo3Ints = s => {\n const m = strTo3IntsRE.exec(s);\n if (!m) {\n return [false];\n }\n const v = [m[1], m[2], m[3]].map(v => parseInt(v));\n const outOfRange = v.find(v => v > 255);\n return [!outOfRange, v];\n};\n\nconst strTo4IntsRE = /^\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*$/;\nconst strTo4Ints = s => {\n const m = strTo4IntsRE.exec(s);\n if (!m) {\n return [false];\n }\n const v = [m[1], m[2], m[3], m[4]].map(v => parseInt(v));\n const outOfRange = v.find(v => v > 255);\n return [!outOfRange, v];\n};\n\nconst strTo3Floats = s => {\n const numbers = s.split(',').map(s => s.trim());\n const v = numbers.map(v => parseFloat(v));\n if (v.length !== 3) {\n return [false];\n }\n // Note: using isNaN not Number.isNaN\n const badNdx = numbers.findIndex(v => isNaN(v));\n return [badNdx < 0, v.map(v => f3(v))];\n};\n\nconst strTo4Floats = s => {\n const numbers = s.split(',').map(s => s.trim());\n const v = numbers.map(v => parseFloat(v));\n if (v.length !== 4) {\n return [false];\n }\n // Note: using isNaN not Number.isNaN\n const badNdx = numbers.findIndex(v => isNaN(v));\n return [badNdx < 0, v.map(v => f3(v))];\n};\n\nconst strToUint32RGBRegex = /^\\s*(?:0x){0,1}([0-9a-z]{1,6})\\s*$/i;\nconst strToUint32RGB = s => {\n const m = strToUint32RGBRegex.exec(s);\n if (!m) {\n return [false];\n }\n return [true, parseInt(m[1], 16)];\n};\n\nconst strToUint32RGBARegex = /^\\s*(?:0x){0,1}([0-9a-z]{1,8})\\s*$/i;\nconst strToUint32RGBA = s => {\n const m = strToUint32RGBARegex.exec(s);\n if (!m) {\n return [false];\n }\n return [true, parseInt(m[1], 16)];\n};\n\nconst hex6RE = /^\\s*#[a-f0-9]{6}\\s*$|^\\s*#[a-f0-9]{3}\\s*$/i;\nconst hexNoHash6RE = /^\\s*[a-f0-9]{6}\\s*$/i;\nconst hex8RE = /^\\s*#[a-f0-9]{8}\\s*$/i;\nconst hexNoHash8RE = /^\\s*[a-f0-9]{8}\\s*$/i;\n\n// For each format converter\n//\n// fromHex/toHex convert from/to '#RRGGBB'\n//\n// fromHex converts from the string '#RRBBGG' to the format\n// (eg: for uint32-rgb, '#123456' becomes 0x123456)\n//\n// toHex converts from the format to '#RRGGBB'\n// (eg: for uint8-rgb, [16, 33, 50] becomes '#102132')\n//\n//\n// fromStr/toStr convert from/to what's in the input[type=text] element\n//\n// toStr converts from the format to its string representation\n// (eg, for object-rgb, {r: 1, g: 0.5, b:0} becomes \"{r: 1, g: 0.5, b:0}\")\n// ^object ^string\n//\n// fromStr converts its string representation to its format\n// (eg, for object-rgb) \"{r: 1, g: 0.5, b:0}\" becomes {r: 1, g: 0.5, b:0})\n// ^string ^object\n// fromString returns an array which is [valid, v]\n// where valid is true if the string was a valid and v is the converted\n// format if v is true.\n//\n// Note: toStr should convert to \"ideal\" form (whatever that is).\n// (eg, for css-rgb\n// \"{ r: 0.10000, g: 001, b: 0}\" becomes \"{r: 0.1, g: 1, b: 0}\"\n// notice that css-rgb is a string to a string\n// )\nexport const colorFormatConverters = {\n 'hex6': {\n color: {\n from: v => [true, v],\n to: fixHex6,\n },\n text: {\n from: v => [hex6RE.test(v), v.trim()],\n to: v => v,\n },\n },\n 'hex8': {\n color: {\n from: v => [true, v],\n to: fixHex8,\n },\n text: {\n from: v => [hex8RE.test(v), v.trim()],\n to: v => v,\n },\n },\n 'hex3': {\n color: {\n from: v => [true, fixHex3(v)],\n to: hex3ToHex6,\n },\n text: {\n from: v => [hex6RE.test(v), hex6ToHex3(v.trim())],\n to: v => v,\n },\n },\n 'hex6-no-hash': {\n color: {\n from: v => [true, v.substring(1)],\n to: v => `#${fixHex6(v)}`,\n },\n text: {\n from: v => [hexNoHash6RE.test(v), v.trim()],\n to: v => v,\n },\n },\n 'hex8-no-hash': {\n color: {\n from: v => [true, v.substring(1)],\n to: v => `#${fixHex8(v)}`,\n },\n text: {\n from: v => [hexNoHash8RE.test(v), v.trim()],\n to: v => v,\n },\n },\n 'hex3-no-hash': {\n color: {\n from: v => [true, fixHex3(v).substring(1)],\n to: hex3ToHex6,\n },\n text: {\n from: v => [hexNoHash6RE.test(v), hex6ToHex3(v.trim())],\n to: v => v,\n },\n },\n 'uint32-rgb': {\n color: {\n from: v => [true, hexToUint32RGB(v)],\n to: uint32RGBToHex,\n },\n text: {\n from: v => strToUint32RGB(v),\n to: v => `0x${v.toString(16).padStart(6, '0')}`,\n },\n },\n 'uint32-rgba': {\n color: {\n from: v => [true, hexToUint32RGBA(v)],\n to: uint32RGBAToHex,\n },\n text: {\n from: v => strToUint32RGBA(v),\n to: v => `0x${v.toString(16).padStart(8, '0')}`,\n },\n },\n 'uint8-rgb': {\n color: {\n from: v => [true, hexToUint8RGB(v)],\n to: uint8RGBToHex,\n },\n text: {\n from: strTo3Ints,\n to: v => v.join(', '),\n },\n },\n 'uint8-rgba': {\n color: {\n from: v => [true, hexToUint8RGBA(v)],\n to: uint8RGBAToHex,\n },\n text: {\n from: strTo4Ints,\n to: v => v.join(', '),\n },\n },\n 'float-rgb': {\n color: {\n from: v => [true, hexToFloatRGB(v)],\n to: floatRGBToHex,\n },\n text: {\n from: strTo3Floats,\n // need Array.from because map of Float32Array makes a Float32Array\n to: v => Array.from(v).map(v => f3(v)).join(', '),\n },\n },\n 'float-rgba': {\n color: {\n from: v => [true, hexToFloatRGBA(v)],\n to: floatRGBAToHex,\n },\n text: {\n from: strTo4Floats,\n // need Array.from because map of Float32Array makes a Float32Array\n to: v => Array.from(v).map(v => f3(v)).join(', '),\n },\n },\n 'float-hsv': {\n color: {\n from: v => [true, rgbFloatToHSV01(hexToFloatRGB(v))],\n to: v => hsv01ToRGBFloat(floatRGBToHex(v)),\n },\n text: {\n from: strTo3Floats,\n // need Array.from because map of Float32Array makes a Float32Array\n to: v => Array.from(v).map(v => f3(v)).join(', '),\n },\n },\n 'float-hsva': {\n color: {\n from: v => [true, rgbaFloatToHSVA01(hexToFloatRGB(v))],\n to: v => hsva01ToRGBAFloat(floatRGBToHex(v)),\n },\n text: {\n from: strTo4Floats,\n // need Array.from because map of Float32Array makes a Float32Array\n to: v => Array.from(v).map(v => f3(v)).join(', '),\n },\n },\n //'float-hsl': {\n // color: {\n // from: v => [true, rgbFloatToHsl01(hexToFloatRGB(v))],\n // to: v => hsl01ToRGBFloat(floatRGBToHex(v)),\n // },\n // text: {\n // from: strTo3Floats,\n // // need Array.from because map of Float32Array makes a Float32Array\n // to: v => Array.from(v).map(v => f3(v)).join(', '),\n // },\n //},\n //'float-hsla': {\n // color: {\n // from: v => [true, hexToFloatRGBA(v)],\n // to: floatRGBAToHex,\n // },\n // text: {\n // from: strTo4Floats,\n // // need Array.from because map of Float32Array makes a Float32Array\n // to: v => Array.from(v).map(v => f3(v)).join(', '),\n // },\n //},\n 'object-rgb': {\n color: {\n from: v => [true, hexToObjectRGB(v)],\n to: objectRGBToHex,\n },\n text: {\n from: strToRGBObject,\n to: rgbObjectToStr,\n },\n },\n 'object-rgba': {\n color: {\n from: v => [true, hexToObjectRGBA(v)],\n to: objectRGBAToHex,\n },\n text: {\n from: strToRGBAObject,\n to: rgbaObjectToStr,\n },\n },\n 'css-rgb': {\n color: {\n from: v => [true, hexToCssRGB(v)],\n to: cssRGBToHex,\n },\n text: {\n from: strToCssRGB,\n to: v => strToCssRGB(v)[1],\n },\n },\n 'css-rgba': {\n color: {\n from: v => [true, hexToCssRGBA(v)],\n to: cssRGBAToHex,\n },\n text: {\n from: strToCssRGBA,\n to: v => strToCssRGBA(v)[1],\n },\n },\n 'css-hsl': {\n color: {\n from: v => [true, hexToCssHSL(v)],\n to: cssHSLToHex,\n },\n text: {\n from: strToCssHSL,\n to: v => strToCssHSL(v)[1],\n },\n },\n 'css-hsla': {\n color: {\n from: v => [true, hexToCssHSLA(v)],\n to: cssHSLAToHex,\n },\n text: {\n from: strToCssHSLA,\n to: v => strToCssHSLA(v)[1],\n },\n },\n};","import { createElem } from '../libs/elem.js';\nimport View from './View.js';\n\nexport default class ElementView extends View {\n constructor(tag, className) {\n super(createElem(tag, {className}));\n }\n}","import ElementView from '../views/ElementView.js';\nimport LabelController from './LabelController.js';\n\n// TODO: remove this? Should just be user side\nexport default class Canvas extends LabelController {\n #canvasElem;\n\n constructor(name) {\n super('muigui-canvas', name);\n this.#canvasElem = this.add(\n new ElementView('canvas', 'muigui-canvas'),\n ).domElement;\n }\n get canvas() {\n return this.#canvasElem;\n }\n listen() {\n return this;\n }\n}","import { createElem } from '../libs/elem.js';\nimport { identity } from '../libs/conversions.js';\nimport EditView from './EditView.js';\nimport { copyExistingProperties } from '../libs/utils.js';\n\nexport default class ColorView extends EditView {\n #to;\n #from;\n #colorElem;\n #skipUpdate;\n #options = {\n converters: identity,\n };\n\n constructor(setter, options) {\n const colorElem = createElem('input', {\n type: 'color',\n onInput: () => {\n const [valid, newV] = this.#from(colorElem.value);\n if (valid) {\n this.#skipUpdate = true;\n setter.setValue(newV);\n }\n },\n onChange: () => {\n const [valid, newV] = this.#from(colorElem.value);\n if (valid) {\n this.#skipUpdate = true;\n setter.setFinalValue(newV);\n }\n },\n });\n super(createElem('div', {}, [colorElem]));\n this.setOptions(options);\n this.#colorElem = colorElem;\n }\n updateDisplay(v) {\n if (!this.#skipUpdate) {\n this.#colorElem.value = this.#to(v);\n }\n this.#skipUpdate = false;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {converters: {to, from}} = this.#options;\n this.#to = to;\n this.#from = from;\n return this;\n }\n}\n","import {\n colorFormatConverters,\n guessFormat,\n} from '../libs/color-utils.js';\nimport ValueController from './ValueController.js';\nimport TextView from '../views/TextView.js';\nimport ColorView from '../views/ColorView.js';\n\nexport default class Color extends ValueController {\n #colorView;\n #textView;\n\n constructor(object, property, options = {}) {\n super(object, property, 'muigui-color');\n const format = options.format || guessFormat(this.getValue());\n const {color, text} = colorFormatConverters[format];\n this.#colorView = this.add(new ColorView(this, {converters: color}));\n this.#textView = this.add(new TextView(this, {converters: text}));\n this.updateDisplay();\n }\n setOptions(options) {\n const {format} = options;\n if (format) {\n const {color, text} = colorFormatConverters[format];\n this.#colorView.setOptions({converters: color});\n this.#textView.setOptions({converters: text});\n }\n super.setOptions(options);\n return this;\n }\n}","import Controller from './Controller.js';\n\n// This feels like it should be something else like\n// gui.addController({className: 'muigui-divider')};\nexport default class Divider extends Controller {\n constructor() {\n super('muigui-divider');\n }\n}","import Controller from './Controller.js';\n\nexport default class Container extends Controller {\n #controllers;\n #childDestController;\n\n constructor(className) {\n super(className);\n this.#controllers = [];\n this.#childDestController = this;\n }\n get children() {\n return this.#controllers; // should we return a copy?\n }\n get controllers() {\n return this.#controllers.filter(c => !(c instanceof Container));\n }\n get folders() {\n return this.#controllers.filter(c => c instanceof Container);\n }\n reset(recursive = true) {\n for (const controller of this.#controllers) {\n if (!(controller instanceof Container) || recursive) {\n controller.reset(recursive);\n }\n }\n return this;\n }\n updateDisplay() {\n for (const controller of this.#controllers) {\n controller.updateDisplay();\n }\n return this;\n }\n remove(controller) {\n const ndx = this.#controllers.indexOf(controller);\n if (ndx >= 0) {\n const c = this.#controllers.splice(ndx, 1);\n const c0 = c[0];\n const elem = c0.domElement;\n elem.remove();\n c0.setParent(null);\n }\n return this;\n }\n #addControllerImpl(controller) {\n this.domElement.appendChild(controller.domElement);\n this.#controllers.push(controller);\n controller.setParent(this);\n return controller;\n }\n addController(controller) {\n return this.#childDestController.#addControllerImpl(controller);\n }\n pushContainer(container) {\n this.addController(container);\n this.#childDestController = container;\n return container;\n }\n popContainer() {\n this.#childDestController = this.#childDestController.parent;\n return this;\n }\n listen() {\n this.#controllers.forEach(c => {\n c.listen();\n });\n return this;\n }\n}\n","import { createElem } from '../libs/elem.js';\nimport Container from './Container.js';\n\nexport default class Folder extends Container {\n #labelElem;\n\n constructor(name = 'Controls', className = 'muigui-menu') {\n super(className);\n this.#labelElem = createElem('label');\n this.addElem(createElem('button', {\n type: 'button',\n onClick: () => this.toggleOpen(),\n }, [this.#labelElem]));\n this.pushContainer(new Container('muigui-open-container'));\n this.pushContainer(new Container());\n this.name(name);\n this.open();\n }\n open(open = true) {\n this.domElement.classList.toggle('muigui-closed', !open);\n this.domElement.classList.toggle('muigui-open', open);\n return this;\n }\n close() {\n return this.open(false);\n }\n name(name) {\n this.#labelElem.textContent = name;\n return this;\n }\n title(title) {\n return this.name(title);\n }\n toggleOpen() {\n this.open(!this.domElement.classList.contains('muigui-open'));\n return this;\n }\n}\n","import Controller from './Controller.js';\n\n// This feels like it should be something else like\n// gui.addDividing = new Controller()\nexport default class Label extends Controller {\n constructor(text) {\n super('muigui-label');\n this.text(text);\n }\n text(text) {\n this.domElement.textContent = text;\n return this;\n }\n}","function noop() {\n}\n\nexport function computeRelativePosition(elem, event, start) {\n const rect = elem.getBoundingClientRect();\n const x = event.clientX - rect.left;\n const y = event.clientY - rect.top;\n const nx = x / rect.width;\n const ny = y / rect.height;\n start = start || [x, y];\n const dx = x - start[0];\n const dy = y - start[1];\n const ndx = dx / rect.width;\n const ndy = dy / rect.width;\n return {x, y, nx, ny, dx, dy, ndx, ndy};\n}\n\nexport function addTouchEvents(elem, {onDown = noop, onMove = noop, onUp = noop}) {\n let start;\n const pointerMove = function (event) {\n const e = {\n type: 'move',\n ...computeRelativePosition(elem, event, start),\n };\n onMove(e);\n };\n\n const pointerUp = function (event) {\n elem.releasePointerCapture(event.pointerId);\n elem.removeEventListener('pointermove', pointerMove);\n elem.removeEventListener('pointerup', pointerUp);\n\n document.body.style.backgroundColor = '';\n\n onUp('up');\n };\n\n const pointerDown = function (event) {\n elem.addEventListener('pointermove', pointerMove);\n elem.addEventListener('pointerup', pointerUp);\n elem.setPointerCapture(event.pointerId);\n\n const rel = computeRelativePosition(elem, event);\n start = [rel.x, rel.y];\n onDown({\n type: 'down',\n ...rel,\n });\n };\n\n elem.addEventListener('pointerdown', pointerDown);\n\n return function () {\n elem.removeEventListener('pointerdown', pointerDown);\n };\n}","import { createElem, getNewId } from '../libs/elem.js';\nimport { addTouchEvents } from '../libs/touch.js';\nimport { identity } from '../libs/conversions.js';\nimport { clamp } from '../libs/utils.js';\nimport EditView from './EditView.js';\nimport {\n hexToFloatRGB,\n hexToFloatRGBA,\n hsv01ToRGBFloat,\n hsva01ToRGBAFloat,\n rgbFloatToHSV01,\n rgbaFloatToHSVA01,\n floatRGBToHex,\n floatRGBAToHex,\n rgbaFloatToHsla01,\n} from '../libs/color-utils.js';\nimport { copyExistingProperties } from '../libs/utils.js';\n\nconst svg = `\n\n \n \n \n \n \n \n \n \n\n \n \n \n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n \n \n \n \n \n \n \n \n\n`;\n\nfunction connectFillTargets(elem) {\n elem.querySelectorAll('[data-src]').forEach(srcElem => {\n const id = getNewId();\n srcElem.id = id;\n elem.querySelectorAll(`[data-target=${srcElem.dataset.src}]`).forEach(targetElem => {\n targetElem.setAttribute('fill', `url(#${id})`);\n });\n });\n return elem;\n}\n\n// Was originally going to make alpha an option. Issue is\n// hard coded conversions?\nexport default class ColorChooserView extends EditView {\n #to;\n #from;\n #satLevelElem;\n #circleElem;\n #hueUIElem;\n #hueElem;\n #hueCursorElem;\n #alphaUIElem;\n #alphaElem;\n #alphaCursorElem;\n #hsva;\n #skipHueUpdate;\n #skipSatLevelUpdate;\n #skipAlphaUpdate;\n #options = {\n converters: identity,\n alpha: false,\n };\n #convertInternalToHex;\n #convertHexToInternal;\n\n constructor(setter, options) {\n super(createElem('div', {\n innerHTML: svg,\n className: 'muigui-no-scroll',\n }));\n this.#satLevelElem = this.domElement.children[0];\n this.#hueUIElem = this.domElement.children[1];\n this.#alphaUIElem = this.domElement.children[2];\n connectFillTargets(this.#satLevelElem);\n connectFillTargets(this.#hueUIElem);\n connectFillTargets(this.#alphaUIElem);\n this.#circleElem = this.$('.muigui-color-chooser-circle');\n this.#hueElem = this.$('[data-src=muigui-color-chooser-hue]');\n this.#hueCursorElem = this.$('.muigui-color-chooser-hue-cursor');\n this.#alphaElem = this.$('[data-src=muigui-color-chooser-alpha]');\n this.#alphaCursorElem = this.$('.muigui-color-chooser-alpha-cursor');\n\n const handleSatLevelChange = (e) => {\n const s = clamp(e.nx, 0, 1);\n const v = clamp(e.ny, 0, 1);\n this.#hsva[1] = s;\n this.#hsva[2] = (1 - v);\n this.#skipHueUpdate = true;\n this.#skipAlphaUpdate = true;\n const [valid, newV] = this.#from(this.#convertInternalToHex(this.#hsva));\n if (valid) {\n setter.setValue(newV);\n }\n };\n\n const handleHueChange = (e) => {\n const h = clamp(e.nx, 0, 1);\n this.#hsva[0] = h;\n this.#skipSatLevelUpdate = true;\n this.#skipAlphaUpdate = true;\n const [valid, newV] = this.#from(this.#convertInternalToHex(this.#hsva));\n if (valid) {\n setter.setValue(newV);\n }\n };\n\n const handleAlphaChange = (e) => {\n const a = clamp(e.nx, 0, 1);\n this.#hsva[3] = a;\n this.#skipHueUpdate = true;\n this.#skipSatLevelUpdate = true;\n const [valid, newV] = this.#from(this.#convertInternalToHex(this.#hsva));\n if (valid) {\n setter.setValue(newV);\n }\n };\n\n addTouchEvents(this.#satLevelElem, {\n onDown: handleSatLevelChange,\n onMove: handleSatLevelChange,\n });\n addTouchEvents(this.#hueUIElem, {\n onDown: handleHueChange,\n onMove: handleHueChange,\n });\n addTouchEvents(this.#alphaUIElem, {\n onDown: handleAlphaChange,\n onMove: handleAlphaChange,\n });\n this.setOptions(options);\n }\n updateDisplay(newV) {\n if (!this.#hsva) {\n this.#hsva = this.#convertHexToInternal(this.#to(newV));\n }\n {\n const [h, s, v, a = 1] = this.#convertHexToInternal(this.#to(newV));\n // Don't copy the hue if it was un-computable.\n if (!this.#skipHueUpdate) {\n this.#hsva[0] = s > 0.001 && v > 0.001 ? h : this.#hsva[0];\n }\n if (!this.#skipSatLevelUpdate) {\n this.#hsva[1] = s;\n this.#hsva[2] = v;\n }\n if (!this.#skipAlphaUpdate) {\n this.#hsva[3] = a;\n }\n }\n {\n const [h, s, v, a] = this.#hsva;\n const [hue, sat, lum] = rgbaFloatToHsla01(hsva01ToRGBAFloat(this.#hsva));\n\n if (!this.#skipHueUpdate) {\n this.#hueCursorElem.setAttribute('transform', `translate(${h * 64}, 0)`);\n }\n this.#hueElem.children[0].setAttribute('stop-color', `hsl(${hue * 360} 0% 100% / ${a})`);\n this.#hueElem.children[1].setAttribute('stop-color', `hsl(${hue * 360} 100% 50% / ${a})`);\n if (!this.#skipAlphaUpdate) {\n this.#alphaCursorElem.setAttribute('transform', `translate(${a * 64}, 0)`);\n }\n this.#alphaElem.children[0].setAttribute('stop-color', `hsl(${hue * 360} ${sat * 100}% ${lum * 100}% / 0)`);\n this.#alphaElem.children[1].setAttribute('stop-color', `hsl(${hue * 360} ${sat * 100}% ${lum * 100}% / 1)`);\n\n if (!this.#skipSatLevelUpdate) {\n this.#circleElem.setAttribute('cx', `${s * 64}`);\n this.#circleElem.setAttribute('cy', `${(1 - v) * 48}`);\n }\n }\n this.#skipHueUpdate = false;\n this.#skipSatLevelUpdate = false;\n this.#skipAlphaUpdate = false;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {converters: {to, from}, alpha} = this.#options;\n this.#alphaUIElem.style.display = alpha ? '' : 'none';\n this.#convertInternalToHex = alpha\n ? v => floatRGBAToHex(hsva01ToRGBAFloat(v))\n : v => floatRGBToHex(hsv01ToRGBFloat(v));\n this.#convertHexToInternal = alpha\n ? v => rgbaFloatToHSVA01(hexToFloatRGBA(v))\n : v => rgbFloatToHSV01(hexToFloatRGB(v));\n this.#to = to;\n this.#from = from;\n return this;\n }\n}\n","import ElementView from '../views/ElementView.js';\nimport ValueController from './ValueController.js';\nimport { copyExistingProperties } from '../libs/utils.js';\nimport { createElem } from '../libs/elem.js';\n/*\n\nholder = new TabHolder\ntab = holder.add(new Tab(\"name\"))\ntab.add(...)\n\n\npc = new PopdownController\ntop = pc.add(new Row())\ntop.add(new Button());\nvalues = topRow.add(new Div())\nbottom = pc.add(new Row());\n\n\n\npc = new PopdownController\npc.addTop\npc.addTop\n\npc.addBottom\n\n\n*/\n\nexport default class PopDownController extends ValueController {\n #top;\n #valuesView;\n #checkboxElem;\n #bottom;\n #options = {\n open: false,\n };\n\n constructor(object, property, options = {}) {\n super(object, property, 'muigui-pop-down-controller');\n /*\n [ValueView\n [[B][values]] upper row\n [[ visual ]] lower row\n ]\n */\n this.#top = this.add(new ElementView('div', 'muigui-pop-down-top'));\n// this.#top.add(new CheckboxView(makeSetter(this.#options, 'open')));\n const checkboxElem = this.#top.addElem(createElem('input', {\n type: 'checkbox',\n onChange: () => {\n this.#options.open = checkboxElem.checked;\n this.updateDisplay();\n },\n }));\n this.#checkboxElem = checkboxElem;\n this.#valuesView = this.#top.add(new ElementView('div', 'muigui-pop-down-values'));\n const container = new ElementView('div', 'muigui-pop-down-bottom muigui-open-container');\n this.#bottom = new ElementView('div');\n container.add(this.#bottom);\n this.add(container);\n this.setOptions(options);\n }\n setKnobColor(bgCssColor/*, fgCssColor*/) {\n if (this.#checkboxElem) {\n this.#checkboxElem.style = `\n --range-color: ${bgCssColor};\n --value-bg-color: ${bgCssColor};\n `;\n }\n }\n updateDisplay() {\n super.updateDisplay();\n const {open} = this.#options;\n this.domElement.children[1].classList.toggle('muigui-open', open);\n this.domElement.children[1].classList.toggle('muigui-closed', !open);\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n super.setOptions(options);\n this.updateDisplay();\n }\n addTop(view) {\n return this.#valuesView.add(view);\n }\n addBottom(view) {\n return this.#bottom.add(view);\n }\n}","/* eslint-disable no-underscore-dangle */\nimport {\n colorFormatConverters,\n guessFormat,\n hasAlpha,\n hexToUint8RGB,\n hslToRgbUint8,\n rgbUint8ToHsl,\n uint8RGBToHex,\n} from '../libs/color-utils.js';\nimport ColorChooserView from '../views/ColorChooserView.js';\nimport TextView from '../views/TextView.js';\nimport PopDownController from './PopDownController.js';\n\nexport default class ColorChooser extends PopDownController {\n #colorView;\n #textView;\n #to;\n\n constructor(object, property, options = {}) {\n super(object, property, 'muigui-color-chooser');\n const format = options.format || guessFormat(this.getValue());\n const {color, text} = colorFormatConverters[format];\n this.#to = color.to;\n this.#textView = new TextView(this, {converters: text, alpha: hasAlpha(format)});\n this.#colorView = new ColorChooserView(this, {converters: color, alpha: hasAlpha(format)});\n this.addTop(this.#textView);\n this.addBottom(this.#colorView);\n // WTF! FIX!\n this.___setKnobHelper = true;\n this.updateDisplay();\n }\n #setKnobHelper() {\n if (this.#to) {\n const hex6Or8 = this.#to(this.getValue());\n const alpha = hex6Or8.length === 9 ? hex6Or8.substring(7, 9) : 'FF';\n const hsl = rgbUint8ToHsl(hexToUint8RGB(hex6Or8));\n hsl[2] = (hsl[2] + 50) % 100;\n const hex = uint8RGBToHex(hslToRgbUint8(hsl));\n this.setKnobColor(`${hex6Or8.substring(0, 7)}${alpha}`, hex);\n }\n }\n updateDisplay() {\n super.updateDisplay();\n if (this.___setKnobHelper) {\n this.#setKnobHelper();\n }\n }\n setOptions(options) {\n super.setOptions(options);\n return this;\n }\n}\n","import { createElem } from '../libs/elem.js';\nimport View from '../views/View.js';\n\nfunction showCSS(ob) {\n if (ob.prototype.css) {\n showCSS(ob.prototype);\n }\n}\n\nexport default class Layout extends View {\n static css = 'bar';\n constructor(tag, className) {\n super(createElem(tag, {className}));\n\n showCSS(this);\n }\n}\n\n/*\nclass ValueController ?? {\n const row = this.add(new Row());\n const label = row.add(new Label());\n const div = row.add(new Div());\n const row = div.add(new Row());\n}\n*/\n\n/*\nclass MyCustomThing extends ValueController {\n constructor(object, property, options) {\n const topRow = this.add(new Row());\n const bottomRow = this.add(new Row());\n topRow.add(new NumberView());\n topRow.add(new NumberView());\n topRow.add(new NumberView());\n topRow.add(new NumberView());\n bottomRow.add(new DirectionView());\n bottomRow.add(new DirectionView());\n bottomRow.add(new DirectionView());\n bottomRow.add(new DirectionView());\n }\n}\n new Grid([\n [new\n ]\n */","import Layout from './Layout.js';\n\nexport default class Column extends Layout {\n constructor() {\n super('div', 'muigui-row');\n }\n}\n","import Layout from './Layout.js';\n\nexport default class Frame extends Layout {\n static css = 'foo';\n constructor() {\n super('div', 'muigui-frame');\n }\n static get foo() {\n return 'boo';\n }\n}\n","import Layout from './Layout.js';\n\nexport default class Grid extends Layout {\n constructor() {\n super('div', 'muigui-grid');\n }\n}\n","import Layout from './Layout.js';\n\nexport default class Row extends Layout {\n constructor() {\n super('div', 'muigui-row');\n }\n}\n","import css from './styles/muigui.css.js';\nimport {createElem} from './libs/elem.js';\nimport {createController} from './controllers/create-controller.js';\nimport {\n mapRange,\n makeRangeConverters,\n makeRangeOptions,\n makeMinMaxPair,\n} from './libs/utils.js';\nimport {\n converters\n} from './libs/conversions.js';\nimport {\n hasAlpha,\n guessFormat,\n} from './libs/color-utils.js';\nimport Canvas from './controllers/Canvas.js';\nimport Color from './controllers/Color.js';\nimport Divider from './controllers/Divider.js';\nimport Folder from './controllers/Folder.js';\nimport Label from './controllers/Label.js';\nimport Controller from './controllers/Controller.js';\nimport ColorChooser from './controllers/ColorChooser.js';\n\nimport Column from './layout/Column.js';\nimport Frame from './layout/Frame.js';\nimport Grid from './layout/Grid.js';\nimport Row from './layout/Row.js';\n\nexport {\n Column,\n Frame,\n Grid,\n Row,\n};\n\nfunction camelCaseToSnakeCase(id) {\n return id\n .replace(/(.)([A-Z][a-z]+)/g, '$1_$2')\n .replace(/([a-z0-9])([A-Z])/g, '$1_$2')\n .toLowerCase();\n}\n\nfunction prepName(name) {\n return camelCaseToSnakeCase(name.toString()).replaceAll('_', ' ');\n}\n\nexport class GUIFolder extends Folder {\n add(object, property, ...args) {\n const controller = object instanceof Controller\n ? object\n : createController(object, property, ...args).name(prepName(property));\n return this.addController(controller);\n }\n addCanvas(name) {\n return this.addController(new Canvas(name));\n }\n addColor(object, property, options = {}) {\n const value = object[property];\n if (hasAlpha(options.format || guessFormat(value))) {\n return this\n .addController(new ColorChooser(object, property, options))\n .name(prepName(property));\n } else {\n return this\n .addController(new Color(object, property, options))\n .name(prepName(property));\n }\n }\n addDivider() {\n return this.addController(new Divider());\n }\n addFolder(name) {\n return this.addController(new GUIFolder(name));\n }\n addLabel(text) {\n return this.addController(new Label(text));\n }\n addButton(name, fn) {\n const o = {fn};\n return this.add(o, 'fn').name(prepName(name));\n }\n}\n\nclass MuiguiElement extends HTMLElement {\n constructor() {\n super();\n this.shadow = this.attachShadow({mode: 'open'});\n }\n}\n\ncustomElements.define('muigui-element', MuiguiElement);\n\nconst baseStyleSheet = new CSSStyleSheet();\n//baseStyleSheet.replaceSync(css.default);\nconst userStyleSheet = new CSSStyleSheet();\n\nfunction makeStyleSheetUpdater(styleSheet) {\n let newCss;\n let newCssPromise;\n\n function updateStyle() {\n if (newCss && !newCssPromise) {\n const s = newCss;\n newCss = undefined;\n newCssPromise = styleSheet.replace(s).then(() => {\n newCssPromise = undefined;\n updateStyle();\n });\n }\n }\n\n return function updateStyleSheet(css) {\n newCss = css;\n updateStyle();\n };\n}\n\nconst updateBaseStyle = makeStyleSheetUpdater(baseStyleSheet);\nconst updateUserStyle = makeStyleSheetUpdater(userStyleSheet);\n\nfunction getTheme(name) {\n const { include, css: cssStr } = css.themes[name];\n return `${include.map(m => css[m]).join('\\n')} : css.default}\\n${cssStr || ''}`;\n}\n\nexport class GUI extends GUIFolder {\n static converters = converters;\n static mapRange = mapRange;\n static makeRangeConverters = makeRangeConverters;\n static makeRangeOptions = makeRangeOptions;\n static makeMinMaxPair = makeMinMaxPair;\n #localStyleSheet = new CSSStyleSheet();\n\n constructor(options = {}) {\n super('Controls', 'muigui-root');\n if (options instanceof HTMLElement) {\n options = {parent: options};\n }\n const {\n autoPlace = true,\n width,\n title = 'Controls',\n } = options;\n let {\n parent,\n } = options;\n\n if (width) {\n this.domElement.style.width = /^\\d+$/.test(width) ? `${width}px` : width;\n }\n if (parent === undefined && autoPlace) {\n parent = document.body;\n this.domElement.classList.add('muigui-auto-place');\n }\n if (parent) {\n const muiguiElement = createElem('muigui-element');\n muiguiElement.shadowRoot.adoptedStyleSheets = [this.#localStyleSheet, baseStyleSheet, userStyleSheet];\n muiguiElement.shadow.appendChild(this.domElement);\n parent.appendChild(muiguiElement);\n }\n if (title) {\n this.title(title);\n }\n this.#localStyleSheet.replaceSync(css.default);\n this.domElement.classList.add('muigui', 'muigui-colors');\n }\n setStyle(css) {\n this.#localStyleSheet.replace(css);\n }\n static setBaseStyles(css) {\n updateBaseStyle(css);\n }\n static getBaseStyleSheet() {\n return baseStyleSheet;\n }\n static setUserStyles(css) {\n updateUserStyle(css);\n }\n static getUserStyleSheet() {\n return userStyleSheet;\n }\n setTheme(name) {\n this.setStyle(getTheme(name));\n }\n static setTheme(name) {\n GUI.setBaseStyles(getTheme(name));\n }\n}\n\nexport default GUI;\n","function noop() {\n}\n\nconst keyDirections = {\n ArrowLeft: [-1, 0],\n ArrowRight: [1, 0],\n ArrowUp: [0, -1],\n ArrowDown: [0, 1],\n};\n\n// This probably needs to be global\nexport function addKeyboardEvents(elem, {onDown = noop, onUp = noop}) {\n const keyDown = function (event) {\n const mult = event.shiftKey ? 10 : 1;\n const [dx, dy] = (keyDirections[event.key] || [0, 0]).map(v => v * mult);\n const fn = event.type === 'keydown' ? onDown : onUp;\n fn({\n type: event.type.substring(3),\n dx,\n dy,\n event,\n });\n };\n\n elem.addEventListener('keydown', keyDown);\n elem.addEventListener('keyup', keyDown);\n\n return function () {\n elem.removeEventListener('keydown', keyDown);\n elem.removeEventListener('keyup', keyDown);\n };\n}","export function assert(truthy, msg = '') {\n if (!truthy) {\n throw new Error(msg);\n }\n}","import { assert } from '../libs/assert.js';\n\nfunction getEllipsePointForAngle(cx, cy, rx, ry, phi, theta) {\n const m = Math.abs(rx) * Math.cos(theta);\n const n = Math.abs(ry) * Math.sin(theta);\n\n return [\n cx + Math.cos(phi) * m - Math.sin(phi) * n,\n cy + Math.sin(phi) * m + Math.cos(phi) * n,\n ];\n}\n\nfunction getEndpointParameters(cx, cy, rx, ry, phi, theta, dTheta) {\n const [x1, y1] = getEllipsePointForAngle(cx, cy, rx, ry, phi, theta);\n const [x2, y2] = getEllipsePointForAngle(cx, cy, rx, ry, phi, theta + dTheta);\n\n const fa = Math.abs(dTheta) > Math.PI ? 1 : 0;\n const fs = dTheta > 0 ? 1 : 0;\n\n return { x1, y1, x2, y2, fa, fs };\n}\n\nexport function arc(cx, cy, r, start, end) {\n assert(Math.abs(start - end) <= Math.PI * 2);\n assert(start >= -Math.PI && start <= Math.PI * 2);\n assert(start <= end);\n assert(end >= -Math.PI && end <= Math.PI * 4);\n\n const { x1, y1, x2, y2, fa, fs } = getEndpointParameters(cx, cy, r, r, 0, start, end - start);\n return Math.abs(Math.abs(start - end) - Math.PI * 2) > Number.EPSILON\n ? `M${cx} ${cy} L${x1} ${y1} A ${r} ${r} 0 ${fa} ${fs} ${x2} ${y2} L${cx} ${cy}`\n : `M${x1} ${y1} L${x1} ${y1} A ${r} ${r} 0 ${fa} ${fs} ${x2} ${y2}`;\n}\n","import { identity } from '../libs/conversions.js';\nimport { createElem } from '../libs/elem.js';\nimport { addKeyboardEvents } from '../libs/keyboard.js';\nimport { arc } from '../libs/svg.js';\nimport { addTouchEvents } from '../libs/touch.js';\nimport { createWheelHelper } from '../libs/wheel.js';\nimport { clamp, copyExistingProperties, euclideanModulo, lerp, stepify } from '../libs/utils.js';\nimport EditView from './EditView.js';\n\nconst svg = `\n\n \n \n \n \n \n \n \n\n`;\n\nconst twoPiMod = v => euclideanModulo(v + Math.PI, Math.PI * 2) - Math.PI;\n\nexport default class DirectionView extends EditView {\n #arrowElem;\n #rangeElem;\n #lastV;\n #wrap;\n #options = {\n step: 1,\n min: -180,\n max: 180,\n\n /*\n --------\n / -π/2 \\\n / | \\\n |<- -π * |\n | * 0 ->| zero is down the positive X axis\n |<- +π * |\n \\ | /\n \\ π/2 /\n --------\n */\n dirMin: -Math.PI,\n dirMax: Math.PI,\n //dirMin: Math.PI * 0.5,\n //dirMax: Math.PI * 2.5,\n //dirMin: -Math.PI * 0.75, // test 10:30 to 7:30\n //dirMax: Math.PI * 0.75,\n //dirMin: Math.PI * 0.75, // test 7:30 to 10:30\n //dirMax: -Math.PI * 0.75,\n //dirMin: -Math.PI * 0.75, // test 10:30 to 1:30\n //dirMax: -Math.PI * 0.25,\n //dirMin: Math.PI * 0.25, // test 4:30 to 7:30\n //dirMax: Math.PI * 0.75,\n //dirMin: Math.PI * 0.75, // test 4:30 to 7:30\n //dirMax: Math.PI * 0.25,\n wrap: undefined,\n converters: identity,\n };\n\n constructor(setter, options = {}) {\n const wheelHelper = createWheelHelper();\n super(createElem('div', {\n className: 'muigui-direction muigui-no-scroll',\n innerHTML: svg,\n onWheel: e => {\n e.preventDefault();\n const {min, max, step} = this.#options;\n const delta = wheelHelper(e, step);\n let tempV = this.#lastV + delta;\n if (this.#wrap) {\n tempV = euclideanModulo(tempV - min, max - min) + min;\n }\n const newV = clamp(stepify(tempV, v => v, step), min, max);\n setter.setValue(newV);\n },\n }));\n const handleTouch = (e) => {\n const {min, max, step, dirMin, dirMax} = this.#options;\n const nx = e.nx * 2 - 1;\n const ny = e.ny * 2 - 1;\n const a = Math.atan2(ny, nx);\n\n const center = (dirMin + dirMax) / 2;\n\n const centeredAngle = twoPiMod(a - center);\n const centeredStart = twoPiMod(dirMin - center);\n const diff = dirMax - dirMin;\n\n const n = clamp((centeredAngle - centeredStart) / (diff), 0, 1);\n const newV = stepify(min + (max - min) * n, v => v, step);\n setter.setValue(newV);\n };\n addTouchEvents(this.domElement, {\n onDown: handleTouch,\n onMove: handleTouch,\n });\n addKeyboardEvents(this.domElement, {\n onDown: (e) => {\n const {min, max, step} = this.#options;\n const newV = clamp(stepify(this.#lastV + e.dx * step, v => v, step), min, max);\n setter.setValue(newV);\n },\n });\n this.#arrowElem = this.$('#muigui-arrow');\n this.#rangeElem = this.$('#muigui-range');\n this.setOptions(options);\n }\n updateDisplay(v) {\n this.#lastV = v;\n const {min, max} = this.#options;\n const n = (v - min) / (max - min);\n const angle = lerp(this.#options.dirMin, this.#options.dirMax, n);\n this.#arrowElem.style.transform = `rotate(${angle}rad)`;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {dirMin, dirMax, wrap} = this.#options;\n this.#wrap = wrap !== undefined\n ? wrap\n : Math.abs(dirMin - dirMax) >= Math.PI * 2 - Number.EPSILON;\n const [min, max] = dirMin < dirMax ? [dirMin, dirMax] : [dirMax , dirMin];\n this.#rangeElem.setAttribute('d', arc(0, 0, 28.87, min, max));\n }\n}\n","import { identity } from '../libs/conversions.js';\nimport DirectionView from '../views/DirectionView.js';\nimport NumberView from '../views/NumberView.js';\n// import ValueController from './ValueController.js';\nimport PopDownController from './PopDownController.js';\n\n\n// deg2rad\n// where is 0\n// range (0, 360), (-180, +180), (0,0) Really this is a range\n\nexport default class Direction extends PopDownController {\n #options;\n constructor(object, property, options) {\n super(object, property, 'muigui-direction');\nthis.#options = options; // FIX\n this.addTop(new NumberView(this,\nidentity));\n this.addBottom(new DirectionView(this, options));\n this.updateDisplay();\n }\n}\n\n","import { createElem } from '../libs/elem.js';\nimport { makeId } from '../libs/ids.js';\nimport EditView from './EditView.js';\n\nexport default class RadioGridView extends EditView {\n #values;\n\n constructor(setter, keyValues, cols = 3) {\n const values = [];\n const name = makeId();\n super(createElem('div', {}, keyValues.map(([key, value], ndx) => {\n values.push(value);\n return createElem('label', {}, [\n createElem('input', {\n type: 'radio',\n name,\n value: ndx,\n onChange: function () {\n if (this.checked) {\n setter.setFinalValue(that.#values[this.value]);\n }\n },\n }),\n createElem('button', {\n type: 'button',\n textContent: key,\n onClick: function () {\n this.previousElementSibling.click();\n },\n }),\n ]);\n })));\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const that = this;\n this.#values = values;\n this.cols(cols);\n }\n updateDisplay(v) {\n const ndx = this.#values.indexOf(v);\n for (let i = 0; i < this.domElement.children.length; ++i) {\n this.domElement.children[i].children[0].checked = i === ndx;\n }\n }\n cols(cols) {\n this.domElement.style.gridTemplateColumns = `repeat(${cols}, 1fr)`;\n }\n}\n","import RadioGridView from '../views/RadioGridView.js';\nimport ValueController from './ValueController.js';\nimport { convertToKeyValues } from '../libs/key-values.js';\n\nexport default class RadioGrid extends ValueController {\n constructor(object, property, options) {\n super(object, property, 'muigui-radio-grid');\n const valueIsNumber = typeof this.getValue() === 'number';\n const {\n keyValues: keyValuesInput,\n cols = 3,\n } = options;\n const keyValues = convertToKeyValues(keyValuesInput, valueIsNumber);\n this.add(new RadioGridView(this, keyValues, cols));\n this.updateDisplay();\n }\n}","export function onResize(elem, callback) {\n new ResizeObserver(() => {\n callback({rect: elem.getBoundingClientRect(), elem});\n }).observe(elem);\n}\n\nexport function onResizeSVGNoScale(elem, hAnchor, vAnchor, callback) {\n onResize(elem, ({rect}) => {\n const {width, height} = rect;\n elem.setAttribute('viewBox', `-${width * hAnchor} -${height * vAnchor} ${width} ${height}`);\n callback({elem, rect});\n });\n}\n\nexport function onResizeCanvas(elem, callback) {\n onResize(elem, ({rect}) => {\n const {width, height} = rect;\n elem.width = width;\n elem.height = height;\n callback({elem, rect});\n });\n}\n","import { createElem } from '../libs/elem.js';\nimport { addKeyboardEvents } from '../libs/keyboard.js';\nimport { addTouchEvents } from '../libs/touch.js';\nimport { createWheelHelper } from '../libs/wheel.js';\nimport { onResizeSVGNoScale } from '../libs/resize-helpers.js';\nimport { clamp, copyExistingProperties, stepify } from '../libs/utils.js';\nimport EditView from './EditView.js';\n\nconst svg = `\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n`;\n\nfunction createSVGTicks(start, end, step, min, max, height) {\n const p = [];\n if (start < min) {\n start += stepify(min - start, v => v, step);\n }\n end = Math.min(end, max);\n for (let i = start; i <= end; i += step) {\n p.push(`M${i} 0 l0 ${height}`);\n }\n return p.join(' ');\n}\n\nfunction createSVGNumbers(start, end, unitSize, unit, minusSize, min, max, labelFn) {\n const texts = [];\n if (start < min) {\n start += stepify(min - start, v => v, unitSize);\n }\n end = Math.min(end, max);\n const digits = Math.max(0, -Math.log10(unit));\n const f = v => labelFn(v.toFixed(digits));\n for (let i = start; i <= end; i += unitSize) {\n texts.push(`= 0 ? i : (i - minusSize / 2) }\" y=\"0\">${f(i / unitSize * unit)}`);\n }\n return texts.join('\\n');\n}\n\nfunction computeSizeOfMinus(elem) {\n const oldHTML = elem.innerHTML;\n elem.innerHTML = '- ';\n const text = elem.querySelector('text');\n const size = text.getComputedTextLength();\n elem.innerHTML = oldHTML;\n return size;\n}\n\nexport default class SliderView extends EditView {\n #svgElem;\n #originElem;\n #ticksElem;\n #thicksElem;\n #numbersElem;\n #leftGradElem;\n #rightGradElem;\n #width;\n #height;\n #lastV;\n #minusSize;\n #options = {\n min: -100,\n max: 100,\n step: 1,\n unit: 10,\n unitSize: 10,\n ticksPerUnit: 5,\n labelFn: v => v,\n tickHeight: 1,\n limits: true,\n thicksColor: undefined,\n orientation: undefined,\n };\n\n constructor(setter, options) {\n const wheelHelper = createWheelHelper();\n super(createElem('div', {\n innerHTML: svg,\n className: 'muigui-no-v-scroll',\n onWheel: e => {\n e.preventDefault();\n const {min, max, step} = this.#options;\n const delta = wheelHelper(e, step);\n const newV = clamp(stepify(this.#lastV + delta, v => v, step), min, max);\n setter.setValue(newV);\n },\n }));\n this.#svgElem = this.$('svg');\n this.#originElem = this.$('#muigui-origin');\n this.#ticksElem = this.$('#muigui-ticks');\n this.#thicksElem = this.$('#muigui-thicks');\n this.#numbersElem = this.$('#muigui-numbers');\n this.#leftGradElem = this.$('#muigui-left-grad');\n this.#rightGradElem = this.$('#muigui-right-grad');\n this.setOptions(options);\n let startV;\n addTouchEvents(this.domElement, {\n onDown: () => {\n startV = this.#lastV;\n },\n onMove: (e) => {\n const {min, max, unitSize, unit, step} = this.#options;\n const newV = clamp(stepify(startV - e.dx / unitSize * unit, v => v, step), min, max);\n setter.setValue(newV);\n },\n });\n addKeyboardEvents(this.domElement, {\n onDown: (e) => {\n const {min, max, step} = this.#options;\n const newV = clamp(stepify(this.#lastV + e.dx * step, v => v, step), min, max);\n setter.setValue(newV);\n },\n });\n onResizeSVGNoScale(this.#svgElem, 0.5, 0, ({rect: {width}}) => {\n this.#leftGradElem.setAttribute('x', -width / 2);\n this.#rightGradElem.setAttribute('x', width / 2 - 20);\n this.#minusSize = computeSizeOfMinus(this.#numbersElem);\n this.#width = width;\n this.#updateSlider();\n });\n }\n // |--------V--------|\n // . . | . . . | . . . |\n //\n #updateSlider() {\n // There's no size if ResizeObserver has not fired yet.\n if (!this.#width || this.#lastV === undefined) {\n return;\n }\n const {\n labelFn,\n limits,\n min,\n max,\n orientation,\n tickHeight,\n ticksPerUnit,\n unit,\n unitSize,\n thicksColor,\n } = this.#options;\n const unitsAcross = Math.ceil(this.#width / unitSize);\n const center = this.#lastV;\n const centerUnitSpace = center / unit;\n const startUnitSpace = Math.round(centerUnitSpace - unitsAcross);\n const endUnitSpace = startUnitSpace + unitsAcross * 2;\n const start = startUnitSpace * unitSize;\n const end = endUnitSpace * unitSize;\n const minUnitSpace = limits ? min * unitSize / unit : start;\n const maxUnitSpace = limits ? max * unitSize / unit : end;\n const height = labelFn(1) === '' ? 10 : 5;\n if (ticksPerUnit > 1) {\n this.#ticksElem.setAttribute('d', createSVGTicks(start, end, unitSize / ticksPerUnit, minUnitSpace, maxUnitSpace, height * tickHeight));\n }\n this.#thicksElem.style.stroke = thicksColor; //setAttribute('stroke', thicksColor);\n this.#thicksElem.setAttribute('d', createSVGTicks(start, end, unitSize, minUnitSpace, maxUnitSpace, height));\n this.#numbersElem.innerHTML = createSVGNumbers(start, end, unitSize, unit, this.#minusSize, minUnitSpace, maxUnitSpace, labelFn);\n this.#originElem.setAttribute('transform', `translate(${-this.#lastV * unitSize / unit} 0)`);\n this.#svgElem.classList.toggle('muigui-slider-up', orientation === 'up');\n }\n updateDisplay(v) {\n this.#lastV = v;\n this.#updateSlider();\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n return this;\n }\n}\n","import ValueController from './ValueController.js';\nimport NumberView from '../views/NumberView.js';\nimport SliderView from '../views/SliderView.js';\n\nexport default class Slider extends ValueController {\n constructor(object, property, options = {}) {\n super(object, property, 'muigui-slider');\n this.add(new SliderView(this, options));\n this.add(new NumberView(this, options));\n this.updateDisplay();\n }\n}\n","import { createElem } from '../libs/elem.js';\nimport { addTouchEvents } from '../libs/touch.js';\nimport { onResizeSVGNoScale } from '../libs/resize-helpers.js';\nimport EditView from './EditView.js';\n\nconst svg = `\n\n \n \n \n \n \n\n`;\n\nexport default class Vec2View extends EditView {\n #svgElem;\n #arrowElem;\n #circleElem;\n #lastV = [];\n\n constructor(setter) {\n super(createElem('div', {\n innerHTML: svg,\n className: 'muigui-no-scroll',\n }));\n const onTouch = (e) => {\n const {width, height} = this.#svgElem.getBoundingClientRect();\n const nx = e.nx * 2 - 1;\n const ny = e.ny * 2 - 1;\n setter.setValue([nx * width * 0.5, ny * height * 0.5]);\n };\n addTouchEvents(this.domElement, {\n onDown: onTouch,\n onMove: onTouch,\n });\n this.#svgElem = this.$('svg');\n this.#arrowElem = this.$('#muigui-arrow');\n this.#circleElem = this.$('#muigui-circle');\n onResizeSVGNoScale(this.#svgElem, 0.5, 0.5, () => this.#updateDisplayImpl);\n }\n #updateDisplayImpl() {\n const [x, y] = this.#lastV;\n this.#arrowElem.setAttribute('d', `M0,0L${x},${y}`);\n this.#circleElem.setAttribute('transform', `translate(${x}, ${y})`);\n }\n updateDisplay(v) {\n this.#lastV[0] = v[0];\n this.#lastV[1] = v[1];\n this.#updateDisplayImpl();\n }\n}\n","import NumberView from '../views/NumberView.js';\nimport Vec2View from '../views/Vec2View.js';\nimport PopDownController from './PopDownController.js';\nimport { strToNumber } from '../libs/conversions.js';\n\n// TODO: zoom with wheel and pinch?\n// TODO: grid?\n// // options\n// scale:\n// range: number (both x and y + /)\n// range: array (min, max)\n// xRange:\n// deg/rad/turn\n\nexport default class Vec2 extends PopDownController {\n constructor(object, property) {\n super(object, property, 'muigui-vec2');\n\n const makeSetter = (ndx) => {\n return {\n setValue: (v) => {\n const newV = this.getValue();\n newV[ndx] = v;\n this.setValue(newV);\n },\n setFinalValue: (v) => {\n const newV = this.getValue();\n newV[ndx] = v;\n this.setFinalValue(newV);\n },\n };\n };\n\n this.addTop(new NumberView(makeSetter(0), {\n converters: {\n to: v => v[0],\n from: strToNumber.from,\n },\n }));\n this.addTop(new NumberView(makeSetter(1), {\n converters: {\n to: v => v[1],\n from: strToNumber.from,\n },\n }));\n this.addBottom(new Vec2View(this));\n this.updateDisplay();\n }\n}\n","import GUI from './muigui.js';\n\nimport ColorChooser from './controllers/ColorChooser.js';\nimport Direction from './controllers/Direction.js';\nimport RadioGrid from './controllers/RadioGrid.js';\nimport Range from './controllers/Range.js';\nimport Select from './controllers/Select.js';\nimport Slider from './controllers/Slider.js';\nimport TextNumber from './controllers/TextNumber.js';\nimport Vec2 from './controllers/Vec2.js';\n\nGUI.ColorChooser = ColorChooser;\nGUI.Direction = Direction;\nGUI.RadioGrid = RadioGrid;\nGUI.Range = Range;\nGUI.Select = Select;\nGUI.Slider = Slider;\nGUI.TextNumber = TextNumber;\nGUI.Vec2 = Vec2;\n\nexport default GUI;"],"names":["clamp","euclideanModulo","lerp","identity","noop","svg"],"mappings":";;;;;;;AAAA,YAAe;EACf,EAAE,OAAO,EAAE,CAAC;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;EACD,MAAM,EAAE;EACR,EAAE,OAAO,EAAE;EACX,IAAI,OAAO,EAAE,CAAC,SAAS,CAAC;EACxB,IAAI,GAAG,EAAE,CAAC;AACV,IAAI,CAAC;EACL,GAAG;EACH,EAAE,KAAK,EAAE;EACT,IAAI,OAAO,EAAE,CAAC,SAAS,CAAC;EACxB,IAAI,GAAG,EAAE,CAAC;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;EACD,GAAG;EACH,EAAE,IAAI,EAAE;EACR,IAAI,OAAO,EAAE,EAAE;EACf,IAAI,GAAG,EAAE,CAAC;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,CAAC;EACH,GAAG;EACH,EAAE,IAAI,EAAE;EACR,IAAI,OAAO,EAAE,EAAE;EACf,IAAI,GAAG,EAAE,EAAE;EACX,GAAG;EACH,CAAC;EACD,CAAC;;ECh1BM,SAAS,YAAY,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE;EACpD,EAAE,KAAK,MAAM,CAAC,GAAG,EAAE,K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,GAAG,KAAK,CAAC;EAClB,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC;EACpB,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC;EACpB,GAAG,CAAC,UAAU,GAAG,UAAU,CAAC;EAC5B,GAAG,CAAC,IAAI,GAAG,IAAI;;;;;;;;"} \ No newline at end of file diff --git a/dist/0.x/muigui.min.js b/dist/0.x/muigui.min.js index 4d0c8e6..76b1a37 100644 --- a/dist/0.x/muigui.min.js +++ b/dist/0.x/muigui.min.js @@ -1,2 +1,2 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).GUI=e()}(this,(function(){"use strict";var t={default:'\n.muigui {\n --bg-color: #ddd;\n --color: #222;\n --contrast-color: #eee;\n --value-color: #145 ;\n --value-bg-color: #eeee;\n --disabled-color: #999;\n --menu-bg-color: #f8f8f8;\n --menu-sep-color: #bbb;\n --hover-bg-color: #999;\n --focus-color: #8BF;\n --range-color: #AAA;\n --invalid-color: #FF0000;\n --selected-color: rgb(255, 255, 255, 0.9);\n\n --button-bg-color: var(--value-bg-color);\n\n --image-open: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjNDQ0OyIgeD0iMjAlIiB5PSI0NSUiIHdpZHRoPSI2MCUiIGhlaWdodD0iMTAlIj48L3JlY3Q+Cjwvc3ZnPg==);\n --image-closed: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjNDQ0OyIgeD0iNDUlIiB5PSIyMCUiIHdpZHRoPSIxMCUiIGhlaWdodD0iNjAlIj48L3JlY3Q+CiAgPHJlY3Qgc3R5bGU9ImZpbGw6ICM0NDQ7IiB4PSIyMCUiIHk9IjQ1JSIgd2lkdGg9IjYwJSIgaGVpZ2h0PSIxMCUiPjwvcmVjdD4KPC9zdmc+);\n --image-checkerboard: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjNDA0MDQwOyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSI+PC9yZWN0PgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjODA4MDgwOyIgeD0iMCIgeT0iMCIgd2lkdGg9IjUwJSIgaGVpZ2h0PSI1MCUiPjwvcmVjdD4KICA8cmVjdCBzdHlsZT0iZmlsbDogIzgwODA4MDsiIHg9IjUwJSIgeT0iNTAlIiB3aWR0aD0iNTAlIiBoZWlnaHQ9IjUwJSI+PC9yZWN0Pgo8L3N2Zz4=);\n\n --range-left-color: var(--value-color);\n --range-right-color: var(--value-bg-color); \n --range-right-hover-color: var(--hover-bg-color);\n --button-image: \n linear-gradient(\n rgba(255, 255, 255, 1), rgba(0, 0, 0, 0.2)\n );\n\n color: var(--color);\n background-color: var(--bg-color);\n}\n\n@media (prefers-color-scheme: dark) {\n .muigui {\n --bg-color: #222222;\n --color: #dddddd;\n --contrast-color: #000;\n --value-color: #43e5f7;\n --value-bg-color: #444444;\n --disabled-color: #666666;\n --menu-bg-color: #080808;\n --menu-sep-color: #444444;\n --hover-bg-color: #666666;\n --focus-color: #458; /*#88AAFF*/;\n --range-color: #888888;\n --invalid-color: #FF6666;\n --selected-color: rgba(255, 255, 255, 0.3);\n\n --button-bg-color: var(--value-bg-color);\n\n --range-left-color: var(--value-color);\n --range-right-color: var(--value-bg-color); \n --range-right-hover-color: var(--hover-bg-color);\n --button-image: linear-gradient(\n rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.4)\n );\n\n color: var(--color);\n background-color: var(--bg-color);\n\n --image-closed: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjREREOyIgeD0iMjAlIiB5PSI0NSUiIHdpZHRoPSI2MCUiIGhlaWdodD0iMTAlIj48L3JlY3Q+Cjwvc3ZnPg==);\n --image-open: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjREREOyIgeD0iNDUlIiB5PSIyMCUiIHdpZHRoPSIxMCUiIGhlaWdodD0iNjAlIj48L3JlY3Q+CiAgPHJlY3Qgc3R5bGU9ImZpbGw6ICNEREQ7IiB4PSIyMCUiIHk9IjQ1JSIgd2lkdGg9IjYwJSIgaGVpZ2h0PSIxMCUiPjwvcmVjdD4KPC9zdmc+);\n }\n}\n\n.muigui {\n --width: 250px;\n --label-width: 45%;\n --number-width: 40%;\n\n --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;\n --font-size: 11px;\n --font-family-mono: Menlo, Monaco, Consolas, "Droid Sans Mono", monospace;\n --font-size-mono: 11px;\n\n --line-height: 1.7em;\n --border-radius: 0px;\n\n width: var(--width);\n font-family: var(--font-family);\n font-size: var(--font-size);\n box-sizing: border-box;\n line-height: 100%;\n}\n.muigui * {\n box-sizing: inherit;\n}\n\n.muigui-no-scroll {\n touch-action: none;\n}\n.muigui-no-h-scroll {\n touch-action: pan-y;\n}\n.muigui-no-v-scroll {\n touch-action: pan-x;\n}\n\n.muigui-invalid-value {\n background-color: red !important;\n color: white !important;\n}\n\n.muigui-grid {\n display: grid;\n}\n.muigui-rows {\n display: flex;\n flex-direction: column;\n\n min-height: 20px;\n border: 2px solid red;\n}\n.muigui-columns {\n display: flex;\n flex-direction: row;\n\n height: 20px;\n border: 2px solid green;\n}\n.muigui-rows>*,\n.muigui-columns>* {\n flex: 1 1 auto;\n align-items: stretch;\n min-height: 0;\n min-width: 0;\n}\n\n.muigui-row {\n border: 2px solid yellow;\n min-height: 10px\n}\n.muigui-column {\n border: 2px solid lightgreen;\n}\n\n/* -------- */\n\n.muigui-show { /* */ }\n.muigui-hide { \n display: none !important;\n}\n.muigui-disabled {\n pointer-events: none;\n --color: var(--disabled-color) !important;\n --value-color: var(--disabled-color) !important;\n --range-left-color: var(--disabled-color) !important;\n}\n\n.muigui canvas,\n.muigui svg {\n display: block;\n border-radius: var(--border-radius);\n}\n.muigui canvas {\n background-color: var(--value-bg-color);\n}\n\n.muigui-controller {\n min-width: 0;\n min-height: var(--line-height);\n}\n.muigui-root {\n z-index: 1;\n}\n.muigui-root,\n.muigui-menu {\n display: flex;\n flex-direction: column;\n position: relative;\n user-select: none;\n height: fit-content;\n margin: 0;\n padding-bottom: 0.1em;\n border-radius: var(--border-radius);\n}\n.muigui-menu {\n border-bottom: 1px solid var(--menu-sep-color);\n}\n\n.muigui-root>button:nth-child(1),\n.muigui-menu>button:nth-child(1) {\n border-top: 1px solid var(--menu-sep-color);\n border-bottom: 1px solid var(--menu-sep-color);\n position: relative;\n text-align: left;\n color: var(--color);\n background-color: var(--menu-bg-color);\n min-height: var(--line-height);\n padding: 0.2em;\n cursor: pointer;\n border-radius: var(--border-radius);\n}\n.muigui-root>div:nth-child(2),\n.muigui-menu>div:nth-child(2) {\n flex: 1 1 auto;\n}\n\n.muigui-controller {\n margin-left: 0.2em;\n margin-right: 0.2em;\n}\n.muigui-root.muigui-controller,\n.muigui-menu.muigui-controller {\n margin-left: 0;\n margin-right: 0;\n}\n.muigui-controller>*:nth-child(1) {\n flex: 1 0 var(--label-width);\n min-width: 0;\n /* white-space: pre; why?? */\n}\n.muigui-controller>label:nth-child(1) {\n place-content: center start;\n display: inline-grid;\n overflow: hidden;\n}\n.muigui-controller>*:nth-child(2) {\n flex: 1 1 75%;\n min-width: 0;\n}\n\n/* -----------------------------------------\n a label controller is [[label][value]]\n*/\n\n.muigui-label-controller {\n display: flex;\n margin: 0.4em 0 0.4em 0;\n word-wrap: initial;\n align-items: stretch;\n}\n\n.muigui-value {\n display: flex;\n align-items: stretch;\n}\n.muigui-value>* {\n flex: 1 1 auto;\n min-width: 0;\n}\n.muigui-value>*:nth-child(1) {\n flex: 1 1 calc(100% - var(--number-width));\n}\n.muigui-value>*:nth-child(2) {\n flex: 1 1 var(--number-width);\n margin-left: 0.2em;\n}\n\n/* fix! */\n.muigui-open>button>label::before,\n.muigui-closed>button>label::before {\n content: "X";\n color: rgba(0, 0, 0, 0);\n background-color: var(--range-color);\n border-radius: 0.2em;\n width: 1.25em;\n margin-right: 0.25em;\n height: 1.25em; /*var(--line-height);*/\n display: inline-grid;\n place-content: center start;\n pointer-events: none;\n}\n.muigui-open>button>label::before {\n background-image: var(--image-open);\n}\n.muigui-closed>button>label::before {\n background-image: var(--image-closed);\n}\n\n.muigui-open>.muigui-open-container {\n transition: all 0.1s ease-out;\n overflow: auto;\n height: 100%;\n}\n.muigui-closed>.muigui-open-container {\n transition: all 0.1s ease-out;\n overflow: hidden;\n min-height: 0;\n}\n.muigui-open>.muigui-open-container>* {\n transition: all 0.1s ease-out;\n margin-top: 0px;\n}\n.muigui-closed>.muigui-open-container>* {\n transition: all 0.1s ease-out;\n margin-top: -100%;\n}\n\n/* ---- popdown ---- */\n\n.muigui-pop-down-top {\n display: flex;\n}\n/* fix? */\n.muigui-value>*:nth-child(1).muigui-pop-down-top {\n flex: 0;\n}\n.muigui-closed .muigui-pop-down-bottom {\n max-height: 0;\n}\n\n.muigui-value .muigui-pop-down-bottom {\n margin: 0;\n}\n\n.muigui-pop-down-values {\n min-width: 0;\n display: flex;\n}\n.muigui-pop-down-values>* {\n flex: 1 1 auto;\n min-width: 0;\n}\n\n.muigui-value.muigui-pop-down-controller {\n flex-direction: column;\n}\n\n.muigui-pop-down-top input[type=checkbox] {\n -webkit-appearance: none;\n appearance: none;\n width: auto;\n color: var(--value-color);\n background-color: var(--value-bg-color);\n background-image: var(--image-checkerboard);\n background-size: 10px 10px;\n background-position: 0 0, 0 5px, 5px -5px, -5px 0px;\n\n cursor: pointer;\n\n display: grid;\n place-content: center;\n margin: 0;\n font: inherit;\n color: currentColor;\n width: 1.7em;\n height: 1.7em;\n transform: translateY(-0.075em);\n}\n\n.muigui-pop-down-top input[type=checkbox]::before {\n content: "+";\n display: grid;\n place-content: center;\n border-radius: calc(var(--border-radius) + 2px);\n border-left: 1px solid rgba(255,255,255,0.3);\n border-top: 1px solid rgba(255,255,255,0.3);\n border-bottom: 1px solid rgba(0,0,0,0.2);\n border-right: 1px solid rgba(0,0,0,0.2);\n background-color: var(--range-color);\n color: var(--value-bg-color);\n width: calc(var(--line-height) - 4px);\n height: calc(var(--line-height) - 4px);\n}\n\n.muigui-pop-down-top input[type=checkbox]:checked::before {\n content: "X";\n}\n\n\n/* ---- select ---- */\n\n.muigui select,\n.muigui option,\n.muigui input,\n.muigui button {\n color: var(--value-color);\n background-color: var(--value-bg-color);\n font-family: var(--font-family);\n font-size: var(--font-size);\n border: none;\n margin: 0;\n border-radius: var(--border-radius);\n}\n.muigui select {\n appearance: none;\n margin: 0;\n margin-left: 0; /*?*/\n overflow: hidden; /* Safari */\n}\n\n.muigui select:focus,\n.muigui input:focus,\n.muigui button:focus {\n outline: 1px solid var(--focus-color);\n}\n\n.muigui select:hover,\n.muigui option:hover,\n.muigui input:hover,\n.muigui button:hover {\n background-color: var(--hover-bg-color); \n}\n\n/* ------ [ label ] ------ */\n\n.muigui-label {\n border-top: 1px solid var(--menu-sep-color);\n border-bottom: 1px solid var(--menu-sep-color);\n padding-top: 0.4em;\n padding-bottom: 0.3em;\n place-content: center start;\n background-color: var(--menu-bg-color);\n white-space: pre;\n border-radius: var(--border-radius);\n}\n\n/* ------ [ divider] ------ */\n\n.muigui-divider {\n min-height: 6px;\n border-top: 2px solid var(--menu-sep-color);\n margin-top: 6px;\n}\n\n/* ------ [ button ] ------ */\n\n.muigui-button {\n display: grid;\n padding: 2px 0 2px 0;\n}\n.muigui-button button {\n border: none;\n color: var(--value-color);\n background-color: var(--button-bg-color);\n background-image: var(--button-image);\n cursor: pointer;\n place-content: center center;\n height: var(--line-height);\n}\n\n/* ------ [ color ] ------ */\n\n.muigui-color>div {\n overflow: hidden;\n position: relative;\n margin-left: 0;\n margin-right: 0; /* why? */\n max-width: var(--line-height);\n border-radius: var(--border-radius);\n}\n\n.muigui-color>div:focus-within {\n outline: 1px solid var(--focus-color);\n}\n\n.muigui-color input[type=color] {\n border: none;\n padding: 0;\n background: inherit;\n cursor: pointer;\n position: absolute;\n width: 200%;\n left: -10px;\n top: -10px;\n height: 200%;\n}\n.muigui-disabled canvas,\n.muigui-disabled svg,\n.muigui-disabled img,\n.muigui-disabled .muigui-color input[type=color] {\n opacity: 0.2;\n}\n\n/* ------ [ checkbox ] ------ */\n\n.muigui-checkbox>label:nth-child(2) {\n display: grid;\n place-content: center start;\n margin: 0;\n}\n\n.muigui-checkbox input[type=checkbox] {\n -webkit-appearance: none;\n appearance: none;\n width: auto;\n color: var(--value-color);\n background-color: var(--value-bg-color);\n cursor: pointer;\n\n display: grid;\n place-content: center;\n margin: 0;\n font: inherit;\n color: currentColor;\n width: 1.7em;\n height: 1.7em;\n transform: translateY(-0.075em);\n}\n\n.muigui-checkbox input[type=checkbox]::before {\n content: "";\n color: var(--value-color);\n display: grid;\n place-content: center;\n}\n\n.muigui-checkbox input[type=checkbox]:checked::before {\n content: "✔";\n}\n\n.muigui input[type=number]::-webkit-inner-spin-button, \n.muigui input[type=number]::-webkit-outer-spin-button { \n -webkit-appearance: none;\n appearance: none;\n margin: 0; \n}\n.muigui input[type=number] {\n -moz-appearance: textfield;\n}\n\n/* ------ [ radio grid ] ------ */\n\n.muigui-radio-grid>div {\n display: grid;\n gap: 2px;\n}\n\n.muigui-radio-grid input {\n appearance: none;\n display: none;\n}\n\n.muigui-radio-grid button {\n color: var(--color);\n width: 100%;\n text-align: left;\n}\n\n.muigui-radio-grid input:checked + button {\n color: var(--value-color);\n background-color: var(--selected-color);\n}\n\n/* ------ [ color-chooser ] ------ */\n\n.muigui-color-chooser-cursor {\n stroke-width: 1px;\n stroke: white;\n fill: none;\n}\n.muigui-color-chooser-circle {\n stroke-width: 1px;\n stroke: white;\n fill: none;\n}\n\n\n/* ------ [ vec2 ] ------ */\n\n.muigui-vec2 svg {\n background-color: var(--value-bg-color);\n}\n\n.muigui-vec2-axis {\n stroke: 1px;\n stroke: var(--focus-color);\n}\n\n.muigui-vec2-line {\n stroke-width: 1px;\n stroke: var(--value-color);\n fill: var(--value-color);\n}\n\n/* ------ [ direction ] ------ */\n\n.muigui-direction svg {\n background-color: rgba(0,0,0,0.2);\n}\n\n.muigui-direction:focus-within svg {\n outline: none;\n}\n.muigui-direction-range {\n fill: var(--value-bg-color);\n}\n.muigui-direction svg:focus {\n outline: none;\n}\n.muigui-direction svg:focus .muigui-direction-range {\n stroke-width: 0.5px;\n stroke: var(--focus-color);\n}\n\n.muigui-direction-arrow {\n fill: var(--value-color);\n}\n\n/* ------ [ slider ] ------ */\n\n.muigui-slider>div {\n display: flex;\n align-items: stretch;\n height: var(--line-height);\n}\n.muigui-slider svg {\n flex: 1 1 auto;\n}\n.muigui-slider .muigui-slider-up #muigui-orientation {\n transform: scale(1, -1) translateY(-100%);\n}\n\n.muigui-slider .muigui-slider-up #muigui-number-orientation {\n transform: scale(1,-1);\n}\n\n.muigui-ticks {\n stroke: var(--range-color);\n}\n.muigui-thicks {\n stroke: var(--color);\n stroke-width: 2px;\n}\n.muigui-svg-text {\n fill: var(--color);\n font-size: 7px;\n}\n.muigui-mark {\n fill: var(--value-color);\n}\n\n/* ------ [ range ] ------ */\n\n\n.muigui-range input[type=range] {\n -webkit-appearance: none;\n appearance: none;\n background-color: transparent;\n}\n\n.muigui-range input[type=range]::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n border-radius: calc(var(--border-radius) + 2px);\n border-left: 1px solid rgba(255,255,255,0.3);\n border-top: 1px solid rgba(255,255,255,0.3);\n border-bottom: 1px solid rgba(0,0,0,0.2);\n border-right: 1px solid rgba(0,0,0,0.2);\n background-color: var(--range-color);\n margin-top: calc((var(--line-height) - 6px) / -2);\n width: calc(var(--line-height) - 6px);\n height: calc(var(--line-height) - 6px);\n}\n\n.muigui-range input[type=range]::-webkit-slider-runnable-track {\n -webkit-appearance: none;\n appearance: none;\n border: 1px solid var(--menu-sep-color);\n height: 2px;\n}\n\n\n/* dat.gui style - doesn\'t work on Safari iOS */\n\n/*\n.muigui-range input[type=range] {\n cursor: ew-resize;\n overflow: hidden;\n}\n\n.muigui-range input[type=range] {\n -webkit-appearance: none;\n appearance: none;\n background-color: var(--range-right-color);\n margin: 0;\n}\n.muigui-range input[type=range]:hover {\n background-color: var(--range-right-hover-color);\n}\n\n.muigui-range input[type=range]::-webkit-slider-runnable-track {\n -webkit-appearance: none;\n appearance: none;\n height: max-content;\n color: var(--range-left-color);\n margin-top: -1px;\n}\n\n.muigui-range input[type=range]::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 0px;\n height: max-content;\n box-shadow: -1000px 0 0 1000px var(--range-left-color);\n}\n*/\n\n/* FF */\n/*\n.muigui-range input[type=range]::-moz-slider-progress {\n background-color: var(--range-left-color); \n}\n.muigui-range input[type=range]::-moz-slider-thumb {\n height: max-content;\n width: 0;\n border: none;\n box-shadow: -1000px 0 0 1000px var(--range-left-color);\n box-sizing: border-box;\n}\n*/\n\n.muigui-checkered-background {\n background-color: #404040;\n background-image:\n linear-gradient(45deg, #808080 25%, transparent 25%),\n linear-gradient(-45deg, #808080 25%, transparent 25%),\n linear-gradient(45deg, transparent 75%, #808080 75%),\n linear-gradient(-45deg, transparent 75%, #808080 75%);\n background-size: 16px 16px;\n background-position: 0 0, 0 8px, 8px -8px, -8px 0px;\n}\n\n/* ---------------------------------------------------------- */\n\n/* needs to be at bottom to take precedence */\n.muigui-auto-place {\n max-height: 100%;\n position: fixed;\n top: 0;\n right: 15px;\n z-index: 100001;\n}\n\n',themes:{default:{include:["default"],css:"\n "},float:{include:["default"],css:"\n :root {\n color-scheme: light dark,\n }\n\n .muigui {\n --width: 400px;\n --bg-color: initial;\n --label-width: 25%;\n --number-width: 20%;\n }\n\n input,\n .muigui-label-controller>label {\n text-shadow:\n -1px -1px 0 var(--contrast-color),\n 1px -1px 0 var(--contrast-color),\n -1px 1px 0 var(--contrast-color),\n 1px 1px 0 var(--contrast-color);\n }\n\n .muigui-controller > label:nth-child(1) {\n place-content: center end;\n margin-right: 1em;\n }\n\n .muigui-value > :nth-child(2) {\n margin-left: 1em;\n }\n\n .muigui-root>*:nth-child(1) {\n display: none;\n }\n\n .muigui-range input[type=range]::-webkit-slider-thumb {\n border-radius: 1em;\n }\n\n .muigui-range input[type=range]::-webkit-slider-runnable-track {\n -webkit-appearance: initial;\n appearance: none;\n border: 1px solid rgba(0, 0, 0, 0.25);\n height: 2px;\n }\n\n .muigui-colors {\n --value-color: var(--color );\n --value-bg-color: rgba(0, 0, 0, 0.1);\n --disabled-color: #cccccc;\n --menu-bg-color: rgba(0, 0, 0, 0.1);\n --menu-sep-color: #bbbbbb;\n --hover-bg-color: rgba(0, 0, 0, 0);\n --invalid-color: #FF0000;\n --selected-color: rgba(0, 0, 0, 0.3);\n --range-color: rgba(0, 0, 0, 0.125);\n }\n"},form:{include:[],css:"\n .muigui {\n --width: 100%;\n --label-width: 45%;\n --number-width: 40%;\n }\n .muigui-root>button {\n display: none;\n }\n .muigui-controller {\n margin-top: 1em;\n }\n .muigui-label-controller {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n margin-top: 1em;\n }\n .muigui-label-controller:has(.muigui-checkbox) {\n flex-direction: row;\n }\n .muigui-value {\n display: flex;\n align-items: stretch;\n }\n .muigui-value>* {\n flex: 1 1 auto;\n min-width: 0;\n }\n .muigui-controller>*:nth-child(1) {\n flex: 1 0 var(--label-width);\n min-width: 0;\n white-space: pre;\n }\n .muigui-controller>label:nth-child(1) {\n place-content: center start;\n display: inline-grid;\n overflow: hidden;\n }\n .muigui-controller>*:nth-child(2) {\n flex: 1 1 75%;\n min-width: 0;\n }\n "},none:{include:[],css:""}}};function e(t,e={},n=[]){const i=document.createElement(t);return function(t,e,n){for(const[n,i]of Object.entries(e))if("function"==typeof i&&n.startsWith("on")){const e=n.substring(2).toLowerCase();t.addEventListener(e,i,{passive:!1})}else if("object"==typeof i)for(const[e,o]of Object.entries(i))t[n][e]=o;else void 0===t[n]?t.setAttribute(n,i):t[n]=i;for(const e of n)t.appendChild(e)}(i,e,n),i}let n=0;function i(t,e){const n=t.indexOf(e);return n&&t.splice(n,1),t}function o(t,e,n){return Math.max(e,Math.min(n,t))}const r="undefined"!=typeof SharedArrayBuffer?function(t){return t&&t.buffer&&(t.buffer instanceof ArrayBuffer||t.buffer instanceof SharedArrayBuffer)}:function(t){return t&&t.buffer&&t.buffer instanceof ArrayBuffer},s=(t,e,n)=>Math.round(e(t)/n)/(1/n),a=(t,e)=>(t%e+e)%e;function l(t,e){for(const n in e)n in t&&(t[n]=e[n]);return t}const u=(t,e,n,i,o)=>(t-e)*(o-i)/(n-e)+i,c=({from:t,to:e})=>({to:n=>u(n,...t,...e),from:n=>[!0,u(n,...e,...t)]}),h=({from:t,to:e,step:n})=>({min:e[0],max:e[1],...n&&{step:n},converters:c({from:t,to:e})}),d={to:t=>t,from:t=>[!0,t]};function m(t,e,n,i,o){const{converters:{from:r}=d}=o,{min:s,max:a}=o,l=o.minRange||0,u=r(l)[1],c=t.add(e,n,{...o,min:s,max:a-l}).onChange((t=>{h.setValue(Math.min(a,Math.max(t+u,e[i])))})),h=t.add(e,i,{...o,min:s+l,max:a}).onChange((t=>{c.setValue(Math.max(s,Math.min(t-u,e[n])))}));return[c,h]}class p{domElement;#t;#e=[];constructor(t){this.domElement=t,this.#t=t}addElem(t){return this.#t.appendChild(t),t}removeElem(t){return this.#t.removeChild(t),t}pushSubElem(t){this.#t.appendChild(t),this.#t=t}popSubElem(){this.#t=this.#t.parentElement}add(t){return this.#e.push(t),this.addElem(t.domElement),t}remove(t){return this.removeElem(t.domElement),i(this.#e,t),t}pushSubView(t){this.pushSubElem(t.domElement)}popSubView(){this.popSubElem()}setOptions(t){for(const e of this.#e)e.setOptions(t)}updateDisplayIfNeeded(t,e){for(const n of this.#e)n.updateDisplayIfNeeded(t,e);return this}$(t){return this.domElement.querySelector(t)}}class g extends p{#n;#i;#o;constructor(t){super(e("div",{className:"muigui-controller"})),this.#n=[],this.#i=[],t&&this.domElement.classList.add(t)}get parent(){return this.#o}setParent(t){this.#o=t,this.enable(!this.disabled())}show(t=!0){return this.domElement.classList.toggle("muigui-hide",!t),this.domElement.classList.toggle("muigui-show",t),this}hide(){return this.show(!1)}disabled(){return!!this.domElement.closest(".muigui-disabled")}enable(t=!0){return this.domElement.classList.toggle("muigui-disabled",!t),["input","button","select","textarea"].forEach((t=>{this.domElement.querySelectorAll(t).forEach((t=>{const e=!!t.closest(".muigui-disabled");t.disabled=e}))})),this}disable(t=!0){return this.enable(!t)}onChange(t){return this.removeChange(t),this.#n.push(t),this}removeChange(t){return i(this.#n,t),this}onFinishChange(t){return this.removeFinishChange(t),this.#i.push(t),this}removeFinishChange(t){return i(this.#i,t),this}#r(t,e){for(const n of t)n.call(this,e)}emitChange(t,e,n){this.#r(this.#n,t),this.#o&&(void 0===e?this.#o.emitChange(t):this.#o.emitChange({object:e,property:n,value:t,controller:this}))}emitFinalChange(t,e,n){this.#r(this.#i,t),this.#o&&(void 0===e?this.#o.emitChange(t):this.#o.emitFinalChange({object:e,property:n,value:t,controller:this}))}updateDisplay(){}getColors(){const t=t=>t.replace(/-([a-z])/g,((t,e)=>e.toUpperCase())),n=e("div");this.domElement.appendChild(n);const i=Object.fromEntries(["color","bg-color","value-color","value-bg-color","hover-bg-color","menu-bg-color","menu-sep-color","disabled-color"].map((e=>{n.style.color=`var(--${e})`;const i=getComputedStyle(n);return[t(e),i.color]})));return n.remove(),i}}class b extends g{#s;#a;#l;#u={name:""};constructor(t,n,i={}){super("muigui-button",""),this.#s=t,this.#a=n,this.#l=this.addElem(e("button",{type:"button",onClick:()=>{this.#s[this.#a](this)}})),this.setOptions({name:n,...i})}name(t){this.#l.textContent=t}setOptions(t){l(this.#u,t);const{name:e}=this.#u;this.#l.textContent=e}}function f(t,e){if(t.length!==e.length)return!1;for(let n=0;n{t.setValue(i.checked)},onChange:()=>{t.setFinalValue(i.checked)}});super(e("label",{},[i])),this.#f=i}updateDisplay(t){this.#f.checked=t}}const w=[],y=new Set;let k,E;function I(){k=void 0,E=!0;for(const t of w)y.has(t)||t();E=!1,y.size&&(E?$():(y.forEach((t=>{i(w,t)})),y.clear())),$()}function $(){!k&&w.length&&(k=requestAnimationFrame(I))}let C=0;function M(){return"muigui-"+ ++C}class S extends p{constructor(t=""){super(e("div",{className:"muigui-value"})),t&&this.domElement.classList.add(t)}}class V extends g{#v;#x;constructor(t="",n=""){super("muigui-label-controller"),this.#v=M(),this.#x=e("label",{for:this.#v}),this.domElement.appendChild(this.#x),this.pushSubView(new S(t)),this.name(n)}get id(){return this.#v}name(t){return this.#x.title===this.#x.textContent&&(this.#x.title=t),this.#x.textContent=t,this}tooltip(t){this.#x.title=t}}class D extends V{#s;#a;#w;#y;#e;#k;constructor(t,e,n=""){super(n,e),this.#s=t,this.#a=e,this.#w=this.getValue(),this.#y=!1,this.#e=[]}get initialValue(){return this.#w}get object(){return this.#s}get property(){return this.#a}add(t){return this.#e.push(t),super.add(t),this.updateDisplay(),t}#E(t,e){let n=!1;if("object"==typeof t){const e=this.#s[this.#a];if(Array.isArray(t)||r(t))for(let i=0;i=0&&w.splice(e,1)}(this.#k)),this}}class N extends D{constructor(t,e){super(t,e,"muigui-checkbox");const n=this.id;this.add(new x(this,n)),this.updateDisplay()}}const A={to:t=>t,from:t=>[!0,t]},j={to:t=>t.toString(),from:t=>{const e=parseFloat(t);return[!Number.isNaN(e),e]}},U={radToDeg:c({to:[0,180],from:[0,Math.PI]})};function L(){let t=0;return function(e,n,i=5){t-=e.deltaY*n/i;const o=Math.floor(Math.abs(t)/n)*Math.sign(t)*n;return t-=o,o}}class F extends v{#I;#$;#C;#M;#u={step:.01,converters:j,min:Number.NEGATIVE_INFINITY,max:Number.POSITIVE_INFINITY};constructor(t,n){const i=t.setValue.bind(t),r=t.setFinalValue.bind(t),a=L();super(e("input",{type:"number",onInput:()=>{this.#S(i,!0)},onChange:()=>{this.#S(r,!1)},onWheel:e=>{e.preventDefault();const{min:n,max:i,step:r}=this.#u,l=a(e,r),u=parseFloat(this.domElement.value),c=o(s(u+l,(t=>t),r),n,i),[h,d]=this.#$(c);h&&t.setValue(d)}})),this.setOptions(n)}#S(t,e){const n=parseFloat(this.domElement.value),[i,r]=this.#$(n);let s;if(i&&!Number.isNaN(n)){const{min:n,max:i}=this.#u;s=r>=n&&r<=i,this.#M=e,t(o(r,n,i))}this.domElement.classList.toggle("muigui-invalid-value",!i||!s)}updateDisplay(t){this.#M||(this.domElement.value=s(t,this.#I,this.#C)),this.#M=!1}setOptions(t){l(this.#u,t);const{step:e,converters:{to:n,from:i}}=this.#u;return this.#I=n,this.#$=i,this.#C=e,this}}class P extends D{#V;#C;constructor(t,e,n={}){super(t,e,"muigui-text-number"),this.#V=this.add(new F(this,n)),this.updateDisplay()}}class O extends v{#D;constructor(t,n){const i=[];super(e("select",{onChange:()=>{t.setFinalValue(this.#D[this.domElement.selectedIndex])}},n.map((([t,n])=>(i.push(n),e("option",{textContent:t})))))),this.#D=i}updateDisplay(t){const e=this.#D.indexOf(t);this.domElement.selectedIndex=e}}function H(t,e){return Array.isArray(t)?Array.isArray(t[0])?t:e?t.map(((t,e)=>[t,e])):t.map((t=>[t,t])):[...Object.entries(t)]}class T extends D{constructor(t,e,n){super(t,e,"muigui-select");const i="number"==typeof this.getValue(),{keyValues:o}=n,r=H(o,i);this.add(new O(this,r)),this.updateDisplay()}}class z extends v{#I;#$;#C;#M;#u={step:.01,min:0,max:1,converters:A};constructor(t,n){const i=L();super(e("input",{type:"range",onInput:()=>{this.#M=!0;const{min:e,max:n,step:i}=this.#u,r=parseFloat(this.domElement.value),a=o(s(r,(t=>t),i),e,n),[l,u]=this.#$(a);l&&t.setValue(u)},onChange:()=>{this.#M=!0;const{min:e,max:n,step:i}=this.#u,r=parseFloat(this.domElement.value),a=o(s(r,(t=>t),i),e,n),[l,u]=this.#$(a);l&&t.setFinalValue(u)},onWheel:e=>{e.preventDefault();const[n,r]=this.#$(parseFloat(this.domElement.value));if(!n)return;const{min:a,max:l,step:u}=this.#u,c=i(e,u),h=o(s(r+c,(t=>t),u),a,l);t.setValue(h)}})),this.setOptions(n)}updateDisplay(t){this.#M||(this.domElement.value=s(t,this.#I,this.#C)),this.#M=!1}setOptions(t){l(this.#u,t);const{step:e,min:n,max:i,converters:{to:o,from:r}}=this.#u;return this.#I=o,this.#$=r,this.#C=e,this.domElement.step=e,this.domElement.min=n,this.domElement.max=i,this}}class W extends D{constructor(t,e,n){super(t,e,"muigui-range"),this.add(new z(this,n)),this.add(new F(this,n))}}class B extends v{#I;#$;#M;#u={converters:A};constructor(t,n){const i=t.setValue.bind(t),o=t.setFinalValue.bind(t);super(e("input",{type:"text",onInput:()=>{this.#S(i,!0)},onChange:()=>{this.#S(o,!1)}})),this.setOptions(n)}#S(t,e){const[n,i]=this.#$(this.domElement.value);n&&(this.#M=e,t(i)),this.domElement.style.color=n?"":"var(--invalid-color)"}updateDisplay(t){this.#M||(this.domElement.value=this.#I(t),this.domElement.style.color=""),this.#M=!1}setOptions(t){l(this.#u,t);const{converters:{to:e,from:n}}=this.#u;return this.#I=e,this.#$=n,this}}class G extends D{constructor(t,e){super(t,e,"muigui-text"),this.add(new B(this)),this.updateDisplay()}}const R=(t,e,n)=>Math.max(e,Math.min(n,t)),Z=(t,e,n)=>t+(e-t)*n,J=t=>t>=0?t%1:1-t%1,Y=t=>+t.toFixed(0),Q=t=>+t.toFixed(3),K=t=>parseInt(t.substring(1,3),16)<<16|parseInt(t.substring(3,5),16)<<8|parseInt(t.substring(5,7),16),_=t=>parseInt(t.substring(1,3),16)*2**24+65536*parseInt(t.substring(3,5),16)+256*parseInt(t.substring(5,7),16)+parseInt(t.substring(7,9),16),q=t=>[parseInt(t.substring(1,3),16),parseInt(t.substring(3,5),16),parseInt(t.substring(5,7),16)],X=t=>`#${Array.from(t).map((t=>t.toString(16).padStart(2,"0"))).join("")}`,tt=t=>[parseInt(t.substring(1,3),16),parseInt(t.substring(3,5),16),parseInt(t.substring(5,7),16),parseInt(t.substring(7,9),16)],et=t=>`#${Array.from(t).map((t=>t.toString(16).padStart(2,"0"))).join("")}`,nt=t=>q(t).map((t=>Q(t/255))),it=t=>X(Array.from(t).map((t=>Math.round(R(255*t,0,255))))),ot=t=>tt(t).map((t=>Q(t/255))),rt=t=>et(Array.from(t).map((t=>Math.round(R(255*t,0,255))))),st=t=>R(Math.round(255*t),0,255).toString(16).padStart(2,"0"),at=t=>({r:parseInt(t.substring(1,3),16)/255,g:parseInt(t.substring(3,5),16)/255,b:parseInt(t.substring(5,7),16)/255}),lt=t=>({r:parseInt(t.substring(1,3),16)/255,g:parseInt(t.substring(3,5),16)/255,b:parseInt(t.substring(5,7),16)/255,a:parseInt(t.substring(7,9),16)/255}),ut=t=>`rgb(${q(t).join(", ")})`,ct=/^\s*rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)\s*$/,ht=t=>`rgba(${tt(t).map(((t,e)=>3===e?t/255:t)).join(", ")})`,dt=/^\s*rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+\.\d+|\d+)\s*\)\s*$/,mt=t=>{const e=yt(q(t)).map((t=>Y(t)));return`hsl(${e[0]}, ${e[1]}%, ${e[2]}%)`},pt=t=>{const e=kt(tt(t)).map(((t,e)=>3===e?Q(t):Y(t)));return`hsl(${e[0]} ${e[1]}% ${e[2]}% / ${e[3]})`},gt=/^\s*hsl\(\s*(\d+)(?:deg|)\s*(?:,|)\s*(\d+)%\s*(?:,|)\s*(\d+)%\s*\)\s*$/,bt=/^\s*hsl\(\s*(\d+)(?:deg|)\s*(?:,|)\s*(\d+)%\s*(?:,|)\s*(\d+)%\s*\/\s*(\d+\.\d+|\d+)\s*\)\s*$/,ft=(t,e)=>(t%e+e)%e;function vt([t,e,n]){t=ft(t,360),e=R(e/100,0,1),n=R(n/100,0,1);const i=e*Math.min(n,1-n);function o(e){const o=(e+t/30)%12;return n-i*Math.max(-1,Math.min(o-3,9-o,1))}return[o(0),o(8),o(4)].map((t=>Math.round(255*t)))}function xt([t,e,n]){const i=Math.max(t,e,n),o=Math.min(t,e,n),r=.5*(o+i),s=i-o;let a=0,l=0;if(0!==s)switch(l=0===r||1===r?0:(i-r)/Math.min(r,1-r),i){case t:a=(e-n)/s+(e{const[e,n,i]=xt(t.map((t=>t/255)));return[360*e,100*n,100*i]},kt=t=>{const[e,n,i,o]=wt(t.map((t=>t/255)));return[360*e,100*n,100*i,o]};function Et([t,e,n]){return e=R(e,0,1),n=R(n,0,1),[t,t+2/3,t+1/3].map((t=>Z(1,R(Math.abs(6*J(t)-3)-1,0,1),e)*n))}function It([t,e,n,i]){return[...Et([t,e,n]),i]}const $t=t=>Math.round(1e3*t)/1e3;function Ct([t,e,n]){const i=n>e?[n,e,-1,2/3]:[e,n,0,-1/3],o=i[0]>t?[i[0],i[1],i[3],t]:[t,i[1],i[2],i[0]],r=o[0]-Math.min(o[3],o[1]);return[Math.abs(o[2]+(o[3]-o[1])/(6*r+Number.EPSILON)),r/(o[0]+Number.EPSILON),o[0]].map($t)}function Mt([t,e,n,i]){return[...Ct([t,e,n]),i]}const St=t=>t.endsWith("a")||t.startsWith("hex8"),Vt=[{re:/^#(?:[0-9a-f]){6}$/i,format:"hex6"},{re:/^(?:[0-9a-f]){6}$/i,format:"hex6-no-hash"},{re:/^#(?:[0-9a-f]){8}$/i,format:"hex8"},{re:/^(?:[0-9a-f]){8}$/i,format:"hex8-no-hash"},{re:/^#(?:[0-9a-f]){3}$/i,format:"hex3"},{re:/^(?:[0-9a-f]){3}$/i,format:"hex3-no-hash"},{re:ct,format:"css-rgb"},{re:gt,format:"css-hsl"},{re:dt,format:"css-rgba"},{re:bt,format:"css-hsla"}];function Dt(t){switch(typeof t){case"number":return console.warn('can not reliably guess format based on a number. You should pass in a format like {format: "uint32-rgb"} or {format: "uint32-rgb"}'),t<=16777215?"uint32-rgb":"uint32-rgba";case"string":{const e=function(t){for(const e of Vt)if(e.re.test(t))return e}(t.trim());if(e)return e.format;break}case"object":if(t instanceof Uint8Array||t instanceof Uint8ClampedArray){if(3===t.length)return"uint8-rgb";if(4===t.length)return"uint8-rgba"}else if(t instanceof Float32Array){if(3===t.length)return"float-rgb";if(4===t.length)return"float-rgba"}else if(Array.isArray(t)){if(3===t.length)return"float-rgb";if(4===t.length)return"float-rgba"}else if("r"in t&&"g"in t&&"b"in t)return"a"in t?"object-rgba":"object-rgb"}throw new Error(`unknown color format: ${t}`)}function Nt(t){return t.trim(t)}function At(t){return t.trim(t)}function jt(t){return t[1]===t[2]&&t[3]===t[4]&&t[5]===t[6]?`#${t[1]}${t[3]}${t[5]}`:t}const Ut=/^(#|)([0-9a-f]{3})$/i;function Lt(t){const e=Ut.exec(t);if(e){const[,,t]=e;return"#"+`${(n=t)[0]}${n[0]}${n[1]}${n[1]}${n[2]}${n[2]}`}var n;return t}function Ft(t){return jt(Nt(t))}const Pt=t=>{const e=ct.exec(t);if(!e)return[!1];const n=[e[1],e[2],e[3]].map((t=>parseInt(t)));return[!n.find((t=>t>255)),`rgb(${n.join(", ")})`]},Ot=t=>{const e=dt.exec(t);if(!e)return[!1];const n=[e[1],e[2],e[3],e[4]].map(((t,e)=>3===e?parseFloat(t):parseInt(t)));return[!n.find((t=>t>255)),`rgba(${n.join(", ")})`]},Ht=t=>{const e=gt.exec(t);if(!e)return[!1];const n=[e[1],e[2],e[3]].map((t=>parseFloat(t)));return[!n.find((t=>Number.isNaN(t))),`hsl(${n[0]}, ${n[1]}%, ${n[2]}%)`]},Tt=t=>{const e=bt.exec(t);if(!e)return[!1];const n=[e[1],e[2],e[3],e[4]].map((t=>parseFloat(t)));return[!n.find((t=>Number.isNaN(t))),`hsl(${n[0]} ${n[1]}% ${n[2]}% / ${n[3]})`]},zt=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*$/,Wt=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*$/,Bt=t=>{const e=t.split(",").map((t=>t.trim())),n=e.map((t=>parseFloat(t)));if(3!==n.length)return[!1];const i=e.findIndex((t=>isNaN(t)));return[i<0,n.map((t=>Q(t)))]},Gt=t=>{const e=t.split(",").map((t=>t.trim())),n=e.map((t=>parseFloat(t)));if(4!==n.length)return[!1];const i=e.findIndex((t=>isNaN(t)));return[i<0,n.map((t=>Q(t)))]},Rt=/^\s*(?:0x){0,1}([0-9a-z]{1,6})\s*$/i,Zt=/^\s*(?:0x){0,1}([0-9a-z]{1,8})\s*$/i,Jt=/^\s*#[a-f0-9]{6}\s*$|^\s*#[a-f0-9]{3}\s*$/i,Yt=/^\s*[a-f0-9]{6}\s*$/i,Qt=/^\s*#[a-f0-9]{8}\s*$/i,Kt=/^\s*[a-f0-9]{8}\s*$/i,_t={hex6:{color:{from:t=>[!0,t],to:Nt},text:{from:t=>[Jt.test(t),t.trim()],to:t=>t}},hex8:{color:{from:t=>[!0,t],to:At},text:{from:t=>[Qt.test(t),t.trim()],to:t=>t}},hex3:{color:{from:t=>[!0,Ft(t)],to:Lt},text:{from:t=>[Jt.test(t),jt(t.trim())],to:t=>t}},"hex6-no-hash":{color:{from:t=>[!0,t.substring(1)],to:t=>`#${Nt(t)}`},text:{from:t=>[Yt.test(t),t.trim()],to:t=>t}},"hex8-no-hash":{color:{from:t=>[!0,t.substring(1)],to:t=>`#${At(t)}`},text:{from:t=>[Kt.test(t),t.trim()],to:t=>t}},"hex3-no-hash":{color:{from:t=>[!0,Ft(t).substring(1)],to:Lt},text:{from:t=>[Yt.test(t),jt(t.trim())],to:t=>t}},"uint32-rgb":{color:{from:t=>[!0,K(t)],to:t=>`#${Math.round(t).toString(16).padStart(6,"0")}`},text:{from:t=>(t=>{const e=Rt.exec(t);return e?[!0,parseInt(e[1],16)]:[!1]})(t),to:t=>`0x${t.toString(16).padStart(6,"0")}`}},"uint32-rgba":{color:{from:t=>[!0,_(t)],to:t=>`#${Math.round(t).toString(16).padStart(8,"0")}`},text:{from:t=>(t=>{const e=Zt.exec(t);return e?[!0,parseInt(e[1],16)]:[!1]})(t),to:t=>`0x${t.toString(16).padStart(8,"0")}`}},"uint8-rgb":{color:{from:t=>[!0,q(t)],to:X},text:{from:t=>{const e=zt.exec(t);if(!e)return[!1];const n=[e[1],e[2],e[3]].map((t=>parseInt(t)));return[!n.find((t=>t>255)),n]},to:t=>t.join(", ")}},"uint8-rgba":{color:{from:t=>[!0,tt(t)],to:et},text:{from:t=>{const e=Wt.exec(t);if(!e)return[!1];const n=[e[1],e[2],e[3],e[4]].map((t=>parseInt(t)));return[!n.find((t=>t>255)),n]},to:t=>t.join(", ")}},"float-rgb":{color:{from:t=>[!0,nt(t)],to:it},text:{from:Bt,to:t=>Array.from(t).map((t=>Q(t))).join(", ")}},"float-rgba":{color:{from:t=>[!0,ot(t)],to:rt},text:{from:Gt,to:t=>Array.from(t).map((t=>Q(t))).join(", ")}},"float-hsv":{color:{from:t=>[!0,Ct(nt(t))],to:t=>Et(it(t))},text:{from:Bt,to:t=>Array.from(t).map((t=>Q(t))).join(", ")}},"float-hsva":{color:{from:t=>[!0,Mt(nt(t))],to:t=>It(it(t))},text:{from:Gt,to:t=>Array.from(t).map((t=>Q(t))).join(", ")}},"object-rgb":{color:{from:t=>[!0,at(t)],to:t=>`#${st(t.r)}${st(t.g)}${st(t.b)}`},text:{from:t=>{try{const e=t.replace(/([a-z])/g,'"$1"'),n=JSON.parse(e);if(Number.isNaN(n.r)||Number.isNaN(n.g)||Number.isNaN(n.b))throw new Error("not {r, g, b}");return[!0,n]}catch(t){return[!1]}},to:t=>`{r:${Q(t.r)}, g:${Q(t.g)}, b:${Q(t.b)}}`}},"object-rgba":{color:{from:t=>[!0,lt(t)],to:t=>`#${st(t.r)}${st(t.g)}${st(t.b)}${st(t.a)}`},text:{from:t=>{try{const e=t.replace(/([a-z])/g,'"$1"'),n=JSON.parse(e);if(Number.isNaN(n.r)||Number.isNaN(n.g)||Number.isNaN(n.b)||Number.isNaN(n.a))throw new Error("not {r, g, b, a}");return[!0,n]}catch(t){return[!1]}},to:t=>`{r:${Q(t.r)}, g:${Q(t.g)}, b:${Q(t.b)}}, a:${Q(t.a)}}`}},"css-rgb":{color:{from:t=>[!0,ut(t)],to:t=>{const e=ct.exec(t);return X([e[1],e[2],e[3]].map((t=>parseInt(t))))}},text:{from:Pt,to:t=>Pt(t)[1]}},"css-rgba":{color:{from:t=>[!0,ht(t)],to:t=>{const e=dt.exec(t);return et([e[1],e[2],e[3],e[4]].map(((t,e)=>3===e?255*parseFloat(t)|0:parseInt(t))))}},text:{from:Ot,to:t=>Ot(t)[1]}},"css-hsl":{color:{from:t=>[!0,mt(t)],to:t=>{const e=gt.exec(t),n=vt([e[1],e[2],e[3]].map((t=>parseFloat(t))));return X(n)}},text:{from:Ht,to:t=>Ht(t)[1]}},"css-hsla":{color:{from:t=>[!0,pt(t)],to:t=>{const e=bt.exec(t),n=function([t,e,n,i]){return[...vt([t,e,n]),255*i|0]}([e[1],e[2],e[3],e[4]].map((t=>parseFloat(t))));return et(n)}},text:{from:Tt,to:t=>Tt(t)[1]}}};class qt extends p{constructor(t,n){super(e(t,{className:n}))}}class Xt extends V{#N;constructor(t){super("muigui-canvas",t),this.#N=this.add(new qt("canvas","muigui-canvas")).domElement}get canvas(){return this.#N}}class te extends v{#I;#$;#A;#M;#u={converters:A};constructor(t,n){const i=e("input",{type:"color",onInput:()=>{const[e,n]=this.#$(i.value);e&&(this.#M=!0,t.setValue(n))},onChange:()=>{const[e,n]=this.#$(i.value);e&&(this.#M=!0,t.setFinalValue(n))}});super(e("div",{},[i])),this.setOptions(n),this.#A=i}updateDisplay(t){this.#M||(this.#A.value=this.#I(t)),this.#M=!1}setOptions(t){l(this.#u,t);const{converters:{to:e,from:n}}=this.#u;return this.#I=e,this.#$=n,this}}class ee extends D{#j;#V;constructor(t,e,n={}){super(t,e,"muigui-color");const i=n.format||Dt(this.getValue()),{color:o,text:r}=_t[i];this.#j=this.add(new te(this,{converters:o})),this.#V=this.add(new B(this,{converters:r})),this.updateDisplay()}setOptions(t){const{format:e}=t;if(e){const{color:t,text:n}=_t[e];this.#j.setOptions({converters:t}),this.#V.setOptions({converters:n})}return super.setOptions(t),this}}class ne extends g{constructor(){super("muigui-divider")}}class ie extends g{#U;#L;constructor(t){super(t),this.#U=[],this.#L=this}get children(){return this.#U}get controllers(){return this.#U.filter((t=>!(t instanceof ie)))}get folders(){return this.#U.filter((t=>t instanceof ie))}reset(t=!0){for(const e of this.#U)e instanceof ie&&!t||e.reset(t);return this}updateDisplay(){for(const t of this.#U)t.updateDisplay();return this}remove(t){const e=this.#U.indexOf(t);if(e>=0){const t=this.#U.splice(e,1)[0];t.domElement.remove(),t.setParent(null)}return this}#F(t){return this.domElement.appendChild(t.domElement),this.#U.push(t),t.setParent(this),t}addController(t){return this.#L.#F(t)}pushContainer(t){return this.addController(t),this.#L=t,t}popContainer(){return this.#L=this.#L.parent,this}}class oe extends ie{#P;constructor(t="Controls",n="muigui-menu"){super(n),this.#P=e("label"),this.addElem(e("button",{type:"button",onClick:()=>this.toggleOpen()},[this.#P])),this.pushContainer(new ie("muigui-open-container")),this.pushContainer(new ie),this.name(t),this.open()}open(t=!0){return this.domElement.classList.toggle("muigui-closed",!t),this.domElement.classList.toggle("muigui-open",t),this}close(){return this.open(!1)}name(t){return this.#P.textContent=t,this}title(t){return this.name(t)}toggleOpen(){return this.open(!this.domElement.classList.contains("muigui-open")),this}}class re extends g{constructor(t){super("muigui-label"),this.text(t)}text(t){return this.domElement.textContent=t,this}}function se(){}function ae(t,e,n){const i=t.getBoundingClientRect(),o=e.clientX-i.left,r=e.clientY-i.top,s=o/i.width,a=r/i.height,l=o-(n=n||[o,r])[0],u=r-n[1];return{x:o,y:r,nx:s,ny:a,dx:l,dy:u,ndx:l/i.width,ndy:u/i.width}}function le(t,{onDown:e=se,onMove:n=se,onUp:i=se}){let o;const r=function(e){const i={type:"move",...ae(t,e,o)};n(i)},s=function(e){t.releasePointerCapture(e.pointerId),t.removeEventListener("pointermove",r),t.removeEventListener("pointerup",s),document.body.style.backgroundColor="",i("up")},a=function(n){t.addEventListener("pointermove",r),t.addEventListener("pointerup",s),t.setPointerCapture(n.pointerId);const i=ae(t,n);o=[i.x,i.y],e({type:"down",...i})};return t.addEventListener("pointerdown",a),function(){t.removeEventListener("pointerdown",a)}}function ue(t){return t.querySelectorAll("[data-src]").forEach((e=>{const i="muigui-id-"+n++;e.id=i,t.querySelectorAll(`[data-target=${e.dataset.src}]`).forEach((t=>{t.setAttribute("fill",`url(#${i})`)}))})),t}class ce extends v{#I;#$;#O;#H;#T;#z;#W;#B;#G;#R;#Z;#J;#Y;#Q;#u={converters:A,alpha:!1};#K;#_;constructor(t,n){super(e("div",{innerHTML:'\n\n \n \n \n \n \n \n \n \n\n \n \n \n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n \n \n \n \n \n \n \n \n\n',className:"muigui-no-scroll"})),this.#O=this.domElement.children[0],this.#T=this.domElement.children[1],this.#B=this.domElement.children[2],ue(this.#O),ue(this.#T),ue(this.#B),this.#H=this.$(".muigui-color-chooser-circle"),this.#z=this.$("[data-src=muigui-color-chooser-hue]"),this.#W=this.$(".muigui-color-chooser-hue-cursor"),this.#G=this.$("[data-src=muigui-color-chooser-alpha]"),this.#R=this.$(".muigui-color-chooser-alpha-cursor");const i=e=>{const n=o(e.nx,0,1),i=o(e.ny,0,1);this.#Z[1]=n,this.#Z[2]=1-i,this.#J=!0,this.#Q=!0;const[r,s]=this.#$(this.#K(this.#Z));r&&t.setValue(s)},r=e=>{const n=o(e.nx,0,1);this.#Z[0]=n,this.#Y=!0,this.#Q=!0;const[i,r]=this.#$(this.#K(this.#Z));i&&t.setValue(r)},s=e=>{const n=o(e.nx,0,1);this.#Z[3]=n,this.#J=!0,this.#Y=!0;const[i,r]=this.#$(this.#K(this.#Z));i&&t.setValue(r)};le(this.#O,{onDown:i,onMove:i}),le(this.#T,{onDown:r,onMove:r}),le(this.#B,{onDown:s,onMove:s}),this.setOptions(n)}updateDisplay(t){this.#Z||(this.#Z=this.#_(this.#I(t)));{const[e,n,i,o=1]=this.#_(this.#I(t));this.#J||(this.#Z[0]=n>.001&&i>.001?e:this.#Z[0]),this.#Y||(this.#Z[1]=n,this.#Z[2]=i),this.#Q||(this.#Z[3]=o)}{const[t,e,n,i]=this.#Z,[o,r,s]=wt(It(this.#Z));this.#J||this.#W.setAttribute("transform",`translate(${64*t}, 0)`),this.#z.children[0].setAttribute("stop-color",`hsl(${360*o} 0% 100% / ${i})`),this.#z.children[1].setAttribute("stop-color",`hsl(${360*o} 100% 50% / ${i})`),this.#Q||this.#R.setAttribute("transform",`translate(${64*i}, 0)`),this.#G.children[0].setAttribute("stop-color",`hsl(${360*o} ${100*r}% ${100*s}% / 0)`),this.#G.children[1].setAttribute("stop-color",`hsl(${360*o} ${100*r}% ${100*s}% / 1)`),this.#Y||(this.#H.setAttribute("cx",""+64*e),this.#H.setAttribute("cy",""+48*(1-n)))}this.#J=!1,this.#Y=!1,this.#Q=!1}setOptions(t){l(this.#u,t);const{converters:{to:e,from:n},alpha:i}=this.#u;return this.#B.style.display=i?"":"none",this.#K=i?t=>rt(It(t)):t=>it(Et(t)),this.#_=i?t=>Mt(ot(t)):t=>Ct(nt(t)),this.#I=e,this.#$=n,this}}class he extends D{#q;#X;#f;#tt;#u={open:!1};constructor(t,n,i={}){super(t,n,"muigui-pop-down-controller"),this.#q=this.add(new qt("div","muigui-pop-down-top"));const o=this.#q.addElem(e("input",{type:"checkbox",onChange:()=>{this.#u.open=o.checked,this.updateDisplay()}}));this.#f=o,this.#X=this.#q.add(new qt("div","muigui-pop-down-values"));const r=new qt("div","muigui-pop-down-bottom muigui-open-container");this.#tt=new qt("div"),r.add(this.#tt),this.add(r),this.setOptions(i)}setKnobColor(t){this.#f&&(this.#f.style=`\n --range-color: ${t};\n --value-bg-color: ${t};\n `)}updateDisplay(){super.updateDisplay();const{open:t}=this.#u;this.domElement.children[1].classList.toggle("muigui-open",t),this.domElement.children[1].classList.toggle("muigui-closed",!t)}setOptions(t){l(this.#u,t),super.setOptions(t),this.updateDisplay()}addTop(t){return this.#X.add(t)}addBottom(t){return this.#tt.add(t)}}class de extends he{#j;#V;#I;constructor(t,e,n={}){super(t,e,"muigui-color-chooser");const i=n.format||Dt(this.getValue()),{color:o,text:r}=_t[i];this.#I=o.to,this.#V=new B(this,{converters:r,alpha:St(i)}),this.#j=new ce(this,{converters:o,alpha:St(i)}),this.addTop(this.#V),this.addBottom(this.#j),this.___setKnobHelper=!0,this.updateDisplay()}#et(){if(this.#I){const t=this.#I(this.getValue()),e=9===t.length?t.substring(7,9):"FF",n=yt(q(t));n[2]=(n[2]+50)%100;const i=X(vt(n));this.setKnobColor(`${t.substring(0,7)}${e}`,i)}}updateDisplay(){super.updateDisplay(),this.___setKnobHelper&&this.#et()}setOptions(t){return super.setOptions(t),this}}class me extends oe{add(t,e,...n){const i=t instanceof g?t:function(t,e,...n){const[i]=n;if(Array.isArray(i))return new T(t,e,{keyValues:i});if(i&&i.keyValues)return new T(t,e,{keyValues:i.keyValues});const o=typeof t[e];switch(o){case"number":if("number"==typeof n[0]&&"number"==typeof n[1]){const i=n[0],o=n[1],r=n[2];return new W(t,e,{min:i,max:o,...r&&{step:r}})}return 0===n.length?new P(t,e,...n):new W(t,e,...n);case"boolean":return new N(t,e,...n);case"function":return new b(t,e,...n);case"string":return new G(t,e,...n);case"undefined":throw new Error(`no property named ${e}`);default:throw new Error(`unhandled type ${o} for property ${e}`)}}(t,e,...n);return this.addController(i)}addCanvas(t){return this.addController(new Xt(t))}addColor(t,e,n={}){const i=t[e];return St(n.format||Dt(i))?this.addController(new de(t,e,n)):this.addController(new ee(t,e,n))}addDivider(){return this.addController(new ne)}addFolder(t){return this.addController(new me(t))}addLabel(t){return this.addController(new re(t))}addButton(t,e){const n={fn:e};return this.add(n,"fn").name(t)}}class pe extends HTMLElement{constructor(){super(),this.shadow=this.attachShadow({mode:"open"})}}customElements.define("muigui-element",pe);const ge=new CSSStyleSheet,be=new CSSStyleSheet;function fe(t){let e,n;function i(){if(e&&!n){const o=e;e=void 0,n=t.replace(o).then((()=>{n=void 0,i()}))}}return function(t){e=t,i()}}const ve=fe(ge),xe=fe(be);function we(e){const{include:n,css:i}=t.themes[e];return`${n.map((e=>t[e])).join("\n")} : css.default}\n${i||""}`}class ye extends me{static converters=U;static mapRange=u;static makeRangeConverters=c;static makeRangeOptions=h;static makeMinMaxPair=m;#nt=new CSSStyleSheet;constructor(n={}){super("Controls","muigui-root"),n instanceof HTMLElement&&(n={parent:n});const{autoPlace:i=!0,width:o,title:r="Controls"}=n;let{parent:s}=n;if(o&&(this.domElement.style.width=/^\d+$/.test(o)?`${o}px`:o),void 0===s&&i&&(s=document.body,this.domElement.classList.add("muigui-auto-place")),s){const t=e("muigui-element");t.shadowRoot.adoptedStyleSheets=[this.#nt,ge,be],t.shadow.appendChild(this.domElement),s.appendChild(t)}r&&this.title(r),this.#nt.replaceSync(t.default),this.domElement.classList.add("muigui","muigui-colors")}setStyle(t){this.#nt.replace(t)}static setBaseStyles(t){ve(t)}static getBaseStyleSheet(){return ge}static setUserStyles(t){xe(t)}static getUserStyleSheet(){return be}setTheme(t){this.setStyle(we(t))}static setTheme(t){ye.setBaseStyles(we(t))}}function ke(){}const Ee={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]};function Ie(t,{onDown:e=ke,onUp:n=ke}){const i=function(t){const i=t.shiftKey?10:1,[o,r]=(Ee[t.key]||[0,0]).map((t=>t*i));("keydown"===t.type?e:n)({type:t.type.substring(3),dx:o,dy:r,event:t})};return t.addEventListener("keydown",i),t.addEventListener("keyup",i),function(){t.removeEventListener("keydown",i),t.removeEventListener("keyup",i)}}function $e(t,e=""){if(!t)throw new Error(e)}function Ce(t,e,n,i,o,r){const s=Math.abs(n)*Math.cos(r),a=Math.abs(i)*Math.sin(r);return[t+Math.cos(o)*s-Math.sin(o)*a,e+Math.sin(o)*s+Math.cos(o)*a]}function Me(t,e,n,i,o){$e(Math.abs(i-o)<=2*Math.PI),$e(i>=-Math.PI&&i<=2*Math.PI),$e(i<=o),$e(o>=-Math.PI&&o<=4*Math.PI);const{x1:r,y1:s,x2:a,y2:l,fa:u,fs:c}=function(t,e,n,i,o,r,s){const[a,l]=Ce(t,e,n,i,o,r),[u,c]=Ce(t,e,n,i,o,r+s);return{x1:a,y1:l,x2:u,y2:c,fa:Math.abs(s)>Math.PI?1:0,fs:s>0?1:0}}(t,e,n,n,0,i,o-i);return Math.abs(Math.abs(i-o)-2*Math.PI)>Number.EPSILON?`M${t} ${e} L${r} ${s} A ${n} ${n} 0 ${u} ${c} ${a} ${l} L${t} ${e}`:`M${r} ${s} L${r} ${s} A ${n} ${n} 0 ${u} ${c} ${a} ${l}`}const Se=t=>a(t+Math.PI,2*Math.PI)-Math.PI;class Ve extends v{#it;#ot;#rt;#st;#u={step:1,min:-180,max:180,dirMin:-Math.PI,dirMax:Math.PI,wrap:void 0,converters:A};constructor(t,n={}){const i=L();super(e("div",{className:"muigui-direction muigui-no-scroll",innerHTML:'\n\n \x3c!----\x3e\n \n \n \n \n \n \n\n',onWheel:e=>{e.preventDefault();const{min:n,max:r,step:l}=this.#u,u=i(e,l);let c=this.#rt+u;this.#st&&(c=a(c-n,r-n)+n);const h=o(s(c,(t=>t),l),n,r);t.setValue(h)}}));const r=e=>{const{min:n,max:i,step:r,dirMin:a,dirMax:l}=this.#u,u=2*e.nx-1,c=2*e.ny-1,h=Math.atan2(c,u),d=(a+l)/2,m=o((Se(h-d)-Se(a-d))/(l-a),0,1),p=s(n+(i-n)*m,(t=>t),r);t.setValue(p)};le(this.domElement,{onDown:r,onMove:r}),Ie(this.domElement,{onDown:e=>{const{min:n,max:i,step:r}=this.#u,a=o(s(this.#rt+e.dx*r,(t=>t),r),n,i);t.setValue(a)}}),this.#it=this.$("#muigui-arrow"),this.#ot=this.$("#muigui-range"),this.setOptions(n)}updateDisplay(t){this.#rt=t;const{min:e,max:n}=this.#u,i=(t-e)/(n-e),o=(r=this.#u.dirMin,s=this.#u.dirMax,r+(s-r)*i);var r,s;this.#it.style.transform=`rotate(${o}rad)`}setOptions(t){l(this.#u,t);const{dirMin:e,dirMax:n,wrap:i}=this.#u;this.#st=void 0!==i?i:Math.abs(e-n)>=2*Math.PI-Number.EPSILON;const[o,r]=e(o.push(i),e("label",{},[e("input",{type:"radio",name:r,value:a,onChange:function(){this.checked&&t.setFinalValue(s.#D[this.value])}}),e("button",{type:"button",textContent:n,onClick:function(){this.previousElementSibling.click()}})]))))));const s=this;this.#D=o,this.cols(i)}updateDisplay(t){const e=this.#D.indexOf(t);for(let t=0;t{e({rect:t.getBoundingClientRect(),elem:t})})).observe(t)}function Ae(t,e,n,i){Ne(t,(({rect:o})=>{const{width:r,height:s}=o;t.setAttribute("viewBox",`-${r*e} -${s*n} ${r} ${s}`),i({elem:t,rect:o})}))}function je(t,e,n,i,o,r){const a=[];tt),n)),e=Math.min(e,o);for(let i=t;i<=e;i+=n)a.push(`M${i} 0 l0 ${r}`);return a.join(" ")}class Ue extends v{#at;#lt;#ut;#ct;#ht;#dt;#mt;#pt;#gt;#rt;#bt;#u={min:-100,max:100,step:1,unit:10,unitSize:10,ticksPerUnit:5,labelFn:t=>t,tickHeight:1,limits:!0,thicksColor:void 0,orientation:void 0};constructor(t,n){const i=L();let r;super(e("div",{innerHTML:'\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \x3c!----\x3e\n \x3c!----\x3e\n \n \n \n \n\n',className:"muigui-no-v-scroll",onWheel:e=>{e.preventDefault();const{min:n,max:r,step:a}=this.#u,l=i(e,a),u=o(s(this.#rt+l,(t=>t),a),n,r);t.setValue(u)}})),this.#at=this.$("svg"),this.#lt=this.$("#muigui-origin"),this.#ut=this.$("#muigui-ticks"),this.#ct=this.$("#muigui-thicks"),this.#ht=this.$("#muigui-numbers"),this.#dt=this.$("#muigui-left-grad"),this.#mt=this.$("#muigui-right-grad"),this.setOptions(n),le(this.domElement,{onDown:()=>{r=this.#rt},onMove:e=>{const{min:n,max:i,unitSize:a,unit:l,step:u}=this.#u,c=o(s(r-e.dx/a*l,(t=>t),u),n,i);t.setValue(c)}}),Ie(this.domElement,{onDown:e=>{const{min:n,max:i,step:r}=this.#u,a=o(s(this.#rt+e.dx*r,(t=>t),r),n,i);t.setValue(a)}}),Ae(this.#at,.5,0,(({rect:{width:t}})=>{this.#dt.setAttribute("x",-t/2),this.#mt.setAttribute("x",t/2-20),this.#bt=function(t){const e=t.innerHTML;t.innerHTML="- ";const n=t.querySelector("text").getComputedTextLength();return t.innerHTML=e,n}(this.#ht),this.#pt=t,this.#ft()}))}#ft(){if(!this.#pt||void 0===this.#rt)return;const{labelFn:t,limits:e,min:n,max:i,orientation:o,tickHeight:r,ticksPerUnit:a,unit:l,unitSize:u,thicksColor:c}=this.#u,h=Math.ceil(this.#pt/u),d=this.#rt/l,m=Math.round(d-h),p=m*u,g=(m+2*h)*u,b=e?n*u/l:p,f=e?i*u/l:g,v=""===t(1)?10:5;a>1&&this.#ut.setAttribute("d",je(p,g,u/a,b,f,v*r)),this.#ct.style.stroke=c,this.#ct.setAttribute("d",je(p,g,u,b,f,v)),this.#ht.innerHTML=function(t,e,n,i,o,r,a,l){const u=[];tt),n)),e=Math.min(e,a);const c=Math.max(0,-Math.log10(i));for(let r=t;r<=e;r+=n)u.push(`${h=r/n*i,l(h.toFixed(c))}`);var h;return u.join("\n")}(p,g,u,l,this.#bt,b,f,t),this.#lt.setAttribute("transform",`translate(${-this.#rt*u/l} 0)`),this.#at.classList.toggle("muigui-slider-up","up"===o)}updateDisplay(t){this.#rt=t,this.#ft()}setOptions(t){return l(this.#u,t),this}}class Le extends v{#at;#it;#H;#rt=[];constructor(t){super(e("div",{innerHTML:'\n\n \n \n \n \n \n\n',className:"muigui-no-scroll"}));const n=e=>{const{width:n,height:i}=this.#at.getBoundingClientRect(),o=2*e.nx-1,r=2*e.ny-1;t.setValue([o*n*.5,r*i*.5])};le(this.domElement,{onDown:n,onMove:n}),this.#at=this.$("svg"),this.#it=this.$("#muigui-arrow"),this.#H=this.$("#muigui-circle"),Ae(this.#at,.5,.5,(()=>this.#vt))}#vt(){const[t,e]=this.#rt;this.#it.setAttribute("d",`M0,0L${t},${e}`),this.#H.setAttribute("transform",`translate(${t}, ${e})`)}updateDisplay(t){this.#rt[0]=t[0],this.#rt[1]=t[1],this.#vt()}}return ye.ColorChooser=de,ye.Direction=class extends he{#u;constructor(t,e,n){super(t,e,"muigui-direction"),this.#u=n,this.addTop(new F(this,A)),this.addBottom(new Ve(this,n)),this.updateDisplay()}},ye.RadioGrid=class extends D{constructor(t,e,n){super(t,e,"muigui-radio-grid");const i="number"==typeof this.getValue(),{keyValues:o,cols:r=3}=n,s=H(o,i);this.add(new De(this,s,r)),this.updateDisplay()}},ye.Range=W,ye.Select=T,ye.Slider=class extends D{constructor(t,e,n={}){super(t,e,"muigui-slider"),this.add(new Ue(this,n)),this.add(new F(this,n)),this.updateDisplay()}},ye.TextNumber=P,ye.Vec2=class extends he{constructor(t,e){super(t,e,"muigui-vec2");const n=t=>({setValue:e=>{const n=this.getValue();n[t]=e,this.setValue(n)},setFinalValue:e=>{const n=this.getValue();n[t]=e,this.setFinalValue(n)}});this.addTop(new F(n(0),{converters:{to:t=>t[0],from:j.from}})),this.addTop(new F(n(1),{converters:{to:t=>t[1],from:j.from}})),this.addBottom(new Le(this)),this.updateDisplay()}},ye})); +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).GUI=e()}(this,(function(){"use strict";var t={default:'\n.muigui {\n --bg-color: #ddd;\n --color: #222;\n --contrast-color: #eee;\n --value-color: #145 ;\n --value-bg-color: #eeee;\n --disabled-color: #999;\n --menu-bg-color: #f8f8f8;\n --menu-sep-color: #bbb;\n --hover-bg-color: #999;\n --focus-color: #8BF;\n --range-color: #AAA;\n --invalid-color: #FF0000;\n --selected-color: rgb(255, 255, 255, 0.9);\n\n --button-bg-color: var(--value-bg-color);\n\n --image-open: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjNDQ0OyIgeD0iMjAlIiB5PSI0NSUiIHdpZHRoPSI2MCUiIGhlaWdodD0iMTAlIj48L3JlY3Q+Cjwvc3ZnPg==);\n --image-closed: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjNDQ0OyIgeD0iNDUlIiB5PSIyMCUiIHdpZHRoPSIxMCUiIGhlaWdodD0iNjAlIj48L3JlY3Q+CiAgPHJlY3Qgc3R5bGU9ImZpbGw6ICM0NDQ7IiB4PSIyMCUiIHk9IjQ1JSIgd2lkdGg9IjYwJSIgaGVpZ2h0PSIxMCUiPjwvcmVjdD4KPC9zdmc+);\n --image-checkerboard: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjNDA0MDQwOyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSI+PC9yZWN0PgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjODA4MDgwOyIgeD0iMCIgeT0iMCIgd2lkdGg9IjUwJSIgaGVpZ2h0PSI1MCUiPjwvcmVjdD4KICA8cmVjdCBzdHlsZT0iZmlsbDogIzgwODA4MDsiIHg9IjUwJSIgeT0iNTAlIiB3aWR0aD0iNTAlIiBoZWlnaHQ9IjUwJSI+PC9yZWN0Pgo8L3N2Zz4=);\n\n --range-left-color: var(--value-color);\n --range-right-color: var(--value-bg-color); \n --range-right-hover-color: var(--hover-bg-color);\n --button-image: \n linear-gradient(\n rgba(255, 255, 255, 1), rgba(0, 0, 0, 0.2)\n );\n\n color: var(--color);\n background-color: var(--bg-color);\n}\n\n@media (prefers-color-scheme: dark) {\n .muigui {\n --bg-color: #222222;\n --color: #dddddd;\n --contrast-color: #000;\n --value-color: #43e5f7;\n --value-bg-color: #444444;\n --disabled-color: #666666;\n --menu-bg-color: #080808;\n --menu-sep-color: #444444;\n --hover-bg-color: #666666;\n --focus-color: #458; /*#88AAFF*/;\n --range-color: #888888;\n --invalid-color: #FF6666;\n --selected-color: rgba(255, 255, 255, 0.3);\n\n --button-bg-color: var(--value-bg-color);\n\n --range-left-color: var(--value-color);\n --range-right-color: var(--value-bg-color); \n --range-right-hover-color: var(--hover-bg-color);\n --button-image: linear-gradient(\n rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.4)\n );\n\n color: var(--color);\n background-color: var(--bg-color);\n\n --image-closed: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjREREOyIgeD0iMjAlIiB5PSI0NSUiIHdpZHRoPSI2MCUiIGhlaWdodD0iMTAlIj48L3JlY3Q+Cjwvc3ZnPg==);\n --image-open: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjREREOyIgeD0iNDUlIiB5PSIyMCUiIHdpZHRoPSIxMCUiIGhlaWdodD0iNjAlIj48L3JlY3Q+CiAgPHJlY3Qgc3R5bGU9ImZpbGw6ICNEREQ7IiB4PSIyMCUiIHk9IjQ1JSIgd2lkdGg9IjYwJSIgaGVpZ2h0PSIxMCUiPjwvcmVjdD4KPC9zdmc+);\n }\n}\n\n.muigui {\n --width: 250px;\n --label-width: 45%;\n --number-width: 40%;\n\n --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;\n --font-size: 11px;\n --font-family-mono: Menlo, Monaco, Consolas, "Droid Sans Mono", monospace;\n --font-size-mono: 11px;\n\n --line-height: 1.7em;\n --border-radius: 0px;\n\n width: var(--width);\n font-family: var(--font-family);\n font-size: var(--font-size);\n box-sizing: border-box;\n line-height: 100%;\n white-space: nowrap;\n}\n.muigui * {\n box-sizing: inherit;\n}\n\n.muigui-no-scroll {\n touch-action: none;\n}\n.muigui-no-h-scroll {\n touch-action: pan-y;\n}\n.muigui-no-v-scroll {\n touch-action: pan-x;\n}\n\n.muigui-invalid-value {\n background-color: red !important;\n color: white !important;\n}\n\n.muigui-grid {\n display: grid;\n}\n.muigui-rows {\n display: flex;\n flex-direction: column;\n\n min-height: 20px;\n border: 2px solid red;\n}\n.muigui-columns {\n display: flex;\n flex-direction: row;\n\n height: 20px;\n border: 2px solid green;\n}\n.muigui-rows>*,\n.muigui-columns>* {\n flex: 1 1 auto;\n align-items: stretch;\n min-height: 0;\n min-width: 0;\n}\n\n.muigui-row {\n border: 2px solid yellow;\n min-height: 10px\n}\n.muigui-column {\n border: 2px solid lightgreen;\n}\n\n/* -------- */\n\n.muigui-show { /* */ }\n.muigui-hide { \n display: none !important;\n}\n.muigui-disabled {\n pointer-events: none;\n --color: var(--disabled-color) !important;\n --value-color: var(--disabled-color) !important;\n --range-left-color: var(--disabled-color) !important;\n}\n\n.muigui canvas,\n.muigui svg {\n display: block;\n border-radius: var(--border-radius);\n}\n.muigui canvas {\n background-color: var(--value-bg-color);\n}\n\n.muigui-controller {\n min-width: 0;\n min-height: var(--line-height);\n}\n.muigui-root {\n z-index: 1;\n}\n.muigui-root,\n.muigui-menu {\n display: flex;\n flex-direction: column;\n position: relative;\n user-select: none;\n height: fit-content;\n margin: 0;\n padding-bottom: 0.1em;\n border-radius: var(--border-radius);\n}\n.muigui-menu {\n border-bottom: 1px solid var(--menu-sep-color);\n}\n\n.muigui-root>button:nth-child(1),\n.muigui-menu>button:nth-child(1) {\n border-top: 1px solid var(--menu-sep-color);\n border-bottom: 1px solid var(--menu-sep-color);\n position: relative;\n text-align: left;\n color: var(--color);\n background-color: var(--menu-bg-color);\n min-height: var(--line-height);\n padding: 0.2em;\n cursor: pointer;\n border-radius: var(--border-radius);\n}\n.muigui-root>div:nth-child(2),\n.muigui-menu>div:nth-child(2) {\n flex: 1 1 auto;\n}\n\n.muigui-controller {\n margin-left: 0.2em;\n margin-right: 0.2em;\n}\n.muigui-root.muigui-controller,\n.muigui-menu.muigui-controller {\n margin-left: 0;\n margin-right: 0;\n}\n.muigui-controller>*:nth-child(1) {\n flex: 1 0 var(--label-width);\n min-width: 0;\n /* white-space: pre; why?? */\n}\n.muigui-controller>label:nth-child(1) {\n place-content: center start;\n display: inline-grid;\n overflow: hidden;\n}\n.muigui-controller>*:nth-child(2) {\n flex: 1 1 75%;\n min-width: 0;\n}\n\n/* -----------------------------------------\n a label controller is [[label][value]]\n*/\n\n.muigui-label-controller {\n display: flex;\n margin: 0.4em 0 0.4em 0;\n word-wrap: initial;\n align-items: stretch;\n}\n\n.muigui-value {\n display: flex;\n align-items: stretch;\n}\n.muigui-value>* {\n flex: 1 1 auto;\n min-width: 0;\n}\n.muigui-value>*:nth-child(1) {\n flex: 1 1 calc(100% - var(--number-width));\n}\n.muigui-value>*:nth-child(2) {\n flex: 1 1 var(--number-width);\n margin-left: 0.2em;\n}\n\n/* fix! */\n.muigui-open>button>label::before,\n.muigui-closed>button>label::before {\n content: "X";\n color: rgba(0, 0, 0, 0);\n background-color: var(--range-color);\n border-radius: 0.2em;\n width: 1.25em;\n margin-right: 0.25em;\n height: 1.25em; /*var(--line-height);*/\n display: inline-grid;\n place-content: center start;\n pointer-events: none;\n}\n.muigui-open>button>label::before {\n background-image: var(--image-open);\n}\n.muigui-closed>button>label::before {\n background-image: var(--image-closed);\n}\n\n.muigui-open>.muigui-open-container {\n transition: all 0.1s ease-out;\n overflow: auto;\n height: 100%;\n}\n.muigui-closed>.muigui-open-container {\n transition: all 0.1s ease-out;\n overflow: hidden;\n min-height: 0;\n}\n.muigui-open>.muigui-open-container>* {\n transition: all 0.1s ease-out;\n margin-top: 0px;\n}\n.muigui-closed>.muigui-open-container>* {\n transition: all 0.1s ease-out;\n margin-top: -1000%;\n}\n\n/* ---- popdown ---- */\n\n.muigui-pop-down-top {\n display: flex;\n}\n/* fix? */\n.muigui-value>*:nth-child(1).muigui-pop-down-top {\n flex: 0;\n}\n.muigui-closed .muigui-pop-down-bottom {\n max-height: 0;\n}\n\n.muigui-value .muigui-pop-down-bottom {\n margin: 0;\n}\n\n.muigui-pop-down-values {\n min-width: 0;\n display: flex;\n}\n.muigui-pop-down-values>* {\n flex: 1 1 auto;\n min-width: 0;\n}\n\n.muigui-value.muigui-pop-down-controller {\n flex-direction: column;\n}\n\n.muigui-pop-down-top input[type=checkbox] {\n -webkit-appearance: none;\n appearance: none;\n width: auto;\n color: var(--value-color);\n background-color: var(--value-bg-color);\n background-image: var(--image-checkerboard);\n background-size: 10px 10px;\n background-position: 0 0, 0 5px, 5px -5px, -5px 0px;\n\n cursor: pointer;\n\n display: grid;\n place-content: center;\n margin: 0;\n font: inherit;\n color: currentColor;\n width: 1.7em;\n height: 1.7em;\n transform: translateY(-0.075em);\n}\n\n.muigui-pop-down-top input[type=checkbox]::before {\n content: "+";\n display: grid;\n place-content: center;\n border-radius: calc(var(--border-radius) + 2px);\n border-left: 1px solid rgba(255,255,255,0.3);\n border-top: 1px solid rgba(255,255,255,0.3);\n border-bottom: 1px solid rgba(0,0,0,0.2);\n border-right: 1px solid rgba(0,0,0,0.2);\n background-color: var(--range-color);\n color: var(--value-bg-color);\n width: calc(var(--line-height) - 4px);\n height: calc(var(--line-height) - 4px);\n}\n\n.muigui-pop-down-top input[type=checkbox]:checked::before {\n content: "X";\n}\n\n\n/* ---- select ---- */\n\n.muigui select,\n.muigui option,\n.muigui input,\n.muigui button {\n color: var(--value-color);\n background-color: var(--value-bg-color);\n font-family: var(--font-family);\n font-size: var(--font-size);\n border: none;\n margin: 0;\n border-radius: var(--border-radius);\n}\n.muigui select {\n appearance: none;\n margin: 0;\n margin-left: 0; /*?*/\n overflow: hidden; /* Safari */\n}\n\n.muigui select:focus,\n.muigui input:focus,\n.muigui button:focus {\n outline: 1px solid var(--focus-color);\n}\n\n.muigui select:hover,\n.muigui option:hover,\n.muigui input:hover,\n.muigui button:hover {\n background-color: var(--hover-bg-color); \n}\n\n/* ------ [ label ] ------ */\n\n.muigui-label {\n border-top: 1px solid var(--menu-sep-color);\n border-bottom: 1px solid var(--menu-sep-color);\n padding-top: 0.4em;\n padding-bottom: 0.3em;\n place-content: center start;\n background-color: var(--menu-bg-color);\n white-space: pre;\n border-radius: var(--border-radius);\n}\n\n/* ------ [ divider] ------ */\n\n.muigui-divider {\n min-height: 6px;\n border-top: 2px solid var(--menu-sep-color);\n margin-top: 6px;\n}\n\n/* ------ [ button ] ------ */\n\n.muigui-button {\n display: grid;\n padding: 2px 0 2px 0;\n}\n.muigui-button button {\n border: none;\n color: var(--value-color);\n background-color: var(--button-bg-color);\n background-image: var(--button-image);\n cursor: pointer;\n place-content: center center;\n height: var(--line-height);\n}\n\n/* ------ [ color ] ------ */\n\n.muigui-color>div {\n overflow: hidden;\n position: relative;\n margin-left: 0;\n margin-right: 0; /* why? */\n max-width: var(--line-height);\n border-radius: var(--border-radius);\n}\n\n.muigui-color>div:focus-within {\n outline: 1px solid var(--focus-color);\n}\n\n.muigui-color input[type=color] {\n border: none;\n padding: 0;\n background: inherit;\n cursor: pointer;\n position: absolute;\n width: 200%;\n left: -10px;\n top: -10px;\n height: 200%;\n}\n.muigui-disabled canvas,\n.muigui-disabled svg,\n.muigui-disabled img,\n.muigui-disabled .muigui-color input[type=color] {\n opacity: 0.2;\n}\n\n/* ------ [ checkbox ] ------ */\n\n.muigui-checkbox>label:nth-child(2) {\n display: grid;\n place-content: center start;\n margin: 0;\n}\n\n.muigui-checkbox input[type=checkbox] {\n -webkit-appearance: none;\n appearance: none;\n width: auto;\n color: var(--value-color);\n background-color: var(--value-bg-color);\n cursor: pointer;\n\n display: grid;\n place-content: center;\n margin: 0;\n font: inherit;\n color: currentColor;\n width: 1.7em;\n height: 1.7em;\n transform: translateY(-0.075em);\n}\n\n.muigui-checkbox input[type=checkbox]::before {\n content: "";\n color: var(--value-color);\n display: grid;\n place-content: center;\n}\n\n.muigui-checkbox input[type=checkbox]:checked::before {\n content: "✔";\n}\n\n.muigui input[type=number]::-webkit-inner-spin-button, \n.muigui input[type=number]::-webkit-outer-spin-button { \n -webkit-appearance: none;\n appearance: none;\n margin: 0; \n}\n.muigui input[type=number] {\n -moz-appearance: textfield;\n}\n\n/* ------ [ radio grid ] ------ */\n\n.muigui-radio-grid>div {\n display: grid;\n gap: 2px;\n}\n\n.muigui-radio-grid input {\n appearance: none;\n display: none;\n}\n\n.muigui-radio-grid button {\n color: var(--color);\n width: 100%;\n text-align: left;\n}\n\n.muigui-radio-grid input:checked + button {\n color: var(--value-color);\n background-color: var(--selected-color);\n}\n\n/* ------ [ color-chooser ] ------ */\n\n.muigui-color-chooser-cursor {\n stroke-width: 1px;\n stroke: white;\n fill: none;\n}\n.muigui-color-chooser-circle {\n stroke-width: 1px;\n stroke: white;\n fill: none;\n}\n\n\n/* ------ [ vec2 ] ------ */\n\n.muigui-vec2 svg {\n background-color: var(--value-bg-color);\n}\n\n.muigui-vec2-axis {\n stroke: 1px;\n stroke: var(--focus-color);\n}\n\n.muigui-vec2-line {\n stroke-width: 1px;\n stroke: var(--value-color);\n fill: var(--value-color);\n}\n\n/* ------ [ direction ] ------ */\n\n.muigui-direction svg {\n background-color: rgba(0,0,0,0.2);\n}\n\n.muigui-direction:focus-within svg {\n outline: none;\n}\n.muigui-direction-range {\n fill: var(--value-bg-color);\n}\n.muigui-direction svg:focus {\n outline: none;\n}\n.muigui-direction svg:focus .muigui-direction-range {\n stroke-width: 0.5px;\n stroke: var(--focus-color);\n}\n\n.muigui-direction-arrow {\n fill: var(--value-color);\n}\n\n/* ------ [ slider ] ------ */\n\n.muigui-slider>div {\n display: flex;\n align-items: stretch;\n height: var(--line-height);\n}\n.muigui-slider svg {\n flex: 1 1 auto;\n}\n.muigui-slider .muigui-slider-up #muigui-orientation {\n transform: scale(1, -1) translateY(-100%);\n}\n\n.muigui-slider .muigui-slider-up #muigui-number-orientation {\n transform: scale(1,-1);\n}\n\n.muigui-ticks {\n stroke: var(--range-color);\n}\n.muigui-thicks {\n stroke: var(--color);\n stroke-width: 2px;\n}\n.muigui-svg-text {\n fill: var(--color);\n font-size: 7px;\n}\n.muigui-mark {\n fill: var(--value-color);\n}\n\n/* ------ [ range ] ------ */\n\n\n.muigui-range input[type=range] {\n -webkit-appearance: none;\n appearance: none;\n background-color: transparent;\n}\n\n.muigui-range input[type=range]::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n border-radius: calc(var(--border-radius) + 2px);\n border-left: 1px solid rgba(255,255,255,0.3);\n border-top: 1px solid rgba(255,255,255,0.3);\n border-bottom: 1px solid rgba(0,0,0,0.2);\n border-right: 1px solid rgba(0,0,0,0.2);\n background-color: var(--range-color);\n margin-top: calc((var(--line-height) - 6px) / -2);\n width: calc(var(--line-height) - 6px);\n height: calc(var(--line-height) - 6px);\n}\n\n.muigui-range input[type=range]::-webkit-slider-runnable-track {\n -webkit-appearance: none;\n appearance: none;\n border: 1px solid var(--menu-sep-color);\n height: 2px;\n}\n\n\n/* dat.gui style - doesn\'t work on Safari iOS */\n\n/*\n.muigui-range input[type=range] {\n cursor: ew-resize;\n overflow: hidden;\n}\n\n.muigui-range input[type=range] {\n -webkit-appearance: none;\n appearance: none;\n background-color: var(--range-right-color);\n margin: 0;\n}\n.muigui-range input[type=range]:hover {\n background-color: var(--range-right-hover-color);\n}\n\n.muigui-range input[type=range]::-webkit-slider-runnable-track {\n -webkit-appearance: none;\n appearance: none;\n height: max-content;\n color: var(--range-left-color);\n margin-top: -1px;\n}\n\n.muigui-range input[type=range]::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 0px;\n height: max-content;\n box-shadow: -1000px 0 0 1000px var(--range-left-color);\n}\n*/\n\n/* FF */\n/*\n.muigui-range input[type=range]::-moz-slider-progress {\n background-color: var(--range-left-color); \n}\n.muigui-range input[type=range]::-moz-slider-thumb {\n height: max-content;\n width: 0;\n border: none;\n box-shadow: -1000px 0 0 1000px var(--range-left-color);\n box-sizing: border-box;\n}\n*/\n\n.muigui-checkered-background {\n background-color: #404040;\n background-image:\n linear-gradient(45deg, #808080 25%, transparent 25%),\n linear-gradient(-45deg, #808080 25%, transparent 25%),\n linear-gradient(45deg, transparent 75%, #808080 75%),\n linear-gradient(-45deg, transparent 75%, #808080 75%);\n background-size: 16px 16px;\n background-position: 0 0, 0 8px, 8px -8px, -8px 0px;\n}\n\n/* ---------------------------------------------------------- */\n\n/* needs to be at bottom to take precedence */\n.muigui-auto-place {\n max-height: 100%;\n position: fixed;\n top: 0;\n right: 15px;\n z-index: 100001;\n}\n\n',themes:{default:{include:["default"],css:"\n "},float:{include:["default"],css:"\n :root {\n color-scheme: light dark,\n }\n\n .muigui {\n --width: 400px;\n --bg-color: initial;\n --label-width: 25%;\n --number-width: 20%;\n }\n\n input,\n .muigui-label-controller>label {\n text-shadow:\n -1px -1px 0 var(--contrast-color),\n 1px -1px 0 var(--contrast-color),\n -1px 1px 0 var(--contrast-color),\n 1px 1px 0 var(--contrast-color);\n }\n\n .muigui-controller > label:nth-child(1) {\n place-content: center end;\n margin-right: 1em;\n }\n\n .muigui-value > :nth-child(2) {\n margin-left: 1em;\n }\n\n .muigui-root>*:nth-child(1) {\n display: none;\n }\n\n .muigui-range input[type=range]::-webkit-slider-thumb {\n border-radius: 1em;\n }\n\n .muigui-range input[type=range]::-webkit-slider-runnable-track {\n -webkit-appearance: initial;\n appearance: none;\n border: 1px solid rgba(0, 0, 0, 0.25);\n height: 2px;\n }\n\n .muigui-colors {\n --value-color: var(--color );\n --value-bg-color: rgba(0, 0, 0, 0.1);\n --disabled-color: #cccccc;\n --menu-bg-color: rgba(0, 0, 0, 0.1);\n --menu-sep-color: #bbbbbb;\n --hover-bg-color: rgba(0, 0, 0, 0);\n --invalid-color: #FF0000;\n --selected-color: rgba(0, 0, 0, 0.3);\n --range-color: rgba(0, 0, 0, 0.125);\n }\n"},form:{include:[],css:"\n .muigui {\n --width: 100%;\n --label-width: 45%;\n --number-width: 40%;\n }\n .muigui-root>button {\n display: none;\n }\n .muigui-controller {\n margin-top: 1em;\n }\n .muigui-label-controller {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n margin-top: 1em;\n }\n .muigui-label-controller:has(.muigui-checkbox) {\n flex-direction: row;\n }\n .muigui-value {\n display: flex;\n align-items: stretch;\n }\n .muigui-value>* {\n flex: 1 1 auto;\n min-width: 0;\n }\n .muigui-controller>*:nth-child(1) {\n flex: 1 0 var(--label-width);\n min-width: 0;\n white-space: pre;\n }\n .muigui-controller>label:nth-child(1) {\n place-content: center start;\n display: inline-grid;\n overflow: hidden;\n }\n .muigui-controller>*:nth-child(2) {\n flex: 1 1 75%;\n min-width: 0;\n }\n "},none:{include:[],css:""}}};function e(t,e={},n=[]){const i=document.createElement(t);return function(t,e,n){for(const[n,i]of Object.entries(e))if("function"==typeof i&&n.startsWith("on")){const e=n.substring(2).toLowerCase();t.addEventListener(e,i,{passive:!1})}else if("object"==typeof i)for(const[e,o]of Object.entries(i))t[n][e]=o;else void 0===t[n]?t.setAttribute(n,i):t[n]=i;for(const e of n)t.appendChild(e)}(i,e,n),i}let n=0;function i(t,e){const n=t.indexOf(e);return n&&t.splice(n,1),t}function o(t,e,n){return Math.max(e,Math.min(n,t))}const r="undefined"!=typeof SharedArrayBuffer?function(t){return t&&t.buffer&&(t.buffer instanceof ArrayBuffer||t.buffer instanceof SharedArrayBuffer)}:function(t){return t&&t.buffer&&t.buffer instanceof ArrayBuffer},s=(t,e,n)=>Math.round(e(t)/n)/(1/n),a=(t,e)=>(t%e+e)%e;function l(t,e){for(const n in e)n in t&&(t[n]=e[n]);return t}const u=(t,e,n,i,o)=>(t-e)*(o-i)/(n-e)+i,c=({from:t,to:e})=>({to:n=>u(n,...t,...e),from:n=>[!0,u(n,...e,...t)]}),h=({from:t,to:e,step:n})=>({min:e[0],max:e[1],...n&&{step:n},converters:c({from:t,to:e})}),d={to:t=>t,from:t=>[!0,t]};function m(t,e,n,i,o){const{converters:{from:r}=d}=o,{min:s,max:a}=o,l=o.minRange||0,u=r(l)[1],c=t.add(e,n,{...o,min:s,max:a-l}).onChange((t=>{h.setValue(Math.min(a,Math.max(t+u,e[i])))})),h=t.add(e,i,{...o,min:s+l,max:a}).onChange((t=>{c.setValue(Math.max(s,Math.min(t-u,e[n])))}));return[c,h]}class p{domElement;#t;#e=[];constructor(t){this.domElement=t,this.#t=t}addElem(t){return this.#t.appendChild(t),t}removeElem(t){return this.#t.removeChild(t),t}pushSubElem(t){this.#t.appendChild(t),this.#t=t}popSubElem(){this.#t=this.#t.parentElement}add(t){return this.#e.push(t),this.addElem(t.domElement),t}remove(t){return this.removeElem(t.domElement),i(this.#e,t),t}pushSubView(t){this.pushSubElem(t.domElement)}popSubView(){this.popSubElem()}setOptions(t){for(const e of this.#e)e.setOptions(t)}updateDisplayIfNeeded(t,e){for(const n of this.#e)n.updateDisplayIfNeeded(t,e);return this}$(t){return this.domElement.querySelector(t)}}class g extends p{#n;#i;#o;constructor(t){super(e("div",{className:"muigui-controller"})),this.#n=[],this.#i=[],t&&this.domElement.classList.add(t)}get parent(){return this.#o}setParent(t){this.#o=t,this.enable(!this.disabled())}show(t=!0){return this.domElement.classList.toggle("muigui-hide",!t),this.domElement.classList.toggle("muigui-show",t),this}hide(){return this.show(!1)}disabled(){return!!this.domElement.closest(".muigui-disabled")}enable(t=!0){return this.domElement.classList.toggle("muigui-disabled",!t),["input","button","select","textarea"].forEach((t=>{this.domElement.querySelectorAll(t).forEach((t=>{const e=!!t.closest(".muigui-disabled");t.disabled=e}))})),this}disable(t=!0){return this.enable(!t)}onChange(t){return this.removeChange(t),this.#n.push(t),this}removeChange(t){return i(this.#n,t),this}onFinishChange(t){return this.removeFinishChange(t),this.#i.push(t),this}removeFinishChange(t){return i(this.#i,t),this}#r(t,e){for(const n of t)n.call(this,e)}emitChange(t,e,n){this.#r(this.#n,t),this.#o&&(void 0===e?this.#o.emitChange(t):this.#o.emitChange({object:e,property:n,value:t,controller:this}))}emitFinalChange(t,e,n){this.#r(this.#i,t),this.#o&&(void 0===e?this.#o.emitChange(t):this.#o.emitFinalChange({object:e,property:n,value:t,controller:this}))}updateDisplay(){}getColors(){const t=t=>t.replace(/-([a-z])/g,((t,e)=>e.toUpperCase())),n=e("div");this.domElement.appendChild(n);const i=Object.fromEntries(["color","bg-color","value-color","value-bg-color","hover-bg-color","menu-bg-color","menu-sep-color","disabled-color"].map((e=>{n.style.color=`var(--${e})`;const i=getComputedStyle(n);return[t(e),i.color]})));return n.remove(),i}}class f extends g{#s;#a;#l;#u={name:""};constructor(t,n,i={}){super("muigui-button",""),this.#s=t,this.#a=n,this.#l=this.addElem(e("button",{type:"button",onClick:()=>{this.#s[this.#a](this)}})),this.setOptions({name:n,...i})}name(t){return this.#l.textContent=t,this}setOptions(t){l(this.#u,t);const{name:e}=this.#u;return this.#l.textContent=e,this}}function b(t,e){if(t.length!==e.length)return!1;for(let n=0;n{t.setValue(i.checked)},onChange:()=>{t.setFinalValue(i.checked)}});super(e("label",{},[i])),this.#b=i}updateDisplay(t){this.#b.checked=t}}const w=[],y=new Set;let k,E;function I(){k=void 0,E=!0;for(const t of w)y.has(t)||t();E=!1,y.size&&(E?$():(y.forEach((t=>{i(w,t)})),y.clear())),$()}function $(){!k&&w.length&&(k=requestAnimationFrame(I))}let C=0;function M(){return"muigui-"+ ++C}class S extends p{constructor(t=""){super(e("div",{className:"muigui-value"})),t&&this.domElement.classList.add(t)}}class V extends g{#v;#x;constructor(t="",n=""){super("muigui-label-controller"),this.#v=M(),this.#x=e("label",{for:this.#v}),this.domElement.appendChild(this.#x),this.pushSubView(new S(t)),this.name(n)}get id(){return this.#v}name(t){return this.#x.title===this.#x.textContent&&(this.#x.title=t),this.#x.textContent=t,this}tooltip(t){this.#x.title=t}}class D extends V{#s;#a;#w;#y;#e;#k;constructor(t,e,n=""){super(n,e),this.#s=t,this.#a=e,this.#w=this.getValue(),this.#y=!1,this.#e=[]}get initialValue(){return this.#w}get object(){return this.#s}get property(){return this.#a}add(t){return this.#e.push(t),super.add(t),this.updateDisplay(),t}#E(t,e){let n=!1;if("object"==typeof t){const e=this.#s[this.#a];if(Array.isArray(t)||r(t))for(let i=0;i=0&&w.splice(e,1)}(this.#k)),this}}class N extends D{constructor(t,e){super(t,e,"muigui-checkbox");const n=this.id;this.add(new x(this,n)),this.updateDisplay()}}const A={to:t=>t,from:t=>[!0,t]},j={to:t=>t.toString(),from:t=>{const e=parseFloat(t);return[!Number.isNaN(e),e]}},U={radToDeg:c({to:[0,180],from:[0,Math.PI]})};function L(){let t=0;return function(e,n,i=5){t-=e.deltaY*n/i;const o=Math.floor(Math.abs(t)/n)*Math.sign(t)*n;return t-=o,o}}class F extends v{#I;#$;#C;#M;#u={step:.01,converters:j,min:Number.NEGATIVE_INFINITY,max:Number.POSITIVE_INFINITY};constructor(t,n){const i=t.setValue.bind(t),r=t.setFinalValue.bind(t),a=L();super(e("input",{type:"number",onInput:()=>{this.#S(i,!0)},onChange:()=>{this.#S(r,!1)},onWheel:e=>{e.preventDefault();const{min:n,max:i,step:r}=this.#u,l=a(e,r),u=parseFloat(this.domElement.value),c=o(s(u+l,(t=>t),r),n,i),[h,d]=this.#$(c);h&&t.setValue(d)}})),this.setOptions(n)}#S(t,e){const n=parseFloat(this.domElement.value),[i,r]=this.#$(n);let s;if(i&&!Number.isNaN(n)){const{min:n,max:i}=this.#u;s=r>=n&&r<=i,this.#M=e,t(o(r,n,i))}this.domElement.classList.toggle("muigui-invalid-value",!i||!s)}updateDisplay(t){this.#M||(this.domElement.value=s(t,this.#I,this.#C)),this.#M=!1}setOptions(t){l(this.#u,t);const{step:e,converters:{to:n,from:i}}=this.#u;return this.#I=n,this.#$=i,this.#C=e,this}}class P extends D{#V;#C;constructor(t,e,n={}){super(t,e,"muigui-text-number"),this.#V=this.add(new F(this,n)),this.updateDisplay()}}class O extends v{#D;constructor(t,n){const i=[];super(e("select",{onChange:()=>{t.setFinalValue(this.#D[this.domElement.selectedIndex])}},n.map((([t,n])=>(i.push(n),e("option",{textContent:t})))))),this.#D=i}updateDisplay(t){const e=this.#D.indexOf(t);this.domElement.selectedIndex=e}}function H(t,e){return Array.isArray(t)?Array.isArray(t[0])?t:e?t.map(((t,e)=>[t,e])):t.map((t=>[t,t])):[...Object.entries(t)]}class z extends D{constructor(t,e,n){super(t,e,"muigui-select");const i="number"==typeof this.getValue(),{keyValues:o}=n,r=H(o,i);this.add(new O(this,r)),this.updateDisplay()}}class T extends v{#I;#$;#C;#M;#u={step:.01,min:0,max:1,converters:A};constructor(t,n){const i=L();super(e("input",{type:"range",onInput:()=>{this.#M=!0;const{min:e,max:n,step:i}=this.#u,r=parseFloat(this.domElement.value),a=o(s(r,(t=>t),i),e,n),[l,u]=this.#$(a);l&&t.setValue(u)},onChange:()=>{this.#M=!0;const{min:e,max:n,step:i}=this.#u,r=parseFloat(this.domElement.value),a=o(s(r,(t=>t),i),e,n),[l,u]=this.#$(a);l&&t.setFinalValue(u)},onWheel:e=>{e.preventDefault();const[n,r]=this.#$(parseFloat(this.domElement.value));if(!n)return;const{min:a,max:l,step:u}=this.#u,c=i(e,u),h=o(s(r+c,(t=>t),u),a,l);t.setValue(h)}})),this.setOptions(n)}updateDisplay(t){this.#M||(this.domElement.value=s(t,this.#I,this.#C)),this.#M=!1}setOptions(t){l(this.#u,t);const{step:e,min:n,max:i,converters:{to:o,from:r}}=this.#u;return this.#I=o,this.#$=r,this.#C=e,this.domElement.step=e,this.domElement.min=n,this.domElement.max=i,this}}class W extends D{constructor(t,e,n){super(t,e,"muigui-range"),this.add(new T(this,n)),this.add(new F(this,n))}}class B extends v{#I;#$;#M;#u={converters:A};constructor(t,n){const i=t.setValue.bind(t),o=t.setFinalValue.bind(t);super(e("input",{type:"text",onInput:()=>{this.#S(i,!0)},onChange:()=>{this.#S(o,!1)}})),this.setOptions(n)}#S(t,e){const[n,i]=this.#$(this.domElement.value);n&&(this.#M=e,t(i)),this.domElement.style.color=n?"":"var(--invalid-color)"}updateDisplay(t){this.#M||(this.domElement.value=this.#I(t),this.domElement.style.color=""),this.#M=!1}setOptions(t){l(this.#u,t);const{converters:{to:e,from:n}}=this.#u;return this.#I=e,this.#$=n,this}}class G extends D{constructor(t,e){super(t,e,"muigui-text"),this.add(new B(this)),this.updateDisplay()}}const Z=(t,e,n)=>Math.max(e,Math.min(n,t)),R=(t,e,n)=>t+(e-t)*n,J=t=>t>=0?t%1:1-t%1,Y=t=>+t.toFixed(0),Q=t=>+t.toFixed(3),_=t=>parseInt(t.substring(1,3),16)<<16|parseInt(t.substring(3,5),16)<<8|parseInt(t.substring(5,7),16),K=t=>parseInt(t.substring(1,3),16)*2**24+65536*parseInt(t.substring(3,5),16)+256*parseInt(t.substring(5,7),16)+parseInt(t.substring(7,9),16),q=t=>[parseInt(t.substring(1,3),16),parseInt(t.substring(3,5),16),parseInt(t.substring(5,7),16)],X=t=>`#${Array.from(t).map((t=>t.toString(16).padStart(2,"0"))).join("")}`,tt=t=>[parseInt(t.substring(1,3),16),parseInt(t.substring(3,5),16),parseInt(t.substring(5,7),16),parseInt(t.substring(7,9),16)],et=t=>`#${Array.from(t).map((t=>t.toString(16).padStart(2,"0"))).join("")}`,nt=t=>q(t).map((t=>Q(t/255))),it=t=>X(Array.from(t).map((t=>Math.round(Z(255*t,0,255))))),ot=t=>tt(t).map((t=>Q(t/255))),rt=t=>et(Array.from(t).map((t=>Math.round(Z(255*t,0,255))))),st=t=>Z(Math.round(255*t),0,255).toString(16).padStart(2,"0"),at=t=>({r:parseInt(t.substring(1,3),16)/255,g:parseInt(t.substring(3,5),16)/255,b:parseInt(t.substring(5,7),16)/255}),lt=t=>({r:parseInt(t.substring(1,3),16)/255,g:parseInt(t.substring(3,5),16)/255,b:parseInt(t.substring(5,7),16)/255,a:parseInt(t.substring(7,9),16)/255}),ut=t=>`rgb(${q(t).join(", ")})`,ct=/^\s*rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)\s*$/,ht=t=>`rgba(${tt(t).map(((t,e)=>3===e?t/255:t)).join(", ")})`,dt=/^\s*rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+\.\d+|\d+)\s*\)\s*$/,mt=t=>{const e=yt(q(t)).map((t=>Y(t)));return`hsl(${e[0]}, ${e[1]}%, ${e[2]}%)`},pt=t=>{const e=kt(tt(t)).map(((t,e)=>3===e?Q(t):Y(t)));return`hsl(${e[0]} ${e[1]}% ${e[2]}% / ${e[3]})`},gt=/^\s*hsl\(\s*(\d+)(?:deg|)\s*(?:,|)\s*(\d+)%\s*(?:,|)\s*(\d+)%\s*\)\s*$/,ft=/^\s*hsl\(\s*(\d+)(?:deg|)\s*(?:,|)\s*(\d+)%\s*(?:,|)\s*(\d+)%\s*\/\s*(\d+\.\d+|\d+)\s*\)\s*$/,bt=(t,e)=>(t%e+e)%e;function vt([t,e,n]){t=bt(t,360),e=Z(e/100,0,1),n=Z(n/100,0,1);const i=e*Math.min(n,1-n);function o(e){const o=(e+t/30)%12;return n-i*Math.max(-1,Math.min(o-3,9-o,1))}return[o(0),o(8),o(4)].map((t=>Math.round(255*t)))}function xt([t,e,n]){const i=Math.max(t,e,n),o=Math.min(t,e,n),r=.5*(o+i),s=i-o;let a=0,l=0;if(0!==s)switch(l=0===r||1===r?0:(i-r)/Math.min(r,1-r),i){case t:a=(e-n)/s+(e{const[e,n,i]=xt(t.map((t=>t/255)));return[360*e,100*n,100*i]},kt=t=>{const[e,n,i,o]=wt(t.map((t=>t/255)));return[360*e,100*n,100*i,o]};function Et([t,e,n]){return e=Z(e,0,1),n=Z(n,0,1),[t,t+2/3,t+1/3].map((t=>R(1,Z(Math.abs(6*J(t)-3)-1,0,1),e)*n))}function It([t,e,n,i]){return[...Et([t,e,n]),i]}const $t=t=>Math.round(1e3*t)/1e3;function Ct([t,e,n]){const i=n>e?[n,e,-1,2/3]:[e,n,0,-1/3],o=i[0]>t?[i[0],i[1],i[3],t]:[t,i[1],i[2],i[0]],r=o[0]-Math.min(o[3],o[1]);return[Math.abs(o[2]+(o[3]-o[1])/(6*r+Number.EPSILON)),r/(o[0]+Number.EPSILON),o[0]].map($t)}function Mt([t,e,n,i]){return[...Ct([t,e,n]),i]}const St=t=>t.endsWith("a")||t.startsWith("hex8"),Vt=[{re:/^#(?:[0-9a-f]){6}$/i,format:"hex6"},{re:/^(?:[0-9a-f]){6}$/i,format:"hex6-no-hash"},{re:/^#(?:[0-9a-f]){8}$/i,format:"hex8"},{re:/^(?:[0-9a-f]){8}$/i,format:"hex8-no-hash"},{re:/^#(?:[0-9a-f]){3}$/i,format:"hex3"},{re:/^(?:[0-9a-f]){3}$/i,format:"hex3-no-hash"},{re:ct,format:"css-rgb"},{re:gt,format:"css-hsl"},{re:dt,format:"css-rgba"},{re:ft,format:"css-hsla"}];function Dt(t){switch(typeof t){case"number":return console.warn('can not reliably guess format based on a number. You should pass in a format like {format: "uint32-rgb"} or {format: "uint32-rgb"}'),t<=16777215?"uint32-rgb":"uint32-rgba";case"string":{const e=function(t){for(const e of Vt)if(e.re.test(t))return e}(t.trim());if(e)return e.format;break}case"object":if(t instanceof Uint8Array||t instanceof Uint8ClampedArray){if(3===t.length)return"uint8-rgb";if(4===t.length)return"uint8-rgba"}else if(t instanceof Float32Array){if(3===t.length)return"float-rgb";if(4===t.length)return"float-rgba"}else if(Array.isArray(t)){if(3===t.length)return"float-rgb";if(4===t.length)return"float-rgba"}else if("r"in t&&"g"in t&&"b"in t)return"a"in t?"object-rgba":"object-rgb"}throw new Error(`unknown color format: ${t}`)}function Nt(t){return t.trim(t)}function At(t){return t.trim(t)}function jt(t){return t[1]===t[2]&&t[3]===t[4]&&t[5]===t[6]?`#${t[1]}${t[3]}${t[5]}`:t}const Ut=/^(#|)([0-9a-f]{3})$/i;function Lt(t){const e=Ut.exec(t);if(e){const[,,t]=e;return"#"+`${(n=t)[0]}${n[0]}${n[1]}${n[1]}${n[2]}${n[2]}`}var n;return t}function Ft(t){return jt(Nt(t))}const Pt=t=>{const e=ct.exec(t);if(!e)return[!1];const n=[e[1],e[2],e[3]].map((t=>parseInt(t)));return[!n.find((t=>t>255)),`rgb(${n.join(", ")})`]},Ot=t=>{const e=dt.exec(t);if(!e)return[!1];const n=[e[1],e[2],e[3],e[4]].map(((t,e)=>3===e?parseFloat(t):parseInt(t)));return[!n.find((t=>t>255)),`rgba(${n.join(", ")})`]},Ht=t=>{const e=gt.exec(t);if(!e)return[!1];const n=[e[1],e[2],e[3]].map((t=>parseFloat(t)));return[!n.find((t=>Number.isNaN(t))),`hsl(${n[0]}, ${n[1]}%, ${n[2]}%)`]},zt=t=>{const e=ft.exec(t);if(!e)return[!1];const n=[e[1],e[2],e[3],e[4]].map((t=>parseFloat(t)));return[!n.find((t=>Number.isNaN(t))),`hsl(${n[0]} ${n[1]}% ${n[2]}% / ${n[3]})`]},Tt=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*$/,Wt=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*$/,Bt=t=>{const e=t.split(",").map((t=>t.trim())),n=e.map((t=>parseFloat(t)));if(3!==n.length)return[!1];const i=e.findIndex((t=>isNaN(t)));return[i<0,n.map((t=>Q(t)))]},Gt=t=>{const e=t.split(",").map((t=>t.trim())),n=e.map((t=>parseFloat(t)));if(4!==n.length)return[!1];const i=e.findIndex((t=>isNaN(t)));return[i<0,n.map((t=>Q(t)))]},Zt=/^\s*(?:0x){0,1}([0-9a-z]{1,6})\s*$/i,Rt=/^\s*(?:0x){0,1}([0-9a-z]{1,8})\s*$/i,Jt=/^\s*#[a-f0-9]{6}\s*$|^\s*#[a-f0-9]{3}\s*$/i,Yt=/^\s*[a-f0-9]{6}\s*$/i,Qt=/^\s*#[a-f0-9]{8}\s*$/i,_t=/^\s*[a-f0-9]{8}\s*$/i,Kt={hex6:{color:{from:t=>[!0,t],to:Nt},text:{from:t=>[Jt.test(t),t.trim()],to:t=>t}},hex8:{color:{from:t=>[!0,t],to:At},text:{from:t=>[Qt.test(t),t.trim()],to:t=>t}},hex3:{color:{from:t=>[!0,Ft(t)],to:Lt},text:{from:t=>[Jt.test(t),jt(t.trim())],to:t=>t}},"hex6-no-hash":{color:{from:t=>[!0,t.substring(1)],to:t=>`#${Nt(t)}`},text:{from:t=>[Yt.test(t),t.trim()],to:t=>t}},"hex8-no-hash":{color:{from:t=>[!0,t.substring(1)],to:t=>`#${At(t)}`},text:{from:t=>[_t.test(t),t.trim()],to:t=>t}},"hex3-no-hash":{color:{from:t=>[!0,Ft(t).substring(1)],to:Lt},text:{from:t=>[Yt.test(t),jt(t.trim())],to:t=>t}},"uint32-rgb":{color:{from:t=>[!0,_(t)],to:t=>`#${Math.round(t).toString(16).padStart(6,"0")}`},text:{from:t=>(t=>{const e=Zt.exec(t);return e?[!0,parseInt(e[1],16)]:[!1]})(t),to:t=>`0x${t.toString(16).padStart(6,"0")}`}},"uint32-rgba":{color:{from:t=>[!0,K(t)],to:t=>`#${Math.round(t).toString(16).padStart(8,"0")}`},text:{from:t=>(t=>{const e=Rt.exec(t);return e?[!0,parseInt(e[1],16)]:[!1]})(t),to:t=>`0x${t.toString(16).padStart(8,"0")}`}},"uint8-rgb":{color:{from:t=>[!0,q(t)],to:X},text:{from:t=>{const e=Tt.exec(t);if(!e)return[!1];const n=[e[1],e[2],e[3]].map((t=>parseInt(t)));return[!n.find((t=>t>255)),n]},to:t=>t.join(", ")}},"uint8-rgba":{color:{from:t=>[!0,tt(t)],to:et},text:{from:t=>{const e=Wt.exec(t);if(!e)return[!1];const n=[e[1],e[2],e[3],e[4]].map((t=>parseInt(t)));return[!n.find((t=>t>255)),n]},to:t=>t.join(", ")}},"float-rgb":{color:{from:t=>[!0,nt(t)],to:it},text:{from:Bt,to:t=>Array.from(t).map((t=>Q(t))).join(", ")}},"float-rgba":{color:{from:t=>[!0,ot(t)],to:rt},text:{from:Gt,to:t=>Array.from(t).map((t=>Q(t))).join(", ")}},"float-hsv":{color:{from:t=>[!0,Ct(nt(t))],to:t=>Et(it(t))},text:{from:Bt,to:t=>Array.from(t).map((t=>Q(t))).join(", ")}},"float-hsva":{color:{from:t=>[!0,Mt(nt(t))],to:t=>It(it(t))},text:{from:Gt,to:t=>Array.from(t).map((t=>Q(t))).join(", ")}},"object-rgb":{color:{from:t=>[!0,at(t)],to:t=>`#${st(t.r)}${st(t.g)}${st(t.b)}`},text:{from:t=>{try{const e=t.replace(/([a-z])/g,'"$1"'),n=JSON.parse(e);if(Number.isNaN(n.r)||Number.isNaN(n.g)||Number.isNaN(n.b))throw new Error("not {r, g, b}");return[!0,n]}catch(t){return[!1]}},to:t=>`{r:${Q(t.r)}, g:${Q(t.g)}, b:${Q(t.b)}}`}},"object-rgba":{color:{from:t=>[!0,lt(t)],to:t=>`#${st(t.r)}${st(t.g)}${st(t.b)}${st(t.a)}`},text:{from:t=>{try{const e=t.replace(/([a-z])/g,'"$1"'),n=JSON.parse(e);if(Number.isNaN(n.r)||Number.isNaN(n.g)||Number.isNaN(n.b)||Number.isNaN(n.a))throw new Error("not {r, g, b, a}");return[!0,n]}catch(t){return[!1]}},to:t=>`{r:${Q(t.r)}, g:${Q(t.g)}, b:${Q(t.b)}}, a:${Q(t.a)}}`}},"css-rgb":{color:{from:t=>[!0,ut(t)],to:t=>{const e=ct.exec(t);return X([e[1],e[2],e[3]].map((t=>parseInt(t))))}},text:{from:Pt,to:t=>Pt(t)[1]}},"css-rgba":{color:{from:t=>[!0,ht(t)],to:t=>{const e=dt.exec(t);return et([e[1],e[2],e[3],e[4]].map(((t,e)=>3===e?255*parseFloat(t)|0:parseInt(t))))}},text:{from:Ot,to:t=>Ot(t)[1]}},"css-hsl":{color:{from:t=>[!0,mt(t)],to:t=>{const e=gt.exec(t),n=vt([e[1],e[2],e[3]].map((t=>parseFloat(t))));return X(n)}},text:{from:Ht,to:t=>Ht(t)[1]}},"css-hsla":{color:{from:t=>[!0,pt(t)],to:t=>{const e=ft.exec(t),n=function([t,e,n,i]){return[...vt([t,e,n]),255*i|0]}([e[1],e[2],e[3],e[4]].map((t=>parseFloat(t))));return et(n)}},text:{from:zt,to:t=>zt(t)[1]}}};class qt extends p{constructor(t,n){super(e(t,{className:n}))}}class Xt extends V{#N;constructor(t){super("muigui-canvas",t),this.#N=this.add(new qt("canvas","muigui-canvas")).domElement}get canvas(){return this.#N}listen(){return this}}class te extends v{#I;#$;#A;#M;#u={converters:A};constructor(t,n){const i=e("input",{type:"color",onInput:()=>{const[e,n]=this.#$(i.value);e&&(this.#M=!0,t.setValue(n))},onChange:()=>{const[e,n]=this.#$(i.value);e&&(this.#M=!0,t.setFinalValue(n))}});super(e("div",{},[i])),this.setOptions(n),this.#A=i}updateDisplay(t){this.#M||(this.#A.value=this.#I(t)),this.#M=!1}setOptions(t){l(this.#u,t);const{converters:{to:e,from:n}}=this.#u;return this.#I=e,this.#$=n,this}}class ee extends D{#j;#V;constructor(t,e,n={}){super(t,e,"muigui-color");const i=n.format||Dt(this.getValue()),{color:o,text:r}=Kt[i];this.#j=this.add(new te(this,{converters:o})),this.#V=this.add(new B(this,{converters:r})),this.updateDisplay()}setOptions(t){const{format:e}=t;if(e){const{color:t,text:n}=Kt[e];this.#j.setOptions({converters:t}),this.#V.setOptions({converters:n})}return super.setOptions(t),this}}class ne extends g{constructor(){super("muigui-divider")}}class ie extends g{#U;#L;constructor(t){super(t),this.#U=[],this.#L=this}get children(){return this.#U}get controllers(){return this.#U.filter((t=>!(t instanceof ie)))}get folders(){return this.#U.filter((t=>t instanceof ie))}reset(t=!0){for(const e of this.#U)e instanceof ie&&!t||e.reset(t);return this}updateDisplay(){for(const t of this.#U)t.updateDisplay();return this}remove(t){const e=this.#U.indexOf(t);if(e>=0){const t=this.#U.splice(e,1)[0];t.domElement.remove(),t.setParent(null)}return this}#F(t){return this.domElement.appendChild(t.domElement),this.#U.push(t),t.setParent(this),t}addController(t){return this.#L.#F(t)}pushContainer(t){return this.addController(t),this.#L=t,t}popContainer(){return this.#L=this.#L.parent,this}listen(){return this.#U.forEach((t=>{t.listen()})),this}}class oe extends ie{#P;constructor(t="Controls",n="muigui-menu"){super(n),this.#P=e("label"),this.addElem(e("button",{type:"button",onClick:()=>this.toggleOpen()},[this.#P])),this.pushContainer(new ie("muigui-open-container")),this.pushContainer(new ie),this.name(t),this.open()}open(t=!0){return this.domElement.classList.toggle("muigui-closed",!t),this.domElement.classList.toggle("muigui-open",t),this}close(){return this.open(!1)}name(t){return this.#P.textContent=t,this}title(t){return this.name(t)}toggleOpen(){return this.open(!this.domElement.classList.contains("muigui-open")),this}}class re extends g{constructor(t){super("muigui-label"),this.text(t)}text(t){return this.domElement.textContent=t,this}}function se(){}function ae(t,e,n){const i=t.getBoundingClientRect(),o=e.clientX-i.left,r=e.clientY-i.top,s=o/i.width,a=r/i.height,l=o-(n=n||[o,r])[0],u=r-n[1];return{x:o,y:r,nx:s,ny:a,dx:l,dy:u,ndx:l/i.width,ndy:u/i.width}}function le(t,{onDown:e=se,onMove:n=se,onUp:i=se}){let o;const r=function(e){const i={type:"move",...ae(t,e,o)};n(i)},s=function(e){t.releasePointerCapture(e.pointerId),t.removeEventListener("pointermove",r),t.removeEventListener("pointerup",s),document.body.style.backgroundColor="",i("up")},a=function(n){t.addEventListener("pointermove",r),t.addEventListener("pointerup",s),t.setPointerCapture(n.pointerId);const i=ae(t,n);o=[i.x,i.y],e({type:"down",...i})};return t.addEventListener("pointerdown",a),function(){t.removeEventListener("pointerdown",a)}}function ue(t){return t.querySelectorAll("[data-src]").forEach((e=>{const i="muigui-id-"+n++;e.id=i,t.querySelectorAll(`[data-target=${e.dataset.src}]`).forEach((t=>{t.setAttribute("fill",`url(#${i})`)}))})),t}class ce extends v{#I;#$;#O;#H;#z;#T;#W;#B;#G;#Z;#R;#J;#Y;#Q;#u={converters:A,alpha:!1};#_;#K;constructor(t,n){super(e("div",{innerHTML:'\n\n \n \n \n \n \n \n \n \n\n \n \n \n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n \n \n \n \n \n \n \n \n\n',className:"muigui-no-scroll"})),this.#O=this.domElement.children[0],this.#z=this.domElement.children[1],this.#B=this.domElement.children[2],ue(this.#O),ue(this.#z),ue(this.#B),this.#H=this.$(".muigui-color-chooser-circle"),this.#T=this.$("[data-src=muigui-color-chooser-hue]"),this.#W=this.$(".muigui-color-chooser-hue-cursor"),this.#G=this.$("[data-src=muigui-color-chooser-alpha]"),this.#Z=this.$(".muigui-color-chooser-alpha-cursor");const i=e=>{const n=o(e.nx,0,1),i=o(e.ny,0,1);this.#R[1]=n,this.#R[2]=1-i,this.#J=!0,this.#Q=!0;const[r,s]=this.#$(this.#_(this.#R));r&&t.setValue(s)},r=e=>{const n=o(e.nx,0,1);this.#R[0]=n,this.#Y=!0,this.#Q=!0;const[i,r]=this.#$(this.#_(this.#R));i&&t.setValue(r)},s=e=>{const n=o(e.nx,0,1);this.#R[3]=n,this.#J=!0,this.#Y=!0;const[i,r]=this.#$(this.#_(this.#R));i&&t.setValue(r)};le(this.#O,{onDown:i,onMove:i}),le(this.#z,{onDown:r,onMove:r}),le(this.#B,{onDown:s,onMove:s}),this.setOptions(n)}updateDisplay(t){this.#R||(this.#R=this.#K(this.#I(t)));{const[e,n,i,o=1]=this.#K(this.#I(t));this.#J||(this.#R[0]=n>.001&&i>.001?e:this.#R[0]),this.#Y||(this.#R[1]=n,this.#R[2]=i),this.#Q||(this.#R[3]=o)}{const[t,e,n,i]=this.#R,[o,r,s]=wt(It(this.#R));this.#J||this.#W.setAttribute("transform",`translate(${64*t}, 0)`),this.#T.children[0].setAttribute("stop-color",`hsl(${360*o} 0% 100% / ${i})`),this.#T.children[1].setAttribute("stop-color",`hsl(${360*o} 100% 50% / ${i})`),this.#Q||this.#Z.setAttribute("transform",`translate(${64*i}, 0)`),this.#G.children[0].setAttribute("stop-color",`hsl(${360*o} ${100*r}% ${100*s}% / 0)`),this.#G.children[1].setAttribute("stop-color",`hsl(${360*o} ${100*r}% ${100*s}% / 1)`),this.#Y||(this.#H.setAttribute("cx",""+64*e),this.#H.setAttribute("cy",""+48*(1-n)))}this.#J=!1,this.#Y=!1,this.#Q=!1}setOptions(t){l(this.#u,t);const{converters:{to:e,from:n},alpha:i}=this.#u;return this.#B.style.display=i?"":"none",this.#_=i?t=>rt(It(t)):t=>it(Et(t)),this.#K=i?t=>Mt(ot(t)):t=>Ct(nt(t)),this.#I=e,this.#$=n,this}}class he extends D{#q;#X;#b;#tt;#u={open:!1};constructor(t,n,i={}){super(t,n,"muigui-pop-down-controller"),this.#q=this.add(new qt("div","muigui-pop-down-top"));const o=this.#q.addElem(e("input",{type:"checkbox",onChange:()=>{this.#u.open=o.checked,this.updateDisplay()}}));this.#b=o,this.#X=this.#q.add(new qt("div","muigui-pop-down-values"));const r=new qt("div","muigui-pop-down-bottom muigui-open-container");this.#tt=new qt("div"),r.add(this.#tt),this.add(r),this.setOptions(i)}setKnobColor(t){this.#b&&(this.#b.style=`\n --range-color: ${t};\n --value-bg-color: ${t};\n `)}updateDisplay(){super.updateDisplay();const{open:t}=this.#u;this.domElement.children[1].classList.toggle("muigui-open",t),this.domElement.children[1].classList.toggle("muigui-closed",!t)}setOptions(t){l(this.#u,t),super.setOptions(t),this.updateDisplay()}addTop(t){return this.#X.add(t)}addBottom(t){return this.#tt.add(t)}}class de extends he{#j;#V;#I;constructor(t,e,n={}){super(t,e,"muigui-color-chooser");const i=n.format||Dt(this.getValue()),{color:o,text:r}=Kt[i];this.#I=o.to,this.#V=new B(this,{converters:r,alpha:St(i)}),this.#j=new ce(this,{converters:o,alpha:St(i)}),this.addTop(this.#V),this.addBottom(this.#j),this.___setKnobHelper=!0,this.updateDisplay()}#et(){if(this.#I){const t=this.#I(this.getValue()),e=9===t.length?t.substring(7,9):"FF",n=yt(q(t));n[2]=(n[2]+50)%100;const i=X(vt(n));this.setKnobColor(`${t.substring(0,7)}${e}`,i)}}updateDisplay(){super.updateDisplay(),this.___setKnobHelper&&this.#et()}setOptions(t){return super.setOptions(t),this}}function me(t){return function(t){return t.replace(/(.)([A-Z][a-z]+)/g,"$1_$2").replace(/([a-z0-9])([A-Z])/g,"$1_$2").toLowerCase()}(t.toString()).replaceAll("_"," ")}class pe extends oe{add(t,e,...n){const i=t instanceof g?t:function(t,e,...n){const[i]=n;if(Array.isArray(i))return new z(t,e,{keyValues:i});if(i&&i.keyValues)return new z(t,e,{keyValues:i.keyValues});const o=typeof t[e];switch(o){case"number":if("number"==typeof n[0]&&"number"==typeof n[1]){const i=n[0],o=n[1],r=n[2];return new W(t,e,{min:i,max:o,...r&&{step:r}})}return 0===n.length?new P(t,e,...n):new W(t,e,...n);case"boolean":return new N(t,e,...n);case"function":return new f(t,e,...n);case"string":return new G(t,e,...n);case"undefined":throw new Error(`no property named ${e}`);default:throw new Error(`unhandled type ${o} for property ${e}`)}}(t,e,...n).name(me(e));return this.addController(i)}addCanvas(t){return this.addController(new Xt(t))}addColor(t,e,n={}){const i=t[e];return St(n.format||Dt(i))?this.addController(new de(t,e,n)).name(me(e)):this.addController(new ee(t,e,n)).name(me(e))}addDivider(){return this.addController(new ne)}addFolder(t){return this.addController(new pe(t))}addLabel(t){return this.addController(new re(t))}addButton(t,e){const n={fn:e};return this.add(n,"fn").name(me(t))}}class ge extends HTMLElement{constructor(){super(),this.shadow=this.attachShadow({mode:"open"})}}customElements.define("muigui-element",ge);const fe=new CSSStyleSheet,be=new CSSStyleSheet;function ve(t){let e,n;function i(){if(e&&!n){const o=e;e=void 0,n=t.replace(o).then((()=>{n=void 0,i()}))}}return function(t){e=t,i()}}const xe=ve(fe),we=ve(be);function ye(e){const{include:n,css:i}=t.themes[e];return`${n.map((e=>t[e])).join("\n")} : css.default}\n${i||""}`}class ke extends pe{static converters=U;static mapRange=u;static makeRangeConverters=c;static makeRangeOptions=h;static makeMinMaxPair=m;#nt=new CSSStyleSheet;constructor(n={}){super("Controls","muigui-root"),n instanceof HTMLElement&&(n={parent:n});const{autoPlace:i=!0,width:o,title:r="Controls"}=n;let{parent:s}=n;if(o&&(this.domElement.style.width=/^\d+$/.test(o)?`${o}px`:o),void 0===s&&i&&(s=document.body,this.domElement.classList.add("muigui-auto-place")),s){const t=e("muigui-element");t.shadowRoot.adoptedStyleSheets=[this.#nt,fe,be],t.shadow.appendChild(this.domElement),s.appendChild(t)}r&&this.title(r),this.#nt.replaceSync(t.default),this.domElement.classList.add("muigui","muigui-colors")}setStyle(t){this.#nt.replace(t)}static setBaseStyles(t){xe(t)}static getBaseStyleSheet(){return fe}static setUserStyles(t){we(t)}static getUserStyleSheet(){return be}setTheme(t){this.setStyle(ye(t))}static setTheme(t){ke.setBaseStyles(ye(t))}}function Ee(){}const Ie={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]};function $e(t,{onDown:e=Ee,onUp:n=Ee}){const i=function(t){const i=t.shiftKey?10:1,[o,r]=(Ie[t.key]||[0,0]).map((t=>t*i));("keydown"===t.type?e:n)({type:t.type.substring(3),dx:o,dy:r,event:t})};return t.addEventListener("keydown",i),t.addEventListener("keyup",i),function(){t.removeEventListener("keydown",i),t.removeEventListener("keyup",i)}}function Ce(t,e=""){if(!t)throw new Error(e)}function Me(t,e,n,i,o,r){const s=Math.abs(n)*Math.cos(r),a=Math.abs(i)*Math.sin(r);return[t+Math.cos(o)*s-Math.sin(o)*a,e+Math.sin(o)*s+Math.cos(o)*a]}function Se(t,e,n,i,o){Ce(Math.abs(i-o)<=2*Math.PI),Ce(i>=-Math.PI&&i<=2*Math.PI),Ce(i<=o),Ce(o>=-Math.PI&&o<=4*Math.PI);const{x1:r,y1:s,x2:a,y2:l,fa:u,fs:c}=function(t,e,n,i,o,r,s){const[a,l]=Me(t,e,n,i,o,r),[u,c]=Me(t,e,n,i,o,r+s);return{x1:a,y1:l,x2:u,y2:c,fa:Math.abs(s)>Math.PI?1:0,fs:s>0?1:0}}(t,e,n,n,0,i,o-i);return Math.abs(Math.abs(i-o)-2*Math.PI)>Number.EPSILON?`M${t} ${e} L${r} ${s} A ${n} ${n} 0 ${u} ${c} ${a} ${l} L${t} ${e}`:`M${r} ${s} L${r} ${s} A ${n} ${n} 0 ${u} ${c} ${a} ${l}`}const Ve=t=>a(t+Math.PI,2*Math.PI)-Math.PI;class De extends v{#it;#ot;#rt;#st;#u={step:1,min:-180,max:180,dirMin:-Math.PI,dirMax:Math.PI,wrap:void 0,converters:A};constructor(t,n={}){const i=L();super(e("div",{className:"muigui-direction muigui-no-scroll",innerHTML:'\n\n \x3c!----\x3e\n \n \n \n \n \n \n\n',onWheel:e=>{e.preventDefault();const{min:n,max:r,step:l}=this.#u,u=i(e,l);let c=this.#rt+u;this.#st&&(c=a(c-n,r-n)+n);const h=o(s(c,(t=>t),l),n,r);t.setValue(h)}}));const r=e=>{const{min:n,max:i,step:r,dirMin:a,dirMax:l}=this.#u,u=2*e.nx-1,c=2*e.ny-1,h=Math.atan2(c,u),d=(a+l)/2,m=o((Ve(h-d)-Ve(a-d))/(l-a),0,1),p=s(n+(i-n)*m,(t=>t),r);t.setValue(p)};le(this.domElement,{onDown:r,onMove:r}),$e(this.domElement,{onDown:e=>{const{min:n,max:i,step:r}=this.#u,a=o(s(this.#rt+e.dx*r,(t=>t),r),n,i);t.setValue(a)}}),this.#it=this.$("#muigui-arrow"),this.#ot=this.$("#muigui-range"),this.setOptions(n)}updateDisplay(t){this.#rt=t;const{min:e,max:n}=this.#u,i=(t-e)/(n-e),o=(r=this.#u.dirMin,s=this.#u.dirMax,r+(s-r)*i);var r,s;this.#it.style.transform=`rotate(${o}rad)`}setOptions(t){l(this.#u,t);const{dirMin:e,dirMax:n,wrap:i}=this.#u;this.#st=void 0!==i?i:Math.abs(e-n)>=2*Math.PI-Number.EPSILON;const[o,r]=e(o.push(i),e("label",{},[e("input",{type:"radio",name:r,value:a,onChange:function(){this.checked&&t.setFinalValue(s.#D[this.value])}}),e("button",{type:"button",textContent:n,onClick:function(){this.previousElementSibling.click()}})]))))));const s=this;this.#D=o,this.cols(i)}updateDisplay(t){const e=this.#D.indexOf(t);for(let t=0;t{e({rect:t.getBoundingClientRect(),elem:t})})).observe(t)}function je(t,e,n,i){Ae(t,(({rect:o})=>{const{width:r,height:s}=o;t.setAttribute("viewBox",`-${r*e} -${s*n} ${r} ${s}`),i({elem:t,rect:o})}))}function Ue(t,e,n,i,o,r){const a=[];tt),n)),e=Math.min(e,o);for(let i=t;i<=e;i+=n)a.push(`M${i} 0 l0 ${r}`);return a.join(" ")}class Le extends v{#at;#lt;#ut;#ct;#ht;#dt;#mt;#pt;#gt;#rt;#ft;#u={min:-100,max:100,step:1,unit:10,unitSize:10,ticksPerUnit:5,labelFn:t=>t,tickHeight:1,limits:!0,thicksColor:void 0,orientation:void 0};constructor(t,n){const i=L();let r;super(e("div",{innerHTML:'\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \x3c!----\x3e\n \x3c!----\x3e\n \n \n \n \n\n',className:"muigui-no-v-scroll",onWheel:e=>{e.preventDefault();const{min:n,max:r,step:a}=this.#u,l=i(e,a),u=o(s(this.#rt+l,(t=>t),a),n,r);t.setValue(u)}})),this.#at=this.$("svg"),this.#lt=this.$("#muigui-origin"),this.#ut=this.$("#muigui-ticks"),this.#ct=this.$("#muigui-thicks"),this.#ht=this.$("#muigui-numbers"),this.#dt=this.$("#muigui-left-grad"),this.#mt=this.$("#muigui-right-grad"),this.setOptions(n),le(this.domElement,{onDown:()=>{r=this.#rt},onMove:e=>{const{min:n,max:i,unitSize:a,unit:l,step:u}=this.#u,c=o(s(r-e.dx/a*l,(t=>t),u),n,i);t.setValue(c)}}),$e(this.domElement,{onDown:e=>{const{min:n,max:i,step:r}=this.#u,a=o(s(this.#rt+e.dx*r,(t=>t),r),n,i);t.setValue(a)}}),je(this.#at,.5,0,(({rect:{width:t}})=>{this.#dt.setAttribute("x",-t/2),this.#mt.setAttribute("x",t/2-20),this.#ft=function(t){const e=t.innerHTML;t.innerHTML="- ";const n=t.querySelector("text").getComputedTextLength();return t.innerHTML=e,n}(this.#ht),this.#pt=t,this.#bt()}))}#bt(){if(!this.#pt||void 0===this.#rt)return;const{labelFn:t,limits:e,min:n,max:i,orientation:o,tickHeight:r,ticksPerUnit:a,unit:l,unitSize:u,thicksColor:c}=this.#u,h=Math.ceil(this.#pt/u),d=this.#rt/l,m=Math.round(d-h),p=m*u,g=(m+2*h)*u,f=e?n*u/l:p,b=e?i*u/l:g,v=""===t(1)?10:5;a>1&&this.#ut.setAttribute("d",Ue(p,g,u/a,f,b,v*r)),this.#ct.style.stroke=c,this.#ct.setAttribute("d",Ue(p,g,u,f,b,v)),this.#ht.innerHTML=function(t,e,n,i,o,r,a,l){const u=[];tt),n)),e=Math.min(e,a);const c=Math.max(0,-Math.log10(i));for(let r=t;r<=e;r+=n)u.push(`${h=r/n*i,l(h.toFixed(c))}`);var h;return u.join("\n")}(p,g,u,l,this.#ft,f,b,t),this.#lt.setAttribute("transform",`translate(${-this.#rt*u/l} 0)`),this.#at.classList.toggle("muigui-slider-up","up"===o)}updateDisplay(t){this.#rt=t,this.#bt()}setOptions(t){return l(this.#u,t),this}}class Fe extends v{#at;#it;#H;#rt=[];constructor(t){super(e("div",{innerHTML:'\n\n \n \n \n \n \n\n',className:"muigui-no-scroll"}));const n=e=>{const{width:n,height:i}=this.#at.getBoundingClientRect(),o=2*e.nx-1,r=2*e.ny-1;t.setValue([o*n*.5,r*i*.5])};le(this.domElement,{onDown:n,onMove:n}),this.#at=this.$("svg"),this.#it=this.$("#muigui-arrow"),this.#H=this.$("#muigui-circle"),je(this.#at,.5,.5,(()=>this.#vt))}#vt(){const[t,e]=this.#rt;this.#it.setAttribute("d",`M0,0L${t},${e}`),this.#H.setAttribute("transform",`translate(${t}, ${e})`)}updateDisplay(t){this.#rt[0]=t[0],this.#rt[1]=t[1],this.#vt()}}return ke.ColorChooser=de,ke.Direction=class extends he{#u;constructor(t,e,n){super(t,e,"muigui-direction"),this.#u=n,this.addTop(new F(this,A)),this.addBottom(new De(this,n)),this.updateDisplay()}},ke.RadioGrid=class extends D{constructor(t,e,n){super(t,e,"muigui-radio-grid");const i="number"==typeof this.getValue(),{keyValues:o,cols:r=3}=n,s=H(o,i);this.add(new Ne(this,s,r)),this.updateDisplay()}},ke.Range=W,ke.Select=z,ke.Slider=class extends D{constructor(t,e,n={}){super(t,e,"muigui-slider"),this.add(new Le(this,n)),this.add(new F(this,n)),this.updateDisplay()}},ke.TextNumber=P,ke.Vec2=class extends he{constructor(t,e){super(t,e,"muigui-vec2");const n=t=>({setValue:e=>{const n=this.getValue();n[t]=e,this.setValue(n)},setFinalValue:e=>{const n=this.getValue();n[t]=e,this.setFinalValue(n)}});this.addTop(new F(n(0),{converters:{to:t=>t[0],from:j.from}})),this.addTop(new F(n(1),{converters:{to:t=>t[1],from:j.from}})),this.addBottom(new Fe(this)),this.updateDisplay()}},ke})); //# sourceMappingURL=muigui.min.js.map diff --git a/dist/0.x/muigui.min.js.map b/dist/0.x/muigui.min.js.map index 2f8a95a..2a33770 100644 --- a/dist/0.x/muigui.min.js.map +++ b/dist/0.x/muigui.min.js.map @@ -1 +1 @@ -{"version":3,"file":"muigui.min.js","sources":["../../src/styles/muigui.css.js","../../src/libs/elem.js","../../src/libs/utils.js","../../../src/views/View.ts","../../src/controllers/Controller.js","../../src/controllers/Button.js","../../src/views/EditView.js","../../src/views/CheckboxView.js","../../src/libs/taskrunner.js","../../src/libs/ids.js","../../src/views/ValueView.js","../../src/controllers/LabelController.js","../../src/controllers/ValueController.js","../../src/controllers/Checkbox.js","../../src/libs/conversions.js","../../src/libs/wheel.js","../../src/views/NumberView.js","../../src/controllers/TextNumber.js","../../src/views/SelectView.js","../../src/libs/key-values.js","../../src/controllers/Select.js","../../src/views/RangeView.js","../../src/controllers/Range.js","../../src/views/TextView.js","../../src/controllers/Text.js","../../src/libs/color-utils.js","../../src/views/ElementView.js","../../src/controllers/Canvas.js","../../src/views/ColorView.js","../../src/controllers/Color.js","../../src/controllers/Divider.js","../../src/controllers/Container.js","../../src/controllers/Folder.js","../../src/controllers/Label.js","../../src/libs/touch.js","../../src/views/ColorChooserView.js","../../src/controllers/PopDownController.js","../../src/controllers/ColorChooser.js","../../src/muigui.js","../../src/controllers/create-controller.js","../../src/libs/keyboard.js","../../src/libs/assert.js","../../src/libs/svg.js","../../src/views/DirectionView.js","../../src/views/RadioGridView.js","../../src/libs/resize-helpers.js","../../src/views/SliderView.js","../../src/views/Vec2View.js","../../src/umd.js","../../src/controllers/Direction.js","../../src/controllers/RadioGrid.js","../../src/controllers/Slider.js","../../src/controllers/Vec2.js"],"sourcesContent":["export default {\n default: `\n.muigui {\n --bg-color: #ddd;\n --color: #222;\n --contrast-color: #eee;\n --value-color: #145 ;\n --value-bg-color: #eeee;\n --disabled-color: #999;\n --menu-bg-color: #f8f8f8;\n --menu-sep-color: #bbb;\n --hover-bg-color: #999;\n --focus-color: #8BF;\n --range-color: #AAA;\n --invalid-color: #FF0000;\n --selected-color: rgb(255, 255, 255, 0.9);\n\n --button-bg-color: var(--value-bg-color);\n\n --image-open: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjNDQ0OyIgeD0iMjAlIiB5PSI0NSUiIHdpZHRoPSI2MCUiIGhlaWdodD0iMTAlIj48L3JlY3Q+Cjwvc3ZnPg==);\n --image-closed: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjNDQ0OyIgeD0iNDUlIiB5PSIyMCUiIHdpZHRoPSIxMCUiIGhlaWdodD0iNjAlIj48L3JlY3Q+CiAgPHJlY3Qgc3R5bGU9ImZpbGw6ICM0NDQ7IiB4PSIyMCUiIHk9IjQ1JSIgd2lkdGg9IjYwJSIgaGVpZ2h0PSIxMCUiPjwvcmVjdD4KPC9zdmc+);\n --image-checkerboard: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjNDA0MDQwOyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSI+PC9yZWN0PgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjODA4MDgwOyIgeD0iMCIgeT0iMCIgd2lkdGg9IjUwJSIgaGVpZ2h0PSI1MCUiPjwvcmVjdD4KICA8cmVjdCBzdHlsZT0iZmlsbDogIzgwODA4MDsiIHg9IjUwJSIgeT0iNTAlIiB3aWR0aD0iNTAlIiBoZWlnaHQ9IjUwJSI+PC9yZWN0Pgo8L3N2Zz4=);\n\n --range-left-color: var(--value-color);\n --range-right-color: var(--value-bg-color); \n --range-right-hover-color: var(--hover-bg-color);\n --button-image: \n linear-gradient(\n rgba(255, 255, 255, 1), rgba(0, 0, 0, 0.2)\n );\n\n color: var(--color);\n background-color: var(--bg-color);\n}\n\n@media (prefers-color-scheme: dark) {\n .muigui {\n --bg-color: #222222;\n --color: #dddddd;\n --contrast-color: #000;\n --value-color: #43e5f7;\n --value-bg-color: #444444;\n --disabled-color: #666666;\n --menu-bg-color: #080808;\n --menu-sep-color: #444444;\n --hover-bg-color: #666666;\n --focus-color: #458; /*#88AAFF*/;\n --range-color: #888888;\n --invalid-color: #FF6666;\n --selected-color: rgba(255, 255, 255, 0.3);\n\n --button-bg-color: var(--value-bg-color);\n\n --range-left-color: var(--value-color);\n --range-right-color: var(--value-bg-color); \n --range-right-hover-color: var(--hover-bg-color);\n --button-image: linear-gradient(\n rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.4)\n );\n\n color: var(--color);\n background-color: var(--bg-color);\n\n --image-closed: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjREREOyIgeD0iMjAlIiB5PSI0NSUiIHdpZHRoPSI2MCUiIGhlaWdodD0iMTAlIj48L3JlY3Q+Cjwvc3ZnPg==);\n --image-open: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjREREOyIgeD0iNDUlIiB5PSIyMCUiIHdpZHRoPSIxMCUiIGhlaWdodD0iNjAlIj48L3JlY3Q+CiAgPHJlY3Qgc3R5bGU9ImZpbGw6ICNEREQ7IiB4PSIyMCUiIHk9IjQ1JSIgd2lkdGg9IjYwJSIgaGVpZ2h0PSIxMCUiPjwvcmVjdD4KPC9zdmc+);\n }\n}\n\n.muigui {\n --width: 250px;\n --label-width: 45%;\n --number-width: 40%;\n\n --font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Arial, sans-serif;\n --font-size: 11px;\n --font-family-mono: Menlo, Monaco, Consolas, \"Droid Sans Mono\", monospace;\n --font-size-mono: 11px;\n\n --line-height: 1.7em;\n --border-radius: 0px;\n\n width: var(--width);\n font-family: var(--font-family);\n font-size: var(--font-size);\n box-sizing: border-box;\n line-height: 100%;\n}\n.muigui * {\n box-sizing: inherit;\n}\n\n.muigui-no-scroll {\n touch-action: none;\n}\n.muigui-no-h-scroll {\n touch-action: pan-y;\n}\n.muigui-no-v-scroll {\n touch-action: pan-x;\n}\n\n.muigui-invalid-value {\n background-color: red !important;\n color: white !important;\n}\n\n.muigui-grid {\n display: grid;\n}\n.muigui-rows {\n display: flex;\n flex-direction: column;\n\n min-height: 20px;\n border: 2px solid red;\n}\n.muigui-columns {\n display: flex;\n flex-direction: row;\n\n height: 20px;\n border: 2px solid green;\n}\n.muigui-rows>*,\n.muigui-columns>* {\n flex: 1 1 auto;\n align-items: stretch;\n min-height: 0;\n min-width: 0;\n}\n\n.muigui-row {\n border: 2px solid yellow;\n min-height: 10px\n}\n.muigui-column {\n border: 2px solid lightgreen;\n}\n\n/* -------- */\n\n.muigui-show { /* */ }\n.muigui-hide { \n display: none !important;\n}\n.muigui-disabled {\n pointer-events: none;\n --color: var(--disabled-color) !important;\n --value-color: var(--disabled-color) !important;\n --range-left-color: var(--disabled-color) !important;\n}\n\n.muigui canvas,\n.muigui svg {\n display: block;\n border-radius: var(--border-radius);\n}\n.muigui canvas {\n background-color: var(--value-bg-color);\n}\n\n.muigui-controller {\n min-width: 0;\n min-height: var(--line-height);\n}\n.muigui-root {\n z-index: 1;\n}\n.muigui-root,\n.muigui-menu {\n display: flex;\n flex-direction: column;\n position: relative;\n user-select: none;\n height: fit-content;\n margin: 0;\n padding-bottom: 0.1em;\n border-radius: var(--border-radius);\n}\n.muigui-menu {\n border-bottom: 1px solid var(--menu-sep-color);\n}\n\n.muigui-root>button:nth-child(1),\n.muigui-menu>button:nth-child(1) {\n border-top: 1px solid var(--menu-sep-color);\n border-bottom: 1px solid var(--menu-sep-color);\n position: relative;\n text-align: left;\n color: var(--color);\n background-color: var(--menu-bg-color);\n min-height: var(--line-height);\n padding: 0.2em;\n cursor: pointer;\n border-radius: var(--border-radius);\n}\n.muigui-root>div:nth-child(2),\n.muigui-menu>div:nth-child(2) {\n flex: 1 1 auto;\n}\n\n.muigui-controller {\n margin-left: 0.2em;\n margin-right: 0.2em;\n}\n.muigui-root.muigui-controller,\n.muigui-menu.muigui-controller {\n margin-left: 0;\n margin-right: 0;\n}\n.muigui-controller>*:nth-child(1) {\n flex: 1 0 var(--label-width);\n min-width: 0;\n /* white-space: pre; why?? */\n}\n.muigui-controller>label:nth-child(1) {\n place-content: center start;\n display: inline-grid;\n overflow: hidden;\n}\n.muigui-controller>*:nth-child(2) {\n flex: 1 1 75%;\n min-width: 0;\n}\n\n/* -----------------------------------------\n a label controller is [[label][value]]\n*/\n\n.muigui-label-controller {\n display: flex;\n margin: 0.4em 0 0.4em 0;\n word-wrap: initial;\n align-items: stretch;\n}\n\n.muigui-value {\n display: flex;\n align-items: stretch;\n}\n.muigui-value>* {\n flex: 1 1 auto;\n min-width: 0;\n}\n.muigui-value>*:nth-child(1) {\n flex: 1 1 calc(100% - var(--number-width));\n}\n.muigui-value>*:nth-child(2) {\n flex: 1 1 var(--number-width);\n margin-left: 0.2em;\n}\n\n/* fix! */\n.muigui-open>button>label::before,\n.muigui-closed>button>label::before {\n content: \"X\";\n color: rgba(0, 0, 0, 0);\n background-color: var(--range-color);\n border-radius: 0.2em;\n width: 1.25em;\n margin-right: 0.25em;\n height: 1.25em; /*var(--line-height);*/\n display: inline-grid;\n place-content: center start;\n pointer-events: none;\n}\n.muigui-open>button>label::before {\n background-image: var(--image-open);\n}\n.muigui-closed>button>label::before {\n background-image: var(--image-closed);\n}\n\n.muigui-open>.muigui-open-container {\n transition: all 0.1s ease-out;\n overflow: auto;\n height: 100%;\n}\n.muigui-closed>.muigui-open-container {\n transition: all 0.1s ease-out;\n overflow: hidden;\n min-height: 0;\n}\n.muigui-open>.muigui-open-container>* {\n transition: all 0.1s ease-out;\n margin-top: 0px;\n}\n.muigui-closed>.muigui-open-container>* {\n transition: all 0.1s ease-out;\n margin-top: -100%;\n}\n\n/* ---- popdown ---- */\n\n.muigui-pop-down-top {\n display: flex;\n}\n/* fix? */\n.muigui-value>*:nth-child(1).muigui-pop-down-top {\n flex: 0;\n}\n.muigui-closed .muigui-pop-down-bottom {\n max-height: 0;\n}\n\n.muigui-value .muigui-pop-down-bottom {\n margin: 0;\n}\n\n.muigui-pop-down-values {\n min-width: 0;\n display: flex;\n}\n.muigui-pop-down-values>* {\n flex: 1 1 auto;\n min-width: 0;\n}\n\n.muigui-value.muigui-pop-down-controller {\n flex-direction: column;\n}\n\n.muigui-pop-down-top input[type=checkbox] {\n -webkit-appearance: none;\n appearance: none;\n width: auto;\n color: var(--value-color);\n background-color: var(--value-bg-color);\n background-image: var(--image-checkerboard);\n background-size: 10px 10px;\n background-position: 0 0, 0 5px, 5px -5px, -5px 0px;\n\n cursor: pointer;\n\n display: grid;\n place-content: center;\n margin: 0;\n font: inherit;\n color: currentColor;\n width: 1.7em;\n height: 1.7em;\n transform: translateY(-0.075em);\n}\n\n.muigui-pop-down-top input[type=checkbox]::before {\n content: \"+\";\n display: grid;\n place-content: center;\n border-radius: calc(var(--border-radius) + 2px);\n border-left: 1px solid rgba(255,255,255,0.3);\n border-top: 1px solid rgba(255,255,255,0.3);\n border-bottom: 1px solid rgba(0,0,0,0.2);\n border-right: 1px solid rgba(0,0,0,0.2);\n background-color: var(--range-color);\n color: var(--value-bg-color);\n width: calc(var(--line-height) - 4px);\n height: calc(var(--line-height) - 4px);\n}\n\n.muigui-pop-down-top input[type=checkbox]:checked::before {\n content: \"X\";\n}\n\n\n/* ---- select ---- */\n\n.muigui select,\n.muigui option,\n.muigui input,\n.muigui button {\n color: var(--value-color);\n background-color: var(--value-bg-color);\n font-family: var(--font-family);\n font-size: var(--font-size);\n border: none;\n margin: 0;\n border-radius: var(--border-radius);\n}\n.muigui select {\n appearance: none;\n margin: 0;\n margin-left: 0; /*?*/\n overflow: hidden; /* Safari */\n}\n\n.muigui select:focus,\n.muigui input:focus,\n.muigui button:focus {\n outline: 1px solid var(--focus-color);\n}\n\n.muigui select:hover,\n.muigui option:hover,\n.muigui input:hover,\n.muigui button:hover {\n background-color: var(--hover-bg-color); \n}\n\n/* ------ [ label ] ------ */\n\n.muigui-label {\n border-top: 1px solid var(--menu-sep-color);\n border-bottom: 1px solid var(--menu-sep-color);\n padding-top: 0.4em;\n padding-bottom: 0.3em;\n place-content: center start;\n background-color: var(--menu-bg-color);\n white-space: pre;\n border-radius: var(--border-radius);\n}\n\n/* ------ [ divider] ------ */\n\n.muigui-divider {\n min-height: 6px;\n border-top: 2px solid var(--menu-sep-color);\n margin-top: 6px;\n}\n\n/* ------ [ button ] ------ */\n\n.muigui-button {\n display: grid;\n padding: 2px 0 2px 0;\n}\n.muigui-button button {\n border: none;\n color: var(--value-color);\n background-color: var(--button-bg-color);\n background-image: var(--button-image);\n cursor: pointer;\n place-content: center center;\n height: var(--line-height);\n}\n\n/* ------ [ color ] ------ */\n\n.muigui-color>div {\n overflow: hidden;\n position: relative;\n margin-left: 0;\n margin-right: 0; /* why? */\n max-width: var(--line-height);\n border-radius: var(--border-radius);\n}\n\n.muigui-color>div:focus-within {\n outline: 1px solid var(--focus-color);\n}\n\n.muigui-color input[type=color] {\n border: none;\n padding: 0;\n background: inherit;\n cursor: pointer;\n position: absolute;\n width: 200%;\n left: -10px;\n top: -10px;\n height: 200%;\n}\n.muigui-disabled canvas,\n.muigui-disabled svg,\n.muigui-disabled img,\n.muigui-disabled .muigui-color input[type=color] {\n opacity: 0.2;\n}\n\n/* ------ [ checkbox ] ------ */\n\n.muigui-checkbox>label:nth-child(2) {\n display: grid;\n place-content: center start;\n margin: 0;\n}\n\n.muigui-checkbox input[type=checkbox] {\n -webkit-appearance: none;\n appearance: none;\n width: auto;\n color: var(--value-color);\n background-color: var(--value-bg-color);\n cursor: pointer;\n\n display: grid;\n place-content: center;\n margin: 0;\n font: inherit;\n color: currentColor;\n width: 1.7em;\n height: 1.7em;\n transform: translateY(-0.075em);\n}\n\n.muigui-checkbox input[type=checkbox]::before {\n content: \"\";\n color: var(--value-color);\n display: grid;\n place-content: center;\n}\n\n.muigui-checkbox input[type=checkbox]:checked::before {\n content: \"✔\";\n}\n\n.muigui input[type=number]::-webkit-inner-spin-button, \n.muigui input[type=number]::-webkit-outer-spin-button { \n -webkit-appearance: none;\n appearance: none;\n margin: 0; \n}\n.muigui input[type=number] {\n -moz-appearance: textfield;\n}\n\n/* ------ [ radio grid ] ------ */\n\n.muigui-radio-grid>div {\n display: grid;\n gap: 2px;\n}\n\n.muigui-radio-grid input {\n appearance: none;\n display: none;\n}\n\n.muigui-radio-grid button {\n color: var(--color);\n width: 100%;\n text-align: left;\n}\n\n.muigui-radio-grid input:checked + button {\n color: var(--value-color);\n background-color: var(--selected-color);\n}\n\n/* ------ [ color-chooser ] ------ */\n\n.muigui-color-chooser-cursor {\n stroke-width: 1px;\n stroke: white;\n fill: none;\n}\n.muigui-color-chooser-circle {\n stroke-width: 1px;\n stroke: white;\n fill: none;\n}\n\n\n/* ------ [ vec2 ] ------ */\n\n.muigui-vec2 svg {\n background-color: var(--value-bg-color);\n}\n\n.muigui-vec2-axis {\n stroke: 1px;\n stroke: var(--focus-color);\n}\n\n.muigui-vec2-line {\n stroke-width: 1px;\n stroke: var(--value-color);\n fill: var(--value-color);\n}\n\n/* ------ [ direction ] ------ */\n\n.muigui-direction svg {\n background-color: rgba(0,0,0,0.2);\n}\n\n.muigui-direction:focus-within svg {\n outline: none;\n}\n.muigui-direction-range {\n fill: var(--value-bg-color);\n}\n.muigui-direction svg:focus {\n outline: none;\n}\n.muigui-direction svg:focus .muigui-direction-range {\n stroke-width: 0.5px;\n stroke: var(--focus-color);\n}\n\n.muigui-direction-arrow {\n fill: var(--value-color);\n}\n\n/* ------ [ slider ] ------ */\n\n.muigui-slider>div {\n display: flex;\n align-items: stretch;\n height: var(--line-height);\n}\n.muigui-slider svg {\n flex: 1 1 auto;\n}\n.muigui-slider .muigui-slider-up #muigui-orientation {\n transform: scale(1, -1) translateY(-100%);\n}\n\n.muigui-slider .muigui-slider-up #muigui-number-orientation {\n transform: scale(1,-1);\n}\n\n.muigui-ticks {\n stroke: var(--range-color);\n}\n.muigui-thicks {\n stroke: var(--color);\n stroke-width: 2px;\n}\n.muigui-svg-text {\n fill: var(--color);\n font-size: 7px;\n}\n.muigui-mark {\n fill: var(--value-color);\n}\n\n/* ------ [ range ] ------ */\n\n\n.muigui-range input[type=range] {\n -webkit-appearance: none;\n appearance: none;\n background-color: transparent;\n}\n\n.muigui-range input[type=range]::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n border-radius: calc(var(--border-radius) + 2px);\n border-left: 1px solid rgba(255,255,255,0.3);\n border-top: 1px solid rgba(255,255,255,0.3);\n border-bottom: 1px solid rgba(0,0,0,0.2);\n border-right: 1px solid rgba(0,0,0,0.2);\n background-color: var(--range-color);\n margin-top: calc((var(--line-height) - 6px) / -2);\n width: calc(var(--line-height) - 6px);\n height: calc(var(--line-height) - 6px);\n}\n\n.muigui-range input[type=range]::-webkit-slider-runnable-track {\n -webkit-appearance: none;\n appearance: none;\n border: 1px solid var(--menu-sep-color);\n height: 2px;\n}\n\n\n/* dat.gui style - doesn't work on Safari iOS */\n\n/*\n.muigui-range input[type=range] {\n cursor: ew-resize;\n overflow: hidden;\n}\n\n.muigui-range input[type=range] {\n -webkit-appearance: none;\n appearance: none;\n background-color: var(--range-right-color);\n margin: 0;\n}\n.muigui-range input[type=range]:hover {\n background-color: var(--range-right-hover-color);\n}\n\n.muigui-range input[type=range]::-webkit-slider-runnable-track {\n -webkit-appearance: none;\n appearance: none;\n height: max-content;\n color: var(--range-left-color);\n margin-top: -1px;\n}\n\n.muigui-range input[type=range]::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 0px;\n height: max-content;\n box-shadow: -1000px 0 0 1000px var(--range-left-color);\n}\n*/\n\n/* FF */\n/*\n.muigui-range input[type=range]::-moz-slider-progress {\n background-color: var(--range-left-color); \n}\n.muigui-range input[type=range]::-moz-slider-thumb {\n height: max-content;\n width: 0;\n border: none;\n box-shadow: -1000px 0 0 1000px var(--range-left-color);\n box-sizing: border-box;\n}\n*/\n\n.muigui-checkered-background {\n background-color: #404040;\n background-image:\n linear-gradient(45deg, #808080 25%, transparent 25%),\n linear-gradient(-45deg, #808080 25%, transparent 25%),\n linear-gradient(45deg, transparent 75%, #808080 75%),\n linear-gradient(-45deg, transparent 75%, #808080 75%);\n background-size: 16px 16px;\n background-position: 0 0, 0 8px, 8px -8px, -8px 0px;\n}\n\n/* ---------------------------------------------------------- */\n\n/* needs to be at bottom to take precedence */\n.muigui-auto-place {\n max-height: 100%;\n position: fixed;\n top: 0;\n right: 15px;\n z-index: 100001;\n}\n\n`,\nthemes: {\n default: {\n include: ['default'],\n css: `\n `,\n },\n float: {\n include: ['default'],\n css: `\n :root {\n color-scheme: light dark,\n }\n\n .muigui {\n --width: 400px;\n --bg-color: initial;\n --label-width: 25%;\n --number-width: 20%;\n }\n\n input,\n .muigui-label-controller>label {\n text-shadow:\n -1px -1px 0 var(--contrast-color),\n 1px -1px 0 var(--contrast-color),\n -1px 1px 0 var(--contrast-color),\n 1px 1px 0 var(--contrast-color);\n }\n\n .muigui-controller > label:nth-child(1) {\n place-content: center end;\n margin-right: 1em;\n }\n\n .muigui-value > :nth-child(2) {\n margin-left: 1em;\n }\n\n .muigui-root>*:nth-child(1) {\n display: none;\n }\n\n .muigui-range input[type=range]::-webkit-slider-thumb {\n border-radius: 1em;\n }\n\n .muigui-range input[type=range]::-webkit-slider-runnable-track {\n -webkit-appearance: initial;\n appearance: none;\n border: 1px solid rgba(0, 0, 0, 0.25);\n height: 2px;\n }\n\n .muigui-colors {\n --value-color: var(--color );\n --value-bg-color: rgba(0, 0, 0, 0.1);\n --disabled-color: #cccccc;\n --menu-bg-color: rgba(0, 0, 0, 0.1);\n --menu-sep-color: #bbbbbb;\n --hover-bg-color: rgba(0, 0, 0, 0);\n --invalid-color: #FF0000;\n --selected-color: rgba(0, 0, 0, 0.3);\n --range-color: rgba(0, 0, 0, 0.125);\n }\n`,\n },\n form: {\n include: [],\n css: `\n .muigui {\n --width: 100%;\n --label-width: 45%;\n --number-width: 40%;\n }\n .muigui-root>button {\n display: none;\n }\n .muigui-controller {\n margin-top: 1em;\n }\n .muigui-label-controller {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n margin-top: 1em;\n }\n .muigui-label-controller:has(.muigui-checkbox) {\n flex-direction: row;\n }\n .muigui-value {\n display: flex;\n align-items: stretch;\n }\n .muigui-value>* {\n flex: 1 1 auto;\n min-width: 0;\n }\n .muigui-controller>*:nth-child(1) {\n flex: 1 0 var(--label-width);\n min-width: 0;\n white-space: pre;\n }\n .muigui-controller>label:nth-child(1) {\n place-content: center start;\n display: inline-grid;\n overflow: hidden;\n }\n .muigui-controller>*:nth-child(2) {\n flex: 1 1 75%;\n min-width: 0;\n }\n `,\n },\n none: {\n include: [],\n css: '',\n },\n},\n};\n","export function setElemProps(elem, attrs, children) {\n for (const [key, value] of Object.entries(attrs)) {\n if (typeof value === 'function' && key.startsWith('on')) {\n const eventName = key.substring(2).toLowerCase();\n elem.addEventListener(eventName, value, {passive: false});\n } else if (typeof value === 'object') {\n for (const [k, v] of Object.entries(value)) {\n elem[key][k] = v;\n }\n } else if (elem[key] === undefined) {\n elem.setAttribute(key, value);\n } else {\n elem[key] = value;\n }\n }\n for (const child of children) {\n elem.appendChild(child);\n }\n return elem;\n}\n\nexport function createElem(tag, attrs = {}, children = []) {\n const elem = document.createElement(tag);\n setElemProps(elem, attrs, children);\n return elem;\n}\n\nexport function addElem(tag, parent, attrs = {}, children = []) {\n const elem = createElem(tag, attrs, children);\n parent.appendChild(elem);\n return elem;\n}\n\nlet nextId = 0;\nexport function getNewId() {\n return `muigui-id-${nextId++}`;\n}\n","export function removeArrayElem(array, value) {\n const ndx = array.indexOf(value);\n if (ndx) {\n array.splice(ndx, 1);\n }\n return array;\n}\n\n/**\n * Converts an camelCase or snake_case id to \"camel case\" or \"snake case\"\n * @param {string} id\n */\nconst underscoreRE = /_/g;\nconst upperLowerRE = /([A-Z])([a-z])/g;\nexport function idToLabel(id) {\n return id.replace(underscoreRE, ' ')\n .replace(upperLowerRE, (m, m1, m2) => `${m1.toLowerCase()} ${m2}`);\n}\n\nexport function clamp(v, min, max) {\n return Math.max(min, Math.min(max, v));\n}\n\nexport const isTypedArray = typeof SharedArrayBuffer !== 'undefined'\n ? function isArrayBufferOrSharedArrayBuffer(a) {\n return a && a.buffer && (a.buffer instanceof ArrayBuffer || a.buffer instanceof SharedArrayBuffer);\n }\n : function isArrayBuffer(a) {\n return a && a.buffer && a.buffer instanceof ArrayBuffer;\n };\n\nexport const isArrayOrTypedArray = v => Array.isArray(v) || isTypedArray(v);\n\n// Yea, I know this should be `Math.round(v / step) * step\n// but try step = 0.1, newV = 19.95\n//\n// I get\n// Math.round(19.95 / 0.1) * 0.1\n// 19.900000000000002\n// vs\n// Math.round(19.95 / 0.1) / (1 / 0.1)\n// 19.9\n//\nexport const stepify = (v, from, step) => Math.round(from(v) / step) / (1 / step);\n\nexport const euclideanModulo = (v, n) => ((v % n) + n) % n;\nexport const lerp = (a, b, t) => a + (b - a) * t;\nexport function copyExistingProperties(dst, src) {\n for (const key in src) {\n if (key in dst) {\n dst[key] = src[key];\n }\n }\n return dst;\n}\n\nexport const mapRange = (v, inMin, inMax, outMin, outMax) => (v - inMin) * (outMax - outMin) / (inMax - inMin) + outMin;\n\nexport const makeRangeConverters = ({from, to}) => {\n return {\n to: v => mapRange(v, ...from, ...to),\n from: v => [true, mapRange(v, ...to, ...from)],\n };\n};\n\nexport const makeRangeOptions = ({from, to, step}) => {\n return {\n min: to[0],\n max: to[1],\n ...(step && {step}),\n converters: makeRangeConverters({from, to}),\n };\n};\n\n// TODO: remove an use one in conversions. Move makeRangeConverters there?\nexport const identity = {\n to: v => v,\n from: v => [true, v],\n};\nexport function makeMinMaxPair(gui, properties, minPropName, maxPropName, options) {\n const { converters: { from } = identity } = options;\n const { min, max } = options;\n const guiMinRange = options.minRange || 0;\n const valueMinRange = from(guiMinRange)[1];\n const minGui = gui\n .add(properties, minPropName, {\n ...options,\n min,\n max: max - guiMinRange,\n })\n .onChange(v => {\n maxGui.setValue(Math.min(max, Math.max(v + valueMinRange, properties[maxPropName])));\n });\n const maxGui = gui\n .add(properties, maxPropName, {\n ...options,\n min: min + guiMinRange,\n max,\n })\n .onChange(v => {\n minGui.setValue(Math.max(min, Math.min(v - valueMinRange, properties[minPropName])));\n });\n return [ minGui, maxGui ];\n}\n\n","import { removeArrayElem } from '../libs/utils.js';\n\nexport default class View {\n domElement: HTMLElement;\n\n #childDestElem: HTMLElement;\n #views: View[] = [];\n\n constructor(elem: HTMLElement) {\n this.domElement = elem;\n this.#childDestElem = elem;\n }\n addElem(elem: HTMLElement) {\n this.#childDestElem.appendChild(elem);\n return elem;\n }\n removeElem(elem: HTMLElement) {\n this.#childDestElem.removeChild(elem);\n return elem;\n }\n pushSubElem(elem: HTMLElement) {\n this.#childDestElem.appendChild(elem);\n this.#childDestElem = elem;\n }\n popSubElem() {\n this.#childDestElem = this.#childDestElem.parentElement!;\n }\n add(view: View) {\n this.#views.push(view);\n this.addElem(view.domElement);\n return view;\n }\n remove(view: View) {\n this.removeElem(view.domElement);\n removeArrayElem(this.#views, view);\n return view;\n }\n pushSubView(view: View) {\n this.pushSubElem(view.domElement);\n }\n popSubView() {\n this.popSubElem();\n }\n setOptions(options: any) {\n for (const view of this.#views) {\n view.setOptions(options);\n }\n }\n updateDisplayIfNeeded(newV: any, ignoreCache?: boolean) {\n for (const view of this.#views) {\n view.updateDisplayIfNeeded(newV, ignoreCache);\n }\n return this;\n }\n $(selector: string) {\n return this.domElement.querySelector(selector);\n }\n}","import { createElem } from '../libs/elem.js';\nimport { removeArrayElem } from '../libs/utils.js';\nimport View from '../views/View.js';\n\nexport default class Controller extends View {\n #changeFns;\n #finishChangeFns;\n #parent;\n\n constructor(className) {\n super(createElem('div', {className: 'muigui-controller'}));\n this.#changeFns = [];\n this.#finishChangeFns = [];\n // we need the specialization to come last so it takes precedence.\n if (className) {\n this.domElement.classList.add(className);\n }\n }\n get parent() {\n return this.#parent;\n }\n setParent(parent) {\n this.#parent = parent;\n this.enable(!this.disabled());\n }\n show(show = true) {\n this.domElement.classList.toggle('muigui-hide', !show);\n this.domElement.classList.toggle('muigui-show', show);\n return this;\n }\n hide() {\n return this.show(false);\n }\n disabled() {\n return !!this.domElement.closest('.muigui-disabled');\n }\n\n enable(enable = true) {\n this.domElement.classList.toggle('muigui-disabled', !enable);\n\n // If disabled we need to set the attribute 'disabled=true' to all\n // input/select/button/textarea's below\n //\n // If enabled we need to set the attribute 'disabled=false' to all below\n // until we hit a disabled controller.\n //\n // ATM the problem is we can find the input/select/button/textarea elements\n // but we can't easily find which controller they belong do.\n // But we don't need to? We can just check up if it or parent has\n // '.muigui-disabled'\n ['input', 'button', 'select', 'textarea'].forEach(tag => {\n this.domElement.querySelectorAll(tag).forEach(elem => {\n const disabled = !!elem.closest('.muigui-disabled');\n elem.disabled = disabled;\n });\n });\n\n return this;\n }\n disable(disable = true) {\n return this.enable(!disable);\n }\n onChange(fn) {\n this.removeChange(fn);\n this.#changeFns.push(fn);\n return this;\n }\n removeChange(fn) {\n removeArrayElem(this.#changeFns, fn);\n return this;\n }\n onFinishChange(fn) {\n this.removeFinishChange(fn);\n this.#finishChangeFns.push(fn);\n return this;\n }\n removeFinishChange(fn) {\n removeArrayElem(this.#finishChangeFns, fn);\n return this;\n }\n #callListeners(fns, newV) {\n for (const fn of fns) {\n fn.call(this, newV);\n }\n }\n emitChange(value, object, property) {\n this.#callListeners(this.#changeFns, value);\n if (this.#parent) {\n if (object === undefined) {\n this.#parent.emitChange(value);\n } else {\n this.#parent.emitChange({\n object,\n property,\n value,\n controller: this,\n });\n }\n }\n }\n emitFinalChange(value, object, property) {\n this.#callListeners(this.#finishChangeFns, value);\n if (this.#parent) {\n if (object === undefined) {\n this.#parent.emitChange(value);\n } else {\n this.#parent.emitFinalChange({\n object,\n property,\n value,\n controller: this,\n });\n }\n }\n }\n updateDisplay() {\n // placeholder. override\n }\n getColors() {\n const toCamelCase = s => s.replace(/-([a-z])/g, (m, m1) => m1.toUpperCase());\n const keys = [\n 'color',\n 'bg-color',\n 'value-color',\n 'value-bg-color',\n 'hover-bg-color',\n 'menu-bg-color',\n 'menu-sep-color',\n 'disabled-color',\n ];\n const div = createElem('div');\n this.domElement.appendChild(div);\n const colors = Object.fromEntries(keys.map(key => {\n div.style.color = `var(--${key})`;\n const s = getComputedStyle(div);\n return [toCamelCase(key), s.color];\n }));\n div.remove();\n return colors;\n }\n}\n","import {\n createElem,\n} from '../libs/elem.js';\nimport { copyExistingProperties } from '../libs/utils.js';\nimport Controller from './Controller.js';\n\nexport default class Button extends Controller {\n #object;\n #property;\n #buttonElem;\n #options = {\n name: '',\n };\n\n constructor(object, property, options = {}) {\n super('muigui-button', '');\n this.#object = object;\n this.#property = property;\n\n this.#buttonElem = this.addElem(\n createElem('button', {\n type: 'button',\n onClick: () => {\n this.#object[this.#property](this);\n },\n }));\n this.setOptions({name: property, ...options});\n }\n name(name) {\n this.#buttonElem.textContent = name;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {name} = this.#options;\n this.#buttonElem.textContent = name;\n }\n}","import { isTypedArray } from '../libs/utils.js';\nimport View from './View.js';\n\nfunction arraysEqual(a, b) {\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; ++i) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n}\n\nfunction copyArrayElementsFromTo(src, dst) {\n dst.length = src.length;\n for (let i = 0; i < src.length; ++i) {\n dst[i] = src[i];\n }\n}\n\nexport default class EditView extends View {\n #oldV;\n #updateCheck;\n\n #checkArrayNeedsUpdate(newV) {\n // It's an array, we need to compare all elements\n // Example, vec2, [r,g,b], ...\n const needUpdate = !arraysEqual(newV, this.#oldV);\n if (needUpdate) {\n copyArrayElementsFromTo(newV, this.#oldV);\n }\n return needUpdate;\n }\n\n #checkTypedArrayNeedsUpdate() {\n let once = true;\n return function checkTypedArrayNeedsUpdateImpl(newV) {\n // It's a typedarray, we need to compare all elements\n // Example: Float32Array([r, g, b])\n let needUpdate = once;\n once = false;\n if (!needUpdate) {\n needUpdate = !arraysEqual(newV, this.#oldV);\n }\n return needUpdate;\n };\n }\n\n #checkObjectNeedsUpdate(newV) {\n let needUpdate = false;\n for (const key in newV) {\n if (newV[key] !== this.#oldV[key]) {\n needUpdate = true;\n this.#oldV[key] = newV[key];\n }\n }\n return needUpdate;\n }\n\n #checkValueNeedsUpdate(newV) {\n const needUpdate = newV !== this.#oldV;\n this.#oldV = newV;\n return needUpdate;\n }\n\n #getUpdateCheckForType(newV) {\n if (Array.isArray(newV)) {\n this.#oldV = [];\n return this.#checkArrayNeedsUpdate.bind(this);\n } else if (isTypedArray(newV)) {\n this.#oldV = new newV.constructor(newV);\n return this.#checkTypedArrayNeedsUpdate(this);\n } else if (typeof newV === 'object') {\n this.#oldV = {};\n return this.#checkObjectNeedsUpdate.bind(this);\n } else {\n return this.#checkValueNeedsUpdate.bind(this);\n }\n }\n\n // The point of this is updating DOM elements\n // is slow but if we've called `listen` then\n // every frame we're going to try to update\n // things with the current value so if nothing\n // has changed then skip it.\n updateDisplayIfNeeded(newV, ignoreCache) {\n this.#updateCheck = this.#updateCheck || this.#getUpdateCheckForType(newV);\n // Note: We call #updateCheck first because it updates\n // the cache\n if (this.#updateCheck(newV) || ignoreCache) {\n this.updateDisplay(newV);\n }\n }\n setOptions(/*options*/) {\n // override this\n return this;\n }\n}\n","import { createElem } from '../libs/elem.js';\nimport EditView from './EditView.js';\n\nexport default class CheckboxView extends EditView {\n #checkboxElem;\n constructor(setter, id) {\n const checkboxElem = createElem('input', {\n type: 'checkbox',\n id,\n onInput: () => {\n setter.setValue(checkboxElem.checked);\n },\n onChange: () => {\n setter.setFinalValue(checkboxElem.checked);\n },\n });\n super(createElem('label', {}, [checkboxElem]));\n this.#checkboxElem = checkboxElem;\n }\n updateDisplay(v) {\n this.#checkboxElem.checked = v;\n }\n}\n","import { removeArrayElem } from './utils.js';\n\nconst tasks = [];\nconst tasksToRemove = new Set();\n\nlet requestId;\nlet processing;\n\nfunction removeTasks() {\n if (!tasksToRemove.size) {\n return;\n }\n\n if (processing) {\n queueProcessing();\n return;\n }\n\n tasksToRemove.forEach(task => {\n removeArrayElem(tasks, task);\n });\n tasksToRemove.clear();\n}\n\nfunction processTasks() {\n requestId = undefined;\n processing = true;\n for (const task of tasks) {\n if (!tasksToRemove.has(task)) {\n task();\n }\n }\n processing = false;\n removeTasks();\n queueProcessing();\n}\n\nfunction queueProcessing() {\n if (!requestId && tasks.length) {\n requestId = requestAnimationFrame(processTasks);\n }\n}\n\nexport function addTask(fn) {\n tasks.push(fn);\n queueProcessing();\n}\n\nexport function removeTask(fn) {\n tasksToRemove.set(fn);\n\n const ndx = tasks.indexOf(fn);\n if (ndx >= 0) {\n tasks.splice(ndx, 1);\n }\n}","let id = 0;\n\nexport function makeId() {\n return `muigui-${++id}`;\n}\n","import { createElem } from '../libs/elem.js';\nimport View from './View.js';\n\nexport default class ValueView extends View {\n constructor(className = '') {\n super(createElem('div', {className: 'muigui-value'}));\n if (className) {\n this.domElement.classList.add(className);\n }\n }\n}","import { createElem } from '../libs/elem.js';\nimport { makeId } from '../libs/ids.js';\nimport ValueView from '../views/ValueView.js';\nimport Controller from './Controller.js';\n\nexport default class LabelController extends Controller {\n #id;\n #nameElem;\n\n constructor(className = '', name = '') {\n super('muigui-label-controller');\n this.#id = makeId();\n this.#nameElem = createElem('label', {for: this.#id});\n this.domElement.appendChild(this.#nameElem);\n this.pushSubView(new ValueView(className));\n this.name(name);\n }\n get id() {\n return this.#id;\n }\n name(name) {\n if (this.#nameElem.title === this.#nameElem.textContent) {\n this.#nameElem.title = name;\n }\n this.#nameElem.textContent = name;\n return this;\n }\n tooltip(tip) {\n this.#nameElem.title = tip;\n }\n}\n\n","import {addTask, removeTask} from '../libs/taskrunner.js';\nimport { isTypedArray } from '../libs/utils.js';\nimport LabelController from './LabelController.js';\n\nexport default class ValueController extends LabelController {\n #object;\n #property;\n #initialValue;\n #listening;\n #views;\n #updateFn;\n\n constructor(object, property, className = '') {\n super(className, property);\n this.#object = object;\n this.#property = property;\n this.#initialValue = this.getValue();\n this.#listening = false;\n this.#views = [];\n }\n get initialValue() {\n return this.#initialValue;\n }\n get object() {\n return this.#object;\n }\n get property() {\n return this.#property;\n }\n add(view) {\n this.#views.push(view);\n super.add(view);\n this.updateDisplay();\n return view;\n }\n #setValueImpl(v, ignoreCache) {\n let isDifferent = false;\n if (typeof v === 'object') {\n const dst = this.#object[this.#property];\n // don't replace objects, just their values.\n if (Array.isArray(v) || isTypedArray(v)) {\n for (let i = 0; i < v.length; ++i) {\n isDifferent ||= dst[i] !== v[i];\n dst[i] = v[i];\n }\n } else {\n for (const key of Object.keys(v)) {\n isDifferent ||= dst[key] !== v[key];\n }\n Object.assign(dst, v);\n }\n } else {\n isDifferent = this.#object[this.#property] !== v;\n this.#object[this.#property] = v;\n }\n this.updateDisplay(ignoreCache);\n if (isDifferent) {\n this.emitChange(this.getValue(), this.#object, this.#property);\n }\n return isDifferent;\n }\n setValue(v) {\n this.#setValueImpl(v);\n }\n setFinalValue(v) {\n const isDifferent = this.#setValueImpl(v, true);\n if (isDifferent) {\n this.emitFinalChange(this.getValue(), this.#object, this.#property);\n }\n return this;\n }\n updateDisplay(ignoreCache) {\n const newV = this.getValue();\n for (const view of this.#views) {\n view.updateDisplayIfNeeded(newV, ignoreCache);\n }\n return this;\n }\n setOptions(options) {\n for (const view of this.#views) {\n view.setOptions(options);\n }\n this.updateDisplay();\n return this;\n }\n getValue() {\n return this.#object[this.#property];\n }\n value(v) {\n this.setValue(v);\n return this;\n }\n reset() {\n this.setValue(this.#initialValue);\n return this;\n }\n listen(listen = true) {\n if (!this.#updateFn) {\n this.#updateFn = this.updateDisplay.bind(this);\n }\n if (listen) {\n if (!this.#listening) {\n this.#listening = true;\n addTask(this.#updateFn);\n }\n } else {\n if (this.#listening) {\n this.#listening = false;\n removeTask(this.#updateFn);\n }\n }\n return this;\n }\n}\n\n","import CheckboxView from '../views/CheckboxView.js';\nimport ValueController from './ValueController.js';\n\nexport default class Checkbox extends ValueController {\n constructor(object, property) {\n super(object, property, 'muigui-checkbox');\n const id = this.id;\n this.add(new CheckboxView(this, id));\n this.updateDisplay();\n }\n}","import {\n makeRangeConverters,\n} from './utils.js';\n\nexport const identity = {\n to: v => v,\n from: v => [true, v],\n};\n\n// from: from string to value\n// to: from value to string\nexport const strToNumber = {\n to: v => v.toString(),\n from: v => {\n const newV = parseFloat(v);\n return [!Number.isNaN(newV), newV];\n },\n};\n\nexport const converters = {\n radToDeg: makeRangeConverters({to: [0, 180], from: [0, Math.PI]}),\n};\n","export function createWheelHelper() {\n let wheelAccum = 0;\n return function (e, step, wheelScale = 5) {\n wheelAccum -= e.deltaY * step / wheelScale;\n const wheelSteps = Math.floor(Math.abs(wheelAccum) / step) * Math.sign(wheelAccum);\n const delta = wheelSteps * step;\n wheelAccum -= delta;\n return delta;\n };\n}\n","import { createElem } from '../libs/elem.js';\nimport { strToNumber } from '../libs/conversions.js';\nimport { createWheelHelper } from '../libs/wheel.js';\nimport { clamp, copyExistingProperties, stepify } from '../libs/utils.js';\nimport EditView from './EditView.js';\n\nexport default class NumberView extends EditView {\n #to;\n #from;\n #step;\n #skipUpdate;\n #options = {\n step: 0.01,\n converters: strToNumber,\n min: Number.NEGATIVE_INFINITY,\n max: Number.POSITIVE_INFINITY,\n };\n\n constructor(setter, options) {\n const setValue = setter.setValue.bind(setter);\n const setFinalValue = setter.setFinalValue.bind(setter);\n const wheelHelper = createWheelHelper();\n super(createElem('input', {\n type: 'number',\n onInput: () => {\n this.#handleInput(setValue, true);\n },\n onChange: () => {\n this.#handleInput(setFinalValue, false);\n },\n onWheel: e => {\n e.preventDefault();\n const {min, max, step} = this.#options;\n const delta = wheelHelper(e, step);\n const v = parseFloat(this.domElement.value);\n const newV = clamp(stepify(v + delta, v => v, step), min, max);\n const [valid, outV] = this.#from(newV);\n if (valid) {\n setter.setValue(outV);\n }\n },\n }));\n this.setOptions(options);\n }\n #handleInput(setFn, skipUpdate) {\n const v = parseFloat(this.domElement.value);\n const [valid, newV] = this.#from(v);\n let inRange;\n if (valid && !Number.isNaN(v)) {\n const {min, max} = this.#options;\n inRange = newV >= min && newV <= max;\n this.#skipUpdate = skipUpdate;\n setFn(clamp(newV, min, max));\n }\n this.domElement.classList.toggle('muigui-invalid-value', !valid || !inRange);\n }\n updateDisplay(v) {\n if (!this.#skipUpdate) {\n this.domElement.value = stepify(v, this.#to, this.#step);\n }\n this.#skipUpdate = false;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {\n step,\n converters: {to, from},\n } = this.#options;\n this.#to = to;\n this.#from = from;\n this.#step = step;\n return this;\n }\n}\n","\nimport NumberView from '../views/NumberView.js';\nimport ValueController from './ValueController.js';\n\n// Wanted to name this `Number` but it conflicts with\n// JavaScript `Number`. It most likely wouldn't be\n// an issue? But users might `import {Number} ...` and\n// things would break.\nexport default class TextNumber extends ValueController {\n #textView;\n #step;\n\n constructor(object, property, options = {}) {\n super(object, property, 'muigui-text-number');\n this.#textView = this.add(new NumberView(this, options));\n this.updateDisplay();\n }\n}","import { createElem } from '../libs/elem.js';\nimport EditView from './EditView.js';\n\nexport default class SelectView extends EditView {\n #values;\n\n constructor(setter, keyValues) {\n const values = [];\n super(createElem('select', {\n onChange: () => {\n setter.setFinalValue(this.#values[this.domElement.selectedIndex]);\n },\n }, keyValues.map(([key, value]) => {\n values.push(value);\n return createElem('option', {textContent: key});\n })));\n this.#values = values;\n }\n updateDisplay(v) {\n const ndx = this.#values.indexOf(v);\n this.domElement.selectedIndex = ndx;\n }\n}\n","\n// 4 cases\n// (a) keyValues is array of arrays, each sub array is key value\n// (b) keyValues is array and value is number then keys = array contents, value = index\n// (c) keyValues is array and value is not number, key = array contents, value = array contents\n// (d) keyValues is object then key->value\nexport function convertToKeyValues(keyValues, valueIsNumber) {\n if (Array.isArray(keyValues)) {\n if (Array.isArray(keyValues[0])) {\n // (a) keyValues is array of arrays, each sub array is key value\n return keyValues;\n } else {\n if (valueIsNumber) {\n // (b) keyValues is array and value is number then keys = array contents, value = index\n return keyValues.map((v, ndx) => [v, ndx]);\n } else {\n // (c) keyValues is array and value is not number, key = array contents, value = array contents\n return keyValues.map(v => [v, v]);\n }\n }\n } else {\n // (d)\n return [...Object.entries(keyValues)];\n }\n}\n","import SelectView from '../views/SelectView.js';\nimport ValueController from './ValueController.js';\nimport { convertToKeyValues } from '../libs/key-values.js';\n\nexport default class Select extends ValueController {\n constructor(object, property, options) {\n super(object, property, 'muigui-select');\n const valueIsNumber = typeof this.getValue() === 'number';\n const {keyValues: keyValuesInput} = options;\n const keyValues = convertToKeyValues(keyValuesInput, valueIsNumber);\n this.add(new SelectView(this, keyValues));\n this.updateDisplay();\n }\n}","import { createElem } from '../libs/elem.js';\nimport { identity } from '../libs/conversions.js';\nimport { clamp, copyExistingProperties, stepify } from '../libs/utils.js';\nimport { createWheelHelper } from '../libs/wheel.js';\nimport EditView from './EditView.js';\n\nexport default class RangeView extends EditView {\n #to;\n #from;\n #step;\n #skipUpdate;\n #options = {\n step: 0.01,\n min: 0,\n max: 1,\n converters: identity,\n };\n\n constructor(setter, options) {\n const wheelHelper = createWheelHelper();\n super(createElem('input', {\n type: 'range',\n onInput: () => {\n this.#skipUpdate = true;\n const {min, max, step} = this.#options;\n const v = parseFloat(this.domElement.value);\n const newV = clamp(stepify(v, v => v, step), min, max);\n const [valid, validV] = this.#from(newV);\n if (valid) {\n setter.setValue(validV);\n }\n },\n onChange: () => {\n this.#skipUpdate = true;\n const {min, max, step} = this.#options;\n const v = parseFloat(this.domElement.value);\n const newV = clamp(stepify(v, v => v, step), min, max);\n const [valid, validV] = this.#from(newV);\n if (valid) {\n setter.setFinalValue(validV);\n }\n },\n onWheel: e => {\n e.preventDefault();\n const [valid, v] = this.#from(parseFloat(this.domElement.value));\n if (!valid) {\n return;\n }\n const {min, max, step} = this.#options;\n const delta = wheelHelper(e, step);\n const newV = clamp(stepify(v + delta, v => v, step), min, max);\n setter.setValue(newV);\n },\n }));\n this.setOptions(options);\n }\n updateDisplay(v) {\n if (!this.#skipUpdate) {\n this.domElement.value = stepify(v, this.#to, this.#step);\n }\n this.#skipUpdate = false;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {\n step,\n min,\n max,\n converters: {to, from},\n } = this.#options;\n this.#to = to;\n this.#from = from;\n this.#step = step;\n this.domElement.step = step;\n this.domElement.min = min;\n this.domElement.max = max;\n return this;\n }\n}","import ValueController from './ValueController.js';\nimport NumberView from '../views/NumberView.js';\nimport RangeView from '../views/RangeView.js';\n\nexport default class Range extends ValueController {\n constructor(object, property, options) {\n super(object, property, 'muigui-range');\n this.add(new RangeView(this, options));\n this.add(new NumberView(this, options));\n }\n}\n","import { createElem } from '../libs/elem.js';\nimport { identity } from '../libs/conversions.js';\nimport EditView from './EditView.js';\nimport { copyExistingProperties } from '../libs/utils.js';\n\nexport default class TextView extends EditView {\n #to;\n #from;\n #skipUpdate;\n #options = {\n converters: identity,\n };\n\n constructor(setter, options) {\n const setValue = setter.setValue.bind(setter);\n const setFinalValue = setter.setFinalValue.bind(setter);\n super(createElem('input', {\n type: 'text',\n onInput: () => {\n this.#handleInput(setValue, true);\n },\n onChange: () => {\n this.#handleInput(setFinalValue, false);\n },\n }));\n this.setOptions(options);\n }\n #handleInput(setFn, skipUpdate) {\n const [valid, newV] = this.#from(this.domElement.value);\n if (valid) {\n this.#skipUpdate = skipUpdate;\n setFn(newV);\n }\n this.domElement.style.color = valid ? '' : 'var(--invalid-color)';\n\n }\n updateDisplay(v) {\n if (!this.#skipUpdate) {\n this.domElement.value = this.#to(v);\n this.domElement.style.color = '';\n }\n this.#skipUpdate = false;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {\n converters: {to, from},\n } = this.#options;\n this.#to = to;\n this.#from = from;\n return this;\n }\n}\n","import TextView from '../views/TextView.js';\nimport ValueController from './ValueController.js';\n\nexport default class Text extends ValueController {\n constructor(object, property) {\n super(object, property, 'muigui-text');\n this.add(new TextView(this));\n this.updateDisplay();\n }\n}","const clamp = (v, min, max) => Math.max(min, Math.min(max, v));\nconst lerp = (a, b, t) => a + (b - a) * t;\nconst fract = v => v >= 0 ? v % 1 : 1 - (v % 1);\n\nconst f0 = v => +v.toFixed(0); // converts to string (eg 1.2 => \"1\"), then converts back to number (eg, \"1.200\" => 1.2)\nconst f3 = v => +v.toFixed(3); // converts to string (eg 1.2 => \"1.200\"), then converts back to number (eg, \"1.200\" => 1.2)\n\nconst hexToUint32RGB = v => (parseInt(v.substring(1, 3), 16) << 16) |\n (parseInt(v.substring(3, 5), 16) << 8 ) |\n (parseInt(v.substring(5, 7), 16) );\nconst uint32RGBToHex = v => `#${(Math.round(v)).toString(16).padStart(6, '0')}`;\nconst hexToUint32RGBA = v => (parseInt(v.substring(1, 3), 16) * 2 ** 24) +\n (parseInt(v.substring(3, 5), 16) * 2 ** 16) +\n (parseInt(v.substring(5, 7), 16) * 2 ** 8) +\n (parseInt(v.substring(7, 9), 16) );\nconst uint32RGBAToHex = v => `#${(Math.round(v)).toString(16).padStart(8, '0')}`;\n\nexport const hexToUint8RGB = v => [\n parseInt(v.substring(1, 3), 16),\n parseInt(v.substring(3, 5), 16),\n parseInt(v.substring(5, 7), 16),\n];\nexport const uint8RGBToHex = v => `#${Array.from(v).map(v => v.toString(16).padStart(2, '0')).join('')}`;\n\nexport const hexToUint8RGBA = v => [\n parseInt(v.substring(1, 3), 16),\n parseInt(v.substring(3, 5), 16),\n parseInt(v.substring(5, 7), 16),\n parseInt(v.substring(7, 9), 16),\n];\nexport const uint8RGBAToHex = v => `#${Array.from(v).map(v => v.toString(16).padStart(2, '0')).join('')}`;\n\nexport const hexToFloatRGB = v => hexToUint8RGB(v).map(v => f3(v / 255));\nexport const floatRGBToHex = v => uint8RGBToHex(Array.from(v).map(v => Math.round(clamp(v * 255, 0, 255))));\n\nexport const hexToFloatRGBA = v => hexToUint8RGBA(v).map(v => f3(v / 255));\nexport const floatRGBAToHex = v => uint8RGBAToHex(Array.from(v).map(v => Math.round(clamp(v * 255, 0, 255))));\n\nconst scaleAndClamp = v => clamp(Math.round(v * 255), 0, 255).toString(16).padStart(2, '0');\n\nconst hexToObjectRGB = v => ({\n r: parseInt(v.substring(1, 3), 16) / 255,\n g: parseInt(v.substring(3, 5), 16) / 255,\n b: parseInt(v.substring(5, 7), 16) / 255,\n});\nconst objectRGBToHex = v => `#${scaleAndClamp(v.r)}${scaleAndClamp(v.g)}${scaleAndClamp(v.b)}`;\nconst hexToObjectRGBA = v => ({\n r: parseInt(v.substring(1, 3), 16) / 255,\n g: parseInt(v.substring(3, 5), 16) / 255,\n b: parseInt(v.substring(5, 7), 16) / 255,\n a: parseInt(v.substring(7, 9), 16) / 255,\n});\nconst objectRGBAToHex = v => `#${scaleAndClamp(v.r)}${scaleAndClamp(v.g)}${scaleAndClamp(v.b)}${scaleAndClamp(v.a)}`;\n\nconst hexToCssRGB = v => `rgb(${hexToUint8RGB(v).join(', ')})`;\nconst cssRGBRegex = /^\\s*rgb\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*\\)\\s*$/;\nconst cssRGBToHex = v => {\n const m = cssRGBRegex.exec(v);\n return uint8RGBToHex([m[1], m[2], m[3]].map(v => parseInt(v)));\n};\nconst hexToCssRGBA = v => `rgba(${hexToUint8RGBA(v).map((v, i) => i === 3 ? v / 255 : v).join(', ')})`;\nconst cssRGBARegex = /^\\s*rgba\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+\\.\\d+|\\d+)\\s*\\)\\s*$/;\nconst cssRGBAToHex = v => {\n const m = cssRGBARegex.exec(v);\n return uint8RGBAToHex([m[1], m[2], m[3], m[4]].map((v, i) => i === 3 ? (parseFloat(v) * 255 | 0) : parseInt(v)));\n};\n\nconst hexToCssHSL = v => {\n const hsl = rgbUint8ToHsl(hexToUint8RGB(v)).map(v => f0(v));\n return `hsl(${hsl[0]}, ${hsl[1]}%, ${hsl[2]}%)`;\n};\nconst hexToCssHSLA = v => {\n const hsla = rgbaUint8ToHsla(hexToUint8RGBA(v)).map((v, i) => i === 3 ? f3(v) : f0(v));\n return `hsl(${hsla[0]} ${hsla[1]}% ${hsla[2]}% / ${hsla[3]})`;\n};\nconst cssHSLRegex = /^\\s*hsl\\(\\s*(\\d+)(?:deg|)\\s*(?:,|)\\s*(\\d+)%\\s*(?:,|)\\s*(\\d+)%\\s*\\)\\s*$/;\nconst cssHSLARegex = /^\\s*hsl\\(\\s*(\\d+)(?:deg|)\\s*(?:,|)\\s*(\\d+)%\\s*(?:,|)\\s*(\\d+)%\\s*\\/\\s*(\\d+\\.\\d+|\\d+)\\s*\\)\\s*$/;\n\nconst hex3DigitTo6Digit = v => `${v[0]}${v[0]}${v[1]}${v[1]}${v[2]}${v[2]}`;\nconst cssHSLToHex = v => {\n const m = cssHSLRegex.exec(v);\n const rgb = hslToRgbUint8([m[1], m[2], m[3]].map(v => parseFloat(v)));\n return uint8RGBToHex(rgb);\n};\nconst cssHSLAToHex = v => {\n const m = cssHSLARegex.exec(v);\n const rgba = hslaToRgbaUint8([m[1], m[2], m[3], m[4]].map(v => parseFloat(v)));\n return uint8RGBAToHex(rgba);\n};\n\nconst euclideanModulo = (v, n) => ((v % n) + n) % n;\n\nexport function hslToRgbUint8([h, s, l]) {\n h = euclideanModulo(h, 360);\n s = clamp(s / 100, 0, 1);\n l = clamp(l / 100, 0, 1);\n\n const a = s * Math.min(l, 1 - l);\n\n function f(n) {\n const k = (n + h / 30) % 12;\n return l - a * Math.max(-1, Math.min(k - 3, 9 - k, 1));\n }\n\n return [f(0), f(8), f(4)].map(v => Math.round(v * 255));\n}\n\nexport function hslaToRgbaUint8([h, s, l, a]) {\n const rgb = hslToRgbUint8([h, s, l]);\n return [...rgb, a * 255 | 0];\n}\n\nexport function rgbFloatToHsl01([r, g, b]) {\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const l = (min + max) * 0.5;\n const d = max - min;\n let h = 0;\n let s = 0;\n\n if (d !== 0) {\n s = (l === 0 || l === 1)\n ? 0\n : (max - l) / Math.min(l, 1 - l);\n\n switch (max) {\n case r: h = (g - b) / d + (g < b ? 6 : 0); break;\n case g: h = (b - r) / d + 2; break;\n case b: h = (r - g) / d + 4;\n }\n }\n\n return [h / 6, s, l];\n}\n\nexport function rgbaFloatToHsla01([r, g, b, a]) {\n const hsl = rgbFloatToHsl01([r, g, b]);\n return [...hsl, a];\n}\n\nexport const rgbUint8ToHsl = (rgb) => {\n const [h, s, l] = rgbFloatToHsl01(rgb.map(v => v / 255));\n return [h * 360, s * 100, l * 100];\n};\n\nexport const rgbaUint8ToHsla = (rgba) => {\n const [h, s, l, a] = rgbaFloatToHsla01(rgba.map(v => v / 255));\n return [h * 360, s * 100, l * 100, a];\n};\n\nexport function hsv01ToRGBFloat([hue, sat, val]) {\n sat = clamp(sat, 0, 1);\n val = clamp(val, 0, 1);\n return [hue, hue + 2 / 3, hue + 1 / 3].map(\n v => lerp(1, clamp(Math.abs(fract(v) * 6 - 3.0) - 1, 0, 1), sat) * val\n );\n}\n\nexport function hsva01ToRGBAFloat([hue, sat, val, alpha]) {\n const rgb = hsv01ToRGBFloat([hue, sat, val]);\n return [...rgb, alpha];\n}\n\nconst round3 = v => Math.round(v * 1000) / 1000;\n\nexport function rgbFloatToHSV01([r, g, b]) {\n const p = b > g\n ? [b, g, -1, 2 / 3]\n : [g, b, 0, -1 / 3];\n const q = p[0] > r\n ? [p[0], p[1], p[3], r]\n : [r, p[1], p[2], p[0]];\n const d = q[0] - Math.min(q[3], q[1]);\n return [\n Math.abs(q[2] + (q[3] - q[1]) / (6 * d + Number.EPSILON)),\n d / (q[0] + Number.EPSILON),\n q[0],\n ].map(round3);\n}\n\nexport function rgbaFloatToHSVA01([r, g, b, a]) {\n const hsv = rgbFloatToHSV01([r, g, b]);\n return [...hsv, a];\n}\n\n// window.hsv01ToRGBFloat = hsv01ToRGBFloat;\n// window.rgbFloatToHSV01 = rgbFloatToHSV01;\n\n// Yea, meh!\nexport const hasAlpha = format => format.endsWith('a') || format.startsWith('hex8');\n\nconst cssStringFormats = [\n { re: /^#(?:[0-9a-f]){6}$/i, format: 'hex6' },\n { re: /^(?:[0-9a-f]){6}$/i, format: 'hex6-no-hash' },\n { re: /^#(?:[0-9a-f]){8}$/i, format: 'hex8' },\n { re: /^(?:[0-9a-f]){8}$/i, format: 'hex8-no-hash' },\n { re: /^#(?:[0-9a-f]){3}$/i, format: 'hex3' },\n { re: /^(?:[0-9a-f]){3}$/i, format: 'hex3-no-hash' },\n { re: cssRGBRegex, format: 'css-rgb' },\n { re: cssHSLRegex, format: 'css-hsl' },\n { re: cssRGBARegex, format: 'css-rgba' },\n { re: cssHSLARegex, format: 'css-hsla' },\n];\n\nfunction guessStringColorFormat(v) {\n for (const formatInfo of cssStringFormats) {\n if (formatInfo.re.test(v)) {\n return formatInfo;\n }\n }\n return undefined;\n}\n\nexport function guessFormat(v) {\n switch (typeof v) {\n case 'number':\n console.warn('can not reliably guess format based on a number. You should pass in a format like {format: \"uint32-rgb\"} or {format: \"uint32-rgb\"}');\n return v <= 0xFFFFFF ? 'uint32-rgb' : 'uint32-rgba';\n case 'string': {\n const formatInfo = guessStringColorFormat(v.trim());\n if (formatInfo) {\n return formatInfo.format;\n }\n break;\n }\n case 'object':\n if (v instanceof Uint8Array || v instanceof Uint8ClampedArray) {\n if (v.length === 3) {\n return 'uint8-rgb';\n } else if (v.length === 4) {\n return 'uint8-rgba';\n }\n } else if (v instanceof Float32Array) {\n if (v.length === 3) {\n return 'float-rgb';\n } else if (v.length === 4) {\n return 'float-rgba';\n }\n } else if (Array.isArray(v)) {\n if (v.length === 3) {\n return 'float-rgb';\n } else if (v.length === 4) {\n return 'float-rgba';\n }\n } else {\n if ('r' in v && 'g' in v && 'b' in v) {\n if ('a' in v) {\n return 'object-rgba';\n } else {\n return 'object-rgb';\n }\n }\n }\n }\n throw new Error(`unknown color format: ${v}`);\n}\n\nfunction fixHex6(v) {\n return v.trim(v);\n //const formatInfo = guessStringColorFormat(v.trim());\n //const fix = formatInfo ? formatInfo.fix : v => v;\n //return fix(v.trim());\n}\n\nfunction fixHex8(v) {\n return v.trim(v);\n //const formatInfo = guessStringColorFormat(v.trim());\n //const fix = formatInfo ? formatInfo.fix : v => v;\n //return fix(v.trim());\n}\n\nfunction hex6ToHex3(hex6) {\n return (hex6[1] === hex6[2] &&\n hex6[3] === hex6[4] &&\n hex6[5] === hex6[6])\n ? `#${hex6[1]}${hex6[3]}${hex6[5]}`\n : hex6;\n}\n\nconst hex3RE = /^(#|)([0-9a-f]{3})$/i;\nfunction hex3ToHex6(hex3) {\n const m = hex3RE.exec(hex3);\n if (m) {\n const [, , m2] = m;\n return `#${hex3DigitTo6Digit(m2)}`;\n }\n return hex3;\n}\n\nfunction fixHex3(v) {\n return hex6ToHex3(fixHex6(v));\n}\n\nconst strToRGBObject = (s) => {\n try {\n const json = s.replace(/([a-z])/g, '\"$1\"');\n const rgb = JSON.parse(json);\n if (Number.isNaN(rgb.r) || Number.isNaN(rgb.g) || Number.isNaN(rgb.b)) {\n throw new Error('not {r, g, b}');\n }\n return [true, rgb];\n } catch (e) {\n return [false];\n }\n};\n\nconst strToRGBAObject = (s) => {\n try {\n const json = s.replace(/([a-z])/g, '\"$1\"');\n const rgba = JSON.parse(json);\n if (Number.isNaN(rgba.r) || Number.isNaN(rgba.g) || Number.isNaN(rgba.b) || Number.isNaN(rgba.a)) {\n throw new Error('not {r, g, b, a}');\n }\n return [true, rgba];\n } catch (e) {\n return [false];\n }\n};\n\nconst strToCssRGB = s => {\n const m = cssRGBRegex.exec(s);\n if (!m) {\n return [false];\n }\n const v = [m[1], m[2], m[3]].map(v => parseInt(v));\n const outOfRange = v.find(v => v > 255);\n return [!outOfRange, `rgb(${v.join(', ')})`];\n};\n\nconst strToCssRGBA = s => {\n const m = cssRGBARegex.exec(s);\n if (!m) {\n return [false];\n }\n const v = [m[1], m[2], m[3], m[4]].map((v, i) => i === 3 ? parseFloat(v) : parseInt(v));\n const outOfRange = v.find(v => v > 255);\n return [!outOfRange, `rgba(${v.join(', ')})`];\n};\n\nconst strToCssHSL = s => {\n const m = cssHSLRegex.exec(s);\n if (!m) {\n return [false];\n }\n const v = [m[1], m[2], m[3]].map(v => parseFloat(v));\n const outOfRange = v.find(v => Number.isNaN(v));\n return [!outOfRange, `hsl(${v[0]}, ${v[1]}%, ${v[2]}%)`];\n};\n\nconst strToCssHSLA = s => {\n const m = cssHSLARegex.exec(s);\n if (!m) {\n return [false];\n }\n const v = [m[1], m[2], m[3], m[4]].map(v => parseFloat(v));\n const outOfRange = v.find(v => Number.isNaN(v));\n return [!outOfRange, `hsl(${v[0]} ${v[1]}% ${v[2]}% / ${v[3]})`];\n};\n\nconst rgbObjectToStr = rgb => {\n return `{r:${f3(rgb.r)}, g:${f3(rgb.g)}, b:${f3(rgb.b)}}`;\n};\nconst rgbaObjectToStr = rgba => {\n return `{r:${f3(rgba.r)}, g:${f3(rgba.g)}, b:${f3(rgba.b)}}, a:${f3(rgba.a)}}`;\n};\n\nconst strTo3IntsRE = /^\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*$/;\nconst strTo3Ints = s => {\n const m = strTo3IntsRE.exec(s);\n if (!m) {\n return [false];\n }\n const v = [m[1], m[2], m[3]].map(v => parseInt(v));\n const outOfRange = v.find(v => v > 255);\n return [!outOfRange, v];\n};\n\nconst strTo4IntsRE = /^\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*$/;\nconst strTo4Ints = s => {\n const m = strTo4IntsRE.exec(s);\n if (!m) {\n return [false];\n }\n const v = [m[1], m[2], m[3], m[4]].map(v => parseInt(v));\n const outOfRange = v.find(v => v > 255);\n return [!outOfRange, v];\n};\n\nconst strTo3Floats = s => {\n const numbers = s.split(',').map(s => s.trim());\n const v = numbers.map(v => parseFloat(v));\n if (v.length !== 3) {\n return [false];\n }\n // Note: using isNaN not Number.isNaN\n const badNdx = numbers.findIndex(v => isNaN(v));\n return [badNdx < 0, v.map(v => f3(v))];\n};\n\nconst strTo4Floats = s => {\n const numbers = s.split(',').map(s => s.trim());\n const v = numbers.map(v => parseFloat(v));\n if (v.length !== 4) {\n return [false];\n }\n // Note: using isNaN not Number.isNaN\n const badNdx = numbers.findIndex(v => isNaN(v));\n return [badNdx < 0, v.map(v => f3(v))];\n};\n\nconst strToUint32RGBRegex = /^\\s*(?:0x){0,1}([0-9a-z]{1,6})\\s*$/i;\nconst strToUint32RGB = s => {\n const m = strToUint32RGBRegex.exec(s);\n if (!m) {\n return [false];\n }\n return [true, parseInt(m[1], 16)];\n};\n\nconst strToUint32RGBARegex = /^\\s*(?:0x){0,1}([0-9a-z]{1,8})\\s*$/i;\nconst strToUint32RGBA = s => {\n const m = strToUint32RGBARegex.exec(s);\n if (!m) {\n return [false];\n }\n return [true, parseInt(m[1], 16)];\n};\n\nconst hex6RE = /^\\s*#[a-f0-9]{6}\\s*$|^\\s*#[a-f0-9]{3}\\s*$/i;\nconst hexNoHash6RE = /^\\s*[a-f0-9]{6}\\s*$/i;\nconst hex8RE = /^\\s*#[a-f0-9]{8}\\s*$/i;\nconst hexNoHash8RE = /^\\s*[a-f0-9]{8}\\s*$/i;\n\n// For each format converter\n//\n// fromHex/toHex convert from/to '#RRGGBB'\n//\n// fromHex converts from the string '#RRBBGG' to the format\n// (eg: for uint32-rgb, '#123456' becomes 0x123456)\n//\n// toHex converts from the format to '#RRGGBB'\n// (eg: for uint8-rgb, [16, 33, 50] becomes '#102132')\n//\n//\n// fromStr/toStr convert from/to what's in the input[type=text] element\n//\n// toStr converts from the format to its string representation\n// (eg, for object-rgb, {r: 1, g: 0.5, b:0} becomes \"{r: 1, g: 0.5, b:0}\")\n// ^object ^string\n//\n// fromStr converts its string representation to its format\n// (eg, for object-rgb) \"{r: 1, g: 0.5, b:0}\" becomes {r: 1, g: 0.5, b:0})\n// ^string ^object\n// fromString returns an array which is [valid, v]\n// where valid is true if the string was a valid and v is the converted\n// format if v is true.\n//\n// Note: toStr should convert to \"ideal\" form (whatever that is).\n// (eg, for css-rgb\n// \"{ r: 0.10000, g: 001, b: 0}\" becomes \"{r: 0.1, g: 1, b: 0}\"\n// notice that css-rgb is a string to a string\n// )\nexport const colorFormatConverters = {\n 'hex6': {\n color: {\n from: v => [true, v],\n to: fixHex6,\n },\n text: {\n from: v => [hex6RE.test(v), v.trim()],\n to: v => v,\n },\n },\n 'hex8': {\n color: {\n from: v => [true, v],\n to: fixHex8,\n },\n text: {\n from: v => [hex8RE.test(v), v.trim()],\n to: v => v,\n },\n },\n 'hex3': {\n color: {\n from: v => [true, fixHex3(v)],\n to: hex3ToHex6,\n },\n text: {\n from: v => [hex6RE.test(v), hex6ToHex3(v.trim())],\n to: v => v,\n },\n },\n 'hex6-no-hash': {\n color: {\n from: v => [true, v.substring(1)],\n to: v => `#${fixHex6(v)}`,\n },\n text: {\n from: v => [hexNoHash6RE.test(v), v.trim()],\n to: v => v,\n },\n },\n 'hex8-no-hash': {\n color: {\n from: v => [true, v.substring(1)],\n to: v => `#${fixHex8(v)}`,\n },\n text: {\n from: v => [hexNoHash8RE.test(v), v.trim()],\n to: v => v,\n },\n },\n 'hex3-no-hash': {\n color: {\n from: v => [true, fixHex3(v).substring(1)],\n to: hex3ToHex6,\n },\n text: {\n from: v => [hexNoHash6RE.test(v), hex6ToHex3(v.trim())],\n to: v => v,\n },\n },\n 'uint32-rgb': {\n color: {\n from: v => [true, hexToUint32RGB(v)],\n to: uint32RGBToHex,\n },\n text: {\n from: v => strToUint32RGB(v),\n to: v => `0x${v.toString(16).padStart(6, '0')}`,\n },\n },\n 'uint32-rgba': {\n color: {\n from: v => [true, hexToUint32RGBA(v)],\n to: uint32RGBAToHex,\n },\n text: {\n from: v => strToUint32RGBA(v),\n to: v => `0x${v.toString(16).padStart(8, '0')}`,\n },\n },\n 'uint8-rgb': {\n color: {\n from: v => [true, hexToUint8RGB(v)],\n to: uint8RGBToHex,\n },\n text: {\n from: strTo3Ints,\n to: v => v.join(', '),\n },\n },\n 'uint8-rgba': {\n color: {\n from: v => [true, hexToUint8RGBA(v)],\n to: uint8RGBAToHex,\n },\n text: {\n from: strTo4Ints,\n to: v => v.join(', '),\n },\n },\n 'float-rgb': {\n color: {\n from: v => [true, hexToFloatRGB(v)],\n to: floatRGBToHex,\n },\n text: {\n from: strTo3Floats,\n // need Array.from because map of Float32Array makes a Float32Array\n to: v => Array.from(v).map(v => f3(v)).join(', '),\n },\n },\n 'float-rgba': {\n color: {\n from: v => [true, hexToFloatRGBA(v)],\n to: floatRGBAToHex,\n },\n text: {\n from: strTo4Floats,\n // need Array.from because map of Float32Array makes a Float32Array\n to: v => Array.from(v).map(v => f3(v)).join(', '),\n },\n },\n 'float-hsv': {\n color: {\n from: v => [true, rgbFloatToHSV01(hexToFloatRGB(v))],\n to: v => hsv01ToRGBFloat(floatRGBToHex(v)),\n },\n text: {\n from: strTo3Floats,\n // need Array.from because map of Float32Array makes a Float32Array\n to: v => Array.from(v).map(v => f3(v)).join(', '),\n },\n },\n 'float-hsva': {\n color: {\n from: v => [true, rgbaFloatToHSVA01(hexToFloatRGB(v))],\n to: v => hsva01ToRGBAFloat(floatRGBToHex(v)),\n },\n text: {\n from: strTo4Floats,\n // need Array.from because map of Float32Array makes a Float32Array\n to: v => Array.from(v).map(v => f3(v)).join(', '),\n },\n },\n //'float-hsl': {\n // color: {\n // from: v => [true, rgbFloatToHsl01(hexToFloatRGB(v))],\n // to: v => hsl01ToRGBFloat(floatRGBToHex(v)),\n // },\n // text: {\n // from: strTo3Floats,\n // // need Array.from because map of Float32Array makes a Float32Array\n // to: v => Array.from(v).map(v => f3(v)).join(', '),\n // },\n //},\n //'float-hsla': {\n // color: {\n // from: v => [true, hexToFloatRGBA(v)],\n // to: floatRGBAToHex,\n // },\n // text: {\n // from: strTo4Floats,\n // // need Array.from because map of Float32Array makes a Float32Array\n // to: v => Array.from(v).map(v => f3(v)).join(', '),\n // },\n //},\n 'object-rgb': {\n color: {\n from: v => [true, hexToObjectRGB(v)],\n to: objectRGBToHex,\n },\n text: {\n from: strToRGBObject,\n to: rgbObjectToStr,\n },\n },\n 'object-rgba': {\n color: {\n from: v => [true, hexToObjectRGBA(v)],\n to: objectRGBAToHex,\n },\n text: {\n from: strToRGBAObject,\n to: rgbaObjectToStr,\n },\n },\n 'css-rgb': {\n color: {\n from: v => [true, hexToCssRGB(v)],\n to: cssRGBToHex,\n },\n text: {\n from: strToCssRGB,\n to: v => strToCssRGB(v)[1],\n },\n },\n 'css-rgba': {\n color: {\n from: v => [true, hexToCssRGBA(v)],\n to: cssRGBAToHex,\n },\n text: {\n from: strToCssRGBA,\n to: v => strToCssRGBA(v)[1],\n },\n },\n 'css-hsl': {\n color: {\n from: v => [true, hexToCssHSL(v)],\n to: cssHSLToHex,\n },\n text: {\n from: strToCssHSL,\n to: v => strToCssHSL(v)[1],\n },\n },\n 'css-hsla': {\n color: {\n from: v => [true, hexToCssHSLA(v)],\n to: cssHSLAToHex,\n },\n text: {\n from: strToCssHSLA,\n to: v => strToCssHSLA(v)[1],\n },\n },\n};","import { createElem } from '../libs/elem.js';\nimport View from './View.js';\n\nexport default class ElementView extends View {\n constructor(tag, className) {\n super(createElem(tag, {className}));\n }\n}","import ElementView from '../views/ElementView.js';\nimport LabelController from './LabelController.js';\n\n// TODO: remove this? Should just be user side\nexport default class Canvas extends LabelController {\n #canvasElem;\n\n constructor(name) {\n super('muigui-canvas', name);\n this.#canvasElem = this.add(\n new ElementView('canvas', 'muigui-canvas'),\n ).domElement;\n }\n get canvas() {\n return this.#canvasElem;\n }\n}","import { createElem } from '../libs/elem.js';\nimport { identity } from '../libs/conversions.js';\nimport EditView from './EditView.js';\nimport { copyExistingProperties } from '../libs/utils.js';\n\nexport default class ColorView extends EditView {\n #to;\n #from;\n #colorElem;\n #skipUpdate;\n #options = {\n converters: identity,\n };\n\n constructor(setter, options) {\n const colorElem = createElem('input', {\n type: 'color',\n onInput: () => {\n const [valid, newV] = this.#from(colorElem.value);\n if (valid) {\n this.#skipUpdate = true;\n setter.setValue(newV);\n }\n },\n onChange: () => {\n const [valid, newV] = this.#from(colorElem.value);\n if (valid) {\n this.#skipUpdate = true;\n setter.setFinalValue(newV);\n }\n },\n });\n super(createElem('div', {}, [colorElem]));\n this.setOptions(options);\n this.#colorElem = colorElem;\n }\n updateDisplay(v) {\n if (!this.#skipUpdate) {\n this.#colorElem.value = this.#to(v);\n }\n this.#skipUpdate = false;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {converters: {to, from}} = this.#options;\n this.#to = to;\n this.#from = from;\n return this;\n }\n}\n","import {\n colorFormatConverters,\n guessFormat,\n} from '../libs/color-utils.js';\nimport ValueController from './ValueController.js';\nimport TextView from '../views/TextView.js';\nimport ColorView from '../views/ColorView.js';\n\nexport default class Color extends ValueController {\n #colorView;\n #textView;\n\n constructor(object, property, options = {}) {\n super(object, property, 'muigui-color');\n const format = options.format || guessFormat(this.getValue());\n const {color, text} = colorFormatConverters[format];\n this.#colorView = this.add(new ColorView(this, {converters: color}));\n this.#textView = this.add(new TextView(this, {converters: text}));\n this.updateDisplay();\n }\n setOptions(options) {\n const {format} = options;\n if (format) {\n const {color, text} = colorFormatConverters[format];\n this.#colorView.setOptions({converters: color});\n this.#textView.setOptions({converters: text});\n }\n super.setOptions(options);\n return this;\n }\n}","import Controller from './Controller.js';\n\n// This feels like it should be something else like\n// gui.addController({className: 'muigui-divider')};\nexport default class Divider extends Controller {\n constructor() {\n super('muigui-divider');\n }\n}","import Controller from './Controller.js';\n\nexport default class Container extends Controller {\n #controllers;\n #childDestController;\n\n constructor(className) {\n super(className);\n this.#controllers = [];\n this.#childDestController = this;\n }\n get children() {\n return this.#controllers; // should we return a copy?\n }\n get controllers() {\n return this.#controllers.filter(c => !(c instanceof Container));\n }\n get folders() {\n return this.#controllers.filter(c => c instanceof Container);\n }\n reset(recursive = true) {\n for (const controller of this.#controllers) {\n if (!(controller instanceof Container) || recursive) {\n controller.reset(recursive);\n }\n }\n return this;\n }\n updateDisplay() {\n for (const controller of this.#controllers) {\n controller.updateDisplay();\n }\n return this;\n }\n remove(controller) {\n const ndx = this.#controllers.indexOf(controller);\n if (ndx >= 0) {\n const c = this.#controllers.splice(ndx, 1);\n const c0 = c[0];\n const elem = c0.domElement;\n elem.remove();\n c0.setParent(null);\n }\n return this;\n }\n #addControllerImpl(controller) {\n this.domElement.appendChild(controller.domElement);\n this.#controllers.push(controller);\n controller.setParent(this);\n return controller;\n }\n addController(controller) {\n return this.#childDestController.#addControllerImpl(controller);\n }\n pushContainer(container) {\n this.addController(container);\n this.#childDestController = container;\n return container;\n }\n popContainer() {\n this.#childDestController = this.#childDestController.parent;\n return this;\n }\n}\n","import { createElem } from '../libs/elem.js';\nimport Container from './Container.js';\n\nexport default class Folder extends Container {\n #labelElem;\n\n constructor(name = 'Controls', className = 'muigui-menu') {\n super(className);\n this.#labelElem = createElem('label');\n this.addElem(createElem('button', {\n type: 'button',\n onClick: () => this.toggleOpen(),\n }, [this.#labelElem]));\n this.pushContainer(new Container('muigui-open-container'));\n this.pushContainer(new Container());\n this.name(name);\n this.open();\n }\n open(open = true) {\n this.domElement.classList.toggle('muigui-closed', !open);\n this.domElement.classList.toggle('muigui-open', open);\n return this;\n }\n close() {\n return this.open(false);\n }\n name(name) {\n this.#labelElem.textContent = name;\n return this;\n }\n title(title) {\n return this.name(title);\n }\n toggleOpen() {\n this.open(!this.domElement.classList.contains('muigui-open'));\n return this;\n }\n}\n","import Controller from './Controller.js';\n\n// This feels like it should be something else like\n// gui.addDividing = new Controller()\nexport default class Label extends Controller {\n constructor(text) {\n super('muigui-label');\n this.text(text);\n }\n text(text) {\n this.domElement.textContent = text;\n return this;\n }\n}","function noop() {\n}\n\nexport function computeRelativePosition(elem, event, start) {\n const rect = elem.getBoundingClientRect();\n const x = event.clientX - rect.left;\n const y = event.clientY - rect.top;\n const nx = x / rect.width;\n const ny = y / rect.height;\n start = start || [x, y];\n const dx = x - start[0];\n const dy = y - start[1];\n const ndx = dx / rect.width;\n const ndy = dy / rect.width;\n return {x, y, nx, ny, dx, dy, ndx, ndy};\n}\n\nexport function addTouchEvents(elem, {onDown = noop, onMove = noop, onUp = noop}) {\n let start;\n const pointerMove = function (event) {\n const e = {\n type: 'move',\n ...computeRelativePosition(elem, event, start),\n };\n onMove(e);\n };\n\n const pointerUp = function (event) {\n elem.releasePointerCapture(event.pointerId);\n elem.removeEventListener('pointermove', pointerMove);\n elem.removeEventListener('pointerup', pointerUp);\n\n document.body.style.backgroundColor = '';\n\n onUp('up');\n };\n\n const pointerDown = function (event) {\n elem.addEventListener('pointermove', pointerMove);\n elem.addEventListener('pointerup', pointerUp);\n elem.setPointerCapture(event.pointerId);\n\n const rel = computeRelativePosition(elem, event);\n start = [rel.x, rel.y];\n onDown({\n type: 'down',\n ...rel,\n });\n };\n\n elem.addEventListener('pointerdown', pointerDown);\n\n return function () {\n elem.removeEventListener('pointerdown', pointerDown);\n };\n}","import { createElem, getNewId } from '../libs/elem.js';\nimport { addTouchEvents } from '../libs/touch.js';\nimport { identity } from '../libs/conversions.js';\nimport { clamp } from '../libs/utils.js';\nimport EditView from './EditView.js';\nimport {\n hexToFloatRGB,\n hexToFloatRGBA,\n hsv01ToRGBFloat,\n hsva01ToRGBAFloat,\n rgbFloatToHSV01,\n rgbaFloatToHSVA01,\n floatRGBToHex,\n floatRGBAToHex,\n rgbaFloatToHsla01,\n} from '../libs/color-utils.js';\nimport { copyExistingProperties } from '../libs/utils.js';\n\nconst svg = `\n\n \n \n \n \n \n \n \n \n\n \n \n \n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n \n \n \n \n \n \n \n \n\n`;\n\nfunction connectFillTargets(elem) {\n elem.querySelectorAll('[data-src]').forEach(srcElem => {\n const id = getNewId();\n srcElem.id = id;\n elem.querySelectorAll(`[data-target=${srcElem.dataset.src}]`).forEach(targetElem => {\n targetElem.setAttribute('fill', `url(#${id})`);\n });\n });\n return elem;\n}\n\n// Was originally going to make alpha an option. Issue is\n// hard coded conversions?\nexport default class ColorChooserView extends EditView {\n #to;\n #from;\n #satLevelElem;\n #circleElem;\n #hueUIElem;\n #hueElem;\n #hueCursorElem;\n #alphaUIElem;\n #alphaElem;\n #alphaCursorElem;\n #hsva;\n #skipHueUpdate;\n #skipSatLevelUpdate;\n #skipAlphaUpdate;\n #options = {\n converters: identity,\n alpha: false,\n };\n #convertInternalToHex;\n #convertHexToInternal;\n\n constructor(setter, options) {\n super(createElem('div', {\n innerHTML: svg,\n className: 'muigui-no-scroll',\n }));\n this.#satLevelElem = this.domElement.children[0];\n this.#hueUIElem = this.domElement.children[1];\n this.#alphaUIElem = this.domElement.children[2];\n connectFillTargets(this.#satLevelElem);\n connectFillTargets(this.#hueUIElem);\n connectFillTargets(this.#alphaUIElem);\n this.#circleElem = this.$('.muigui-color-chooser-circle');\n this.#hueElem = this.$('[data-src=muigui-color-chooser-hue]');\n this.#hueCursorElem = this.$('.muigui-color-chooser-hue-cursor');\n this.#alphaElem = this.$('[data-src=muigui-color-chooser-alpha]');\n this.#alphaCursorElem = this.$('.muigui-color-chooser-alpha-cursor');\n\n const handleSatLevelChange = (e) => {\n const s = clamp(e.nx, 0, 1);\n const v = clamp(e.ny, 0, 1);\n this.#hsva[1] = s;\n this.#hsva[2] = (1 - v);\n this.#skipHueUpdate = true;\n this.#skipAlphaUpdate = true;\n const [valid, newV] = this.#from(this.#convertInternalToHex(this.#hsva));\n if (valid) {\n setter.setValue(newV);\n }\n };\n\n const handleHueChange = (e) => {\n const h = clamp(e.nx, 0, 1);\n this.#hsva[0] = h;\n this.#skipSatLevelUpdate = true;\n this.#skipAlphaUpdate = true;\n const [valid, newV] = this.#from(this.#convertInternalToHex(this.#hsva));\n if (valid) {\n setter.setValue(newV);\n }\n };\n\n const handleAlphaChange = (e) => {\n const a = clamp(e.nx, 0, 1);\n this.#hsva[3] = a;\n this.#skipHueUpdate = true;\n this.#skipSatLevelUpdate = true;\n const [valid, newV] = this.#from(this.#convertInternalToHex(this.#hsva));\n if (valid) {\n setter.setValue(newV);\n }\n };\n\n addTouchEvents(this.#satLevelElem, {\n onDown: handleSatLevelChange,\n onMove: handleSatLevelChange,\n });\n addTouchEvents(this.#hueUIElem, {\n onDown: handleHueChange,\n onMove: handleHueChange,\n });\n addTouchEvents(this.#alphaUIElem, {\n onDown: handleAlphaChange,\n onMove: handleAlphaChange,\n });\n this.setOptions(options);\n }\n updateDisplay(newV) {\n if (!this.#hsva) {\n this.#hsva = this.#convertHexToInternal(this.#to(newV));\n }\n {\n const [h, s, v, a = 1] = this.#convertHexToInternal(this.#to(newV));\n // Don't copy the hue if it was un-computable.\n if (!this.#skipHueUpdate) {\n this.#hsva[0] = s > 0.001 && v > 0.001 ? h : this.#hsva[0];\n }\n if (!this.#skipSatLevelUpdate) {\n this.#hsva[1] = s;\n this.#hsva[2] = v;\n }\n if (!this.#skipAlphaUpdate) {\n this.#hsva[3] = a;\n }\n }\n {\n const [h, s, v, a] = this.#hsva;\n const [hue, sat, lum] = rgbaFloatToHsla01(hsva01ToRGBAFloat(this.#hsva));\n\n if (!this.#skipHueUpdate) {\n this.#hueCursorElem.setAttribute('transform', `translate(${h * 64}, 0)`);\n }\n this.#hueElem.children[0].setAttribute('stop-color', `hsl(${hue * 360} 0% 100% / ${a})`);\n this.#hueElem.children[1].setAttribute('stop-color', `hsl(${hue * 360} 100% 50% / ${a})`);\n if (!this.#skipAlphaUpdate) {\n this.#alphaCursorElem.setAttribute('transform', `translate(${a * 64}, 0)`);\n }\n this.#alphaElem.children[0].setAttribute('stop-color', `hsl(${hue * 360} ${sat * 100}% ${lum * 100}% / 0)`);\n this.#alphaElem.children[1].setAttribute('stop-color', `hsl(${hue * 360} ${sat * 100}% ${lum * 100}% / 1)`);\n\n if (!this.#skipSatLevelUpdate) {\n this.#circleElem.setAttribute('cx', `${s * 64}`);\n this.#circleElem.setAttribute('cy', `${(1 - v) * 48}`);\n }\n }\n this.#skipHueUpdate = false;\n this.#skipSatLevelUpdate = false;\n this.#skipAlphaUpdate = false;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {converters: {to, from}, alpha} = this.#options;\n this.#alphaUIElem.style.display = alpha ? '' : 'none';\n this.#convertInternalToHex = alpha\n ? v => floatRGBAToHex(hsva01ToRGBAFloat(v))\n : v => floatRGBToHex(hsv01ToRGBFloat(v));\n this.#convertHexToInternal = alpha\n ? v => rgbaFloatToHSVA01(hexToFloatRGBA(v))\n : v => rgbFloatToHSV01(hexToFloatRGB(v));\n this.#to = to;\n this.#from = from;\n return this;\n }\n}\n","import ElementView from '../views/ElementView.js';\nimport ValueController from './ValueController.js';\nimport { copyExistingProperties } from '../libs/utils.js';\nimport { createElem } from '../libs/elem.js';\n/*\n\nholder = new TabHolder\ntab = holder.add(new Tab(\"name\"))\ntab.add(...)\n\n\npc = new PopdownController\ntop = pc.add(new Row())\ntop.add(new Button());\nvalues = topRow.add(new Div())\nbottom = pc.add(new Row());\n\n\n\npc = new PopdownController\npc.addTop\npc.addTop\n\npc.addBottom\n\n\n*/\n\nexport default class PopDownController extends ValueController {\n #top;\n #valuesView;\n #checkboxElem;\n #bottom;\n #options = {\n open: false,\n };\n\n constructor(object, property, options = {}) {\n super(object, property, 'muigui-pop-down-controller');\n /*\n [ValueView\n [[B][values]] upper row\n [[ visual ]] lower row\n ]\n */\n this.#top = this.add(new ElementView('div', 'muigui-pop-down-top'));\n// this.#top.add(new CheckboxView(makeSetter(this.#options, 'open')));\n const checkboxElem = this.#top.addElem(createElem('input', {\n type: 'checkbox',\n onChange: () => {\n this.#options.open = checkboxElem.checked;\n this.updateDisplay();\n },\n }));\n this.#checkboxElem = checkboxElem;\n this.#valuesView = this.#top.add(new ElementView('div', 'muigui-pop-down-values'));\n const container = new ElementView('div', 'muigui-pop-down-bottom muigui-open-container');\n this.#bottom = new ElementView('div');\n container.add(this.#bottom);\n this.add(container);\n this.setOptions(options);\n }\n setKnobColor(bgCssColor/*, fgCssColor*/) {\n if (this.#checkboxElem) {\n this.#checkboxElem.style = `\n --range-color: ${bgCssColor};\n --value-bg-color: ${bgCssColor};\n `;\n }\n }\n updateDisplay() {\n super.updateDisplay();\n const {open} = this.#options;\n this.domElement.children[1].classList.toggle('muigui-open', open);\n this.domElement.children[1].classList.toggle('muigui-closed', !open);\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n super.setOptions(options);\n this.updateDisplay();\n }\n addTop(view) {\n return this.#valuesView.add(view);\n }\n addBottom(view) {\n return this.#bottom.add(view);\n }\n}","/* eslint-disable no-underscore-dangle */\nimport {\n colorFormatConverters,\n guessFormat,\n hasAlpha,\n hexToUint8RGB,\n hslToRgbUint8,\n rgbUint8ToHsl,\n uint8RGBToHex,\n} from '../libs/color-utils.js';\nimport ColorChooserView from '../views/ColorChooserView.js';\nimport TextView from '../views/TextView.js';\nimport PopDownController from './PopDownController.js';\n\nexport default class ColorChooser extends PopDownController {\n #colorView;\n #textView;\n #to;\n\n constructor(object, property, options = {}) {\n super(object, property, 'muigui-color-chooser');\n const format = options.format || guessFormat(this.getValue());\n const {color, text} = colorFormatConverters[format];\n this.#to = color.to;\n this.#textView = new TextView(this, {converters: text, alpha: hasAlpha(format)});\n this.#colorView = new ColorChooserView(this, {converters: color, alpha: hasAlpha(format)});\n this.addTop(this.#textView);\n this.addBottom(this.#colorView);\n // WTF! FIX!\n this.___setKnobHelper = true;\n this.updateDisplay();\n }\n #setKnobHelper() {\n if (this.#to) {\n const hex6Or8 = this.#to(this.getValue());\n const alpha = hex6Or8.length === 9 ? hex6Or8.substring(7, 9) : 'FF';\n const hsl = rgbUint8ToHsl(hexToUint8RGB(hex6Or8));\n hsl[2] = (hsl[2] + 50) % 100;\n const hex = uint8RGBToHex(hslToRgbUint8(hsl));\n this.setKnobColor(`${hex6Or8.substring(0, 7)}${alpha}`, hex);\n }\n }\n updateDisplay() {\n super.updateDisplay();\n if (this.___setKnobHelper) {\n this.#setKnobHelper();\n }\n }\n setOptions(options) {\n super.setOptions(options);\n return this;\n }\n}\n","import css from './styles/muigui.css.js';\nimport {createElem} from './libs/elem.js';\nimport {createController} from './controllers/create-controller.js';\nimport {\n mapRange,\n makeRangeConverters,\n makeRangeOptions,\n makeMinMaxPair,\n} from './libs/utils.js';\nimport {\n converters\n} from './libs/conversions.js';\nimport {\n hasAlpha,\n guessFormat,\n} from './libs/color-utils.js';\nimport Canvas from './controllers/Canvas.js';\nimport Color from './controllers/Color.js';\nimport Divider from './controllers/Divider.js';\nimport Folder from './controllers/Folder.js';\nimport Label from './controllers/Label.js';\nimport Controller from './controllers/Controller.js';\nimport ColorChooser from './controllers/ColorChooser.js';\n\nimport Column from './layout/Column.js';\nimport Frame from './layout/Frame.js';\nimport Grid from './layout/Grid.js';\nimport Row from './layout/Row.js';\n\nexport {\n Column,\n Frame,\n Grid,\n Row,\n};\n\nexport class GUIFolder extends Folder {\n add(object, property, ...args) {\n const controller = object instanceof Controller\n ? object\n : createController(object, property, ...args);\n return this.addController(controller);\n }\n addCanvas(name) {\n return this.addController(new Canvas(name));\n }\n addColor(object, property, options = {}) {\n const value = object[property];\n if (hasAlpha(options.format || guessFormat(value))) {\n return this.addController(new ColorChooser(object, property, options));\n } else {\n return this.addController(new Color(object, property, options));\n }\n }\n addDivider() {\n return this.addController(new Divider());\n }\n addFolder(name) {\n return this.addController(new GUIFolder(name));\n }\n addLabel(text) {\n return this.addController(new Label(text));\n }\n addButton(name, fn) {\n const o = {fn};\n return this.add(o, 'fn').name(name);\n }\n}\n\nclass MuiguiElement extends HTMLElement {\n constructor() {\n super();\n this.shadow = this.attachShadow({mode: 'open'});\n }\n}\n\ncustomElements.define('muigui-element', MuiguiElement);\n\nconst baseStyleSheet = new CSSStyleSheet();\n//baseStyleSheet.replaceSync(css.default);\nconst userStyleSheet = new CSSStyleSheet();\n\nfunction makeStyleSheetUpdater(styleSheet) {\n let newCss;\n let newCssPromise;\n\n function updateStyle() {\n if (newCss && !newCssPromise) {\n const s = newCss;\n newCss = undefined;\n newCssPromise = styleSheet.replace(s).then(() => {\n newCssPromise = undefined;\n updateStyle();\n });\n }\n }\n\n return function updateStyleSheet(css) {\n newCss = css;\n updateStyle();\n };\n}\n\nconst updateBaseStyle = makeStyleSheetUpdater(baseStyleSheet);\nconst updateUserStyle = makeStyleSheetUpdater(userStyleSheet);\n\nfunction getTheme(name) {\n const { include, css: cssStr } = css.themes[name];\n return `${include.map(m => css[m]).join('\\n')} : css.default}\\n${cssStr || ''}`;\n}\n\nexport class GUI extends GUIFolder {\n static converters = converters;\n static mapRange = mapRange;\n static makeRangeConverters = makeRangeConverters;\n static makeRangeOptions = makeRangeOptions;\n static makeMinMaxPair = makeMinMaxPair;\n #localStyleSheet = new CSSStyleSheet();\n\n constructor(options = {}) {\n super('Controls', 'muigui-root');\n if (options instanceof HTMLElement) {\n options = {parent: options};\n }\n const {\n autoPlace = true,\n width,\n title = 'Controls',\n } = options;\n let {\n parent,\n } = options;\n\n if (width) {\n this.domElement.style.width = /^\\d+$/.test(width) ? `${width}px` : width;\n }\n if (parent === undefined && autoPlace) {\n parent = document.body;\n this.domElement.classList.add('muigui-auto-place');\n }\n if (parent) {\n const muiguiElement = createElem('muigui-element');\n muiguiElement.shadowRoot.adoptedStyleSheets = [this.#localStyleSheet, baseStyleSheet, userStyleSheet];\n muiguiElement.shadow.appendChild(this.domElement);\n parent.appendChild(muiguiElement);\n }\n if (title) {\n this.title(title);\n }\n this.#localStyleSheet.replaceSync(css.default);\n this.domElement.classList.add('muigui', 'muigui-colors');\n }\n setStyle(css) {\n this.#localStyleSheet.replace(css);\n }\n static setBaseStyles(css) {\n updateBaseStyle(css);\n }\n static getBaseStyleSheet() {\n return baseStyleSheet;\n }\n static setUserStyles(css) {\n updateUserStyle(css);\n }\n static getUserStyleSheet() {\n return userStyleSheet;\n }\n setTheme(name) {\n this.setStyle(getTheme(name));\n }\n static setTheme(name) {\n GUI.setBaseStyles(getTheme(name));\n }\n}\n\nexport default GUI;\n","import Button from './Button.js';\nimport Checkbox from './Checkbox.js';\nimport TextNumber from './TextNumber.js';\nimport Select from './Select.js';\nimport Range from './Range.js';\nimport Text from './Text.js';\n\n// const isConversion = o => typeof o.to === 'function' && typeof o.from === 'function';\n\n/**\n * possible inputs\n * add(o, p, min: number, max: number)\n * add(o, p, min: number, max: number, step: number)\n * add(o, p, array: [value])\n * add(o, p, array: [[key, value]])\n *\n * @param {*} object\n * @param {string} property\n * @param {...any} args\n * @returns {Controller}\n */\nexport function createController(object, property, ...args) {\n const [arg1] = args;\n if (Array.isArray(arg1)) {\n return new Select(object, property, {keyValues: arg1});\n }\n if (arg1 && arg1.keyValues) {\n return new Select(object, property, {keyValues: arg1.keyValues});\n }\n\n const t = typeof object[property];\n switch (t) {\n case 'number':\n if (typeof args[0] === 'number' && typeof args[1] === 'number') {\n const min = args[0];\n const max = args[1];\n const step = args[2];\n return new Range(object, property, {min, max, ...(step && {step})});\n }\n return args.length === 0\n ? new TextNumber(object, property, ...args)\n : new Range(object, property, ...args);\n case 'boolean':\n return new Checkbox(object, property, ...args);\n case 'function':\n return new Button(object, property, ...args);\n case 'string':\n return new Text(object, property, ...args);\n case 'undefined':\n throw new Error(`no property named ${property}`);\n default:\n throw new Error(`unhandled type ${t} for property ${property}`);\n }\n}","function noop() {\n}\n\nconst keyDirections = {\n ArrowLeft: [-1, 0],\n ArrowRight: [1, 0],\n ArrowUp: [0, -1],\n ArrowDown: [0, 1],\n};\n\n// This probably needs to be global\nexport function addKeyboardEvents(elem, {onDown = noop, onUp = noop}) {\n const keyDown = function (event) {\n const mult = event.shiftKey ? 10 : 1;\n const [dx, dy] = (keyDirections[event.key] || [0, 0]).map(v => v * mult);\n const fn = event.type === 'keydown' ? onDown : onUp;\n fn({\n type: event.type.substring(3),\n dx,\n dy,\n event,\n });\n };\n\n elem.addEventListener('keydown', keyDown);\n elem.addEventListener('keyup', keyDown);\n\n return function () {\n elem.removeEventListener('keydown', keyDown);\n elem.removeEventListener('keyup', keyDown);\n };\n}","export function assert(truthy, msg = '') {\n if (!truthy) {\n throw new Error(msg);\n }\n}","import { assert } from '../libs/assert.js';\n\nfunction getEllipsePointForAngle(cx, cy, rx, ry, phi, theta) {\n const m = Math.abs(rx) * Math.cos(theta);\n const n = Math.abs(ry) * Math.sin(theta);\n\n return [\n cx + Math.cos(phi) * m - Math.sin(phi) * n,\n cy + Math.sin(phi) * m + Math.cos(phi) * n,\n ];\n}\n\nfunction getEndpointParameters(cx, cy, rx, ry, phi, theta, dTheta) {\n const [x1, y1] = getEllipsePointForAngle(cx, cy, rx, ry, phi, theta);\n const [x2, y2] = getEllipsePointForAngle(cx, cy, rx, ry, phi, theta + dTheta);\n\n const fa = Math.abs(dTheta) > Math.PI ? 1 : 0;\n const fs = dTheta > 0 ? 1 : 0;\n\n return { x1, y1, x2, y2, fa, fs };\n}\n\nexport function arc(cx, cy, r, start, end) {\n assert(Math.abs(start - end) <= Math.PI * 2);\n assert(start >= -Math.PI && start <= Math.PI * 2);\n assert(start <= end);\n assert(end >= -Math.PI && end <= Math.PI * 4);\n\n const { x1, y1, x2, y2, fa, fs } = getEndpointParameters(cx, cy, r, r, 0, start, end - start);\n return Math.abs(Math.abs(start - end) - Math.PI * 2) > Number.EPSILON\n ? `M${cx} ${cy} L${x1} ${y1} A ${r} ${r} 0 ${fa} ${fs} ${x2} ${y2} L${cx} ${cy}`\n : `M${x1} ${y1} L${x1} ${y1} A ${r} ${r} 0 ${fa} ${fs} ${x2} ${y2}`;\n}\n","import { identity } from '../libs/conversions.js';\nimport { createElem } from '../libs/elem.js';\nimport { addKeyboardEvents } from '../libs/keyboard.js';\nimport { arc } from '../libs/svg.js';\nimport { addTouchEvents } from '../libs/touch.js';\nimport { createWheelHelper } from '../libs/wheel.js';\nimport { clamp, copyExistingProperties, euclideanModulo, lerp, stepify } from '../libs/utils.js';\nimport EditView from './EditView.js';\n\nconst svg = `\n\n \n \n \n \n \n \n \n\n`;\n\nconst twoPiMod = v => euclideanModulo(v + Math.PI, Math.PI * 2) - Math.PI;\n\nexport default class DirectionView extends EditView {\n #arrowElem;\n #rangeElem;\n #lastV;\n #wrap;\n #options = {\n step: 1,\n min: -180,\n max: 180,\n\n /*\n --------\n / -π/2 \\\n / | \\\n |<- -π * |\n | * 0 ->| zero is down the positive X axis\n |<- +π * |\n \\ | /\n \\ π/2 /\n --------\n */\n dirMin: -Math.PI,\n dirMax: Math.PI,\n //dirMin: Math.PI * 0.5,\n //dirMax: Math.PI * 2.5,\n //dirMin: -Math.PI * 0.75, // test 10:30 to 7:30\n //dirMax: Math.PI * 0.75,\n //dirMin: Math.PI * 0.75, // test 7:30 to 10:30\n //dirMax: -Math.PI * 0.75,\n //dirMin: -Math.PI * 0.75, // test 10:30 to 1:30\n //dirMax: -Math.PI * 0.25,\n //dirMin: Math.PI * 0.25, // test 4:30 to 7:30\n //dirMax: Math.PI * 0.75,\n //dirMin: Math.PI * 0.75, // test 4:30 to 7:30\n //dirMax: Math.PI * 0.25,\n wrap: undefined,\n converters: identity,\n };\n\n constructor(setter, options = {}) {\n const wheelHelper = createWheelHelper();\n super(createElem('div', {\n className: 'muigui-direction muigui-no-scroll',\n innerHTML: svg,\n onWheel: e => {\n e.preventDefault();\n const {min, max, step} = this.#options;\n const delta = wheelHelper(e, step);\n let tempV = this.#lastV + delta;\n if (this.#wrap) {\n tempV = euclideanModulo(tempV - min, max - min) + min;\n }\n const newV = clamp(stepify(tempV, v => v, step), min, max);\n setter.setValue(newV);\n },\n }));\n const handleTouch = (e) => {\n const {min, max, step, dirMin, dirMax} = this.#options;\n const nx = e.nx * 2 - 1;\n const ny = e.ny * 2 - 1;\n const a = Math.atan2(ny, nx);\n\n const center = (dirMin + dirMax) / 2;\n\n const centeredAngle = twoPiMod(a - center);\n const centeredStart = twoPiMod(dirMin - center);\n const diff = dirMax - dirMin;\n\n const n = clamp((centeredAngle - centeredStart) / (diff), 0, 1);\n const newV = stepify(min + (max - min) * n, v => v, step);\n setter.setValue(newV);\n };\n addTouchEvents(this.domElement, {\n onDown: handleTouch,\n onMove: handleTouch,\n });\n addKeyboardEvents(this.domElement, {\n onDown: (e) => {\n const {min, max, step} = this.#options;\n const newV = clamp(stepify(this.#lastV + e.dx * step, v => v, step), min, max);\n setter.setValue(newV);\n },\n });\n this.#arrowElem = this.$('#muigui-arrow');\n this.#rangeElem = this.$('#muigui-range');\n this.setOptions(options);\n }\n updateDisplay(v) {\n this.#lastV = v;\n const {min, max} = this.#options;\n const n = (v - min) / (max - min);\n const angle = lerp(this.#options.dirMin, this.#options.dirMax, n);\n this.#arrowElem.style.transform = `rotate(${angle}rad)`;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {dirMin, dirMax, wrap} = this.#options;\n this.#wrap = wrap !== undefined\n ? wrap\n : Math.abs(dirMin - dirMax) >= Math.PI * 2 - Number.EPSILON;\n const [min, max] = dirMin < dirMax ? [dirMin, dirMax] : [dirMax , dirMin];\n this.#rangeElem.setAttribute('d', arc(0, 0, 28.87, min, max));\n }\n}\n","import { createElem } from '../libs/elem.js';\nimport { makeId } from '../libs/ids.js';\nimport EditView from './EditView.js';\n\nexport default class RadioGridView extends EditView {\n #values;\n\n constructor(setter, keyValues, cols = 3) {\n const values = [];\n const name = makeId();\n super(createElem('div', {}, keyValues.map(([key, value], ndx) => {\n values.push(value);\n return createElem('label', {}, [\n createElem('input', {\n type: 'radio',\n name,\n value: ndx,\n onChange: function () {\n if (this.checked) {\n setter.setFinalValue(that.#values[this.value]);\n }\n },\n }),\n createElem('button', {\n type: 'button',\n textContent: key,\n onClick: function () {\n this.previousElementSibling.click();\n },\n }),\n ]);\n })));\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const that = this;\n this.#values = values;\n this.cols(cols);\n }\n updateDisplay(v) {\n const ndx = this.#values.indexOf(v);\n for (let i = 0; i < this.domElement.children.length; ++i) {\n this.domElement.children[i].children[0].checked = i === ndx;\n }\n }\n cols(cols) {\n this.domElement.style.gridTemplateColumns = `repeat(${cols}, 1fr)`;\n }\n}\n","export function onResize(elem, callback) {\n new ResizeObserver(() => {\n callback({rect: elem.getBoundingClientRect(), elem});\n }).observe(elem);\n}\n\nexport function onResizeSVGNoScale(elem, hAnchor, vAnchor, callback) {\n onResize(elem, ({rect}) => {\n const {width, height} = rect;\n elem.setAttribute('viewBox', `-${width * hAnchor} -${height * vAnchor} ${width} ${height}`);\n callback({elem, rect});\n });\n}\n\nexport function onResizeCanvas(elem, callback) {\n onResize(elem, ({rect}) => {\n const {width, height} = rect;\n elem.width = width;\n elem.height = height;\n callback({elem, rect});\n });\n}\n","import { createElem } from '../libs/elem.js';\nimport { addKeyboardEvents } from '../libs/keyboard.js';\nimport { addTouchEvents } from '../libs/touch.js';\nimport { createWheelHelper } from '../libs/wheel.js';\nimport { onResizeSVGNoScale } from '../libs/resize-helpers.js';\nimport { clamp, copyExistingProperties, stepify } from '../libs/utils.js';\nimport EditView from './EditView.js';\n\nconst svg = `\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n`;\n\nfunction createSVGTicks(start, end, step, min, max, height) {\n const p = [];\n if (start < min) {\n start += stepify(min - start, v => v, step);\n }\n end = Math.min(end, max);\n for (let i = start; i <= end; i += step) {\n p.push(`M${i} 0 l0 ${height}`);\n }\n return p.join(' ');\n}\n\nfunction createSVGNumbers(start, end, unitSize, unit, minusSize, min, max, labelFn) {\n const texts = [];\n if (start < min) {\n start += stepify(min - start, v => v, unitSize);\n }\n end = Math.min(end, max);\n const digits = Math.max(0, -Math.log10(unit));\n const f = v => labelFn(v.toFixed(digits));\n for (let i = start; i <= end; i += unitSize) {\n texts.push(`= 0 ? i : (i - minusSize / 2) }\" y=\"0\">${f(i / unitSize * unit)}`);\n }\n return texts.join('\\n');\n}\n\nfunction computeSizeOfMinus(elem) {\n const oldHTML = elem.innerHTML;\n elem.innerHTML = '- ';\n const text = elem.querySelector('text');\n const size = text.getComputedTextLength();\n elem.innerHTML = oldHTML;\n return size;\n}\n\nexport default class SliderView extends EditView {\n #svgElem;\n #originElem;\n #ticksElem;\n #thicksElem;\n #numbersElem;\n #leftGradElem;\n #rightGradElem;\n #width;\n #height;\n #lastV;\n #minusSize;\n #options = {\n min: -100,\n max: 100,\n step: 1,\n unit: 10,\n unitSize: 10,\n ticksPerUnit: 5,\n labelFn: v => v,\n tickHeight: 1,\n limits: true,\n thicksColor: undefined,\n orientation: undefined,\n };\n\n constructor(setter, options) {\n const wheelHelper = createWheelHelper();\n super(createElem('div', {\n innerHTML: svg,\n className: 'muigui-no-v-scroll',\n onWheel: e => {\n e.preventDefault();\n const {min, max, step} = this.#options;\n const delta = wheelHelper(e, step);\n const newV = clamp(stepify(this.#lastV + delta, v => v, step), min, max);\n setter.setValue(newV);\n },\n }));\n this.#svgElem = this.$('svg');\n this.#originElem = this.$('#muigui-origin');\n this.#ticksElem = this.$('#muigui-ticks');\n this.#thicksElem = this.$('#muigui-thicks');\n this.#numbersElem = this.$('#muigui-numbers');\n this.#leftGradElem = this.$('#muigui-left-grad');\n this.#rightGradElem = this.$('#muigui-right-grad');\n this.setOptions(options);\n let startV;\n addTouchEvents(this.domElement, {\n onDown: () => {\n startV = this.#lastV;\n },\n onMove: (e) => {\n const {min, max, unitSize, unit, step} = this.#options;\n const newV = clamp(stepify(startV - e.dx / unitSize * unit, v => v, step), min, max);\n setter.setValue(newV);\n },\n });\n addKeyboardEvents(this.domElement, {\n onDown: (e) => {\n const {min, max, step} = this.#options;\n const newV = clamp(stepify(this.#lastV + e.dx * step, v => v, step), min, max);\n setter.setValue(newV);\n },\n });\n onResizeSVGNoScale(this.#svgElem, 0.5, 0, ({rect: {width}}) => {\n this.#leftGradElem.setAttribute('x', -width / 2);\n this.#rightGradElem.setAttribute('x', width / 2 - 20);\n this.#minusSize = computeSizeOfMinus(this.#numbersElem);\n this.#width = width;\n this.#updateSlider();\n });\n }\n // |--------V--------|\n // . . | . . . | . . . |\n //\n #updateSlider() {\n // There's no size if ResizeObserver has not fired yet.\n if (!this.#width || this.#lastV === undefined) {\n return;\n }\n const {\n labelFn,\n limits,\n min,\n max,\n orientation,\n tickHeight,\n ticksPerUnit,\n unit,\n unitSize,\n thicksColor,\n } = this.#options;\n const unitsAcross = Math.ceil(this.#width / unitSize);\n const center = this.#lastV;\n const centerUnitSpace = center / unit;\n const startUnitSpace = Math.round(centerUnitSpace - unitsAcross);\n const endUnitSpace = startUnitSpace + unitsAcross * 2;\n const start = startUnitSpace * unitSize;\n const end = endUnitSpace * unitSize;\n const minUnitSpace = limits ? min * unitSize / unit : start;\n const maxUnitSpace = limits ? max * unitSize / unit : end;\n const height = labelFn(1) === '' ? 10 : 5;\n if (ticksPerUnit > 1) {\n this.#ticksElem.setAttribute('d', createSVGTicks(start, end, unitSize / ticksPerUnit, minUnitSpace, maxUnitSpace, height * tickHeight));\n }\n this.#thicksElem.style.stroke = thicksColor; //setAttribute('stroke', thicksColor);\n this.#thicksElem.setAttribute('d', createSVGTicks(start, end, unitSize, minUnitSpace, maxUnitSpace, height));\n this.#numbersElem.innerHTML = createSVGNumbers(start, end, unitSize, unit, this.#minusSize, minUnitSpace, maxUnitSpace, labelFn);\n this.#originElem.setAttribute('transform', `translate(${-this.#lastV * unitSize / unit} 0)`);\n this.#svgElem.classList.toggle('muigui-slider-up', orientation === 'up');\n }\n updateDisplay(v) {\n this.#lastV = v;\n this.#updateSlider();\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n return this;\n }\n}\n","import { createElem } from '../libs/elem.js';\nimport { addTouchEvents } from '../libs/touch.js';\nimport { onResizeSVGNoScale } from '../libs/resize-helpers.js';\nimport EditView from './EditView.js';\n\nconst svg = `\n\n \n \n \n \n \n\n`;\n\nexport default class Vec2View extends EditView {\n #svgElem;\n #arrowElem;\n #circleElem;\n #lastV = [];\n\n constructor(setter) {\n super(createElem('div', {\n innerHTML: svg,\n className: 'muigui-no-scroll',\n }));\n const onTouch = (e) => {\n const {width, height} = this.#svgElem.getBoundingClientRect();\n const nx = e.nx * 2 - 1;\n const ny = e.ny * 2 - 1;\n setter.setValue([nx * width * 0.5, ny * height * 0.5]);\n };\n addTouchEvents(this.domElement, {\n onDown: onTouch,\n onMove: onTouch,\n });\n this.#svgElem = this.$('svg');\n this.#arrowElem = this.$('#muigui-arrow');\n this.#circleElem = this.$('#muigui-circle');\n onResizeSVGNoScale(this.#svgElem, 0.5, 0.5, () => this.#updateDisplayImpl);\n }\n #updateDisplayImpl() {\n const [x, y] = this.#lastV;\n this.#arrowElem.setAttribute('d', `M0,0L${x},${y}`);\n this.#circleElem.setAttribute('transform', `translate(${x}, ${y})`);\n }\n updateDisplay(v) {\n this.#lastV[0] = v[0];\n this.#lastV[1] = v[1];\n this.#updateDisplayImpl();\n }\n}\n","import GUI from './muigui.js';\n\nimport ColorChooser from './controllers/ColorChooser.js';\nimport Direction from './controllers/Direction.js';\nimport RadioGrid from './controllers/RadioGrid.js';\nimport Range from './controllers/Range.js';\nimport Select from './controllers/Select.js';\nimport Slider from './controllers/Slider.js';\nimport TextNumber from './controllers/TextNumber.js';\nimport Vec2 from './controllers/Vec2.js';\n\nGUI.ColorChooser = ColorChooser;\nGUI.Direction = Direction;\nGUI.RadioGrid = RadioGrid;\nGUI.Range = Range;\nGUI.Select = Select;\nGUI.Slider = Slider;\nGUI.TextNumber = TextNumber;\nGUI.Vec2 = Vec2;\n\nexport default GUI;","import { identity } from '../libs/conversions.js';\nimport DirectionView from '../views/DirectionView.js';\nimport NumberView from '../views/NumberView.js';\n// import ValueController from './ValueController.js';\nimport PopDownController from './PopDownController.js';\n\n\n// deg2rad\n// where is 0\n// range (0, 360), (-180, +180), (0,0) Really this is a range\n\nexport default class Direction extends PopDownController {\n #options;\n constructor(object, property, options) {\n super(object, property, 'muigui-direction');\nthis.#options = options; // FIX\n this.addTop(new NumberView(this,\nidentity));\n this.addBottom(new DirectionView(this, options));\n this.updateDisplay();\n }\n}\n\n","import RadioGridView from '../views/RadioGridView.js';\nimport ValueController from './ValueController.js';\nimport { convertToKeyValues } from '../libs/key-values.js';\n\nexport default class RadioGrid extends ValueController {\n constructor(object, property, options) {\n super(object, property, 'muigui-radio-grid');\n const valueIsNumber = typeof this.getValue() === 'number';\n const {\n keyValues: keyValuesInput,\n cols = 3,\n } = options;\n const keyValues = convertToKeyValues(keyValuesInput, valueIsNumber);\n this.add(new RadioGridView(this, keyValues, cols));\n this.updateDisplay();\n }\n}","import ValueController from './ValueController.js';\nimport NumberView from '../views/NumberView.js';\nimport SliderView from '../views/SliderView.js';\n\nexport default class Slider extends ValueController {\n constructor(object, property, options = {}) {\n super(object, property, 'muigui-slider');\n this.add(new SliderView(this, options));\n this.add(new NumberView(this, options));\n this.updateDisplay();\n }\n}\n","import NumberView from '../views/NumberView.js';\nimport Vec2View from '../views/Vec2View.js';\nimport PopDownController from './PopDownController.js';\nimport { strToNumber } from '../libs/conversions.js';\n\n// TODO: zoom with wheel and pinch?\n// TODO: grid?\n// // options\n// scale:\n// range: number (both x and y + /)\n// range: array (min, max)\n// xRange:\n// deg/rad/turn\n\nexport default class Vec2 extends PopDownController {\n constructor(object, property) {\n super(object, property, 'muigui-vec2');\n\n const makeSetter = (ndx) => {\n return {\n setValue: (v) => {\n const newV = this.getValue();\n newV[ndx] = v;\n this.setValue(newV);\n },\n setFinalValue: (v) => {\n const newV = this.getValue();\n newV[ndx] = v;\n this.setFinalValue(newV);\n },\n };\n };\n\n this.addTop(new NumberView(makeSetter(0), {\n converters: {\n to: v => v[0],\n from: strToNumber.from,\n },\n }));\n this.addTop(new NumberView(makeSetter(1), {\n converters: {\n to: v => v[1],\n from: strToNumber.from,\n },\n }));\n this.addBottom(new Vec2View(this));\n this.updateDisplay();\n }\n}\n"],"names":["css","default","themes","include","float","form","none","createElem","tag","attrs","children","elem","document","createElement","key","value","Object","entries","startsWith","eventName","substring","toLowerCase","addEventListener","passive","k","v","undefined","setAttribute","child","appendChild","setElemProps","nextId","removeArrayElem","array","ndx","indexOf","splice","clamp","min","max","Math","isTypedArray","SharedArrayBuffer","a","buffer","ArrayBuffer","stepify","from","step","round","euclideanModulo","n","copyExistingProperties","dst","src","mapRange","inMin","inMax","outMin","outMax","makeRangeConverters","to","makeRangeOptions","converters","identity","makeMinMaxPair","gui","properties","minPropName","maxPropName","options","guiMinRange","minRange","valueMinRange","minGui","add","onChange","maxGui","setValue","View","domElement","childDestElem","views","constructor","this","addElem","removeElem","removeChild","pushSubElem","popSubElem","parentElement","view","push","remove","pushSubView","popSubView","setOptions","updateDisplayIfNeeded","newV","ignoreCache","$","selector","querySelector","Controller","changeFns","finishChangeFns","parent","className","super","classList","setParent","enable","disabled","show","toggle","hide","closest","forEach","querySelectorAll","disable","fn","removeChange","onFinishChange","removeFinishChange","callListeners","fns","call","emitChange","object","property","controller","emitFinalChange","updateDisplay","getColors","toCamelCase","s","replace","m","m1","toUpperCase","div","colors","fromEntries","map","style","color","getComputedStyle","Button","buttonElem","name","type","onClick","textContent","arraysEqual","b","length","i","EditView","oldV","updateCheck","checkArrayNeedsUpdate","needUpdate","copyArrayElementsFromTo","checkTypedArrayNeedsUpdate","once","checkObjectNeedsUpdate","checkValueNeedsUpdate","getUpdateCheckForType","Array","isArray","bind","CheckboxView","checkboxElem","setter","id","onInput","checked","setFinalValue","tasks","tasksToRemove","Set","requestId","processing","processTasks","task","has","size","queueProcessing","clear","requestAnimationFrame","makeId","ValueView","LabelController","nameElem","for","title","tooltip","tip","ValueController","initialValue","listening","updateFn","getValue","setValueImpl","isDifferent","keys","assign","reset","listen","set","removeTask","Checkbox","strToNumber","toString","parseFloat","Number","isNaN","radToDeg","PI","createWheelHelper","wheelAccum","e","wheelScale","deltaY","delta","floor","abs","sign","NumberView","skipUpdate","NEGATIVE_INFINITY","POSITIVE_INFINITY","wheelHelper","handleInput","onWheel","preventDefault","valid","outV","setFn","inRange","TextNumber","textView","SelectView","values","keyValues","selectedIndex","convertToKeyValues","valueIsNumber","Select","keyValuesInput","RangeView","validV","Range","TextView","Text","lerp","t","fract","f0","toFixed","f3","hexToUint32RGB","parseInt","hexToUint32RGBA","hexToUint8RGB","uint8RGBToHex","padStart","join","hexToUint8RGBA","uint8RGBAToHex","hexToFloatRGB","floatRGBToHex","hexToFloatRGBA","floatRGBAToHex","scaleAndClamp","hexToObjectRGB","r","g","hexToObjectRGBA","hexToCssRGB","cssRGBRegex","hexToCssRGBA","cssRGBARegex","hexToCssHSL","hsl","rgbUint8ToHsl","hexToCssHSLA","hsla","rgbaUint8ToHsla","cssHSLRegex","cssHSLARegex","hslToRgbUint8","h","l","f","rgbFloatToHsl01","d","rgbaFloatToHsla01","rgb","rgba","hsv01ToRGBFloat","hue","sat","val","hsva01ToRGBAFloat","alpha","round3","rgbFloatToHSV01","p","q","EPSILON","rgbaFloatToHSVA01","hasAlpha","format","endsWith","cssStringFormats","re","guessFormat","console","warn","formatInfo","test","guessStringColorFormat","trim","Uint8Array","Uint8ClampedArray","Float32Array","Error","fixHex6","fixHex8","hex6ToHex3","hex6","hex3RE","hex3ToHex6","hex3","exec","m2","fixHex3","strToCssRGB","find","strToCssRGBA","strToCssHSL","strToCssHSLA","strTo3IntsRE","strTo4IntsRE","strTo3Floats","numbers","split","badNdx","findIndex","strTo4Floats","strToUint32RGBRegex","strToUint32RGBARegex","hex6RE","hexNoHash6RE","hex8RE","hexNoHash8RE","colorFormatConverters","text","hex8","strToUint32RGB","strToUint32RGBA","json","JSON","parse","hslaToRgbaUint8","ElementView","Canvas","canvasElem","canvas","ColorView","colorElem","Color","colorView","Divider","Container","controllers","childDestController","filter","c","folders","recursive","c0","addControllerImpl","addController","pushContainer","container","popContainer","Folder","labelElem","toggleOpen","open","close","contains","Label","noop","computeRelativePosition","event","start","rect","getBoundingClientRect","x","clientX","left","y","clientY","top","nx","width","ny","height","dx","dy","ndy","addTouchEvents","onDown","onMove","onUp","pointerMove","pointerUp","releasePointerCapture","pointerId","removeEventListener","body","backgroundColor","pointerDown","setPointerCapture","rel","connectFillTargets","srcElem","dataset","targetElem","ColorChooserView","satLevelElem","circleElem","hueUIElem","hueElem","hueCursorElem","alphaUIElem","alphaElem","alphaCursorElem","hsva","skipHueUpdate","skipSatLevelUpdate","skipAlphaUpdate","convertInternalToHex","convertHexToInternal","innerHTML","handleSatLevelChange","handleHueChange","handleAlphaChange","lum","display","PopDownController","valuesView","bottom","setKnobColor","bgCssColor","addTop","addBottom","ColorChooser","___setKnobHelper","setKnobHelper","hex6Or8","hex","GUIFolder","args","arg1","createController","addCanvas","addColor","addDivider","addFolder","addLabel","addButton","o","MuiguiElement","HTMLElement","shadow","attachShadow","mode","customElements","define","baseStyleSheet","CSSStyleSheet","userStyleSheet","makeStyleSheetUpdater","styleSheet","newCss","newCssPromise","updateStyle","then","updateBaseStyle","updateUserStyle","getTheme","cssStr","GUI","static","localStyleSheet","autoPlace","muiguiElement","shadowRoot","adoptedStyleSheets","replaceSync","setStyle","setTheme","setBaseStyles","keyDirections","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","addKeyboardEvents","keyDown","mult","shiftKey","assert","truthy","msg","getEllipsePointForAngle","cx","cy","rx","ry","phi","theta","cos","sin","arc","end","x1","y1","x2","y2","fa","fs","dTheta","getEndpointParameters","twoPiMod","DirectionView","arrowElem","rangeElem","lastV","wrap","dirMin","dirMax","tempV","handleTouch","atan2","center","angle","transform","RadioGridView","cols","that","previousElementSibling","click","gridTemplateColumns","onResize","callback","ResizeObserver","observe","onResizeSVGNoScale","hAnchor","vAnchor","createSVGTicks","SliderView","svgElem","originElem","ticksElem","thicksElem","numbersElem","leftGradElem","rightGradElem","minusSize","unit","unitSize","ticksPerUnit","labelFn","tickHeight","limits","thicksColor","orientation","startV","oldHTML","getComputedTextLength","computeSizeOfMinus","updateSlider","unitsAcross","ceil","centerUnitSpace","startUnitSpace","minUnitSpace","maxUnitSpace","stroke","texts","digits","log10","createSVGNumbers","Vec2View","onTouch","updateDisplayImpl","Direction","RadioGrid","Slider","Vec2","makeSetter"],"mappings":"oOAAe,IAAAA,EAAA,CACbC,QAAS,yshBAwtBXC,OAAQ,CACND,QAAS,CACPE,QAAS,CAAC,WACVH,IAAK,UAGPI,MAAO,CACLD,QAAS,CAAC,WACVH,IAAK,+xCA0DPK,KAAM,CACJF,QAAS,GACTH,IAAK,28BA6CPM,KAAM,CACJH,QAAS,GACTH,IAAK,MCvzBF,SAASO,EAAWC,EAAKC,EAAQ,CAAA,EAAIC,EAAW,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AASA,EACbwP,GAAI4G,OGZW,cAAqBtZ,EAClCnH,YAAY6C,EAAQC,EAAU3D,EAAU,CAAA,GACtCsC,MAAMoB,EAAQC,EAAU,iBACxB7C,KAAKT,IAAI,IAAI2e,GAAWle,KAAMd,IAC9Bc,KAAKT,IAAI,IAAIyJ,EAAWhJ,KAAMd,IAC9Bc,KAAKgD,eACN,GHOH4W,GAAIhQ,WAAaA,EACjBgQ,GAAI6G,KIJW,cAAmBxJ,GAChClX,YAAY6C,EAAQC,GAClBrB,MAAMoB,EAAQC,EAAU,eAExB,MAAM6d,EAAc5jB,IACX,CACL4C,SAAWrD,IACT,MAAMyE,EAAOd,KAAKsH,WAClBxG,EAAKhE,GAAOT,EACZ2D,KAAKN,SAASoB,EAAK,EAErB+E,cAAgBxJ,IACd,MAAMyE,EAAOd,KAAKsH,WAClBxG,EAAKhE,GAAOT,EACZ2D,KAAK6F,cAAc/E,EAAK,IAK9Bd,KAAKsX,OAAO,IAAItO,EAAW0X,EAAW,GAAI,CACxC/hB,WAAY,CACVF,GAAIpC,GAAKA,EAAE,GACXsB,KAAMqK,EAAYrK,SAGtBqC,KAAKsX,OAAO,IAAItO,EAAW0X,EAAW,GAAI,CACxC/hB,WAAY,CACVF,GAAIpC,GAAKA,EAAE,GACXsB,KAAMqK,EAAYrK,SAGtBqC,KAAKuX,UAAU,IAAI4I,GAASngB,OAC5BA,KAAKgD,eACN"} \ No newline at end of file +{"version":3,"file":"muigui.min.js","sources":["../../src/styles/muigui.css.js","../../src/libs/elem.js","../../src/libs/utils.js","../../../src/views/View.ts","../../src/controllers/Controller.js","../../src/controllers/Button.js","../../src/views/EditView.js","../../src/views/CheckboxView.js","../../src/libs/taskrunner.js","../../src/libs/ids.js","../../src/views/ValueView.js","../../src/controllers/LabelController.js","../../src/controllers/ValueController.js","../../src/controllers/Checkbox.js","../../src/libs/conversions.js","../../src/libs/wheel.js","../../src/views/NumberView.js","../../src/controllers/TextNumber.js","../../src/views/SelectView.js","../../src/libs/key-values.js","../../src/controllers/Select.js","../../src/views/RangeView.js","../../src/controllers/Range.js","../../src/views/TextView.js","../../src/controllers/Text.js","../../src/libs/color-utils.js","../../src/views/ElementView.js","../../src/controllers/Canvas.js","../../src/views/ColorView.js","../../src/controllers/Color.js","../../src/controllers/Divider.js","../../src/controllers/Container.js","../../src/controllers/Folder.js","../../src/controllers/Label.js","../../src/libs/touch.js","../../src/views/ColorChooserView.js","../../src/controllers/PopDownController.js","../../src/controllers/ColorChooser.js","../../src/muigui.js","../../src/controllers/create-controller.js","../../src/libs/keyboard.js","../../src/libs/assert.js","../../src/libs/svg.js","../../src/views/DirectionView.js","../../src/views/RadioGridView.js","../../src/libs/resize-helpers.js","../../src/views/SliderView.js","../../src/views/Vec2View.js","../../src/umd.js","../../src/controllers/Direction.js","../../src/controllers/RadioGrid.js","../../src/controllers/Slider.js","../../src/controllers/Vec2.js"],"sourcesContent":["export default {\n default: `\n.muigui {\n --bg-color: #ddd;\n --color: #222;\n --contrast-color: #eee;\n --value-color: #145 ;\n --value-bg-color: #eeee;\n --disabled-color: #999;\n --menu-bg-color: #f8f8f8;\n --menu-sep-color: #bbb;\n --hover-bg-color: #999;\n --focus-color: #8BF;\n --range-color: #AAA;\n --invalid-color: #FF0000;\n --selected-color: rgb(255, 255, 255, 0.9);\n\n --button-bg-color: var(--value-bg-color);\n\n --image-open: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjNDQ0OyIgeD0iMjAlIiB5PSI0NSUiIHdpZHRoPSI2MCUiIGhlaWdodD0iMTAlIj48L3JlY3Q+Cjwvc3ZnPg==);\n --image-closed: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjNDQ0OyIgeD0iNDUlIiB5PSIyMCUiIHdpZHRoPSIxMCUiIGhlaWdodD0iNjAlIj48L3JlY3Q+CiAgPHJlY3Qgc3R5bGU9ImZpbGw6ICM0NDQ7IiB4PSIyMCUiIHk9IjQ1JSIgd2lkdGg9IjYwJSIgaGVpZ2h0PSIxMCUiPjwvcmVjdD4KPC9zdmc+);\n --image-checkerboard: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjNDA0MDQwOyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSI+PC9yZWN0PgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjODA4MDgwOyIgeD0iMCIgeT0iMCIgd2lkdGg9IjUwJSIgaGVpZ2h0PSI1MCUiPjwvcmVjdD4KICA8cmVjdCBzdHlsZT0iZmlsbDogIzgwODA4MDsiIHg9IjUwJSIgeT0iNTAlIiB3aWR0aD0iNTAlIiBoZWlnaHQ9IjUwJSI+PC9yZWN0Pgo8L3N2Zz4=);\n\n --range-left-color: var(--value-color);\n --range-right-color: var(--value-bg-color); \n --range-right-hover-color: var(--hover-bg-color);\n --button-image: \n linear-gradient(\n rgba(255, 255, 255, 1), rgba(0, 0, 0, 0.2)\n );\n\n color: var(--color);\n background-color: var(--bg-color);\n}\n\n@media (prefers-color-scheme: dark) {\n .muigui {\n --bg-color: #222222;\n --color: #dddddd;\n --contrast-color: #000;\n --value-color: #43e5f7;\n --value-bg-color: #444444;\n --disabled-color: #666666;\n --menu-bg-color: #080808;\n --menu-sep-color: #444444;\n --hover-bg-color: #666666;\n --focus-color: #458; /*#88AAFF*/;\n --range-color: #888888;\n --invalid-color: #FF6666;\n --selected-color: rgba(255, 255, 255, 0.3);\n\n --button-bg-color: var(--value-bg-color);\n\n --range-left-color: var(--value-color);\n --range-right-color: var(--value-bg-color); \n --range-right-hover-color: var(--hover-bg-color);\n --button-image: linear-gradient(\n rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.4)\n );\n\n color: var(--color);\n background-color: var(--bg-color);\n\n --image-closed: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjREREOyIgeD0iMjAlIiB5PSI0NSUiIHdpZHRoPSI2MCUiIGhlaWdodD0iMTAlIj48L3JlY3Q+Cjwvc3ZnPg==);\n --image-open: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjREREOyIgeD0iNDUlIiB5PSIyMCUiIHdpZHRoPSIxMCUiIGhlaWdodD0iNjAlIj48L3JlY3Q+CiAgPHJlY3Qgc3R5bGU9ImZpbGw6ICNEREQ7IiB4PSIyMCUiIHk9IjQ1JSIgd2lkdGg9IjYwJSIgaGVpZ2h0PSIxMCUiPjwvcmVjdD4KPC9zdmc+);\n }\n}\n\n.muigui {\n --width: 250px;\n --label-width: 45%;\n --number-width: 40%;\n\n --font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Arial, sans-serif;\n --font-size: 11px;\n --font-family-mono: Menlo, Monaco, Consolas, \"Droid Sans Mono\", monospace;\n --font-size-mono: 11px;\n\n --line-height: 1.7em;\n --border-radius: 0px;\n\n width: var(--width);\n font-family: var(--font-family);\n font-size: var(--font-size);\n box-sizing: border-box;\n line-height: 100%;\n white-space: nowrap;\n}\n.muigui * {\n box-sizing: inherit;\n}\n\n.muigui-no-scroll {\n touch-action: none;\n}\n.muigui-no-h-scroll {\n touch-action: pan-y;\n}\n.muigui-no-v-scroll {\n touch-action: pan-x;\n}\n\n.muigui-invalid-value {\n background-color: red !important;\n color: white !important;\n}\n\n.muigui-grid {\n display: grid;\n}\n.muigui-rows {\n display: flex;\n flex-direction: column;\n\n min-height: 20px;\n border: 2px solid red;\n}\n.muigui-columns {\n display: flex;\n flex-direction: row;\n\n height: 20px;\n border: 2px solid green;\n}\n.muigui-rows>*,\n.muigui-columns>* {\n flex: 1 1 auto;\n align-items: stretch;\n min-height: 0;\n min-width: 0;\n}\n\n.muigui-row {\n border: 2px solid yellow;\n min-height: 10px\n}\n.muigui-column {\n border: 2px solid lightgreen;\n}\n\n/* -------- */\n\n.muigui-show { /* */ }\n.muigui-hide { \n display: none !important;\n}\n.muigui-disabled {\n pointer-events: none;\n --color: var(--disabled-color) !important;\n --value-color: var(--disabled-color) !important;\n --range-left-color: var(--disabled-color) !important;\n}\n\n.muigui canvas,\n.muigui svg {\n display: block;\n border-radius: var(--border-radius);\n}\n.muigui canvas {\n background-color: var(--value-bg-color);\n}\n\n.muigui-controller {\n min-width: 0;\n min-height: var(--line-height);\n}\n.muigui-root {\n z-index: 1;\n}\n.muigui-root,\n.muigui-menu {\n display: flex;\n flex-direction: column;\n position: relative;\n user-select: none;\n height: fit-content;\n margin: 0;\n padding-bottom: 0.1em;\n border-radius: var(--border-radius);\n}\n.muigui-menu {\n border-bottom: 1px solid var(--menu-sep-color);\n}\n\n.muigui-root>button:nth-child(1),\n.muigui-menu>button:nth-child(1) {\n border-top: 1px solid var(--menu-sep-color);\n border-bottom: 1px solid var(--menu-sep-color);\n position: relative;\n text-align: left;\n color: var(--color);\n background-color: var(--menu-bg-color);\n min-height: var(--line-height);\n padding: 0.2em;\n cursor: pointer;\n border-radius: var(--border-radius);\n}\n.muigui-root>div:nth-child(2),\n.muigui-menu>div:nth-child(2) {\n flex: 1 1 auto;\n}\n\n.muigui-controller {\n margin-left: 0.2em;\n margin-right: 0.2em;\n}\n.muigui-root.muigui-controller,\n.muigui-menu.muigui-controller {\n margin-left: 0;\n margin-right: 0;\n}\n.muigui-controller>*:nth-child(1) {\n flex: 1 0 var(--label-width);\n min-width: 0;\n /* white-space: pre; why?? */\n}\n.muigui-controller>label:nth-child(1) {\n place-content: center start;\n display: inline-grid;\n overflow: hidden;\n}\n.muigui-controller>*:nth-child(2) {\n flex: 1 1 75%;\n min-width: 0;\n}\n\n/* -----------------------------------------\n a label controller is [[label][value]]\n*/\n\n.muigui-label-controller {\n display: flex;\n margin: 0.4em 0 0.4em 0;\n word-wrap: initial;\n align-items: stretch;\n}\n\n.muigui-value {\n display: flex;\n align-items: stretch;\n}\n.muigui-value>* {\n flex: 1 1 auto;\n min-width: 0;\n}\n.muigui-value>*:nth-child(1) {\n flex: 1 1 calc(100% - var(--number-width));\n}\n.muigui-value>*:nth-child(2) {\n flex: 1 1 var(--number-width);\n margin-left: 0.2em;\n}\n\n/* fix! */\n.muigui-open>button>label::before,\n.muigui-closed>button>label::before {\n content: \"X\";\n color: rgba(0, 0, 0, 0);\n background-color: var(--range-color);\n border-radius: 0.2em;\n width: 1.25em;\n margin-right: 0.25em;\n height: 1.25em; /*var(--line-height);*/\n display: inline-grid;\n place-content: center start;\n pointer-events: none;\n}\n.muigui-open>button>label::before {\n background-image: var(--image-open);\n}\n.muigui-closed>button>label::before {\n background-image: var(--image-closed);\n}\n\n.muigui-open>.muigui-open-container {\n transition: all 0.1s ease-out;\n overflow: auto;\n height: 100%;\n}\n.muigui-closed>.muigui-open-container {\n transition: all 0.1s ease-out;\n overflow: hidden;\n min-height: 0;\n}\n.muigui-open>.muigui-open-container>* {\n transition: all 0.1s ease-out;\n margin-top: 0px;\n}\n.muigui-closed>.muigui-open-container>* {\n transition: all 0.1s ease-out;\n margin-top: -1000%;\n}\n\n/* ---- popdown ---- */\n\n.muigui-pop-down-top {\n display: flex;\n}\n/* fix? */\n.muigui-value>*:nth-child(1).muigui-pop-down-top {\n flex: 0;\n}\n.muigui-closed .muigui-pop-down-bottom {\n max-height: 0;\n}\n\n.muigui-value .muigui-pop-down-bottom {\n margin: 0;\n}\n\n.muigui-pop-down-values {\n min-width: 0;\n display: flex;\n}\n.muigui-pop-down-values>* {\n flex: 1 1 auto;\n min-width: 0;\n}\n\n.muigui-value.muigui-pop-down-controller {\n flex-direction: column;\n}\n\n.muigui-pop-down-top input[type=checkbox] {\n -webkit-appearance: none;\n appearance: none;\n width: auto;\n color: var(--value-color);\n background-color: var(--value-bg-color);\n background-image: var(--image-checkerboard);\n background-size: 10px 10px;\n background-position: 0 0, 0 5px, 5px -5px, -5px 0px;\n\n cursor: pointer;\n\n display: grid;\n place-content: center;\n margin: 0;\n font: inherit;\n color: currentColor;\n width: 1.7em;\n height: 1.7em;\n transform: translateY(-0.075em);\n}\n\n.muigui-pop-down-top input[type=checkbox]::before {\n content: \"+\";\n display: grid;\n place-content: center;\n border-radius: calc(var(--border-radius) + 2px);\n border-left: 1px solid rgba(255,255,255,0.3);\n border-top: 1px solid rgba(255,255,255,0.3);\n border-bottom: 1px solid rgba(0,0,0,0.2);\n border-right: 1px solid rgba(0,0,0,0.2);\n background-color: var(--range-color);\n color: var(--value-bg-color);\n width: calc(var(--line-height) - 4px);\n height: calc(var(--line-height) - 4px);\n}\n\n.muigui-pop-down-top input[type=checkbox]:checked::before {\n content: \"X\";\n}\n\n\n/* ---- select ---- */\n\n.muigui select,\n.muigui option,\n.muigui input,\n.muigui button {\n color: var(--value-color);\n background-color: var(--value-bg-color);\n font-family: var(--font-family);\n font-size: var(--font-size);\n border: none;\n margin: 0;\n border-radius: var(--border-radius);\n}\n.muigui select {\n appearance: none;\n margin: 0;\n margin-left: 0; /*?*/\n overflow: hidden; /* Safari */\n}\n\n.muigui select:focus,\n.muigui input:focus,\n.muigui button:focus {\n outline: 1px solid var(--focus-color);\n}\n\n.muigui select:hover,\n.muigui option:hover,\n.muigui input:hover,\n.muigui button:hover {\n background-color: var(--hover-bg-color); \n}\n\n/* ------ [ label ] ------ */\n\n.muigui-label {\n border-top: 1px solid var(--menu-sep-color);\n border-bottom: 1px solid var(--menu-sep-color);\n padding-top: 0.4em;\n padding-bottom: 0.3em;\n place-content: center start;\n background-color: var(--menu-bg-color);\n white-space: pre;\n border-radius: var(--border-radius);\n}\n\n/* ------ [ divider] ------ */\n\n.muigui-divider {\n min-height: 6px;\n border-top: 2px solid var(--menu-sep-color);\n margin-top: 6px;\n}\n\n/* ------ [ button ] ------ */\n\n.muigui-button {\n display: grid;\n padding: 2px 0 2px 0;\n}\n.muigui-button button {\n border: none;\n color: var(--value-color);\n background-color: var(--button-bg-color);\n background-image: var(--button-image);\n cursor: pointer;\n place-content: center center;\n height: var(--line-height);\n}\n\n/* ------ [ color ] ------ */\n\n.muigui-color>div {\n overflow: hidden;\n position: relative;\n margin-left: 0;\n margin-right: 0; /* why? */\n max-width: var(--line-height);\n border-radius: var(--border-radius);\n}\n\n.muigui-color>div:focus-within {\n outline: 1px solid var(--focus-color);\n}\n\n.muigui-color input[type=color] {\n border: none;\n padding: 0;\n background: inherit;\n cursor: pointer;\n position: absolute;\n width: 200%;\n left: -10px;\n top: -10px;\n height: 200%;\n}\n.muigui-disabled canvas,\n.muigui-disabled svg,\n.muigui-disabled img,\n.muigui-disabled .muigui-color input[type=color] {\n opacity: 0.2;\n}\n\n/* ------ [ checkbox ] ------ */\n\n.muigui-checkbox>label:nth-child(2) {\n display: grid;\n place-content: center start;\n margin: 0;\n}\n\n.muigui-checkbox input[type=checkbox] {\n -webkit-appearance: none;\n appearance: none;\n width: auto;\n color: var(--value-color);\n background-color: var(--value-bg-color);\n cursor: pointer;\n\n display: grid;\n place-content: center;\n margin: 0;\n font: inherit;\n color: currentColor;\n width: 1.7em;\n height: 1.7em;\n transform: translateY(-0.075em);\n}\n\n.muigui-checkbox input[type=checkbox]::before {\n content: \"\";\n color: var(--value-color);\n display: grid;\n place-content: center;\n}\n\n.muigui-checkbox input[type=checkbox]:checked::before {\n content: \"✔\";\n}\n\n.muigui input[type=number]::-webkit-inner-spin-button, \n.muigui input[type=number]::-webkit-outer-spin-button { \n -webkit-appearance: none;\n appearance: none;\n margin: 0; \n}\n.muigui input[type=number] {\n -moz-appearance: textfield;\n}\n\n/* ------ [ radio grid ] ------ */\n\n.muigui-radio-grid>div {\n display: grid;\n gap: 2px;\n}\n\n.muigui-radio-grid input {\n appearance: none;\n display: none;\n}\n\n.muigui-radio-grid button {\n color: var(--color);\n width: 100%;\n text-align: left;\n}\n\n.muigui-radio-grid input:checked + button {\n color: var(--value-color);\n background-color: var(--selected-color);\n}\n\n/* ------ [ color-chooser ] ------ */\n\n.muigui-color-chooser-cursor {\n stroke-width: 1px;\n stroke: white;\n fill: none;\n}\n.muigui-color-chooser-circle {\n stroke-width: 1px;\n stroke: white;\n fill: none;\n}\n\n\n/* ------ [ vec2 ] ------ */\n\n.muigui-vec2 svg {\n background-color: var(--value-bg-color);\n}\n\n.muigui-vec2-axis {\n stroke: 1px;\n stroke: var(--focus-color);\n}\n\n.muigui-vec2-line {\n stroke-width: 1px;\n stroke: var(--value-color);\n fill: var(--value-color);\n}\n\n/* ------ [ direction ] ------ */\n\n.muigui-direction svg {\n background-color: rgba(0,0,0,0.2);\n}\n\n.muigui-direction:focus-within svg {\n outline: none;\n}\n.muigui-direction-range {\n fill: var(--value-bg-color);\n}\n.muigui-direction svg:focus {\n outline: none;\n}\n.muigui-direction svg:focus .muigui-direction-range {\n stroke-width: 0.5px;\n stroke: var(--focus-color);\n}\n\n.muigui-direction-arrow {\n fill: var(--value-color);\n}\n\n/* ------ [ slider ] ------ */\n\n.muigui-slider>div {\n display: flex;\n align-items: stretch;\n height: var(--line-height);\n}\n.muigui-slider svg {\n flex: 1 1 auto;\n}\n.muigui-slider .muigui-slider-up #muigui-orientation {\n transform: scale(1, -1) translateY(-100%);\n}\n\n.muigui-slider .muigui-slider-up #muigui-number-orientation {\n transform: scale(1,-1);\n}\n\n.muigui-ticks {\n stroke: var(--range-color);\n}\n.muigui-thicks {\n stroke: var(--color);\n stroke-width: 2px;\n}\n.muigui-svg-text {\n fill: var(--color);\n font-size: 7px;\n}\n.muigui-mark {\n fill: var(--value-color);\n}\n\n/* ------ [ range ] ------ */\n\n\n.muigui-range input[type=range] {\n -webkit-appearance: none;\n appearance: none;\n background-color: transparent;\n}\n\n.muigui-range input[type=range]::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n border-radius: calc(var(--border-radius) + 2px);\n border-left: 1px solid rgba(255,255,255,0.3);\n border-top: 1px solid rgba(255,255,255,0.3);\n border-bottom: 1px solid rgba(0,0,0,0.2);\n border-right: 1px solid rgba(0,0,0,0.2);\n background-color: var(--range-color);\n margin-top: calc((var(--line-height) - 6px) / -2);\n width: calc(var(--line-height) - 6px);\n height: calc(var(--line-height) - 6px);\n}\n\n.muigui-range input[type=range]::-webkit-slider-runnable-track {\n -webkit-appearance: none;\n appearance: none;\n border: 1px solid var(--menu-sep-color);\n height: 2px;\n}\n\n\n/* dat.gui style - doesn't work on Safari iOS */\n\n/*\n.muigui-range input[type=range] {\n cursor: ew-resize;\n overflow: hidden;\n}\n\n.muigui-range input[type=range] {\n -webkit-appearance: none;\n appearance: none;\n background-color: var(--range-right-color);\n margin: 0;\n}\n.muigui-range input[type=range]:hover {\n background-color: var(--range-right-hover-color);\n}\n\n.muigui-range input[type=range]::-webkit-slider-runnable-track {\n -webkit-appearance: none;\n appearance: none;\n height: max-content;\n color: var(--range-left-color);\n margin-top: -1px;\n}\n\n.muigui-range input[type=range]::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 0px;\n height: max-content;\n box-shadow: -1000px 0 0 1000px var(--range-left-color);\n}\n*/\n\n/* FF */\n/*\n.muigui-range input[type=range]::-moz-slider-progress {\n background-color: var(--range-left-color); \n}\n.muigui-range input[type=range]::-moz-slider-thumb {\n height: max-content;\n width: 0;\n border: none;\n box-shadow: -1000px 0 0 1000px var(--range-left-color);\n box-sizing: border-box;\n}\n*/\n\n.muigui-checkered-background {\n background-color: #404040;\n background-image:\n linear-gradient(45deg, #808080 25%, transparent 25%),\n linear-gradient(-45deg, #808080 25%, transparent 25%),\n linear-gradient(45deg, transparent 75%, #808080 75%),\n linear-gradient(-45deg, transparent 75%, #808080 75%);\n background-size: 16px 16px;\n background-position: 0 0, 0 8px, 8px -8px, -8px 0px;\n}\n\n/* ---------------------------------------------------------- */\n\n/* needs to be at bottom to take precedence */\n.muigui-auto-place {\n max-height: 100%;\n position: fixed;\n top: 0;\n right: 15px;\n z-index: 100001;\n}\n\n`,\nthemes: {\n default: {\n include: ['default'],\n css: `\n `,\n },\n float: {\n include: ['default'],\n css: `\n :root {\n color-scheme: light dark,\n }\n\n .muigui {\n --width: 400px;\n --bg-color: initial;\n --label-width: 25%;\n --number-width: 20%;\n }\n\n input,\n .muigui-label-controller>label {\n text-shadow:\n -1px -1px 0 var(--contrast-color),\n 1px -1px 0 var(--contrast-color),\n -1px 1px 0 var(--contrast-color),\n 1px 1px 0 var(--contrast-color);\n }\n\n .muigui-controller > label:nth-child(1) {\n place-content: center end;\n margin-right: 1em;\n }\n\n .muigui-value > :nth-child(2) {\n margin-left: 1em;\n }\n\n .muigui-root>*:nth-child(1) {\n display: none;\n }\n\n .muigui-range input[type=range]::-webkit-slider-thumb {\n border-radius: 1em;\n }\n\n .muigui-range input[type=range]::-webkit-slider-runnable-track {\n -webkit-appearance: initial;\n appearance: none;\n border: 1px solid rgba(0, 0, 0, 0.25);\n height: 2px;\n }\n\n .muigui-colors {\n --value-color: var(--color );\n --value-bg-color: rgba(0, 0, 0, 0.1);\n --disabled-color: #cccccc;\n --menu-bg-color: rgba(0, 0, 0, 0.1);\n --menu-sep-color: #bbbbbb;\n --hover-bg-color: rgba(0, 0, 0, 0);\n --invalid-color: #FF0000;\n --selected-color: rgba(0, 0, 0, 0.3);\n --range-color: rgba(0, 0, 0, 0.125);\n }\n`,\n },\n form: {\n include: [],\n css: `\n .muigui {\n --width: 100%;\n --label-width: 45%;\n --number-width: 40%;\n }\n .muigui-root>button {\n display: none;\n }\n .muigui-controller {\n margin-top: 1em;\n }\n .muigui-label-controller {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n margin-top: 1em;\n }\n .muigui-label-controller:has(.muigui-checkbox) {\n flex-direction: row;\n }\n .muigui-value {\n display: flex;\n align-items: stretch;\n }\n .muigui-value>* {\n flex: 1 1 auto;\n min-width: 0;\n }\n .muigui-controller>*:nth-child(1) {\n flex: 1 0 var(--label-width);\n min-width: 0;\n white-space: pre;\n }\n .muigui-controller>label:nth-child(1) {\n place-content: center start;\n display: inline-grid;\n overflow: hidden;\n }\n .muigui-controller>*:nth-child(2) {\n flex: 1 1 75%;\n min-width: 0;\n }\n `,\n },\n none: {\n include: [],\n css: '',\n },\n},\n};\n","export function setElemProps(elem, attrs, children) {\n for (const [key, value] of Object.entries(attrs)) {\n if (typeof value === 'function' && key.startsWith('on')) {\n const eventName = key.substring(2).toLowerCase();\n elem.addEventListener(eventName, value, {passive: false});\n } else if (typeof value === 'object') {\n for (const [k, v] of Object.entries(value)) {\n elem[key][k] = v;\n }\n } else if (elem[key] === undefined) {\n elem.setAttribute(key, value);\n } else {\n elem[key] = value;\n }\n }\n for (const child of children) {\n elem.appendChild(child);\n }\n return elem;\n}\n\nexport function createElem(tag, attrs = {}, children = []) {\n const elem = document.createElement(tag);\n setElemProps(elem, attrs, children);\n return elem;\n}\n\nexport function addElem(tag, parent, attrs = {}, children = []) {\n const elem = createElem(tag, attrs, children);\n parent.appendChild(elem);\n return elem;\n}\n\nlet nextId = 0;\nexport function getNewId() {\n return `muigui-id-${nextId++}`;\n}\n","export function removeArrayElem(array, value) {\n const ndx = array.indexOf(value);\n if (ndx) {\n array.splice(ndx, 1);\n }\n return array;\n}\n\n/**\n * Converts an camelCase or snake_case id to \"camel case\" or \"snake case\"\n * @param {string} id\n */\nconst underscoreRE = /_/g;\nconst upperLowerRE = /([A-Z])([a-z])/g;\nexport function idToLabel(id) {\n return id.replace(underscoreRE, ' ')\n .replace(upperLowerRE, (m, m1, m2) => `${m1.toLowerCase()} ${m2}`);\n}\n\nexport function clamp(v, min, max) {\n return Math.max(min, Math.min(max, v));\n}\n\nexport const isTypedArray = typeof SharedArrayBuffer !== 'undefined'\n ? function isArrayBufferOrSharedArrayBuffer(a) {\n return a && a.buffer && (a.buffer instanceof ArrayBuffer || a.buffer instanceof SharedArrayBuffer);\n }\n : function isArrayBuffer(a) {\n return a && a.buffer && a.buffer instanceof ArrayBuffer;\n };\n\nexport const isArrayOrTypedArray = v => Array.isArray(v) || isTypedArray(v);\n\n// Yea, I know this should be `Math.round(v / step) * step\n// but try step = 0.1, newV = 19.95\n//\n// I get\n// Math.round(19.95 / 0.1) * 0.1\n// 19.900000000000002\n// vs\n// Math.round(19.95 / 0.1) / (1 / 0.1)\n// 19.9\n//\nexport const stepify = (v, from, step) => Math.round(from(v) / step) / (1 / step);\n\nexport const euclideanModulo = (v, n) => ((v % n) + n) % n;\nexport const lerp = (a, b, t) => a + (b - a) * t;\nexport function copyExistingProperties(dst, src) {\n for (const key in src) {\n if (key in dst) {\n dst[key] = src[key];\n }\n }\n return dst;\n}\n\nexport const mapRange = (v, inMin, inMax, outMin, outMax) => (v - inMin) * (outMax - outMin) / (inMax - inMin) + outMin;\n\nexport const makeRangeConverters = ({from, to}) => {\n return {\n to: v => mapRange(v, ...from, ...to),\n from: v => [true, mapRange(v, ...to, ...from)],\n };\n};\n\nexport const makeRangeOptions = ({from, to, step}) => {\n return {\n min: to[0],\n max: to[1],\n ...(step && {step}),\n converters: makeRangeConverters({from, to}),\n };\n};\n\n// TODO: remove an use one in conversions. Move makeRangeConverters there?\nexport const identity = {\n to: v => v,\n from: v => [true, v],\n};\nexport function makeMinMaxPair(gui, properties, minPropName, maxPropName, options) {\n const { converters: { from } = identity } = options;\n const { min, max } = options;\n const guiMinRange = options.minRange || 0;\n const valueMinRange = from(guiMinRange)[1];\n const minGui = gui\n .add(properties, minPropName, {\n ...options,\n min,\n max: max - guiMinRange,\n })\n .onChange(v => {\n maxGui.setValue(Math.min(max, Math.max(v + valueMinRange, properties[maxPropName])));\n });\n const maxGui = gui\n .add(properties, maxPropName, {\n ...options,\n min: min + guiMinRange,\n max,\n })\n .onChange(v => {\n minGui.setValue(Math.max(min, Math.min(v - valueMinRange, properties[minPropName])));\n });\n return [ minGui, maxGui ];\n}\n\n","import { removeArrayElem } from '../libs/utils.js';\n\nexport default class View {\n domElement: HTMLElement;\n\n #childDestElem: HTMLElement;\n #views: View[] = [];\n\n constructor(elem: HTMLElement) {\n this.domElement = elem;\n this.#childDestElem = elem;\n }\n addElem(elem: HTMLElement) {\n this.#childDestElem.appendChild(elem);\n return elem;\n }\n removeElem(elem: HTMLElement) {\n this.#childDestElem.removeChild(elem);\n return elem;\n }\n pushSubElem(elem: HTMLElement) {\n this.#childDestElem.appendChild(elem);\n this.#childDestElem = elem;\n }\n popSubElem() {\n this.#childDestElem = this.#childDestElem.parentElement!;\n }\n add(view: View) {\n this.#views.push(view);\n this.addElem(view.domElement);\n return view;\n }\n remove(view: View) {\n this.removeElem(view.domElement);\n removeArrayElem(this.#views, view);\n return view;\n }\n pushSubView(view: View) {\n this.pushSubElem(view.domElement);\n }\n popSubView() {\n this.popSubElem();\n }\n setOptions(options: any) {\n for (const view of this.#views) {\n view.setOptions(options);\n }\n }\n updateDisplayIfNeeded(newV: any, ignoreCache?: boolean) {\n for (const view of this.#views) {\n view.updateDisplayIfNeeded(newV, ignoreCache);\n }\n return this;\n }\n $(selector: string) {\n return this.domElement.querySelector(selector);\n }\n}","import { createElem } from '../libs/elem.js';\nimport { removeArrayElem } from '../libs/utils.js';\nimport View from '../views/View.js';\n\nexport default class Controller extends View {\n #changeFns;\n #finishChangeFns;\n #parent;\n\n constructor(className) {\n super(createElem('div', {className: 'muigui-controller'}));\n this.#changeFns = [];\n this.#finishChangeFns = [];\n // we need the specialization to come last so it takes precedence.\n if (className) {\n this.domElement.classList.add(className);\n }\n }\n get parent() {\n return this.#parent;\n }\n setParent(parent) {\n this.#parent = parent;\n this.enable(!this.disabled());\n }\n show(show = true) {\n this.domElement.classList.toggle('muigui-hide', !show);\n this.domElement.classList.toggle('muigui-show', show);\n return this;\n }\n hide() {\n return this.show(false);\n }\n disabled() {\n return !!this.domElement.closest('.muigui-disabled');\n }\n\n enable(enable = true) {\n this.domElement.classList.toggle('muigui-disabled', !enable);\n\n // If disabled we need to set the attribute 'disabled=true' to all\n // input/select/button/textarea's below\n //\n // If enabled we need to set the attribute 'disabled=false' to all below\n // until we hit a disabled controller.\n //\n // ATM the problem is we can find the input/select/button/textarea elements\n // but we can't easily find which controller they belong do.\n // But we don't need to? We can just check up if it or parent has\n // '.muigui-disabled'\n ['input', 'button', 'select', 'textarea'].forEach(tag => {\n this.domElement.querySelectorAll(tag).forEach(elem => {\n const disabled = !!elem.closest('.muigui-disabled');\n elem.disabled = disabled;\n });\n });\n\n return this;\n }\n disable(disable = true) {\n return this.enable(!disable);\n }\n onChange(fn) {\n this.removeChange(fn);\n this.#changeFns.push(fn);\n return this;\n }\n removeChange(fn) {\n removeArrayElem(this.#changeFns, fn);\n return this;\n }\n onFinishChange(fn) {\n this.removeFinishChange(fn);\n this.#finishChangeFns.push(fn);\n return this;\n }\n removeFinishChange(fn) {\n removeArrayElem(this.#finishChangeFns, fn);\n return this;\n }\n #callListeners(fns, newV) {\n for (const fn of fns) {\n fn.call(this, newV);\n }\n }\n emitChange(value, object, property) {\n this.#callListeners(this.#changeFns, value);\n if (this.#parent) {\n if (object === undefined) {\n this.#parent.emitChange(value);\n } else {\n this.#parent.emitChange({\n object,\n property,\n value,\n controller: this,\n });\n }\n }\n }\n emitFinalChange(value, object, property) {\n this.#callListeners(this.#finishChangeFns, value);\n if (this.#parent) {\n if (object === undefined) {\n this.#parent.emitChange(value);\n } else {\n this.#parent.emitFinalChange({\n object,\n property,\n value,\n controller: this,\n });\n }\n }\n }\n updateDisplay() {\n // placeholder. override\n }\n getColors() {\n const toCamelCase = s => s.replace(/-([a-z])/g, (m, m1) => m1.toUpperCase());\n const keys = [\n 'color',\n 'bg-color',\n 'value-color',\n 'value-bg-color',\n 'hover-bg-color',\n 'menu-bg-color',\n 'menu-sep-color',\n 'disabled-color',\n ];\n const div = createElem('div');\n this.domElement.appendChild(div);\n const colors = Object.fromEntries(keys.map(key => {\n div.style.color = `var(--${key})`;\n const s = getComputedStyle(div);\n return [toCamelCase(key), s.color];\n }));\n div.remove();\n return colors;\n }\n}\n","import {\n createElem,\n} from '../libs/elem.js';\nimport { copyExistingProperties } from '../libs/utils.js';\nimport Controller from './Controller.js';\n\nexport default class Button extends Controller {\n #object;\n #property;\n #buttonElem;\n #options = {\n name: '',\n };\n\n constructor(object, property, options = {}) {\n super('muigui-button', '');\n this.#object = object;\n this.#property = property;\n\n this.#buttonElem = this.addElem(\n createElem('button', {\n type: 'button',\n onClick: () => {\n this.#object[this.#property](this);\n },\n }));\n this.setOptions({name: property, ...options});\n }\n name(name) {\n this.#buttonElem.textContent = name;\n return this;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {name} = this.#options;\n this.#buttonElem.textContent = name;\n return this;\n }\n}","import { isTypedArray } from '../libs/utils.js';\nimport View from './View.js';\n\nfunction arraysEqual(a, b) {\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; ++i) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n}\n\nfunction copyArrayElementsFromTo(src, dst) {\n dst.length = src.length;\n for (let i = 0; i < src.length; ++i) {\n dst[i] = src[i];\n }\n}\n\nexport default class EditView extends View {\n #oldV;\n #updateCheck;\n\n #checkArrayNeedsUpdate(newV) {\n // It's an array, we need to compare all elements\n // Example, vec2, [r,g,b], ...\n const needUpdate = !arraysEqual(newV, this.#oldV);\n if (needUpdate) {\n copyArrayElementsFromTo(newV, this.#oldV);\n }\n return needUpdate;\n }\n\n #checkTypedArrayNeedsUpdate() {\n let once = true;\n return function checkTypedArrayNeedsUpdateImpl(newV) {\n // It's a typedarray, we need to compare all elements\n // Example: Float32Array([r, g, b])\n let needUpdate = once;\n once = false;\n if (!needUpdate) {\n needUpdate = !arraysEqual(newV, this.#oldV);\n }\n return needUpdate;\n };\n }\n\n #checkObjectNeedsUpdate(newV) {\n let needUpdate = false;\n for (const key in newV) {\n if (newV[key] !== this.#oldV[key]) {\n needUpdate = true;\n this.#oldV[key] = newV[key];\n }\n }\n return needUpdate;\n }\n\n #checkValueNeedsUpdate(newV) {\n const needUpdate = newV !== this.#oldV;\n this.#oldV = newV;\n return needUpdate;\n }\n\n #getUpdateCheckForType(newV) {\n if (Array.isArray(newV)) {\n this.#oldV = [];\n return this.#checkArrayNeedsUpdate.bind(this);\n } else if (isTypedArray(newV)) {\n this.#oldV = new newV.constructor(newV);\n return this.#checkTypedArrayNeedsUpdate(this);\n } else if (typeof newV === 'object') {\n this.#oldV = {};\n return this.#checkObjectNeedsUpdate.bind(this);\n } else {\n return this.#checkValueNeedsUpdate.bind(this);\n }\n }\n\n // The point of this is updating DOM elements\n // is slow but if we've called `listen` then\n // every frame we're going to try to update\n // things with the current value so if nothing\n // has changed then skip it.\n updateDisplayIfNeeded(newV, ignoreCache) {\n this.#updateCheck = this.#updateCheck || this.#getUpdateCheckForType(newV);\n // Note: We call #updateCheck first because it updates\n // the cache\n if (this.#updateCheck(newV) || ignoreCache) {\n this.updateDisplay(newV);\n }\n }\n setOptions(/*options*/) {\n // override this\n return this;\n }\n}\n","import { createElem } from '../libs/elem.js';\nimport EditView from './EditView.js';\n\nexport default class CheckboxView extends EditView {\n #checkboxElem;\n constructor(setter, id) {\n const checkboxElem = createElem('input', {\n type: 'checkbox',\n id,\n onInput: () => {\n setter.setValue(checkboxElem.checked);\n },\n onChange: () => {\n setter.setFinalValue(checkboxElem.checked);\n },\n });\n super(createElem('label', {}, [checkboxElem]));\n this.#checkboxElem = checkboxElem;\n }\n updateDisplay(v) {\n this.#checkboxElem.checked = v;\n }\n}\n","import { removeArrayElem } from './utils.js';\n\nconst tasks = [];\nconst tasksToRemove = new Set();\n\nlet requestId;\nlet processing;\n\nfunction removeTasks() {\n if (!tasksToRemove.size) {\n return;\n }\n\n if (processing) {\n queueProcessing();\n return;\n }\n\n tasksToRemove.forEach(task => {\n removeArrayElem(tasks, task);\n });\n tasksToRemove.clear();\n}\n\nfunction processTasks() {\n requestId = undefined;\n processing = true;\n for (const task of tasks) {\n if (!tasksToRemove.has(task)) {\n task();\n }\n }\n processing = false;\n removeTasks();\n queueProcessing();\n}\n\nfunction queueProcessing() {\n if (!requestId && tasks.length) {\n requestId = requestAnimationFrame(processTasks);\n }\n}\n\nexport function addTask(fn) {\n tasks.push(fn);\n queueProcessing();\n}\n\nexport function removeTask(fn) {\n tasksToRemove.set(fn);\n\n const ndx = tasks.indexOf(fn);\n if (ndx >= 0) {\n tasks.splice(ndx, 1);\n }\n}","let id = 0;\n\nexport function makeId() {\n return `muigui-${++id}`;\n}\n","import { createElem } from '../libs/elem.js';\nimport View from './View.js';\n\nexport default class ValueView extends View {\n constructor(className = '') {\n super(createElem('div', {className: 'muigui-value'}));\n if (className) {\n this.domElement.classList.add(className);\n }\n }\n}","import { createElem } from '../libs/elem.js';\nimport { makeId } from '../libs/ids.js';\nimport ValueView from '../views/ValueView.js';\nimport Controller from './Controller.js';\n\nexport default class LabelController extends Controller {\n #id;\n #nameElem;\n\n constructor(className = '', name = '') {\n super('muigui-label-controller');\n this.#id = makeId();\n this.#nameElem = createElem('label', {for: this.#id});\n this.domElement.appendChild(this.#nameElem);\n this.pushSubView(new ValueView(className));\n this.name(name);\n }\n get id() {\n return this.#id;\n }\n name(name) {\n if (this.#nameElem.title === this.#nameElem.textContent) {\n this.#nameElem.title = name;\n }\n this.#nameElem.textContent = name;\n return this;\n }\n tooltip(tip) {\n this.#nameElem.title = tip;\n }\n}\n\n","import {addTask, removeTask} from '../libs/taskrunner.js';\nimport { isTypedArray } from '../libs/utils.js';\nimport LabelController from './LabelController.js';\n\nexport default class ValueController extends LabelController {\n #object;\n #property;\n #initialValue;\n #listening;\n #views;\n #updateFn;\n\n constructor(object, property, className = '') {\n super(className, property);\n this.#object = object;\n this.#property = property;\n this.#initialValue = this.getValue();\n this.#listening = false;\n this.#views = [];\n }\n get initialValue() {\n return this.#initialValue;\n }\n get object() {\n return this.#object;\n }\n get property() {\n return this.#property;\n }\n add(view) {\n this.#views.push(view);\n super.add(view);\n this.updateDisplay();\n return view;\n }\n #setValueImpl(v, ignoreCache) {\n let isDifferent = false;\n if (typeof v === 'object') {\n const dst = this.#object[this.#property];\n // don't replace objects, just their values.\n if (Array.isArray(v) || isTypedArray(v)) {\n for (let i = 0; i < v.length; ++i) {\n isDifferent ||= dst[i] !== v[i];\n dst[i] = v[i];\n }\n } else {\n for (const key of Object.keys(v)) {\n isDifferent ||= dst[key] !== v[key];\n }\n Object.assign(dst, v);\n }\n } else {\n isDifferent = this.#object[this.#property] !== v;\n this.#object[this.#property] = v;\n }\n this.updateDisplay(ignoreCache);\n if (isDifferent) {\n this.emitChange(this.getValue(), this.#object, this.#property);\n }\n return isDifferent;\n }\n setValue(v) {\n this.#setValueImpl(v);\n }\n setFinalValue(v) {\n const isDifferent = this.#setValueImpl(v, true);\n if (isDifferent) {\n this.emitFinalChange(this.getValue(), this.#object, this.#property);\n }\n return this;\n }\n updateDisplay(ignoreCache) {\n const newV = this.getValue();\n for (const view of this.#views) {\n view.updateDisplayIfNeeded(newV, ignoreCache);\n }\n return this;\n }\n setOptions(options) {\n for (const view of this.#views) {\n view.setOptions(options);\n }\n this.updateDisplay();\n return this;\n }\n getValue() {\n return this.#object[this.#property];\n }\n value(v) {\n this.setValue(v);\n return this;\n }\n reset() {\n this.setValue(this.#initialValue);\n return this;\n }\n listen(listen = true) {\n if (!this.#updateFn) {\n this.#updateFn = this.updateDisplay.bind(this);\n }\n if (listen) {\n if (!this.#listening) {\n this.#listening = true;\n addTask(this.#updateFn);\n }\n } else {\n if (this.#listening) {\n this.#listening = false;\n removeTask(this.#updateFn);\n }\n }\n return this;\n }\n}\n\n","import CheckboxView from '../views/CheckboxView.js';\nimport ValueController from './ValueController.js';\n\nexport default class Checkbox extends ValueController {\n constructor(object, property) {\n super(object, property, 'muigui-checkbox');\n const id = this.id;\n this.add(new CheckboxView(this, id));\n this.updateDisplay();\n }\n}","import {\n makeRangeConverters,\n} from './utils.js';\n\nexport const identity = {\n to: v => v,\n from: v => [true, v],\n};\n\n// from: from string to value\n// to: from value to string\nexport const strToNumber = {\n to: v => v.toString(),\n from: v => {\n const newV = parseFloat(v);\n return [!Number.isNaN(newV), newV];\n },\n};\n\nexport const converters = {\n radToDeg: makeRangeConverters({to: [0, 180], from: [0, Math.PI]}),\n};\n","export function createWheelHelper() {\n let wheelAccum = 0;\n return function (e, step, wheelScale = 5) {\n wheelAccum -= e.deltaY * step / wheelScale;\n const wheelSteps = Math.floor(Math.abs(wheelAccum) / step) * Math.sign(wheelAccum);\n const delta = wheelSteps * step;\n wheelAccum -= delta;\n return delta;\n };\n}\n","import { createElem } from '../libs/elem.js';\nimport { strToNumber } from '../libs/conversions.js';\nimport { createWheelHelper } from '../libs/wheel.js';\nimport { clamp, copyExistingProperties, stepify } from '../libs/utils.js';\nimport EditView from './EditView.js';\n\nexport default class NumberView extends EditView {\n #to;\n #from;\n #step;\n #skipUpdate;\n #options = {\n step: 0.01,\n converters: strToNumber,\n min: Number.NEGATIVE_INFINITY,\n max: Number.POSITIVE_INFINITY,\n };\n\n constructor(setter, options) {\n const setValue = setter.setValue.bind(setter);\n const setFinalValue = setter.setFinalValue.bind(setter);\n const wheelHelper = createWheelHelper();\n super(createElem('input', {\n type: 'number',\n onInput: () => {\n this.#handleInput(setValue, true);\n },\n onChange: () => {\n this.#handleInput(setFinalValue, false);\n },\n onWheel: e => {\n e.preventDefault();\n const {min, max, step} = this.#options;\n const delta = wheelHelper(e, step);\n const v = parseFloat(this.domElement.value);\n const newV = clamp(stepify(v + delta, v => v, step), min, max);\n const [valid, outV] = this.#from(newV);\n if (valid) {\n setter.setValue(outV);\n }\n },\n }));\n this.setOptions(options);\n }\n #handleInput(setFn, skipUpdate) {\n const v = parseFloat(this.domElement.value);\n const [valid, newV] = this.#from(v);\n let inRange;\n if (valid && !Number.isNaN(v)) {\n const {min, max} = this.#options;\n inRange = newV >= min && newV <= max;\n this.#skipUpdate = skipUpdate;\n setFn(clamp(newV, min, max));\n }\n this.domElement.classList.toggle('muigui-invalid-value', !valid || !inRange);\n }\n updateDisplay(v) {\n if (!this.#skipUpdate) {\n this.domElement.value = stepify(v, this.#to, this.#step);\n }\n this.#skipUpdate = false;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {\n step,\n converters: {to, from},\n } = this.#options;\n this.#to = to;\n this.#from = from;\n this.#step = step;\n return this;\n }\n}\n","\nimport NumberView from '../views/NumberView.js';\nimport ValueController from './ValueController.js';\n\n// Wanted to name this `Number` but it conflicts with\n// JavaScript `Number`. It most likely wouldn't be\n// an issue? But users might `import {Number} ...` and\n// things would break.\nexport default class TextNumber extends ValueController {\n #textView;\n #step;\n\n constructor(object, property, options = {}) {\n super(object, property, 'muigui-text-number');\n this.#textView = this.add(new NumberView(this, options));\n this.updateDisplay();\n }\n}","import { createElem } from '../libs/elem.js';\nimport EditView from './EditView.js';\n\nexport default class SelectView extends EditView {\n #values;\n\n constructor(setter, keyValues) {\n const values = [];\n super(createElem('select', {\n onChange: () => {\n setter.setFinalValue(this.#values[this.domElement.selectedIndex]);\n },\n }, keyValues.map(([key, value]) => {\n values.push(value);\n return createElem('option', {textContent: key});\n })));\n this.#values = values;\n }\n updateDisplay(v) {\n const ndx = this.#values.indexOf(v);\n this.domElement.selectedIndex = ndx;\n }\n}\n","\n// 4 cases\n// (a) keyValues is array of arrays, each sub array is key value\n// (b) keyValues is array and value is number then keys = array contents, value = index\n// (c) keyValues is array and value is not number, key = array contents, value = array contents\n// (d) keyValues is object then key->value\nexport function convertToKeyValues(keyValues, valueIsNumber) {\n if (Array.isArray(keyValues)) {\n if (Array.isArray(keyValues[0])) {\n // (a) keyValues is array of arrays, each sub array is key value\n return keyValues;\n } else {\n if (valueIsNumber) {\n // (b) keyValues is array and value is number then keys = array contents, value = index\n return keyValues.map((v, ndx) => [v, ndx]);\n } else {\n // (c) keyValues is array and value is not number, key = array contents, value = array contents\n return keyValues.map(v => [v, v]);\n }\n }\n } else {\n // (d)\n return [...Object.entries(keyValues)];\n }\n}\n","import SelectView from '../views/SelectView.js';\nimport ValueController from './ValueController.js';\nimport { convertToKeyValues } from '../libs/key-values.js';\n\nexport default class Select extends ValueController {\n constructor(object, property, options) {\n super(object, property, 'muigui-select');\n const valueIsNumber = typeof this.getValue() === 'number';\n const {keyValues: keyValuesInput} = options;\n const keyValues = convertToKeyValues(keyValuesInput, valueIsNumber);\n this.add(new SelectView(this, keyValues));\n this.updateDisplay();\n }\n}","import { createElem } from '../libs/elem.js';\nimport { identity } from '../libs/conversions.js';\nimport { clamp, copyExistingProperties, stepify } from '../libs/utils.js';\nimport { createWheelHelper } from '../libs/wheel.js';\nimport EditView from './EditView.js';\n\nexport default class RangeView extends EditView {\n #to;\n #from;\n #step;\n #skipUpdate;\n #options = {\n step: 0.01,\n min: 0,\n max: 1,\n converters: identity,\n };\n\n constructor(setter, options) {\n const wheelHelper = createWheelHelper();\n super(createElem('input', {\n type: 'range',\n onInput: () => {\n this.#skipUpdate = true;\n const {min, max, step} = this.#options;\n const v = parseFloat(this.domElement.value);\n const newV = clamp(stepify(v, v => v, step), min, max);\n const [valid, validV] = this.#from(newV);\n if (valid) {\n setter.setValue(validV);\n }\n },\n onChange: () => {\n this.#skipUpdate = true;\n const {min, max, step} = this.#options;\n const v = parseFloat(this.domElement.value);\n const newV = clamp(stepify(v, v => v, step), min, max);\n const [valid, validV] = this.#from(newV);\n if (valid) {\n setter.setFinalValue(validV);\n }\n },\n onWheel: e => {\n e.preventDefault();\n const [valid, v] = this.#from(parseFloat(this.domElement.value));\n if (!valid) {\n return;\n }\n const {min, max, step} = this.#options;\n const delta = wheelHelper(e, step);\n const newV = clamp(stepify(v + delta, v => v, step), min, max);\n setter.setValue(newV);\n },\n }));\n this.setOptions(options);\n }\n updateDisplay(v) {\n if (!this.#skipUpdate) {\n this.domElement.value = stepify(v, this.#to, this.#step);\n }\n this.#skipUpdate = false;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {\n step,\n min,\n max,\n converters: {to, from},\n } = this.#options;\n this.#to = to;\n this.#from = from;\n this.#step = step;\n this.domElement.step = step;\n this.domElement.min = min;\n this.domElement.max = max;\n return this;\n }\n}","import ValueController from './ValueController.js';\nimport NumberView from '../views/NumberView.js';\nimport RangeView from '../views/RangeView.js';\n\nexport default class Range extends ValueController {\n constructor(object, property, options) {\n super(object, property, 'muigui-range');\n this.add(new RangeView(this, options));\n this.add(new NumberView(this, options));\n }\n}\n","import { createElem } from '../libs/elem.js';\nimport { identity } from '../libs/conversions.js';\nimport EditView from './EditView.js';\nimport { copyExistingProperties } from '../libs/utils.js';\n\nexport default class TextView extends EditView {\n #to;\n #from;\n #skipUpdate;\n #options = {\n converters: identity,\n };\n\n constructor(setter, options) {\n const setValue = setter.setValue.bind(setter);\n const setFinalValue = setter.setFinalValue.bind(setter);\n super(createElem('input', {\n type: 'text',\n onInput: () => {\n this.#handleInput(setValue, true);\n },\n onChange: () => {\n this.#handleInput(setFinalValue, false);\n },\n }));\n this.setOptions(options);\n }\n #handleInput(setFn, skipUpdate) {\n const [valid, newV] = this.#from(this.domElement.value);\n if (valid) {\n this.#skipUpdate = skipUpdate;\n setFn(newV);\n }\n this.domElement.style.color = valid ? '' : 'var(--invalid-color)';\n\n }\n updateDisplay(v) {\n if (!this.#skipUpdate) {\n this.domElement.value = this.#to(v);\n this.domElement.style.color = '';\n }\n this.#skipUpdate = false;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {\n converters: {to, from},\n } = this.#options;\n this.#to = to;\n this.#from = from;\n return this;\n }\n}\n","import TextView from '../views/TextView.js';\nimport ValueController from './ValueController.js';\n\nexport default class Text extends ValueController {\n constructor(object, property) {\n super(object, property, 'muigui-text');\n this.add(new TextView(this));\n this.updateDisplay();\n }\n}","const clamp = (v, min, max) => Math.max(min, Math.min(max, v));\nconst lerp = (a, b, t) => a + (b - a) * t;\nconst fract = v => v >= 0 ? v % 1 : 1 - (v % 1);\n\nconst f0 = v => +v.toFixed(0); // converts to string (eg 1.2 => \"1\"), then converts back to number (eg, \"1.200\" => 1.2)\nconst f3 = v => +v.toFixed(3); // converts to string (eg 1.2 => \"1.200\"), then converts back to number (eg, \"1.200\" => 1.2)\n\nconst hexToUint32RGB = v => (parseInt(v.substring(1, 3), 16) << 16) |\n (parseInt(v.substring(3, 5), 16) << 8 ) |\n (parseInt(v.substring(5, 7), 16) );\nconst uint32RGBToHex = v => `#${(Math.round(v)).toString(16).padStart(6, '0')}`;\nconst hexToUint32RGBA = v => (parseInt(v.substring(1, 3), 16) * 2 ** 24) +\n (parseInt(v.substring(3, 5), 16) * 2 ** 16) +\n (parseInt(v.substring(5, 7), 16) * 2 ** 8) +\n (parseInt(v.substring(7, 9), 16) );\nconst uint32RGBAToHex = v => `#${(Math.round(v)).toString(16).padStart(8, '0')}`;\n\nexport const hexToUint8RGB = v => [\n parseInt(v.substring(1, 3), 16),\n parseInt(v.substring(3, 5), 16),\n parseInt(v.substring(5, 7), 16),\n];\nexport const uint8RGBToHex = v => `#${Array.from(v).map(v => v.toString(16).padStart(2, '0')).join('')}`;\n\nexport const hexToUint8RGBA = v => [\n parseInt(v.substring(1, 3), 16),\n parseInt(v.substring(3, 5), 16),\n parseInt(v.substring(5, 7), 16),\n parseInt(v.substring(7, 9), 16),\n];\nexport const uint8RGBAToHex = v => `#${Array.from(v).map(v => v.toString(16).padStart(2, '0')).join('')}`;\n\nexport const hexToFloatRGB = v => hexToUint8RGB(v).map(v => f3(v / 255));\nexport const floatRGBToHex = v => uint8RGBToHex(Array.from(v).map(v => Math.round(clamp(v * 255, 0, 255))));\n\nexport const hexToFloatRGBA = v => hexToUint8RGBA(v).map(v => f3(v / 255));\nexport const floatRGBAToHex = v => uint8RGBAToHex(Array.from(v).map(v => Math.round(clamp(v * 255, 0, 255))));\n\nconst scaleAndClamp = v => clamp(Math.round(v * 255), 0, 255).toString(16).padStart(2, '0');\n\nconst hexToObjectRGB = v => ({\n r: parseInt(v.substring(1, 3), 16) / 255,\n g: parseInt(v.substring(3, 5), 16) / 255,\n b: parseInt(v.substring(5, 7), 16) / 255,\n});\nconst objectRGBToHex = v => `#${scaleAndClamp(v.r)}${scaleAndClamp(v.g)}${scaleAndClamp(v.b)}`;\nconst hexToObjectRGBA = v => ({\n r: parseInt(v.substring(1, 3), 16) / 255,\n g: parseInt(v.substring(3, 5), 16) / 255,\n b: parseInt(v.substring(5, 7), 16) / 255,\n a: parseInt(v.substring(7, 9), 16) / 255,\n});\nconst objectRGBAToHex = v => `#${scaleAndClamp(v.r)}${scaleAndClamp(v.g)}${scaleAndClamp(v.b)}${scaleAndClamp(v.a)}`;\n\nconst hexToCssRGB = v => `rgb(${hexToUint8RGB(v).join(', ')})`;\nconst cssRGBRegex = /^\\s*rgb\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*\\)\\s*$/;\nconst cssRGBToHex = v => {\n const m = cssRGBRegex.exec(v);\n return uint8RGBToHex([m[1], m[2], m[3]].map(v => parseInt(v)));\n};\nconst hexToCssRGBA = v => `rgba(${hexToUint8RGBA(v).map((v, i) => i === 3 ? v / 255 : v).join(', ')})`;\nconst cssRGBARegex = /^\\s*rgba\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+\\.\\d+|\\d+)\\s*\\)\\s*$/;\nconst cssRGBAToHex = v => {\n const m = cssRGBARegex.exec(v);\n return uint8RGBAToHex([m[1], m[2], m[3], m[4]].map((v, i) => i === 3 ? (parseFloat(v) * 255 | 0) : parseInt(v)));\n};\n\nconst hexToCssHSL = v => {\n const hsl = rgbUint8ToHsl(hexToUint8RGB(v)).map(v => f0(v));\n return `hsl(${hsl[0]}, ${hsl[1]}%, ${hsl[2]}%)`;\n};\nconst hexToCssHSLA = v => {\n const hsla = rgbaUint8ToHsla(hexToUint8RGBA(v)).map((v, i) => i === 3 ? f3(v) : f0(v));\n return `hsl(${hsla[0]} ${hsla[1]}% ${hsla[2]}% / ${hsla[3]})`;\n};\nconst cssHSLRegex = /^\\s*hsl\\(\\s*(\\d+)(?:deg|)\\s*(?:,|)\\s*(\\d+)%\\s*(?:,|)\\s*(\\d+)%\\s*\\)\\s*$/;\nconst cssHSLARegex = /^\\s*hsl\\(\\s*(\\d+)(?:deg|)\\s*(?:,|)\\s*(\\d+)%\\s*(?:,|)\\s*(\\d+)%\\s*\\/\\s*(\\d+\\.\\d+|\\d+)\\s*\\)\\s*$/;\n\nconst hex3DigitTo6Digit = v => `${v[0]}${v[0]}${v[1]}${v[1]}${v[2]}${v[2]}`;\nconst cssHSLToHex = v => {\n const m = cssHSLRegex.exec(v);\n const rgb = hslToRgbUint8([m[1], m[2], m[3]].map(v => parseFloat(v)));\n return uint8RGBToHex(rgb);\n};\nconst cssHSLAToHex = v => {\n const m = cssHSLARegex.exec(v);\n const rgba = hslaToRgbaUint8([m[1], m[2], m[3], m[4]].map(v => parseFloat(v)));\n return uint8RGBAToHex(rgba);\n};\n\nconst euclideanModulo = (v, n) => ((v % n) + n) % n;\n\nexport function hslToRgbUint8([h, s, l]) {\n h = euclideanModulo(h, 360);\n s = clamp(s / 100, 0, 1);\n l = clamp(l / 100, 0, 1);\n\n const a = s * Math.min(l, 1 - l);\n\n function f(n) {\n const k = (n + h / 30) % 12;\n return l - a * Math.max(-1, Math.min(k - 3, 9 - k, 1));\n }\n\n return [f(0), f(8), f(4)].map(v => Math.round(v * 255));\n}\n\nexport function hslaToRgbaUint8([h, s, l, a]) {\n const rgb = hslToRgbUint8([h, s, l]);\n return [...rgb, a * 255 | 0];\n}\n\nexport function rgbFloatToHsl01([r, g, b]) {\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const l = (min + max) * 0.5;\n const d = max - min;\n let h = 0;\n let s = 0;\n\n if (d !== 0) {\n s = (l === 0 || l === 1)\n ? 0\n : (max - l) / Math.min(l, 1 - l);\n\n switch (max) {\n case r: h = (g - b) / d + (g < b ? 6 : 0); break;\n case g: h = (b - r) / d + 2; break;\n case b: h = (r - g) / d + 4;\n }\n }\n\n return [h / 6, s, l];\n}\n\nexport function rgbaFloatToHsla01([r, g, b, a]) {\n const hsl = rgbFloatToHsl01([r, g, b]);\n return [...hsl, a];\n}\n\nexport const rgbUint8ToHsl = (rgb) => {\n const [h, s, l] = rgbFloatToHsl01(rgb.map(v => v / 255));\n return [h * 360, s * 100, l * 100];\n};\n\nexport const rgbaUint8ToHsla = (rgba) => {\n const [h, s, l, a] = rgbaFloatToHsla01(rgba.map(v => v / 255));\n return [h * 360, s * 100, l * 100, a];\n};\n\nexport function hsv01ToRGBFloat([hue, sat, val]) {\n sat = clamp(sat, 0, 1);\n val = clamp(val, 0, 1);\n return [hue, hue + 2 / 3, hue + 1 / 3].map(\n v => lerp(1, clamp(Math.abs(fract(v) * 6 - 3.0) - 1, 0, 1), sat) * val\n );\n}\n\nexport function hsva01ToRGBAFloat([hue, sat, val, alpha]) {\n const rgb = hsv01ToRGBFloat([hue, sat, val]);\n return [...rgb, alpha];\n}\n\nconst round3 = v => Math.round(v * 1000) / 1000;\n\nexport function rgbFloatToHSV01([r, g, b]) {\n const p = b > g\n ? [b, g, -1, 2 / 3]\n : [g, b, 0, -1 / 3];\n const q = p[0] > r\n ? [p[0], p[1], p[3], r]\n : [r, p[1], p[2], p[0]];\n const d = q[0] - Math.min(q[3], q[1]);\n return [\n Math.abs(q[2] + (q[3] - q[1]) / (6 * d + Number.EPSILON)),\n d / (q[0] + Number.EPSILON),\n q[0],\n ].map(round3);\n}\n\nexport function rgbaFloatToHSVA01([r, g, b, a]) {\n const hsv = rgbFloatToHSV01([r, g, b]);\n return [...hsv, a];\n}\n\n// window.hsv01ToRGBFloat = hsv01ToRGBFloat;\n// window.rgbFloatToHSV01 = rgbFloatToHSV01;\n\n// Yea, meh!\nexport const hasAlpha = format => format.endsWith('a') || format.startsWith('hex8');\n\nconst cssStringFormats = [\n { re: /^#(?:[0-9a-f]){6}$/i, format: 'hex6' },\n { re: /^(?:[0-9a-f]){6}$/i, format: 'hex6-no-hash' },\n { re: /^#(?:[0-9a-f]){8}$/i, format: 'hex8' },\n { re: /^(?:[0-9a-f]){8}$/i, format: 'hex8-no-hash' },\n { re: /^#(?:[0-9a-f]){3}$/i, format: 'hex3' },\n { re: /^(?:[0-9a-f]){3}$/i, format: 'hex3-no-hash' },\n { re: cssRGBRegex, format: 'css-rgb' },\n { re: cssHSLRegex, format: 'css-hsl' },\n { re: cssRGBARegex, format: 'css-rgba' },\n { re: cssHSLARegex, format: 'css-hsla' },\n];\n\nfunction guessStringColorFormat(v) {\n for (const formatInfo of cssStringFormats) {\n if (formatInfo.re.test(v)) {\n return formatInfo;\n }\n }\n return undefined;\n}\n\nexport function guessFormat(v) {\n switch (typeof v) {\n case 'number':\n console.warn('can not reliably guess format based on a number. You should pass in a format like {format: \"uint32-rgb\"} or {format: \"uint32-rgb\"}');\n return v <= 0xFFFFFF ? 'uint32-rgb' : 'uint32-rgba';\n case 'string': {\n const formatInfo = guessStringColorFormat(v.trim());\n if (formatInfo) {\n return formatInfo.format;\n }\n break;\n }\n case 'object':\n if (v instanceof Uint8Array || v instanceof Uint8ClampedArray) {\n if (v.length === 3) {\n return 'uint8-rgb';\n } else if (v.length === 4) {\n return 'uint8-rgba';\n }\n } else if (v instanceof Float32Array) {\n if (v.length === 3) {\n return 'float-rgb';\n } else if (v.length === 4) {\n return 'float-rgba';\n }\n } else if (Array.isArray(v)) {\n if (v.length === 3) {\n return 'float-rgb';\n } else if (v.length === 4) {\n return 'float-rgba';\n }\n } else {\n if ('r' in v && 'g' in v && 'b' in v) {\n if ('a' in v) {\n return 'object-rgba';\n } else {\n return 'object-rgb';\n }\n }\n }\n }\n throw new Error(`unknown color format: ${v}`);\n}\n\nfunction fixHex6(v) {\n return v.trim(v);\n //const formatInfo = guessStringColorFormat(v.trim());\n //const fix = formatInfo ? formatInfo.fix : v => v;\n //return fix(v.trim());\n}\n\nfunction fixHex8(v) {\n return v.trim(v);\n //const formatInfo = guessStringColorFormat(v.trim());\n //const fix = formatInfo ? formatInfo.fix : v => v;\n //return fix(v.trim());\n}\n\nfunction hex6ToHex3(hex6) {\n return (hex6[1] === hex6[2] &&\n hex6[3] === hex6[4] &&\n hex6[5] === hex6[6])\n ? `#${hex6[1]}${hex6[3]}${hex6[5]}`\n : hex6;\n}\n\nconst hex3RE = /^(#|)([0-9a-f]{3})$/i;\nfunction hex3ToHex6(hex3) {\n const m = hex3RE.exec(hex3);\n if (m) {\n const [, , m2] = m;\n return `#${hex3DigitTo6Digit(m2)}`;\n }\n return hex3;\n}\n\nfunction fixHex3(v) {\n return hex6ToHex3(fixHex6(v));\n}\n\nconst strToRGBObject = (s) => {\n try {\n const json = s.replace(/([a-z])/g, '\"$1\"');\n const rgb = JSON.parse(json);\n if (Number.isNaN(rgb.r) || Number.isNaN(rgb.g) || Number.isNaN(rgb.b)) {\n throw new Error('not {r, g, b}');\n }\n return [true, rgb];\n } catch (e) {\n return [false];\n }\n};\n\nconst strToRGBAObject = (s) => {\n try {\n const json = s.replace(/([a-z])/g, '\"$1\"');\n const rgba = JSON.parse(json);\n if (Number.isNaN(rgba.r) || Number.isNaN(rgba.g) || Number.isNaN(rgba.b) || Number.isNaN(rgba.a)) {\n throw new Error('not {r, g, b, a}');\n }\n return [true, rgba];\n } catch (e) {\n return [false];\n }\n};\n\nconst strToCssRGB = s => {\n const m = cssRGBRegex.exec(s);\n if (!m) {\n return [false];\n }\n const v = [m[1], m[2], m[3]].map(v => parseInt(v));\n const outOfRange = v.find(v => v > 255);\n return [!outOfRange, `rgb(${v.join(', ')})`];\n};\n\nconst strToCssRGBA = s => {\n const m = cssRGBARegex.exec(s);\n if (!m) {\n return [false];\n }\n const v = [m[1], m[2], m[3], m[4]].map((v, i) => i === 3 ? parseFloat(v) : parseInt(v));\n const outOfRange = v.find(v => v > 255);\n return [!outOfRange, `rgba(${v.join(', ')})`];\n};\n\nconst strToCssHSL = s => {\n const m = cssHSLRegex.exec(s);\n if (!m) {\n return [false];\n }\n const v = [m[1], m[2], m[3]].map(v => parseFloat(v));\n const outOfRange = v.find(v => Number.isNaN(v));\n return [!outOfRange, `hsl(${v[0]}, ${v[1]}%, ${v[2]}%)`];\n};\n\nconst strToCssHSLA = s => {\n const m = cssHSLARegex.exec(s);\n if (!m) {\n return [false];\n }\n const v = [m[1], m[2], m[3], m[4]].map(v => parseFloat(v));\n const outOfRange = v.find(v => Number.isNaN(v));\n return [!outOfRange, `hsl(${v[0]} ${v[1]}% ${v[2]}% / ${v[3]})`];\n};\n\nconst rgbObjectToStr = rgb => {\n return `{r:${f3(rgb.r)}, g:${f3(rgb.g)}, b:${f3(rgb.b)}}`;\n};\nconst rgbaObjectToStr = rgba => {\n return `{r:${f3(rgba.r)}, g:${f3(rgba.g)}, b:${f3(rgba.b)}}, a:${f3(rgba.a)}}`;\n};\n\nconst strTo3IntsRE = /^\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*$/;\nconst strTo3Ints = s => {\n const m = strTo3IntsRE.exec(s);\n if (!m) {\n return [false];\n }\n const v = [m[1], m[2], m[3]].map(v => parseInt(v));\n const outOfRange = v.find(v => v > 255);\n return [!outOfRange, v];\n};\n\nconst strTo4IntsRE = /^\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*$/;\nconst strTo4Ints = s => {\n const m = strTo4IntsRE.exec(s);\n if (!m) {\n return [false];\n }\n const v = [m[1], m[2], m[3], m[4]].map(v => parseInt(v));\n const outOfRange = v.find(v => v > 255);\n return [!outOfRange, v];\n};\n\nconst strTo3Floats = s => {\n const numbers = s.split(',').map(s => s.trim());\n const v = numbers.map(v => parseFloat(v));\n if (v.length !== 3) {\n return [false];\n }\n // Note: using isNaN not Number.isNaN\n const badNdx = numbers.findIndex(v => isNaN(v));\n return [badNdx < 0, v.map(v => f3(v))];\n};\n\nconst strTo4Floats = s => {\n const numbers = s.split(',').map(s => s.trim());\n const v = numbers.map(v => parseFloat(v));\n if (v.length !== 4) {\n return [false];\n }\n // Note: using isNaN not Number.isNaN\n const badNdx = numbers.findIndex(v => isNaN(v));\n return [badNdx < 0, v.map(v => f3(v))];\n};\n\nconst strToUint32RGBRegex = /^\\s*(?:0x){0,1}([0-9a-z]{1,6})\\s*$/i;\nconst strToUint32RGB = s => {\n const m = strToUint32RGBRegex.exec(s);\n if (!m) {\n return [false];\n }\n return [true, parseInt(m[1], 16)];\n};\n\nconst strToUint32RGBARegex = /^\\s*(?:0x){0,1}([0-9a-z]{1,8})\\s*$/i;\nconst strToUint32RGBA = s => {\n const m = strToUint32RGBARegex.exec(s);\n if (!m) {\n return [false];\n }\n return [true, parseInt(m[1], 16)];\n};\n\nconst hex6RE = /^\\s*#[a-f0-9]{6}\\s*$|^\\s*#[a-f0-9]{3}\\s*$/i;\nconst hexNoHash6RE = /^\\s*[a-f0-9]{6}\\s*$/i;\nconst hex8RE = /^\\s*#[a-f0-9]{8}\\s*$/i;\nconst hexNoHash8RE = /^\\s*[a-f0-9]{8}\\s*$/i;\n\n// For each format converter\n//\n// fromHex/toHex convert from/to '#RRGGBB'\n//\n// fromHex converts from the string '#RRBBGG' to the format\n// (eg: for uint32-rgb, '#123456' becomes 0x123456)\n//\n// toHex converts from the format to '#RRGGBB'\n// (eg: for uint8-rgb, [16, 33, 50] becomes '#102132')\n//\n//\n// fromStr/toStr convert from/to what's in the input[type=text] element\n//\n// toStr converts from the format to its string representation\n// (eg, for object-rgb, {r: 1, g: 0.5, b:0} becomes \"{r: 1, g: 0.5, b:0}\")\n// ^object ^string\n//\n// fromStr converts its string representation to its format\n// (eg, for object-rgb) \"{r: 1, g: 0.5, b:0}\" becomes {r: 1, g: 0.5, b:0})\n// ^string ^object\n// fromString returns an array which is [valid, v]\n// where valid is true if the string was a valid and v is the converted\n// format if v is true.\n//\n// Note: toStr should convert to \"ideal\" form (whatever that is).\n// (eg, for css-rgb\n// \"{ r: 0.10000, g: 001, b: 0}\" becomes \"{r: 0.1, g: 1, b: 0}\"\n// notice that css-rgb is a string to a string\n// )\nexport const colorFormatConverters = {\n 'hex6': {\n color: {\n from: v => [true, v],\n to: fixHex6,\n },\n text: {\n from: v => [hex6RE.test(v), v.trim()],\n to: v => v,\n },\n },\n 'hex8': {\n color: {\n from: v => [true, v],\n to: fixHex8,\n },\n text: {\n from: v => [hex8RE.test(v), v.trim()],\n to: v => v,\n },\n },\n 'hex3': {\n color: {\n from: v => [true, fixHex3(v)],\n to: hex3ToHex6,\n },\n text: {\n from: v => [hex6RE.test(v), hex6ToHex3(v.trim())],\n to: v => v,\n },\n },\n 'hex6-no-hash': {\n color: {\n from: v => [true, v.substring(1)],\n to: v => `#${fixHex6(v)}`,\n },\n text: {\n from: v => [hexNoHash6RE.test(v), v.trim()],\n to: v => v,\n },\n },\n 'hex8-no-hash': {\n color: {\n from: v => [true, v.substring(1)],\n to: v => `#${fixHex8(v)}`,\n },\n text: {\n from: v => [hexNoHash8RE.test(v), v.trim()],\n to: v => v,\n },\n },\n 'hex3-no-hash': {\n color: {\n from: v => [true, fixHex3(v).substring(1)],\n to: hex3ToHex6,\n },\n text: {\n from: v => [hexNoHash6RE.test(v), hex6ToHex3(v.trim())],\n to: v => v,\n },\n },\n 'uint32-rgb': {\n color: {\n from: v => [true, hexToUint32RGB(v)],\n to: uint32RGBToHex,\n },\n text: {\n from: v => strToUint32RGB(v),\n to: v => `0x${v.toString(16).padStart(6, '0')}`,\n },\n },\n 'uint32-rgba': {\n color: {\n from: v => [true, hexToUint32RGBA(v)],\n to: uint32RGBAToHex,\n },\n text: {\n from: v => strToUint32RGBA(v),\n to: v => `0x${v.toString(16).padStart(8, '0')}`,\n },\n },\n 'uint8-rgb': {\n color: {\n from: v => [true, hexToUint8RGB(v)],\n to: uint8RGBToHex,\n },\n text: {\n from: strTo3Ints,\n to: v => v.join(', '),\n },\n },\n 'uint8-rgba': {\n color: {\n from: v => [true, hexToUint8RGBA(v)],\n to: uint8RGBAToHex,\n },\n text: {\n from: strTo4Ints,\n to: v => v.join(', '),\n },\n },\n 'float-rgb': {\n color: {\n from: v => [true, hexToFloatRGB(v)],\n to: floatRGBToHex,\n },\n text: {\n from: strTo3Floats,\n // need Array.from because map of Float32Array makes a Float32Array\n to: v => Array.from(v).map(v => f3(v)).join(', '),\n },\n },\n 'float-rgba': {\n color: {\n from: v => [true, hexToFloatRGBA(v)],\n to: floatRGBAToHex,\n },\n text: {\n from: strTo4Floats,\n // need Array.from because map of Float32Array makes a Float32Array\n to: v => Array.from(v).map(v => f3(v)).join(', '),\n },\n },\n 'float-hsv': {\n color: {\n from: v => [true, rgbFloatToHSV01(hexToFloatRGB(v))],\n to: v => hsv01ToRGBFloat(floatRGBToHex(v)),\n },\n text: {\n from: strTo3Floats,\n // need Array.from because map of Float32Array makes a Float32Array\n to: v => Array.from(v).map(v => f3(v)).join(', '),\n },\n },\n 'float-hsva': {\n color: {\n from: v => [true, rgbaFloatToHSVA01(hexToFloatRGB(v))],\n to: v => hsva01ToRGBAFloat(floatRGBToHex(v)),\n },\n text: {\n from: strTo4Floats,\n // need Array.from because map of Float32Array makes a Float32Array\n to: v => Array.from(v).map(v => f3(v)).join(', '),\n },\n },\n //'float-hsl': {\n // color: {\n // from: v => [true, rgbFloatToHsl01(hexToFloatRGB(v))],\n // to: v => hsl01ToRGBFloat(floatRGBToHex(v)),\n // },\n // text: {\n // from: strTo3Floats,\n // // need Array.from because map of Float32Array makes a Float32Array\n // to: v => Array.from(v).map(v => f3(v)).join(', '),\n // },\n //},\n //'float-hsla': {\n // color: {\n // from: v => [true, hexToFloatRGBA(v)],\n // to: floatRGBAToHex,\n // },\n // text: {\n // from: strTo4Floats,\n // // need Array.from because map of Float32Array makes a Float32Array\n // to: v => Array.from(v).map(v => f3(v)).join(', '),\n // },\n //},\n 'object-rgb': {\n color: {\n from: v => [true, hexToObjectRGB(v)],\n to: objectRGBToHex,\n },\n text: {\n from: strToRGBObject,\n to: rgbObjectToStr,\n },\n },\n 'object-rgba': {\n color: {\n from: v => [true, hexToObjectRGBA(v)],\n to: objectRGBAToHex,\n },\n text: {\n from: strToRGBAObject,\n to: rgbaObjectToStr,\n },\n },\n 'css-rgb': {\n color: {\n from: v => [true, hexToCssRGB(v)],\n to: cssRGBToHex,\n },\n text: {\n from: strToCssRGB,\n to: v => strToCssRGB(v)[1],\n },\n },\n 'css-rgba': {\n color: {\n from: v => [true, hexToCssRGBA(v)],\n to: cssRGBAToHex,\n },\n text: {\n from: strToCssRGBA,\n to: v => strToCssRGBA(v)[1],\n },\n },\n 'css-hsl': {\n color: {\n from: v => [true, hexToCssHSL(v)],\n to: cssHSLToHex,\n },\n text: {\n from: strToCssHSL,\n to: v => strToCssHSL(v)[1],\n },\n },\n 'css-hsla': {\n color: {\n from: v => [true, hexToCssHSLA(v)],\n to: cssHSLAToHex,\n },\n text: {\n from: strToCssHSLA,\n to: v => strToCssHSLA(v)[1],\n },\n },\n};","import { createElem } from '../libs/elem.js';\nimport View from './View.js';\n\nexport default class ElementView extends View {\n constructor(tag, className) {\n super(createElem(tag, {className}));\n }\n}","import ElementView from '../views/ElementView.js';\nimport LabelController from './LabelController.js';\n\n// TODO: remove this? Should just be user side\nexport default class Canvas extends LabelController {\n #canvasElem;\n\n constructor(name) {\n super('muigui-canvas', name);\n this.#canvasElem = this.add(\n new ElementView('canvas', 'muigui-canvas'),\n ).domElement;\n }\n get canvas() {\n return this.#canvasElem;\n }\n listen() {\n return this;\n }\n}","import { createElem } from '../libs/elem.js';\nimport { identity } from '../libs/conversions.js';\nimport EditView from './EditView.js';\nimport { copyExistingProperties } from '../libs/utils.js';\n\nexport default class ColorView extends EditView {\n #to;\n #from;\n #colorElem;\n #skipUpdate;\n #options = {\n converters: identity,\n };\n\n constructor(setter, options) {\n const colorElem = createElem('input', {\n type: 'color',\n onInput: () => {\n const [valid, newV] = this.#from(colorElem.value);\n if (valid) {\n this.#skipUpdate = true;\n setter.setValue(newV);\n }\n },\n onChange: () => {\n const [valid, newV] = this.#from(colorElem.value);\n if (valid) {\n this.#skipUpdate = true;\n setter.setFinalValue(newV);\n }\n },\n });\n super(createElem('div', {}, [colorElem]));\n this.setOptions(options);\n this.#colorElem = colorElem;\n }\n updateDisplay(v) {\n if (!this.#skipUpdate) {\n this.#colorElem.value = this.#to(v);\n }\n this.#skipUpdate = false;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {converters: {to, from}} = this.#options;\n this.#to = to;\n this.#from = from;\n return this;\n }\n}\n","import {\n colorFormatConverters,\n guessFormat,\n} from '../libs/color-utils.js';\nimport ValueController from './ValueController.js';\nimport TextView from '../views/TextView.js';\nimport ColorView from '../views/ColorView.js';\n\nexport default class Color extends ValueController {\n #colorView;\n #textView;\n\n constructor(object, property, options = {}) {\n super(object, property, 'muigui-color');\n const format = options.format || guessFormat(this.getValue());\n const {color, text} = colorFormatConverters[format];\n this.#colorView = this.add(new ColorView(this, {converters: color}));\n this.#textView = this.add(new TextView(this, {converters: text}));\n this.updateDisplay();\n }\n setOptions(options) {\n const {format} = options;\n if (format) {\n const {color, text} = colorFormatConverters[format];\n this.#colorView.setOptions({converters: color});\n this.#textView.setOptions({converters: text});\n }\n super.setOptions(options);\n return this;\n }\n}","import Controller from './Controller.js';\n\n// This feels like it should be something else like\n// gui.addController({className: 'muigui-divider')};\nexport default class Divider extends Controller {\n constructor() {\n super('muigui-divider');\n }\n}","import Controller from './Controller.js';\n\nexport default class Container extends Controller {\n #controllers;\n #childDestController;\n\n constructor(className) {\n super(className);\n this.#controllers = [];\n this.#childDestController = this;\n }\n get children() {\n return this.#controllers; // should we return a copy?\n }\n get controllers() {\n return this.#controllers.filter(c => !(c instanceof Container));\n }\n get folders() {\n return this.#controllers.filter(c => c instanceof Container);\n }\n reset(recursive = true) {\n for (const controller of this.#controllers) {\n if (!(controller instanceof Container) || recursive) {\n controller.reset(recursive);\n }\n }\n return this;\n }\n updateDisplay() {\n for (const controller of this.#controllers) {\n controller.updateDisplay();\n }\n return this;\n }\n remove(controller) {\n const ndx = this.#controllers.indexOf(controller);\n if (ndx >= 0) {\n const c = this.#controllers.splice(ndx, 1);\n const c0 = c[0];\n const elem = c0.domElement;\n elem.remove();\n c0.setParent(null);\n }\n return this;\n }\n #addControllerImpl(controller) {\n this.domElement.appendChild(controller.domElement);\n this.#controllers.push(controller);\n controller.setParent(this);\n return controller;\n }\n addController(controller) {\n return this.#childDestController.#addControllerImpl(controller);\n }\n pushContainer(container) {\n this.addController(container);\n this.#childDestController = container;\n return container;\n }\n popContainer() {\n this.#childDestController = this.#childDestController.parent;\n return this;\n }\n listen() {\n this.#controllers.forEach(c => {\n c.listen();\n });\n return this;\n }\n}\n","import { createElem } from '../libs/elem.js';\nimport Container from './Container.js';\n\nexport default class Folder extends Container {\n #labelElem;\n\n constructor(name = 'Controls', className = 'muigui-menu') {\n super(className);\n this.#labelElem = createElem('label');\n this.addElem(createElem('button', {\n type: 'button',\n onClick: () => this.toggleOpen(),\n }, [this.#labelElem]));\n this.pushContainer(new Container('muigui-open-container'));\n this.pushContainer(new Container());\n this.name(name);\n this.open();\n }\n open(open = true) {\n this.domElement.classList.toggle('muigui-closed', !open);\n this.domElement.classList.toggle('muigui-open', open);\n return this;\n }\n close() {\n return this.open(false);\n }\n name(name) {\n this.#labelElem.textContent = name;\n return this;\n }\n title(title) {\n return this.name(title);\n }\n toggleOpen() {\n this.open(!this.domElement.classList.contains('muigui-open'));\n return this;\n }\n}\n","import Controller from './Controller.js';\n\n// This feels like it should be something else like\n// gui.addDividing = new Controller()\nexport default class Label extends Controller {\n constructor(text) {\n super('muigui-label');\n this.text(text);\n }\n text(text) {\n this.domElement.textContent = text;\n return this;\n }\n}","function noop() {\n}\n\nexport function computeRelativePosition(elem, event, start) {\n const rect = elem.getBoundingClientRect();\n const x = event.clientX - rect.left;\n const y = event.clientY - rect.top;\n const nx = x / rect.width;\n const ny = y / rect.height;\n start = start || [x, y];\n const dx = x - start[0];\n const dy = y - start[1];\n const ndx = dx / rect.width;\n const ndy = dy / rect.width;\n return {x, y, nx, ny, dx, dy, ndx, ndy};\n}\n\nexport function addTouchEvents(elem, {onDown = noop, onMove = noop, onUp = noop}) {\n let start;\n const pointerMove = function (event) {\n const e = {\n type: 'move',\n ...computeRelativePosition(elem, event, start),\n };\n onMove(e);\n };\n\n const pointerUp = function (event) {\n elem.releasePointerCapture(event.pointerId);\n elem.removeEventListener('pointermove', pointerMove);\n elem.removeEventListener('pointerup', pointerUp);\n\n document.body.style.backgroundColor = '';\n\n onUp('up');\n };\n\n const pointerDown = function (event) {\n elem.addEventListener('pointermove', pointerMove);\n elem.addEventListener('pointerup', pointerUp);\n elem.setPointerCapture(event.pointerId);\n\n const rel = computeRelativePosition(elem, event);\n start = [rel.x, rel.y];\n onDown({\n type: 'down',\n ...rel,\n });\n };\n\n elem.addEventListener('pointerdown', pointerDown);\n\n return function () {\n elem.removeEventListener('pointerdown', pointerDown);\n };\n}","import { createElem, getNewId } from '../libs/elem.js';\nimport { addTouchEvents } from '../libs/touch.js';\nimport { identity } from '../libs/conversions.js';\nimport { clamp } from '../libs/utils.js';\nimport EditView from './EditView.js';\nimport {\n hexToFloatRGB,\n hexToFloatRGBA,\n hsv01ToRGBFloat,\n hsva01ToRGBAFloat,\n rgbFloatToHSV01,\n rgbaFloatToHSVA01,\n floatRGBToHex,\n floatRGBAToHex,\n rgbaFloatToHsla01,\n} from '../libs/color-utils.js';\nimport { copyExistingProperties } from '../libs/utils.js';\n\nconst svg = `\n\n \n \n \n \n \n \n \n \n\n \n \n \n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n \n \n \n \n \n \n \n \n\n`;\n\nfunction connectFillTargets(elem) {\n elem.querySelectorAll('[data-src]').forEach(srcElem => {\n const id = getNewId();\n srcElem.id = id;\n elem.querySelectorAll(`[data-target=${srcElem.dataset.src}]`).forEach(targetElem => {\n targetElem.setAttribute('fill', `url(#${id})`);\n });\n });\n return elem;\n}\n\n// Was originally going to make alpha an option. Issue is\n// hard coded conversions?\nexport default class ColorChooserView extends EditView {\n #to;\n #from;\n #satLevelElem;\n #circleElem;\n #hueUIElem;\n #hueElem;\n #hueCursorElem;\n #alphaUIElem;\n #alphaElem;\n #alphaCursorElem;\n #hsva;\n #skipHueUpdate;\n #skipSatLevelUpdate;\n #skipAlphaUpdate;\n #options = {\n converters: identity,\n alpha: false,\n };\n #convertInternalToHex;\n #convertHexToInternal;\n\n constructor(setter, options) {\n super(createElem('div', {\n innerHTML: svg,\n className: 'muigui-no-scroll',\n }));\n this.#satLevelElem = this.domElement.children[0];\n this.#hueUIElem = this.domElement.children[1];\n this.#alphaUIElem = this.domElement.children[2];\n connectFillTargets(this.#satLevelElem);\n connectFillTargets(this.#hueUIElem);\n connectFillTargets(this.#alphaUIElem);\n this.#circleElem = this.$('.muigui-color-chooser-circle');\n this.#hueElem = this.$('[data-src=muigui-color-chooser-hue]');\n this.#hueCursorElem = this.$('.muigui-color-chooser-hue-cursor');\n this.#alphaElem = this.$('[data-src=muigui-color-chooser-alpha]');\n this.#alphaCursorElem = this.$('.muigui-color-chooser-alpha-cursor');\n\n const handleSatLevelChange = (e) => {\n const s = clamp(e.nx, 0, 1);\n const v = clamp(e.ny, 0, 1);\n this.#hsva[1] = s;\n this.#hsva[2] = (1 - v);\n this.#skipHueUpdate = true;\n this.#skipAlphaUpdate = true;\n const [valid, newV] = this.#from(this.#convertInternalToHex(this.#hsva));\n if (valid) {\n setter.setValue(newV);\n }\n };\n\n const handleHueChange = (e) => {\n const h = clamp(e.nx, 0, 1);\n this.#hsva[0] = h;\n this.#skipSatLevelUpdate = true;\n this.#skipAlphaUpdate = true;\n const [valid, newV] = this.#from(this.#convertInternalToHex(this.#hsva));\n if (valid) {\n setter.setValue(newV);\n }\n };\n\n const handleAlphaChange = (e) => {\n const a = clamp(e.nx, 0, 1);\n this.#hsva[3] = a;\n this.#skipHueUpdate = true;\n this.#skipSatLevelUpdate = true;\n const [valid, newV] = this.#from(this.#convertInternalToHex(this.#hsva));\n if (valid) {\n setter.setValue(newV);\n }\n };\n\n addTouchEvents(this.#satLevelElem, {\n onDown: handleSatLevelChange,\n onMove: handleSatLevelChange,\n });\n addTouchEvents(this.#hueUIElem, {\n onDown: handleHueChange,\n onMove: handleHueChange,\n });\n addTouchEvents(this.#alphaUIElem, {\n onDown: handleAlphaChange,\n onMove: handleAlphaChange,\n });\n this.setOptions(options);\n }\n updateDisplay(newV) {\n if (!this.#hsva) {\n this.#hsva = this.#convertHexToInternal(this.#to(newV));\n }\n {\n const [h, s, v, a = 1] = this.#convertHexToInternal(this.#to(newV));\n // Don't copy the hue if it was un-computable.\n if (!this.#skipHueUpdate) {\n this.#hsva[0] = s > 0.001 && v > 0.001 ? h : this.#hsva[0];\n }\n if (!this.#skipSatLevelUpdate) {\n this.#hsva[1] = s;\n this.#hsva[2] = v;\n }\n if (!this.#skipAlphaUpdate) {\n this.#hsva[3] = a;\n }\n }\n {\n const [h, s, v, a] = this.#hsva;\n const [hue, sat, lum] = rgbaFloatToHsla01(hsva01ToRGBAFloat(this.#hsva));\n\n if (!this.#skipHueUpdate) {\n this.#hueCursorElem.setAttribute('transform', `translate(${h * 64}, 0)`);\n }\n this.#hueElem.children[0].setAttribute('stop-color', `hsl(${hue * 360} 0% 100% / ${a})`);\n this.#hueElem.children[1].setAttribute('stop-color', `hsl(${hue * 360} 100% 50% / ${a})`);\n if (!this.#skipAlphaUpdate) {\n this.#alphaCursorElem.setAttribute('transform', `translate(${a * 64}, 0)`);\n }\n this.#alphaElem.children[0].setAttribute('stop-color', `hsl(${hue * 360} ${sat * 100}% ${lum * 100}% / 0)`);\n this.#alphaElem.children[1].setAttribute('stop-color', `hsl(${hue * 360} ${sat * 100}% ${lum * 100}% / 1)`);\n\n if (!this.#skipSatLevelUpdate) {\n this.#circleElem.setAttribute('cx', `${s * 64}`);\n this.#circleElem.setAttribute('cy', `${(1 - v) * 48}`);\n }\n }\n this.#skipHueUpdate = false;\n this.#skipSatLevelUpdate = false;\n this.#skipAlphaUpdate = false;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {converters: {to, from}, alpha} = this.#options;\n this.#alphaUIElem.style.display = alpha ? '' : 'none';\n this.#convertInternalToHex = alpha\n ? v => floatRGBAToHex(hsva01ToRGBAFloat(v))\n : v => floatRGBToHex(hsv01ToRGBFloat(v));\n this.#convertHexToInternal = alpha\n ? v => rgbaFloatToHSVA01(hexToFloatRGBA(v))\n : v => rgbFloatToHSV01(hexToFloatRGB(v));\n this.#to = to;\n this.#from = from;\n return this;\n }\n}\n","import ElementView from '../views/ElementView.js';\nimport ValueController from './ValueController.js';\nimport { copyExistingProperties } from '../libs/utils.js';\nimport { createElem } from '../libs/elem.js';\n/*\n\nholder = new TabHolder\ntab = holder.add(new Tab(\"name\"))\ntab.add(...)\n\n\npc = new PopdownController\ntop = pc.add(new Row())\ntop.add(new Button());\nvalues = topRow.add(new Div())\nbottom = pc.add(new Row());\n\n\n\npc = new PopdownController\npc.addTop\npc.addTop\n\npc.addBottom\n\n\n*/\n\nexport default class PopDownController extends ValueController {\n #top;\n #valuesView;\n #checkboxElem;\n #bottom;\n #options = {\n open: false,\n };\n\n constructor(object, property, options = {}) {\n super(object, property, 'muigui-pop-down-controller');\n /*\n [ValueView\n [[B][values]] upper row\n [[ visual ]] lower row\n ]\n */\n this.#top = this.add(new ElementView('div', 'muigui-pop-down-top'));\n// this.#top.add(new CheckboxView(makeSetter(this.#options, 'open')));\n const checkboxElem = this.#top.addElem(createElem('input', {\n type: 'checkbox',\n onChange: () => {\n this.#options.open = checkboxElem.checked;\n this.updateDisplay();\n },\n }));\n this.#checkboxElem = checkboxElem;\n this.#valuesView = this.#top.add(new ElementView('div', 'muigui-pop-down-values'));\n const container = new ElementView('div', 'muigui-pop-down-bottom muigui-open-container');\n this.#bottom = new ElementView('div');\n container.add(this.#bottom);\n this.add(container);\n this.setOptions(options);\n }\n setKnobColor(bgCssColor/*, fgCssColor*/) {\n if (this.#checkboxElem) {\n this.#checkboxElem.style = `\n --range-color: ${bgCssColor};\n --value-bg-color: ${bgCssColor};\n `;\n }\n }\n updateDisplay() {\n super.updateDisplay();\n const {open} = this.#options;\n this.domElement.children[1].classList.toggle('muigui-open', open);\n this.domElement.children[1].classList.toggle('muigui-closed', !open);\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n super.setOptions(options);\n this.updateDisplay();\n }\n addTop(view) {\n return this.#valuesView.add(view);\n }\n addBottom(view) {\n return this.#bottom.add(view);\n }\n}","/* eslint-disable no-underscore-dangle */\nimport {\n colorFormatConverters,\n guessFormat,\n hasAlpha,\n hexToUint8RGB,\n hslToRgbUint8,\n rgbUint8ToHsl,\n uint8RGBToHex,\n} from '../libs/color-utils.js';\nimport ColorChooserView from '../views/ColorChooserView.js';\nimport TextView from '../views/TextView.js';\nimport PopDownController from './PopDownController.js';\n\nexport default class ColorChooser extends PopDownController {\n #colorView;\n #textView;\n #to;\n\n constructor(object, property, options = {}) {\n super(object, property, 'muigui-color-chooser');\n const format = options.format || guessFormat(this.getValue());\n const {color, text} = colorFormatConverters[format];\n this.#to = color.to;\n this.#textView = new TextView(this, {converters: text, alpha: hasAlpha(format)});\n this.#colorView = new ColorChooserView(this, {converters: color, alpha: hasAlpha(format)});\n this.addTop(this.#textView);\n this.addBottom(this.#colorView);\n // WTF! FIX!\n this.___setKnobHelper = true;\n this.updateDisplay();\n }\n #setKnobHelper() {\n if (this.#to) {\n const hex6Or8 = this.#to(this.getValue());\n const alpha = hex6Or8.length === 9 ? hex6Or8.substring(7, 9) : 'FF';\n const hsl = rgbUint8ToHsl(hexToUint8RGB(hex6Or8));\n hsl[2] = (hsl[2] + 50) % 100;\n const hex = uint8RGBToHex(hslToRgbUint8(hsl));\n this.setKnobColor(`${hex6Or8.substring(0, 7)}${alpha}`, hex);\n }\n }\n updateDisplay() {\n super.updateDisplay();\n if (this.___setKnobHelper) {\n this.#setKnobHelper();\n }\n }\n setOptions(options) {\n super.setOptions(options);\n return this;\n }\n}\n","import css from './styles/muigui.css.js';\nimport {createElem} from './libs/elem.js';\nimport {createController} from './controllers/create-controller.js';\nimport {\n mapRange,\n makeRangeConverters,\n makeRangeOptions,\n makeMinMaxPair,\n} from './libs/utils.js';\nimport {\n converters\n} from './libs/conversions.js';\nimport {\n hasAlpha,\n guessFormat,\n} from './libs/color-utils.js';\nimport Canvas from './controllers/Canvas.js';\nimport Color from './controllers/Color.js';\nimport Divider from './controllers/Divider.js';\nimport Folder from './controllers/Folder.js';\nimport Label from './controllers/Label.js';\nimport Controller from './controllers/Controller.js';\nimport ColorChooser from './controllers/ColorChooser.js';\n\nimport Column from './layout/Column.js';\nimport Frame from './layout/Frame.js';\nimport Grid from './layout/Grid.js';\nimport Row from './layout/Row.js';\n\nexport {\n Column,\n Frame,\n Grid,\n Row,\n};\n\nfunction camelCaseToSnakeCase(id) {\n return id\n .replace(/(.)([A-Z][a-z]+)/g, '$1_$2')\n .replace(/([a-z0-9])([A-Z])/g, '$1_$2')\n .toLowerCase();\n}\n\nfunction prepName(name) {\n return camelCaseToSnakeCase(name.toString()).replaceAll('_', ' ');\n}\n\nexport class GUIFolder extends Folder {\n add(object, property, ...args) {\n const controller = object instanceof Controller\n ? object\n : createController(object, property, ...args).name(prepName(property));\n return this.addController(controller);\n }\n addCanvas(name) {\n return this.addController(new Canvas(name));\n }\n addColor(object, property, options = {}) {\n const value = object[property];\n if (hasAlpha(options.format || guessFormat(value))) {\n return this\n .addController(new ColorChooser(object, property, options))\n .name(prepName(property));\n } else {\n return this\n .addController(new Color(object, property, options))\n .name(prepName(property));\n }\n }\n addDivider() {\n return this.addController(new Divider());\n }\n addFolder(name) {\n return this.addController(new GUIFolder(name));\n }\n addLabel(text) {\n return this.addController(new Label(text));\n }\n addButton(name, fn) {\n const o = {fn};\n return this.add(o, 'fn').name(prepName(name));\n }\n}\n\nclass MuiguiElement extends HTMLElement {\n constructor() {\n super();\n this.shadow = this.attachShadow({mode: 'open'});\n }\n}\n\ncustomElements.define('muigui-element', MuiguiElement);\n\nconst baseStyleSheet = new CSSStyleSheet();\n//baseStyleSheet.replaceSync(css.default);\nconst userStyleSheet = new CSSStyleSheet();\n\nfunction makeStyleSheetUpdater(styleSheet) {\n let newCss;\n let newCssPromise;\n\n function updateStyle() {\n if (newCss && !newCssPromise) {\n const s = newCss;\n newCss = undefined;\n newCssPromise = styleSheet.replace(s).then(() => {\n newCssPromise = undefined;\n updateStyle();\n });\n }\n }\n\n return function updateStyleSheet(css) {\n newCss = css;\n updateStyle();\n };\n}\n\nconst updateBaseStyle = makeStyleSheetUpdater(baseStyleSheet);\nconst updateUserStyle = makeStyleSheetUpdater(userStyleSheet);\n\nfunction getTheme(name) {\n const { include, css: cssStr } = css.themes[name];\n return `${include.map(m => css[m]).join('\\n')} : css.default}\\n${cssStr || ''}`;\n}\n\nexport class GUI extends GUIFolder {\n static converters = converters;\n static mapRange = mapRange;\n static makeRangeConverters = makeRangeConverters;\n static makeRangeOptions = makeRangeOptions;\n static makeMinMaxPair = makeMinMaxPair;\n #localStyleSheet = new CSSStyleSheet();\n\n constructor(options = {}) {\n super('Controls', 'muigui-root');\n if (options instanceof HTMLElement) {\n options = {parent: options};\n }\n const {\n autoPlace = true,\n width,\n title = 'Controls',\n } = options;\n let {\n parent,\n } = options;\n\n if (width) {\n this.domElement.style.width = /^\\d+$/.test(width) ? `${width}px` : width;\n }\n if (parent === undefined && autoPlace) {\n parent = document.body;\n this.domElement.classList.add('muigui-auto-place');\n }\n if (parent) {\n const muiguiElement = createElem('muigui-element');\n muiguiElement.shadowRoot.adoptedStyleSheets = [this.#localStyleSheet, baseStyleSheet, userStyleSheet];\n muiguiElement.shadow.appendChild(this.domElement);\n parent.appendChild(muiguiElement);\n }\n if (title) {\n this.title(title);\n }\n this.#localStyleSheet.replaceSync(css.default);\n this.domElement.classList.add('muigui', 'muigui-colors');\n }\n setStyle(css) {\n this.#localStyleSheet.replace(css);\n }\n static setBaseStyles(css) {\n updateBaseStyle(css);\n }\n static getBaseStyleSheet() {\n return baseStyleSheet;\n }\n static setUserStyles(css) {\n updateUserStyle(css);\n }\n static getUserStyleSheet() {\n return userStyleSheet;\n }\n setTheme(name) {\n this.setStyle(getTheme(name));\n }\n static setTheme(name) {\n GUI.setBaseStyles(getTheme(name));\n }\n}\n\nexport default GUI;\n","import Button from './Button.js';\nimport Checkbox from './Checkbox.js';\nimport TextNumber from './TextNumber.js';\nimport Select from './Select.js';\nimport Range from './Range.js';\nimport Text from './Text.js';\n\n// const isConversion = o => typeof o.to === 'function' && typeof o.from === 'function';\n\n/**\n * possible inputs\n * add(o, p, min: number, max: number)\n * add(o, p, min: number, max: number, step: number)\n * add(o, p, array: [value])\n * add(o, p, array: [[key, value]])\n *\n * @param {*} object\n * @param {string} property\n * @param {...any} args\n * @returns {Controller}\n */\nexport function createController(object, property, ...args) {\n const [arg1] = args;\n if (Array.isArray(arg1)) {\n return new Select(object, property, {keyValues: arg1});\n }\n if (arg1 && arg1.keyValues) {\n return new Select(object, property, {keyValues: arg1.keyValues});\n }\n\n const t = typeof object[property];\n switch (t) {\n case 'number':\n if (typeof args[0] === 'number' && typeof args[1] === 'number') {\n const min = args[0];\n const max = args[1];\n const step = args[2];\n return new Range(object, property, {min, max, ...(step && {step})});\n }\n return args.length === 0\n ? new TextNumber(object, property, ...args)\n : new Range(object, property, ...args);\n case 'boolean':\n return new Checkbox(object, property, ...args);\n case 'function':\n return new Button(object, property, ...args);\n case 'string':\n return new Text(object, property, ...args);\n case 'undefined':\n throw new Error(`no property named ${property}`);\n default:\n throw new Error(`unhandled type ${t} for property ${property}`);\n }\n}","function noop() {\n}\n\nconst keyDirections = {\n ArrowLeft: [-1, 0],\n ArrowRight: [1, 0],\n ArrowUp: [0, -1],\n ArrowDown: [0, 1],\n};\n\n// This probably needs to be global\nexport function addKeyboardEvents(elem, {onDown = noop, onUp = noop}) {\n const keyDown = function (event) {\n const mult = event.shiftKey ? 10 : 1;\n const [dx, dy] = (keyDirections[event.key] || [0, 0]).map(v => v * mult);\n const fn = event.type === 'keydown' ? onDown : onUp;\n fn({\n type: event.type.substring(3),\n dx,\n dy,\n event,\n });\n };\n\n elem.addEventListener('keydown', keyDown);\n elem.addEventListener('keyup', keyDown);\n\n return function () {\n elem.removeEventListener('keydown', keyDown);\n elem.removeEventListener('keyup', keyDown);\n };\n}","export function assert(truthy, msg = '') {\n if (!truthy) {\n throw new Error(msg);\n }\n}","import { assert } from '../libs/assert.js';\n\nfunction getEllipsePointForAngle(cx, cy, rx, ry, phi, theta) {\n const m = Math.abs(rx) * Math.cos(theta);\n const n = Math.abs(ry) * Math.sin(theta);\n\n return [\n cx + Math.cos(phi) * m - Math.sin(phi) * n,\n cy + Math.sin(phi) * m + Math.cos(phi) * n,\n ];\n}\n\nfunction getEndpointParameters(cx, cy, rx, ry, phi, theta, dTheta) {\n const [x1, y1] = getEllipsePointForAngle(cx, cy, rx, ry, phi, theta);\n const [x2, y2] = getEllipsePointForAngle(cx, cy, rx, ry, phi, theta + dTheta);\n\n const fa = Math.abs(dTheta) > Math.PI ? 1 : 0;\n const fs = dTheta > 0 ? 1 : 0;\n\n return { x1, y1, x2, y2, fa, fs };\n}\n\nexport function arc(cx, cy, r, start, end) {\n assert(Math.abs(start - end) <= Math.PI * 2);\n assert(start >= -Math.PI && start <= Math.PI * 2);\n assert(start <= end);\n assert(end >= -Math.PI && end <= Math.PI * 4);\n\n const { x1, y1, x2, y2, fa, fs } = getEndpointParameters(cx, cy, r, r, 0, start, end - start);\n return Math.abs(Math.abs(start - end) - Math.PI * 2) > Number.EPSILON\n ? `M${cx} ${cy} L${x1} ${y1} A ${r} ${r} 0 ${fa} ${fs} ${x2} ${y2} L${cx} ${cy}`\n : `M${x1} ${y1} L${x1} ${y1} A ${r} ${r} 0 ${fa} ${fs} ${x2} ${y2}`;\n}\n","import { identity } from '../libs/conversions.js';\nimport { createElem } from '../libs/elem.js';\nimport { addKeyboardEvents } from '../libs/keyboard.js';\nimport { arc } from '../libs/svg.js';\nimport { addTouchEvents } from '../libs/touch.js';\nimport { createWheelHelper } from '../libs/wheel.js';\nimport { clamp, copyExistingProperties, euclideanModulo, lerp, stepify } from '../libs/utils.js';\nimport EditView from './EditView.js';\n\nconst svg = `\n\n \n \n \n \n \n \n \n\n`;\n\nconst twoPiMod = v => euclideanModulo(v + Math.PI, Math.PI * 2) - Math.PI;\n\nexport default class DirectionView extends EditView {\n #arrowElem;\n #rangeElem;\n #lastV;\n #wrap;\n #options = {\n step: 1,\n min: -180,\n max: 180,\n\n /*\n --------\n / -π/2 \\\n / | \\\n |<- -π * |\n | * 0 ->| zero is down the positive X axis\n |<- +π * |\n \\ | /\n \\ π/2 /\n --------\n */\n dirMin: -Math.PI,\n dirMax: Math.PI,\n //dirMin: Math.PI * 0.5,\n //dirMax: Math.PI * 2.5,\n //dirMin: -Math.PI * 0.75, // test 10:30 to 7:30\n //dirMax: Math.PI * 0.75,\n //dirMin: Math.PI * 0.75, // test 7:30 to 10:30\n //dirMax: -Math.PI * 0.75,\n //dirMin: -Math.PI * 0.75, // test 10:30 to 1:30\n //dirMax: -Math.PI * 0.25,\n //dirMin: Math.PI * 0.25, // test 4:30 to 7:30\n //dirMax: Math.PI * 0.75,\n //dirMin: Math.PI * 0.75, // test 4:30 to 7:30\n //dirMax: Math.PI * 0.25,\n wrap: undefined,\n converters: identity,\n };\n\n constructor(setter, options = {}) {\n const wheelHelper = createWheelHelper();\n super(createElem('div', {\n className: 'muigui-direction muigui-no-scroll',\n innerHTML: svg,\n onWheel: e => {\n e.preventDefault();\n const {min, max, step} = this.#options;\n const delta = wheelHelper(e, step);\n let tempV = this.#lastV + delta;\n if (this.#wrap) {\n tempV = euclideanModulo(tempV - min, max - min) + min;\n }\n const newV = clamp(stepify(tempV, v => v, step), min, max);\n setter.setValue(newV);\n },\n }));\n const handleTouch = (e) => {\n const {min, max, step, dirMin, dirMax} = this.#options;\n const nx = e.nx * 2 - 1;\n const ny = e.ny * 2 - 1;\n const a = Math.atan2(ny, nx);\n\n const center = (dirMin + dirMax) / 2;\n\n const centeredAngle = twoPiMod(a - center);\n const centeredStart = twoPiMod(dirMin - center);\n const diff = dirMax - dirMin;\n\n const n = clamp((centeredAngle - centeredStart) / (diff), 0, 1);\n const newV = stepify(min + (max - min) * n, v => v, step);\n setter.setValue(newV);\n };\n addTouchEvents(this.domElement, {\n onDown: handleTouch,\n onMove: handleTouch,\n });\n addKeyboardEvents(this.domElement, {\n onDown: (e) => {\n const {min, max, step} = this.#options;\n const newV = clamp(stepify(this.#lastV + e.dx * step, v => v, step), min, max);\n setter.setValue(newV);\n },\n });\n this.#arrowElem = this.$('#muigui-arrow');\n this.#rangeElem = this.$('#muigui-range');\n this.setOptions(options);\n }\n updateDisplay(v) {\n this.#lastV = v;\n const {min, max} = this.#options;\n const n = (v - min) / (max - min);\n const angle = lerp(this.#options.dirMin, this.#options.dirMax, n);\n this.#arrowElem.style.transform = `rotate(${angle}rad)`;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {dirMin, dirMax, wrap} = this.#options;\n this.#wrap = wrap !== undefined\n ? wrap\n : Math.abs(dirMin - dirMax) >= Math.PI * 2 - Number.EPSILON;\n const [min, max] = dirMin < dirMax ? [dirMin, dirMax] : [dirMax , dirMin];\n this.#rangeElem.setAttribute('d', arc(0, 0, 28.87, min, max));\n }\n}\n","import { createElem } from '../libs/elem.js';\nimport { makeId } from '../libs/ids.js';\nimport EditView from './EditView.js';\n\nexport default class RadioGridView extends EditView {\n #values;\n\n constructor(setter, keyValues, cols = 3) {\n const values = [];\n const name = makeId();\n super(createElem('div', {}, keyValues.map(([key, value], ndx) => {\n values.push(value);\n return createElem('label', {}, [\n createElem('input', {\n type: 'radio',\n name,\n value: ndx,\n onChange: function () {\n if (this.checked) {\n setter.setFinalValue(that.#values[this.value]);\n }\n },\n }),\n createElem('button', {\n type: 'button',\n textContent: key,\n onClick: function () {\n this.previousElementSibling.click();\n },\n }),\n ]);\n })));\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const that = this;\n this.#values = values;\n this.cols(cols);\n }\n updateDisplay(v) {\n const ndx = this.#values.indexOf(v);\n for (let i = 0; i < this.domElement.children.length; ++i) {\n this.domElement.children[i].children[0].checked = i === ndx;\n }\n }\n cols(cols) {\n this.domElement.style.gridTemplateColumns = `repeat(${cols}, 1fr)`;\n }\n}\n","export function onResize(elem, callback) {\n new ResizeObserver(() => {\n callback({rect: elem.getBoundingClientRect(), elem});\n }).observe(elem);\n}\n\nexport function onResizeSVGNoScale(elem, hAnchor, vAnchor, callback) {\n onResize(elem, ({rect}) => {\n const {width, height} = rect;\n elem.setAttribute('viewBox', `-${width * hAnchor} -${height * vAnchor} ${width} ${height}`);\n callback({elem, rect});\n });\n}\n\nexport function onResizeCanvas(elem, callback) {\n onResize(elem, ({rect}) => {\n const {width, height} = rect;\n elem.width = width;\n elem.height = height;\n callback({elem, rect});\n });\n}\n","import { createElem } from '../libs/elem.js';\nimport { addKeyboardEvents } from '../libs/keyboard.js';\nimport { addTouchEvents } from '../libs/touch.js';\nimport { createWheelHelper } from '../libs/wheel.js';\nimport { onResizeSVGNoScale } from '../libs/resize-helpers.js';\nimport { clamp, copyExistingProperties, stepify } from '../libs/utils.js';\nimport EditView from './EditView.js';\n\nconst svg = `\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n`;\n\nfunction createSVGTicks(start, end, step, min, max, height) {\n const p = [];\n if (start < min) {\n start += stepify(min - start, v => v, step);\n }\n end = Math.min(end, max);\n for (let i = start; i <= end; i += step) {\n p.push(`M${i} 0 l0 ${height}`);\n }\n return p.join(' ');\n}\n\nfunction createSVGNumbers(start, end, unitSize, unit, minusSize, min, max, labelFn) {\n const texts = [];\n if (start < min) {\n start += stepify(min - start, v => v, unitSize);\n }\n end = Math.min(end, max);\n const digits = Math.max(0, -Math.log10(unit));\n const f = v => labelFn(v.toFixed(digits));\n for (let i = start; i <= end; i += unitSize) {\n texts.push(`= 0 ? i : (i - minusSize / 2) }\" y=\"0\">${f(i / unitSize * unit)}`);\n }\n return texts.join('\\n');\n}\n\nfunction computeSizeOfMinus(elem) {\n const oldHTML = elem.innerHTML;\n elem.innerHTML = '- ';\n const text = elem.querySelector('text');\n const size = text.getComputedTextLength();\n elem.innerHTML = oldHTML;\n return size;\n}\n\nexport default class SliderView extends EditView {\n #svgElem;\n #originElem;\n #ticksElem;\n #thicksElem;\n #numbersElem;\n #leftGradElem;\n #rightGradElem;\n #width;\n #height;\n #lastV;\n #minusSize;\n #options = {\n min: -100,\n max: 100,\n step: 1,\n unit: 10,\n unitSize: 10,\n ticksPerUnit: 5,\n labelFn: v => v,\n tickHeight: 1,\n limits: true,\n thicksColor: undefined,\n orientation: undefined,\n };\n\n constructor(setter, options) {\n const wheelHelper = createWheelHelper();\n super(createElem('div', {\n innerHTML: svg,\n className: 'muigui-no-v-scroll',\n onWheel: e => {\n e.preventDefault();\n const {min, max, step} = this.#options;\n const delta = wheelHelper(e, step);\n const newV = clamp(stepify(this.#lastV + delta, v => v, step), min, max);\n setter.setValue(newV);\n },\n }));\n this.#svgElem = this.$('svg');\n this.#originElem = this.$('#muigui-origin');\n this.#ticksElem = this.$('#muigui-ticks');\n this.#thicksElem = this.$('#muigui-thicks');\n this.#numbersElem = this.$('#muigui-numbers');\n this.#leftGradElem = this.$('#muigui-left-grad');\n this.#rightGradElem = this.$('#muigui-right-grad');\n this.setOptions(options);\n let startV;\n addTouchEvents(this.domElement, {\n onDown: () => {\n startV = this.#lastV;\n },\n onMove: (e) => {\n const {min, max, unitSize, unit, step} = this.#options;\n const newV = clamp(stepify(startV - e.dx / unitSize * unit, v => v, step), min, max);\n setter.setValue(newV);\n },\n });\n addKeyboardEvents(this.domElement, {\n onDown: (e) => {\n const {min, max, step} = this.#options;\n const newV = clamp(stepify(this.#lastV + e.dx * step, v => v, step), min, max);\n setter.setValue(newV);\n },\n });\n onResizeSVGNoScale(this.#svgElem, 0.5, 0, ({rect: {width}}) => {\n this.#leftGradElem.setAttribute('x', -width / 2);\n this.#rightGradElem.setAttribute('x', width / 2 - 20);\n this.#minusSize = computeSizeOfMinus(this.#numbersElem);\n this.#width = width;\n this.#updateSlider();\n });\n }\n // |--------V--------|\n // . . | . . . | . . . |\n //\n #updateSlider() {\n // There's no size if ResizeObserver has not fired yet.\n if (!this.#width || this.#lastV === undefined) {\n return;\n }\n const {\n labelFn,\n limits,\n min,\n max,\n orientation,\n tickHeight,\n ticksPerUnit,\n unit,\n unitSize,\n thicksColor,\n } = this.#options;\n const unitsAcross = Math.ceil(this.#width / unitSize);\n const center = this.#lastV;\n const centerUnitSpace = center / unit;\n const startUnitSpace = Math.round(centerUnitSpace - unitsAcross);\n const endUnitSpace = startUnitSpace + unitsAcross * 2;\n const start = startUnitSpace * unitSize;\n const end = endUnitSpace * unitSize;\n const minUnitSpace = limits ? min * unitSize / unit : start;\n const maxUnitSpace = limits ? max * unitSize / unit : end;\n const height = labelFn(1) === '' ? 10 : 5;\n if (ticksPerUnit > 1) {\n this.#ticksElem.setAttribute('d', createSVGTicks(start, end, unitSize / ticksPerUnit, minUnitSpace, maxUnitSpace, height * tickHeight));\n }\n this.#thicksElem.style.stroke = thicksColor; //setAttribute('stroke', thicksColor);\n this.#thicksElem.setAttribute('d', createSVGTicks(start, end, unitSize, minUnitSpace, maxUnitSpace, height));\n this.#numbersElem.innerHTML = createSVGNumbers(start, end, unitSize, unit, this.#minusSize, minUnitSpace, maxUnitSpace, labelFn);\n this.#originElem.setAttribute('transform', `translate(${-this.#lastV * unitSize / unit} 0)`);\n this.#svgElem.classList.toggle('muigui-slider-up', orientation === 'up');\n }\n updateDisplay(v) {\n this.#lastV = v;\n this.#updateSlider();\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n return this;\n }\n}\n","import { createElem } from '../libs/elem.js';\nimport { addTouchEvents } from '../libs/touch.js';\nimport { onResizeSVGNoScale } from '../libs/resize-helpers.js';\nimport EditView from './EditView.js';\n\nconst svg = `\n\n \n \n \n \n \n\n`;\n\nexport default class Vec2View extends EditView {\n #svgElem;\n #arrowElem;\n #circleElem;\n #lastV = [];\n\n constructor(setter) {\n super(createElem('div', {\n innerHTML: svg,\n className: 'muigui-no-scroll',\n }));\n const onTouch = (e) => {\n const {width, height} = this.#svgElem.getBoundingClientRect();\n const nx = e.nx * 2 - 1;\n const ny = e.ny * 2 - 1;\n setter.setValue([nx * width * 0.5, ny * height * 0.5]);\n };\n addTouchEvents(this.domElement, {\n onDown: onTouch,\n onMove: onTouch,\n });\n this.#svgElem = this.$('svg');\n this.#arrowElem = this.$('#muigui-arrow');\n this.#circleElem = this.$('#muigui-circle');\n onResizeSVGNoScale(this.#svgElem, 0.5, 0.5, () => this.#updateDisplayImpl);\n }\n #updateDisplayImpl() {\n const [x, y] = this.#lastV;\n this.#arrowElem.setAttribute('d', `M0,0L${x},${y}`);\n this.#circleElem.setAttribute('transform', `translate(${x}, ${y})`);\n }\n updateDisplay(v) {\n this.#lastV[0] = v[0];\n this.#lastV[1] = v[1];\n this.#updateDisplayImpl();\n }\n}\n","import GUI from './muigui.js';\n\nimport ColorChooser from './controllers/ColorChooser.js';\nimport Direction from './controllers/Direction.js';\nimport RadioGrid from './controllers/RadioGrid.js';\nimport Range from './controllers/Range.js';\nimport Select from './controllers/Select.js';\nimport Slider from './controllers/Slider.js';\nimport TextNumber from './controllers/TextNumber.js';\nimport Vec2 from './controllers/Vec2.js';\n\nGUI.ColorChooser = ColorChooser;\nGUI.Direction = Direction;\nGUI.RadioGrid = RadioGrid;\nGUI.Range = Range;\nGUI.Select = Select;\nGUI.Slider = Slider;\nGUI.TextNumber = TextNumber;\nGUI.Vec2 = Vec2;\n\nexport default GUI;","import { identity } from '../libs/conversions.js';\nimport DirectionView from '../views/DirectionView.js';\nimport NumberView from '../views/NumberView.js';\n// import ValueController from './ValueController.js';\nimport PopDownController from './PopDownController.js';\n\n\n// deg2rad\n// where is 0\n// range (0, 360), (-180, +180), (0,0) Really this is a range\n\nexport default class Direction extends PopDownController {\n #options;\n constructor(object, property, options) {\n super(object, property, 'muigui-direction');\nthis.#options = options; // FIX\n this.addTop(new NumberView(this,\nidentity));\n this.addBottom(new DirectionView(this, options));\n this.updateDisplay();\n }\n}\n\n","import RadioGridView from '../views/RadioGridView.js';\nimport ValueController from './ValueController.js';\nimport { convertToKeyValues } from '../libs/key-values.js';\n\nexport default class RadioGrid extends ValueController {\n constructor(object, property, options) {\n super(object, property, 'muigui-radio-grid');\n const valueIsNumber = typeof this.getValue() === 'number';\n const {\n keyValues: keyValuesInput,\n cols = 3,\n } = options;\n const keyValues = convertToKeyValues(keyValuesInput, valueIsNumber);\n this.add(new RadioGridView(this, keyValues, cols));\n this.updateDisplay();\n }\n}","import ValueController from './ValueController.js';\nimport NumberView from '../views/NumberView.js';\nimport SliderView from '../views/SliderView.js';\n\nexport default class Slider extends ValueController {\n constructor(object, property, options = {}) {\n super(object, property, 'muigui-slider');\n this.add(new SliderView(this, options));\n this.add(new NumberView(this, options));\n this.updateDisplay();\n }\n}\n","import NumberView from '../views/NumberView.js';\nimport Vec2View from '../views/Vec2View.js';\nimport PopDownController from './PopDownController.js';\nimport { strToNumber } from '../libs/conversions.js';\n\n// TODO: zoom with wheel and pinch?\n// TODO: grid?\n// // options\n// scale:\n// range: number (both x and y + /)\n// range: array (min, max)\n// xRange:\n// deg/rad/turn\n\nexport default class Vec2 extends PopDownController {\n constructor(object, property) {\n super(object, property, 'muigui-vec2');\n\n const makeSetter = (ndx) => {\n return {\n setValue: (v) => {\n const newV = this.getValue();\n newV[ndx] = v;\n this.setValue(newV);\n },\n setFinalValue: (v) => {\n const newV = this.getValue();\n newV[ndx] = v;\n this.setFinalValue(newV);\n },\n };\n };\n\n this.addTop(new NumberView(makeSetter(0), {\n converters: {\n to: v => v[0],\n from: strToNumber.from,\n },\n }));\n this.addTop(new NumberView(makeSetter(1), {\n converters: {\n to: v => v[1],\n from: strToNumber.from,\n },\n }));\n this.addBottom(new Vec2View(this));\n this.updateDisplay();\n }\n}\n"],"names":["css","default","themes","include","float","form","none","createElem","tag","attrs","children","elem","document","createElement","key","value","Object","entries","startsWith","eventName","substring","toLowerCase","addEventListener","passive","k","v","undefined","setAttribute","child","appendChild","setElemProps","nextId","removeArrayElem","array","ndx","indexOf","splice","clamp","min","max","Math","isTypedArray","SharedArrayBuffer","a","buffer","ArrayBuffer","stepify","from","step","round","euclideanModulo","n","copyExistingProperties","dst","src","mapRange","inMin","inMax","outMin","outMax","makeRangeConverters","to","makeRangeOptions","converters","identity","makeMinMaxPair","gui","properties","minPropName","maxPropName","options","guiMinRange","minRange","valueMinRange","minGui","add","onChange","maxGui","setValue","View","domElement","childDestElem","views","constructor","this","addElem","removeElem","removeChild","pushSubElem","popSubElem","parentElement","view","push","remove","pushSubView","popSubView","setOptions","updateDisplayIfNeeded","newV","ignoreCache","$","selector","querySelector","Controller","changeFns","finishChangeFns","parent","className","super","classList","setParent","enable","disabled","show","toggle","hide","closest","forEach","querySelectorAll","disable","fn","removeChange","onFinishChange","removeFinishChange","callListeners","fns","call","emitChange","object","property","controller","emitFinalChange","updateDisplay","getColors","toCamelCase","s","replace","m","m1","toUpperCase","div","colors","fromEntries","map","style","color","getComputedStyle","Button","buttonElem","name","type","onClick","textContent","arraysEqual","b","length","i","EditView","oldV","updateCheck","checkArrayNeedsUpdate","needUpdate","copyArrayElementsFromTo","checkTypedArrayNeedsUpdate","once","checkObjectNeedsUpdate","checkValueNeedsUpdate","getUpdateCheckForType","Array","isArray","bind","CheckboxView","checkboxElem","setter","id","onInput","checked","setFinalValue","tasks","tasksToRemove","Set","requestId","processing","processTasks","task","has","size","queueProcessing","clear","requestAnimationFrame","makeId","ValueView","LabelController","nameElem","for","title","tooltip","tip","ValueController","initialValue","listening","updateFn","getValue","setValueImpl","isDifferent","keys","assign","reset","listen","set","removeTask","Checkbox","strToNumber","toString","parseFloat","Number","isNaN","radToDeg","PI","createWheelHelper","wheelAccum","e","wheelScale","deltaY","delta","floor","abs","sign","NumberView","skipUpdate","NEGATIVE_INFINITY","POSITIVE_INFINITY","wheelHelper","handleInput","onWheel","preventDefault","valid","outV","setFn","inRange","TextNumber","textView","SelectView","values","keyValues","selectedIndex","convertToKeyValues","valueIsNumber","Select","keyValuesInput","RangeView","validV","Range","TextView","Text","lerp","t","fract","f0","toFixed","f3","hexToUint32RGB","parseInt","hexToUint32RGBA","hexToUint8RGB","uint8RGBToHex","padStart","join","hexToUint8RGBA","uint8RGBAToHex","hexToFloatRGB","floatRGBToHex","hexToFloatRGBA","floatRGBAToHex","scaleAndClamp","hexToObjectRGB","r","g","hexToObjectRGBA","hexToCssRGB","cssRGBRegex","hexToCssRGBA","cssRGBARegex","hexToCssHSL","hsl","rgbUint8ToHsl","hexToCssHSLA","hsla","rgbaUint8ToHsla","cssHSLRegex","cssHSLARegex","hslToRgbUint8","h","l","f","rgbFloatToHsl01","d","rgbaFloatToHsla01","rgb","rgba","hsv01ToRGBFloat","hue","sat","val","hsva01ToRGBAFloat","alpha","round3","rgbFloatToHSV01","p","q","EPSILON","rgbaFloatToHSVA01","hasAlpha","format","endsWith","cssStringFormats","re","guessFormat","console","warn","formatInfo","test","guessStringColorFormat","trim","Uint8Array","Uint8ClampedArray","Float32Array","Error","fixHex6","fixHex8","hex6ToHex3","hex6","hex3RE","hex3ToHex6","hex3","exec","m2","fixHex3","strToCssRGB","find","strToCssRGBA","strToCssHSL","strToCssHSLA","strTo3IntsRE","strTo4IntsRE","strTo3Floats","numbers","split","badNdx","findIndex","strTo4Floats","strToUint32RGBRegex","strToUint32RGBARegex","hex6RE","hexNoHash6RE","hex8RE","hexNoHash8RE","colorFormatConverters","text","hex8","strToUint32RGB","strToUint32RGBA","json","JSON","parse","hslaToRgbaUint8","ElementView","Canvas","canvasElem","canvas","ColorView","colorElem","Color","colorView","Divider","Container","controllers","childDestController","filter","c","folders","recursive","c0","addControllerImpl","addController","pushContainer","container","popContainer","Folder","labelElem","toggleOpen","open","close","contains","Label","noop","computeRelativePosition","event","start","rect","getBoundingClientRect","x","clientX","left","y","clientY","top","nx","width","ny","height","dx","dy","ndy","addTouchEvents","onDown","onMove","onUp","pointerMove","pointerUp","releasePointerCapture","pointerId","removeEventListener","body","backgroundColor","pointerDown","setPointerCapture","rel","connectFillTargets","srcElem","dataset","targetElem","ColorChooserView","satLevelElem","circleElem","hueUIElem","hueElem","hueCursorElem","alphaUIElem","alphaElem","alphaCursorElem","hsva","skipHueUpdate","skipSatLevelUpdate","skipAlphaUpdate","convertInternalToHex","convertHexToInternal","innerHTML","handleSatLevelChange","handleHueChange","handleAlphaChange","lum","display","PopDownController","valuesView","bottom","setKnobColor","bgCssColor","addTop","addBottom","ColorChooser","___setKnobHelper","setKnobHelper","hex6Or8","hex","prepName","camelCaseToSnakeCase","replaceAll","GUIFolder","args","arg1","createController","addCanvas","addColor","addDivider","addFolder","addLabel","addButton","o","MuiguiElement","HTMLElement","shadow","attachShadow","mode","customElements","define","baseStyleSheet","CSSStyleSheet","userStyleSheet","makeStyleSheetUpdater","styleSheet","newCss","newCssPromise","updateStyle","then","updateBaseStyle","updateUserStyle","getTheme","cssStr","GUI","static","localStyleSheet","autoPlace","muiguiElement","shadowRoot","adoptedStyleSheets","replaceSync","setStyle","setTheme","setBaseStyles","keyDirections","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","addKeyboardEvents","keyDown","mult","shiftKey","assert","truthy","msg","getEllipsePointForAngle","cx","cy","rx","ry","phi","theta","cos","sin","arc","end","x1","y1","x2","y2","fa","fs","dTheta","getEndpointParameters","twoPiMod","DirectionView","arrowElem","rangeElem","lastV","wrap","dirMin","dirMax","tempV","handleTouch","atan2","center","angle","transform","RadioGridView","cols","that","previousElementSibling","click","gridTemplateColumns","onResize","callback","ResizeObserver","observe","onResizeSVGNoScale","hAnchor","vAnchor","createSVGTicks","SliderView","svgElem","originElem","ticksElem","thicksElem","numbersElem","leftGradElem","rightGradElem","minusSize","unit","unitSize","ticksPerUnit","labelFn","tickHeight","limits","thicksColor","orientation","startV","oldHTML","getComputedTextLength","computeSizeOfMinus","updateSlider","unitsAcross","ceil","centerUnitSpace","startUnitSpace","minUnitSpace","maxUnitSpace","stroke","texts","digits","log10","createSVGNumbers","Vec2View","onTouch","updateDisplayImpl","Direction","RadioGrid","Slider","Vec2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H,WAClBxG,EAAKhE,GAAOT,EACZ2D,KAAK6F,cAAc/E,EAAK,IAK9Bd,KAAKsX,OAAO,IAAItO,EAAW6X,EAAW,GAAI,CACxCliB,WAAY,CACVF,GAAIpC,GAAKA,EAAE,GACXsB,KAAMqK,EAAYrK,SAGtBqC,KAAKsX,OAAO,IAAItO,EAAW6X,EAAW,GAAI,CACxCliB,WAAY,CACVF,GAAIpC,GAAKA,EAAE,GACXsB,KAAMqK,EAAYrK,SAGtBqC,KAAKuX,UAAU,IAAI+I,GAAStgB,OAC5BA,KAAKgD,eACN"} \ No newline at end of file diff --git a/dist/0.x/muigui.module.js b/dist/0.x/muigui.module.js index 7f1ca46..432eb77 100644 --- a/dist/0.x/muigui.module.js +++ b/dist/0.x/muigui.module.js @@ -1,4 +1,4 @@ -/* muigui@0.0.17, license MIT */ +/* muigui@0.0.20, license MIT */ var css = { default: ` .muigui { @@ -85,6 +85,7 @@ var css = { font-size: var(--font-size); box-sizing: border-box; line-height: 100%; + white-space: nowrap; } .muigui * { box-sizing: inherit; @@ -288,7 +289,7 @@ var css = { } .muigui-closed>.muigui-open-container>* { transition: all 0.1s ease-out; - margin-top: -100%; + margin-top: -1000%; } /* ---- popdown ---- */ @@ -1208,11 +1209,13 @@ class Button extends Controller { } name(name) { this.#buttonElem.textContent = name; + return this; } setOptions(options) { copyExistingProperties(this.#options, options); const {name} = this.#options; this.#buttonElem.textContent = name; + return this; } } @@ -2620,6 +2623,9 @@ class Canvas extends LabelController { get canvas() { return this.#canvasElem; } + listen() { + return this; + } } class ColorView extends EditView { @@ -2761,6 +2767,12 @@ class Container extends Controller { this.#childDestController = this.#childDestController.parent; return this; } + listen() { + this.#controllers.forEach(c => { + c.listen(); + }); + return this; + } } class Folder extends Container { @@ -3269,11 +3281,22 @@ class Row extends Layout { } } +function camelCaseToSnakeCase(id) { + return id + .replace(/(.)([A-Z][a-z]+)/g, '$1_$2') + .replace(/([a-z0-9])([A-Z])/g, '$1_$2') + .toLowerCase(); +} + +function prepName(name) { + return camelCaseToSnakeCase(name.toString()).replaceAll('_', ' '); +} + class GUIFolder extends Folder { add(object, property, ...args) { const controller = object instanceof Controller ? object - : createController(object, property, ...args); + : createController(object, property, ...args).name(prepName(property)); return this.addController(controller); } addCanvas(name) { @@ -3282,9 +3305,13 @@ class GUIFolder extends Folder { addColor(object, property, options = {}) { const value = object[property]; if (hasAlpha(options.format || guessFormat(value))) { - return this.addController(new ColorChooser(object, property, options)); + return this + .addController(new ColorChooser(object, property, options)) + .name(prepName(property)); } else { - return this.addController(new Color(object, property, options)); + return this + .addController(new Color(object, property, options)) + .name(prepName(property)); } } addDivider() { @@ -3298,7 +3325,7 @@ class GUIFolder extends Folder { } addButton(name, fn) { const o = {fn}; - return this.add(o, 'fn').name(name); + return this.add(o, 'fn').name(prepName(name)); } } diff --git a/dist/0.x/muigui.module.js.map b/dist/0.x/muigui.module.js.map index 175f67b..d084b6b 100644 --- a/dist/0.x/muigui.module.js.map +++ b/dist/0.x/muigui.module.js.map @@ -1 +1 @@ -{"version":3,"file":"muigui.module.js","sources":["../../src/styles/muigui.css.js","../../src/libs/elem.js","../../src/libs/utils.js","../../../src/views/View.ts","../../src/controllers/Controller.js","../../src/controllers/Button.js","../../src/views/EditView.js","../../src/views/CheckboxView.js","../../src/libs/taskrunner.js","../../src/libs/ids.js","../../src/views/ValueView.js","../../src/controllers/LabelController.js","../../src/controllers/ValueController.js","../../src/controllers/Checkbox.js","../../src/libs/conversions.js","../../src/libs/wheel.js","../../src/views/NumberView.js","../../src/controllers/TextNumber.js","../../src/views/SelectView.js","../../src/libs/key-values.js","../../src/controllers/Select.js","../../src/views/RangeView.js","../../src/controllers/Range.js","../../src/views/TextView.js","../../src/controllers/Text.js","../../src/controllers/create-controller.js","../../src/libs/color-utils.js","../../src/views/ElementView.js","../../src/controllers/Canvas.js","../../src/views/ColorView.js","../../src/controllers/Color.js","../../src/controllers/Divider.js","../../src/controllers/Container.js","../../src/controllers/Folder.js","../../src/controllers/Label.js","../../src/libs/touch.js","../../src/views/ColorChooserView.js","../../src/controllers/PopDownController.js","../../src/controllers/ColorChooser.js","../../src/layout/Layout.js","../../src/layout/Column.js","../../src/layout/Frame.js","../../src/layout/Grid.js","../../src/layout/Row.js","../../src/muigui.js","../../src/libs/keyboard.js","../../src/libs/assert.js","../../src/libs/svg.js","../../src/views/DirectionView.js","../../src/controllers/Direction.js","../../src/views/RadioGridView.js","../../src/controllers/RadioGrid.js","../../src/libs/resize-helpers.js","../../src/views/SliderView.js","../../src/controllers/Slider.js","../../src/views/Vec2View.js","../../src/controllers/Vec2.js","../../src/libs/graph.js","../../src/libs/monitor.js","../../../src/esm.ts"],"sourcesContent":["export default {\n default: `\n.muigui {\n --bg-color: #ddd;\n --color: #222;\n --contrast-color: #eee;\n --value-color: #145 ;\n --value-bg-color: #eeee;\n --disabled-color: #999;\n --menu-bg-color: #f8f8f8;\n --menu-sep-color: #bbb;\n --hover-bg-color: #999;\n --focus-color: #8BF;\n --range-color: #AAA;\n --invalid-color: #FF0000;\n --selected-color: rgb(255, 255, 255, 0.9);\n\n --button-bg-color: var(--value-bg-color);\n\n --image-open: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjNDQ0OyIgeD0iMjAlIiB5PSI0NSUiIHdpZHRoPSI2MCUiIGhlaWdodD0iMTAlIj48L3JlY3Q+Cjwvc3ZnPg==);\n --image-closed: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjNDQ0OyIgeD0iNDUlIiB5PSIyMCUiIHdpZHRoPSIxMCUiIGhlaWdodD0iNjAlIj48L3JlY3Q+CiAgPHJlY3Qgc3R5bGU9ImZpbGw6ICM0NDQ7IiB4PSIyMCUiIHk9IjQ1JSIgd2lkdGg9IjYwJSIgaGVpZ2h0PSIxMCUiPjwvcmVjdD4KPC9zdmc+);\n --image-checkerboard: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjNDA0MDQwOyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSI+PC9yZWN0PgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjODA4MDgwOyIgeD0iMCIgeT0iMCIgd2lkdGg9IjUwJSIgaGVpZ2h0PSI1MCUiPjwvcmVjdD4KICA8cmVjdCBzdHlsZT0iZmlsbDogIzgwODA4MDsiIHg9IjUwJSIgeT0iNTAlIiB3aWR0aD0iNTAlIiBoZWlnaHQ9IjUwJSI+PC9yZWN0Pgo8L3N2Zz4=);\n\n --range-left-color: var(--value-color);\n --range-right-color: var(--value-bg-color); \n --range-right-hover-color: var(--hover-bg-color);\n --button-image: \n linear-gradient(\n rgba(255, 255, 255, 1), rgba(0, 0, 0, 0.2)\n );\n\n color: var(--color);\n background-color: var(--bg-color);\n}\n\n@media (prefers-color-scheme: dark) {\n .muigui {\n --bg-color: #222222;\n --color: #dddddd;\n --contrast-color: #000;\n --value-color: #43e5f7;\n --value-bg-color: #444444;\n --disabled-color: #666666;\n --menu-bg-color: #080808;\n --menu-sep-color: #444444;\n --hover-bg-color: #666666;\n --focus-color: #458; /*#88AAFF*/;\n --range-color: #888888;\n --invalid-color: #FF6666;\n --selected-color: rgba(255, 255, 255, 0.3);\n\n --button-bg-color: var(--value-bg-color);\n\n --range-left-color: var(--value-color);\n --range-right-color: var(--value-bg-color); \n --range-right-hover-color: var(--hover-bg-color);\n --button-image: linear-gradient(\n rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.4)\n );\n\n color: var(--color);\n background-color: var(--bg-color);\n\n --image-closed: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjREREOyIgeD0iMjAlIiB5PSI0NSUiIHdpZHRoPSI2MCUiIGhlaWdodD0iMTAlIj48L3JlY3Q+Cjwvc3ZnPg==);\n --image-open: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjREREOyIgeD0iNDUlIiB5PSIyMCUiIHdpZHRoPSIxMCUiIGhlaWdodD0iNjAlIj48L3JlY3Q+CiAgPHJlY3Qgc3R5bGU9ImZpbGw6ICNEREQ7IiB4PSIyMCUiIHk9IjQ1JSIgd2lkdGg9IjYwJSIgaGVpZ2h0PSIxMCUiPjwvcmVjdD4KPC9zdmc+);\n }\n}\n\n.muigui {\n --width: 250px;\n --label-width: 45%;\n --number-width: 40%;\n\n --font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Arial, sans-serif;\n --font-size: 11px;\n --font-family-mono: Menlo, Monaco, Consolas, \"Droid Sans Mono\", monospace;\n --font-size-mono: 11px;\n\n --line-height: 1.7em;\n --border-radius: 0px;\n\n width: var(--width);\n font-family: var(--font-family);\n font-size: var(--font-size);\n box-sizing: border-box;\n line-height: 100%;\n}\n.muigui * {\n box-sizing: inherit;\n}\n\n.muigui-no-scroll {\n touch-action: none;\n}\n.muigui-no-h-scroll {\n touch-action: pan-y;\n}\n.muigui-no-v-scroll {\n touch-action: pan-x;\n}\n\n.muigui-invalid-value {\n background-color: red !important;\n color: white !important;\n}\n\n.muigui-grid {\n display: grid;\n}\n.muigui-rows {\n display: flex;\n flex-direction: column;\n\n min-height: 20px;\n border: 2px solid red;\n}\n.muigui-columns {\n display: flex;\n flex-direction: row;\n\n height: 20px;\n border: 2px solid green;\n}\n.muigui-rows>*,\n.muigui-columns>* {\n flex: 1 1 auto;\n align-items: stretch;\n min-height: 0;\n min-width: 0;\n}\n\n.muigui-row {\n border: 2px solid yellow;\n min-height: 10px\n}\n.muigui-column {\n border: 2px solid lightgreen;\n}\n\n/* -------- */\n\n.muigui-show { /* */ }\n.muigui-hide { \n display: none !important;\n}\n.muigui-disabled {\n pointer-events: none;\n --color: var(--disabled-color) !important;\n --value-color: var(--disabled-color) !important;\n --range-left-color: var(--disabled-color) !important;\n}\n\n.muigui canvas,\n.muigui svg {\n display: block;\n border-radius: var(--border-radius);\n}\n.muigui canvas {\n background-color: var(--value-bg-color);\n}\n\n.muigui-controller {\n min-width: 0;\n min-height: var(--line-height);\n}\n.muigui-root {\n z-index: 1;\n}\n.muigui-root,\n.muigui-menu {\n display: flex;\n flex-direction: column;\n position: relative;\n user-select: none;\n height: fit-content;\n margin: 0;\n padding-bottom: 0.1em;\n border-radius: var(--border-radius);\n}\n.muigui-menu {\n border-bottom: 1px solid var(--menu-sep-color);\n}\n\n.muigui-root>button:nth-child(1),\n.muigui-menu>button:nth-child(1) {\n border-top: 1px solid var(--menu-sep-color);\n border-bottom: 1px solid var(--menu-sep-color);\n position: relative;\n text-align: left;\n color: var(--color);\n background-color: var(--menu-bg-color);\n min-height: var(--line-height);\n padding: 0.2em;\n cursor: pointer;\n border-radius: var(--border-radius);\n}\n.muigui-root>div:nth-child(2),\n.muigui-menu>div:nth-child(2) {\n flex: 1 1 auto;\n}\n\n.muigui-controller {\n margin-left: 0.2em;\n margin-right: 0.2em;\n}\n.muigui-root.muigui-controller,\n.muigui-menu.muigui-controller {\n margin-left: 0;\n margin-right: 0;\n}\n.muigui-controller>*:nth-child(1) {\n flex: 1 0 var(--label-width);\n min-width: 0;\n /* white-space: pre; why?? */\n}\n.muigui-controller>label:nth-child(1) {\n place-content: center start;\n display: inline-grid;\n overflow: hidden;\n}\n.muigui-controller>*:nth-child(2) {\n flex: 1 1 75%;\n min-width: 0;\n}\n\n/* -----------------------------------------\n a label controller is [[label][value]]\n*/\n\n.muigui-label-controller {\n display: flex;\n margin: 0.4em 0 0.4em 0;\n word-wrap: initial;\n align-items: stretch;\n}\n\n.muigui-value {\n display: flex;\n align-items: stretch;\n}\n.muigui-value>* {\n flex: 1 1 auto;\n min-width: 0;\n}\n.muigui-value>*:nth-child(1) {\n flex: 1 1 calc(100% - var(--number-width));\n}\n.muigui-value>*:nth-child(2) {\n flex: 1 1 var(--number-width);\n margin-left: 0.2em;\n}\n\n/* fix! */\n.muigui-open>button>label::before,\n.muigui-closed>button>label::before {\n content: \"X\";\n color: rgba(0, 0, 0, 0);\n background-color: var(--range-color);\n border-radius: 0.2em;\n width: 1.25em;\n margin-right: 0.25em;\n height: 1.25em; /*var(--line-height);*/\n display: inline-grid;\n place-content: center start;\n pointer-events: none;\n}\n.muigui-open>button>label::before {\n background-image: var(--image-open);\n}\n.muigui-closed>button>label::before {\n background-image: var(--image-closed);\n}\n\n.muigui-open>.muigui-open-container {\n transition: all 0.1s ease-out;\n overflow: auto;\n height: 100%;\n}\n.muigui-closed>.muigui-open-container {\n transition: all 0.1s ease-out;\n overflow: hidden;\n min-height: 0;\n}\n.muigui-open>.muigui-open-container>* {\n transition: all 0.1s ease-out;\n margin-top: 0px;\n}\n.muigui-closed>.muigui-open-container>* {\n transition: all 0.1s ease-out;\n margin-top: -100%;\n}\n\n/* ---- popdown ---- */\n\n.muigui-pop-down-top {\n display: flex;\n}\n/* fix? */\n.muigui-value>*:nth-child(1).muigui-pop-down-top {\n flex: 0;\n}\n.muigui-closed .muigui-pop-down-bottom {\n max-height: 0;\n}\n\n.muigui-value .muigui-pop-down-bottom {\n margin: 0;\n}\n\n.muigui-pop-down-values {\n min-width: 0;\n display: flex;\n}\n.muigui-pop-down-values>* {\n flex: 1 1 auto;\n min-width: 0;\n}\n\n.muigui-value.muigui-pop-down-controller {\n flex-direction: column;\n}\n\n.muigui-pop-down-top input[type=checkbox] {\n -webkit-appearance: none;\n appearance: none;\n width: auto;\n color: var(--value-color);\n background-color: var(--value-bg-color);\n background-image: var(--image-checkerboard);\n background-size: 10px 10px;\n background-position: 0 0, 0 5px, 5px -5px, -5px 0px;\n\n cursor: pointer;\n\n display: grid;\n place-content: center;\n margin: 0;\n font: inherit;\n color: currentColor;\n width: 1.7em;\n height: 1.7em;\n transform: translateY(-0.075em);\n}\n\n.muigui-pop-down-top input[type=checkbox]::before {\n content: \"+\";\n display: grid;\n place-content: center;\n border-radius: calc(var(--border-radius) + 2px);\n border-left: 1px solid rgba(255,255,255,0.3);\n border-top: 1px solid rgba(255,255,255,0.3);\n border-bottom: 1px solid rgba(0,0,0,0.2);\n border-right: 1px solid rgba(0,0,0,0.2);\n background-color: var(--range-color);\n color: var(--value-bg-color);\n width: calc(var(--line-height) - 4px);\n height: calc(var(--line-height) - 4px);\n}\n\n.muigui-pop-down-top input[type=checkbox]:checked::before {\n content: \"X\";\n}\n\n\n/* ---- select ---- */\n\n.muigui select,\n.muigui option,\n.muigui input,\n.muigui button {\n color: var(--value-color);\n background-color: var(--value-bg-color);\n font-family: var(--font-family);\n font-size: var(--font-size);\n border: none;\n margin: 0;\n border-radius: var(--border-radius);\n}\n.muigui select {\n appearance: none;\n margin: 0;\n margin-left: 0; /*?*/\n overflow: hidden; /* Safari */\n}\n\n.muigui select:focus,\n.muigui input:focus,\n.muigui button:focus {\n outline: 1px solid var(--focus-color);\n}\n\n.muigui select:hover,\n.muigui option:hover,\n.muigui input:hover,\n.muigui button:hover {\n background-color: var(--hover-bg-color); \n}\n\n/* ------ [ label ] ------ */\n\n.muigui-label {\n border-top: 1px solid var(--menu-sep-color);\n border-bottom: 1px solid var(--menu-sep-color);\n padding-top: 0.4em;\n padding-bottom: 0.3em;\n place-content: center start;\n background-color: var(--menu-bg-color);\n white-space: pre;\n border-radius: var(--border-radius);\n}\n\n/* ------ [ divider] ------ */\n\n.muigui-divider {\n min-height: 6px;\n border-top: 2px solid var(--menu-sep-color);\n margin-top: 6px;\n}\n\n/* ------ [ button ] ------ */\n\n.muigui-button {\n display: grid;\n padding: 2px 0 2px 0;\n}\n.muigui-button button {\n border: none;\n color: var(--value-color);\n background-color: var(--button-bg-color);\n background-image: var(--button-image);\n cursor: pointer;\n place-content: center center;\n height: var(--line-height);\n}\n\n/* ------ [ color ] ------ */\n\n.muigui-color>div {\n overflow: hidden;\n position: relative;\n margin-left: 0;\n margin-right: 0; /* why? */\n max-width: var(--line-height);\n border-radius: var(--border-radius);\n}\n\n.muigui-color>div:focus-within {\n outline: 1px solid var(--focus-color);\n}\n\n.muigui-color input[type=color] {\n border: none;\n padding: 0;\n background: inherit;\n cursor: pointer;\n position: absolute;\n width: 200%;\n left: -10px;\n top: -10px;\n height: 200%;\n}\n.muigui-disabled canvas,\n.muigui-disabled svg,\n.muigui-disabled img,\n.muigui-disabled .muigui-color input[type=color] {\n opacity: 0.2;\n}\n\n/* ------ [ checkbox ] ------ */\n\n.muigui-checkbox>label:nth-child(2) {\n display: grid;\n place-content: center start;\n margin: 0;\n}\n\n.muigui-checkbox input[type=checkbox] {\n -webkit-appearance: none;\n appearance: none;\n width: auto;\n color: var(--value-color);\n background-color: var(--value-bg-color);\n cursor: pointer;\n\n display: grid;\n place-content: center;\n margin: 0;\n font: inherit;\n color: currentColor;\n width: 1.7em;\n height: 1.7em;\n transform: translateY(-0.075em);\n}\n\n.muigui-checkbox input[type=checkbox]::before {\n content: \"\";\n color: var(--value-color);\n display: grid;\n place-content: center;\n}\n\n.muigui-checkbox input[type=checkbox]:checked::before {\n content: \"✔\";\n}\n\n.muigui input[type=number]::-webkit-inner-spin-button, \n.muigui input[type=number]::-webkit-outer-spin-button { \n -webkit-appearance: none;\n appearance: none;\n margin: 0; \n}\n.muigui input[type=number] {\n -moz-appearance: textfield;\n}\n\n/* ------ [ radio grid ] ------ */\n\n.muigui-radio-grid>div {\n display: grid;\n gap: 2px;\n}\n\n.muigui-radio-grid input {\n appearance: none;\n display: none;\n}\n\n.muigui-radio-grid button {\n color: var(--color);\n width: 100%;\n text-align: left;\n}\n\n.muigui-radio-grid input:checked + button {\n color: var(--value-color);\n background-color: var(--selected-color);\n}\n\n/* ------ [ color-chooser ] ------ */\n\n.muigui-color-chooser-cursor {\n stroke-width: 1px;\n stroke: white;\n fill: none;\n}\n.muigui-color-chooser-circle {\n stroke-width: 1px;\n stroke: white;\n fill: none;\n}\n\n\n/* ------ [ vec2 ] ------ */\n\n.muigui-vec2 svg {\n background-color: var(--value-bg-color);\n}\n\n.muigui-vec2-axis {\n stroke: 1px;\n stroke: var(--focus-color);\n}\n\n.muigui-vec2-line {\n stroke-width: 1px;\n stroke: var(--value-color);\n fill: var(--value-color);\n}\n\n/* ------ [ direction ] ------ */\n\n.muigui-direction svg {\n background-color: rgba(0,0,0,0.2);\n}\n\n.muigui-direction:focus-within svg {\n outline: none;\n}\n.muigui-direction-range {\n fill: var(--value-bg-color);\n}\n.muigui-direction svg:focus {\n outline: none;\n}\n.muigui-direction svg:focus .muigui-direction-range {\n stroke-width: 0.5px;\n stroke: var(--focus-color);\n}\n\n.muigui-direction-arrow {\n fill: var(--value-color);\n}\n\n/* ------ [ slider ] ------ */\n\n.muigui-slider>div {\n display: flex;\n align-items: stretch;\n height: var(--line-height);\n}\n.muigui-slider svg {\n flex: 1 1 auto;\n}\n.muigui-slider .muigui-slider-up #muigui-orientation {\n transform: scale(1, -1) translateY(-100%);\n}\n\n.muigui-slider .muigui-slider-up #muigui-number-orientation {\n transform: scale(1,-1);\n}\n\n.muigui-ticks {\n stroke: var(--range-color);\n}\n.muigui-thicks {\n stroke: var(--color);\n stroke-width: 2px;\n}\n.muigui-svg-text {\n fill: var(--color);\n font-size: 7px;\n}\n.muigui-mark {\n fill: var(--value-color);\n}\n\n/* ------ [ range ] ------ */\n\n\n.muigui-range input[type=range] {\n -webkit-appearance: none;\n appearance: none;\n background-color: transparent;\n}\n\n.muigui-range input[type=range]::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n border-radius: calc(var(--border-radius) + 2px);\n border-left: 1px solid rgba(255,255,255,0.3);\n border-top: 1px solid rgba(255,255,255,0.3);\n border-bottom: 1px solid rgba(0,0,0,0.2);\n border-right: 1px solid rgba(0,0,0,0.2);\n background-color: var(--range-color);\n margin-top: calc((var(--line-height) - 6px) / -2);\n width: calc(var(--line-height) - 6px);\n height: calc(var(--line-height) - 6px);\n}\n\n.muigui-range input[type=range]::-webkit-slider-runnable-track {\n -webkit-appearance: none;\n appearance: none;\n border: 1px solid var(--menu-sep-color);\n height: 2px;\n}\n\n\n/* dat.gui style - doesn't work on Safari iOS */\n\n/*\n.muigui-range input[type=range] {\n cursor: ew-resize;\n overflow: hidden;\n}\n\n.muigui-range input[type=range] {\n -webkit-appearance: none;\n appearance: none;\n background-color: var(--range-right-color);\n margin: 0;\n}\n.muigui-range input[type=range]:hover {\n background-color: var(--range-right-hover-color);\n}\n\n.muigui-range input[type=range]::-webkit-slider-runnable-track {\n -webkit-appearance: none;\n appearance: none;\n height: max-content;\n color: var(--range-left-color);\n margin-top: -1px;\n}\n\n.muigui-range input[type=range]::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 0px;\n height: max-content;\n box-shadow: -1000px 0 0 1000px var(--range-left-color);\n}\n*/\n\n/* FF */\n/*\n.muigui-range input[type=range]::-moz-slider-progress {\n background-color: var(--range-left-color); \n}\n.muigui-range input[type=range]::-moz-slider-thumb {\n height: max-content;\n width: 0;\n border: none;\n box-shadow: -1000px 0 0 1000px var(--range-left-color);\n box-sizing: border-box;\n}\n*/\n\n.muigui-checkered-background {\n background-color: #404040;\n background-image:\n linear-gradient(45deg, #808080 25%, transparent 25%),\n linear-gradient(-45deg, #808080 25%, transparent 25%),\n linear-gradient(45deg, transparent 75%, #808080 75%),\n linear-gradient(-45deg, transparent 75%, #808080 75%);\n background-size: 16px 16px;\n background-position: 0 0, 0 8px, 8px -8px, -8px 0px;\n}\n\n/* ---------------------------------------------------------- */\n\n/* needs to be at bottom to take precedence */\n.muigui-auto-place {\n max-height: 100%;\n position: fixed;\n top: 0;\n right: 15px;\n z-index: 100001;\n}\n\n`,\nthemes: {\n default: {\n include: ['default'],\n css: `\n `,\n },\n float: {\n include: ['default'],\n css: `\n :root {\n color-scheme: light dark,\n }\n\n .muigui {\n --width: 400px;\n --bg-color: initial;\n --label-width: 25%;\n --number-width: 20%;\n }\n\n input,\n .muigui-label-controller>label {\n text-shadow:\n -1px -1px 0 var(--contrast-color),\n 1px -1px 0 var(--contrast-color),\n -1px 1px 0 var(--contrast-color),\n 1px 1px 0 var(--contrast-color);\n }\n\n .muigui-controller > label:nth-child(1) {\n place-content: center end;\n margin-right: 1em;\n }\n\n .muigui-value > :nth-child(2) {\n margin-left: 1em;\n }\n\n .muigui-root>*:nth-child(1) {\n display: none;\n }\n\n .muigui-range input[type=range]::-webkit-slider-thumb {\n border-radius: 1em;\n }\n\n .muigui-range input[type=range]::-webkit-slider-runnable-track {\n -webkit-appearance: initial;\n appearance: none;\n border: 1px solid rgba(0, 0, 0, 0.25);\n height: 2px;\n }\n\n .muigui-colors {\n --value-color: var(--color );\n --value-bg-color: rgba(0, 0, 0, 0.1);\n --disabled-color: #cccccc;\n --menu-bg-color: rgba(0, 0, 0, 0.1);\n --menu-sep-color: #bbbbbb;\n --hover-bg-color: rgba(0, 0, 0, 0);\n --invalid-color: #FF0000;\n --selected-color: rgba(0, 0, 0, 0.3);\n --range-color: rgba(0, 0, 0, 0.125);\n }\n`,\n },\n form: {\n include: [],\n css: `\n .muigui {\n --width: 100%;\n --label-width: 45%;\n --number-width: 40%;\n }\n .muigui-root>button {\n display: none;\n }\n .muigui-controller {\n margin-top: 1em;\n }\n .muigui-label-controller {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n margin-top: 1em;\n }\n .muigui-label-controller:has(.muigui-checkbox) {\n flex-direction: row;\n }\n .muigui-value {\n display: flex;\n align-items: stretch;\n }\n .muigui-value>* {\n flex: 1 1 auto;\n min-width: 0;\n }\n .muigui-controller>*:nth-child(1) {\n flex: 1 0 var(--label-width);\n min-width: 0;\n white-space: pre;\n }\n .muigui-controller>label:nth-child(1) {\n place-content: center start;\n display: inline-grid;\n overflow: hidden;\n }\n .muigui-controller>*:nth-child(2) {\n flex: 1 1 75%;\n min-width: 0;\n }\n `,\n },\n none: {\n include: [],\n css: '',\n },\n},\n};\n","export function setElemProps(elem, attrs, children) {\n for (const [key, value] of Object.entries(attrs)) {\n if (typeof value === 'function' && key.startsWith('on')) {\n const eventName = key.substring(2).toLowerCase();\n elem.addEventListener(eventName, value, {passive: false});\n } else if (typeof value === 'object') {\n for (const [k, v] of Object.entries(value)) {\n elem[key][k] = v;\n }\n } else if (elem[key] === undefined) {\n elem.setAttribute(key, value);\n } else {\n elem[key] = value;\n }\n }\n for (const child of children) {\n elem.appendChild(child);\n }\n return elem;\n}\n\nexport function createElem(tag, attrs = {}, children = []) {\n const elem = document.createElement(tag);\n setElemProps(elem, attrs, children);\n return elem;\n}\n\nexport function addElem(tag, parent, attrs = {}, children = []) {\n const elem = createElem(tag, attrs, children);\n parent.appendChild(elem);\n return elem;\n}\n\nlet nextId = 0;\nexport function getNewId() {\n return `muigui-id-${nextId++}`;\n}\n","export function removeArrayElem(array, value) {\n const ndx = array.indexOf(value);\n if (ndx) {\n array.splice(ndx, 1);\n }\n return array;\n}\n\n/**\n * Converts an camelCase or snake_case id to \"camel case\" or \"snake case\"\n * @param {string} id\n */\nconst underscoreRE = /_/g;\nconst upperLowerRE = /([A-Z])([a-z])/g;\nexport function idToLabel(id) {\n return id.replace(underscoreRE, ' ')\n .replace(upperLowerRE, (m, m1, m2) => `${m1.toLowerCase()} ${m2}`);\n}\n\nexport function clamp(v, min, max) {\n return Math.max(min, Math.min(max, v));\n}\n\nexport const isTypedArray = typeof SharedArrayBuffer !== 'undefined'\n ? function isArrayBufferOrSharedArrayBuffer(a) {\n return a && a.buffer && (a.buffer instanceof ArrayBuffer || a.buffer instanceof SharedArrayBuffer);\n }\n : function isArrayBuffer(a) {\n return a && a.buffer && a.buffer instanceof ArrayBuffer;\n };\n\nexport const isArrayOrTypedArray = v => Array.isArray(v) || isTypedArray(v);\n\n// Yea, I know this should be `Math.round(v / step) * step\n// but try step = 0.1, newV = 19.95\n//\n// I get\n// Math.round(19.95 / 0.1) * 0.1\n// 19.900000000000002\n// vs\n// Math.round(19.95 / 0.1) / (1 / 0.1)\n// 19.9\n//\nexport const stepify = (v, from, step) => Math.round(from(v) / step) / (1 / step);\n\nexport const euclideanModulo = (v, n) => ((v % n) + n) % n;\nexport const lerp = (a, b, t) => a + (b - a) * t;\nexport function copyExistingProperties(dst, src) {\n for (const key in src) {\n if (key in dst) {\n dst[key] = src[key];\n }\n }\n return dst;\n}\n\nexport const mapRange = (v, inMin, inMax, outMin, outMax) => (v - inMin) * (outMax - outMin) / (inMax - inMin) + outMin;\n\nexport const makeRangeConverters = ({from, to}) => {\n return {\n to: v => mapRange(v, ...from, ...to),\n from: v => [true, mapRange(v, ...to, ...from)],\n };\n};\n\nexport const makeRangeOptions = ({from, to, step}) => {\n return {\n min: to[0],\n max: to[1],\n ...(step && {step}),\n converters: makeRangeConverters({from, to}),\n };\n};\n\n// TODO: remove an use one in conversions. Move makeRangeConverters there?\nexport const identity = {\n to: v => v,\n from: v => [true, v],\n};\nexport function makeMinMaxPair(gui, properties, minPropName, maxPropName, options) {\n const { converters: { from } = identity } = options;\n const { min, max } = options;\n const guiMinRange = options.minRange || 0;\n const valueMinRange = from(guiMinRange)[1];\n const minGui = gui\n .add(properties, minPropName, {\n ...options,\n min,\n max: max - guiMinRange,\n })\n .onChange(v => {\n maxGui.setValue(Math.min(max, Math.max(v + valueMinRange, properties[maxPropName])));\n });\n const maxGui = gui\n .add(properties, maxPropName, {\n ...options,\n min: min + guiMinRange,\n max,\n })\n .onChange(v => {\n minGui.setValue(Math.max(min, Math.min(v - valueMinRange, properties[minPropName])));\n });\n return [ minGui, maxGui ];\n}\n\n","import { removeArrayElem } from '../libs/utils.js';\n\nexport default class View {\n domElement: HTMLElement;\n\n #childDestElem: HTMLElement;\n #views: View[] = [];\n\n constructor(elem: HTMLElement) {\n this.domElement = elem;\n this.#childDestElem = elem;\n }\n addElem(elem: HTMLElement) {\n this.#childDestElem.appendChild(elem);\n return elem;\n }\n removeElem(elem: HTMLElement) {\n this.#childDestElem.removeChild(elem);\n return elem;\n }\n pushSubElem(elem: HTMLElement) {\n this.#childDestElem.appendChild(elem);\n this.#childDestElem = elem;\n }\n popSubElem() {\n this.#childDestElem = this.#childDestElem.parentElement!;\n }\n add(view: View) {\n this.#views.push(view);\n this.addElem(view.domElement);\n return view;\n }\n remove(view: View) {\n this.removeElem(view.domElement);\n removeArrayElem(this.#views, view);\n return view;\n }\n pushSubView(view: View) {\n this.pushSubElem(view.domElement);\n }\n popSubView() {\n this.popSubElem();\n }\n setOptions(options: any) {\n for (const view of this.#views) {\n view.setOptions(options);\n }\n }\n updateDisplayIfNeeded(newV: any, ignoreCache?: boolean) {\n for (const view of this.#views) {\n view.updateDisplayIfNeeded(newV, ignoreCache);\n }\n return this;\n }\n $(selector: string) {\n return this.domElement.querySelector(selector);\n }\n}","import { createElem } from '../libs/elem.js';\nimport { removeArrayElem } from '../libs/utils.js';\nimport View from '../views/View.js';\n\nexport default class Controller extends View {\n #changeFns;\n #finishChangeFns;\n #parent;\n\n constructor(className) {\n super(createElem('div', {className: 'muigui-controller'}));\n this.#changeFns = [];\n this.#finishChangeFns = [];\n // we need the specialization to come last so it takes precedence.\n if (className) {\n this.domElement.classList.add(className);\n }\n }\n get parent() {\n return this.#parent;\n }\n setParent(parent) {\n this.#parent = parent;\n this.enable(!this.disabled());\n }\n show(show = true) {\n this.domElement.classList.toggle('muigui-hide', !show);\n this.domElement.classList.toggle('muigui-show', show);\n return this;\n }\n hide() {\n return this.show(false);\n }\n disabled() {\n return !!this.domElement.closest('.muigui-disabled');\n }\n\n enable(enable = true) {\n this.domElement.classList.toggle('muigui-disabled', !enable);\n\n // If disabled we need to set the attribute 'disabled=true' to all\n // input/select/button/textarea's below\n //\n // If enabled we need to set the attribute 'disabled=false' to all below\n // until we hit a disabled controller.\n //\n // ATM the problem is we can find the input/select/button/textarea elements\n // but we can't easily find which controller they belong do.\n // But we don't need to? We can just check up if it or parent has\n // '.muigui-disabled'\n ['input', 'button', 'select', 'textarea'].forEach(tag => {\n this.domElement.querySelectorAll(tag).forEach(elem => {\n const disabled = !!elem.closest('.muigui-disabled');\n elem.disabled = disabled;\n });\n });\n\n return this;\n }\n disable(disable = true) {\n return this.enable(!disable);\n }\n onChange(fn) {\n this.removeChange(fn);\n this.#changeFns.push(fn);\n return this;\n }\n removeChange(fn) {\n removeArrayElem(this.#changeFns, fn);\n return this;\n }\n onFinishChange(fn) {\n this.removeFinishChange(fn);\n this.#finishChangeFns.push(fn);\n return this;\n }\n removeFinishChange(fn) {\n removeArrayElem(this.#finishChangeFns, fn);\n return this;\n }\n #callListeners(fns, newV) {\n for (const fn of fns) {\n fn.call(this, newV);\n }\n }\n emitChange(value, object, property) {\n this.#callListeners(this.#changeFns, value);\n if (this.#parent) {\n if (object === undefined) {\n this.#parent.emitChange(value);\n } else {\n this.#parent.emitChange({\n object,\n property,\n value,\n controller: this,\n });\n }\n }\n }\n emitFinalChange(value, object, property) {\n this.#callListeners(this.#finishChangeFns, value);\n if (this.#parent) {\n if (object === undefined) {\n this.#parent.emitChange(value);\n } else {\n this.#parent.emitFinalChange({\n object,\n property,\n value,\n controller: this,\n });\n }\n }\n }\n updateDisplay() {\n // placeholder. override\n }\n getColors() {\n const toCamelCase = s => s.replace(/-([a-z])/g, (m, m1) => m1.toUpperCase());\n const keys = [\n 'color',\n 'bg-color',\n 'value-color',\n 'value-bg-color',\n 'hover-bg-color',\n 'menu-bg-color',\n 'menu-sep-color',\n 'disabled-color',\n ];\n const div = createElem('div');\n this.domElement.appendChild(div);\n const colors = Object.fromEntries(keys.map(key => {\n div.style.color = `var(--${key})`;\n const s = getComputedStyle(div);\n return [toCamelCase(key), s.color];\n }));\n div.remove();\n return colors;\n }\n}\n","import {\n createElem,\n} from '../libs/elem.js';\nimport { copyExistingProperties } from '../libs/utils.js';\nimport Controller from './Controller.js';\n\nexport default class Button extends Controller {\n #object;\n #property;\n #buttonElem;\n #options = {\n name: '',\n };\n\n constructor(object, property, options = {}) {\n super('muigui-button', '');\n this.#object = object;\n this.#property = property;\n\n this.#buttonElem = this.addElem(\n createElem('button', {\n type: 'button',\n onClick: () => {\n this.#object[this.#property](this);\n },\n }));\n this.setOptions({name: property, ...options});\n }\n name(name) {\n this.#buttonElem.textContent = name;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {name} = this.#options;\n this.#buttonElem.textContent = name;\n }\n}","import { isTypedArray } from '../libs/utils.js';\nimport View from './View.js';\n\nfunction arraysEqual(a, b) {\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; ++i) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n}\n\nfunction copyArrayElementsFromTo(src, dst) {\n dst.length = src.length;\n for (let i = 0; i < src.length; ++i) {\n dst[i] = src[i];\n }\n}\n\nexport default class EditView extends View {\n #oldV;\n #updateCheck;\n\n #checkArrayNeedsUpdate(newV) {\n // It's an array, we need to compare all elements\n // Example, vec2, [r,g,b], ...\n const needUpdate = !arraysEqual(newV, this.#oldV);\n if (needUpdate) {\n copyArrayElementsFromTo(newV, this.#oldV);\n }\n return needUpdate;\n }\n\n #checkTypedArrayNeedsUpdate() {\n let once = true;\n return function checkTypedArrayNeedsUpdateImpl(newV) {\n // It's a typedarray, we need to compare all elements\n // Example: Float32Array([r, g, b])\n let needUpdate = once;\n once = false;\n if (!needUpdate) {\n needUpdate = !arraysEqual(newV, this.#oldV);\n }\n return needUpdate;\n };\n }\n\n #checkObjectNeedsUpdate(newV) {\n let needUpdate = false;\n for (const key in newV) {\n if (newV[key] !== this.#oldV[key]) {\n needUpdate = true;\n this.#oldV[key] = newV[key];\n }\n }\n return needUpdate;\n }\n\n #checkValueNeedsUpdate(newV) {\n const needUpdate = newV !== this.#oldV;\n this.#oldV = newV;\n return needUpdate;\n }\n\n #getUpdateCheckForType(newV) {\n if (Array.isArray(newV)) {\n this.#oldV = [];\n return this.#checkArrayNeedsUpdate.bind(this);\n } else if (isTypedArray(newV)) {\n this.#oldV = new newV.constructor(newV);\n return this.#checkTypedArrayNeedsUpdate(this);\n } else if (typeof newV === 'object') {\n this.#oldV = {};\n return this.#checkObjectNeedsUpdate.bind(this);\n } else {\n return this.#checkValueNeedsUpdate.bind(this);\n }\n }\n\n // The point of this is updating DOM elements\n // is slow but if we've called `listen` then\n // every frame we're going to try to update\n // things with the current value so if nothing\n // has changed then skip it.\n updateDisplayIfNeeded(newV, ignoreCache) {\n this.#updateCheck = this.#updateCheck || this.#getUpdateCheckForType(newV);\n // Note: We call #updateCheck first because it updates\n // the cache\n if (this.#updateCheck(newV) || ignoreCache) {\n this.updateDisplay(newV);\n }\n }\n setOptions(/*options*/) {\n // override this\n return this;\n }\n}\n","import { createElem } from '../libs/elem.js';\nimport EditView from './EditView.js';\n\nexport default class CheckboxView extends EditView {\n #checkboxElem;\n constructor(setter, id) {\n const checkboxElem = createElem('input', {\n type: 'checkbox',\n id,\n onInput: () => {\n setter.setValue(checkboxElem.checked);\n },\n onChange: () => {\n setter.setFinalValue(checkboxElem.checked);\n },\n });\n super(createElem('label', {}, [checkboxElem]));\n this.#checkboxElem = checkboxElem;\n }\n updateDisplay(v) {\n this.#checkboxElem.checked = v;\n }\n}\n","import { removeArrayElem } from './utils.js';\n\nconst tasks = [];\nconst tasksToRemove = new Set();\n\nlet requestId;\nlet processing;\n\nfunction removeTasks() {\n if (!tasksToRemove.size) {\n return;\n }\n\n if (processing) {\n queueProcessing();\n return;\n }\n\n tasksToRemove.forEach(task => {\n removeArrayElem(tasks, task);\n });\n tasksToRemove.clear();\n}\n\nfunction processTasks() {\n requestId = undefined;\n processing = true;\n for (const task of tasks) {\n if (!tasksToRemove.has(task)) {\n task();\n }\n }\n processing = false;\n removeTasks();\n queueProcessing();\n}\n\nfunction queueProcessing() {\n if (!requestId && tasks.length) {\n requestId = requestAnimationFrame(processTasks);\n }\n}\n\nexport function addTask(fn) {\n tasks.push(fn);\n queueProcessing();\n}\n\nexport function removeTask(fn) {\n tasksToRemove.set(fn);\n\n const ndx = tasks.indexOf(fn);\n if (ndx >= 0) {\n tasks.splice(ndx, 1);\n }\n}","let id = 0;\n\nexport function makeId() {\n return `muigui-${++id}`;\n}\n","import { createElem } from '../libs/elem.js';\nimport View from './View.js';\n\nexport default class ValueView extends View {\n constructor(className = '') {\n super(createElem('div', {className: 'muigui-value'}));\n if (className) {\n this.domElement.classList.add(className);\n }\n }\n}","import { createElem } from '../libs/elem.js';\nimport { makeId } from '../libs/ids.js';\nimport ValueView from '../views/ValueView.js';\nimport Controller from './Controller.js';\n\nexport default class LabelController extends Controller {\n #id;\n #nameElem;\n\n constructor(className = '', name = '') {\n super('muigui-label-controller');\n this.#id = makeId();\n this.#nameElem = createElem('label', {for: this.#id});\n this.domElement.appendChild(this.#nameElem);\n this.pushSubView(new ValueView(className));\n this.name(name);\n }\n get id() {\n return this.#id;\n }\n name(name) {\n if (this.#nameElem.title === this.#nameElem.textContent) {\n this.#nameElem.title = name;\n }\n this.#nameElem.textContent = name;\n return this;\n }\n tooltip(tip) {\n this.#nameElem.title = tip;\n }\n}\n\n","import {addTask, removeTask} from '../libs/taskrunner.js';\nimport { isTypedArray } from '../libs/utils.js';\nimport LabelController from './LabelController.js';\n\nexport default class ValueController extends LabelController {\n #object;\n #property;\n #initialValue;\n #listening;\n #views;\n #updateFn;\n\n constructor(object, property, className = '') {\n super(className, property);\n this.#object = object;\n this.#property = property;\n this.#initialValue = this.getValue();\n this.#listening = false;\n this.#views = [];\n }\n get initialValue() {\n return this.#initialValue;\n }\n get object() {\n return this.#object;\n }\n get property() {\n return this.#property;\n }\n add(view) {\n this.#views.push(view);\n super.add(view);\n this.updateDisplay();\n return view;\n }\n #setValueImpl(v, ignoreCache) {\n let isDifferent = false;\n if (typeof v === 'object') {\n const dst = this.#object[this.#property];\n // don't replace objects, just their values.\n if (Array.isArray(v) || isTypedArray(v)) {\n for (let i = 0; i < v.length; ++i) {\n isDifferent ||= dst[i] !== v[i];\n dst[i] = v[i];\n }\n } else {\n for (const key of Object.keys(v)) {\n isDifferent ||= dst[key] !== v[key];\n }\n Object.assign(dst, v);\n }\n } else {\n isDifferent = this.#object[this.#property] !== v;\n this.#object[this.#property] = v;\n }\n this.updateDisplay(ignoreCache);\n if (isDifferent) {\n this.emitChange(this.getValue(), this.#object, this.#property);\n }\n return isDifferent;\n }\n setValue(v) {\n this.#setValueImpl(v);\n }\n setFinalValue(v) {\n const isDifferent = this.#setValueImpl(v, true);\n if (isDifferent) {\n this.emitFinalChange(this.getValue(), this.#object, this.#property);\n }\n return this;\n }\n updateDisplay(ignoreCache) {\n const newV = this.getValue();\n for (const view of this.#views) {\n view.updateDisplayIfNeeded(newV, ignoreCache);\n }\n return this;\n }\n setOptions(options) {\n for (const view of this.#views) {\n view.setOptions(options);\n }\n this.updateDisplay();\n return this;\n }\n getValue() {\n return this.#object[this.#property];\n }\n value(v) {\n this.setValue(v);\n return this;\n }\n reset() {\n this.setValue(this.#initialValue);\n return this;\n }\n listen(listen = true) {\n if (!this.#updateFn) {\n this.#updateFn = this.updateDisplay.bind(this);\n }\n if (listen) {\n if (!this.#listening) {\n this.#listening = true;\n addTask(this.#updateFn);\n }\n } else {\n if (this.#listening) {\n this.#listening = false;\n removeTask(this.#updateFn);\n }\n }\n return this;\n }\n}\n\n","import CheckboxView from '../views/CheckboxView.js';\nimport ValueController from './ValueController.js';\n\nexport default class Checkbox extends ValueController {\n constructor(object, property) {\n super(object, property, 'muigui-checkbox');\n const id = this.id;\n this.add(new CheckboxView(this, id));\n this.updateDisplay();\n }\n}","import {\n makeRangeConverters,\n} from './utils.js';\n\nexport const identity = {\n to: v => v,\n from: v => [true, v],\n};\n\n// from: from string to value\n// to: from value to string\nexport const strToNumber = {\n to: v => v.toString(),\n from: v => {\n const newV = parseFloat(v);\n return [!Number.isNaN(newV), newV];\n },\n};\n\nexport const converters = {\n radToDeg: makeRangeConverters({to: [0, 180], from: [0, Math.PI]}),\n};\n","export function createWheelHelper() {\n let wheelAccum = 0;\n return function (e, step, wheelScale = 5) {\n wheelAccum -= e.deltaY * step / wheelScale;\n const wheelSteps = Math.floor(Math.abs(wheelAccum) / step) * Math.sign(wheelAccum);\n const delta = wheelSteps * step;\n wheelAccum -= delta;\n return delta;\n };\n}\n","import { createElem } from '../libs/elem.js';\nimport { strToNumber } from '../libs/conversions.js';\nimport { createWheelHelper } from '../libs/wheel.js';\nimport { clamp, copyExistingProperties, stepify } from '../libs/utils.js';\nimport EditView from './EditView.js';\n\nexport default class NumberView extends EditView {\n #to;\n #from;\n #step;\n #skipUpdate;\n #options = {\n step: 0.01,\n converters: strToNumber,\n min: Number.NEGATIVE_INFINITY,\n max: Number.POSITIVE_INFINITY,\n };\n\n constructor(setter, options) {\n const setValue = setter.setValue.bind(setter);\n const setFinalValue = setter.setFinalValue.bind(setter);\n const wheelHelper = createWheelHelper();\n super(createElem('input', {\n type: 'number',\n onInput: () => {\n this.#handleInput(setValue, true);\n },\n onChange: () => {\n this.#handleInput(setFinalValue, false);\n },\n onWheel: e => {\n e.preventDefault();\n const {min, max, step} = this.#options;\n const delta = wheelHelper(e, step);\n const v = parseFloat(this.domElement.value);\n const newV = clamp(stepify(v + delta, v => v, step), min, max);\n const [valid, outV] = this.#from(newV);\n if (valid) {\n setter.setValue(outV);\n }\n },\n }));\n this.setOptions(options);\n }\n #handleInput(setFn, skipUpdate) {\n const v = parseFloat(this.domElement.value);\n const [valid, newV] = this.#from(v);\n let inRange;\n if (valid && !Number.isNaN(v)) {\n const {min, max} = this.#options;\n inRange = newV >= min && newV <= max;\n this.#skipUpdate = skipUpdate;\n setFn(clamp(newV, min, max));\n }\n this.domElement.classList.toggle('muigui-invalid-value', !valid || !inRange);\n }\n updateDisplay(v) {\n if (!this.#skipUpdate) {\n this.domElement.value = stepify(v, this.#to, this.#step);\n }\n this.#skipUpdate = false;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {\n step,\n converters: {to, from},\n } = this.#options;\n this.#to = to;\n this.#from = from;\n this.#step = step;\n return this;\n }\n}\n","\nimport NumberView from '../views/NumberView.js';\nimport ValueController from './ValueController.js';\n\n// Wanted to name this `Number` but it conflicts with\n// JavaScript `Number`. It most likely wouldn't be\n// an issue? But users might `import {Number} ...` and\n// things would break.\nexport default class TextNumber extends ValueController {\n #textView;\n #step;\n\n constructor(object, property, options = {}) {\n super(object, property, 'muigui-text-number');\n this.#textView = this.add(new NumberView(this, options));\n this.updateDisplay();\n }\n}","import { createElem } from '../libs/elem.js';\nimport EditView from './EditView.js';\n\nexport default class SelectView extends EditView {\n #values;\n\n constructor(setter, keyValues) {\n const values = [];\n super(createElem('select', {\n onChange: () => {\n setter.setFinalValue(this.#values[this.domElement.selectedIndex]);\n },\n }, keyValues.map(([key, value]) => {\n values.push(value);\n return createElem('option', {textContent: key});\n })));\n this.#values = values;\n }\n updateDisplay(v) {\n const ndx = this.#values.indexOf(v);\n this.domElement.selectedIndex = ndx;\n }\n}\n","\n// 4 cases\n// (a) keyValues is array of arrays, each sub array is key value\n// (b) keyValues is array and value is number then keys = array contents, value = index\n// (c) keyValues is array and value is not number, key = array contents, value = array contents\n// (d) keyValues is object then key->value\nexport function convertToKeyValues(keyValues, valueIsNumber) {\n if (Array.isArray(keyValues)) {\n if (Array.isArray(keyValues[0])) {\n // (a) keyValues is array of arrays, each sub array is key value\n return keyValues;\n } else {\n if (valueIsNumber) {\n // (b) keyValues is array and value is number then keys = array contents, value = index\n return keyValues.map((v, ndx) => [v, ndx]);\n } else {\n // (c) keyValues is array and value is not number, key = array contents, value = array contents\n return keyValues.map(v => [v, v]);\n }\n }\n } else {\n // (d)\n return [...Object.entries(keyValues)];\n }\n}\n","import SelectView from '../views/SelectView.js';\nimport ValueController from './ValueController.js';\nimport { convertToKeyValues } from '../libs/key-values.js';\n\nexport default class Select extends ValueController {\n constructor(object, property, options) {\n super(object, property, 'muigui-select');\n const valueIsNumber = typeof this.getValue() === 'number';\n const {keyValues: keyValuesInput} = options;\n const keyValues = convertToKeyValues(keyValuesInput, valueIsNumber);\n this.add(new SelectView(this, keyValues));\n this.updateDisplay();\n }\n}","import { createElem } from '../libs/elem.js';\nimport { identity } from '../libs/conversions.js';\nimport { clamp, copyExistingProperties, stepify } from '../libs/utils.js';\nimport { createWheelHelper } from '../libs/wheel.js';\nimport EditView from './EditView.js';\n\nexport default class RangeView extends EditView {\n #to;\n #from;\n #step;\n #skipUpdate;\n #options = {\n step: 0.01,\n min: 0,\n max: 1,\n converters: identity,\n };\n\n constructor(setter, options) {\n const wheelHelper = createWheelHelper();\n super(createElem('input', {\n type: 'range',\n onInput: () => {\n this.#skipUpdate = true;\n const {min, max, step} = this.#options;\n const v = parseFloat(this.domElement.value);\n const newV = clamp(stepify(v, v => v, step), min, max);\n const [valid, validV] = this.#from(newV);\n if (valid) {\n setter.setValue(validV);\n }\n },\n onChange: () => {\n this.#skipUpdate = true;\n const {min, max, step} = this.#options;\n const v = parseFloat(this.domElement.value);\n const newV = clamp(stepify(v, v => v, step), min, max);\n const [valid, validV] = this.#from(newV);\n if (valid) {\n setter.setFinalValue(validV);\n }\n },\n onWheel: e => {\n e.preventDefault();\n const [valid, v] = this.#from(parseFloat(this.domElement.value));\n if (!valid) {\n return;\n }\n const {min, max, step} = this.#options;\n const delta = wheelHelper(e, step);\n const newV = clamp(stepify(v + delta, v => v, step), min, max);\n setter.setValue(newV);\n },\n }));\n this.setOptions(options);\n }\n updateDisplay(v) {\n if (!this.#skipUpdate) {\n this.domElement.value = stepify(v, this.#to, this.#step);\n }\n this.#skipUpdate = false;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {\n step,\n min,\n max,\n converters: {to, from},\n } = this.#options;\n this.#to = to;\n this.#from = from;\n this.#step = step;\n this.domElement.step = step;\n this.domElement.min = min;\n this.domElement.max = max;\n return this;\n }\n}","import ValueController from './ValueController.js';\nimport NumberView from '../views/NumberView.js';\nimport RangeView from '../views/RangeView.js';\n\nexport default class Range extends ValueController {\n constructor(object, property, options) {\n super(object, property, 'muigui-range');\n this.add(new RangeView(this, options));\n this.add(new NumberView(this, options));\n }\n}\n","import { createElem } from '../libs/elem.js';\nimport { identity } from '../libs/conversions.js';\nimport EditView from './EditView.js';\nimport { copyExistingProperties } from '../libs/utils.js';\n\nexport default class TextView extends EditView {\n #to;\n #from;\n #skipUpdate;\n #options = {\n converters: identity,\n };\n\n constructor(setter, options) {\n const setValue = setter.setValue.bind(setter);\n const setFinalValue = setter.setFinalValue.bind(setter);\n super(createElem('input', {\n type: 'text',\n onInput: () => {\n this.#handleInput(setValue, true);\n },\n onChange: () => {\n this.#handleInput(setFinalValue, false);\n },\n }));\n this.setOptions(options);\n }\n #handleInput(setFn, skipUpdate) {\n const [valid, newV] = this.#from(this.domElement.value);\n if (valid) {\n this.#skipUpdate = skipUpdate;\n setFn(newV);\n }\n this.domElement.style.color = valid ? '' : 'var(--invalid-color)';\n\n }\n updateDisplay(v) {\n if (!this.#skipUpdate) {\n this.domElement.value = this.#to(v);\n this.domElement.style.color = '';\n }\n this.#skipUpdate = false;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {\n converters: {to, from},\n } = this.#options;\n this.#to = to;\n this.#from = from;\n return this;\n }\n}\n","import TextView from '../views/TextView.js';\nimport ValueController from './ValueController.js';\n\nexport default class Text extends ValueController {\n constructor(object, property) {\n super(object, property, 'muigui-text');\n this.add(new TextView(this));\n this.updateDisplay();\n }\n}","import Button from './Button.js';\nimport Checkbox from './Checkbox.js';\nimport TextNumber from './TextNumber.js';\nimport Select from './Select.js';\nimport Range from './Range.js';\nimport Text from './Text.js';\n\n// const isConversion = o => typeof o.to === 'function' && typeof o.from === 'function';\n\n/**\n * possible inputs\n * add(o, p, min: number, max: number)\n * add(o, p, min: number, max: number, step: number)\n * add(o, p, array: [value])\n * add(o, p, array: [[key, value]])\n *\n * @param {*} object\n * @param {string} property\n * @param {...any} args\n * @returns {Controller}\n */\nexport function createController(object, property, ...args) {\n const [arg1] = args;\n if (Array.isArray(arg1)) {\n return new Select(object, property, {keyValues: arg1});\n }\n if (arg1 && arg1.keyValues) {\n return new Select(object, property, {keyValues: arg1.keyValues});\n }\n\n const t = typeof object[property];\n switch (t) {\n case 'number':\n if (typeof args[0] === 'number' && typeof args[1] === 'number') {\n const min = args[0];\n const max = args[1];\n const step = args[2];\n return new Range(object, property, {min, max, ...(step && {step})});\n }\n return args.length === 0\n ? new TextNumber(object, property, ...args)\n : new Range(object, property, ...args);\n case 'boolean':\n return new Checkbox(object, property, ...args);\n case 'function':\n return new Button(object, property, ...args);\n case 'string':\n return new Text(object, property, ...args);\n case 'undefined':\n throw new Error(`no property named ${property}`);\n default:\n throw new Error(`unhandled type ${t} for property ${property}`);\n }\n}","const clamp = (v, min, max) => Math.max(min, Math.min(max, v));\nconst lerp = (a, b, t) => a + (b - a) * t;\nconst fract = v => v >= 0 ? v % 1 : 1 - (v % 1);\n\nconst f0 = v => +v.toFixed(0); // converts to string (eg 1.2 => \"1\"), then converts back to number (eg, \"1.200\" => 1.2)\nconst f3 = v => +v.toFixed(3); // converts to string (eg 1.2 => \"1.200\"), then converts back to number (eg, \"1.200\" => 1.2)\n\nconst hexToUint32RGB = v => (parseInt(v.substring(1, 3), 16) << 16) |\n (parseInt(v.substring(3, 5), 16) << 8 ) |\n (parseInt(v.substring(5, 7), 16) );\nconst uint32RGBToHex = v => `#${(Math.round(v)).toString(16).padStart(6, '0')}`;\nconst hexToUint32RGBA = v => (parseInt(v.substring(1, 3), 16) * 2 ** 24) +\n (parseInt(v.substring(3, 5), 16) * 2 ** 16) +\n (parseInt(v.substring(5, 7), 16) * 2 ** 8) +\n (parseInt(v.substring(7, 9), 16) );\nconst uint32RGBAToHex = v => `#${(Math.round(v)).toString(16).padStart(8, '0')}`;\n\nexport const hexToUint8RGB = v => [\n parseInt(v.substring(1, 3), 16),\n parseInt(v.substring(3, 5), 16),\n parseInt(v.substring(5, 7), 16),\n];\nexport const uint8RGBToHex = v => `#${Array.from(v).map(v => v.toString(16).padStart(2, '0')).join('')}`;\n\nexport const hexToUint8RGBA = v => [\n parseInt(v.substring(1, 3), 16),\n parseInt(v.substring(3, 5), 16),\n parseInt(v.substring(5, 7), 16),\n parseInt(v.substring(7, 9), 16),\n];\nexport const uint8RGBAToHex = v => `#${Array.from(v).map(v => v.toString(16).padStart(2, '0')).join('')}`;\n\nexport const hexToFloatRGB = v => hexToUint8RGB(v).map(v => f3(v / 255));\nexport const floatRGBToHex = v => uint8RGBToHex(Array.from(v).map(v => Math.round(clamp(v * 255, 0, 255))));\n\nexport const hexToFloatRGBA = v => hexToUint8RGBA(v).map(v => f3(v / 255));\nexport const floatRGBAToHex = v => uint8RGBAToHex(Array.from(v).map(v => Math.round(clamp(v * 255, 0, 255))));\n\nconst scaleAndClamp = v => clamp(Math.round(v * 255), 0, 255).toString(16).padStart(2, '0');\n\nconst hexToObjectRGB = v => ({\n r: parseInt(v.substring(1, 3), 16) / 255,\n g: parseInt(v.substring(3, 5), 16) / 255,\n b: parseInt(v.substring(5, 7), 16) / 255,\n});\nconst objectRGBToHex = v => `#${scaleAndClamp(v.r)}${scaleAndClamp(v.g)}${scaleAndClamp(v.b)}`;\nconst hexToObjectRGBA = v => ({\n r: parseInt(v.substring(1, 3), 16) / 255,\n g: parseInt(v.substring(3, 5), 16) / 255,\n b: parseInt(v.substring(5, 7), 16) / 255,\n a: parseInt(v.substring(7, 9), 16) / 255,\n});\nconst objectRGBAToHex = v => `#${scaleAndClamp(v.r)}${scaleAndClamp(v.g)}${scaleAndClamp(v.b)}${scaleAndClamp(v.a)}`;\n\nconst hexToCssRGB = v => `rgb(${hexToUint8RGB(v).join(', ')})`;\nconst cssRGBRegex = /^\\s*rgb\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*\\)\\s*$/;\nconst cssRGBToHex = v => {\n const m = cssRGBRegex.exec(v);\n return uint8RGBToHex([m[1], m[2], m[3]].map(v => parseInt(v)));\n};\nconst hexToCssRGBA = v => `rgba(${hexToUint8RGBA(v).map((v, i) => i === 3 ? v / 255 : v).join(', ')})`;\nconst cssRGBARegex = /^\\s*rgba\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+\\.\\d+|\\d+)\\s*\\)\\s*$/;\nconst cssRGBAToHex = v => {\n const m = cssRGBARegex.exec(v);\n return uint8RGBAToHex([m[1], m[2], m[3], m[4]].map((v, i) => i === 3 ? (parseFloat(v) * 255 | 0) : parseInt(v)));\n};\n\nconst hexToCssHSL = v => {\n const hsl = rgbUint8ToHsl(hexToUint8RGB(v)).map(v => f0(v));\n return `hsl(${hsl[0]}, ${hsl[1]}%, ${hsl[2]}%)`;\n};\nconst hexToCssHSLA = v => {\n const hsla = rgbaUint8ToHsla(hexToUint8RGBA(v)).map((v, i) => i === 3 ? f3(v) : f0(v));\n return `hsl(${hsla[0]} ${hsla[1]}% ${hsla[2]}% / ${hsla[3]})`;\n};\nconst cssHSLRegex = /^\\s*hsl\\(\\s*(\\d+)(?:deg|)\\s*(?:,|)\\s*(\\d+)%\\s*(?:,|)\\s*(\\d+)%\\s*\\)\\s*$/;\nconst cssHSLARegex = /^\\s*hsl\\(\\s*(\\d+)(?:deg|)\\s*(?:,|)\\s*(\\d+)%\\s*(?:,|)\\s*(\\d+)%\\s*\\/\\s*(\\d+\\.\\d+|\\d+)\\s*\\)\\s*$/;\n\nconst hex3DigitTo6Digit = v => `${v[0]}${v[0]}${v[1]}${v[1]}${v[2]}${v[2]}`;\nconst cssHSLToHex = v => {\n const m = cssHSLRegex.exec(v);\n const rgb = hslToRgbUint8([m[1], m[2], m[3]].map(v => parseFloat(v)));\n return uint8RGBToHex(rgb);\n};\nconst cssHSLAToHex = v => {\n const m = cssHSLARegex.exec(v);\n const rgba = hslaToRgbaUint8([m[1], m[2], m[3], m[4]].map(v => parseFloat(v)));\n return uint8RGBAToHex(rgba);\n};\n\nconst euclideanModulo = (v, n) => ((v % n) + n) % n;\n\nexport function hslToRgbUint8([h, s, l]) {\n h = euclideanModulo(h, 360);\n s = clamp(s / 100, 0, 1);\n l = clamp(l / 100, 0, 1);\n\n const a = s * Math.min(l, 1 - l);\n\n function f(n) {\n const k = (n + h / 30) % 12;\n return l - a * Math.max(-1, Math.min(k - 3, 9 - k, 1));\n }\n\n return [f(0), f(8), f(4)].map(v => Math.round(v * 255));\n}\n\nexport function hslaToRgbaUint8([h, s, l, a]) {\n const rgb = hslToRgbUint8([h, s, l]);\n return [...rgb, a * 255 | 0];\n}\n\nexport function rgbFloatToHsl01([r, g, b]) {\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const l = (min + max) * 0.5;\n const d = max - min;\n let h = 0;\n let s = 0;\n\n if (d !== 0) {\n s = (l === 0 || l === 1)\n ? 0\n : (max - l) / Math.min(l, 1 - l);\n\n switch (max) {\n case r: h = (g - b) / d + (g < b ? 6 : 0); break;\n case g: h = (b - r) / d + 2; break;\n case b: h = (r - g) / d + 4;\n }\n }\n\n return [h / 6, s, l];\n}\n\nexport function rgbaFloatToHsla01([r, g, b, a]) {\n const hsl = rgbFloatToHsl01([r, g, b]);\n return [...hsl, a];\n}\n\nexport const rgbUint8ToHsl = (rgb) => {\n const [h, s, l] = rgbFloatToHsl01(rgb.map(v => v / 255));\n return [h * 360, s * 100, l * 100];\n};\n\nexport const rgbaUint8ToHsla = (rgba) => {\n const [h, s, l, a] = rgbaFloatToHsla01(rgba.map(v => v / 255));\n return [h * 360, s * 100, l * 100, a];\n};\n\nexport function hsv01ToRGBFloat([hue, sat, val]) {\n sat = clamp(sat, 0, 1);\n val = clamp(val, 0, 1);\n return [hue, hue + 2 / 3, hue + 1 / 3].map(\n v => lerp(1, clamp(Math.abs(fract(v) * 6 - 3.0) - 1, 0, 1), sat) * val\n );\n}\n\nexport function hsva01ToRGBAFloat([hue, sat, val, alpha]) {\n const rgb = hsv01ToRGBFloat([hue, sat, val]);\n return [...rgb, alpha];\n}\n\nconst round3 = v => Math.round(v * 1000) / 1000;\n\nexport function rgbFloatToHSV01([r, g, b]) {\n const p = b > g\n ? [b, g, -1, 2 / 3]\n : [g, b, 0, -1 / 3];\n const q = p[0] > r\n ? [p[0], p[1], p[3], r]\n : [r, p[1], p[2], p[0]];\n const d = q[0] - Math.min(q[3], q[1]);\n return [\n Math.abs(q[2] + (q[3] - q[1]) / (6 * d + Number.EPSILON)),\n d / (q[0] + Number.EPSILON),\n q[0],\n ].map(round3);\n}\n\nexport function rgbaFloatToHSVA01([r, g, b, a]) {\n const hsv = rgbFloatToHSV01([r, g, b]);\n return [...hsv, a];\n}\n\n// window.hsv01ToRGBFloat = hsv01ToRGBFloat;\n// window.rgbFloatToHSV01 = rgbFloatToHSV01;\n\n// Yea, meh!\nexport const hasAlpha = format => format.endsWith('a') || format.startsWith('hex8');\n\nconst cssStringFormats = [\n { re: /^#(?:[0-9a-f]){6}$/i, format: 'hex6' },\n { re: /^(?:[0-9a-f]){6}$/i, format: 'hex6-no-hash' },\n { re: /^#(?:[0-9a-f]){8}$/i, format: 'hex8' },\n { re: /^(?:[0-9a-f]){8}$/i, format: 'hex8-no-hash' },\n { re: /^#(?:[0-9a-f]){3}$/i, format: 'hex3' },\n { re: /^(?:[0-9a-f]){3}$/i, format: 'hex3-no-hash' },\n { re: cssRGBRegex, format: 'css-rgb' },\n { re: cssHSLRegex, format: 'css-hsl' },\n { re: cssRGBARegex, format: 'css-rgba' },\n { re: cssHSLARegex, format: 'css-hsla' },\n];\n\nfunction guessStringColorFormat(v) {\n for (const formatInfo of cssStringFormats) {\n if (formatInfo.re.test(v)) {\n return formatInfo;\n }\n }\n return undefined;\n}\n\nexport function guessFormat(v) {\n switch (typeof v) {\n case 'number':\n console.warn('can not reliably guess format based on a number. You should pass in a format like {format: \"uint32-rgb\"} or {format: \"uint32-rgb\"}');\n return v <= 0xFFFFFF ? 'uint32-rgb' : 'uint32-rgba';\n case 'string': {\n const formatInfo = guessStringColorFormat(v.trim());\n if (formatInfo) {\n return formatInfo.format;\n }\n break;\n }\n case 'object':\n if (v instanceof Uint8Array || v instanceof Uint8ClampedArray) {\n if (v.length === 3) {\n return 'uint8-rgb';\n } else if (v.length === 4) {\n return 'uint8-rgba';\n }\n } else if (v instanceof Float32Array) {\n if (v.length === 3) {\n return 'float-rgb';\n } else if (v.length === 4) {\n return 'float-rgba';\n }\n } else if (Array.isArray(v)) {\n if (v.length === 3) {\n return 'float-rgb';\n } else if (v.length === 4) {\n return 'float-rgba';\n }\n } else {\n if ('r' in v && 'g' in v && 'b' in v) {\n if ('a' in v) {\n return 'object-rgba';\n } else {\n return 'object-rgb';\n }\n }\n }\n }\n throw new Error(`unknown color format: ${v}`);\n}\n\nfunction fixHex6(v) {\n return v.trim(v);\n //const formatInfo = guessStringColorFormat(v.trim());\n //const fix = formatInfo ? formatInfo.fix : v => v;\n //return fix(v.trim());\n}\n\nfunction fixHex8(v) {\n return v.trim(v);\n //const formatInfo = guessStringColorFormat(v.trim());\n //const fix = formatInfo ? formatInfo.fix : v => v;\n //return fix(v.trim());\n}\n\nfunction hex6ToHex3(hex6) {\n return (hex6[1] === hex6[2] &&\n hex6[3] === hex6[4] &&\n hex6[5] === hex6[6])\n ? `#${hex6[1]}${hex6[3]}${hex6[5]}`\n : hex6;\n}\n\nconst hex3RE = /^(#|)([0-9a-f]{3})$/i;\nfunction hex3ToHex6(hex3) {\n const m = hex3RE.exec(hex3);\n if (m) {\n const [, , m2] = m;\n return `#${hex3DigitTo6Digit(m2)}`;\n }\n return hex3;\n}\n\nfunction fixHex3(v) {\n return hex6ToHex3(fixHex6(v));\n}\n\nconst strToRGBObject = (s) => {\n try {\n const json = s.replace(/([a-z])/g, '\"$1\"');\n const rgb = JSON.parse(json);\n if (Number.isNaN(rgb.r) || Number.isNaN(rgb.g) || Number.isNaN(rgb.b)) {\n throw new Error('not {r, g, b}');\n }\n return [true, rgb];\n } catch (e) {\n return [false];\n }\n};\n\nconst strToRGBAObject = (s) => {\n try {\n const json = s.replace(/([a-z])/g, '\"$1\"');\n const rgba = JSON.parse(json);\n if (Number.isNaN(rgba.r) || Number.isNaN(rgba.g) || Number.isNaN(rgba.b) || Number.isNaN(rgba.a)) {\n throw new Error('not {r, g, b, a}');\n }\n return [true, rgba];\n } catch (e) {\n return [false];\n }\n};\n\nconst strToCssRGB = s => {\n const m = cssRGBRegex.exec(s);\n if (!m) {\n return [false];\n }\n const v = [m[1], m[2], m[3]].map(v => parseInt(v));\n const outOfRange = v.find(v => v > 255);\n return [!outOfRange, `rgb(${v.join(', ')})`];\n};\n\nconst strToCssRGBA = s => {\n const m = cssRGBARegex.exec(s);\n if (!m) {\n return [false];\n }\n const v = [m[1], m[2], m[3], m[4]].map((v, i) => i === 3 ? parseFloat(v) : parseInt(v));\n const outOfRange = v.find(v => v > 255);\n return [!outOfRange, `rgba(${v.join(', ')})`];\n};\n\nconst strToCssHSL = s => {\n const m = cssHSLRegex.exec(s);\n if (!m) {\n return [false];\n }\n const v = [m[1], m[2], m[3]].map(v => parseFloat(v));\n const outOfRange = v.find(v => Number.isNaN(v));\n return [!outOfRange, `hsl(${v[0]}, ${v[1]}%, ${v[2]}%)`];\n};\n\nconst strToCssHSLA = s => {\n const m = cssHSLARegex.exec(s);\n if (!m) {\n return [false];\n }\n const v = [m[1], m[2], m[3], m[4]].map(v => parseFloat(v));\n const outOfRange = v.find(v => Number.isNaN(v));\n return [!outOfRange, `hsl(${v[0]} ${v[1]}% ${v[2]}% / ${v[3]})`];\n};\n\nconst rgbObjectToStr = rgb => {\n return `{r:${f3(rgb.r)}, g:${f3(rgb.g)}, b:${f3(rgb.b)}}`;\n};\nconst rgbaObjectToStr = rgba => {\n return `{r:${f3(rgba.r)}, g:${f3(rgba.g)}, b:${f3(rgba.b)}}, a:${f3(rgba.a)}}`;\n};\n\nconst strTo3IntsRE = /^\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*$/;\nconst strTo3Ints = s => {\n const m = strTo3IntsRE.exec(s);\n if (!m) {\n return [false];\n }\n const v = [m[1], m[2], m[3]].map(v => parseInt(v));\n const outOfRange = v.find(v => v > 255);\n return [!outOfRange, v];\n};\n\nconst strTo4IntsRE = /^\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*$/;\nconst strTo4Ints = s => {\n const m = strTo4IntsRE.exec(s);\n if (!m) {\n return [false];\n }\n const v = [m[1], m[2], m[3], m[4]].map(v => parseInt(v));\n const outOfRange = v.find(v => v > 255);\n return [!outOfRange, v];\n};\n\nconst strTo3Floats = s => {\n const numbers = s.split(',').map(s => s.trim());\n const v = numbers.map(v => parseFloat(v));\n if (v.length !== 3) {\n return [false];\n }\n // Note: using isNaN not Number.isNaN\n const badNdx = numbers.findIndex(v => isNaN(v));\n return [badNdx < 0, v.map(v => f3(v))];\n};\n\nconst strTo4Floats = s => {\n const numbers = s.split(',').map(s => s.trim());\n const v = numbers.map(v => parseFloat(v));\n if (v.length !== 4) {\n return [false];\n }\n // Note: using isNaN not Number.isNaN\n const badNdx = numbers.findIndex(v => isNaN(v));\n return [badNdx < 0, v.map(v => f3(v))];\n};\n\nconst strToUint32RGBRegex = /^\\s*(?:0x){0,1}([0-9a-z]{1,6})\\s*$/i;\nconst strToUint32RGB = s => {\n const m = strToUint32RGBRegex.exec(s);\n if (!m) {\n return [false];\n }\n return [true, parseInt(m[1], 16)];\n};\n\nconst strToUint32RGBARegex = /^\\s*(?:0x){0,1}([0-9a-z]{1,8})\\s*$/i;\nconst strToUint32RGBA = s => {\n const m = strToUint32RGBARegex.exec(s);\n if (!m) {\n return [false];\n }\n return [true, parseInt(m[1], 16)];\n};\n\nconst hex6RE = /^\\s*#[a-f0-9]{6}\\s*$|^\\s*#[a-f0-9]{3}\\s*$/i;\nconst hexNoHash6RE = /^\\s*[a-f0-9]{6}\\s*$/i;\nconst hex8RE = /^\\s*#[a-f0-9]{8}\\s*$/i;\nconst hexNoHash8RE = /^\\s*[a-f0-9]{8}\\s*$/i;\n\n// For each format converter\n//\n// fromHex/toHex convert from/to '#RRGGBB'\n//\n// fromHex converts from the string '#RRBBGG' to the format\n// (eg: for uint32-rgb, '#123456' becomes 0x123456)\n//\n// toHex converts from the format to '#RRGGBB'\n// (eg: for uint8-rgb, [16, 33, 50] becomes '#102132')\n//\n//\n// fromStr/toStr convert from/to what's in the input[type=text] element\n//\n// toStr converts from the format to its string representation\n// (eg, for object-rgb, {r: 1, g: 0.5, b:0} becomes \"{r: 1, g: 0.5, b:0}\")\n// ^object ^string\n//\n// fromStr converts its string representation to its format\n// (eg, for object-rgb) \"{r: 1, g: 0.5, b:0}\" becomes {r: 1, g: 0.5, b:0})\n// ^string ^object\n// fromString returns an array which is [valid, v]\n// where valid is true if the string was a valid and v is the converted\n// format if v is true.\n//\n// Note: toStr should convert to \"ideal\" form (whatever that is).\n// (eg, for css-rgb\n// \"{ r: 0.10000, g: 001, b: 0}\" becomes \"{r: 0.1, g: 1, b: 0}\"\n// notice that css-rgb is a string to a string\n// )\nexport const colorFormatConverters = {\n 'hex6': {\n color: {\n from: v => [true, v],\n to: fixHex6,\n },\n text: {\n from: v => [hex6RE.test(v), v.trim()],\n to: v => v,\n },\n },\n 'hex8': {\n color: {\n from: v => [true, v],\n to: fixHex8,\n },\n text: {\n from: v => [hex8RE.test(v), v.trim()],\n to: v => v,\n },\n },\n 'hex3': {\n color: {\n from: v => [true, fixHex3(v)],\n to: hex3ToHex6,\n },\n text: {\n from: v => [hex6RE.test(v), hex6ToHex3(v.trim())],\n to: v => v,\n },\n },\n 'hex6-no-hash': {\n color: {\n from: v => [true, v.substring(1)],\n to: v => `#${fixHex6(v)}`,\n },\n text: {\n from: v => [hexNoHash6RE.test(v), v.trim()],\n to: v => v,\n },\n },\n 'hex8-no-hash': {\n color: {\n from: v => [true, v.substring(1)],\n to: v => `#${fixHex8(v)}`,\n },\n text: {\n from: v => [hexNoHash8RE.test(v), v.trim()],\n to: v => v,\n },\n },\n 'hex3-no-hash': {\n color: {\n from: v => [true, fixHex3(v).substring(1)],\n to: hex3ToHex6,\n },\n text: {\n from: v => [hexNoHash6RE.test(v), hex6ToHex3(v.trim())],\n to: v => v,\n },\n },\n 'uint32-rgb': {\n color: {\n from: v => [true, hexToUint32RGB(v)],\n to: uint32RGBToHex,\n },\n text: {\n from: v => strToUint32RGB(v),\n to: v => `0x${v.toString(16).padStart(6, '0')}`,\n },\n },\n 'uint32-rgba': {\n color: {\n from: v => [true, hexToUint32RGBA(v)],\n to: uint32RGBAToHex,\n },\n text: {\n from: v => strToUint32RGBA(v),\n to: v => `0x${v.toString(16).padStart(8, '0')}`,\n },\n },\n 'uint8-rgb': {\n color: {\n from: v => [true, hexToUint8RGB(v)],\n to: uint8RGBToHex,\n },\n text: {\n from: strTo3Ints,\n to: v => v.join(', '),\n },\n },\n 'uint8-rgba': {\n color: {\n from: v => [true, hexToUint8RGBA(v)],\n to: uint8RGBAToHex,\n },\n text: {\n from: strTo4Ints,\n to: v => v.join(', '),\n },\n },\n 'float-rgb': {\n color: {\n from: v => [true, hexToFloatRGB(v)],\n to: floatRGBToHex,\n },\n text: {\n from: strTo3Floats,\n // need Array.from because map of Float32Array makes a Float32Array\n to: v => Array.from(v).map(v => f3(v)).join(', '),\n },\n },\n 'float-rgba': {\n color: {\n from: v => [true, hexToFloatRGBA(v)],\n to: floatRGBAToHex,\n },\n text: {\n from: strTo4Floats,\n // need Array.from because map of Float32Array makes a Float32Array\n to: v => Array.from(v).map(v => f3(v)).join(', '),\n },\n },\n 'float-hsv': {\n color: {\n from: v => [true, rgbFloatToHSV01(hexToFloatRGB(v))],\n to: v => hsv01ToRGBFloat(floatRGBToHex(v)),\n },\n text: {\n from: strTo3Floats,\n // need Array.from because map of Float32Array makes a Float32Array\n to: v => Array.from(v).map(v => f3(v)).join(', '),\n },\n },\n 'float-hsva': {\n color: {\n from: v => [true, rgbaFloatToHSVA01(hexToFloatRGB(v))],\n to: v => hsva01ToRGBAFloat(floatRGBToHex(v)),\n },\n text: {\n from: strTo4Floats,\n // need Array.from because map of Float32Array makes a Float32Array\n to: v => Array.from(v).map(v => f3(v)).join(', '),\n },\n },\n //'float-hsl': {\n // color: {\n // from: v => [true, rgbFloatToHsl01(hexToFloatRGB(v))],\n // to: v => hsl01ToRGBFloat(floatRGBToHex(v)),\n // },\n // text: {\n // from: strTo3Floats,\n // // need Array.from because map of Float32Array makes a Float32Array\n // to: v => Array.from(v).map(v => f3(v)).join(', '),\n // },\n //},\n //'float-hsla': {\n // color: {\n // from: v => [true, hexToFloatRGBA(v)],\n // to: floatRGBAToHex,\n // },\n // text: {\n // from: strTo4Floats,\n // // need Array.from because map of Float32Array makes a Float32Array\n // to: v => Array.from(v).map(v => f3(v)).join(', '),\n // },\n //},\n 'object-rgb': {\n color: {\n from: v => [true, hexToObjectRGB(v)],\n to: objectRGBToHex,\n },\n text: {\n from: strToRGBObject,\n to: rgbObjectToStr,\n },\n },\n 'object-rgba': {\n color: {\n from: v => [true, hexToObjectRGBA(v)],\n to: objectRGBAToHex,\n },\n text: {\n from: strToRGBAObject,\n to: rgbaObjectToStr,\n },\n },\n 'css-rgb': {\n color: {\n from: v => [true, hexToCssRGB(v)],\n to: cssRGBToHex,\n },\n text: {\n from: strToCssRGB,\n to: v => strToCssRGB(v)[1],\n },\n },\n 'css-rgba': {\n color: {\n from: v => [true, hexToCssRGBA(v)],\n to: cssRGBAToHex,\n },\n text: {\n from: strToCssRGBA,\n to: v => strToCssRGBA(v)[1],\n },\n },\n 'css-hsl': {\n color: {\n from: v => [true, hexToCssHSL(v)],\n to: cssHSLToHex,\n },\n text: {\n from: strToCssHSL,\n to: v => strToCssHSL(v)[1],\n },\n },\n 'css-hsla': {\n color: {\n from: v => [true, hexToCssHSLA(v)],\n to: cssHSLAToHex,\n },\n text: {\n from: strToCssHSLA,\n to: v => strToCssHSLA(v)[1],\n },\n },\n};","import { createElem } from '../libs/elem.js';\nimport View from './View.js';\n\nexport default class ElementView extends View {\n constructor(tag, className) {\n super(createElem(tag, {className}));\n }\n}","import ElementView from '../views/ElementView.js';\nimport LabelController from './LabelController.js';\n\n// TODO: remove this? Should just be user side\nexport default class Canvas extends LabelController {\n #canvasElem;\n\n constructor(name) {\n super('muigui-canvas', name);\n this.#canvasElem = this.add(\n new ElementView('canvas', 'muigui-canvas'),\n ).domElement;\n }\n get canvas() {\n return this.#canvasElem;\n }\n}","import { createElem } from '../libs/elem.js';\nimport { identity } from '../libs/conversions.js';\nimport EditView from './EditView.js';\nimport { copyExistingProperties } from '../libs/utils.js';\n\nexport default class ColorView extends EditView {\n #to;\n #from;\n #colorElem;\n #skipUpdate;\n #options = {\n converters: identity,\n };\n\n constructor(setter, options) {\n const colorElem = createElem('input', {\n type: 'color',\n onInput: () => {\n const [valid, newV] = this.#from(colorElem.value);\n if (valid) {\n this.#skipUpdate = true;\n setter.setValue(newV);\n }\n },\n onChange: () => {\n const [valid, newV] = this.#from(colorElem.value);\n if (valid) {\n this.#skipUpdate = true;\n setter.setFinalValue(newV);\n }\n },\n });\n super(createElem('div', {}, [colorElem]));\n this.setOptions(options);\n this.#colorElem = colorElem;\n }\n updateDisplay(v) {\n if (!this.#skipUpdate) {\n this.#colorElem.value = this.#to(v);\n }\n this.#skipUpdate = false;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {converters: {to, from}} = this.#options;\n this.#to = to;\n this.#from = from;\n return this;\n }\n}\n","import {\n colorFormatConverters,\n guessFormat,\n} from '../libs/color-utils.js';\nimport ValueController from './ValueController.js';\nimport TextView from '../views/TextView.js';\nimport ColorView from '../views/ColorView.js';\n\nexport default class Color extends ValueController {\n #colorView;\n #textView;\n\n constructor(object, property, options = {}) {\n super(object, property, 'muigui-color');\n const format = options.format || guessFormat(this.getValue());\n const {color, text} = colorFormatConverters[format];\n this.#colorView = this.add(new ColorView(this, {converters: color}));\n this.#textView = this.add(new TextView(this, {converters: text}));\n this.updateDisplay();\n }\n setOptions(options) {\n const {format} = options;\n if (format) {\n const {color, text} = colorFormatConverters[format];\n this.#colorView.setOptions({converters: color});\n this.#textView.setOptions({converters: text});\n }\n super.setOptions(options);\n return this;\n }\n}","import Controller from './Controller.js';\n\n// This feels like it should be something else like\n// gui.addController({className: 'muigui-divider')};\nexport default class Divider extends Controller {\n constructor() {\n super('muigui-divider');\n }\n}","import Controller from './Controller.js';\n\nexport default class Container extends Controller {\n #controllers;\n #childDestController;\n\n constructor(className) {\n super(className);\n this.#controllers = [];\n this.#childDestController = this;\n }\n get children() {\n return this.#controllers; // should we return a copy?\n }\n get controllers() {\n return this.#controllers.filter(c => !(c instanceof Container));\n }\n get folders() {\n return this.#controllers.filter(c => c instanceof Container);\n }\n reset(recursive = true) {\n for (const controller of this.#controllers) {\n if (!(controller instanceof Container) || recursive) {\n controller.reset(recursive);\n }\n }\n return this;\n }\n updateDisplay() {\n for (const controller of this.#controllers) {\n controller.updateDisplay();\n }\n return this;\n }\n remove(controller) {\n const ndx = this.#controllers.indexOf(controller);\n if (ndx >= 0) {\n const c = this.#controllers.splice(ndx, 1);\n const c0 = c[0];\n const elem = c0.domElement;\n elem.remove();\n c0.setParent(null);\n }\n return this;\n }\n #addControllerImpl(controller) {\n this.domElement.appendChild(controller.domElement);\n this.#controllers.push(controller);\n controller.setParent(this);\n return controller;\n }\n addController(controller) {\n return this.#childDestController.#addControllerImpl(controller);\n }\n pushContainer(container) {\n this.addController(container);\n this.#childDestController = container;\n return container;\n }\n popContainer() {\n this.#childDestController = this.#childDestController.parent;\n return this;\n }\n}\n","import { createElem } from '../libs/elem.js';\nimport Container from './Container.js';\n\nexport default class Folder extends Container {\n #labelElem;\n\n constructor(name = 'Controls', className = 'muigui-menu') {\n super(className);\n this.#labelElem = createElem('label');\n this.addElem(createElem('button', {\n type: 'button',\n onClick: () => this.toggleOpen(),\n }, [this.#labelElem]));\n this.pushContainer(new Container('muigui-open-container'));\n this.pushContainer(new Container());\n this.name(name);\n this.open();\n }\n open(open = true) {\n this.domElement.classList.toggle('muigui-closed', !open);\n this.domElement.classList.toggle('muigui-open', open);\n return this;\n }\n close() {\n return this.open(false);\n }\n name(name) {\n this.#labelElem.textContent = name;\n return this;\n }\n title(title) {\n return this.name(title);\n }\n toggleOpen() {\n this.open(!this.domElement.classList.contains('muigui-open'));\n return this;\n }\n}\n","import Controller from './Controller.js';\n\n// This feels like it should be something else like\n// gui.addDividing = new Controller()\nexport default class Label extends Controller {\n constructor(text) {\n super('muigui-label');\n this.text(text);\n }\n text(text) {\n this.domElement.textContent = text;\n return this;\n }\n}","function noop() {\n}\n\nexport function computeRelativePosition(elem, event, start) {\n const rect = elem.getBoundingClientRect();\n const x = event.clientX - rect.left;\n const y = event.clientY - rect.top;\n const nx = x / rect.width;\n const ny = y / rect.height;\n start = start || [x, y];\n const dx = x - start[0];\n const dy = y - start[1];\n const ndx = dx / rect.width;\n const ndy = dy / rect.width;\n return {x, y, nx, ny, dx, dy, ndx, ndy};\n}\n\nexport function addTouchEvents(elem, {onDown = noop, onMove = noop, onUp = noop}) {\n let start;\n const pointerMove = function (event) {\n const e = {\n type: 'move',\n ...computeRelativePosition(elem, event, start),\n };\n onMove(e);\n };\n\n const pointerUp = function (event) {\n elem.releasePointerCapture(event.pointerId);\n elem.removeEventListener('pointermove', pointerMove);\n elem.removeEventListener('pointerup', pointerUp);\n\n document.body.style.backgroundColor = '';\n\n onUp('up');\n };\n\n const pointerDown = function (event) {\n elem.addEventListener('pointermove', pointerMove);\n elem.addEventListener('pointerup', pointerUp);\n elem.setPointerCapture(event.pointerId);\n\n const rel = computeRelativePosition(elem, event);\n start = [rel.x, rel.y];\n onDown({\n type: 'down',\n ...rel,\n });\n };\n\n elem.addEventListener('pointerdown', pointerDown);\n\n return function () {\n elem.removeEventListener('pointerdown', pointerDown);\n };\n}","import { createElem, getNewId } from '../libs/elem.js';\nimport { addTouchEvents } from '../libs/touch.js';\nimport { identity } from '../libs/conversions.js';\nimport { clamp } from '../libs/utils.js';\nimport EditView from './EditView.js';\nimport {\n hexToFloatRGB,\n hexToFloatRGBA,\n hsv01ToRGBFloat,\n hsva01ToRGBAFloat,\n rgbFloatToHSV01,\n rgbaFloatToHSVA01,\n floatRGBToHex,\n floatRGBAToHex,\n rgbaFloatToHsla01,\n} from '../libs/color-utils.js';\nimport { copyExistingProperties } from '../libs/utils.js';\n\nconst svg = `\n\n \n \n \n \n \n \n \n \n\n \n \n \n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n \n \n \n \n \n \n \n \n\n`;\n\nfunction connectFillTargets(elem) {\n elem.querySelectorAll('[data-src]').forEach(srcElem => {\n const id = getNewId();\n srcElem.id = id;\n elem.querySelectorAll(`[data-target=${srcElem.dataset.src}]`).forEach(targetElem => {\n targetElem.setAttribute('fill', `url(#${id})`);\n });\n });\n return elem;\n}\n\n// Was originally going to make alpha an option. Issue is\n// hard coded conversions?\nexport default class ColorChooserView extends EditView {\n #to;\n #from;\n #satLevelElem;\n #circleElem;\n #hueUIElem;\n #hueElem;\n #hueCursorElem;\n #alphaUIElem;\n #alphaElem;\n #alphaCursorElem;\n #hsva;\n #skipHueUpdate;\n #skipSatLevelUpdate;\n #skipAlphaUpdate;\n #options = {\n converters: identity,\n alpha: false,\n };\n #convertInternalToHex;\n #convertHexToInternal;\n\n constructor(setter, options) {\n super(createElem('div', {\n innerHTML: svg,\n className: 'muigui-no-scroll',\n }));\n this.#satLevelElem = this.domElement.children[0];\n this.#hueUIElem = this.domElement.children[1];\n this.#alphaUIElem = this.domElement.children[2];\n connectFillTargets(this.#satLevelElem);\n connectFillTargets(this.#hueUIElem);\n connectFillTargets(this.#alphaUIElem);\n this.#circleElem = this.$('.muigui-color-chooser-circle');\n this.#hueElem = this.$('[data-src=muigui-color-chooser-hue]');\n this.#hueCursorElem = this.$('.muigui-color-chooser-hue-cursor');\n this.#alphaElem = this.$('[data-src=muigui-color-chooser-alpha]');\n this.#alphaCursorElem = this.$('.muigui-color-chooser-alpha-cursor');\n\n const handleSatLevelChange = (e) => {\n const s = clamp(e.nx, 0, 1);\n const v = clamp(e.ny, 0, 1);\n this.#hsva[1] = s;\n this.#hsva[2] = (1 - v);\n this.#skipHueUpdate = true;\n this.#skipAlphaUpdate = true;\n const [valid, newV] = this.#from(this.#convertInternalToHex(this.#hsva));\n if (valid) {\n setter.setValue(newV);\n }\n };\n\n const handleHueChange = (e) => {\n const h = clamp(e.nx, 0, 1);\n this.#hsva[0] = h;\n this.#skipSatLevelUpdate = true;\n this.#skipAlphaUpdate = true;\n const [valid, newV] = this.#from(this.#convertInternalToHex(this.#hsva));\n if (valid) {\n setter.setValue(newV);\n }\n };\n\n const handleAlphaChange = (e) => {\n const a = clamp(e.nx, 0, 1);\n this.#hsva[3] = a;\n this.#skipHueUpdate = true;\n this.#skipSatLevelUpdate = true;\n const [valid, newV] = this.#from(this.#convertInternalToHex(this.#hsva));\n if (valid) {\n setter.setValue(newV);\n }\n };\n\n addTouchEvents(this.#satLevelElem, {\n onDown: handleSatLevelChange,\n onMove: handleSatLevelChange,\n });\n addTouchEvents(this.#hueUIElem, {\n onDown: handleHueChange,\n onMove: handleHueChange,\n });\n addTouchEvents(this.#alphaUIElem, {\n onDown: handleAlphaChange,\n onMove: handleAlphaChange,\n });\n this.setOptions(options);\n }\n updateDisplay(newV) {\n if (!this.#hsva) {\n this.#hsva = this.#convertHexToInternal(this.#to(newV));\n }\n {\n const [h, s, v, a = 1] = this.#convertHexToInternal(this.#to(newV));\n // Don't copy the hue if it was un-computable.\n if (!this.#skipHueUpdate) {\n this.#hsva[0] = s > 0.001 && v > 0.001 ? h : this.#hsva[0];\n }\n if (!this.#skipSatLevelUpdate) {\n this.#hsva[1] = s;\n this.#hsva[2] = v;\n }\n if (!this.#skipAlphaUpdate) {\n this.#hsva[3] = a;\n }\n }\n {\n const [h, s, v, a] = this.#hsva;\n const [hue, sat, lum] = rgbaFloatToHsla01(hsva01ToRGBAFloat(this.#hsva));\n\n if (!this.#skipHueUpdate) {\n this.#hueCursorElem.setAttribute('transform', `translate(${h * 64}, 0)`);\n }\n this.#hueElem.children[0].setAttribute('stop-color', `hsl(${hue * 360} 0% 100% / ${a})`);\n this.#hueElem.children[1].setAttribute('stop-color', `hsl(${hue * 360} 100% 50% / ${a})`);\n if (!this.#skipAlphaUpdate) {\n this.#alphaCursorElem.setAttribute('transform', `translate(${a * 64}, 0)`);\n }\n this.#alphaElem.children[0].setAttribute('stop-color', `hsl(${hue * 360} ${sat * 100}% ${lum * 100}% / 0)`);\n this.#alphaElem.children[1].setAttribute('stop-color', `hsl(${hue * 360} ${sat * 100}% ${lum * 100}% / 1)`);\n\n if (!this.#skipSatLevelUpdate) {\n this.#circleElem.setAttribute('cx', `${s * 64}`);\n this.#circleElem.setAttribute('cy', `${(1 - v) * 48}`);\n }\n }\n this.#skipHueUpdate = false;\n this.#skipSatLevelUpdate = false;\n this.#skipAlphaUpdate = false;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {converters: {to, from}, alpha} = this.#options;\n this.#alphaUIElem.style.display = alpha ? '' : 'none';\n this.#convertInternalToHex = alpha\n ? v => floatRGBAToHex(hsva01ToRGBAFloat(v))\n : v => floatRGBToHex(hsv01ToRGBFloat(v));\n this.#convertHexToInternal = alpha\n ? v => rgbaFloatToHSVA01(hexToFloatRGBA(v))\n : v => rgbFloatToHSV01(hexToFloatRGB(v));\n this.#to = to;\n this.#from = from;\n return this;\n }\n}\n","import ElementView from '../views/ElementView.js';\nimport ValueController from './ValueController.js';\nimport { copyExistingProperties } from '../libs/utils.js';\nimport { createElem } from '../libs/elem.js';\n/*\n\nholder = new TabHolder\ntab = holder.add(new Tab(\"name\"))\ntab.add(...)\n\n\npc = new PopdownController\ntop = pc.add(new Row())\ntop.add(new Button());\nvalues = topRow.add(new Div())\nbottom = pc.add(new Row());\n\n\n\npc = new PopdownController\npc.addTop\npc.addTop\n\npc.addBottom\n\n\n*/\n\nexport default class PopDownController extends ValueController {\n #top;\n #valuesView;\n #checkboxElem;\n #bottom;\n #options = {\n open: false,\n };\n\n constructor(object, property, options = {}) {\n super(object, property, 'muigui-pop-down-controller');\n /*\n [ValueView\n [[B][values]] upper row\n [[ visual ]] lower row\n ]\n */\n this.#top = this.add(new ElementView('div', 'muigui-pop-down-top'));\n// this.#top.add(new CheckboxView(makeSetter(this.#options, 'open')));\n const checkboxElem = this.#top.addElem(createElem('input', {\n type: 'checkbox',\n onChange: () => {\n this.#options.open = checkboxElem.checked;\n this.updateDisplay();\n },\n }));\n this.#checkboxElem = checkboxElem;\n this.#valuesView = this.#top.add(new ElementView('div', 'muigui-pop-down-values'));\n const container = new ElementView('div', 'muigui-pop-down-bottom muigui-open-container');\n this.#bottom = new ElementView('div');\n container.add(this.#bottom);\n this.add(container);\n this.setOptions(options);\n }\n setKnobColor(bgCssColor/*, fgCssColor*/) {\n if (this.#checkboxElem) {\n this.#checkboxElem.style = `\n --range-color: ${bgCssColor};\n --value-bg-color: ${bgCssColor};\n `;\n }\n }\n updateDisplay() {\n super.updateDisplay();\n const {open} = this.#options;\n this.domElement.children[1].classList.toggle('muigui-open', open);\n this.domElement.children[1].classList.toggle('muigui-closed', !open);\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n super.setOptions(options);\n this.updateDisplay();\n }\n addTop(view) {\n return this.#valuesView.add(view);\n }\n addBottom(view) {\n return this.#bottom.add(view);\n }\n}","/* eslint-disable no-underscore-dangle */\nimport {\n colorFormatConverters,\n guessFormat,\n hasAlpha,\n hexToUint8RGB,\n hslToRgbUint8,\n rgbUint8ToHsl,\n uint8RGBToHex,\n} from '../libs/color-utils.js';\nimport ColorChooserView from '../views/ColorChooserView.js';\nimport TextView from '../views/TextView.js';\nimport PopDownController from './PopDownController.js';\n\nexport default class ColorChooser extends PopDownController {\n #colorView;\n #textView;\n #to;\n\n constructor(object, property, options = {}) {\n super(object, property, 'muigui-color-chooser');\n const format = options.format || guessFormat(this.getValue());\n const {color, text} = colorFormatConverters[format];\n this.#to = color.to;\n this.#textView = new TextView(this, {converters: text, alpha: hasAlpha(format)});\n this.#colorView = new ColorChooserView(this, {converters: color, alpha: hasAlpha(format)});\n this.addTop(this.#textView);\n this.addBottom(this.#colorView);\n // WTF! FIX!\n this.___setKnobHelper = true;\n this.updateDisplay();\n }\n #setKnobHelper() {\n if (this.#to) {\n const hex6Or8 = this.#to(this.getValue());\n const alpha = hex6Or8.length === 9 ? hex6Or8.substring(7, 9) : 'FF';\n const hsl = rgbUint8ToHsl(hexToUint8RGB(hex6Or8));\n hsl[2] = (hsl[2] + 50) % 100;\n const hex = uint8RGBToHex(hslToRgbUint8(hsl));\n this.setKnobColor(`${hex6Or8.substring(0, 7)}${alpha}`, hex);\n }\n }\n updateDisplay() {\n super.updateDisplay();\n if (this.___setKnobHelper) {\n this.#setKnobHelper();\n }\n }\n setOptions(options) {\n super.setOptions(options);\n return this;\n }\n}\n","import { createElem } from '../libs/elem.js';\nimport View from '../views/View.js';\n\nfunction showCSS(ob) {\n if (ob.prototype.css) {\n showCSS(ob.prototype);\n }\n}\n\nexport default class Layout extends View {\n static css = 'bar';\n constructor(tag, className) {\n super(createElem(tag, {className}));\n\n showCSS(this);\n }\n}\n\n/*\nclass ValueController ?? {\n const row = this.add(new Row());\n const label = row.add(new Label());\n const div = row.add(new Div());\n const row = div.add(new Row());\n}\n*/\n\n/*\nclass MyCustomThing extends ValueController {\n constructor(object, property, options) {\n const topRow = this.add(new Row());\n const bottomRow = this.add(new Row());\n topRow.add(new NumberView());\n topRow.add(new NumberView());\n topRow.add(new NumberView());\n topRow.add(new NumberView());\n bottomRow.add(new DirectionView());\n bottomRow.add(new DirectionView());\n bottomRow.add(new DirectionView());\n bottomRow.add(new DirectionView());\n }\n}\n new Grid([\n [new\n ]\n */","import Layout from './Layout.js';\n\nexport default class Column extends Layout {\n constructor() {\n super('div', 'muigui-row');\n }\n}\n","import Layout from './Layout.js';\n\nexport default class Frame extends Layout {\n static css = 'foo';\n constructor() {\n super('div', 'muigui-frame');\n }\n static get foo() {\n return 'boo';\n }\n}\n","import Layout from './Layout.js';\n\nexport default class Grid extends Layout {\n constructor() {\n super('div', 'muigui-grid');\n }\n}\n","import Layout from './Layout.js';\n\nexport default class Row extends Layout {\n constructor() {\n super('div', 'muigui-row');\n }\n}\n","import css from './styles/muigui.css.js';\nimport {createElem} from './libs/elem.js';\nimport {createController} from './controllers/create-controller.js';\nimport {\n mapRange,\n makeRangeConverters,\n makeRangeOptions,\n makeMinMaxPair,\n} from './libs/utils.js';\nimport {\n converters\n} from './libs/conversions.js';\nimport {\n hasAlpha,\n guessFormat,\n} from './libs/color-utils.js';\nimport Canvas from './controllers/Canvas.js';\nimport Color from './controllers/Color.js';\nimport Divider from './controllers/Divider.js';\nimport Folder from './controllers/Folder.js';\nimport Label from './controllers/Label.js';\nimport Controller from './controllers/Controller.js';\nimport ColorChooser from './controllers/ColorChooser.js';\n\nimport Column from './layout/Column.js';\nimport Frame from './layout/Frame.js';\nimport Grid from './layout/Grid.js';\nimport Row from './layout/Row.js';\n\nexport {\n Column,\n Frame,\n Grid,\n Row,\n};\n\nexport class GUIFolder extends Folder {\n add(object, property, ...args) {\n const controller = object instanceof Controller\n ? object\n : createController(object, property, ...args);\n return this.addController(controller);\n }\n addCanvas(name) {\n return this.addController(new Canvas(name));\n }\n addColor(object, property, options = {}) {\n const value = object[property];\n if (hasAlpha(options.format || guessFormat(value))) {\n return this.addController(new ColorChooser(object, property, options));\n } else {\n return this.addController(new Color(object, property, options));\n }\n }\n addDivider() {\n return this.addController(new Divider());\n }\n addFolder(name) {\n return this.addController(new GUIFolder(name));\n }\n addLabel(text) {\n return this.addController(new Label(text));\n }\n addButton(name, fn) {\n const o = {fn};\n return this.add(o, 'fn').name(name);\n }\n}\n\nclass MuiguiElement extends HTMLElement {\n constructor() {\n super();\n this.shadow = this.attachShadow({mode: 'open'});\n }\n}\n\ncustomElements.define('muigui-element', MuiguiElement);\n\nconst baseStyleSheet = new CSSStyleSheet();\n//baseStyleSheet.replaceSync(css.default);\nconst userStyleSheet = new CSSStyleSheet();\n\nfunction makeStyleSheetUpdater(styleSheet) {\n let newCss;\n let newCssPromise;\n\n function updateStyle() {\n if (newCss && !newCssPromise) {\n const s = newCss;\n newCss = undefined;\n newCssPromise = styleSheet.replace(s).then(() => {\n newCssPromise = undefined;\n updateStyle();\n });\n }\n }\n\n return function updateStyleSheet(css) {\n newCss = css;\n updateStyle();\n };\n}\n\nconst updateBaseStyle = makeStyleSheetUpdater(baseStyleSheet);\nconst updateUserStyle = makeStyleSheetUpdater(userStyleSheet);\n\nfunction getTheme(name) {\n const { include, css: cssStr } = css.themes[name];\n return `${include.map(m => css[m]).join('\\n')} : css.default}\\n${cssStr || ''}`;\n}\n\nexport class GUI extends GUIFolder {\n static converters = converters;\n static mapRange = mapRange;\n static makeRangeConverters = makeRangeConverters;\n static makeRangeOptions = makeRangeOptions;\n static makeMinMaxPair = makeMinMaxPair;\n #localStyleSheet = new CSSStyleSheet();\n\n constructor(options = {}) {\n super('Controls', 'muigui-root');\n if (options instanceof HTMLElement) {\n options = {parent: options};\n }\n const {\n autoPlace = true,\n width,\n title = 'Controls',\n } = options;\n let {\n parent,\n } = options;\n\n if (width) {\n this.domElement.style.width = /^\\d+$/.test(width) ? `${width}px` : width;\n }\n if (parent === undefined && autoPlace) {\n parent = document.body;\n this.domElement.classList.add('muigui-auto-place');\n }\n if (parent) {\n const muiguiElement = createElem('muigui-element');\n muiguiElement.shadowRoot.adoptedStyleSheets = [this.#localStyleSheet, baseStyleSheet, userStyleSheet];\n muiguiElement.shadow.appendChild(this.domElement);\n parent.appendChild(muiguiElement);\n }\n if (title) {\n this.title(title);\n }\n this.#localStyleSheet.replaceSync(css.default);\n this.domElement.classList.add('muigui', 'muigui-colors');\n }\n setStyle(css) {\n this.#localStyleSheet.replace(css);\n }\n static setBaseStyles(css) {\n updateBaseStyle(css);\n }\n static getBaseStyleSheet() {\n return baseStyleSheet;\n }\n static setUserStyles(css) {\n updateUserStyle(css);\n }\n static getUserStyleSheet() {\n return userStyleSheet;\n }\n setTheme(name) {\n this.setStyle(getTheme(name));\n }\n static setTheme(name) {\n GUI.setBaseStyles(getTheme(name));\n }\n}\n\nexport default GUI;\n","function noop() {\n}\n\nconst keyDirections = {\n ArrowLeft: [-1, 0],\n ArrowRight: [1, 0],\n ArrowUp: [0, -1],\n ArrowDown: [0, 1],\n};\n\n// This probably needs to be global\nexport function addKeyboardEvents(elem, {onDown = noop, onUp = noop}) {\n const keyDown = function (event) {\n const mult = event.shiftKey ? 10 : 1;\n const [dx, dy] = (keyDirections[event.key] || [0, 0]).map(v => v * mult);\n const fn = event.type === 'keydown' ? onDown : onUp;\n fn({\n type: event.type.substring(3),\n dx,\n dy,\n event,\n });\n };\n\n elem.addEventListener('keydown', keyDown);\n elem.addEventListener('keyup', keyDown);\n\n return function () {\n elem.removeEventListener('keydown', keyDown);\n elem.removeEventListener('keyup', keyDown);\n };\n}","export function assert(truthy, msg = '') {\n if (!truthy) {\n throw new Error(msg);\n }\n}","import { assert } from '../libs/assert.js';\n\nfunction getEllipsePointForAngle(cx, cy, rx, ry, phi, theta) {\n const m = Math.abs(rx) * Math.cos(theta);\n const n = Math.abs(ry) * Math.sin(theta);\n\n return [\n cx + Math.cos(phi) * m - Math.sin(phi) * n,\n cy + Math.sin(phi) * m + Math.cos(phi) * n,\n ];\n}\n\nfunction getEndpointParameters(cx, cy, rx, ry, phi, theta, dTheta) {\n const [x1, y1] = getEllipsePointForAngle(cx, cy, rx, ry, phi, theta);\n const [x2, y2] = getEllipsePointForAngle(cx, cy, rx, ry, phi, theta + dTheta);\n\n const fa = Math.abs(dTheta) > Math.PI ? 1 : 0;\n const fs = dTheta > 0 ? 1 : 0;\n\n return { x1, y1, x2, y2, fa, fs };\n}\n\nexport function arc(cx, cy, r, start, end) {\n assert(Math.abs(start - end) <= Math.PI * 2);\n assert(start >= -Math.PI && start <= Math.PI * 2);\n assert(start <= end);\n assert(end >= -Math.PI && end <= Math.PI * 4);\n\n const { x1, y1, x2, y2, fa, fs } = getEndpointParameters(cx, cy, r, r, 0, start, end - start);\n return Math.abs(Math.abs(start - end) - Math.PI * 2) > Number.EPSILON\n ? `M${cx} ${cy} L${x1} ${y1} A ${r} ${r} 0 ${fa} ${fs} ${x2} ${y2} L${cx} ${cy}`\n : `M${x1} ${y1} L${x1} ${y1} A ${r} ${r} 0 ${fa} ${fs} ${x2} ${y2}`;\n}\n","import { identity } from '../libs/conversions.js';\nimport { createElem } from '../libs/elem.js';\nimport { addKeyboardEvents } from '../libs/keyboard.js';\nimport { arc } from '../libs/svg.js';\nimport { addTouchEvents } from '../libs/touch.js';\nimport { createWheelHelper } from '../libs/wheel.js';\nimport { clamp, copyExistingProperties, euclideanModulo, lerp, stepify } from '../libs/utils.js';\nimport EditView from './EditView.js';\n\nconst svg = `\n\n \n \n \n \n \n \n \n\n`;\n\nconst twoPiMod = v => euclideanModulo(v + Math.PI, Math.PI * 2) - Math.PI;\n\nexport default class DirectionView extends EditView {\n #arrowElem;\n #rangeElem;\n #lastV;\n #wrap;\n #options = {\n step: 1,\n min: -180,\n max: 180,\n\n /*\n --------\n / -π/2 \\\n / | \\\n |<- -π * |\n | * 0 ->| zero is down the positive X axis\n |<- +π * |\n \\ | /\n \\ π/2 /\n --------\n */\n dirMin: -Math.PI,\n dirMax: Math.PI,\n //dirMin: Math.PI * 0.5,\n //dirMax: Math.PI * 2.5,\n //dirMin: -Math.PI * 0.75, // test 10:30 to 7:30\n //dirMax: Math.PI * 0.75,\n //dirMin: Math.PI * 0.75, // test 7:30 to 10:30\n //dirMax: -Math.PI * 0.75,\n //dirMin: -Math.PI * 0.75, // test 10:30 to 1:30\n //dirMax: -Math.PI * 0.25,\n //dirMin: Math.PI * 0.25, // test 4:30 to 7:30\n //dirMax: Math.PI * 0.75,\n //dirMin: Math.PI * 0.75, // test 4:30 to 7:30\n //dirMax: Math.PI * 0.25,\n wrap: undefined,\n converters: identity,\n };\n\n constructor(setter, options = {}) {\n const wheelHelper = createWheelHelper();\n super(createElem('div', {\n className: 'muigui-direction muigui-no-scroll',\n innerHTML: svg,\n onWheel: e => {\n e.preventDefault();\n const {min, max, step} = this.#options;\n const delta = wheelHelper(e, step);\n let tempV = this.#lastV + delta;\n if (this.#wrap) {\n tempV = euclideanModulo(tempV - min, max - min) + min;\n }\n const newV = clamp(stepify(tempV, v => v, step), min, max);\n setter.setValue(newV);\n },\n }));\n const handleTouch = (e) => {\n const {min, max, step, dirMin, dirMax} = this.#options;\n const nx = e.nx * 2 - 1;\n const ny = e.ny * 2 - 1;\n const a = Math.atan2(ny, nx);\n\n const center = (dirMin + dirMax) / 2;\n\n const centeredAngle = twoPiMod(a - center);\n const centeredStart = twoPiMod(dirMin - center);\n const diff = dirMax - dirMin;\n\n const n = clamp((centeredAngle - centeredStart) / (diff), 0, 1);\n const newV = stepify(min + (max - min) * n, v => v, step);\n setter.setValue(newV);\n };\n addTouchEvents(this.domElement, {\n onDown: handleTouch,\n onMove: handleTouch,\n });\n addKeyboardEvents(this.domElement, {\n onDown: (e) => {\n const {min, max, step} = this.#options;\n const newV = clamp(stepify(this.#lastV + e.dx * step, v => v, step), min, max);\n setter.setValue(newV);\n },\n });\n this.#arrowElem = this.$('#muigui-arrow');\n this.#rangeElem = this.$('#muigui-range');\n this.setOptions(options);\n }\n updateDisplay(v) {\n this.#lastV = v;\n const {min, max} = this.#options;\n const n = (v - min) / (max - min);\n const angle = lerp(this.#options.dirMin, this.#options.dirMax, n);\n this.#arrowElem.style.transform = `rotate(${angle}rad)`;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {dirMin, dirMax, wrap} = this.#options;\n this.#wrap = wrap !== undefined\n ? wrap\n : Math.abs(dirMin - dirMax) >= Math.PI * 2 - Number.EPSILON;\n const [min, max] = dirMin < dirMax ? [dirMin, dirMax] : [dirMax , dirMin];\n this.#rangeElem.setAttribute('d', arc(0, 0, 28.87, min, max));\n }\n}\n","import { identity } from '../libs/conversions.js';\nimport DirectionView from '../views/DirectionView.js';\nimport NumberView from '../views/NumberView.js';\n// import ValueController from './ValueController.js';\nimport PopDownController from './PopDownController.js';\n\n\n// deg2rad\n// where is 0\n// range (0, 360), (-180, +180), (0,0) Really this is a range\n\nexport default class Direction extends PopDownController {\n #options;\n constructor(object, property, options) {\n super(object, property, 'muigui-direction');\nthis.#options = options; // FIX\n this.addTop(new NumberView(this,\nidentity));\n this.addBottom(new DirectionView(this, options));\n this.updateDisplay();\n }\n}\n\n","import { createElem } from '../libs/elem.js';\nimport { makeId } from '../libs/ids.js';\nimport EditView from './EditView.js';\n\nexport default class RadioGridView extends EditView {\n #values;\n\n constructor(setter, keyValues, cols = 3) {\n const values = [];\n const name = makeId();\n super(createElem('div', {}, keyValues.map(([key, value], ndx) => {\n values.push(value);\n return createElem('label', {}, [\n createElem('input', {\n type: 'radio',\n name,\n value: ndx,\n onChange: function () {\n if (this.checked) {\n setter.setFinalValue(that.#values[this.value]);\n }\n },\n }),\n createElem('button', {\n type: 'button',\n textContent: key,\n onClick: function () {\n this.previousElementSibling.click();\n },\n }),\n ]);\n })));\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const that = this;\n this.#values = values;\n this.cols(cols);\n }\n updateDisplay(v) {\n const ndx = this.#values.indexOf(v);\n for (let i = 0; i < this.domElement.children.length; ++i) {\n this.domElement.children[i].children[0].checked = i === ndx;\n }\n }\n cols(cols) {\n this.domElement.style.gridTemplateColumns = `repeat(${cols}, 1fr)`;\n }\n}\n","import RadioGridView from '../views/RadioGridView.js';\nimport ValueController from './ValueController.js';\nimport { convertToKeyValues } from '../libs/key-values.js';\n\nexport default class RadioGrid extends ValueController {\n constructor(object, property, options) {\n super(object, property, 'muigui-radio-grid');\n const valueIsNumber = typeof this.getValue() === 'number';\n const {\n keyValues: keyValuesInput,\n cols = 3,\n } = options;\n const keyValues = convertToKeyValues(keyValuesInput, valueIsNumber);\n this.add(new RadioGridView(this, keyValues, cols));\n this.updateDisplay();\n }\n}","export function onResize(elem, callback) {\n new ResizeObserver(() => {\n callback({rect: elem.getBoundingClientRect(), elem});\n }).observe(elem);\n}\n\nexport function onResizeSVGNoScale(elem, hAnchor, vAnchor, callback) {\n onResize(elem, ({rect}) => {\n const {width, height} = rect;\n elem.setAttribute('viewBox', `-${width * hAnchor} -${height * vAnchor} ${width} ${height}`);\n callback({elem, rect});\n });\n}\n\nexport function onResizeCanvas(elem, callback) {\n onResize(elem, ({rect}) => {\n const {width, height} = rect;\n elem.width = width;\n elem.height = height;\n callback({elem, rect});\n });\n}\n","import { createElem } from '../libs/elem.js';\nimport { addKeyboardEvents } from '../libs/keyboard.js';\nimport { addTouchEvents } from '../libs/touch.js';\nimport { createWheelHelper } from '../libs/wheel.js';\nimport { onResizeSVGNoScale } from '../libs/resize-helpers.js';\nimport { clamp, copyExistingProperties, stepify } from '../libs/utils.js';\nimport EditView from './EditView.js';\n\nconst svg = `\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n`;\n\nfunction createSVGTicks(start, end, step, min, max, height) {\n const p = [];\n if (start < min) {\n start += stepify(min - start, v => v, step);\n }\n end = Math.min(end, max);\n for (let i = start; i <= end; i += step) {\n p.push(`M${i} 0 l0 ${height}`);\n }\n return p.join(' ');\n}\n\nfunction createSVGNumbers(start, end, unitSize, unit, minusSize, min, max, labelFn) {\n const texts = [];\n if (start < min) {\n start += stepify(min - start, v => v, unitSize);\n }\n end = Math.min(end, max);\n const digits = Math.max(0, -Math.log10(unit));\n const f = v => labelFn(v.toFixed(digits));\n for (let i = start; i <= end; i += unitSize) {\n texts.push(`= 0 ? i : (i - minusSize / 2) }\" y=\"0\">${f(i / unitSize * unit)}`);\n }\n return texts.join('\\n');\n}\n\nfunction computeSizeOfMinus(elem) {\n const oldHTML = elem.innerHTML;\n elem.innerHTML = '- ';\n const text = elem.querySelector('text');\n const size = text.getComputedTextLength();\n elem.innerHTML = oldHTML;\n return size;\n}\n\nexport default class SliderView extends EditView {\n #svgElem;\n #originElem;\n #ticksElem;\n #thicksElem;\n #numbersElem;\n #leftGradElem;\n #rightGradElem;\n #width;\n #height;\n #lastV;\n #minusSize;\n #options = {\n min: -100,\n max: 100,\n step: 1,\n unit: 10,\n unitSize: 10,\n ticksPerUnit: 5,\n labelFn: v => v,\n tickHeight: 1,\n limits: true,\n thicksColor: undefined,\n orientation: undefined,\n };\n\n constructor(setter, options) {\n const wheelHelper = createWheelHelper();\n super(createElem('div', {\n innerHTML: svg,\n className: 'muigui-no-v-scroll',\n onWheel: e => {\n e.preventDefault();\n const {min, max, step} = this.#options;\n const delta = wheelHelper(e, step);\n const newV = clamp(stepify(this.#lastV + delta, v => v, step), min, max);\n setter.setValue(newV);\n },\n }));\n this.#svgElem = this.$('svg');\n this.#originElem = this.$('#muigui-origin');\n this.#ticksElem = this.$('#muigui-ticks');\n this.#thicksElem = this.$('#muigui-thicks');\n this.#numbersElem = this.$('#muigui-numbers');\n this.#leftGradElem = this.$('#muigui-left-grad');\n this.#rightGradElem = this.$('#muigui-right-grad');\n this.setOptions(options);\n let startV;\n addTouchEvents(this.domElement, {\n onDown: () => {\n startV = this.#lastV;\n },\n onMove: (e) => {\n const {min, max, unitSize, unit, step} = this.#options;\n const newV = clamp(stepify(startV - e.dx / unitSize * unit, v => v, step), min, max);\n setter.setValue(newV);\n },\n });\n addKeyboardEvents(this.domElement, {\n onDown: (e) => {\n const {min, max, step} = this.#options;\n const newV = clamp(stepify(this.#lastV + e.dx * step, v => v, step), min, max);\n setter.setValue(newV);\n },\n });\n onResizeSVGNoScale(this.#svgElem, 0.5, 0, ({rect: {width}}) => {\n this.#leftGradElem.setAttribute('x', -width / 2);\n this.#rightGradElem.setAttribute('x', width / 2 - 20);\n this.#minusSize = computeSizeOfMinus(this.#numbersElem);\n this.#width = width;\n this.#updateSlider();\n });\n }\n // |--------V--------|\n // . . | . . . | . . . |\n //\n #updateSlider() {\n // There's no size if ResizeObserver has not fired yet.\n if (!this.#width || this.#lastV === undefined) {\n return;\n }\n const {\n labelFn,\n limits,\n min,\n max,\n orientation,\n tickHeight,\n ticksPerUnit,\n unit,\n unitSize,\n thicksColor,\n } = this.#options;\n const unitsAcross = Math.ceil(this.#width / unitSize);\n const center = this.#lastV;\n const centerUnitSpace = center / unit;\n const startUnitSpace = Math.round(centerUnitSpace - unitsAcross);\n const endUnitSpace = startUnitSpace + unitsAcross * 2;\n const start = startUnitSpace * unitSize;\n const end = endUnitSpace * unitSize;\n const minUnitSpace = limits ? min * unitSize / unit : start;\n const maxUnitSpace = limits ? max * unitSize / unit : end;\n const height = labelFn(1) === '' ? 10 : 5;\n if (ticksPerUnit > 1) {\n this.#ticksElem.setAttribute('d', createSVGTicks(start, end, unitSize / ticksPerUnit, minUnitSpace, maxUnitSpace, height * tickHeight));\n }\n this.#thicksElem.style.stroke = thicksColor; //setAttribute('stroke', thicksColor);\n this.#thicksElem.setAttribute('d', createSVGTicks(start, end, unitSize, minUnitSpace, maxUnitSpace, height));\n this.#numbersElem.innerHTML = createSVGNumbers(start, end, unitSize, unit, this.#minusSize, minUnitSpace, maxUnitSpace, labelFn);\n this.#originElem.setAttribute('transform', `translate(${-this.#lastV * unitSize / unit} 0)`);\n this.#svgElem.classList.toggle('muigui-slider-up', orientation === 'up');\n }\n updateDisplay(v) {\n this.#lastV = v;\n this.#updateSlider();\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n return this;\n }\n}\n","import ValueController from './ValueController.js';\nimport NumberView from '../views/NumberView.js';\nimport SliderView from '../views/SliderView.js';\n\nexport default class Slider extends ValueController {\n constructor(object, property, options = {}) {\n super(object, property, 'muigui-slider');\n this.add(new SliderView(this, options));\n this.add(new NumberView(this, options));\n this.updateDisplay();\n }\n}\n","import { createElem } from '../libs/elem.js';\nimport { addTouchEvents } from '../libs/touch.js';\nimport { onResizeSVGNoScale } from '../libs/resize-helpers.js';\nimport EditView from './EditView.js';\n\nconst svg = `\n\n \n \n \n \n \n\n`;\n\nexport default class Vec2View extends EditView {\n #svgElem;\n #arrowElem;\n #circleElem;\n #lastV = [];\n\n constructor(setter) {\n super(createElem('div', {\n innerHTML: svg,\n className: 'muigui-no-scroll',\n }));\n const onTouch = (e) => {\n const {width, height} = this.#svgElem.getBoundingClientRect();\n const nx = e.nx * 2 - 1;\n const ny = e.ny * 2 - 1;\n setter.setValue([nx * width * 0.5, ny * height * 0.5]);\n };\n addTouchEvents(this.domElement, {\n onDown: onTouch,\n onMove: onTouch,\n });\n this.#svgElem = this.$('svg');\n this.#arrowElem = this.$('#muigui-arrow');\n this.#circleElem = this.$('#muigui-circle');\n onResizeSVGNoScale(this.#svgElem, 0.5, 0.5, () => this.#updateDisplayImpl);\n }\n #updateDisplayImpl() {\n const [x, y] = this.#lastV;\n this.#arrowElem.setAttribute('d', `M0,0L${x},${y}`);\n this.#circleElem.setAttribute('transform', `translate(${x}, ${y})`);\n }\n updateDisplay(v) {\n this.#lastV[0] = v[0];\n this.#lastV[1] = v[1];\n this.#updateDisplayImpl();\n }\n}\n","import NumberView from '../views/NumberView.js';\nimport Vec2View from '../views/Vec2View.js';\nimport PopDownController from './PopDownController.js';\nimport { strToNumber } from '../libs/conversions.js';\n\n// TODO: zoom with wheel and pinch?\n// TODO: grid?\n// // options\n// scale:\n// range: number (both x and y + /)\n// range: array (min, max)\n// xRange:\n// deg/rad/turn\n\nexport default class Vec2 extends PopDownController {\n constructor(object, property) {\n super(object, property, 'muigui-vec2');\n\n const makeSetter = (ndx) => {\n return {\n setValue: (v) => {\n const newV = this.getValue();\n newV[ndx] = v;\n this.setValue(newV);\n },\n setFinalValue: (v) => {\n const newV = this.getValue();\n newV[ndx] = v;\n this.setFinalValue(newV);\n },\n };\n };\n\n this.addTop(new NumberView(makeSetter(0), {\n converters: {\n to: v => v[0],\n from: strToNumber.from,\n },\n }));\n this.addTop(new NumberView(makeSetter(1), {\n converters: {\n to: v => v[1],\n from: strToNumber.from,\n },\n }));\n this.addBottom(new Vec2View(this));\n this.updateDisplay();\n }\n}\n","const darkColors = {\n main: '#ddd',\n};\nconst lightColors = {\n main: '#333',\n};\n\nconst darkMatcher = window.matchMedia('(prefers-color-scheme: dark)');\n\nlet colors;\nlet isDarkMode;\n\nfunction update() {\n isDarkMode = darkMatcher.matches;\n colors = isDarkMode ? darkColors : lightColors;\n}\ndarkMatcher.addEventListener('change', update);\nupdate();\n\nexport function graph(canvas, data, {\n min = -1,\n max = 1,\n interval = 16,\n color,\n }) {\n const ctx = canvas.getContext('2d');\n\n function render() {\n const {width, height} = canvas;\n ctx.clearRect(0, 0, width, height);\n ctx.beginPath();\n const range = max - min;\n for (let i = 0; i < data.length; ++i) {\n const x = i * width / data.length;\n const y = (data[i] - min) * height / range;\n ctx.lineTo(x, y);\n }\n ctx.strokeStyle = color || colors.main;\n ctx.stroke();\n }\n setInterval(render, interval);\n}","export function monitor(label, object, property, {interval = 200} = {}) {\n setInterval(() => {\n label.text(JSON.stringify(object[property], null, 2));\n }, interval);\n}\n","import GUI from './muigui.js';\n\nexport { default as ColorChooser } from './controllers/ColorChooser.js';\nexport { default as Direction } from './controllers/Direction.js';\nexport { default as RadioGrid } from './controllers/RadioGrid.js';\nexport { default as Range } from './controllers/Range.js';\nexport { default as Select } from './controllers/Select.js';\nexport { default as Slider } from './controllers/Slider.js';\nexport { default as TextNumber } from './controllers/TextNumber.js';\nexport { default as Vec2 } from './controllers/Vec2.js';\n\nimport {graph} from './libs/graph.js';\nimport {monitor} from './libs/monitor.js';\n\nexport const helpers = {\n graph,\n monitor,\n};\n\nexport default GUI;"],"names":["clamp","euclideanModulo","lerp","identity","noop","svg"],"mappings":";AAAA,UAAe;AACf,EAAE,OAAO,EAAE,CAAC;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,MAAM,EAAE;AACR,EAAE,OAAO,EAAE;AACX,IAAI,OAAO,EAAE,CAAC,SAAS,CAAC;AACxB,IAAI,GAAG,EAAE,CAAC;AACV,IAAI,CAAC;AACL,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,OAAO,EAAE,CAAC,SAAS,CAAC;AACxB,IAAI,GAAG,EAAE,CAAC;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,GAAG;AACH,EAAE,IAAI,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CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AAC1D,GAAG,EAAE,QAAQ,CAAC,CAAC;AACf;;ACUa,MAAA,OAAO,GAAG;IACrB,KAAK;IACL,OAAO;;;;;"} \ No newline at end of file +{"version":3,"file":"muigui.module.js","sources":["../../src/styles/muigui.css.js","../../src/libs/elem.js","../../src/libs/utils.js","../../../src/views/View.ts","../../src/controllers/Controller.js","../../src/controllers/Button.js","../../src/views/EditView.js","../../src/views/CheckboxView.js","../../src/libs/taskrunner.js","../../src/libs/ids.js","../../src/views/ValueView.js","../../src/controllers/LabelController.js","../../src/controllers/ValueController.js","../../src/controllers/Checkbox.js","../../src/libs/conversions.js","../../src/libs/wheel.js","../../src/views/NumberView.js","../../src/controllers/TextNumber.js","../../src/views/SelectView.js","../../src/libs/key-values.js","../../src/controllers/Select.js","../../src/views/RangeView.js","../../src/controllers/Range.js","../../src/views/TextView.js","../../src/controllers/Text.js","../../src/controllers/create-controller.js","../../src/libs/color-utils.js","../../src/views/ElementView.js","../../src/controllers/Canvas.js","../../src/views/ColorView.js","../../src/controllers/Color.js","../../src/controllers/Divider.js","../../src/controllers/Container.js","../../src/controllers/Folder.js","../../src/controllers/Label.js","../../src/libs/touch.js","../../src/views/ColorChooserView.js","../../src/controllers/PopDownController.js","../../src/controllers/ColorChooser.js","../../src/layout/Layout.js","../../src/layout/Column.js","../../src/layout/Frame.js","../../src/layout/Grid.js","../../src/layout/Row.js","../../src/muigui.js","../../src/libs/keyboard.js","../../src/libs/assert.js","../../src/libs/svg.js","../../src/views/DirectionView.js","../../src/controllers/Direction.js","../../src/views/RadioGridView.js","../../src/controllers/RadioGrid.js","../../src/libs/resize-helpers.js","../../src/views/SliderView.js","../../src/controllers/Slider.js","../../src/views/Vec2View.js","../../src/controllers/Vec2.js","../../src/libs/graph.js","../../src/libs/monitor.js","../../../src/esm.ts"],"sourcesContent":["export default {\n default: `\n.muigui {\n --bg-color: #ddd;\n --color: #222;\n --contrast-color: #eee;\n --value-color: #145 ;\n --value-bg-color: #eeee;\n --disabled-color: #999;\n --menu-bg-color: #f8f8f8;\n --menu-sep-color: #bbb;\n --hover-bg-color: #999;\n --focus-color: #8BF;\n --range-color: #AAA;\n --invalid-color: #FF0000;\n --selected-color: rgb(255, 255, 255, 0.9);\n\n --button-bg-color: var(--value-bg-color);\n\n --image-open: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjNDQ0OyIgeD0iMjAlIiB5PSI0NSUiIHdpZHRoPSI2MCUiIGhlaWdodD0iMTAlIj48L3JlY3Q+Cjwvc3ZnPg==);\n --image-closed: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjNDQ0OyIgeD0iNDUlIiB5PSIyMCUiIHdpZHRoPSIxMCUiIGhlaWdodD0iNjAlIj48L3JlY3Q+CiAgPHJlY3Qgc3R5bGU9ImZpbGw6ICM0NDQ7IiB4PSIyMCUiIHk9IjQ1JSIgd2lkdGg9IjYwJSIgaGVpZ2h0PSIxMCUiPjwvcmVjdD4KPC9zdmc+);\n --image-checkerboard: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjNDA0MDQwOyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSI+PC9yZWN0PgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjODA4MDgwOyIgeD0iMCIgeT0iMCIgd2lkdGg9IjUwJSIgaGVpZ2h0PSI1MCUiPjwvcmVjdD4KICA8cmVjdCBzdHlsZT0iZmlsbDogIzgwODA4MDsiIHg9IjUwJSIgeT0iNTAlIiB3aWR0aD0iNTAlIiBoZWlnaHQ9IjUwJSI+PC9yZWN0Pgo8L3N2Zz4=);\n\n --range-left-color: var(--value-color);\n --range-right-color: var(--value-bg-color); \n --range-right-hover-color: var(--hover-bg-color);\n --button-image: \n linear-gradient(\n rgba(255, 255, 255, 1), rgba(0, 0, 0, 0.2)\n );\n\n color: var(--color);\n background-color: var(--bg-color);\n}\n\n@media (prefers-color-scheme: dark) {\n .muigui {\n --bg-color: #222222;\n --color: #dddddd;\n --contrast-color: #000;\n --value-color: #43e5f7;\n --value-bg-color: #444444;\n --disabled-color: #666666;\n --menu-bg-color: #080808;\n --menu-sep-color: #444444;\n --hover-bg-color: #666666;\n --focus-color: #458; /*#88AAFF*/;\n --range-color: #888888;\n --invalid-color: #FF6666;\n --selected-color: rgba(255, 255, 255, 0.3);\n\n --button-bg-color: var(--value-bg-color);\n\n --range-left-color: var(--value-color);\n --range-right-color: var(--value-bg-color); \n --range-right-hover-color: var(--hover-bg-color);\n --button-image: linear-gradient(\n rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.4)\n );\n\n color: var(--color);\n background-color: var(--bg-color);\n\n --image-closed: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjREREOyIgeD0iMjAlIiB5PSI0NSUiIHdpZHRoPSI2MCUiIGhlaWdodD0iMTAlIj48L3JlY3Q+Cjwvc3ZnPg==);\n --image-open: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjREREOyIgeD0iNDUlIiB5PSIyMCUiIHdpZHRoPSIxMCUiIGhlaWdodD0iNjAlIj48L3JlY3Q+CiAgPHJlY3Qgc3R5bGU9ImZpbGw6ICNEREQ7IiB4PSIyMCUiIHk9IjQ1JSIgd2lkdGg9IjYwJSIgaGVpZ2h0PSIxMCUiPjwvcmVjdD4KPC9zdmc+);\n }\n}\n\n.muigui {\n --width: 250px;\n --label-width: 45%;\n --number-width: 40%;\n\n --font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Arial, sans-serif;\n --font-size: 11px;\n --font-family-mono: Menlo, Monaco, Consolas, \"Droid Sans Mono\", monospace;\n --font-size-mono: 11px;\n\n --line-height: 1.7em;\n --border-radius: 0px;\n\n width: var(--width);\n font-family: var(--font-family);\n font-size: var(--font-size);\n box-sizing: border-box;\n line-height: 100%;\n white-space: nowrap;\n}\n.muigui * {\n box-sizing: inherit;\n}\n\n.muigui-no-scroll {\n touch-action: none;\n}\n.muigui-no-h-scroll {\n touch-action: pan-y;\n}\n.muigui-no-v-scroll {\n touch-action: pan-x;\n}\n\n.muigui-invalid-value {\n background-color: red !important;\n color: white !important;\n}\n\n.muigui-grid {\n display: grid;\n}\n.muigui-rows {\n display: flex;\n flex-direction: column;\n\n min-height: 20px;\n border: 2px solid red;\n}\n.muigui-columns {\n display: flex;\n flex-direction: row;\n\n height: 20px;\n border: 2px solid green;\n}\n.muigui-rows>*,\n.muigui-columns>* {\n flex: 1 1 auto;\n align-items: stretch;\n min-height: 0;\n min-width: 0;\n}\n\n.muigui-row {\n border: 2px solid yellow;\n min-height: 10px\n}\n.muigui-column {\n border: 2px solid lightgreen;\n}\n\n/* -------- */\n\n.muigui-show { /* */ }\n.muigui-hide { \n display: none !important;\n}\n.muigui-disabled {\n pointer-events: none;\n --color: var(--disabled-color) !important;\n --value-color: var(--disabled-color) !important;\n --range-left-color: var(--disabled-color) !important;\n}\n\n.muigui canvas,\n.muigui svg {\n display: block;\n border-radius: var(--border-radius);\n}\n.muigui canvas {\n background-color: var(--value-bg-color);\n}\n\n.muigui-controller {\n min-width: 0;\n min-height: var(--line-height);\n}\n.muigui-root {\n z-index: 1;\n}\n.muigui-root,\n.muigui-menu {\n display: flex;\n flex-direction: column;\n position: relative;\n user-select: none;\n height: fit-content;\n margin: 0;\n padding-bottom: 0.1em;\n border-radius: var(--border-radius);\n}\n.muigui-menu {\n border-bottom: 1px solid var(--menu-sep-color);\n}\n\n.muigui-root>button:nth-child(1),\n.muigui-menu>button:nth-child(1) {\n border-top: 1px solid var(--menu-sep-color);\n border-bottom: 1px solid var(--menu-sep-color);\n position: relative;\n text-align: left;\n color: var(--color);\n background-color: var(--menu-bg-color);\n min-height: var(--line-height);\n padding: 0.2em;\n cursor: pointer;\n border-radius: var(--border-radius);\n}\n.muigui-root>div:nth-child(2),\n.muigui-menu>div:nth-child(2) {\n flex: 1 1 auto;\n}\n\n.muigui-controller {\n margin-left: 0.2em;\n margin-right: 0.2em;\n}\n.muigui-root.muigui-controller,\n.muigui-menu.muigui-controller {\n margin-left: 0;\n margin-right: 0;\n}\n.muigui-controller>*:nth-child(1) {\n flex: 1 0 var(--label-width);\n min-width: 0;\n /* white-space: pre; why?? */\n}\n.muigui-controller>label:nth-child(1) {\n place-content: center start;\n display: inline-grid;\n overflow: hidden;\n}\n.muigui-controller>*:nth-child(2) {\n flex: 1 1 75%;\n min-width: 0;\n}\n\n/* -----------------------------------------\n a label controller is [[label][value]]\n*/\n\n.muigui-label-controller {\n display: flex;\n margin: 0.4em 0 0.4em 0;\n word-wrap: initial;\n align-items: stretch;\n}\n\n.muigui-value {\n display: flex;\n align-items: stretch;\n}\n.muigui-value>* {\n flex: 1 1 auto;\n min-width: 0;\n}\n.muigui-value>*:nth-child(1) {\n flex: 1 1 calc(100% - var(--number-width));\n}\n.muigui-value>*:nth-child(2) {\n flex: 1 1 var(--number-width);\n margin-left: 0.2em;\n}\n\n/* fix! */\n.muigui-open>button>label::before,\n.muigui-closed>button>label::before {\n content: \"X\";\n color: rgba(0, 0, 0, 0);\n background-color: var(--range-color);\n border-radius: 0.2em;\n width: 1.25em;\n margin-right: 0.25em;\n height: 1.25em; /*var(--line-height);*/\n display: inline-grid;\n place-content: center start;\n pointer-events: none;\n}\n.muigui-open>button>label::before {\n background-image: var(--image-open);\n}\n.muigui-closed>button>label::before {\n background-image: var(--image-closed);\n}\n\n.muigui-open>.muigui-open-container {\n transition: all 0.1s ease-out;\n overflow: auto;\n height: 100%;\n}\n.muigui-closed>.muigui-open-container {\n transition: all 0.1s ease-out;\n overflow: hidden;\n min-height: 0;\n}\n.muigui-open>.muigui-open-container>* {\n transition: all 0.1s ease-out;\n margin-top: 0px;\n}\n.muigui-closed>.muigui-open-container>* {\n transition: all 0.1s ease-out;\n margin-top: -1000%;\n}\n\n/* ---- popdown ---- */\n\n.muigui-pop-down-top {\n display: flex;\n}\n/* fix? */\n.muigui-value>*:nth-child(1).muigui-pop-down-top {\n flex: 0;\n}\n.muigui-closed .muigui-pop-down-bottom {\n max-height: 0;\n}\n\n.muigui-value .muigui-pop-down-bottom {\n margin: 0;\n}\n\n.muigui-pop-down-values {\n min-width: 0;\n display: flex;\n}\n.muigui-pop-down-values>* {\n flex: 1 1 auto;\n min-width: 0;\n}\n\n.muigui-value.muigui-pop-down-controller {\n flex-direction: column;\n}\n\n.muigui-pop-down-top input[type=checkbox] {\n -webkit-appearance: none;\n appearance: none;\n width: auto;\n color: var(--value-color);\n background-color: var(--value-bg-color);\n background-image: var(--image-checkerboard);\n background-size: 10px 10px;\n background-position: 0 0, 0 5px, 5px -5px, -5px 0px;\n\n cursor: pointer;\n\n display: grid;\n place-content: center;\n margin: 0;\n font: inherit;\n color: currentColor;\n width: 1.7em;\n height: 1.7em;\n transform: translateY(-0.075em);\n}\n\n.muigui-pop-down-top input[type=checkbox]::before {\n content: \"+\";\n display: grid;\n place-content: center;\n border-radius: calc(var(--border-radius) + 2px);\n border-left: 1px solid rgba(255,255,255,0.3);\n border-top: 1px solid rgba(255,255,255,0.3);\n border-bottom: 1px solid rgba(0,0,0,0.2);\n border-right: 1px solid rgba(0,0,0,0.2);\n background-color: var(--range-color);\n color: var(--value-bg-color);\n width: calc(var(--line-height) - 4px);\n height: calc(var(--line-height) - 4px);\n}\n\n.muigui-pop-down-top input[type=checkbox]:checked::before {\n content: \"X\";\n}\n\n\n/* ---- select ---- */\n\n.muigui select,\n.muigui option,\n.muigui input,\n.muigui button {\n color: var(--value-color);\n background-color: var(--value-bg-color);\n font-family: var(--font-family);\n font-size: var(--font-size);\n border: none;\n margin: 0;\n border-radius: var(--border-radius);\n}\n.muigui select {\n appearance: none;\n margin: 0;\n margin-left: 0; /*?*/\n overflow: hidden; /* Safari */\n}\n\n.muigui select:focus,\n.muigui input:focus,\n.muigui button:focus {\n outline: 1px solid var(--focus-color);\n}\n\n.muigui select:hover,\n.muigui option:hover,\n.muigui input:hover,\n.muigui button:hover {\n background-color: var(--hover-bg-color); \n}\n\n/* ------ [ label ] ------ */\n\n.muigui-label {\n border-top: 1px solid var(--menu-sep-color);\n border-bottom: 1px solid var(--menu-sep-color);\n padding-top: 0.4em;\n padding-bottom: 0.3em;\n place-content: center start;\n background-color: var(--menu-bg-color);\n white-space: pre;\n border-radius: var(--border-radius);\n}\n\n/* ------ [ divider] ------ */\n\n.muigui-divider {\n min-height: 6px;\n border-top: 2px solid var(--menu-sep-color);\n margin-top: 6px;\n}\n\n/* ------ [ button ] ------ */\n\n.muigui-button {\n display: grid;\n padding: 2px 0 2px 0;\n}\n.muigui-button button {\n border: none;\n color: var(--value-color);\n background-color: var(--button-bg-color);\n background-image: var(--button-image);\n cursor: pointer;\n place-content: center center;\n height: var(--line-height);\n}\n\n/* ------ [ color ] ------ */\n\n.muigui-color>div {\n overflow: hidden;\n position: relative;\n margin-left: 0;\n margin-right: 0; /* why? */\n max-width: var(--line-height);\n border-radius: var(--border-radius);\n}\n\n.muigui-color>div:focus-within {\n outline: 1px solid var(--focus-color);\n}\n\n.muigui-color input[type=color] {\n border: none;\n padding: 0;\n background: inherit;\n cursor: pointer;\n position: absolute;\n width: 200%;\n left: -10px;\n top: -10px;\n height: 200%;\n}\n.muigui-disabled canvas,\n.muigui-disabled svg,\n.muigui-disabled img,\n.muigui-disabled .muigui-color input[type=color] {\n opacity: 0.2;\n}\n\n/* ------ [ checkbox ] ------ */\n\n.muigui-checkbox>label:nth-child(2) {\n display: grid;\n place-content: center start;\n margin: 0;\n}\n\n.muigui-checkbox input[type=checkbox] {\n -webkit-appearance: none;\n appearance: none;\n width: auto;\n color: var(--value-color);\n background-color: var(--value-bg-color);\n cursor: pointer;\n\n display: grid;\n place-content: center;\n margin: 0;\n font: inherit;\n color: currentColor;\n width: 1.7em;\n height: 1.7em;\n transform: translateY(-0.075em);\n}\n\n.muigui-checkbox input[type=checkbox]::before {\n content: \"\";\n color: var(--value-color);\n display: grid;\n place-content: center;\n}\n\n.muigui-checkbox input[type=checkbox]:checked::before {\n content: \"✔\";\n}\n\n.muigui input[type=number]::-webkit-inner-spin-button, \n.muigui input[type=number]::-webkit-outer-spin-button { \n -webkit-appearance: none;\n appearance: none;\n margin: 0; \n}\n.muigui input[type=number] {\n -moz-appearance: textfield;\n}\n\n/* ------ [ radio grid ] ------ */\n\n.muigui-radio-grid>div {\n display: grid;\n gap: 2px;\n}\n\n.muigui-radio-grid input {\n appearance: none;\n display: none;\n}\n\n.muigui-radio-grid button {\n color: var(--color);\n width: 100%;\n text-align: left;\n}\n\n.muigui-radio-grid input:checked + button {\n color: var(--value-color);\n background-color: var(--selected-color);\n}\n\n/* ------ [ color-chooser ] ------ */\n\n.muigui-color-chooser-cursor {\n stroke-width: 1px;\n stroke: white;\n fill: none;\n}\n.muigui-color-chooser-circle {\n stroke-width: 1px;\n stroke: white;\n fill: none;\n}\n\n\n/* ------ [ vec2 ] ------ */\n\n.muigui-vec2 svg {\n background-color: var(--value-bg-color);\n}\n\n.muigui-vec2-axis {\n stroke: 1px;\n stroke: var(--focus-color);\n}\n\n.muigui-vec2-line {\n stroke-width: 1px;\n stroke: var(--value-color);\n fill: var(--value-color);\n}\n\n/* ------ [ direction ] ------ */\n\n.muigui-direction svg {\n background-color: rgba(0,0,0,0.2);\n}\n\n.muigui-direction:focus-within svg {\n outline: none;\n}\n.muigui-direction-range {\n fill: var(--value-bg-color);\n}\n.muigui-direction svg:focus {\n outline: none;\n}\n.muigui-direction svg:focus .muigui-direction-range {\n stroke-width: 0.5px;\n stroke: var(--focus-color);\n}\n\n.muigui-direction-arrow {\n fill: var(--value-color);\n}\n\n/* ------ [ slider ] ------ */\n\n.muigui-slider>div {\n display: flex;\n align-items: stretch;\n height: var(--line-height);\n}\n.muigui-slider svg {\n flex: 1 1 auto;\n}\n.muigui-slider .muigui-slider-up #muigui-orientation {\n transform: scale(1, -1) translateY(-100%);\n}\n\n.muigui-slider .muigui-slider-up #muigui-number-orientation {\n transform: scale(1,-1);\n}\n\n.muigui-ticks {\n stroke: var(--range-color);\n}\n.muigui-thicks {\n stroke: var(--color);\n stroke-width: 2px;\n}\n.muigui-svg-text {\n fill: var(--color);\n font-size: 7px;\n}\n.muigui-mark {\n fill: var(--value-color);\n}\n\n/* ------ [ range ] ------ */\n\n\n.muigui-range input[type=range] {\n -webkit-appearance: none;\n appearance: none;\n background-color: transparent;\n}\n\n.muigui-range input[type=range]::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n border-radius: calc(var(--border-radius) + 2px);\n border-left: 1px solid rgba(255,255,255,0.3);\n border-top: 1px solid rgba(255,255,255,0.3);\n border-bottom: 1px solid rgba(0,0,0,0.2);\n border-right: 1px solid rgba(0,0,0,0.2);\n background-color: var(--range-color);\n margin-top: calc((var(--line-height) - 6px) / -2);\n width: calc(var(--line-height) - 6px);\n height: calc(var(--line-height) - 6px);\n}\n\n.muigui-range input[type=range]::-webkit-slider-runnable-track {\n -webkit-appearance: none;\n appearance: none;\n border: 1px solid var(--menu-sep-color);\n height: 2px;\n}\n\n\n/* dat.gui style - doesn't work on Safari iOS */\n\n/*\n.muigui-range input[type=range] {\n cursor: ew-resize;\n overflow: hidden;\n}\n\n.muigui-range input[type=range] {\n -webkit-appearance: none;\n appearance: none;\n background-color: var(--range-right-color);\n margin: 0;\n}\n.muigui-range input[type=range]:hover {\n background-color: var(--range-right-hover-color);\n}\n\n.muigui-range input[type=range]::-webkit-slider-runnable-track {\n -webkit-appearance: none;\n appearance: none;\n height: max-content;\n color: var(--range-left-color);\n margin-top: -1px;\n}\n\n.muigui-range input[type=range]::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 0px;\n height: max-content;\n box-shadow: -1000px 0 0 1000px var(--range-left-color);\n}\n*/\n\n/* FF */\n/*\n.muigui-range input[type=range]::-moz-slider-progress {\n background-color: var(--range-left-color); \n}\n.muigui-range input[type=range]::-moz-slider-thumb {\n height: max-content;\n width: 0;\n border: none;\n box-shadow: -1000px 0 0 1000px var(--range-left-color);\n box-sizing: border-box;\n}\n*/\n\n.muigui-checkered-background {\n background-color: #404040;\n background-image:\n linear-gradient(45deg, #808080 25%, transparent 25%),\n linear-gradient(-45deg, #808080 25%, transparent 25%),\n linear-gradient(45deg, transparent 75%, #808080 75%),\n linear-gradient(-45deg, transparent 75%, #808080 75%);\n background-size: 16px 16px;\n background-position: 0 0, 0 8px, 8px -8px, -8px 0px;\n}\n\n/* ---------------------------------------------------------- */\n\n/* needs to be at bottom to take precedence */\n.muigui-auto-place {\n max-height: 100%;\n position: fixed;\n top: 0;\n right: 15px;\n z-index: 100001;\n}\n\n`,\nthemes: {\n default: {\n include: ['default'],\n css: `\n `,\n },\n float: {\n include: ['default'],\n css: `\n :root {\n color-scheme: light dark,\n }\n\n .muigui {\n --width: 400px;\n --bg-color: initial;\n --label-width: 25%;\n --number-width: 20%;\n }\n\n input,\n .muigui-label-controller>label {\n text-shadow:\n -1px -1px 0 var(--contrast-color),\n 1px -1px 0 var(--contrast-color),\n -1px 1px 0 var(--contrast-color),\n 1px 1px 0 var(--contrast-color);\n }\n\n .muigui-controller > label:nth-child(1) {\n place-content: center end;\n margin-right: 1em;\n }\n\n .muigui-value > :nth-child(2) {\n margin-left: 1em;\n }\n\n .muigui-root>*:nth-child(1) {\n display: none;\n }\n\n .muigui-range input[type=range]::-webkit-slider-thumb {\n border-radius: 1em;\n }\n\n .muigui-range input[type=range]::-webkit-slider-runnable-track {\n -webkit-appearance: initial;\n appearance: none;\n border: 1px solid rgba(0, 0, 0, 0.25);\n height: 2px;\n }\n\n .muigui-colors {\n --value-color: var(--color );\n --value-bg-color: rgba(0, 0, 0, 0.1);\n --disabled-color: #cccccc;\n --menu-bg-color: rgba(0, 0, 0, 0.1);\n --menu-sep-color: #bbbbbb;\n --hover-bg-color: rgba(0, 0, 0, 0);\n --invalid-color: #FF0000;\n --selected-color: rgba(0, 0, 0, 0.3);\n --range-color: rgba(0, 0, 0, 0.125);\n }\n`,\n },\n form: {\n include: [],\n css: `\n .muigui {\n --width: 100%;\n --label-width: 45%;\n --number-width: 40%;\n }\n .muigui-root>button {\n display: none;\n }\n .muigui-controller {\n margin-top: 1em;\n }\n .muigui-label-controller {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n margin-top: 1em;\n }\n .muigui-label-controller:has(.muigui-checkbox) {\n flex-direction: row;\n }\n .muigui-value {\n display: flex;\n align-items: stretch;\n }\n .muigui-value>* {\n flex: 1 1 auto;\n min-width: 0;\n }\n .muigui-controller>*:nth-child(1) {\n flex: 1 0 var(--label-width);\n min-width: 0;\n white-space: pre;\n }\n .muigui-controller>label:nth-child(1) {\n place-content: center start;\n display: inline-grid;\n overflow: hidden;\n }\n .muigui-controller>*:nth-child(2) {\n flex: 1 1 75%;\n min-width: 0;\n }\n `,\n },\n none: {\n include: [],\n css: '',\n },\n},\n};\n","export function setElemProps(elem, attrs, children) {\n for (const [key, value] of Object.entries(attrs)) {\n if (typeof value === 'function' && key.startsWith('on')) {\n const eventName = key.substring(2).toLowerCase();\n elem.addEventListener(eventName, value, {passive: false});\n } else if (typeof value === 'object') {\n for (const [k, v] of Object.entries(value)) {\n elem[key][k] = v;\n }\n } else if (elem[key] === undefined) {\n elem.setAttribute(key, value);\n } else {\n elem[key] = value;\n }\n }\n for (const child of children) {\n elem.appendChild(child);\n }\n return elem;\n}\n\nexport function createElem(tag, attrs = {}, children = []) {\n const elem = document.createElement(tag);\n setElemProps(elem, attrs, children);\n return elem;\n}\n\nexport function addElem(tag, parent, attrs = {}, children = []) {\n const elem = createElem(tag, attrs, children);\n parent.appendChild(elem);\n return elem;\n}\n\nlet nextId = 0;\nexport function getNewId() {\n return `muigui-id-${nextId++}`;\n}\n","export function removeArrayElem(array, value) {\n const ndx = array.indexOf(value);\n if (ndx) {\n array.splice(ndx, 1);\n }\n return array;\n}\n\n/**\n * Converts an camelCase or snake_case id to \"camel case\" or \"snake case\"\n * @param {string} id\n */\nconst underscoreRE = /_/g;\nconst upperLowerRE = /([A-Z])([a-z])/g;\nexport function idToLabel(id) {\n return id.replace(underscoreRE, ' ')\n .replace(upperLowerRE, (m, m1, m2) => `${m1.toLowerCase()} ${m2}`);\n}\n\nexport function clamp(v, min, max) {\n return Math.max(min, Math.min(max, v));\n}\n\nexport const isTypedArray = typeof SharedArrayBuffer !== 'undefined'\n ? function isArrayBufferOrSharedArrayBuffer(a) {\n return a && a.buffer && (a.buffer instanceof ArrayBuffer || a.buffer instanceof SharedArrayBuffer);\n }\n : function isArrayBuffer(a) {\n return a && a.buffer && a.buffer instanceof ArrayBuffer;\n };\n\nexport const isArrayOrTypedArray = v => Array.isArray(v) || isTypedArray(v);\n\n// Yea, I know this should be `Math.round(v / step) * step\n// but try step = 0.1, newV = 19.95\n//\n// I get\n// Math.round(19.95 / 0.1) * 0.1\n// 19.900000000000002\n// vs\n// Math.round(19.95 / 0.1) / (1 / 0.1)\n// 19.9\n//\nexport const stepify = (v, from, step) => Math.round(from(v) / step) / (1 / step);\n\nexport const euclideanModulo = (v, n) => ((v % n) + n) % n;\nexport const lerp = (a, b, t) => a + (b - a) * t;\nexport function copyExistingProperties(dst, src) {\n for (const key in src) {\n if (key in dst) {\n dst[key] = src[key];\n }\n }\n return dst;\n}\n\nexport const mapRange = (v, inMin, inMax, outMin, outMax) => (v - inMin) * (outMax - outMin) / (inMax - inMin) + outMin;\n\nexport const makeRangeConverters = ({from, to}) => {\n return {\n to: v => mapRange(v, ...from, ...to),\n from: v => [true, mapRange(v, ...to, ...from)],\n };\n};\n\nexport const makeRangeOptions = ({from, to, step}) => {\n return {\n min: to[0],\n max: to[1],\n ...(step && {step}),\n converters: makeRangeConverters({from, to}),\n };\n};\n\n// TODO: remove an use one in conversions. Move makeRangeConverters there?\nexport const identity = {\n to: v => v,\n from: v => [true, v],\n};\nexport function makeMinMaxPair(gui, properties, minPropName, maxPropName, options) {\n const { converters: { from } = identity } = options;\n const { min, max } = options;\n const guiMinRange = options.minRange || 0;\n const valueMinRange = from(guiMinRange)[1];\n const minGui = gui\n .add(properties, minPropName, {\n ...options,\n min,\n max: max - guiMinRange,\n })\n .onChange(v => {\n maxGui.setValue(Math.min(max, Math.max(v + valueMinRange, properties[maxPropName])));\n });\n const maxGui = gui\n .add(properties, maxPropName, {\n ...options,\n min: min + guiMinRange,\n max,\n })\n .onChange(v => {\n minGui.setValue(Math.max(min, Math.min(v - valueMinRange, properties[minPropName])));\n });\n return [ minGui, maxGui ];\n}\n\n","import { removeArrayElem } from '../libs/utils.js';\n\nexport default class View {\n domElement: HTMLElement;\n\n #childDestElem: HTMLElement;\n #views: View[] = [];\n\n constructor(elem: HTMLElement) {\n this.domElement = elem;\n this.#childDestElem = elem;\n }\n addElem(elem: HTMLElement) {\n this.#childDestElem.appendChild(elem);\n return elem;\n }\n removeElem(elem: HTMLElement) {\n this.#childDestElem.removeChild(elem);\n return elem;\n }\n pushSubElem(elem: HTMLElement) {\n this.#childDestElem.appendChild(elem);\n this.#childDestElem = elem;\n }\n popSubElem() {\n this.#childDestElem = this.#childDestElem.parentElement!;\n }\n add(view: View) {\n this.#views.push(view);\n this.addElem(view.domElement);\n return view;\n }\n remove(view: View) {\n this.removeElem(view.domElement);\n removeArrayElem(this.#views, view);\n return view;\n }\n pushSubView(view: View) {\n this.pushSubElem(view.domElement);\n }\n popSubView() {\n this.popSubElem();\n }\n setOptions(options: any) {\n for (const view of this.#views) {\n view.setOptions(options);\n }\n }\n updateDisplayIfNeeded(newV: any, ignoreCache?: boolean) {\n for (const view of this.#views) {\n view.updateDisplayIfNeeded(newV, ignoreCache);\n }\n return this;\n }\n $(selector: string) {\n return this.domElement.querySelector(selector);\n }\n}","import { createElem } from '../libs/elem.js';\nimport { removeArrayElem } from '../libs/utils.js';\nimport View from '../views/View.js';\n\nexport default class Controller extends View {\n #changeFns;\n #finishChangeFns;\n #parent;\n\n constructor(className) {\n super(createElem('div', {className: 'muigui-controller'}));\n this.#changeFns = [];\n this.#finishChangeFns = [];\n // we need the specialization to come last so it takes precedence.\n if (className) {\n this.domElement.classList.add(className);\n }\n }\n get parent() {\n return this.#parent;\n }\n setParent(parent) {\n this.#parent = parent;\n this.enable(!this.disabled());\n }\n show(show = true) {\n this.domElement.classList.toggle('muigui-hide', !show);\n this.domElement.classList.toggle('muigui-show', show);\n return this;\n }\n hide() {\n return this.show(false);\n }\n disabled() {\n return !!this.domElement.closest('.muigui-disabled');\n }\n\n enable(enable = true) {\n this.domElement.classList.toggle('muigui-disabled', !enable);\n\n // If disabled we need to set the attribute 'disabled=true' to all\n // input/select/button/textarea's below\n //\n // If enabled we need to set the attribute 'disabled=false' to all below\n // until we hit a disabled controller.\n //\n // ATM the problem is we can find the input/select/button/textarea elements\n // but we can't easily find which controller they belong do.\n // But we don't need to? We can just check up if it or parent has\n // '.muigui-disabled'\n ['input', 'button', 'select', 'textarea'].forEach(tag => {\n this.domElement.querySelectorAll(tag).forEach(elem => {\n const disabled = !!elem.closest('.muigui-disabled');\n elem.disabled = disabled;\n });\n });\n\n return this;\n }\n disable(disable = true) {\n return this.enable(!disable);\n }\n onChange(fn) {\n this.removeChange(fn);\n this.#changeFns.push(fn);\n return this;\n }\n removeChange(fn) {\n removeArrayElem(this.#changeFns, fn);\n return this;\n }\n onFinishChange(fn) {\n this.removeFinishChange(fn);\n this.#finishChangeFns.push(fn);\n return this;\n }\n removeFinishChange(fn) {\n removeArrayElem(this.#finishChangeFns, fn);\n return this;\n }\n #callListeners(fns, newV) {\n for (const fn of fns) {\n fn.call(this, newV);\n }\n }\n emitChange(value, object, property) {\n this.#callListeners(this.#changeFns, value);\n if (this.#parent) {\n if (object === undefined) {\n this.#parent.emitChange(value);\n } else {\n this.#parent.emitChange({\n object,\n property,\n value,\n controller: this,\n });\n }\n }\n }\n emitFinalChange(value, object, property) {\n this.#callListeners(this.#finishChangeFns, value);\n if (this.#parent) {\n if (object === undefined) {\n this.#parent.emitChange(value);\n } else {\n this.#parent.emitFinalChange({\n object,\n property,\n value,\n controller: this,\n });\n }\n }\n }\n updateDisplay() {\n // placeholder. override\n }\n getColors() {\n const toCamelCase = s => s.replace(/-([a-z])/g, (m, m1) => m1.toUpperCase());\n const keys = [\n 'color',\n 'bg-color',\n 'value-color',\n 'value-bg-color',\n 'hover-bg-color',\n 'menu-bg-color',\n 'menu-sep-color',\n 'disabled-color',\n ];\n const div = createElem('div');\n this.domElement.appendChild(div);\n const colors = Object.fromEntries(keys.map(key => {\n div.style.color = `var(--${key})`;\n const s = getComputedStyle(div);\n return [toCamelCase(key), s.color];\n }));\n div.remove();\n return colors;\n }\n}\n","import {\n createElem,\n} from '../libs/elem.js';\nimport { copyExistingProperties } from '../libs/utils.js';\nimport Controller from './Controller.js';\n\nexport default class Button extends Controller {\n #object;\n #property;\n #buttonElem;\n #options = {\n name: '',\n };\n\n constructor(object, property, options = {}) {\n super('muigui-button', '');\n this.#object = object;\n this.#property = property;\n\n this.#buttonElem = this.addElem(\n createElem('button', {\n type: 'button',\n onClick: () => {\n this.#object[this.#property](this);\n },\n }));\n this.setOptions({name: property, ...options});\n }\n name(name) {\n this.#buttonElem.textContent = name;\n return this;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {name} = this.#options;\n this.#buttonElem.textContent = name;\n return this;\n }\n}","import { isTypedArray } from '../libs/utils.js';\nimport View from './View.js';\n\nfunction arraysEqual(a, b) {\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; ++i) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n}\n\nfunction copyArrayElementsFromTo(src, dst) {\n dst.length = src.length;\n for (let i = 0; i < src.length; ++i) {\n dst[i] = src[i];\n }\n}\n\nexport default class EditView extends View {\n #oldV;\n #updateCheck;\n\n #checkArrayNeedsUpdate(newV) {\n // It's an array, we need to compare all elements\n // Example, vec2, [r,g,b], ...\n const needUpdate = !arraysEqual(newV, this.#oldV);\n if (needUpdate) {\n copyArrayElementsFromTo(newV, this.#oldV);\n }\n return needUpdate;\n }\n\n #checkTypedArrayNeedsUpdate() {\n let once = true;\n return function checkTypedArrayNeedsUpdateImpl(newV) {\n // It's a typedarray, we need to compare all elements\n // Example: Float32Array([r, g, b])\n let needUpdate = once;\n once = false;\n if (!needUpdate) {\n needUpdate = !arraysEqual(newV, this.#oldV);\n }\n return needUpdate;\n };\n }\n\n #checkObjectNeedsUpdate(newV) {\n let needUpdate = false;\n for (const key in newV) {\n if (newV[key] !== this.#oldV[key]) {\n needUpdate = true;\n this.#oldV[key] = newV[key];\n }\n }\n return needUpdate;\n }\n\n #checkValueNeedsUpdate(newV) {\n const needUpdate = newV !== this.#oldV;\n this.#oldV = newV;\n return needUpdate;\n }\n\n #getUpdateCheckForType(newV) {\n if (Array.isArray(newV)) {\n this.#oldV = [];\n return this.#checkArrayNeedsUpdate.bind(this);\n } else if (isTypedArray(newV)) {\n this.#oldV = new newV.constructor(newV);\n return this.#checkTypedArrayNeedsUpdate(this);\n } else if (typeof newV === 'object') {\n this.#oldV = {};\n return this.#checkObjectNeedsUpdate.bind(this);\n } else {\n return this.#checkValueNeedsUpdate.bind(this);\n }\n }\n\n // The point of this is updating DOM elements\n // is slow but if we've called `listen` then\n // every frame we're going to try to update\n // things with the current value so if nothing\n // has changed then skip it.\n updateDisplayIfNeeded(newV, ignoreCache) {\n this.#updateCheck = this.#updateCheck || this.#getUpdateCheckForType(newV);\n // Note: We call #updateCheck first because it updates\n // the cache\n if (this.#updateCheck(newV) || ignoreCache) {\n this.updateDisplay(newV);\n }\n }\n setOptions(/*options*/) {\n // override this\n return this;\n }\n}\n","import { createElem } from '../libs/elem.js';\nimport EditView from './EditView.js';\n\nexport default class CheckboxView extends EditView {\n #checkboxElem;\n constructor(setter, id) {\n const checkboxElem = createElem('input', {\n type: 'checkbox',\n id,\n onInput: () => {\n setter.setValue(checkboxElem.checked);\n },\n onChange: () => {\n setter.setFinalValue(checkboxElem.checked);\n },\n });\n super(createElem('label', {}, [checkboxElem]));\n this.#checkboxElem = checkboxElem;\n }\n updateDisplay(v) {\n this.#checkboxElem.checked = v;\n }\n}\n","import { removeArrayElem } from './utils.js';\n\nconst tasks = [];\nconst tasksToRemove = new Set();\n\nlet requestId;\nlet processing;\n\nfunction removeTasks() {\n if (!tasksToRemove.size) {\n return;\n }\n\n if (processing) {\n queueProcessing();\n return;\n }\n\n tasksToRemove.forEach(task => {\n removeArrayElem(tasks, task);\n });\n tasksToRemove.clear();\n}\n\nfunction processTasks() {\n requestId = undefined;\n processing = true;\n for (const task of tasks) {\n if (!tasksToRemove.has(task)) {\n task();\n }\n }\n processing = false;\n removeTasks();\n queueProcessing();\n}\n\nfunction queueProcessing() {\n if (!requestId && tasks.length) {\n requestId = requestAnimationFrame(processTasks);\n }\n}\n\nexport function addTask(fn) {\n tasks.push(fn);\n queueProcessing();\n}\n\nexport function removeTask(fn) {\n tasksToRemove.set(fn);\n\n const ndx = tasks.indexOf(fn);\n if (ndx >= 0) {\n tasks.splice(ndx, 1);\n }\n}","let id = 0;\n\nexport function makeId() {\n return `muigui-${++id}`;\n}\n","import { createElem } from '../libs/elem.js';\nimport View from './View.js';\n\nexport default class ValueView extends View {\n constructor(className = '') {\n super(createElem('div', {className: 'muigui-value'}));\n if (className) {\n this.domElement.classList.add(className);\n }\n }\n}","import { createElem } from '../libs/elem.js';\nimport { makeId } from '../libs/ids.js';\nimport ValueView from '../views/ValueView.js';\nimport Controller from './Controller.js';\n\nexport default class LabelController extends Controller {\n #id;\n #nameElem;\n\n constructor(className = '', name = '') {\n super('muigui-label-controller');\n this.#id = makeId();\n this.#nameElem = createElem('label', {for: this.#id});\n this.domElement.appendChild(this.#nameElem);\n this.pushSubView(new ValueView(className));\n this.name(name);\n }\n get id() {\n return this.#id;\n }\n name(name) {\n if (this.#nameElem.title === this.#nameElem.textContent) {\n this.#nameElem.title = name;\n }\n this.#nameElem.textContent = name;\n return this;\n }\n tooltip(tip) {\n this.#nameElem.title = tip;\n }\n}\n\n","import {addTask, removeTask} from '../libs/taskrunner.js';\nimport { isTypedArray } from '../libs/utils.js';\nimport LabelController from './LabelController.js';\n\nexport default class ValueController extends LabelController {\n #object;\n #property;\n #initialValue;\n #listening;\n #views;\n #updateFn;\n\n constructor(object, property, className = '') {\n super(className, property);\n this.#object = object;\n this.#property = property;\n this.#initialValue = this.getValue();\n this.#listening = false;\n this.#views = [];\n }\n get initialValue() {\n return this.#initialValue;\n }\n get object() {\n return this.#object;\n }\n get property() {\n return this.#property;\n }\n add(view) {\n this.#views.push(view);\n super.add(view);\n this.updateDisplay();\n return view;\n }\n #setValueImpl(v, ignoreCache) {\n let isDifferent = false;\n if (typeof v === 'object') {\n const dst = this.#object[this.#property];\n // don't replace objects, just their values.\n if (Array.isArray(v) || isTypedArray(v)) {\n for (let i = 0; i < v.length; ++i) {\n isDifferent ||= dst[i] !== v[i];\n dst[i] = v[i];\n }\n } else {\n for (const key of Object.keys(v)) {\n isDifferent ||= dst[key] !== v[key];\n }\n Object.assign(dst, v);\n }\n } else {\n isDifferent = this.#object[this.#property] !== v;\n this.#object[this.#property] = v;\n }\n this.updateDisplay(ignoreCache);\n if (isDifferent) {\n this.emitChange(this.getValue(), this.#object, this.#property);\n }\n return isDifferent;\n }\n setValue(v) {\n this.#setValueImpl(v);\n }\n setFinalValue(v) {\n const isDifferent = this.#setValueImpl(v, true);\n if (isDifferent) {\n this.emitFinalChange(this.getValue(), this.#object, this.#property);\n }\n return this;\n }\n updateDisplay(ignoreCache) {\n const newV = this.getValue();\n for (const view of this.#views) {\n view.updateDisplayIfNeeded(newV, ignoreCache);\n }\n return this;\n }\n setOptions(options) {\n for (const view of this.#views) {\n view.setOptions(options);\n }\n this.updateDisplay();\n return this;\n }\n getValue() {\n return this.#object[this.#property];\n }\n value(v) {\n this.setValue(v);\n return this;\n }\n reset() {\n this.setValue(this.#initialValue);\n return this;\n }\n listen(listen = true) {\n if (!this.#updateFn) {\n this.#updateFn = this.updateDisplay.bind(this);\n }\n if (listen) {\n if (!this.#listening) {\n this.#listening = true;\n addTask(this.#updateFn);\n }\n } else {\n if (this.#listening) {\n this.#listening = false;\n removeTask(this.#updateFn);\n }\n }\n return this;\n }\n}\n\n","import CheckboxView from '../views/CheckboxView.js';\nimport ValueController from './ValueController.js';\n\nexport default class Checkbox extends ValueController {\n constructor(object, property) {\n super(object, property, 'muigui-checkbox');\n const id = this.id;\n this.add(new CheckboxView(this, id));\n this.updateDisplay();\n }\n}","import {\n makeRangeConverters,\n} from './utils.js';\n\nexport const identity = {\n to: v => v,\n from: v => [true, v],\n};\n\n// from: from string to value\n// to: from value to string\nexport const strToNumber = {\n to: v => v.toString(),\n from: v => {\n const newV = parseFloat(v);\n return [!Number.isNaN(newV), newV];\n },\n};\n\nexport const converters = {\n radToDeg: makeRangeConverters({to: [0, 180], from: [0, Math.PI]}),\n};\n","export function createWheelHelper() {\n let wheelAccum = 0;\n return function (e, step, wheelScale = 5) {\n wheelAccum -= e.deltaY * step / wheelScale;\n const wheelSteps = Math.floor(Math.abs(wheelAccum) / step) * Math.sign(wheelAccum);\n const delta = wheelSteps * step;\n wheelAccum -= delta;\n return delta;\n };\n}\n","import { createElem } from '../libs/elem.js';\nimport { strToNumber } from '../libs/conversions.js';\nimport { createWheelHelper } from '../libs/wheel.js';\nimport { clamp, copyExistingProperties, stepify } from '../libs/utils.js';\nimport EditView from './EditView.js';\n\nexport default class NumberView extends EditView {\n #to;\n #from;\n #step;\n #skipUpdate;\n #options = {\n step: 0.01,\n converters: strToNumber,\n min: Number.NEGATIVE_INFINITY,\n max: Number.POSITIVE_INFINITY,\n };\n\n constructor(setter, options) {\n const setValue = setter.setValue.bind(setter);\n const setFinalValue = setter.setFinalValue.bind(setter);\n const wheelHelper = createWheelHelper();\n super(createElem('input', {\n type: 'number',\n onInput: () => {\n this.#handleInput(setValue, true);\n },\n onChange: () => {\n this.#handleInput(setFinalValue, false);\n },\n onWheel: e => {\n e.preventDefault();\n const {min, max, step} = this.#options;\n const delta = wheelHelper(e, step);\n const v = parseFloat(this.domElement.value);\n const newV = clamp(stepify(v + delta, v => v, step), min, max);\n const [valid, outV] = this.#from(newV);\n if (valid) {\n setter.setValue(outV);\n }\n },\n }));\n this.setOptions(options);\n }\n #handleInput(setFn, skipUpdate) {\n const v = parseFloat(this.domElement.value);\n const [valid, newV] = this.#from(v);\n let inRange;\n if (valid && !Number.isNaN(v)) {\n const {min, max} = this.#options;\n inRange = newV >= min && newV <= max;\n this.#skipUpdate = skipUpdate;\n setFn(clamp(newV, min, max));\n }\n this.domElement.classList.toggle('muigui-invalid-value', !valid || !inRange);\n }\n updateDisplay(v) {\n if (!this.#skipUpdate) {\n this.domElement.value = stepify(v, this.#to, this.#step);\n }\n this.#skipUpdate = false;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {\n step,\n converters: {to, from},\n } = this.#options;\n this.#to = to;\n this.#from = from;\n this.#step = step;\n return this;\n }\n}\n","\nimport NumberView from '../views/NumberView.js';\nimport ValueController from './ValueController.js';\n\n// Wanted to name this `Number` but it conflicts with\n// JavaScript `Number`. It most likely wouldn't be\n// an issue? But users might `import {Number} ...` and\n// things would break.\nexport default class TextNumber extends ValueController {\n #textView;\n #step;\n\n constructor(object, property, options = {}) {\n super(object, property, 'muigui-text-number');\n this.#textView = this.add(new NumberView(this, options));\n this.updateDisplay();\n }\n}","import { createElem } from '../libs/elem.js';\nimport EditView from './EditView.js';\n\nexport default class SelectView extends EditView {\n #values;\n\n constructor(setter, keyValues) {\n const values = [];\n super(createElem('select', {\n onChange: () => {\n setter.setFinalValue(this.#values[this.domElement.selectedIndex]);\n },\n }, keyValues.map(([key, value]) => {\n values.push(value);\n return createElem('option', {textContent: key});\n })));\n this.#values = values;\n }\n updateDisplay(v) {\n const ndx = this.#values.indexOf(v);\n this.domElement.selectedIndex = ndx;\n }\n}\n","\n// 4 cases\n// (a) keyValues is array of arrays, each sub array is key value\n// (b) keyValues is array and value is number then keys = array contents, value = index\n// (c) keyValues is array and value is not number, key = array contents, value = array contents\n// (d) keyValues is object then key->value\nexport function convertToKeyValues(keyValues, valueIsNumber) {\n if (Array.isArray(keyValues)) {\n if (Array.isArray(keyValues[0])) {\n // (a) keyValues is array of arrays, each sub array is key value\n return keyValues;\n } else {\n if (valueIsNumber) {\n // (b) keyValues is array and value is number then keys = array contents, value = index\n return keyValues.map((v, ndx) => [v, ndx]);\n } else {\n // (c) keyValues is array and value is not number, key = array contents, value = array contents\n return keyValues.map(v => [v, v]);\n }\n }\n } else {\n // (d)\n return [...Object.entries(keyValues)];\n }\n}\n","import SelectView from '../views/SelectView.js';\nimport ValueController from './ValueController.js';\nimport { convertToKeyValues } from '../libs/key-values.js';\n\nexport default class Select extends ValueController {\n constructor(object, property, options) {\n super(object, property, 'muigui-select');\n const valueIsNumber = typeof this.getValue() === 'number';\n const {keyValues: keyValuesInput} = options;\n const keyValues = convertToKeyValues(keyValuesInput, valueIsNumber);\n this.add(new SelectView(this, keyValues));\n this.updateDisplay();\n }\n}","import { createElem } from '../libs/elem.js';\nimport { identity } from '../libs/conversions.js';\nimport { clamp, copyExistingProperties, stepify } from '../libs/utils.js';\nimport { createWheelHelper } from '../libs/wheel.js';\nimport EditView from './EditView.js';\n\nexport default class RangeView extends EditView {\n #to;\n #from;\n #step;\n #skipUpdate;\n #options = {\n step: 0.01,\n min: 0,\n max: 1,\n converters: identity,\n };\n\n constructor(setter, options) {\n const wheelHelper = createWheelHelper();\n super(createElem('input', {\n type: 'range',\n onInput: () => {\n this.#skipUpdate = true;\n const {min, max, step} = this.#options;\n const v = parseFloat(this.domElement.value);\n const newV = clamp(stepify(v, v => v, step), min, max);\n const [valid, validV] = this.#from(newV);\n if (valid) {\n setter.setValue(validV);\n }\n },\n onChange: () => {\n this.#skipUpdate = true;\n const {min, max, step} = this.#options;\n const v = parseFloat(this.domElement.value);\n const newV = clamp(stepify(v, v => v, step), min, max);\n const [valid, validV] = this.#from(newV);\n if (valid) {\n setter.setFinalValue(validV);\n }\n },\n onWheel: e => {\n e.preventDefault();\n const [valid, v] = this.#from(parseFloat(this.domElement.value));\n if (!valid) {\n return;\n }\n const {min, max, step} = this.#options;\n const delta = wheelHelper(e, step);\n const newV = clamp(stepify(v + delta, v => v, step), min, max);\n setter.setValue(newV);\n },\n }));\n this.setOptions(options);\n }\n updateDisplay(v) {\n if (!this.#skipUpdate) {\n this.domElement.value = stepify(v, this.#to, this.#step);\n }\n this.#skipUpdate = false;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {\n step,\n min,\n max,\n converters: {to, from},\n } = this.#options;\n this.#to = to;\n this.#from = from;\n this.#step = step;\n this.domElement.step = step;\n this.domElement.min = min;\n this.domElement.max = max;\n return this;\n }\n}","import ValueController from './ValueController.js';\nimport NumberView from '../views/NumberView.js';\nimport RangeView from '../views/RangeView.js';\n\nexport default class Range extends ValueController {\n constructor(object, property, options) {\n super(object, property, 'muigui-range');\n this.add(new RangeView(this, options));\n this.add(new NumberView(this, options));\n }\n}\n","import { createElem } from '../libs/elem.js';\nimport { identity } from '../libs/conversions.js';\nimport EditView from './EditView.js';\nimport { copyExistingProperties } from '../libs/utils.js';\n\nexport default class TextView extends EditView {\n #to;\n #from;\n #skipUpdate;\n #options = {\n converters: identity,\n };\n\n constructor(setter, options) {\n const setValue = setter.setValue.bind(setter);\n const setFinalValue = setter.setFinalValue.bind(setter);\n super(createElem('input', {\n type: 'text',\n onInput: () => {\n this.#handleInput(setValue, true);\n },\n onChange: () => {\n this.#handleInput(setFinalValue, false);\n },\n }));\n this.setOptions(options);\n }\n #handleInput(setFn, skipUpdate) {\n const [valid, newV] = this.#from(this.domElement.value);\n if (valid) {\n this.#skipUpdate = skipUpdate;\n setFn(newV);\n }\n this.domElement.style.color = valid ? '' : 'var(--invalid-color)';\n\n }\n updateDisplay(v) {\n if (!this.#skipUpdate) {\n this.domElement.value = this.#to(v);\n this.domElement.style.color = '';\n }\n this.#skipUpdate = false;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {\n converters: {to, from},\n } = this.#options;\n this.#to = to;\n this.#from = from;\n return this;\n }\n}\n","import TextView from '../views/TextView.js';\nimport ValueController from './ValueController.js';\n\nexport default class Text extends ValueController {\n constructor(object, property) {\n super(object, property, 'muigui-text');\n this.add(new TextView(this));\n this.updateDisplay();\n }\n}","import Button from './Button.js';\nimport Checkbox from './Checkbox.js';\nimport TextNumber from './TextNumber.js';\nimport Select from './Select.js';\nimport Range from './Range.js';\nimport Text from './Text.js';\n\n// const isConversion = o => typeof o.to === 'function' && typeof o.from === 'function';\n\n/**\n * possible inputs\n * add(o, p, min: number, max: number)\n * add(o, p, min: number, max: number, step: number)\n * add(o, p, array: [value])\n * add(o, p, array: [[key, value]])\n *\n * @param {*} object\n * @param {string} property\n * @param {...any} args\n * @returns {Controller}\n */\nexport function createController(object, property, ...args) {\n const [arg1] = args;\n if (Array.isArray(arg1)) {\n return new Select(object, property, {keyValues: arg1});\n }\n if (arg1 && arg1.keyValues) {\n return new Select(object, property, {keyValues: arg1.keyValues});\n }\n\n const t = typeof object[property];\n switch (t) {\n case 'number':\n if (typeof args[0] === 'number' && typeof args[1] === 'number') {\n const min = args[0];\n const max = args[1];\n const step = args[2];\n return new Range(object, property, {min, max, ...(step && {step})});\n }\n return args.length === 0\n ? new TextNumber(object, property, ...args)\n : new Range(object, property, ...args);\n case 'boolean':\n return new Checkbox(object, property, ...args);\n case 'function':\n return new Button(object, property, ...args);\n case 'string':\n return new Text(object, property, ...args);\n case 'undefined':\n throw new Error(`no property named ${property}`);\n default:\n throw new Error(`unhandled type ${t} for property ${property}`);\n }\n}","const clamp = (v, min, max) => Math.max(min, Math.min(max, v));\nconst lerp = (a, b, t) => a + (b - a) * t;\nconst fract = v => v >= 0 ? v % 1 : 1 - (v % 1);\n\nconst f0 = v => +v.toFixed(0); // converts to string (eg 1.2 => \"1\"), then converts back to number (eg, \"1.200\" => 1.2)\nconst f3 = v => +v.toFixed(3); // converts to string (eg 1.2 => \"1.200\"), then converts back to number (eg, \"1.200\" => 1.2)\n\nconst hexToUint32RGB = v => (parseInt(v.substring(1, 3), 16) << 16) |\n (parseInt(v.substring(3, 5), 16) << 8 ) |\n (parseInt(v.substring(5, 7), 16) );\nconst uint32RGBToHex = v => `#${(Math.round(v)).toString(16).padStart(6, '0')}`;\nconst hexToUint32RGBA = v => (parseInt(v.substring(1, 3), 16) * 2 ** 24) +\n (parseInt(v.substring(3, 5), 16) * 2 ** 16) +\n (parseInt(v.substring(5, 7), 16) * 2 ** 8) +\n (parseInt(v.substring(7, 9), 16) );\nconst uint32RGBAToHex = v => `#${(Math.round(v)).toString(16).padStart(8, '0')}`;\n\nexport const hexToUint8RGB = v => [\n parseInt(v.substring(1, 3), 16),\n parseInt(v.substring(3, 5), 16),\n parseInt(v.substring(5, 7), 16),\n];\nexport const uint8RGBToHex = v => `#${Array.from(v).map(v => v.toString(16).padStart(2, '0')).join('')}`;\n\nexport const hexToUint8RGBA = v => [\n parseInt(v.substring(1, 3), 16),\n parseInt(v.substring(3, 5), 16),\n parseInt(v.substring(5, 7), 16),\n parseInt(v.substring(7, 9), 16),\n];\nexport const uint8RGBAToHex = v => `#${Array.from(v).map(v => v.toString(16).padStart(2, '0')).join('')}`;\n\nexport const hexToFloatRGB = v => hexToUint8RGB(v).map(v => f3(v / 255));\nexport const floatRGBToHex = v => uint8RGBToHex(Array.from(v).map(v => Math.round(clamp(v * 255, 0, 255))));\n\nexport const hexToFloatRGBA = v => hexToUint8RGBA(v).map(v => f3(v / 255));\nexport const floatRGBAToHex = v => uint8RGBAToHex(Array.from(v).map(v => Math.round(clamp(v * 255, 0, 255))));\n\nconst scaleAndClamp = v => clamp(Math.round(v * 255), 0, 255).toString(16).padStart(2, '0');\n\nconst hexToObjectRGB = v => ({\n r: parseInt(v.substring(1, 3), 16) / 255,\n g: parseInt(v.substring(3, 5), 16) / 255,\n b: parseInt(v.substring(5, 7), 16) / 255,\n});\nconst objectRGBToHex = v => `#${scaleAndClamp(v.r)}${scaleAndClamp(v.g)}${scaleAndClamp(v.b)}`;\nconst hexToObjectRGBA = v => ({\n r: parseInt(v.substring(1, 3), 16) / 255,\n g: parseInt(v.substring(3, 5), 16) / 255,\n b: parseInt(v.substring(5, 7), 16) / 255,\n a: parseInt(v.substring(7, 9), 16) / 255,\n});\nconst objectRGBAToHex = v => `#${scaleAndClamp(v.r)}${scaleAndClamp(v.g)}${scaleAndClamp(v.b)}${scaleAndClamp(v.a)}`;\n\nconst hexToCssRGB = v => `rgb(${hexToUint8RGB(v).join(', ')})`;\nconst cssRGBRegex = /^\\s*rgb\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*\\)\\s*$/;\nconst cssRGBToHex = v => {\n const m = cssRGBRegex.exec(v);\n return uint8RGBToHex([m[1], m[2], m[3]].map(v => parseInt(v)));\n};\nconst hexToCssRGBA = v => `rgba(${hexToUint8RGBA(v).map((v, i) => i === 3 ? v / 255 : v).join(', ')})`;\nconst cssRGBARegex = /^\\s*rgba\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+\\.\\d+|\\d+)\\s*\\)\\s*$/;\nconst cssRGBAToHex = v => {\n const m = cssRGBARegex.exec(v);\n return uint8RGBAToHex([m[1], m[2], m[3], m[4]].map((v, i) => i === 3 ? (parseFloat(v) * 255 | 0) : parseInt(v)));\n};\n\nconst hexToCssHSL = v => {\n const hsl = rgbUint8ToHsl(hexToUint8RGB(v)).map(v => f0(v));\n return `hsl(${hsl[0]}, ${hsl[1]}%, ${hsl[2]}%)`;\n};\nconst hexToCssHSLA = v => {\n const hsla = rgbaUint8ToHsla(hexToUint8RGBA(v)).map((v, i) => i === 3 ? f3(v) : f0(v));\n return `hsl(${hsla[0]} ${hsla[1]}% ${hsla[2]}% / ${hsla[3]})`;\n};\nconst cssHSLRegex = /^\\s*hsl\\(\\s*(\\d+)(?:deg|)\\s*(?:,|)\\s*(\\d+)%\\s*(?:,|)\\s*(\\d+)%\\s*\\)\\s*$/;\nconst cssHSLARegex = /^\\s*hsl\\(\\s*(\\d+)(?:deg|)\\s*(?:,|)\\s*(\\d+)%\\s*(?:,|)\\s*(\\d+)%\\s*\\/\\s*(\\d+\\.\\d+|\\d+)\\s*\\)\\s*$/;\n\nconst hex3DigitTo6Digit = v => `${v[0]}${v[0]}${v[1]}${v[1]}${v[2]}${v[2]}`;\nconst cssHSLToHex = v => {\n const m = cssHSLRegex.exec(v);\n const rgb = hslToRgbUint8([m[1], m[2], m[3]].map(v => parseFloat(v)));\n return uint8RGBToHex(rgb);\n};\nconst cssHSLAToHex = v => {\n const m = cssHSLARegex.exec(v);\n const rgba = hslaToRgbaUint8([m[1], m[2], m[3], m[4]].map(v => parseFloat(v)));\n return uint8RGBAToHex(rgba);\n};\n\nconst euclideanModulo = (v, n) => ((v % n) + n) % n;\n\nexport function hslToRgbUint8([h, s, l]) {\n h = euclideanModulo(h, 360);\n s = clamp(s / 100, 0, 1);\n l = clamp(l / 100, 0, 1);\n\n const a = s * Math.min(l, 1 - l);\n\n function f(n) {\n const k = (n + h / 30) % 12;\n return l - a * Math.max(-1, Math.min(k - 3, 9 - k, 1));\n }\n\n return [f(0), f(8), f(4)].map(v => Math.round(v * 255));\n}\n\nexport function hslaToRgbaUint8([h, s, l, a]) {\n const rgb = hslToRgbUint8([h, s, l]);\n return [...rgb, a * 255 | 0];\n}\n\nexport function rgbFloatToHsl01([r, g, b]) {\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const l = (min + max) * 0.5;\n const d = max - min;\n let h = 0;\n let s = 0;\n\n if (d !== 0) {\n s = (l === 0 || l === 1)\n ? 0\n : (max - l) / Math.min(l, 1 - l);\n\n switch (max) {\n case r: h = (g - b) / d + (g < b ? 6 : 0); break;\n case g: h = (b - r) / d + 2; break;\n case b: h = (r - g) / d + 4;\n }\n }\n\n return [h / 6, s, l];\n}\n\nexport function rgbaFloatToHsla01([r, g, b, a]) {\n const hsl = rgbFloatToHsl01([r, g, b]);\n return [...hsl, a];\n}\n\nexport const rgbUint8ToHsl = (rgb) => {\n const [h, s, l] = rgbFloatToHsl01(rgb.map(v => v / 255));\n return [h * 360, s * 100, l * 100];\n};\n\nexport const rgbaUint8ToHsla = (rgba) => {\n const [h, s, l, a] = rgbaFloatToHsla01(rgba.map(v => v / 255));\n return [h * 360, s * 100, l * 100, a];\n};\n\nexport function hsv01ToRGBFloat([hue, sat, val]) {\n sat = clamp(sat, 0, 1);\n val = clamp(val, 0, 1);\n return [hue, hue + 2 / 3, hue + 1 / 3].map(\n v => lerp(1, clamp(Math.abs(fract(v) * 6 - 3.0) - 1, 0, 1), sat) * val\n );\n}\n\nexport function hsva01ToRGBAFloat([hue, sat, val, alpha]) {\n const rgb = hsv01ToRGBFloat([hue, sat, val]);\n return [...rgb, alpha];\n}\n\nconst round3 = v => Math.round(v * 1000) / 1000;\n\nexport function rgbFloatToHSV01([r, g, b]) {\n const p = b > g\n ? [b, g, -1, 2 / 3]\n : [g, b, 0, -1 / 3];\n const q = p[0] > r\n ? [p[0], p[1], p[3], r]\n : [r, p[1], p[2], p[0]];\n const d = q[0] - Math.min(q[3], q[1]);\n return [\n Math.abs(q[2] + (q[3] - q[1]) / (6 * d + Number.EPSILON)),\n d / (q[0] + Number.EPSILON),\n q[0],\n ].map(round3);\n}\n\nexport function rgbaFloatToHSVA01([r, g, b, a]) {\n const hsv = rgbFloatToHSV01([r, g, b]);\n return [...hsv, a];\n}\n\n// window.hsv01ToRGBFloat = hsv01ToRGBFloat;\n// window.rgbFloatToHSV01 = rgbFloatToHSV01;\n\n// Yea, meh!\nexport const hasAlpha = format => format.endsWith('a') || format.startsWith('hex8');\n\nconst cssStringFormats = [\n { re: /^#(?:[0-9a-f]){6}$/i, format: 'hex6' },\n { re: /^(?:[0-9a-f]){6}$/i, format: 'hex6-no-hash' },\n { re: /^#(?:[0-9a-f]){8}$/i, format: 'hex8' },\n { re: /^(?:[0-9a-f]){8}$/i, format: 'hex8-no-hash' },\n { re: /^#(?:[0-9a-f]){3}$/i, format: 'hex3' },\n { re: /^(?:[0-9a-f]){3}$/i, format: 'hex3-no-hash' },\n { re: cssRGBRegex, format: 'css-rgb' },\n { re: cssHSLRegex, format: 'css-hsl' },\n { re: cssRGBARegex, format: 'css-rgba' },\n { re: cssHSLARegex, format: 'css-hsla' },\n];\n\nfunction guessStringColorFormat(v) {\n for (const formatInfo of cssStringFormats) {\n if (formatInfo.re.test(v)) {\n return formatInfo;\n }\n }\n return undefined;\n}\n\nexport function guessFormat(v) {\n switch (typeof v) {\n case 'number':\n console.warn('can not reliably guess format based on a number. You should pass in a format like {format: \"uint32-rgb\"} or {format: \"uint32-rgb\"}');\n return v <= 0xFFFFFF ? 'uint32-rgb' : 'uint32-rgba';\n case 'string': {\n const formatInfo = guessStringColorFormat(v.trim());\n if (formatInfo) {\n return formatInfo.format;\n }\n break;\n }\n case 'object':\n if (v instanceof Uint8Array || v instanceof Uint8ClampedArray) {\n if (v.length === 3) {\n return 'uint8-rgb';\n } else if (v.length === 4) {\n return 'uint8-rgba';\n }\n } else if (v instanceof Float32Array) {\n if (v.length === 3) {\n return 'float-rgb';\n } else if (v.length === 4) {\n return 'float-rgba';\n }\n } else if (Array.isArray(v)) {\n if (v.length === 3) {\n return 'float-rgb';\n } else if (v.length === 4) {\n return 'float-rgba';\n }\n } else {\n if ('r' in v && 'g' in v && 'b' in v) {\n if ('a' in v) {\n return 'object-rgba';\n } else {\n return 'object-rgb';\n }\n }\n }\n }\n throw new Error(`unknown color format: ${v}`);\n}\n\nfunction fixHex6(v) {\n return v.trim(v);\n //const formatInfo = guessStringColorFormat(v.trim());\n //const fix = formatInfo ? formatInfo.fix : v => v;\n //return fix(v.trim());\n}\n\nfunction fixHex8(v) {\n return v.trim(v);\n //const formatInfo = guessStringColorFormat(v.trim());\n //const fix = formatInfo ? formatInfo.fix : v => v;\n //return fix(v.trim());\n}\n\nfunction hex6ToHex3(hex6) {\n return (hex6[1] === hex6[2] &&\n hex6[3] === hex6[4] &&\n hex6[5] === hex6[6])\n ? `#${hex6[1]}${hex6[3]}${hex6[5]}`\n : hex6;\n}\n\nconst hex3RE = /^(#|)([0-9a-f]{3})$/i;\nfunction hex3ToHex6(hex3) {\n const m = hex3RE.exec(hex3);\n if (m) {\n const [, , m2] = m;\n return `#${hex3DigitTo6Digit(m2)}`;\n }\n return hex3;\n}\n\nfunction fixHex3(v) {\n return hex6ToHex3(fixHex6(v));\n}\n\nconst strToRGBObject = (s) => {\n try {\n const json = s.replace(/([a-z])/g, '\"$1\"');\n const rgb = JSON.parse(json);\n if (Number.isNaN(rgb.r) || Number.isNaN(rgb.g) || Number.isNaN(rgb.b)) {\n throw new Error('not {r, g, b}');\n }\n return [true, rgb];\n } catch (e) {\n return [false];\n }\n};\n\nconst strToRGBAObject = (s) => {\n try {\n const json = s.replace(/([a-z])/g, '\"$1\"');\n const rgba = JSON.parse(json);\n if (Number.isNaN(rgba.r) || Number.isNaN(rgba.g) || Number.isNaN(rgba.b) || Number.isNaN(rgba.a)) {\n throw new Error('not {r, g, b, a}');\n }\n return [true, rgba];\n } catch (e) {\n return [false];\n }\n};\n\nconst strToCssRGB = s => {\n const m = cssRGBRegex.exec(s);\n if (!m) {\n return [false];\n }\n const v = [m[1], m[2], m[3]].map(v => parseInt(v));\n const outOfRange = v.find(v => v > 255);\n return [!outOfRange, `rgb(${v.join(', ')})`];\n};\n\nconst strToCssRGBA = s => {\n const m = cssRGBARegex.exec(s);\n if (!m) {\n return [false];\n }\n const v = [m[1], m[2], m[3], m[4]].map((v, i) => i === 3 ? parseFloat(v) : parseInt(v));\n const outOfRange = v.find(v => v > 255);\n return [!outOfRange, `rgba(${v.join(', ')})`];\n};\n\nconst strToCssHSL = s => {\n const m = cssHSLRegex.exec(s);\n if (!m) {\n return [false];\n }\n const v = [m[1], m[2], m[3]].map(v => parseFloat(v));\n const outOfRange = v.find(v => Number.isNaN(v));\n return [!outOfRange, `hsl(${v[0]}, ${v[1]}%, ${v[2]}%)`];\n};\n\nconst strToCssHSLA = s => {\n const m = cssHSLARegex.exec(s);\n if (!m) {\n return [false];\n }\n const v = [m[1], m[2], m[3], m[4]].map(v => parseFloat(v));\n const outOfRange = v.find(v => Number.isNaN(v));\n return [!outOfRange, `hsl(${v[0]} ${v[1]}% ${v[2]}% / ${v[3]})`];\n};\n\nconst rgbObjectToStr = rgb => {\n return `{r:${f3(rgb.r)}, g:${f3(rgb.g)}, b:${f3(rgb.b)}}`;\n};\nconst rgbaObjectToStr = rgba => {\n return `{r:${f3(rgba.r)}, g:${f3(rgba.g)}, b:${f3(rgba.b)}}, a:${f3(rgba.a)}}`;\n};\n\nconst strTo3IntsRE = /^\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*$/;\nconst strTo3Ints = s => {\n const m = strTo3IntsRE.exec(s);\n if (!m) {\n return [false];\n }\n const v = [m[1], m[2], m[3]].map(v => parseInt(v));\n const outOfRange = v.find(v => v > 255);\n return [!outOfRange, v];\n};\n\nconst strTo4IntsRE = /^\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*$/;\nconst strTo4Ints = s => {\n const m = strTo4IntsRE.exec(s);\n if (!m) {\n return [false];\n }\n const v = [m[1], m[2], m[3], m[4]].map(v => parseInt(v));\n const outOfRange = v.find(v => v > 255);\n return [!outOfRange, v];\n};\n\nconst strTo3Floats = s => {\n const numbers = s.split(',').map(s => s.trim());\n const v = numbers.map(v => parseFloat(v));\n if (v.length !== 3) {\n return [false];\n }\n // Note: using isNaN not Number.isNaN\n const badNdx = numbers.findIndex(v => isNaN(v));\n return [badNdx < 0, v.map(v => f3(v))];\n};\n\nconst strTo4Floats = s => {\n const numbers = s.split(',').map(s => s.trim());\n const v = numbers.map(v => parseFloat(v));\n if (v.length !== 4) {\n return [false];\n }\n // Note: using isNaN not Number.isNaN\n const badNdx = numbers.findIndex(v => isNaN(v));\n return [badNdx < 0, v.map(v => f3(v))];\n};\n\nconst strToUint32RGBRegex = /^\\s*(?:0x){0,1}([0-9a-z]{1,6})\\s*$/i;\nconst strToUint32RGB = s => {\n const m = strToUint32RGBRegex.exec(s);\n if (!m) {\n return [false];\n }\n return [true, parseInt(m[1], 16)];\n};\n\nconst strToUint32RGBARegex = /^\\s*(?:0x){0,1}([0-9a-z]{1,8})\\s*$/i;\nconst strToUint32RGBA = s => {\n const m = strToUint32RGBARegex.exec(s);\n if (!m) {\n return [false];\n }\n return [true, parseInt(m[1], 16)];\n};\n\nconst hex6RE = /^\\s*#[a-f0-9]{6}\\s*$|^\\s*#[a-f0-9]{3}\\s*$/i;\nconst hexNoHash6RE = /^\\s*[a-f0-9]{6}\\s*$/i;\nconst hex8RE = /^\\s*#[a-f0-9]{8}\\s*$/i;\nconst hexNoHash8RE = /^\\s*[a-f0-9]{8}\\s*$/i;\n\n// For each format converter\n//\n// fromHex/toHex convert from/to '#RRGGBB'\n//\n// fromHex converts from the string '#RRBBGG' to the format\n// (eg: for uint32-rgb, '#123456' becomes 0x123456)\n//\n// toHex converts from the format to '#RRGGBB'\n// (eg: for uint8-rgb, [16, 33, 50] becomes '#102132')\n//\n//\n// fromStr/toStr convert from/to what's in the input[type=text] element\n//\n// toStr converts from the format to its string representation\n// (eg, for object-rgb, {r: 1, g: 0.5, b:0} becomes \"{r: 1, g: 0.5, b:0}\")\n// ^object ^string\n//\n// fromStr converts its string representation to its format\n// (eg, for object-rgb) \"{r: 1, g: 0.5, b:0}\" becomes {r: 1, g: 0.5, b:0})\n// ^string ^object\n// fromString returns an array which is [valid, v]\n// where valid is true if the string was a valid and v is the converted\n// format if v is true.\n//\n// Note: toStr should convert to \"ideal\" form (whatever that is).\n// (eg, for css-rgb\n// \"{ r: 0.10000, g: 001, b: 0}\" becomes \"{r: 0.1, g: 1, b: 0}\"\n// notice that css-rgb is a string to a string\n// )\nexport const colorFormatConverters = {\n 'hex6': {\n color: {\n from: v => [true, v],\n to: fixHex6,\n },\n text: {\n from: v => [hex6RE.test(v), v.trim()],\n to: v => v,\n },\n },\n 'hex8': {\n color: {\n from: v => [true, v],\n to: fixHex8,\n },\n text: {\n from: v => [hex8RE.test(v), v.trim()],\n to: v => v,\n },\n },\n 'hex3': {\n color: {\n from: v => [true, fixHex3(v)],\n to: hex3ToHex6,\n },\n text: {\n from: v => [hex6RE.test(v), hex6ToHex3(v.trim())],\n to: v => v,\n },\n },\n 'hex6-no-hash': {\n color: {\n from: v => [true, v.substring(1)],\n to: v => `#${fixHex6(v)}`,\n },\n text: {\n from: v => [hexNoHash6RE.test(v), v.trim()],\n to: v => v,\n },\n },\n 'hex8-no-hash': {\n color: {\n from: v => [true, v.substring(1)],\n to: v => `#${fixHex8(v)}`,\n },\n text: {\n from: v => [hexNoHash8RE.test(v), v.trim()],\n to: v => v,\n },\n },\n 'hex3-no-hash': {\n color: {\n from: v => [true, fixHex3(v).substring(1)],\n to: hex3ToHex6,\n },\n text: {\n from: v => [hexNoHash6RE.test(v), hex6ToHex3(v.trim())],\n to: v => v,\n },\n },\n 'uint32-rgb': {\n color: {\n from: v => [true, hexToUint32RGB(v)],\n to: uint32RGBToHex,\n },\n text: {\n from: v => strToUint32RGB(v),\n to: v => `0x${v.toString(16).padStart(6, '0')}`,\n },\n },\n 'uint32-rgba': {\n color: {\n from: v => [true, hexToUint32RGBA(v)],\n to: uint32RGBAToHex,\n },\n text: {\n from: v => strToUint32RGBA(v),\n to: v => `0x${v.toString(16).padStart(8, '0')}`,\n },\n },\n 'uint8-rgb': {\n color: {\n from: v => [true, hexToUint8RGB(v)],\n to: uint8RGBToHex,\n },\n text: {\n from: strTo3Ints,\n to: v => v.join(', '),\n },\n },\n 'uint8-rgba': {\n color: {\n from: v => [true, hexToUint8RGBA(v)],\n to: uint8RGBAToHex,\n },\n text: {\n from: strTo4Ints,\n to: v => v.join(', '),\n },\n },\n 'float-rgb': {\n color: {\n from: v => [true, hexToFloatRGB(v)],\n to: floatRGBToHex,\n },\n text: {\n from: strTo3Floats,\n // need Array.from because map of Float32Array makes a Float32Array\n to: v => Array.from(v).map(v => f3(v)).join(', '),\n },\n },\n 'float-rgba': {\n color: {\n from: v => [true, hexToFloatRGBA(v)],\n to: floatRGBAToHex,\n },\n text: {\n from: strTo4Floats,\n // need Array.from because map of Float32Array makes a Float32Array\n to: v => Array.from(v).map(v => f3(v)).join(', '),\n },\n },\n 'float-hsv': {\n color: {\n from: v => [true, rgbFloatToHSV01(hexToFloatRGB(v))],\n to: v => hsv01ToRGBFloat(floatRGBToHex(v)),\n },\n text: {\n from: strTo3Floats,\n // need Array.from because map of Float32Array makes a Float32Array\n to: v => Array.from(v).map(v => f3(v)).join(', '),\n },\n },\n 'float-hsva': {\n color: {\n from: v => [true, rgbaFloatToHSVA01(hexToFloatRGB(v))],\n to: v => hsva01ToRGBAFloat(floatRGBToHex(v)),\n },\n text: {\n from: strTo4Floats,\n // need Array.from because map of Float32Array makes a Float32Array\n to: v => Array.from(v).map(v => f3(v)).join(', '),\n },\n },\n //'float-hsl': {\n // color: {\n // from: v => [true, rgbFloatToHsl01(hexToFloatRGB(v))],\n // to: v => hsl01ToRGBFloat(floatRGBToHex(v)),\n // },\n // text: {\n // from: strTo3Floats,\n // // need Array.from because map of Float32Array makes a Float32Array\n // to: v => Array.from(v).map(v => f3(v)).join(', '),\n // },\n //},\n //'float-hsla': {\n // color: {\n // from: v => [true, hexToFloatRGBA(v)],\n // to: floatRGBAToHex,\n // },\n // text: {\n // from: strTo4Floats,\n // // need Array.from because map of Float32Array makes a Float32Array\n // to: v => Array.from(v).map(v => f3(v)).join(', '),\n // },\n //},\n 'object-rgb': {\n color: {\n from: v => [true, hexToObjectRGB(v)],\n to: objectRGBToHex,\n },\n text: {\n from: strToRGBObject,\n to: rgbObjectToStr,\n },\n },\n 'object-rgba': {\n color: {\n from: v => [true, hexToObjectRGBA(v)],\n to: objectRGBAToHex,\n },\n text: {\n from: strToRGBAObject,\n to: rgbaObjectToStr,\n },\n },\n 'css-rgb': {\n color: {\n from: v => [true, hexToCssRGB(v)],\n to: cssRGBToHex,\n },\n text: {\n from: strToCssRGB,\n to: v => strToCssRGB(v)[1],\n },\n },\n 'css-rgba': {\n color: {\n from: v => [true, hexToCssRGBA(v)],\n to: cssRGBAToHex,\n },\n text: {\n from: strToCssRGBA,\n to: v => strToCssRGBA(v)[1],\n },\n },\n 'css-hsl': {\n color: {\n from: v => [true, hexToCssHSL(v)],\n to: cssHSLToHex,\n },\n text: {\n from: strToCssHSL,\n to: v => strToCssHSL(v)[1],\n },\n },\n 'css-hsla': {\n color: {\n from: v => [true, hexToCssHSLA(v)],\n to: cssHSLAToHex,\n },\n text: {\n from: strToCssHSLA,\n to: v => strToCssHSLA(v)[1],\n },\n },\n};","import { createElem } from '../libs/elem.js';\nimport View from './View.js';\n\nexport default class ElementView extends View {\n constructor(tag, className) {\n super(createElem(tag, {className}));\n }\n}","import ElementView from '../views/ElementView.js';\nimport LabelController from './LabelController.js';\n\n// TODO: remove this? Should just be user side\nexport default class Canvas extends LabelController {\n #canvasElem;\n\n constructor(name) {\n super('muigui-canvas', name);\n this.#canvasElem = this.add(\n new ElementView('canvas', 'muigui-canvas'),\n ).domElement;\n }\n get canvas() {\n return this.#canvasElem;\n }\n listen() {\n return this;\n }\n}","import { createElem } from '../libs/elem.js';\nimport { identity } from '../libs/conversions.js';\nimport EditView from './EditView.js';\nimport { copyExistingProperties } from '../libs/utils.js';\n\nexport default class ColorView extends EditView {\n #to;\n #from;\n #colorElem;\n #skipUpdate;\n #options = {\n converters: identity,\n };\n\n constructor(setter, options) {\n const colorElem = createElem('input', {\n type: 'color',\n onInput: () => {\n const [valid, newV] = this.#from(colorElem.value);\n if (valid) {\n this.#skipUpdate = true;\n setter.setValue(newV);\n }\n },\n onChange: () => {\n const [valid, newV] = this.#from(colorElem.value);\n if (valid) {\n this.#skipUpdate = true;\n setter.setFinalValue(newV);\n }\n },\n });\n super(createElem('div', {}, [colorElem]));\n this.setOptions(options);\n this.#colorElem = colorElem;\n }\n updateDisplay(v) {\n if (!this.#skipUpdate) {\n this.#colorElem.value = this.#to(v);\n }\n this.#skipUpdate = false;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {converters: {to, from}} = this.#options;\n this.#to = to;\n this.#from = from;\n return this;\n }\n}\n","import {\n colorFormatConverters,\n guessFormat,\n} from '../libs/color-utils.js';\nimport ValueController from './ValueController.js';\nimport TextView from '../views/TextView.js';\nimport ColorView from '../views/ColorView.js';\n\nexport default class Color extends ValueController {\n #colorView;\n #textView;\n\n constructor(object, property, options = {}) {\n super(object, property, 'muigui-color');\n const format = options.format || guessFormat(this.getValue());\n const {color, text} = colorFormatConverters[format];\n this.#colorView = this.add(new ColorView(this, {converters: color}));\n this.#textView = this.add(new TextView(this, {converters: text}));\n this.updateDisplay();\n }\n setOptions(options) {\n const {format} = options;\n if (format) {\n const {color, text} = colorFormatConverters[format];\n this.#colorView.setOptions({converters: color});\n this.#textView.setOptions({converters: text});\n }\n super.setOptions(options);\n return this;\n }\n}","import Controller from './Controller.js';\n\n// This feels like it should be something else like\n// gui.addController({className: 'muigui-divider')};\nexport default class Divider extends Controller {\n constructor() {\n super('muigui-divider');\n }\n}","import Controller from './Controller.js';\n\nexport default class Container extends Controller {\n #controllers;\n #childDestController;\n\n constructor(className) {\n super(className);\n this.#controllers = [];\n this.#childDestController = this;\n }\n get children() {\n return this.#controllers; // should we return a copy?\n }\n get controllers() {\n return this.#controllers.filter(c => !(c instanceof Container));\n }\n get folders() {\n return this.#controllers.filter(c => c instanceof Container);\n }\n reset(recursive = true) {\n for (const controller of this.#controllers) {\n if (!(controller instanceof Container) || recursive) {\n controller.reset(recursive);\n }\n }\n return this;\n }\n updateDisplay() {\n for (const controller of this.#controllers) {\n controller.updateDisplay();\n }\n return this;\n }\n remove(controller) {\n const ndx = this.#controllers.indexOf(controller);\n if (ndx >= 0) {\n const c = this.#controllers.splice(ndx, 1);\n const c0 = c[0];\n const elem = c0.domElement;\n elem.remove();\n c0.setParent(null);\n }\n return this;\n }\n #addControllerImpl(controller) {\n this.domElement.appendChild(controller.domElement);\n this.#controllers.push(controller);\n controller.setParent(this);\n return controller;\n }\n addController(controller) {\n return this.#childDestController.#addControllerImpl(controller);\n }\n pushContainer(container) {\n this.addController(container);\n this.#childDestController = container;\n return container;\n }\n popContainer() {\n this.#childDestController = this.#childDestController.parent;\n return this;\n }\n listen() {\n this.#controllers.forEach(c => {\n c.listen();\n });\n return this;\n }\n}\n","import { createElem } from '../libs/elem.js';\nimport Container from './Container.js';\n\nexport default class Folder extends Container {\n #labelElem;\n\n constructor(name = 'Controls', className = 'muigui-menu') {\n super(className);\n this.#labelElem = createElem('label');\n this.addElem(createElem('button', {\n type: 'button',\n onClick: () => this.toggleOpen(),\n }, [this.#labelElem]));\n this.pushContainer(new Container('muigui-open-container'));\n this.pushContainer(new Container());\n this.name(name);\n this.open();\n }\n open(open = true) {\n this.domElement.classList.toggle('muigui-closed', !open);\n this.domElement.classList.toggle('muigui-open', open);\n return this;\n }\n close() {\n return this.open(false);\n }\n name(name) {\n this.#labelElem.textContent = name;\n return this;\n }\n title(title) {\n return this.name(title);\n }\n toggleOpen() {\n this.open(!this.domElement.classList.contains('muigui-open'));\n return this;\n }\n}\n","import Controller from './Controller.js';\n\n// This feels like it should be something else like\n// gui.addDividing = new Controller()\nexport default class Label extends Controller {\n constructor(text) {\n super('muigui-label');\n this.text(text);\n }\n text(text) {\n this.domElement.textContent = text;\n return this;\n }\n}","function noop() {\n}\n\nexport function computeRelativePosition(elem, event, start) {\n const rect = elem.getBoundingClientRect();\n const x = event.clientX - rect.left;\n const y = event.clientY - rect.top;\n const nx = x / rect.width;\n const ny = y / rect.height;\n start = start || [x, y];\n const dx = x - start[0];\n const dy = y - start[1];\n const ndx = dx / rect.width;\n const ndy = dy / rect.width;\n return {x, y, nx, ny, dx, dy, ndx, ndy};\n}\n\nexport function addTouchEvents(elem, {onDown = noop, onMove = noop, onUp = noop}) {\n let start;\n const pointerMove = function (event) {\n const e = {\n type: 'move',\n ...computeRelativePosition(elem, event, start),\n };\n onMove(e);\n };\n\n const pointerUp = function (event) {\n elem.releasePointerCapture(event.pointerId);\n elem.removeEventListener('pointermove', pointerMove);\n elem.removeEventListener('pointerup', pointerUp);\n\n document.body.style.backgroundColor = '';\n\n onUp('up');\n };\n\n const pointerDown = function (event) {\n elem.addEventListener('pointermove', pointerMove);\n elem.addEventListener('pointerup', pointerUp);\n elem.setPointerCapture(event.pointerId);\n\n const rel = computeRelativePosition(elem, event);\n start = [rel.x, rel.y];\n onDown({\n type: 'down',\n ...rel,\n });\n };\n\n elem.addEventListener('pointerdown', pointerDown);\n\n return function () {\n elem.removeEventListener('pointerdown', pointerDown);\n };\n}","import { createElem, getNewId } from '../libs/elem.js';\nimport { addTouchEvents } from '../libs/touch.js';\nimport { identity } from '../libs/conversions.js';\nimport { clamp } from '../libs/utils.js';\nimport EditView from './EditView.js';\nimport {\n hexToFloatRGB,\n hexToFloatRGBA,\n hsv01ToRGBFloat,\n hsva01ToRGBAFloat,\n rgbFloatToHSV01,\n rgbaFloatToHSVA01,\n floatRGBToHex,\n floatRGBAToHex,\n rgbaFloatToHsla01,\n} from '../libs/color-utils.js';\nimport { copyExistingProperties } from '../libs/utils.js';\n\nconst svg = `\n\n \n \n \n \n \n \n \n \n\n \n \n \n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n \n \n \n \n \n \n \n \n\n`;\n\nfunction connectFillTargets(elem) {\n elem.querySelectorAll('[data-src]').forEach(srcElem => {\n const id = getNewId();\n srcElem.id = id;\n elem.querySelectorAll(`[data-target=${srcElem.dataset.src}]`).forEach(targetElem => {\n targetElem.setAttribute('fill', `url(#${id})`);\n });\n });\n return elem;\n}\n\n// Was originally going to make alpha an option. Issue is\n// hard coded conversions?\nexport default class ColorChooserView extends EditView {\n #to;\n #from;\n #satLevelElem;\n #circleElem;\n #hueUIElem;\n #hueElem;\n #hueCursorElem;\n #alphaUIElem;\n #alphaElem;\n #alphaCursorElem;\n #hsva;\n #skipHueUpdate;\n #skipSatLevelUpdate;\n #skipAlphaUpdate;\n #options = {\n converters: identity,\n alpha: false,\n };\n #convertInternalToHex;\n #convertHexToInternal;\n\n constructor(setter, options) {\n super(createElem('div', {\n innerHTML: svg,\n className: 'muigui-no-scroll',\n }));\n this.#satLevelElem = this.domElement.children[0];\n this.#hueUIElem = this.domElement.children[1];\n this.#alphaUIElem = this.domElement.children[2];\n connectFillTargets(this.#satLevelElem);\n connectFillTargets(this.#hueUIElem);\n connectFillTargets(this.#alphaUIElem);\n this.#circleElem = this.$('.muigui-color-chooser-circle');\n this.#hueElem = this.$('[data-src=muigui-color-chooser-hue]');\n this.#hueCursorElem = this.$('.muigui-color-chooser-hue-cursor');\n this.#alphaElem = this.$('[data-src=muigui-color-chooser-alpha]');\n this.#alphaCursorElem = this.$('.muigui-color-chooser-alpha-cursor');\n\n const handleSatLevelChange = (e) => {\n const s = clamp(e.nx, 0, 1);\n const v = clamp(e.ny, 0, 1);\n this.#hsva[1] = s;\n this.#hsva[2] = (1 - v);\n this.#skipHueUpdate = true;\n this.#skipAlphaUpdate = true;\n const [valid, newV] = this.#from(this.#convertInternalToHex(this.#hsva));\n if (valid) {\n setter.setValue(newV);\n }\n };\n\n const handleHueChange = (e) => {\n const h = clamp(e.nx, 0, 1);\n this.#hsva[0] = h;\n this.#skipSatLevelUpdate = true;\n this.#skipAlphaUpdate = true;\n const [valid, newV] = this.#from(this.#convertInternalToHex(this.#hsva));\n if (valid) {\n setter.setValue(newV);\n }\n };\n\n const handleAlphaChange = (e) => {\n const a = clamp(e.nx, 0, 1);\n this.#hsva[3] = a;\n this.#skipHueUpdate = true;\n this.#skipSatLevelUpdate = true;\n const [valid, newV] = this.#from(this.#convertInternalToHex(this.#hsva));\n if (valid) {\n setter.setValue(newV);\n }\n };\n\n addTouchEvents(this.#satLevelElem, {\n onDown: handleSatLevelChange,\n onMove: handleSatLevelChange,\n });\n addTouchEvents(this.#hueUIElem, {\n onDown: handleHueChange,\n onMove: handleHueChange,\n });\n addTouchEvents(this.#alphaUIElem, {\n onDown: handleAlphaChange,\n onMove: handleAlphaChange,\n });\n this.setOptions(options);\n }\n updateDisplay(newV) {\n if (!this.#hsva) {\n this.#hsva = this.#convertHexToInternal(this.#to(newV));\n }\n {\n const [h, s, v, a = 1] = this.#convertHexToInternal(this.#to(newV));\n // Don't copy the hue if it was un-computable.\n if (!this.#skipHueUpdate) {\n this.#hsva[0] = s > 0.001 && v > 0.001 ? h : this.#hsva[0];\n }\n if (!this.#skipSatLevelUpdate) {\n this.#hsva[1] = s;\n this.#hsva[2] = v;\n }\n if (!this.#skipAlphaUpdate) {\n this.#hsva[3] = a;\n }\n }\n {\n const [h, s, v, a] = this.#hsva;\n const [hue, sat, lum] = rgbaFloatToHsla01(hsva01ToRGBAFloat(this.#hsva));\n\n if (!this.#skipHueUpdate) {\n this.#hueCursorElem.setAttribute('transform', `translate(${h * 64}, 0)`);\n }\n this.#hueElem.children[0].setAttribute('stop-color', `hsl(${hue * 360} 0% 100% / ${a})`);\n this.#hueElem.children[1].setAttribute('stop-color', `hsl(${hue * 360} 100% 50% / ${a})`);\n if (!this.#skipAlphaUpdate) {\n this.#alphaCursorElem.setAttribute('transform', `translate(${a * 64}, 0)`);\n }\n this.#alphaElem.children[0].setAttribute('stop-color', `hsl(${hue * 360} ${sat * 100}% ${lum * 100}% / 0)`);\n this.#alphaElem.children[1].setAttribute('stop-color', `hsl(${hue * 360} ${sat * 100}% ${lum * 100}% / 1)`);\n\n if (!this.#skipSatLevelUpdate) {\n this.#circleElem.setAttribute('cx', `${s * 64}`);\n this.#circleElem.setAttribute('cy', `${(1 - v) * 48}`);\n }\n }\n this.#skipHueUpdate = false;\n this.#skipSatLevelUpdate = false;\n this.#skipAlphaUpdate = false;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {converters: {to, from}, alpha} = this.#options;\n this.#alphaUIElem.style.display = alpha ? '' : 'none';\n this.#convertInternalToHex = alpha\n ? v => floatRGBAToHex(hsva01ToRGBAFloat(v))\n : v => floatRGBToHex(hsv01ToRGBFloat(v));\n this.#convertHexToInternal = alpha\n ? v => rgbaFloatToHSVA01(hexToFloatRGBA(v))\n : v => rgbFloatToHSV01(hexToFloatRGB(v));\n this.#to = to;\n this.#from = from;\n return this;\n }\n}\n","import ElementView from '../views/ElementView.js';\nimport ValueController from './ValueController.js';\nimport { copyExistingProperties } from '../libs/utils.js';\nimport { createElem } from '../libs/elem.js';\n/*\n\nholder = new TabHolder\ntab = holder.add(new Tab(\"name\"))\ntab.add(...)\n\n\npc = new PopdownController\ntop = pc.add(new Row())\ntop.add(new Button());\nvalues = topRow.add(new Div())\nbottom = pc.add(new Row());\n\n\n\npc = new PopdownController\npc.addTop\npc.addTop\n\npc.addBottom\n\n\n*/\n\nexport default class PopDownController extends ValueController {\n #top;\n #valuesView;\n #checkboxElem;\n #bottom;\n #options = {\n open: false,\n };\n\n constructor(object, property, options = {}) {\n super(object, property, 'muigui-pop-down-controller');\n /*\n [ValueView\n [[B][values]] upper row\n [[ visual ]] lower row\n ]\n */\n this.#top = this.add(new ElementView('div', 'muigui-pop-down-top'));\n// this.#top.add(new CheckboxView(makeSetter(this.#options, 'open')));\n const checkboxElem = this.#top.addElem(createElem('input', {\n type: 'checkbox',\n onChange: () => {\n this.#options.open = checkboxElem.checked;\n this.updateDisplay();\n },\n }));\n this.#checkboxElem = checkboxElem;\n this.#valuesView = this.#top.add(new ElementView('div', 'muigui-pop-down-values'));\n const container = new ElementView('div', 'muigui-pop-down-bottom muigui-open-container');\n this.#bottom = new ElementView('div');\n container.add(this.#bottom);\n this.add(container);\n this.setOptions(options);\n }\n setKnobColor(bgCssColor/*, fgCssColor*/) {\n if (this.#checkboxElem) {\n this.#checkboxElem.style = `\n --range-color: ${bgCssColor};\n --value-bg-color: ${bgCssColor};\n `;\n }\n }\n updateDisplay() {\n super.updateDisplay();\n const {open} = this.#options;\n this.domElement.children[1].classList.toggle('muigui-open', open);\n this.domElement.children[1].classList.toggle('muigui-closed', !open);\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n super.setOptions(options);\n this.updateDisplay();\n }\n addTop(view) {\n return this.#valuesView.add(view);\n }\n addBottom(view) {\n return this.#bottom.add(view);\n }\n}","/* eslint-disable no-underscore-dangle */\nimport {\n colorFormatConverters,\n guessFormat,\n hasAlpha,\n hexToUint8RGB,\n hslToRgbUint8,\n rgbUint8ToHsl,\n uint8RGBToHex,\n} from '../libs/color-utils.js';\nimport ColorChooserView from '../views/ColorChooserView.js';\nimport TextView from '../views/TextView.js';\nimport PopDownController from './PopDownController.js';\n\nexport default class ColorChooser extends PopDownController {\n #colorView;\n #textView;\n #to;\n\n constructor(object, property, options = {}) {\n super(object, property, 'muigui-color-chooser');\n const format = options.format || guessFormat(this.getValue());\n const {color, text} = colorFormatConverters[format];\n this.#to = color.to;\n this.#textView = new TextView(this, {converters: text, alpha: hasAlpha(format)});\n this.#colorView = new ColorChooserView(this, {converters: color, alpha: hasAlpha(format)});\n this.addTop(this.#textView);\n this.addBottom(this.#colorView);\n // WTF! FIX!\n this.___setKnobHelper = true;\n this.updateDisplay();\n }\n #setKnobHelper() {\n if (this.#to) {\n const hex6Or8 = this.#to(this.getValue());\n const alpha = hex6Or8.length === 9 ? hex6Or8.substring(7, 9) : 'FF';\n const hsl = rgbUint8ToHsl(hexToUint8RGB(hex6Or8));\n hsl[2] = (hsl[2] + 50) % 100;\n const hex = uint8RGBToHex(hslToRgbUint8(hsl));\n this.setKnobColor(`${hex6Or8.substring(0, 7)}${alpha}`, hex);\n }\n }\n updateDisplay() {\n super.updateDisplay();\n if (this.___setKnobHelper) {\n this.#setKnobHelper();\n }\n }\n setOptions(options) {\n super.setOptions(options);\n return this;\n }\n}\n","import { createElem } from '../libs/elem.js';\nimport View from '../views/View.js';\n\nfunction showCSS(ob) {\n if (ob.prototype.css) {\n showCSS(ob.prototype);\n }\n}\n\nexport default class Layout extends View {\n static css = 'bar';\n constructor(tag, className) {\n super(createElem(tag, {className}));\n\n showCSS(this);\n }\n}\n\n/*\nclass ValueController ?? {\n const row = this.add(new Row());\n const label = row.add(new Label());\n const div = row.add(new Div());\n const row = div.add(new Row());\n}\n*/\n\n/*\nclass MyCustomThing extends ValueController {\n constructor(object, property, options) {\n const topRow = this.add(new Row());\n const bottomRow = this.add(new Row());\n topRow.add(new NumberView());\n topRow.add(new NumberView());\n topRow.add(new NumberView());\n topRow.add(new NumberView());\n bottomRow.add(new DirectionView());\n bottomRow.add(new DirectionView());\n bottomRow.add(new DirectionView());\n bottomRow.add(new DirectionView());\n }\n}\n new Grid([\n [new\n ]\n */","import Layout from './Layout.js';\n\nexport default class Column extends Layout {\n constructor() {\n super('div', 'muigui-row');\n }\n}\n","import Layout from './Layout.js';\n\nexport default class Frame extends Layout {\n static css = 'foo';\n constructor() {\n super('div', 'muigui-frame');\n }\n static get foo() {\n return 'boo';\n }\n}\n","import Layout from './Layout.js';\n\nexport default class Grid extends Layout {\n constructor() {\n super('div', 'muigui-grid');\n }\n}\n","import Layout from './Layout.js';\n\nexport default class Row extends Layout {\n constructor() {\n super('div', 'muigui-row');\n }\n}\n","import css from './styles/muigui.css.js';\nimport {createElem} from './libs/elem.js';\nimport {createController} from './controllers/create-controller.js';\nimport {\n mapRange,\n makeRangeConverters,\n makeRangeOptions,\n makeMinMaxPair,\n} from './libs/utils.js';\nimport {\n converters\n} from './libs/conversions.js';\nimport {\n hasAlpha,\n guessFormat,\n} from './libs/color-utils.js';\nimport Canvas from './controllers/Canvas.js';\nimport Color from './controllers/Color.js';\nimport Divider from './controllers/Divider.js';\nimport Folder from './controllers/Folder.js';\nimport Label from './controllers/Label.js';\nimport Controller from './controllers/Controller.js';\nimport ColorChooser from './controllers/ColorChooser.js';\n\nimport Column from './layout/Column.js';\nimport Frame from './layout/Frame.js';\nimport Grid from './layout/Grid.js';\nimport Row from './layout/Row.js';\n\nexport {\n Column,\n Frame,\n Grid,\n Row,\n};\n\nfunction camelCaseToSnakeCase(id) {\n return id\n .replace(/(.)([A-Z][a-z]+)/g, '$1_$2')\n .replace(/([a-z0-9])([A-Z])/g, '$1_$2')\n .toLowerCase();\n}\n\nfunction prepName(name) {\n return camelCaseToSnakeCase(name.toString()).replaceAll('_', ' ');\n}\n\nexport class GUIFolder extends Folder {\n add(object, property, ...args) {\n const controller = object instanceof Controller\n ? object\n : createController(object, property, ...args).name(prepName(property));\n return this.addController(controller);\n }\n addCanvas(name) {\n return this.addController(new Canvas(name));\n }\n addColor(object, property, options = {}) {\n const value = object[property];\n if (hasAlpha(options.format || guessFormat(value))) {\n return this\n .addController(new ColorChooser(object, property, options))\n .name(prepName(property));\n } else {\n return this\n .addController(new Color(object, property, options))\n .name(prepName(property));\n }\n }\n addDivider() {\n return this.addController(new Divider());\n }\n addFolder(name) {\n return this.addController(new GUIFolder(name));\n }\n addLabel(text) {\n return this.addController(new Label(text));\n }\n addButton(name, fn) {\n const o = {fn};\n return this.add(o, 'fn').name(prepName(name));\n }\n}\n\nclass MuiguiElement extends HTMLElement {\n constructor() {\n super();\n this.shadow = this.attachShadow({mode: 'open'});\n }\n}\n\ncustomElements.define('muigui-element', MuiguiElement);\n\nconst baseStyleSheet = new CSSStyleSheet();\n//baseStyleSheet.replaceSync(css.default);\nconst userStyleSheet = new CSSStyleSheet();\n\nfunction makeStyleSheetUpdater(styleSheet) {\n let newCss;\n let newCssPromise;\n\n function updateStyle() {\n if (newCss && !newCssPromise) {\n const s = newCss;\n newCss = undefined;\n newCssPromise = styleSheet.replace(s).then(() => {\n newCssPromise = undefined;\n updateStyle();\n });\n }\n }\n\n return function updateStyleSheet(css) {\n newCss = css;\n updateStyle();\n };\n}\n\nconst updateBaseStyle = makeStyleSheetUpdater(baseStyleSheet);\nconst updateUserStyle = makeStyleSheetUpdater(userStyleSheet);\n\nfunction getTheme(name) {\n const { include, css: cssStr } = css.themes[name];\n return `${include.map(m => css[m]).join('\\n')} : css.default}\\n${cssStr || ''}`;\n}\n\nexport class GUI extends GUIFolder {\n static converters = converters;\n static mapRange = mapRange;\n static makeRangeConverters = makeRangeConverters;\n static makeRangeOptions = makeRangeOptions;\n static makeMinMaxPair = makeMinMaxPair;\n #localStyleSheet = new CSSStyleSheet();\n\n constructor(options = {}) {\n super('Controls', 'muigui-root');\n if (options instanceof HTMLElement) {\n options = {parent: options};\n }\n const {\n autoPlace = true,\n width,\n title = 'Controls',\n } = options;\n let {\n parent,\n } = options;\n\n if (width) {\n this.domElement.style.width = /^\\d+$/.test(width) ? `${width}px` : width;\n }\n if (parent === undefined && autoPlace) {\n parent = document.body;\n this.domElement.classList.add('muigui-auto-place');\n }\n if (parent) {\n const muiguiElement = createElem('muigui-element');\n muiguiElement.shadowRoot.adoptedStyleSheets = [this.#localStyleSheet, baseStyleSheet, userStyleSheet];\n muiguiElement.shadow.appendChild(this.domElement);\n parent.appendChild(muiguiElement);\n }\n if (title) {\n this.title(title);\n }\n this.#localStyleSheet.replaceSync(css.default);\n this.domElement.classList.add('muigui', 'muigui-colors');\n }\n setStyle(css) {\n this.#localStyleSheet.replace(css);\n }\n static setBaseStyles(css) {\n updateBaseStyle(css);\n }\n static getBaseStyleSheet() {\n return baseStyleSheet;\n }\n static setUserStyles(css) {\n updateUserStyle(css);\n }\n static getUserStyleSheet() {\n return userStyleSheet;\n }\n setTheme(name) {\n this.setStyle(getTheme(name));\n }\n static setTheme(name) {\n GUI.setBaseStyles(getTheme(name));\n }\n}\n\nexport default GUI;\n","function noop() {\n}\n\nconst keyDirections = {\n ArrowLeft: [-1, 0],\n ArrowRight: [1, 0],\n ArrowUp: [0, -1],\n ArrowDown: [0, 1],\n};\n\n// This probably needs to be global\nexport function addKeyboardEvents(elem, {onDown = noop, onUp = noop}) {\n const keyDown = function (event) {\n const mult = event.shiftKey ? 10 : 1;\n const [dx, dy] = (keyDirections[event.key] || [0, 0]).map(v => v * mult);\n const fn = event.type === 'keydown' ? onDown : onUp;\n fn({\n type: event.type.substring(3),\n dx,\n dy,\n event,\n });\n };\n\n elem.addEventListener('keydown', keyDown);\n elem.addEventListener('keyup', keyDown);\n\n return function () {\n elem.removeEventListener('keydown', keyDown);\n elem.removeEventListener('keyup', keyDown);\n };\n}","export function assert(truthy, msg = '') {\n if (!truthy) {\n throw new Error(msg);\n }\n}","import { assert } from '../libs/assert.js';\n\nfunction getEllipsePointForAngle(cx, cy, rx, ry, phi, theta) {\n const m = Math.abs(rx) * Math.cos(theta);\n const n = Math.abs(ry) * Math.sin(theta);\n\n return [\n cx + Math.cos(phi) * m - Math.sin(phi) * n,\n cy + Math.sin(phi) * m + Math.cos(phi) * n,\n ];\n}\n\nfunction getEndpointParameters(cx, cy, rx, ry, phi, theta, dTheta) {\n const [x1, y1] = getEllipsePointForAngle(cx, cy, rx, ry, phi, theta);\n const [x2, y2] = getEllipsePointForAngle(cx, cy, rx, ry, phi, theta + dTheta);\n\n const fa = Math.abs(dTheta) > Math.PI ? 1 : 0;\n const fs = dTheta > 0 ? 1 : 0;\n\n return { x1, y1, x2, y2, fa, fs };\n}\n\nexport function arc(cx, cy, r, start, end) {\n assert(Math.abs(start - end) <= Math.PI * 2);\n assert(start >= -Math.PI && start <= Math.PI * 2);\n assert(start <= end);\n assert(end >= -Math.PI && end <= Math.PI * 4);\n\n const { x1, y1, x2, y2, fa, fs } = getEndpointParameters(cx, cy, r, r, 0, start, end - start);\n return Math.abs(Math.abs(start - end) - Math.PI * 2) > Number.EPSILON\n ? `M${cx} ${cy} L${x1} ${y1} A ${r} ${r} 0 ${fa} ${fs} ${x2} ${y2} L${cx} ${cy}`\n : `M${x1} ${y1} L${x1} ${y1} A ${r} ${r} 0 ${fa} ${fs} ${x2} ${y2}`;\n}\n","import { identity } from '../libs/conversions.js';\nimport { createElem } from '../libs/elem.js';\nimport { addKeyboardEvents } from '../libs/keyboard.js';\nimport { arc } from '../libs/svg.js';\nimport { addTouchEvents } from '../libs/touch.js';\nimport { createWheelHelper } from '../libs/wheel.js';\nimport { clamp, copyExistingProperties, euclideanModulo, lerp, stepify } from '../libs/utils.js';\nimport EditView from './EditView.js';\n\nconst svg = `\n\n \n \n \n \n \n \n \n\n`;\n\nconst twoPiMod = v => euclideanModulo(v + Math.PI, Math.PI * 2) - Math.PI;\n\nexport default class DirectionView extends EditView {\n #arrowElem;\n #rangeElem;\n #lastV;\n #wrap;\n #options = {\n step: 1,\n min: -180,\n max: 180,\n\n /*\n --------\n / -π/2 \\\n / | \\\n |<- -π * |\n | * 0 ->| zero is down the positive X axis\n |<- +π * |\n \\ | /\n \\ π/2 /\n --------\n */\n dirMin: -Math.PI,\n dirMax: Math.PI,\n //dirMin: Math.PI * 0.5,\n //dirMax: Math.PI * 2.5,\n //dirMin: -Math.PI * 0.75, // test 10:30 to 7:30\n //dirMax: Math.PI * 0.75,\n //dirMin: Math.PI * 0.75, // test 7:30 to 10:30\n //dirMax: -Math.PI * 0.75,\n //dirMin: -Math.PI * 0.75, // test 10:30 to 1:30\n //dirMax: -Math.PI * 0.25,\n //dirMin: Math.PI * 0.25, // test 4:30 to 7:30\n //dirMax: Math.PI * 0.75,\n //dirMin: Math.PI * 0.75, // test 4:30 to 7:30\n //dirMax: Math.PI * 0.25,\n wrap: undefined,\n converters: identity,\n };\n\n constructor(setter, options = {}) {\n const wheelHelper = createWheelHelper();\n super(createElem('div', {\n className: 'muigui-direction muigui-no-scroll',\n innerHTML: svg,\n onWheel: e => {\n e.preventDefault();\n const {min, max, step} = this.#options;\n const delta = wheelHelper(e, step);\n let tempV = this.#lastV + delta;\n if (this.#wrap) {\n tempV = euclideanModulo(tempV - min, max - min) + min;\n }\n const newV = clamp(stepify(tempV, v => v, step), min, max);\n setter.setValue(newV);\n },\n }));\n const handleTouch = (e) => {\n const {min, max, step, dirMin, dirMax} = this.#options;\n const nx = e.nx * 2 - 1;\n const ny = e.ny * 2 - 1;\n const a = Math.atan2(ny, nx);\n\n const center = (dirMin + dirMax) / 2;\n\n const centeredAngle = twoPiMod(a - center);\n const centeredStart = twoPiMod(dirMin - center);\n const diff = dirMax - dirMin;\n\n const n = clamp((centeredAngle - centeredStart) / (diff), 0, 1);\n const newV = stepify(min + (max - min) * n, v => v, step);\n setter.setValue(newV);\n };\n addTouchEvents(this.domElement, {\n onDown: handleTouch,\n onMove: handleTouch,\n });\n addKeyboardEvents(this.domElement, {\n onDown: (e) => {\n const {min, max, step} = this.#options;\n const newV = clamp(stepify(this.#lastV + e.dx * step, v => v, step), min, max);\n setter.setValue(newV);\n },\n });\n this.#arrowElem = this.$('#muigui-arrow');\n this.#rangeElem = this.$('#muigui-range');\n this.setOptions(options);\n }\n updateDisplay(v) {\n this.#lastV = v;\n const {min, max} = this.#options;\n const n = (v - min) / (max - min);\n const angle = lerp(this.#options.dirMin, this.#options.dirMax, n);\n this.#arrowElem.style.transform = `rotate(${angle}rad)`;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {dirMin, dirMax, wrap} = this.#options;\n this.#wrap = wrap !== undefined\n ? wrap\n : Math.abs(dirMin - dirMax) >= Math.PI * 2 - Number.EPSILON;\n const [min, max] = dirMin < dirMax ? [dirMin, dirMax] : [dirMax , dirMin];\n this.#rangeElem.setAttribute('d', arc(0, 0, 28.87, min, max));\n }\n}\n","import { identity } from '../libs/conversions.js';\nimport DirectionView from '../views/DirectionView.js';\nimport NumberView from '../views/NumberView.js';\n// import ValueController from './ValueController.js';\nimport PopDownController from './PopDownController.js';\n\n\n// deg2rad\n// where is 0\n// range (0, 360), (-180, +180), (0,0) Really this is a range\n\nexport default class Direction extends PopDownController {\n #options;\n constructor(object, property, options) {\n super(object, property, 'muigui-direction');\nthis.#options = options; // FIX\n this.addTop(new NumberView(this,\nidentity));\n this.addBottom(new DirectionView(this, options));\n this.updateDisplay();\n }\n}\n\n","import { createElem } from '../libs/elem.js';\nimport { makeId } from '../libs/ids.js';\nimport EditView from './EditView.js';\n\nexport default class RadioGridView extends EditView {\n #values;\n\n constructor(setter, keyValues, cols = 3) {\n const values = [];\n const name = makeId();\n super(createElem('div', {}, keyValues.map(([key, value], ndx) => {\n values.push(value);\n return createElem('label', {}, [\n createElem('input', {\n type: 'radio',\n name,\n value: ndx,\n onChange: function () {\n if (this.checked) {\n setter.setFinalValue(that.#values[this.value]);\n }\n },\n }),\n createElem('button', {\n type: 'button',\n textContent: key,\n onClick: function () {\n this.previousElementSibling.click();\n },\n }),\n ]);\n })));\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const that = this;\n this.#values = values;\n this.cols(cols);\n }\n updateDisplay(v) {\n const ndx = this.#values.indexOf(v);\n for (let i = 0; i < this.domElement.children.length; ++i) {\n this.domElement.children[i].children[0].checked = i === ndx;\n }\n }\n cols(cols) {\n this.domElement.style.gridTemplateColumns = `repeat(${cols}, 1fr)`;\n }\n}\n","import RadioGridView from '../views/RadioGridView.js';\nimport ValueController from './ValueController.js';\nimport { convertToKeyValues } from '../libs/key-values.js';\n\nexport default class RadioGrid extends ValueController {\n constructor(object, property, options) {\n super(object, property, 'muigui-radio-grid');\n const valueIsNumber = typeof this.getValue() === 'number';\n const {\n keyValues: keyValuesInput,\n cols = 3,\n } = options;\n const keyValues = convertToKeyValues(keyValuesInput, valueIsNumber);\n this.add(new RadioGridView(this, keyValues, cols));\n this.updateDisplay();\n }\n}","export function onResize(elem, callback) {\n new ResizeObserver(() => {\n callback({rect: elem.getBoundingClientRect(), elem});\n }).observe(elem);\n}\n\nexport function onResizeSVGNoScale(elem, hAnchor, vAnchor, callback) {\n onResize(elem, ({rect}) => {\n const {width, height} = rect;\n elem.setAttribute('viewBox', `-${width * hAnchor} -${height * vAnchor} ${width} ${height}`);\n callback({elem, rect});\n });\n}\n\nexport function onResizeCanvas(elem, callback) {\n onResize(elem, ({rect}) => {\n const {width, height} = rect;\n elem.width = width;\n elem.height = height;\n callback({elem, rect});\n });\n}\n","import { createElem } from '../libs/elem.js';\nimport { addKeyboardEvents } from '../libs/keyboard.js';\nimport { addTouchEvents } from '../libs/touch.js';\nimport { createWheelHelper } from '../libs/wheel.js';\nimport { onResizeSVGNoScale } from '../libs/resize-helpers.js';\nimport { clamp, copyExistingProperties, stepify } from '../libs/utils.js';\nimport EditView from './EditView.js';\n\nconst svg = `\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n`;\n\nfunction createSVGTicks(start, end, step, min, max, height) {\n const p = [];\n if (start < min) {\n start += stepify(min - start, v => v, step);\n }\n end = Math.min(end, max);\n for (let i = start; i <= end; i += step) {\n p.push(`M${i} 0 l0 ${height}`);\n }\n return p.join(' ');\n}\n\nfunction createSVGNumbers(start, end, unitSize, unit, minusSize, min, max, labelFn) {\n const texts = [];\n if (start < min) {\n start += stepify(min - start, v => v, unitSize);\n }\n end = Math.min(end, max);\n const digits = Math.max(0, -Math.log10(unit));\n const f = v => labelFn(v.toFixed(digits));\n for (let i = start; i <= end; i += unitSize) {\n texts.push(`= 0 ? i : (i - minusSize / 2) }\" y=\"0\">${f(i / unitSize * unit)}`);\n }\n return texts.join('\\n');\n}\n\nfunction computeSizeOfMinus(elem) {\n const oldHTML = elem.innerHTML;\n elem.innerHTML = '- ';\n const text = elem.querySelector('text');\n const size = text.getComputedTextLength();\n elem.innerHTML = oldHTML;\n return size;\n}\n\nexport default class SliderView extends EditView {\n #svgElem;\n #originElem;\n #ticksElem;\n #thicksElem;\n #numbersElem;\n #leftGradElem;\n #rightGradElem;\n #width;\n #height;\n #lastV;\n #minusSize;\n #options = {\n min: -100,\n max: 100,\n step: 1,\n unit: 10,\n unitSize: 10,\n ticksPerUnit: 5,\n labelFn: v => v,\n tickHeight: 1,\n limits: true,\n thicksColor: undefined,\n orientation: undefined,\n };\n\n constructor(setter, options) {\n const wheelHelper = createWheelHelper();\n super(createElem('div', {\n innerHTML: svg,\n className: 'muigui-no-v-scroll',\n onWheel: e => {\n e.preventDefault();\n const {min, max, step} = this.#options;\n const delta = wheelHelper(e, step);\n const newV = clamp(stepify(this.#lastV + delta, v => v, step), min, max);\n setter.setValue(newV);\n },\n }));\n this.#svgElem = this.$('svg');\n this.#originElem = this.$('#muigui-origin');\n this.#ticksElem = this.$('#muigui-ticks');\n this.#thicksElem = this.$('#muigui-thicks');\n this.#numbersElem = this.$('#muigui-numbers');\n this.#leftGradElem = this.$('#muigui-left-grad');\n this.#rightGradElem = this.$('#muigui-right-grad');\n this.setOptions(options);\n let startV;\n addTouchEvents(this.domElement, {\n onDown: () => {\n startV = this.#lastV;\n },\n onMove: (e) => {\n const {min, max, unitSize, unit, step} = this.#options;\n const newV = clamp(stepify(startV - e.dx / unitSize * unit, v => v, step), min, max);\n setter.setValue(newV);\n },\n });\n addKeyboardEvents(this.domElement, {\n onDown: (e) => {\n const {min, max, step} = this.#options;\n const newV = clamp(stepify(this.#lastV + e.dx * step, v => v, step), min, max);\n setter.setValue(newV);\n },\n });\n onResizeSVGNoScale(this.#svgElem, 0.5, 0, ({rect: {width}}) => {\n this.#leftGradElem.setAttribute('x', -width / 2);\n this.#rightGradElem.setAttribute('x', width / 2 - 20);\n this.#minusSize = computeSizeOfMinus(this.#numbersElem);\n this.#width = width;\n this.#updateSlider();\n });\n }\n // |--------V--------|\n // . . | . . . | . . . |\n //\n #updateSlider() {\n // There's no size if ResizeObserver has not fired yet.\n if (!this.#width || this.#lastV === undefined) {\n return;\n }\n const {\n labelFn,\n limits,\n min,\n max,\n orientation,\n tickHeight,\n ticksPerUnit,\n unit,\n unitSize,\n thicksColor,\n } = this.#options;\n const unitsAcross = Math.ceil(this.#width / unitSize);\n const center = this.#lastV;\n const centerUnitSpace = center / unit;\n const startUnitSpace = Math.round(centerUnitSpace - unitsAcross);\n const endUnitSpace = startUnitSpace + unitsAcross * 2;\n const start = startUnitSpace * unitSize;\n const end = endUnitSpace * unitSize;\n const minUnitSpace = limits ? min * unitSize / unit : start;\n const maxUnitSpace = limits ? max * unitSize / unit : end;\n const height = labelFn(1) === '' ? 10 : 5;\n if (ticksPerUnit > 1) {\n this.#ticksElem.setAttribute('d', createSVGTicks(start, end, unitSize / ticksPerUnit, minUnitSpace, maxUnitSpace, height * tickHeight));\n }\n this.#thicksElem.style.stroke = thicksColor; //setAttribute('stroke', thicksColor);\n this.#thicksElem.setAttribute('d', createSVGTicks(start, end, unitSize, minUnitSpace, maxUnitSpace, height));\n this.#numbersElem.innerHTML = createSVGNumbers(start, end, unitSize, unit, this.#minusSize, minUnitSpace, maxUnitSpace, labelFn);\n this.#originElem.setAttribute('transform', `translate(${-this.#lastV * unitSize / unit} 0)`);\n this.#svgElem.classList.toggle('muigui-slider-up', orientation === 'up');\n }\n updateDisplay(v) {\n this.#lastV = v;\n this.#updateSlider();\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n return this;\n }\n}\n","import ValueController from './ValueController.js';\nimport NumberView from '../views/NumberView.js';\nimport SliderView from '../views/SliderView.js';\n\nexport default class Slider extends ValueController {\n constructor(object, property, options = {}) {\n super(object, property, 'muigui-slider');\n this.add(new SliderView(this, options));\n this.add(new NumberView(this, options));\n this.updateDisplay();\n }\n}\n","import { createElem } from '../libs/elem.js';\nimport { addTouchEvents } from '../libs/touch.js';\nimport { onResizeSVGNoScale } from '../libs/resize-helpers.js';\nimport EditView from './EditView.js';\n\nconst svg = `\n\n \n \n \n \n \n\n`;\n\nexport default class Vec2View extends EditView {\n #svgElem;\n #arrowElem;\n #circleElem;\n #lastV = [];\n\n constructor(setter) {\n super(createElem('div', {\n innerHTML: svg,\n className: 'muigui-no-scroll',\n }));\n const onTouch = (e) => {\n const {width, height} = this.#svgElem.getBoundingClientRect();\n const nx = e.nx * 2 - 1;\n const ny = e.ny * 2 - 1;\n setter.setValue([nx * width * 0.5, ny * height * 0.5]);\n };\n addTouchEvents(this.domElement, {\n onDown: onTouch,\n onMove: onTouch,\n });\n this.#svgElem = this.$('svg');\n this.#arrowElem = this.$('#muigui-arrow');\n this.#circleElem = this.$('#muigui-circle');\n onResizeSVGNoScale(this.#svgElem, 0.5, 0.5, () => this.#updateDisplayImpl);\n }\n #updateDisplayImpl() {\n const [x, y] = this.#lastV;\n this.#arrowElem.setAttribute('d', `M0,0L${x},${y}`);\n this.#circleElem.setAttribute('transform', `translate(${x}, ${y})`);\n }\n updateDisplay(v) {\n this.#lastV[0] = v[0];\n this.#lastV[1] = v[1];\n this.#updateDisplayImpl();\n }\n}\n","import NumberView from '../views/NumberView.js';\nimport Vec2View from '../views/Vec2View.js';\nimport PopDownController from './PopDownController.js';\nimport { strToNumber } from '../libs/conversions.js';\n\n// TODO: zoom with wheel and pinch?\n// TODO: grid?\n// // options\n// scale:\n// range: number (both x and y + /)\n// range: array (min, max)\n// xRange:\n// deg/rad/turn\n\nexport default class Vec2 extends PopDownController {\n constructor(object, property) {\n super(object, property, 'muigui-vec2');\n\n const makeSetter = (ndx) => {\n return {\n setValue: (v) => {\n const newV = this.getValue();\n newV[ndx] = v;\n this.setValue(newV);\n },\n setFinalValue: (v) => {\n const newV = this.getValue();\n newV[ndx] = v;\n this.setFinalValue(newV);\n },\n };\n };\n\n this.addTop(new NumberView(makeSetter(0), {\n converters: {\n to: v => v[0],\n from: strToNumber.from,\n },\n }));\n this.addTop(new NumberView(makeSetter(1), {\n converters: {\n to: v => v[1],\n from: strToNumber.from,\n },\n }));\n this.addBottom(new Vec2View(this));\n this.updateDisplay();\n }\n}\n","const darkColors = {\n main: '#ddd',\n};\nconst lightColors = {\n main: '#333',\n};\n\nconst darkMatcher = window.matchMedia('(prefers-color-scheme: dark)');\n\nlet colors;\nlet isDarkMode;\n\nfunction update() {\n isDarkMode = darkMatcher.matches;\n colors = isDarkMode ? darkColors : lightColors;\n}\ndarkMatcher.addEventListener('change', update);\nupdate();\n\nexport function graph(canvas, data, {\n min = -1,\n max = 1,\n interval = 16,\n color,\n }) {\n const ctx = canvas.getContext('2d');\n\n function render() {\n const {width, height} = canvas;\n ctx.clearRect(0, 0, width, height);\n ctx.beginPath();\n const range = max - min;\n for (let i = 0; i < data.length; ++i) {\n const x = i * width / data.length;\n const y = (data[i] - min) * height / range;\n ctx.lineTo(x, y);\n }\n ctx.strokeStyle = color || colors.main;\n ctx.stroke();\n }\n setInterval(render, interval);\n}","export function monitor(label, object, property, {interval = 200} = {}) {\n setInterval(() => {\n label.text(JSON.stringify(object[property], null, 2));\n }, interval);\n}\n","import GUI from './muigui.js';\n\nexport { default as ColorChooser } from './controllers/ColorChooser.js';\nexport { default as Direction } from './controllers/Direction.js';\nexport { default as RadioGrid } from './controllers/RadioGrid.js';\nexport { default as Range } from './controllers/Range.js';\nexport { default as Select } from './controllers/Select.js';\nexport { default as Slider } from './controllers/Slider.js';\nexport { default as TextNumber } from './controllers/TextNumber.js';\nexport { default as Vec2 } from './controllers/Vec2.js';\n\nimport {graph} from './libs/graph.js';\nimport {monitor} from './libs/monitor.js';\n\nexport const helpers = {\n graph,\n monitor,\n};\n\nexport default GUI;"],"names":["clamp","euclideanModulo","lerp","identity","noop","svg"],"mappings":";AAAA,UAAe;AACf,EAAE,OAAO,EAAE,CAAC;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,MAAM,EAAE;AACR,EAAE,OAAO,EAAE;AACX,IAAI,OAAO,EAAE,CAAC,SAAS,CAAC;AACxB,IAAI,GAAG,EAAE,CAAC;AACV,IAAI,CAAC;AACL,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,OAAO,EAAE,CAAC,SAAS,CAAC;AACxB,IAAI,GAAG,EAAE,CAAC;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,OAAO,EAAE,EAAE;AACf,IAAI,GAAG,EAAE,CAAC;AACV;AACA;AACA;AACA;AACA;AACA;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,CAAC,SAAS,EAAE,CAAC;AACpB,IAAI,MAAM,KAAK,GAAG,GAAG,GAAG,GAAG,CAAC;AAC5B,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE;AAC1C,MAAM,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC;AACxC,MAAM,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,MAAM,GAAG,KAAK,CAAC;AACjD,MAAM,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACvB,KAAK;AACL,IAAI,GAAG,CAAC,WAAW,GAAG,KAAK,IAAI,MAAM,CAAC,IAAI,CAAC;AAC3C,IAAI,GAAG,CAAC,MAAM,EAAE,CAAC;AACjB,GAAG;AACH,EAAE,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AAChC;;ACzCO,SAAS,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,QAAQ,GAAG,GAAG,CAAC,GAAG,EAAE,EAAE;AACxE,EAAE,WAAW,CAAC,MAAM;AACpB,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AAC1D,GAAG,EAAE,QAAQ,CAAC,CAAC;AACf;;ACUa,MAAA,OAAO,GAAG;IACrB,KAAK;IACL,OAAO;;;;;"} \ No newline at end of file diff --git a/dist/0.x/muigui.module.min.js b/dist/0.x/muigui.module.min.js index c21420e..01d6c47 100644 --- a/dist/0.x/muigui.module.min.js +++ b/dist/0.x/muigui.module.min.js @@ -1,2 +1,2 @@ -var t={default:'\n.muigui {\n --bg-color: #ddd;\n --color: #222;\n --contrast-color: #eee;\n --value-color: #145 ;\n --value-bg-color: #eeee;\n --disabled-color: #999;\n --menu-bg-color: #f8f8f8;\n --menu-sep-color: #bbb;\n --hover-bg-color: #999;\n --focus-color: #8BF;\n --range-color: #AAA;\n --invalid-color: #FF0000;\n --selected-color: rgb(255, 255, 255, 0.9);\n\n --button-bg-color: var(--value-bg-color);\n\n --image-open: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjNDQ0OyIgeD0iMjAlIiB5PSI0NSUiIHdpZHRoPSI2MCUiIGhlaWdodD0iMTAlIj48L3JlY3Q+Cjwvc3ZnPg==);\n --image-closed: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjNDQ0OyIgeD0iNDUlIiB5PSIyMCUiIHdpZHRoPSIxMCUiIGhlaWdodD0iNjAlIj48L3JlY3Q+CiAgPHJlY3Qgc3R5bGU9ImZpbGw6ICM0NDQ7IiB4PSIyMCUiIHk9IjQ1JSIgd2lkdGg9IjYwJSIgaGVpZ2h0PSIxMCUiPjwvcmVjdD4KPC9zdmc+);\n --image-checkerboard: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjNDA0MDQwOyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSI+PC9yZWN0PgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjODA4MDgwOyIgeD0iMCIgeT0iMCIgd2lkdGg9IjUwJSIgaGVpZ2h0PSI1MCUiPjwvcmVjdD4KICA8cmVjdCBzdHlsZT0iZmlsbDogIzgwODA4MDsiIHg9IjUwJSIgeT0iNTAlIiB3aWR0aD0iNTAlIiBoZWlnaHQ9IjUwJSI+PC9yZWN0Pgo8L3N2Zz4=);\n\n --range-left-color: var(--value-color);\n --range-right-color: var(--value-bg-color); \n --range-right-hover-color: var(--hover-bg-color);\n --button-image: \n linear-gradient(\n rgba(255, 255, 255, 1), rgba(0, 0, 0, 0.2)\n );\n\n color: var(--color);\n background-color: var(--bg-color);\n}\n\n@media (prefers-color-scheme: dark) {\n .muigui {\n --bg-color: #222222;\n --color: #dddddd;\n --contrast-color: #000;\n --value-color: #43e5f7;\n --value-bg-color: #444444;\n --disabled-color: #666666;\n --menu-bg-color: #080808;\n --menu-sep-color: #444444;\n --hover-bg-color: #666666;\n --focus-color: #458; /*#88AAFF*/;\n --range-color: #888888;\n --invalid-color: #FF6666;\n --selected-color: rgba(255, 255, 255, 0.3);\n\n --button-bg-color: var(--value-bg-color);\n\n --range-left-color: var(--value-color);\n --range-right-color: var(--value-bg-color); \n --range-right-hover-color: var(--hover-bg-color);\n --button-image: linear-gradient(\n rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.4)\n );\n\n color: var(--color);\n background-color: var(--bg-color);\n\n --image-closed: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjREREOyIgeD0iMjAlIiB5PSI0NSUiIHdpZHRoPSI2MCUiIGhlaWdodD0iMTAlIj48L3JlY3Q+Cjwvc3ZnPg==);\n --image-open: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjREREOyIgeD0iNDUlIiB5PSIyMCUiIHdpZHRoPSIxMCUiIGhlaWdodD0iNjAlIj48L3JlY3Q+CiAgPHJlY3Qgc3R5bGU9ImZpbGw6ICNEREQ7IiB4PSIyMCUiIHk9IjQ1JSIgd2lkdGg9IjYwJSIgaGVpZ2h0PSIxMCUiPjwvcmVjdD4KPC9zdmc+);\n }\n}\n\n.muigui {\n --width: 250px;\n --label-width: 45%;\n --number-width: 40%;\n\n --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;\n --font-size: 11px;\n --font-family-mono: Menlo, Monaco, Consolas, "Droid Sans Mono", monospace;\n --font-size-mono: 11px;\n\n --line-height: 1.7em;\n --border-radius: 0px;\n\n width: var(--width);\n font-family: var(--font-family);\n font-size: var(--font-size);\n box-sizing: border-box;\n line-height: 100%;\n}\n.muigui * {\n box-sizing: inherit;\n}\n\n.muigui-no-scroll {\n touch-action: none;\n}\n.muigui-no-h-scroll {\n touch-action: pan-y;\n}\n.muigui-no-v-scroll {\n touch-action: pan-x;\n}\n\n.muigui-invalid-value {\n background-color: red !important;\n color: white !important;\n}\n\n.muigui-grid {\n display: grid;\n}\n.muigui-rows {\n display: flex;\n flex-direction: column;\n\n min-height: 20px;\n border: 2px solid red;\n}\n.muigui-columns {\n display: flex;\n flex-direction: row;\n\n height: 20px;\n border: 2px solid green;\n}\n.muigui-rows>*,\n.muigui-columns>* {\n flex: 1 1 auto;\n align-items: stretch;\n min-height: 0;\n min-width: 0;\n}\n\n.muigui-row {\n border: 2px solid yellow;\n min-height: 10px\n}\n.muigui-column {\n border: 2px solid lightgreen;\n}\n\n/* -------- */\n\n.muigui-show { /* */ }\n.muigui-hide { \n display: none !important;\n}\n.muigui-disabled {\n pointer-events: none;\n --color: var(--disabled-color) !important;\n --value-color: var(--disabled-color) !important;\n --range-left-color: var(--disabled-color) !important;\n}\n\n.muigui canvas,\n.muigui svg {\n display: block;\n border-radius: var(--border-radius);\n}\n.muigui canvas {\n background-color: var(--value-bg-color);\n}\n\n.muigui-controller {\n min-width: 0;\n min-height: var(--line-height);\n}\n.muigui-root {\n z-index: 1;\n}\n.muigui-root,\n.muigui-menu {\n display: flex;\n flex-direction: column;\n position: relative;\n user-select: none;\n height: fit-content;\n margin: 0;\n padding-bottom: 0.1em;\n border-radius: var(--border-radius);\n}\n.muigui-menu {\n border-bottom: 1px solid var(--menu-sep-color);\n}\n\n.muigui-root>button:nth-child(1),\n.muigui-menu>button:nth-child(1) {\n border-top: 1px solid var(--menu-sep-color);\n border-bottom: 1px solid var(--menu-sep-color);\n position: relative;\n text-align: left;\n color: var(--color);\n background-color: var(--menu-bg-color);\n min-height: var(--line-height);\n padding: 0.2em;\n cursor: pointer;\n border-radius: var(--border-radius);\n}\n.muigui-root>div:nth-child(2),\n.muigui-menu>div:nth-child(2) {\n flex: 1 1 auto;\n}\n\n.muigui-controller {\n margin-left: 0.2em;\n margin-right: 0.2em;\n}\n.muigui-root.muigui-controller,\n.muigui-menu.muigui-controller {\n margin-left: 0;\n margin-right: 0;\n}\n.muigui-controller>*:nth-child(1) {\n flex: 1 0 var(--label-width);\n min-width: 0;\n /* white-space: pre; why?? */\n}\n.muigui-controller>label:nth-child(1) {\n place-content: center start;\n display: inline-grid;\n overflow: hidden;\n}\n.muigui-controller>*:nth-child(2) {\n flex: 1 1 75%;\n min-width: 0;\n}\n\n/* -----------------------------------------\n a label controller is [[label][value]]\n*/\n\n.muigui-label-controller {\n display: flex;\n margin: 0.4em 0 0.4em 0;\n word-wrap: initial;\n align-items: stretch;\n}\n\n.muigui-value {\n display: flex;\n align-items: stretch;\n}\n.muigui-value>* {\n flex: 1 1 auto;\n min-width: 0;\n}\n.muigui-value>*:nth-child(1) {\n flex: 1 1 calc(100% - var(--number-width));\n}\n.muigui-value>*:nth-child(2) {\n flex: 1 1 var(--number-width);\n margin-left: 0.2em;\n}\n\n/* fix! */\n.muigui-open>button>label::before,\n.muigui-closed>button>label::before {\n content: "X";\n color: rgba(0, 0, 0, 0);\n background-color: var(--range-color);\n border-radius: 0.2em;\n width: 1.25em;\n margin-right: 0.25em;\n height: 1.25em; /*var(--line-height);*/\n display: inline-grid;\n place-content: center start;\n pointer-events: none;\n}\n.muigui-open>button>label::before {\n background-image: var(--image-open);\n}\n.muigui-closed>button>label::before {\n background-image: var(--image-closed);\n}\n\n.muigui-open>.muigui-open-container {\n transition: all 0.1s ease-out;\n overflow: auto;\n height: 100%;\n}\n.muigui-closed>.muigui-open-container {\n transition: all 0.1s ease-out;\n overflow: hidden;\n min-height: 0;\n}\n.muigui-open>.muigui-open-container>* {\n transition: all 0.1s ease-out;\n margin-top: 0px;\n}\n.muigui-closed>.muigui-open-container>* {\n transition: all 0.1s ease-out;\n margin-top: -100%;\n}\n\n/* ---- popdown ---- */\n\n.muigui-pop-down-top {\n display: flex;\n}\n/* fix? */\n.muigui-value>*:nth-child(1).muigui-pop-down-top {\n flex: 0;\n}\n.muigui-closed .muigui-pop-down-bottom {\n max-height: 0;\n}\n\n.muigui-value .muigui-pop-down-bottom {\n margin: 0;\n}\n\n.muigui-pop-down-values {\n min-width: 0;\n display: flex;\n}\n.muigui-pop-down-values>* {\n flex: 1 1 auto;\n min-width: 0;\n}\n\n.muigui-value.muigui-pop-down-controller {\n flex-direction: column;\n}\n\n.muigui-pop-down-top input[type=checkbox] {\n -webkit-appearance: none;\n appearance: none;\n width: auto;\n color: var(--value-color);\n background-color: var(--value-bg-color);\n background-image: var(--image-checkerboard);\n background-size: 10px 10px;\n background-position: 0 0, 0 5px, 5px -5px, -5px 0px;\n\n cursor: pointer;\n\n display: grid;\n place-content: center;\n margin: 0;\n font: inherit;\n color: currentColor;\n width: 1.7em;\n height: 1.7em;\n transform: translateY(-0.075em);\n}\n\n.muigui-pop-down-top input[type=checkbox]::before {\n content: "+";\n display: grid;\n place-content: center;\n border-radius: calc(var(--border-radius) + 2px);\n border-left: 1px solid rgba(255,255,255,0.3);\n border-top: 1px solid rgba(255,255,255,0.3);\n border-bottom: 1px solid rgba(0,0,0,0.2);\n border-right: 1px solid rgba(0,0,0,0.2);\n background-color: var(--range-color);\n color: var(--value-bg-color);\n width: calc(var(--line-height) - 4px);\n height: calc(var(--line-height) - 4px);\n}\n\n.muigui-pop-down-top input[type=checkbox]:checked::before {\n content: "X";\n}\n\n\n/* ---- select ---- */\n\n.muigui select,\n.muigui option,\n.muigui input,\n.muigui button {\n color: var(--value-color);\n background-color: var(--value-bg-color);\n font-family: var(--font-family);\n font-size: var(--font-size);\n border: none;\n margin: 0;\n border-radius: var(--border-radius);\n}\n.muigui select {\n appearance: none;\n margin: 0;\n margin-left: 0; /*?*/\n overflow: hidden; /* Safari */\n}\n\n.muigui select:focus,\n.muigui input:focus,\n.muigui button:focus {\n outline: 1px solid var(--focus-color);\n}\n\n.muigui select:hover,\n.muigui option:hover,\n.muigui input:hover,\n.muigui button:hover {\n background-color: var(--hover-bg-color); \n}\n\n/* ------ [ label ] ------ */\n\n.muigui-label {\n border-top: 1px solid var(--menu-sep-color);\n border-bottom: 1px solid var(--menu-sep-color);\n padding-top: 0.4em;\n padding-bottom: 0.3em;\n place-content: center start;\n background-color: var(--menu-bg-color);\n white-space: pre;\n border-radius: var(--border-radius);\n}\n\n/* ------ [ divider] ------ */\n\n.muigui-divider {\n min-height: 6px;\n border-top: 2px solid var(--menu-sep-color);\n margin-top: 6px;\n}\n\n/* ------ [ button ] ------ */\n\n.muigui-button {\n display: grid;\n padding: 2px 0 2px 0;\n}\n.muigui-button button {\n border: none;\n color: var(--value-color);\n background-color: var(--button-bg-color);\n background-image: var(--button-image);\n cursor: pointer;\n place-content: center center;\n height: var(--line-height);\n}\n\n/* ------ [ color ] ------ */\n\n.muigui-color>div {\n overflow: hidden;\n position: relative;\n margin-left: 0;\n margin-right: 0; /* why? */\n max-width: var(--line-height);\n border-radius: var(--border-radius);\n}\n\n.muigui-color>div:focus-within {\n outline: 1px solid var(--focus-color);\n}\n\n.muigui-color input[type=color] {\n border: none;\n padding: 0;\n background: inherit;\n cursor: pointer;\n position: absolute;\n width: 200%;\n left: -10px;\n top: -10px;\n height: 200%;\n}\n.muigui-disabled canvas,\n.muigui-disabled svg,\n.muigui-disabled img,\n.muigui-disabled .muigui-color input[type=color] {\n opacity: 0.2;\n}\n\n/* ------ [ checkbox ] ------ */\n\n.muigui-checkbox>label:nth-child(2) {\n display: grid;\n place-content: center start;\n margin: 0;\n}\n\n.muigui-checkbox input[type=checkbox] {\n -webkit-appearance: none;\n appearance: none;\n width: auto;\n color: var(--value-color);\n background-color: var(--value-bg-color);\n cursor: pointer;\n\n display: grid;\n place-content: center;\n margin: 0;\n font: inherit;\n color: currentColor;\n width: 1.7em;\n height: 1.7em;\n transform: translateY(-0.075em);\n}\n\n.muigui-checkbox input[type=checkbox]::before {\n content: "";\n color: var(--value-color);\n display: grid;\n place-content: center;\n}\n\n.muigui-checkbox input[type=checkbox]:checked::before {\n content: "✔";\n}\n\n.muigui input[type=number]::-webkit-inner-spin-button, \n.muigui input[type=number]::-webkit-outer-spin-button { \n -webkit-appearance: none;\n appearance: none;\n margin: 0; \n}\n.muigui input[type=number] {\n -moz-appearance: textfield;\n}\n\n/* ------ [ radio grid ] ------ */\n\n.muigui-radio-grid>div {\n display: grid;\n gap: 2px;\n}\n\n.muigui-radio-grid input {\n appearance: none;\n display: none;\n}\n\n.muigui-radio-grid button {\n color: var(--color);\n width: 100%;\n text-align: left;\n}\n\n.muigui-radio-grid input:checked + button {\n color: var(--value-color);\n background-color: var(--selected-color);\n}\n\n/* ------ [ color-chooser ] ------ */\n\n.muigui-color-chooser-cursor {\n stroke-width: 1px;\n stroke: white;\n fill: none;\n}\n.muigui-color-chooser-circle {\n stroke-width: 1px;\n stroke: white;\n fill: none;\n}\n\n\n/* ------ [ vec2 ] ------ */\n\n.muigui-vec2 svg {\n background-color: var(--value-bg-color);\n}\n\n.muigui-vec2-axis {\n stroke: 1px;\n stroke: var(--focus-color);\n}\n\n.muigui-vec2-line {\n stroke-width: 1px;\n stroke: var(--value-color);\n fill: var(--value-color);\n}\n\n/* ------ [ direction ] ------ */\n\n.muigui-direction svg {\n background-color: rgba(0,0,0,0.2);\n}\n\n.muigui-direction:focus-within svg {\n outline: none;\n}\n.muigui-direction-range {\n fill: var(--value-bg-color);\n}\n.muigui-direction svg:focus {\n outline: none;\n}\n.muigui-direction svg:focus .muigui-direction-range {\n stroke-width: 0.5px;\n stroke: var(--focus-color);\n}\n\n.muigui-direction-arrow {\n fill: var(--value-color);\n}\n\n/* ------ [ slider ] ------ */\n\n.muigui-slider>div {\n display: flex;\n align-items: stretch;\n height: var(--line-height);\n}\n.muigui-slider svg {\n flex: 1 1 auto;\n}\n.muigui-slider .muigui-slider-up #muigui-orientation {\n transform: scale(1, -1) translateY(-100%);\n}\n\n.muigui-slider .muigui-slider-up #muigui-number-orientation {\n transform: scale(1,-1);\n}\n\n.muigui-ticks {\n stroke: var(--range-color);\n}\n.muigui-thicks {\n stroke: var(--color);\n stroke-width: 2px;\n}\n.muigui-svg-text {\n fill: var(--color);\n font-size: 7px;\n}\n.muigui-mark {\n fill: var(--value-color);\n}\n\n/* ------ [ range ] ------ */\n\n\n.muigui-range input[type=range] {\n -webkit-appearance: none;\n appearance: none;\n background-color: transparent;\n}\n\n.muigui-range input[type=range]::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n border-radius: calc(var(--border-radius) + 2px);\n border-left: 1px solid rgba(255,255,255,0.3);\n border-top: 1px solid rgba(255,255,255,0.3);\n border-bottom: 1px solid rgba(0,0,0,0.2);\n border-right: 1px solid rgba(0,0,0,0.2);\n background-color: var(--range-color);\n margin-top: calc((var(--line-height) - 6px) / -2);\n width: calc(var(--line-height) - 6px);\n height: calc(var(--line-height) - 6px);\n}\n\n.muigui-range input[type=range]::-webkit-slider-runnable-track {\n -webkit-appearance: none;\n appearance: none;\n border: 1px solid var(--menu-sep-color);\n height: 2px;\n}\n\n\n/* dat.gui style - doesn\'t work on Safari iOS */\n\n/*\n.muigui-range input[type=range] {\n cursor: ew-resize;\n overflow: hidden;\n}\n\n.muigui-range input[type=range] {\n -webkit-appearance: none;\n appearance: none;\n background-color: var(--range-right-color);\n margin: 0;\n}\n.muigui-range input[type=range]:hover {\n background-color: var(--range-right-hover-color);\n}\n\n.muigui-range input[type=range]::-webkit-slider-runnable-track {\n -webkit-appearance: none;\n appearance: none;\n height: max-content;\n color: var(--range-left-color);\n margin-top: -1px;\n}\n\n.muigui-range input[type=range]::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 0px;\n height: max-content;\n box-shadow: -1000px 0 0 1000px var(--range-left-color);\n}\n*/\n\n/* FF */\n/*\n.muigui-range input[type=range]::-moz-slider-progress {\n background-color: var(--range-left-color); \n}\n.muigui-range input[type=range]::-moz-slider-thumb {\n height: max-content;\n width: 0;\n border: none;\n box-shadow: -1000px 0 0 1000px var(--range-left-color);\n box-sizing: border-box;\n}\n*/\n\n.muigui-checkered-background {\n background-color: #404040;\n background-image:\n linear-gradient(45deg, #808080 25%, transparent 25%),\n linear-gradient(-45deg, #808080 25%, transparent 25%),\n linear-gradient(45deg, transparent 75%, #808080 75%),\n linear-gradient(-45deg, transparent 75%, #808080 75%);\n background-size: 16px 16px;\n background-position: 0 0, 0 8px, 8px -8px, -8px 0px;\n}\n\n/* ---------------------------------------------------------- */\n\n/* needs to be at bottom to take precedence */\n.muigui-auto-place {\n max-height: 100%;\n position: fixed;\n top: 0;\n right: 15px;\n z-index: 100001;\n}\n\n',themes:{default:{include:["default"],css:"\n "},float:{include:["default"],css:"\n :root {\n color-scheme: light dark,\n }\n\n .muigui {\n --width: 400px;\n --bg-color: initial;\n --label-width: 25%;\n --number-width: 20%;\n }\n\n input,\n .muigui-label-controller>label {\n text-shadow:\n -1px -1px 0 var(--contrast-color),\n 1px -1px 0 var(--contrast-color),\n -1px 1px 0 var(--contrast-color),\n 1px 1px 0 var(--contrast-color);\n }\n\n .muigui-controller > label:nth-child(1) {\n place-content: center end;\n margin-right: 1em;\n }\n\n .muigui-value > :nth-child(2) {\n margin-left: 1em;\n }\n\n .muigui-root>*:nth-child(1) {\n display: none;\n }\n\n .muigui-range input[type=range]::-webkit-slider-thumb {\n border-radius: 1em;\n }\n\n .muigui-range input[type=range]::-webkit-slider-runnable-track {\n -webkit-appearance: initial;\n appearance: none;\n border: 1px solid rgba(0, 0, 0, 0.25);\n height: 2px;\n }\n\n .muigui-colors {\n --value-color: var(--color );\n --value-bg-color: rgba(0, 0, 0, 0.1);\n --disabled-color: #cccccc;\n --menu-bg-color: rgba(0, 0, 0, 0.1);\n --menu-sep-color: #bbbbbb;\n --hover-bg-color: rgba(0, 0, 0, 0);\n --invalid-color: #FF0000;\n --selected-color: rgba(0, 0, 0, 0.3);\n --range-color: rgba(0, 0, 0, 0.125);\n }\n"},form:{include:[],css:"\n .muigui {\n --width: 100%;\n --label-width: 45%;\n --number-width: 40%;\n }\n .muigui-root>button {\n display: none;\n }\n .muigui-controller {\n margin-top: 1em;\n }\n .muigui-label-controller {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n margin-top: 1em;\n }\n .muigui-label-controller:has(.muigui-checkbox) {\n flex-direction: row;\n }\n .muigui-value {\n display: flex;\n align-items: stretch;\n }\n .muigui-value>* {\n flex: 1 1 auto;\n min-width: 0;\n }\n .muigui-controller>*:nth-child(1) {\n flex: 1 0 var(--label-width);\n min-width: 0;\n white-space: pre;\n }\n .muigui-controller>label:nth-child(1) {\n place-content: center start;\n display: inline-grid;\n overflow: hidden;\n }\n .muigui-controller>*:nth-child(2) {\n flex: 1 1 75%;\n min-width: 0;\n }\n "},none:{include:[],css:""}}};function e(t,e={},n=[]){const i=document.createElement(t);return function(t,e,n){for(const[n,i]of Object.entries(e))if("function"==typeof i&&n.startsWith("on")){const e=n.substring(2).toLowerCase();t.addEventListener(e,i,{passive:!1})}else if("object"==typeof i)for(const[e,o]of Object.entries(i))t[n][e]=o;else void 0===t[n]?t.setAttribute(n,i):t[n]=i;for(const e of n)t.appendChild(e)}(i,e,n),i}let n=0;function i(t,e){const n=t.indexOf(e);return n&&t.splice(n,1),t}function o(t,e,n){return Math.max(e,Math.min(n,t))}const r="undefined"!=typeof SharedArrayBuffer?function(t){return t&&t.buffer&&(t.buffer instanceof ArrayBuffer||t.buffer instanceof SharedArrayBuffer)}:function(t){return t&&t.buffer&&t.buffer instanceof ArrayBuffer},s=(t,e,n)=>Math.round(e(t)/n)/(1/n),a=(t,e)=>(t%e+e)%e;function l(t,e){for(const n in e)n in t&&(t[n]=e[n]);return t}const u=(t,e,n,i,o)=>(t-e)*(o-i)/(n-e)+i,c=({from:t,to:e})=>({to:n=>u(n,...t,...e),from:n=>[!0,u(n,...e,...t)]}),h=({from:t,to:e,step:n})=>({min:e[0],max:e[1],...n&&{step:n},converters:c({from:t,to:e})}),d={to:t=>t,from:t=>[!0,t]};function m(t,e,n,i,o){const{converters:{from:r}=d}=o,{min:s,max:a}=o,l=o.minRange||0,u=r(l)[1],c=t.add(e,n,{...o,min:s,max:a-l}).onChange((t=>{h.setValue(Math.min(a,Math.max(t+u,e[i])))})),h=t.add(e,i,{...o,min:s+l,max:a}).onChange((t=>{c.setValue(Math.max(s,Math.min(t-u,e[n])))}));return[c,h]}class p{domElement;#t;#e=[];constructor(t){this.domElement=t,this.#t=t}addElem(t){return this.#t.appendChild(t),t}removeElem(t){return this.#t.removeChild(t),t}pushSubElem(t){this.#t.appendChild(t),this.#t=t}popSubElem(){this.#t=this.#t.parentElement}add(t){return this.#e.push(t),this.addElem(t.domElement),t}remove(t){return this.removeElem(t.domElement),i(this.#e,t),t}pushSubView(t){this.pushSubElem(t.domElement)}popSubView(){this.popSubElem()}setOptions(t){for(const e of this.#e)e.setOptions(t)}updateDisplayIfNeeded(t,e){for(const n of this.#e)n.updateDisplayIfNeeded(t,e);return this}$(t){return this.domElement.querySelector(t)}}class g extends p{#n;#i;#o;constructor(t){super(e("div",{className:"muigui-controller"})),this.#n=[],this.#i=[],t&&this.domElement.classList.add(t)}get parent(){return this.#o}setParent(t){this.#o=t,this.enable(!this.disabled())}show(t=!0){return this.domElement.classList.toggle("muigui-hide",!t),this.domElement.classList.toggle("muigui-show",t),this}hide(){return this.show(!1)}disabled(){return!!this.domElement.closest(".muigui-disabled")}enable(t=!0){return this.domElement.classList.toggle("muigui-disabled",!t),["input","button","select","textarea"].forEach((t=>{this.domElement.querySelectorAll(t).forEach((t=>{const e=!!t.closest(".muigui-disabled");t.disabled=e}))})),this}disable(t=!0){return this.enable(!t)}onChange(t){return this.removeChange(t),this.#n.push(t),this}removeChange(t){return i(this.#n,t),this}onFinishChange(t){return this.removeFinishChange(t),this.#i.push(t),this}removeFinishChange(t){return i(this.#i,t),this}#r(t,e){for(const n of t)n.call(this,e)}emitChange(t,e,n){this.#r(this.#n,t),this.#o&&(void 0===e?this.#o.emitChange(t):this.#o.emitChange({object:e,property:n,value:t,controller:this}))}emitFinalChange(t,e,n){this.#r(this.#i,t),this.#o&&(void 0===e?this.#o.emitChange(t):this.#o.emitFinalChange({object:e,property:n,value:t,controller:this}))}updateDisplay(){}getColors(){const t=t=>t.replace(/-([a-z])/g,((t,e)=>e.toUpperCase())),n=e("div");this.domElement.appendChild(n);const i=Object.fromEntries(["color","bg-color","value-color","value-bg-color","hover-bg-color","menu-bg-color","menu-sep-color","disabled-color"].map((e=>{n.style.color=`var(--${e})`;const i=getComputedStyle(n);return[t(e),i.color]})));return n.remove(),i}}class b extends g{#s;#a;#l;#u={name:""};constructor(t,n,i={}){super("muigui-button",""),this.#s=t,this.#a=n,this.#l=this.addElem(e("button",{type:"button",onClick:()=>{this.#s[this.#a](this)}})),this.setOptions({name:n,...i})}name(t){this.#l.textContent=t}setOptions(t){l(this.#u,t);const{name:e}=this.#u;this.#l.textContent=e}}function f(t,e){if(t.length!==e.length)return!1;for(let n=0;n{t.setValue(i.checked)},onChange:()=>{t.setFinalValue(i.checked)}});super(e("label",{},[i])),this.#f=i}updateDisplay(t){this.#f.checked=t}}const w=[],y=new Set;let k,E;function I(){k=void 0,E=!0;for(const t of w)y.has(t)||t();E=!1,y.size&&(E?$():(y.forEach((t=>{i(w,t)})),y.clear())),$()}function $(){!k&&w.length&&(k=requestAnimationFrame(I))}let C=0;function M(){return"muigui-"+ ++C}class S extends p{constructor(t=""){super(e("div",{className:"muigui-value"})),t&&this.domElement.classList.add(t)}}class V extends g{#v;#x;constructor(t="",n=""){super("muigui-label-controller"),this.#v=M(),this.#x=e("label",{for:this.#v}),this.domElement.appendChild(this.#x),this.pushSubView(new S(t)),this.name(n)}get id(){return this.#v}name(t){return this.#x.title===this.#x.textContent&&(this.#x.title=t),this.#x.textContent=t,this}tooltip(t){this.#x.title=t}}class D extends V{#s;#a;#w;#y;#e;#k;constructor(t,e,n=""){super(n,e),this.#s=t,this.#a=e,this.#w=this.getValue(),this.#y=!1,this.#e=[]}get initialValue(){return this.#w}get object(){return this.#s}get property(){return this.#a}add(t){return this.#e.push(t),super.add(t),this.updateDisplay(),t}#E(t,e){let n=!1;if("object"==typeof t){const e=this.#s[this.#a];if(Array.isArray(t)||r(t))for(let i=0;i=0&&w.splice(e,1)}(this.#k)),this}}class N extends D{constructor(t,e){super(t,e,"muigui-checkbox");const n=this.id;this.add(new x(this,n)),this.updateDisplay()}}const A={to:t=>t,from:t=>[!0,t]},j={to:t=>t.toString(),from:t=>{const e=parseFloat(t);return[!Number.isNaN(e),e]}},U={radToDeg:c({to:[0,180],from:[0,Math.PI]})};function L(){let t=0;return function(e,n,i=5){t-=e.deltaY*n/i;const o=Math.floor(Math.abs(t)/n)*Math.sign(t)*n;return t-=o,o}}class F extends v{#I;#$;#C;#M;#u={step:.01,converters:j,min:Number.NEGATIVE_INFINITY,max:Number.POSITIVE_INFINITY};constructor(t,n){const i=t.setValue.bind(t),r=t.setFinalValue.bind(t),a=L();super(e("input",{type:"number",onInput:()=>{this.#S(i,!0)},onChange:()=>{this.#S(r,!1)},onWheel:e=>{e.preventDefault();const{min:n,max:i,step:r}=this.#u,l=a(e,r),u=parseFloat(this.domElement.value),c=o(s(u+l,(t=>t),r),n,i),[h,d]=this.#$(c);h&&t.setValue(d)}})),this.setOptions(n)}#S(t,e){const n=parseFloat(this.domElement.value),[i,r]=this.#$(n);let s;if(i&&!Number.isNaN(n)){const{min:n,max:i}=this.#u;s=r>=n&&r<=i,this.#M=e,t(o(r,n,i))}this.domElement.classList.toggle("muigui-invalid-value",!i||!s)}updateDisplay(t){this.#M||(this.domElement.value=s(t,this.#I,this.#C)),this.#M=!1}setOptions(t){l(this.#u,t);const{step:e,converters:{to:n,from:i}}=this.#u;return this.#I=n,this.#$=i,this.#C=e,this}}class P extends D{#V;#C;constructor(t,e,n={}){super(t,e,"muigui-text-number"),this.#V=this.add(new F(this,n)),this.updateDisplay()}}class O extends v{#D;constructor(t,n){const i=[];super(e("select",{onChange:()=>{t.setFinalValue(this.#D[this.domElement.selectedIndex])}},n.map((([t,n])=>(i.push(n),e("option",{textContent:t})))))),this.#D=i}updateDisplay(t){const e=this.#D.indexOf(t);this.domElement.selectedIndex=e}}function H(t,e){return Array.isArray(t)?Array.isArray(t[0])?t:e?t.map(((t,e)=>[t,e])):t.map((t=>[t,t])):[...Object.entries(t)]}class z extends D{constructor(t,e,n){super(t,e,"muigui-select");const i="number"==typeof this.getValue(),{keyValues:o}=n,r=H(o,i);this.add(new O(this,r)),this.updateDisplay()}}class T extends v{#I;#$;#C;#M;#u={step:.01,min:0,max:1,converters:A};constructor(t,n){const i=L();super(e("input",{type:"range",onInput:()=>{this.#M=!0;const{min:e,max:n,step:i}=this.#u,r=parseFloat(this.domElement.value),a=o(s(r,(t=>t),i),e,n),[l,u]=this.#$(a);l&&t.setValue(u)},onChange:()=>{this.#M=!0;const{min:e,max:n,step:i}=this.#u,r=parseFloat(this.domElement.value),a=o(s(r,(t=>t),i),e,n),[l,u]=this.#$(a);l&&t.setFinalValue(u)},onWheel:e=>{e.preventDefault();const[n,r]=this.#$(parseFloat(this.domElement.value));if(!n)return;const{min:a,max:l,step:u}=this.#u,c=i(e,u),h=o(s(r+c,(t=>t),u),a,l);t.setValue(h)}})),this.setOptions(n)}updateDisplay(t){this.#M||(this.domElement.value=s(t,this.#I,this.#C)),this.#M=!1}setOptions(t){l(this.#u,t);const{step:e,min:n,max:i,converters:{to:o,from:r}}=this.#u;return this.#I=o,this.#$=r,this.#C=e,this.domElement.step=e,this.domElement.min=n,this.domElement.max=i,this}}class W extends D{constructor(t,e,n){super(t,e,"muigui-range"),this.add(new T(this,n)),this.add(new F(this,n))}}class B extends v{#I;#$;#M;#u={converters:A};constructor(t,n){const i=t.setValue.bind(t),o=t.setFinalValue.bind(t);super(e("input",{type:"text",onInput:()=>{this.#S(i,!0)},onChange:()=>{this.#S(o,!1)}})),this.setOptions(n)}#S(t,e){const[n,i]=this.#$(this.domElement.value);n&&(this.#M=e,t(i)),this.domElement.style.color=n?"":"var(--invalid-color)"}updateDisplay(t){this.#M||(this.domElement.value=this.#I(t),this.domElement.style.color=""),this.#M=!1}setOptions(t){l(this.#u,t);const{converters:{to:e,from:n}}=this.#u;return this.#I=e,this.#$=n,this}}class G extends D{constructor(t,e){super(t,e,"muigui-text"),this.add(new B(this)),this.updateDisplay()}}const R=(t,e,n)=>Math.max(e,Math.min(n,t)),Z=(t,e,n)=>t+(e-t)*n,J=t=>t>=0?t%1:1-t%1,Y=t=>+t.toFixed(0),Q=t=>+t.toFixed(3),K=t=>parseInt(t.substring(1,3),16)<<16|parseInt(t.substring(3,5),16)<<8|parseInt(t.substring(5,7),16),_=t=>parseInt(t.substring(1,3),16)*2**24+65536*parseInt(t.substring(3,5),16)+256*parseInt(t.substring(5,7),16)+parseInt(t.substring(7,9),16),q=t=>[parseInt(t.substring(1,3),16),parseInt(t.substring(3,5),16),parseInt(t.substring(5,7),16)],X=t=>`#${Array.from(t).map((t=>t.toString(16).padStart(2,"0"))).join("")}`,tt=t=>[parseInt(t.substring(1,3),16),parseInt(t.substring(3,5),16),parseInt(t.substring(5,7),16),parseInt(t.substring(7,9),16)],et=t=>`#${Array.from(t).map((t=>t.toString(16).padStart(2,"0"))).join("")}`,nt=t=>q(t).map((t=>Q(t/255))),it=t=>X(Array.from(t).map((t=>Math.round(R(255*t,0,255))))),ot=t=>tt(t).map((t=>Q(t/255))),rt=t=>et(Array.from(t).map((t=>Math.round(R(255*t,0,255))))),st=t=>R(Math.round(255*t),0,255).toString(16).padStart(2,"0"),at=t=>({r:parseInt(t.substring(1,3),16)/255,g:parseInt(t.substring(3,5),16)/255,b:parseInt(t.substring(5,7),16)/255}),lt=t=>({r:parseInt(t.substring(1,3),16)/255,g:parseInt(t.substring(3,5),16)/255,b:parseInt(t.substring(5,7),16)/255,a:parseInt(t.substring(7,9),16)/255}),ut=t=>`rgb(${q(t).join(", ")})`,ct=/^\s*rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)\s*$/,ht=t=>`rgba(${tt(t).map(((t,e)=>3===e?t/255:t)).join(", ")})`,dt=/^\s*rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+\.\d+|\d+)\s*\)\s*$/,mt=t=>{const e=yt(q(t)).map((t=>Y(t)));return`hsl(${e[0]}, ${e[1]}%, ${e[2]}%)`},pt=t=>{const e=kt(tt(t)).map(((t,e)=>3===e?Q(t):Y(t)));return`hsl(${e[0]} ${e[1]}% ${e[2]}% / ${e[3]})`},gt=/^\s*hsl\(\s*(\d+)(?:deg|)\s*(?:,|)\s*(\d+)%\s*(?:,|)\s*(\d+)%\s*\)\s*$/,bt=/^\s*hsl\(\s*(\d+)(?:deg|)\s*(?:,|)\s*(\d+)%\s*(?:,|)\s*(\d+)%\s*\/\s*(\d+\.\d+|\d+)\s*\)\s*$/,ft=(t,e)=>(t%e+e)%e;function vt([t,e,n]){t=ft(t,360),e=R(e/100,0,1),n=R(n/100,0,1);const i=e*Math.min(n,1-n);function o(e){const o=(e+t/30)%12;return n-i*Math.max(-1,Math.min(o-3,9-o,1))}return[o(0),o(8),o(4)].map((t=>Math.round(255*t)))}function xt([t,e,n]){const i=Math.max(t,e,n),o=Math.min(t,e,n),r=.5*(o+i),s=i-o;let a=0,l=0;if(0!==s)switch(l=0===r||1===r?0:(i-r)/Math.min(r,1-r),i){case t:a=(e-n)/s+(e{const[e,n,i]=xt(t.map((t=>t/255)));return[360*e,100*n,100*i]},kt=t=>{const[e,n,i,o]=wt(t.map((t=>t/255)));return[360*e,100*n,100*i,o]};function Et([t,e,n]){return e=R(e,0,1),n=R(n,0,1),[t,t+2/3,t+1/3].map((t=>Z(1,R(Math.abs(6*J(t)-3)-1,0,1),e)*n))}function It([t,e,n,i]){return[...Et([t,e,n]),i]}const $t=t=>Math.round(1e3*t)/1e3;function Ct([t,e,n]){const i=n>e?[n,e,-1,2/3]:[e,n,0,-1/3],o=i[0]>t?[i[0],i[1],i[3],t]:[t,i[1],i[2],i[0]],r=o[0]-Math.min(o[3],o[1]);return[Math.abs(o[2]+(o[3]-o[1])/(6*r+Number.EPSILON)),r/(o[0]+Number.EPSILON),o[0]].map($t)}function Mt([t,e,n,i]){return[...Ct([t,e,n]),i]}const St=t=>t.endsWith("a")||t.startsWith("hex8"),Vt=[{re:/^#(?:[0-9a-f]){6}$/i,format:"hex6"},{re:/^(?:[0-9a-f]){6}$/i,format:"hex6-no-hash"},{re:/^#(?:[0-9a-f]){8}$/i,format:"hex8"},{re:/^(?:[0-9a-f]){8}$/i,format:"hex8-no-hash"},{re:/^#(?:[0-9a-f]){3}$/i,format:"hex3"},{re:/^(?:[0-9a-f]){3}$/i,format:"hex3-no-hash"},{re:ct,format:"css-rgb"},{re:gt,format:"css-hsl"},{re:dt,format:"css-rgba"},{re:bt,format:"css-hsla"}];function Dt(t){switch(typeof t){case"number":return console.warn('can not reliably guess format based on a number. You should pass in a format like {format: "uint32-rgb"} or {format: "uint32-rgb"}'),t<=16777215?"uint32-rgb":"uint32-rgba";case"string":{const e=function(t){for(const e of Vt)if(e.re.test(t))return e}(t.trim());if(e)return e.format;break}case"object":if(t instanceof Uint8Array||t instanceof Uint8ClampedArray){if(3===t.length)return"uint8-rgb";if(4===t.length)return"uint8-rgba"}else if(t instanceof Float32Array){if(3===t.length)return"float-rgb";if(4===t.length)return"float-rgba"}else if(Array.isArray(t)){if(3===t.length)return"float-rgb";if(4===t.length)return"float-rgba"}else if("r"in t&&"g"in t&&"b"in t)return"a"in t?"object-rgba":"object-rgb"}throw new Error(`unknown color format: ${t}`)}function Nt(t){return t.trim(t)}function At(t){return t.trim(t)}function jt(t){return t[1]===t[2]&&t[3]===t[4]&&t[5]===t[6]?`#${t[1]}${t[3]}${t[5]}`:t}const Ut=/^(#|)([0-9a-f]{3})$/i;function Lt(t){const e=Ut.exec(t);if(e){const[,,t]=e;return"#"+`${(n=t)[0]}${n[0]}${n[1]}${n[1]}${n[2]}${n[2]}`}var n;return t}function Ft(t){return jt(Nt(t))}const Pt=t=>{const e=ct.exec(t);if(!e)return[!1];const n=[e[1],e[2],e[3]].map((t=>parseInt(t)));return[!n.find((t=>t>255)),`rgb(${n.join(", ")})`]},Ot=t=>{const e=dt.exec(t);if(!e)return[!1];const n=[e[1],e[2],e[3],e[4]].map(((t,e)=>3===e?parseFloat(t):parseInt(t)));return[!n.find((t=>t>255)),`rgba(${n.join(", ")})`]},Ht=t=>{const e=gt.exec(t);if(!e)return[!1];const n=[e[1],e[2],e[3]].map((t=>parseFloat(t)));return[!n.find((t=>Number.isNaN(t))),`hsl(${n[0]}, ${n[1]}%, ${n[2]}%)`]},zt=t=>{const e=bt.exec(t);if(!e)return[!1];const n=[e[1],e[2],e[3],e[4]].map((t=>parseFloat(t)));return[!n.find((t=>Number.isNaN(t))),`hsl(${n[0]} ${n[1]}% ${n[2]}% / ${n[3]})`]},Tt=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*$/,Wt=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*$/,Bt=t=>{const e=t.split(",").map((t=>t.trim())),n=e.map((t=>parseFloat(t)));if(3!==n.length)return[!1];const i=e.findIndex((t=>isNaN(t)));return[i<0,n.map((t=>Q(t)))]},Gt=t=>{const e=t.split(",").map((t=>t.trim())),n=e.map((t=>parseFloat(t)));if(4!==n.length)return[!1];const i=e.findIndex((t=>isNaN(t)));return[i<0,n.map((t=>Q(t)))]},Rt=/^\s*(?:0x){0,1}([0-9a-z]{1,6})\s*$/i,Zt=/^\s*(?:0x){0,1}([0-9a-z]{1,8})\s*$/i,Jt=/^\s*#[a-f0-9]{6}\s*$|^\s*#[a-f0-9]{3}\s*$/i,Yt=/^\s*[a-f0-9]{6}\s*$/i,Qt=/^\s*#[a-f0-9]{8}\s*$/i,Kt=/^\s*[a-f0-9]{8}\s*$/i,_t={hex6:{color:{from:t=>[!0,t],to:Nt},text:{from:t=>[Jt.test(t),t.trim()],to:t=>t}},hex8:{color:{from:t=>[!0,t],to:At},text:{from:t=>[Qt.test(t),t.trim()],to:t=>t}},hex3:{color:{from:t=>[!0,Ft(t)],to:Lt},text:{from:t=>[Jt.test(t),jt(t.trim())],to:t=>t}},"hex6-no-hash":{color:{from:t=>[!0,t.substring(1)],to:t=>`#${Nt(t)}`},text:{from:t=>[Yt.test(t),t.trim()],to:t=>t}},"hex8-no-hash":{color:{from:t=>[!0,t.substring(1)],to:t=>`#${At(t)}`},text:{from:t=>[Kt.test(t),t.trim()],to:t=>t}},"hex3-no-hash":{color:{from:t=>[!0,Ft(t).substring(1)],to:Lt},text:{from:t=>[Yt.test(t),jt(t.trim())],to:t=>t}},"uint32-rgb":{color:{from:t=>[!0,K(t)],to:t=>`#${Math.round(t).toString(16).padStart(6,"0")}`},text:{from:t=>(t=>{const e=Rt.exec(t);return e?[!0,parseInt(e[1],16)]:[!1]})(t),to:t=>`0x${t.toString(16).padStart(6,"0")}`}},"uint32-rgba":{color:{from:t=>[!0,_(t)],to:t=>`#${Math.round(t).toString(16).padStart(8,"0")}`},text:{from:t=>(t=>{const e=Zt.exec(t);return e?[!0,parseInt(e[1],16)]:[!1]})(t),to:t=>`0x${t.toString(16).padStart(8,"0")}`}},"uint8-rgb":{color:{from:t=>[!0,q(t)],to:X},text:{from:t=>{const e=Tt.exec(t);if(!e)return[!1];const n=[e[1],e[2],e[3]].map((t=>parseInt(t)));return[!n.find((t=>t>255)),n]},to:t=>t.join(", ")}},"uint8-rgba":{color:{from:t=>[!0,tt(t)],to:et},text:{from:t=>{const e=Wt.exec(t);if(!e)return[!1];const n=[e[1],e[2],e[3],e[4]].map((t=>parseInt(t)));return[!n.find((t=>t>255)),n]},to:t=>t.join(", ")}},"float-rgb":{color:{from:t=>[!0,nt(t)],to:it},text:{from:Bt,to:t=>Array.from(t).map((t=>Q(t))).join(", ")}},"float-rgba":{color:{from:t=>[!0,ot(t)],to:rt},text:{from:Gt,to:t=>Array.from(t).map((t=>Q(t))).join(", ")}},"float-hsv":{color:{from:t=>[!0,Ct(nt(t))],to:t=>Et(it(t))},text:{from:Bt,to:t=>Array.from(t).map((t=>Q(t))).join(", ")}},"float-hsva":{color:{from:t=>[!0,Mt(nt(t))],to:t=>It(it(t))},text:{from:Gt,to:t=>Array.from(t).map((t=>Q(t))).join(", ")}},"object-rgb":{color:{from:t=>[!0,at(t)],to:t=>`#${st(t.r)}${st(t.g)}${st(t.b)}`},text:{from:t=>{try{const e=t.replace(/([a-z])/g,'"$1"'),n=JSON.parse(e);if(Number.isNaN(n.r)||Number.isNaN(n.g)||Number.isNaN(n.b))throw new Error("not {r, g, b}");return[!0,n]}catch(t){return[!1]}},to:t=>`{r:${Q(t.r)}, g:${Q(t.g)}, b:${Q(t.b)}}`}},"object-rgba":{color:{from:t=>[!0,lt(t)],to:t=>`#${st(t.r)}${st(t.g)}${st(t.b)}${st(t.a)}`},text:{from:t=>{try{const e=t.replace(/([a-z])/g,'"$1"'),n=JSON.parse(e);if(Number.isNaN(n.r)||Number.isNaN(n.g)||Number.isNaN(n.b)||Number.isNaN(n.a))throw new Error("not {r, g, b, a}");return[!0,n]}catch(t){return[!1]}},to:t=>`{r:${Q(t.r)}, g:${Q(t.g)}, b:${Q(t.b)}}, a:${Q(t.a)}}`}},"css-rgb":{color:{from:t=>[!0,ut(t)],to:t=>{const e=ct.exec(t);return X([e[1],e[2],e[3]].map((t=>parseInt(t))))}},text:{from:Pt,to:t=>Pt(t)[1]}},"css-rgba":{color:{from:t=>[!0,ht(t)],to:t=>{const e=dt.exec(t);return et([e[1],e[2],e[3],e[4]].map(((t,e)=>3===e?255*parseFloat(t)|0:parseInt(t))))}},text:{from:Ot,to:t=>Ot(t)[1]}},"css-hsl":{color:{from:t=>[!0,mt(t)],to:t=>{const e=gt.exec(t),n=vt([e[1],e[2],e[3]].map((t=>parseFloat(t))));return X(n)}},text:{from:Ht,to:t=>Ht(t)[1]}},"css-hsla":{color:{from:t=>[!0,pt(t)],to:t=>{const e=bt.exec(t),n=function([t,e,n,i]){return[...vt([t,e,n]),255*i|0]}([e[1],e[2],e[3],e[4]].map((t=>parseFloat(t))));return et(n)}},text:{from:zt,to:t=>zt(t)[1]}}};class qt extends p{constructor(t,n){super(e(t,{className:n}))}}class Xt extends V{#N;constructor(t){super("muigui-canvas",t),this.#N=this.add(new qt("canvas","muigui-canvas")).domElement}get canvas(){return this.#N}}class te extends v{#I;#$;#A;#M;#u={converters:A};constructor(t,n){const i=e("input",{type:"color",onInput:()=>{const[e,n]=this.#$(i.value);e&&(this.#M=!0,t.setValue(n))},onChange:()=>{const[e,n]=this.#$(i.value);e&&(this.#M=!0,t.setFinalValue(n))}});super(e("div",{},[i])),this.setOptions(n),this.#A=i}updateDisplay(t){this.#M||(this.#A.value=this.#I(t)),this.#M=!1}setOptions(t){l(this.#u,t);const{converters:{to:e,from:n}}=this.#u;return this.#I=e,this.#$=n,this}}class ee extends D{#j;#V;constructor(t,e,n={}){super(t,e,"muigui-color");const i=n.format||Dt(this.getValue()),{color:o,text:r}=_t[i];this.#j=this.add(new te(this,{converters:o})),this.#V=this.add(new B(this,{converters:r})),this.updateDisplay()}setOptions(t){const{format:e}=t;if(e){const{color:t,text:n}=_t[e];this.#j.setOptions({converters:t}),this.#V.setOptions({converters:n})}return super.setOptions(t),this}}class ne extends g{constructor(){super("muigui-divider")}}class ie extends g{#U;#L;constructor(t){super(t),this.#U=[],this.#L=this}get children(){return this.#U}get controllers(){return this.#U.filter((t=>!(t instanceof ie)))}get folders(){return this.#U.filter((t=>t instanceof ie))}reset(t=!0){for(const e of this.#U)e instanceof ie&&!t||e.reset(t);return this}updateDisplay(){for(const t of this.#U)t.updateDisplay();return this}remove(t){const e=this.#U.indexOf(t);if(e>=0){const t=this.#U.splice(e,1)[0];t.domElement.remove(),t.setParent(null)}return this}#F(t){return this.domElement.appendChild(t.domElement),this.#U.push(t),t.setParent(this),t}addController(t){return this.#L.#F(t)}pushContainer(t){return this.addController(t),this.#L=t,t}popContainer(){return this.#L=this.#L.parent,this}}class oe extends ie{#P;constructor(t="Controls",n="muigui-menu"){super(n),this.#P=e("label"),this.addElem(e("button",{type:"button",onClick:()=>this.toggleOpen()},[this.#P])),this.pushContainer(new ie("muigui-open-container")),this.pushContainer(new ie),this.name(t),this.open()}open(t=!0){return this.domElement.classList.toggle("muigui-closed",!t),this.domElement.classList.toggle("muigui-open",t),this}close(){return this.open(!1)}name(t){return this.#P.textContent=t,this}title(t){return this.name(t)}toggleOpen(){return this.open(!this.domElement.classList.contains("muigui-open")),this}}class re extends g{constructor(t){super("muigui-label"),this.text(t)}text(t){return this.domElement.textContent=t,this}}function se(){}function ae(t,e,n){const i=t.getBoundingClientRect(),o=e.clientX-i.left,r=e.clientY-i.top,s=o/i.width,a=r/i.height,l=o-(n=n||[o,r])[0],u=r-n[1];return{x:o,y:r,nx:s,ny:a,dx:l,dy:u,ndx:l/i.width,ndy:u/i.width}}function le(t,{onDown:e=se,onMove:n=se,onUp:i=se}){let o;const r=function(e){const i={type:"move",...ae(t,e,o)};n(i)},s=function(e){t.releasePointerCapture(e.pointerId),t.removeEventListener("pointermove",r),t.removeEventListener("pointerup",s),document.body.style.backgroundColor="",i("up")},a=function(n){t.addEventListener("pointermove",r),t.addEventListener("pointerup",s),t.setPointerCapture(n.pointerId);const i=ae(t,n);o=[i.x,i.y],e({type:"down",...i})};return t.addEventListener("pointerdown",a),function(){t.removeEventListener("pointerdown",a)}}function ue(t){return t.querySelectorAll("[data-src]").forEach((e=>{const i="muigui-id-"+n++;e.id=i,t.querySelectorAll(`[data-target=${e.dataset.src}]`).forEach((t=>{t.setAttribute("fill",`url(#${i})`)}))})),t}class ce extends v{#I;#$;#O;#H;#z;#T;#W;#B;#G;#R;#Z;#J;#Y;#Q;#u={converters:A,alpha:!1};#K;#_;constructor(t,n){super(e("div",{innerHTML:'\n\n \n \n \n \n \n \n \n \n\n \n \n \n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n \n \n \n \n \n \n \n \n\n',className:"muigui-no-scroll"})),this.#O=this.domElement.children[0],this.#z=this.domElement.children[1],this.#B=this.domElement.children[2],ue(this.#O),ue(this.#z),ue(this.#B),this.#H=this.$(".muigui-color-chooser-circle"),this.#T=this.$("[data-src=muigui-color-chooser-hue]"),this.#W=this.$(".muigui-color-chooser-hue-cursor"),this.#G=this.$("[data-src=muigui-color-chooser-alpha]"),this.#R=this.$(".muigui-color-chooser-alpha-cursor");const i=e=>{const n=o(e.nx,0,1),i=o(e.ny,0,1);this.#Z[1]=n,this.#Z[2]=1-i,this.#J=!0,this.#Q=!0;const[r,s]=this.#$(this.#K(this.#Z));r&&t.setValue(s)},r=e=>{const n=o(e.nx,0,1);this.#Z[0]=n,this.#Y=!0,this.#Q=!0;const[i,r]=this.#$(this.#K(this.#Z));i&&t.setValue(r)},s=e=>{const n=o(e.nx,0,1);this.#Z[3]=n,this.#J=!0,this.#Y=!0;const[i,r]=this.#$(this.#K(this.#Z));i&&t.setValue(r)};le(this.#O,{onDown:i,onMove:i}),le(this.#z,{onDown:r,onMove:r}),le(this.#B,{onDown:s,onMove:s}),this.setOptions(n)}updateDisplay(t){this.#Z||(this.#Z=this.#_(this.#I(t)));{const[e,n,i,o=1]=this.#_(this.#I(t));this.#J||(this.#Z[0]=n>.001&&i>.001?e:this.#Z[0]),this.#Y||(this.#Z[1]=n,this.#Z[2]=i),this.#Q||(this.#Z[3]=o)}{const[t,e,n,i]=this.#Z,[o,r,s]=wt(It(this.#Z));this.#J||this.#W.setAttribute("transform",`translate(${64*t}, 0)`),this.#T.children[0].setAttribute("stop-color",`hsl(${360*o} 0% 100% / ${i})`),this.#T.children[1].setAttribute("stop-color",`hsl(${360*o} 100% 50% / ${i})`),this.#Q||this.#R.setAttribute("transform",`translate(${64*i}, 0)`),this.#G.children[0].setAttribute("stop-color",`hsl(${360*o} ${100*r}% ${100*s}% / 0)`),this.#G.children[1].setAttribute("stop-color",`hsl(${360*o} ${100*r}% ${100*s}% / 1)`),this.#Y||(this.#H.setAttribute("cx",""+64*e),this.#H.setAttribute("cy",""+48*(1-n)))}this.#J=!1,this.#Y=!1,this.#Q=!1}setOptions(t){l(this.#u,t);const{converters:{to:e,from:n},alpha:i}=this.#u;return this.#B.style.display=i?"":"none",this.#K=i?t=>rt(It(t)):t=>it(Et(t)),this.#_=i?t=>Mt(ot(t)):t=>Ct(nt(t)),this.#I=e,this.#$=n,this}}class he extends D{#q;#X;#f;#tt;#u={open:!1};constructor(t,n,i={}){super(t,n,"muigui-pop-down-controller"),this.#q=this.add(new qt("div","muigui-pop-down-top"));const o=this.#q.addElem(e("input",{type:"checkbox",onChange:()=>{this.#u.open=o.checked,this.updateDisplay()}}));this.#f=o,this.#X=this.#q.add(new qt("div","muigui-pop-down-values"));const r=new qt("div","muigui-pop-down-bottom muigui-open-container");this.#tt=new qt("div"),r.add(this.#tt),this.add(r),this.setOptions(i)}setKnobColor(t){this.#f&&(this.#f.style=`\n --range-color: ${t};\n --value-bg-color: ${t};\n `)}updateDisplay(){super.updateDisplay();const{open:t}=this.#u;this.domElement.children[1].classList.toggle("muigui-open",t),this.domElement.children[1].classList.toggle("muigui-closed",!t)}setOptions(t){l(this.#u,t),super.setOptions(t),this.updateDisplay()}addTop(t){return this.#X.add(t)}addBottom(t){return this.#tt.add(t)}}class de extends he{#j;#V;#I;constructor(t,e,n={}){super(t,e,"muigui-color-chooser");const i=n.format||Dt(this.getValue()),{color:o,text:r}=_t[i];this.#I=o.to,this.#V=new B(this,{converters:r,alpha:St(i)}),this.#j=new ce(this,{converters:o,alpha:St(i)}),this.addTop(this.#V),this.addBottom(this.#j),this.___setKnobHelper=!0,this.updateDisplay()}#et(){if(this.#I){const t=this.#I(this.getValue()),e=9===t.length?t.substring(7,9):"FF",n=yt(q(t));n[2]=(n[2]+50)%100;const i=X(vt(n));this.setKnobColor(`${t.substring(0,7)}${e}`,i)}}updateDisplay(){super.updateDisplay(),this.___setKnobHelper&&this.#et()}setOptions(t){return super.setOptions(t),this}}class me extends oe{add(t,e,...n){const i=t instanceof g?t:function(t,e,...n){const[i]=n;if(Array.isArray(i))return new z(t,e,{keyValues:i});if(i&&i.keyValues)return new z(t,e,{keyValues:i.keyValues});const o=typeof t[e];switch(o){case"number":if("number"==typeof n[0]&&"number"==typeof n[1]){const i=n[0],o=n[1],r=n[2];return new W(t,e,{min:i,max:o,...r&&{step:r}})}return 0===n.length?new P(t,e,...n):new W(t,e,...n);case"boolean":return new N(t,e,...n);case"function":return new b(t,e,...n);case"string":return new G(t,e,...n);case"undefined":throw new Error(`no property named ${e}`);default:throw new Error(`unhandled type ${o} for property ${e}`)}}(t,e,...n);return this.addController(i)}addCanvas(t){return this.addController(new Xt(t))}addColor(t,e,n={}){const i=t[e];return St(n.format||Dt(i))?this.addController(new de(t,e,n)):this.addController(new ee(t,e,n))}addDivider(){return this.addController(new ne)}addFolder(t){return this.addController(new me(t))}addLabel(t){return this.addController(new re(t))}addButton(t,e){const n={fn:e};return this.add(n,"fn").name(t)}}class pe extends HTMLElement{constructor(){super(),this.shadow=this.attachShadow({mode:"open"})}}customElements.define("muigui-element",pe);const ge=new CSSStyleSheet,be=new CSSStyleSheet;function fe(t){let e,n;function i(){if(e&&!n){const o=e;e=void 0,n=t.replace(o).then((()=>{n=void 0,i()}))}}return function(t){e=t,i()}}const ve=fe(ge),xe=fe(be);function we(e){const{include:n,css:i}=t.themes[e];return`${n.map((e=>t[e])).join("\n")} : css.default}\n${i||""}`}class ye extends me{static converters=U;static mapRange=u;static makeRangeConverters=c;static makeRangeOptions=h;static makeMinMaxPair=m;#nt=new CSSStyleSheet;constructor(n={}){super("Controls","muigui-root"),n instanceof HTMLElement&&(n={parent:n});const{autoPlace:i=!0,width:o,title:r="Controls"}=n;let{parent:s}=n;if(o&&(this.domElement.style.width=/^\d+$/.test(o)?`${o}px`:o),void 0===s&&i&&(s=document.body,this.domElement.classList.add("muigui-auto-place")),s){const t=e("muigui-element");t.shadowRoot.adoptedStyleSheets=[this.#nt,ge,be],t.shadow.appendChild(this.domElement),s.appendChild(t)}r&&this.title(r),this.#nt.replaceSync(t.default),this.domElement.classList.add("muigui","muigui-colors")}setStyle(t){this.#nt.replace(t)}static setBaseStyles(t){ve(t)}static getBaseStyleSheet(){return ge}static setUserStyles(t){xe(t)}static getUserStyleSheet(){return be}setTheme(t){this.setStyle(we(t))}static setTheme(t){ye.setBaseStyles(we(t))}}function ke(){}const Ee={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]};function Ie(t,{onDown:e=ke,onUp:n=ke}){const i=function(t){const i=t.shiftKey?10:1,[o,r]=(Ee[t.key]||[0,0]).map((t=>t*i));("keydown"===t.type?e:n)({type:t.type.substring(3),dx:o,dy:r,event:t})};return t.addEventListener("keydown",i),t.addEventListener("keyup",i),function(){t.removeEventListener("keydown",i),t.removeEventListener("keyup",i)}}function $e(t,e=""){if(!t)throw new Error(e)}function Ce(t,e,n,i,o,r){const s=Math.abs(n)*Math.cos(r),a=Math.abs(i)*Math.sin(r);return[t+Math.cos(o)*s-Math.sin(o)*a,e+Math.sin(o)*s+Math.cos(o)*a]}function Me(t,e,n,i,o){$e(Math.abs(i-o)<=2*Math.PI),$e(i>=-Math.PI&&i<=2*Math.PI),$e(i<=o),$e(o>=-Math.PI&&o<=4*Math.PI);const{x1:r,y1:s,x2:a,y2:l,fa:u,fs:c}=function(t,e,n,i,o,r,s){const[a,l]=Ce(t,e,n,i,o,r),[u,c]=Ce(t,e,n,i,o,r+s);return{x1:a,y1:l,x2:u,y2:c,fa:Math.abs(s)>Math.PI?1:0,fs:s>0?1:0}}(t,e,n,n,0,i,o-i);return Math.abs(Math.abs(i-o)-2*Math.PI)>Number.EPSILON?`M${t} ${e} L${r} ${s} A ${n} ${n} 0 ${u} ${c} ${a} ${l} L${t} ${e}`:`M${r} ${s} L${r} ${s} A ${n} ${n} 0 ${u} ${c} ${a} ${l}`}const Se=t=>a(t+Math.PI,2*Math.PI)-Math.PI;class Ve extends v{#it;#ot;#rt;#st;#u={step:1,min:-180,max:180,dirMin:-Math.PI,dirMax:Math.PI,wrap:void 0,converters:A};constructor(t,n={}){const i=L();super(e("div",{className:"muigui-direction muigui-no-scroll",innerHTML:'\n\n \x3c!----\x3e\n \n \n \n \n \n \n\n',onWheel:e=>{e.preventDefault();const{min:n,max:r,step:l}=this.#u,u=i(e,l);let c=this.#rt+u;this.#st&&(c=a(c-n,r-n)+n);const h=o(s(c,(t=>t),l),n,r);t.setValue(h)}}));const r=e=>{const{min:n,max:i,step:r,dirMin:a,dirMax:l}=this.#u,u=2*e.nx-1,c=2*e.ny-1,h=Math.atan2(c,u),d=(a+l)/2,m=o((Se(h-d)-Se(a-d))/(l-a),0,1),p=s(n+(i-n)*m,(t=>t),r);t.setValue(p)};le(this.domElement,{onDown:r,onMove:r}),Ie(this.domElement,{onDown:e=>{const{min:n,max:i,step:r}=this.#u,a=o(s(this.#rt+e.dx*r,(t=>t),r),n,i);t.setValue(a)}}),this.#it=this.$("#muigui-arrow"),this.#ot=this.$("#muigui-range"),this.setOptions(n)}updateDisplay(t){this.#rt=t;const{min:e,max:n}=this.#u,i=(t-e)/(n-e),o=(r=this.#u.dirMin,s=this.#u.dirMax,r+(s-r)*i);var r,s;this.#it.style.transform=`rotate(${o}rad)`}setOptions(t){l(this.#u,t);const{dirMin:e,dirMax:n,wrap:i}=this.#u;this.#st=void 0!==i?i:Math.abs(e-n)>=2*Math.PI-Number.EPSILON;const[o,r]=e(o.push(i),e("label",{},[e("input",{type:"radio",name:r,value:a,onChange:function(){this.checked&&t.setFinalValue(s.#D[this.value])}}),e("button",{type:"button",textContent:n,onClick:function(){this.previousElementSibling.click()}})]))))));const s=this;this.#D=o,this.cols(i)}updateDisplay(t){const e=this.#D.indexOf(t);for(let t=0;t{e({rect:t.getBoundingClientRect(),elem:t})})).observe(t)}function Ue(t,e,n,i){je(t,(({rect:o})=>{const{width:r,height:s}=o;t.setAttribute("viewBox",`-${r*e} -${s*n} ${r} ${s}`),i({elem:t,rect:o})}))}function Le(t,e,n,i,o,r){const a=[];tt),n)),e=Math.min(e,o);for(let i=t;i<=e;i+=n)a.push(`M${i} 0 l0 ${r}`);return a.join(" ")}class Fe extends v{#at;#lt;#ut;#ct;#ht;#dt;#mt;#pt;#gt;#rt;#bt;#u={min:-100,max:100,step:1,unit:10,unitSize:10,ticksPerUnit:5,labelFn:t=>t,tickHeight:1,limits:!0,thicksColor:void 0,orientation:void 0};constructor(t,n){const i=L();let r;super(e("div",{innerHTML:'\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \x3c!----\x3e\n \x3c!----\x3e\n \n \n \n \n\n',className:"muigui-no-v-scroll",onWheel:e=>{e.preventDefault();const{min:n,max:r,step:a}=this.#u,l=i(e,a),u=o(s(this.#rt+l,(t=>t),a),n,r);t.setValue(u)}})),this.#at=this.$("svg"),this.#lt=this.$("#muigui-origin"),this.#ut=this.$("#muigui-ticks"),this.#ct=this.$("#muigui-thicks"),this.#ht=this.$("#muigui-numbers"),this.#dt=this.$("#muigui-left-grad"),this.#mt=this.$("#muigui-right-grad"),this.setOptions(n),le(this.domElement,{onDown:()=>{r=this.#rt},onMove:e=>{const{min:n,max:i,unitSize:a,unit:l,step:u}=this.#u,c=o(s(r-e.dx/a*l,(t=>t),u),n,i);t.setValue(c)}}),Ie(this.domElement,{onDown:e=>{const{min:n,max:i,step:r}=this.#u,a=o(s(this.#rt+e.dx*r,(t=>t),r),n,i);t.setValue(a)}}),Ue(this.#at,.5,0,(({rect:{width:t}})=>{this.#dt.setAttribute("x",-t/2),this.#mt.setAttribute("x",t/2-20),this.#bt=function(t){const e=t.innerHTML;t.innerHTML="- ";const n=t.querySelector("text").getComputedTextLength();return t.innerHTML=e,n}(this.#ht),this.#pt=t,this.#ft()}))}#ft(){if(!this.#pt||void 0===this.#rt)return;const{labelFn:t,limits:e,min:n,max:i,orientation:o,tickHeight:r,ticksPerUnit:a,unit:l,unitSize:u,thicksColor:c}=this.#u,h=Math.ceil(this.#pt/u),d=this.#rt/l,m=Math.round(d-h),p=m*u,g=(m+2*h)*u,b=e?n*u/l:p,f=e?i*u/l:g,v=""===t(1)?10:5;a>1&&this.#ut.setAttribute("d",Le(p,g,u/a,b,f,v*r)),this.#ct.style.stroke=c,this.#ct.setAttribute("d",Le(p,g,u,b,f,v)),this.#ht.innerHTML=function(t,e,n,i,o,r,a,l){const u=[];tt),n)),e=Math.min(e,a);const c=Math.max(0,-Math.log10(i));for(let r=t;r<=e;r+=n)u.push(`${h=r/n*i,l(h.toFixed(c))}`);var h;return u.join("\n")}(p,g,u,l,this.#bt,b,f,t),this.#lt.setAttribute("transform",`translate(${-this.#rt*u/l} 0)`),this.#at.classList.toggle("muigui-slider-up","up"===o)}updateDisplay(t){this.#rt=t,this.#ft()}setOptions(t){return l(this.#u,t),this}}class Pe extends D{constructor(t,e,n={}){super(t,e,"muigui-slider"),this.add(new Fe(this,n)),this.add(new F(this,n)),this.updateDisplay()}}class Oe extends v{#at;#it;#H;#rt=[];constructor(t){super(e("div",{innerHTML:'\n\n \n \n \n \n \n\n',className:"muigui-no-scroll"}));const n=e=>{const{width:n,height:i}=this.#at.getBoundingClientRect(),o=2*e.nx-1,r=2*e.ny-1;t.setValue([o*n*.5,r*i*.5])};le(this.domElement,{onDown:n,onMove:n}),this.#at=this.$("svg"),this.#it=this.$("#muigui-arrow"),this.#H=this.$("#muigui-circle"),Ue(this.#at,.5,.5,(()=>this.#vt))}#vt(){const[t,e]=this.#rt;this.#it.setAttribute("d",`M0,0L${t},${e}`),this.#H.setAttribute("transform",`translate(${t}, ${e})`)}updateDisplay(t){this.#rt[0]=t[0],this.#rt[1]=t[1],this.#vt()}}class He extends he{constructor(t,e){super(t,e,"muigui-vec2");const n=t=>({setValue:e=>{const n=this.getValue();n[t]=e,this.setValue(n)},setFinalValue:e=>{const n=this.getValue();n[t]=e,this.setFinalValue(n)}});this.addTop(new F(n(0),{converters:{to:t=>t[0],from:j.from}})),this.addTop(new F(n(1),{converters:{to:t=>t[1],from:j.from}})),this.addBottom(new Oe(this)),this.updateDisplay()}}const ze={main:"#ddd"},Te={main:"#333"},We=window.matchMedia("(prefers-color-scheme: dark)");let Be,Ge;function Re(){Ge=We.matches,Be=Ge?ze:Te}We.addEventListener("change",Re),Re();const Ze={graph:function(t,e,{min:n=-1,max:i=1,interval:o=16,color:r}){const s=t.getContext("2d");setInterval((function(){const{width:o,height:a}=t;s.clearRect(0,0,o,a),s.beginPath();const l=i-n;for(let t=0;t{t.text(JSON.stringify(e[n],null,2))}),i)}};export{de as ColorChooser,De as Direction,Ae as RadioGrid,W as Range,z as Select,Pe as Slider,P as TextNumber,He as Vec2,ye as default,Ze as helpers}; +var t={default:'\n.muigui {\n --bg-color: #ddd;\n --color: #222;\n --contrast-color: #eee;\n --value-color: #145 ;\n --value-bg-color: #eeee;\n --disabled-color: #999;\n --menu-bg-color: #f8f8f8;\n --menu-sep-color: #bbb;\n --hover-bg-color: #999;\n --focus-color: #8BF;\n --range-color: #AAA;\n --invalid-color: #FF0000;\n --selected-color: rgb(255, 255, 255, 0.9);\n\n --button-bg-color: var(--value-bg-color);\n\n --image-open: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjNDQ0OyIgeD0iMjAlIiB5PSI0NSUiIHdpZHRoPSI2MCUiIGhlaWdodD0iMTAlIj48L3JlY3Q+Cjwvc3ZnPg==);\n --image-closed: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjNDQ0OyIgeD0iNDUlIiB5PSIyMCUiIHdpZHRoPSIxMCUiIGhlaWdodD0iNjAlIj48L3JlY3Q+CiAgPHJlY3Qgc3R5bGU9ImZpbGw6ICM0NDQ7IiB4PSIyMCUiIHk9IjQ1JSIgd2lkdGg9IjYwJSIgaGVpZ2h0PSIxMCUiPjwvcmVjdD4KPC9zdmc+);\n --image-checkerboard: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjNDA0MDQwOyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSI+PC9yZWN0PgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjODA4MDgwOyIgeD0iMCIgeT0iMCIgd2lkdGg9IjUwJSIgaGVpZ2h0PSI1MCUiPjwvcmVjdD4KICA8cmVjdCBzdHlsZT0iZmlsbDogIzgwODA4MDsiIHg9IjUwJSIgeT0iNTAlIiB3aWR0aD0iNTAlIiBoZWlnaHQ9IjUwJSI+PC9yZWN0Pgo8L3N2Zz4=);\n\n --range-left-color: var(--value-color);\n --range-right-color: var(--value-bg-color); \n --range-right-hover-color: var(--hover-bg-color);\n --button-image: \n linear-gradient(\n rgba(255, 255, 255, 1), rgba(0, 0, 0, 0.2)\n );\n\n color: var(--color);\n background-color: var(--bg-color);\n}\n\n@media (prefers-color-scheme: dark) {\n .muigui {\n --bg-color: #222222;\n --color: #dddddd;\n --contrast-color: #000;\n --value-color: #43e5f7;\n --value-bg-color: #444444;\n --disabled-color: #666666;\n --menu-bg-color: #080808;\n --menu-sep-color: #444444;\n --hover-bg-color: #666666;\n --focus-color: #458; /*#88AAFF*/;\n --range-color: #888888;\n --invalid-color: #FF6666;\n --selected-color: rgba(255, 255, 255, 0.3);\n\n --button-bg-color: var(--value-bg-color);\n\n --range-left-color: var(--value-color);\n --range-right-color: var(--value-bg-color); \n --range-right-hover-color: var(--hover-bg-color);\n --button-image: linear-gradient(\n rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.4)\n );\n\n color: var(--color);\n background-color: var(--bg-color);\n\n --image-closed: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjREREOyIgeD0iMjAlIiB5PSI0NSUiIHdpZHRoPSI2MCUiIGhlaWdodD0iMTAlIj48L3JlY3Q+Cjwvc3ZnPg==);\n --image-open: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjREREOyIgeD0iNDUlIiB5PSIyMCUiIHdpZHRoPSIxMCUiIGhlaWdodD0iNjAlIj48L3JlY3Q+CiAgPHJlY3Qgc3R5bGU9ImZpbGw6ICNEREQ7IiB4PSIyMCUiIHk9IjQ1JSIgd2lkdGg9IjYwJSIgaGVpZ2h0PSIxMCUiPjwvcmVjdD4KPC9zdmc+);\n }\n}\n\n.muigui {\n --width: 250px;\n --label-width: 45%;\n --number-width: 40%;\n\n --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;\n --font-size: 11px;\n --font-family-mono: Menlo, Monaco, Consolas, "Droid Sans Mono", monospace;\n --font-size-mono: 11px;\n\n --line-height: 1.7em;\n --border-radius: 0px;\n\n width: var(--width);\n font-family: var(--font-family);\n font-size: var(--font-size);\n box-sizing: border-box;\n line-height: 100%;\n white-space: nowrap;\n}\n.muigui * {\n box-sizing: inherit;\n}\n\n.muigui-no-scroll {\n touch-action: none;\n}\n.muigui-no-h-scroll {\n touch-action: pan-y;\n}\n.muigui-no-v-scroll {\n touch-action: pan-x;\n}\n\n.muigui-invalid-value {\n background-color: red !important;\n color: white !important;\n}\n\n.muigui-grid {\n display: grid;\n}\n.muigui-rows {\n display: flex;\n flex-direction: column;\n\n min-height: 20px;\n border: 2px solid red;\n}\n.muigui-columns {\n display: flex;\n flex-direction: row;\n\n height: 20px;\n border: 2px solid green;\n}\n.muigui-rows>*,\n.muigui-columns>* {\n flex: 1 1 auto;\n align-items: stretch;\n min-height: 0;\n min-width: 0;\n}\n\n.muigui-row {\n border: 2px solid yellow;\n min-height: 10px\n}\n.muigui-column {\n border: 2px solid lightgreen;\n}\n\n/* -------- */\n\n.muigui-show { /* */ }\n.muigui-hide { \n display: none !important;\n}\n.muigui-disabled {\n pointer-events: none;\n --color: var(--disabled-color) !important;\n --value-color: var(--disabled-color) !important;\n --range-left-color: var(--disabled-color) !important;\n}\n\n.muigui canvas,\n.muigui svg {\n display: block;\n border-radius: var(--border-radius);\n}\n.muigui canvas {\n background-color: var(--value-bg-color);\n}\n\n.muigui-controller {\n min-width: 0;\n min-height: var(--line-height);\n}\n.muigui-root {\n z-index: 1;\n}\n.muigui-root,\n.muigui-menu {\n display: flex;\n flex-direction: column;\n position: relative;\n user-select: none;\n height: fit-content;\n margin: 0;\n padding-bottom: 0.1em;\n border-radius: var(--border-radius);\n}\n.muigui-menu {\n border-bottom: 1px solid var(--menu-sep-color);\n}\n\n.muigui-root>button:nth-child(1),\n.muigui-menu>button:nth-child(1) {\n border-top: 1px solid var(--menu-sep-color);\n border-bottom: 1px solid var(--menu-sep-color);\n position: relative;\n text-align: left;\n color: var(--color);\n background-color: var(--menu-bg-color);\n min-height: var(--line-height);\n padding: 0.2em;\n cursor: pointer;\n border-radius: var(--border-radius);\n}\n.muigui-root>div:nth-child(2),\n.muigui-menu>div:nth-child(2) {\n flex: 1 1 auto;\n}\n\n.muigui-controller {\n margin-left: 0.2em;\n margin-right: 0.2em;\n}\n.muigui-root.muigui-controller,\n.muigui-menu.muigui-controller {\n margin-left: 0;\n margin-right: 0;\n}\n.muigui-controller>*:nth-child(1) {\n flex: 1 0 var(--label-width);\n min-width: 0;\n /* white-space: pre; why?? */\n}\n.muigui-controller>label:nth-child(1) {\n place-content: center start;\n display: inline-grid;\n overflow: hidden;\n}\n.muigui-controller>*:nth-child(2) {\n flex: 1 1 75%;\n min-width: 0;\n}\n\n/* -----------------------------------------\n a label controller is [[label][value]]\n*/\n\n.muigui-label-controller {\n display: flex;\n margin: 0.4em 0 0.4em 0;\n word-wrap: initial;\n align-items: stretch;\n}\n\n.muigui-value {\n display: flex;\n align-items: stretch;\n}\n.muigui-value>* {\n flex: 1 1 auto;\n min-width: 0;\n}\n.muigui-value>*:nth-child(1) {\n flex: 1 1 calc(100% - var(--number-width));\n}\n.muigui-value>*:nth-child(2) {\n flex: 1 1 var(--number-width);\n margin-left: 0.2em;\n}\n\n/* fix! */\n.muigui-open>button>label::before,\n.muigui-closed>button>label::before {\n content: "X";\n color: rgba(0, 0, 0, 0);\n background-color: var(--range-color);\n border-radius: 0.2em;\n width: 1.25em;\n margin-right: 0.25em;\n height: 1.25em; /*var(--line-height);*/\n display: inline-grid;\n place-content: center start;\n pointer-events: none;\n}\n.muigui-open>button>label::before {\n background-image: var(--image-open);\n}\n.muigui-closed>button>label::before {\n background-image: var(--image-closed);\n}\n\n.muigui-open>.muigui-open-container {\n transition: all 0.1s ease-out;\n overflow: auto;\n height: 100%;\n}\n.muigui-closed>.muigui-open-container {\n transition: all 0.1s ease-out;\n overflow: hidden;\n min-height: 0;\n}\n.muigui-open>.muigui-open-container>* {\n transition: all 0.1s ease-out;\n margin-top: 0px;\n}\n.muigui-closed>.muigui-open-container>* {\n transition: all 0.1s ease-out;\n margin-top: -1000%;\n}\n\n/* ---- popdown ---- */\n\n.muigui-pop-down-top {\n display: flex;\n}\n/* fix? */\n.muigui-value>*:nth-child(1).muigui-pop-down-top {\n flex: 0;\n}\n.muigui-closed .muigui-pop-down-bottom {\n max-height: 0;\n}\n\n.muigui-value .muigui-pop-down-bottom {\n margin: 0;\n}\n\n.muigui-pop-down-values {\n min-width: 0;\n display: flex;\n}\n.muigui-pop-down-values>* {\n flex: 1 1 auto;\n min-width: 0;\n}\n\n.muigui-value.muigui-pop-down-controller {\n flex-direction: column;\n}\n\n.muigui-pop-down-top input[type=checkbox] {\n -webkit-appearance: none;\n appearance: none;\n width: auto;\n color: var(--value-color);\n background-color: var(--value-bg-color);\n background-image: var(--image-checkerboard);\n background-size: 10px 10px;\n background-position: 0 0, 0 5px, 5px -5px, -5px 0px;\n\n cursor: pointer;\n\n display: grid;\n place-content: center;\n margin: 0;\n font: inherit;\n color: currentColor;\n width: 1.7em;\n height: 1.7em;\n transform: translateY(-0.075em);\n}\n\n.muigui-pop-down-top input[type=checkbox]::before {\n content: "+";\n display: grid;\n place-content: center;\n border-radius: calc(var(--border-radius) + 2px);\n border-left: 1px solid rgba(255,255,255,0.3);\n border-top: 1px solid rgba(255,255,255,0.3);\n border-bottom: 1px solid rgba(0,0,0,0.2);\n border-right: 1px solid rgba(0,0,0,0.2);\n background-color: var(--range-color);\n color: var(--value-bg-color);\n width: calc(var(--line-height) - 4px);\n height: calc(var(--line-height) - 4px);\n}\n\n.muigui-pop-down-top input[type=checkbox]:checked::before {\n content: "X";\n}\n\n\n/* ---- select ---- */\n\n.muigui select,\n.muigui option,\n.muigui input,\n.muigui button {\n color: var(--value-color);\n background-color: var(--value-bg-color);\n font-family: var(--font-family);\n font-size: var(--font-size);\n border: none;\n margin: 0;\n border-radius: var(--border-radius);\n}\n.muigui select {\n appearance: none;\n margin: 0;\n margin-left: 0; /*?*/\n overflow: hidden; /* Safari */\n}\n\n.muigui select:focus,\n.muigui input:focus,\n.muigui button:focus {\n outline: 1px solid var(--focus-color);\n}\n\n.muigui select:hover,\n.muigui option:hover,\n.muigui input:hover,\n.muigui button:hover {\n background-color: var(--hover-bg-color); \n}\n\n/* ------ [ label ] ------ */\n\n.muigui-label {\n border-top: 1px solid var(--menu-sep-color);\n border-bottom: 1px solid var(--menu-sep-color);\n padding-top: 0.4em;\n padding-bottom: 0.3em;\n place-content: center start;\n background-color: var(--menu-bg-color);\n white-space: pre;\n border-radius: var(--border-radius);\n}\n\n/* ------ [ divider] ------ */\n\n.muigui-divider {\n min-height: 6px;\n border-top: 2px solid var(--menu-sep-color);\n margin-top: 6px;\n}\n\n/* ------ [ button ] ------ */\n\n.muigui-button {\n display: grid;\n padding: 2px 0 2px 0;\n}\n.muigui-button button {\n border: none;\n color: var(--value-color);\n background-color: var(--button-bg-color);\n background-image: var(--button-image);\n cursor: pointer;\n place-content: center center;\n height: var(--line-height);\n}\n\n/* ------ [ color ] ------ */\n\n.muigui-color>div {\n overflow: hidden;\n position: relative;\n margin-left: 0;\n margin-right: 0; /* why? */\n max-width: var(--line-height);\n border-radius: var(--border-radius);\n}\n\n.muigui-color>div:focus-within {\n outline: 1px solid var(--focus-color);\n}\n\n.muigui-color input[type=color] {\n border: none;\n padding: 0;\n background: inherit;\n cursor: pointer;\n position: absolute;\n width: 200%;\n left: -10px;\n top: -10px;\n height: 200%;\n}\n.muigui-disabled canvas,\n.muigui-disabled svg,\n.muigui-disabled img,\n.muigui-disabled .muigui-color input[type=color] {\n opacity: 0.2;\n}\n\n/* ------ [ checkbox ] ------ */\n\n.muigui-checkbox>label:nth-child(2) {\n display: grid;\n place-content: center start;\n margin: 0;\n}\n\n.muigui-checkbox input[type=checkbox] {\n -webkit-appearance: none;\n appearance: none;\n width: auto;\n color: var(--value-color);\n background-color: var(--value-bg-color);\n cursor: pointer;\n\n display: grid;\n place-content: center;\n margin: 0;\n font: inherit;\n color: currentColor;\n width: 1.7em;\n height: 1.7em;\n transform: translateY(-0.075em);\n}\n\n.muigui-checkbox input[type=checkbox]::before {\n content: "";\n color: var(--value-color);\n display: grid;\n place-content: center;\n}\n\n.muigui-checkbox input[type=checkbox]:checked::before {\n content: "✔";\n}\n\n.muigui input[type=number]::-webkit-inner-spin-button, \n.muigui input[type=number]::-webkit-outer-spin-button { \n -webkit-appearance: none;\n appearance: none;\n margin: 0; \n}\n.muigui input[type=number] {\n -moz-appearance: textfield;\n}\n\n/* ------ [ radio grid ] ------ */\n\n.muigui-radio-grid>div {\n display: grid;\n gap: 2px;\n}\n\n.muigui-radio-grid input {\n appearance: none;\n display: none;\n}\n\n.muigui-radio-grid button {\n color: var(--color);\n width: 100%;\n text-align: left;\n}\n\n.muigui-radio-grid input:checked + button {\n color: var(--value-color);\n background-color: var(--selected-color);\n}\n\n/* ------ [ color-chooser ] ------ */\n\n.muigui-color-chooser-cursor {\n stroke-width: 1px;\n stroke: white;\n fill: none;\n}\n.muigui-color-chooser-circle {\n stroke-width: 1px;\n stroke: white;\n fill: none;\n}\n\n\n/* ------ [ vec2 ] ------ */\n\n.muigui-vec2 svg {\n background-color: var(--value-bg-color);\n}\n\n.muigui-vec2-axis {\n stroke: 1px;\n stroke: var(--focus-color);\n}\n\n.muigui-vec2-line {\n stroke-width: 1px;\n stroke: var(--value-color);\n fill: var(--value-color);\n}\n\n/* ------ [ direction ] ------ */\n\n.muigui-direction svg {\n background-color: rgba(0,0,0,0.2);\n}\n\n.muigui-direction:focus-within svg {\n outline: none;\n}\n.muigui-direction-range {\n fill: var(--value-bg-color);\n}\n.muigui-direction svg:focus {\n outline: none;\n}\n.muigui-direction svg:focus .muigui-direction-range {\n stroke-width: 0.5px;\n stroke: var(--focus-color);\n}\n\n.muigui-direction-arrow {\n fill: var(--value-color);\n}\n\n/* ------ [ slider ] ------ */\n\n.muigui-slider>div {\n display: flex;\n align-items: stretch;\n height: var(--line-height);\n}\n.muigui-slider svg {\n flex: 1 1 auto;\n}\n.muigui-slider .muigui-slider-up #muigui-orientation {\n transform: scale(1, -1) translateY(-100%);\n}\n\n.muigui-slider .muigui-slider-up #muigui-number-orientation {\n transform: scale(1,-1);\n}\n\n.muigui-ticks {\n stroke: var(--range-color);\n}\n.muigui-thicks {\n stroke: var(--color);\n stroke-width: 2px;\n}\n.muigui-svg-text {\n fill: var(--color);\n font-size: 7px;\n}\n.muigui-mark {\n fill: var(--value-color);\n}\n\n/* ------ [ range ] ------ */\n\n\n.muigui-range input[type=range] {\n -webkit-appearance: none;\n appearance: none;\n background-color: transparent;\n}\n\n.muigui-range input[type=range]::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n border-radius: calc(var(--border-radius) + 2px);\n border-left: 1px solid rgba(255,255,255,0.3);\n border-top: 1px solid rgba(255,255,255,0.3);\n border-bottom: 1px solid rgba(0,0,0,0.2);\n border-right: 1px solid rgba(0,0,0,0.2);\n background-color: var(--range-color);\n margin-top: calc((var(--line-height) - 6px) / -2);\n width: calc(var(--line-height) - 6px);\n height: calc(var(--line-height) - 6px);\n}\n\n.muigui-range input[type=range]::-webkit-slider-runnable-track {\n -webkit-appearance: none;\n appearance: none;\n border: 1px solid var(--menu-sep-color);\n height: 2px;\n}\n\n\n/* dat.gui style - doesn\'t work on Safari iOS */\n\n/*\n.muigui-range input[type=range] {\n cursor: ew-resize;\n overflow: hidden;\n}\n\n.muigui-range input[type=range] {\n -webkit-appearance: none;\n appearance: none;\n background-color: var(--range-right-color);\n margin: 0;\n}\n.muigui-range input[type=range]:hover {\n background-color: var(--range-right-hover-color);\n}\n\n.muigui-range input[type=range]::-webkit-slider-runnable-track {\n -webkit-appearance: none;\n appearance: none;\n height: max-content;\n color: var(--range-left-color);\n margin-top: -1px;\n}\n\n.muigui-range input[type=range]::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 0px;\n height: max-content;\n box-shadow: -1000px 0 0 1000px var(--range-left-color);\n}\n*/\n\n/* FF */\n/*\n.muigui-range input[type=range]::-moz-slider-progress {\n background-color: var(--range-left-color); \n}\n.muigui-range input[type=range]::-moz-slider-thumb {\n height: max-content;\n width: 0;\n border: none;\n box-shadow: -1000px 0 0 1000px var(--range-left-color);\n box-sizing: border-box;\n}\n*/\n\n.muigui-checkered-background {\n background-color: #404040;\n background-image:\n linear-gradient(45deg, #808080 25%, transparent 25%),\n linear-gradient(-45deg, #808080 25%, transparent 25%),\n linear-gradient(45deg, transparent 75%, #808080 75%),\n linear-gradient(-45deg, transparent 75%, #808080 75%);\n background-size: 16px 16px;\n background-position: 0 0, 0 8px, 8px -8px, -8px 0px;\n}\n\n/* ---------------------------------------------------------- */\n\n/* needs to be at bottom to take precedence */\n.muigui-auto-place {\n max-height: 100%;\n position: fixed;\n top: 0;\n right: 15px;\n z-index: 100001;\n}\n\n',themes:{default:{include:["default"],css:"\n "},float:{include:["default"],css:"\n :root {\n color-scheme: light dark,\n }\n\n .muigui {\n --width: 400px;\n --bg-color: initial;\n --label-width: 25%;\n --number-width: 20%;\n }\n\n input,\n .muigui-label-controller>label {\n text-shadow:\n -1px -1px 0 var(--contrast-color),\n 1px -1px 0 var(--contrast-color),\n -1px 1px 0 var(--contrast-color),\n 1px 1px 0 var(--contrast-color);\n }\n\n .muigui-controller > label:nth-child(1) {\n place-content: center end;\n margin-right: 1em;\n }\n\n .muigui-value > :nth-child(2) {\n margin-left: 1em;\n }\n\n .muigui-root>*:nth-child(1) {\n display: none;\n }\n\n .muigui-range input[type=range]::-webkit-slider-thumb {\n border-radius: 1em;\n }\n\n .muigui-range input[type=range]::-webkit-slider-runnable-track {\n -webkit-appearance: initial;\n appearance: none;\n border: 1px solid rgba(0, 0, 0, 0.25);\n height: 2px;\n }\n\n .muigui-colors {\n --value-color: var(--color );\n --value-bg-color: rgba(0, 0, 0, 0.1);\n --disabled-color: #cccccc;\n --menu-bg-color: rgba(0, 0, 0, 0.1);\n --menu-sep-color: #bbbbbb;\n --hover-bg-color: rgba(0, 0, 0, 0);\n --invalid-color: #FF0000;\n --selected-color: rgba(0, 0, 0, 0.3);\n --range-color: rgba(0, 0, 0, 0.125);\n }\n"},form:{include:[],css:"\n .muigui {\n --width: 100%;\n --label-width: 45%;\n --number-width: 40%;\n }\n .muigui-root>button {\n display: none;\n }\n .muigui-controller {\n margin-top: 1em;\n }\n .muigui-label-controller {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n margin-top: 1em;\n }\n .muigui-label-controller:has(.muigui-checkbox) {\n flex-direction: row;\n }\n .muigui-value {\n display: flex;\n align-items: stretch;\n }\n .muigui-value>* {\n flex: 1 1 auto;\n min-width: 0;\n }\n .muigui-controller>*:nth-child(1) {\n flex: 1 0 var(--label-width);\n min-width: 0;\n white-space: pre;\n }\n .muigui-controller>label:nth-child(1) {\n place-content: center start;\n display: inline-grid;\n overflow: hidden;\n }\n .muigui-controller>*:nth-child(2) {\n flex: 1 1 75%;\n min-width: 0;\n }\n "},none:{include:[],css:""}}};function e(t,e={},n=[]){const i=document.createElement(t);return function(t,e,n){for(const[n,i]of Object.entries(e))if("function"==typeof i&&n.startsWith("on")){const e=n.substring(2).toLowerCase();t.addEventListener(e,i,{passive:!1})}else if("object"==typeof i)for(const[e,o]of Object.entries(i))t[n][e]=o;else void 0===t[n]?t.setAttribute(n,i):t[n]=i;for(const e of n)t.appendChild(e)}(i,e,n),i}let n=0;function i(t,e){const n=t.indexOf(e);return n&&t.splice(n,1),t}function o(t,e,n){return Math.max(e,Math.min(n,t))}const r="undefined"!=typeof SharedArrayBuffer?function(t){return t&&t.buffer&&(t.buffer instanceof ArrayBuffer||t.buffer instanceof SharedArrayBuffer)}:function(t){return t&&t.buffer&&t.buffer instanceof ArrayBuffer},s=(t,e,n)=>Math.round(e(t)/n)/(1/n),a=(t,e)=>(t%e+e)%e;function l(t,e){for(const n in e)n in t&&(t[n]=e[n]);return t}const u=(t,e,n,i,o)=>(t-e)*(o-i)/(n-e)+i,c=({from:t,to:e})=>({to:n=>u(n,...t,...e),from:n=>[!0,u(n,...e,...t)]}),h=({from:t,to:e,step:n})=>({min:e[0],max:e[1],...n&&{step:n},converters:c({from:t,to:e})}),d={to:t=>t,from:t=>[!0,t]};function m(t,e,n,i,o){const{converters:{from:r}=d}=o,{min:s,max:a}=o,l=o.minRange||0,u=r(l)[1],c=t.add(e,n,{...o,min:s,max:a-l}).onChange((t=>{h.setValue(Math.min(a,Math.max(t+u,e[i])))})),h=t.add(e,i,{...o,min:s+l,max:a}).onChange((t=>{c.setValue(Math.max(s,Math.min(t-u,e[n])))}));return[c,h]}class p{domElement;#t;#e=[];constructor(t){this.domElement=t,this.#t=t}addElem(t){return this.#t.appendChild(t),t}removeElem(t){return this.#t.removeChild(t),t}pushSubElem(t){this.#t.appendChild(t),this.#t=t}popSubElem(){this.#t=this.#t.parentElement}add(t){return this.#e.push(t),this.addElem(t.domElement),t}remove(t){return this.removeElem(t.domElement),i(this.#e,t),t}pushSubView(t){this.pushSubElem(t.domElement)}popSubView(){this.popSubElem()}setOptions(t){for(const e of this.#e)e.setOptions(t)}updateDisplayIfNeeded(t,e){for(const n of this.#e)n.updateDisplayIfNeeded(t,e);return this}$(t){return this.domElement.querySelector(t)}}class g extends p{#n;#i;#o;constructor(t){super(e("div",{className:"muigui-controller"})),this.#n=[],this.#i=[],t&&this.domElement.classList.add(t)}get parent(){return this.#o}setParent(t){this.#o=t,this.enable(!this.disabled())}show(t=!0){return this.domElement.classList.toggle("muigui-hide",!t),this.domElement.classList.toggle("muigui-show",t),this}hide(){return this.show(!1)}disabled(){return!!this.domElement.closest(".muigui-disabled")}enable(t=!0){return this.domElement.classList.toggle("muigui-disabled",!t),["input","button","select","textarea"].forEach((t=>{this.domElement.querySelectorAll(t).forEach((t=>{const e=!!t.closest(".muigui-disabled");t.disabled=e}))})),this}disable(t=!0){return this.enable(!t)}onChange(t){return this.removeChange(t),this.#n.push(t),this}removeChange(t){return i(this.#n,t),this}onFinishChange(t){return this.removeFinishChange(t),this.#i.push(t),this}removeFinishChange(t){return i(this.#i,t),this}#r(t,e){for(const n of t)n.call(this,e)}emitChange(t,e,n){this.#r(this.#n,t),this.#o&&(void 0===e?this.#o.emitChange(t):this.#o.emitChange({object:e,property:n,value:t,controller:this}))}emitFinalChange(t,e,n){this.#r(this.#i,t),this.#o&&(void 0===e?this.#o.emitChange(t):this.#o.emitFinalChange({object:e,property:n,value:t,controller:this}))}updateDisplay(){}getColors(){const t=t=>t.replace(/-([a-z])/g,((t,e)=>e.toUpperCase())),n=e("div");this.domElement.appendChild(n);const i=Object.fromEntries(["color","bg-color","value-color","value-bg-color","hover-bg-color","menu-bg-color","menu-sep-color","disabled-color"].map((e=>{n.style.color=`var(--${e})`;const i=getComputedStyle(n);return[t(e),i.color]})));return n.remove(),i}}class b extends g{#s;#a;#l;#u={name:""};constructor(t,n,i={}){super("muigui-button",""),this.#s=t,this.#a=n,this.#l=this.addElem(e("button",{type:"button",onClick:()=>{this.#s[this.#a](this)}})),this.setOptions({name:n,...i})}name(t){return this.#l.textContent=t,this}setOptions(t){l(this.#u,t);const{name:e}=this.#u;return this.#l.textContent=e,this}}function f(t,e){if(t.length!==e.length)return!1;for(let n=0;n{t.setValue(i.checked)},onChange:()=>{t.setFinalValue(i.checked)}});super(e("label",{},[i])),this.#f=i}updateDisplay(t){this.#f.checked=t}}const w=[],y=new Set;let k,E;function I(){k=void 0,E=!0;for(const t of w)y.has(t)||t();E=!1,y.size&&(E?$():(y.forEach((t=>{i(w,t)})),y.clear())),$()}function $(){!k&&w.length&&(k=requestAnimationFrame(I))}let C=0;function M(){return"muigui-"+ ++C}class S extends p{constructor(t=""){super(e("div",{className:"muigui-value"})),t&&this.domElement.classList.add(t)}}class V extends g{#v;#x;constructor(t="",n=""){super("muigui-label-controller"),this.#v=M(),this.#x=e("label",{for:this.#v}),this.domElement.appendChild(this.#x),this.pushSubView(new S(t)),this.name(n)}get id(){return this.#v}name(t){return this.#x.title===this.#x.textContent&&(this.#x.title=t),this.#x.textContent=t,this}tooltip(t){this.#x.title=t}}class D extends V{#s;#a;#w;#y;#e;#k;constructor(t,e,n=""){super(n,e),this.#s=t,this.#a=e,this.#w=this.getValue(),this.#y=!1,this.#e=[]}get initialValue(){return this.#w}get object(){return this.#s}get property(){return this.#a}add(t){return this.#e.push(t),super.add(t),this.updateDisplay(),t}#E(t,e){let n=!1;if("object"==typeof t){const e=this.#s[this.#a];if(Array.isArray(t)||r(t))for(let i=0;i=0&&w.splice(e,1)}(this.#k)),this}}class N extends D{constructor(t,e){super(t,e,"muigui-checkbox");const n=this.id;this.add(new x(this,n)),this.updateDisplay()}}const A={to:t=>t,from:t=>[!0,t]},j={to:t=>t.toString(),from:t=>{const e=parseFloat(t);return[!Number.isNaN(e),e]}},U={radToDeg:c({to:[0,180],from:[0,Math.PI]})};function L(){let t=0;return function(e,n,i=5){t-=e.deltaY*n/i;const o=Math.floor(Math.abs(t)/n)*Math.sign(t)*n;return t-=o,o}}class F extends v{#I;#$;#C;#M;#u={step:.01,converters:j,min:Number.NEGATIVE_INFINITY,max:Number.POSITIVE_INFINITY};constructor(t,n){const i=t.setValue.bind(t),r=t.setFinalValue.bind(t),a=L();super(e("input",{type:"number",onInput:()=>{this.#S(i,!0)},onChange:()=>{this.#S(r,!1)},onWheel:e=>{e.preventDefault();const{min:n,max:i,step:r}=this.#u,l=a(e,r),u=parseFloat(this.domElement.value),c=o(s(u+l,(t=>t),r),n,i),[h,d]=this.#$(c);h&&t.setValue(d)}})),this.setOptions(n)}#S(t,e){const n=parseFloat(this.domElement.value),[i,r]=this.#$(n);let s;if(i&&!Number.isNaN(n)){const{min:n,max:i}=this.#u;s=r>=n&&r<=i,this.#M=e,t(o(r,n,i))}this.domElement.classList.toggle("muigui-invalid-value",!i||!s)}updateDisplay(t){this.#M||(this.domElement.value=s(t,this.#I,this.#C)),this.#M=!1}setOptions(t){l(this.#u,t);const{step:e,converters:{to:n,from:i}}=this.#u;return this.#I=n,this.#$=i,this.#C=e,this}}class P extends D{#V;#C;constructor(t,e,n={}){super(t,e,"muigui-text-number"),this.#V=this.add(new F(this,n)),this.updateDisplay()}}class O extends v{#D;constructor(t,n){const i=[];super(e("select",{onChange:()=>{t.setFinalValue(this.#D[this.domElement.selectedIndex])}},n.map((([t,n])=>(i.push(n),e("option",{textContent:t})))))),this.#D=i}updateDisplay(t){const e=this.#D.indexOf(t);this.domElement.selectedIndex=e}}function H(t,e){return Array.isArray(t)?Array.isArray(t[0])?t:e?t.map(((t,e)=>[t,e])):t.map((t=>[t,t])):[...Object.entries(t)]}class z extends D{constructor(t,e,n){super(t,e,"muigui-select");const i="number"==typeof this.getValue(),{keyValues:o}=n,r=H(o,i);this.add(new O(this,r)),this.updateDisplay()}}class T extends v{#I;#$;#C;#M;#u={step:.01,min:0,max:1,converters:A};constructor(t,n){const i=L();super(e("input",{type:"range",onInput:()=>{this.#M=!0;const{min:e,max:n,step:i}=this.#u,r=parseFloat(this.domElement.value),a=o(s(r,(t=>t),i),e,n),[l,u]=this.#$(a);l&&t.setValue(u)},onChange:()=>{this.#M=!0;const{min:e,max:n,step:i}=this.#u,r=parseFloat(this.domElement.value),a=o(s(r,(t=>t),i),e,n),[l,u]=this.#$(a);l&&t.setFinalValue(u)},onWheel:e=>{e.preventDefault();const[n,r]=this.#$(parseFloat(this.domElement.value));if(!n)return;const{min:a,max:l,step:u}=this.#u,c=i(e,u),h=o(s(r+c,(t=>t),u),a,l);t.setValue(h)}})),this.setOptions(n)}updateDisplay(t){this.#M||(this.domElement.value=s(t,this.#I,this.#C)),this.#M=!1}setOptions(t){l(this.#u,t);const{step:e,min:n,max:i,converters:{to:o,from:r}}=this.#u;return this.#I=o,this.#$=r,this.#C=e,this.domElement.step=e,this.domElement.min=n,this.domElement.max=i,this}}class W extends D{constructor(t,e,n){super(t,e,"muigui-range"),this.add(new T(this,n)),this.add(new F(this,n))}}class B extends v{#I;#$;#M;#u={converters:A};constructor(t,n){const i=t.setValue.bind(t),o=t.setFinalValue.bind(t);super(e("input",{type:"text",onInput:()=>{this.#S(i,!0)},onChange:()=>{this.#S(o,!1)}})),this.setOptions(n)}#S(t,e){const[n,i]=this.#$(this.domElement.value);n&&(this.#M=e,t(i)),this.domElement.style.color=n?"":"var(--invalid-color)"}updateDisplay(t){this.#M||(this.domElement.value=this.#I(t),this.domElement.style.color=""),this.#M=!1}setOptions(t){l(this.#u,t);const{converters:{to:e,from:n}}=this.#u;return this.#I=e,this.#$=n,this}}class G extends D{constructor(t,e){super(t,e,"muigui-text"),this.add(new B(this)),this.updateDisplay()}}const Z=(t,e,n)=>Math.max(e,Math.min(n,t)),R=(t,e,n)=>t+(e-t)*n,J=t=>t>=0?t%1:1-t%1,Y=t=>+t.toFixed(0),Q=t=>+t.toFixed(3),_=t=>parseInt(t.substring(1,3),16)<<16|parseInt(t.substring(3,5),16)<<8|parseInt(t.substring(5,7),16),K=t=>parseInt(t.substring(1,3),16)*2**24+65536*parseInt(t.substring(3,5),16)+256*parseInt(t.substring(5,7),16)+parseInt(t.substring(7,9),16),q=t=>[parseInt(t.substring(1,3),16),parseInt(t.substring(3,5),16),parseInt(t.substring(5,7),16)],X=t=>`#${Array.from(t).map((t=>t.toString(16).padStart(2,"0"))).join("")}`,tt=t=>[parseInt(t.substring(1,3),16),parseInt(t.substring(3,5),16),parseInt(t.substring(5,7),16),parseInt(t.substring(7,9),16)],et=t=>`#${Array.from(t).map((t=>t.toString(16).padStart(2,"0"))).join("")}`,nt=t=>q(t).map((t=>Q(t/255))),it=t=>X(Array.from(t).map((t=>Math.round(Z(255*t,0,255))))),ot=t=>tt(t).map((t=>Q(t/255))),rt=t=>et(Array.from(t).map((t=>Math.round(Z(255*t,0,255))))),st=t=>Z(Math.round(255*t),0,255).toString(16).padStart(2,"0"),at=t=>({r:parseInt(t.substring(1,3),16)/255,g:parseInt(t.substring(3,5),16)/255,b:parseInt(t.substring(5,7),16)/255}),lt=t=>({r:parseInt(t.substring(1,3),16)/255,g:parseInt(t.substring(3,5),16)/255,b:parseInt(t.substring(5,7),16)/255,a:parseInt(t.substring(7,9),16)/255}),ut=t=>`rgb(${q(t).join(", ")})`,ct=/^\s*rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)\s*$/,ht=t=>`rgba(${tt(t).map(((t,e)=>3===e?t/255:t)).join(", ")})`,dt=/^\s*rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+\.\d+|\d+)\s*\)\s*$/,mt=t=>{const e=yt(q(t)).map((t=>Y(t)));return`hsl(${e[0]}, ${e[1]}%, ${e[2]}%)`},pt=t=>{const e=kt(tt(t)).map(((t,e)=>3===e?Q(t):Y(t)));return`hsl(${e[0]} ${e[1]}% ${e[2]}% / ${e[3]})`},gt=/^\s*hsl\(\s*(\d+)(?:deg|)\s*(?:,|)\s*(\d+)%\s*(?:,|)\s*(\d+)%\s*\)\s*$/,bt=/^\s*hsl\(\s*(\d+)(?:deg|)\s*(?:,|)\s*(\d+)%\s*(?:,|)\s*(\d+)%\s*\/\s*(\d+\.\d+|\d+)\s*\)\s*$/,ft=(t,e)=>(t%e+e)%e;function vt([t,e,n]){t=ft(t,360),e=Z(e/100,0,1),n=Z(n/100,0,1);const i=e*Math.min(n,1-n);function o(e){const o=(e+t/30)%12;return n-i*Math.max(-1,Math.min(o-3,9-o,1))}return[o(0),o(8),o(4)].map((t=>Math.round(255*t)))}function xt([t,e,n]){const i=Math.max(t,e,n),o=Math.min(t,e,n),r=.5*(o+i),s=i-o;let a=0,l=0;if(0!==s)switch(l=0===r||1===r?0:(i-r)/Math.min(r,1-r),i){case t:a=(e-n)/s+(e{const[e,n,i]=xt(t.map((t=>t/255)));return[360*e,100*n,100*i]},kt=t=>{const[e,n,i,o]=wt(t.map((t=>t/255)));return[360*e,100*n,100*i,o]};function Et([t,e,n]){return e=Z(e,0,1),n=Z(n,0,1),[t,t+2/3,t+1/3].map((t=>R(1,Z(Math.abs(6*J(t)-3)-1,0,1),e)*n))}function It([t,e,n,i]){return[...Et([t,e,n]),i]}const $t=t=>Math.round(1e3*t)/1e3;function Ct([t,e,n]){const i=n>e?[n,e,-1,2/3]:[e,n,0,-1/3],o=i[0]>t?[i[0],i[1],i[3],t]:[t,i[1],i[2],i[0]],r=o[0]-Math.min(o[3],o[1]);return[Math.abs(o[2]+(o[3]-o[1])/(6*r+Number.EPSILON)),r/(o[0]+Number.EPSILON),o[0]].map($t)}function Mt([t,e,n,i]){return[...Ct([t,e,n]),i]}const St=t=>t.endsWith("a")||t.startsWith("hex8"),Vt=[{re:/^#(?:[0-9a-f]){6}$/i,format:"hex6"},{re:/^(?:[0-9a-f]){6}$/i,format:"hex6-no-hash"},{re:/^#(?:[0-9a-f]){8}$/i,format:"hex8"},{re:/^(?:[0-9a-f]){8}$/i,format:"hex8-no-hash"},{re:/^#(?:[0-9a-f]){3}$/i,format:"hex3"},{re:/^(?:[0-9a-f]){3}$/i,format:"hex3-no-hash"},{re:ct,format:"css-rgb"},{re:gt,format:"css-hsl"},{re:dt,format:"css-rgba"},{re:bt,format:"css-hsla"}];function Dt(t){switch(typeof t){case"number":return console.warn('can not reliably guess format based on a number. You should pass in a format like {format: "uint32-rgb"} or {format: "uint32-rgb"}'),t<=16777215?"uint32-rgb":"uint32-rgba";case"string":{const e=function(t){for(const e of Vt)if(e.re.test(t))return e}(t.trim());if(e)return e.format;break}case"object":if(t instanceof Uint8Array||t instanceof Uint8ClampedArray){if(3===t.length)return"uint8-rgb";if(4===t.length)return"uint8-rgba"}else if(t instanceof Float32Array){if(3===t.length)return"float-rgb";if(4===t.length)return"float-rgba"}else if(Array.isArray(t)){if(3===t.length)return"float-rgb";if(4===t.length)return"float-rgba"}else if("r"in t&&"g"in t&&"b"in t)return"a"in t?"object-rgba":"object-rgb"}throw new Error(`unknown color format: ${t}`)}function Nt(t){return t.trim(t)}function At(t){return t.trim(t)}function jt(t){return t[1]===t[2]&&t[3]===t[4]&&t[5]===t[6]?`#${t[1]}${t[3]}${t[5]}`:t}const Ut=/^(#|)([0-9a-f]{3})$/i;function Lt(t){const e=Ut.exec(t);if(e){const[,,t]=e;return"#"+`${(n=t)[0]}${n[0]}${n[1]}${n[1]}${n[2]}${n[2]}`}var n;return t}function Ft(t){return jt(Nt(t))}const Pt=t=>{const e=ct.exec(t);if(!e)return[!1];const n=[e[1],e[2],e[3]].map((t=>parseInt(t)));return[!n.find((t=>t>255)),`rgb(${n.join(", ")})`]},Ot=t=>{const e=dt.exec(t);if(!e)return[!1];const n=[e[1],e[2],e[3],e[4]].map(((t,e)=>3===e?parseFloat(t):parseInt(t)));return[!n.find((t=>t>255)),`rgba(${n.join(", ")})`]},Ht=t=>{const e=gt.exec(t);if(!e)return[!1];const n=[e[1],e[2],e[3]].map((t=>parseFloat(t)));return[!n.find((t=>Number.isNaN(t))),`hsl(${n[0]}, ${n[1]}%, ${n[2]}%)`]},zt=t=>{const e=bt.exec(t);if(!e)return[!1];const n=[e[1],e[2],e[3],e[4]].map((t=>parseFloat(t)));return[!n.find((t=>Number.isNaN(t))),`hsl(${n[0]} ${n[1]}% ${n[2]}% / ${n[3]})`]},Tt=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*$/,Wt=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*$/,Bt=t=>{const e=t.split(",").map((t=>t.trim())),n=e.map((t=>parseFloat(t)));if(3!==n.length)return[!1];const i=e.findIndex((t=>isNaN(t)));return[i<0,n.map((t=>Q(t)))]},Gt=t=>{const e=t.split(",").map((t=>t.trim())),n=e.map((t=>parseFloat(t)));if(4!==n.length)return[!1];const i=e.findIndex((t=>isNaN(t)));return[i<0,n.map((t=>Q(t)))]},Zt=/^\s*(?:0x){0,1}([0-9a-z]{1,6})\s*$/i,Rt=/^\s*(?:0x){0,1}([0-9a-z]{1,8})\s*$/i,Jt=/^\s*#[a-f0-9]{6}\s*$|^\s*#[a-f0-9]{3}\s*$/i,Yt=/^\s*[a-f0-9]{6}\s*$/i,Qt=/^\s*#[a-f0-9]{8}\s*$/i,_t=/^\s*[a-f0-9]{8}\s*$/i,Kt={hex6:{color:{from:t=>[!0,t],to:Nt},text:{from:t=>[Jt.test(t),t.trim()],to:t=>t}},hex8:{color:{from:t=>[!0,t],to:At},text:{from:t=>[Qt.test(t),t.trim()],to:t=>t}},hex3:{color:{from:t=>[!0,Ft(t)],to:Lt},text:{from:t=>[Jt.test(t),jt(t.trim())],to:t=>t}},"hex6-no-hash":{color:{from:t=>[!0,t.substring(1)],to:t=>`#${Nt(t)}`},text:{from:t=>[Yt.test(t),t.trim()],to:t=>t}},"hex8-no-hash":{color:{from:t=>[!0,t.substring(1)],to:t=>`#${At(t)}`},text:{from:t=>[_t.test(t),t.trim()],to:t=>t}},"hex3-no-hash":{color:{from:t=>[!0,Ft(t).substring(1)],to:Lt},text:{from:t=>[Yt.test(t),jt(t.trim())],to:t=>t}},"uint32-rgb":{color:{from:t=>[!0,_(t)],to:t=>`#${Math.round(t).toString(16).padStart(6,"0")}`},text:{from:t=>(t=>{const e=Zt.exec(t);return e?[!0,parseInt(e[1],16)]:[!1]})(t),to:t=>`0x${t.toString(16).padStart(6,"0")}`}},"uint32-rgba":{color:{from:t=>[!0,K(t)],to:t=>`#${Math.round(t).toString(16).padStart(8,"0")}`},text:{from:t=>(t=>{const e=Rt.exec(t);return e?[!0,parseInt(e[1],16)]:[!1]})(t),to:t=>`0x${t.toString(16).padStart(8,"0")}`}},"uint8-rgb":{color:{from:t=>[!0,q(t)],to:X},text:{from:t=>{const e=Tt.exec(t);if(!e)return[!1];const n=[e[1],e[2],e[3]].map((t=>parseInt(t)));return[!n.find((t=>t>255)),n]},to:t=>t.join(", ")}},"uint8-rgba":{color:{from:t=>[!0,tt(t)],to:et},text:{from:t=>{const e=Wt.exec(t);if(!e)return[!1];const n=[e[1],e[2],e[3],e[4]].map((t=>parseInt(t)));return[!n.find((t=>t>255)),n]},to:t=>t.join(", ")}},"float-rgb":{color:{from:t=>[!0,nt(t)],to:it},text:{from:Bt,to:t=>Array.from(t).map((t=>Q(t))).join(", ")}},"float-rgba":{color:{from:t=>[!0,ot(t)],to:rt},text:{from:Gt,to:t=>Array.from(t).map((t=>Q(t))).join(", ")}},"float-hsv":{color:{from:t=>[!0,Ct(nt(t))],to:t=>Et(it(t))},text:{from:Bt,to:t=>Array.from(t).map((t=>Q(t))).join(", ")}},"float-hsva":{color:{from:t=>[!0,Mt(nt(t))],to:t=>It(it(t))},text:{from:Gt,to:t=>Array.from(t).map((t=>Q(t))).join(", ")}},"object-rgb":{color:{from:t=>[!0,at(t)],to:t=>`#${st(t.r)}${st(t.g)}${st(t.b)}`},text:{from:t=>{try{const e=t.replace(/([a-z])/g,'"$1"'),n=JSON.parse(e);if(Number.isNaN(n.r)||Number.isNaN(n.g)||Number.isNaN(n.b))throw new Error("not {r, g, b}");return[!0,n]}catch(t){return[!1]}},to:t=>`{r:${Q(t.r)}, g:${Q(t.g)}, b:${Q(t.b)}}`}},"object-rgba":{color:{from:t=>[!0,lt(t)],to:t=>`#${st(t.r)}${st(t.g)}${st(t.b)}${st(t.a)}`},text:{from:t=>{try{const e=t.replace(/([a-z])/g,'"$1"'),n=JSON.parse(e);if(Number.isNaN(n.r)||Number.isNaN(n.g)||Number.isNaN(n.b)||Number.isNaN(n.a))throw new Error("not {r, g, b, a}");return[!0,n]}catch(t){return[!1]}},to:t=>`{r:${Q(t.r)}, g:${Q(t.g)}, b:${Q(t.b)}}, a:${Q(t.a)}}`}},"css-rgb":{color:{from:t=>[!0,ut(t)],to:t=>{const e=ct.exec(t);return X([e[1],e[2],e[3]].map((t=>parseInt(t))))}},text:{from:Pt,to:t=>Pt(t)[1]}},"css-rgba":{color:{from:t=>[!0,ht(t)],to:t=>{const e=dt.exec(t);return et([e[1],e[2],e[3],e[4]].map(((t,e)=>3===e?255*parseFloat(t)|0:parseInt(t))))}},text:{from:Ot,to:t=>Ot(t)[1]}},"css-hsl":{color:{from:t=>[!0,mt(t)],to:t=>{const e=gt.exec(t),n=vt([e[1],e[2],e[3]].map((t=>parseFloat(t))));return X(n)}},text:{from:Ht,to:t=>Ht(t)[1]}},"css-hsla":{color:{from:t=>[!0,pt(t)],to:t=>{const e=bt.exec(t),n=function([t,e,n,i]){return[...vt([t,e,n]),255*i|0]}([e[1],e[2],e[3],e[4]].map((t=>parseFloat(t))));return et(n)}},text:{from:zt,to:t=>zt(t)[1]}}};class qt extends p{constructor(t,n){super(e(t,{className:n}))}}class Xt extends V{#N;constructor(t){super("muigui-canvas",t),this.#N=this.add(new qt("canvas","muigui-canvas")).domElement}get canvas(){return this.#N}listen(){return this}}class te extends v{#I;#$;#A;#M;#u={converters:A};constructor(t,n){const i=e("input",{type:"color",onInput:()=>{const[e,n]=this.#$(i.value);e&&(this.#M=!0,t.setValue(n))},onChange:()=>{const[e,n]=this.#$(i.value);e&&(this.#M=!0,t.setFinalValue(n))}});super(e("div",{},[i])),this.setOptions(n),this.#A=i}updateDisplay(t){this.#M||(this.#A.value=this.#I(t)),this.#M=!1}setOptions(t){l(this.#u,t);const{converters:{to:e,from:n}}=this.#u;return this.#I=e,this.#$=n,this}}class ee extends D{#j;#V;constructor(t,e,n={}){super(t,e,"muigui-color");const i=n.format||Dt(this.getValue()),{color:o,text:r}=Kt[i];this.#j=this.add(new te(this,{converters:o})),this.#V=this.add(new B(this,{converters:r})),this.updateDisplay()}setOptions(t){const{format:e}=t;if(e){const{color:t,text:n}=Kt[e];this.#j.setOptions({converters:t}),this.#V.setOptions({converters:n})}return super.setOptions(t),this}}class ne extends g{constructor(){super("muigui-divider")}}class ie extends g{#U;#L;constructor(t){super(t),this.#U=[],this.#L=this}get children(){return this.#U}get controllers(){return this.#U.filter((t=>!(t instanceof ie)))}get folders(){return this.#U.filter((t=>t instanceof ie))}reset(t=!0){for(const e of this.#U)e instanceof ie&&!t||e.reset(t);return this}updateDisplay(){for(const t of this.#U)t.updateDisplay();return this}remove(t){const e=this.#U.indexOf(t);if(e>=0){const t=this.#U.splice(e,1)[0];t.domElement.remove(),t.setParent(null)}return this}#F(t){return this.domElement.appendChild(t.domElement),this.#U.push(t),t.setParent(this),t}addController(t){return this.#L.#F(t)}pushContainer(t){return this.addController(t),this.#L=t,t}popContainer(){return this.#L=this.#L.parent,this}listen(){return this.#U.forEach((t=>{t.listen()})),this}}class oe extends ie{#P;constructor(t="Controls",n="muigui-menu"){super(n),this.#P=e("label"),this.addElem(e("button",{type:"button",onClick:()=>this.toggleOpen()},[this.#P])),this.pushContainer(new ie("muigui-open-container")),this.pushContainer(new ie),this.name(t),this.open()}open(t=!0){return this.domElement.classList.toggle("muigui-closed",!t),this.domElement.classList.toggle("muigui-open",t),this}close(){return this.open(!1)}name(t){return this.#P.textContent=t,this}title(t){return this.name(t)}toggleOpen(){return this.open(!this.domElement.classList.contains("muigui-open")),this}}class re extends g{constructor(t){super("muigui-label"),this.text(t)}text(t){return this.domElement.textContent=t,this}}function se(){}function ae(t,e,n){const i=t.getBoundingClientRect(),o=e.clientX-i.left,r=e.clientY-i.top,s=o/i.width,a=r/i.height,l=o-(n=n||[o,r])[0],u=r-n[1];return{x:o,y:r,nx:s,ny:a,dx:l,dy:u,ndx:l/i.width,ndy:u/i.width}}function le(t,{onDown:e=se,onMove:n=se,onUp:i=se}){let o;const r=function(e){const i={type:"move",...ae(t,e,o)};n(i)},s=function(e){t.releasePointerCapture(e.pointerId),t.removeEventListener("pointermove",r),t.removeEventListener("pointerup",s),document.body.style.backgroundColor="",i("up")},a=function(n){t.addEventListener("pointermove",r),t.addEventListener("pointerup",s),t.setPointerCapture(n.pointerId);const i=ae(t,n);o=[i.x,i.y],e({type:"down",...i})};return t.addEventListener("pointerdown",a),function(){t.removeEventListener("pointerdown",a)}}function ue(t){return t.querySelectorAll("[data-src]").forEach((e=>{const i="muigui-id-"+n++;e.id=i,t.querySelectorAll(`[data-target=${e.dataset.src}]`).forEach((t=>{t.setAttribute("fill",`url(#${i})`)}))})),t}class ce extends v{#I;#$;#O;#H;#z;#T;#W;#B;#G;#Z;#R;#J;#Y;#Q;#u={converters:A,alpha:!1};#_;#K;constructor(t,n){super(e("div",{innerHTML:'\n\n \n \n \n \n \n \n \n \n\n \n \n \n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n \n \n \n \n \n \n \n \n\n',className:"muigui-no-scroll"})),this.#O=this.domElement.children[0],this.#z=this.domElement.children[1],this.#B=this.domElement.children[2],ue(this.#O),ue(this.#z),ue(this.#B),this.#H=this.$(".muigui-color-chooser-circle"),this.#T=this.$("[data-src=muigui-color-chooser-hue]"),this.#W=this.$(".muigui-color-chooser-hue-cursor"),this.#G=this.$("[data-src=muigui-color-chooser-alpha]"),this.#Z=this.$(".muigui-color-chooser-alpha-cursor");const i=e=>{const n=o(e.nx,0,1),i=o(e.ny,0,1);this.#R[1]=n,this.#R[2]=1-i,this.#J=!0,this.#Q=!0;const[r,s]=this.#$(this.#_(this.#R));r&&t.setValue(s)},r=e=>{const n=o(e.nx,0,1);this.#R[0]=n,this.#Y=!0,this.#Q=!0;const[i,r]=this.#$(this.#_(this.#R));i&&t.setValue(r)},s=e=>{const n=o(e.nx,0,1);this.#R[3]=n,this.#J=!0,this.#Y=!0;const[i,r]=this.#$(this.#_(this.#R));i&&t.setValue(r)};le(this.#O,{onDown:i,onMove:i}),le(this.#z,{onDown:r,onMove:r}),le(this.#B,{onDown:s,onMove:s}),this.setOptions(n)}updateDisplay(t){this.#R||(this.#R=this.#K(this.#I(t)));{const[e,n,i,o=1]=this.#K(this.#I(t));this.#J||(this.#R[0]=n>.001&&i>.001?e:this.#R[0]),this.#Y||(this.#R[1]=n,this.#R[2]=i),this.#Q||(this.#R[3]=o)}{const[t,e,n,i]=this.#R,[o,r,s]=wt(It(this.#R));this.#J||this.#W.setAttribute("transform",`translate(${64*t}, 0)`),this.#T.children[0].setAttribute("stop-color",`hsl(${360*o} 0% 100% / ${i})`),this.#T.children[1].setAttribute("stop-color",`hsl(${360*o} 100% 50% / ${i})`),this.#Q||this.#Z.setAttribute("transform",`translate(${64*i}, 0)`),this.#G.children[0].setAttribute("stop-color",`hsl(${360*o} ${100*r}% ${100*s}% / 0)`),this.#G.children[1].setAttribute("stop-color",`hsl(${360*o} ${100*r}% ${100*s}% / 1)`),this.#Y||(this.#H.setAttribute("cx",""+64*e),this.#H.setAttribute("cy",""+48*(1-n)))}this.#J=!1,this.#Y=!1,this.#Q=!1}setOptions(t){l(this.#u,t);const{converters:{to:e,from:n},alpha:i}=this.#u;return this.#B.style.display=i?"":"none",this.#_=i?t=>rt(It(t)):t=>it(Et(t)),this.#K=i?t=>Mt(ot(t)):t=>Ct(nt(t)),this.#I=e,this.#$=n,this}}class he extends D{#q;#X;#f;#tt;#u={open:!1};constructor(t,n,i={}){super(t,n,"muigui-pop-down-controller"),this.#q=this.add(new qt("div","muigui-pop-down-top"));const o=this.#q.addElem(e("input",{type:"checkbox",onChange:()=>{this.#u.open=o.checked,this.updateDisplay()}}));this.#f=o,this.#X=this.#q.add(new qt("div","muigui-pop-down-values"));const r=new qt("div","muigui-pop-down-bottom muigui-open-container");this.#tt=new qt("div"),r.add(this.#tt),this.add(r),this.setOptions(i)}setKnobColor(t){this.#f&&(this.#f.style=`\n --range-color: ${t};\n --value-bg-color: ${t};\n `)}updateDisplay(){super.updateDisplay();const{open:t}=this.#u;this.domElement.children[1].classList.toggle("muigui-open",t),this.domElement.children[1].classList.toggle("muigui-closed",!t)}setOptions(t){l(this.#u,t),super.setOptions(t),this.updateDisplay()}addTop(t){return this.#X.add(t)}addBottom(t){return this.#tt.add(t)}}class de extends he{#j;#V;#I;constructor(t,e,n={}){super(t,e,"muigui-color-chooser");const i=n.format||Dt(this.getValue()),{color:o,text:r}=Kt[i];this.#I=o.to,this.#V=new B(this,{converters:r,alpha:St(i)}),this.#j=new ce(this,{converters:o,alpha:St(i)}),this.addTop(this.#V),this.addBottom(this.#j),this.___setKnobHelper=!0,this.updateDisplay()}#et(){if(this.#I){const t=this.#I(this.getValue()),e=9===t.length?t.substring(7,9):"FF",n=yt(q(t));n[2]=(n[2]+50)%100;const i=X(vt(n));this.setKnobColor(`${t.substring(0,7)}${e}`,i)}}updateDisplay(){super.updateDisplay(),this.___setKnobHelper&&this.#et()}setOptions(t){return super.setOptions(t),this}}function me(t){return function(t){return t.replace(/(.)([A-Z][a-z]+)/g,"$1_$2").replace(/([a-z0-9])([A-Z])/g,"$1_$2").toLowerCase()}(t.toString()).replaceAll("_"," ")}class pe extends oe{add(t,e,...n){const i=t instanceof g?t:function(t,e,...n){const[i]=n;if(Array.isArray(i))return new z(t,e,{keyValues:i});if(i&&i.keyValues)return new z(t,e,{keyValues:i.keyValues});const o=typeof t[e];switch(o){case"number":if("number"==typeof n[0]&&"number"==typeof n[1]){const i=n[0],o=n[1],r=n[2];return new W(t,e,{min:i,max:o,...r&&{step:r}})}return 0===n.length?new P(t,e,...n):new W(t,e,...n);case"boolean":return new N(t,e,...n);case"function":return new b(t,e,...n);case"string":return new G(t,e,...n);case"undefined":throw new Error(`no property named ${e}`);default:throw new Error(`unhandled type ${o} for property ${e}`)}}(t,e,...n).name(me(e));return this.addController(i)}addCanvas(t){return this.addController(new Xt(t))}addColor(t,e,n={}){const i=t[e];return St(n.format||Dt(i))?this.addController(new de(t,e,n)).name(me(e)):this.addController(new ee(t,e,n)).name(me(e))}addDivider(){return this.addController(new ne)}addFolder(t){return this.addController(new pe(t))}addLabel(t){return this.addController(new re(t))}addButton(t,e){const n={fn:e};return this.add(n,"fn").name(me(t))}}class ge extends HTMLElement{constructor(){super(),this.shadow=this.attachShadow({mode:"open"})}}customElements.define("muigui-element",ge);const be=new CSSStyleSheet,fe=new CSSStyleSheet;function ve(t){let e,n;function i(){if(e&&!n){const o=e;e=void 0,n=t.replace(o).then((()=>{n=void 0,i()}))}}return function(t){e=t,i()}}const xe=ve(be),we=ve(fe);function ye(e){const{include:n,css:i}=t.themes[e];return`${n.map((e=>t[e])).join("\n")} : css.default}\n${i||""}`}class ke extends pe{static converters=U;static mapRange=u;static makeRangeConverters=c;static makeRangeOptions=h;static makeMinMaxPair=m;#nt=new CSSStyleSheet;constructor(n={}){super("Controls","muigui-root"),n instanceof HTMLElement&&(n={parent:n});const{autoPlace:i=!0,width:o,title:r="Controls"}=n;let{parent:s}=n;if(o&&(this.domElement.style.width=/^\d+$/.test(o)?`${o}px`:o),void 0===s&&i&&(s=document.body,this.domElement.classList.add("muigui-auto-place")),s){const t=e("muigui-element");t.shadowRoot.adoptedStyleSheets=[this.#nt,be,fe],t.shadow.appendChild(this.domElement),s.appendChild(t)}r&&this.title(r),this.#nt.replaceSync(t.default),this.domElement.classList.add("muigui","muigui-colors")}setStyle(t){this.#nt.replace(t)}static setBaseStyles(t){xe(t)}static getBaseStyleSheet(){return be}static setUserStyles(t){we(t)}static getUserStyleSheet(){return fe}setTheme(t){this.setStyle(ye(t))}static setTheme(t){ke.setBaseStyles(ye(t))}}function Ee(){}const Ie={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]};function $e(t,{onDown:e=Ee,onUp:n=Ee}){const i=function(t){const i=t.shiftKey?10:1,[o,r]=(Ie[t.key]||[0,0]).map((t=>t*i));("keydown"===t.type?e:n)({type:t.type.substring(3),dx:o,dy:r,event:t})};return t.addEventListener("keydown",i),t.addEventListener("keyup",i),function(){t.removeEventListener("keydown",i),t.removeEventListener("keyup",i)}}function Ce(t,e=""){if(!t)throw new Error(e)}function Me(t,e,n,i,o,r){const s=Math.abs(n)*Math.cos(r),a=Math.abs(i)*Math.sin(r);return[t+Math.cos(o)*s-Math.sin(o)*a,e+Math.sin(o)*s+Math.cos(o)*a]}function Se(t,e,n,i,o){Ce(Math.abs(i-o)<=2*Math.PI),Ce(i>=-Math.PI&&i<=2*Math.PI),Ce(i<=o),Ce(o>=-Math.PI&&o<=4*Math.PI);const{x1:r,y1:s,x2:a,y2:l,fa:u,fs:c}=function(t,e,n,i,o,r,s){const[a,l]=Me(t,e,n,i,o,r),[u,c]=Me(t,e,n,i,o,r+s);return{x1:a,y1:l,x2:u,y2:c,fa:Math.abs(s)>Math.PI?1:0,fs:s>0?1:0}}(t,e,n,n,0,i,o-i);return Math.abs(Math.abs(i-o)-2*Math.PI)>Number.EPSILON?`M${t} ${e} L${r} ${s} A ${n} ${n} 0 ${u} ${c} ${a} ${l} L${t} ${e}`:`M${r} ${s} L${r} ${s} A ${n} ${n} 0 ${u} ${c} ${a} ${l}`}const Ve=t=>a(t+Math.PI,2*Math.PI)-Math.PI;class De extends v{#it;#ot;#rt;#st;#u={step:1,min:-180,max:180,dirMin:-Math.PI,dirMax:Math.PI,wrap:void 0,converters:A};constructor(t,n={}){const i=L();super(e("div",{className:"muigui-direction muigui-no-scroll",innerHTML:'\n\n \x3c!----\x3e\n \n \n \n \n \n \n\n',onWheel:e=>{e.preventDefault();const{min:n,max:r,step:l}=this.#u,u=i(e,l);let c=this.#rt+u;this.#st&&(c=a(c-n,r-n)+n);const h=o(s(c,(t=>t),l),n,r);t.setValue(h)}}));const r=e=>{const{min:n,max:i,step:r,dirMin:a,dirMax:l}=this.#u,u=2*e.nx-1,c=2*e.ny-1,h=Math.atan2(c,u),d=(a+l)/2,m=o((Ve(h-d)-Ve(a-d))/(l-a),0,1),p=s(n+(i-n)*m,(t=>t),r);t.setValue(p)};le(this.domElement,{onDown:r,onMove:r}),$e(this.domElement,{onDown:e=>{const{min:n,max:i,step:r}=this.#u,a=o(s(this.#rt+e.dx*r,(t=>t),r),n,i);t.setValue(a)}}),this.#it=this.$("#muigui-arrow"),this.#ot=this.$("#muigui-range"),this.setOptions(n)}updateDisplay(t){this.#rt=t;const{min:e,max:n}=this.#u,i=(t-e)/(n-e),o=(r=this.#u.dirMin,s=this.#u.dirMax,r+(s-r)*i);var r,s;this.#it.style.transform=`rotate(${o}rad)`}setOptions(t){l(this.#u,t);const{dirMin:e,dirMax:n,wrap:i}=this.#u;this.#st=void 0!==i?i:Math.abs(e-n)>=2*Math.PI-Number.EPSILON;const[o,r]=e(o.push(i),e("label",{},[e("input",{type:"radio",name:r,value:a,onChange:function(){this.checked&&t.setFinalValue(s.#D[this.value])}}),e("button",{type:"button",textContent:n,onClick:function(){this.previousElementSibling.click()}})]))))));const s=this;this.#D=o,this.cols(i)}updateDisplay(t){const e=this.#D.indexOf(t);for(let t=0;t{e({rect:t.getBoundingClientRect(),elem:t})})).observe(t)}function Le(t,e,n,i){Ue(t,(({rect:o})=>{const{width:r,height:s}=o;t.setAttribute("viewBox",`-${r*e} -${s*n} ${r} ${s}`),i({elem:t,rect:o})}))}function Fe(t,e,n,i,o,r){const a=[];tt),n)),e=Math.min(e,o);for(let i=t;i<=e;i+=n)a.push(`M${i} 0 l0 ${r}`);return a.join(" ")}class Pe extends v{#at;#lt;#ut;#ct;#ht;#dt;#mt;#pt;#gt;#rt;#bt;#u={min:-100,max:100,step:1,unit:10,unitSize:10,ticksPerUnit:5,labelFn:t=>t,tickHeight:1,limits:!0,thicksColor:void 0,orientation:void 0};constructor(t,n){const i=L();let r;super(e("div",{innerHTML:'\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \x3c!----\x3e\n \x3c!----\x3e\n \n \n \n \n\n',className:"muigui-no-v-scroll",onWheel:e=>{e.preventDefault();const{min:n,max:r,step:a}=this.#u,l=i(e,a),u=o(s(this.#rt+l,(t=>t),a),n,r);t.setValue(u)}})),this.#at=this.$("svg"),this.#lt=this.$("#muigui-origin"),this.#ut=this.$("#muigui-ticks"),this.#ct=this.$("#muigui-thicks"),this.#ht=this.$("#muigui-numbers"),this.#dt=this.$("#muigui-left-grad"),this.#mt=this.$("#muigui-right-grad"),this.setOptions(n),le(this.domElement,{onDown:()=>{r=this.#rt},onMove:e=>{const{min:n,max:i,unitSize:a,unit:l,step:u}=this.#u,c=o(s(r-e.dx/a*l,(t=>t),u),n,i);t.setValue(c)}}),$e(this.domElement,{onDown:e=>{const{min:n,max:i,step:r}=this.#u,a=o(s(this.#rt+e.dx*r,(t=>t),r),n,i);t.setValue(a)}}),Le(this.#at,.5,0,(({rect:{width:t}})=>{this.#dt.setAttribute("x",-t/2),this.#mt.setAttribute("x",t/2-20),this.#bt=function(t){const e=t.innerHTML;t.innerHTML="- ";const n=t.querySelector("text").getComputedTextLength();return t.innerHTML=e,n}(this.#ht),this.#pt=t,this.#ft()}))}#ft(){if(!this.#pt||void 0===this.#rt)return;const{labelFn:t,limits:e,min:n,max:i,orientation:o,tickHeight:r,ticksPerUnit:a,unit:l,unitSize:u,thicksColor:c}=this.#u,h=Math.ceil(this.#pt/u),d=this.#rt/l,m=Math.round(d-h),p=m*u,g=(m+2*h)*u,b=e?n*u/l:p,f=e?i*u/l:g,v=""===t(1)?10:5;a>1&&this.#ut.setAttribute("d",Fe(p,g,u/a,b,f,v*r)),this.#ct.style.stroke=c,this.#ct.setAttribute("d",Fe(p,g,u,b,f,v)),this.#ht.innerHTML=function(t,e,n,i,o,r,a,l){const u=[];tt),n)),e=Math.min(e,a);const c=Math.max(0,-Math.log10(i));for(let r=t;r<=e;r+=n)u.push(`${h=r/n*i,l(h.toFixed(c))}`);var h;return u.join("\n")}(p,g,u,l,this.#bt,b,f,t),this.#lt.setAttribute("transform",`translate(${-this.#rt*u/l} 0)`),this.#at.classList.toggle("muigui-slider-up","up"===o)}updateDisplay(t){this.#rt=t,this.#ft()}setOptions(t){return l(this.#u,t),this}}class Oe extends D{constructor(t,e,n={}){super(t,e,"muigui-slider"),this.add(new Pe(this,n)),this.add(new F(this,n)),this.updateDisplay()}}class He extends v{#at;#it;#H;#rt=[];constructor(t){super(e("div",{innerHTML:'\n\n \n \n \n \n \n\n',className:"muigui-no-scroll"}));const n=e=>{const{width:n,height:i}=this.#at.getBoundingClientRect(),o=2*e.nx-1,r=2*e.ny-1;t.setValue([o*n*.5,r*i*.5])};le(this.domElement,{onDown:n,onMove:n}),this.#at=this.$("svg"),this.#it=this.$("#muigui-arrow"),this.#H=this.$("#muigui-circle"),Le(this.#at,.5,.5,(()=>this.#vt))}#vt(){const[t,e]=this.#rt;this.#it.setAttribute("d",`M0,0L${t},${e}`),this.#H.setAttribute("transform",`translate(${t}, ${e})`)}updateDisplay(t){this.#rt[0]=t[0],this.#rt[1]=t[1],this.#vt()}}class ze extends he{constructor(t,e){super(t,e,"muigui-vec2");const n=t=>({setValue:e=>{const n=this.getValue();n[t]=e,this.setValue(n)},setFinalValue:e=>{const n=this.getValue();n[t]=e,this.setFinalValue(n)}});this.addTop(new F(n(0),{converters:{to:t=>t[0],from:j.from}})),this.addTop(new F(n(1),{converters:{to:t=>t[1],from:j.from}})),this.addBottom(new He(this)),this.updateDisplay()}}const Te={main:"#ddd"},We={main:"#333"},Be=window.matchMedia("(prefers-color-scheme: dark)");let Ge,Ze;function Re(){Ze=Be.matches,Ge=Ze?Te:We}Be.addEventListener("change",Re),Re();const Je={graph:function(t,e,{min:n=-1,max:i=1,interval:o=16,color:r}){const s=t.getContext("2d");setInterval((function(){const{width:o,height:a}=t;s.clearRect(0,0,o,a),s.beginPath();const l=i-n;for(let t=0;t{t.text(JSON.stringify(e[n],null,2))}),i)}};export{de as ColorChooser,Ne as Direction,je as RadioGrid,W as Range,z as Select,Oe as Slider,P as TextNumber,ze as Vec2,ke as default,Je as helpers}; //# sourceMappingURL=muigui.module.min.js.map diff --git a/dist/0.x/muigui.module.min.js.map b/dist/0.x/muigui.module.min.js.map index 7a3e54f..09eed26 100644 --- a/dist/0.x/muigui.module.min.js.map +++ b/dist/0.x/muigui.module.min.js.map @@ -1 +1 @@ -{"version":3,"file":"muigui.module.min.js","sources":["../../src/styles/muigui.css.js","../../src/libs/elem.js","../../src/libs/utils.js","../../../src/views/View.ts","../../src/controllers/Controller.js","../../src/controllers/Button.js","../../src/views/EditView.js","../../src/views/CheckboxView.js","../../src/libs/taskrunner.js","../../src/libs/ids.js","../../src/views/ValueView.js","../../src/controllers/LabelController.js","../../src/controllers/ValueController.js","../../src/controllers/Checkbox.js","../../src/libs/conversions.js","../../src/libs/wheel.js","../../src/views/NumberView.js","../../src/controllers/TextNumber.js","../../src/views/SelectView.js","../../src/libs/key-values.js","../../src/controllers/Select.js","../../src/views/RangeView.js","../../src/controllers/Range.js","../../src/views/TextView.js","../../src/controllers/Text.js","../../src/libs/color-utils.js","../../src/views/ElementView.js","../../src/controllers/Canvas.js","../../src/views/ColorView.js","../../src/controllers/Color.js","../../src/controllers/Divider.js","../../src/controllers/Container.js","../../src/controllers/Folder.js","../../src/controllers/Label.js","../../src/libs/touch.js","../../src/views/ColorChooserView.js","../../src/controllers/PopDownController.js","../../src/controllers/ColorChooser.js","../../src/muigui.js","../../src/controllers/create-controller.js","../../src/libs/keyboard.js","../../src/libs/assert.js","../../src/libs/svg.js","../../src/views/DirectionView.js","../../src/controllers/Direction.js","../../src/views/RadioGridView.js","../../src/controllers/RadioGrid.js","../../src/libs/resize-helpers.js","../../src/views/SliderView.js","../../src/controllers/Slider.js","../../src/views/Vec2View.js","../../src/controllers/Vec2.js","../../src/libs/graph.js","../../../src/esm.ts","../../src/libs/monitor.js"],"sourcesContent":["export default {\n default: `\n.muigui {\n --bg-color: #ddd;\n --color: #222;\n --contrast-color: #eee;\n --value-color: #145 ;\n --value-bg-color: #eeee;\n --disabled-color: #999;\n --menu-bg-color: #f8f8f8;\n --menu-sep-color: #bbb;\n --hover-bg-color: #999;\n --focus-color: #8BF;\n --range-color: #AAA;\n --invalid-color: #FF0000;\n --selected-color: rgb(255, 255, 255, 0.9);\n\n --button-bg-color: var(--value-bg-color);\n\n --image-open: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjNDQ0OyIgeD0iMjAlIiB5PSI0NSUiIHdpZHRoPSI2MCUiIGhlaWdodD0iMTAlIj48L3JlY3Q+Cjwvc3ZnPg==);\n --image-closed: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjNDQ0OyIgeD0iNDUlIiB5PSIyMCUiIHdpZHRoPSIxMCUiIGhlaWdodD0iNjAlIj48L3JlY3Q+CiAgPHJlY3Qgc3R5bGU9ImZpbGw6ICM0NDQ7IiB4PSIyMCUiIHk9IjQ1JSIgd2lkdGg9IjYwJSIgaGVpZ2h0PSIxMCUiPjwvcmVjdD4KPC9zdmc+);\n --image-checkerboard: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjNDA0MDQwOyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSI+PC9yZWN0PgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjODA4MDgwOyIgeD0iMCIgeT0iMCIgd2lkdGg9IjUwJSIgaGVpZ2h0PSI1MCUiPjwvcmVjdD4KICA8cmVjdCBzdHlsZT0iZmlsbDogIzgwODA4MDsiIHg9IjUwJSIgeT0iNTAlIiB3aWR0aD0iNTAlIiBoZWlnaHQ9IjUwJSI+PC9yZWN0Pgo8L3N2Zz4=);\n\n --range-left-color: var(--value-color);\n --range-right-color: var(--value-bg-color); \n --range-right-hover-color: var(--hover-bg-color);\n --button-image: \n linear-gradient(\n rgba(255, 255, 255, 1), rgba(0, 0, 0, 0.2)\n );\n\n color: var(--color);\n background-color: var(--bg-color);\n}\n\n@media (prefers-color-scheme: dark) {\n .muigui {\n --bg-color: #222222;\n --color: #dddddd;\n --contrast-color: #000;\n --value-color: #43e5f7;\n --value-bg-color: #444444;\n --disabled-color: #666666;\n --menu-bg-color: #080808;\n --menu-sep-color: #444444;\n --hover-bg-color: #666666;\n --focus-color: #458; /*#88AAFF*/;\n --range-color: #888888;\n --invalid-color: #FF6666;\n --selected-color: rgba(255, 255, 255, 0.3);\n\n --button-bg-color: var(--value-bg-color);\n\n --range-left-color: var(--value-color);\n --range-right-color: var(--value-bg-color); \n --range-right-hover-color: var(--hover-bg-color);\n --button-image: linear-gradient(\n rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.4)\n );\n\n color: var(--color);\n background-color: var(--bg-color);\n\n --image-closed: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjREREOyIgeD0iMjAlIiB5PSI0NSUiIHdpZHRoPSI2MCUiIGhlaWdodD0iMTAlIj48L3JlY3Q+Cjwvc3ZnPg==);\n --image-open: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjREREOyIgeD0iNDUlIiB5PSIyMCUiIHdpZHRoPSIxMCUiIGhlaWdodD0iNjAlIj48L3JlY3Q+CiAgPHJlY3Qgc3R5bGU9ImZpbGw6ICNEREQ7IiB4PSIyMCUiIHk9IjQ1JSIgd2lkdGg9IjYwJSIgaGVpZ2h0PSIxMCUiPjwvcmVjdD4KPC9zdmc+);\n }\n}\n\n.muigui {\n --width: 250px;\n --label-width: 45%;\n --number-width: 40%;\n\n --font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Arial, sans-serif;\n --font-size: 11px;\n --font-family-mono: Menlo, Monaco, Consolas, \"Droid Sans Mono\", monospace;\n --font-size-mono: 11px;\n\n --line-height: 1.7em;\n --border-radius: 0px;\n\n width: var(--width);\n font-family: var(--font-family);\n font-size: var(--font-size);\n box-sizing: border-box;\n line-height: 100%;\n}\n.muigui * {\n box-sizing: inherit;\n}\n\n.muigui-no-scroll {\n touch-action: none;\n}\n.muigui-no-h-scroll {\n touch-action: pan-y;\n}\n.muigui-no-v-scroll {\n touch-action: pan-x;\n}\n\n.muigui-invalid-value {\n background-color: red !important;\n color: white !important;\n}\n\n.muigui-grid {\n display: grid;\n}\n.muigui-rows {\n display: flex;\n flex-direction: column;\n\n min-height: 20px;\n border: 2px solid red;\n}\n.muigui-columns {\n display: flex;\n flex-direction: row;\n\n height: 20px;\n border: 2px solid green;\n}\n.muigui-rows>*,\n.muigui-columns>* {\n flex: 1 1 auto;\n align-items: stretch;\n min-height: 0;\n min-width: 0;\n}\n\n.muigui-row {\n border: 2px solid yellow;\n min-height: 10px\n}\n.muigui-column {\n border: 2px solid lightgreen;\n}\n\n/* -------- */\n\n.muigui-show { /* */ }\n.muigui-hide { \n display: none !important;\n}\n.muigui-disabled {\n pointer-events: none;\n --color: var(--disabled-color) !important;\n --value-color: var(--disabled-color) !important;\n --range-left-color: var(--disabled-color) !important;\n}\n\n.muigui canvas,\n.muigui svg {\n display: block;\n border-radius: var(--border-radius);\n}\n.muigui canvas {\n background-color: var(--value-bg-color);\n}\n\n.muigui-controller {\n min-width: 0;\n min-height: var(--line-height);\n}\n.muigui-root {\n z-index: 1;\n}\n.muigui-root,\n.muigui-menu {\n display: flex;\n flex-direction: column;\n position: relative;\n user-select: none;\n height: fit-content;\n margin: 0;\n padding-bottom: 0.1em;\n border-radius: var(--border-radius);\n}\n.muigui-menu {\n border-bottom: 1px solid var(--menu-sep-color);\n}\n\n.muigui-root>button:nth-child(1),\n.muigui-menu>button:nth-child(1) {\n border-top: 1px solid var(--menu-sep-color);\n border-bottom: 1px solid var(--menu-sep-color);\n position: relative;\n text-align: left;\n color: var(--color);\n background-color: var(--menu-bg-color);\n min-height: var(--line-height);\n padding: 0.2em;\n cursor: pointer;\n border-radius: var(--border-radius);\n}\n.muigui-root>div:nth-child(2),\n.muigui-menu>div:nth-child(2) {\n flex: 1 1 auto;\n}\n\n.muigui-controller {\n margin-left: 0.2em;\n margin-right: 0.2em;\n}\n.muigui-root.muigui-controller,\n.muigui-menu.muigui-controller {\n margin-left: 0;\n margin-right: 0;\n}\n.muigui-controller>*:nth-child(1) {\n flex: 1 0 var(--label-width);\n min-width: 0;\n /* white-space: pre; why?? */\n}\n.muigui-controller>label:nth-child(1) {\n place-content: center start;\n display: inline-grid;\n overflow: hidden;\n}\n.muigui-controller>*:nth-child(2) {\n flex: 1 1 75%;\n min-width: 0;\n}\n\n/* -----------------------------------------\n a label controller is [[label][value]]\n*/\n\n.muigui-label-controller {\n display: flex;\n margin: 0.4em 0 0.4em 0;\n word-wrap: initial;\n align-items: stretch;\n}\n\n.muigui-value {\n display: flex;\n align-items: stretch;\n}\n.muigui-value>* {\n flex: 1 1 auto;\n min-width: 0;\n}\n.muigui-value>*:nth-child(1) {\n flex: 1 1 calc(100% - var(--number-width));\n}\n.muigui-value>*:nth-child(2) {\n flex: 1 1 var(--number-width);\n margin-left: 0.2em;\n}\n\n/* fix! */\n.muigui-open>button>label::before,\n.muigui-closed>button>label::before {\n content: \"X\";\n color: rgba(0, 0, 0, 0);\n background-color: var(--range-color);\n border-radius: 0.2em;\n width: 1.25em;\n margin-right: 0.25em;\n height: 1.25em; /*var(--line-height);*/\n display: inline-grid;\n place-content: center start;\n pointer-events: none;\n}\n.muigui-open>button>label::before {\n background-image: var(--image-open);\n}\n.muigui-closed>button>label::before {\n background-image: var(--image-closed);\n}\n\n.muigui-open>.muigui-open-container {\n transition: all 0.1s ease-out;\n overflow: auto;\n height: 100%;\n}\n.muigui-closed>.muigui-open-container {\n transition: all 0.1s ease-out;\n overflow: hidden;\n min-height: 0;\n}\n.muigui-open>.muigui-open-container>* {\n transition: all 0.1s ease-out;\n margin-top: 0px;\n}\n.muigui-closed>.muigui-open-container>* {\n transition: all 0.1s ease-out;\n margin-top: -100%;\n}\n\n/* ---- popdown ---- */\n\n.muigui-pop-down-top {\n display: flex;\n}\n/* fix? */\n.muigui-value>*:nth-child(1).muigui-pop-down-top {\n flex: 0;\n}\n.muigui-closed .muigui-pop-down-bottom {\n max-height: 0;\n}\n\n.muigui-value .muigui-pop-down-bottom {\n margin: 0;\n}\n\n.muigui-pop-down-values {\n min-width: 0;\n display: flex;\n}\n.muigui-pop-down-values>* {\n flex: 1 1 auto;\n min-width: 0;\n}\n\n.muigui-value.muigui-pop-down-controller {\n flex-direction: column;\n}\n\n.muigui-pop-down-top input[type=checkbox] {\n -webkit-appearance: none;\n appearance: none;\n width: auto;\n color: var(--value-color);\n background-color: var(--value-bg-color);\n background-image: var(--image-checkerboard);\n background-size: 10px 10px;\n background-position: 0 0, 0 5px, 5px -5px, -5px 0px;\n\n cursor: pointer;\n\n display: grid;\n place-content: center;\n margin: 0;\n font: inherit;\n color: currentColor;\n width: 1.7em;\n height: 1.7em;\n transform: translateY(-0.075em);\n}\n\n.muigui-pop-down-top input[type=checkbox]::before {\n content: \"+\";\n display: grid;\n place-content: center;\n border-radius: calc(var(--border-radius) + 2px);\n border-left: 1px solid rgba(255,255,255,0.3);\n border-top: 1px solid rgba(255,255,255,0.3);\n border-bottom: 1px solid rgba(0,0,0,0.2);\n border-right: 1px solid rgba(0,0,0,0.2);\n background-color: var(--range-color);\n color: var(--value-bg-color);\n width: calc(var(--line-height) - 4px);\n height: calc(var(--line-height) - 4px);\n}\n\n.muigui-pop-down-top input[type=checkbox]:checked::before {\n content: \"X\";\n}\n\n\n/* ---- select ---- */\n\n.muigui select,\n.muigui option,\n.muigui input,\n.muigui button {\n color: var(--value-color);\n background-color: var(--value-bg-color);\n font-family: var(--font-family);\n font-size: var(--font-size);\n border: none;\n margin: 0;\n border-radius: var(--border-radius);\n}\n.muigui select {\n appearance: none;\n margin: 0;\n margin-left: 0; /*?*/\n overflow: hidden; /* Safari */\n}\n\n.muigui select:focus,\n.muigui input:focus,\n.muigui button:focus {\n outline: 1px solid var(--focus-color);\n}\n\n.muigui select:hover,\n.muigui option:hover,\n.muigui input:hover,\n.muigui button:hover {\n background-color: var(--hover-bg-color); \n}\n\n/* ------ [ label ] ------ */\n\n.muigui-label {\n border-top: 1px solid var(--menu-sep-color);\n border-bottom: 1px solid var(--menu-sep-color);\n padding-top: 0.4em;\n padding-bottom: 0.3em;\n place-content: center start;\n background-color: var(--menu-bg-color);\n white-space: pre;\n border-radius: var(--border-radius);\n}\n\n/* ------ [ divider] ------ */\n\n.muigui-divider {\n min-height: 6px;\n border-top: 2px solid var(--menu-sep-color);\n margin-top: 6px;\n}\n\n/* ------ [ button ] ------ */\n\n.muigui-button {\n display: grid;\n padding: 2px 0 2px 0;\n}\n.muigui-button button {\n border: none;\n color: var(--value-color);\n background-color: var(--button-bg-color);\n background-image: var(--button-image);\n cursor: pointer;\n place-content: center center;\n height: var(--line-height);\n}\n\n/* ------ [ color ] ------ */\n\n.muigui-color>div {\n overflow: hidden;\n position: relative;\n margin-left: 0;\n margin-right: 0; /* why? */\n max-width: var(--line-height);\n border-radius: var(--border-radius);\n}\n\n.muigui-color>div:focus-within {\n outline: 1px solid var(--focus-color);\n}\n\n.muigui-color input[type=color] {\n border: none;\n padding: 0;\n background: inherit;\n cursor: pointer;\n position: absolute;\n width: 200%;\n left: -10px;\n top: -10px;\n height: 200%;\n}\n.muigui-disabled canvas,\n.muigui-disabled svg,\n.muigui-disabled img,\n.muigui-disabled .muigui-color input[type=color] {\n opacity: 0.2;\n}\n\n/* ------ [ checkbox ] ------ */\n\n.muigui-checkbox>label:nth-child(2) {\n display: grid;\n place-content: center start;\n margin: 0;\n}\n\n.muigui-checkbox input[type=checkbox] {\n -webkit-appearance: none;\n appearance: none;\n width: auto;\n color: var(--value-color);\n background-color: var(--value-bg-color);\n cursor: pointer;\n\n display: grid;\n place-content: center;\n margin: 0;\n font: inherit;\n color: currentColor;\n width: 1.7em;\n height: 1.7em;\n transform: translateY(-0.075em);\n}\n\n.muigui-checkbox input[type=checkbox]::before {\n content: \"\";\n color: var(--value-color);\n display: grid;\n place-content: center;\n}\n\n.muigui-checkbox input[type=checkbox]:checked::before {\n content: \"✔\";\n}\n\n.muigui input[type=number]::-webkit-inner-spin-button, \n.muigui input[type=number]::-webkit-outer-spin-button { \n -webkit-appearance: none;\n appearance: none;\n margin: 0; \n}\n.muigui input[type=number] {\n -moz-appearance: textfield;\n}\n\n/* ------ [ radio grid ] ------ */\n\n.muigui-radio-grid>div {\n display: grid;\n gap: 2px;\n}\n\n.muigui-radio-grid input {\n appearance: none;\n display: none;\n}\n\n.muigui-radio-grid button {\n color: var(--color);\n width: 100%;\n text-align: left;\n}\n\n.muigui-radio-grid input:checked + button {\n color: var(--value-color);\n background-color: var(--selected-color);\n}\n\n/* ------ [ color-chooser ] ------ */\n\n.muigui-color-chooser-cursor {\n stroke-width: 1px;\n stroke: white;\n fill: none;\n}\n.muigui-color-chooser-circle {\n stroke-width: 1px;\n stroke: white;\n fill: none;\n}\n\n\n/* ------ [ vec2 ] ------ */\n\n.muigui-vec2 svg {\n background-color: var(--value-bg-color);\n}\n\n.muigui-vec2-axis {\n stroke: 1px;\n stroke: var(--focus-color);\n}\n\n.muigui-vec2-line {\n stroke-width: 1px;\n stroke: var(--value-color);\n fill: var(--value-color);\n}\n\n/* ------ [ direction ] ------ */\n\n.muigui-direction svg {\n background-color: rgba(0,0,0,0.2);\n}\n\n.muigui-direction:focus-within svg {\n outline: none;\n}\n.muigui-direction-range {\n fill: var(--value-bg-color);\n}\n.muigui-direction svg:focus {\n outline: none;\n}\n.muigui-direction svg:focus .muigui-direction-range {\n stroke-width: 0.5px;\n stroke: var(--focus-color);\n}\n\n.muigui-direction-arrow {\n fill: var(--value-color);\n}\n\n/* ------ [ slider ] ------ */\n\n.muigui-slider>div {\n display: flex;\n align-items: stretch;\n height: var(--line-height);\n}\n.muigui-slider svg {\n flex: 1 1 auto;\n}\n.muigui-slider .muigui-slider-up #muigui-orientation {\n transform: scale(1, -1) translateY(-100%);\n}\n\n.muigui-slider .muigui-slider-up #muigui-number-orientation {\n transform: scale(1,-1);\n}\n\n.muigui-ticks {\n stroke: var(--range-color);\n}\n.muigui-thicks {\n stroke: var(--color);\n stroke-width: 2px;\n}\n.muigui-svg-text {\n fill: var(--color);\n font-size: 7px;\n}\n.muigui-mark {\n fill: var(--value-color);\n}\n\n/* ------ [ range ] ------ */\n\n\n.muigui-range input[type=range] {\n -webkit-appearance: none;\n appearance: none;\n background-color: transparent;\n}\n\n.muigui-range input[type=range]::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n border-radius: calc(var(--border-radius) + 2px);\n border-left: 1px solid rgba(255,255,255,0.3);\n border-top: 1px solid rgba(255,255,255,0.3);\n border-bottom: 1px solid rgba(0,0,0,0.2);\n border-right: 1px solid rgba(0,0,0,0.2);\n background-color: var(--range-color);\n margin-top: calc((var(--line-height) - 6px) / -2);\n width: calc(var(--line-height) - 6px);\n height: calc(var(--line-height) - 6px);\n}\n\n.muigui-range input[type=range]::-webkit-slider-runnable-track {\n -webkit-appearance: none;\n appearance: none;\n border: 1px solid var(--menu-sep-color);\n height: 2px;\n}\n\n\n/* dat.gui style - doesn't work on Safari iOS */\n\n/*\n.muigui-range input[type=range] {\n cursor: ew-resize;\n overflow: hidden;\n}\n\n.muigui-range input[type=range] {\n -webkit-appearance: none;\n appearance: none;\n background-color: var(--range-right-color);\n margin: 0;\n}\n.muigui-range input[type=range]:hover {\n background-color: var(--range-right-hover-color);\n}\n\n.muigui-range input[type=range]::-webkit-slider-runnable-track {\n -webkit-appearance: none;\n appearance: none;\n height: max-content;\n color: var(--range-left-color);\n margin-top: -1px;\n}\n\n.muigui-range input[type=range]::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 0px;\n height: max-content;\n box-shadow: -1000px 0 0 1000px var(--range-left-color);\n}\n*/\n\n/* FF */\n/*\n.muigui-range input[type=range]::-moz-slider-progress {\n background-color: var(--range-left-color); \n}\n.muigui-range input[type=range]::-moz-slider-thumb {\n height: max-content;\n width: 0;\n border: none;\n box-shadow: -1000px 0 0 1000px var(--range-left-color);\n box-sizing: border-box;\n}\n*/\n\n.muigui-checkered-background {\n background-color: #404040;\n background-image:\n linear-gradient(45deg, #808080 25%, transparent 25%),\n linear-gradient(-45deg, #808080 25%, transparent 25%),\n linear-gradient(45deg, transparent 75%, #808080 75%),\n linear-gradient(-45deg, transparent 75%, #808080 75%);\n background-size: 16px 16px;\n background-position: 0 0, 0 8px, 8px -8px, -8px 0px;\n}\n\n/* ---------------------------------------------------------- */\n\n/* needs to be at bottom to take precedence */\n.muigui-auto-place {\n max-height: 100%;\n position: fixed;\n top: 0;\n right: 15px;\n z-index: 100001;\n}\n\n`,\nthemes: {\n default: {\n include: ['default'],\n css: `\n `,\n },\n float: {\n include: ['default'],\n css: `\n :root {\n color-scheme: light dark,\n }\n\n .muigui {\n --width: 400px;\n --bg-color: initial;\n --label-width: 25%;\n --number-width: 20%;\n }\n\n input,\n .muigui-label-controller>label {\n text-shadow:\n -1px -1px 0 var(--contrast-color),\n 1px -1px 0 var(--contrast-color),\n -1px 1px 0 var(--contrast-color),\n 1px 1px 0 var(--contrast-color);\n }\n\n .muigui-controller > label:nth-child(1) {\n place-content: center end;\n margin-right: 1em;\n }\n\n .muigui-value > :nth-child(2) {\n margin-left: 1em;\n }\n\n .muigui-root>*:nth-child(1) {\n display: none;\n }\n\n .muigui-range input[type=range]::-webkit-slider-thumb {\n border-radius: 1em;\n }\n\n .muigui-range input[type=range]::-webkit-slider-runnable-track {\n -webkit-appearance: initial;\n appearance: none;\n border: 1px solid rgba(0, 0, 0, 0.25);\n height: 2px;\n }\n\n .muigui-colors {\n --value-color: var(--color );\n --value-bg-color: rgba(0, 0, 0, 0.1);\n --disabled-color: #cccccc;\n --menu-bg-color: rgba(0, 0, 0, 0.1);\n --menu-sep-color: #bbbbbb;\n --hover-bg-color: rgba(0, 0, 0, 0);\n --invalid-color: #FF0000;\n --selected-color: rgba(0, 0, 0, 0.3);\n --range-color: rgba(0, 0, 0, 0.125);\n }\n`,\n },\n form: {\n include: [],\n css: `\n .muigui {\n --width: 100%;\n --label-width: 45%;\n --number-width: 40%;\n }\n .muigui-root>button {\n display: none;\n }\n .muigui-controller {\n margin-top: 1em;\n }\n .muigui-label-controller {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n margin-top: 1em;\n }\n .muigui-label-controller:has(.muigui-checkbox) {\n flex-direction: row;\n }\n .muigui-value {\n display: flex;\n align-items: stretch;\n }\n .muigui-value>* {\n flex: 1 1 auto;\n min-width: 0;\n }\n .muigui-controller>*:nth-child(1) {\n flex: 1 0 var(--label-width);\n min-width: 0;\n white-space: pre;\n }\n .muigui-controller>label:nth-child(1) {\n place-content: center start;\n display: inline-grid;\n overflow: hidden;\n }\n .muigui-controller>*:nth-child(2) {\n flex: 1 1 75%;\n min-width: 0;\n }\n `,\n },\n none: {\n include: [],\n css: '',\n },\n},\n};\n","export function setElemProps(elem, attrs, children) {\n for (const [key, value] of Object.entries(attrs)) {\n if (typeof value === 'function' && key.startsWith('on')) {\n const eventName = key.substring(2).toLowerCase();\n elem.addEventListener(eventName, value, {passive: false});\n } else if (typeof value === 'object') {\n for (const [k, v] of Object.entries(value)) {\n elem[key][k] = v;\n }\n } else if (elem[key] === undefined) {\n elem.setAttribute(key, value);\n } else {\n elem[key] = value;\n }\n }\n for (const child of children) {\n elem.appendChild(child);\n }\n return elem;\n}\n\nexport function createElem(tag, attrs = {}, children = []) {\n const elem = document.createElement(tag);\n setElemProps(elem, attrs, children);\n return elem;\n}\n\nexport function addElem(tag, parent, attrs = {}, children = []) {\n const elem = createElem(tag, attrs, children);\n parent.appendChild(elem);\n return elem;\n}\n\nlet nextId = 0;\nexport function getNewId() {\n return `muigui-id-${nextId++}`;\n}\n","export function removeArrayElem(array, value) {\n const ndx = array.indexOf(value);\n if (ndx) {\n array.splice(ndx, 1);\n }\n return array;\n}\n\n/**\n * Converts an camelCase or snake_case id to \"camel case\" or \"snake case\"\n * @param {string} id\n */\nconst underscoreRE = /_/g;\nconst upperLowerRE = /([A-Z])([a-z])/g;\nexport function idToLabel(id) {\n return id.replace(underscoreRE, ' ')\n .replace(upperLowerRE, (m, m1, m2) => `${m1.toLowerCase()} ${m2}`);\n}\n\nexport function clamp(v, min, max) {\n return Math.max(min, Math.min(max, v));\n}\n\nexport const isTypedArray = typeof SharedArrayBuffer !== 'undefined'\n ? function isArrayBufferOrSharedArrayBuffer(a) {\n return a && a.buffer && (a.buffer instanceof ArrayBuffer || a.buffer instanceof SharedArrayBuffer);\n }\n : function isArrayBuffer(a) {\n return a && a.buffer && a.buffer instanceof ArrayBuffer;\n };\n\nexport const isArrayOrTypedArray = v => Array.isArray(v) || isTypedArray(v);\n\n// Yea, I know this should be `Math.round(v / step) * step\n// but try step = 0.1, newV = 19.95\n//\n// I get\n// Math.round(19.95 / 0.1) * 0.1\n// 19.900000000000002\n// vs\n// Math.round(19.95 / 0.1) / (1 / 0.1)\n// 19.9\n//\nexport const stepify = (v, from, step) => Math.round(from(v) / step) / (1 / step);\n\nexport const euclideanModulo = (v, n) => ((v % n) + n) % n;\nexport const lerp = (a, b, t) => a + (b - a) * t;\nexport function copyExistingProperties(dst, src) {\n for (const key in src) {\n if (key in dst) {\n dst[key] = src[key];\n }\n }\n return dst;\n}\n\nexport const mapRange = (v, inMin, inMax, outMin, outMax) => (v - inMin) * (outMax - outMin) / (inMax - inMin) + outMin;\n\nexport const makeRangeConverters = ({from, to}) => {\n return {\n to: v => mapRange(v, ...from, ...to),\n from: v => [true, mapRange(v, ...to, ...from)],\n };\n};\n\nexport const makeRangeOptions = ({from, to, step}) => {\n return {\n min: to[0],\n max: to[1],\n ...(step && {step}),\n converters: makeRangeConverters({from, to}),\n };\n};\n\n// TODO: remove an use one in conversions. Move makeRangeConverters there?\nexport const identity = {\n to: v => v,\n from: v => [true, v],\n};\nexport function makeMinMaxPair(gui, properties, minPropName, maxPropName, options) {\n const { converters: { from } = identity } = options;\n const { min, max } = options;\n const guiMinRange = options.minRange || 0;\n const valueMinRange = from(guiMinRange)[1];\n const minGui = gui\n .add(properties, minPropName, {\n ...options,\n min,\n max: max - guiMinRange,\n })\n .onChange(v => {\n maxGui.setValue(Math.min(max, Math.max(v + valueMinRange, properties[maxPropName])));\n });\n const maxGui = gui\n .add(properties, maxPropName, {\n ...options,\n min: min + guiMinRange,\n max,\n })\n .onChange(v => {\n minGui.setValue(Math.max(min, Math.min(v - valueMinRange, properties[minPropName])));\n });\n return [ minGui, maxGui ];\n}\n\n","import { removeArrayElem } from '../libs/utils.js';\n\nexport default class View {\n domElement: HTMLElement;\n\n #childDestElem: HTMLElement;\n #views: View[] = [];\n\n constructor(elem: HTMLElement) {\n this.domElement = elem;\n this.#childDestElem = elem;\n }\n addElem(elem: HTMLElement) {\n this.#childDestElem.appendChild(elem);\n return elem;\n }\n removeElem(elem: HTMLElement) {\n this.#childDestElem.removeChild(elem);\n return elem;\n }\n pushSubElem(elem: HTMLElement) {\n this.#childDestElem.appendChild(elem);\n this.#childDestElem = elem;\n }\n popSubElem() {\n this.#childDestElem = this.#childDestElem.parentElement!;\n }\n add(view: View) {\n this.#views.push(view);\n this.addElem(view.domElement);\n return view;\n }\n remove(view: View) {\n this.removeElem(view.domElement);\n removeArrayElem(this.#views, view);\n return view;\n }\n pushSubView(view: View) {\n this.pushSubElem(view.domElement);\n }\n popSubView() {\n this.popSubElem();\n }\n setOptions(options: any) {\n for (const view of this.#views) {\n view.setOptions(options);\n }\n }\n updateDisplayIfNeeded(newV: any, ignoreCache?: boolean) {\n for (const view of this.#views) {\n view.updateDisplayIfNeeded(newV, ignoreCache);\n }\n return this;\n }\n $(selector: string) {\n return this.domElement.querySelector(selector);\n }\n}","import { createElem } from '../libs/elem.js';\nimport { removeArrayElem } from '../libs/utils.js';\nimport View from '../views/View.js';\n\nexport default class Controller extends View {\n #changeFns;\n #finishChangeFns;\n #parent;\n\n constructor(className) {\n super(createElem('div', {className: 'muigui-controller'}));\n this.#changeFns = [];\n this.#finishChangeFns = [];\n // we need the specialization to come last so it takes precedence.\n if (className) {\n this.domElement.classList.add(className);\n }\n }\n get parent() {\n return this.#parent;\n }\n setParent(parent) {\n this.#parent = parent;\n this.enable(!this.disabled());\n }\n show(show = true) {\n this.domElement.classList.toggle('muigui-hide', !show);\n this.domElement.classList.toggle('muigui-show', show);\n return this;\n }\n hide() {\n return this.show(false);\n }\n disabled() {\n return !!this.domElement.closest('.muigui-disabled');\n }\n\n enable(enable = true) {\n this.domElement.classList.toggle('muigui-disabled', !enable);\n\n // If disabled we need to set the attribute 'disabled=true' to all\n // input/select/button/textarea's below\n //\n // If enabled we need to set the attribute 'disabled=false' to all below\n // until we hit a disabled controller.\n //\n // ATM the problem is we can find the input/select/button/textarea elements\n // but we can't easily find which controller they belong do.\n // But we don't need to? We can just check up if it or parent has\n // '.muigui-disabled'\n ['input', 'button', 'select', 'textarea'].forEach(tag => {\n this.domElement.querySelectorAll(tag).forEach(elem => {\n const disabled = !!elem.closest('.muigui-disabled');\n elem.disabled = disabled;\n });\n });\n\n return this;\n }\n disable(disable = true) {\n return this.enable(!disable);\n }\n onChange(fn) {\n this.removeChange(fn);\n this.#changeFns.push(fn);\n return this;\n }\n removeChange(fn) {\n removeArrayElem(this.#changeFns, fn);\n return this;\n }\n onFinishChange(fn) {\n this.removeFinishChange(fn);\n this.#finishChangeFns.push(fn);\n return this;\n }\n removeFinishChange(fn) {\n removeArrayElem(this.#finishChangeFns, fn);\n return this;\n }\n #callListeners(fns, newV) {\n for (const fn of fns) {\n fn.call(this, newV);\n }\n }\n emitChange(value, object, property) {\n this.#callListeners(this.#changeFns, value);\n if (this.#parent) {\n if (object === undefined) {\n this.#parent.emitChange(value);\n } else {\n this.#parent.emitChange({\n object,\n property,\n value,\n controller: this,\n });\n }\n }\n }\n emitFinalChange(value, object, property) {\n this.#callListeners(this.#finishChangeFns, value);\n if (this.#parent) {\n if (object === undefined) {\n this.#parent.emitChange(value);\n } else {\n this.#parent.emitFinalChange({\n object,\n property,\n value,\n controller: this,\n });\n }\n }\n }\n updateDisplay() {\n // placeholder. override\n }\n getColors() {\n const toCamelCase = s => s.replace(/-([a-z])/g, (m, m1) => m1.toUpperCase());\n const keys = [\n 'color',\n 'bg-color',\n 'value-color',\n 'value-bg-color',\n 'hover-bg-color',\n 'menu-bg-color',\n 'menu-sep-color',\n 'disabled-color',\n ];\n const div = createElem('div');\n this.domElement.appendChild(div);\n const colors = Object.fromEntries(keys.map(key => {\n div.style.color = `var(--${key})`;\n const s = getComputedStyle(div);\n return [toCamelCase(key), s.color];\n }));\n div.remove();\n return colors;\n }\n}\n","import {\n createElem,\n} from '../libs/elem.js';\nimport { copyExistingProperties } from '../libs/utils.js';\nimport Controller from './Controller.js';\n\nexport default class Button extends Controller {\n #object;\n #property;\n #buttonElem;\n #options = {\n name: '',\n };\n\n constructor(object, property, options = {}) {\n super('muigui-button', '');\n this.#object = object;\n this.#property = property;\n\n this.#buttonElem = this.addElem(\n createElem('button', {\n type: 'button',\n onClick: () => {\n this.#object[this.#property](this);\n },\n }));\n this.setOptions({name: property, ...options});\n }\n name(name) {\n this.#buttonElem.textContent = name;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {name} = this.#options;\n this.#buttonElem.textContent = name;\n }\n}","import { isTypedArray } from '../libs/utils.js';\nimport View from './View.js';\n\nfunction arraysEqual(a, b) {\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; ++i) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n}\n\nfunction copyArrayElementsFromTo(src, dst) {\n dst.length = src.length;\n for (let i = 0; i < src.length; ++i) {\n dst[i] = src[i];\n }\n}\n\nexport default class EditView extends View {\n #oldV;\n #updateCheck;\n\n #checkArrayNeedsUpdate(newV) {\n // It's an array, we need to compare all elements\n // Example, vec2, [r,g,b], ...\n const needUpdate = !arraysEqual(newV, this.#oldV);\n if (needUpdate) {\n copyArrayElementsFromTo(newV, this.#oldV);\n }\n return needUpdate;\n }\n\n #checkTypedArrayNeedsUpdate() {\n let once = true;\n return function checkTypedArrayNeedsUpdateImpl(newV) {\n // It's a typedarray, we need to compare all elements\n // Example: Float32Array([r, g, b])\n let needUpdate = once;\n once = false;\n if (!needUpdate) {\n needUpdate = !arraysEqual(newV, this.#oldV);\n }\n return needUpdate;\n };\n }\n\n #checkObjectNeedsUpdate(newV) {\n let needUpdate = false;\n for (const key in newV) {\n if (newV[key] !== this.#oldV[key]) {\n needUpdate = true;\n this.#oldV[key] = newV[key];\n }\n }\n return needUpdate;\n }\n\n #checkValueNeedsUpdate(newV) {\n const needUpdate = newV !== this.#oldV;\n this.#oldV = newV;\n return needUpdate;\n }\n\n #getUpdateCheckForType(newV) {\n if (Array.isArray(newV)) {\n this.#oldV = [];\n return this.#checkArrayNeedsUpdate.bind(this);\n } else if (isTypedArray(newV)) {\n this.#oldV = new newV.constructor(newV);\n return this.#checkTypedArrayNeedsUpdate(this);\n } else if (typeof newV === 'object') {\n this.#oldV = {};\n return this.#checkObjectNeedsUpdate.bind(this);\n } else {\n return this.#checkValueNeedsUpdate.bind(this);\n }\n }\n\n // The point of this is updating DOM elements\n // is slow but if we've called `listen` then\n // every frame we're going to try to update\n // things with the current value so if nothing\n // has changed then skip it.\n updateDisplayIfNeeded(newV, ignoreCache) {\n this.#updateCheck = this.#updateCheck || this.#getUpdateCheckForType(newV);\n // Note: We call #updateCheck first because it updates\n // the cache\n if (this.#updateCheck(newV) || ignoreCache) {\n this.updateDisplay(newV);\n }\n }\n setOptions(/*options*/) {\n // override this\n return this;\n }\n}\n","import { createElem } from '../libs/elem.js';\nimport EditView from './EditView.js';\n\nexport default class CheckboxView extends EditView {\n #checkboxElem;\n constructor(setter, id) {\n const checkboxElem = createElem('input', {\n type: 'checkbox',\n id,\n onInput: () => {\n setter.setValue(checkboxElem.checked);\n },\n onChange: () => {\n setter.setFinalValue(checkboxElem.checked);\n },\n });\n super(createElem('label', {}, [checkboxElem]));\n this.#checkboxElem = checkboxElem;\n }\n updateDisplay(v) {\n this.#checkboxElem.checked = v;\n }\n}\n","import { removeArrayElem } from './utils.js';\n\nconst tasks = [];\nconst tasksToRemove = new Set();\n\nlet requestId;\nlet processing;\n\nfunction removeTasks() {\n if (!tasksToRemove.size) {\n return;\n }\n\n if (processing) {\n queueProcessing();\n return;\n }\n\n tasksToRemove.forEach(task => {\n removeArrayElem(tasks, task);\n });\n tasksToRemove.clear();\n}\n\nfunction processTasks() {\n requestId = undefined;\n processing = true;\n for (const task of tasks) {\n if (!tasksToRemove.has(task)) {\n task();\n }\n }\n processing = false;\n removeTasks();\n queueProcessing();\n}\n\nfunction queueProcessing() {\n if (!requestId && tasks.length) {\n requestId = requestAnimationFrame(processTasks);\n }\n}\n\nexport function addTask(fn) {\n tasks.push(fn);\n queueProcessing();\n}\n\nexport function removeTask(fn) {\n tasksToRemove.set(fn);\n\n const ndx = tasks.indexOf(fn);\n if (ndx >= 0) {\n tasks.splice(ndx, 1);\n }\n}","let id = 0;\n\nexport function makeId() {\n return `muigui-${++id}`;\n}\n","import { createElem } from '../libs/elem.js';\nimport View from './View.js';\n\nexport default class ValueView extends View {\n constructor(className = '') {\n super(createElem('div', {className: 'muigui-value'}));\n if (className) {\n this.domElement.classList.add(className);\n }\n }\n}","import { createElem } from '../libs/elem.js';\nimport { makeId } from '../libs/ids.js';\nimport ValueView from '../views/ValueView.js';\nimport Controller from './Controller.js';\n\nexport default class LabelController extends Controller {\n #id;\n #nameElem;\n\n constructor(className = '', name = '') {\n super('muigui-label-controller');\n this.#id = makeId();\n this.#nameElem = createElem('label', {for: this.#id});\n this.domElement.appendChild(this.#nameElem);\n this.pushSubView(new ValueView(className));\n this.name(name);\n }\n get id() {\n return this.#id;\n }\n name(name) {\n if (this.#nameElem.title === this.#nameElem.textContent) {\n this.#nameElem.title = name;\n }\n this.#nameElem.textContent = name;\n return this;\n }\n tooltip(tip) {\n this.#nameElem.title = tip;\n }\n}\n\n","import {addTask, removeTask} from '../libs/taskrunner.js';\nimport { isTypedArray } from '../libs/utils.js';\nimport LabelController from './LabelController.js';\n\nexport default class ValueController extends LabelController {\n #object;\n #property;\n #initialValue;\n #listening;\n #views;\n #updateFn;\n\n constructor(object, property, className = '') {\n super(className, property);\n this.#object = object;\n this.#property = property;\n this.#initialValue = this.getValue();\n this.#listening = false;\n this.#views = [];\n }\n get initialValue() {\n return this.#initialValue;\n }\n get object() {\n return this.#object;\n }\n get property() {\n return this.#property;\n }\n add(view) {\n this.#views.push(view);\n super.add(view);\n this.updateDisplay();\n return view;\n }\n #setValueImpl(v, ignoreCache) {\n let isDifferent = false;\n if (typeof v === 'object') {\n const dst = this.#object[this.#property];\n // don't replace objects, just their values.\n if (Array.isArray(v) || isTypedArray(v)) {\n for (let i = 0; i < v.length; ++i) {\n isDifferent ||= dst[i] !== v[i];\n dst[i] = v[i];\n }\n } else {\n for (const key of Object.keys(v)) {\n isDifferent ||= dst[key] !== v[key];\n }\n Object.assign(dst, v);\n }\n } else {\n isDifferent = this.#object[this.#property] !== v;\n this.#object[this.#property] = v;\n }\n this.updateDisplay(ignoreCache);\n if (isDifferent) {\n this.emitChange(this.getValue(), this.#object, this.#property);\n }\n return isDifferent;\n }\n setValue(v) {\n this.#setValueImpl(v);\n }\n setFinalValue(v) {\n const isDifferent = this.#setValueImpl(v, true);\n if (isDifferent) {\n this.emitFinalChange(this.getValue(), this.#object, this.#property);\n }\n return this;\n }\n updateDisplay(ignoreCache) {\n const newV = this.getValue();\n for (const view of this.#views) {\n view.updateDisplayIfNeeded(newV, ignoreCache);\n }\n return this;\n }\n setOptions(options) {\n for (const view of this.#views) {\n view.setOptions(options);\n }\n this.updateDisplay();\n return this;\n }\n getValue() {\n return this.#object[this.#property];\n }\n value(v) {\n this.setValue(v);\n return this;\n }\n reset() {\n this.setValue(this.#initialValue);\n return this;\n }\n listen(listen = true) {\n if (!this.#updateFn) {\n this.#updateFn = this.updateDisplay.bind(this);\n }\n if (listen) {\n if (!this.#listening) {\n this.#listening = true;\n addTask(this.#updateFn);\n }\n } else {\n if (this.#listening) {\n this.#listening = false;\n removeTask(this.#updateFn);\n }\n }\n return this;\n }\n}\n\n","import CheckboxView from '../views/CheckboxView.js';\nimport ValueController from './ValueController.js';\n\nexport default class Checkbox extends ValueController {\n constructor(object, property) {\n super(object, property, 'muigui-checkbox');\n const id = this.id;\n this.add(new CheckboxView(this, id));\n this.updateDisplay();\n }\n}","import {\n makeRangeConverters,\n} from './utils.js';\n\nexport const identity = {\n to: v => v,\n from: v => [true, v],\n};\n\n// from: from string to value\n// to: from value to string\nexport const strToNumber = {\n to: v => v.toString(),\n from: v => {\n const newV = parseFloat(v);\n return [!Number.isNaN(newV), newV];\n },\n};\n\nexport const converters = {\n radToDeg: makeRangeConverters({to: [0, 180], from: [0, Math.PI]}),\n};\n","export function createWheelHelper() {\n let wheelAccum = 0;\n return function (e, step, wheelScale = 5) {\n wheelAccum -= e.deltaY * step / wheelScale;\n const wheelSteps = Math.floor(Math.abs(wheelAccum) / step) * Math.sign(wheelAccum);\n const delta = wheelSteps * step;\n wheelAccum -= delta;\n return delta;\n };\n}\n","import { createElem } from '../libs/elem.js';\nimport { strToNumber } from '../libs/conversions.js';\nimport { createWheelHelper } from '../libs/wheel.js';\nimport { clamp, copyExistingProperties, stepify } from '../libs/utils.js';\nimport EditView from './EditView.js';\n\nexport default class NumberView extends EditView {\n #to;\n #from;\n #step;\n #skipUpdate;\n #options = {\n step: 0.01,\n converters: strToNumber,\n min: Number.NEGATIVE_INFINITY,\n max: Number.POSITIVE_INFINITY,\n };\n\n constructor(setter, options) {\n const setValue = setter.setValue.bind(setter);\n const setFinalValue = setter.setFinalValue.bind(setter);\n const wheelHelper = createWheelHelper();\n super(createElem('input', {\n type: 'number',\n onInput: () => {\n this.#handleInput(setValue, true);\n },\n onChange: () => {\n this.#handleInput(setFinalValue, false);\n },\n onWheel: e => {\n e.preventDefault();\n const {min, max, step} = this.#options;\n const delta = wheelHelper(e, step);\n const v = parseFloat(this.domElement.value);\n const newV = clamp(stepify(v + delta, v => v, step), min, max);\n const [valid, outV] = this.#from(newV);\n if (valid) {\n setter.setValue(outV);\n }\n },\n }));\n this.setOptions(options);\n }\n #handleInput(setFn, skipUpdate) {\n const v = parseFloat(this.domElement.value);\n const [valid, newV] = this.#from(v);\n let inRange;\n if (valid && !Number.isNaN(v)) {\n const {min, max} = this.#options;\n inRange = newV >= min && newV <= max;\n this.#skipUpdate = skipUpdate;\n setFn(clamp(newV, min, max));\n }\n this.domElement.classList.toggle('muigui-invalid-value', !valid || !inRange);\n }\n updateDisplay(v) {\n if (!this.#skipUpdate) {\n this.domElement.value = stepify(v, this.#to, this.#step);\n }\n this.#skipUpdate = false;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {\n step,\n converters: {to, from},\n } = this.#options;\n this.#to = to;\n this.#from = from;\n this.#step = step;\n return this;\n }\n}\n","\nimport NumberView from '../views/NumberView.js';\nimport ValueController from './ValueController.js';\n\n// Wanted to name this `Number` but it conflicts with\n// JavaScript `Number`. It most likely wouldn't be\n// an issue? But users might `import {Number} ...` and\n// things would break.\nexport default class TextNumber extends ValueController {\n #textView;\n #step;\n\n constructor(object, property, options = {}) {\n super(object, property, 'muigui-text-number');\n this.#textView = this.add(new NumberView(this, options));\n this.updateDisplay();\n }\n}","import { createElem } from '../libs/elem.js';\nimport EditView from './EditView.js';\n\nexport default class SelectView extends EditView {\n #values;\n\n constructor(setter, keyValues) {\n const values = [];\n super(createElem('select', {\n onChange: () => {\n setter.setFinalValue(this.#values[this.domElement.selectedIndex]);\n },\n }, keyValues.map(([key, value]) => {\n values.push(value);\n return createElem('option', {textContent: key});\n })));\n this.#values = values;\n }\n updateDisplay(v) {\n const ndx = this.#values.indexOf(v);\n this.domElement.selectedIndex = ndx;\n }\n}\n","\n// 4 cases\n// (a) keyValues is array of arrays, each sub array is key value\n// (b) keyValues is array and value is number then keys = array contents, value = index\n// (c) keyValues is array and value is not number, key = array contents, value = array contents\n// (d) keyValues is object then key->value\nexport function convertToKeyValues(keyValues, valueIsNumber) {\n if (Array.isArray(keyValues)) {\n if (Array.isArray(keyValues[0])) {\n // (a) keyValues is array of arrays, each sub array is key value\n return keyValues;\n } else {\n if (valueIsNumber) {\n // (b) keyValues is array and value is number then keys = array contents, value = index\n return keyValues.map((v, ndx) => [v, ndx]);\n } else {\n // (c) keyValues is array and value is not number, key = array contents, value = array contents\n return keyValues.map(v => [v, v]);\n }\n }\n } else {\n // (d)\n return [...Object.entries(keyValues)];\n }\n}\n","import SelectView from '../views/SelectView.js';\nimport ValueController from './ValueController.js';\nimport { convertToKeyValues } from '../libs/key-values.js';\n\nexport default class Select extends ValueController {\n constructor(object, property, options) {\n super(object, property, 'muigui-select');\n const valueIsNumber = typeof this.getValue() === 'number';\n const {keyValues: keyValuesInput} = options;\n const keyValues = convertToKeyValues(keyValuesInput, valueIsNumber);\n this.add(new SelectView(this, keyValues));\n this.updateDisplay();\n }\n}","import { createElem } from '../libs/elem.js';\nimport { identity } from '../libs/conversions.js';\nimport { clamp, copyExistingProperties, stepify } from '../libs/utils.js';\nimport { createWheelHelper } from '../libs/wheel.js';\nimport EditView from './EditView.js';\n\nexport default class RangeView extends EditView {\n #to;\n #from;\n #step;\n #skipUpdate;\n #options = {\n step: 0.01,\n min: 0,\n max: 1,\n converters: identity,\n };\n\n constructor(setter, options) {\n const wheelHelper = createWheelHelper();\n super(createElem('input', {\n type: 'range',\n onInput: () => {\n this.#skipUpdate = true;\n const {min, max, step} = this.#options;\n const v = parseFloat(this.domElement.value);\n const newV = clamp(stepify(v, v => v, step), min, max);\n const [valid, validV] = this.#from(newV);\n if (valid) {\n setter.setValue(validV);\n }\n },\n onChange: () => {\n this.#skipUpdate = true;\n const {min, max, step} = this.#options;\n const v = parseFloat(this.domElement.value);\n const newV = clamp(stepify(v, v => v, step), min, max);\n const [valid, validV] = this.#from(newV);\n if (valid) {\n setter.setFinalValue(validV);\n }\n },\n onWheel: e => {\n e.preventDefault();\n const [valid, v] = this.#from(parseFloat(this.domElement.value));\n if (!valid) {\n return;\n }\n const {min, max, step} = this.#options;\n const delta = wheelHelper(e, step);\n const newV = clamp(stepify(v + delta, v => v, step), min, max);\n setter.setValue(newV);\n },\n }));\n this.setOptions(options);\n }\n updateDisplay(v) {\n if (!this.#skipUpdate) {\n this.domElement.value = stepify(v, this.#to, this.#step);\n }\n this.#skipUpdate = false;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {\n step,\n min,\n max,\n converters: {to, from},\n } = this.#options;\n this.#to = to;\n this.#from = from;\n this.#step = step;\n this.domElement.step = step;\n this.domElement.min = min;\n this.domElement.max = max;\n return this;\n }\n}","import ValueController from './ValueController.js';\nimport NumberView from '../views/NumberView.js';\nimport RangeView from '../views/RangeView.js';\n\nexport default class Range extends ValueController {\n constructor(object, property, options) {\n super(object, property, 'muigui-range');\n this.add(new RangeView(this, options));\n this.add(new NumberView(this, options));\n }\n}\n","import { createElem } from '../libs/elem.js';\nimport { identity } from '../libs/conversions.js';\nimport EditView from './EditView.js';\nimport { copyExistingProperties } from '../libs/utils.js';\n\nexport default class TextView extends EditView {\n #to;\n #from;\n #skipUpdate;\n #options = {\n converters: identity,\n };\n\n constructor(setter, options) {\n const setValue = setter.setValue.bind(setter);\n const setFinalValue = setter.setFinalValue.bind(setter);\n super(createElem('input', {\n type: 'text',\n onInput: () => {\n this.#handleInput(setValue, true);\n },\n onChange: () => {\n this.#handleInput(setFinalValue, false);\n },\n }));\n this.setOptions(options);\n }\n #handleInput(setFn, skipUpdate) {\n const [valid, newV] = this.#from(this.domElement.value);\n if (valid) {\n this.#skipUpdate = skipUpdate;\n setFn(newV);\n }\n this.domElement.style.color = valid ? '' : 'var(--invalid-color)';\n\n }\n updateDisplay(v) {\n if (!this.#skipUpdate) {\n this.domElement.value = this.#to(v);\n this.domElement.style.color = '';\n }\n this.#skipUpdate = false;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {\n converters: {to, from},\n } = this.#options;\n this.#to = to;\n this.#from = from;\n return this;\n }\n}\n","import TextView from '../views/TextView.js';\nimport ValueController from './ValueController.js';\n\nexport default class Text extends ValueController {\n constructor(object, property) {\n super(object, property, 'muigui-text');\n this.add(new TextView(this));\n this.updateDisplay();\n }\n}","const clamp = (v, min, max) => Math.max(min, Math.min(max, v));\nconst lerp = (a, b, t) => a + (b - a) * t;\nconst fract = v => v >= 0 ? v % 1 : 1 - (v % 1);\n\nconst f0 = v => +v.toFixed(0); // converts to string (eg 1.2 => \"1\"), then converts back to number (eg, \"1.200\" => 1.2)\nconst f3 = v => +v.toFixed(3); // converts to string (eg 1.2 => \"1.200\"), then converts back to number (eg, \"1.200\" => 1.2)\n\nconst hexToUint32RGB = v => (parseInt(v.substring(1, 3), 16) << 16) |\n (parseInt(v.substring(3, 5), 16) << 8 ) |\n (parseInt(v.substring(5, 7), 16) );\nconst uint32RGBToHex = v => `#${(Math.round(v)).toString(16).padStart(6, '0')}`;\nconst hexToUint32RGBA = v => (parseInt(v.substring(1, 3), 16) * 2 ** 24) +\n (parseInt(v.substring(3, 5), 16) * 2 ** 16) +\n (parseInt(v.substring(5, 7), 16) * 2 ** 8) +\n (parseInt(v.substring(7, 9), 16) );\nconst uint32RGBAToHex = v => `#${(Math.round(v)).toString(16).padStart(8, '0')}`;\n\nexport const hexToUint8RGB = v => [\n parseInt(v.substring(1, 3), 16),\n parseInt(v.substring(3, 5), 16),\n parseInt(v.substring(5, 7), 16),\n];\nexport const uint8RGBToHex = v => `#${Array.from(v).map(v => v.toString(16).padStart(2, '0')).join('')}`;\n\nexport const hexToUint8RGBA = v => [\n parseInt(v.substring(1, 3), 16),\n parseInt(v.substring(3, 5), 16),\n parseInt(v.substring(5, 7), 16),\n parseInt(v.substring(7, 9), 16),\n];\nexport const uint8RGBAToHex = v => `#${Array.from(v).map(v => v.toString(16).padStart(2, '0')).join('')}`;\n\nexport const hexToFloatRGB = v => hexToUint8RGB(v).map(v => f3(v / 255));\nexport const floatRGBToHex = v => uint8RGBToHex(Array.from(v).map(v => Math.round(clamp(v * 255, 0, 255))));\n\nexport const hexToFloatRGBA = v => hexToUint8RGBA(v).map(v => f3(v / 255));\nexport const floatRGBAToHex = v => uint8RGBAToHex(Array.from(v).map(v => Math.round(clamp(v * 255, 0, 255))));\n\nconst scaleAndClamp = v => clamp(Math.round(v * 255), 0, 255).toString(16).padStart(2, '0');\n\nconst hexToObjectRGB = v => ({\n r: parseInt(v.substring(1, 3), 16) / 255,\n g: parseInt(v.substring(3, 5), 16) / 255,\n b: parseInt(v.substring(5, 7), 16) / 255,\n});\nconst objectRGBToHex = v => `#${scaleAndClamp(v.r)}${scaleAndClamp(v.g)}${scaleAndClamp(v.b)}`;\nconst hexToObjectRGBA = v => ({\n r: parseInt(v.substring(1, 3), 16) / 255,\n g: parseInt(v.substring(3, 5), 16) / 255,\n b: parseInt(v.substring(5, 7), 16) / 255,\n a: parseInt(v.substring(7, 9), 16) / 255,\n});\nconst objectRGBAToHex = v => `#${scaleAndClamp(v.r)}${scaleAndClamp(v.g)}${scaleAndClamp(v.b)}${scaleAndClamp(v.a)}`;\n\nconst hexToCssRGB = v => `rgb(${hexToUint8RGB(v).join(', ')})`;\nconst cssRGBRegex = /^\\s*rgb\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*\\)\\s*$/;\nconst cssRGBToHex = v => {\n const m = cssRGBRegex.exec(v);\n return uint8RGBToHex([m[1], m[2], m[3]].map(v => parseInt(v)));\n};\nconst hexToCssRGBA = v => `rgba(${hexToUint8RGBA(v).map((v, i) => i === 3 ? v / 255 : v).join(', ')})`;\nconst cssRGBARegex = /^\\s*rgba\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+\\.\\d+|\\d+)\\s*\\)\\s*$/;\nconst cssRGBAToHex = v => {\n const m = cssRGBARegex.exec(v);\n return uint8RGBAToHex([m[1], m[2], m[3], m[4]].map((v, i) => i === 3 ? (parseFloat(v) * 255 | 0) : parseInt(v)));\n};\n\nconst hexToCssHSL = v => {\n const hsl = rgbUint8ToHsl(hexToUint8RGB(v)).map(v => f0(v));\n return `hsl(${hsl[0]}, ${hsl[1]}%, ${hsl[2]}%)`;\n};\nconst hexToCssHSLA = v => {\n const hsla = rgbaUint8ToHsla(hexToUint8RGBA(v)).map((v, i) => i === 3 ? f3(v) : f0(v));\n return `hsl(${hsla[0]} ${hsla[1]}% ${hsla[2]}% / ${hsla[3]})`;\n};\nconst cssHSLRegex = /^\\s*hsl\\(\\s*(\\d+)(?:deg|)\\s*(?:,|)\\s*(\\d+)%\\s*(?:,|)\\s*(\\d+)%\\s*\\)\\s*$/;\nconst cssHSLARegex = /^\\s*hsl\\(\\s*(\\d+)(?:deg|)\\s*(?:,|)\\s*(\\d+)%\\s*(?:,|)\\s*(\\d+)%\\s*\\/\\s*(\\d+\\.\\d+|\\d+)\\s*\\)\\s*$/;\n\nconst hex3DigitTo6Digit = v => `${v[0]}${v[0]}${v[1]}${v[1]}${v[2]}${v[2]}`;\nconst cssHSLToHex = v => {\n const m = cssHSLRegex.exec(v);\n const rgb = hslToRgbUint8([m[1], m[2], m[3]].map(v => parseFloat(v)));\n return uint8RGBToHex(rgb);\n};\nconst cssHSLAToHex = v => {\n const m = cssHSLARegex.exec(v);\n const rgba = hslaToRgbaUint8([m[1], m[2], m[3], m[4]].map(v => parseFloat(v)));\n return uint8RGBAToHex(rgba);\n};\n\nconst euclideanModulo = (v, n) => ((v % n) + n) % n;\n\nexport function hslToRgbUint8([h, s, l]) {\n h = euclideanModulo(h, 360);\n s = clamp(s / 100, 0, 1);\n l = clamp(l / 100, 0, 1);\n\n const a = s * Math.min(l, 1 - l);\n\n function f(n) {\n const k = (n + h / 30) % 12;\n return l - a * Math.max(-1, Math.min(k - 3, 9 - k, 1));\n }\n\n return [f(0), f(8), f(4)].map(v => Math.round(v * 255));\n}\n\nexport function hslaToRgbaUint8([h, s, l, a]) {\n const rgb = hslToRgbUint8([h, s, l]);\n return [...rgb, a * 255 | 0];\n}\n\nexport function rgbFloatToHsl01([r, g, b]) {\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const l = (min + max) * 0.5;\n const d = max - min;\n let h = 0;\n let s = 0;\n\n if (d !== 0) {\n s = (l === 0 || l === 1)\n ? 0\n : (max - l) / Math.min(l, 1 - l);\n\n switch (max) {\n case r: h = (g - b) / d + (g < b ? 6 : 0); break;\n case g: h = (b - r) / d + 2; break;\n case b: h = (r - g) / d + 4;\n }\n }\n\n return [h / 6, s, l];\n}\n\nexport function rgbaFloatToHsla01([r, g, b, a]) {\n const hsl = rgbFloatToHsl01([r, g, b]);\n return [...hsl, a];\n}\n\nexport const rgbUint8ToHsl = (rgb) => {\n const [h, s, l] = rgbFloatToHsl01(rgb.map(v => v / 255));\n return [h * 360, s * 100, l * 100];\n};\n\nexport const rgbaUint8ToHsla = (rgba) => {\n const [h, s, l, a] = rgbaFloatToHsla01(rgba.map(v => v / 255));\n return [h * 360, s * 100, l * 100, a];\n};\n\nexport function hsv01ToRGBFloat([hue, sat, val]) {\n sat = clamp(sat, 0, 1);\n val = clamp(val, 0, 1);\n return [hue, hue + 2 / 3, hue + 1 / 3].map(\n v => lerp(1, clamp(Math.abs(fract(v) * 6 - 3.0) - 1, 0, 1), sat) * val\n );\n}\n\nexport function hsva01ToRGBAFloat([hue, sat, val, alpha]) {\n const rgb = hsv01ToRGBFloat([hue, sat, val]);\n return [...rgb, alpha];\n}\n\nconst round3 = v => Math.round(v * 1000) / 1000;\n\nexport function rgbFloatToHSV01([r, g, b]) {\n const p = b > g\n ? [b, g, -1, 2 / 3]\n : [g, b, 0, -1 / 3];\n const q = p[0] > r\n ? [p[0], p[1], p[3], r]\n : [r, p[1], p[2], p[0]];\n const d = q[0] - Math.min(q[3], q[1]);\n return [\n Math.abs(q[2] + (q[3] - q[1]) / (6 * d + Number.EPSILON)),\n d / (q[0] + Number.EPSILON),\n q[0],\n ].map(round3);\n}\n\nexport function rgbaFloatToHSVA01([r, g, b, a]) {\n const hsv = rgbFloatToHSV01([r, g, b]);\n return [...hsv, a];\n}\n\n// window.hsv01ToRGBFloat = hsv01ToRGBFloat;\n// window.rgbFloatToHSV01 = rgbFloatToHSV01;\n\n// Yea, meh!\nexport const hasAlpha = format => format.endsWith('a') || format.startsWith('hex8');\n\nconst cssStringFormats = [\n { re: /^#(?:[0-9a-f]){6}$/i, format: 'hex6' },\n { re: /^(?:[0-9a-f]){6}$/i, format: 'hex6-no-hash' },\n { re: /^#(?:[0-9a-f]){8}$/i, format: 'hex8' },\n { re: /^(?:[0-9a-f]){8}$/i, format: 'hex8-no-hash' },\n { re: /^#(?:[0-9a-f]){3}$/i, format: 'hex3' },\n { re: /^(?:[0-9a-f]){3}$/i, format: 'hex3-no-hash' },\n { re: cssRGBRegex, format: 'css-rgb' },\n { re: cssHSLRegex, format: 'css-hsl' },\n { re: cssRGBARegex, format: 'css-rgba' },\n { re: cssHSLARegex, format: 'css-hsla' },\n];\n\nfunction guessStringColorFormat(v) {\n for (const formatInfo of cssStringFormats) {\n if (formatInfo.re.test(v)) {\n return formatInfo;\n }\n }\n return undefined;\n}\n\nexport function guessFormat(v) {\n switch (typeof v) {\n case 'number':\n console.warn('can not reliably guess format based on a number. You should pass in a format like {format: \"uint32-rgb\"} or {format: \"uint32-rgb\"}');\n return v <= 0xFFFFFF ? 'uint32-rgb' : 'uint32-rgba';\n case 'string': {\n const formatInfo = guessStringColorFormat(v.trim());\n if (formatInfo) {\n return formatInfo.format;\n }\n break;\n }\n case 'object':\n if (v instanceof Uint8Array || v instanceof Uint8ClampedArray) {\n if (v.length === 3) {\n return 'uint8-rgb';\n } else if (v.length === 4) {\n return 'uint8-rgba';\n }\n } else if (v instanceof Float32Array) {\n if (v.length === 3) {\n return 'float-rgb';\n } else if (v.length === 4) {\n return 'float-rgba';\n }\n } else if (Array.isArray(v)) {\n if (v.length === 3) {\n return 'float-rgb';\n } else if (v.length === 4) {\n return 'float-rgba';\n }\n } else {\n if ('r' in v && 'g' in v && 'b' in v) {\n if ('a' in v) {\n return 'object-rgba';\n } else {\n return 'object-rgb';\n }\n }\n }\n }\n throw new Error(`unknown color format: ${v}`);\n}\n\nfunction fixHex6(v) {\n return v.trim(v);\n //const formatInfo = guessStringColorFormat(v.trim());\n //const fix = formatInfo ? formatInfo.fix : v => v;\n //return fix(v.trim());\n}\n\nfunction fixHex8(v) {\n return v.trim(v);\n //const formatInfo = guessStringColorFormat(v.trim());\n //const fix = formatInfo ? formatInfo.fix : v => v;\n //return fix(v.trim());\n}\n\nfunction hex6ToHex3(hex6) {\n return (hex6[1] === hex6[2] &&\n hex6[3] === hex6[4] &&\n hex6[5] === hex6[6])\n ? `#${hex6[1]}${hex6[3]}${hex6[5]}`\n : hex6;\n}\n\nconst hex3RE = /^(#|)([0-9a-f]{3})$/i;\nfunction hex3ToHex6(hex3) {\n const m = hex3RE.exec(hex3);\n if (m) {\n const [, , m2] = m;\n return `#${hex3DigitTo6Digit(m2)}`;\n }\n return hex3;\n}\n\nfunction fixHex3(v) {\n return hex6ToHex3(fixHex6(v));\n}\n\nconst strToRGBObject = (s) => {\n try {\n const json = s.replace(/([a-z])/g, '\"$1\"');\n const rgb = JSON.parse(json);\n if (Number.isNaN(rgb.r) || Number.isNaN(rgb.g) || Number.isNaN(rgb.b)) {\n throw new Error('not {r, g, b}');\n }\n return [true, rgb];\n } catch (e) {\n return [false];\n }\n};\n\nconst strToRGBAObject = (s) => {\n try {\n const json = s.replace(/([a-z])/g, '\"$1\"');\n const rgba = JSON.parse(json);\n if (Number.isNaN(rgba.r) || Number.isNaN(rgba.g) || Number.isNaN(rgba.b) || Number.isNaN(rgba.a)) {\n throw new Error('not {r, g, b, a}');\n }\n return [true, rgba];\n } catch (e) {\n return [false];\n }\n};\n\nconst strToCssRGB = s => {\n const m = cssRGBRegex.exec(s);\n if (!m) {\n return [false];\n }\n const v = [m[1], m[2], m[3]].map(v => parseInt(v));\n const outOfRange = v.find(v => v > 255);\n return [!outOfRange, `rgb(${v.join(', ')})`];\n};\n\nconst strToCssRGBA = s => {\n const m = cssRGBARegex.exec(s);\n if (!m) {\n return [false];\n }\n const v = [m[1], m[2], m[3], m[4]].map((v, i) => i === 3 ? parseFloat(v) : parseInt(v));\n const outOfRange = v.find(v => v > 255);\n return [!outOfRange, `rgba(${v.join(', ')})`];\n};\n\nconst strToCssHSL = s => {\n const m = cssHSLRegex.exec(s);\n if (!m) {\n return [false];\n }\n const v = [m[1], m[2], m[3]].map(v => parseFloat(v));\n const outOfRange = v.find(v => Number.isNaN(v));\n return [!outOfRange, `hsl(${v[0]}, ${v[1]}%, ${v[2]}%)`];\n};\n\nconst strToCssHSLA = s => {\n const m = cssHSLARegex.exec(s);\n if (!m) {\n return [false];\n }\n const v = [m[1], m[2], m[3], m[4]].map(v => parseFloat(v));\n const outOfRange = v.find(v => Number.isNaN(v));\n return [!outOfRange, `hsl(${v[0]} ${v[1]}% ${v[2]}% / ${v[3]})`];\n};\n\nconst rgbObjectToStr = rgb => {\n return `{r:${f3(rgb.r)}, g:${f3(rgb.g)}, b:${f3(rgb.b)}}`;\n};\nconst rgbaObjectToStr = rgba => {\n return `{r:${f3(rgba.r)}, g:${f3(rgba.g)}, b:${f3(rgba.b)}}, a:${f3(rgba.a)}}`;\n};\n\nconst strTo3IntsRE = /^\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*$/;\nconst strTo3Ints = s => {\n const m = strTo3IntsRE.exec(s);\n if (!m) {\n return [false];\n }\n const v = [m[1], m[2], m[3]].map(v => parseInt(v));\n const outOfRange = v.find(v => v > 255);\n return [!outOfRange, v];\n};\n\nconst strTo4IntsRE = /^\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*$/;\nconst strTo4Ints = s => {\n const m = strTo4IntsRE.exec(s);\n if (!m) {\n return [false];\n }\n const v = [m[1], m[2], m[3], m[4]].map(v => parseInt(v));\n const outOfRange = v.find(v => v > 255);\n return [!outOfRange, v];\n};\n\nconst strTo3Floats = s => {\n const numbers = s.split(',').map(s => s.trim());\n const v = numbers.map(v => parseFloat(v));\n if (v.length !== 3) {\n return [false];\n }\n // Note: using isNaN not Number.isNaN\n const badNdx = numbers.findIndex(v => isNaN(v));\n return [badNdx < 0, v.map(v => f3(v))];\n};\n\nconst strTo4Floats = s => {\n const numbers = s.split(',').map(s => s.trim());\n const v = numbers.map(v => parseFloat(v));\n if (v.length !== 4) {\n return [false];\n }\n // Note: using isNaN not Number.isNaN\n const badNdx = numbers.findIndex(v => isNaN(v));\n return [badNdx < 0, v.map(v => f3(v))];\n};\n\nconst strToUint32RGBRegex = /^\\s*(?:0x){0,1}([0-9a-z]{1,6})\\s*$/i;\nconst strToUint32RGB = s => {\n const m = strToUint32RGBRegex.exec(s);\n if (!m) {\n return [false];\n }\n return [true, parseInt(m[1], 16)];\n};\n\nconst strToUint32RGBARegex = /^\\s*(?:0x){0,1}([0-9a-z]{1,8})\\s*$/i;\nconst strToUint32RGBA = s => {\n const m = strToUint32RGBARegex.exec(s);\n if (!m) {\n return [false];\n }\n return [true, parseInt(m[1], 16)];\n};\n\nconst hex6RE = /^\\s*#[a-f0-9]{6}\\s*$|^\\s*#[a-f0-9]{3}\\s*$/i;\nconst hexNoHash6RE = /^\\s*[a-f0-9]{6}\\s*$/i;\nconst hex8RE = /^\\s*#[a-f0-9]{8}\\s*$/i;\nconst hexNoHash8RE = /^\\s*[a-f0-9]{8}\\s*$/i;\n\n// For each format converter\n//\n// fromHex/toHex convert from/to '#RRGGBB'\n//\n// fromHex converts from the string '#RRBBGG' to the format\n// (eg: for uint32-rgb, '#123456' becomes 0x123456)\n//\n// toHex converts from the format to '#RRGGBB'\n// (eg: for uint8-rgb, [16, 33, 50] becomes '#102132')\n//\n//\n// fromStr/toStr convert from/to what's in the input[type=text] element\n//\n// toStr converts from the format to its string representation\n// (eg, for object-rgb, {r: 1, g: 0.5, b:0} becomes \"{r: 1, g: 0.5, b:0}\")\n// ^object ^string\n//\n// fromStr converts its string representation to its format\n// (eg, for object-rgb) \"{r: 1, g: 0.5, b:0}\" becomes {r: 1, g: 0.5, b:0})\n// ^string ^object\n// fromString returns an array which is [valid, v]\n// where valid is true if the string was a valid and v is the converted\n// format if v is true.\n//\n// Note: toStr should convert to \"ideal\" form (whatever that is).\n// (eg, for css-rgb\n// \"{ r: 0.10000, g: 001, b: 0}\" becomes \"{r: 0.1, g: 1, b: 0}\"\n// notice that css-rgb is a string to a string\n// )\nexport const colorFormatConverters = {\n 'hex6': {\n color: {\n from: v => [true, v],\n to: fixHex6,\n },\n text: {\n from: v => [hex6RE.test(v), v.trim()],\n to: v => v,\n },\n },\n 'hex8': {\n color: {\n from: v => [true, v],\n to: fixHex8,\n },\n text: {\n from: v => [hex8RE.test(v), v.trim()],\n to: v => v,\n },\n },\n 'hex3': {\n color: {\n from: v => [true, fixHex3(v)],\n to: hex3ToHex6,\n },\n text: {\n from: v => [hex6RE.test(v), hex6ToHex3(v.trim())],\n to: v => v,\n },\n },\n 'hex6-no-hash': {\n color: {\n from: v => [true, v.substring(1)],\n to: v => `#${fixHex6(v)}`,\n },\n text: {\n from: v => [hexNoHash6RE.test(v), v.trim()],\n to: v => v,\n },\n },\n 'hex8-no-hash': {\n color: {\n from: v => [true, v.substring(1)],\n to: v => `#${fixHex8(v)}`,\n },\n text: {\n from: v => [hexNoHash8RE.test(v), v.trim()],\n to: v => v,\n },\n },\n 'hex3-no-hash': {\n color: {\n from: v => [true, fixHex3(v).substring(1)],\n to: hex3ToHex6,\n },\n text: {\n from: v => [hexNoHash6RE.test(v), hex6ToHex3(v.trim())],\n to: v => v,\n },\n },\n 'uint32-rgb': {\n color: {\n from: v => [true, hexToUint32RGB(v)],\n to: uint32RGBToHex,\n },\n text: {\n from: v => strToUint32RGB(v),\n to: v => `0x${v.toString(16).padStart(6, '0')}`,\n },\n },\n 'uint32-rgba': {\n color: {\n from: v => [true, hexToUint32RGBA(v)],\n to: uint32RGBAToHex,\n },\n text: {\n from: v => strToUint32RGBA(v),\n to: v => `0x${v.toString(16).padStart(8, '0')}`,\n },\n },\n 'uint8-rgb': {\n color: {\n from: v => [true, hexToUint8RGB(v)],\n to: uint8RGBToHex,\n },\n text: {\n from: strTo3Ints,\n to: v => v.join(', '),\n },\n },\n 'uint8-rgba': {\n color: {\n from: v => [true, hexToUint8RGBA(v)],\n to: uint8RGBAToHex,\n },\n text: {\n from: strTo4Ints,\n to: v => v.join(', '),\n },\n },\n 'float-rgb': {\n color: {\n from: v => [true, hexToFloatRGB(v)],\n to: floatRGBToHex,\n },\n text: {\n from: strTo3Floats,\n // need Array.from because map of Float32Array makes a Float32Array\n to: v => Array.from(v).map(v => f3(v)).join(', '),\n },\n },\n 'float-rgba': {\n color: {\n from: v => [true, hexToFloatRGBA(v)],\n to: floatRGBAToHex,\n },\n text: {\n from: strTo4Floats,\n // need Array.from because map of Float32Array makes a Float32Array\n to: v => Array.from(v).map(v => f3(v)).join(', '),\n },\n },\n 'float-hsv': {\n color: {\n from: v => [true, rgbFloatToHSV01(hexToFloatRGB(v))],\n to: v => hsv01ToRGBFloat(floatRGBToHex(v)),\n },\n text: {\n from: strTo3Floats,\n // need Array.from because map of Float32Array makes a Float32Array\n to: v => Array.from(v).map(v => f3(v)).join(', '),\n },\n },\n 'float-hsva': {\n color: {\n from: v => [true, rgbaFloatToHSVA01(hexToFloatRGB(v))],\n to: v => hsva01ToRGBAFloat(floatRGBToHex(v)),\n },\n text: {\n from: strTo4Floats,\n // need Array.from because map of Float32Array makes a Float32Array\n to: v => Array.from(v).map(v => f3(v)).join(', '),\n },\n },\n //'float-hsl': {\n // color: {\n // from: v => [true, rgbFloatToHsl01(hexToFloatRGB(v))],\n // to: v => hsl01ToRGBFloat(floatRGBToHex(v)),\n // },\n // text: {\n // from: strTo3Floats,\n // // need Array.from because map of Float32Array makes a Float32Array\n // to: v => Array.from(v).map(v => f3(v)).join(', '),\n // },\n //},\n //'float-hsla': {\n // color: {\n // from: v => [true, hexToFloatRGBA(v)],\n // to: floatRGBAToHex,\n // },\n // text: {\n // from: strTo4Floats,\n // // need Array.from because map of Float32Array makes a Float32Array\n // to: v => Array.from(v).map(v => f3(v)).join(', '),\n // },\n //},\n 'object-rgb': {\n color: {\n from: v => [true, hexToObjectRGB(v)],\n to: objectRGBToHex,\n },\n text: {\n from: strToRGBObject,\n to: rgbObjectToStr,\n },\n },\n 'object-rgba': {\n color: {\n from: v => [true, hexToObjectRGBA(v)],\n to: objectRGBAToHex,\n },\n text: {\n from: strToRGBAObject,\n to: rgbaObjectToStr,\n },\n },\n 'css-rgb': {\n color: {\n from: v => [true, hexToCssRGB(v)],\n to: cssRGBToHex,\n },\n text: {\n from: strToCssRGB,\n to: v => strToCssRGB(v)[1],\n },\n },\n 'css-rgba': {\n color: {\n from: v => [true, hexToCssRGBA(v)],\n to: cssRGBAToHex,\n },\n text: {\n from: strToCssRGBA,\n to: v => strToCssRGBA(v)[1],\n },\n },\n 'css-hsl': {\n color: {\n from: v => [true, hexToCssHSL(v)],\n to: cssHSLToHex,\n },\n text: {\n from: strToCssHSL,\n to: v => strToCssHSL(v)[1],\n },\n },\n 'css-hsla': {\n color: {\n from: v => [true, hexToCssHSLA(v)],\n to: cssHSLAToHex,\n },\n text: {\n from: strToCssHSLA,\n to: v => strToCssHSLA(v)[1],\n },\n },\n};","import { createElem } from '../libs/elem.js';\nimport View from './View.js';\n\nexport default class ElementView extends View {\n constructor(tag, className) {\n super(createElem(tag, {className}));\n }\n}","import ElementView from '../views/ElementView.js';\nimport LabelController from './LabelController.js';\n\n// TODO: remove this? Should just be user side\nexport default class Canvas extends LabelController {\n #canvasElem;\n\n constructor(name) {\n super('muigui-canvas', name);\n this.#canvasElem = this.add(\n new ElementView('canvas', 'muigui-canvas'),\n ).domElement;\n }\n get canvas() {\n return this.#canvasElem;\n }\n}","import { createElem } from '../libs/elem.js';\nimport { identity } from '../libs/conversions.js';\nimport EditView from './EditView.js';\nimport { copyExistingProperties } from '../libs/utils.js';\n\nexport default class ColorView extends EditView {\n #to;\n #from;\n #colorElem;\n #skipUpdate;\n #options = {\n converters: identity,\n };\n\n constructor(setter, options) {\n const colorElem = createElem('input', {\n type: 'color',\n onInput: () => {\n const [valid, newV] = this.#from(colorElem.value);\n if (valid) {\n this.#skipUpdate = true;\n setter.setValue(newV);\n }\n },\n onChange: () => {\n const [valid, newV] = this.#from(colorElem.value);\n if (valid) {\n this.#skipUpdate = true;\n setter.setFinalValue(newV);\n }\n },\n });\n super(createElem('div', {}, [colorElem]));\n this.setOptions(options);\n this.#colorElem = colorElem;\n }\n updateDisplay(v) {\n if (!this.#skipUpdate) {\n this.#colorElem.value = this.#to(v);\n }\n this.#skipUpdate = false;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {converters: {to, from}} = this.#options;\n this.#to = to;\n this.#from = from;\n return this;\n }\n}\n","import {\n colorFormatConverters,\n guessFormat,\n} from '../libs/color-utils.js';\nimport ValueController from './ValueController.js';\nimport TextView from '../views/TextView.js';\nimport ColorView from '../views/ColorView.js';\n\nexport default class Color extends ValueController {\n #colorView;\n #textView;\n\n constructor(object, property, options = {}) {\n super(object, property, 'muigui-color');\n const format = options.format || guessFormat(this.getValue());\n const {color, text} = colorFormatConverters[format];\n this.#colorView = this.add(new ColorView(this, {converters: color}));\n this.#textView = this.add(new TextView(this, {converters: text}));\n this.updateDisplay();\n }\n setOptions(options) {\n const {format} = options;\n if (format) {\n const {color, text} = colorFormatConverters[format];\n this.#colorView.setOptions({converters: color});\n this.#textView.setOptions({converters: text});\n }\n super.setOptions(options);\n return this;\n }\n}","import Controller from './Controller.js';\n\n// This feels like it should be something else like\n// gui.addController({className: 'muigui-divider')};\nexport default class Divider extends Controller {\n constructor() {\n super('muigui-divider');\n }\n}","import Controller from './Controller.js';\n\nexport default class Container extends Controller {\n #controllers;\n #childDestController;\n\n constructor(className) {\n super(className);\n this.#controllers = [];\n this.#childDestController = this;\n }\n get children() {\n return this.#controllers; // should we return a copy?\n }\n get controllers() {\n return this.#controllers.filter(c => !(c instanceof Container));\n }\n get folders() {\n return this.#controllers.filter(c => c instanceof Container);\n }\n reset(recursive = true) {\n for (const controller of this.#controllers) {\n if (!(controller instanceof Container) || recursive) {\n controller.reset(recursive);\n }\n }\n return this;\n }\n updateDisplay() {\n for (const controller of this.#controllers) {\n controller.updateDisplay();\n }\n return this;\n }\n remove(controller) {\n const ndx = this.#controllers.indexOf(controller);\n if (ndx >= 0) {\n const c = this.#controllers.splice(ndx, 1);\n const c0 = c[0];\n const elem = c0.domElement;\n elem.remove();\n c0.setParent(null);\n }\n return this;\n }\n #addControllerImpl(controller) {\n this.domElement.appendChild(controller.domElement);\n this.#controllers.push(controller);\n controller.setParent(this);\n return controller;\n }\n addController(controller) {\n return this.#childDestController.#addControllerImpl(controller);\n }\n pushContainer(container) {\n this.addController(container);\n this.#childDestController = container;\n return container;\n }\n popContainer() {\n this.#childDestController = this.#childDestController.parent;\n return this;\n }\n}\n","import { createElem } from '../libs/elem.js';\nimport Container from './Container.js';\n\nexport default class Folder extends Container {\n #labelElem;\n\n constructor(name = 'Controls', className = 'muigui-menu') {\n super(className);\n this.#labelElem = createElem('label');\n this.addElem(createElem('button', {\n type: 'button',\n onClick: () => this.toggleOpen(),\n }, [this.#labelElem]));\n this.pushContainer(new Container('muigui-open-container'));\n this.pushContainer(new Container());\n this.name(name);\n this.open();\n }\n open(open = true) {\n this.domElement.classList.toggle('muigui-closed', !open);\n this.domElement.classList.toggle('muigui-open', open);\n return this;\n }\n close() {\n return this.open(false);\n }\n name(name) {\n this.#labelElem.textContent = name;\n return this;\n }\n title(title) {\n return this.name(title);\n }\n toggleOpen() {\n this.open(!this.domElement.classList.contains('muigui-open'));\n return this;\n }\n}\n","import Controller from './Controller.js';\n\n// This feels like it should be something else like\n// gui.addDividing = new Controller()\nexport default class Label extends Controller {\n constructor(text) {\n super('muigui-label');\n this.text(text);\n }\n text(text) {\n this.domElement.textContent = text;\n return this;\n }\n}","function noop() {\n}\n\nexport function computeRelativePosition(elem, event, start) {\n const rect = elem.getBoundingClientRect();\n const x = event.clientX - rect.left;\n const y = event.clientY - rect.top;\n const nx = x / rect.width;\n const ny = y / rect.height;\n start = start || [x, y];\n const dx = x - start[0];\n const dy = y - start[1];\n const ndx = dx / rect.width;\n const ndy = dy / rect.width;\n return {x, y, nx, ny, dx, dy, ndx, ndy};\n}\n\nexport function addTouchEvents(elem, {onDown = noop, onMove = noop, onUp = noop}) {\n let start;\n const pointerMove = function (event) {\n const e = {\n type: 'move',\n ...computeRelativePosition(elem, event, start),\n };\n onMove(e);\n };\n\n const pointerUp = function (event) {\n elem.releasePointerCapture(event.pointerId);\n elem.removeEventListener('pointermove', pointerMove);\n elem.removeEventListener('pointerup', pointerUp);\n\n document.body.style.backgroundColor = '';\n\n onUp('up');\n };\n\n const pointerDown = function (event) {\n elem.addEventListener('pointermove', pointerMove);\n elem.addEventListener('pointerup', pointerUp);\n elem.setPointerCapture(event.pointerId);\n\n const rel = computeRelativePosition(elem, event);\n start = [rel.x, rel.y];\n onDown({\n type: 'down',\n ...rel,\n });\n };\n\n elem.addEventListener('pointerdown', pointerDown);\n\n return function () {\n elem.removeEventListener('pointerdown', pointerDown);\n };\n}","import { createElem, getNewId } from '../libs/elem.js';\nimport { addTouchEvents } from '../libs/touch.js';\nimport { identity } from '../libs/conversions.js';\nimport { clamp } from '../libs/utils.js';\nimport EditView from './EditView.js';\nimport {\n hexToFloatRGB,\n hexToFloatRGBA,\n hsv01ToRGBFloat,\n hsva01ToRGBAFloat,\n rgbFloatToHSV01,\n rgbaFloatToHSVA01,\n floatRGBToHex,\n floatRGBAToHex,\n rgbaFloatToHsla01,\n} from '../libs/color-utils.js';\nimport { copyExistingProperties } from '../libs/utils.js';\n\nconst svg = `\n\n \n \n \n \n \n \n \n \n\n \n \n \n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n \n \n \n \n \n \n \n \n\n`;\n\nfunction connectFillTargets(elem) {\n elem.querySelectorAll('[data-src]').forEach(srcElem => {\n const id = getNewId();\n srcElem.id = id;\n elem.querySelectorAll(`[data-target=${srcElem.dataset.src}]`).forEach(targetElem => {\n targetElem.setAttribute('fill', `url(#${id})`);\n });\n });\n return elem;\n}\n\n// Was originally going to make alpha an option. Issue is\n// hard coded conversions?\nexport default class ColorChooserView extends EditView {\n #to;\n #from;\n #satLevelElem;\n #circleElem;\n #hueUIElem;\n #hueElem;\n #hueCursorElem;\n #alphaUIElem;\n #alphaElem;\n #alphaCursorElem;\n #hsva;\n #skipHueUpdate;\n #skipSatLevelUpdate;\n #skipAlphaUpdate;\n #options = {\n converters: identity,\n alpha: false,\n };\n #convertInternalToHex;\n #convertHexToInternal;\n\n constructor(setter, options) {\n super(createElem('div', {\n innerHTML: svg,\n className: 'muigui-no-scroll',\n }));\n this.#satLevelElem = this.domElement.children[0];\n this.#hueUIElem = this.domElement.children[1];\n this.#alphaUIElem = this.domElement.children[2];\n connectFillTargets(this.#satLevelElem);\n connectFillTargets(this.#hueUIElem);\n connectFillTargets(this.#alphaUIElem);\n this.#circleElem = this.$('.muigui-color-chooser-circle');\n this.#hueElem = this.$('[data-src=muigui-color-chooser-hue]');\n this.#hueCursorElem = this.$('.muigui-color-chooser-hue-cursor');\n this.#alphaElem = this.$('[data-src=muigui-color-chooser-alpha]');\n this.#alphaCursorElem = this.$('.muigui-color-chooser-alpha-cursor');\n\n const handleSatLevelChange = (e) => {\n const s = clamp(e.nx, 0, 1);\n const v = clamp(e.ny, 0, 1);\n this.#hsva[1] = s;\n this.#hsva[2] = (1 - v);\n this.#skipHueUpdate = true;\n this.#skipAlphaUpdate = true;\n const [valid, newV] = this.#from(this.#convertInternalToHex(this.#hsva));\n if (valid) {\n setter.setValue(newV);\n }\n };\n\n const handleHueChange = (e) => {\n const h = clamp(e.nx, 0, 1);\n this.#hsva[0] = h;\n this.#skipSatLevelUpdate = true;\n this.#skipAlphaUpdate = true;\n const [valid, newV] = this.#from(this.#convertInternalToHex(this.#hsva));\n if (valid) {\n setter.setValue(newV);\n }\n };\n\n const handleAlphaChange = (e) => {\n const a = clamp(e.nx, 0, 1);\n this.#hsva[3] = a;\n this.#skipHueUpdate = true;\n this.#skipSatLevelUpdate = true;\n const [valid, newV] = this.#from(this.#convertInternalToHex(this.#hsva));\n if (valid) {\n setter.setValue(newV);\n }\n };\n\n addTouchEvents(this.#satLevelElem, {\n onDown: handleSatLevelChange,\n onMove: handleSatLevelChange,\n });\n addTouchEvents(this.#hueUIElem, {\n onDown: handleHueChange,\n onMove: handleHueChange,\n });\n addTouchEvents(this.#alphaUIElem, {\n onDown: handleAlphaChange,\n onMove: handleAlphaChange,\n });\n this.setOptions(options);\n }\n updateDisplay(newV) {\n if (!this.#hsva) {\n this.#hsva = this.#convertHexToInternal(this.#to(newV));\n }\n {\n const [h, s, v, a = 1] = this.#convertHexToInternal(this.#to(newV));\n // Don't copy the hue if it was un-computable.\n if (!this.#skipHueUpdate) {\n this.#hsva[0] = s > 0.001 && v > 0.001 ? h : this.#hsva[0];\n }\n if (!this.#skipSatLevelUpdate) {\n this.#hsva[1] = s;\n this.#hsva[2] = v;\n }\n if (!this.#skipAlphaUpdate) {\n this.#hsva[3] = a;\n }\n }\n {\n const [h, s, v, a] = this.#hsva;\n const [hue, sat, lum] = rgbaFloatToHsla01(hsva01ToRGBAFloat(this.#hsva));\n\n if (!this.#skipHueUpdate) {\n this.#hueCursorElem.setAttribute('transform', `translate(${h * 64}, 0)`);\n }\n this.#hueElem.children[0].setAttribute('stop-color', `hsl(${hue * 360} 0% 100% / ${a})`);\n this.#hueElem.children[1].setAttribute('stop-color', `hsl(${hue * 360} 100% 50% / ${a})`);\n if (!this.#skipAlphaUpdate) {\n this.#alphaCursorElem.setAttribute('transform', `translate(${a * 64}, 0)`);\n }\n this.#alphaElem.children[0].setAttribute('stop-color', `hsl(${hue * 360} ${sat * 100}% ${lum * 100}% / 0)`);\n this.#alphaElem.children[1].setAttribute('stop-color', `hsl(${hue * 360} ${sat * 100}% ${lum * 100}% / 1)`);\n\n if (!this.#skipSatLevelUpdate) {\n this.#circleElem.setAttribute('cx', `${s * 64}`);\n this.#circleElem.setAttribute('cy', `${(1 - v) * 48}`);\n }\n }\n this.#skipHueUpdate = false;\n this.#skipSatLevelUpdate = false;\n this.#skipAlphaUpdate = false;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {converters: {to, from}, alpha} = this.#options;\n this.#alphaUIElem.style.display = alpha ? '' : 'none';\n this.#convertInternalToHex = alpha\n ? v => floatRGBAToHex(hsva01ToRGBAFloat(v))\n : v => floatRGBToHex(hsv01ToRGBFloat(v));\n this.#convertHexToInternal = alpha\n ? v => rgbaFloatToHSVA01(hexToFloatRGBA(v))\n : v => rgbFloatToHSV01(hexToFloatRGB(v));\n this.#to = to;\n this.#from = from;\n return this;\n }\n}\n","import ElementView from '../views/ElementView.js';\nimport ValueController from './ValueController.js';\nimport { copyExistingProperties } from '../libs/utils.js';\nimport { createElem } from '../libs/elem.js';\n/*\n\nholder = new TabHolder\ntab = holder.add(new Tab(\"name\"))\ntab.add(...)\n\n\npc = new PopdownController\ntop = pc.add(new Row())\ntop.add(new Button());\nvalues = topRow.add(new Div())\nbottom = pc.add(new Row());\n\n\n\npc = new PopdownController\npc.addTop\npc.addTop\n\npc.addBottom\n\n\n*/\n\nexport default class PopDownController extends ValueController {\n #top;\n #valuesView;\n #checkboxElem;\n #bottom;\n #options = {\n open: false,\n };\n\n constructor(object, property, options = {}) {\n super(object, property, 'muigui-pop-down-controller');\n /*\n [ValueView\n [[B][values]] upper row\n [[ visual ]] lower row\n ]\n */\n this.#top = this.add(new ElementView('div', 'muigui-pop-down-top'));\n// this.#top.add(new CheckboxView(makeSetter(this.#options, 'open')));\n const checkboxElem = this.#top.addElem(createElem('input', {\n type: 'checkbox',\n onChange: () => {\n this.#options.open = checkboxElem.checked;\n this.updateDisplay();\n },\n }));\n this.#checkboxElem = checkboxElem;\n this.#valuesView = this.#top.add(new ElementView('div', 'muigui-pop-down-values'));\n const container = new ElementView('div', 'muigui-pop-down-bottom muigui-open-container');\n this.#bottom = new ElementView('div');\n container.add(this.#bottom);\n this.add(container);\n this.setOptions(options);\n }\n setKnobColor(bgCssColor/*, fgCssColor*/) {\n if (this.#checkboxElem) {\n this.#checkboxElem.style = `\n --range-color: ${bgCssColor};\n --value-bg-color: ${bgCssColor};\n `;\n }\n }\n updateDisplay() {\n super.updateDisplay();\n const {open} = this.#options;\n this.domElement.children[1].classList.toggle('muigui-open', open);\n this.domElement.children[1].classList.toggle('muigui-closed', !open);\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n super.setOptions(options);\n this.updateDisplay();\n }\n addTop(view) {\n return this.#valuesView.add(view);\n }\n addBottom(view) {\n return this.#bottom.add(view);\n }\n}","/* eslint-disable no-underscore-dangle */\nimport {\n colorFormatConverters,\n guessFormat,\n hasAlpha,\n hexToUint8RGB,\n hslToRgbUint8,\n rgbUint8ToHsl,\n uint8RGBToHex,\n} from '../libs/color-utils.js';\nimport ColorChooserView from '../views/ColorChooserView.js';\nimport TextView from '../views/TextView.js';\nimport PopDownController from './PopDownController.js';\n\nexport default class ColorChooser extends PopDownController {\n #colorView;\n #textView;\n #to;\n\n constructor(object, property, options = {}) {\n super(object, property, 'muigui-color-chooser');\n const format = options.format || guessFormat(this.getValue());\n const {color, text} = colorFormatConverters[format];\n this.#to = color.to;\n this.#textView = new TextView(this, {converters: text, alpha: hasAlpha(format)});\n this.#colorView = new ColorChooserView(this, {converters: color, alpha: hasAlpha(format)});\n this.addTop(this.#textView);\n this.addBottom(this.#colorView);\n // WTF! FIX!\n this.___setKnobHelper = true;\n this.updateDisplay();\n }\n #setKnobHelper() {\n if (this.#to) {\n const hex6Or8 = this.#to(this.getValue());\n const alpha = hex6Or8.length === 9 ? hex6Or8.substring(7, 9) : 'FF';\n const hsl = rgbUint8ToHsl(hexToUint8RGB(hex6Or8));\n hsl[2] = (hsl[2] + 50) % 100;\n const hex = uint8RGBToHex(hslToRgbUint8(hsl));\n this.setKnobColor(`${hex6Or8.substring(0, 7)}${alpha}`, hex);\n }\n }\n updateDisplay() {\n super.updateDisplay();\n if (this.___setKnobHelper) {\n this.#setKnobHelper();\n }\n }\n setOptions(options) {\n super.setOptions(options);\n return this;\n }\n}\n","import css from './styles/muigui.css.js';\nimport {createElem} from './libs/elem.js';\nimport {createController} from './controllers/create-controller.js';\nimport {\n mapRange,\n makeRangeConverters,\n makeRangeOptions,\n makeMinMaxPair,\n} from './libs/utils.js';\nimport {\n converters\n} from './libs/conversions.js';\nimport {\n hasAlpha,\n guessFormat,\n} from './libs/color-utils.js';\nimport Canvas from './controllers/Canvas.js';\nimport Color from './controllers/Color.js';\nimport Divider from './controllers/Divider.js';\nimport Folder from './controllers/Folder.js';\nimport Label from './controllers/Label.js';\nimport Controller from './controllers/Controller.js';\nimport ColorChooser from './controllers/ColorChooser.js';\n\nimport Column from './layout/Column.js';\nimport Frame from './layout/Frame.js';\nimport Grid from './layout/Grid.js';\nimport Row from './layout/Row.js';\n\nexport {\n Column,\n Frame,\n Grid,\n Row,\n};\n\nexport class GUIFolder extends Folder {\n add(object, property, ...args) {\n const controller = object instanceof Controller\n ? object\n : createController(object, property, ...args);\n return this.addController(controller);\n }\n addCanvas(name) {\n return this.addController(new Canvas(name));\n }\n addColor(object, property, options = {}) {\n const value = object[property];\n if (hasAlpha(options.format || guessFormat(value))) {\n return this.addController(new ColorChooser(object, property, options));\n } else {\n return this.addController(new Color(object, property, options));\n }\n }\n addDivider() {\n return this.addController(new Divider());\n }\n addFolder(name) {\n return this.addController(new GUIFolder(name));\n }\n addLabel(text) {\n return this.addController(new Label(text));\n }\n addButton(name, fn) {\n const o = {fn};\n return this.add(o, 'fn').name(name);\n }\n}\n\nclass MuiguiElement extends HTMLElement {\n constructor() {\n super();\n this.shadow = this.attachShadow({mode: 'open'});\n }\n}\n\ncustomElements.define('muigui-element', MuiguiElement);\n\nconst baseStyleSheet = new CSSStyleSheet();\n//baseStyleSheet.replaceSync(css.default);\nconst userStyleSheet = new CSSStyleSheet();\n\nfunction makeStyleSheetUpdater(styleSheet) {\n let newCss;\n let newCssPromise;\n\n function updateStyle() {\n if (newCss && !newCssPromise) {\n const s = newCss;\n newCss = undefined;\n newCssPromise = styleSheet.replace(s).then(() => {\n newCssPromise = undefined;\n updateStyle();\n });\n }\n }\n\n return function updateStyleSheet(css) {\n newCss = css;\n updateStyle();\n };\n}\n\nconst updateBaseStyle = makeStyleSheetUpdater(baseStyleSheet);\nconst updateUserStyle = makeStyleSheetUpdater(userStyleSheet);\n\nfunction getTheme(name) {\n const { include, css: cssStr } = css.themes[name];\n return `${include.map(m => css[m]).join('\\n')} : css.default}\\n${cssStr || ''}`;\n}\n\nexport class GUI extends GUIFolder {\n static converters = converters;\n static mapRange = mapRange;\n static makeRangeConverters = makeRangeConverters;\n static makeRangeOptions = makeRangeOptions;\n static makeMinMaxPair = makeMinMaxPair;\n #localStyleSheet = new CSSStyleSheet();\n\n constructor(options = {}) {\n super('Controls', 'muigui-root');\n if (options instanceof HTMLElement) {\n options = {parent: options};\n }\n const {\n autoPlace = true,\n width,\n title = 'Controls',\n } = options;\n let {\n parent,\n } = options;\n\n if (width) {\n this.domElement.style.width = /^\\d+$/.test(width) ? `${width}px` : width;\n }\n if (parent === undefined && autoPlace) {\n parent = document.body;\n this.domElement.classList.add('muigui-auto-place');\n }\n if (parent) {\n const muiguiElement = createElem('muigui-element');\n muiguiElement.shadowRoot.adoptedStyleSheets = [this.#localStyleSheet, baseStyleSheet, userStyleSheet];\n muiguiElement.shadow.appendChild(this.domElement);\n parent.appendChild(muiguiElement);\n }\n if (title) {\n this.title(title);\n }\n this.#localStyleSheet.replaceSync(css.default);\n this.domElement.classList.add('muigui', 'muigui-colors');\n }\n setStyle(css) {\n this.#localStyleSheet.replace(css);\n }\n static setBaseStyles(css) {\n updateBaseStyle(css);\n }\n static getBaseStyleSheet() {\n return baseStyleSheet;\n }\n static setUserStyles(css) {\n updateUserStyle(css);\n }\n static getUserStyleSheet() {\n return userStyleSheet;\n }\n setTheme(name) {\n this.setStyle(getTheme(name));\n }\n static setTheme(name) {\n GUI.setBaseStyles(getTheme(name));\n }\n}\n\nexport default GUI;\n","import Button from './Button.js';\nimport Checkbox from './Checkbox.js';\nimport TextNumber from './TextNumber.js';\nimport Select from './Select.js';\nimport Range from './Range.js';\nimport Text from './Text.js';\n\n// const isConversion = o => typeof o.to === 'function' && typeof o.from === 'function';\n\n/**\n * possible inputs\n * add(o, p, min: number, max: number)\n * add(o, p, min: number, max: number, step: number)\n * add(o, p, array: [value])\n * add(o, p, array: [[key, value]])\n *\n * @param {*} object\n * @param {string} property\n * @param {...any} args\n * @returns {Controller}\n */\nexport function createController(object, property, ...args) {\n const [arg1] = args;\n if (Array.isArray(arg1)) {\n return new Select(object, property, {keyValues: arg1});\n }\n if (arg1 && arg1.keyValues) {\n return new Select(object, property, {keyValues: arg1.keyValues});\n }\n\n const t = typeof object[property];\n switch (t) {\n case 'number':\n if (typeof args[0] === 'number' && typeof args[1] === 'number') {\n const min = args[0];\n const max = args[1];\n const step = args[2];\n return new Range(object, property, {min, max, ...(step && {step})});\n }\n return args.length === 0\n ? new TextNumber(object, property, ...args)\n : new Range(object, property, ...args);\n case 'boolean':\n return new Checkbox(object, property, ...args);\n case 'function':\n return new Button(object, property, ...args);\n case 'string':\n return new Text(object, property, ...args);\n case 'undefined':\n throw new Error(`no property named ${property}`);\n default:\n throw new Error(`unhandled type ${t} for property ${property}`);\n }\n}","function noop() {\n}\n\nconst keyDirections = {\n ArrowLeft: [-1, 0],\n ArrowRight: [1, 0],\n ArrowUp: [0, -1],\n ArrowDown: [0, 1],\n};\n\n// This probably needs to be global\nexport function addKeyboardEvents(elem, {onDown = noop, onUp = noop}) {\n const keyDown = function (event) {\n const mult = event.shiftKey ? 10 : 1;\n const [dx, dy] = (keyDirections[event.key] || [0, 0]).map(v => v * mult);\n const fn = event.type === 'keydown' ? onDown : onUp;\n fn({\n type: event.type.substring(3),\n dx,\n dy,\n event,\n });\n };\n\n elem.addEventListener('keydown', keyDown);\n elem.addEventListener('keyup', keyDown);\n\n return function () {\n elem.removeEventListener('keydown', keyDown);\n elem.removeEventListener('keyup', keyDown);\n };\n}","export function assert(truthy, msg = '') {\n if (!truthy) {\n throw new Error(msg);\n }\n}","import { assert } from '../libs/assert.js';\n\nfunction getEllipsePointForAngle(cx, cy, rx, ry, phi, theta) {\n const m = Math.abs(rx) * Math.cos(theta);\n const n = Math.abs(ry) * Math.sin(theta);\n\n return [\n cx + Math.cos(phi) * m - Math.sin(phi) * n,\n cy + Math.sin(phi) * m + Math.cos(phi) * n,\n ];\n}\n\nfunction getEndpointParameters(cx, cy, rx, ry, phi, theta, dTheta) {\n const [x1, y1] = getEllipsePointForAngle(cx, cy, rx, ry, phi, theta);\n const [x2, y2] = getEllipsePointForAngle(cx, cy, rx, ry, phi, theta + dTheta);\n\n const fa = Math.abs(dTheta) > Math.PI ? 1 : 0;\n const fs = dTheta > 0 ? 1 : 0;\n\n return { x1, y1, x2, y2, fa, fs };\n}\n\nexport function arc(cx, cy, r, start, end) {\n assert(Math.abs(start - end) <= Math.PI * 2);\n assert(start >= -Math.PI && start <= Math.PI * 2);\n assert(start <= end);\n assert(end >= -Math.PI && end <= Math.PI * 4);\n\n const { x1, y1, x2, y2, fa, fs } = getEndpointParameters(cx, cy, r, r, 0, start, end - start);\n return Math.abs(Math.abs(start - end) - Math.PI * 2) > Number.EPSILON\n ? `M${cx} ${cy} L${x1} ${y1} A ${r} ${r} 0 ${fa} ${fs} ${x2} ${y2} L${cx} ${cy}`\n : `M${x1} ${y1} L${x1} ${y1} A ${r} ${r} 0 ${fa} ${fs} ${x2} ${y2}`;\n}\n","import { identity } from '../libs/conversions.js';\nimport { createElem } from '../libs/elem.js';\nimport { addKeyboardEvents } from '../libs/keyboard.js';\nimport { arc } from '../libs/svg.js';\nimport { addTouchEvents } from '../libs/touch.js';\nimport { createWheelHelper } from '../libs/wheel.js';\nimport { clamp, copyExistingProperties, euclideanModulo, lerp, stepify } from '../libs/utils.js';\nimport EditView from './EditView.js';\n\nconst svg = `\n\n \n \n \n \n \n \n \n\n`;\n\nconst twoPiMod = v => euclideanModulo(v + Math.PI, Math.PI * 2) - Math.PI;\n\nexport default class DirectionView extends EditView {\n #arrowElem;\n #rangeElem;\n #lastV;\n #wrap;\n #options = {\n step: 1,\n min: -180,\n max: 180,\n\n /*\n --------\n / -π/2 \\\n / | \\\n |<- -π * |\n | * 0 ->| zero is down the positive X axis\n |<- +π * |\n \\ | /\n \\ π/2 /\n --------\n */\n dirMin: -Math.PI,\n dirMax: Math.PI,\n //dirMin: Math.PI * 0.5,\n //dirMax: Math.PI * 2.5,\n //dirMin: -Math.PI * 0.75, // test 10:30 to 7:30\n //dirMax: Math.PI * 0.75,\n //dirMin: Math.PI * 0.75, // test 7:30 to 10:30\n //dirMax: -Math.PI * 0.75,\n //dirMin: -Math.PI * 0.75, // test 10:30 to 1:30\n //dirMax: -Math.PI * 0.25,\n //dirMin: Math.PI * 0.25, // test 4:30 to 7:30\n //dirMax: Math.PI * 0.75,\n //dirMin: Math.PI * 0.75, // test 4:30 to 7:30\n //dirMax: Math.PI * 0.25,\n wrap: undefined,\n converters: identity,\n };\n\n constructor(setter, options = {}) {\n const wheelHelper = createWheelHelper();\n super(createElem('div', {\n className: 'muigui-direction muigui-no-scroll',\n innerHTML: svg,\n onWheel: e => {\n e.preventDefault();\n const {min, max, step} = this.#options;\n const delta = wheelHelper(e, step);\n let tempV = this.#lastV + delta;\n if (this.#wrap) {\n tempV = euclideanModulo(tempV - min, max - min) + min;\n }\n const newV = clamp(stepify(tempV, v => v, step), min, max);\n setter.setValue(newV);\n },\n }));\n const handleTouch = (e) => {\n const {min, max, step, dirMin, dirMax} = this.#options;\n const nx = e.nx * 2 - 1;\n const ny = e.ny * 2 - 1;\n const a = Math.atan2(ny, nx);\n\n const center = (dirMin + dirMax) / 2;\n\n const centeredAngle = twoPiMod(a - center);\n const centeredStart = twoPiMod(dirMin - center);\n const diff = dirMax - dirMin;\n\n const n = clamp((centeredAngle - centeredStart) / (diff), 0, 1);\n const newV = stepify(min + (max - min) * n, v => v, step);\n setter.setValue(newV);\n };\n addTouchEvents(this.domElement, {\n onDown: handleTouch,\n onMove: handleTouch,\n });\n addKeyboardEvents(this.domElement, {\n onDown: (e) => {\n const {min, max, step} = this.#options;\n const newV = clamp(stepify(this.#lastV + e.dx * step, v => v, step), min, max);\n setter.setValue(newV);\n },\n });\n this.#arrowElem = this.$('#muigui-arrow');\n this.#rangeElem = this.$('#muigui-range');\n this.setOptions(options);\n }\n updateDisplay(v) {\n this.#lastV = v;\n const {min, max} = this.#options;\n const n = (v - min) / (max - min);\n const angle = lerp(this.#options.dirMin, this.#options.dirMax, n);\n this.#arrowElem.style.transform = `rotate(${angle}rad)`;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {dirMin, dirMax, wrap} = this.#options;\n this.#wrap = wrap !== undefined\n ? wrap\n : Math.abs(dirMin - dirMax) >= Math.PI * 2 - Number.EPSILON;\n const [min, max] = dirMin < dirMax ? [dirMin, dirMax] : [dirMax , dirMin];\n this.#rangeElem.setAttribute('d', arc(0, 0, 28.87, min, max));\n }\n}\n","import { identity } from '../libs/conversions.js';\nimport DirectionView from '../views/DirectionView.js';\nimport NumberView from '../views/NumberView.js';\n// import ValueController from './ValueController.js';\nimport PopDownController from './PopDownController.js';\n\n\n// deg2rad\n// where is 0\n// range (0, 360), (-180, +180), (0,0) Really this is a range\n\nexport default class Direction extends PopDownController {\n #options;\n constructor(object, property, options) {\n super(object, property, 'muigui-direction');\nthis.#options = options; // FIX\n this.addTop(new NumberView(this,\nidentity));\n this.addBottom(new DirectionView(this, options));\n this.updateDisplay();\n }\n}\n\n","import { createElem } from '../libs/elem.js';\nimport { makeId } from '../libs/ids.js';\nimport EditView from './EditView.js';\n\nexport default class RadioGridView extends EditView {\n #values;\n\n constructor(setter, keyValues, cols = 3) {\n const values = [];\n const name = makeId();\n super(createElem('div', {}, keyValues.map(([key, value], ndx) => {\n values.push(value);\n return createElem('label', {}, [\n createElem('input', {\n type: 'radio',\n name,\n value: ndx,\n onChange: function () {\n if (this.checked) {\n setter.setFinalValue(that.#values[this.value]);\n }\n },\n }),\n createElem('button', {\n type: 'button',\n textContent: key,\n onClick: function () {\n this.previousElementSibling.click();\n },\n }),\n ]);\n })));\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const that = this;\n this.#values = values;\n this.cols(cols);\n }\n updateDisplay(v) {\n const ndx = this.#values.indexOf(v);\n for (let i = 0; i < this.domElement.children.length; ++i) {\n this.domElement.children[i].children[0].checked = i === ndx;\n }\n }\n cols(cols) {\n this.domElement.style.gridTemplateColumns = `repeat(${cols}, 1fr)`;\n }\n}\n","import RadioGridView from '../views/RadioGridView.js';\nimport ValueController from './ValueController.js';\nimport { convertToKeyValues } from '../libs/key-values.js';\n\nexport default class RadioGrid extends ValueController {\n constructor(object, property, options) {\n super(object, property, 'muigui-radio-grid');\n const valueIsNumber = typeof this.getValue() === 'number';\n const {\n keyValues: keyValuesInput,\n cols = 3,\n } = options;\n const keyValues = convertToKeyValues(keyValuesInput, valueIsNumber);\n this.add(new RadioGridView(this, keyValues, cols));\n this.updateDisplay();\n }\n}","export function onResize(elem, callback) {\n new ResizeObserver(() => {\n callback({rect: elem.getBoundingClientRect(), elem});\n }).observe(elem);\n}\n\nexport function onResizeSVGNoScale(elem, hAnchor, vAnchor, callback) {\n onResize(elem, ({rect}) => {\n const {width, height} = rect;\n elem.setAttribute('viewBox', `-${width * hAnchor} -${height * vAnchor} ${width} ${height}`);\n callback({elem, rect});\n });\n}\n\nexport function onResizeCanvas(elem, callback) {\n onResize(elem, ({rect}) => {\n const {width, height} = rect;\n elem.width = width;\n elem.height = height;\n callback({elem, rect});\n });\n}\n","import { createElem } from '../libs/elem.js';\nimport { addKeyboardEvents } from '../libs/keyboard.js';\nimport { addTouchEvents } from '../libs/touch.js';\nimport { createWheelHelper } from '../libs/wheel.js';\nimport { onResizeSVGNoScale } from '../libs/resize-helpers.js';\nimport { clamp, copyExistingProperties, stepify } from '../libs/utils.js';\nimport EditView from './EditView.js';\n\nconst svg = `\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n`;\n\nfunction createSVGTicks(start, end, step, min, max, height) {\n const p = [];\n if (start < min) {\n start += stepify(min - start, v => v, step);\n }\n end = Math.min(end, max);\n for (let i = start; i <= end; i += step) {\n p.push(`M${i} 0 l0 ${height}`);\n }\n return p.join(' ');\n}\n\nfunction createSVGNumbers(start, end, unitSize, unit, minusSize, min, max, labelFn) {\n const texts = [];\n if (start < min) {\n start += stepify(min - start, v => v, unitSize);\n }\n end = Math.min(end, max);\n const digits = Math.max(0, -Math.log10(unit));\n const f = v => labelFn(v.toFixed(digits));\n for (let i = start; i <= end; i += unitSize) {\n texts.push(`= 0 ? i : (i - minusSize / 2) }\" y=\"0\">${f(i / unitSize * unit)}`);\n }\n return texts.join('\\n');\n}\n\nfunction computeSizeOfMinus(elem) {\n const oldHTML = elem.innerHTML;\n elem.innerHTML = '- ';\n const text = elem.querySelector('text');\n const size = text.getComputedTextLength();\n elem.innerHTML = oldHTML;\n return size;\n}\n\nexport default class SliderView extends EditView {\n #svgElem;\n #originElem;\n #ticksElem;\n #thicksElem;\n #numbersElem;\n #leftGradElem;\n #rightGradElem;\n #width;\n #height;\n #lastV;\n #minusSize;\n #options = {\n min: -100,\n max: 100,\n step: 1,\n unit: 10,\n unitSize: 10,\n ticksPerUnit: 5,\n labelFn: v => v,\n tickHeight: 1,\n limits: true,\n thicksColor: undefined,\n orientation: undefined,\n };\n\n constructor(setter, options) {\n const wheelHelper = createWheelHelper();\n super(createElem('div', {\n innerHTML: svg,\n className: 'muigui-no-v-scroll',\n onWheel: e => {\n e.preventDefault();\n const {min, max, step} = this.#options;\n const delta = wheelHelper(e, step);\n const newV = clamp(stepify(this.#lastV + delta, v => v, step), min, max);\n setter.setValue(newV);\n },\n }));\n this.#svgElem = this.$('svg');\n this.#originElem = this.$('#muigui-origin');\n this.#ticksElem = this.$('#muigui-ticks');\n this.#thicksElem = this.$('#muigui-thicks');\n this.#numbersElem = this.$('#muigui-numbers');\n this.#leftGradElem = this.$('#muigui-left-grad');\n this.#rightGradElem = this.$('#muigui-right-grad');\n this.setOptions(options);\n let startV;\n addTouchEvents(this.domElement, {\n onDown: () => {\n startV = this.#lastV;\n },\n onMove: (e) => {\n const {min, max, unitSize, unit, step} = this.#options;\n const newV = clamp(stepify(startV - e.dx / unitSize * unit, v => v, step), min, max);\n setter.setValue(newV);\n },\n });\n addKeyboardEvents(this.domElement, {\n onDown: (e) => {\n const {min, max, step} = this.#options;\n const newV = clamp(stepify(this.#lastV + e.dx * step, v => v, step), min, max);\n setter.setValue(newV);\n },\n });\n onResizeSVGNoScale(this.#svgElem, 0.5, 0, ({rect: {width}}) => {\n this.#leftGradElem.setAttribute('x', -width / 2);\n this.#rightGradElem.setAttribute('x', width / 2 - 20);\n this.#minusSize = computeSizeOfMinus(this.#numbersElem);\n this.#width = width;\n this.#updateSlider();\n });\n }\n // |--------V--------|\n // . . | . . . | . . . |\n //\n #updateSlider() {\n // There's no size if ResizeObserver has not fired yet.\n if (!this.#width || this.#lastV === undefined) {\n return;\n }\n const {\n labelFn,\n limits,\n min,\n max,\n orientation,\n tickHeight,\n ticksPerUnit,\n unit,\n unitSize,\n thicksColor,\n } = this.#options;\n const unitsAcross = Math.ceil(this.#width / unitSize);\n const center = this.#lastV;\n const centerUnitSpace = center / unit;\n const startUnitSpace = Math.round(centerUnitSpace - unitsAcross);\n const endUnitSpace = startUnitSpace + unitsAcross * 2;\n const start = startUnitSpace * unitSize;\n const end = endUnitSpace * unitSize;\n const minUnitSpace = limits ? min * unitSize / unit : start;\n const maxUnitSpace = limits ? max * unitSize / unit : end;\n const height = labelFn(1) === '' ? 10 : 5;\n if (ticksPerUnit > 1) {\n this.#ticksElem.setAttribute('d', createSVGTicks(start, end, unitSize / ticksPerUnit, minUnitSpace, maxUnitSpace, height * tickHeight));\n }\n this.#thicksElem.style.stroke = thicksColor; //setAttribute('stroke', thicksColor);\n this.#thicksElem.setAttribute('d', createSVGTicks(start, end, unitSize, minUnitSpace, maxUnitSpace, height));\n this.#numbersElem.innerHTML = createSVGNumbers(start, end, unitSize, unit, this.#minusSize, minUnitSpace, maxUnitSpace, labelFn);\n this.#originElem.setAttribute('transform', `translate(${-this.#lastV * unitSize / unit} 0)`);\n this.#svgElem.classList.toggle('muigui-slider-up', orientation === 'up');\n }\n updateDisplay(v) {\n this.#lastV = v;\n this.#updateSlider();\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n return this;\n }\n}\n","import ValueController from './ValueController.js';\nimport NumberView from '../views/NumberView.js';\nimport SliderView from '../views/SliderView.js';\n\nexport default class Slider extends ValueController {\n constructor(object, property, options = {}) {\n super(object, property, 'muigui-slider');\n this.add(new SliderView(this, options));\n this.add(new NumberView(this, options));\n this.updateDisplay();\n }\n}\n","import { createElem } from '../libs/elem.js';\nimport { addTouchEvents } from '../libs/touch.js';\nimport { onResizeSVGNoScale } from '../libs/resize-helpers.js';\nimport EditView from './EditView.js';\n\nconst svg = `\n\n \n \n \n \n \n\n`;\n\nexport default class Vec2View extends EditView {\n #svgElem;\n #arrowElem;\n #circleElem;\n #lastV = [];\n\n constructor(setter) {\n super(createElem('div', {\n innerHTML: svg,\n className: 'muigui-no-scroll',\n }));\n const onTouch = (e) => {\n const {width, height} = this.#svgElem.getBoundingClientRect();\n const nx = e.nx * 2 - 1;\n const ny = e.ny * 2 - 1;\n setter.setValue([nx * width * 0.5, ny * height * 0.5]);\n };\n addTouchEvents(this.domElement, {\n onDown: onTouch,\n onMove: onTouch,\n });\n this.#svgElem = this.$('svg');\n this.#arrowElem = this.$('#muigui-arrow');\n this.#circleElem = this.$('#muigui-circle');\n onResizeSVGNoScale(this.#svgElem, 0.5, 0.5, () => this.#updateDisplayImpl);\n }\n #updateDisplayImpl() {\n const [x, y] = this.#lastV;\n this.#arrowElem.setAttribute('d', `M0,0L${x},${y}`);\n this.#circleElem.setAttribute('transform', `translate(${x}, ${y})`);\n }\n updateDisplay(v) {\n this.#lastV[0] = v[0];\n this.#lastV[1] = v[1];\n this.#updateDisplayImpl();\n }\n}\n","import NumberView from '../views/NumberView.js';\nimport Vec2View from '../views/Vec2View.js';\nimport PopDownController from './PopDownController.js';\nimport { strToNumber } from '../libs/conversions.js';\n\n// TODO: zoom with wheel and pinch?\n// TODO: grid?\n// // options\n// scale:\n// range: number (both x and y + /)\n// range: array (min, max)\n// xRange:\n// deg/rad/turn\n\nexport default class Vec2 extends PopDownController {\n constructor(object, property) {\n super(object, property, 'muigui-vec2');\n\n const makeSetter = (ndx) => {\n return {\n setValue: (v) => {\n const newV = this.getValue();\n newV[ndx] = v;\n this.setValue(newV);\n },\n setFinalValue: (v) => {\n const newV = this.getValue();\n newV[ndx] = v;\n this.setFinalValue(newV);\n },\n };\n };\n\n this.addTop(new NumberView(makeSetter(0), {\n converters: {\n to: v => v[0],\n from: strToNumber.from,\n },\n }));\n this.addTop(new NumberView(makeSetter(1), {\n converters: {\n to: v => v[1],\n from: strToNumber.from,\n },\n }));\n this.addBottom(new Vec2View(this));\n this.updateDisplay();\n }\n}\n","const darkColors = {\n main: '#ddd',\n};\nconst lightColors = {\n main: '#333',\n};\n\nconst darkMatcher = window.matchMedia('(prefers-color-scheme: dark)');\n\nlet colors;\nlet isDarkMode;\n\nfunction update() {\n isDarkMode = darkMatcher.matches;\n colors = isDarkMode ? darkColors : lightColors;\n}\ndarkMatcher.addEventListener('change', update);\nupdate();\n\nexport function graph(canvas, data, {\n min = -1,\n max = 1,\n interval = 16,\n color,\n }) {\n const ctx = canvas.getContext('2d');\n\n function render() {\n const {width, height} = canvas;\n ctx.clearRect(0, 0, width, height);\n ctx.beginPath();\n const range = max - min;\n for (let i = 0; i < data.length; ++i) {\n const x = i * width / data.length;\n const y = (data[i] - min) * height / range;\n ctx.lineTo(x, y);\n }\n ctx.strokeStyle = color || colors.main;\n ctx.stroke();\n }\n setInterval(render, interval);\n}","import GUI from './muigui.js';\n\nexport { default as ColorChooser } from './controllers/ColorChooser.js';\nexport { default as Direction } from './controllers/Direction.js';\nexport { default as RadioGrid } from './controllers/RadioGrid.js';\nexport { default as Range } from './controllers/Range.js';\nexport { default as Select } from './controllers/Select.js';\nexport { default as Slider } from './controllers/Slider.js';\nexport { default as TextNumber } from './controllers/TextNumber.js';\nexport { default as Vec2 } from './controllers/Vec2.js';\n\nimport {graph} from './libs/graph.js';\nimport {monitor} from './libs/monitor.js';\n\nexport const helpers = {\n graph,\n monitor,\n};\n\nexport default GUI;","export function monitor(label, object, property, {interval = 200} = {}) {\n setInterval(() => {\n label.text(JSON.stringify(object[property], null, 2));\n }, interval);\n}\n"],"names":["css","default","themes","include","float","form","none","createElem","tag","attrs","children","elem","document","createElement","key","value","Object","entries","startsWith","eventName","substring","toLowerCase","addEventListener","passive","k","v","undefined","setAttribute","child","appendChild","setElemProps","nextId","removeArrayElem","array","ndx","indexOf","splice","clamp","min","max","Math","isTypedArray","SharedArrayBuffer","a","buffer","ArrayBuffer","stepify","from","step","round","euclideanModulo","n","copyExistingProperties","dst","src","mapRange","inMin","inMax","outMin","outMax","makeRangeConverters","to","makeRangeOptions","converters","identity","makeMinMaxPair","gui","properties","minPropName","maxPropName","options","guiMinRange","minRange","valueMinRange","minGui","add","onChange","maxGui","setValue","View","domElement","childDestElem","views","constructor","this","addElem","removeElem","removeChild","pushSubElem","popSubElem","parentElement","view","push","remove","pushSubView","popSubView","setOptions","updateDisplayIfNeeded","newV","ignoreCache","$","selector","querySelector","Controller","changeFns","finishChangeFns","parent","className","super","classList","setParent","enable","disabled","show","toggle","hide","closest","forEach","querySelectorAll","disable","fn","removeChange","onFinishChange","removeFinishChange","callListeners","fns","call","emitChange","object","property","controller","emitFinalChange","updateDisplay","getColors","toCamelCase","s","replace","m","m1","toUpperCase","div","colors","fromEntries","map","style","color","getComputedStyle","Button","buttonElem","name","type","onClick","textContent","arraysEqual","b","length","i","EditView","oldV","updateCheck","checkArrayNeedsUpdate","needUpdate","copyArrayElementsFromTo","checkTypedArrayNeedsUpdate","once","checkObjectNeedsUpdate","checkValueNeedsUpdate","getUpdateCheckForType","Array","isArray","bind","CheckboxView","checkboxElem","setter","id","onInput","checked","setFinalValue","tasks","tasksToRemove","Set","requestId","processing","processTasks","task","has","size","queueProcessing","clear","requestAnimationFrame","makeId","ValueView","LabelController","nameElem","for","title","tooltip","tip","ValueController","initialValue","listening","updateFn","getValue","setValueImpl","isDifferent","keys","assign","reset","listen","set","removeTask","Checkbox","strToNumber","toString","parseFloat","Number","isNaN","radToDeg","PI","createWheelHelper","wheelAccum","e","wheelScale","deltaY","delta","floor","abs","sign","NumberView","skipUpdate","NEGATIVE_INFINITY","POSITIVE_INFINITY","wheelHelper","handleInput","onWheel","preventDefault","valid","outV","setFn","inRange","TextNumber","textView","SelectView","values","keyValues","selectedIndex","convertToKeyValues","valueIsNumber","Select","keyValuesInput","RangeView","validV","Range","TextView","Text","lerp","t","fract","f0","toFixed","f3","hexToUint32RGB","parseInt","hexToUint32RGBA","hexToUint8RGB","uint8RGBToHex","padStart","join","hexToUint8RGBA","uint8RGBAToHex","hexToFloatRGB","floatRGBToHex","hexToFloatRGBA","floatRGBAToHex","scaleAndClamp","hexToObjectRGB","r","g","hexToObjectRGBA","hexToCssRGB","cssRGBRegex","hexToCssRGBA","cssRGBARegex","hexToCssHSL","hsl","rgbUint8ToHsl","hexToCssHSLA","hsla","rgbaUint8ToHsla","cssHSLRegex","cssHSLARegex","hslToRgbUint8","h","l","f","rgbFloatToHsl01","d","rgbaFloatToHsla01","rgb","rgba","hsv01ToRGBFloat","hue","sat","val","hsva01ToRGBAFloat","alpha","round3","rgbFloatToHSV01","p","q","EPSILON","rgbaFloatToHSVA01","hasAlpha","format","endsWith","cssStringFormats","re","guessFormat","console","warn","formatInfo","test","guessStringColorFormat","trim","Uint8Array","Uint8ClampedArray","Float32Array","Error","fixHex6","fixHex8","hex6ToHex3","hex6","hex3RE","hex3ToHex6","hex3","exec","m2","fixHex3","strToCssRGB","find","strToCssRGBA","strToCssHSL","strToCssHSLA","strTo3IntsRE","strTo4IntsRE","strTo3Floats","numbers","split","badNdx","findIndex","strTo4Floats","strToUint32RGBRegex","strToUint32RGBARegex","hex6RE","hexNoHash6RE","hex8RE","hexNoHash8RE","colorFormatConverters","text","hex8","strToUint32RGB","strToUint32RGBA","json","JSON","parse","hslaToRgbaUint8","ElementView","Canvas","canvasElem","canvas","ColorView","colorElem","Color","colorView","Divider","Container","controllers","childDestController","filter","c","folders","recursive","c0","addControllerImpl","addController","pushContainer","container","popContainer","Folder","labelElem","toggleOpen","open","close","contains","Label","noop","computeRelativePosition","event","start","rect","getBoundingClientRect","x","clientX","left","y","clientY","top","nx","width","ny","height","dx","dy","ndy","addTouchEvents","onDown","onMove","onUp","pointerMove","pointerUp","releasePointerCapture","pointerId","removeEventListener","body","backgroundColor","pointerDown","setPointerCapture","rel","connectFillTargets","srcElem","dataset","targetElem","ColorChooserView","satLevelElem","circleElem","hueUIElem","hueElem","hueCursorElem","alphaUIElem","alphaElem","alphaCursorElem","hsva","skipHueUpdate","skipSatLevelUpdate","skipAlphaUpdate","convertInternalToHex","convertHexToInternal","innerHTML","handleSatLevelChange","handleHueChange","handleAlphaChange","lum","display","PopDownController","valuesView","bottom","setKnobColor","bgCssColor","addTop","addBottom","ColorChooser","___setKnobHelper","setKnobHelper","hex6Or8","hex","GUIFolder","args","arg1","createController","addCanvas","addColor","addDivider","addFolder","addLabel","addButton","o","MuiguiElement","HTMLElement","shadow","attachShadow","mode","customElements","define","baseStyleSheet","CSSStyleSheet","userStyleSheet","makeStyleSheetUpdater","styleSheet","newCss","newCssPromise","updateStyle","then","updateBaseStyle","updateUserStyle","getTheme","cssStr","GUI","static","localStyleSheet","autoPlace","muiguiElement","shadowRoot","adoptedStyleSheets","replaceSync","setStyle","setTheme","setBaseStyles","keyDirections","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","addKeyboardEvents","keyDown","mult","shiftKey","assert","truthy","msg","getEllipsePointForAngle","cx","cy","rx","ry","phi","theta","cos","sin","arc","end","x1","y1","x2","y2","fa","fs","dTheta","getEndpointParameters","twoPiMod","DirectionView","arrowElem","rangeElem","lastV","wrap","dirMin","dirMax","tempV","handleTouch","atan2","center","angle","transform","Direction","RadioGridView","cols","that","previousElementSibling","click","gridTemplateColumns","RadioGrid","onResize","callback","ResizeObserver","observe","onResizeSVGNoScale","hAnchor","vAnchor","createSVGTicks","SliderView","svgElem","originElem","ticksElem","thicksElem","numbersElem","leftGradElem","rightGradElem","minusSize","unit","unitSize","ticksPerUnit","labelFn","tickHeight","limits","thicksColor","orientation","startV","oldHTML","getComputedTextLength","computeSizeOfMinus","updateSlider","unitsAcross","ceil","centerUnitSpace","startUnitSpace","minUnitSpace","maxUnitSpace","stroke","texts","digits","log10","createSVGNumbers","Slider","Vec2View","onTouch","updateDisplayImpl","Vec2","makeSetter","darkColors","main","lightColors","darkMatcher","window","matchMedia","isDarkMode","update","matches","helpers","graph","data","interval","ctx","getContext","setInterval","clearRect","beginPath","range","lineTo","strokeStyle","monitor","label","stringify"],"mappings":"AAAA,IAAeA,EAAA,CACbC,QAAS,yshBAwtBXC,OAAQ,CACND,QAAS,CACPE,Q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P,GAAMpkB,IAChCA,GAAM,EAAEC,IACRA,EAAM,EAACokB,SACPA,EAAW,GAAE1d,MACbA,IAEF,MAAM2d,EAAM3P,EAAO4P,WAAW,MAe9BC,aAbA,WACE,MAAMtN,MAACA,EAAKE,OAAEA,GAAUzC,EACxB2P,EAAIG,UAAU,EAAG,EAAGvN,EAAOE,GAC3BkN,EAAII,YACJ,MAAMC,EAAQ1kB,EAAMD,EACpB,IAAK,IAAIsH,EAAI,EAAGA,EAAI8c,EAAK/c,SAAUC,EAAG,CACpC,MAAMqP,EAAIrP,EAAI4P,EAAQkN,EAAK/c,OACrByP,GAAKsN,EAAK9c,GAAKtH,GAAOoX,EAASuN,EACrCL,EAAIM,OAAOjO,EAAGG,EACf,CACDwN,EAAIO,YAAcle,GAASJ,GAAOmd,KAClCY,EAAIxB,QACL,GACmBuB,EACtB,ECzBES,QChBK,SAAiBC,EAAOrf,EAAQC,GAAU0e,SAACA,EAAW,KAAO,IAClEG,aAAY,KACVO,EAAM/Q,KAAKK,KAAK2Q,UAAUtf,EAAOC,GAAW,KAAM,GAAG,GACpD0e,EACL"} \ No newline at end of file +{"version":3,"file":"muigui.module.min.js","sources":["../../src/styles/muigui.css.js","../../src/libs/elem.js","../../src/libs/utils.js","../../../src/views/View.ts","../../src/controllers/Controller.js","../../src/controllers/Button.js","../../src/views/EditView.js","../../src/views/CheckboxView.js","../../src/libs/taskrunner.js","../../src/libs/ids.js","../../src/views/ValueView.js","../../src/controllers/LabelController.js","../../src/controllers/ValueController.js","../../src/controllers/Checkbox.js","../../src/libs/conversions.js","../../src/libs/wheel.js","../../src/views/NumberView.js","../../src/controllers/TextNumber.js","../../src/views/SelectView.js","../../src/libs/key-values.js","../../src/controllers/Select.js","../../src/views/RangeView.js","../../src/controllers/Range.js","../../src/views/TextView.js","../../src/controllers/Text.js","../../src/libs/color-utils.js","../../src/views/ElementView.js","../../src/controllers/Canvas.js","../../src/views/ColorView.js","../../src/controllers/Color.js","../../src/controllers/Divider.js","../../src/controllers/Container.js","../../src/controllers/Folder.js","../../src/controllers/Label.js","../../src/libs/touch.js","../../src/views/ColorChooserView.js","../../src/controllers/PopDownController.js","../../src/controllers/ColorChooser.js","../../src/muigui.js","../../src/controllers/create-controller.js","../../src/libs/keyboard.js","../../src/libs/assert.js","../../src/libs/svg.js","../../src/views/DirectionView.js","../../src/controllers/Direction.js","../../src/views/RadioGridView.js","../../src/controllers/RadioGrid.js","../../src/libs/resize-helpers.js","../../src/views/SliderView.js","../../src/controllers/Slider.js","../../src/views/Vec2View.js","../../src/controllers/Vec2.js","../../src/libs/graph.js","../../../src/esm.ts","../../src/libs/monitor.js"],"sourcesContent":["export default {\n default: `\n.muigui {\n --bg-color: #ddd;\n --color: #222;\n --contrast-color: #eee;\n --value-color: #145 ;\n --value-bg-color: #eeee;\n --disabled-color: #999;\n --menu-bg-color: #f8f8f8;\n --menu-sep-color: #bbb;\n --hover-bg-color: #999;\n --focus-color: #8BF;\n --range-color: #AAA;\n --invalid-color: #FF0000;\n --selected-color: rgb(255, 255, 255, 0.9);\n\n --button-bg-color: var(--value-bg-color);\n\n --image-open: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjNDQ0OyIgeD0iMjAlIiB5PSI0NSUiIHdpZHRoPSI2MCUiIGhlaWdodD0iMTAlIj48L3JlY3Q+Cjwvc3ZnPg==);\n --image-closed: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjNDQ0OyIgeD0iNDUlIiB5PSIyMCUiIHdpZHRoPSIxMCUiIGhlaWdodD0iNjAlIj48L3JlY3Q+CiAgPHJlY3Qgc3R5bGU9ImZpbGw6ICM0NDQ7IiB4PSIyMCUiIHk9IjQ1JSIgd2lkdGg9IjYwJSIgaGVpZ2h0PSIxMCUiPjwvcmVjdD4KPC9zdmc+);\n --image-checkerboard: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjNDA0MDQwOyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSI+PC9yZWN0PgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjODA4MDgwOyIgeD0iMCIgeT0iMCIgd2lkdGg9IjUwJSIgaGVpZ2h0PSI1MCUiPjwvcmVjdD4KICA8cmVjdCBzdHlsZT0iZmlsbDogIzgwODA4MDsiIHg9IjUwJSIgeT0iNTAlIiB3aWR0aD0iNTAlIiBoZWlnaHQ9IjUwJSI+PC9yZWN0Pgo8L3N2Zz4=);\n\n --range-left-color: var(--value-color);\n --range-right-color: var(--value-bg-color); \n --range-right-hover-color: var(--hover-bg-color);\n --button-image: \n linear-gradient(\n rgba(255, 255, 255, 1), rgba(0, 0, 0, 0.2)\n );\n\n color: var(--color);\n background-color: var(--bg-color);\n}\n\n@media (prefers-color-scheme: dark) {\n .muigui {\n --bg-color: #222222;\n --color: #dddddd;\n --contrast-color: #000;\n --value-color: #43e5f7;\n --value-bg-color: #444444;\n --disabled-color: #666666;\n --menu-bg-color: #080808;\n --menu-sep-color: #444444;\n --hover-bg-color: #666666;\n --focus-color: #458; /*#88AAFF*/;\n --range-color: #888888;\n --invalid-color: #FF6666;\n --selected-color: rgba(255, 255, 255, 0.3);\n\n --button-bg-color: var(--value-bg-color);\n\n --range-left-color: var(--value-color);\n --range-right-color: var(--value-bg-color); \n --range-right-hover-color: var(--hover-bg-color);\n --button-image: linear-gradient(\n rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.4)\n );\n\n color: var(--color);\n background-color: var(--bg-color);\n\n --image-closed: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjREREOyIgeD0iMjAlIiB5PSI0NSUiIHdpZHRoPSI2MCUiIGhlaWdodD0iMTAlIj48L3JlY3Q+Cjwvc3ZnPg==);\n --image-open: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHN0eWxlPSJmaWxsOiAjREREOyIgeD0iNDUlIiB5PSIyMCUiIHdpZHRoPSIxMCUiIGhlaWdodD0iNjAlIj48L3JlY3Q+CiAgPHJlY3Qgc3R5bGU9ImZpbGw6ICNEREQ7IiB4PSIyMCUiIHk9IjQ1JSIgd2lkdGg9IjYwJSIgaGVpZ2h0PSIxMCUiPjwvcmVjdD4KPC9zdmc+);\n }\n}\n\n.muigui {\n --width: 250px;\n --label-width: 45%;\n --number-width: 40%;\n\n --font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Arial, sans-serif;\n --font-size: 11px;\n --font-family-mono: Menlo, Monaco, Consolas, \"Droid Sans Mono\", monospace;\n --font-size-mono: 11px;\n\n --line-height: 1.7em;\n --border-radius: 0px;\n\n width: var(--width);\n font-family: var(--font-family);\n font-size: var(--font-size);\n box-sizing: border-box;\n line-height: 100%;\n white-space: nowrap;\n}\n.muigui * {\n box-sizing: inherit;\n}\n\n.muigui-no-scroll {\n touch-action: none;\n}\n.muigui-no-h-scroll {\n touch-action: pan-y;\n}\n.muigui-no-v-scroll {\n touch-action: pan-x;\n}\n\n.muigui-invalid-value {\n background-color: red !important;\n color: white !important;\n}\n\n.muigui-grid {\n display: grid;\n}\n.muigui-rows {\n display: flex;\n flex-direction: column;\n\n min-height: 20px;\n border: 2px solid red;\n}\n.muigui-columns {\n display: flex;\n flex-direction: row;\n\n height: 20px;\n border: 2px solid green;\n}\n.muigui-rows>*,\n.muigui-columns>* {\n flex: 1 1 auto;\n align-items: stretch;\n min-height: 0;\n min-width: 0;\n}\n\n.muigui-row {\n border: 2px solid yellow;\n min-height: 10px\n}\n.muigui-column {\n border: 2px solid lightgreen;\n}\n\n/* -------- */\n\n.muigui-show { /* */ }\n.muigui-hide { \n display: none !important;\n}\n.muigui-disabled {\n pointer-events: none;\n --color: var(--disabled-color) !important;\n --value-color: var(--disabled-color) !important;\n --range-left-color: var(--disabled-color) !important;\n}\n\n.muigui canvas,\n.muigui svg {\n display: block;\n border-radius: var(--border-radius);\n}\n.muigui canvas {\n background-color: var(--value-bg-color);\n}\n\n.muigui-controller {\n min-width: 0;\n min-height: var(--line-height);\n}\n.muigui-root {\n z-index: 1;\n}\n.muigui-root,\n.muigui-menu {\n display: flex;\n flex-direction: column;\n position: relative;\n user-select: none;\n height: fit-content;\n margin: 0;\n padding-bottom: 0.1em;\n border-radius: var(--border-radius);\n}\n.muigui-menu {\n border-bottom: 1px solid var(--menu-sep-color);\n}\n\n.muigui-root>button:nth-child(1),\n.muigui-menu>button:nth-child(1) {\n border-top: 1px solid var(--menu-sep-color);\n border-bottom: 1px solid var(--menu-sep-color);\n position: relative;\n text-align: left;\n color: var(--color);\n background-color: var(--menu-bg-color);\n min-height: var(--line-height);\n padding: 0.2em;\n cursor: pointer;\n border-radius: var(--border-radius);\n}\n.muigui-root>div:nth-child(2),\n.muigui-menu>div:nth-child(2) {\n flex: 1 1 auto;\n}\n\n.muigui-controller {\n margin-left: 0.2em;\n margin-right: 0.2em;\n}\n.muigui-root.muigui-controller,\n.muigui-menu.muigui-controller {\n margin-left: 0;\n margin-right: 0;\n}\n.muigui-controller>*:nth-child(1) {\n flex: 1 0 var(--label-width);\n min-width: 0;\n /* white-space: pre; why?? */\n}\n.muigui-controller>label:nth-child(1) {\n place-content: center start;\n display: inline-grid;\n overflow: hidden;\n}\n.muigui-controller>*:nth-child(2) {\n flex: 1 1 75%;\n min-width: 0;\n}\n\n/* -----------------------------------------\n a label controller is [[label][value]]\n*/\n\n.muigui-label-controller {\n display: flex;\n margin: 0.4em 0 0.4em 0;\n word-wrap: initial;\n align-items: stretch;\n}\n\n.muigui-value {\n display: flex;\n align-items: stretch;\n}\n.muigui-value>* {\n flex: 1 1 auto;\n min-width: 0;\n}\n.muigui-value>*:nth-child(1) {\n flex: 1 1 calc(100% - var(--number-width));\n}\n.muigui-value>*:nth-child(2) {\n flex: 1 1 var(--number-width);\n margin-left: 0.2em;\n}\n\n/* fix! */\n.muigui-open>button>label::before,\n.muigui-closed>button>label::before {\n content: \"X\";\n color: rgba(0, 0, 0, 0);\n background-color: var(--range-color);\n border-radius: 0.2em;\n width: 1.25em;\n margin-right: 0.25em;\n height: 1.25em; /*var(--line-height);*/\n display: inline-grid;\n place-content: center start;\n pointer-events: none;\n}\n.muigui-open>button>label::before {\n background-image: var(--image-open);\n}\n.muigui-closed>button>label::before {\n background-image: var(--image-closed);\n}\n\n.muigui-open>.muigui-open-container {\n transition: all 0.1s ease-out;\n overflow: auto;\n height: 100%;\n}\n.muigui-closed>.muigui-open-container {\n transition: all 0.1s ease-out;\n overflow: hidden;\n min-height: 0;\n}\n.muigui-open>.muigui-open-container>* {\n transition: all 0.1s ease-out;\n margin-top: 0px;\n}\n.muigui-closed>.muigui-open-container>* {\n transition: all 0.1s ease-out;\n margin-top: -1000%;\n}\n\n/* ---- popdown ---- */\n\n.muigui-pop-down-top {\n display: flex;\n}\n/* fix? */\n.muigui-value>*:nth-child(1).muigui-pop-down-top {\n flex: 0;\n}\n.muigui-closed .muigui-pop-down-bottom {\n max-height: 0;\n}\n\n.muigui-value .muigui-pop-down-bottom {\n margin: 0;\n}\n\n.muigui-pop-down-values {\n min-width: 0;\n display: flex;\n}\n.muigui-pop-down-values>* {\n flex: 1 1 auto;\n min-width: 0;\n}\n\n.muigui-value.muigui-pop-down-controller {\n flex-direction: column;\n}\n\n.muigui-pop-down-top input[type=checkbox] {\n -webkit-appearance: none;\n appearance: none;\n width: auto;\n color: var(--value-color);\n background-color: var(--value-bg-color);\n background-image: var(--image-checkerboard);\n background-size: 10px 10px;\n background-position: 0 0, 0 5px, 5px -5px, -5px 0px;\n\n cursor: pointer;\n\n display: grid;\n place-content: center;\n margin: 0;\n font: inherit;\n color: currentColor;\n width: 1.7em;\n height: 1.7em;\n transform: translateY(-0.075em);\n}\n\n.muigui-pop-down-top input[type=checkbox]::before {\n content: \"+\";\n display: grid;\n place-content: center;\n border-radius: calc(var(--border-radius) + 2px);\n border-left: 1px solid rgba(255,255,255,0.3);\n border-top: 1px solid rgba(255,255,255,0.3);\n border-bottom: 1px solid rgba(0,0,0,0.2);\n border-right: 1px solid rgba(0,0,0,0.2);\n background-color: var(--range-color);\n color: var(--value-bg-color);\n width: calc(var(--line-height) - 4px);\n height: calc(var(--line-height) - 4px);\n}\n\n.muigui-pop-down-top input[type=checkbox]:checked::before {\n content: \"X\";\n}\n\n\n/* ---- select ---- */\n\n.muigui select,\n.muigui option,\n.muigui input,\n.muigui button {\n color: var(--value-color);\n background-color: var(--value-bg-color);\n font-family: var(--font-family);\n font-size: var(--font-size);\n border: none;\n margin: 0;\n border-radius: var(--border-radius);\n}\n.muigui select {\n appearance: none;\n margin: 0;\n margin-left: 0; /*?*/\n overflow: hidden; /* Safari */\n}\n\n.muigui select:focus,\n.muigui input:focus,\n.muigui button:focus {\n outline: 1px solid var(--focus-color);\n}\n\n.muigui select:hover,\n.muigui option:hover,\n.muigui input:hover,\n.muigui button:hover {\n background-color: var(--hover-bg-color); \n}\n\n/* ------ [ label ] ------ */\n\n.muigui-label {\n border-top: 1px solid var(--menu-sep-color);\n border-bottom: 1px solid var(--menu-sep-color);\n padding-top: 0.4em;\n padding-bottom: 0.3em;\n place-content: center start;\n background-color: var(--menu-bg-color);\n white-space: pre;\n border-radius: var(--border-radius);\n}\n\n/* ------ [ divider] ------ */\n\n.muigui-divider {\n min-height: 6px;\n border-top: 2px solid var(--menu-sep-color);\n margin-top: 6px;\n}\n\n/* ------ [ button ] ------ */\n\n.muigui-button {\n display: grid;\n padding: 2px 0 2px 0;\n}\n.muigui-button button {\n border: none;\n color: var(--value-color);\n background-color: var(--button-bg-color);\n background-image: var(--button-image);\n cursor: pointer;\n place-content: center center;\n height: var(--line-height);\n}\n\n/* ------ [ color ] ------ */\n\n.muigui-color>div {\n overflow: hidden;\n position: relative;\n margin-left: 0;\n margin-right: 0; /* why? */\n max-width: var(--line-height);\n border-radius: var(--border-radius);\n}\n\n.muigui-color>div:focus-within {\n outline: 1px solid var(--focus-color);\n}\n\n.muigui-color input[type=color] {\n border: none;\n padding: 0;\n background: inherit;\n cursor: pointer;\n position: absolute;\n width: 200%;\n left: -10px;\n top: -10px;\n height: 200%;\n}\n.muigui-disabled canvas,\n.muigui-disabled svg,\n.muigui-disabled img,\n.muigui-disabled .muigui-color input[type=color] {\n opacity: 0.2;\n}\n\n/* ------ [ checkbox ] ------ */\n\n.muigui-checkbox>label:nth-child(2) {\n display: grid;\n place-content: center start;\n margin: 0;\n}\n\n.muigui-checkbox input[type=checkbox] {\n -webkit-appearance: none;\n appearance: none;\n width: auto;\n color: var(--value-color);\n background-color: var(--value-bg-color);\n cursor: pointer;\n\n display: grid;\n place-content: center;\n margin: 0;\n font: inherit;\n color: currentColor;\n width: 1.7em;\n height: 1.7em;\n transform: translateY(-0.075em);\n}\n\n.muigui-checkbox input[type=checkbox]::before {\n content: \"\";\n color: var(--value-color);\n display: grid;\n place-content: center;\n}\n\n.muigui-checkbox input[type=checkbox]:checked::before {\n content: \"✔\";\n}\n\n.muigui input[type=number]::-webkit-inner-spin-button, \n.muigui input[type=number]::-webkit-outer-spin-button { \n -webkit-appearance: none;\n appearance: none;\n margin: 0; \n}\n.muigui input[type=number] {\n -moz-appearance: textfield;\n}\n\n/* ------ [ radio grid ] ------ */\n\n.muigui-radio-grid>div {\n display: grid;\n gap: 2px;\n}\n\n.muigui-radio-grid input {\n appearance: none;\n display: none;\n}\n\n.muigui-radio-grid button {\n color: var(--color);\n width: 100%;\n text-align: left;\n}\n\n.muigui-radio-grid input:checked + button {\n color: var(--value-color);\n background-color: var(--selected-color);\n}\n\n/* ------ [ color-chooser ] ------ */\n\n.muigui-color-chooser-cursor {\n stroke-width: 1px;\n stroke: white;\n fill: none;\n}\n.muigui-color-chooser-circle {\n stroke-width: 1px;\n stroke: white;\n fill: none;\n}\n\n\n/* ------ [ vec2 ] ------ */\n\n.muigui-vec2 svg {\n background-color: var(--value-bg-color);\n}\n\n.muigui-vec2-axis {\n stroke: 1px;\n stroke: var(--focus-color);\n}\n\n.muigui-vec2-line {\n stroke-width: 1px;\n stroke: var(--value-color);\n fill: var(--value-color);\n}\n\n/* ------ [ direction ] ------ */\n\n.muigui-direction svg {\n background-color: rgba(0,0,0,0.2);\n}\n\n.muigui-direction:focus-within svg {\n outline: none;\n}\n.muigui-direction-range {\n fill: var(--value-bg-color);\n}\n.muigui-direction svg:focus {\n outline: none;\n}\n.muigui-direction svg:focus .muigui-direction-range {\n stroke-width: 0.5px;\n stroke: var(--focus-color);\n}\n\n.muigui-direction-arrow {\n fill: var(--value-color);\n}\n\n/* ------ [ slider ] ------ */\n\n.muigui-slider>div {\n display: flex;\n align-items: stretch;\n height: var(--line-height);\n}\n.muigui-slider svg {\n flex: 1 1 auto;\n}\n.muigui-slider .muigui-slider-up #muigui-orientation {\n transform: scale(1, -1) translateY(-100%);\n}\n\n.muigui-slider .muigui-slider-up #muigui-number-orientation {\n transform: scale(1,-1);\n}\n\n.muigui-ticks {\n stroke: var(--range-color);\n}\n.muigui-thicks {\n stroke: var(--color);\n stroke-width: 2px;\n}\n.muigui-svg-text {\n fill: var(--color);\n font-size: 7px;\n}\n.muigui-mark {\n fill: var(--value-color);\n}\n\n/* ------ [ range ] ------ */\n\n\n.muigui-range input[type=range] {\n -webkit-appearance: none;\n appearance: none;\n background-color: transparent;\n}\n\n.muigui-range input[type=range]::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n border-radius: calc(var(--border-radius) + 2px);\n border-left: 1px solid rgba(255,255,255,0.3);\n border-top: 1px solid rgba(255,255,255,0.3);\n border-bottom: 1px solid rgba(0,0,0,0.2);\n border-right: 1px solid rgba(0,0,0,0.2);\n background-color: var(--range-color);\n margin-top: calc((var(--line-height) - 6px) / -2);\n width: calc(var(--line-height) - 6px);\n height: calc(var(--line-height) - 6px);\n}\n\n.muigui-range input[type=range]::-webkit-slider-runnable-track {\n -webkit-appearance: none;\n appearance: none;\n border: 1px solid var(--menu-sep-color);\n height: 2px;\n}\n\n\n/* dat.gui style - doesn't work on Safari iOS */\n\n/*\n.muigui-range input[type=range] {\n cursor: ew-resize;\n overflow: hidden;\n}\n\n.muigui-range input[type=range] {\n -webkit-appearance: none;\n appearance: none;\n background-color: var(--range-right-color);\n margin: 0;\n}\n.muigui-range input[type=range]:hover {\n background-color: var(--range-right-hover-color);\n}\n\n.muigui-range input[type=range]::-webkit-slider-runnable-track {\n -webkit-appearance: none;\n appearance: none;\n height: max-content;\n color: var(--range-left-color);\n margin-top: -1px;\n}\n\n.muigui-range input[type=range]::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 0px;\n height: max-content;\n box-shadow: -1000px 0 0 1000px var(--range-left-color);\n}\n*/\n\n/* FF */\n/*\n.muigui-range input[type=range]::-moz-slider-progress {\n background-color: var(--range-left-color); \n}\n.muigui-range input[type=range]::-moz-slider-thumb {\n height: max-content;\n width: 0;\n border: none;\n box-shadow: -1000px 0 0 1000px var(--range-left-color);\n box-sizing: border-box;\n}\n*/\n\n.muigui-checkered-background {\n background-color: #404040;\n background-image:\n linear-gradient(45deg, #808080 25%, transparent 25%),\n linear-gradient(-45deg, #808080 25%, transparent 25%),\n linear-gradient(45deg, transparent 75%, #808080 75%),\n linear-gradient(-45deg, transparent 75%, #808080 75%);\n background-size: 16px 16px;\n background-position: 0 0, 0 8px, 8px -8px, -8px 0px;\n}\n\n/* ---------------------------------------------------------- */\n\n/* needs to be at bottom to take precedence */\n.muigui-auto-place {\n max-height: 100%;\n position: fixed;\n top: 0;\n right: 15px;\n z-index: 100001;\n}\n\n`,\nthemes: {\n default: {\n include: ['default'],\n css: `\n `,\n },\n float: {\n include: ['default'],\n css: `\n :root {\n color-scheme: light dark,\n }\n\n .muigui {\n --width: 400px;\n --bg-color: initial;\n --label-width: 25%;\n --number-width: 20%;\n }\n\n input,\n .muigui-label-controller>label {\n text-shadow:\n -1px -1px 0 var(--contrast-color),\n 1px -1px 0 var(--contrast-color),\n -1px 1px 0 var(--contrast-color),\n 1px 1px 0 var(--contrast-color);\n }\n\n .muigui-controller > label:nth-child(1) {\n place-content: center end;\n margin-right: 1em;\n }\n\n .muigui-value > :nth-child(2) {\n margin-left: 1em;\n }\n\n .muigui-root>*:nth-child(1) {\n display: none;\n }\n\n .muigui-range input[type=range]::-webkit-slider-thumb {\n border-radius: 1em;\n }\n\n .muigui-range input[type=range]::-webkit-slider-runnable-track {\n -webkit-appearance: initial;\n appearance: none;\n border: 1px solid rgba(0, 0, 0, 0.25);\n height: 2px;\n }\n\n .muigui-colors {\n --value-color: var(--color );\n --value-bg-color: rgba(0, 0, 0, 0.1);\n --disabled-color: #cccccc;\n --menu-bg-color: rgba(0, 0, 0, 0.1);\n --menu-sep-color: #bbbbbb;\n --hover-bg-color: rgba(0, 0, 0, 0);\n --invalid-color: #FF0000;\n --selected-color: rgba(0, 0, 0, 0.3);\n --range-color: rgba(0, 0, 0, 0.125);\n }\n`,\n },\n form: {\n include: [],\n css: `\n .muigui {\n --width: 100%;\n --label-width: 45%;\n --number-width: 40%;\n }\n .muigui-root>button {\n display: none;\n }\n .muigui-controller {\n margin-top: 1em;\n }\n .muigui-label-controller {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n margin-top: 1em;\n }\n .muigui-label-controller:has(.muigui-checkbox) {\n flex-direction: row;\n }\n .muigui-value {\n display: flex;\n align-items: stretch;\n }\n .muigui-value>* {\n flex: 1 1 auto;\n min-width: 0;\n }\n .muigui-controller>*:nth-child(1) {\n flex: 1 0 var(--label-width);\n min-width: 0;\n white-space: pre;\n }\n .muigui-controller>label:nth-child(1) {\n place-content: center start;\n display: inline-grid;\n overflow: hidden;\n }\n .muigui-controller>*:nth-child(2) {\n flex: 1 1 75%;\n min-width: 0;\n }\n `,\n },\n none: {\n include: [],\n css: '',\n },\n},\n};\n","export function setElemProps(elem, attrs, children) {\n for (const [key, value] of Object.entries(attrs)) {\n if (typeof value === 'function' && key.startsWith('on')) {\n const eventName = key.substring(2).toLowerCase();\n elem.addEventListener(eventName, value, {passive: false});\n } else if (typeof value === 'object') {\n for (const [k, v] of Object.entries(value)) {\n elem[key][k] = v;\n }\n } else if (elem[key] === undefined) {\n elem.setAttribute(key, value);\n } else {\n elem[key] = value;\n }\n }\n for (const child of children) {\n elem.appendChild(child);\n }\n return elem;\n}\n\nexport function createElem(tag, attrs = {}, children = []) {\n const elem = document.createElement(tag);\n setElemProps(elem, attrs, children);\n return elem;\n}\n\nexport function addElem(tag, parent, attrs = {}, children = []) {\n const elem = createElem(tag, attrs, children);\n parent.appendChild(elem);\n return elem;\n}\n\nlet nextId = 0;\nexport function getNewId() {\n return `muigui-id-${nextId++}`;\n}\n","export function removeArrayElem(array, value) {\n const ndx = array.indexOf(value);\n if (ndx) {\n array.splice(ndx, 1);\n }\n return array;\n}\n\n/**\n * Converts an camelCase or snake_case id to \"camel case\" or \"snake case\"\n * @param {string} id\n */\nconst underscoreRE = /_/g;\nconst upperLowerRE = /([A-Z])([a-z])/g;\nexport function idToLabel(id) {\n return id.replace(underscoreRE, ' ')\n .replace(upperLowerRE, (m, m1, m2) => `${m1.toLowerCase()} ${m2}`);\n}\n\nexport function clamp(v, min, max) {\n return Math.max(min, Math.min(max, v));\n}\n\nexport const isTypedArray = typeof SharedArrayBuffer !== 'undefined'\n ? function isArrayBufferOrSharedArrayBuffer(a) {\n return a && a.buffer && (a.buffer instanceof ArrayBuffer || a.buffer instanceof SharedArrayBuffer);\n }\n : function isArrayBuffer(a) {\n return a && a.buffer && a.buffer instanceof ArrayBuffer;\n };\n\nexport const isArrayOrTypedArray = v => Array.isArray(v) || isTypedArray(v);\n\n// Yea, I know this should be `Math.round(v / step) * step\n// but try step = 0.1, newV = 19.95\n//\n// I get\n// Math.round(19.95 / 0.1) * 0.1\n// 19.900000000000002\n// vs\n// Math.round(19.95 / 0.1) / (1 / 0.1)\n// 19.9\n//\nexport const stepify = (v, from, step) => Math.round(from(v) / step) / (1 / step);\n\nexport const euclideanModulo = (v, n) => ((v % n) + n) % n;\nexport const lerp = (a, b, t) => a + (b - a) * t;\nexport function copyExistingProperties(dst, src) {\n for (const key in src) {\n if (key in dst) {\n dst[key] = src[key];\n }\n }\n return dst;\n}\n\nexport const mapRange = (v, inMin, inMax, outMin, outMax) => (v - inMin) * (outMax - outMin) / (inMax - inMin) + outMin;\n\nexport const makeRangeConverters = ({from, to}) => {\n return {\n to: v => mapRange(v, ...from, ...to),\n from: v => [true, mapRange(v, ...to, ...from)],\n };\n};\n\nexport const makeRangeOptions = ({from, to, step}) => {\n return {\n min: to[0],\n max: to[1],\n ...(step && {step}),\n converters: makeRangeConverters({from, to}),\n };\n};\n\n// TODO: remove an use one in conversions. Move makeRangeConverters there?\nexport const identity = {\n to: v => v,\n from: v => [true, v],\n};\nexport function makeMinMaxPair(gui, properties, minPropName, maxPropName, options) {\n const { converters: { from } = identity } = options;\n const { min, max } = options;\n const guiMinRange = options.minRange || 0;\n const valueMinRange = from(guiMinRange)[1];\n const minGui = gui\n .add(properties, minPropName, {\n ...options,\n min,\n max: max - guiMinRange,\n })\n .onChange(v => {\n maxGui.setValue(Math.min(max, Math.max(v + valueMinRange, properties[maxPropName])));\n });\n const maxGui = gui\n .add(properties, maxPropName, {\n ...options,\n min: min + guiMinRange,\n max,\n })\n .onChange(v => {\n minGui.setValue(Math.max(min, Math.min(v - valueMinRange, properties[minPropName])));\n });\n return [ minGui, maxGui ];\n}\n\n","import { removeArrayElem } from '../libs/utils.js';\n\nexport default class View {\n domElement: HTMLElement;\n\n #childDestElem: HTMLElement;\n #views: View[] = [];\n\n constructor(elem: HTMLElement) {\n this.domElement = elem;\n this.#childDestElem = elem;\n }\n addElem(elem: HTMLElement) {\n this.#childDestElem.appendChild(elem);\n return elem;\n }\n removeElem(elem: HTMLElement) {\n this.#childDestElem.removeChild(elem);\n return elem;\n }\n pushSubElem(elem: HTMLElement) {\n this.#childDestElem.appendChild(elem);\n this.#childDestElem = elem;\n }\n popSubElem() {\n this.#childDestElem = this.#childDestElem.parentElement!;\n }\n add(view: View) {\n this.#views.push(view);\n this.addElem(view.domElement);\n return view;\n }\n remove(view: View) {\n this.removeElem(view.domElement);\n removeArrayElem(this.#views, view);\n return view;\n }\n pushSubView(view: View) {\n this.pushSubElem(view.domElement);\n }\n popSubView() {\n this.popSubElem();\n }\n setOptions(options: any) {\n for (const view of this.#views) {\n view.setOptions(options);\n }\n }\n updateDisplayIfNeeded(newV: any, ignoreCache?: boolean) {\n for (const view of this.#views) {\n view.updateDisplayIfNeeded(newV, ignoreCache);\n }\n return this;\n }\n $(selector: string) {\n return this.domElement.querySelector(selector);\n }\n}","import { createElem } from '../libs/elem.js';\nimport { removeArrayElem } from '../libs/utils.js';\nimport View from '../views/View.js';\n\nexport default class Controller extends View {\n #changeFns;\n #finishChangeFns;\n #parent;\n\n constructor(className) {\n super(createElem('div', {className: 'muigui-controller'}));\n this.#changeFns = [];\n this.#finishChangeFns = [];\n // we need the specialization to come last so it takes precedence.\n if (className) {\n this.domElement.classList.add(className);\n }\n }\n get parent() {\n return this.#parent;\n }\n setParent(parent) {\n this.#parent = parent;\n this.enable(!this.disabled());\n }\n show(show = true) {\n this.domElement.classList.toggle('muigui-hide', !show);\n this.domElement.classList.toggle('muigui-show', show);\n return this;\n }\n hide() {\n return this.show(false);\n }\n disabled() {\n return !!this.domElement.closest('.muigui-disabled');\n }\n\n enable(enable = true) {\n this.domElement.classList.toggle('muigui-disabled', !enable);\n\n // If disabled we need to set the attribute 'disabled=true' to all\n // input/select/button/textarea's below\n //\n // If enabled we need to set the attribute 'disabled=false' to all below\n // until we hit a disabled controller.\n //\n // ATM the problem is we can find the input/select/button/textarea elements\n // but we can't easily find which controller they belong do.\n // But we don't need to? We can just check up if it or parent has\n // '.muigui-disabled'\n ['input', 'button', 'select', 'textarea'].forEach(tag => {\n this.domElement.querySelectorAll(tag).forEach(elem => {\n const disabled = !!elem.closest('.muigui-disabled');\n elem.disabled = disabled;\n });\n });\n\n return this;\n }\n disable(disable = true) {\n return this.enable(!disable);\n }\n onChange(fn) {\n this.removeChange(fn);\n this.#changeFns.push(fn);\n return this;\n }\n removeChange(fn) {\n removeArrayElem(this.#changeFns, fn);\n return this;\n }\n onFinishChange(fn) {\n this.removeFinishChange(fn);\n this.#finishChangeFns.push(fn);\n return this;\n }\n removeFinishChange(fn) {\n removeArrayElem(this.#finishChangeFns, fn);\n return this;\n }\n #callListeners(fns, newV) {\n for (const fn of fns) {\n fn.call(this, newV);\n }\n }\n emitChange(value, object, property) {\n this.#callListeners(this.#changeFns, value);\n if (this.#parent) {\n if (object === undefined) {\n this.#parent.emitChange(value);\n } else {\n this.#parent.emitChange({\n object,\n property,\n value,\n controller: this,\n });\n }\n }\n }\n emitFinalChange(value, object, property) {\n this.#callListeners(this.#finishChangeFns, value);\n if (this.#parent) {\n if (object === undefined) {\n this.#parent.emitChange(value);\n } else {\n this.#parent.emitFinalChange({\n object,\n property,\n value,\n controller: this,\n });\n }\n }\n }\n updateDisplay() {\n // placeholder. override\n }\n getColors() {\n const toCamelCase = s => s.replace(/-([a-z])/g, (m, m1) => m1.toUpperCase());\n const keys = [\n 'color',\n 'bg-color',\n 'value-color',\n 'value-bg-color',\n 'hover-bg-color',\n 'menu-bg-color',\n 'menu-sep-color',\n 'disabled-color',\n ];\n const div = createElem('div');\n this.domElement.appendChild(div);\n const colors = Object.fromEntries(keys.map(key => {\n div.style.color = `var(--${key})`;\n const s = getComputedStyle(div);\n return [toCamelCase(key), s.color];\n }));\n div.remove();\n return colors;\n }\n}\n","import {\n createElem,\n} from '../libs/elem.js';\nimport { copyExistingProperties } from '../libs/utils.js';\nimport Controller from './Controller.js';\n\nexport default class Button extends Controller {\n #object;\n #property;\n #buttonElem;\n #options = {\n name: '',\n };\n\n constructor(object, property, options = {}) {\n super('muigui-button', '');\n this.#object = object;\n this.#property = property;\n\n this.#buttonElem = this.addElem(\n createElem('button', {\n type: 'button',\n onClick: () => {\n this.#object[this.#property](this);\n },\n }));\n this.setOptions({name: property, ...options});\n }\n name(name) {\n this.#buttonElem.textContent = name;\n return this;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {name} = this.#options;\n this.#buttonElem.textContent = name;\n return this;\n }\n}","import { isTypedArray } from '../libs/utils.js';\nimport View from './View.js';\n\nfunction arraysEqual(a, b) {\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; ++i) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n}\n\nfunction copyArrayElementsFromTo(src, dst) {\n dst.length = src.length;\n for (let i = 0; i < src.length; ++i) {\n dst[i] = src[i];\n }\n}\n\nexport default class EditView extends View {\n #oldV;\n #updateCheck;\n\n #checkArrayNeedsUpdate(newV) {\n // It's an array, we need to compare all elements\n // Example, vec2, [r,g,b], ...\n const needUpdate = !arraysEqual(newV, this.#oldV);\n if (needUpdate) {\n copyArrayElementsFromTo(newV, this.#oldV);\n }\n return needUpdate;\n }\n\n #checkTypedArrayNeedsUpdate() {\n let once = true;\n return function checkTypedArrayNeedsUpdateImpl(newV) {\n // It's a typedarray, we need to compare all elements\n // Example: Float32Array([r, g, b])\n let needUpdate = once;\n once = false;\n if (!needUpdate) {\n needUpdate = !arraysEqual(newV, this.#oldV);\n }\n return needUpdate;\n };\n }\n\n #checkObjectNeedsUpdate(newV) {\n let needUpdate = false;\n for (const key in newV) {\n if (newV[key] !== this.#oldV[key]) {\n needUpdate = true;\n this.#oldV[key] = newV[key];\n }\n }\n return needUpdate;\n }\n\n #checkValueNeedsUpdate(newV) {\n const needUpdate = newV !== this.#oldV;\n this.#oldV = newV;\n return needUpdate;\n }\n\n #getUpdateCheckForType(newV) {\n if (Array.isArray(newV)) {\n this.#oldV = [];\n return this.#checkArrayNeedsUpdate.bind(this);\n } else if (isTypedArray(newV)) {\n this.#oldV = new newV.constructor(newV);\n return this.#checkTypedArrayNeedsUpdate(this);\n } else if (typeof newV === 'object') {\n this.#oldV = {};\n return this.#checkObjectNeedsUpdate.bind(this);\n } else {\n return this.#checkValueNeedsUpdate.bind(this);\n }\n }\n\n // The point of this is updating DOM elements\n // is slow but if we've called `listen` then\n // every frame we're going to try to update\n // things with the current value so if nothing\n // has changed then skip it.\n updateDisplayIfNeeded(newV, ignoreCache) {\n this.#updateCheck = this.#updateCheck || this.#getUpdateCheckForType(newV);\n // Note: We call #updateCheck first because it updates\n // the cache\n if (this.#updateCheck(newV) || ignoreCache) {\n this.updateDisplay(newV);\n }\n }\n setOptions(/*options*/) {\n // override this\n return this;\n }\n}\n","import { createElem } from '../libs/elem.js';\nimport EditView from './EditView.js';\n\nexport default class CheckboxView extends EditView {\n #checkboxElem;\n constructor(setter, id) {\n const checkboxElem = createElem('input', {\n type: 'checkbox',\n id,\n onInput: () => {\n setter.setValue(checkboxElem.checked);\n },\n onChange: () => {\n setter.setFinalValue(checkboxElem.checked);\n },\n });\n super(createElem('label', {}, [checkboxElem]));\n this.#checkboxElem = checkboxElem;\n }\n updateDisplay(v) {\n this.#checkboxElem.checked = v;\n }\n}\n","import { removeArrayElem } from './utils.js';\n\nconst tasks = [];\nconst tasksToRemove = new Set();\n\nlet requestId;\nlet processing;\n\nfunction removeTasks() {\n if (!tasksToRemove.size) {\n return;\n }\n\n if (processing) {\n queueProcessing();\n return;\n }\n\n tasksToRemove.forEach(task => {\n removeArrayElem(tasks, task);\n });\n tasksToRemove.clear();\n}\n\nfunction processTasks() {\n requestId = undefined;\n processing = true;\n for (const task of tasks) {\n if (!tasksToRemove.has(task)) {\n task();\n }\n }\n processing = false;\n removeTasks();\n queueProcessing();\n}\n\nfunction queueProcessing() {\n if (!requestId && tasks.length) {\n requestId = requestAnimationFrame(processTasks);\n }\n}\n\nexport function addTask(fn) {\n tasks.push(fn);\n queueProcessing();\n}\n\nexport function removeTask(fn) {\n tasksToRemove.set(fn);\n\n const ndx = tasks.indexOf(fn);\n if (ndx >= 0) {\n tasks.splice(ndx, 1);\n }\n}","let id = 0;\n\nexport function makeId() {\n return `muigui-${++id}`;\n}\n","import { createElem } from '../libs/elem.js';\nimport View from './View.js';\n\nexport default class ValueView extends View {\n constructor(className = '') {\n super(createElem('div', {className: 'muigui-value'}));\n if (className) {\n this.domElement.classList.add(className);\n }\n }\n}","import { createElem } from '../libs/elem.js';\nimport { makeId } from '../libs/ids.js';\nimport ValueView from '../views/ValueView.js';\nimport Controller from './Controller.js';\n\nexport default class LabelController extends Controller {\n #id;\n #nameElem;\n\n constructor(className = '', name = '') {\n super('muigui-label-controller');\n this.#id = makeId();\n this.#nameElem = createElem('label', {for: this.#id});\n this.domElement.appendChild(this.#nameElem);\n this.pushSubView(new ValueView(className));\n this.name(name);\n }\n get id() {\n return this.#id;\n }\n name(name) {\n if (this.#nameElem.title === this.#nameElem.textContent) {\n this.#nameElem.title = name;\n }\n this.#nameElem.textContent = name;\n return this;\n }\n tooltip(tip) {\n this.#nameElem.title = tip;\n }\n}\n\n","import {addTask, removeTask} from '../libs/taskrunner.js';\nimport { isTypedArray } from '../libs/utils.js';\nimport LabelController from './LabelController.js';\n\nexport default class ValueController extends LabelController {\n #object;\n #property;\n #initialValue;\n #listening;\n #views;\n #updateFn;\n\n constructor(object, property, className = '') {\n super(className, property);\n this.#object = object;\n this.#property = property;\n this.#initialValue = this.getValue();\n this.#listening = false;\n this.#views = [];\n }\n get initialValue() {\n return this.#initialValue;\n }\n get object() {\n return this.#object;\n }\n get property() {\n return this.#property;\n }\n add(view) {\n this.#views.push(view);\n super.add(view);\n this.updateDisplay();\n return view;\n }\n #setValueImpl(v, ignoreCache) {\n let isDifferent = false;\n if (typeof v === 'object') {\n const dst = this.#object[this.#property];\n // don't replace objects, just their values.\n if (Array.isArray(v) || isTypedArray(v)) {\n for (let i = 0; i < v.length; ++i) {\n isDifferent ||= dst[i] !== v[i];\n dst[i] = v[i];\n }\n } else {\n for (const key of Object.keys(v)) {\n isDifferent ||= dst[key] !== v[key];\n }\n Object.assign(dst, v);\n }\n } else {\n isDifferent = this.#object[this.#property] !== v;\n this.#object[this.#property] = v;\n }\n this.updateDisplay(ignoreCache);\n if (isDifferent) {\n this.emitChange(this.getValue(), this.#object, this.#property);\n }\n return isDifferent;\n }\n setValue(v) {\n this.#setValueImpl(v);\n }\n setFinalValue(v) {\n const isDifferent = this.#setValueImpl(v, true);\n if (isDifferent) {\n this.emitFinalChange(this.getValue(), this.#object, this.#property);\n }\n return this;\n }\n updateDisplay(ignoreCache) {\n const newV = this.getValue();\n for (const view of this.#views) {\n view.updateDisplayIfNeeded(newV, ignoreCache);\n }\n return this;\n }\n setOptions(options) {\n for (const view of this.#views) {\n view.setOptions(options);\n }\n this.updateDisplay();\n return this;\n }\n getValue() {\n return this.#object[this.#property];\n }\n value(v) {\n this.setValue(v);\n return this;\n }\n reset() {\n this.setValue(this.#initialValue);\n return this;\n }\n listen(listen = true) {\n if (!this.#updateFn) {\n this.#updateFn = this.updateDisplay.bind(this);\n }\n if (listen) {\n if (!this.#listening) {\n this.#listening = true;\n addTask(this.#updateFn);\n }\n } else {\n if (this.#listening) {\n this.#listening = false;\n removeTask(this.#updateFn);\n }\n }\n return this;\n }\n}\n\n","import CheckboxView from '../views/CheckboxView.js';\nimport ValueController from './ValueController.js';\n\nexport default class Checkbox extends ValueController {\n constructor(object, property) {\n super(object, property, 'muigui-checkbox');\n const id = this.id;\n this.add(new CheckboxView(this, id));\n this.updateDisplay();\n }\n}","import {\n makeRangeConverters,\n} from './utils.js';\n\nexport const identity = {\n to: v => v,\n from: v => [true, v],\n};\n\n// from: from string to value\n// to: from value to string\nexport const strToNumber = {\n to: v => v.toString(),\n from: v => {\n const newV = parseFloat(v);\n return [!Number.isNaN(newV), newV];\n },\n};\n\nexport const converters = {\n radToDeg: makeRangeConverters({to: [0, 180], from: [0, Math.PI]}),\n};\n","export function createWheelHelper() {\n let wheelAccum = 0;\n return function (e, step, wheelScale = 5) {\n wheelAccum -= e.deltaY * step / wheelScale;\n const wheelSteps = Math.floor(Math.abs(wheelAccum) / step) * Math.sign(wheelAccum);\n const delta = wheelSteps * step;\n wheelAccum -= delta;\n return delta;\n };\n}\n","import { createElem } from '../libs/elem.js';\nimport { strToNumber } from '../libs/conversions.js';\nimport { createWheelHelper } from '../libs/wheel.js';\nimport { clamp, copyExistingProperties, stepify } from '../libs/utils.js';\nimport EditView from './EditView.js';\n\nexport default class NumberView extends EditView {\n #to;\n #from;\n #step;\n #skipUpdate;\n #options = {\n step: 0.01,\n converters: strToNumber,\n min: Number.NEGATIVE_INFINITY,\n max: Number.POSITIVE_INFINITY,\n };\n\n constructor(setter, options) {\n const setValue = setter.setValue.bind(setter);\n const setFinalValue = setter.setFinalValue.bind(setter);\n const wheelHelper = createWheelHelper();\n super(createElem('input', {\n type: 'number',\n onInput: () => {\n this.#handleInput(setValue, true);\n },\n onChange: () => {\n this.#handleInput(setFinalValue, false);\n },\n onWheel: e => {\n e.preventDefault();\n const {min, max, step} = this.#options;\n const delta = wheelHelper(e, step);\n const v = parseFloat(this.domElement.value);\n const newV = clamp(stepify(v + delta, v => v, step), min, max);\n const [valid, outV] = this.#from(newV);\n if (valid) {\n setter.setValue(outV);\n }\n },\n }));\n this.setOptions(options);\n }\n #handleInput(setFn, skipUpdate) {\n const v = parseFloat(this.domElement.value);\n const [valid, newV] = this.#from(v);\n let inRange;\n if (valid && !Number.isNaN(v)) {\n const {min, max} = this.#options;\n inRange = newV >= min && newV <= max;\n this.#skipUpdate = skipUpdate;\n setFn(clamp(newV, min, max));\n }\n this.domElement.classList.toggle('muigui-invalid-value', !valid || !inRange);\n }\n updateDisplay(v) {\n if (!this.#skipUpdate) {\n this.domElement.value = stepify(v, this.#to, this.#step);\n }\n this.#skipUpdate = false;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {\n step,\n converters: {to, from},\n } = this.#options;\n this.#to = to;\n this.#from = from;\n this.#step = step;\n return this;\n }\n}\n","\nimport NumberView from '../views/NumberView.js';\nimport ValueController from './ValueController.js';\n\n// Wanted to name this `Number` but it conflicts with\n// JavaScript `Number`. It most likely wouldn't be\n// an issue? But users might `import {Number} ...` and\n// things would break.\nexport default class TextNumber extends ValueController {\n #textView;\n #step;\n\n constructor(object, property, options = {}) {\n super(object, property, 'muigui-text-number');\n this.#textView = this.add(new NumberView(this, options));\n this.updateDisplay();\n }\n}","import { createElem } from '../libs/elem.js';\nimport EditView from './EditView.js';\n\nexport default class SelectView extends EditView {\n #values;\n\n constructor(setter, keyValues) {\n const values = [];\n super(createElem('select', {\n onChange: () => {\n setter.setFinalValue(this.#values[this.domElement.selectedIndex]);\n },\n }, keyValues.map(([key, value]) => {\n values.push(value);\n return createElem('option', {textContent: key});\n })));\n this.#values = values;\n }\n updateDisplay(v) {\n const ndx = this.#values.indexOf(v);\n this.domElement.selectedIndex = ndx;\n }\n}\n","\n// 4 cases\n// (a) keyValues is array of arrays, each sub array is key value\n// (b) keyValues is array and value is number then keys = array contents, value = index\n// (c) keyValues is array and value is not number, key = array contents, value = array contents\n// (d) keyValues is object then key->value\nexport function convertToKeyValues(keyValues, valueIsNumber) {\n if (Array.isArray(keyValues)) {\n if (Array.isArray(keyValues[0])) {\n // (a) keyValues is array of arrays, each sub array is key value\n return keyValues;\n } else {\n if (valueIsNumber) {\n // (b) keyValues is array and value is number then keys = array contents, value = index\n return keyValues.map((v, ndx) => [v, ndx]);\n } else {\n // (c) keyValues is array and value is not number, key = array contents, value = array contents\n return keyValues.map(v => [v, v]);\n }\n }\n } else {\n // (d)\n return [...Object.entries(keyValues)];\n }\n}\n","import SelectView from '../views/SelectView.js';\nimport ValueController from './ValueController.js';\nimport { convertToKeyValues } from '../libs/key-values.js';\n\nexport default class Select extends ValueController {\n constructor(object, property, options) {\n super(object, property, 'muigui-select');\n const valueIsNumber = typeof this.getValue() === 'number';\n const {keyValues: keyValuesInput} = options;\n const keyValues = convertToKeyValues(keyValuesInput, valueIsNumber);\n this.add(new SelectView(this, keyValues));\n this.updateDisplay();\n }\n}","import { createElem } from '../libs/elem.js';\nimport { identity } from '../libs/conversions.js';\nimport { clamp, copyExistingProperties, stepify } from '../libs/utils.js';\nimport { createWheelHelper } from '../libs/wheel.js';\nimport EditView from './EditView.js';\n\nexport default class RangeView extends EditView {\n #to;\n #from;\n #step;\n #skipUpdate;\n #options = {\n step: 0.01,\n min: 0,\n max: 1,\n converters: identity,\n };\n\n constructor(setter, options) {\n const wheelHelper = createWheelHelper();\n super(createElem('input', {\n type: 'range',\n onInput: () => {\n this.#skipUpdate = true;\n const {min, max, step} = this.#options;\n const v = parseFloat(this.domElement.value);\n const newV = clamp(stepify(v, v => v, step), min, max);\n const [valid, validV] = this.#from(newV);\n if (valid) {\n setter.setValue(validV);\n }\n },\n onChange: () => {\n this.#skipUpdate = true;\n const {min, max, step} = this.#options;\n const v = parseFloat(this.domElement.value);\n const newV = clamp(stepify(v, v => v, step), min, max);\n const [valid, validV] = this.#from(newV);\n if (valid) {\n setter.setFinalValue(validV);\n }\n },\n onWheel: e => {\n e.preventDefault();\n const [valid, v] = this.#from(parseFloat(this.domElement.value));\n if (!valid) {\n return;\n }\n const {min, max, step} = this.#options;\n const delta = wheelHelper(e, step);\n const newV = clamp(stepify(v + delta, v => v, step), min, max);\n setter.setValue(newV);\n },\n }));\n this.setOptions(options);\n }\n updateDisplay(v) {\n if (!this.#skipUpdate) {\n this.domElement.value = stepify(v, this.#to, this.#step);\n }\n this.#skipUpdate = false;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {\n step,\n min,\n max,\n converters: {to, from},\n } = this.#options;\n this.#to = to;\n this.#from = from;\n this.#step = step;\n this.domElement.step = step;\n this.domElement.min = min;\n this.domElement.max = max;\n return this;\n }\n}","import ValueController from './ValueController.js';\nimport NumberView from '../views/NumberView.js';\nimport RangeView from '../views/RangeView.js';\n\nexport default class Range extends ValueController {\n constructor(object, property, options) {\n super(object, property, 'muigui-range');\n this.add(new RangeView(this, options));\n this.add(new NumberView(this, options));\n }\n}\n","import { createElem } from '../libs/elem.js';\nimport { identity } from '../libs/conversions.js';\nimport EditView from './EditView.js';\nimport { copyExistingProperties } from '../libs/utils.js';\n\nexport default class TextView extends EditView {\n #to;\n #from;\n #skipUpdate;\n #options = {\n converters: identity,\n };\n\n constructor(setter, options) {\n const setValue = setter.setValue.bind(setter);\n const setFinalValue = setter.setFinalValue.bind(setter);\n super(createElem('input', {\n type: 'text',\n onInput: () => {\n this.#handleInput(setValue, true);\n },\n onChange: () => {\n this.#handleInput(setFinalValue, false);\n },\n }));\n this.setOptions(options);\n }\n #handleInput(setFn, skipUpdate) {\n const [valid, newV] = this.#from(this.domElement.value);\n if (valid) {\n this.#skipUpdate = skipUpdate;\n setFn(newV);\n }\n this.domElement.style.color = valid ? '' : 'var(--invalid-color)';\n\n }\n updateDisplay(v) {\n if (!this.#skipUpdate) {\n this.domElement.value = this.#to(v);\n this.domElement.style.color = '';\n }\n this.#skipUpdate = false;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {\n converters: {to, from},\n } = this.#options;\n this.#to = to;\n this.#from = from;\n return this;\n }\n}\n","import TextView from '../views/TextView.js';\nimport ValueController from './ValueController.js';\n\nexport default class Text extends ValueController {\n constructor(object, property) {\n super(object, property, 'muigui-text');\n this.add(new TextView(this));\n this.updateDisplay();\n }\n}","const clamp = (v, min, max) => Math.max(min, Math.min(max, v));\nconst lerp = (a, b, t) => a + (b - a) * t;\nconst fract = v => v >= 0 ? v % 1 : 1 - (v % 1);\n\nconst f0 = v => +v.toFixed(0); // converts to string (eg 1.2 => \"1\"), then converts back to number (eg, \"1.200\" => 1.2)\nconst f3 = v => +v.toFixed(3); // converts to string (eg 1.2 => \"1.200\"), then converts back to number (eg, \"1.200\" => 1.2)\n\nconst hexToUint32RGB = v => (parseInt(v.substring(1, 3), 16) << 16) |\n (parseInt(v.substring(3, 5), 16) << 8 ) |\n (parseInt(v.substring(5, 7), 16) );\nconst uint32RGBToHex = v => `#${(Math.round(v)).toString(16).padStart(6, '0')}`;\nconst hexToUint32RGBA = v => (parseInt(v.substring(1, 3), 16) * 2 ** 24) +\n (parseInt(v.substring(3, 5), 16) * 2 ** 16) +\n (parseInt(v.substring(5, 7), 16) * 2 ** 8) +\n (parseInt(v.substring(7, 9), 16) );\nconst uint32RGBAToHex = v => `#${(Math.round(v)).toString(16).padStart(8, '0')}`;\n\nexport const hexToUint8RGB = v => [\n parseInt(v.substring(1, 3), 16),\n parseInt(v.substring(3, 5), 16),\n parseInt(v.substring(5, 7), 16),\n];\nexport const uint8RGBToHex = v => `#${Array.from(v).map(v => v.toString(16).padStart(2, '0')).join('')}`;\n\nexport const hexToUint8RGBA = v => [\n parseInt(v.substring(1, 3), 16),\n parseInt(v.substring(3, 5), 16),\n parseInt(v.substring(5, 7), 16),\n parseInt(v.substring(7, 9), 16),\n];\nexport const uint8RGBAToHex = v => `#${Array.from(v).map(v => v.toString(16).padStart(2, '0')).join('')}`;\n\nexport const hexToFloatRGB = v => hexToUint8RGB(v).map(v => f3(v / 255));\nexport const floatRGBToHex = v => uint8RGBToHex(Array.from(v).map(v => Math.round(clamp(v * 255, 0, 255))));\n\nexport const hexToFloatRGBA = v => hexToUint8RGBA(v).map(v => f3(v / 255));\nexport const floatRGBAToHex = v => uint8RGBAToHex(Array.from(v).map(v => Math.round(clamp(v * 255, 0, 255))));\n\nconst scaleAndClamp = v => clamp(Math.round(v * 255), 0, 255).toString(16).padStart(2, '0');\n\nconst hexToObjectRGB = v => ({\n r: parseInt(v.substring(1, 3), 16) / 255,\n g: parseInt(v.substring(3, 5), 16) / 255,\n b: parseInt(v.substring(5, 7), 16) / 255,\n});\nconst objectRGBToHex = v => `#${scaleAndClamp(v.r)}${scaleAndClamp(v.g)}${scaleAndClamp(v.b)}`;\nconst hexToObjectRGBA = v => ({\n r: parseInt(v.substring(1, 3), 16) / 255,\n g: parseInt(v.substring(3, 5), 16) / 255,\n b: parseInt(v.substring(5, 7), 16) / 255,\n a: parseInt(v.substring(7, 9), 16) / 255,\n});\nconst objectRGBAToHex = v => `#${scaleAndClamp(v.r)}${scaleAndClamp(v.g)}${scaleAndClamp(v.b)}${scaleAndClamp(v.a)}`;\n\nconst hexToCssRGB = v => `rgb(${hexToUint8RGB(v).join(', ')})`;\nconst cssRGBRegex = /^\\s*rgb\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*\\)\\s*$/;\nconst cssRGBToHex = v => {\n const m = cssRGBRegex.exec(v);\n return uint8RGBToHex([m[1], m[2], m[3]].map(v => parseInt(v)));\n};\nconst hexToCssRGBA = v => `rgba(${hexToUint8RGBA(v).map((v, i) => i === 3 ? v / 255 : v).join(', ')})`;\nconst cssRGBARegex = /^\\s*rgba\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+\\.\\d+|\\d+)\\s*\\)\\s*$/;\nconst cssRGBAToHex = v => {\n const m = cssRGBARegex.exec(v);\n return uint8RGBAToHex([m[1], m[2], m[3], m[4]].map((v, i) => i === 3 ? (parseFloat(v) * 255 | 0) : parseInt(v)));\n};\n\nconst hexToCssHSL = v => {\n const hsl = rgbUint8ToHsl(hexToUint8RGB(v)).map(v => f0(v));\n return `hsl(${hsl[0]}, ${hsl[1]}%, ${hsl[2]}%)`;\n};\nconst hexToCssHSLA = v => {\n const hsla = rgbaUint8ToHsla(hexToUint8RGBA(v)).map((v, i) => i === 3 ? f3(v) : f0(v));\n return `hsl(${hsla[0]} ${hsla[1]}% ${hsla[2]}% / ${hsla[3]})`;\n};\nconst cssHSLRegex = /^\\s*hsl\\(\\s*(\\d+)(?:deg|)\\s*(?:,|)\\s*(\\d+)%\\s*(?:,|)\\s*(\\d+)%\\s*\\)\\s*$/;\nconst cssHSLARegex = /^\\s*hsl\\(\\s*(\\d+)(?:deg|)\\s*(?:,|)\\s*(\\d+)%\\s*(?:,|)\\s*(\\d+)%\\s*\\/\\s*(\\d+\\.\\d+|\\d+)\\s*\\)\\s*$/;\n\nconst hex3DigitTo6Digit = v => `${v[0]}${v[0]}${v[1]}${v[1]}${v[2]}${v[2]}`;\nconst cssHSLToHex = v => {\n const m = cssHSLRegex.exec(v);\n const rgb = hslToRgbUint8([m[1], m[2], m[3]].map(v => parseFloat(v)));\n return uint8RGBToHex(rgb);\n};\nconst cssHSLAToHex = v => {\n const m = cssHSLARegex.exec(v);\n const rgba = hslaToRgbaUint8([m[1], m[2], m[3], m[4]].map(v => parseFloat(v)));\n return uint8RGBAToHex(rgba);\n};\n\nconst euclideanModulo = (v, n) => ((v % n) + n) % n;\n\nexport function hslToRgbUint8([h, s, l]) {\n h = euclideanModulo(h, 360);\n s = clamp(s / 100, 0, 1);\n l = clamp(l / 100, 0, 1);\n\n const a = s * Math.min(l, 1 - l);\n\n function f(n) {\n const k = (n + h / 30) % 12;\n return l - a * Math.max(-1, Math.min(k - 3, 9 - k, 1));\n }\n\n return [f(0), f(8), f(4)].map(v => Math.round(v * 255));\n}\n\nexport function hslaToRgbaUint8([h, s, l, a]) {\n const rgb = hslToRgbUint8([h, s, l]);\n return [...rgb, a * 255 | 0];\n}\n\nexport function rgbFloatToHsl01([r, g, b]) {\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const l = (min + max) * 0.5;\n const d = max - min;\n let h = 0;\n let s = 0;\n\n if (d !== 0) {\n s = (l === 0 || l === 1)\n ? 0\n : (max - l) / Math.min(l, 1 - l);\n\n switch (max) {\n case r: h = (g - b) / d + (g < b ? 6 : 0); break;\n case g: h = (b - r) / d + 2; break;\n case b: h = (r - g) / d + 4;\n }\n }\n\n return [h / 6, s, l];\n}\n\nexport function rgbaFloatToHsla01([r, g, b, a]) {\n const hsl = rgbFloatToHsl01([r, g, b]);\n return [...hsl, a];\n}\n\nexport const rgbUint8ToHsl = (rgb) => {\n const [h, s, l] = rgbFloatToHsl01(rgb.map(v => v / 255));\n return [h * 360, s * 100, l * 100];\n};\n\nexport const rgbaUint8ToHsla = (rgba) => {\n const [h, s, l, a] = rgbaFloatToHsla01(rgba.map(v => v / 255));\n return [h * 360, s * 100, l * 100, a];\n};\n\nexport function hsv01ToRGBFloat([hue, sat, val]) {\n sat = clamp(sat, 0, 1);\n val = clamp(val, 0, 1);\n return [hue, hue + 2 / 3, hue + 1 / 3].map(\n v => lerp(1, clamp(Math.abs(fract(v) * 6 - 3.0) - 1, 0, 1), sat) * val\n );\n}\n\nexport function hsva01ToRGBAFloat([hue, sat, val, alpha]) {\n const rgb = hsv01ToRGBFloat([hue, sat, val]);\n return [...rgb, alpha];\n}\n\nconst round3 = v => Math.round(v * 1000) / 1000;\n\nexport function rgbFloatToHSV01([r, g, b]) {\n const p = b > g\n ? [b, g, -1, 2 / 3]\n : [g, b, 0, -1 / 3];\n const q = p[0] > r\n ? [p[0], p[1], p[3], r]\n : [r, p[1], p[2], p[0]];\n const d = q[0] - Math.min(q[3], q[1]);\n return [\n Math.abs(q[2] + (q[3] - q[1]) / (6 * d + Number.EPSILON)),\n d / (q[0] + Number.EPSILON),\n q[0],\n ].map(round3);\n}\n\nexport function rgbaFloatToHSVA01([r, g, b, a]) {\n const hsv = rgbFloatToHSV01([r, g, b]);\n return [...hsv, a];\n}\n\n// window.hsv01ToRGBFloat = hsv01ToRGBFloat;\n// window.rgbFloatToHSV01 = rgbFloatToHSV01;\n\n// Yea, meh!\nexport const hasAlpha = format => format.endsWith('a') || format.startsWith('hex8');\n\nconst cssStringFormats = [\n { re: /^#(?:[0-9a-f]){6}$/i, format: 'hex6' },\n { re: /^(?:[0-9a-f]){6}$/i, format: 'hex6-no-hash' },\n { re: /^#(?:[0-9a-f]){8}$/i, format: 'hex8' },\n { re: /^(?:[0-9a-f]){8}$/i, format: 'hex8-no-hash' },\n { re: /^#(?:[0-9a-f]){3}$/i, format: 'hex3' },\n { re: /^(?:[0-9a-f]){3}$/i, format: 'hex3-no-hash' },\n { re: cssRGBRegex, format: 'css-rgb' },\n { re: cssHSLRegex, format: 'css-hsl' },\n { re: cssRGBARegex, format: 'css-rgba' },\n { re: cssHSLARegex, format: 'css-hsla' },\n];\n\nfunction guessStringColorFormat(v) {\n for (const formatInfo of cssStringFormats) {\n if (formatInfo.re.test(v)) {\n return formatInfo;\n }\n }\n return undefined;\n}\n\nexport function guessFormat(v) {\n switch (typeof v) {\n case 'number':\n console.warn('can not reliably guess format based on a number. You should pass in a format like {format: \"uint32-rgb\"} or {format: \"uint32-rgb\"}');\n return v <= 0xFFFFFF ? 'uint32-rgb' : 'uint32-rgba';\n case 'string': {\n const formatInfo = guessStringColorFormat(v.trim());\n if (formatInfo) {\n return formatInfo.format;\n }\n break;\n }\n case 'object':\n if (v instanceof Uint8Array || v instanceof Uint8ClampedArray) {\n if (v.length === 3) {\n return 'uint8-rgb';\n } else if (v.length === 4) {\n return 'uint8-rgba';\n }\n } else if (v instanceof Float32Array) {\n if (v.length === 3) {\n return 'float-rgb';\n } else if (v.length === 4) {\n return 'float-rgba';\n }\n } else if (Array.isArray(v)) {\n if (v.length === 3) {\n return 'float-rgb';\n } else if (v.length === 4) {\n return 'float-rgba';\n }\n } else {\n if ('r' in v && 'g' in v && 'b' in v) {\n if ('a' in v) {\n return 'object-rgba';\n } else {\n return 'object-rgb';\n }\n }\n }\n }\n throw new Error(`unknown color format: ${v}`);\n}\n\nfunction fixHex6(v) {\n return v.trim(v);\n //const formatInfo = guessStringColorFormat(v.trim());\n //const fix = formatInfo ? formatInfo.fix : v => v;\n //return fix(v.trim());\n}\n\nfunction fixHex8(v) {\n return v.trim(v);\n //const formatInfo = guessStringColorFormat(v.trim());\n //const fix = formatInfo ? formatInfo.fix : v => v;\n //return fix(v.trim());\n}\n\nfunction hex6ToHex3(hex6) {\n return (hex6[1] === hex6[2] &&\n hex6[3] === hex6[4] &&\n hex6[5] === hex6[6])\n ? `#${hex6[1]}${hex6[3]}${hex6[5]}`\n : hex6;\n}\n\nconst hex3RE = /^(#|)([0-9a-f]{3})$/i;\nfunction hex3ToHex6(hex3) {\n const m = hex3RE.exec(hex3);\n if (m) {\n const [, , m2] = m;\n return `#${hex3DigitTo6Digit(m2)}`;\n }\n return hex3;\n}\n\nfunction fixHex3(v) {\n return hex6ToHex3(fixHex6(v));\n}\n\nconst strToRGBObject = (s) => {\n try {\n const json = s.replace(/([a-z])/g, '\"$1\"');\n const rgb = JSON.parse(json);\n if (Number.isNaN(rgb.r) || Number.isNaN(rgb.g) || Number.isNaN(rgb.b)) {\n throw new Error('not {r, g, b}');\n }\n return [true, rgb];\n } catch (e) {\n return [false];\n }\n};\n\nconst strToRGBAObject = (s) => {\n try {\n const json = s.replace(/([a-z])/g, '\"$1\"');\n const rgba = JSON.parse(json);\n if (Number.isNaN(rgba.r) || Number.isNaN(rgba.g) || Number.isNaN(rgba.b) || Number.isNaN(rgba.a)) {\n throw new Error('not {r, g, b, a}');\n }\n return [true, rgba];\n } catch (e) {\n return [false];\n }\n};\n\nconst strToCssRGB = s => {\n const m = cssRGBRegex.exec(s);\n if (!m) {\n return [false];\n }\n const v = [m[1], m[2], m[3]].map(v => parseInt(v));\n const outOfRange = v.find(v => v > 255);\n return [!outOfRange, `rgb(${v.join(', ')})`];\n};\n\nconst strToCssRGBA = s => {\n const m = cssRGBARegex.exec(s);\n if (!m) {\n return [false];\n }\n const v = [m[1], m[2], m[3], m[4]].map((v, i) => i === 3 ? parseFloat(v) : parseInt(v));\n const outOfRange = v.find(v => v > 255);\n return [!outOfRange, `rgba(${v.join(', ')})`];\n};\n\nconst strToCssHSL = s => {\n const m = cssHSLRegex.exec(s);\n if (!m) {\n return [false];\n }\n const v = [m[1], m[2], m[3]].map(v => parseFloat(v));\n const outOfRange = v.find(v => Number.isNaN(v));\n return [!outOfRange, `hsl(${v[0]}, ${v[1]}%, ${v[2]}%)`];\n};\n\nconst strToCssHSLA = s => {\n const m = cssHSLARegex.exec(s);\n if (!m) {\n return [false];\n }\n const v = [m[1], m[2], m[3], m[4]].map(v => parseFloat(v));\n const outOfRange = v.find(v => Number.isNaN(v));\n return [!outOfRange, `hsl(${v[0]} ${v[1]}% ${v[2]}% / ${v[3]})`];\n};\n\nconst rgbObjectToStr = rgb => {\n return `{r:${f3(rgb.r)}, g:${f3(rgb.g)}, b:${f3(rgb.b)}}`;\n};\nconst rgbaObjectToStr = rgba => {\n return `{r:${f3(rgba.r)}, g:${f3(rgba.g)}, b:${f3(rgba.b)}}, a:${f3(rgba.a)}}`;\n};\n\nconst strTo3IntsRE = /^\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*$/;\nconst strTo3Ints = s => {\n const m = strTo3IntsRE.exec(s);\n if (!m) {\n return [false];\n }\n const v = [m[1], m[2], m[3]].map(v => parseInt(v));\n const outOfRange = v.find(v => v > 255);\n return [!outOfRange, v];\n};\n\nconst strTo4IntsRE = /^\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*$/;\nconst strTo4Ints = s => {\n const m = strTo4IntsRE.exec(s);\n if (!m) {\n return [false];\n }\n const v = [m[1], m[2], m[3], m[4]].map(v => parseInt(v));\n const outOfRange = v.find(v => v > 255);\n return [!outOfRange, v];\n};\n\nconst strTo3Floats = s => {\n const numbers = s.split(',').map(s => s.trim());\n const v = numbers.map(v => parseFloat(v));\n if (v.length !== 3) {\n return [false];\n }\n // Note: using isNaN not Number.isNaN\n const badNdx = numbers.findIndex(v => isNaN(v));\n return [badNdx < 0, v.map(v => f3(v))];\n};\n\nconst strTo4Floats = s => {\n const numbers = s.split(',').map(s => s.trim());\n const v = numbers.map(v => parseFloat(v));\n if (v.length !== 4) {\n return [false];\n }\n // Note: using isNaN not Number.isNaN\n const badNdx = numbers.findIndex(v => isNaN(v));\n return [badNdx < 0, v.map(v => f3(v))];\n};\n\nconst strToUint32RGBRegex = /^\\s*(?:0x){0,1}([0-9a-z]{1,6})\\s*$/i;\nconst strToUint32RGB = s => {\n const m = strToUint32RGBRegex.exec(s);\n if (!m) {\n return [false];\n }\n return [true, parseInt(m[1], 16)];\n};\n\nconst strToUint32RGBARegex = /^\\s*(?:0x){0,1}([0-9a-z]{1,8})\\s*$/i;\nconst strToUint32RGBA = s => {\n const m = strToUint32RGBARegex.exec(s);\n if (!m) {\n return [false];\n }\n return [true, parseInt(m[1], 16)];\n};\n\nconst hex6RE = /^\\s*#[a-f0-9]{6}\\s*$|^\\s*#[a-f0-9]{3}\\s*$/i;\nconst hexNoHash6RE = /^\\s*[a-f0-9]{6}\\s*$/i;\nconst hex8RE = /^\\s*#[a-f0-9]{8}\\s*$/i;\nconst hexNoHash8RE = /^\\s*[a-f0-9]{8}\\s*$/i;\n\n// For each format converter\n//\n// fromHex/toHex convert from/to '#RRGGBB'\n//\n// fromHex converts from the string '#RRBBGG' to the format\n// (eg: for uint32-rgb, '#123456' becomes 0x123456)\n//\n// toHex converts from the format to '#RRGGBB'\n// (eg: for uint8-rgb, [16, 33, 50] becomes '#102132')\n//\n//\n// fromStr/toStr convert from/to what's in the input[type=text] element\n//\n// toStr converts from the format to its string representation\n// (eg, for object-rgb, {r: 1, g: 0.5, b:0} becomes \"{r: 1, g: 0.5, b:0}\")\n// ^object ^string\n//\n// fromStr converts its string representation to its format\n// (eg, for object-rgb) \"{r: 1, g: 0.5, b:0}\" becomes {r: 1, g: 0.5, b:0})\n// ^string ^object\n// fromString returns an array which is [valid, v]\n// where valid is true if the string was a valid and v is the converted\n// format if v is true.\n//\n// Note: toStr should convert to \"ideal\" form (whatever that is).\n// (eg, for css-rgb\n// \"{ r: 0.10000, g: 001, b: 0}\" becomes \"{r: 0.1, g: 1, b: 0}\"\n// notice that css-rgb is a string to a string\n// )\nexport const colorFormatConverters = {\n 'hex6': {\n color: {\n from: v => [true, v],\n to: fixHex6,\n },\n text: {\n from: v => [hex6RE.test(v), v.trim()],\n to: v => v,\n },\n },\n 'hex8': {\n color: {\n from: v => [true, v],\n to: fixHex8,\n },\n text: {\n from: v => [hex8RE.test(v), v.trim()],\n to: v => v,\n },\n },\n 'hex3': {\n color: {\n from: v => [true, fixHex3(v)],\n to: hex3ToHex6,\n },\n text: {\n from: v => [hex6RE.test(v), hex6ToHex3(v.trim())],\n to: v => v,\n },\n },\n 'hex6-no-hash': {\n color: {\n from: v => [true, v.substring(1)],\n to: v => `#${fixHex6(v)}`,\n },\n text: {\n from: v => [hexNoHash6RE.test(v), v.trim()],\n to: v => v,\n },\n },\n 'hex8-no-hash': {\n color: {\n from: v => [true, v.substring(1)],\n to: v => `#${fixHex8(v)}`,\n },\n text: {\n from: v => [hexNoHash8RE.test(v), v.trim()],\n to: v => v,\n },\n },\n 'hex3-no-hash': {\n color: {\n from: v => [true, fixHex3(v).substring(1)],\n to: hex3ToHex6,\n },\n text: {\n from: v => [hexNoHash6RE.test(v), hex6ToHex3(v.trim())],\n to: v => v,\n },\n },\n 'uint32-rgb': {\n color: {\n from: v => [true, hexToUint32RGB(v)],\n to: uint32RGBToHex,\n },\n text: {\n from: v => strToUint32RGB(v),\n to: v => `0x${v.toString(16).padStart(6, '0')}`,\n },\n },\n 'uint32-rgba': {\n color: {\n from: v => [true, hexToUint32RGBA(v)],\n to: uint32RGBAToHex,\n },\n text: {\n from: v => strToUint32RGBA(v),\n to: v => `0x${v.toString(16).padStart(8, '0')}`,\n },\n },\n 'uint8-rgb': {\n color: {\n from: v => [true, hexToUint8RGB(v)],\n to: uint8RGBToHex,\n },\n text: {\n from: strTo3Ints,\n to: v => v.join(', '),\n },\n },\n 'uint8-rgba': {\n color: {\n from: v => [true, hexToUint8RGBA(v)],\n to: uint8RGBAToHex,\n },\n text: {\n from: strTo4Ints,\n to: v => v.join(', '),\n },\n },\n 'float-rgb': {\n color: {\n from: v => [true, hexToFloatRGB(v)],\n to: floatRGBToHex,\n },\n text: {\n from: strTo3Floats,\n // need Array.from because map of Float32Array makes a Float32Array\n to: v => Array.from(v).map(v => f3(v)).join(', '),\n },\n },\n 'float-rgba': {\n color: {\n from: v => [true, hexToFloatRGBA(v)],\n to: floatRGBAToHex,\n },\n text: {\n from: strTo4Floats,\n // need Array.from because map of Float32Array makes a Float32Array\n to: v => Array.from(v).map(v => f3(v)).join(', '),\n },\n },\n 'float-hsv': {\n color: {\n from: v => [true, rgbFloatToHSV01(hexToFloatRGB(v))],\n to: v => hsv01ToRGBFloat(floatRGBToHex(v)),\n },\n text: {\n from: strTo3Floats,\n // need Array.from because map of Float32Array makes a Float32Array\n to: v => Array.from(v).map(v => f3(v)).join(', '),\n },\n },\n 'float-hsva': {\n color: {\n from: v => [true, rgbaFloatToHSVA01(hexToFloatRGB(v))],\n to: v => hsva01ToRGBAFloat(floatRGBToHex(v)),\n },\n text: {\n from: strTo4Floats,\n // need Array.from because map of Float32Array makes a Float32Array\n to: v => Array.from(v).map(v => f3(v)).join(', '),\n },\n },\n //'float-hsl': {\n // color: {\n // from: v => [true, rgbFloatToHsl01(hexToFloatRGB(v))],\n // to: v => hsl01ToRGBFloat(floatRGBToHex(v)),\n // },\n // text: {\n // from: strTo3Floats,\n // // need Array.from because map of Float32Array makes a Float32Array\n // to: v => Array.from(v).map(v => f3(v)).join(', '),\n // },\n //},\n //'float-hsla': {\n // color: {\n // from: v => [true, hexToFloatRGBA(v)],\n // to: floatRGBAToHex,\n // },\n // text: {\n // from: strTo4Floats,\n // // need Array.from because map of Float32Array makes a Float32Array\n // to: v => Array.from(v).map(v => f3(v)).join(', '),\n // },\n //},\n 'object-rgb': {\n color: {\n from: v => [true, hexToObjectRGB(v)],\n to: objectRGBToHex,\n },\n text: {\n from: strToRGBObject,\n to: rgbObjectToStr,\n },\n },\n 'object-rgba': {\n color: {\n from: v => [true, hexToObjectRGBA(v)],\n to: objectRGBAToHex,\n },\n text: {\n from: strToRGBAObject,\n to: rgbaObjectToStr,\n },\n },\n 'css-rgb': {\n color: {\n from: v => [true, hexToCssRGB(v)],\n to: cssRGBToHex,\n },\n text: {\n from: strToCssRGB,\n to: v => strToCssRGB(v)[1],\n },\n },\n 'css-rgba': {\n color: {\n from: v => [true, hexToCssRGBA(v)],\n to: cssRGBAToHex,\n },\n text: {\n from: strToCssRGBA,\n to: v => strToCssRGBA(v)[1],\n },\n },\n 'css-hsl': {\n color: {\n from: v => [true, hexToCssHSL(v)],\n to: cssHSLToHex,\n },\n text: {\n from: strToCssHSL,\n to: v => strToCssHSL(v)[1],\n },\n },\n 'css-hsla': {\n color: {\n from: v => [true, hexToCssHSLA(v)],\n to: cssHSLAToHex,\n },\n text: {\n from: strToCssHSLA,\n to: v => strToCssHSLA(v)[1],\n },\n },\n};","import { createElem } from '../libs/elem.js';\nimport View from './View.js';\n\nexport default class ElementView extends View {\n constructor(tag, className) {\n super(createElem(tag, {className}));\n }\n}","import ElementView from '../views/ElementView.js';\nimport LabelController from './LabelController.js';\n\n// TODO: remove this? Should just be user side\nexport default class Canvas extends LabelController {\n #canvasElem;\n\n constructor(name) {\n super('muigui-canvas', name);\n this.#canvasElem = this.add(\n new ElementView('canvas', 'muigui-canvas'),\n ).domElement;\n }\n get canvas() {\n return this.#canvasElem;\n }\n listen() {\n return this;\n }\n}","import { createElem } from '../libs/elem.js';\nimport { identity } from '../libs/conversions.js';\nimport EditView from './EditView.js';\nimport { copyExistingProperties } from '../libs/utils.js';\n\nexport default class ColorView extends EditView {\n #to;\n #from;\n #colorElem;\n #skipUpdate;\n #options = {\n converters: identity,\n };\n\n constructor(setter, options) {\n const colorElem = createElem('input', {\n type: 'color',\n onInput: () => {\n const [valid, newV] = this.#from(colorElem.value);\n if (valid) {\n this.#skipUpdate = true;\n setter.setValue(newV);\n }\n },\n onChange: () => {\n const [valid, newV] = this.#from(colorElem.value);\n if (valid) {\n this.#skipUpdate = true;\n setter.setFinalValue(newV);\n }\n },\n });\n super(createElem('div', {}, [colorElem]));\n this.setOptions(options);\n this.#colorElem = colorElem;\n }\n updateDisplay(v) {\n if (!this.#skipUpdate) {\n this.#colorElem.value = this.#to(v);\n }\n this.#skipUpdate = false;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {converters: {to, from}} = this.#options;\n this.#to = to;\n this.#from = from;\n return this;\n }\n}\n","import {\n colorFormatConverters,\n guessFormat,\n} from '../libs/color-utils.js';\nimport ValueController from './ValueController.js';\nimport TextView from '../views/TextView.js';\nimport ColorView from '../views/ColorView.js';\n\nexport default class Color extends ValueController {\n #colorView;\n #textView;\n\n constructor(object, property, options = {}) {\n super(object, property, 'muigui-color');\n const format = options.format || guessFormat(this.getValue());\n const {color, text} = colorFormatConverters[format];\n this.#colorView = this.add(new ColorView(this, {converters: color}));\n this.#textView = this.add(new TextView(this, {converters: text}));\n this.updateDisplay();\n }\n setOptions(options) {\n const {format} = options;\n if (format) {\n const {color, text} = colorFormatConverters[format];\n this.#colorView.setOptions({converters: color});\n this.#textView.setOptions({converters: text});\n }\n super.setOptions(options);\n return this;\n }\n}","import Controller from './Controller.js';\n\n// This feels like it should be something else like\n// gui.addController({className: 'muigui-divider')};\nexport default class Divider extends Controller {\n constructor() {\n super('muigui-divider');\n }\n}","import Controller from './Controller.js';\n\nexport default class Container extends Controller {\n #controllers;\n #childDestController;\n\n constructor(className) {\n super(className);\n this.#controllers = [];\n this.#childDestController = this;\n }\n get children() {\n return this.#controllers; // should we return a copy?\n }\n get controllers() {\n return this.#controllers.filter(c => !(c instanceof Container));\n }\n get folders() {\n return this.#controllers.filter(c => c instanceof Container);\n }\n reset(recursive = true) {\n for (const controller of this.#controllers) {\n if (!(controller instanceof Container) || recursive) {\n controller.reset(recursive);\n }\n }\n return this;\n }\n updateDisplay() {\n for (const controller of this.#controllers) {\n controller.updateDisplay();\n }\n return this;\n }\n remove(controller) {\n const ndx = this.#controllers.indexOf(controller);\n if (ndx >= 0) {\n const c = this.#controllers.splice(ndx, 1);\n const c0 = c[0];\n const elem = c0.domElement;\n elem.remove();\n c0.setParent(null);\n }\n return this;\n }\n #addControllerImpl(controller) {\n this.domElement.appendChild(controller.domElement);\n this.#controllers.push(controller);\n controller.setParent(this);\n return controller;\n }\n addController(controller) {\n return this.#childDestController.#addControllerImpl(controller);\n }\n pushContainer(container) {\n this.addController(container);\n this.#childDestController = container;\n return container;\n }\n popContainer() {\n this.#childDestController = this.#childDestController.parent;\n return this;\n }\n listen() {\n this.#controllers.forEach(c => {\n c.listen();\n });\n return this;\n }\n}\n","import { createElem } from '../libs/elem.js';\nimport Container from './Container.js';\n\nexport default class Folder extends Container {\n #labelElem;\n\n constructor(name = 'Controls', className = 'muigui-menu') {\n super(className);\n this.#labelElem = createElem('label');\n this.addElem(createElem('button', {\n type: 'button',\n onClick: () => this.toggleOpen(),\n }, [this.#labelElem]));\n this.pushContainer(new Container('muigui-open-container'));\n this.pushContainer(new Container());\n this.name(name);\n this.open();\n }\n open(open = true) {\n this.domElement.classList.toggle('muigui-closed', !open);\n this.domElement.classList.toggle('muigui-open', open);\n return this;\n }\n close() {\n return this.open(false);\n }\n name(name) {\n this.#labelElem.textContent = name;\n return this;\n }\n title(title) {\n return this.name(title);\n }\n toggleOpen() {\n this.open(!this.domElement.classList.contains('muigui-open'));\n return this;\n }\n}\n","import Controller from './Controller.js';\n\n// This feels like it should be something else like\n// gui.addDividing = new Controller()\nexport default class Label extends Controller {\n constructor(text) {\n super('muigui-label');\n this.text(text);\n }\n text(text) {\n this.domElement.textContent = text;\n return this;\n }\n}","function noop() {\n}\n\nexport function computeRelativePosition(elem, event, start) {\n const rect = elem.getBoundingClientRect();\n const x = event.clientX - rect.left;\n const y = event.clientY - rect.top;\n const nx = x / rect.width;\n const ny = y / rect.height;\n start = start || [x, y];\n const dx = x - start[0];\n const dy = y - start[1];\n const ndx = dx / rect.width;\n const ndy = dy / rect.width;\n return {x, y, nx, ny, dx, dy, ndx, ndy};\n}\n\nexport function addTouchEvents(elem, {onDown = noop, onMove = noop, onUp = noop}) {\n let start;\n const pointerMove = function (event) {\n const e = {\n type: 'move',\n ...computeRelativePosition(elem, event, start),\n };\n onMove(e);\n };\n\n const pointerUp = function (event) {\n elem.releasePointerCapture(event.pointerId);\n elem.removeEventListener('pointermove', pointerMove);\n elem.removeEventListener('pointerup', pointerUp);\n\n document.body.style.backgroundColor = '';\n\n onUp('up');\n };\n\n const pointerDown = function (event) {\n elem.addEventListener('pointermove', pointerMove);\n elem.addEventListener('pointerup', pointerUp);\n elem.setPointerCapture(event.pointerId);\n\n const rel = computeRelativePosition(elem, event);\n start = [rel.x, rel.y];\n onDown({\n type: 'down',\n ...rel,\n });\n };\n\n elem.addEventListener('pointerdown', pointerDown);\n\n return function () {\n elem.removeEventListener('pointerdown', pointerDown);\n };\n}","import { createElem, getNewId } from '../libs/elem.js';\nimport { addTouchEvents } from '../libs/touch.js';\nimport { identity } from '../libs/conversions.js';\nimport { clamp } from '../libs/utils.js';\nimport EditView from './EditView.js';\nimport {\n hexToFloatRGB,\n hexToFloatRGBA,\n hsv01ToRGBFloat,\n hsva01ToRGBAFloat,\n rgbFloatToHSV01,\n rgbaFloatToHSVA01,\n floatRGBToHex,\n floatRGBAToHex,\n rgbaFloatToHsla01,\n} from '../libs/color-utils.js';\nimport { copyExistingProperties } from '../libs/utils.js';\n\nconst svg = `\n\n \n \n \n \n \n \n \n \n\n \n \n \n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n \n \n \n \n \n \n \n \n\n`;\n\nfunction connectFillTargets(elem) {\n elem.querySelectorAll('[data-src]').forEach(srcElem => {\n const id = getNewId();\n srcElem.id = id;\n elem.querySelectorAll(`[data-target=${srcElem.dataset.src}]`).forEach(targetElem => {\n targetElem.setAttribute('fill', `url(#${id})`);\n });\n });\n return elem;\n}\n\n// Was originally going to make alpha an option. Issue is\n// hard coded conversions?\nexport default class ColorChooserView extends EditView {\n #to;\n #from;\n #satLevelElem;\n #circleElem;\n #hueUIElem;\n #hueElem;\n #hueCursorElem;\n #alphaUIElem;\n #alphaElem;\n #alphaCursorElem;\n #hsva;\n #skipHueUpdate;\n #skipSatLevelUpdate;\n #skipAlphaUpdate;\n #options = {\n converters: identity,\n alpha: false,\n };\n #convertInternalToHex;\n #convertHexToInternal;\n\n constructor(setter, options) {\n super(createElem('div', {\n innerHTML: svg,\n className: 'muigui-no-scroll',\n }));\n this.#satLevelElem = this.domElement.children[0];\n this.#hueUIElem = this.domElement.children[1];\n this.#alphaUIElem = this.domElement.children[2];\n connectFillTargets(this.#satLevelElem);\n connectFillTargets(this.#hueUIElem);\n connectFillTargets(this.#alphaUIElem);\n this.#circleElem = this.$('.muigui-color-chooser-circle');\n this.#hueElem = this.$('[data-src=muigui-color-chooser-hue]');\n this.#hueCursorElem = this.$('.muigui-color-chooser-hue-cursor');\n this.#alphaElem = this.$('[data-src=muigui-color-chooser-alpha]');\n this.#alphaCursorElem = this.$('.muigui-color-chooser-alpha-cursor');\n\n const handleSatLevelChange = (e) => {\n const s = clamp(e.nx, 0, 1);\n const v = clamp(e.ny, 0, 1);\n this.#hsva[1] = s;\n this.#hsva[2] = (1 - v);\n this.#skipHueUpdate = true;\n this.#skipAlphaUpdate = true;\n const [valid, newV] = this.#from(this.#convertInternalToHex(this.#hsva));\n if (valid) {\n setter.setValue(newV);\n }\n };\n\n const handleHueChange = (e) => {\n const h = clamp(e.nx, 0, 1);\n this.#hsva[0] = h;\n this.#skipSatLevelUpdate = true;\n this.#skipAlphaUpdate = true;\n const [valid, newV] = this.#from(this.#convertInternalToHex(this.#hsva));\n if (valid) {\n setter.setValue(newV);\n }\n };\n\n const handleAlphaChange = (e) => {\n const a = clamp(e.nx, 0, 1);\n this.#hsva[3] = a;\n this.#skipHueUpdate = true;\n this.#skipSatLevelUpdate = true;\n const [valid, newV] = this.#from(this.#convertInternalToHex(this.#hsva));\n if (valid) {\n setter.setValue(newV);\n }\n };\n\n addTouchEvents(this.#satLevelElem, {\n onDown: handleSatLevelChange,\n onMove: handleSatLevelChange,\n });\n addTouchEvents(this.#hueUIElem, {\n onDown: handleHueChange,\n onMove: handleHueChange,\n });\n addTouchEvents(this.#alphaUIElem, {\n onDown: handleAlphaChange,\n onMove: handleAlphaChange,\n });\n this.setOptions(options);\n }\n updateDisplay(newV) {\n if (!this.#hsva) {\n this.#hsva = this.#convertHexToInternal(this.#to(newV));\n }\n {\n const [h, s, v, a = 1] = this.#convertHexToInternal(this.#to(newV));\n // Don't copy the hue if it was un-computable.\n if (!this.#skipHueUpdate) {\n this.#hsva[0] = s > 0.001 && v > 0.001 ? h : this.#hsva[0];\n }\n if (!this.#skipSatLevelUpdate) {\n this.#hsva[1] = s;\n this.#hsva[2] = v;\n }\n if (!this.#skipAlphaUpdate) {\n this.#hsva[3] = a;\n }\n }\n {\n const [h, s, v, a] = this.#hsva;\n const [hue, sat, lum] = rgbaFloatToHsla01(hsva01ToRGBAFloat(this.#hsva));\n\n if (!this.#skipHueUpdate) {\n this.#hueCursorElem.setAttribute('transform', `translate(${h * 64}, 0)`);\n }\n this.#hueElem.children[0].setAttribute('stop-color', `hsl(${hue * 360} 0% 100% / ${a})`);\n this.#hueElem.children[1].setAttribute('stop-color', `hsl(${hue * 360} 100% 50% / ${a})`);\n if (!this.#skipAlphaUpdate) {\n this.#alphaCursorElem.setAttribute('transform', `translate(${a * 64}, 0)`);\n }\n this.#alphaElem.children[0].setAttribute('stop-color', `hsl(${hue * 360} ${sat * 100}% ${lum * 100}% / 0)`);\n this.#alphaElem.children[1].setAttribute('stop-color', `hsl(${hue * 360} ${sat * 100}% ${lum * 100}% / 1)`);\n\n if (!this.#skipSatLevelUpdate) {\n this.#circleElem.setAttribute('cx', `${s * 64}`);\n this.#circleElem.setAttribute('cy', `${(1 - v) * 48}`);\n }\n }\n this.#skipHueUpdate = false;\n this.#skipSatLevelUpdate = false;\n this.#skipAlphaUpdate = false;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {converters: {to, from}, alpha} = this.#options;\n this.#alphaUIElem.style.display = alpha ? '' : 'none';\n this.#convertInternalToHex = alpha\n ? v => floatRGBAToHex(hsva01ToRGBAFloat(v))\n : v => floatRGBToHex(hsv01ToRGBFloat(v));\n this.#convertHexToInternal = alpha\n ? v => rgbaFloatToHSVA01(hexToFloatRGBA(v))\n : v => rgbFloatToHSV01(hexToFloatRGB(v));\n this.#to = to;\n this.#from = from;\n return this;\n }\n}\n","import ElementView from '../views/ElementView.js';\nimport ValueController from './ValueController.js';\nimport { copyExistingProperties } from '../libs/utils.js';\nimport { createElem } from '../libs/elem.js';\n/*\n\nholder = new TabHolder\ntab = holder.add(new Tab(\"name\"))\ntab.add(...)\n\n\npc = new PopdownController\ntop = pc.add(new Row())\ntop.add(new Button());\nvalues = topRow.add(new Div())\nbottom = pc.add(new Row());\n\n\n\npc = new PopdownController\npc.addTop\npc.addTop\n\npc.addBottom\n\n\n*/\n\nexport default class PopDownController extends ValueController {\n #top;\n #valuesView;\n #checkboxElem;\n #bottom;\n #options = {\n open: false,\n };\n\n constructor(object, property, options = {}) {\n super(object, property, 'muigui-pop-down-controller');\n /*\n [ValueView\n [[B][values]] upper row\n [[ visual ]] lower row\n ]\n */\n this.#top = this.add(new ElementView('div', 'muigui-pop-down-top'));\n// this.#top.add(new CheckboxView(makeSetter(this.#options, 'open')));\n const checkboxElem = this.#top.addElem(createElem('input', {\n type: 'checkbox',\n onChange: () => {\n this.#options.open = checkboxElem.checked;\n this.updateDisplay();\n },\n }));\n this.#checkboxElem = checkboxElem;\n this.#valuesView = this.#top.add(new ElementView('div', 'muigui-pop-down-values'));\n const container = new ElementView('div', 'muigui-pop-down-bottom muigui-open-container');\n this.#bottom = new ElementView('div');\n container.add(this.#bottom);\n this.add(container);\n this.setOptions(options);\n }\n setKnobColor(bgCssColor/*, fgCssColor*/) {\n if (this.#checkboxElem) {\n this.#checkboxElem.style = `\n --range-color: ${bgCssColor};\n --value-bg-color: ${bgCssColor};\n `;\n }\n }\n updateDisplay() {\n super.updateDisplay();\n const {open} = this.#options;\n this.domElement.children[1].classList.toggle('muigui-open', open);\n this.domElement.children[1].classList.toggle('muigui-closed', !open);\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n super.setOptions(options);\n this.updateDisplay();\n }\n addTop(view) {\n return this.#valuesView.add(view);\n }\n addBottom(view) {\n return this.#bottom.add(view);\n }\n}","/* eslint-disable no-underscore-dangle */\nimport {\n colorFormatConverters,\n guessFormat,\n hasAlpha,\n hexToUint8RGB,\n hslToRgbUint8,\n rgbUint8ToHsl,\n uint8RGBToHex,\n} from '../libs/color-utils.js';\nimport ColorChooserView from '../views/ColorChooserView.js';\nimport TextView from '../views/TextView.js';\nimport PopDownController from './PopDownController.js';\n\nexport default class ColorChooser extends PopDownController {\n #colorView;\n #textView;\n #to;\n\n constructor(object, property, options = {}) {\n super(object, property, 'muigui-color-chooser');\n const format = options.format || guessFormat(this.getValue());\n const {color, text} = colorFormatConverters[format];\n this.#to = color.to;\n this.#textView = new TextView(this, {converters: text, alpha: hasAlpha(format)});\n this.#colorView = new ColorChooserView(this, {converters: color, alpha: hasAlpha(format)});\n this.addTop(this.#textView);\n this.addBottom(this.#colorView);\n // WTF! FIX!\n this.___setKnobHelper = true;\n this.updateDisplay();\n }\n #setKnobHelper() {\n if (this.#to) {\n const hex6Or8 = this.#to(this.getValue());\n const alpha = hex6Or8.length === 9 ? hex6Or8.substring(7, 9) : 'FF';\n const hsl = rgbUint8ToHsl(hexToUint8RGB(hex6Or8));\n hsl[2] = (hsl[2] + 50) % 100;\n const hex = uint8RGBToHex(hslToRgbUint8(hsl));\n this.setKnobColor(`${hex6Or8.substring(0, 7)}${alpha}`, hex);\n }\n }\n updateDisplay() {\n super.updateDisplay();\n if (this.___setKnobHelper) {\n this.#setKnobHelper();\n }\n }\n setOptions(options) {\n super.setOptions(options);\n return this;\n }\n}\n","import css from './styles/muigui.css.js';\nimport {createElem} from './libs/elem.js';\nimport {createController} from './controllers/create-controller.js';\nimport {\n mapRange,\n makeRangeConverters,\n makeRangeOptions,\n makeMinMaxPair,\n} from './libs/utils.js';\nimport {\n converters\n} from './libs/conversions.js';\nimport {\n hasAlpha,\n guessFormat,\n} from './libs/color-utils.js';\nimport Canvas from './controllers/Canvas.js';\nimport Color from './controllers/Color.js';\nimport Divider from './controllers/Divider.js';\nimport Folder from './controllers/Folder.js';\nimport Label from './controllers/Label.js';\nimport Controller from './controllers/Controller.js';\nimport ColorChooser from './controllers/ColorChooser.js';\n\nimport Column from './layout/Column.js';\nimport Frame from './layout/Frame.js';\nimport Grid from './layout/Grid.js';\nimport Row from './layout/Row.js';\n\nexport {\n Column,\n Frame,\n Grid,\n Row,\n};\n\nfunction camelCaseToSnakeCase(id) {\n return id\n .replace(/(.)([A-Z][a-z]+)/g, '$1_$2')\n .replace(/([a-z0-9])([A-Z])/g, '$1_$2')\n .toLowerCase();\n}\n\nfunction prepName(name) {\n return camelCaseToSnakeCase(name.toString()).replaceAll('_', ' ');\n}\n\nexport class GUIFolder extends Folder {\n add(object, property, ...args) {\n const controller = object instanceof Controller\n ? object\n : createController(object, property, ...args).name(prepName(property));\n return this.addController(controller);\n }\n addCanvas(name) {\n return this.addController(new Canvas(name));\n }\n addColor(object, property, options = {}) {\n const value = object[property];\n if (hasAlpha(options.format || guessFormat(value))) {\n return this\n .addController(new ColorChooser(object, property, options))\n .name(prepName(property));\n } else {\n return this\n .addController(new Color(object, property, options))\n .name(prepName(property));\n }\n }\n addDivider() {\n return this.addController(new Divider());\n }\n addFolder(name) {\n return this.addController(new GUIFolder(name));\n }\n addLabel(text) {\n return this.addController(new Label(text));\n }\n addButton(name, fn) {\n const o = {fn};\n return this.add(o, 'fn').name(prepName(name));\n }\n}\n\nclass MuiguiElement extends HTMLElement {\n constructor() {\n super();\n this.shadow = this.attachShadow({mode: 'open'});\n }\n}\n\ncustomElements.define('muigui-element', MuiguiElement);\n\nconst baseStyleSheet = new CSSStyleSheet();\n//baseStyleSheet.replaceSync(css.default);\nconst userStyleSheet = new CSSStyleSheet();\n\nfunction makeStyleSheetUpdater(styleSheet) {\n let newCss;\n let newCssPromise;\n\n function updateStyle() {\n if (newCss && !newCssPromise) {\n const s = newCss;\n newCss = undefined;\n newCssPromise = styleSheet.replace(s).then(() => {\n newCssPromise = undefined;\n updateStyle();\n });\n }\n }\n\n return function updateStyleSheet(css) {\n newCss = css;\n updateStyle();\n };\n}\n\nconst updateBaseStyle = makeStyleSheetUpdater(baseStyleSheet);\nconst updateUserStyle = makeStyleSheetUpdater(userStyleSheet);\n\nfunction getTheme(name) {\n const { include, css: cssStr } = css.themes[name];\n return `${include.map(m => css[m]).join('\\n')} : css.default}\\n${cssStr || ''}`;\n}\n\nexport class GUI extends GUIFolder {\n static converters = converters;\n static mapRange = mapRange;\n static makeRangeConverters = makeRangeConverters;\n static makeRangeOptions = makeRangeOptions;\n static makeMinMaxPair = makeMinMaxPair;\n #localStyleSheet = new CSSStyleSheet();\n\n constructor(options = {}) {\n super('Controls', 'muigui-root');\n if (options instanceof HTMLElement) {\n options = {parent: options};\n }\n const {\n autoPlace = true,\n width,\n title = 'Controls',\n } = options;\n let {\n parent,\n } = options;\n\n if (width) {\n this.domElement.style.width = /^\\d+$/.test(width) ? `${width}px` : width;\n }\n if (parent === undefined && autoPlace) {\n parent = document.body;\n this.domElement.classList.add('muigui-auto-place');\n }\n if (parent) {\n const muiguiElement = createElem('muigui-element');\n muiguiElement.shadowRoot.adoptedStyleSheets = [this.#localStyleSheet, baseStyleSheet, userStyleSheet];\n muiguiElement.shadow.appendChild(this.domElement);\n parent.appendChild(muiguiElement);\n }\n if (title) {\n this.title(title);\n }\n this.#localStyleSheet.replaceSync(css.default);\n this.domElement.classList.add('muigui', 'muigui-colors');\n }\n setStyle(css) {\n this.#localStyleSheet.replace(css);\n }\n static setBaseStyles(css) {\n updateBaseStyle(css);\n }\n static getBaseStyleSheet() {\n return baseStyleSheet;\n }\n static setUserStyles(css) {\n updateUserStyle(css);\n }\n static getUserStyleSheet() {\n return userStyleSheet;\n }\n setTheme(name) {\n this.setStyle(getTheme(name));\n }\n static setTheme(name) {\n GUI.setBaseStyles(getTheme(name));\n }\n}\n\nexport default GUI;\n","import Button from './Button.js';\nimport Checkbox from './Checkbox.js';\nimport TextNumber from './TextNumber.js';\nimport Select from './Select.js';\nimport Range from './Range.js';\nimport Text from './Text.js';\n\n// const isConversion = o => typeof o.to === 'function' && typeof o.from === 'function';\n\n/**\n * possible inputs\n * add(o, p, min: number, max: number)\n * add(o, p, min: number, max: number, step: number)\n * add(o, p, array: [value])\n * add(o, p, array: [[key, value]])\n *\n * @param {*} object\n * @param {string} property\n * @param {...any} args\n * @returns {Controller}\n */\nexport function createController(object, property, ...args) {\n const [arg1] = args;\n if (Array.isArray(arg1)) {\n return new Select(object, property, {keyValues: arg1});\n }\n if (arg1 && arg1.keyValues) {\n return new Select(object, property, {keyValues: arg1.keyValues});\n }\n\n const t = typeof object[property];\n switch (t) {\n case 'number':\n if (typeof args[0] === 'number' && typeof args[1] === 'number') {\n const min = args[0];\n const max = args[1];\n const step = args[2];\n return new Range(object, property, {min, max, ...(step && {step})});\n }\n return args.length === 0\n ? new TextNumber(object, property, ...args)\n : new Range(object, property, ...args);\n case 'boolean':\n return new Checkbox(object, property, ...args);\n case 'function':\n return new Button(object, property, ...args);\n case 'string':\n return new Text(object, property, ...args);\n case 'undefined':\n throw new Error(`no property named ${property}`);\n default:\n throw new Error(`unhandled type ${t} for property ${property}`);\n }\n}","function noop() {\n}\n\nconst keyDirections = {\n ArrowLeft: [-1, 0],\n ArrowRight: [1, 0],\n ArrowUp: [0, -1],\n ArrowDown: [0, 1],\n};\n\n// This probably needs to be global\nexport function addKeyboardEvents(elem, {onDown = noop, onUp = noop}) {\n const keyDown = function (event) {\n const mult = event.shiftKey ? 10 : 1;\n const [dx, dy] = (keyDirections[event.key] || [0, 0]).map(v => v * mult);\n const fn = event.type === 'keydown' ? onDown : onUp;\n fn({\n type: event.type.substring(3),\n dx,\n dy,\n event,\n });\n };\n\n elem.addEventListener('keydown', keyDown);\n elem.addEventListener('keyup', keyDown);\n\n return function () {\n elem.removeEventListener('keydown', keyDown);\n elem.removeEventListener('keyup', keyDown);\n };\n}","export function assert(truthy, msg = '') {\n if (!truthy) {\n throw new Error(msg);\n }\n}","import { assert } from '../libs/assert.js';\n\nfunction getEllipsePointForAngle(cx, cy, rx, ry, phi, theta) {\n const m = Math.abs(rx) * Math.cos(theta);\n const n = Math.abs(ry) * Math.sin(theta);\n\n return [\n cx + Math.cos(phi) * m - Math.sin(phi) * n,\n cy + Math.sin(phi) * m + Math.cos(phi) * n,\n ];\n}\n\nfunction getEndpointParameters(cx, cy, rx, ry, phi, theta, dTheta) {\n const [x1, y1] = getEllipsePointForAngle(cx, cy, rx, ry, phi, theta);\n const [x2, y2] = getEllipsePointForAngle(cx, cy, rx, ry, phi, theta + dTheta);\n\n const fa = Math.abs(dTheta) > Math.PI ? 1 : 0;\n const fs = dTheta > 0 ? 1 : 0;\n\n return { x1, y1, x2, y2, fa, fs };\n}\n\nexport function arc(cx, cy, r, start, end) {\n assert(Math.abs(start - end) <= Math.PI * 2);\n assert(start >= -Math.PI && start <= Math.PI * 2);\n assert(start <= end);\n assert(end >= -Math.PI && end <= Math.PI * 4);\n\n const { x1, y1, x2, y2, fa, fs } = getEndpointParameters(cx, cy, r, r, 0, start, end - start);\n return Math.abs(Math.abs(start - end) - Math.PI * 2) > Number.EPSILON\n ? `M${cx} ${cy} L${x1} ${y1} A ${r} ${r} 0 ${fa} ${fs} ${x2} ${y2} L${cx} ${cy}`\n : `M${x1} ${y1} L${x1} ${y1} A ${r} ${r} 0 ${fa} ${fs} ${x2} ${y2}`;\n}\n","import { identity } from '../libs/conversions.js';\nimport { createElem } from '../libs/elem.js';\nimport { addKeyboardEvents } from '../libs/keyboard.js';\nimport { arc } from '../libs/svg.js';\nimport { addTouchEvents } from '../libs/touch.js';\nimport { createWheelHelper } from '../libs/wheel.js';\nimport { clamp, copyExistingProperties, euclideanModulo, lerp, stepify } from '../libs/utils.js';\nimport EditView from './EditView.js';\n\nconst svg = `\n\n \n \n \n \n \n \n \n\n`;\n\nconst twoPiMod = v => euclideanModulo(v + Math.PI, Math.PI * 2) - Math.PI;\n\nexport default class DirectionView extends EditView {\n #arrowElem;\n #rangeElem;\n #lastV;\n #wrap;\n #options = {\n step: 1,\n min: -180,\n max: 180,\n\n /*\n --------\n / -π/2 \\\n / | \\\n |<- -π * |\n | * 0 ->| zero is down the positive X axis\n |<- +π * |\n \\ | /\n \\ π/2 /\n --------\n */\n dirMin: -Math.PI,\n dirMax: Math.PI,\n //dirMin: Math.PI * 0.5,\n //dirMax: Math.PI * 2.5,\n //dirMin: -Math.PI * 0.75, // test 10:30 to 7:30\n //dirMax: Math.PI * 0.75,\n //dirMin: Math.PI * 0.75, // test 7:30 to 10:30\n //dirMax: -Math.PI * 0.75,\n //dirMin: -Math.PI * 0.75, // test 10:30 to 1:30\n //dirMax: -Math.PI * 0.25,\n //dirMin: Math.PI * 0.25, // test 4:30 to 7:30\n //dirMax: Math.PI * 0.75,\n //dirMin: Math.PI * 0.75, // test 4:30 to 7:30\n //dirMax: Math.PI * 0.25,\n wrap: undefined,\n converters: identity,\n };\n\n constructor(setter, options = {}) {\n const wheelHelper = createWheelHelper();\n super(createElem('div', {\n className: 'muigui-direction muigui-no-scroll',\n innerHTML: svg,\n onWheel: e => {\n e.preventDefault();\n const {min, max, step} = this.#options;\n const delta = wheelHelper(e, step);\n let tempV = this.#lastV + delta;\n if (this.#wrap) {\n tempV = euclideanModulo(tempV - min, max - min) + min;\n }\n const newV = clamp(stepify(tempV, v => v, step), min, max);\n setter.setValue(newV);\n },\n }));\n const handleTouch = (e) => {\n const {min, max, step, dirMin, dirMax} = this.#options;\n const nx = e.nx * 2 - 1;\n const ny = e.ny * 2 - 1;\n const a = Math.atan2(ny, nx);\n\n const center = (dirMin + dirMax) / 2;\n\n const centeredAngle = twoPiMod(a - center);\n const centeredStart = twoPiMod(dirMin - center);\n const diff = dirMax - dirMin;\n\n const n = clamp((centeredAngle - centeredStart) / (diff), 0, 1);\n const newV = stepify(min + (max - min) * n, v => v, step);\n setter.setValue(newV);\n };\n addTouchEvents(this.domElement, {\n onDown: handleTouch,\n onMove: handleTouch,\n });\n addKeyboardEvents(this.domElement, {\n onDown: (e) => {\n const {min, max, step} = this.#options;\n const newV = clamp(stepify(this.#lastV + e.dx * step, v => v, step), min, max);\n setter.setValue(newV);\n },\n });\n this.#arrowElem = this.$('#muigui-arrow');\n this.#rangeElem = this.$('#muigui-range');\n this.setOptions(options);\n }\n updateDisplay(v) {\n this.#lastV = v;\n const {min, max} = this.#options;\n const n = (v - min) / (max - min);\n const angle = lerp(this.#options.dirMin, this.#options.dirMax, n);\n this.#arrowElem.style.transform = `rotate(${angle}rad)`;\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n const {dirMin, dirMax, wrap} = this.#options;\n this.#wrap = wrap !== undefined\n ? wrap\n : Math.abs(dirMin - dirMax) >= Math.PI * 2 - Number.EPSILON;\n const [min, max] = dirMin < dirMax ? [dirMin, dirMax] : [dirMax , dirMin];\n this.#rangeElem.setAttribute('d', arc(0, 0, 28.87, min, max));\n }\n}\n","import { identity } from '../libs/conversions.js';\nimport DirectionView from '../views/DirectionView.js';\nimport NumberView from '../views/NumberView.js';\n// import ValueController from './ValueController.js';\nimport PopDownController from './PopDownController.js';\n\n\n// deg2rad\n// where is 0\n// range (0, 360), (-180, +180), (0,0) Really this is a range\n\nexport default class Direction extends PopDownController {\n #options;\n constructor(object, property, options) {\n super(object, property, 'muigui-direction');\nthis.#options = options; // FIX\n this.addTop(new NumberView(this,\nidentity));\n this.addBottom(new DirectionView(this, options));\n this.updateDisplay();\n }\n}\n\n","import { createElem } from '../libs/elem.js';\nimport { makeId } from '../libs/ids.js';\nimport EditView from './EditView.js';\n\nexport default class RadioGridView extends EditView {\n #values;\n\n constructor(setter, keyValues, cols = 3) {\n const values = [];\n const name = makeId();\n super(createElem('div', {}, keyValues.map(([key, value], ndx) => {\n values.push(value);\n return createElem('label', {}, [\n createElem('input', {\n type: 'radio',\n name,\n value: ndx,\n onChange: function () {\n if (this.checked) {\n setter.setFinalValue(that.#values[this.value]);\n }\n },\n }),\n createElem('button', {\n type: 'button',\n textContent: key,\n onClick: function () {\n this.previousElementSibling.click();\n },\n }),\n ]);\n })));\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const that = this;\n this.#values = values;\n this.cols(cols);\n }\n updateDisplay(v) {\n const ndx = this.#values.indexOf(v);\n for (let i = 0; i < this.domElement.children.length; ++i) {\n this.domElement.children[i].children[0].checked = i === ndx;\n }\n }\n cols(cols) {\n this.domElement.style.gridTemplateColumns = `repeat(${cols}, 1fr)`;\n }\n}\n","import RadioGridView from '../views/RadioGridView.js';\nimport ValueController from './ValueController.js';\nimport { convertToKeyValues } from '../libs/key-values.js';\n\nexport default class RadioGrid extends ValueController {\n constructor(object, property, options) {\n super(object, property, 'muigui-radio-grid');\n const valueIsNumber = typeof this.getValue() === 'number';\n const {\n keyValues: keyValuesInput,\n cols = 3,\n } = options;\n const keyValues = convertToKeyValues(keyValuesInput, valueIsNumber);\n this.add(new RadioGridView(this, keyValues, cols));\n this.updateDisplay();\n }\n}","export function onResize(elem, callback) {\n new ResizeObserver(() => {\n callback({rect: elem.getBoundingClientRect(), elem});\n }).observe(elem);\n}\n\nexport function onResizeSVGNoScale(elem, hAnchor, vAnchor, callback) {\n onResize(elem, ({rect}) => {\n const {width, height} = rect;\n elem.setAttribute('viewBox', `-${width * hAnchor} -${height * vAnchor} ${width} ${height}`);\n callback({elem, rect});\n });\n}\n\nexport function onResizeCanvas(elem, callback) {\n onResize(elem, ({rect}) => {\n const {width, height} = rect;\n elem.width = width;\n elem.height = height;\n callback({elem, rect});\n });\n}\n","import { createElem } from '../libs/elem.js';\nimport { addKeyboardEvents } from '../libs/keyboard.js';\nimport { addTouchEvents } from '../libs/touch.js';\nimport { createWheelHelper } from '../libs/wheel.js';\nimport { onResizeSVGNoScale } from '../libs/resize-helpers.js';\nimport { clamp, copyExistingProperties, stepify } from '../libs/utils.js';\nimport EditView from './EditView.js';\n\nconst svg = `\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n`;\n\nfunction createSVGTicks(start, end, step, min, max, height) {\n const p = [];\n if (start < min) {\n start += stepify(min - start, v => v, step);\n }\n end = Math.min(end, max);\n for (let i = start; i <= end; i += step) {\n p.push(`M${i} 0 l0 ${height}`);\n }\n return p.join(' ');\n}\n\nfunction createSVGNumbers(start, end, unitSize, unit, minusSize, min, max, labelFn) {\n const texts = [];\n if (start < min) {\n start += stepify(min - start, v => v, unitSize);\n }\n end = Math.min(end, max);\n const digits = Math.max(0, -Math.log10(unit));\n const f = v => labelFn(v.toFixed(digits));\n for (let i = start; i <= end; i += unitSize) {\n texts.push(`= 0 ? i : (i - minusSize / 2) }\" y=\"0\">${f(i / unitSize * unit)}`);\n }\n return texts.join('\\n');\n}\n\nfunction computeSizeOfMinus(elem) {\n const oldHTML = elem.innerHTML;\n elem.innerHTML = '- ';\n const text = elem.querySelector('text');\n const size = text.getComputedTextLength();\n elem.innerHTML = oldHTML;\n return size;\n}\n\nexport default class SliderView extends EditView {\n #svgElem;\n #originElem;\n #ticksElem;\n #thicksElem;\n #numbersElem;\n #leftGradElem;\n #rightGradElem;\n #width;\n #height;\n #lastV;\n #minusSize;\n #options = {\n min: -100,\n max: 100,\n step: 1,\n unit: 10,\n unitSize: 10,\n ticksPerUnit: 5,\n labelFn: v => v,\n tickHeight: 1,\n limits: true,\n thicksColor: undefined,\n orientation: undefined,\n };\n\n constructor(setter, options) {\n const wheelHelper = createWheelHelper();\n super(createElem('div', {\n innerHTML: svg,\n className: 'muigui-no-v-scroll',\n onWheel: e => {\n e.preventDefault();\n const {min, max, step} = this.#options;\n const delta = wheelHelper(e, step);\n const newV = clamp(stepify(this.#lastV + delta, v => v, step), min, max);\n setter.setValue(newV);\n },\n }));\n this.#svgElem = this.$('svg');\n this.#originElem = this.$('#muigui-origin');\n this.#ticksElem = this.$('#muigui-ticks');\n this.#thicksElem = this.$('#muigui-thicks');\n this.#numbersElem = this.$('#muigui-numbers');\n this.#leftGradElem = this.$('#muigui-left-grad');\n this.#rightGradElem = this.$('#muigui-right-grad');\n this.setOptions(options);\n let startV;\n addTouchEvents(this.domElement, {\n onDown: () => {\n startV = this.#lastV;\n },\n onMove: (e) => {\n const {min, max, unitSize, unit, step} = this.#options;\n const newV = clamp(stepify(startV - e.dx / unitSize * unit, v => v, step), min, max);\n setter.setValue(newV);\n },\n });\n addKeyboardEvents(this.domElement, {\n onDown: (e) => {\n const {min, max, step} = this.#options;\n const newV = clamp(stepify(this.#lastV + e.dx * step, v => v, step), min, max);\n setter.setValue(newV);\n },\n });\n onResizeSVGNoScale(this.#svgElem, 0.5, 0, ({rect: {width}}) => {\n this.#leftGradElem.setAttribute('x', -width / 2);\n this.#rightGradElem.setAttribute('x', width / 2 - 20);\n this.#minusSize = computeSizeOfMinus(this.#numbersElem);\n this.#width = width;\n this.#updateSlider();\n });\n }\n // |--------V--------|\n // . . | . . . | . . . |\n //\n #updateSlider() {\n // There's no size if ResizeObserver has not fired yet.\n if (!this.#width || this.#lastV === undefined) {\n return;\n }\n const {\n labelFn,\n limits,\n min,\n max,\n orientation,\n tickHeight,\n ticksPerUnit,\n unit,\n unitSize,\n thicksColor,\n } = this.#options;\n const unitsAcross = Math.ceil(this.#width / unitSize);\n const center = this.#lastV;\n const centerUnitSpace = center / unit;\n const startUnitSpace = Math.round(centerUnitSpace - unitsAcross);\n const endUnitSpace = startUnitSpace + unitsAcross * 2;\n const start = startUnitSpace * unitSize;\n const end = endUnitSpace * unitSize;\n const minUnitSpace = limits ? min * unitSize / unit : start;\n const maxUnitSpace = limits ? max * unitSize / unit : end;\n const height = labelFn(1) === '' ? 10 : 5;\n if (ticksPerUnit > 1) {\n this.#ticksElem.setAttribute('d', createSVGTicks(start, end, unitSize / ticksPerUnit, minUnitSpace, maxUnitSpace, height * tickHeight));\n }\n this.#thicksElem.style.stroke = thicksColor; //setAttribute('stroke', thicksColor);\n this.#thicksElem.setAttribute('d', createSVGTicks(start, end, unitSize, minUnitSpace, maxUnitSpace, height));\n this.#numbersElem.innerHTML = createSVGNumbers(start, end, unitSize, unit, this.#minusSize, minUnitSpace, maxUnitSpace, labelFn);\n this.#originElem.setAttribute('transform', `translate(${-this.#lastV * unitSize / unit} 0)`);\n this.#svgElem.classList.toggle('muigui-slider-up', orientation === 'up');\n }\n updateDisplay(v) {\n this.#lastV = v;\n this.#updateSlider();\n }\n setOptions(options) {\n copyExistingProperties(this.#options, options);\n return this;\n }\n}\n","import ValueController from './ValueController.js';\nimport NumberView from '../views/NumberView.js';\nimport SliderView from '../views/SliderView.js';\n\nexport default class Slider extends ValueController {\n constructor(object, property, options = {}) {\n super(object, property, 'muigui-slider');\n this.add(new SliderView(this, options));\n this.add(new NumberView(this, options));\n this.updateDisplay();\n }\n}\n","import { createElem } from '../libs/elem.js';\nimport { addTouchEvents } from '../libs/touch.js';\nimport { onResizeSVGNoScale } from '../libs/resize-helpers.js';\nimport EditView from './EditView.js';\n\nconst svg = `\n\n \n \n \n \n \n\n`;\n\nexport default class Vec2View extends EditView {\n #svgElem;\n #arrowElem;\n #circleElem;\n #lastV = [];\n\n constructor(setter) {\n super(createElem('div', {\n innerHTML: svg,\n className: 'muigui-no-scroll',\n }));\n const onTouch = (e) => {\n const {width, height} = this.#svgElem.getBoundingClientRect();\n const nx = e.nx * 2 - 1;\n const ny = e.ny * 2 - 1;\n setter.setValue([nx * width * 0.5, ny * height * 0.5]);\n };\n addTouchEvents(this.domElement, {\n onDown: onTouch,\n onMove: onTouch,\n });\n this.#svgElem = this.$('svg');\n this.#arrowElem = this.$('#muigui-arrow');\n this.#circleElem = this.$('#muigui-circle');\n onResizeSVGNoScale(this.#svgElem, 0.5, 0.5, () => this.#updateDisplayImpl);\n }\n #updateDisplayImpl() {\n const [x, y] = this.#lastV;\n this.#arrowElem.setAttribute('d', `M0,0L${x},${y}`);\n this.#circleElem.setAttribute('transform', `translate(${x}, ${y})`);\n }\n updateDisplay(v) {\n this.#lastV[0] = v[0];\n this.#lastV[1] = v[1];\n this.#updateDisplayImpl();\n }\n}\n","import NumberView from '../views/NumberView.js';\nimport Vec2View from '../views/Vec2View.js';\nimport PopDownController from './PopDownController.js';\nimport { strToNumber } from '../libs/conversions.js';\n\n// TODO: zoom with wheel and pinch?\n// TODO: grid?\n// // options\n// scale:\n// range: number (both x and y + /)\n// range: array (min, max)\n// xRange:\n// deg/rad/turn\n\nexport default class Vec2 extends PopDownController {\n constructor(object, property) {\n super(object, property, 'muigui-vec2');\n\n const makeSetter = (ndx) => {\n return {\n setValue: (v) => {\n const newV = this.getValue();\n newV[ndx] = v;\n this.setValue(newV);\n },\n setFinalValue: (v) => {\n const newV = this.getValue();\n newV[ndx] = v;\n this.setFinalValue(newV);\n },\n };\n };\n\n this.addTop(new NumberView(makeSetter(0), {\n converters: {\n to: v => v[0],\n from: strToNumber.from,\n },\n }));\n this.addTop(new NumberView(makeSetter(1), {\n converters: {\n to: v => v[1],\n from: strToNumber.from,\n },\n }));\n this.addBottom(new Vec2View(this));\n this.updateDisplay();\n }\n}\n","const darkColors = {\n main: '#ddd',\n};\nconst lightColors = {\n main: '#333',\n};\n\nconst darkMatcher = window.matchMedia('(prefers-color-scheme: dark)');\n\nlet colors;\nlet isDarkMode;\n\nfunction update() {\n isDarkMode = darkMatcher.matches;\n colors = isDarkMode ? darkColors : lightColors;\n}\ndarkMatcher.addEventListener('change', update);\nupdate();\n\nexport function graph(canvas, data, {\n min = -1,\n max = 1,\n interval = 16,\n color,\n }) {\n const ctx = canvas.getContext('2d');\n\n function render() {\n const {width, height} = canvas;\n ctx.clearRect(0, 0, width, height);\n ctx.beginPath();\n const range = max - min;\n for (let i = 0; i < data.length; ++i) {\n const x = i * width / data.length;\n const y = (data[i] - min) * height / range;\n ctx.lineTo(x, y);\n }\n ctx.strokeStyle = color || colors.main;\n ctx.stroke();\n }\n setInterval(render, interval);\n}","import GUI from './muigui.js';\n\nexport { default as ColorChooser } from './controllers/ColorChooser.js';\nexport { default as Direction } from './controllers/Direction.js';\nexport { default as RadioGrid } from './controllers/RadioGrid.js';\nexport { default as Range } from './controllers/Range.js';\nexport { default as Select } from './controllers/Select.js';\nexport { default as Slider } from './controllers/Slider.js';\nexport { default as TextNumber } from './controllers/TextNumber.js';\nexport { default as Vec2 } from './controllers/Vec2.js';\n\nimport {graph} from './libs/graph.js';\nimport {monitor} from './libs/monitor.js';\n\nexport const helpers = {\n graph,\n monitor,\n};\n\nexport default GUI;","export function monitor(label, object, property, {interval = 200} = {}) {\n setInterval(() => {\n label.text(JSON.stringify(object[property], null, 2));\n }, interval);\n}\n"],"names":["css","default","themes","include","float","form","none","createElem","tag","attrs","children","elem","document","createElement","key","value","Object","entries","startsWith","eventName","substring","toLowerCase","addEventListener","passive","k","v","undefined","setAttribute","child","appendChild","setElemProps","nextId","removeArrayElem","array","ndx","indexOf","splice","clamp","min","max","Math","isTypedArray","SharedArrayBuffer","a","buffer","ArrayBuffer","stepify","from","step","round","euclideanModulo","n","copyExistingProperties","dst","src","mapRange","inMin","inMax","outMin","outMax","makeRangeConverters","to","makeRangeOptions","converters","identity","makeMinMaxPair","gui","properties","minPropName","maxPropName","options","guiMinRange","minRange","valueMinRange","minGui","add","onChange","maxGui","setValue","View","domElement","childDestElem","views","constructor","this","addElem","removeElem","removeChild","pushSubElem","popSubElem","parentElement","view","push","remove","pushSubView","popSubView","setOptions","updateDisplayIfNeeded","newV","ignoreCache","$","selector","querySelector","Controller","changeFns","finishChangeFns","parent","className","super","classList","setParent","enable","disabled","show","toggle","hide","closest","forEach","querySelectorAll","disable","fn","removeChange","onFinishChange","removeFinishChange","callListeners","fns","call","emitChange","object","property","controller","emitFinalChange","updateDisplay","getColors","toCamelCase","s","replace","m","m1","toUpperCase","div","colors","fromEntries","map","style","color","getComputedStyle","Button","buttonElem","name","type","onClick","textContent","arraysEqual","b","length","i","EditView","oldV","updateCheck","checkArrayNeedsUpdate","needUpdate","copyArrayElementsFromTo","checkTypedArrayNeedsUpdate","once","checkObjectNeedsUpdate","checkValueNeedsUpdate","getUpdateCheckForType","Array","isArray","bind","CheckboxView","checkboxElem","setter","id","onInput","checked","setFinalValue","tasks","tasksToRemove","Set","requestId","processing","processTasks","task","has","size","queueProcessing","clear","requestAnimationFrame","makeId","ValueView","LabelController","nameElem","for","title","tooltip","tip","ValueController","initialValue","listening","updateFn","getValue","setValueImpl","isDifferent","keys","assign","reset","listen","set","removeTask","Checkbox","strToNumber","toString","parseFloat","Number","isNaN","radToDeg","PI","createWheelHelper","wheelAccum","e","wheelScale","deltaY","delta","floor","abs","sign","NumberView","skipUpdate","NEGATIVE_INFINITY","POSITIVE_INFINITY","wheelHelper","handleInput","onWheel","preventDefault","valid","outV","setFn","inRange","TextNumber","textView","SelectView","values","keyValues","selectedIndex","convertToKeyValues","valueIsNumber","Select","keyValuesInput","RangeView","validV","Range","TextView","Text","lerp","t","fract","f0","toFixed","f3","hexToUint32RGB","parseInt","hexToUint32RGBA","hexToUint8RGB","uint8RGBToHex","padStart","join","hexToUint8RGBA","uint8RGBAToHex","hexToFloatRGB","floatRGBToHex","hexToFloatRGBA","floatRGBAToHex","scaleAndClamp","hexToObjectRGB","r","g","hexToObjectRGBA","hexToCssRGB","cssRGBRegex","hexToCssRGBA","cssRGBARegex","hexToCssHSL","hsl","rgbUint8ToHsl","hexToCssHSLA","hsla","rgbaUint8ToHsla","cssHSLRegex","cssHSLARegex","hslToRgbUint8","h","l","f","rgbFloatToHsl01","d","rgbaFloatToHsla01","rgb","rgba","hsv01ToRGBFloat","hue","sat","val","hsva01ToRGBAFloat","alpha","round3","rgbFloatToHSV01","p","q","EPSILON","rgbaFloatToHSVA01","hasAlpha","format","endsWith","cssStringFormats","re","guessFormat","console","warn","formatInfo","test","guessStringColorFormat","trim","Uint8Array","Uint8ClampedArray","Float32Array","Error","fixHex6","fixHex8","hex6ToHex3","hex6","hex3RE","hex3ToHex6","hex3","exec","m2","fixHex3","strToCssRGB","find","strToCssRGBA","strToCssHSL","strToCssHSLA","strTo3IntsRE","strTo4IntsRE","strTo3Floats","numbers","split","badNdx","findIndex","strTo4Floats","strToUint32RGBRegex","strToUint32RGBARegex","hex6RE","hexNoHash6RE","hex8RE","hexNoHash8RE","colorFormatConverters","text","hex8","strToUint32RGB","strToUint32RGBA","json","JSON","parse","hslaToRgbaUint8","ElementView","Canvas","canvasElem","canvas","ColorView","colorElem","Color","colorView","Divider","Container","controllers","childDestController","filter","c","folders","recursive","c0","addControllerImpl","addController","pushContainer","container","popContainer","Folder","labelElem","toggleOpen","open","close","contains","Label","noop","computeRelativePosition","event","start","rect","getBoundingClientRect","x","clientX","left","y","clientY","top","nx","width","ny","height","dx","dy","ndy","addTouchEvents","onDown","onMove","onUp","pointerMove","pointerUp","releasePointerCapture","pointerId","removeEventListener","body","backgroundColor","pointerDown","setPointerCapture","rel","connectFillTargets","srcElem","dataset","targetElem","ColorChooserView","satLevelElem","circleElem","hueUIElem","hueElem","hueCursorElem","alphaUIElem","alphaElem","alphaCursorElem","hsva","skipHueUpdate","skipSatLevelUpdate","skipAlphaUpdate","convertInternalToHex","convertHexToInternal","innerHTML","handleSatLevelChange","handleHueChange","handleAlphaChange","lum","display","PopDownController","valuesView","bottom","setKnobColor","bgCssColor","addTop","addBottom","ColorChooser","___setKnobHelper","setKnobHelper","hex6Or8","hex","prepName","camelCaseToSnakeCase","replaceAll","GUIFolder","args","arg1","createController","addCanvas","addColor","addDivider","addFolder","addLabel","addButton","o","MuiguiElement","HTMLElement","shadow","attachShadow","mode","customElements","define","baseStyleSheet","CSSStyleSheet","userStyleSheet","makeStyleSheetUpdater","styleSheet","newCss","newCssPromise","updateStyle","then","updateBaseStyle","updateUserStyle","getTheme","cssStr","GUI","static","localStyleSheet","autoPlace","muiguiElement","shadowRoot","adoptedStyleSheets","replaceSync","setStyle","setTheme","setBaseStyles","keyDirections","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","addKeyboardEvents","keyDown","mult","shiftKey","assert","truthy","msg","getEllipsePointForAngle","cx","cy","rx","ry","phi","theta","cos","sin","arc","end","x1","y1","x2","y2","fa","fs","dTheta","getEndpointParameters","twoPiMod","DirectionView","arrowElem","rangeElem","lastV","wrap","dirMin","dirMax","tempV","handleTouch","atan2","center","angle","transform","Direction","RadioGridView","cols","that","previousElementSibling","click","gridTemplateColumns","RadioGrid","onResize","callback","ResizeObserver","observe","onResizeSVGNoScale","hAnchor","vAnchor","createSVGTicks","SliderView","svgElem","originElem","ticksElem","thicksElem","numbersElem","leftGradElem","rightGradElem","minusSize","unit","unitSize","ticksPerUnit","labelFn","tickHeight","limits","thicksColor","orientation","startV","oldHTML","getComputedTextLength","computeSizeOfMinus","updateSlider","unitsAcross","ceil","centerUnitSpace","startUnitSpace","minUnitSpace","maxUnitSpace","stroke","texts","digits","log10","createSVGNumbers","Slider","Vec2View","onTouch","updateDisplayImpl","Vec2","makeSetter","darkColors","main","lightColors","darkMatcher","window","matchMedia","isDarkMode","update","matches","helpers","graph","data","interval","ctx","getContext","setInterval","clearRect","beginPath","range","lineTo","strokeStyle","monitor","label","stringify"],"mappings":"AAAA,IAAeA,EAAA,CACbC,QAAS,kuhBAytBXC,OAAQ,CACND,QAAS,CACPE,QAAS,CAAC,WACVH,IAAK,UAGPI,MAAO,CACLD,QAAS,CAAC,WACVH,IAAK,+xCA0DPK,KAAM,CACJF,QAAS,GACTH,IAAK,28BA6CPM,KAAM,CACJH,QAAS,GACTH,IAAK,MCxzBF,SAASO,EAAWC,EAAKC,EAAQ,CAAA,EAAIC,EAAW,IACrD,MAAMC,EAAOC,SAASC,cAAcL,GAEpC,OAxBK,SAAsBG,EAAMF,EAAOC,GACxC,IAAK,MAAOI,EAAKC,KAAUC,OAAOC,QAAQR,GACxC,GAAqB,mBAAVM,GAAwBD,EAAII,WAAW,MAAO,CACvD,MAAMC,EAAYL,EAAIM,UAAU,GAAGC,cACnCV,EAAKW,iBAAiBH,EAAWJ,EAAO,CAACQ,SAAS,GACxD,MAAW,GAAqB,iBAAVR,EAChB,IAAK,MAAOS,EAAGC,KAAMT,OAAOC,QAAQF,GAClCJ,EAAKG,GAAKU,GAAKC,YAEMC,IAAdf,EAAKG,GACdH,EAAKgB,aAAab,EAAKC,GAEvB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OE,GAC3BqN,EAAII,YACJ,MAAMC,EAAQ7kB,EAAMD,EACpB,IAAK,IAAIsH,EAAI,EAAGA,EAAIid,EAAKld,SAAUC,EAAG,CACpC,MAAMqP,EAAIrP,EAAI4P,EAAQqN,EAAKld,OACrByP,GAAKyN,EAAKjd,GAAKtH,GAAOoX,EAAS0N,EACrCL,EAAIM,OAAOpO,EAAGG,EACf,CACD2N,EAAIO,YAAcre,GAASJ,GAAOsd,KAClCY,EAAIxB,QACL,GACmBuB,EACtB,ECzBES,QChBK,SAAiBC,EAAOxf,EAAQC,GAAU6e,SAACA,EAAW,KAAO,IAClEG,aAAY,KACVO,EAAMlR,KAAKK,KAAK8Q,UAAUzf,EAAOC,GAAW,KAAM,GAAG,GACpD6e,EACL"} \ No newline at end of file diff --git a/examples/js/long-hide.js b/examples/js/long-hide.js new file mode 100644 index 0000000..0651864 --- /dev/null +++ b/examples/js/long-hide.js @@ -0,0 +1,40 @@ +import GUI from '../../dist/0.x/muigui.module.js'; +//import {GUI} from '../../src/muigui.js'; + +const gui = new GUI(); + +function addFolder(gui, name) { + const f = gui.addFolder(name); + for (let i = 0; i < 50; ++i) { + f.addButton(i.toString(), () => {}); + } +} + +const degToRad = deg => deg * Math.PI / 180; + +const settings = { + translation: new Float32Array([0, 0, 0]), + rotation: new Float32Array([0, 0, 0]), + scale: new Float32Array([1, 1, 1]), + baseRotation: degToRad(-45), +}; + +const radToDegOptions = { min: -180, max: 180, step: 1, converters: GUI.converters.radToDeg }; +const cameraRadToDegOptions = { min: -180, max: 180, step: 1, converters: GUI.converters.radToDeg }; + +gui.add(settings, 'baseRotation', cameraRadToDegOptions); +/*const nodeLabel =*/ gui.addLabel('node:'); +const trsFolder = gui.addFolder('orientation'); +trsFolder.add(settings.translation, '0', -50, 50, 1).name('translation x'); +trsFolder.add(settings.translation, '1', -50, 50, 1).name('translation y'); +trsFolder.add(settings.translation, '2', -50, 50, 1).name('translation z'); +trsFolder.add(settings.rotation, '0', radToDegOptions).name('rotation x'); +trsFolder.add(settings.rotation, '1', radToDegOptions).name('rotation y'); +trsFolder.add(settings.rotation, '2', radToDegOptions).name('rotation z'); +trsFolder.add(settings.scale, '0', 0.001, 2).name('scale x'); +trsFolder.add(settings.scale, '1', 0.001, 2).name('scale y'); +trsFolder.add(settings.scale, '2', 0.001, 2).name('scale z'); + +addFolder(gui, 'one'); +addFolder(gui, 'two'); +addFolder(gui, 'three'); diff --git a/examples/js/lots.js b/examples/js/lots.js index 4592881..bea3566 100644 --- a/examples/js/lots.js +++ b/examples/js/lots.js @@ -154,70 +154,78 @@ if (showUI) { gui.disable(); } - const f = gui.addFolder('Submenu'); - const c = f.addCanvas('signal'); - f.add(s, 'period1', {min: 0.1, max: 4}); - f.add(s, 'period2', {min: 0.1, max: 4}); - f.add(s, 'name').listen(); - f.add(s, 'hobby').onFinishChange(e => log(new Date(), e.value)); - f.add(s, 'propertyWithLongName', ['longNamedEnumThatWillPushSizeTooFar']); - f.addController(new Direction(s, 'direction')).listen(); - f.addController(new Direction(s, 'hour', { - step: 360 / 12, conversion: { - to: v => { - const newV = (v - 3) * 360 / 12; - console.log('to:', v, newV); - return newV; + { + const f = gui.addFolder('Submenu'); + const c = f.addCanvas('signal'); + f.add(s, 'period1', {min: 0.1, max: 4}); + f.add(s, 'period2', {min: 0.1, max: 4}); + f.add(s, 'name').listen(); + f.add(s, 'hobby').onFinishChange(e => log(new Date(), e.value)); + f.add(s, 'propertyWithLongName', ['longNamedEnumThatWillPushSizeTooFar']); + f.addController(new Direction(s, 'direction')).listen(); + f.addController(new Direction(s, 'hour', { + step: 360 / 12, conversion: { + to: v => { + const newV = (v - 3) * 360 / 12; + console.log('to:', v, newV); + return newV; + }, + from: v => { + const newV = v * 12 / 360 + 3; + console.log('from:', v, newV); + return [true, newV]; + }, }, - from: v => { - const newV = v * 12 / 360 + 3; - console.log('from:', v, newV); - return [true, newV]; - }, - }, - })).listen(); - f.addController(new Vec2(s, 'vec', {range: 100})).listen(); - f.addController(new ColorChooser(s, 'c2'));//.listen(); - - const ctx = c.canvas.getContext('2d'); - let lastY = 0; - let lTime1 = 0; - let lTime2 = 0; - let then = 0; - // eslint-disable-next-line no-loop-func - const draw = (now) => { - const elapsedTime = now - then; - then = now; - lTime1 += elapsedTime * s.period1; - lTime2 += elapsedTime * s.period2; - const res = 2; - resizeCanvasToDisplaySize(ctx.canvas, res); - - const width = ctx.canvas.width; - const height = ctx.canvas.height; - if (width && height) { - ctx.save(); - ctx.globalCompositeOperation = 'copy'; - ctx.drawImage( - ctx.canvas, - res, 0, width - res, height, - 0, 0, width - res, height); - ctx.clearRect(width - res, 0, res, height); - ctx.globalCompositeOperation = 'source-over'; - ctx.strokeStyle = uiCSSColorVariableNames.color; - const s1 = Math.sin(lTime1 * 0.01); - const s2 = Math.sin(lTime2 * 0.01); - const newY = height / 2 + (s1 + s2) * (height - 1) / 4; - ctx.beginPath(); - ctx.lineTo(width - res * 2, lastY); - ctx.lineTo(width - 1, newY); - ctx.stroke(); - lastY = newY; - } + })).listen(); + f.addController(new Vec2(s, 'vec', {range: 100})).listen(); + f.addController(new ColorChooser(s, 'c2'));//.listen(); + + const ctx = c.canvas.getContext('2d'); + let lastY = 0; + let lTime1 = 0; + let lTime2 = 0; + let then = 0; + // eslint-disable-next-line no-loop-func + const draw = (now) => { + const elapsedTime = now - then; + then = now; + lTime1 += elapsedTime * s.period1; + lTime2 += elapsedTime * s.period2; + const res = 2; + resizeCanvasToDisplaySize(ctx.canvas, res); + + const width = ctx.canvas.width; + const height = ctx.canvas.height; + if (width && height) { + ctx.save(); + ctx.globalCompositeOperation = 'copy'; + ctx.drawImage( + ctx.canvas, + res, 0, width - res, height, + 0, 0, width - res, height); + ctx.clearRect(width - res, 0, res, height); + ctx.globalCompositeOperation = 'source-over'; + ctx.strokeStyle = uiCSSColorVariableNames.color; + const s1 = Math.sin(lTime1 * 0.01); + const s2 = Math.sin(lTime2 * 0.01); + const newY = height / 2 + (s1 + s2) * (height - 1) / 4; + ctx.beginPath(); + ctx.lineTo(width - res * 2, lastY); + ctx.lineTo(width - 1, newY); + ctx.stroke(); + lastY = newY; + } + requestAnimationFrame(draw); + }; requestAnimationFrame(draw); - }; - requestAnimationFrame(draw); + } + + { + const f = gui.addFolder('Folder with a long long long long long long long name'); + f.addButton('button with a long long long long long long long name', () => {}); + } } + } // Using Sliders diff --git a/examples/long-hide.html b/examples/long-hide.html new file mode 100644 index 0000000..c103a03 --- /dev/null +++ b/examples/long-hide.html @@ -0,0 +1,18 @@ + + + + + + muigui + + + +

muigui

+
+ + + \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index e129ff0..9bbaea5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "muigui", - "version": "0.0.17", + "version": "0.0.20", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "muigui", - "version": "0.0.17", + "version": "0.0.20", "license": "MIT", "devDependencies": { "@rollup/plugin-node-resolve": "^15.0.1", @@ -21,9 +21,9 @@ "eslint-plugin-one-variable-per-var": "^0.0.3", "eslint-plugin-optional-comma-spacing": "0.0.4", "eslint-plugin-require-trailing-comma": "0.0.1", - "puppeteer": "^21.5.2", + "puppeteer": "^23.10.4", "rollup": "^3.20.2", - "servez": "^2.1.2", + "servez": "^2.2.4", "tslib": "^2.6.2", "typescript": "5.2" } @@ -38,141 +38,28 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.23.4", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.23.4.tgz", - "integrity": "sha512-r1IONyb6Ia+jYR2vvIDhdWdlTGhqbBoFqLTQidzZ4kepUFH15ejXvFHxCVbtl7BOXIudsIubf4E81xeA3h3IXA==", + "version": "7.26.2", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", + "integrity": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==", "dev": true, "dependencies": { - "@babel/highlight": "^7.23.4", - "chalk": "^2.4.2" + "@babel/helper-validator-identifier": "^7.25.9", + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" }, "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/code-frame/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/code-frame/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/code-frame/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/@babel/code-frame/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "node_modules/@babel/code-frame/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", - "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", + "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", "dev": true, "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/highlight": { - "version": "7.23.4", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.23.4.tgz", - "integrity": "sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==", - "dev": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.22.20", - "chalk": "^2.4.2", - "js-tokens": "^4.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/highlight/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/@babel/highlight/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "node_modules/@babel/highlight/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", @@ -356,24 +243,25 @@ } }, "node_modules/@puppeteer/browsers": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-1.8.0.tgz", - "integrity": "sha512-TkRHIV6k2D8OlUe8RtG+5jgOF/H98Myx0M6AOafC8DdNVOFiBSFa5cpRDtpm8LXOa9sVwe0+e6Q3FC56X/DZfg==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-2.6.1.tgz", + "integrity": "sha512-aBSREisdsGH890S2rQqK82qmQYU3uFpSH8wcZWHgHzl3LfzsxAKbLNiAG9mO8v1Y0UICBeClICxPJvyr0rcuxg==", "dev": true, "dependencies": { - "debug": "4.3.4", - "extract-zip": "2.0.1", - "progress": "2.0.3", - "proxy-agent": "6.3.1", - "tar-fs": "3.0.4", - "unbzip2-stream": "1.4.3", - "yargs": "17.7.2" + "debug": "^4.4.0", + "extract-zip": "^2.0.1", + "progress": "^2.0.3", + "proxy-agent": "^6.5.0", + "semver": "^7.6.3", + "tar-fs": "^3.0.6", + "unbzip2-stream": "^1.4.3", + "yargs": "^17.7.2" }, "bin": { "browsers": "lib/cjs/main-cli.js" }, "engines": { - "node": ">=16.3.0" + "node": ">=18" } }, "node_modules/@rollup/plugin-node-resolve": { @@ -508,18 +396,18 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.9.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.9.5.tgz", - "integrity": "sha512-Uq2xbNq0chGg+/WQEU0LJTSs/1nKxz6u1iemLcGomkSnKokbW1fbLqc3HOqCf2JP7KjlL4QkS7oZZTrOQHQYgQ==", + "version": "22.10.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.2.tgz", + "integrity": "sha512-Xxr6BBRCAOQixvonOye19wnzyDiUtTeqldOOmj3CkeblonbccA12PFwlufvRdrpjXxqnmUaeiU5EOA+7s5diUQ==", "dev": true, "dependencies": { - "undici-types": "~5.26.4" + "undici-types": "~6.20.0" } }, "node_modules/@types/node-forge": { - "version": "1.3.10", - "resolved": "https://registry.npmjs.org/@types/node-forge/-/node-forge-1.3.10.tgz", - "integrity": "sha512-y6PJDYN4xYBxwd22l+OVH35N+1fCYWiuC3aiP2SlXVE6Lo7SS+rSx9r89hLxrP4pn6n1lBGhHJ12pj3F3Mpttw==", + "version": "1.3.11", + "resolved": "https://registry.npmjs.org/@types/node-forge/-/node-forge-1.3.11.tgz", + "integrity": "sha512-FQx220y22OKNTqaByeBGqHWYz4cl94tpcxeFdvBo3wjG6XPBuZ0BNgNZRV5J5TFmmcsJ4IzsLkmGRiQbnYsBEQ==", "dev": true, "dependencies": { "@types/node": "*" @@ -771,13 +659,10 @@ } }, "node_modules/agent-base": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz", - "integrity": "sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==", + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.3.tgz", + "integrity": "sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw==", "dev": true, - "dependencies": { - "debug": "^4.3.4" - }, "engines": { "node": ">= 14" } @@ -878,9 +763,9 @@ } }, "node_modules/b4a": { - "version": "1.6.4", - "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.4.tgz", - "integrity": "sha512-fpWrvyVHEKyeEvbKZTVOeZF3VSKKWtJxFIxX/jaVPf+cLbGUSitjb49pHLqPV2BUNNZ0LcoeEGfE/YCpyDYHIw==", + "version": "1.6.7", + "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.7.tgz", + "integrity": "sha512-OnAYlL5b7LEkALw87fUVafQw5rVR9RjwGd4KUwNQ6DrrNmaVaUCgLipfVlzrPQ4tWOR9P0IXGNOx50jYCCdSJg==", "dev": true }, "node_modules/balanced-match": { @@ -889,6 +774,52 @@ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true }, + "node_modules/bare-events": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.5.0.tgz", + "integrity": "sha512-/E8dDe9dsbLyh2qrZ64PEPadOQ0F4gbl1sUJOrmph7xOiIxfY8vwab/4bFLh4Y88/Hk/ujKcrQKc+ps0mv873A==", + "dev": true, + "optional": true + }, + "node_modules/bare-fs": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/bare-fs/-/bare-fs-2.3.5.tgz", + "integrity": "sha512-SlE9eTxifPDJrT6YgemQ1WGFleevzwY+XAP1Xqgl56HtcrisC2CHCZ2tq6dBpcH2TnNxwUEUGhweo+lrQtYuiw==", + "dev": true, + "optional": true, + "dependencies": { + "bare-events": "^2.0.0", + "bare-path": "^2.0.0", + "bare-stream": "^2.0.0" + } + }, + "node_modules/bare-os": { + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/bare-os/-/bare-os-2.4.4.tgz", + "integrity": "sha512-z3UiI2yi1mK0sXeRdc4O1Kk8aOa/e+FNWZcTiPB/dfTWyLypuE99LibgRaQki914Jq//yAWylcAt+mknKdixRQ==", + "dev": true, + "optional": true + }, + "node_modules/bare-path": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/bare-path/-/bare-path-2.1.3.tgz", + "integrity": "sha512-lh/eITfU8hrj9Ru5quUp0Io1kJWIk1bTjzo7JH1P5dWmQ2EL4hFUlfI8FonAhSlgIfhn63p84CDY/x+PisgcXA==", + "dev": true, + "optional": true, + "dependencies": { + "bare-os": "^2.1.0" + } + }, + "node_modules/bare-stream": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/bare-stream/-/bare-stream-2.6.1.tgz", + "integrity": "sha512-eVZbtKM+4uehzrsj49KtCy3Pbg7kO1pJ3SKZ1SFrIH/0pnj9scuGGgUlNDf/7qS8WKtGdiJY5Kyhs/ivYPTB/g==", + "dev": true, + "optional": true, + "dependencies": { + "streamx": "^2.21.0" + } + }, "node_modules/base64-js": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", @@ -922,9 +853,9 @@ } }, "node_modules/basic-ftp": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-5.0.3.tgz", - "integrity": "sha512-QHX8HLlncOLpy54mh+k/sWIFd0ThmRqwe9ZjELybGZK+tZ8rUb9VO0saKJUROTbE+KhzDUT7xziGpGrW8Kmd+g==", + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-5.0.5.tgz", + "integrity": "sha512-4Bcg1P8xhUuqcii/S0Z9wiHIrQVPMermM1any+MX5GeGD7faD3/msQUDGLol9wOcz4/jbg/WJnGqoJF6LiBdtg==", "dev": true, "engines": { "node": ">=10.0.0" @@ -946,21 +877,21 @@ } }, "node_modules/body-parser": { - "version": "1.20.1", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", - "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", + "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", "dev": true, "dependencies": { "bytes": "3.1.2", - "content-type": "~1.0.4", + "content-type": "~1.0.5", "debug": "2.6.9", "depd": "2.0.0", "destroy": "1.2.0", "http-errors": "2.0.0", "iconv-lite": "0.4.24", "on-finished": "2.4.1", - "qs": "6.11.0", - "raw-body": "2.5.1", + "qs": "6.13.0", + "raw-body": "2.5.2", "type-is": "~1.6.18", "unpipe": "1.0.0" }, @@ -1067,14 +998,47 @@ } }, "node_modules/call-bind": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.5.tgz", - "integrity": "sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", + "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", "dev": true, "dependencies": { - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.1", - "set-function-length": "^1.1.1" + "call-bind-apply-helpers": "^1.0.0", + "es-define-property": "^1.0.0", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz", + "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.2.tgz", + "integrity": "sha512-0lk0PHFe/uz0vl527fG9CgdE9WdafjDbCXvBbs+LUv000TVt2Jjhqbs4Jwm8gz070w8xXyEAxrPOMullsxXeGg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.8", + "get-intrinsic": "^1.2.5" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -1166,13 +1130,14 @@ } }, "node_modules/chromium-bidi": { - "version": "0.4.33", - "resolved": "https://registry.npmjs.org/chromium-bidi/-/chromium-bidi-0.4.33.tgz", - "integrity": "sha512-IxoFM5WGQOIAd95qrSXzJUv4eXIrh+RvU3rwwqIiwYuvfE7U/Llj4fejbsJnjJMUYCuGtVQsY2gv7oGl4aTNSQ==", + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/chromium-bidi/-/chromium-bidi-0.8.0.tgz", + "integrity": "sha512-uJydbGdTw0DEUjhoogGveneJVWX/9YuqkWePzMmkBYwtdAqo5d3J/ovNKFr+/2hWXYmYCr6it8mSSTIj6SS6Ug==", "dev": true, "dependencies": { "mitt": "3.0.1", - "urlpattern-polyfill": "9.0.0" + "urlpattern-polyfill": "10.0.0", + "zod": "3.23.8" }, "peerDependencies": { "devtools-protocol": "*" @@ -1273,9 +1238,9 @@ } }, "node_modules/cookie": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", - "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", + "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==", "dev": true, "engines": { "node": ">= 0.6" @@ -1301,15 +1266,15 @@ } }, "node_modules/cosmiconfig": { - "version": "8.3.6", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.3.6.tgz", - "integrity": "sha512-kcZ6+W5QzcJ3P1Mt+83OUv/oHFqZHIx8DuxG6eZ5RGMERoLqp4BuGjhHLYGK+Kf5XVkQvqBSmAy/nGWN3qDgEA==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-9.0.0.tgz", + "integrity": "sha512-itvL5h8RETACmOTFc4UfIyB2RfEHi71Ax6E/PivVxq9NseKbOWpeyHEOIbmAw1rs8Ak0VursQNww7lf7YtUwzg==", "dev": true, "dependencies": { + "env-paths": "^2.2.1", "import-fresh": "^3.3.0", "js-yaml": "^4.1.0", - "parse-json": "^5.2.0", - "path-type": "^4.0.0" + "parse-json": "^5.2.0" }, "engines": { "node": ">=14" @@ -1326,15 +1291,6 @@ } } }, - "node_modules/cross-fetch": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz", - "integrity": "sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==", - "dev": true, - "dependencies": { - "node-fetch": "^2.6.12" - } - }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -1350,21 +1306,21 @@ } }, "node_modules/data-uri-to-buffer": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-6.0.1.tgz", - "integrity": "sha512-MZd3VlchQkp8rdend6vrx7MmVDJzSNTBvghvKjirLkD+WTChA3KUf0jkE68Q4UyctNqI11zZO9/x2Yx+ub5Cvg==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-6.0.2.tgz", + "integrity": "sha512-7hvf7/GW8e86rW0ptuwS3OcBGDjIi6SZva7hCyWC0yYry2cOPmLIjXAUHI6DK2HsnwJd9ifmt57i8eV2n4YNpw==", "dev": true, "engines": { "node": ">= 14" } }, "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, "dependencies": { - "ms": "2.1.2" + "ms": "^2.1.3" }, "engines": { "node": ">=6.0" @@ -1391,17 +1347,20 @@ } }, "node_modules/define-data-property": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.1.tgz", - "integrity": "sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", "dev": true, "dependencies": { - "get-intrinsic": "^1.2.1", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.0" + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/degenerator": { @@ -1438,9 +1397,9 @@ } }, "node_modules/devtools-protocol": { - "version": "0.0.1203626", - "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1203626.tgz", - "integrity": "sha512-nEzHZteIUZfGCZtTiS1fRpC8UZmsfD1SiyPvaUNvS13dvKf666OAm8YTi0+Ca3n1nLEyu49Cy4+dPWpaHFJk9g==", + "version": "0.0.1367902", + "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1367902.tgz", + "integrity": "sha512-XxtPuC3PGakY6PD7dG66/o8KwJ/LkH2/EKe19Dcw58w53dv4/vSQEkn/SzuyhHE2q4zPgCkxQBxus3VV4ql+Pg==", "dev": true }, "node_modules/dir-glob": { @@ -1522,6 +1481,20 @@ "url": "https://github.com/fb55/domutils?sponsor=1" } }, + "node_modules/dunder-proto": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.0.tgz", + "integrity": "sha512-9+Sj30DIu+4KvHqMfLUGLFYL2PkURSYMVXJyXe92nFRvlYq5hBjLEhblKB+vkd/WVlUYMWigiY07T91Fkk0+4A==", + "dev": true, + "dependencies": { + "call-bind-apply-helpers": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", @@ -1535,9 +1508,9 @@ "dev": true }, "node_modules/encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", "dev": true, "engines": { "node": ">= 0.8" @@ -1564,6 +1537,15 @@ "url": "https://github.com/fb55/entities?sponsor=1" } }, + "node_modules/env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", @@ -1573,10 +1555,40 @@ "is-arrayish": "^0.2.1" } }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", + "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", "dev": true, "engines": { "node": ">=6" @@ -1822,37 +1834,37 @@ } }, "node_modules/express": { - "version": "4.18.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", - "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz", + "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==", "dev": true, "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.20.1", + "body-parser": "1.20.3", "content-disposition": "0.5.4", "content-type": "~1.0.4", - "cookie": "0.5.0", + "cookie": "0.7.1", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "2.0.0", - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "etag": "~1.8.1", - "finalhandler": "1.2.0", + "finalhandler": "1.3.1", "fresh": "0.5.2", "http-errors": "2.0.0", - "merge-descriptors": "1.0.1", + "merge-descriptors": "1.0.3", "methods": "~1.1.2", "on-finished": "2.4.1", "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", + "path-to-regexp": "0.1.12", "proxy-addr": "~2.0.7", - "qs": "6.11.0", + "qs": "6.13.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", - "send": "0.18.0", - "serve-static": "1.15.0", + "send": "0.19.0", + "serve-static": "1.16.2", "setprototypeof": "1.2.0", "statuses": "2.0.1", "type-is": "~1.6.18", @@ -1861,6 +1873,10 @@ }, "engines": { "node": ">= 0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" } }, "node_modules/express/node_modules/debug": { @@ -2013,13 +2029,13 @@ } }, "node_modules/finalhandler": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", - "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", + "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", "dev": true, "dependencies": { "debug": "2.6.9", - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "on-finished": "2.4.1", "parseurl": "~1.3.3", @@ -2098,20 +2114,6 @@ "node": ">= 0.6" } }, - "node_modules/fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "dev": true, - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - }, - "engines": { - "node": ">=6 <7 || >=8" - } - }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -2151,15 +2153,24 @@ } }, "node_modules/get-intrinsic": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.2.tgz", - "integrity": "sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA==", + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.6.tgz", + "integrity": "sha512-qxsEs+9A+u85HhllWJJFicJfPDhRmjzoYdl64aMWW9yRIJmSyxdn8IEkuIM530/7T+lv0TIHd8L6Q/ra0tEoeA==", "dev": true, "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "dunder-proto": "^1.0.0", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", "function-bind": "^1.1.2", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "hasown": "^2.0.0" + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -2181,15 +2192,14 @@ } }, "node_modules/get-uri": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/get-uri/-/get-uri-6.0.2.tgz", - "integrity": "sha512-5KLucCJobh8vBY1K07EFV4+cPZH3mrV9YeAruUseCQKHB58SGjjT2l9/eA9LD082IiuMjSlFJEcdJ27TXvbZNw==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/get-uri/-/get-uri-6.0.4.tgz", + "integrity": "sha512-E1b1lFFLvLgak2whF2xDBcOy6NLVGZBqqjJjsIhvopKfWWEi64pLVTWWehV8KlLerZkfNTA95sTe2OdJKm1OzQ==", "dev": true, "dependencies": { "basic-ftp": "^5.0.2", - "data-uri-to-buffer": "^6.0.0", - "debug": "^4.3.4", - "fs-extra": "^8.1.0" + "data-uri-to-buffer": "^6.0.2", + "debug": "^4.3.4" }, "engines": { "node": ">= 14" @@ -2263,23 +2273,17 @@ } }, "node_modules/gopd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", "dev": true, - "dependencies": { - "get-intrinsic": "^1.1.3" + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/graceful-fs": { - "version": "4.2.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "dev": true - }, "node_modules/graphemer": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", @@ -2298,43 +2302,22 @@ "node": ">= 0.4.0" } }, - "node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/has-property-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.1.tgz", - "integrity": "sha512-VsX8eaIewvas0xnvinAe9bw4WfIeODpGYikiWYLH+dma0Jw6KHYqWiWfhQlgOVK8D6PvjubK5Uc4P0iIhIcNVg==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", "dev": true, "dependencies": { - "get-intrinsic": "^1.2.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", - "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", - "dev": true, - "engines": { - "node": ">= 0.4" + "es-define-property": "^1.0.0" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", "dev": true, "engines": { "node": ">= 0.4" @@ -2344,9 +2327,9 @@ } }, "node_modules/hasown": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", - "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", "dev": true, "dependencies": { "function-bind": "^1.1.2" @@ -2391,9 +2374,9 @@ } }, "node_modules/http-proxy-agent": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.0.tgz", - "integrity": "sha512-+ZT+iBxVUQ1asugqnD6oWoRiS25AkjNfG085dKJGtGxkdwLQrMKU5wJr2bOOFAXzKcTuqq+7fZlTMgG3SRfIYQ==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", "dev": true, "dependencies": { "agent-base": "^7.1.0", @@ -2404,12 +2387,12 @@ } }, "node_modules/https-proxy-agent": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.2.tgz", - "integrity": "sha512-NmLNjm6ucYwtcUmL7JQC1ZQ57LmHP4lT15FQ8D61nak1rO6DH+fz5qNK2Ap5UN4ZapYICE3/0KodcLYSPsPbaA==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", "dev": true, "dependencies": { - "agent-base": "^7.0.2", + "agent-base": "^7.1.2", "debug": "4" }, "engines": { @@ -2498,11 +2481,18 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, - "node_modules/ip": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.8.tgz", - "integrity": "sha512-PuExPYUiu6qMBQb4l06ecm6T6ujzhmh+MeJcW9wa89PoAz5pvd4zPgN5WJV104mb6S2T1AwNIAaB70JNrLQWhg==", - "dev": true + "node_modules/ip-address": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz", + "integrity": "sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==", + "dev": true, + "dependencies": { + "jsbn": "1.1.0", + "sprintf-js": "^1.1.3" + }, + "engines": { + "node": ">= 12" + } }, "node_modules/ipaddr.js": { "version": "1.9.1", @@ -2636,6 +2626,12 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/jsbn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz", + "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==", + "dev": true + }, "node_modules/json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", @@ -2654,15 +2650,6 @@ "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", "dev": true }, - "node_modules/jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", - "dev": true, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, "node_modules/levn": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", @@ -2712,6 +2699,15 @@ "node": ">=12" } }, + "node_modules/math-intrinsics": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.0.0.tgz", + "integrity": "sha512-4MqMiKP90ybymYvsut0CH2g4XWbfLtmlCkXmtmdcDCxNB+mQcu1w/1+L/VD7vi/PSv7X2JYV7SCcR+jiPXnQtA==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -2722,10 +2718,13 @@ } }, "node_modules/merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==", - "dev": true + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, "node_modules/merge2": { "version": "1.4.1", @@ -2809,16 +2808,10 @@ "integrity": "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==", "dev": true }, - "node_modules/mkdirp-classic": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", - "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==", - "dev": true - }, "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, "node_modules/natural-compare": { @@ -2845,26 +2838,6 @@ "node": ">= 0.4.0" } }, - "node_modules/node-fetch": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", - "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", - "dev": true, - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, "node_modules/node-forge": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz", @@ -2893,10 +2866,13 @@ } }, "node_modules/object-inspect": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", - "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", + "version": "1.13.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.3.tgz", + "integrity": "sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==", "dev": true, + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -2970,32 +2946,31 @@ } }, "node_modules/pac-proxy-agent": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-7.0.1.tgz", - "integrity": "sha512-ASV8yU4LLKBAjqIPMbrgtaKIvxQri/yh2OpI+S6hVa9JRkUI3Y3NPFbfngDtY7oFtSMD3w31Xns89mDa3Feo5A==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-7.1.0.tgz", + "integrity": "sha512-Z5FnLVVZSnX7WjBg0mhDtydeRZ1xMcATZThjySQUHqr+0ksP8kqaw23fNKkaaN/Z8gwLUs/W7xdl0I75eP2Xyw==", "dev": true, "dependencies": { "@tootallnate/quickjs-emscripten": "^0.23.0", - "agent-base": "^7.0.2", + "agent-base": "^7.1.2", "debug": "^4.3.4", "get-uri": "^6.0.1", "http-proxy-agent": "^7.0.0", - "https-proxy-agent": "^7.0.2", - "pac-resolver": "^7.0.0", - "socks-proxy-agent": "^8.0.2" + "https-proxy-agent": "^7.0.6", + "pac-resolver": "^7.0.1", + "socks-proxy-agent": "^8.0.5" }, "engines": { "node": ">= 14" } }, "node_modules/pac-resolver": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/pac-resolver/-/pac-resolver-7.0.0.tgz", - "integrity": "sha512-Fd9lT9vJbHYRACT8OhCbZBbxr6KRSawSovFpy8nDGshaK99S/EBhVIHp9+crhxrsZOuvLpgL1n23iyPg6Rl2hg==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/pac-resolver/-/pac-resolver-7.0.1.tgz", + "integrity": "sha512-5NPgf87AT2STgwa2ntRMr45jTKrYBGkVU36yT0ig/n/GMAa3oPqhZfIQ2kMEimReg0+t9kZViDVZ83qfVUlckg==", "dev": true, "dependencies": { "degenerator": "^5.0.0", - "ip": "^1.1.8", "netmask": "^2.0.2" }, "engines": { @@ -3075,9 +3050,9 @@ "dev": true }, "node_modules/path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==", + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", + "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==", "dev": true }, "node_modules/path-type": { @@ -3095,6 +3070,12 @@ "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==", "dev": true }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true + }, "node_modules/picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", @@ -3139,19 +3120,19 @@ } }, "node_modules/proxy-agent": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-6.3.1.tgz", - "integrity": "sha512-Rb5RVBy1iyqOtNl15Cw/llpeLH8bsb37gM1FUfKQ+Wck6xHlbAhWGUFiTRHtkjqGTA5pSHz6+0hrPW/oECihPQ==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-6.5.0.tgz", + "integrity": "sha512-TmatMXdr2KlRiA2CyDu8GqR8EjahTG3aY3nXjdzFyoZbmB8hrBsTyMezhULIXKnC0jpfjlmiZ3+EaCzoInSu/A==", "dev": true, "dependencies": { - "agent-base": "^7.0.2", + "agent-base": "^7.1.2", "debug": "^4.3.4", - "http-proxy-agent": "^7.0.0", - "https-proxy-agent": "^7.0.2", + "http-proxy-agent": "^7.0.1", + "https-proxy-agent": "^7.0.6", "lru-cache": "^7.14.1", - "pac-proxy-agent": "^7.0.1", + "pac-proxy-agent": "^7.1.0", "proxy-from-env": "^1.1.0", - "socks-proxy-agent": "^8.0.2" + "socks-proxy-agent": "^8.0.5" }, "engines": { "node": ">= 14" @@ -3164,9 +3145,9 @@ "dev": true }, "node_modules/pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.2.tgz", + "integrity": "sha512-tUPXtzlGM8FE3P0ZL6DVs/3P58k9nk8/jZeQCurTJylQA8qFYzHFfhBJkuqyE0FifOsQ0uKWekiZ5g8wtr28cw==", "dev": true, "dependencies": { "end-of-stream": "^1.1.0", @@ -3183,44 +3164,50 @@ } }, "node_modules/puppeteer": { - "version": "21.5.2", - "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-21.5.2.tgz", - "integrity": "sha512-BaAGJOq8Fl6/cck6obmwaNLksuY0Bg/lIahCLhJPGXBFUD2mCffypa4A592MaWnDcye7eaHmSK9yot0pxctY8A==", + "version": "23.10.4", + "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-23.10.4.tgz", + "integrity": "sha512-i0sYIAIjdO9MoRfFqbkoWFnQYZVmNp8msbztTgG46KbOdoYAv4f56MFzdFwtC0lyZHtkP+yl0H7tP0dNg3RQYA==", "dev": true, "hasInstallScript": true, "dependencies": { - "@puppeteer/browsers": "1.8.0", - "cosmiconfig": "8.3.6", - "puppeteer-core": "21.5.2" + "@puppeteer/browsers": "2.6.1", + "chromium-bidi": "0.8.0", + "cosmiconfig": "^9.0.0", + "devtools-protocol": "0.0.1367902", + "puppeteer-core": "23.10.4", + "typed-query-selector": "^2.12.0" + }, + "bin": { + "puppeteer": "lib/cjs/puppeteer/node/cli.js" }, "engines": { - "node": ">=16.13.2" + "node": ">=18" } }, "node_modules/puppeteer-core": { - "version": "21.5.2", - "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-21.5.2.tgz", - "integrity": "sha512-v4T0cWnujSKs+iEfmb8ccd7u4/x8oblEyKqplqKnJ582Kw8PewYAWvkH4qUWhitN3O2q9RF7dzkvjyK5HbzjLA==", + "version": "23.10.4", + "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-23.10.4.tgz", + "integrity": "sha512-pQAY7+IFAndWDkDodsQGguW1/ifV5OMlGXJDspwtK49Asb7poJZ/V5rXJxVSpq57bWrJasjQBZ1X27z1oWVq4Q==", "dev": true, "dependencies": { - "@puppeteer/browsers": "1.8.0", - "chromium-bidi": "0.4.33", - "cross-fetch": "4.0.0", - "debug": "4.3.4", - "devtools-protocol": "0.0.1203626", - "ws": "8.14.2" + "@puppeteer/browsers": "2.6.1", + "chromium-bidi": "0.8.0", + "debug": "^4.4.0", + "devtools-protocol": "0.0.1367902", + "typed-query-selector": "^2.12.0", + "ws": "^8.18.0" }, "engines": { - "node": ">=16.13.2" + "node": ">=18" } }, "node_modules/qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", "dev": true, "dependencies": { - "side-channel": "^1.0.4" + "side-channel": "^1.0.6" }, "engines": { "node": ">=0.6" @@ -3274,9 +3261,9 @@ } }, "node_modules/raw-body": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", - "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", "dev": true, "dependencies": { "bytes": "3.1.2", @@ -3431,13 +3418,10 @@ } }, "node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, "bin": { "semver": "bin/semver.js" }, @@ -3445,22 +3429,10 @@ "node": ">=10" } }, - "node_modules/semver/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/send": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", - "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", + "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", "dev": true, "dependencies": { "debug": "2.6.9", @@ -3496,11 +3468,14 @@ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "dev": true }, - "node_modules/send/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true + "node_modules/send/node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "dev": true, + "engines": { + "node": ">= 0.8" + } }, "node_modules/serialize-javascript": { "version": "6.0.1", @@ -3590,15 +3565,15 @@ } }, "node_modules/serve-static": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", - "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", + "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", "dev": true, "dependencies": { - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "parseurl": "~1.3.3", - "send": "0.18.0" + "send": "0.19.0" }, "engines": { "node": ">= 0.8.0" @@ -3611,55 +3586,57 @@ "dev": true }, "node_modules/servez": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/servez/-/servez-2.1.2.tgz", - "integrity": "sha512-uJ/GlvogUfe52p9E5p9maEMQzycEMiz1doWkW8rke33WezHQ1P6/xPBqerOoeK9ze24Am1vJey7j/ddtySJTwg==", + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/servez/-/servez-2.2.4.tgz", + "integrity": "sha512-HcsVAEnEvDq5WH9kLQBK6SvykTRFllX052b34k5mCs/XpwTXdxYyf4+1pCJdHenLb1gGuEZzcm5HdHRdVciBHA==", "dev": true, "dependencies": { - "ansi-colors": "^4.1.1", + "ansi-colors": "^4.1.3", "color-support": "^1.1.3", - "commander": "^11.0.0", - "servez-lib": "^2.8.1" + "commander": "^12.1.0", + "servez-lib": "^2.9.5" }, "bin": { "servez": "bin/servez" } }, "node_modules/servez-lib": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/servez-lib/-/servez-lib-2.8.1.tgz", - "integrity": "sha512-Wg/hvTxBPJ0ZqlQKTDktMDEAi/V5/wXdEaj4/O6SM1ZmqwWQoHDw0Yyg7l/G91znMQOCkyEdfAFPasOpjQWbNg==", + "version": "2.9.5", + "resolved": "https://registry.npmjs.org/servez-lib/-/servez-lib-2.9.5.tgz", + "integrity": "sha512-ET3M1Vd4v6a0uz2bQBsZ/fOS8Mmx0GLWYr4cPVKA/QNKLrrBfnzHVkIR3wRxxsC8kU11jS93HTu8zOkZAp1wBw==", "dev": true, "dependencies": { "basic-auth": "^2.0.1", "cors": "^2.8.5", - "debug": "^4.3.4", - "express": "^4.18.2", + "debug": "^4.3.7", + "express": "^4.21.1", "secure-compare": "^3.0.1", - "selfsigned": "^2.1.1", + "selfsigned": "^2.4.1", "serve-index": "^1.9.1", "server-destroy": "^1.0.1" } }, "node_modules/servez/node_modules/commander": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", - "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==", + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", + "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==", "dev": true, "engines": { - "node": ">=16" + "node": ">=18" } }, "node_modules/set-function-length": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.1.1.tgz", - "integrity": "sha512-VoaqjbBJKiWtg4yRcKBQ7g7wnGnLV3M8oLvVWwOk2PdYY6PEFegR1vezXR0tw6fZGF9csVakIRjrJiy2veSBFQ==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", "dev": true, "dependencies": { - "define-data-property": "^1.1.1", - "get-intrinsic": "^1.2.1", + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.0" + "has-property-descriptors": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -3693,14 +3670,72 @@ } }, "node_modules/side-channel": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", "dev": true, "dependencies": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "dev": true, + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "dev": true, + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -3732,39 +3767,33 @@ "dev": true }, "node_modules/socks": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz", - "integrity": "sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==", + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.3.tgz", + "integrity": "sha512-l5x7VUUWbjVFbafGLxPWkYsHIhEvmF85tbIeFZWc8ZPtoMyybuEhL7Jye/ooC4/d48FgOjSJXgsF/AJPYCW8Zw==", "dev": true, "dependencies": { - "ip": "^2.0.0", + "ip-address": "^9.0.5", "smart-buffer": "^4.2.0" }, "engines": { - "node": ">= 10.13.0", + "node": ">= 10.0.0", "npm": ">= 3.0.0" } }, "node_modules/socks-proxy-agent": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.2.tgz", - "integrity": "sha512-8zuqoLv1aP/66PHF5TqwJ7Czm3Yv32urJQHrVyhD7mmA6d61Zv8cIXQYPTWwmg6qlupnPvs/QKDmfa4P/qct2g==", + "version": "8.0.5", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.5.tgz", + "integrity": "sha512-HehCEsotFqbPW9sJ8WVYB6UbmIMv7kUUORIF2Nncq4VQvBfNBLibW9YZR5dlYCSUhwcD628pRllm7n+E+YTzJw==", "dev": true, "dependencies": { - "agent-base": "^7.0.2", + "agent-base": "^7.1.2", "debug": "^4.3.4", - "socks": "^2.7.1" + "socks": "^2.8.3" }, "engines": { "node": ">= 14" } }, - "node_modules/socks/node_modules/ip": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.0.tgz", - "integrity": "sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==", - "dev": true - }, "node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -3784,6 +3813,12 @@ "source-map": "^0.6.0" } }, + "node_modules/sprintf-js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", + "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==", + "dev": true + }, "node_modules/statuses": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", @@ -3794,13 +3829,17 @@ } }, "node_modules/streamx": { - "version": "2.15.5", - "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.15.5.tgz", - "integrity": "sha512-9thPGMkKC2GctCzyCUjME3yR03x2xNo0GPKGkRw2UMYN+gqWa9uqpyNWhmsNCutU5zHmkUum0LsCRQTXUgUCAg==", + "version": "2.21.1", + "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.21.1.tgz", + "integrity": "sha512-PhP9wUnFLa+91CPy3N6tiQsK+gnYyUNuk15S3YG/zjYE7RuPeCjJngqnzpC31ow0lzBHQ+QGO4cNJnd0djYUsw==", "dev": true, "dependencies": { - "fast-fifo": "^1.1.0", - "queue-tick": "^1.0.1" + "fast-fifo": "^1.3.2", + "queue-tick": "^1.0.1", + "text-decoder": "^1.1.0" + }, + "optionalDependencies": { + "bare-events": "^2.2.0" } }, "node_modules/string-width": { @@ -3841,18 +3880,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/supports-preserve-symlinks-flag": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", @@ -3866,20 +3893,23 @@ } }, "node_modules/tar-fs": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.0.4.tgz", - "integrity": "sha512-5AFQU8b9qLfZCX9zp2duONhPmZv0hGYiBPJsyUdqMjzq/mqVpy/rEUSeHk1+YitmxugaptgBh5oDGU3VsAJq4w==", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.0.6.tgz", + "integrity": "sha512-iokBDQQkUyeXhgPYaZxmczGPhnhXZ0CmrqI+MOb/WFGS9DW5wnfrLgtjUJBvz50vQ3qfRwJ62QVoCFu8mPVu5w==", "dev": true, "dependencies": { - "mkdirp-classic": "^0.5.2", "pump": "^3.0.0", "tar-stream": "^3.1.5" + }, + "optionalDependencies": { + "bare-fs": "^2.1.1", + "bare-path": "^2.1.0" } }, "node_modules/tar-stream": { - "version": "3.1.6", - "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.6.tgz", - "integrity": "sha512-B/UyjYwPpMBv+PaFSWAmtYjwdrlEaZQEhMIBFNC5oEG8lpiW8XjcSdmEaClj28ArfKScKHs2nshz3k2le6crsg==", + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.7.tgz", + "integrity": "sha512-qJj60CXt7IU1Ffyc3NJMjh6EkuCFej46zUqJ4J7pqYlThyd9bO0XBTmcOIhSzZJVWfsLks0+nle/j538YAW9RQ==", "dev": true, "dependencies": { "b4a": "^1.6.4", @@ -3905,6 +3935,15 @@ "node": ">=10" } }, + "node_modules/text-decoder": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/text-decoder/-/text-decoder-1.2.3.tgz", + "integrity": "sha512-3/o9z3X0X0fTupwsYvR03pJ/DjWuqqrfwBgTQzdWDiQSm9KitAyz/9WqsT2JQW7KV2m+bC2ol/zqpW37NHxLaA==", + "dev": true, + "dependencies": { + "b4a": "^1.6.4" + } + }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -3938,12 +3977,6 @@ "node": ">=0.6" } }, - "node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", - "dev": true - }, "node_modules/ts-api-utils": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.0.3.tgz", @@ -3999,6 +4032,12 @@ "node": ">= 0.6" } }, + "node_modules/typed-query-selector": { + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/typed-query-selector/-/typed-query-selector-2.12.0.tgz", + "integrity": "sha512-SbklCd1F0EiZOyPiW192rrHZzZ5sBijB6xM+cpmrwDqObvdtunOHHIk9fCGsoK5JVIYXoyEp4iEdE3upFH3PAg==", + "dev": true + }, "node_modules/typescript": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", @@ -4023,20 +4062,11 @@ } }, "node_modules/undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", + "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", "dev": true }, - "node_modules/universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true, - "engines": { - "node": ">= 4.0.0" - } - }, "node_modules/unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", @@ -4056,9 +4086,9 @@ } }, "node_modules/urlpattern-polyfill": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/urlpattern-polyfill/-/urlpattern-polyfill-9.0.0.tgz", - "integrity": "sha512-WHN8KDQblxd32odxeIgo83rdVDE2bvdkb86it7bMhYZwWKJz0+O0RK/eZiHYnM+zgt/U7hAHOlCQGfjjvSkw2g==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/urlpattern-polyfill/-/urlpattern-polyfill-10.0.0.tgz", + "integrity": "sha512-H/A06tKD7sS1O1X2SshBVeA5FLycRpjqiBeqGKmBwBDBy28EnRjORxTNe269KSSr5un5qyWi1iL61wLxpd+ZOg==", "dev": true }, "node_modules/utils-merge": { @@ -4079,22 +4109,6 @@ "node": ">= 0.8" } }, - "node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", - "dev": true - }, - "node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "dev": true, - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -4134,9 +4148,9 @@ "dev": true }, "node_modules/ws": { - "version": "8.14.2", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.14.2.tgz", - "integrity": "sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==", + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", + "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", "dev": true, "engines": { "node": ">=10.0.0" @@ -4163,12 +4177,6 @@ "node": ">=10" } }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/yargs": { "version": "17.7.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", @@ -4217,128 +4225,41 @@ "funding": { "url": "https://github.com/sponsors/sindresorhus" } - } - }, - "dependencies": { - "@aashutoshrathi/word-wrap": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", - "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", - "dev": true }, - "@babel/code-frame": { - "version": "7.23.4", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.23.4.tgz", - "integrity": "sha512-r1IONyb6Ia+jYR2vvIDhdWdlTGhqbBoFqLTQidzZ4kepUFH15ejXvFHxCVbtl7BOXIudsIubf4E81xeA3h3IXA==", + "node_modules/zod": { + "version": "3.23.8", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.23.8.tgz", + "integrity": "sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==", "dev": true, - "requires": { - "@babel/highlight": "^7.23.4", - "chalk": "^2.4.2" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true - } + "funding": { + "url": "https://github.com/sponsors/colinhacks" } - }, - "@babel/helper-validator-identifier": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", - "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", + } + }, + "dependencies": { + "@aashutoshrathi/word-wrap": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", + "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", "dev": true }, - "@babel/highlight": { - "version": "7.23.4", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.23.4.tgz", - "integrity": "sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==", + "@babel/code-frame": { + "version": "7.26.2", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", + "integrity": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.22.20", - "chalk": "^2.4.2", - "js-tokens": "^4.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true - } + "@babel/helper-validator-identifier": "^7.25.9", + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" } }, + "@babel/helper-validator-identifier": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", + "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", + "dev": true + }, "@eslint-community/eslint-utils": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", @@ -4476,18 +4397,19 @@ } }, "@puppeteer/browsers": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-1.8.0.tgz", - "integrity": "sha512-TkRHIV6k2D8OlUe8RtG+5jgOF/H98Myx0M6AOafC8DdNVOFiBSFa5cpRDtpm8LXOa9sVwe0+e6Q3FC56X/DZfg==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-2.6.1.tgz", + "integrity": "sha512-aBSREisdsGH890S2rQqK82qmQYU3uFpSH8wcZWHgHzl3LfzsxAKbLNiAG9mO8v1Y0UICBeClICxPJvyr0rcuxg==", "dev": true, "requires": { - "debug": "4.3.4", - "extract-zip": "2.0.1", - "progress": "2.0.3", - "proxy-agent": "6.3.1", - "tar-fs": "3.0.4", - "unbzip2-stream": "1.4.3", - "yargs": "17.7.2" + "debug": "^4.4.0", + "extract-zip": "^2.0.1", + "progress": "^2.0.3", + "proxy-agent": "^6.5.0", + "semver": "^7.6.3", + "tar-fs": "^3.0.6", + "unbzip2-stream": "^1.4.3", + "yargs": "^17.7.2" } }, "@rollup/plugin-node-resolve": { @@ -4577,18 +4499,18 @@ "dev": true }, "@types/node": { - "version": "20.9.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.9.5.tgz", - "integrity": "sha512-Uq2xbNq0chGg+/WQEU0LJTSs/1nKxz6u1iemLcGomkSnKokbW1fbLqc3HOqCf2JP7KjlL4QkS7oZZTrOQHQYgQ==", + "version": "22.10.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.2.tgz", + "integrity": "sha512-Xxr6BBRCAOQixvonOye19wnzyDiUtTeqldOOmj3CkeblonbccA12PFwlufvRdrpjXxqnmUaeiU5EOA+7s5diUQ==", "dev": true, "requires": { - "undici-types": "~5.26.4" + "undici-types": "~6.20.0" } }, "@types/node-forge": { - "version": "1.3.10", - "resolved": "https://registry.npmjs.org/@types/node-forge/-/node-forge-1.3.10.tgz", - "integrity": "sha512-y6PJDYN4xYBxwd22l+OVH35N+1fCYWiuC3aiP2SlXVE6Lo7SS+rSx9r89hLxrP4pn6n1lBGhHJ12pj3F3Mpttw==", + "version": "1.3.11", + "resolved": "https://registry.npmjs.org/@types/node-forge/-/node-forge-1.3.11.tgz", + "integrity": "sha512-FQx220y22OKNTqaByeBGqHWYz4cl94tpcxeFdvBo3wjG6XPBuZ0BNgNZRV5J5TFmmcsJ4IzsLkmGRiQbnYsBEQ==", "dev": true, "requires": { "@types/node": "*" @@ -4740,13 +4662,10 @@ "requires": {} }, "agent-base": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz", - "integrity": "sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==", - "dev": true, - "requires": { - "debug": "^4.3.4" - } + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.3.tgz", + "integrity": "sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw==", + "dev": true }, "ajv": { "version": "6.12.6", @@ -4819,9 +4738,9 @@ } }, "b4a": { - "version": "1.6.4", - "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.4.tgz", - "integrity": "sha512-fpWrvyVHEKyeEvbKZTVOeZF3VSKKWtJxFIxX/jaVPf+cLbGUSitjb49pHLqPV2BUNNZ0LcoeEGfE/YCpyDYHIw==", + "version": "1.6.7", + "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.7.tgz", + "integrity": "sha512-OnAYlL5b7LEkALw87fUVafQw5rVR9RjwGd4KUwNQ6DrrNmaVaUCgLipfVlzrPQ4tWOR9P0IXGNOx50jYCCdSJg==", "dev": true }, "balanced-match": { @@ -4830,6 +4749,52 @@ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true }, + "bare-events": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.5.0.tgz", + "integrity": "sha512-/E8dDe9dsbLyh2qrZ64PEPadOQ0F4gbl1sUJOrmph7xOiIxfY8vwab/4bFLh4Y88/Hk/ujKcrQKc+ps0mv873A==", + "dev": true, + "optional": true + }, + "bare-fs": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/bare-fs/-/bare-fs-2.3.5.tgz", + "integrity": "sha512-SlE9eTxifPDJrT6YgemQ1WGFleevzwY+XAP1Xqgl56HtcrisC2CHCZ2tq6dBpcH2TnNxwUEUGhweo+lrQtYuiw==", + "dev": true, + "optional": true, + "requires": { + "bare-events": "^2.0.0", + "bare-path": "^2.0.0", + "bare-stream": "^2.0.0" + } + }, + "bare-os": { + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/bare-os/-/bare-os-2.4.4.tgz", + "integrity": "sha512-z3UiI2yi1mK0sXeRdc4O1Kk8aOa/e+FNWZcTiPB/dfTWyLypuE99LibgRaQki914Jq//yAWylcAt+mknKdixRQ==", + "dev": true, + "optional": true + }, + "bare-path": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/bare-path/-/bare-path-2.1.3.tgz", + "integrity": "sha512-lh/eITfU8hrj9Ru5quUp0Io1kJWIk1bTjzo7JH1P5dWmQ2EL4hFUlfI8FonAhSlgIfhn63p84CDY/x+PisgcXA==", + "dev": true, + "optional": true, + "requires": { + "bare-os": "^2.1.0" + } + }, + "bare-stream": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/bare-stream/-/bare-stream-2.6.1.tgz", + "integrity": "sha512-eVZbtKM+4uehzrsj49KtCy3Pbg7kO1pJ3SKZ1SFrIH/0pnj9scuGGgUlNDf/7qS8WKtGdiJY5Kyhs/ivYPTB/g==", + "dev": true, + "optional": true, + "requires": { + "streamx": "^2.21.0" + } + }, "base64-js": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", @@ -4846,9 +4811,9 @@ } }, "basic-ftp": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-5.0.3.tgz", - "integrity": "sha512-QHX8HLlncOLpy54mh+k/sWIFd0ThmRqwe9ZjELybGZK+tZ8rUb9VO0saKJUROTbE+KhzDUT7xziGpGrW8Kmd+g==", + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-5.0.5.tgz", + "integrity": "sha512-4Bcg1P8xhUuqcii/S0Z9wiHIrQVPMermM1any+MX5GeGD7faD3/msQUDGLol9wOcz4/jbg/WJnGqoJF6LiBdtg==", "dev": true }, "batch": { @@ -4864,21 +4829,21 @@ "dev": true }, "body-parser": { - "version": "1.20.1", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", - "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", + "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", "dev": true, "requires": { "bytes": "3.1.2", - "content-type": "~1.0.4", + "content-type": "~1.0.5", "debug": "2.6.9", "depd": "2.0.0", "destroy": "1.2.0", "http-errors": "2.0.0", "iconv-lite": "0.4.24", "on-finished": "2.4.1", - "qs": "6.11.0", - "raw-body": "2.5.1", + "qs": "6.13.0", + "raw-body": "2.5.2", "type-is": "~1.6.18", "unpipe": "1.0.0" }, @@ -4954,14 +4919,35 @@ "dev": true }, "call-bind": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.5.tgz", - "integrity": "sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", + "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", "dev": true, "requires": { - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.1", - "set-function-length": "^1.1.1" + "call-bind-apply-helpers": "^1.0.0", + "es-define-property": "^1.0.0", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.2" + } + }, + "call-bind-apply-helpers": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz", + "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==", + "dev": true, + "requires": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + } + }, + "call-bound": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.2.tgz", + "integrity": "sha512-0lk0PHFe/uz0vl527fG9CgdE9WdafjDbCXvBbs+LUv000TVt2Jjhqbs4Jwm8gz070w8xXyEAxrPOMullsxXeGg==", + "dev": true, + "requires": { + "call-bind": "^1.0.8", + "get-intrinsic": "^1.2.5" } }, "callsites": { @@ -5025,13 +5011,14 @@ } }, "chromium-bidi": { - "version": "0.4.33", - "resolved": "https://registry.npmjs.org/chromium-bidi/-/chromium-bidi-0.4.33.tgz", - "integrity": "sha512-IxoFM5WGQOIAd95qrSXzJUv4eXIrh+RvU3rwwqIiwYuvfE7U/Llj4fejbsJnjJMUYCuGtVQsY2gv7oGl4aTNSQ==", + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/chromium-bidi/-/chromium-bidi-0.8.0.tgz", + "integrity": "sha512-uJydbGdTw0DEUjhoogGveneJVWX/9YuqkWePzMmkBYwtdAqo5d3J/ovNKFr+/2hWXYmYCr6it8mSSTIj6SS6Ug==", "dev": true, "requires": { "mitt": "3.0.1", - "urlpattern-polyfill": "9.0.0" + "urlpattern-polyfill": "10.0.0", + "zod": "3.23.8" } }, "cliui": { @@ -5102,9 +5089,9 @@ "dev": true }, "cookie": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", - "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", + "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==", "dev": true }, "cookie-signature": { @@ -5124,24 +5111,15 @@ } }, "cosmiconfig": { - "version": "8.3.6", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.3.6.tgz", - "integrity": "sha512-kcZ6+W5QzcJ3P1Mt+83OUv/oHFqZHIx8DuxG6eZ5RGMERoLqp4BuGjhHLYGK+Kf5XVkQvqBSmAy/nGWN3qDgEA==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-9.0.0.tgz", + "integrity": "sha512-itvL5h8RETACmOTFc4UfIyB2RfEHi71Ax6E/PivVxq9NseKbOWpeyHEOIbmAw1rs8Ak0VursQNww7lf7YtUwzg==", "dev": true, "requires": { + "env-paths": "^2.2.1", "import-fresh": "^3.3.0", "js-yaml": "^4.1.0", - "parse-json": "^5.2.0", - "path-type": "^4.0.0" - } - }, - "cross-fetch": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz", - "integrity": "sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==", - "dev": true, - "requires": { - "node-fetch": "^2.6.12" + "parse-json": "^5.2.0" } }, "cross-spawn": { @@ -5156,18 +5134,18 @@ } }, "data-uri-to-buffer": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-6.0.1.tgz", - "integrity": "sha512-MZd3VlchQkp8rdend6vrx7MmVDJzSNTBvghvKjirLkD+WTChA3KUf0jkE68Q4UyctNqI11zZO9/x2Yx+ub5Cvg==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-6.0.2.tgz", + "integrity": "sha512-7hvf7/GW8e86rW0ptuwS3OcBGDjIi6SZva7hCyWC0yYry2cOPmLIjXAUHI6DK2HsnwJd9ifmt57i8eV2n4YNpw==", "dev": true }, "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, "requires": { - "ms": "2.1.2" + "ms": "^2.1.3" } }, "deep-is": { @@ -5183,14 +5161,14 @@ "dev": true }, "define-data-property": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.1.tgz", - "integrity": "sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", "dev": true, "requires": { - "get-intrinsic": "^1.2.1", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.0" + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" } }, "degenerator": { @@ -5217,9 +5195,9 @@ "dev": true }, "devtools-protocol": { - "version": "0.0.1203626", - "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1203626.tgz", - "integrity": "sha512-nEzHZteIUZfGCZtTiS1fRpC8UZmsfD1SiyPvaUNvS13dvKf666OAm8YTi0+Ca3n1nLEyu49Cy4+dPWpaHFJk9g==", + "version": "0.0.1367902", + "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1367902.tgz", + "integrity": "sha512-XxtPuC3PGakY6PD7dG66/o8KwJ/LkH2/EKe19Dcw58w53dv4/vSQEkn/SzuyhHE2q4zPgCkxQBxus3VV4ql+Pg==", "dev": true }, "dir-glob": { @@ -5277,6 +5255,17 @@ "domhandler": "^5.0.1" } }, + "dunder-proto": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.0.tgz", + "integrity": "sha512-9+Sj30DIu+4KvHqMfLUGLFYL2PkURSYMVXJyXe92nFRvlYq5hBjLEhblKB+vkd/WVlUYMWigiY07T91Fkk0+4A==", + "dev": true, + "requires": { + "call-bind-apply-helpers": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + } + }, "ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", @@ -5290,9 +5279,9 @@ "dev": true }, "encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", "dev": true }, "end-of-stream": { @@ -5310,6 +5299,12 @@ "integrity": "sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA==", "dev": true }, + "env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "dev": true + }, "error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", @@ -5319,10 +5314,31 @@ "is-arrayish": "^0.2.1" } }, + "es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "dev": true + }, + "es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true + }, + "es-object-atoms": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", + "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "dev": true, + "requires": { + "es-errors": "^1.3.0" + } + }, "escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", "dev": true }, "escape-html": { @@ -5495,37 +5511,37 @@ "dev": true }, "express": { - "version": "4.18.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", - "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz", + "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==", "dev": true, "requires": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.20.1", + "body-parser": "1.20.3", "content-disposition": "0.5.4", "content-type": "~1.0.4", - "cookie": "0.5.0", + "cookie": "0.7.1", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "2.0.0", - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "etag": "~1.8.1", - "finalhandler": "1.2.0", + "finalhandler": "1.3.1", "fresh": "0.5.2", "http-errors": "2.0.0", - "merge-descriptors": "1.0.1", + "merge-descriptors": "1.0.3", "methods": "~1.1.2", "on-finished": "2.4.1", "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", + "path-to-regexp": "0.1.12", "proxy-addr": "~2.0.7", - "qs": "6.11.0", + "qs": "6.13.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", - "send": "0.18.0", - "serve-static": "1.15.0", + "send": "0.19.0", + "serve-static": "1.16.2", "setprototypeof": "1.2.0", "statuses": "2.0.1", "type-is": "~1.6.18", @@ -5653,13 +5669,13 @@ } }, "finalhandler": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", - "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", + "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", "dev": true, "requires": { "debug": "2.6.9", - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "on-finished": "2.4.1", "parseurl": "~1.3.3", @@ -5722,17 +5738,6 @@ "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", "dev": true }, - "fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "dev": true, - "requires": { - "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -5759,15 +5764,21 @@ "dev": true }, "get-intrinsic": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.2.tgz", - "integrity": "sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA==", + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.6.tgz", + "integrity": "sha512-qxsEs+9A+u85HhllWJJFicJfPDhRmjzoYdl64aMWW9yRIJmSyxdn8IEkuIM530/7T+lv0TIHd8L6Q/ra0tEoeA==", "dev": true, "requires": { + "call-bind-apply-helpers": "^1.0.1", + "dunder-proto": "^1.0.0", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", "function-bind": "^1.1.2", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "hasown": "^2.0.0" + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.0.0" } }, "get-stream": { @@ -5780,15 +5791,14 @@ } }, "get-uri": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/get-uri/-/get-uri-6.0.2.tgz", - "integrity": "sha512-5KLucCJobh8vBY1K07EFV4+cPZH3mrV9YeAruUseCQKHB58SGjjT2l9/eA9LD082IiuMjSlFJEcdJ27TXvbZNw==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/get-uri/-/get-uri-6.0.4.tgz", + "integrity": "sha512-E1b1lFFLvLgak2whF2xDBcOy6NLVGZBqqjJjsIhvopKfWWEi64pLVTWWehV8KlLerZkfNTA95sTe2OdJKm1OzQ==", "dev": true, "requires": { "basic-ftp": "^5.0.2", - "data-uri-to-buffer": "^6.0.0", - "debug": "^4.3.4", - "fs-extra": "^8.1.0" + "data-uri-to-buffer": "^6.0.2", + "debug": "^4.3.4" } }, "glob": { @@ -5838,18 +5848,9 @@ } }, "gopd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "dev": true, - "requires": { - "get-intrinsic": "^1.1.3" - } - }, - "graceful-fs": { - "version": "4.2.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", "dev": true }, "graphemer": { @@ -5867,37 +5868,25 @@ "function-bind": "^1.1.1" } }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true - }, "has-property-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.1.tgz", - "integrity": "sha512-VsX8eaIewvas0xnvinAe9bw4WfIeODpGYikiWYLH+dma0Jw6KHYqWiWfhQlgOVK8D6PvjubK5Uc4P0iIhIcNVg==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", "dev": true, "requires": { - "get-intrinsic": "^1.2.2" + "es-define-property": "^1.0.0" } }, - "has-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", - "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", - "dev": true - }, "has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", "dev": true }, "hasown": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", - "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", "dev": true, "requires": { "function-bind": "^1.1.2" @@ -5929,9 +5918,9 @@ } }, "http-proxy-agent": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.0.tgz", - "integrity": "sha512-+ZT+iBxVUQ1asugqnD6oWoRiS25AkjNfG085dKJGtGxkdwLQrMKU5wJr2bOOFAXzKcTuqq+7fZlTMgG3SRfIYQ==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", "dev": true, "requires": { "agent-base": "^7.1.0", @@ -5939,12 +5928,12 @@ } }, "https-proxy-agent": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.2.tgz", - "integrity": "sha512-NmLNjm6ucYwtcUmL7JQC1ZQ57LmHP4lT15FQ8D61nak1rO6DH+fz5qNK2Ap5UN4ZapYICE3/0KodcLYSPsPbaA==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", "dev": true, "requires": { - "agent-base": "^7.0.2", + "agent-base": "^7.1.2", "debug": "4" } }, @@ -6001,11 +5990,15 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, - "ip": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.8.tgz", - "integrity": "sha512-PuExPYUiu6qMBQb4l06ecm6T6ujzhmh+MeJcW9wa89PoAz5pvd4zPgN5WJV104mb6S2T1AwNIAaB70JNrLQWhg==", - "dev": true + "ip-address": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz", + "integrity": "sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==", + "dev": true, + "requires": { + "jsbn": "1.1.0", + "sprintf-js": "^1.1.3" + } }, "ipaddr.js": { "version": "1.9.1", @@ -6106,6 +6099,12 @@ "argparse": "^2.0.1" } }, + "jsbn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz", + "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==", + "dev": true + }, "json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", @@ -6124,15 +6123,6 @@ "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", "dev": true }, - "jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.6" - } - }, "levn": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", @@ -6170,6 +6160,12 @@ "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", "dev": true }, + "math-intrinsics": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.0.0.tgz", + "integrity": "sha512-4MqMiKP90ybymYvsut0CH2g4XWbfLtmlCkXmtmdcDCxNB+mQcu1w/1+L/VD7vi/PSv7X2JYV7SCcR+jiPXnQtA==", + "dev": true + }, "media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -6177,9 +6173,9 @@ "dev": true }, "merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", "dev": true }, "merge2": { @@ -6240,16 +6236,10 @@ "integrity": "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==", "dev": true }, - "mkdirp-classic": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", - "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==", - "dev": true - }, "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, "natural-compare": { @@ -6270,15 +6260,6 @@ "integrity": "sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==", "dev": true }, - "node-fetch": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", - "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", - "dev": true, - "requires": { - "whatwg-url": "^5.0.0" - } - }, "node-forge": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz", @@ -6298,9 +6279,9 @@ "dev": true }, "object-inspect": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", - "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", + "version": "1.13.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.3.tgz", + "integrity": "sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==", "dev": true }, "on-finished": { @@ -6354,29 +6335,28 @@ } }, "pac-proxy-agent": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-7.0.1.tgz", - "integrity": "sha512-ASV8yU4LLKBAjqIPMbrgtaKIvxQri/yh2OpI+S6hVa9JRkUI3Y3NPFbfngDtY7oFtSMD3w31Xns89mDa3Feo5A==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-7.1.0.tgz", + "integrity": "sha512-Z5FnLVVZSnX7WjBg0mhDtydeRZ1xMcATZThjySQUHqr+0ksP8kqaw23fNKkaaN/Z8gwLUs/W7xdl0I75eP2Xyw==", "dev": true, "requires": { "@tootallnate/quickjs-emscripten": "^0.23.0", - "agent-base": "^7.0.2", + "agent-base": "^7.1.2", "debug": "^4.3.4", "get-uri": "^6.0.1", "http-proxy-agent": "^7.0.0", - "https-proxy-agent": "^7.0.2", - "pac-resolver": "^7.0.0", - "socks-proxy-agent": "^8.0.2" + "https-proxy-agent": "^7.0.6", + "pac-resolver": "^7.0.1", + "socks-proxy-agent": "^8.0.5" } }, "pac-resolver": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/pac-resolver/-/pac-resolver-7.0.0.tgz", - "integrity": "sha512-Fd9lT9vJbHYRACT8OhCbZBbxr6KRSawSovFpy8nDGshaK99S/EBhVIHp9+crhxrsZOuvLpgL1n23iyPg6Rl2hg==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/pac-resolver/-/pac-resolver-7.0.1.tgz", + "integrity": "sha512-5NPgf87AT2STgwa2ntRMr45jTKrYBGkVU36yT0ig/n/GMAa3oPqhZfIQ2kMEimReg0+t9kZViDVZ83qfVUlckg==", "dev": true, "requires": { "degenerator": "^5.0.0", - "ip": "^1.1.8", "netmask": "^2.0.2" } }, @@ -6432,9 +6412,9 @@ "dev": true }, "path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==", + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", + "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==", "dev": true }, "path-type": { @@ -6449,6 +6429,12 @@ "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==", "dev": true }, + "picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true + }, "picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", @@ -6478,19 +6464,19 @@ } }, "proxy-agent": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-6.3.1.tgz", - "integrity": "sha512-Rb5RVBy1iyqOtNl15Cw/llpeLH8bsb37gM1FUfKQ+Wck6xHlbAhWGUFiTRHtkjqGTA5pSHz6+0hrPW/oECihPQ==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-6.5.0.tgz", + "integrity": "sha512-TmatMXdr2KlRiA2CyDu8GqR8EjahTG3aY3nXjdzFyoZbmB8hrBsTyMezhULIXKnC0jpfjlmiZ3+EaCzoInSu/A==", "dev": true, "requires": { - "agent-base": "^7.0.2", + "agent-base": "^7.1.2", "debug": "^4.3.4", - "http-proxy-agent": "^7.0.0", - "https-proxy-agent": "^7.0.2", + "http-proxy-agent": "^7.0.1", + "https-proxy-agent": "^7.0.6", "lru-cache": "^7.14.1", - "pac-proxy-agent": "^7.0.1", + "pac-proxy-agent": "^7.1.0", "proxy-from-env": "^1.1.0", - "socks-proxy-agent": "^8.0.2" + "socks-proxy-agent": "^8.0.5" } }, "proxy-from-env": { @@ -6500,9 +6486,9 @@ "dev": true }, "pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.2.tgz", + "integrity": "sha512-tUPXtzlGM8FE3P0ZL6DVs/3P58k9nk8/jZeQCurTJylQA8qFYzHFfhBJkuqyE0FifOsQ0uKWekiZ5g8wtr28cw==", "dev": true, "requires": { "end-of-stream": "^1.1.0", @@ -6516,37 +6502,40 @@ "dev": true }, "puppeteer": { - "version": "21.5.2", - "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-21.5.2.tgz", - "integrity": "sha512-BaAGJOq8Fl6/cck6obmwaNLksuY0Bg/lIahCLhJPGXBFUD2mCffypa4A592MaWnDcye7eaHmSK9yot0pxctY8A==", + "version": "23.10.4", + "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-23.10.4.tgz", + "integrity": "sha512-i0sYIAIjdO9MoRfFqbkoWFnQYZVmNp8msbztTgG46KbOdoYAv4f56MFzdFwtC0lyZHtkP+yl0H7tP0dNg3RQYA==", "dev": true, "requires": { - "@puppeteer/browsers": "1.8.0", - "cosmiconfig": "8.3.6", - "puppeteer-core": "21.5.2" + "@puppeteer/browsers": "2.6.1", + "chromium-bidi": "0.8.0", + "cosmiconfig": "^9.0.0", + "devtools-protocol": "0.0.1367902", + "puppeteer-core": "23.10.4", + "typed-query-selector": "^2.12.0" } }, "puppeteer-core": { - "version": "21.5.2", - "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-21.5.2.tgz", - "integrity": "sha512-v4T0cWnujSKs+iEfmb8ccd7u4/x8oblEyKqplqKnJ582Kw8PewYAWvkH4qUWhitN3O2q9RF7dzkvjyK5HbzjLA==", + "version": "23.10.4", + "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-23.10.4.tgz", + "integrity": "sha512-pQAY7+IFAndWDkDodsQGguW1/ifV5OMlGXJDspwtK49Asb7poJZ/V5rXJxVSpq57bWrJasjQBZ1X27z1oWVq4Q==", "dev": true, "requires": { - "@puppeteer/browsers": "1.8.0", - "chromium-bidi": "0.4.33", - "cross-fetch": "4.0.0", - "debug": "4.3.4", - "devtools-protocol": "0.0.1203626", - "ws": "8.14.2" + "@puppeteer/browsers": "2.6.1", + "chromium-bidi": "0.8.0", + "debug": "^4.4.0", + "devtools-protocol": "0.0.1367902", + "typed-query-selector": "^2.12.0", + "ws": "^8.18.0" } }, "qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", "dev": true, "requires": { - "side-channel": "^1.0.4" + "side-channel": "^1.0.6" } }, "queue-microtask": { @@ -6577,9 +6566,9 @@ "dev": true }, "raw-body": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", - "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", "dev": true, "requires": { "bytes": "3.1.2", @@ -6682,29 +6671,15 @@ } }, "semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - }, - "dependencies": { - "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "requires": { - "yallist": "^4.0.0" - } - } - } + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "dev": true }, "send": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", - "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", + "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", "dev": true, "requires": { "debug": "2.6.9", @@ -6739,10 +6714,10 @@ } } }, - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", "dev": true } } @@ -6825,15 +6800,15 @@ } }, "serve-static": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", - "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", + "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", "dev": true, "requires": { - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "parseurl": "~1.3.3", - "send": "0.18.0" + "send": "0.19.0" } }, "server-destroy": { @@ -6843,51 +6818,53 @@ "dev": true }, "servez": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/servez/-/servez-2.1.2.tgz", - "integrity": "sha512-uJ/GlvogUfe52p9E5p9maEMQzycEMiz1doWkW8rke33WezHQ1P6/xPBqerOoeK9ze24Am1vJey7j/ddtySJTwg==", + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/servez/-/servez-2.2.4.tgz", + "integrity": "sha512-HcsVAEnEvDq5WH9kLQBK6SvykTRFllX052b34k5mCs/XpwTXdxYyf4+1pCJdHenLb1gGuEZzcm5HdHRdVciBHA==", "dev": true, "requires": { - "ansi-colors": "^4.1.1", + "ansi-colors": "^4.1.3", "color-support": "^1.1.3", - "commander": "^11.0.0", - "servez-lib": "^2.8.1" + "commander": "^12.1.0", + "servez-lib": "^2.9.5" }, "dependencies": { "commander": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", - "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==", + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", + "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==", "dev": true } } }, "servez-lib": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/servez-lib/-/servez-lib-2.8.1.tgz", - "integrity": "sha512-Wg/hvTxBPJ0ZqlQKTDktMDEAi/V5/wXdEaj4/O6SM1ZmqwWQoHDw0Yyg7l/G91znMQOCkyEdfAFPasOpjQWbNg==", + "version": "2.9.5", + "resolved": "https://registry.npmjs.org/servez-lib/-/servez-lib-2.9.5.tgz", + "integrity": "sha512-ET3M1Vd4v6a0uz2bQBsZ/fOS8Mmx0GLWYr4cPVKA/QNKLrrBfnzHVkIR3wRxxsC8kU11jS93HTu8zOkZAp1wBw==", "dev": true, "requires": { "basic-auth": "^2.0.1", "cors": "^2.8.5", - "debug": "^4.3.4", - "express": "^4.18.2", + "debug": "^4.3.7", + "express": "^4.21.1", "secure-compare": "^3.0.1", - "selfsigned": "^2.1.1", + "selfsigned": "^2.4.1", "serve-index": "^1.9.1", "server-destroy": "^1.0.1" } }, "set-function-length": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.1.1.tgz", - "integrity": "sha512-VoaqjbBJKiWtg4yRcKBQ7g7wnGnLV3M8oLvVWwOk2PdYY6PEFegR1vezXR0tw6fZGF9csVakIRjrJiy2veSBFQ==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", "dev": true, "requires": { - "define-data-property": "^1.1.1", - "get-intrinsic": "^1.2.1", + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.0" + "has-property-descriptors": "^1.0.2" } }, "setprototypeof": { @@ -6912,14 +6889,51 @@ "dev": true }, "side-channel": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "dev": true, + "requires": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + } + }, + "side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "dev": true, + "requires": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + } + }, + "side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "dev": true, + "requires": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + } + }, + "side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", "dev": true, "requires": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" } }, "slash": { @@ -6941,32 +6955,24 @@ "dev": true }, "socks": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz", - "integrity": "sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==", + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.3.tgz", + "integrity": "sha512-l5x7VUUWbjVFbafGLxPWkYsHIhEvmF85tbIeFZWc8ZPtoMyybuEhL7Jye/ooC4/d48FgOjSJXgsF/AJPYCW8Zw==", "dev": true, "requires": { - "ip": "^2.0.0", + "ip-address": "^9.0.5", "smart-buffer": "^4.2.0" - }, - "dependencies": { - "ip": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.0.tgz", - "integrity": "sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==", - "dev": true - } } }, "socks-proxy-agent": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.2.tgz", - "integrity": "sha512-8zuqoLv1aP/66PHF5TqwJ7Czm3Yv32urJQHrVyhD7mmA6d61Zv8cIXQYPTWwmg6qlupnPvs/QKDmfa4P/qct2g==", + "version": "8.0.5", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.5.tgz", + "integrity": "sha512-HehCEsotFqbPW9sJ8WVYB6UbmIMv7kUUORIF2Nncq4VQvBfNBLibW9YZR5dlYCSUhwcD628pRllm7n+E+YTzJw==", "dev": true, "requires": { - "agent-base": "^7.0.2", + "agent-base": "^7.1.2", "debug": "^4.3.4", - "socks": "^2.7.1" + "socks": "^2.8.3" } }, "source-map": { @@ -6985,6 +6991,12 @@ "source-map": "^0.6.0" } }, + "sprintf-js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", + "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==", + "dev": true + }, "statuses": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", @@ -6992,13 +7004,15 @@ "dev": true }, "streamx": { - "version": "2.15.5", - "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.15.5.tgz", - "integrity": "sha512-9thPGMkKC2GctCzyCUjME3yR03x2xNo0GPKGkRw2UMYN+gqWa9uqpyNWhmsNCutU5zHmkUum0LsCRQTXUgUCAg==", + "version": "2.21.1", + "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.21.1.tgz", + "integrity": "sha512-PhP9wUnFLa+91CPy3N6tiQsK+gnYyUNuk15S3YG/zjYE7RuPeCjJngqnzpC31ow0lzBHQ+QGO4cNJnd0djYUsw==", "dev": true, "requires": { - "fast-fifo": "^1.1.0", - "queue-tick": "^1.0.1" + "bare-events": "^2.2.0", + "fast-fifo": "^1.3.2", + "queue-tick": "^1.0.1", + "text-decoder": "^1.1.0" } }, "string-width": { @@ -7027,15 +7041,6 @@ "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - }, "supports-preserve-symlinks-flag": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", @@ -7043,20 +7048,21 @@ "dev": true }, "tar-fs": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.0.4.tgz", - "integrity": "sha512-5AFQU8b9qLfZCX9zp2duONhPmZv0hGYiBPJsyUdqMjzq/mqVpy/rEUSeHk1+YitmxugaptgBh5oDGU3VsAJq4w==", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.0.6.tgz", + "integrity": "sha512-iokBDQQkUyeXhgPYaZxmczGPhnhXZ0CmrqI+MOb/WFGS9DW5wnfrLgtjUJBvz50vQ3qfRwJ62QVoCFu8mPVu5w==", "dev": true, "requires": { - "mkdirp-classic": "^0.5.2", + "bare-fs": "^2.1.1", + "bare-path": "^2.1.0", "pump": "^3.0.0", "tar-stream": "^3.1.5" } }, "tar-stream": { - "version": "3.1.6", - "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.6.tgz", - "integrity": "sha512-B/UyjYwPpMBv+PaFSWAmtYjwdrlEaZQEhMIBFNC5oEG8lpiW8XjcSdmEaClj28ArfKScKHs2nshz3k2le6crsg==", + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.7.tgz", + "integrity": "sha512-qJj60CXt7IU1Ffyc3NJMjh6EkuCFej46zUqJ4J7pqYlThyd9bO0XBTmcOIhSzZJVWfsLks0+nle/j538YAW9RQ==", "dev": true, "requires": { "b4a": "^1.6.4", @@ -7076,6 +7082,15 @@ "source-map-support": "~0.5.20" } }, + "text-decoder": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/text-decoder/-/text-decoder-1.2.3.tgz", + "integrity": "sha512-3/o9z3X0X0fTupwsYvR03pJ/DjWuqqrfwBgTQzdWDiQSm9KitAyz/9WqsT2JQW7KV2m+bC2ol/zqpW37NHxLaA==", + "dev": true, + "requires": { + "b4a": "^1.6.4" + } + }, "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -7103,12 +7118,6 @@ "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", "dev": true }, - "tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", - "dev": true - }, "ts-api-utils": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.0.3.tgz", @@ -7147,6 +7156,12 @@ "mime-types": "~2.1.24" } }, + "typed-query-selector": { + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/typed-query-selector/-/typed-query-selector-2.12.0.tgz", + "integrity": "sha512-SbklCd1F0EiZOyPiW192rrHZzZ5sBijB6xM+cpmrwDqObvdtunOHHIk9fCGsoK5JVIYXoyEp4iEdE3upFH3PAg==", + "dev": true + }, "typescript": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", @@ -7164,15 +7179,9 @@ } }, "undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", - "dev": true - }, - "universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", + "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", "dev": true }, "unpipe": { @@ -7191,9 +7200,9 @@ } }, "urlpattern-polyfill": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/urlpattern-polyfill/-/urlpattern-polyfill-9.0.0.tgz", - "integrity": "sha512-WHN8KDQblxd32odxeIgo83rdVDE2bvdkb86it7bMhYZwWKJz0+O0RK/eZiHYnM+zgt/U7hAHOlCQGfjjvSkw2g==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/urlpattern-polyfill/-/urlpattern-polyfill-10.0.0.tgz", + "integrity": "sha512-H/A06tKD7sS1O1X2SshBVeA5FLycRpjqiBeqGKmBwBDBy28EnRjORxTNe269KSSr5un5qyWi1iL61wLxpd+ZOg==", "dev": true }, "utils-merge": { @@ -7208,22 +7217,6 @@ "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", "dev": true }, - "webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", - "dev": true - }, - "whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "dev": true, - "requires": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, "which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -7251,9 +7244,9 @@ "dev": true }, "ws": { - "version": "8.14.2", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.14.2.tgz", - "integrity": "sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==", + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", + "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", "dev": true, "requires": {} }, @@ -7263,12 +7256,6 @@ "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", "dev": true }, - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "yargs": { "version": "17.7.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", @@ -7305,6 +7292,12 @@ "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true + }, + "zod": { + "version": "3.23.8", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.23.8.tgz", + "integrity": "sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==", + "dev": true } } } diff --git a/package.json b/package.json index 54f2dcb..75887b3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "muigui", - "version": "0.0.17", + "version": "0.0.20", "description": "A Simple GUI", "main": "dist/0.x/muigui.js", "module": "dist/0.x/muigui.module.js", @@ -50,9 +50,9 @@ "eslint-plugin-one-variable-per-var": "^0.0.3", "eslint-plugin-optional-comma-spacing": "0.0.4", "eslint-plugin-require-trailing-comma": "0.0.1", - "puppeteer": "^21.5.2", + "puppeteer": "^23.10.4", "rollup": "^3.20.2", - "servez": "^2.1.2", + "servez": "^2.2.4", "tslib": "^2.6.2", "typescript": "5.2" } diff --git a/src/controllers/Button.js b/src/controllers/Button.js index efa096c..56cd927 100644 --- a/src/controllers/Button.js +++ b/src/controllers/Button.js @@ -28,10 +28,12 @@ export default class Button extends Controller { } name(name) { this.#buttonElem.textContent = name; + return this; } setOptions(options) { copyExistingProperties(this.#options, options); const {name} = this.#options; this.#buttonElem.textContent = name; + return this; } } \ No newline at end of file diff --git a/src/controllers/Canvas.js b/src/controllers/Canvas.js index c4c1114..f9bd279 100644 --- a/src/controllers/Canvas.js +++ b/src/controllers/Canvas.js @@ -14,4 +14,7 @@ export default class Canvas extends LabelController { get canvas() { return this.#canvasElem; } + listen() { + return this; + } } \ No newline at end of file diff --git a/src/controllers/Container.js b/src/controllers/Container.js index cfe15fe..5ad02f9 100644 --- a/src/controllers/Container.js +++ b/src/controllers/Container.js @@ -61,4 +61,10 @@ export default class Container extends Controller { this.#childDestController = this.#childDestController.parent; return this; } + listen() { + this.#controllers.forEach(c => { + c.listen(); + }); + return this; + } } diff --git a/src/muigui.js b/src/muigui.js index 066272b..ef6b2c7 100644 --- a/src/muigui.js +++ b/src/muigui.js @@ -34,11 +34,22 @@ export { Row, }; +function camelCaseToSnakeCase(id) { + return id + .replace(/(.)([A-Z][a-z]+)/g, '$1_$2') + .replace(/([a-z0-9])([A-Z])/g, '$1_$2') + .toLowerCase(); +} + +function prepName(name) { + return camelCaseToSnakeCase(name.toString()).replaceAll('_', ' '); +} + export class GUIFolder extends Folder { add(object, property, ...args) { const controller = object instanceof Controller ? object - : createController(object, property, ...args); + : createController(object, property, ...args).name(prepName(property)); return this.addController(controller); } addCanvas(name) { @@ -47,9 +58,13 @@ export class GUIFolder extends Folder { addColor(object, property, options = {}) { const value = object[property]; if (hasAlpha(options.format || guessFormat(value))) { - return this.addController(new ColorChooser(object, property, options)); + return this + .addController(new ColorChooser(object, property, options)) + .name(prepName(property)); } else { - return this.addController(new Color(object, property, options)); + return this + .addController(new Color(object, property, options)) + .name(prepName(property)); } } addDivider() { @@ -63,7 +78,7 @@ export class GUIFolder extends Folder { } addButton(name, fn) { const o = {fn}; - return this.add(o, 'fn').name(name); + return this.add(o, 'fn').name(prepName(name)); } } diff --git a/src/styles/muigui.css.js b/src/styles/muigui.css.js index 3f1ce69..876733d 100644 --- a/src/styles/muigui.css.js +++ b/src/styles/muigui.css.js @@ -84,6 +84,7 @@ export default { font-size: var(--font-size); box-sizing: border-box; line-height: 100%; + white-space: nowrap; } .muigui * { box-sizing: inherit; @@ -287,7 +288,7 @@ export default { } .muigui-closed>.muigui-open-container>* { transition: all 0.1s ease-out; - margin-top: -100%; + margin-top: -1000%; } /* ---- popdown ---- */ diff --git a/test/puppeteer.js b/test/puppeteer.js index 9881b2e..0c37bf2 100755 --- a/test/puppeteer.js +++ b/test/puppeteer.js @@ -32,6 +32,8 @@ async function test(port) { //'--enable-webgpu-developer-features', //'--use-angle=swiftshader', '--user-agent=puppeteer', + '--no-sandbox', + '--disable-setuid-sandbox', ], }); const page = await browser.newPage();