laymur 0.10.2 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -11
- package/dist/constraints/UIAspectConstraint.Internal.d.ts +6 -0
- package/dist/constraints/UIAspectConstraint.d.ts +9 -46
- package/dist/constraints/UIConstraint.d.ts +7 -27
- package/dist/constraints/UICustomConstraint.d.ts +13 -45
- package/dist/constraints/UIHeightConstraint.Internal.d.ts +6 -0
- package/dist/constraints/UIHeightConstraint.d.ts +8 -37
- package/dist/constraints/UIHorizontalDistanceConstraint.Internal.d.ts +11 -0
- package/dist/constraints/UIHorizontalDistanceConstraint.d.ts +16 -73
- package/dist/constraints/UIHorizontalProportionConstraint.Internal.d.ts +6 -0
- package/dist/constraints/UIHorizontalProportionConstraint.d.ts +8 -52
- package/dist/constraints/UISingleParameterConstraint.Internal.d.ts +12 -0
- package/dist/constraints/UISingleParameterConstraint.d.ts +24 -87
- package/dist/constraints/UIVerticalDistanceConstraint.Internal.d.ts +11 -0
- package/dist/constraints/UIVerticalDistanceConstraint.d.ts +12 -73
- package/dist/constraints/UIVerticalProportionConstraint.Internal.d.ts +6 -0
- package/dist/constraints/UIVerticalProportionConstraint.d.ts +8 -52
- package/dist/constraints/UIWidthConstraint.Internal.d.ts +6 -0
- package/dist/constraints/UIWidthConstraint.d.ts +8 -37
- package/dist/constraints/builders/UIConstraint2DBuilder.Internal.d.ts +45 -0
- package/dist/constraints/builders/UIConstraint2DBuilder.d.ts +35 -0
- package/dist/constraints/builders/UICoverConstraintBuilder.Internal.d.ts +13 -0
- package/dist/constraints/builders/UICoverConstraintBuilder.d.ts +29 -0
- package/dist/constraints/builders/UIFitConstraintBuilder.Internal.d.ts +13 -0
- package/dist/constraints/builders/UIFitConstraintBuilder.d.ts +29 -0
- package/dist/elements/UIAnchor.Internal.d.ts +9 -0
- package/dist/elements/UIAnchor.d.ts +17 -62
- package/dist/elements/UIAnimatedImage.Internal.d.ts +24 -0
- package/dist/elements/UIAnimatedImage.d.ts +38 -100
- package/dist/elements/UIDummy.Internal.d.ts +18 -0
- package/dist/elements/UIDummy.d.ts +51 -63
- package/dist/elements/UIElement.Internal.d.ts +11 -0
- package/dist/elements/UIElement.d.ts +28 -168
- package/dist/elements/UIGraphics.Internal.d.ts +7 -0
- package/dist/elements/UIGraphics.d.ts +29 -99
- package/dist/elements/UIImage.Internal.d.ts +7 -0
- package/dist/elements/UIImage.d.ts +18 -73
- package/dist/elements/UINineSlice.Internal.d.ts +23 -0
- package/dist/elements/UINineSlice.d.ts +45 -0
- package/dist/elements/UIProgress.Internal.d.ts +14 -0
- package/dist/elements/UIProgress.d.ts +26 -152
- package/dist/elements/UIScene.Internal.d.ts +43 -0
- package/dist/elements/UIScene.d.ts +29 -171
- package/dist/elements/UIText/UIText.Interfaces.d.ts +32 -0
- package/dist/elements/UIText/UIText.Internal.d.ts +26 -0
- package/dist/elements/UIText/UIText.Measuring.d.ts +49 -0
- package/dist/elements/UIText/UIText.Rendering.d.ts +19 -0
- package/dist/elements/UIText/UIText.d.ts +63 -0
- package/dist/index.d.ts +46 -46
- package/dist/index.js +4180 -4006
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/layers/UIFullscreenLayer.d.ts +33 -43
- package/dist/layers/UILayer.Internal.d.ts +15 -0
- package/dist/layers/UILayer.d.ts +29 -184
- package/dist/miscellaneous/UIExpression.d.ts +35 -83
- package/dist/miscellaneous/UIInputEvent.d.ts +11 -8
- package/dist/miscellaneous/UIMode.d.ts +19 -21
- package/dist/miscellaneous/UIOrientation.d.ts +7 -22
- package/dist/miscellaneous/UIPriority.d.ts +16 -40
- package/dist/miscellaneous/UIRelation.d.ts +11 -31
- package/dist/miscellaneous/UITransparencyMode.d.ts +4 -21
- package/dist/miscellaneous/area/UIArea.d.ts +3 -0
- package/dist/miscellaneous/area/UIAreaCircle.d.ts +15 -0
- package/dist/miscellaneous/area/UIAreaPolygon.d.ts +12 -0
- package/dist/miscellaneous/area/UIAreaRectangle.d.ts +17 -0
- package/dist/miscellaneous/area/UIAreaRoundedRectangle.d.ts +21 -0
- package/dist/miscellaneous/asserts.d.ts +39 -82
- package/dist/miscellaneous/color/UIColor.Internal.d.ts +7 -0
- package/dist/miscellaneous/color/UIColor.d.ts +197 -0
- package/dist/miscellaneous/computeTransform.d.ts +18 -0
- package/dist/miscellaneous/generic-plane/UIGenericInstancedPlane.Internal.d.ts +10 -0
- package/dist/miscellaneous/generic-plane/UIGenericInstancedPlane.d.ts +36 -0
- package/dist/miscellaneous/generic-plane/UIGenericPlane.Internal.d.ts +5 -0
- package/dist/miscellaneous/generic-plane/UIGenericPlane.d.ts +23 -0
- package/dist/miscellaneous/generic-plane/UIGenericPlaneRegistry.Internal.d.ts +6 -0
- package/dist/miscellaneous/generic-plane/UIGenericPlaneRegistry.d.ts +27 -0
- package/dist/miscellaneous/generic-plane/shared.d.ts +22 -0
- package/dist/miscellaneous/mask-function/UIProgressMaskFunction.d.ts +9 -0
- package/dist/miscellaneous/mask-function/UIProgressMaskFunctionCircular.d.ts +21 -0
- package/dist/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.d.ts +16 -0
- package/dist/miscellaneous/micro/UIMicro.Internal.d.ts +31 -0
- package/dist/miscellaneous/micro/UIMicro.d.ts +59 -0
- package/dist/miscellaneous/padding/UIPadding.Internal.d.ts +11 -0
- package/dist/miscellaneous/padding/UIPadding.d.ts +46 -0
- package/dist/miscellaneous/resize-policy/UIResizePolicy.d.ts +3 -0
- package/dist/miscellaneous/resize-policy/UIResizePolicyCross.d.ts +22 -0
- package/dist/miscellaneous/resize-policy/UIResizePolicyCrossInverted.d.ts +22 -0
- package/dist/miscellaneous/resize-policy/UIResizePolicyFixedHeight.d.ts +22 -0
- package/dist/miscellaneous/resize-policy/UIResizePolicyFixedWidth.d.ts +22 -0
- package/dist/miscellaneous/resize-policy/UIResizePolicyNone.d.ts +5 -0
- package/dist/miscellaneous/text-span/UITextSpan.Internal.d.ts +8 -0
- package/dist/miscellaneous/text-span/UITextSpan.d.ts +14 -0
- package/dist/miscellaneous/text-style/UITextStyle.Internal.d.ts +48 -0
- package/dist/miscellaneous/text-style/UITextStyle.d.ts +85 -0
- package/dist/miscellaneous/texture/UITextureView.Internal.d.ts +54 -0
- package/dist/miscellaneous/texture/UITextureView.d.ts +61 -0
- package/dist/wrappers/UIInputWrapper.Internal.d.ts +17 -0
- package/dist/wrappers/UIInputWrapper.d.ts +13 -0
- package/dist/wrappers/UISceneWrapper.Internal.d.ts +13 -0
- package/dist/wrappers/UISceneWrapper.d.ts +12 -19
- package/dist/wrappers/UISolverWrapper.Internal.d.ts +49 -0
- package/dist/wrappers/UISolverWrapper.d.ts +2 -1
- package/package.json +3 -1
- package/dist/builders/UIConstraint2DBuilder.d.ts +0 -130
- package/dist/builders/UICoverConstraintBuilder.d.ts +0 -56
- package/dist/builders/UIFitConstraintBuilder.d.ts +0 -56
- package/dist/composer/UIComposer.d.ts +0 -0
- package/dist/composer/UIFullscreenQuad.d.ts +0 -0
- package/dist/composer/UIPass.d.ts +0 -0
- package/dist/elements/UINineSline.d.ts +0 -139
- package/dist/elements/UISpine.d.ts +0 -54
- package/dist/elements/UIText.d.ts +0 -149
- package/dist/miscellaneous/UIColor.d.ts +0 -245
- package/dist/miscellaneous/UIGenericInstancedPlane.d.ts +0 -32
- package/dist/miscellaneous/UIMicro.d.ts +0 -148
- package/dist/miscellaneous/UIMicroAnchorMode.d.ts +0 -9
- package/dist/miscellaneous/UINineSliceBorder.d.ts +0 -21
- package/dist/miscellaneous/UIResizePolicy.d.ts +0 -21
- package/dist/miscellaneous/UIResizePolicyCross.d.ts +0 -14
- package/dist/miscellaneous/UIResizePolicyCrossInverted.d.ts +0 -14
- package/dist/miscellaneous/UIResizePolicyFixedHeight.d.ts +0 -24
- package/dist/miscellaneous/UIResizePolicyFixedWidth.d.ts +0 -27
- package/dist/miscellaneous/UIResizePolicyNone.d.ts +0 -7
- package/dist/miscellaneous/UISceneWrapperClientAPI.d.ts +0 -12
- package/dist/miscellaneous/UITextPadding.d.ts +0 -7
- package/dist/miscellaneous/UITextSpan.d.ts +0 -6
- package/dist/miscellaneous/UITextStyle.d.ts +0 -20
- package/dist/miscellaneous/textInterfaces.d.ts +0 -19
- package/dist/miscellaneous/textTools.d.ts +0 -12
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/miscellaneous/UIExpression.ts","../node_modules/eventail/dist/index.min.js","../src/miscellaneous/UIMode.ts","../src/miscellaneous/UIOrientation.ts","../node_modules/@lume/kiwi/dist/maptype.js","../node_modules/@lume/kiwi/dist/variable.js","../node_modules/@lume/kiwi/dist/expression.js","../node_modules/@lume/kiwi/dist/strength.js","../node_modules/@lume/kiwi/dist/constraint.js","../node_modules/@lume/kiwi/dist/solver.js","../src/miscellaneous/UIPriority.ts","../src/miscellaneous/UIColor.ts","../src/miscellaneous/UITransparencyMode.ts","../src/wrappers/UISceneWrapper.ts","../src/miscellaneous/UIRelation.ts","../src/wrappers/UISolverWrapper.ts","../src/layers/UILayer.ts","../src/constraints/UIConstraint.ts","../src/constraints/UISingleParameterConstraint.ts","../src/constraints/UIHeightConstraint.ts","../src/miscellaneous/asserts.ts","../src/constraints/UIHorizontalDistanceConstraint.ts","../src/constraints/UIHorizontalProportionConstraint.ts","../src/constraints/UIVerticalDistanceConstraint.ts","../src/constraints/UIVerticalProportionConstraint.ts","../src/constraints/UIWidthConstraint.ts","../src/builders/UIConstraint2DBuilder.ts","../src/constraints/UIAspectConstraint.ts","../src/builders/UICoverConstraintBuilder.ts","../src/builders/UIFitConstraintBuilder.ts","../src/constraints/UICustomConstraint.ts","../src/elements/UIAnchor.ts","../src/miscellaneous/UIInputEvent.ts","../src/miscellaneous/UIMicroAnchorMode.ts","../src/miscellaneous/UIMicro.ts","../src/elements/UIElement.ts","../src/elements/UIAnimatedImage.ts","../src/elements/UIDummy.ts","../src/elements/UIGraphics.ts","../src/elements/UIImage.ts","../src/miscellaneous/UINineSliceBorder.ts","../src/elements/UINineSline.ts","../src/elements/UIProgress.ts","../src/elements/UIScene.ts","../src/miscellaneous/UITextStyle.ts","../src/miscellaneous/textTools.ts","../src/miscellaneous/UITextPadding.ts","../src/elements/UIText.ts","../src/miscellaneous/UIResizePolicy.ts","../src/miscellaneous/UIResizePolicyNone.ts","../src/layers/UIFullscreenLayer.ts","../src/miscellaneous/UIGenericInstancedPlane.ts","../src/miscellaneous/UIResizePolicyCross.ts","../src/miscellaneous/UIResizePolicyCrossInverted.ts","../src/miscellaneous/UIResizePolicyFixedHeight.ts","../src/miscellaneous/UIResizePolicyFixedWidth.ts","../src/miscellaneous/UITextSpan.ts"],"sourcesContent":["/**\n * Mathematical expression builder for constraint equations in the UI layout system.\n *\n * UIExpression represents linear mathematical expressions of the form:\n * constant + coefficient₁ × variable₁ + coefficient₂ × variable₂ + ... + coefficientₙ × variableₙ\n *\n * These expressions are used to build constraint equations for the Kiwi solver,\n * enabling complex mathematical relationships between UI element properties.\n * Variables are referenced by their numeric descriptors from the solver system.\n *\n * @see {@link UIConstraint} - Constraints that use expressions\n * @see {@link UISolverWrapper} - Solver integration that creates variables\n */\nexport class UIExpression {\n /** The constant term of the expression. */\n public constant: number;\n /** Map of variable descriptors to their coefficients in the expression. */\n private readonly terms: Map<number, number>;\n\n /**\n * Creates a new UIExpression instance.\n *\n * @param constant - The constant term of the expression (defaults to 0)\n * @param terms - Optional array of [variableDescriptor, coefficient] pairs\n */\n constructor(constant = 0, terms?: [number, number][]) {\n this.constant = constant;\n this.terms = terms ? new Map(terms) : new Map();\n }\n\n /**\n * Creates a new expression that represents the sum of two expressions.\n *\n * Performs mathematical addition: (a.constant + a.terms) + (b.constant + b.terms)\n * Coefficients for the same variables are combined.\n *\n * @param a - The first expression\n * @param b - The second expression\n * @returns A new expression representing a + b\n */\n public static plus(a: UIExpression, b: UIExpression): UIExpression {\n const result = new UIExpression(\n a.constant + b.constant,\n Array.from(a.terms.entries()),\n );\n for (const [variableIndex, coefficient] of b.terms) {\n result.plus(variableIndex, coefficient);\n }\n return result;\n }\n\n /**\n * Creates a new expression that represents the difference of two expressions.\n *\n * Performs mathematical subtraction: (a.constant + a.terms) - (b.constant + b.terms)\n * Coefficients for the same variables are combined with subtraction.\n *\n * @param a - The first expression (minuend)\n * @param b - The second expression (subtrahend)\n * @returns A new expression representing a - b\n */\n public static minus(a: UIExpression, b: UIExpression): UIExpression {\n const result = new UIExpression(\n a.constant - b.constant,\n Array.from(a.terms.entries()),\n );\n for (const [variableIndex, coefficient] of b.terms) {\n result.minus(variableIndex, coefficient);\n }\n return result;\n }\n\n /**\n * Adds a variable term to this expression (mutating operation).\n *\n * If the variable already exists in the expression, its coefficient is\n * increased by the specified amount. Otherwise, a new term is added.\n *\n * @param variableIndex - The variable descriptor from the solver\n * @param coefficient - The coefficient to add for this variable\n * @returns This expression instance for method chaining\n */\n public plus(variableIndex: number, coefficient: number): this {\n this.terms.set(\n variableIndex,\n (this.terms.get(variableIndex) ?? 0) + coefficient,\n );\n return this;\n }\n\n /**\n * Subtracts a variable term from this expression (mutating operation).\n *\n * If the variable already exists in the expression, its coefficient is\n * decreased by the specified amount. Otherwise, a new term with negative\n * coefficient is added.\n *\n * @param variableIndex - The variable descriptor from the solver\n * @param coefficient - The coefficient to subtract for this variable\n * @returns This expression instance for method chaining\n */\n public minus(variableIndex: number, coefficient: number): this {\n return this.plus(variableIndex, -coefficient);\n }\n\n /**\n * Multiplies all terms in this expression by a scalar value (mutating operation).\n *\n * Both the constant term and all variable coefficients are multiplied\n * by the specified value.\n *\n * @param value - The scalar value to multiply by\n * @returns This expression instance for method chaining\n */\n public multiply(value: number): this {\n this.constant *= value;\n for (const [variableIndex, coefficient] of this.terms) {\n this.terms.set(variableIndex, coefficient * value);\n }\n return this;\n }\n\n /**\n * Divides all terms in this expression by a scalar value (mutating operation).\n *\n * Both the constant term and all variable coefficients are divided\n * by the specified value.\n *\n * @param value - The scalar value to divide by (must not be zero)\n * @returns This expression instance for method chaining\n */\n public divide(value: number): this {\n return this.multiply(1 / value);\n }\n\n /**\n * Checks if the expression contains a term for the specified variable.\n *\n * @param variableIndex - The variable descriptor to check for\n * @returns True if the expression has a term for this variable, false otherwise\n */\n public hasTerm(variableIndex: number): boolean {\n return this.terms.has(variableIndex);\n }\n\n /**\n * Copies the content of another expression into this expression (mutating operation).\n *\n * Replaces all terms and the constant of this expression with those\n * from the source expression.\n *\n * @param expression - The source expression to copy from\n * @returns This expression instance for method chaining\n */\n public copy(expression: UIExpression): this {\n this.constant = expression.constant;\n this.terms.clear();\n for (const [variableIndex, coefficient] of expression.terms) {\n this.terms.set(variableIndex, coefficient);\n }\n return this;\n }\n\n /**\n * Creates a deep copy of this expression.\n *\n * The returned expression is completely independent and can be modified\n * without affecting the original.\n *\n * @returns A new UIExpression instance with the same content\n */\n public clone(): UIExpression {\n return new UIExpression(this.constant, Array.from(this.terms.entries()));\n }\n\n /**\n * Prepares the variable terms for internal solver operations.\n *\n * Converts the internal terms map to an array format suitable for\n * integration with the constraint solver system.\n *\n * @returns Array of [variableDescriptor, coefficient] pairs\n * @internal\n */\n protected [\"prepareTermsInternal\"](): [number, number][] {\n return Array.from(this.terms.entries());\n }\n}\n","class t{constructor(t,i,r=0){this.t=new WeakMap,this.i=new Map,void 0!==t&&(void 0===i?this.i.set(t,r):this.t.set(i,new Map([[t,r]])))}insert(t,i,r=0){if(void 0===i){if(this.i.has(t))return;return void this.i.set(t,r)}const s=this.t.get(i);void 0===s?this.t.set(i,new Map([[t,r]])):s.has(t)||s.set(t,r)}remove(t,i){if(void 0===i)return void this.i.delete(t);const r=this.t.get(i);void 0!==r&&(r.delete(t),0===r.size&&this.t.delete(i))}has(t,i){if(void 0===i)return this.i.has(t);const r=this.t.get(i);return void 0!==r&&r.has(t)}getPriority(t,i){if(void 0===i)return this.i.get(t);const r=this.t.get(i);return void 0!==r?r.get(t):void 0}}class i{constructor(){this.o=new Map}on(t,i,r,s=0){return this.h(t,!1,s,i,r),this}once(t,i,r,s=0){return this.h(t,!0,s,i,r),this}off(t,i,r){const s=this.o.get(t);if(void 0===s)return this;s.u&&(s.u=!1,s.v=s.v.slice());const o=s.v;if(0===o.length)return this.o.delete(t),this;if(void 0===i){this.o.delete(t);for(let t=0;t<o.length;t++){const i=o[t];s.l.remove(i._,i.p)}return this}{const e=o.length;if(o[0]._===i&&o[0].p===r)return 1===e?this.o.delete(t):o.shift(),this;const n=e-1;if(o[n]._===i&&o[n].p===r)return o.pop(),this;if(e<10||o[0].M===o[n].M)for(let t=1;t<n;t++){const s=o[t];if(s._===i&&s.p===r)return o.splice(t,1),this}else{const t=s.l.getPriority(i,r);if(void 0===t)return this;let e=0,n=o.length-1;for(;e<=n;){const i=e+n>>>1;o[i].M<t?e=i+1:n=i-1}const c=e;for(n=o.length-1;e<=n;){const i=e+n>>>1;o[i].M<=t?e=i+1:n=i-1}const h=n;for(let t=c;t<=h;t++)if(o[t]._===i&&o[t].p===r)return o.splice(t,1),this}}return this}emit(t,...i){const r=this.o.get(t);if(void 0===r)return!1;if(0===r.v.length)return!1;r.u?r.v=r.v.slice():r.u=!0;const s=r.v;let o=!1;for(let t=0;t<s.length;t++){const r=s[t];r._.apply(r.p,i),r.k&&(o=!0,r.m=!0)}const e=this.o.get(t);if(void 0===e)return!0;e.v===s&&(e.u=!1);const n=e.v;if(o){let i=0;for(let t=0;t<n.length;t++){const r=n[t];r.m?e.l.remove(r._,r.p):n[i++]=r}0===i?this.o.delete(t):n.length=i}return!0}h(i,r,s,o,e){let n=this.o.get(i);if(void 0===n)return void this.o.set(i,{v:[{_:o,p:e,M:s,k:r,m:!1}],u:!1,l:new t(o,e,s)});if(n.l.has(o,e))throw Error(\"Event listener already exists\");n.l.insert(o,e,s);const c={_:o,p:e,M:s,k:r,m:!1};n.u&&(n.u=!1,n.v=n.v.slice());{const t=n.v,i=c.M;if(0===t.length||t[t.length-1].M<=i)return void t.push(c);if(t[0].M>=i)return void t.unshift(c);{let r=0,s=t.length;for(;r<s;){const o=r+s>>>1;t[o].M<i?r=o+1:s=o}t.splice(r,0,c)}}}}export{i as Eventail};\n//# sourceMappingURL=index.min.js.map\n","/**\n * Defines the visibility and interactivity state of UI elements.\n *\n * UI elements can be in one of three states:\n * - Hidden: Element is not visible and does not receive input\n * - Visible: Element is visible but does not receive input\n * - Interactive: Element is visible and can receive input events\n */\nexport enum UIMode {\n /**\n * Element is not rendered and does not receive input events.\n * Equivalent to setting `display: none` in CSS.\n */\n HIDDEN = 0,\n\n /**\n * Element is rendered but does not receive input events.\n * Equivalent to setting `pointer-events: none` in CSS.\n */\n VISIBLE = 1,\n\n /**\n * Element is rendered and can receive input events.\n * This is the fully active state for UI elements.\n */\n INTERACTIVE = 2,\n}\n","/**\n * Defines the screen orientation states for UI constraints.\n *\n * This enum is used to specify when certain UI constraints should be active\n * based on the current device/screen orientation.\n */\nexport enum UIOrientation {\n /**\n * Indicates a landscape orientation (width > height).\n * Constraints using this value will only be active in landscape mode.\n */\n HORIZONTAL = 0,\n\n /**\n * Indicates a portrait orientation (height > width).\n * Constraints using this value will only be active in portrait mode.\n */\n VERTICAL = 1,\n\n /**\n * Indicates that the constraint should always be active,\n * regardless of screen orientation.\n */\n ALWAYS = 2,\n}\n\n/**\n * Resolves an optional orientation to a definite value.\n *\n * @param orientation - The orientation to resolve, or undefined\n * @returns The provided orientation, or ALWAYS if none was provided\n */\nexport function resolveOrientation(orientation?: UIOrientation): UIOrientation {\n return orientation ?? UIOrientation.ALWAYS;\n}\n","export function createMap() {\n return new IndexedMap();\n}\nclass IndexedMap {\n index = {};\n array = [];\n /**\n * Returns the number of items in the array.\n */\n size() {\n return this.array.length;\n }\n /**\n * Returns true if the array is empty.\n */\n empty() {\n return this.array.length === 0;\n }\n /**\n * Returns the item at the given array index.\n *\n * @param index The integer index of the desired item.\n */\n itemAt(index) {\n return this.array[index];\n }\n /**\n * Returns true if the key is in the array, false otherwise.\n *\n * @param key The key to locate in the array.\n */\n contains(key) {\n return this.index[key.id()] !== undefined;\n }\n /**\n * Returns the pair associated with the given key, or undefined.\n *\n * @param key The key to locate in the array.\n */\n find(key) {\n const i = this.index[key.id()];\n return i === undefined ? undefined : this.array[i];\n }\n /**\n * Returns the pair associated with the key if it exists.\n *\n * If the key does not exist, a new pair will be created and\n * inserted using the value created by the given factory.\n *\n * @param key The key to locate in the array.\n * @param factory The function which creates the default value.\n */\n setDefault(key, factory) {\n const i = this.index[key.id()];\n if (i === undefined) {\n const pair = new Pair(key, factory());\n this.index[key.id()] = this.array.length;\n this.array.push(pair);\n return pair;\n }\n else {\n return this.array[i];\n }\n }\n /**\n * Insert the pair into the array and return the pair.\n *\n * This will overwrite any existing entry in the array.\n *\n * @param key The key portion of the pair.\n * @param value The value portion of the pair.\n */\n insert(key, value) {\n const pair = new Pair(key, value);\n const i = this.index[key.id()];\n if (i === undefined) {\n this.index[key.id()] = this.array.length;\n this.array.push(pair);\n }\n else {\n this.array[i] = pair;\n }\n return pair;\n }\n /**\n * Removes and returns the pair for the given key, or undefined.\n *\n * @param key The key to remove from the map.\n */\n erase(key) {\n const i = this.index[key.id()];\n if (i === undefined) {\n return undefined;\n }\n this.index[key.id()] = undefined;\n const pair = this.array[i];\n const last = this.array.pop();\n if (pair !== last) {\n this.array[i] = last;\n this.index[last.first.id()] = i;\n }\n return pair;\n }\n /**\n * Create a copy of this associative array.\n */\n copy() {\n const copy = new IndexedMap();\n for (let i = 0; i < this.array.length; i++) {\n const pair = this.array[i].copy();\n copy.array[i] = pair;\n copy.index[pair.first.id()] = i;\n }\n return copy;\n }\n}\n/**\n * A class which defines a generic pair object.\n * @private\n */\n// tslint:disable: max-classes-per-file\nclass Pair {\n first;\n second;\n /**\n * Construct a new Pair object.\n *\n * @param first The first item of the pair.\n * @param second The second item of the pair.\n */\n constructor(first, second) {\n this.first = first;\n this.second = second;\n }\n /**\n * Create a copy of the pair.\n */\n copy() {\n return new Pair(this.first, this.second);\n }\n}\n","import { Expression } from './expression.js';\n/**\n * The primary user constraint variable.\n *\n * @class\n * @param {String} [name=\"\"] The name to associated with the variable.\n */\nexport class Variable {\n constructor(name = '') {\n this._name = name;\n }\n /**\n * Returns the unique id number of the variable.\n * @private\n */\n id() {\n return this._id;\n }\n /**\n * Returns the name of the variable.\n *\n * @return {String} name of the variable\n */\n name() {\n return this._name;\n }\n /**\n * Set the name of the variable.\n *\n * @param {String} name Name of the variable\n */\n setName(name) {\n this._name = name;\n }\n /**\n * Returns the user context object of the variable.\n * @private\n */\n context() {\n return this._context;\n }\n /**\n * Set the user context object of the variable.\n * @private\n */\n setContext(context) {\n this._context = context;\n }\n /**\n * Returns the value of the variable.\n *\n * @return {Number} Calculated value\n */\n value() {\n return this._value;\n }\n /**\n * Set the value of the variable.\n * @private\n */\n setValue(value) {\n this._value = value;\n }\n /**\n * Creates a new Expression by adding a number, variable or expression\n * to the variable.\n *\n * @param {Number|Variable|Expression} value Value to add.\n * @return {Expression} expression\n */\n plus(value) {\n return new Expression(this, value);\n }\n /**\n * Creates a new Expression by substracting a number, variable or expression\n * from the variable.\n *\n * @param {Number|Variable|Expression} value Value to substract.\n * @return {Expression} expression\n */\n minus(value) {\n return new Expression(this, typeof value === 'number' ? -value : [-1, value]);\n }\n /**\n * Creates a new Expression by multiplying with a fixed number.\n *\n * @param {Number} coefficient Coefficient to multiply with.\n * @return {Expression} expression\n */\n multiply(coefficient) {\n return new Expression([coefficient, this]);\n }\n /**\n * Creates a new Expression by dividing with a fixed number.\n *\n * @param {Number} coefficient Coefficient to divide by.\n * @return {Expression} expression\n */\n divide(coefficient) {\n return new Expression([1 / coefficient, this]);\n }\n /**\n * Returns the JSON representation of the variable.\n * @private\n */\n toJSON() {\n return {\n name: this._name,\n value: this._value,\n };\n }\n toString() {\n return this._context + '[' + this._name + ':' + this._value + ']';\n }\n _name;\n _value = 0.0;\n _context = null;\n _id = VarId++;\n}\n/**\n * The internal variable id counter.\n * @private\n */\nlet VarId = 0;\n","import { createMap } from './maptype.js';\nimport { Variable } from './variable.js';\n/**\n * An expression of variable terms and a constant.\n *\n * The constructor accepts an arbitrary number of parameters,\n * each of which must be one of the following types:\n * - number\n * - Variable\n * - Expression\n * - 2-tuple of [number, Variable|Expression]\n *\n * The parameters are summed. The tuples are multiplied.\n *\n * @class\n * @param {...(number|Variable|Expression|Array)} args\n */\nexport class Expression {\n constructor() {\n let parsed = parseArgs(arguments);\n this._terms = parsed.terms;\n this._constant = parsed.constant;\n }\n /**\n * Returns the mapping of terms in the expression.\n *\n * This *must* be treated as const.\n * @private\n */\n terms() {\n return this._terms;\n }\n /**\n * Returns the constant of the expression.\n * @private\n */\n constant() {\n return this._constant;\n }\n /**\n * Returns the computed value of the expression.\n *\n * @private\n * @return {Number} computed value of the expression\n */\n value() {\n let result = this._constant;\n for (let i = 0, n = this._terms.size(); i < n; i++) {\n let pair = this._terms.itemAt(i);\n result += pair.first.value() * pair.second;\n }\n return result;\n }\n /**\n * Creates a new Expression by adding a number, variable or expression\n * to the expression.\n *\n * @param {Number|Variable|Expression} value Value to add.\n * @return {Expression} expression\n */\n plus(value) {\n return new Expression(this, value);\n }\n /**\n * Creates a new Expression by substracting a number, variable or expression\n * from the expression.\n *\n * @param {Number|Variable|Expression} value Value to substract.\n * @return {Expression} expression\n */\n minus(value) {\n return new Expression(this, typeof value === 'number' ? -value : [-1, value]);\n }\n /**\n * Creates a new Expression by multiplying with a fixed number.\n *\n * @param {Number} coefficient Coefficient to multiply with.\n * @return {Expression} expression\n */\n multiply(coefficient) {\n return new Expression([coefficient, this]);\n }\n /**\n * Creates a new Expression by dividing with a fixed number.\n *\n * @param {Number} coefficient Coefficient to divide by.\n * @return {Expression} expression\n */\n divide(coefficient) {\n return new Expression([1 / coefficient, this]);\n }\n isConstant() {\n return this._terms.size() == 0;\n }\n toString() {\n let result = this._terms.array\n .map(function (pair) {\n return pair.second + '*' + pair.first.toString();\n })\n .join(' + ');\n if (!this.isConstant() && this._constant !== 0) {\n result += ' + ';\n }\n result += this._constant;\n return result;\n }\n _terms;\n _constant;\n}\n/**\n * An internal argument parsing function.\n * @private\n */\nfunction parseArgs(args) {\n let constant = 0.0;\n let factory = () => 0.0;\n let terms = createMap();\n for (let i = 0, n = args.length; i < n; ++i) {\n let item = args[i];\n if (typeof item === 'number') {\n constant += item;\n }\n else if (item instanceof Variable) {\n terms.setDefault(item, factory).second += 1.0;\n }\n else if (item instanceof Expression) {\n constant += item.constant();\n let terms2 = item.terms();\n for (let j = 0, k = terms2.size(); j < k; j++) {\n let termPair = terms2.itemAt(j);\n terms.setDefault(termPair.first, factory).second += termPair.second;\n }\n }\n else if (item instanceof Array) {\n if (item.length !== 2) {\n throw new Error('array must have length 2');\n }\n let value = item[0];\n let value2 = item[1];\n if (typeof value !== 'number') {\n throw new Error('array item 0 must be a number');\n }\n if (value2 instanceof Variable) {\n terms.setDefault(value2, factory).second += value;\n }\n else if (value2 instanceof Expression) {\n constant += value2.constant() * value;\n let terms2 = value2.terms();\n for (let j = 0, k = terms2.size(); j < k; j++) {\n let termPair = terms2.itemAt(j);\n terms.setDefault(termPair.first, factory).second += termPair.second * value;\n }\n }\n else {\n throw new Error('array item 1 must be a variable or expression');\n }\n }\n else {\n throw new Error('invalid Expression argument: ' + item);\n }\n }\n return { terms, constant };\n}\n","/**\n * @class Strength\n */\nexport class Strength {\n /**\n * Create a new symbolic strength.\n *\n * @param a strong\n * @param b medium\n * @param c weak\n * @param [w] weight\n * @return strength\n */\n static create(a, b, c, w = 1.0) {\n let result = 0.0;\n result += Math.max(0.0, Math.min(1000.0, a * w)) * 1000000.0;\n result += Math.max(0.0, Math.min(1000.0, b * w)) * 1000.0;\n result += Math.max(0.0, Math.min(1000.0, c * w));\n return result;\n }\n /**\n * The 'required' symbolic strength.\n */\n static required = Strength.create(1000.0, 1000.0, 1000.0);\n /**\n * The 'strong' symbolic strength.\n */\n static strong = Strength.create(1.0, 0.0, 0.0);\n /**\n * The 'medium' symbolic strength.\n */\n static medium = Strength.create(0.0, 1.0, 0.0);\n /**\n * The 'weak' symbolic strength.\n */\n static weak = Strength.create(0.0, 0.0, 1.0);\n /**\n * Clip a symbolic strength to the allowed min and max.\n * @private\n */\n static clip(value) {\n return Math.max(0.0, Math.min(Strength.required, value));\n }\n}\n","import { Expression } from './expression.js';\nimport { Strength } from './strength.js';\n/**\n * An enum defining the linear constraint operators.\n *\n * |Value|Operator|Description|\n * |----|-----|-----|\n * |`Le`|<=|Less than equal|\n * |`Ge`|>=|Greater than equal|\n * |`Eq`|==|Equal|\n *\n * @enum {Number}\n */\nexport var Operator;\n(function (Operator) {\n Operator[Operator[\"Le\"] = 0] = \"Le\";\n Operator[Operator[\"Ge\"] = 1] = \"Ge\";\n Operator[Operator[\"Eq\"] = 2] = \"Eq\";\n})(Operator || (Operator = {}));\n/**\n * A linear constraint equation.\n *\n * A constraint equation is composed of an expression, an operator,\n * and a strength. The RHS of the equation is implicitly zero.\n *\n * @class\n * @param {Expression} expression The constraint expression (LHS).\n * @param {Operator} operator The equation operator.\n * @param {Expression} [rhs] Right hand side of the expression.\n * @param {Number} [strength=Strength.required] The strength of the constraint.\n */\nexport class Constraint {\n constructor(expression, operator, rhs, strength = Strength.required) {\n this._operator = operator;\n this._strength = Strength.clip(strength);\n if (rhs === undefined && expression instanceof Expression) {\n this._expression = expression;\n }\n else {\n this._expression = expression.minus(rhs);\n }\n }\n /**\n * Returns the unique id number of the constraint.\n * @private\n */\n id() {\n return this._id;\n }\n /**\n * Returns the expression of the constraint.\n *\n * @return {Expression} expression\n */\n expression() {\n return this._expression;\n }\n /**\n * Returns the relational operator of the constraint.\n *\n * @return {Operator} linear constraint operator\n */\n op() {\n return this._operator;\n }\n /**\n * Returns the strength of the constraint.\n *\n * @return {Number} strength\n */\n strength() {\n return this._strength;\n }\n toString() {\n return (this._expression.toString() + ' ' + ['<=', '>=', '='][this._operator] + ' 0 (' + this._strength.toString() + ')');\n }\n _expression;\n _operator;\n _strength;\n _id = CnId++;\n}\n/**\n * The internal constraint id counter.\n * @private\n */\nlet CnId = 0;\n","import { Constraint, Operator } from './constraint.js';\nimport { Expression } from './expression.js';\nimport { createMap } from './maptype.js';\nimport { Strength } from './strength.js';\n/**\n * The constraint solver class.\n *\n * @class\n */\nexport class Solver {\n /**\n * @type {number} - The max number of solver iterations before an error\n * is thrown, in order to prevent infinite iteration. Default: `10,000`.\n */\n maxIterations = 1000;\n /**\n * Construct a new Solver.\n */\n constructor() { }\n /**\n * Creates and add a constraint to the solver.\n *\n * @param {Expression|Variable} lhs Left hand side of the expression\n * @param {Operator} operator Operator\n * @param {Expression|Variable|Number} rhs Right hand side of the expression\n * @param {Number} [strength=Strength.required] Strength\n */\n createConstraint(lhs, operator, rhs, strength = Strength.required) {\n let cn = new Constraint(lhs, operator, rhs, strength);\n this.addConstraint(cn);\n return cn;\n }\n /**\n * Add a constraint to the solver.\n *\n * @param {Constraint} constraint Constraint to add to the solver\n */\n addConstraint(constraint) {\n let cnPair = this._cnMap.find(constraint);\n if (cnPair !== undefined) {\n throw new Error('duplicate constraint');\n }\n // Creating a row causes symbols to be reserved for the variables\n // in the constraint. If this method exits with an exception,\n // then its possible those variables will linger in the var map.\n // Since its likely that those variables will be used in other\n // constraints and since exceptional conditions are uncommon,\n // i'm not too worried about aggressive cleanup of the var map.\n let data = this._createRow(constraint);\n let row = data.row;\n let tag = data.tag;\n let subject = this._chooseSubject(row, tag);\n // If chooseSubject couldnt find a valid entering symbol, one\n // last option is available if the entire row is composed of\n // dummy variables. If the constant of the row is zero, then\n // this represents redundant constraints and the new dummy\n // marker can enter the basis. If the constant is non-zero,\n // then it represents an unsatisfiable constraint.\n if (subject.type() === SymbolType.Invalid && row.allDummies()) {\n if (!nearZero(row.constant())) {\n throw new Error('unsatisfiable constraint');\n }\n else {\n subject = tag.marker;\n }\n }\n // If an entering symbol still isn't found, then the row must\n // be added using an artificial variable. If that fails, then\n // the row represents an unsatisfiable constraint.\n if (subject.type() === SymbolType.Invalid) {\n if (!this._addWithArtificialVariable(row)) {\n throw new Error('unsatisfiable constraint');\n }\n }\n else {\n row.solveFor(subject);\n this._substitute(subject, row);\n this._rowMap.insert(subject, row);\n }\n this._cnMap.insert(constraint, tag);\n // Optimizing after each constraint is added performs less\n // aggregate work due to a smaller average system size. It\n // also ensures the solver remains in a consistent state.\n this._optimize(this._objective);\n }\n /**\n * Remove a constraint from the solver.\n *\n * @param {Constraint} constraint Constraint to remove from the solver\n */\n removeConstraint(constraint) {\n let cnPair = this._cnMap.erase(constraint);\n if (cnPair === undefined) {\n throw new Error('unknown constraint');\n }\n // Remove the error effects from the objective function\n // *before* pivoting, or substitutions into the objective\n // will lead to incorrect solver results.\n this._removeConstraintEffects(constraint, cnPair.second);\n // If the marker is basic, simply drop the row. Otherwise,\n // pivot the marker into the basis and then drop the row.\n let marker = cnPair.second.marker;\n let rowPair = this._rowMap.erase(marker);\n if (rowPair === undefined) {\n let leaving = this._getMarkerLeavingSymbol(marker);\n if (leaving.type() === SymbolType.Invalid) {\n throw new Error('failed to find leaving row');\n }\n rowPair = this._rowMap.erase(leaving);\n rowPair.second.solveForEx(leaving, marker);\n this._substitute(marker, rowPair.second);\n }\n // Optimizing after each constraint is removed ensures that the\n // solver remains consistent. It makes the solver api easier to\n // use at a small tradeoff for speed.\n this._optimize(this._objective);\n }\n /**\n * Test whether the solver contains the constraint.\n *\n * @param {Constraint} constraint Constraint to test for\n * @return {Bool} true or false\n */\n hasConstraint(constraint) {\n return this._cnMap.contains(constraint);\n }\n /**\n * Get an array of the current constraints.\n *\n * @return {Constraint[]}\n */\n getConstraints() {\n return this._cnMap.array.map(({ first }) => first);\n }\n /**\n * Add an edit variable to the solver.\n *\n * @param {Variable} variable Edit variable to add to the solver\n * @param {Number} strength Strength, should be less than `Strength.required`\n */\n addEditVariable(variable, strength) {\n let editPair = this._editMap.find(variable);\n if (editPair !== undefined) {\n throw new Error('duplicate edit variable');\n }\n strength = Strength.clip(strength);\n if (strength === Strength.required) {\n throw new Error('bad required strength');\n }\n let expr = new Expression(variable);\n let cn = new Constraint(expr, Operator.Eq, undefined, strength);\n this.addConstraint(cn);\n let tag = this._cnMap.find(cn).second;\n let info = { tag, constraint: cn, constant: 0.0 };\n this._editMap.insert(variable, info);\n }\n /**\n * Remove an edit variable from the solver.\n *\n * @param {Variable} variable Edit variable to remove from the solver\n */\n removeEditVariable(variable) {\n let editPair = this._editMap.erase(variable);\n if (editPair === undefined) {\n throw new Error('unknown edit variable');\n }\n this.removeConstraint(editPair.second.constraint);\n }\n /**\n * Test whether the solver contains the edit variable.\n *\n * @param {Variable} variable Edit variable to test for\n * @return {Bool} true or false\n */\n hasEditVariable(variable) {\n return this._editMap.contains(variable);\n }\n /**\n * Suggest the value of an edit variable.\n *\n * @param {Variable} variable Edit variable to suggest a value for\n * @param {Number} value Suggested value\n */\n suggestValue(variable, value) {\n let editPair = this._editMap.find(variable);\n if (editPair === undefined) {\n throw new Error('unknown edit variable');\n }\n let rows = this._rowMap;\n let info = editPair.second;\n let delta = value - info.constant;\n info.constant = value;\n // Check first if the positive error variable is basic.\n let marker = info.tag.marker;\n let rowPair = rows.find(marker);\n if (rowPair !== undefined) {\n if (rowPair.second.add(-delta) < 0.0) {\n this._infeasibleRows.push(marker);\n }\n this._dualOptimize();\n return;\n }\n // Check next if the negative error variable is basic.\n let other = info.tag.other;\n rowPair = rows.find(other);\n if (rowPair !== undefined) {\n if (rowPair.second.add(delta) < 0.0) {\n this._infeasibleRows.push(other);\n }\n this._dualOptimize();\n return;\n }\n // Otherwise update each row where the error variables exist.\n for (let i = 0, n = rows.size(); i < n; ++i) {\n let rowPair = rows.itemAt(i);\n let row = rowPair.second;\n let coeff = row.coefficientFor(marker);\n if (coeff !== 0.0 && row.add(delta * coeff) < 0.0 && rowPair.first.type() !== SymbolType.External) {\n this._infeasibleRows.push(rowPair.first);\n }\n }\n this._dualOptimize();\n }\n /**\n * Update the values of the variables.\n */\n updateVariables() {\n let vars = this._varMap;\n let rows = this._rowMap;\n for (let i = 0, n = vars.size(); i < n; ++i) {\n let pair = vars.itemAt(i);\n let rowPair = rows.find(pair.second);\n if (rowPair !== undefined) {\n pair.first.setValue(rowPair.second.constant());\n }\n else {\n pair.first.setValue(0.0);\n }\n }\n }\n /**\n * Get the symbol for the given variable.\n *\n * If a symbol does not exist for the variable, one will be created.\n * @private\n */\n _getVarSymbol(variable) {\n let factory = () => this._makeSymbol(SymbolType.External);\n return this._varMap.setDefault(variable, factory).second;\n }\n /**\n * Create a new Row object for the given constraint.\n *\n * The terms in the constraint will be converted to cells in the row.\n * Any term in the constraint with a coefficient of zero is ignored.\n * This method uses the `_getVarSymbol` method to get the symbol for\n * the variables added to the row. If the symbol for a given cell\n * variable is basic, the cell variable will be substituted with the\n * basic row.\n *\n * The necessary slack and error variables will be added to the row.\n * If the constant for the row is negative, the sign for the row\n * will be inverted so the constant becomes positive.\n *\n * Returns the created Row and the tag for tracking the constraint.\n * @private\n */\n _createRow(constraint) {\n let expr = constraint.expression();\n let row = new Row(expr.constant());\n // Substitute the current basic variables into the row.\n let terms = expr.terms();\n for (let i = 0, n = terms.size(); i < n; ++i) {\n let termPair = terms.itemAt(i);\n if (!nearZero(termPair.second)) {\n let symbol = this._getVarSymbol(termPair.first);\n let basicPair = this._rowMap.find(symbol);\n if (basicPair !== undefined) {\n row.insertRow(basicPair.second, termPair.second);\n }\n else {\n row.insertSymbol(symbol, termPair.second);\n }\n }\n }\n // Add the necessary slack, error, and dummy variables.\n let objective = this._objective;\n let strength = constraint.strength();\n let tag = { marker: INVALID_SYMBOL, other: INVALID_SYMBOL };\n switch (constraint.op()) {\n case Operator.Le:\n case Operator.Ge: {\n let coeff = constraint.op() === Operator.Le ? 1.0 : -1.0;\n let slack = this._makeSymbol(SymbolType.Slack);\n tag.marker = slack;\n row.insertSymbol(slack, coeff);\n if (strength < Strength.required) {\n let error = this._makeSymbol(SymbolType.Error);\n tag.other = error;\n row.insertSymbol(error, -coeff);\n objective.insertSymbol(error, strength);\n }\n break;\n }\n case Operator.Eq: {\n if (strength < Strength.required) {\n let errplus = this._makeSymbol(SymbolType.Error);\n let errminus = this._makeSymbol(SymbolType.Error);\n tag.marker = errplus;\n tag.other = errminus;\n row.insertSymbol(errplus, -1.0); // v = eplus - eminus\n row.insertSymbol(errminus, 1.0); // v - eplus + eminus = 0\n objective.insertSymbol(errplus, strength);\n objective.insertSymbol(errminus, strength);\n }\n else {\n let dummy = this._makeSymbol(SymbolType.Dummy);\n tag.marker = dummy;\n row.insertSymbol(dummy);\n }\n break;\n }\n }\n // Ensure the row has a positive constant.\n if (row.constant() < 0.0) {\n row.reverseSign();\n }\n return { row, tag };\n }\n /**\n * Choose the subject for solving for the row.\n *\n * This method will choose the best subject for using as the solve\n * target for the row. An invalid symbol will be returned if there\n * is no valid target.\n *\n * The symbols are chosen according to the following precedence:\n *\n * 1) The first symbol representing an external variable.\n * 2) A negative slack or error tag variable.\n *\n * If a subject cannot be found, an invalid symbol will be returned.\n *\n * @private\n */\n _chooseSubject(row, tag) {\n let cells = row.cells();\n for (let i = 0, n = cells.size(); i < n; ++i) {\n let pair = cells.itemAt(i);\n if (pair.first.type() === SymbolType.External) {\n return pair.first;\n }\n }\n let type = tag.marker.type();\n if (type === SymbolType.Slack || type === SymbolType.Error) {\n if (row.coefficientFor(tag.marker) < 0.0) {\n return tag.marker;\n }\n }\n type = tag.other.type();\n if (type === SymbolType.Slack || type === SymbolType.Error) {\n if (row.coefficientFor(tag.other) < 0.0) {\n return tag.other;\n }\n }\n return INVALID_SYMBOL;\n }\n /**\n * Add the row to the tableau using an artificial variable.\n *\n * This will return false if the constraint cannot be satisfied.\n *\n * @private\n */\n _addWithArtificialVariable(row) {\n // Create and add the artificial variable to the tableau.\n let art = this._makeSymbol(SymbolType.Slack);\n this._rowMap.insert(art, row.copy());\n this._artificial = row.copy();\n // Optimize the artificial objective. This is successful\n // only if the artificial objective is optimized to zero.\n this._optimize(this._artificial);\n let success = nearZero(this._artificial.constant());\n this._artificial = null;\n // If the artificial variable is basic, pivot the row so that\n // it becomes non-basic. If the row is constant, exit early.\n let pair = this._rowMap.erase(art);\n if (pair !== undefined) {\n let basicRow = pair.second;\n if (basicRow.isConstant()) {\n return success;\n }\n let entering = this._anyPivotableSymbol(basicRow);\n if (entering.type() === SymbolType.Invalid) {\n return false; // unsatisfiable (will this ever happen?)\n }\n basicRow.solveForEx(art, entering);\n this._substitute(entering, basicRow);\n this._rowMap.insert(entering, basicRow);\n }\n // Remove the artificial variable from the tableau.\n let rows = this._rowMap;\n for (let i = 0, n = rows.size(); i < n; ++i) {\n rows.itemAt(i).second.removeSymbol(art);\n }\n this._objective.removeSymbol(art);\n return success;\n }\n /**\n * Substitute the parametric symbol with the given row.\n *\n * This method will substitute all instances of the parametric symbol\n * in the tableau and the objective function with the given row.\n *\n * @private\n */\n _substitute(symbol, row) {\n let rows = this._rowMap;\n for (let i = 0, n = rows.size(); i < n; ++i) {\n let pair = rows.itemAt(i);\n pair.second.substitute(symbol, row);\n if (pair.second.constant() < 0.0 && pair.first.type() !== SymbolType.External) {\n this._infeasibleRows.push(pair.first);\n }\n }\n this._objective.substitute(symbol, row);\n if (this._artificial) {\n this._artificial.substitute(symbol, row);\n }\n }\n /**\n * Optimize the system for the given objective function.\n *\n * This method performs iterations of Phase 2 of the simplex method\n * until the objective function reaches a minimum.\n *\n * @private\n */\n _optimize(objective) {\n let iterations = 0;\n while (iterations < this.maxIterations) {\n let entering = this._getEnteringSymbol(objective);\n if (entering.type() === SymbolType.Invalid) {\n return;\n }\n let leaving = this._getLeavingSymbol(entering);\n if (leaving.type() === SymbolType.Invalid) {\n throw new Error('the objective is unbounded');\n }\n // pivot the entering symbol into the basis\n let row = this._rowMap.erase(leaving).second;\n row.solveForEx(leaving, entering);\n this._substitute(entering, row);\n this._rowMap.insert(entering, row);\n iterations++;\n }\n throw new Error('solver iterations exceeded');\n }\n /**\n * Optimize the system using the dual of the simplex method.\n *\n * The current state of the system should be such that the objective\n * function is optimal, but not feasible. This method will perform\n * an iteration of the dual simplex method to make the solution both\n * optimal and feasible.\n *\n * @private\n */\n _dualOptimize() {\n let rows = this._rowMap;\n let infeasible = this._infeasibleRows;\n while (infeasible.length !== 0) {\n let leaving = infeasible.pop();\n let pair = rows.find(leaving);\n if (pair !== undefined && pair.second.constant() < 0.0) {\n let entering = this._getDualEnteringSymbol(pair.second);\n if (entering.type() === SymbolType.Invalid) {\n throw new Error('dual optimize failed');\n }\n // pivot the entering symbol into the basis\n let row = pair.second;\n rows.erase(leaving);\n row.solveForEx(leaving, entering);\n this._substitute(entering, row);\n rows.insert(entering, row);\n }\n }\n }\n /**\n * Compute the entering variable for a pivot operation.\n *\n * This method will return first symbol in the objective function which\n * is non-dummy and has a coefficient less than zero. If no symbol meets\n * the criteria, it means the objective function is at a minimum, and an\n * invalid symbol is returned.\n *\n * @private\n */\n _getEnteringSymbol(objective) {\n let cells = objective.cells();\n for (let i = 0, n = cells.size(); i < n; ++i) {\n let pair = cells.itemAt(i);\n let symbol = pair.first;\n if (pair.second < 0.0 && symbol.type() !== SymbolType.Dummy) {\n return symbol;\n }\n }\n return INVALID_SYMBOL;\n }\n /**\n * Compute the entering symbol for the dual optimize operation.\n *\n * This method will return the symbol in the row which has a positive\n * coefficient and yields the minimum ratio for its respective symbol\n * in the objective function. The provided row *must* be infeasible.\n * If no symbol is found which meats the criteria, an invalid symbol\n * is returned.\n *\n * @private\n */\n _getDualEnteringSymbol(row) {\n let ratio = Number.MAX_VALUE;\n let entering = INVALID_SYMBOL;\n let cells = row.cells();\n for (let i = 0, n = cells.size(); i < n; ++i) {\n let pair = cells.itemAt(i);\n let symbol = pair.first;\n let c = pair.second;\n if (c > 0.0 && symbol.type() !== SymbolType.Dummy) {\n let coeff = this._objective.coefficientFor(symbol);\n let r = coeff / c;\n if (r < ratio) {\n ratio = r;\n entering = symbol;\n }\n }\n }\n return entering;\n }\n /**\n * Compute the symbol for pivot exit row.\n *\n * This method will return the symbol for the exit row in the row\n * map. If no appropriate exit symbol is found, an invalid symbol\n * will be returned. This indicates that the objective function is\n * unbounded.\n *\n * @private\n */\n _getLeavingSymbol(entering) {\n let ratio = Number.MAX_VALUE;\n let found = INVALID_SYMBOL;\n let rows = this._rowMap;\n for (let i = 0, n = rows.size(); i < n; ++i) {\n let pair = rows.itemAt(i);\n let symbol = pair.first;\n if (symbol.type() !== SymbolType.External) {\n let row = pair.second;\n let temp = row.coefficientFor(entering);\n if (temp < 0.0) {\n let temp_ratio = -row.constant() / temp;\n if (temp_ratio < ratio) {\n ratio = temp_ratio;\n found = symbol;\n }\n }\n }\n }\n return found;\n }\n /**\n * Compute the leaving symbol for a marker variable.\n *\n * This method will return a symbol corresponding to a basic row\n * which holds the given marker variable. The row will be chosen\n * according to the following precedence:\n *\n * 1) The row with a restricted basic varible and a negative coefficient\n * for the marker with the smallest ratio of -constant / coefficient.\n *\n * 2) The row with a restricted basic variable and the smallest ratio\n * of constant / coefficient.\n *\n * 3) The last unrestricted row which contains the marker.\n *\n * If the marker does not exist in any row, an invalid symbol will be\n * returned. This indicates an internal solver error since the marker\n * *should* exist somewhere in the tableau.\n *\n * @private\n */\n _getMarkerLeavingSymbol(marker) {\n let dmax = Number.MAX_VALUE;\n let r1 = dmax;\n let r2 = dmax;\n let invalid = INVALID_SYMBOL;\n let first = invalid;\n let second = invalid;\n let third = invalid;\n let rows = this._rowMap;\n for (let i = 0, n = rows.size(); i < n; ++i) {\n let pair = rows.itemAt(i);\n let row = pair.second;\n let c = row.coefficientFor(marker);\n if (c === 0.0) {\n continue;\n }\n let symbol = pair.first;\n if (symbol.type() === SymbolType.External) {\n third = symbol;\n }\n else if (c < 0.0) {\n let r = -row.constant() / c;\n if (r < r1) {\n r1 = r;\n first = symbol;\n }\n }\n else {\n let r = row.constant() / c;\n if (r < r2) {\n r2 = r;\n second = symbol;\n }\n }\n }\n if (first !== invalid) {\n return first;\n }\n if (second !== invalid) {\n return second;\n }\n return third;\n }\n /**\n * Remove the effects of a constraint on the objective function.\n *\n * @private\n */\n _removeConstraintEffects(cn, tag) {\n if (tag.marker.type() === SymbolType.Error) {\n this._removeMarkerEffects(tag.marker, cn.strength());\n }\n if (tag.other.type() === SymbolType.Error) {\n this._removeMarkerEffects(tag.other, cn.strength());\n }\n }\n /**\n * Remove the effects of an error marker on the objective function.\n *\n * @private\n */\n _removeMarkerEffects(marker, strength) {\n let pair = this._rowMap.find(marker);\n if (pair !== undefined) {\n this._objective.insertRow(pair.second, -strength);\n }\n else {\n this._objective.insertSymbol(marker, -strength);\n }\n }\n /**\n * Get the first Slack or Error symbol in the row.\n *\n * If no such symbol is present, an invalid symbol will be returned.\n *\n * @private\n */\n _anyPivotableSymbol(row) {\n let cells = row.cells();\n for (let i = 0, n = cells.size(); i < n; ++i) {\n let pair = cells.itemAt(i);\n let type = pair.first.type();\n if (type === SymbolType.Slack || type === SymbolType.Error) {\n return pair.first;\n }\n }\n return INVALID_SYMBOL;\n }\n /**\n * Returns a new Symbol of the given type.\n *\n * @private\n */\n _makeSymbol(type) {\n return new Symbol(type, this._idTick++);\n }\n _cnMap = createCnMap();\n _rowMap = createRowMap();\n _varMap = createVarMap();\n _editMap = createEditMap();\n _infeasibleRows = [];\n _objective = new Row();\n _artificial = null;\n _idTick = 0;\n}\n/**\n * Test whether a value is approximately zero.\n * @private\n */\nfunction nearZero(value) {\n let eps = 1.0e-8;\n return value < 0.0 ? -value < eps : value < eps;\n}\n/**\n * An internal function for creating a constraint map.\n * @private\n */\nfunction createCnMap() {\n return createMap();\n}\n/**\n * An internal function for creating a row map.\n * @private\n */\nfunction createRowMap() {\n return createMap();\n}\n/**\n * An internal function for creating a variable map.\n * @private\n */\nfunction createVarMap() {\n return createMap();\n}\n/**\n * An internal function for creating an edit map.\n * @private\n */\nfunction createEditMap() {\n return createMap();\n}\n/**\n * An enum defining the available symbol types.\n * @private\n */\nvar SymbolType;\n(function (SymbolType) {\n SymbolType[SymbolType[\"Invalid\"] = 0] = \"Invalid\";\n SymbolType[SymbolType[\"External\"] = 1] = \"External\";\n SymbolType[SymbolType[\"Slack\"] = 2] = \"Slack\";\n SymbolType[SymbolType[\"Error\"] = 3] = \"Error\";\n SymbolType[SymbolType[\"Dummy\"] = 4] = \"Dummy\";\n})(SymbolType || (SymbolType = {}));\n/**\n * An internal class representing a symbol in the solver.\n * @private\n */\nclass Symbol {\n /**\n * Construct a new Symbol\n *\n * @param [type] The type of the symbol.\n * @param [id] The unique id number of the symbol.\n */\n constructor(type, id) {\n this._id = id;\n this._type = type;\n }\n /**\n * Returns the unique id number of the symbol.\n */\n id() {\n return this._id;\n }\n /**\n * Returns the type of the symbol.\n */\n type() {\n return this._type;\n }\n _id;\n _type;\n}\n/**\n * A static invalid symbol\n * @private\n */\nlet INVALID_SYMBOL = new Symbol(SymbolType.Invalid, -1);\n/**\n * An internal row class used by the solver.\n * @private\n */\nclass Row {\n /**\n * Construct a new Row.\n */\n constructor(constant = 0.0) {\n this._constant = constant;\n }\n /**\n * Returns the mapping of symbols to coefficients.\n */\n cells() {\n return this._cellMap;\n }\n /**\n * Returns the constant for the row.\n */\n constant() {\n return this._constant;\n }\n /**\n * Returns true if the row is a constant value.\n */\n isConstant() {\n return this._cellMap.empty();\n }\n /**\n * Returns true if the Row has all dummy symbols.\n */\n allDummies() {\n let cells = this._cellMap;\n for (let i = 0, n = cells.size(); i < n; ++i) {\n let pair = cells.itemAt(i);\n if (pair.first.type() !== SymbolType.Dummy) {\n return false;\n }\n }\n return true;\n }\n /**\n * Create a copy of the row.\n */\n copy() {\n let theCopy = new Row(this._constant);\n theCopy._cellMap = this._cellMap.copy();\n return theCopy;\n }\n /**\n * Add a constant value to the row constant.\n *\n * Returns the new value of the constant.\n */\n add(value) {\n return (this._constant += value);\n }\n /**\n * Insert the symbol into the row with the given coefficient.\n *\n * If the symbol already exists in the row, the coefficient\n * will be added to the existing coefficient. If the resulting\n * coefficient is zero, the symbol will be removed from the row.\n */\n insertSymbol(symbol, coefficient = 1.0) {\n let pair = this._cellMap.setDefault(symbol, () => 0.0);\n if (nearZero((pair.second += coefficient))) {\n this._cellMap.erase(symbol);\n }\n }\n /**\n * Insert a row into this row with a given coefficient.\n *\n * The constant and the cells of the other row will be\n * multiplied by the coefficient and added to this row. Any\n * cell with a resulting coefficient of zero will be removed\n * from the row.\n */\n insertRow(other, coefficient = 1.0) {\n this._constant += other._constant * coefficient;\n let cells = other._cellMap;\n for (let i = 0, n = cells.size(); i < n; ++i) {\n let pair = cells.itemAt(i);\n this.insertSymbol(pair.first, pair.second * coefficient);\n }\n }\n /**\n * Remove a symbol from the row.\n */\n removeSymbol(symbol) {\n this._cellMap.erase(symbol);\n }\n /**\n * Reverse the sign of the constant and cells in the row.\n */\n reverseSign() {\n this._constant = -this._constant;\n let cells = this._cellMap;\n for (let i = 0, n = cells.size(); i < n; ++i) {\n let pair = cells.itemAt(i);\n pair.second = -pair.second;\n }\n }\n /**\n * Solve the row for the given symbol.\n *\n * This method assumes the row is of the form\n * a * x + b * y + c = 0 and (assuming solve for x) will modify\n * the row to represent the right hand side of\n * x = -b/a * y - c / a. The target symbol will be removed from\n * the row, and the constant and other cells will be multiplied\n * by the negative inverse of the target coefficient.\n *\n * The given symbol *must* exist in the row.\n */\n solveFor(symbol) {\n let cells = this._cellMap;\n let pair = cells.erase(symbol);\n let coeff = -1.0 / pair.second;\n this._constant *= coeff;\n for (let i = 0, n = cells.size(); i < n; ++i) {\n cells.itemAt(i).second *= coeff;\n }\n }\n /**\n * Solve the row for the given symbols.\n *\n * This method assumes the row is of the form\n * x = b * y + c and will solve the row such that\n * y = x / b - c / b. The rhs symbol will be removed from the\n * row, the lhs added, and the result divided by the negative\n * inverse of the rhs coefficient.\n *\n * The lhs symbol *must not* exist in the row, and the rhs\n * symbol must* exist in the row.\n */\n solveForEx(lhs, rhs) {\n this.insertSymbol(lhs, -1.0);\n this.solveFor(rhs);\n }\n /**\n * Returns the coefficient for the given symbol.\n */\n coefficientFor(symbol) {\n let pair = this._cellMap.find(symbol);\n return pair !== undefined ? pair.second : 0.0;\n }\n /**\n * Substitute a symbol with the data from another row.\n *\n * Given a row of the form a * x + b and a substitution of the\n * form x = 3 * y + c the row will be updated to reflect the\n * expression 3 * a * y + a * c + b.\n *\n * If the symbol does not exist in the row, this is a no-op.\n */\n substitute(symbol, row) {\n let pair = this._cellMap.erase(symbol);\n if (pair !== undefined) {\n this.insertRow(row, pair.second);\n }\n }\n _cellMap = createMap();\n _constant;\n}\n","import { Strength } from \"@lume/kiwi\";\n\n/** High priority value for constraint solver strength calculations. */\nconst HIGH_PRIORITY = 1000;\n/** Medium priority value for constraint solver strength calculations. */\nconst MEDIUM_PRIORITY = 100;\n/** Low priority value for constraint solver strength calculations. */\nconst LOW_PRIORITY = 10;\n\n/**\n * Priority levels for UI layout constraints and variables.\n *\n * UIPriority defines a hierarchical system of priority levels used by the\n * constraint solver to determine which constraints should take precedence\n * when conflicts arise. Lower numeric values represent higher priority,\n * with P0 being the highest priority and P7 being the lowest.\n *\n * The priority system maps to Kiwi solver strength values with different\n * strength components (required, strong, medium, weak) to create a nuanced\n * priority hierarchy for layout solving.\n *\n * @see {@link convertPriority} - Converts to Kiwi solver strength values\n */\nexport enum UIPriority {\n /** Highest priority - required constraints that must be satisfied. */\n P0 = 0,\n /** High priority - strong constraints with medium strength. */\n P1 = 1,\n /** Medium-high priority - strong constraints with low strength. */\n P2 = 2,\n /** Medium priority - medium strength constraints. */\n P3 = 3,\n /** Medium-low priority - medium strength constraints with low weight. */\n P4 = 4,\n /** Low priority - weak strength constraints with medium weight. */\n P5 = 5,\n /** Very low priority - weak strength constraints with low weight. */\n P6 = 6,\n /** Lowest priority - weak strength constraints with minimal weight. */\n P7 = 7,\n}\n\n/**\n * Converts UIPriority enum values to Kiwi solver strength values.\n *\n * This function maps the UI priority levels to the three-component strength\n * system used by the Kiwi constraint solver (required, strong, medium, weak).\n * Higher priority levels get stronger constraint strength values.\n *\n * @param priority - The UI priority level to convert\n * @returns The corresponding Kiwi solver strength value\n * @throws Will throw an error if an invalid priority is provided\n * @see {@link UIPriority} - Priority level definitions\n */\nexport function convertPriority(priority: UIPriority): number {\n switch (priority) {\n case UIPriority.P0:\n return Strength.create(HIGH_PRIORITY, HIGH_PRIORITY, HIGH_PRIORITY);\n case UIPriority.P1:\n return Strength.create(MEDIUM_PRIORITY, 0, 0);\n case UIPriority.P2:\n return Strength.create(LOW_PRIORITY, 0, 0);\n case UIPriority.P3:\n return Strength.create(0, MEDIUM_PRIORITY, 0);\n case UIPriority.P4:\n return Strength.create(0, LOW_PRIORITY, 0);\n case UIPriority.P5:\n return Strength.create(0, 0, MEDIUM_PRIORITY);\n case UIPriority.P6:\n return Strength.create(0, 0, LOW_PRIORITY);\n case UIPriority.P7:\n return Strength.create(0, 0, 1);\n default:\n throw new Error(`Invalid priority: ${priority}`);\n }\n}\n\n/**\n * Resolves an optional priority value to a concrete UIPriority.\n *\n * If no priority is provided, returns the default highest priority (P0).\n * This function is commonly used in constraint creation where priority\n * is an optional parameter.\n *\n * @param priority - The optional priority value to resolve\n * @returns The resolved priority, defaulting to P0 if undefined\n */\nexport function resolvePriority(priority?: UIPriority): UIPriority {\n return priority ?? UIPriority.P0;\n}\n","import { Eventail } from \"eventail\";\nimport { Color, Vector4 } from \"three\";\n\n/**\n * Converts sRGB component to linear color space.\n * @param c - sRGB component value (0-1)\n * @returns Linear component value (0-1)\n */\nfunction sRGBToLinear(c: number): number {\n return c <= 0.04045 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);\n}\n\nconst COLORS: Record<string, number | undefined> = {\n black: 0x000000,\n white: 0xffffff,\n red: 0xff0000,\n green: 0x008000,\n blue: 0x0000ff,\n yellow: 0xffff00,\n cyan: 0x00ffff,\n magenta: 0xff00ff,\n\n gray: 0x808080,\n grey: 0x808080,\n silver: 0xc0c0c0,\n maroon: 0x800000,\n olive: 0x808000,\n lime: 0x00ff00,\n aqua: 0x00ffff,\n teal: 0x008080,\n navy: 0x000080,\n fuchsia: 0xff00ff,\n purple: 0x800080,\n\n orange: 0xffa500,\n pink: 0xffc0cb,\n brown: 0xa52a2a,\n gold: 0xffd700,\n violet: 0xee82ee,\n indigo: 0x4b0082,\n coral: 0xff7f50,\n salmon: 0xfa8072,\n khaki: 0xf0e68c,\n plum: 0xdda0dd,\n orchid: 0xda70d6,\n tan: 0xd2b48c,\n beige: 0xf5f5dc,\n mint: 0x98fb98,\n lavender: 0xe6e6fa,\n crimson: 0xdc143c,\n azure: 0xf0ffff,\n ivory: 0xfffff0,\n snow: 0xfffafa,\n};\n\n/**\n * Predefined color names supported by UIColor.\n */\nexport type UIColorName =\n | \"black\"\n | \"white\"\n | \"red\"\n | \"green\"\n | \"blue\"\n | \"yellow\"\n | \"cyan\"\n | \"magenta\"\n | \"gray\"\n | \"grey\"\n | \"silver\"\n | \"maroon\"\n | \"olive\"\n | \"lime\"\n | \"aqua\"\n | \"teal\"\n | \"navy\"\n | \"fuchsia\"\n | \"purple\"\n | \"orange\"\n | \"pink\"\n | \"brown\"\n | \"gold\"\n | \"violet\"\n | \"indigo\"\n | \"coral\"\n | \"salmon\"\n | \"khaki\"\n | \"plum\"\n | \"orchid\"\n | \"tan\"\n | \"beige\"\n | \"mint\"\n | \"lavender\"\n | \"crimson\"\n | \"azure\"\n | \"ivory\"\n | \"snow\";\n\n/**\n * Events emitted by UIColor.\n */\nexport enum UIColorEvent {\n /** Emitted when color components change. */\n CHANGE = \"change\",\n}\n\n/**\n * Event-based RGBA color with support for RGB, HSL, hex, and named colors.\n * Color components are stored as normalized values (0-1).\n */\nexport class UIColor extends Eventail {\n private rInternal = 1;\n private gInternal = 1;\n private bInternal = 1;\n private aInternal = 1;\n\n private hInternal = 0;\n private sInternal = 0;\n private lInternal = 1;\n\n private rgbDirty = false;\n private hslDirty = false;\n\n constructor();\n /**\n * @param r - Red (0-1)\n * @param g - Green (0-1)\n * @param b - Blue (0-1)\n * @param a - Alpha (0-1)\n */\n // eslint-disable-next-line @typescript-eslint/unified-signatures -- Separate overloads make the different constructor patterns more clear\n constructor(r: number, g: number, b: number, a?: number);\n /**\n * @param colorName - Named color\n * @param a - Alpha (0-1)\n */\n // eslint-disable-next-line @typescript-eslint/unified-signatures -- Separate overloads make the different constructor patterns more clear\n constructor(colorName: UIColorName, a?: number);\n /**\n * @param threeColor - Three.js Color object\n * @param a - Alpha (0-1)\n */\n // eslint-disable-next-line @typescript-eslint/unified-signatures -- Separate overloads make the different constructor patterns more clear\n constructor(threeColor: Color, a?: number);\n /**\n * @param hexRGB - Hex RGB value (e.g., 0xFF0000)\n * @param a - Alpha (0-1)\n */\n // eslint-disable-next-line @typescript-eslint/unified-signatures -- Separate overloads make the different constructor patterns more clear\n constructor(hexRGB: number, a?: number);\n constructor(...args: unknown[]) {\n super();\n\n if (args.length >= 3 && typeof args[0] === \"number\") {\n const [r, g, b, a = 1] = args as number[];\n this.rInternal = r;\n this.gInternal = g;\n this.bInternal = b;\n this.aInternal = a;\n } else if (args.length >= 1) {\n const [firstArgument, a = 1] = args;\n if (typeof firstArgument === \"string\") {\n this.setColorName(firstArgument as UIColorName, a as number);\n } else if (firstArgument instanceof Color) {\n this.rInternal = firstArgument.r;\n this.gInternal = firstArgument.g;\n this.bInternal = firstArgument.b;\n this.aInternal = a as number;\n } else {\n this.setHexRGB(firstArgument as number, a as number);\n }\n }\n }\n\n /** Creates black color (0x000000). */\n public static get black(): UIColor {\n return new UIColor(\"black\");\n }\n\n /** Creates white color (0xFFFFFF). */\n public static get white(): UIColor {\n return new UIColor(\"white\");\n }\n\n /** Creates red color (0xFF0000). */\n public static get red(): UIColor {\n return new UIColor(\"red\");\n }\n\n /** Creates green color (0x008000). */\n public static get green(): UIColor {\n return new UIColor(\"green\");\n }\n\n /** Creates blue color (0x0000FF). */\n public static get blue(): UIColor {\n return new UIColor(\"blue\");\n }\n\n /** Creates yellow color (0xFFFF00). */\n public static get yellow(): UIColor {\n return new UIColor(\"yellow\");\n }\n\n /** Creates cyan color (0x00FFFF). */\n public static get cyan(): UIColor {\n return new UIColor(\"cyan\");\n }\n\n /** Creates magenta color (0xFF00FF). */\n public static get magenta(): UIColor {\n return new UIColor(\"magenta\");\n }\n\n /** Creates gray color (0x808080). */\n public static get gray(): UIColor {\n return new UIColor(\"gray\");\n }\n\n /** Creates grey color (0x808080). */\n public static get grey(): UIColor {\n return new UIColor(\"grey\");\n }\n\n /** Creates silver color (0xC0C0C0). */\n public static get silver(): UIColor {\n return new UIColor(\"silver\");\n }\n\n /** Creates maroon color (0x800000). */\n public static get maroon(): UIColor {\n return new UIColor(\"maroon\");\n }\n\n /** Creates olive color (0x808000). */\n public static get olive(): UIColor {\n return new UIColor(\"olive\");\n }\n\n /** Creates lime color (0x00FF00). */\n public static get lime(): UIColor {\n return new UIColor(\"lime\");\n }\n\n /** Creates aqua color (0x00FFFF). */\n public static get aqua(): UIColor {\n return new UIColor(\"aqua\");\n }\n\n /** Creates teal color (0x008080). */\n public static get teal(): UIColor {\n return new UIColor(\"teal\");\n }\n\n /** Creates navy color (0x000080). */\n public static get navy(): UIColor {\n return new UIColor(\"navy\");\n }\n\n /** Creates fuchsia color (0xFF00FF). */\n public static get fuchsia(): UIColor {\n return new UIColor(\"fuchsia\");\n }\n\n /** Creates purple color (0x800080). */\n public static get purple(): UIColor {\n return new UIColor(\"purple\");\n }\n\n /** Creates orange color (0xFFA500). */\n public static get orange(): UIColor {\n return new UIColor(\"orange\");\n }\n\n /** Creates pink color (0xFFC0CB). */\n public static get pink(): UIColor {\n return new UIColor(\"pink\");\n }\n\n /** Creates brown color (0xA52A2A). */\n public static get brown(): UIColor {\n return new UIColor(\"brown\");\n }\n\n /** Creates gold color (0xFFD700). */\n public static get gold(): UIColor {\n return new UIColor(\"gold\");\n }\n\n /** Creates violet color (0xEE82EE). */\n public static get violet(): UIColor {\n return new UIColor(\"violet\");\n }\n\n /** Creates indigo color (0x4B0082). */\n public static get indigo(): UIColor {\n return new UIColor(\"indigo\");\n }\n\n /** Creates coral color (0xFF7F50). */\n public static get coral(): UIColor {\n return new UIColor(\"coral\");\n }\n\n /** Creates salmon color (0xFA8072). */\n public static get salmon(): UIColor {\n return new UIColor(\"salmon\");\n }\n\n /** Creates khaki color (0xF0E68C). */\n public static get khaki(): UIColor {\n return new UIColor(\"khaki\");\n }\n\n /** Creates plum color (0xDDA0DD). */\n public static get plum(): UIColor {\n return new UIColor(\"plum\");\n }\n\n /** Creates orchid color (0xDA70D6). */\n public static get orchid(): UIColor {\n return new UIColor(\"orchid\");\n }\n\n /** Creates tan color (0xD2B48C). */\n public static get tan(): UIColor {\n return new UIColor(\"tan\");\n }\n\n /** Creates beige color (0xF5F5DC). */\n public static get beige(): UIColor {\n return new UIColor(\"beige\");\n }\n\n /** Creates mint color (0x98FB98). */\n public static get mint(): UIColor {\n return new UIColor(\"mint\");\n }\n\n /** Creates lavender color (0xE6E6FA). */\n public static get lavender(): UIColor {\n return new UIColor(\"lavender\");\n }\n\n /** Creates crimson color (0xDC143C). */\n public static get crimson(): UIColor {\n return new UIColor(\"crimson\");\n }\n\n /** Creates azure color (0xF0FFFF). */\n public static get azure(): UIColor {\n return new UIColor(\"azure\");\n }\n\n /** Creates ivory color (0xFFFFF0). */\n public static get ivory(): UIColor {\n return new UIColor(\"ivory\");\n }\n\n /** Creates snow color (0xFFFAFA). */\n public static get snow(): UIColor {\n return new UIColor(\"snow\");\n }\n\n /** Red component (0-1). */\n public get r(): number {\n this.ensureRGBUpdatedFromHSL();\n return this.rInternal;\n }\n\n /** Green component (0-1). */\n public get g(): number {\n this.ensureRGBUpdatedFromHSL();\n return this.gInternal;\n }\n\n /** Blue component (0-1). */\n public get b(): number {\n this.ensureRGBUpdatedFromHSL();\n return this.bInternal;\n }\n\n /** Alpha component (0-1). */\n public get a(): number {\n return this.aInternal;\n }\n\n /** Hue component (0-360). */\n public get hue(): number {\n this.ensureHSLUpdatedFromRGB();\n return this.hInternal;\n }\n\n /** Saturation component (0-1). */\n public get saturation(): number {\n this.ensureHSLUpdatedFromRGB();\n return this.sInternal;\n }\n\n /** Lightness component (0-1). */\n public get lightness(): number {\n this.ensureHSLUpdatedFromRGB();\n return this.lInternal;\n }\n\n public set r(value: number) {\n this.ensureRGBUpdatedFromHSL();\n if (value !== this.rInternal) {\n this.rInternal = value;\n this.hslDirty = true;\n this.emit(UIColorEvent.CHANGE, this);\n }\n }\n\n public set g(value: number) {\n this.ensureRGBUpdatedFromHSL();\n if (value !== this.gInternal) {\n this.gInternal = value;\n this.hslDirty = true;\n this.emit(UIColorEvent.CHANGE, this);\n }\n }\n\n public set b(value: number) {\n this.ensureRGBUpdatedFromHSL();\n if (value !== this.bInternal) {\n this.bInternal = value;\n this.hslDirty = true;\n this.emit(UIColorEvent.CHANGE, this);\n }\n }\n\n public set a(value: number) {\n if (value !== this.aInternal) {\n this.aInternal = value;\n this.emit(UIColorEvent.CHANGE, this);\n }\n }\n\n public set hue(value: number) {\n this.ensureHSLUpdatedFromRGB();\n if (value !== this.hInternal) {\n this.hInternal = value;\n this.rgbDirty = true;\n this.emit(UIColorEvent.CHANGE, this);\n }\n }\n\n public set saturation(value: number) {\n this.ensureHSLUpdatedFromRGB();\n if (value !== this.sInternal) {\n this.sInternal = value;\n this.rgbDirty = true;\n this.emit(UIColorEvent.CHANGE, this);\n }\n }\n\n public set lightness(value: number) {\n this.ensureHSLUpdatedFromRGB();\n if (value !== this.lInternal) {\n this.lInternal = value;\n this.rgbDirty = true;\n this.emit(UIColorEvent.CHANGE, this);\n }\n }\n\n /**\n * Sets all color components.\n *\n * @param r - Red (0-1)\n * @param g - Green (0-1)\n * @param b - Blue (0-1)\n * @param a - Alpha (0-1)\n * @returns This instance\n */\n public set(\n r: number,\n g: number,\n b: number,\n a: number = this.aInternal,\n ): this {\n this.ensureRGBUpdatedFromHSL();\n if (\n r !== this.rInternal ||\n g !== this.gInternal ||\n b !== this.bInternal ||\n a !== this.aInternal\n ) {\n this.rInternal = r;\n this.gInternal = g;\n this.bInternal = b;\n this.aInternal = a;\n this.hslDirty = true;\n this.emit(UIColorEvent.CHANGE, this);\n }\n return this;\n }\n\n /**\n * Returns 32-bit hex RGBA value (alpha in MSB).\n */\n public getHexRGBA(): number {\n this.ensureRGBUpdatedFromHSL();\n return (\n (Math.round(this.rInternal * 255) << 24) |\n (Math.round(this.gInternal * 255) << 16) |\n (Math.round(this.bInternal * 255) << 8) |\n Math.round(this.aInternal * 255)\n );\n }\n\n /**\n * Returns 24-bit hex RGB value.\n */\n public getHexRGB(): number {\n this.ensureRGBUpdatedFromHSL();\n return (\n (Math.round(this.rInternal * 255) << 16) |\n (Math.round(this.gInternal * 255) << 8) |\n Math.round(this.bInternal * 255)\n );\n }\n\n /**\n * Sets color from 32-bit hex RGBA value.\n *\n * @param hex - Hex RGBA (alpha in MSB)\n * @returns This instance\n */\n public setHexRGBA(hex: number): this {\n this.ensureRGBUpdatedFromHSL();\n const r = ((hex >> 16) & 0xff) / 255;\n const g = ((hex >> 8) & 0xff) / 255;\n const b = (hex & 0xff) / 255;\n const a = ((hex >> 24) & 0xff) / 255;\n if (\n r !== this.rInternal ||\n g !== this.gInternal ||\n b !== this.bInternal ||\n a !== this.aInternal\n ) {\n this.rInternal = r;\n this.gInternal = g;\n this.bInternal = b;\n this.aInternal = a;\n this.hslDirty = true;\n this.emit(UIColorEvent.CHANGE, this);\n }\n return this;\n }\n\n /**\n * Sets color from 24-bit hex RGB value.\n *\n * @param hex - Hex RGB (e.g., 0xFF0000)\n * @param a - Alpha (0-1)\n * @returns This instance\n */\n public setHexRGB(hex: number, a = this.aInternal): this {\n this.ensureRGBUpdatedFromHSL();\n const r = ((hex >> 16) & 0xff) / 255;\n const g = ((hex >> 8) & 0xff) / 255;\n const b = (hex & 0xff) / 255;\n if (\n r !== this.rInternal ||\n g !== this.gInternal ||\n b !== this.bInternal ||\n a !== this.aInternal\n ) {\n this.rInternal = r;\n this.gInternal = g;\n this.bInternal = b;\n this.aInternal = a;\n this.hslDirty = true;\n this.emit(UIColorEvent.CHANGE, this);\n }\n return this;\n }\n\n /**\n * Sets color from HSL values.\n *\n * @param h - Hue (0-360)\n * @param s - Saturation (0-1)\n * @param l - Lightness (0-1)\n * @param a - Alpha (0-1)\n * @returns This instance\n */\n public setHSL(h: number, s: number, l: number, a = this.aInternal): this {\n this.ensureHSLUpdatedFromRGB();\n if (\n h !== this.hInternal ||\n s !== this.sInternal ||\n l !== this.lInternal ||\n a !== this.aInternal\n ) {\n this.hInternal = h;\n this.sInternal = s;\n this.lInternal = l;\n this.aInternal = a;\n this.rgbDirty = true;\n this.emit(UIColorEvent.CHANGE, this);\n }\n return this;\n }\n\n /**\n * Sets color from predefined name.\n *\n * @param colorName - Color name\n * @param a - Alpha (0-1)\n * @returns This instance\n * @throws Error if color name is unknown\n */\n public setColorName(colorName: UIColorName, a = this.aInternal): this {\n const normalizedName = colorName.toLowerCase().trim();\n const hex = COLORS[normalizedName];\n\n if (hex === undefined) {\n throw new Error(`Unknown color name: \"${colorName}\".`);\n }\n\n return this.setHexRGB(hex, a);\n }\n\n /**\n * Sets color from Three.js Color object.\n *\n * @param threeColor - Three.js Color object\n * @param a - Alpha (0-1)\n * @returns This instance\n */\n public setThreeColor(threeColor: Color, a = this.aInternal): this {\n this.ensureRGBUpdatedFromHSL();\n if (\n threeColor.r !== this.rInternal ||\n threeColor.g !== this.gInternal ||\n threeColor.b !== this.bInternal ||\n a !== this.aInternal\n ) {\n this.rInternal = threeColor.r;\n this.gInternal = threeColor.g;\n this.bInternal = threeColor.b;\n this.aInternal = a;\n this.hslDirty = true;\n this.emit(UIColorEvent.CHANGE, this);\n }\n return this;\n }\n\n /**\n * Returns CSS rgba() string.\n */\n public toCSSColor(): string {\n this.ensureRGBUpdatedFromHSL();\n const r = Math.round(this.rInternal * 255);\n const g = Math.round(this.gInternal * 255);\n const b = Math.round(this.bInternal * 255);\n return `rgba(${r}, ${g}, ${b}, ${this.aInternal})`;\n }\n\n /**\n * Converts color to linear color space for GLSL.\n *\n * @param result - Vector4 to store the result\n * @returns Vector4 with linear RGB (0-1) and alpha\n */\n public toGLSLColor(result: Vector4 = new Vector4()): Vector4 {\n this.ensureRGBUpdatedFromHSL();\n\n result.x = sRGBToLinear(this.rInternal);\n result.y = sRGBToLinear(this.gInternal);\n result.z = sRGBToLinear(this.bInternal);\n result.w = this.aInternal;\n\n return result;\n }\n\n /**\n * Converts color to Three.js Color object (without alpha).\n *\n * @param result - Color object to store the result\n * @returns Color with RGB values\n */\n public toThreeColor(result: Color = new Color()): Color {\n this.ensureRGBUpdatedFromHSL();\n\n result.r = this.rInternal;\n result.g = this.gInternal;\n result.b = this.bInternal;\n\n return result;\n }\n\n /**\n * Copies values from another color.\n *\n * @param color - UIColor or Three.js Color\n * @returns This instance\n */\n public copy(color: UIColor | Color): this {\n if (color instanceof UIColor) {\n this.ensureRGBUpdatedFromHSL();\n color.ensureRGBUpdatedFromHSL();\n\n if (\n this.rInternal !== color.rInternal ||\n this.gInternal !== color.gInternal ||\n this.bInternal !== color.bInternal ||\n this.aInternal !== color.aInternal\n ) {\n this.rInternal = color.rInternal;\n this.gInternal = color.gInternal;\n this.bInternal = color.bInternal;\n this.aInternal = color.aInternal;\n this.hslDirty = true;\n this.emit(UIColorEvent.CHANGE, this);\n }\n } else {\n this.ensureRGBUpdatedFromHSL();\n if (\n this.rInternal !== color.r ||\n this.gInternal !== color.g ||\n this.bInternal !== color.b ||\n this.aInternal !== 1\n ) {\n this.rInternal = color.r;\n this.gInternal = color.g;\n this.bInternal = color.b;\n this.aInternal = 1;\n this.hslDirty = true;\n this.emit(UIColorEvent.CHANGE, this);\n }\n }\n\n return this;\n }\n\n /**\n * Creates a copy of this color.\n */\n public clone(): UIColor {\n this.ensureRGBUpdatedFromHSL();\n return new UIColor(\n this.rInternal,\n this.gInternal,\n this.bInternal,\n this.aInternal,\n );\n }\n\n /**\n * Updates RGB values from HSL if needed.\n */\n private ensureRGBUpdatedFromHSL(): void {\n if (this.rgbDirty) {\n const { hInternal: h, sInternal: s, lInternal: l } = this;\n const c = (1 - Math.abs(2 * l - 1)) * s;\n const hp = h / 60;\n const x = c * (1 - Math.abs((hp % 2) - 1));\n let [r, g, b] =\n hp < 1\n ? [c, x, 0]\n : hp < 2\n ? [x, c, 0]\n : hp < 3\n ? [0, c, x]\n : hp < 4\n ? [0, x, c]\n : hp < 5\n ? [x, 0, c]\n : [c, 0, x];\n\n const m = l - c / 2;\n this.rInternal = r + m;\n this.gInternal = g + m;\n this.bInternal = b + m;\n this.rgbDirty = false;\n }\n }\n\n /**\n * Updates HSL values from RGB if needed.\n */\n private ensureHSLUpdatedFromRGB(): void {\n if (this.hslDirty) {\n const { rInternal: r, gInternal: g, bInternal: b } = this;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const d = max - min;\n const l = (max + min) / 2;\n\n let h = 0;\n if (d !== 0) {\n if (max === r) {\n h = (g - b) / d + (g < b ? 6 : 0);\n } else if (max === g) {\n h = (b - r) / d + 2;\n } else {\n h = (r - g) / d + 4;\n }\n h *= 60;\n }\n\n const s = d === 0 ? 0 : d / (1 - Math.abs(2 * l - 1));\n this.hInternal = h;\n this.sInternal = s;\n this.lInternal = l;\n this.hslDirty = false;\n }\n }\n}\n","/**\n * Transparency rendering modes for UI elements.\n *\n * Controls how transparent and semi-transparent pixels are handled during rendering.\n * Each mode offers different performance and visual quality trade-offs.\n */\nexport enum UITransparencyMode {\n /**\n * Clip mode - pixels are either fully opaque or fully transparent.\n * Uses alpha testing to discard pixels below a threshold.\n * Best performance but no smooth transparency gradients.\n */\n CLIP = 0,\n\n /**\n * Hash mode - dithered transparency using screen-door transparency.\n * Creates transparency illusion through pixel patterns.\n * Good performance with better visual quality than CLIP.\n */\n HASH = 1,\n\n /**\n * Blend mode - true alpha blending with smooth transparency.\n * Supports full range of transparency values with smooth gradients.\n * Best visual quality but requires depth sorting and impacts performance.\n */\n BLEND = 2,\n}\n","import type { Object3D, WebGLRenderer } from \"three\";\nimport {\n Color,\n Matrix2,\n Matrix3,\n Matrix4,\n Mesh,\n OrthographicCamera,\n PlaneGeometry,\n Scene,\n ShaderMaterial,\n Texture,\n Vector2,\n Vector3,\n Vector4,\n} from \"three\";\nimport { UIColor } from \"../miscellaneous/UIColor\";\nimport type { UISceneWrapperClientAPI } from \"../miscellaneous/UISceneWrapperClientAPI\";\nimport { UITransparencyMode } from \"../miscellaneous/UITransparencyMode\";\nimport fragmentShader from \"../shaders/UIPlane.fs\";\nimport vertexShader from \"../shaders/UIPlane.vs\";\n\nconst DEFAULT_ALPHA_TEST = 0.25;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Constructor type needs to accept any arguments for generic type mapping\ntype Constructor = new (...args: any[]) => any;\n\nconst UNIFROM_TYPE_MAP = new Map<Constructor, string>([\n [UIColor, \"vec4\"],\n [Color, \"vec3\"],\n [Texture, \"sampler2D\"],\n [Vector2, \"vec2\"],\n [Vector3, \"vec3\"],\n [Vector4, \"vec4\"],\n [Matrix2, \"mat2\"],\n [Matrix3, \"mat3\"],\n [Matrix4, \"mat4\"],\n]);\n\ntype UIPropertyType =\n | UIColor\n | Color\n | Texture\n | Vector2\n | Vector3\n | Vector4\n | Matrix2\n | Matrix3\n | Matrix4;\n\nfunction buildUniformDeclaraction(name: string, value: unknown): string {\n if (typeof value === \"number\") {\n return `uniform float ${name};`;\n }\n for (const [objectType, glslType] of UNIFROM_TYPE_MAP) {\n if (value instanceof objectType) {\n return `uniform ${glslType} ${name};`;\n }\n }\n throw new Error(`Unsupported uniform type for key \"${name}\"`);\n}\n\nconst Z_LIMIT = 1024;\nconst GEOMETRY_SIZE = 1;\nconst GEOMETRY_OFFSET = GEOMETRY_SIZE / 2;\n\nexport const geometry = new PlaneGeometry(\n GEOMETRY_SIZE,\n GEOMETRY_SIZE,\n).translate(GEOMETRY_OFFSET, GEOMETRY_OFFSET, 0);\n\nlet originalClearColor: Color = new Color();\nlet originalClearAlpha = 0;\nlet originalAutoClear = false;\nlet originalAutoClearColor = false;\nlet originalAutoClearDepth = false;\nlet originalAutoClearStencil = false;\n\ninterface Descriptor {\n plane: Mesh;\n material: ShaderMaterial;\n}\n\nexport class UISceneWrapper implements UISceneWrapperClientAPI {\n private readonly scene = new Scene();\n private readonly camera: OrthographicCamera;\n\n private readonly descriptors = new Map<number, Descriptor>();\n private lastPlaneIndex = 0;\n\n constructor(w: number, h: number) {\n this.camera = new OrthographicCamera(0, w, h, 0, -Z_LIMIT, Z_LIMIT);\n }\n\n public createPlane(\n source: string,\n uniforms: Record<string, UIPropertyType>,\n ): number {\n const entries = Object.entries(uniforms);\n const material = new ShaderMaterial({\n uniforms: {\n alphaTest: { value: DEFAULT_ALPHA_TEST },\n ...Object.fromEntries(\n entries.map(([k, v]) => [\n k,\n {\n value: v instanceof UIColor ? v.toGLSLColor() : v,\n },\n ]),\n ),\n },\n vertexShader,\n fragmentShader:\n fragmentShader +\n entries.map(([k, v]) => buildUniformDeclaraction(k, v)).join(\"\\n\") +\n source,\n transparent: false,\n alphaTest: DEFAULT_ALPHA_TEST,\n alphaHash: false,\n lights: false,\n fog: false,\n depthWrite: false,\n depthTest: true,\n });\n\n const plane = new Mesh(geometry, material);\n plane.frustumCulled = false;\n plane.matrixAutoUpdate = false;\n this.scene.add(plane);\n\n const index = this.lastPlaneIndex++;\n this.descriptors.set(index, { plane, material });\n\n return index;\n }\n\n public destroyPlane(handler: number): this {\n const descriptor = this.resolveDescriptor(handler);\n this.scene.remove(descriptor.plane);\n this.descriptors.delete(handler);\n return this;\n }\n\n public setTransform(handler: number, value: Matrix4): this {\n const descriptor = this.resolveDescriptor(handler);\n descriptor.plane.matrix.copy(value);\n descriptor.plane.matrixWorldNeedsUpdate = true;\n return this;\n }\n\n public setUniform(\n handler: number,\n uniform: string,\n value: UIPropertyType,\n ): this {\n const descriptor = this.resolveDescriptor(handler);\n if (!(uniform in descriptor.material.uniforms)) {\n throw new Error(`Uniform ${uniform} not found in material`);\n }\n if (value instanceof UIColor) {\n value.toGLSLColor(descriptor.material.uniforms[uniform].value);\n } else {\n descriptor.material.uniforms[uniform].value = value;\n }\n return this;\n }\n\n public setTransparency(handler: number, mode: UITransparencyMode): this {\n const descriptor = this.resolveDescriptor(handler);\n if (mode === UITransparencyMode.BLEND) {\n descriptor.material.transparent = true;\n descriptor.material.alphaTest = 0;\n descriptor.material.uniforms[\"alphaTest\"].value = 0;\n descriptor.material.alphaHash = false;\n } else if (mode === UITransparencyMode.CLIP) {\n descriptor.material.transparent = false;\n descriptor.material.alphaTest = DEFAULT_ALPHA_TEST;\n descriptor.material.uniforms[\"alphaTest\"].value = DEFAULT_ALPHA_TEST;\n descriptor.material.alphaHash = false;\n } else {\n descriptor.material.transparent = false;\n descriptor.material.alphaTest = 0;\n descriptor.material.uniforms[\"alphaTest\"].value = 0;\n descriptor.material.alphaHash = true;\n }\n descriptor.material.uniformsNeedUpdate = true;\n descriptor.material.needsUpdate = true;\n return this;\n }\n\n public setVisibility(handler: number, visible: boolean): this {\n const descriptor = this.resolveDescriptor(handler);\n descriptor.plane.visible = visible;\n return this;\n }\n\n public insertCustomObject(object: Object3D): this {\n this.scene.add(object);\n return this;\n }\n\n public removeCustomObject(object: Object3D): this {\n this.scene.remove(object);\n return this;\n }\n\n public resize(width: number, height: number): this {\n this.camera.right = width;\n this.camera.top = height;\n this.camera.updateProjectionMatrix();\n return this;\n }\n\n public render(renderer: WebGLRenderer): this {\n originalClearColor = renderer.getClearColor(originalClearColor);\n originalClearAlpha = renderer.getClearAlpha();\n originalAutoClear = renderer.autoClear;\n originalAutoClearColor = renderer.autoClearColor;\n originalAutoClearDepth = renderer.autoClearDepth;\n originalAutoClearStencil = renderer.autoClearStencil;\n\n renderer.autoClear = false;\n renderer.autoClearColor = false;\n renderer.autoClearDepth = false;\n renderer.autoClearStencil = false;\n renderer.setClearColor(0x000000, 1);\n\n renderer.clear(false, true, true);\n renderer.render(this.scene, this.camera);\n\n renderer.setClearColor(originalClearColor);\n renderer.setClearAlpha(originalClearAlpha);\n renderer.autoClear = originalAutoClear;\n renderer.autoClearColor = originalAutoClearColor;\n renderer.autoClearDepth = originalAutoClearDepth;\n renderer.autoClearStencil = originalAutoClearStencil;\n return this;\n }\n\n private resolveDescriptor(handler: number): Descriptor {\n const descriptor = this.descriptors.get(handler);\n if (!descriptor) {\n throw new Error(`No descriptor found for handler ${handler}`);\n }\n return descriptor;\n }\n}\n","import { Operator } from \"@lume/kiwi\";\n\n/**\n * Relational operators for UI layout constraints.\n *\n * UIRelation defines the mathematical relationship between the left-hand\n * and right-hand sides of constraint equations. These relations are used\n * by the constraint solver to determine how expressions should be compared\n * when solving layout constraints.\n *\n * @see {@link convertRelation} - Converts to Kiwi solver operators\n */\nexport enum UIRelation {\n /** Equality relation: left-hand side equals right-hand side. */\n EQUAL = 0,\n /** Less than or equal relation: left-hand side ≤ right-hand side. */\n LESS_THAN = 1,\n /** Greater than or equal relation: left-hand side ≥ right-hand side. */\n GREATER_THAN = 2,\n}\n\n/**\n * Converts UIRelation enum values to Kiwi solver operator values.\n *\n * This function maps the UI relation types to the corresponding operators\n * used by the Kiwi constraint solver for mathematical comparisons in\n * constraint equations.\n *\n * @param relation - The UI relation type to convert\n * @returns The corresponding Kiwi solver operator\n * @throws Will throw an error if an invalid relation is provided\n * @see {@link UIRelation} - Relation type definitions\n */\nexport function convertRelation(relation: UIRelation): Operator {\n switch (relation) {\n case UIRelation.EQUAL:\n return Operator.Eq;\n case UIRelation.LESS_THAN:\n return Operator.Le;\n case UIRelation.GREATER_THAN:\n return Operator.Ge;\n default:\n throw new Error(`Invalid relation: ${relation}`);\n }\n}\n\n/**\n * Resolves an optional relation value to a concrete UIRelation.\n *\n * If no relation is provided, returns the default equality relation.\n * This function is commonly used in constraint creation where relation\n * is an optional parameter.\n *\n * @param relation - The optional relation value to resolve\n * @returns The resolved relation, defaulting to EQUAL if undefined\n */\nexport function resolveRelation(relation?: UIRelation): UIRelation {\n return relation ?? UIRelation.EQUAL;\n}\n","import { Constraint, Expression, Solver, Variable } from \"@lume/kiwi\";\nimport { UIExpression } from \"../miscellaneous/UIExpression\";\nimport { convertPriority, UIPriority } from \"../miscellaneous/UIPriority\";\nimport { convertRelation, UIRelation } from \"../miscellaneous/UIRelation\";\n\n/**\n * Internal description of a solver variable with its associated properties.\n */\ninterface VariableDescription {\n /** The underlying Kiwi variable instance. */\n variable: Variable;\n /** Priority level for constraint solving. */\n priority: UIPriority;\n /** Current suggested value for the variable. */\n value: number;\n /** Optional constraint for P0 priority variables (required variables). */\n constraint?: Constraint;\n}\n\n/**\n * Internal description of a solver constraint with its configuration.\n */\ninterface ConstraintDescription {\n /** The underlying Kiwi constraint instance. */\n constraint: Constraint;\n /** Left-hand side expression of the constraint. */\n lhs: UIExpression;\n /** Right-hand side expression of the constraint. */\n rhs: UIExpression;\n /** Priority level for constraint solving. */\n priority: UIPriority;\n /** Relational operator (equal, less than, greater than). */\n relation: UIRelation;\n /** Whether the constraint is currently active. */\n enabled: boolean;\n}\n\n/**\n * Wrapper around the Kiwi constraint solver providing enhanced UI-specific functionality.\n *\n * UISolverWrapper abstracts the Kiwi (Cassowary) constraint solver to provide a more\n * UI-friendly interface with additional features like dynamic constraint modification,\n * required variables (P0 priority), partial constraint updates, and automatic solver\n * recovery. It manages variables and constraints through index-based references,\n * allowing for easy tracking and modification of layout constraints.\n *\n * Key features:\n * - Index-based variable and constraint management\n * - Required variables with P0 priority (always satisfied)\n * - Dynamic constraint modification without full rebuilds\n * - Automatic solver recovery on constraint conflicts\n * - Lazy evaluation with recalculation flags\n *\n * @see {@link UIExpression} - Expression system for constraint definitions\n * @see {@link UIPriority} - Priority levels for variables and constraints\n * @see {@link UIRelation} - Relational operators for constraints\n */\nexport class UISolverWrapper {\n /** The underlying Kiwi solver instance, undefined when solver needs rebuilding. */\n private solver? = new Solver();\n /** Flag indicating whether variable values need recalculation. */\n private recalculationRequired = false;\n\n /** Map of variable indices to their descriptions. */\n private readonly variables = new Map<number, VariableDescription>();\n /** Counter for generating unique variable indices. */\n private lastVariableIndex = 0;\n\n /** Map of constraint indices to their descriptions. */\n private readonly constraints = new Map<number, ConstraintDescription>();\n /** Counter for generating unique constraint indices. */\n private lastConstraintIndex = 0;\n\n /**\n * Creates a new solver variable with the specified value and priority.\n *\n * Variables with P0 priority are treated as required (must be satisfied exactly)\n * and are implemented using equality constraints. Other priorities use edit\n * variables that can be adjusted by the solver.\n *\n * @param value - Initial value for the variable\n * @param priority - Priority level for constraint solving\n * @returns Unique index identifier for the created variable\n */\n public createVariable(value: number, priority: UIPriority): number {\n const index = this.lastVariableIndex++;\n const variable = new Variable();\n\n if (priority === UIPriority.P0) {\n const description: VariableDescription = { variable, priority, value };\n this.variables.set(index, description);\n\n description.constraint = this.buildConstraint(\n new UIExpression(0, [[index, 1]]),\n new UIExpression(value),\n UIRelation.EQUAL,\n priority,\n );\n try {\n this.solver?.addConstraint(description.constraint);\n } catch {\n this.solver = undefined;\n }\n } else {\n this.variables.set(index, { variable, priority, value });\n\n try {\n this.solver?.addEditVariable(variable, convertPriority(priority));\n this.solver?.suggestValue(variable, value);\n } catch {\n this.solver = undefined;\n }\n }\n\n this.recalculationRequired = true;\n return index;\n }\n\n /**\n * Removes a variable from the solver system.\n *\n * The variable must not be referenced by any existing constraints.\n * Cleans up both the variable itself and any associated required constraint.\n *\n * @param index - Index of the variable to remove\n * @throws Will throw an error if the variable doesn't exist or is still in use\n */\n public removeVariable(index: number): void {\n const description = this.variables.get(index);\n if (description === undefined) {\n throw new Error(`Variable ${index} does not exist`);\n }\n\n for (const cDescription of this.constraints.values()) {\n if (cDescription.lhs.hasTerm(index) || cDescription.rhs.hasTerm(index)) {\n throw new Error(`Variable ${index} is used in constraint`);\n }\n }\n\n try {\n description.constraint\n ? this.solver?.removeConstraint(description.constraint)\n : this.solver?.removeEditVariable(description.variable);\n } catch {\n this.solver = undefined;\n }\n\n this.variables.delete(index);\n this.recalculationRequired = true;\n }\n\n /**\n * Suggests a new value for an existing variable.\n *\n * For P0 priority variables, rebuilds the associated constraint.\n * For other priorities, suggests the value to the solver's edit system.\n * Only triggers updates if the value actually changes.\n *\n * @param index - Index of the variable to update\n * @param value - New suggested value\n * @throws Will throw an error if the variable doesn't exist\n */\n public suggestVariableValue(index: number, value: number): void {\n const description = this.variables.get(index);\n if (description === undefined) {\n throw new Error(`Variable ${index} does not exist`);\n }\n\n if (description.value !== value) {\n description.value = value;\n\n if (description.constraint) {\n description.constraint = this.rebuildConstraint(\n description.constraint,\n new UIExpression().plus(index, 1),\n new UIExpression(description.value),\n UIRelation.EQUAL,\n description.priority,\n );\n } else {\n this.solver?.suggestValue(description.variable, value);\n }\n\n this.recalculationRequired = true;\n }\n }\n\n /**\n * Changes the priority of an existing variable.\n *\n * Switching to/from P0 priority changes how the variable is handled:\n * - P0: Creates required constraint (must be satisfied exactly)\n * - Other: Uses edit variable system (can be adjusted by solver)\n *\n * @param index - Index of the variable to modify\n * @param priority - New priority level\n * @throws Will throw an error if the variable doesn't exist\n */\n public setVariablePriority(index: number, priority: UIPriority): void {\n const description = this.variables.get(index);\n if (description === undefined) {\n throw new Error(`Variable ${index} does not exist`);\n }\n\n if (priority !== description.priority) {\n description.priority = priority;\n\n if (description.priority === UIPriority.P0) {\n const lhs = new UIExpression().plus(index, 1);\n const rhs = new UIExpression(description.value);\n\n description.constraint = this.buildConstraint(\n lhs,\n rhs,\n UIRelation.EQUAL,\n description.priority,\n );\n\n try {\n this.solver?.addConstraint(description.constraint);\n } catch {\n this.solver = undefined;\n }\n } else {\n if (description.constraint) {\n try {\n this.solver?.removeConstraint(description.constraint);\n } catch {\n this.solver = undefined;\n }\n }\n\n description.constraint = undefined;\n this.rebuildVariable(index, description);\n }\n\n this.recalculationRequired = true;\n }\n }\n\n /**\n * Reads the current solved value of a variable.\n *\n * Triggers solver recalculation if needed and rebuilds the solver\n * if it was invalidated due to constraint conflicts.\n *\n * @param index - Index of the variable to read\n * @returns Current solved value of the variable\n * @throws Will throw an error if the variable doesn't exist\n */\n public readVariableValue(index: number): number {\n const description = this.variables.get(index);\n if (description === undefined) {\n throw new Error(`Variable ${index} does not exist`);\n }\n\n if (this.solver === undefined) {\n this.rebuildSolver();\n }\n\n if (this.recalculationRequired) {\n this.solver?.updateVariables();\n this.recalculationRequired = false;\n }\n\n return description.variable.value();\n }\n\n /**\n * Creates a new constraint between two expressions.\n *\n * Constraints can be enabled or disabled, and all properties can be\n * modified later without recreating the constraint.\n *\n * @param lhs - Left-hand side expression\n * @param rhs - Right-hand side expression\n * @param relation - Relational operator (equal, less than, greater than)\n * @param priority - Priority level for constraint solving\n * @param enabled - Whether the constraint is initially active\n * @returns Unique index identifier for the created constraint\n */\n public createConstraint(\n lhs: UIExpression,\n rhs: UIExpression,\n relation: UIRelation,\n priority: UIPriority,\n enabled: boolean,\n ): number {\n const index = this.lastConstraintIndex++;\n const constraint = this.buildConstraint(lhs, rhs, relation, priority);\n this.constraints.set(index, {\n constraint,\n lhs: lhs.clone(),\n rhs: rhs.clone(),\n priority,\n relation,\n enabled,\n });\n if (enabled) {\n try {\n this.solver?.addConstraint(constraint);\n } catch {\n this.solver = undefined;\n }\n this.recalculationRequired = true;\n }\n return index;\n }\n\n /**\n * Removes a constraint from the solver system.\n *\n * If the constraint is currently enabled, it will be removed from\n * the active solver before deletion.\n *\n * @param index - Index of the constraint to remove\n * @throws Will throw an error if the constraint doesn't exist\n */\n public removeConstraint(index: number): void {\n const description = this.constraints.get(index);\n if (description === undefined) {\n throw new Error(`Constraint ${index} does not exist`);\n }\n\n if (description.enabled) {\n try {\n this.solver?.removeConstraint(description.constraint);\n } catch {\n this.solver = undefined;\n }\n }\n\n this.constraints.delete(index);\n this.recalculationRequired = true;\n }\n\n /**\n * Updates the left-hand side expression of an existing constraint.\n *\n * Rebuilds the underlying constraint with the new expression while\n * preserving all other properties.\n *\n * @param index - Index of the constraint to modify\n * @param lhs - New left-hand side expression\n * @throws Will throw an error if the constraint doesn't exist\n */\n public setConstraintLHS(index: number, lhs: UIExpression): void {\n const description = this.constraints.get(index);\n if (description === undefined) {\n throw new Error(`Constraint ${index} does not exist`);\n }\n\n description.lhs.copy(lhs);\n this.rebuildConstraintByDescription(description);\n this.recalculationRequired = true;\n }\n\n /**\n * Updates the right-hand side expression of an existing constraint.\n *\n * Rebuilds the underlying constraint with the new expression while\n * preserving all other properties.\n *\n * @param index - Index of the constraint to modify\n * @param rhs - New right-hand side expression\n * @throws Will throw an error if the constraint doesn't exist\n */\n public setConstraintRHS(index: number, rhs: UIExpression): void {\n const description = this.constraints.get(index);\n if (description === undefined) {\n throw new Error(`Constraint ${index} does not exist`);\n }\n\n description.rhs.copy(rhs);\n this.rebuildConstraintByDescription(description);\n this.recalculationRequired = true;\n }\n\n /**\n * Updates the relational operator of an existing constraint.\n *\n * Changes how the left and right expressions are compared\n * (equal, less than, greater than).\n *\n * @param index - Index of the constraint to modify\n * @param relation - New relational operator\n * @throws Will throw an error if the constraint doesn't exist\n */\n public setConstraintRelation(index: number, relation: UIRelation): void {\n const description = this.constraints.get(index);\n if (description === undefined) {\n throw new Error(`Constraint ${index} does not exist`);\n }\n\n if (description.relation !== relation) {\n description.relation = relation;\n this.rebuildConstraintByDescription(description);\n this.recalculationRequired = true;\n }\n }\n\n /**\n * Updates the priority level of an existing constraint.\n *\n * Higher priority constraints are more likely to be satisfied\n * when conflicts arise.\n *\n * @param index - Index of the constraint to modify\n * @param priority - New priority level\n * @throws Will throw an error if the constraint doesn't exist\n */\n public setConstraintPriority(index: number, priority: UIPriority): void {\n const description = this.constraints.get(index);\n if (description === undefined) {\n throw new Error(`Constraint ${index} does not exist`);\n }\n\n if (description.priority !== priority) {\n description.priority = priority;\n this.rebuildConstraintByDescription(description);\n this.recalculationRequired = true;\n }\n }\n\n /**\n * Enables or disables an existing constraint.\n *\n * Disabled constraints are not considered during solving but\n * remain in the system for potential re-enabling.\n *\n * @param index - Index of the constraint to modify\n * @param enabled - Whether the constraint should be active\n * @throws Will throw an error if the constraint doesn't exist\n */\n public setConstraintEnabled(index: number, enabled: boolean): void {\n const description = this.constraints.get(index);\n if (description === undefined) {\n throw new Error(`Constraint ${index} does not exist`);\n }\n\n if (enabled !== description.enabled) {\n description.enabled = enabled;\n try {\n description.enabled\n ? this.solver?.addConstraint(description.constraint)\n : this.solver?.removeConstraint(description.constraint);\n } catch {\n this.solver = undefined;\n }\n this.recalculationRequired = true;\n }\n }\n\n /**\n * Rebuilds a variable in the solver system with new properties.\n *\n * Temporarily removes all constraints that reference the variable,\n * updates the variable configuration, then rebuilds and re-adds\n * the dependent constraints.\n */\n private rebuildVariable(\n index: number,\n description: VariableDescription,\n ): void {\n const dependConstraints: ConstraintDescription[] = [];\n\n for (const cDescription of this.constraints.values()) {\n if (cDescription.lhs.hasTerm(index) || cDescription.rhs.hasTerm(index)) {\n try {\n this.solver?.removeConstraint(cDescription.constraint);\n } catch {\n this.solver = undefined;\n }\n dependConstraints.push(cDescription);\n }\n }\n\n this.solver?.removeEditVariable(description.variable);\n this.solver?.addEditVariable(\n description.variable,\n convertPriority(description.priority),\n );\n\n for (const cDescription of dependConstraints) {\n cDescription.constraint = this.buildConstraint(\n cDescription.lhs,\n cDescription.rhs,\n cDescription.relation,\n cDescription.priority,\n );\n }\n\n for (const cDescription of dependConstraints) {\n try {\n this.solver?.addConstraint(cDescription.constraint);\n } catch {\n this.solver = undefined;\n break;\n }\n }\n }\n\n /**\n * Rebuilds a constraint based on its current description.\n *\n * Uses different rebuild strategies depending on whether the\n * constraint is currently enabled.\n */\n private rebuildConstraintByDescription(\n description: ConstraintDescription,\n ): void {\n description.constraint = description.enabled\n ? this.rebuildConstraint(\n description.constraint,\n description.lhs,\n description.rhs,\n description.relation,\n description.priority,\n )\n : this.buildConstraint(\n description.lhs,\n description.rhs,\n description.relation,\n description.priority,\n );\n }\n\n /**\n * Rebuilds a constraint by removing the old one and creating a new one.\n *\n * Safely handles solver state transitions and constraint replacement.\n */\n private rebuildConstraint(\n oldConstraint: Constraint,\n lhs: UIExpression,\n rhs: UIExpression,\n relation: UIRelation,\n priority: UIPriority,\n ): Constraint {\n try {\n this.solver?.removeConstraint(oldConstraint);\n } catch {\n this.solver = undefined;\n }\n\n const constraint = this.buildConstraint(lhs, rhs, relation, priority);\n\n try {\n this.solver?.addConstraint(constraint);\n } catch {\n this.solver = undefined;\n }\n\n return constraint;\n }\n\n /**\n * Creates a new Kiwi constraint from UI expressions and parameters.\n *\n * Converts UI-level expressions and enums to Kiwi-compatible formats.\n */\n private buildConstraint(\n lhs: UIExpression,\n rhs: UIExpression,\n relation: UIRelation,\n priority: UIPriority,\n ): Constraint {\n return new Constraint(\n this.convertExpression(lhs),\n convertRelation(relation),\n this.convertExpression(rhs),\n convertPriority(priority),\n );\n }\n\n /**\n * Converts a UIExpression to a Kiwi Expression.\n *\n * Maps variable indices to their corresponding Kiwi Variable instances\n * and preserves coefficients and constants.\n */\n private convertExpression(expression: UIExpression): Expression {\n return new Expression(\n ...expression[\"prepareTermsInternal\"]().map(\n ([variableIndex, coefficient]): [number, Variable] => {\n const description = this.variables.get(variableIndex);\n if (description === undefined) {\n throw new Error(`Variable ${variableIndex} does not exist`);\n }\n return [coefficient, description.variable];\n },\n ),\n expression.constant,\n );\n }\n\n /**\n * Completely rebuilds the solver from scratch.\n *\n * Re-adds all variables and constraints to a fresh solver instance.\n * Used for recovery when the solver enters an invalid state.\n */\n private rebuildSolver(): void {\n if (this.solver) {\n throw new Error(\"Solver already exists\");\n }\n\n this.solver = new Solver();\n\n for (const description of this.variables.values()) {\n if (description.constraint) {\n this.solver.addConstraint(description.constraint);\n } else {\n this.solver.addEditVariable(\n description.variable,\n convertPriority(description.priority),\n );\n this.solver.suggestValue(description.variable, description.value);\n }\n }\n\n for (const description of this.constraints.values()) {\n if (description.enabled) {\n this.solver.addConstraint(description.constraint);\n }\n }\n\n this.recalculationRequired = true;\n }\n}\n","import { Eventail } from \"eventail\";\nimport type { WebGLRenderer } from \"three\";\nimport type { UIPlaneElement } from \"../miscellaneous/asserts\";\nimport { UIMode } from \"../miscellaneous/UIMode\";\nimport { UIOrientation } from \"../miscellaneous/UIOrientation\";\nimport { UIPriority } from \"../miscellaneous/UIPriority\";\nimport type { UISceneWrapperClientAPI } from \"../miscellaneous/UISceneWrapperClientAPI\";\nimport { UISceneWrapper } from \"../wrappers/UISceneWrapper\";\nimport { UISolverWrapper } from \"../wrappers/UISolverWrapper\";\n\n/**\n * Interface for handling input events within UI layers.\n */\nexport interface UILayerInputListener {\n zIndex: number;\n catchPointerDown(x: number, y: number, identifier: number): boolean;\n catchPointerMove(x: number, y: number, identifier: number): boolean;\n catchPointerUp(x: number, y: number, identifier: number): boolean;\n}\n\n/**\n * Events that can be emitted by UI layers.\n */\nexport enum UILayerEvent {\n /** Emitted when the layer's orientation changes between horizontal and vertical. */\n ORIENTATION_CHANGE = \"orientation_change\",\n /** Emitted when the layer's visibility/interaction mode changes. */\n MODE_CHANGE = \"mode_change\",\n /** Emitted before the layer is rendered. */\n WILL_RENDER = \"will_render\",\n}\n\n/**\n * Abstract base class for UI layout containers with constraint solving and rendering.\n *\n * UILayer serves as the fundamental container for UI elements, providing constraint-based\n * layout solving, 3D scene management, and event handling. It manages the layer's\n * dimensions through solver variables, handles orientation changes, and coordinates\n * rendering and interaction for all contained elements.\n *\n * Each layer maintains its own constraint solver and scene graph, allowing for\n * independent layout calculation and rendering optimization.\n *\n * @see {@link UIElement} - Elements contained within layers\n * @see {@link UISolverWrapper} - Constraint solving system\n * @see {@link UISceneWrapper} - 3D scene management\n * @see {@link UIOrientation} - Layer orientation states\n */\nexport abstract class UILayer extends Eventail implements UIPlaneElement {\n /** Optional name identifier for the layer. */\n public name = \"\";\n\n /**\n * Solver variable descriptor for the x-coordinate position.\n * This variable is managed by the constraint solver system.\n */\n public readonly xVariable: number;\n\n /**\n * Solver variable descriptor for the y-coordinate position.\n * This variable is managed by the constraint solver system.\n */\n public readonly yVariable: number;\n\n /**\n * Solver variable descriptor for the width dimension.\n * This variable is managed by the constraint solver system.\n */\n public readonly wVariable: number;\n\n /**\n * Solver variable descriptor for the height dimension.\n * This variable is managed by the constraint solver system.\n */\n public readonly hVariable: number;\n\n /**\n * Constraint solver wrapper for managing layout calculations.\n * @see {@link UISolverWrapper}\n */\n protected readonly solverWrapper = new UISolverWrapper();\n\n /**\n * 3D scene wrapper for managing rendering and element hierarchy.\n * @see {@link UISceneWrapper}\n */\n protected readonly sceneWrapper: UISceneWrapper;\n\n /** Internal storage for the current visibility/interaction mode. */\n protected modeInternal: UIMode = UIMode.VISIBLE;\n\n /** Internal storage for the current orientation state. */\n protected orientationInternal: UIOrientation;\n\n /** Collection of input listeners for handling user interactions, sorted by z-index. */\n\n private readonly inputListeners: UILayerInputListener[] = [];\n\n /**\n * Creates a new UILayer instance with specified dimensions.\n *\n * Initializes the constraint solver with position and dimension variables,\n * sets up the 3D scene wrapper, and determines the initial orientation\n * based on the width-to-height ratio.\n *\n * @param w - Initial width of the layer\n * @param h - Initial height of the layer\n */\n constructor(w: number, h: number) {\n super();\n this.sceneWrapper = new UISceneWrapper(w, h);\n this.xVariable = this.solverWrapper.createVariable(0, UIPriority.P0);\n this.yVariable = this.solverWrapper.createVariable(0, UIPriority.P0);\n this.wVariable = this.solverWrapper.createVariable(w, UIPriority.P0);\n this.hVariable = this.solverWrapper.createVariable(h, UIPriority.P0);\n this.orientationInternal =\n w > h ? UIOrientation.HORIZONTAL : UIOrientation.VERTICAL;\n }\n\n /**\n * Gets the current x position value from the constraint solver.\n * @returns The current x position in pixels\n */\n public get x(): number {\n return this.solverWrapper.readVariableValue(this.xVariable);\n }\n\n /**\n * Gets the current y position value from the constraint solver.\n * @returns The current y position in pixels\n */\n public get y(): number {\n return this.solverWrapper.readVariableValue(this.yVariable);\n }\n\n /**\n * Gets the current width value from the constraint solver.\n * @returns The current layer width in pixels\n */\n public get width(): number {\n return this.solverWrapper.readVariableValue(this.wVariable);\n }\n\n /**\n * Gets the current height value from the constraint solver.\n * @returns The current layer height in pixels\n */\n public get height(): number {\n return this.solverWrapper.readVariableValue(this.hVariable);\n }\n\n /**\n * Gets the current visibility and interaction mode.\n * @returns The current UIMode setting\n * @see {@link UIMode}\n */\n public get mode(): UIMode {\n return this.modeInternal;\n }\n\n /**\n * Gets the current orientation state.\n * @returns The current orientation (horizontal or vertical)\n * @see {@link UIOrientation}\n */\n public get orientation(): UIOrientation {\n return this.orientationInternal;\n }\n\n /**\n * Sets the visibility and interaction mode and emits change event.\n * @param value - The new UIMode setting\n * @see {@link UIMode}\n */\n public set mode(value: UIMode) {\n if (value !== this.modeInternal) {\n this.modeInternal = value;\n this.emit(UILayerEvent.MODE_CHANGE, this.modeInternal, this);\n }\n }\n\n /**\n * Internal method for resizing the layer and updating orientation.\n *\n * Updates the solver variables for width and height, resizes the scene wrapper,\n * and determines if the orientation has changed based on the new dimensions.\n * Emits an orientation change event if the orientation has changed.\n *\n * @param width - The new layer width\n * @param height - The new layer height\n * @protected\n */\n protected resizeInternal(width: number, height: number): void {\n this.solverWrapper.suggestVariableValue(this.wVariable, width);\n this.solverWrapper.suggestVariableValue(this.hVariable, height);\n this.sceneWrapper.resize(width, height);\n\n const orientation =\n width > height ? UIOrientation.HORIZONTAL : UIOrientation.VERTICAL;\n\n if (orientation !== this.orientationInternal) {\n this.orientationInternal = orientation;\n this.emit(\n UILayerEvent.ORIENTATION_CHANGE,\n this.orientationInternal,\n this,\n );\n }\n }\n\n /**\n * Internal method for rendering the layer and its elements.\n *\n * Delegates rendering to the scene wrapper if the layer is not hidden.\n * This method is called during the rendering loop to update and draw\n * all elements contained within the layer.\n *\n * @param renderer - The WebGL renderer instance\n * @param deltaTime - Time elapsed since the last frame in seconds\n * @protected\n */\n protected renderInternal(renderer: WebGLRenderer, deltaTime: number): void {\n if (this.mode !== UIMode.HIDDEN) {\n this.emit(UILayerEvent.WILL_RENDER, renderer, deltaTime, this);\n this.sceneWrapper.render(renderer);\n }\n }\n\n protected onPointerDownInternal(\n x: number,\n y: number,\n identifier: number,\n ): void {\n this.handleInputEvent(x, y, \"catchPointerDown\", identifier);\n }\n\n protected onPointerMoveInternal(\n x: number,\n y: number,\n identifier: number,\n ): void {\n this.handleInputEvent(x, y, \"catchPointerMove\", identifier);\n }\n\n protected onPointerUpInternal(\n x: number,\n y: number,\n identifier: number,\n ): void {\n this.handleInputEvent(x, y, \"catchPointerUp\", identifier);\n }\n\n /**\n * Internal method for accessing the constraint solver wrapper.\n *\n * Provides access to the layer's constraint solver for elements and\n * constraints that need to create variables or constraints.\n *\n * @returns The constraint solver wrapper instance\n */\n protected [\"getSolverWrapperInternal\"](): UISolverWrapper {\n return this.solverWrapper;\n }\n\n /**\n * Internal method for accessing the 3D scene wrapper.\n *\n * Provides access to the layer's scene management system for elements\n * that need to be added to or removed from the 3D scene.\n *\n * @returns The scene wrapper instance\n */\n protected [\"getSceneWrapperClientAPI\"](): UISceneWrapperClientAPI {\n return this.sceneWrapper;\n }\n\n /**\n * Internal method for registering an input listener for pointer events.\n *\n * Adds a listener to handle click events with the specified z-index priority.\n * Higher z-index listeners are processed first during event handling.\n *\n * @param listener - The input listener to register\n * @param zIndex - The z-index priority for event handling order\n * @throws Will throw an error if the listener is already registered\n */\n\n protected [\"subscribePointerInput\"](listener: UILayerInputListener): void {\n if (this.inputListeners.find((l) => l === listener)) {\n throw new Error(\"Listener already exists\");\n }\n this.inputListeners.push(listener);\n }\n\n /**\n * Internal method for unregistering an input listener.\n *\n * Removes the specified listener from the event handling system.\n * The listener will no longer receive click events.\n *\n * @param listener - The input listener to remove\n * @throws Will throw an error if the listener is not found\n */\n\n protected [\"unsubscribePointerInput\"](listener: UILayerInputListener): void {\n const index = this.inputListeners.findIndex((l) => l === listener);\n if (index === -1) {\n throw new Error(\"Listener not found\");\n }\n this.inputListeners.splice(index, 1);\n }\n\n private handleInputEvent(\n x: number,\n y: number,\n catchFunctionName:\n | \"catchPointerDown\"\n | \"catchPointerMove\"\n | \"catchPointerUp\",\n identifier: number,\n ): void {\n if (this.mode === UIMode.INTERACTIVE) {\n this.inputListeners.sort((a, b) => b.zIndex - a.zIndex);\n for (const listener of this.inputListeners) {\n if (listener[catchFunctionName](x, y, identifier)) {\n return;\n }\n }\n }\n }\n}\n","import { type UILayer } from \"../layers/UILayer\";\n\nimport type { UISolverWrapper } from \"../wrappers/UISolverWrapper\";\n\n/**\n * Abstract base class for all UI layout constraints.\n *\n * UIConstraint serves as the fundamental building block for the constraint-based\n * layout system. It provides access to the solver wrapper for creating and\n * managing constraint relationships between UI elements. All concrete constraint\n * implementations must extend this class to participate in the layout solving process.\n *\n * @see {@link UILayer} - Container layer for constraints\n * @see {@link UISolverWrapper} - Constraint solver integration\n */\nexport abstract class UIConstraint {\n /** Optional name identifier for the constraint. */\n public name = \"\";\n\n /**\n * Reference to the constraint solver wrapper for managing solver operations.\n * @see {@link UISolverWrapper}\n */\n protected readonly solverWrapper: UISolverWrapper;\n\n /**\n * Creates a new UIConstraint instance.\n *\n * Automatically connects to the layer's constraint solver for managing\n * layout relationships and constraint operations.\n *\n * @param layer - The UI layer that contains this constraint\n */\n constructor(public readonly layer: UILayer) {\n this.solverWrapper = this.layer[\"getSolverWrapperInternal\"]();\n }\n}\n","import type { UILayer } from \"../layers/UILayer\";\nimport { UILayerEvent } from \"../layers/UILayer\";\nimport {\n resolveOrientation,\n UIOrientation,\n} from \"../miscellaneous/UIOrientation\";\nimport { resolvePriority, type UIPriority } from \"../miscellaneous/UIPriority\";\nimport { resolveRelation, type UIRelation } from \"../miscellaneous/UIRelation\";\nimport { UIConstraint } from \"./UIConstraint\";\n\n/**\n * Configuration options for UISingleParameterConstraint creation.\n */\nexport interface UISingleParameterConstraintOptions {\n /** Priority level for the constraint in the solver hierarchy. */\n priority: UIPriority;\n /** Mathematical relation type for the constraint equation. */\n relation: UIRelation;\n /** Orientation context for when the constraint should be active. */\n orientation: UIOrientation;\n}\n\n/**\n * Abstract base class for constraints that operate with configurable parameters.\n *\n * UISingleParameterConstraint extends UIConstraint with common functionality\n * for constraints that need priority, relation, and orientation configuration.\n * It provides automatic orientation-based enabling/disabling of constraints\n * and manages the lifecycle of solver constraint descriptors.\n *\n * @see {@link UIConstraint} - Base constraint class\n * @see {@link UIPriority} - Priority level configuration\n * @see {@link UIRelation} - Mathematical relation types\n * @see {@link UIOrientation} - Orientation-based activation\n */\nexport abstract class UISingleParameterConstraint extends UIConstraint {\n /** Internal storage for the constraint priority level. */\n protected priorityInternal: UIPriority;\n /** Internal storage for the constraint relation type. */\n protected relationInternal: UIRelation;\n /** Internal storage for the constraint orientation setting. */\n protected orientationInternal: UIOrientation;\n\n /** The constraint descriptor managed by the solver system. */\n protected abstract readonly constraint: number;\n\n /**\n * Creates a new UISingleParameterConstraint instance.\n *\n * Initializes the constraint with resolved default values and sets up\n * orientation change event handling for dynamic constraint activation.\n *\n * @param layer - The UI layer that contains this constraint\n * @param priority - Optional priority level (defaults to P0)\n * @param relation - Optional relation type (defaults to EQUAL)\n * @param orientation - Optional orientation setting (defaults to ALWAYS)\n */\n constructor(\n layer: UILayer,\n priority?: UIPriority,\n relation?: UIRelation,\n orientation?: UIOrientation,\n ) {\n super(layer);\n this.priorityInternal = resolvePriority(priority);\n this.relationInternal = resolveRelation(relation);\n this.orientationInternal = resolveOrientation(orientation);\n this.layer.on(UILayerEvent.ORIENTATION_CHANGE, this.onOrientationChange);\n }\n\n /**\n * Gets the current priority level of the constraint.\n * @returns The constraint priority level\n */\n public get priority(): UIPriority {\n return this.priorityInternal;\n }\n\n /**\n * Gets the current mathematical relation type of the constraint.\n * @returns The constraint relation type\n */\n public get relation(): UIRelation {\n return this.relationInternal;\n }\n\n /**\n * Gets the current orientation setting of the constraint.\n * @returns The constraint orientation setting\n */\n public get orientation(): UIOrientation {\n return this.orientationInternal;\n }\n\n /**\n * Sets a new priority level for the constraint.\n * @param value - The new priority level\n */\n public set priority(value: UIPriority) {\n if (value !== this.priorityInternal) {\n this.priorityInternal = value;\n this.solverWrapper.setConstraintPriority(\n this.constraint,\n this.priorityInternal,\n );\n }\n }\n\n /**\n * Sets a new mathematical relation type for the constraint.\n * @param value - The new relation type\n */\n public set relation(value: UIRelation) {\n if (value !== this.relationInternal) {\n this.relationInternal = value;\n this.solverWrapper.setConstraintRelation(\n this.constraint,\n this.relationInternal,\n );\n }\n }\n\n /**\n * Sets a new orientation setting for the constraint.\n * @param value - The new orientation setting\n */\n public set orientation(value: UIOrientation) {\n if (value !== this.orientationInternal) {\n this.orientationInternal = value;\n this.onOrientationChange();\n }\n }\n\n /**\n * Destroys the constraint by cleaning up event listeners and solver resources.\n *\n * This method removes the orientation change event listener and removes\n * the constraint from the solver system. After calling this method,\n * the constraint should not be used anymore.\n */\n public destroy(): void {\n this.layer.off(UILayerEvent.ORIENTATION_CHANGE, this.onOrientationChange);\n this.solverWrapper.removeConstraint(this.constraint);\n }\n\n /**\n * Determines if the constraint should be enabled based on orientation.\n *\n * The constraint is enabled if its orientation is set to ALWAYS or if\n * it matches the current layer orientation.\n *\n * @returns True if the constraint should be enabled, false otherwise\n * @protected\n */\n protected isConstraintEnabled(): boolean {\n return (\n this.orientationInternal === UIOrientation.ALWAYS ||\n this.orientationInternal === this.layer.orientation\n );\n }\n\n /**\n * Event handler for layer orientation changes.\n *\n * Updates the constraint's enabled state in the solver based on the\n * current orientation and the constraint's orientation setting.\n */\n private readonly onOrientationChange = (): void => {\n this.solverWrapper.setConstraintEnabled(\n this.constraint,\n this.isConstraintEnabled(),\n );\n };\n}\n","import type { UILayerElement, UIPlaneElement } from \"../miscellaneous/asserts\";\nimport { UIExpression } from \"../miscellaneous/UIExpression\";\nimport type { UISingleParameterConstraintOptions } from \"./UISingleParameterConstraint\";\nimport { UISingleParameterConstraint } from \"./UISingleParameterConstraint\";\n\n/**\n * Configuration options for UIHeightConstraint creation.\n */\nexport interface UIHeightConstraintOptions\n extends UISingleParameterConstraintOptions {\n /** The desired height value for the element. */\n height: number;\n}\n\n/**\n * Constraint that enforces a specific height value for UI elements.\n *\n * UIHeightConstraint creates a mathematical relationship that fixes an element's\n * height to a constant value. The constraint equation is: element.height = height.\n * This is useful for ensuring elements maintain a specific height regardless of\n * other layout changes or for setting fixed dimensions in responsive layouts.\n *\n * @see {@link UISingleParameterConstraint} - Base class for single-parameter constraints\n * @see {@link UIPlaneElement} - Elements that can have height constraints applied\n * @see {@link UIExpression} - Mathematical expressions for constraint equations\n */\nexport class UIHeightConstraint extends UISingleParameterConstraint {\n /** The constraint descriptor managed by the solver system. */\n protected override readonly constraint: number;\n\n /** Internal storage for the current height value. */\n private heightInternal: number;\n\n /**\n * Creates a new UIHeightConstraint instance.\n *\n * If no height is specified in options, the constraint will use the\n * element's current height as the target height value.\n *\n * @param element - The UI element to apply the height constraint to\n * @param options - Configuration options for the constraint\n */\n constructor(\n private readonly element: UIPlaneElement & UILayerElement,\n options: Partial<UIHeightConstraintOptions> = {},\n ) {\n super(\n element.layer,\n options.priority,\n options.relation,\n options.orientation,\n );\n\n this.heightInternal = options.height ?? element.height;\n\n this.constraint = this.solverWrapper.createConstraint(\n new UIExpression(0, [[this.element.hVariable, 1]]),\n new UIExpression(this.heightInternal),\n this.relation,\n this.priority,\n this.isConstraintEnabled(),\n );\n }\n\n /**\n * Gets the current height value being enforced.\n * @returns The height value in pixels\n */\n public get height(): number {\n return this.heightInternal;\n }\n\n /**\n * Sets a new height value and updates the constraint equation.\n * @param value - The new height value in pixels\n */\n public set height(value: number) {\n if (this.heightInternal !== value) {\n this.heightInternal = value;\n this.solverWrapper.setConstraintRHS(\n this.constraint,\n new UIExpression(value),\n );\n }\n }\n}\n","import { UILayer } from \"../layers/UILayer\";\n\n/** Small epsilon value for floating-point comparisons and minimum positive number validation. */\nexport const EPSILON = 1e-6;\n\n/**\n * Interface for objects that belong to a UI layer.\n *\n * Elements implementing this interface are associated with a specific layer\n * for constraint solving and rendering management.\n */\nexport interface UILayerElement {\n /** The UI layer that contains this element. */\n readonly layer: UILayer;\n}\n\n/**\n * Interface for UI elements that have a position in 2D space.\n *\n * Point elements are characterized by x and y coordinates represented\n * as solver variable descriptors for constraint-based positioning.\n */\nexport interface UIPointElement {\n /** Solver variable descriptor for the x-coordinate. */\n readonly xVariable: number;\n /** Solver variable descriptor for the y-coordinate. */\n readonly yVariable: number;\n\n /** The x-coordinate of the element. */\n readonly x: number;\n /** The y-coordinate of the element. */\n readonly y: number;\n}\n\n/**\n * Interface for UI elements that have both position and dimensions in 2D space.\n *\n * Plane elements extend point elements with width and height properties,\n * enabling rectangular area constraints and positioning.\n */\nexport interface UIPlaneElement extends UIPointElement {\n /** Solver variable descriptor for the width dimension. */\n readonly wVariable: number;\n /** Solver variable descriptor for the height dimension. */\n readonly hVariable: number;\n\n /** The width of the element. */\n readonly width: number;\n /** The height of the element. */\n readonly height: number;\n}\n\n/**\n * Type guard to check if an object implements the UILayerElement interface.\n *\n * @param obj - The object to check\n * @returns True if the object has a valid layer property, false otherwise\n */\nexport function isUILayerElement(obj: unknown): obj is UILayerElement {\n return (\n typeof obj === \"object\" &&\n obj !== null &&\n \"layer\" in obj &&\n obj.layer instanceof UILayer\n );\n}\n\n/**\n * Type guard to check if an object implements the UIPointElement interface.\n *\n * @param obj - The object to check\n * @returns True if the object has valid xVariable and yVariable properties, false otherwise\n */\nexport function isUIPointElement(obj: unknown): obj is UIPointElement {\n return (\n typeof obj === \"object\" &&\n obj !== null &&\n \"xVariable\" in obj &&\n typeof obj.xVariable === \"number\" &&\n \"yVariable\" in obj &&\n typeof obj.yVariable === \"number\" &&\n \"width\" in obj &&\n typeof obj.width === \"number\" &&\n \"height\" in obj &&\n typeof obj.height === \"number\"\n );\n}\n\n/**\n * Type guard to check if an object implements the UIPlaneElement interface.\n *\n * Note: This function only checks for width and height variables. Objects\n * should also satisfy UIPointElement requirements for complete validation.\n *\n * @param obj - The object to check\n * @returns True if the object has valid wVariable and hVariable properties, false otherwise\n */\nexport function isUIPlaneElement(obj: unknown): obj is UIPlaneElement {\n return (\n typeof obj === \"object\" &&\n obj !== null &&\n \"wVariable\" in obj &&\n typeof obj.wVariable === \"number\" &&\n \"hVariable\" in obj &&\n typeof obj.hVariable === \"number\" &&\n \"width\" in obj &&\n typeof obj.width === \"number\" &&\n \"height\" in obj &&\n typeof obj.height === \"number\"\n );\n}\n\n/**\n * Validates that two objects are valid constraint subjects from the same layer.\n *\n * Ensures that both objects are either UILayer instances or UILayerElement instances,\n * that they are not both layers (which cannot be constrained to each other),\n * and that they belong to the same layer for constraint solving.\n *\n * @param a - The first constraint subject\n * @param b - The second constraint subject\n * @param subject - The name of the constraint for error messages\n * @returns The common layer that both subjects belong to\n * @throws Will throw an error if subjects are invalid or from different layers\n */\nexport function assertValidConstraintSubjects(\n a: unknown,\n b: unknown,\n subject: string,\n): UILayer {\n if (a instanceof UILayer && b instanceof UILayer) {\n throw new Error(`${subject}: layer cannot be snapped to another layer`);\n }\n\n let layerA: UILayer;\n let layerB: UILayer;\n\n if (a instanceof UILayer || isUILayerElement(a)) {\n layerA = a instanceof UILayer ? a : a.layer;\n } else {\n throw new Error(`${subject}: A must be a UILayer or a UIPointElement`);\n }\n\n if (b instanceof UILayer || isUILayerElement(b)) {\n layerB = b instanceof UILayer ? b : b.layer;\n } else {\n throw new Error(`${subject}: B must be a UILayer or a UIPointElement`);\n }\n\n if (layerA !== layerB) {\n throw new Error(`${subject}: elements must be on the same layer`);\n }\n\n return layerA;\n}\n\n/**\n * Validates that a value is a finite number within safe integer range.\n *\n * Checks that the value is finite (not NaN, Infinity, or -Infinity) and\n * within the safe integer range for reliable mathematical operations.\n *\n * @param value - The number to validate\n * @param subject - The name of the value for error messages\n * @throws Will throw an error if the value is not finite or exceeds safe range\n */\nexport function assertValidNumber(value: number, subject: string): void {\n if (!Number.isFinite(value)) {\n throw new Error(`${subject}: value must be a finite number`);\n }\n\n if (Math.abs(value) > Number.MAX_SAFE_INTEGER) {\n throw new Error(`${subject}: value exceeds maximum safe integer range`);\n }\n}\n\n/**\n * Validates that a value is a positive number above the epsilon threshold.\n *\n * First validates that the value is a finite number, then ensures it is\n * greater than or equal to EPSILON to avoid numerical precision issues\n * with very small positive values.\n *\n * @param value - The number to validate\n * @param subject - The name of the value for error messages\n * @throws Will throw an error if the value is invalid or not sufficiently positive\n * @see {@link assertValidNumber}\n */\nexport function assertValidPositiveNumber(\n value: number,\n subject: string,\n): void {\n assertValidNumber(value, subject);\n\n if (value < EPSILON) {\n throw new Error(\n `${subject}: value must be greater than or equal to ${EPSILON}`,\n );\n }\n}\n\n/**\n * Validates that a value is a non-negative number (including zero).\n *\n * First validates that the value is a finite number, then ensures it is\n * greater than or equal to zero. Unlike assertValidPositiveNumber, this\n * function allows zero as a valid value.\n *\n * @param value - The number to validate\n * @param subject - The name of the value for error messages\n * @throws Will throw an error if the value is invalid or negative\n * @see {@link assertValidNumber}\n */\nexport function assertValidNonNegativeNumber(\n value: number,\n subject: string,\n): void {\n assertValidNumber(value, subject);\n if (value < 0) {\n throw new Error(`${subject}: value must be greater than or equal to 0`);\n }\n}\n","import type { UIPlaneElement, UIPointElement } from \"../miscellaneous/asserts\";\nimport {\n assertValidConstraintSubjects,\n isUIPlaneElement,\n isUIPointElement,\n} from \"../miscellaneous/asserts\";\nimport { UIExpression } from \"../miscellaneous/UIExpression\";\nimport type { UISingleParameterConstraintOptions } from \"./UISingleParameterConstraint\";\nimport { UISingleParameterConstraint } from \"./UISingleParameterConstraint\";\n\n/** Default anchor point (0.5 = center) for elements when not specified. */\nconst DEFAULT_ANCHOR = 0.5;\n\n/**\n * Configuration options for UIHorizontalDistanceConstraint creation.\n */\nexport interface UIHorizontalDistanceConstraintOptions\n extends UISingleParameterConstraintOptions {\n /** Anchor point for element A (0.0 = left edge, 0.5 = center, 1.0 = right edge). */\n anchorA: number;\n /** Anchor point for element B (0.0 = left edge, 0.5 = center, 1.0 = right edge). */\n anchorB: number;\n /** The desired horizontal distance between the elements. */\n distance: number;\n}\n\n/**\n * Constraint that enforces horizontal distance between two UI elements.\n *\n * UIHorizontalDistanceConstraint creates a mathematical relationship that maintains\n * a specific horizontal distance between two elements using configurable anchor points.\n * For plane elements, anchors determine the reference point (0.0 = left, 0.5 = center, 1.0 = right).\n * For point elements, the anchor is always the element's position. The constraint equation is:\n * (elementB.x + elementB.width * anchorB) - (elementA.x + elementA.width * anchorA) = distance\n *\n * @see {@link UISingleParameterConstraint} - Base class for single-parameter constraints\n * @see {@link UIPointElement} - Point elements that can be constrained\n * @see {@link UIPlaneElement} - Plane elements that can be constrained\n * @see {@link UIExpression} - Mathematical expressions for constraint equations\n */\nexport class UIHorizontalDistanceConstraint extends UISingleParameterConstraint {\n /** The constraint descriptor managed by the solver system. */\n protected override readonly constraint: number;\n\n /** Internal storage for element A's anchor point. */\n private anchorAInternal: number;\n /** Internal storage for element B's anchor point. */\n private anchorBInternal: number;\n /** Internal storage for the horizontal distance value. */\n private distanceInternal: number;\n\n /**\n * Creates a new UIHorizontalDistanceConstraint instance.\n *\n * The constraint will use default anchor points (0.5 = center) and zero distance\n * if not specified in options. Both elements must be from the same layer.\n *\n * @param a - The first UI element (point or plane element)\n * @param b - The second UI element (point or plane element)\n * @param options - Configuration options for the constraint\n * @throws Will throw an error if elements are not from the same layer\n * @see {@link assertValidConstraintSubjects}\n */\n constructor(\n private readonly a: UIPointElement | UIPlaneElement,\n private readonly b: UIPointElement | UIPlaneElement,\n options: Partial<UIHorizontalDistanceConstraintOptions> = {},\n ) {\n super(\n assertValidConstraintSubjects(a, b, \"UIHorizontalDistanceConstraint\"),\n options.priority,\n options.relation,\n options.orientation,\n );\n\n this.anchorAInternal = options.anchorA ?? DEFAULT_ANCHOR;\n this.anchorBInternal = options.anchorB ?? DEFAULT_ANCHOR;\n this.distanceInternal = options.distance ?? 0;\n\n this.constraint = this.solverWrapper.createConstraint(\n this.buildLHS(),\n new UIExpression(this.distanceInternal),\n this.relationInternal,\n this.priorityInternal,\n this.isConstraintEnabled(),\n );\n }\n\n /**\n * Gets the current horizontal distance being enforced.\n * @returns The horizontal distance in pixels\n */\n public get distance(): number {\n return this.distanceInternal;\n }\n\n /**\n * Gets the anchor point for element A.\n * @returns The anchor value (0.0 = left, 0.5 = center, 1.0 = right)\n */\n public get anchorA(): number {\n return this.anchorAInternal;\n }\n\n /**\n * Gets the anchor point for element B.\n * @returns The anchor value (0.0 = left, 0.5 = center, 1.0 = right)\n */\n public get anchorB(): number {\n return this.anchorBInternal;\n }\n\n /**\n * Sets a new horizontal distance and updates the constraint equation.\n * @param value - The new horizontal distance in pixels\n */\n public set distance(value: number) {\n if (this.distanceInternal !== value) {\n this.distanceInternal = value;\n this.solverWrapper.setConstraintRHS(\n this.constraint,\n new UIExpression(this.distanceInternal),\n );\n }\n }\n\n /**\n * Sets a new anchor point for element A and updates the constraint equation.\n * @param value - The new anchor value (0.0 = left, 0.5 = center, 1.0 = right)\n */\n public set anchorA(value: number) {\n if (this.anchorAInternal !== value) {\n this.anchorAInternal = value;\n this.solverWrapper.setConstraintLHS(this.constraint, this.buildLHS());\n }\n }\n\n /**\n * Sets a new anchor point for element B and updates the constraint equation.\n * @param value - The new anchor value (0.0 = left, 0.5 = center, 1.0 = right)\n */\n public set anchorB(value: number) {\n if (this.anchorBInternal !== value) {\n this.anchorBInternal = value;\n this.solverWrapper.setConstraintLHS(this.constraint, this.buildLHS());\n }\n }\n\n /**\n * Builds the left-hand side expression for the constraint equation.\n *\n * Creates the expression: (elementB.x + elementB.width * anchorB) - (elementA.x + elementA.width * anchorA)\n * For point elements, only the x position is used since they have no width.\n * For plane elements, the anchor determines the reference point within the element's width.\n *\n * @returns The UIExpression representing the horizontal distance calculation\n */\n private buildLHS(): UIExpression {\n let aExpression: UIExpression;\n let bExpression: UIExpression;\n\n if (isUIPlaneElement(this.a)) {\n aExpression = new UIExpression(0, [\n [this.a.xVariable, 1],\n [this.a.wVariable, this.anchorAInternal],\n ]);\n } else if (isUIPointElement(this.a)) {\n aExpression = new UIExpression().plus(this.a.xVariable, 1);\n } else {\n throw new Error(\"A is not a valid element type\");\n }\n\n if (isUIPlaneElement(this.b)) {\n bExpression = new UIExpression(0, [\n [this.b.xVariable, 1],\n [this.b.wVariable, this.anchorBInternal],\n ]);\n } else if (isUIPointElement(this.b)) {\n bExpression = new UIExpression().plus(this.b.xVariable, 1);\n } else {\n throw new Error(\"B is not a valid element type\");\n }\n\n return UIExpression.minus(bExpression, aExpression);\n }\n}\n","import type { UIPlaneElement } from \"../miscellaneous/asserts\";\nimport { assertValidConstraintSubjects } from \"../miscellaneous/asserts\";\nimport { UIExpression } from \"../miscellaneous/UIExpression\";\nimport type { UISingleParameterConstraintOptions } from \"./UISingleParameterConstraint\";\nimport { UISingleParameterConstraint } from \"./UISingleParameterConstraint\";\n\n/**\n * Configuration options for UIHorizontalProportionConstraint creation.\n */\nexport interface UIHorizontalProportionConstraintOptions\n extends UISingleParameterConstraintOptions {\n /** The proportional relationship between element widths (elementA.width * proportion = elementB.width). */\n proportion: number;\n}\n\n/**\n * Constraint that enforces proportional width relationships between two UI elements.\n *\n * UIHorizontalProportionConstraint creates a mathematical relationship that maintains\n * a proportional ratio between the widths of two plane elements. The constraint equation is:\n * elementA.width * proportion = elementB.width, which can be rearranged as:\n * elementA.width * proportion - elementB.width = 0\n *\n * This is useful for creating responsive layouts where elements need to maintain\n * specific width ratios, such as sidebar-to-content ratios or grid column proportions.\n *\n * @see {@link UISingleParameterConstraint} - Base class for single-parameter constraints\n * @see {@link UIPlaneElement} - Plane elements that can have proportional constraints applied\n * @see {@link UIExpression} - Mathematical expressions for constraint equations\n */\nexport class UIHorizontalProportionConstraint extends UISingleParameterConstraint {\n /** The constraint descriptor managed by the solver system. */\n protected override readonly constraint: number;\n /** Internal storage for the current proportion value. */\n private proportionInternal: number;\n\n /**\n * Creates a new UIHorizontalProportionConstraint instance.\n *\n * The constraint will enforce the relationship: elementA.width * proportion = elementB.width.\n * If no proportion is specified, it defaults to 1.0 (equal widths).\n * Both elements must be from the same layer.\n *\n * @param a - The first UI plane element (whose width will be multiplied by proportion)\n * @param b - The second UI plane element (target width for the proportion)\n * @param options - Configuration options for the constraint\n * @throws Will throw an error if elements are not from the same layer\n * @see {@link assertValidConstraintSubjects}\n */\n constructor(\n private readonly a: UIPlaneElement,\n private readonly b: UIPlaneElement,\n options: Partial<UIHorizontalProportionConstraintOptions> = {},\n ) {\n super(\n assertValidConstraintSubjects(a, b, \"UIHorizontalProportionConstraint\"),\n options.priority,\n options.relation,\n options.orientation,\n );\n\n this.proportionInternal = options.proportion ?? 1;\n\n this.constraint = this.solverWrapper.createConstraint(\n new UIExpression(0),\n this.buildRHS(),\n this.relationInternal,\n this.priorityInternal,\n this.isConstraintEnabled(),\n );\n }\n\n /**\n * Gets the current proportion value being enforced.\n * @returns The proportion ratio (elementA.width * proportion = elementB.width)\n */\n public get proportion(): number {\n return this.proportionInternal;\n }\n\n /**\n * Sets a new proportion value and updates the constraint equation.\n * @param value - The new proportion ratio\n */\n public set proportion(value: number) {\n if (this.proportionInternal !== value) {\n this.proportionInternal = value;\n this.solverWrapper.setConstraintRHS(this.constraint, this.buildRHS());\n }\n }\n\n /**\n * Builds the right-hand side expression for the constraint equation.\n *\n * Creates the expression: (elementA.width * proportion) - elementB.width = 0\n * This enforces the relationship: elementA.width * proportion = elementB.width\n *\n * @returns The UIExpression representing the proportional width relationship\n */\n private buildRHS(): UIExpression {\n return UIExpression.minus(\n new UIExpression(0, [[this.a.wVariable, this.proportionInternal]]),\n new UIExpression(0, [[this.b.wVariable, 1]]),\n );\n }\n}\n","import type { UIPlaneElement, UIPointElement } from \"../miscellaneous/asserts\";\nimport {\n assertValidConstraintSubjects,\n isUIPlaneElement,\n isUIPointElement,\n} from \"../miscellaneous/asserts\";\nimport { UIExpression } from \"../miscellaneous/UIExpression\";\nimport type { UISingleParameterConstraintOptions } from \"./UISingleParameterConstraint\";\nimport { UISingleParameterConstraint } from \"./UISingleParameterConstraint\";\n\n/** Default anchor point (0.5 = center) for elements when not specified. */\nconst DEFAULT_ANCHOR = 0.5;\n\n/**\n * Configuration options for UIVerticalDistanceConstraint creation.\n */\nexport interface UIVerticalDistanceConstraintOptions\n extends UISingleParameterConstraintOptions {\n /** Anchor point for element A (0.0 = top edge, 0.5 = center, 1.0 = bottom edge). */\n anchorA: number;\n /** Anchor point for element B (0.0 = top edge, 0.5 = center, 1.0 = bottom edge). */\n anchorB: number;\n /** The desired vertical distance between the elements. */\n distance: number;\n}\n\n/**\n * Constraint that enforces vertical distance between two UI elements.\n *\n * UIVerticalDistanceConstraint creates a mathematical relationship that maintains\n * a specific vertical distance between two elements using configurable anchor points.\n * For plane elements, anchors determine the reference point (0.0 = top, 0.5 = center, 1.0 = bottom).\n * For point elements, the anchor is always the element's position. The constraint equation is:\n * (elementB.y + elementB.height * anchorB) - (elementA.y + elementA.height * anchorA) = distance\n *\n * @see {@link UISingleParameterConstraint} - Base class for single-parameter constraints\n * @see {@link UIPointElement} - Point elements that can be constrained\n * @see {@link UIPlaneElement} - Plane elements that can be constrained\n * @see {@link UIExpression} - Mathematical expressions for constraint equations\n */\nexport class UIVerticalDistanceConstraint extends UISingleParameterConstraint {\n /** The constraint descriptor managed by the solver system. */\n protected override readonly constraint: number;\n\n /** Internal storage for element A's anchor point. */\n private anchorAInternal: number;\n /** Internal storage for element B's anchor point. */\n private anchorBInternal: number;\n /** Internal storage for the vertical distance value. */\n private distanceInternal: number;\n\n /**\n * Creates a new UIVerticalDistanceConstraint instance.\n *\n * The constraint will use default anchor points (0.5 = center) and zero distance\n * if not specified in options. Both elements must be from the same layer.\n *\n * @param a - The first UI element (point or plane element)\n * @param b - The second UI element (point or plane element)\n * @param options - Configuration options for the constraint\n * @throws Will throw an error if elements are not from the same layer\n * @see {@link assertValidConstraintSubjects}\n */\n constructor(\n private readonly a: UIPointElement | UIPlaneElement,\n private readonly b: UIPointElement | UIPlaneElement,\n options: Partial<UIVerticalDistanceConstraintOptions> = {},\n ) {\n super(\n assertValidConstraintSubjects(a, b, \"UIVerticalDistanceConstraint\"),\n options.priority,\n options.relation,\n options.orientation,\n );\n\n this.anchorAInternal = options.anchorA ?? DEFAULT_ANCHOR;\n this.anchorBInternal = options.anchorB ?? DEFAULT_ANCHOR;\n this.distanceInternal = options.distance ?? 0;\n\n this.constraint = this.solverWrapper.createConstraint(\n this.buildLHS(),\n new UIExpression(this.distanceInternal),\n this.relationInternal,\n this.priorityInternal,\n this.isConstraintEnabled(),\n );\n }\n\n /**\n * Gets the current vertical distance being enforced.\n * @returns The vertical distance in pixels\n */\n public get distance(): number {\n return this.distanceInternal;\n }\n\n /**\n * Gets the anchor point for element A.\n * @returns The anchor value (0.0 = top, 0.5 = center, 1.0 = bottom)\n */\n public get anchorA(): number {\n return this.anchorAInternal;\n }\n\n /**\n * Gets the anchor point for element B.\n * @returns The anchor value (0.0 = top, 0.5 = center, 1.0 = bottom)\n */\n public get anchorB(): number {\n return this.anchorBInternal;\n }\n\n /**\n * Sets a new vertical distance and updates the constraint equation.\n * @param value - The new vertical distance in pixels\n */\n public set distance(value: number) {\n if (this.distanceInternal !== value) {\n this.distanceInternal = value;\n this.solverWrapper.setConstraintRHS(\n this.constraint,\n new UIExpression(this.distanceInternal),\n );\n }\n }\n\n /**\n * Sets a new anchor point for element A and updates the constraint equation.\n * @param value - The new anchor value (0.0 = top, 0.5 = center, 1.0 = bottom)\n */\n public set anchorA(value: number) {\n if (this.anchorAInternal !== value) {\n this.anchorAInternal = value;\n this.solverWrapper.setConstraintLHS(this.constraint, this.buildLHS());\n }\n }\n\n /**\n * Sets a new anchor point for element B and updates the constraint equation.\n * @param value - The new anchor value (0.0 = top, 0.5 = center, 1.0 = bottom)\n */\n public set anchorB(value: number) {\n if (this.anchorBInternal !== value) {\n this.anchorBInternal = value;\n this.solverWrapper.setConstraintLHS(this.constraint, this.buildLHS());\n }\n }\n\n /**\n * Builds the left-hand side expression for the constraint equation.\n *\n * Creates the expression: (elementB.y + elementB.height * anchorB) - (elementA.y + elementA.height * anchorA)\n * For point elements, only the y position is used since they have no height.\n * For plane elements, the anchor determines the reference point within the element's height.\n *\n * @returns The UIExpression representing the vertical distance calculation\n */\n private buildLHS(): UIExpression {\n let aExpression: UIExpression;\n let bExpression: UIExpression;\n\n if (isUIPlaneElement(this.a)) {\n aExpression = new UIExpression(0, [\n [this.a.yVariable, 1],\n [this.a.hVariable, this.anchorAInternal],\n ]);\n } else if (isUIPointElement(this.a)) {\n aExpression = new UIExpression().plus(this.a.yVariable, 1);\n } else {\n throw new Error(\"A is not a valid element type\");\n }\n\n if (isUIPlaneElement(this.b)) {\n bExpression = new UIExpression(0, [\n [this.b.yVariable, 1],\n [this.b.hVariable, this.anchorBInternal],\n ]);\n } else if (isUIPointElement(this.b)) {\n bExpression = new UIExpression().plus(this.b.yVariable, 1);\n } else {\n throw new Error(\"B is not a valid element type\");\n }\n\n return UIExpression.minus(bExpression, aExpression);\n }\n}\n","import type { UIPlaneElement } from \"../miscellaneous/asserts\";\nimport { assertValidConstraintSubjects } from \"../miscellaneous/asserts\";\nimport { UIExpression } from \"../miscellaneous/UIExpression\";\nimport type { UISingleParameterConstraintOptions } from \"./UISingleParameterConstraint\";\nimport { UISingleParameterConstraint } from \"./UISingleParameterConstraint\";\n\n/**\n * Configuration options for UIVerticalProportionConstraint creation.\n */\nexport interface UIVerticalProportionConstraintOptions\n extends UISingleParameterConstraintOptions {\n /** The proportional relationship between element heights (elementA.height * proportion = elementB.height). */\n proportion: number;\n}\n\n/**\n * Constraint that enforces proportional height relationships between two UI elements.\n *\n * UIVerticalProportionConstraint creates a mathematical relationship that maintains\n * a proportional ratio between the heights of two plane elements. The constraint equation is:\n * elementA.height * proportion = elementB.height, which can be rearranged as:\n * elementA.height * proportion - elementB.height = 0\n *\n * This is useful for creating responsive layouts where elements need to maintain\n * specific height ratios, such as header-to-content ratios or row height proportions.\n *\n * @see {@link UISingleParameterConstraint} - Base class for single-parameter constraints\n * @see {@link UIPlaneElement} - Plane elements that can have proportional constraints applied\n * @see {@link UIExpression} - Mathematical expressions for constraint equations\n */\nexport class UIVerticalProportionConstraint extends UISingleParameterConstraint {\n /** The constraint descriptor managed by the solver system. */\n protected override readonly constraint: number;\n /** Internal storage for the current proportion value. */\n private proportionInternal: number;\n\n /**\n * Creates a new UIVerticalProportionConstraint instance.\n *\n * The constraint will enforce the relationship: elementA.height * proportion = elementB.height.\n * If no proportion is specified, it defaults to 1.0 (equal heights).\n * Both elements must be from the same layer.\n *\n * @param a - The first UI plane element (whose height will be multiplied by proportion)\n * @param b - The second UI plane element (target height for the proportion)\n * @param options - Configuration options for the constraint\n * @throws Will throw an error if elements are not from the same layer\n * @see {@link assertValidConstraintSubjects}\n */\n constructor(\n private readonly a: UIPlaneElement,\n private readonly b: UIPlaneElement,\n options: Partial<UIVerticalProportionConstraintOptions> = {},\n ) {\n super(\n assertValidConstraintSubjects(a, b, \"UIVerticalProportionConstraint\"),\n options.priority,\n options.relation,\n options.orientation,\n );\n\n this.proportionInternal = options.proportion ?? 1;\n\n this.constraint = this.solverWrapper.createConstraint(\n new UIExpression(0),\n this.buildRHS(),\n this.relationInternal,\n this.priorityInternal,\n this.isConstraintEnabled(),\n );\n }\n\n /**\n * Gets the current proportion value being enforced.\n * @returns The proportion ratio (elementA.height * proportion = elementB.height)\n */\n public get proportion(): number {\n return this.proportionInternal;\n }\n\n /**\n * Sets a new proportion value and updates the constraint equation.\n * @param value - The new proportion ratio\n */\n public set proportion(value: number) {\n if (this.proportionInternal !== value) {\n this.proportionInternal = value;\n this.solverWrapper.setConstraintRHS(this.constraint, this.buildRHS());\n }\n }\n\n /**\n * Builds the right-hand side expression for the constraint equation.\n *\n * Creates the expression: (elementA.height * proportion) - elementB.height = 0\n * This enforces the relationship: elementA.height * proportion = elementB.height\n *\n * @returns The UIExpression representing the proportional height relationship\n */\n private buildRHS(): UIExpression {\n return UIExpression.minus(\n new UIExpression(0, [[this.a.hVariable, this.proportionInternal]]),\n new UIExpression(0, [[this.b.hVariable, 1]]),\n );\n }\n}\n","import type { UILayerElement, UIPlaneElement } from \"../miscellaneous/asserts\";\nimport { UIExpression } from \"../miscellaneous/UIExpression\";\nimport type { UISingleParameterConstraintOptions } from \"./UISingleParameterConstraint\";\nimport { UISingleParameterConstraint } from \"./UISingleParameterConstraint\";\n\n/**\n * Configuration options for UIWidthConstraint creation.\n */\nexport interface UIWidthConstraintOptions\n extends UISingleParameterConstraintOptions {\n /** The desired width value for the element. */\n width: number;\n}\n\n/**\n * Constraint that enforces a specific width value for UI elements.\n *\n * UIWidthConstraint creates a mathematical relationship that fixes an element's\n * width to a constant value. The constraint equation is: element.width = width.\n * This is useful for ensuring elements maintain a specific width regardless of\n * other layout changes or for setting fixed dimensions in responsive layouts.\n *\n * @see {@link UISingleParameterConstraint} - Base class for single-parameter constraints\n * @see {@link UIPlaneElement} - Elements that can have width constraints applied\n * @see {@link UIExpression} - Mathematical expressions for constraint equations\n */\nexport class UIWidthConstraint extends UISingleParameterConstraint {\n /** The constraint descriptor managed by the solver system. */\n protected override readonly constraint: number;\n\n /** Internal storage for the current width value. */\n private widthInternal: number;\n\n /**\n * Creates a new UIWidthConstraint instance.\n *\n * If no width is specified in options, the constraint will use the\n * element's current width as the target width value.\n *\n * @param element - The UI element to apply the width constraint to\n * @param options - Configuration options for the constraint\n */\n constructor(\n private readonly element: UIPlaneElement & UILayerElement,\n options: Partial<UIWidthConstraintOptions> = {},\n ) {\n super(\n element.layer,\n options.priority,\n options.relation,\n options.orientation,\n );\n\n this.widthInternal = options.width ?? element.width;\n\n this.constraint = this.solverWrapper.createConstraint(\n new UIExpression(0, [[this.element.wVariable, 1]]),\n new UIExpression(this.widthInternal),\n this.relation,\n this.priority,\n this.isConstraintEnabled(),\n );\n }\n\n /**\n * Gets the current width value being enforced.\n * @returns The width value in pixels\n */\n public get width(): number {\n return this.widthInternal;\n }\n\n /**\n * Sets a new width value and updates the constraint equation.\n * @param value - The new width value in pixels\n */\n public set width(value: number) {\n if (this.widthInternal !== value) {\n this.widthInternal = value;\n this.solverWrapper.setConstraintRHS(\n this.constraint,\n new UIExpression(value),\n );\n }\n }\n}\n","import { UIHeightConstraint } from \"../constraints/UIHeightConstraint\";\nimport { UIHorizontalDistanceConstraint } from \"../constraints/UIHorizontalDistanceConstraint\";\nimport { UIHorizontalProportionConstraint } from \"../constraints/UIHorizontalProportionConstraint\";\nimport { UIVerticalDistanceConstraint } from \"../constraints/UIVerticalDistanceConstraint\";\nimport { UIVerticalProportionConstraint } from \"../constraints/UIVerticalProportionConstraint\";\nimport { UIWidthConstraint } from \"../constraints/UIWidthConstraint\";\nimport type { UIElement } from \"../elements/UIElement\";\nimport type { UIPlaneElement, UIPointElement } from \"../miscellaneous/asserts\";\nimport type { UIOrientation } from \"../miscellaneous/UIOrientation\";\nimport type { UIPriority } from \"../miscellaneous/UIPriority\";\nimport type { UIRelation } from \"../miscellaneous/UIRelation\";\n\n/**\n * Generic 2D type for specifying horizontal and vertical values.\n *\n * This interface allows configuration of properties that can have\n * different values for horizontal and vertical directions.\n *\n * @template T - The type of values for horizontal and vertical properties\n */\ninterface UIType2D<T> {\n /** Horizontal (x-axis) value. */\n h?: T;\n /** Vertical (y-axis) value. */\n v?: T;\n}\n\n/**\n * Base options for 2D constraint configuration.\n */\ninterface UIConstraint2DOptions {\n /** Priority levels for horizontal and vertical constraints. */\n priority: UIType2D<UIPriority>;\n /** Mathematical relations for horizontal and vertical constraints. */\n relation: UIType2D<UIRelation>;\n /** Orientation settings for horizontal and vertical constraints. */\n orientation: UIType2D<UIOrientation>;\n}\n\n/**\n * Configuration options for 2D size constraints.\n */\nexport interface UIConstraintSize2DOptions extends UIConstraint2DOptions {\n /** Size values for horizontal (width) and vertical (height) dimensions. */\n size: UIType2D<number>;\n}\n\n/**\n * Configuration options for 2D distance constraints.\n */\nexport interface UIConstraintDistance2DOptions extends UIConstraint2DOptions {\n /** Anchor points for element A in horizontal and vertical directions. */\n anchorA: UIType2D<number>;\n /** Anchor points for element B in horizontal and vertical directions. */\n anchorB: UIType2D<number>;\n /** Distance values for horizontal and vertical spacing. */\n distance: UIType2D<number>;\n}\n\n/**\n * Configuration options for 2D proportion constraints.\n */\nexport interface UIConstraintProportion2DOptions extends UIConstraint2DOptions {\n /** Proportion ratios for horizontal and vertical relationships. */\n proportion: UIType2D<number>;\n}\n\n/**\n * Result object containing horizontal and vertical constraint instances.\n *\n * @template TH - The type of the horizontal constraint\n * @template TV - The type of the vertical constraint\n */\nexport interface UIConstraint2DResult<TH, TV> {\n /** The horizontal constraint instance. */\n h: TH;\n /** The vertical constraint instance. */\n v: TV;\n}\n\n/**\n * Builder utility for creating paired horizontal and vertical constraints.\n *\n * UIConstraint2DBuilder simplifies the creation of constraint pairs that work\n * together to define 2D relationships between UI elements. Instead of manually\n * creating separate horizontal and vertical constraints, this builder allows\n * you to specify both dimensions at once with a unified interface.\n *\n * This is particularly useful for creating consistent spacing, sizing, and\n * proportional relationships across both axes simultaneously.\n *\n * @see {@link UIWidthConstraint} - Horizontal size constraints\n * @see {@link UIHeightConstraint} - Vertical size constraints\n * @see {@link UIHorizontalDistanceConstraint} - Horizontal spacing constraints\n * @see {@link UIVerticalDistanceConstraint} - Vertical spacing constraints\n */\nexport class UIConstraint2DBuilder {\n /**\n * Creates paired width and height constraints for an element.\n *\n * This method generates both horizontal (width) and vertical (height)\n * size constraints simultaneously, allowing you to set fixed dimensions\n * for both axes with a single call.\n *\n * @param element - The UI element to apply size constraints to\n * @param options - Configuration options for both width and height constraints\n * @returns Object containing the created width and height constraint instances\n */\n public static size(\n element: UIElement,\n options: Partial<UIConstraintSize2DOptions> = {},\n ): UIConstraint2DResult<UIWidthConstraint, UIHeightConstraint> {\n return {\n h: new UIWidthConstraint(element, {\n width: options.size?.h,\n priority: options.priority?.h,\n relation: options.relation?.h,\n orientation: options.orientation?.h,\n }),\n v: new UIHeightConstraint(element, {\n height: options.size?.v,\n priority: options.priority?.v,\n relation: options.relation?.v,\n orientation: options.orientation?.v,\n }),\n };\n }\n\n /**\n * Creates paired horizontal and vertical distance constraints between two elements.\n *\n * This method generates both horizontal and vertical spacing constraints\n * simultaneously, allowing you to define 2D spacing relationships with\n * configurable anchor points for both axes.\n *\n * @param a - The first UI element (point or plane element)\n * @param b - The second UI element (point or plane element)\n * @param options - Configuration options for both horizontal and vertical distance constraints\n * @returns Object containing the created horizontal and vertical distance constraint instances\n */\n public static distance(\n a: UIPointElement | UIPlaneElement,\n b: UIPointElement | UIPlaneElement,\n options: Partial<UIConstraintDistance2DOptions> = {},\n ): UIConstraint2DResult<\n UIHorizontalDistanceConstraint,\n UIVerticalDistanceConstraint\n > {\n return {\n h: new UIHorizontalDistanceConstraint(a, b, {\n anchorA: options.anchorA?.h,\n anchorB: options.anchorB?.h,\n distance: options.distance?.h,\n priority: options.priority?.h,\n relation: options.relation?.h,\n orientation: options.orientation?.h,\n }),\n v: new UIVerticalDistanceConstraint(a, b, {\n anchorA: options.anchorA?.v,\n anchorB: options.anchorB?.v,\n distance: options.distance?.v,\n priority: options.priority?.v,\n relation: options.relation?.v,\n orientation: options.orientation?.v,\n }),\n };\n }\n\n /**\n * Creates paired horizontal and vertical proportion constraints between two elements.\n *\n * This method generates both horizontal (width) and vertical (height)\n * proportion constraints simultaneously, allowing you to define proportional\n * relationships for both dimensions with a single call.\n *\n * @param a - The first UI plane element (whose dimensions will be multiplied by proportion)\n * @param b - The second UI plane element (target dimensions for the proportion)\n * @param options - Configuration options for both horizontal and vertical proportion constraints\n * @returns Object containing the created horizontal and vertical proportion constraint instances\n */\n public static proportion(\n a: UIPlaneElement,\n b: UIPlaneElement,\n options: Partial<UIConstraintProportion2DOptions> = {},\n ): UIConstraint2DResult<\n UIHorizontalProportionConstraint,\n UIVerticalProportionConstraint\n > {\n return {\n h: new UIHorizontalProportionConstraint(a, b, {\n proportion: options.proportion?.h,\n priority: options.priority?.h,\n relation: options.relation?.h,\n orientation: options.orientation?.h,\n }),\n v: new UIVerticalProportionConstraint(a, b, {\n proportion: options.proportion?.v,\n priority: options.priority?.v,\n relation: options.relation?.v,\n orientation: options.orientation?.v,\n }),\n };\n }\n}\n","import type { UILayerElement, UIPlaneElement } from \"../miscellaneous/asserts\";\nimport { UIExpression } from \"../miscellaneous/UIExpression\";\nimport type { UISingleParameterConstraintOptions } from \"./UISingleParameterConstraint\";\nimport { UISingleParameterConstraint } from \"./UISingleParameterConstraint\";\n\n/**\n * Configuration options for UIAspectConstraint creation.\n */\nexport interface UIAspectConstraintOptions\n extends UISingleParameterConstraintOptions {\n /** The desired aspect ratio (width/height) for the element. */\n aspect: number;\n}\n\n/**\n * Constraint that maintains a specific aspect ratio for UI elements.\n *\n * UIAspectConstraint enforces a mathematical relationship between an element's\n * width and height to maintain a constant aspect ratio. The constraint equation\n * is: width = height * aspect. This is useful for ensuring elements maintain\n * their proportions during layout changes or for enforcing specific aspect\n * ratios like 16:9 for video content.\n *\n * @see {@link UISingleParameterConstraint} - Base class for single-parameter constraints\n * @see {@link UIPlaneElement} - Elements that can have aspect constraints applied\n * @see {@link UIExpression} - Mathematical expressions for constraint equations\n */\nexport class UIAspectConstraint extends UISingleParameterConstraint {\n /** The constraint descriptor managed by the solver system. */\n protected override readonly constraint: number;\n\n /** Internal storage for the current aspect ratio value. */\n private aspectInternal: number;\n\n /**\n * Creates a new UIAspectConstraint instance.\n *\n * If no aspect ratio is specified in options, the constraint will use the\n * element's current width-to-height ratio as the target aspect ratio.\n *\n * @param element - The UI element to apply the aspect constraint to\n * @param options - Configuration options for the constraint\n */\n constructor(\n private readonly element: UIPlaneElement & UILayerElement,\n options: Partial<UIAspectConstraintOptions> = {},\n ) {\n super(\n element.layer,\n options.priority,\n options.relation,\n options.orientation,\n );\n\n this.aspectInternal = options.aspect ?? element.width / element.height;\n\n this.constraint = this.solverWrapper.createConstraint(\n this.buildLHS(),\n new UIExpression(0),\n this.relation,\n this.priority,\n this.isConstraintEnabled(),\n );\n }\n\n /**\n * Gets the current aspect ratio being enforced.\n * @returns The aspect ratio (width/height)\n */\n public get aspect(): number {\n return this.aspectInternal;\n }\n\n /**\n * Sets a new aspect ratio and updates the constraint equation.\n * @param value - The new aspect ratio (width/height)\n */\n public set aspect(value: number) {\n if (this.aspectInternal !== value) {\n this.aspectInternal = value;\n this.solverWrapper.setConstraintLHS(this.constraint, this.buildLHS());\n }\n }\n\n /**\n * Builds the left-hand side expression for the constraint equation.\n *\n * Creates the expression: width - (height * aspect) = 0\n * This enforces the relationship: width = height * aspect\n *\n * @returns The UIExpression representing the constraint equation\n */\n private buildLHS(): UIExpression {\n return new UIExpression(0, [\n [this.element.wVariable, 1],\n [this.element.hVariable, -this.aspectInternal],\n ]);\n }\n}\n","import { UIAspectConstraint } from \"../constraints/UIAspectConstraint\";\nimport { UIHorizontalDistanceConstraint } from \"../constraints/UIHorizontalDistanceConstraint\";\nimport { UIHorizontalProportionConstraint } from \"../constraints/UIHorizontalProportionConstraint\";\nimport { UIVerticalDistanceConstraint } from \"../constraints/UIVerticalDistanceConstraint\";\nimport { UIVerticalProportionConstraint } from \"../constraints/UIVerticalProportionConstraint\";\nimport type { UILayerElement, UIPlaneElement } from \"../miscellaneous/asserts\";\nimport { type UIOrientation } from \"../miscellaneous/UIOrientation\";\nimport { UIPriority } from \"../miscellaneous/UIPriority\";\nimport { UIRelation } from \"../miscellaneous/UIRelation\";\n\nconst DEFAULT_ANCHOR = 0.5;\n\n/**\n * Configuration options for the UICoverConstraintBuilder.\n */\nexport interface UICoverConstraintBuilderOptions {\n /** Whether to maintain the aspect ratio of the active (content) element */\n keepActiveAspect: boolean;\n /** Horizontal anchor point (0.0 = left, 0.5 = center, 1.0 = right) */\n anchorH: number;\n /** Vertical anchor point (0.0 = top, 0.5 = center, 1.0 = bottom) */\n anchorV: number;\n /** Orientation context for constraint calculations */\n orientation: UIOrientation;\n}\n\n/**\n * Builder for creating \"cover\" layout constraints that make an element cover its container.\n *\n * Cover layout ensures the active element is large enough to completely cover the passive\n * element while maintaining proportions. This is similar to CSS `background-size: cover`\n * or `object-fit: cover` behavior.\n *\n * The active element will be:\n * - Positioned at the specified anchor point within the passive element\n * - Sized to be at least as large as the passive element in both dimensions\n * - Scaled proportionally to maintain aspect ratio (if enabled)\n *\n * The constraints ensure: passive.dimension * 1 ≤ active.dimension (active covers passive)\n */\nexport class UICoverConstraintBuilder {\n /**\n * Creates a set of constraints for cover layout behavior.\n *\n * @param passive - The container element (what gets covered)\n * @param active - The content element (what does the covering)\n * @param options - Configuration options for the cover layout\n * @returns Object containing all created constraints\n */\n public static build(\n passive: UIPlaneElement,\n active: UIPlaneElement & UILayerElement,\n options: Partial<UICoverConstraintBuilderOptions> = {},\n ): {\n /** Aspect constraint for the active element (if keepActiveAspect is true) */\n activeAspectConstraint?: UIAspectConstraint;\n /** Horizontal positioning constraint */\n xConstraint: UIHorizontalDistanceConstraint;\n /** Vertical positioning constraint */\n yConstraint: UIVerticalDistanceConstraint;\n /** Width proportion constraint (ensures coverage) */\n widthConstraint: UIHorizontalProportionConstraint;\n /** Height proportion constraint (ensures coverage) */\n heightConstraint: UIVerticalProportionConstraint;\n } {\n let activeAspectConstraint: UIAspectConstraint | undefined;\n if (options.keepActiveAspect === true) {\n activeAspectConstraint = new UIAspectConstraint(active, {\n orientation: options.orientation,\n });\n }\n\n const xConstraint = new UIHorizontalDistanceConstraint(passive, active, {\n anchorA: options.anchorH ?? DEFAULT_ANCHOR,\n anchorB: options.anchorH ?? DEFAULT_ANCHOR,\n orientation: options.orientation,\n });\n\n const yConstraint = new UIVerticalDistanceConstraint(passive, active, {\n anchorA: options.anchorV ?? DEFAULT_ANCHOR,\n anchorB: options.anchorV ?? DEFAULT_ANCHOR,\n orientation: options.orientation,\n });\n\n const widthConstraint = new UIHorizontalProportionConstraint(\n passive,\n active,\n {\n proportion: 1,\n relation: UIRelation.GREATER_THAN,\n orientation: options.orientation,\n },\n );\n\n const heightConstraint = new UIVerticalProportionConstraint(\n passive,\n active,\n {\n proportion: 1,\n priority: UIPriority.P1,\n orientation: options.orientation,\n },\n );\n\n return {\n activeAspectConstraint,\n xConstraint,\n yConstraint,\n widthConstraint,\n heightConstraint,\n };\n }\n}\n","import { UIAspectConstraint } from \"../constraints/UIAspectConstraint\";\nimport { UIHorizontalDistanceConstraint } from \"../constraints/UIHorizontalDistanceConstraint\";\nimport { UIHorizontalProportionConstraint } from \"../constraints/UIHorizontalProportionConstraint\";\nimport { UIVerticalDistanceConstraint } from \"../constraints/UIVerticalDistanceConstraint\";\nimport { UIVerticalProportionConstraint } from \"../constraints/UIVerticalProportionConstraint\";\nimport type { UILayerElement, UIPlaneElement } from \"../miscellaneous/asserts\";\nimport { type UIOrientation } from \"../miscellaneous/UIOrientation\";\nimport { UIPriority } from \"../miscellaneous/UIPriority\";\nimport { UIRelation } from \"../miscellaneous/UIRelation\";\n\nconst DEFAULT_ANCHOR = 0.5;\n\n/**\n * Configuration options for the UIFitConstraintBuilder.\n */\nexport interface UIFitConstraintBuilderOptions {\n /** Whether to maintain the aspect ratio of the active (content) element */\n keepActiveAspect: boolean;\n /** Horizontal anchor point (0.0 = left, 0.5 = center, 1.0 = right) */\n anchorH: number;\n /** Vertical anchor point (0.0 = top, 0.5 = center, 1.0 = bottom) */\n anchorV: number;\n /** Orientation context for constraint calculations */\n orientation: UIOrientation;\n}\n\n/**\n * Builder for creating \"fit\" layout constraints that make an element fit within its container.\n *\n * Fit layout ensures the active element is sized to completely fit within the passive\n * element while maintaining proportions. This is similar to CSS `background-size: contain`\n * or `object-fit: contain` behavior.\n *\n * The active element will be:\n * - Positioned at the specified anchor point within the passive element\n * - Sized to fit entirely within the passive element in both dimensions\n * - Scaled proportionally to maintain aspect ratio (if enabled)\n *\n * The constraints ensure: passive.dimension * 1 ≥ active.dimension (active fits within passive)\n */\nexport class UIFitConstraintBuilder {\n /**\n * Creates a set of constraints for fit layout behavior.\n *\n * @param passive - The container element (what contains the content)\n * @param active - The content element (what gets fitted within the container)\n * @param options - Configuration options for the fit layout\n * @returns Object containing all created constraints\n */\n public static build(\n passive: UIPlaneElement,\n active: UIPlaneElement & UILayerElement,\n options: Partial<UIFitConstraintBuilderOptions> = {},\n ): {\n /** Aspect constraint for the active element (if keepActiveAspect is true) */\n activeAspectConstraint?: UIAspectConstraint;\n /** Horizontal positioning constraint */\n xConstraint: UIHorizontalDistanceConstraint;\n /** Vertical positioning constraint */\n yConstraint: UIVerticalDistanceConstraint;\n /** Width proportion constraint (ensures fitting) */\n widthConstraint: UIHorizontalProportionConstraint;\n /** Height proportion constraint (ensures fitting) */\n heightConstraint: UIVerticalProportionConstraint;\n } {\n let activeAspectConstraint: UIAspectConstraint | undefined;\n if (options.keepActiveAspect === true) {\n activeAspectConstraint = new UIAspectConstraint(active, {\n orientation: options.orientation,\n });\n }\n\n const xConstraint = new UIHorizontalDistanceConstraint(passive, active, {\n anchorA: options.anchorH ?? DEFAULT_ANCHOR,\n anchorB: options.anchorH ?? DEFAULT_ANCHOR,\n orientation: options.orientation,\n });\n\n const yConstraint = new UIVerticalDistanceConstraint(passive, active, {\n anchorA: options.anchorV ?? DEFAULT_ANCHOR,\n anchorB: options.anchorV ?? DEFAULT_ANCHOR,\n orientation: options.orientation,\n });\n\n const widthConstraint = new UIHorizontalProportionConstraint(\n passive,\n active,\n {\n proportion: 1,\n relation: UIRelation.LESS_THAN,\n orientation: options.orientation,\n },\n );\n\n const heightConstraint = new UIVerticalProportionConstraint(\n passive,\n active,\n {\n proportion: 1,\n priority: UIPriority.P1,\n orientation: options.orientation,\n },\n );\n\n return {\n activeAspectConstraint,\n xConstraint,\n yConstraint,\n widthConstraint,\n heightConstraint,\n };\n }\n}\n","import type { UILayer } from \"../layers/UILayer\";\nimport type { UIExpression } from \"../miscellaneous/UIExpression\";\nimport type { UISingleParameterConstraintOptions } from \"./UISingleParameterConstraint\";\nimport { UISingleParameterConstraint } from \"./UISingleParameterConstraint\";\n\n/**\n * Constraint that allows custom mathematical relationships between UI elements.\n *\n * UICustomConstraint provides maximum flexibility by allowing direct specification\n * of the left-hand side (LHS) and right-hand side (RHS) expressions for constraint\n * equations. This enables creation of complex mathematical relationships that may\n * not be covered by the specialized constraint types. The constraint equation is:\n * LHS relation RHS (e.g., LHS = RHS, LHS ≤ RHS, or LHS ≥ RHS)\n *\n * This is useful for implementing custom layout logic, complex mathematical\n * relationships between multiple elements, or prototype new constraint types.\n *\n * @see {@link UISingleParameterConstraint} - Base class for single-parameter constraints\n * @see {@link UIExpression} - Mathematical expressions for constraint equations\n * @see {@link UILayer} - Container layer for constraints\n */\nexport class UICustomConstraint extends UISingleParameterConstraint {\n /** The constraint descriptor managed by the solver system. */\n protected override readonly constraint: number;\n /** Internal storage for the left-hand side expression. */\n private lhsInternal: UIExpression;\n /** Internal storage for the right-hand side expression. */\n private rhsInternal: UIExpression;\n\n /**\n * Creates a new UICustomConstraint instance with custom expressions.\n *\n * The constraint will enforce the relationship: LHS relation RHS, where\n * the relation is determined by the options (defaults to equality).\n *\n * @param layer - The UI layer that contains this constraint\n * @param lhs - The left-hand side expression of the constraint equation\n * @param rhs - The right-hand side expression of the constraint equation\n * @param options - Configuration options for the constraint\n */\n constructor(\n layer: UILayer,\n lhs: UIExpression,\n rhs: UIExpression,\n options: Partial<UISingleParameterConstraintOptions> = {},\n ) {\n super(layer, options.priority, options.relation, options.orientation);\n\n this.lhsInternal = lhs;\n this.rhsInternal = rhs;\n\n this.constraint = this.solverWrapper.createConstraint(\n this.lhsInternal,\n this.rhsInternal,\n this.relation,\n this.priority,\n this.isConstraintEnabled(),\n );\n }\n\n /**\n * Gets the current left-hand side expression.\n * @returns The LHS expression of the constraint equation\n */\n public get lhs(): UIExpression {\n return this.lhsInternal;\n }\n\n /**\n * Gets the current right-hand side expression.\n * @returns The RHS expression of the constraint equation\n */\n public get rhs(): UIExpression {\n return this.rhsInternal;\n }\n\n /**\n * Sets a new left-hand side expression and updates the constraint.\n * @param value - The new LHS expression for the constraint equation\n */\n public setLHS(value: UIExpression): void {\n this.lhsInternal = value;\n this.solverWrapper.setConstraintLHS(this.constraint, this.lhsInternal);\n }\n\n /**\n * Sets a new right-hand side expression and updates the constraint.\n * @param value - The new RHS expression for the constraint equation\n */\n public setRHS(value: UIExpression): void {\n this.rhsInternal = value;\n this.solverWrapper.setConstraintRHS(this.constraint, this.rhsInternal);\n }\n}\n","import { Eventail } from \"eventail\";\nimport type { UILayer } from \"../layers/UILayer\";\nimport type { UIPointElement } from \"../miscellaneous/asserts\";\nimport { assertValidNumber } from \"../miscellaneous/asserts\";\nimport { UIPriority } from \"../miscellaneous/UIPriority\";\nimport type { UISolverWrapper } from \"../wrappers/UISolverWrapper\";\n\n/**\n * Base class representing a minimal UI element as a point in 2D space.\n *\n * A UIAnchor serves as the fundamental building block for UI layout systems,\n * representing a single point with x and y coordinates. It provides constraint-based\n * positioning through solver variables and serves as an anchor point for more\n * complex UI elements.\n *\n * @see {@link UIPointElement} - Interface defining point element behavior\n * @see {@link UILayer} - Container layer for UI elements\n * @see {@link UISolverWrapper} - Constraint solver integration\n */\nexport class UIAnchor extends Eventail implements UIPointElement {\n /** Optional name identifier for the anchor. */\n public name = \"\";\n\n /**\n * Solver variable descriptor for the x-coordinate.\n * This variable is managed by the constraint solver system.\n */\n public readonly xVariable: number;\n\n /**\n * Solver variable descriptor for the y-coordinate.\n * This variable is managed by the constraint solver system.\n */\n public readonly yVariable: number;\n\n /**\n * Reference to the constraint solver wrapper for variable management.\n * @see {@link UISolverWrapper}\n */\n protected readonly solverWrapper: UISolverWrapper;\n\n /**\n * Creates a new UIAnchor instance.\n *\n * @param layer - The UI layer that contains this anchor\n * @param x - Initial x-coordinate position\n * @param y - Initial y-coordinate position\n * @throws Will throw an error if x or y are not valid numbers\n * @see {@link assertValidNumber}\n */\n constructor(\n public readonly layer: UILayer,\n x: number,\n y: number,\n ) {\n assertValidNumber(x, \"UIAnchor x\");\n assertValidNumber(y, \"UIAnchor y\");\n\n super();\n this.solverWrapper = this.layer[\"getSolverWrapperInternal\"]();\n this.xVariable = this.solverWrapper.createVariable(x, UIPriority.P7);\n this.yVariable = this.solverWrapper.createVariable(y, UIPriority.P7);\n }\n\n /**\n * Gets the current x-coordinate value from the solver.\n * @returns The current x-coordinate position\n */\n public get x(): number {\n return this.solverWrapper.readVariableValue(this.xVariable);\n }\n\n /**\n * Gets the current y-coordinate value from the solver.\n * @returns The current y-coordinate position\n */\n public get y(): number {\n return this.solverWrapper.readVariableValue(this.yVariable);\n }\n\n /**\n * Sets the x-coordinate value through the solver system.\n * @param value - The new x-coordinate value\n * @throws Will throw an error if value is not a valid number\n * @see {@link assertValidNumber}\n */\n public set x(value: number) {\n assertValidNumber(value, \"UIAnchor x\");\n this.solverWrapper.suggestVariableValue(this.xVariable, value);\n }\n\n /**\n * Sets the y-coordinate value through the solver system.\n * @param value - The new y-coordinate value\n * @throws Will throw an error if value is not a valid number\n * @see {@link assertValidNumber}\n */\n public set y(value: number) {\n assertValidNumber(value, \"UIAnchor y\");\n this.solverWrapper.suggestVariableValue(this.yVariable, value);\n }\n\n /**\n * Destroys the anchor by removing its solver variables.\n *\n * This method cleans up the solver variables associated with this anchor,\n * effectively removing it from the constraint solving system. After calling\n * this method, the anchor should not be used anymore.\n */\n public destroy(): void {\n this.solverWrapper.removeVariable(this.yVariable);\n this.solverWrapper.removeVariable(this.xVariable);\n }\n}\n","/**\n * Events that can be emitted by UI elements.\n */\nexport enum UIInputEvent {\n DOWN = \"pointerdown\",\n MOVE = \"pointermove\",\n UP = \"pointerup\",\n ENTER = \"pointerenter\",\n LEAVE = \"pointerleave\",\n}\n","/**\n * Defines the anchor mode for UIMicro, determining which transformations are applied around the anchor point.\n */\nexport enum UIMicroAnchorMode {\n /** Rotation and scaling are applied around the anchor point */\n ROTATION_SCALE = 0,\n /** Position, rotation, and scaling transformations are all applied around the anchor point */\n POSITION_ROTATION_SCALE = 1,\n}\n","import { Eventail } from \"eventail\";\nimport { MathUtils } from \"three\";\nimport { UIMicroAnchorMode } from \"./UIMicroAnchorMode\";\n\nexport enum UIMicroEvent {\n CHANGE = 0,\n}\n\n/** Default position value for x and y coordinates. */\nconst DEFAULT_POSITION = 0;\n/** Default anchor point value for anchorX and anchorY. */\nconst DEFAULT_ANCHOR = 0.5;\n/** Default scale value for scaleX and scaleY. */\nconst DEFAULT_SCALE = 1;\n/** Default rotation value in radians. */\nconst DEFAULT_ROTATION = 0;\n\n/**\n * Micro-transformation system for non-constraint based UI element adjustments.\n *\n * UIMicro provides a lightweight transformation system that operates independently\n * of the constraint solver. It manages position offsets, anchor points, scaling,\n * and rotation transformations that can be applied to UI elements for animations,\n * visual effects, or fine-tuned positioning without affecting the constraint-based\n * layout system.\n *\n * All transformations are tracked with change detection to optimize rendering\n * performance by only recalculating when properties have actually changed.\n *\n * @see {@link UIElement} - Elements that use micro transformations\n */\nexport class UIMicro extends Eventail {\n /** Internal storage for x-coordinate offset. */\n private xInternal: number = DEFAULT_POSITION;\n /** Internal storage for y-coordinate offset. */\n private yInternal: number = DEFAULT_POSITION;\n /** Internal storage for x-axis anchor point. */\n private anchorXInternal: number = DEFAULT_ANCHOR;\n /** Internal storage for y-axis anchor point. */\n private anchorYInternal: number = DEFAULT_ANCHOR;\n /** Internal storage for x-axis scale factor. */\n private scaleXInternal: number = DEFAULT_SCALE;\n /** Internal storage for y-axis scale factor. */\n private scaleYInternal: number = DEFAULT_SCALE;\n /** Internal storage for rotation in radians. */\n private rotationInternal: number = DEFAULT_ROTATION;\n /** Internal storage for anchor mode determining which transformations are applied around the anchor point. */\n private anchorModeInternal: UIMicroAnchorMode =\n UIMicroAnchorMode.ROTATION_SCALE;\n /** Flag indicating if any transformation properties have changed. */\n private recalculationRequired = false;\n\n /**\n * Gets the x-coordinate offset for micro positioning.\n * @returns The x-offset value\n */\n public get x(): number {\n return this.xInternal;\n }\n\n /**\n * Gets the y-coordinate offset for micro positioning.\n * @returns The y-offset value\n */\n public get y(): number {\n return this.yInternal;\n }\n\n /**\n * Gets the x-axis anchor point for transformations.\n * @returns The anchor point (0.0 = left, 0.5 = center, 1.0 = right)\n */\n public get anchorX(): number {\n return this.anchorXInternal;\n }\n\n /**\n * Gets the y-axis anchor point for transformations.\n * @returns The anchor point (0.0 = top, 0.5 = center, 1.0 = bottom)\n */\n public get anchorY(): number {\n return this.anchorYInternal;\n }\n\n /**\n * Gets the x-axis scale factor.\n * @returns The scale factor (1.0 = normal size)\n */\n public get scaleX(): number {\n return this.scaleXInternal;\n }\n\n /**\n * Gets the y-axis scale factor.\n * @returns The scale factor (1.0 = normal size)\n */\n public get scaleY(): number {\n return this.scaleYInternal;\n }\n\n /**\n * Gets the uniform scale factor (maximum of scaleX and scaleY).\n * @returns The larger of the two scale factors\n */\n public get size(): number {\n return Math.max(this.scaleXInternal, this.scaleYInternal);\n }\n\n /**\n * Gets the rotation angle in degrees.\n * @returns The rotation angle in degrees\n */\n public get angle(): number {\n return MathUtils.radToDeg(this.rotationInternal);\n }\n\n /**\n * Gets the current anchor mode determining which transformations are applied around the anchor point.\n * @returns The anchor mode (ROTATION_SCALE or POSITION_ROTATION_SCALE)\n */\n public get anchorMode(): UIMicroAnchorMode {\n return this.anchorModeInternal;\n }\n\n /**\n * Gets the rotation angle in radians.\n * @returns The rotation angle in radians\n */\n public get rotation(): number {\n return this.rotationInternal;\n }\n\n /**\n * Sets the x-coordinate offset for micro positioning.\n * @param value - The new x-offset value\n */\n public set x(value: number) {\n if (value !== this.xInternal) {\n this.xInternal = value;\n this.recalculationRequired = true;\n this.emit(UIMicroEvent.CHANGE, this);\n }\n }\n\n /**\n * Sets the y-coordinate offset for micro positioning.\n * @param value - The new y-offset value\n */\n public set y(value: number) {\n if (value !== this.yInternal) {\n this.yInternal = value;\n this.recalculationRequired = true;\n this.emit(UIMicroEvent.CHANGE, this);\n }\n }\n\n /**\n * Sets the x-axis anchor point for transformations.\n * @param value - The anchor point (0.0 = left, 0.5 = center, 1.0 = right)\n */\n public set anchorX(value: number) {\n if (value !== this.anchorXInternal) {\n this.anchorXInternal = value;\n this.recalculationRequired = true;\n this.emit(UIMicroEvent.CHANGE, this);\n }\n }\n\n /**\n * Sets the y-axis anchor point for transformations.\n * @param value - The anchor point (0.0 = top, 0.5 = center, 1.0 = bottom)\n */\n public set anchorY(value: number) {\n if (value !== this.anchorYInternal) {\n this.anchorYInternal = value;\n this.recalculationRequired = true;\n this.emit(UIMicroEvent.CHANGE, this);\n }\n }\n\n /**\n * Sets the x-axis scale factor.\n * @param value - The scale factor (1.0 = normal size)\n */\n public set scaleX(value: number) {\n if (value !== this.scaleXInternal) {\n this.scaleXInternal = value;\n this.recalculationRequired = true;\n this.emit(UIMicroEvent.CHANGE, this);\n }\n }\n\n /**\n * Sets the y-axis scale factor.\n * @param value - The scale factor (1.0 = normal size)\n */\n public set scaleY(value: number) {\n if (value !== this.scaleYInternal) {\n this.scaleYInternal = value;\n this.recalculationRequired = true;\n this.emit(UIMicroEvent.CHANGE, this);\n }\n }\n\n /**\n * Sets both scale factors to the same value for uniform scaling.\n * @param value - The uniform scale factor (1.0 = normal size)\n */\n public set size(value: number) {\n if (value !== this.scaleXInternal || value !== this.scaleYInternal) {\n this.scaleXInternal = value;\n this.scaleYInternal = value;\n this.recalculationRequired = true;\n this.emit(UIMicroEvent.CHANGE, this);\n }\n }\n\n /**\n * Sets the rotation angle in degrees.\n * @param value - The rotation angle in degrees\n */\n public set angle(value: number) {\n const rotation = MathUtils.degToRad(value);\n if (rotation !== this.rotationInternal) {\n this.rotationInternal = rotation;\n this.recalculationRequired = true;\n this.emit(UIMicroEvent.CHANGE, this);\n }\n }\n\n /**\n * Sets the rotation angle in radians.\n * @param value - The rotation angle in radians\n */\n public set rotation(value: number) {\n if (value !== this.rotationInternal) {\n this.rotationInternal = value;\n this.recalculationRequired = true;\n this.emit(UIMicroEvent.CHANGE, this);\n }\n }\n\n /**\n * Sets the anchor mode determining which transformations are applied around the anchor point.\n * @param value - The anchor mode (ROTATION_SCALE or POSITION_ROTATION_SCALE)\n */\n public set anchorMode(value: UIMicroAnchorMode) {\n if (value !== this.anchorModeInternal) {\n this.anchorModeInternal = value;\n this.recalculationRequired = true;\n this.emit(UIMicroEvent.CHANGE, this);\n }\n }\n\n /**\n * Resets all transformation properties to their default values.\n *\n * This method restores position (0,0), anchor (0,0), scale (1,1),\n * and rotation (0) to their initial states. Only triggers recalculation\n * if any values actually change.\n */\n public reset(): void {\n if (\n this.xInternal !== DEFAULT_POSITION ||\n this.yInternal !== DEFAULT_POSITION ||\n this.anchorXInternal !== DEFAULT_ANCHOR ||\n this.anchorYInternal !== DEFAULT_ANCHOR ||\n this.scaleXInternal !== DEFAULT_SCALE ||\n this.scaleYInternal !== DEFAULT_SCALE ||\n this.rotationInternal !== DEFAULT_ROTATION\n ) {\n this.xInternal = DEFAULT_POSITION;\n this.yInternal = DEFAULT_POSITION;\n this.anchorXInternal = DEFAULT_ANCHOR;\n this.anchorYInternal = DEFAULT_ANCHOR;\n this.scaleXInternal = DEFAULT_SCALE;\n this.scaleYInternal = DEFAULT_SCALE;\n this.rotationInternal = DEFAULT_ROTATION;\n this.recalculationRequired = true;\n this.emit(UIMicroEvent.CHANGE, this);\n }\n }\n\n public copy(value: UIMicro): void {\n if (\n this.xInternal !== value.xInternal &&\n this.yInternal !== value.yInternal &&\n this.anchorXInternal !== value.anchorXInternal &&\n this.anchorYInternal !== value.anchorYInternal &&\n this.scaleXInternal !== value.scaleXInternal &&\n this.scaleYInternal !== value.scaleYInternal &&\n this.rotationInternal !== value.rotationInternal &&\n this.anchorModeInternal !== value.anchorModeInternal\n ) {\n this.xInternal = value.xInternal;\n this.yInternal = value.yInternal;\n this.anchorXInternal = value.anchorXInternal;\n this.anchorYInternal = value.anchorYInternal;\n this.scaleXInternal = value.scaleXInternal;\n this.scaleYInternal = value.scaleYInternal;\n this.rotationInternal = value.rotationInternal;\n this.anchorModeInternal = value.anchorModeInternal;\n\n this.emit(UIMicroEvent.CHANGE, this);\n this.recalculationRequired = true;\n }\n }\n\n /**\n * Gets whether any transformation properties have changed since last reset.\n *\n * This method is used internally by the rendering system to determine\n * if transformation matrices need to be recalculated.\n *\n * @returns True if recalculation is required, false otherwise\n * @internal\n */\n protected [\"getRecalculationRequiredInternal\"](): boolean {\n return this.recalculationRequired;\n }\n\n /**\n * Resets the recalculation flag after transformations have been applied.\n *\n * This method is called internally by the rendering system after\n * transformation matrices have been updated.\n *\n * @internal\n */\n protected [\"resetRecalculationRequiredInternal\"](): void {\n this.recalculationRequired = false;\n }\n}\n","import type { WebGLRenderer } from \"three\";\nimport { Matrix4, Quaternion, Vector3 } from \"three\";\nimport type { UILayerInputListener } from \"../layers/UILayer\";\nimport { UILayerEvent, type UILayer } from \"../layers/UILayer\";\nimport type { UILayerElement, UIPlaneElement } from \"../miscellaneous/asserts\";\nimport {\n assertValidNumber,\n assertValidPositiveNumber,\n} from \"../miscellaneous/asserts\";\nimport { UIInputEvent } from \"../miscellaneous/UIInputEvent\";\nimport { UIMicro } from \"../miscellaneous/UIMicro\";\nimport { UIMicroAnchorMode } from \"../miscellaneous/UIMicroAnchorMode\";\nimport { UIMode } from \"../miscellaneous/UIMode\";\nimport { UIPriority } from \"../miscellaneous/UIPriority\";\nimport type { UISceneWrapperClientAPI } from \"../miscellaneous/UISceneWrapperClientAPI\";\nimport { UITransparencyMode } from \"../miscellaneous/UITransparencyMode\";\nimport { UIAnchor } from \"./UIAnchor\";\n\nconst position = new Vector3();\nconst quaternion = new Quaternion();\nconst scale = new Vector3();\nconst matrix = new Matrix4();\nconst axis = new Vector3(0, 0, 1);\n\n/**\n * Abstract base class for all renderable UI elements with dimensions.\n *\n * UIElement serves as the fundamental building block for all other UI elements\n * that need to be visually rendered. It extends UIAnchor with dimensional properties\n * and integrates with the Three.js rendering system through shader-based planes. This class\n * provides essential functionality for positioning, sizing, rendering, visibility,\n * z-index management, and user interaction.\n *\n * @see {@link UIAnchor} - Base class providing position functionality\n * @see {@link UIPlaneElement} - Interface defining dimensional element behavior\n * @see {@link UIMicro} - Micro-optimization utilities\n */\nexport abstract class UIElement\n extends UIAnchor\n implements UIPlaneElement, UILayerElement\n{\n /** Micro-transformation system for non-constraint based positioning, scaling, and rotation adjustments. */\n public readonly micro = new UIMicro();\n\n /**\n * Solver variable descriptor for the width dimension.\n * This variable is managed by the constraint solver system.\n */\n public readonly wVariable: number;\n\n /**\n * Solver variable descriptor for the height dimension.\n * This variable is managed by the constraint solver system.\n */\n public readonly hVariable: number;\n\n /** Internal storage for the current visibility/interaction mode. */\n protected modeInternal: UIMode = UIMode.VISIBLE;\n\n /** Internal storage for the transparency rendering mode. */\n protected transparencyInternal: UITransparencyMode = UITransparencyMode.BLEND;\n\n /** Internal storage for the z-index (depth) value. */\n protected zIndexInternal = 0;\n\n /** Optional input listener for handling user interactions when in interactive mode. */\n protected listener?: UILayerInputListener;\n\n protected isPointerInside = false;\n\n /** Client API for interacting with the scene wrapper (rendering system). */\n protected readonly sceneWrapper: UISceneWrapperClientAPI;\n /** Handle to the plane object in the rendering system. */\n protected readonly planeHandler: number;\n\n /**\n * Creates a new UIElement instance with rendering capabilities.\n *\n * @param layer - The UI layer that contains this element\n * @param x - Initial x-coordinate position\n * @param y - Initial y-coordinate position\n * @param width - Initial width dimension (must be positive)\n * @param height - Initial height dimension (must be positive)\n * @param source - GLSL shader source code for rendering this element\n * @param uniforms - Uniform values to pass to the shader\n * @throws Will throw an error if width or height are not valid positive numbers\n * @see {@link assertValidPositiveNumber}\n */\n constructor(\n layer: UILayer,\n x: number,\n y: number,\n width: number,\n height: number,\n source: string,\n uniforms: Record<string, unknown>,\n ) {\n assertValidPositiveNumber(width, \"UIElement width\");\n assertValidPositiveNumber(height, \"UIElement height\");\n\n super(layer, x, y);\n this.layer.on(UILayerEvent.WILL_RENDER, this.onWillRender, this);\n\n this.wVariable = this.solverWrapper.createVariable(width, UIPriority.P6);\n this.hVariable = this.solverWrapper.createVariable(height, UIPriority.P6);\n\n this.sceneWrapper = layer[\"getSceneWrapperClientAPI\"]();\n this.planeHandler = this.sceneWrapper.createPlane(source, uniforms);\n this.sceneWrapper.setTransparency(\n this.planeHandler,\n this.transparencyInternal,\n );\n }\n\n /**\n * Gets the current width value from the solver.\n * @returns The current width dimension\n */\n public get width(): number {\n return this.solverWrapper.readVariableValue(this.wVariable);\n }\n\n /**\n * Gets the current height value from the solver.\n * @returns The current height dimension\n */\n public get height(): number {\n return this.solverWrapper.readVariableValue(this.hVariable);\n }\n\n /**\n * Gets the current z-index (depth) value.\n * @returns The current z-index value\n */\n public get zIndex(): number {\n return this.zIndexInternal;\n }\n\n /**\n * The right edge X coordinate of this element (x + width).\n */\n public get oppositeX(): number {\n return this.x + this.width;\n }\n\n /**\n * The bottom edge Y coordinate of this element (y + height).\n */\n public get oppositeY(): number {\n return this.y + this.height;\n }\n\n /**\n * The X coordinate of the center of this element.\n */\n public get centerX(): number {\n return this.x + this.width / 2;\n }\n\n /**\n * The Y coordinate of the center of this element.\n */\n public get centerY(): number {\n return this.y + this.height / 2;\n }\n\n /**\n * Gets the current visibility and interaction mode.\n * @returns The current UIMode setting\n * @see {@link UIMode}\n */\n public get mode(): UIMode {\n return this.modeInternal;\n }\n\n /**\n * Gets the current transparency rendering mode.\n * @returns The current transparency mode\n * @see {@link UITransparencyMode}\n */\n public get transparency(): UITransparencyMode {\n return this.transparencyInternal;\n }\n\n /**\n * Sets the width value through the solver system.\n * @param value - The new width dimension (must be positive)\n * @throws Will throw an error if value is not a valid positive number\n * @see {@link assertValidPositiveNumber}\n */\n public set width(value: number) {\n assertValidPositiveNumber(value, \"UIElement width\");\n this.solverWrapper.suggestVariableValue(this.wVariable, value);\n }\n\n /**\n * Sets the height value through the solver system.\n * @param value - The new height dimension (must be positive)\n * @throws Will throw an error if value is not a valid positive number\n * @see {@link assertValidPositiveNumber}\n */\n public set height(value: number) {\n assertValidPositiveNumber(value, \"UIElement height\");\n this.solverWrapper.suggestVariableValue(this.hVariable, value);\n }\n\n /**\n * Sets the z-index (depth) value for rendering order and input handling.\n * @param value - The new z-index value\n * @throws Will throw an error if value is not a valid number\n * @see {@link assertValidNumber}\n */\n public set zIndex(value: number) {\n assertValidNumber(value, \"UIElement zIndex\");\n this.zIndexInternal = value;\n if (this.listener) {\n this.listener.zIndex = this.zIndexInternal;\n }\n }\n\n /**\n * The right edge X coordinate of this element (x + width).\n */\n public set oppositeX(value: number) {\n this.x = value - this.width;\n }\n\n /**\n * The bottom edge Y coordinate of this element (y + height).\n */\n public set oppositeY(value: number) {\n this.y = value - this.height;\n }\n\n /**\n * The X coordinate of the center of this element.\n */\n public set centerX(value: number) {\n this.x = value - this.width / 2;\n }\n\n /**\n * The Y coordinate of the center of this element.\n */\n public set centerY(value: number) {\n this.y = value - this.height / 2;\n }\n\n /**\n * Sets the current visibility and interaction mode.\n * @param value - The new UIMode setting\n * @see {@link UIMode}\n */\n public set mode(value: UIMode) {\n if (this.modeInternal !== value) {\n if (value === UIMode.INTERACTIVE) {\n this.listener = {\n catchPointerDown: this.catchPointerDown,\n catchPointerMove: this.catchPointerMove,\n catchPointerUp: this.catchPointerUp,\n zIndex: this.zIndexInternal,\n };\n this.layer[\"subscribePointerInput\"](this.listener);\n } else if (this.modeInternal === UIMode.INTERACTIVE && this.listener) {\n this.layer[\"unsubscribePointerInput\"](this.listener);\n this.listener = undefined;\n }\n\n this.modeInternal = value;\n this.sceneWrapper.setVisibility(\n this.planeHandler,\n value !== UIMode.HIDDEN,\n );\n }\n }\n\n /**\n * Sets the transparency rendering mode.\n * @param value - The new transparency mode\n * @see {@link UITransparencyMode}\n */\n public set transparency(value: UITransparencyMode) {\n this.transparencyInternal = value;\n this.sceneWrapper.setTransparency(this.planeHandler, value);\n }\n\n /**\n * Destroys the UI element by cleaning up all associated resources.\n *\n * This method removes the element from the rendering scene, cleans up\n * dimension solver variables, removes input listeners, and calls the parent\n * destroy method to clean up position variables. After calling this method,\n * the element should not be used anymore.\n */\n public override destroy(): void {\n this.layer.off(UILayerEvent.WILL_RENDER, this.onWillRender, this);\n if (this.listener) {\n this.layer[\"unsubscribePointerInput\"](this.listener);\n }\n this.solverWrapper.removeVariable(this.hVariable);\n this.solverWrapper.removeVariable(this.wVariable);\n this.sceneWrapper.destroyPlane(this.planeHandler);\n super.destroy();\n }\n\n protected readonly catchPointerDown = (\n x: number,\n y: number,\n identifier: number,\n ): boolean => {\n return this.handleInputEvent(x, y, identifier, UIInputEvent.DOWN);\n };\n\n protected readonly catchPointerMove = (\n x: number,\n y: number,\n identifier: number,\n ): boolean => {\n return this.handleInputEvent(x, y, identifier, UIInputEvent.MOVE);\n };\n\n protected readonly catchPointerUp = (\n x: number,\n y: number,\n identifier: number,\n ): boolean => {\n return this.handleInputEvent(x, y, identifier, UIInputEvent.UP);\n };\n\n protected handleInputEvent(\n x: number,\n y: number,\n identifier: number,\n inputEvent: UIInputEvent,\n ): boolean {\n const isPointerInside =\n x > this.x && x < this.oppositeX && y > this.y && y < this.oppositeY;\n\n if (isPointerInside) {\n this.emit(inputEvent, x, y, identifier, this);\n }\n\n if (this.isPointerInside && !isPointerInside) {\n this.emit(UIInputEvent.LEAVE, x, y, identifier, this);\n } else if (!this.isPointerInside && isPointerInside) {\n this.emit(UIInputEvent.ENTER, x, y, identifier, this);\n }\n\n this.isPointerInside = isPointerInside;\n return isPointerInside;\n }\n\n /**\n * Called before each render frame to update the element's transform matrix.\n * Applies micro-transformations (position, rotation, scale, anchor) and updates\n * the rendering system with the final transformation matrix.\n * @param renderer - The WebGL renderer (unused in base implementation)\n * @param deltaTime - Time since last frame in seconds (unused in base implementation)\n */\n protected onWillRender(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars -- Required by UILayer event interface but not used in base implementation\n renderer: WebGLRenderer,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars -- Required by UILayer event interface but not used in base implementation\n deltaTime: number,\n ): void {\n const micro = this.micro;\n\n const width = this.width * micro.scaleX;\n const height = this.height * micro.scaleY;\n\n const anchorOffsetX = micro.anchorX * width;\n const anchorOffsetY = micro.anchorY * height;\n\n const cos = Math.cos(micro.rotation);\n const sin = Math.sin(micro.rotation);\n\n const rotatedAnchorX = anchorOffsetX * cos - anchorOffsetY * sin;\n const rotatedAnchorY = anchorOffsetX * sin + anchorOffsetY * cos;\n\n if (micro.anchorMode === UIMicroAnchorMode.POSITION_ROTATION_SCALE) {\n position.x = this.x + micro.x - rotatedAnchorX;\n position.y = this.y + micro.y - rotatedAnchorY;\n } else {\n const rawAnchorOffsetX = micro.anchorX * this.width;\n const rawAnchorOffsetY = micro.anchorY * this.height;\n position.x = this.x + rawAnchorOffsetX - rotatedAnchorX + micro.x;\n position.y = this.y + rawAnchorOffsetY - rotatedAnchorY + micro.y;\n }\n\n position.z = this.zIndexInternal;\n scale.x = width;\n scale.y = height;\n quaternion.setFromAxisAngle(axis, micro.rotation);\n\n matrix.compose(position, quaternion, scale);\n this.sceneWrapper.setTransform(this.planeHandler, matrix);\n }\n}\n","import type { Matrix3, Texture } from \"three\";\nimport type { UILayer } from \"../layers/UILayer\";\nimport { UIColor, UIColorEvent } from \"../miscellaneous/UIColor\";\nimport source from \"../shaders/UIDefaultShader.glsl\";\nimport { UIElement } from \"./UIElement\";\n\nexport enum UIAnimatedImageEvent {\n PLAY = 0,\n PAUSE = 1,\n STOP = 2,\n}\n\nexport type UIAnimatedImageSequence =\n | { texture: Texture; transforms: Matrix3[] }\n | Texture[];\n\n/**\n * Configuration options for creating a UIAnimatedImage element.\n */\nexport interface UIAnimatedImageOptions {\n /** X position of the element */\n x: number;\n /** Y position of the element */\n y: number;\n /** Width of the element */\n width: number;\n /** Height of the element */\n height: number;\n /** Color tint applied to the image */\n color: UIColor;\n /** Frame rate for animation */\n frameRate: number;\n /** Whether animation should loop */\n loop: boolean;\n}\n\n/**\n * UI element for displaying textured images.\n *\n * UIAnimatedImage is a concrete implementation of UIElement that renders a textured\n * image using shader-based planes. It automatically sizes itself\n * to match the texture dimensions and provides control over visual properties\n * such as color tinting.\n *\n * @see {@link UIElement} - Base class providing UI element functionality\n * @see {@link Texture} - Three.js texture for image data\n */\nexport class UIAnimatedImage extends UIElement {\n /** Internal storage for the current texture */\n private readonly sequenceInternal: {\n texture: Texture;\n uvTransform: Matrix3;\n }[];\n\n /** Internal storage for the color tint */\n private readonly colorInternal: UIColor;\n private frameRateInternal: number;\n private loopInternal: boolean;\n\n private intervalHandler?: ReturnType<typeof setInterval> = undefined;\n private currentFrameIndex = 0;\n\n /**\n * Creates a new UIAnimatedImage instance.\n *\n * The image will automatically size itself to match the texture's dimensions.\n * All options have default values if not specified.\n *\n * @param layer - The UI layer that contains this image\n * @param texture - The Three.js texture to display\n * @param options - Configuration options for the image\n * @throws Will throw an error if the texture dimensions are not valid positive numbers\n */\n constructor(\n layer: UILayer,\n sequence: UIAnimatedImageSequence,\n options: Partial<UIAnimatedImageOptions> = {},\n ) {\n const w = options.width ?? 100;\n const h = options.height ?? 100;\n const color = options.color ?? new UIColor();\n\n let tempSequence: {\n texture: Texture;\n uvTransform: Matrix3;\n }[];\n\n if (Array.isArray(sequence)) {\n tempSequence = sequence.map((texture) => {\n texture.updateMatrix();\n return {\n texture,\n uvTransform: texture.matrix,\n };\n });\n } else {\n tempSequence = sequence.transforms.map((transform) => {\n return {\n texture: sequence.texture,\n uvTransform: transform,\n };\n });\n }\n\n super(layer, options.x ?? 0, options.y ?? 0, w, h, source, {\n map: tempSequence[0].texture,\n uvTransform: tempSequence[0].uvTransform,\n color,\n });\n\n this.sequenceInternal = tempSequence;\n this.colorInternal = color;\n const defaultFrameRate = 24;\n this.frameRateInternal = options.frameRate ?? defaultFrameRate;\n this.loopInternal = options.loop ?? true;\n this.colorInternal.on(UIColorEvent.CHANGE, this.onColorChange);\n }\n\n /**\n * Gets the current color tint applied to the image.\n * @returns The UIColor instance\n */\n public get color(): UIColor {\n return this.colorInternal;\n }\n\n /**\n * Gets the frame rate for animation.\n * @returns The frame rate in frames per second\n */\n public get frameRate(): number {\n return this.frameRateInternal;\n }\n\n /**\n * Gets whether the animation loops.\n * @returns True if animation loops\n */\n public get loop(): boolean {\n return this.loopInternal;\n }\n\n /**\n * Gets the total duration of the animation in seconds.\n * @returns The duration in seconds\n */\n public get duration(): number {\n return this.sequenceInternal.length / this.frameRateInternal;\n }\n\n /**\n * Sets the color tint applied to the image.\n * @param value - The UIColor instance\n */\n public set color(value: UIColor) {\n this.colorInternal.copy(value);\n }\n\n /**\n * Sets the frame rate for animation.\n * @param value - The frame rate in frames per second\n */\n public set frameRate(value: number) {\n if (value <= 0) {\n throw new Error(\"Frame rate must be greater than zero\");\n }\n\n const wasPlaying = this.intervalHandler !== undefined;\n if (wasPlaying) {\n this.pause();\n }\n\n this.frameRateInternal = value;\n\n if (wasPlaying) {\n this.play();\n }\n }\n\n /**\n * Sets whether the animation loops.\n * @param value - True to enable looping\n */\n public set loop(value: boolean) {\n this.loopInternal = value;\n }\n\n /**\n * Starts or resumes playback of the animation.\n */\n public play(): void {\n if (this.intervalHandler !== undefined) {\n return;\n }\n\n this.intervalHandler = setInterval(() => {\n this.currentFrameIndex++;\n\n if (this.loopInternal) {\n this.currentFrameIndex %= this.sequenceInternal.length;\n } else if (this.currentFrameIndex >= this.sequenceInternal.length) {\n this.currentFrameIndex = this.sequenceInternal.length - 1;\n this.pause();\n return;\n }\n\n this.updateFrame();\n }, 1000 / this.frameRateInternal);\n this.emit(UIAnimatedImageEvent.PLAY);\n }\n\n /**\n * Pauses the animation at the current frame.\n */\n public pause(): void {\n if (this.intervalHandler === undefined) {\n return;\n }\n\n clearInterval(this.intervalHandler);\n this.intervalHandler = undefined;\n this.emit(UIAnimatedImageEvent.PAUSE);\n }\n\n /**\n * Stops the animation and resets to the first frame.\n */\n public stop(): void {\n if (this.intervalHandler !== undefined) {\n clearInterval(this.intervalHandler);\n this.intervalHandler = undefined;\n }\n\n this.currentFrameIndex = 0;\n this.updateFrame();\n this.emit(UIAnimatedImageEvent.STOP);\n }\n\n /**\n * Destroys the UI image by cleaning up color event listeners and all associated resources.\n */\n public override destroy(): void {\n this.stop();\n this.colorInternal.off(UIColorEvent.CHANGE, this.onColorChange);\n super.destroy();\n }\n\n /** Event handler for when the color changes */\n private readonly onColorChange = (color: UIColor): void => {\n this.sceneWrapper.setUniform(this.planeHandler, \"color\", color);\n };\n\n private updateFrame(): void {\n const frame = this.sequenceInternal[this.currentFrameIndex];\n this.sceneWrapper.setUniform(this.planeHandler, \"map\", frame.texture);\n this.sceneWrapper.setUniform(\n this.planeHandler,\n \"uvTransform\",\n frame.uvTransform,\n );\n }\n}\n","import type { UILayer } from \"../layers/UILayer\";\nimport {\n assertValidPositiveNumber,\n type UIPlaneElement,\n} from \"../miscellaneous/asserts\";\nimport { UIPriority } from \"../miscellaneous/UIPriority\";\nimport { UIAnchor } from \"./UIAnchor\";\n\n/** Default width and height value for UIDummy elements. */\nconst DEFAULT_SIZE = 100;\n\nexport interface UIDummyOptions {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\n/**\n * UI element that extends UIAnchor with dimensions but without rendering.\n *\n * UIDummy represents a rectangular area in the UI layout system that has position\n * and dimensions (width and height) but does not perform any visual rendering.\n * It serves as a placeholder or spacer element in constraint-based layouts,\n * useful for defining layout structure without visual content.\n *\n * @see {@link UIAnchor} - Base class providing position functionality\n * @see {@link UIPlaneElement} - Interface defining dimensional element behavior\n * @see {@link UILayer} - Container layer for UI elements\n */\nexport class UIDummy extends UIAnchor implements UIPlaneElement {\n /**\n * Solver variable descriptor for the width dimension.\n * This variable is managed by the constraint solver system.\n */\n public readonly wVariable: number;\n\n /**\n * Solver variable descriptor for the height dimension.\n * This variable is managed by the constraint solver system.\n */\n public readonly hVariable: number;\n\n /**\n * Creates a new UIDummy instance with position and dimensions.\n *\n * @param layer - The UI layer that contains this dummy element\n * @param x - Initial x-coordinate position\n * @param y - Initial y-coordinate position\n * @param width - Initial width dimension (defaults to 100)\n * @param height - Initial height dimension (defaults to 100)\n * @throws Will throw an error if width or height are not valid positive numbers\n * @see {@link assertValidPositiveNumber}\n */\n constructor(layer: UILayer, options: Partial<UIDummyOptions> = {}) {\n const x = options.x ?? 0;\n const y = options.y ?? 0;\n const w = options.width ?? DEFAULT_SIZE;\n const h = options.height ?? DEFAULT_SIZE;\n\n assertValidPositiveNumber(w, \"UIDummy width\");\n assertValidPositiveNumber(h, \"UIDummy height\");\n\n super(layer, x, y);\n this.wVariable = this.solverWrapper.createVariable(w, UIPriority.P6);\n this.hVariable = this.solverWrapper.createVariable(h, UIPriority.P6);\n }\n\n /**\n * Gets the current width value from the solver.\n * @returns The current width dimension\n */\n public get width(): number {\n return this.solverWrapper.readVariableValue(this.wVariable);\n }\n\n /**\n * Gets the current height value from the solver.\n * @returns The current height dimension\n */\n public get height(): number {\n return this.solverWrapper.readVariableValue(this.hVariable);\n }\n\n /**\n * Sets the width value through the solver system.\n * @param value - The new width dimension (must be positive)\n * @throws Will throw an error if value is not a valid positive number\n * @see {@link assertValidPositiveNumber}\n */\n public set width(value: number) {\n assertValidPositiveNumber(value, \"UIDummy width\");\n this.solverWrapper.suggestVariableValue(this.wVariable, value);\n }\n\n /**\n * Sets the height value through the solver system.\n * @param value - The new height dimension (must be positive)\n * @throws Will throw an error if value is not a valid positive number\n * @see {@link assertValidPositiveNumber}\n */\n public set height(value: number) {\n assertValidPositiveNumber(value, \"UIDummy height\");\n this.solverWrapper.suggestVariableValue(this.hVariable, value);\n }\n\n /**\n * Destroys the dummy element by removing its solver variables.\n *\n * This method cleans up the dimension solver variables (width and height)\n * associated with this dummy element, then calls the parent destroy method\n * to clean up position variables. After calling this method, the dummy\n * element should not be used anymore.\n */\n public override destroy(): void {\n this.solverWrapper.removeVariable(this.hVariable);\n this.solverWrapper.removeVariable(this.wVariable);\n super.destroy();\n }\n}\n","import { CanvasTexture, LinearFilter } from \"three\";\nimport type { UILayer } from \"../layers/UILayer\";\nimport { UIColor, UIColorEvent } from \"../miscellaneous/UIColor\";\nimport type { UIMode } from \"../miscellaneous/UIMode\";\nimport source from \"../shaders/UIDefaultShader.glsl\";\nimport { UIElement } from \"./UIElement\";\n\n/**\n * Configuration options for creating a UIGraphics element.\n */\nexport interface UIGraphicsOptions {\n /** X position of the element */\n x: number;\n /** Y position of the element */\n y: number;\n /** Width of the canvas (default: 512) */\n width: number;\n /** Height of the canvas (default: 512) */\n height: number;\n /** Color tint applied to the graphics */\n color: UIColor;\n /** Default UIMode */\n mode: UIMode;\n}\n\n/**\n * UI element for drawing graphics using 2D canvas API.\n *\n * UIGraphics uses an OffscreenCanvas for rendering 2D graphics and converts it\n * to a Three.js texture for display. It provides access to the canvas context\n * for custom drawing operations.\n */\nexport class UIGraphics extends UIElement {\n /** OffscreenCanvas for rendering graphics */\n private readonly canvas: OffscreenCanvas;\n /** 2D rendering context */\n private readonly ctx: OffscreenCanvasRenderingContext2D;\n /** Three.js texture created from the canvas */\n private readonly canvasTexture: CanvasTexture;\n /** Internal storage for the color tint */\n private readonly colorInternal: UIColor;\n\n /**\n * Creates a new UIGraphics instance.\n *\n * @param layer - The UI layer that contains this graphics element\n * @param options - Configuration options for the graphics element\n */\n constructor(layer: UILayer, options: Partial<UIGraphicsOptions> = {}) {\n const defaultCanvasSize = 512;\n const width = options.width ?? defaultCanvasSize;\n const height = options.height ?? defaultCanvasSize;\n const color = options.color ?? new UIColor();\n\n // Create OffscreenCanvas\n const canvas = new OffscreenCanvas(width, height);\n const ctx = canvas.getContext(\"2d\");\n\n if (!ctx) {\n throw new Error(\"Failed to get 2D context from OffscreenCanvas\");\n }\n\n // Create texture from canvas\n const canvasTexture = new CanvasTexture(canvas);\n canvasTexture.minFilter = LinearFilter;\n canvasTexture.magFilter = LinearFilter;\n\n super(layer, options.x ?? 0, options.y ?? 0, width, height, source, {\n map: canvasTexture,\n uvTransform: canvasTexture.matrix,\n color,\n });\n\n this.canvas = canvas;\n this.ctx = ctx;\n this.canvasTexture = canvasTexture;\n this.colorInternal = color;\n this.colorInternal.on(UIColorEvent.CHANGE, this.onColorChange);\n\n if (options.mode !== undefined) {\n this.mode = options.mode;\n }\n }\n\n /**\n * Gets the current color tint applied to the graphics.\n */\n public get color(): UIColor {\n return this.colorInternal;\n }\n\n /**\n * Sets the color tint applied to the graphics.\n */\n public set color(value: UIColor) {\n this.colorInternal.copy(value);\n }\n\n /**\n * Clears the canvas with optional fill color.\n *\n * @param fillColor - Optional color to fill after clearing\n */\n public clear(fillColor?: UIColor): this {\n this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);\n if (fillColor !== undefined) {\n this.ctx.fillStyle = fillColor.toCSSColor();\n this.ctx.fillRect(0, 0, this.canvas.width, this.canvas.height);\n }\n this.canvasTexture.needsUpdate = true;\n return this;\n }\n\n /**\n * Draws a rectangle on the canvas.\n */\n public rect(x: number, y: number, width: number, height: number): this {\n this.ctx.rect(x, y, width, height);\n this.canvasTexture.needsUpdate = true;\n return this;\n }\n\n /**\n * Draws a filled rectangle on the canvas.\n */\n public fillRect(x: number, y: number, width: number, height: number): this {\n this.ctx.fillRect(x, y, width, height);\n this.canvasTexture.needsUpdate = true;\n return this;\n }\n\n /**\n * Draws a stroked rectangle on the canvas.\n */\n public strokeRect(x: number, y: number, width: number, height: number): this {\n this.ctx.strokeRect(x, y, width, height);\n this.canvasTexture.needsUpdate = true;\n return this;\n }\n\n /**\n * Draws a circle on the canvas.\n */\n public circle(x: number, y: number, radius: number): this {\n this.ctx.beginPath();\n this.ctx.arc(x, y, radius, 0, Math.PI * 2);\n this.ctx.closePath();\n this.canvasTexture.needsUpdate = true;\n return this;\n }\n\n /**\n * Begins a new path.\n */\n public beginPath(): this {\n this.ctx.beginPath();\n this.canvasTexture.needsUpdate = true;\n return this;\n }\n\n /**\n * Closes the current path.\n */\n public closePath(): this {\n this.ctx.closePath();\n this.canvasTexture.needsUpdate = true;\n return this;\n }\n\n /**\n * Fills the current path.\n */\n public fill(): this {\n this.ctx.fill();\n this.canvasTexture.needsUpdate = true;\n return this;\n }\n\n /**\n * Strokes the current path.\n */\n public stroke(): this {\n this.ctx.stroke();\n this.canvasTexture.needsUpdate = true;\n return this;\n }\n\n /**\n * Moves the path to a point.\n */\n public moveTo(x: number, y: number): this {\n this.ctx.moveTo(x, y);\n return this;\n }\n\n /**\n * Draws a line to a point.\n */\n public lineTo(x: number, y: number): this {\n this.ctx.lineTo(x, y);\n this.canvasTexture.needsUpdate = true;\n return this;\n }\n\n /**\n * Sets the fill style.\n */\n public setFillStyle(style: UIColor | CanvasGradient | CanvasPattern): this {\n this.ctx.fillStyle = style instanceof UIColor ? style.toCSSColor() : style;\n return this;\n }\n\n /**\n * Sets the stroke style.\n */\n public setStrokeStyle(style: UIColor | CanvasGradient | CanvasPattern): this {\n this.ctx.strokeStyle =\n style instanceof UIColor ? style.toCSSColor() : style;\n return this;\n }\n\n /**\n * Sets the line width.\n */\n public setLineWidth(width: number): this {\n this.ctx.lineWidth = width;\n return this;\n }\n\n /**\n * Destroys the graphics element by cleaning up resources.\n */\n public override destroy(): void {\n this.colorInternal.off(UIColorEvent.CHANGE, this.onColorChange);\n this.canvasTexture.dispose();\n super.destroy();\n }\n\n /** Event handler for when the color changes */\n private readonly onColorChange = (color: UIColor): void => {\n this.sceneWrapper.setUniform(this.planeHandler, \"color\", color);\n };\n}\n","import type { Texture } from \"three\";\nimport type { UILayer } from \"../layers/UILayer\";\nimport { assertValidPositiveNumber } from \"../miscellaneous/asserts\";\nimport { UIColor, UIColorEvent } from \"../miscellaneous/UIColor\";\nimport type { UIMode } from \"../miscellaneous/UIMode\";\nimport source from \"../shaders/UIDefaultShader.glsl\";\nimport { UIElement } from \"./UIElement\";\n\n/**\n * Configuration options for creating a UIImage element.\n */\nexport interface UIImageOptions {\n /** X position of the element */\n x: number;\n /** Y position of the element */\n y: number;\n /** Width of the element */\n width: number;\n /** Height of the element */\n height: number;\n /** Color tint applied to the image */\n color: UIColor;\n /** Default UIMode */\n mode: UIMode;\n}\n\n/**\n * UI element for displaying textured images.\n *\n * UIImage is a concrete implementation of UIElement that renders a textured\n * image using shader-based planes. It automatically sizes itself\n * to match the texture dimensions and provides control over visual properties\n * such as color tinting.\n *\n * @see {@link UIElement} - Base class providing UI element functionality\n * @see {@link Texture} - Three.js texture for image data\n */\nexport class UIImage extends UIElement {\n /** Internal storage for the current texture */\n private textureInternal: Texture;\n /** Internal storage for the color tint */\n private readonly colorInternal: UIColor;\n\n /**\n * Creates a new UIImage instance.\n *\n * The image will automatically size itself to match the texture's dimensions.\n * All options have default values if not specified.\n *\n * @param layer - The UI layer that contains this image\n * @param texture - The Three.js texture to display\n * @param options - Configuration options for the image\n * @throws Will throw an error if the texture dimensions are not valid positive numbers\n */\n constructor(\n layer: UILayer,\n texture: Texture,\n options: Partial<UIImageOptions> = {},\n ) {\n const w = options.width ?? texture.image.width;\n const h = options.height ?? texture.image.height;\n\n const color = options.color ?? new UIColor();\n\n super(layer, options.x ?? 0, options.y ?? 0, w, h, source, {\n map: texture,\n uvTransform: texture.matrix,\n color,\n });\n\n this.textureInternal = texture;\n this.colorInternal = color;\n this.colorInternal.on(UIColorEvent.CHANGE, this.onColorChange);\n\n if (options.mode !== undefined) {\n this.mode = options.mode;\n }\n }\n\n /**\n * Gets the current texture being displayed.\n * @returns The current Three.js texture\n */\n public get texture(): Texture {\n return this.textureInternal;\n }\n\n /**\n * Gets the current color tint applied to the image.\n * @returns The UIColor instance\n */\n public get color(): UIColor {\n return this.colorInternal;\n }\n\n /**\n * Sets a new texture for the image.\n *\n * When setting a new texture, the image will automatically resize to match\n * the new texture's dimensions.\n *\n * @param value - The new Three.js texture to display\n * @throws Will throw an error if the texture dimensions are not valid positive numbers\n * @see {@link assertValidPositiveNumber}\n */\n public set texture(value: Texture) {\n const w = value.image.width;\n const h = value.image.height;\n\n assertValidPositiveNumber(w, \"UIImage texture width\");\n assertValidPositiveNumber(h, \"UIImage texture height\");\n\n this.solverWrapper.suggestVariableValue(this.wVariable, w);\n this.solverWrapper.suggestVariableValue(this.hVariable, h);\n\n this.textureInternal = value;\n this.sceneWrapper.setUniform(this.planeHandler, \"map\", value);\n this.sceneWrapper.setUniform(\n this.planeHandler,\n \"uvTransform\",\n value.matrix,\n );\n }\n\n /**\n * Sets the color tint applied to the image.\n * @param value - The UIColor instance\n */\n public set color(value: UIColor) {\n this.colorInternal.copy(value);\n }\n\n /**\n * Destroys the UI image by cleaning up color event listeners and all associated resources.\n */\n public override destroy(): void {\n this.colorInternal.off(UIColorEvent.CHANGE, this.onColorChange);\n super.destroy();\n }\n\n /** Event handler for when the color changes */\n private readonly onColorChange = (color: UIColor): void => {\n this.sceneWrapper.setUniform(this.planeHandler, \"color\", color);\n };\n}\n","const DEFAULT_SLICE_BORDER = 0.25;\n\nexport type UINineSliceBorders =\n | { left: number; right: number; top: number; bottom: number }\n | { horizontal: number; vertical: number }\n | number;\n\n/**\n * Resolves various nine-slice border inputs into a normalized border object.\n *\n * @param value - The border value to resolve (can be number, partial object, or full object)\n * @returns Normalized border object with left, right, top, bottom properties\n */\nexport function resolveNineSliceBorders(value: unknown): {\n l: number;\n r: number;\n t: number;\n b: number;\n} {\n // Handle null/undefined\n if (value === null || value === undefined) {\n return {\n l: DEFAULT_SLICE_BORDER,\n r: DEFAULT_SLICE_BORDER,\n t: DEFAULT_SLICE_BORDER,\n b: DEFAULT_SLICE_BORDER,\n };\n }\n\n // Handle number\n if (typeof value === \"number\") {\n return {\n l: value,\n r: value,\n t: value,\n b: value,\n };\n }\n\n // Handle object\n if (typeof value === \"object\") {\n const obj = value as Record<string, unknown>;\n\n // Handle { horizontal, vertical } format\n if (\"horizontal\" in obj && \"vertical\" in obj) {\n const horizontal =\n typeof obj.horizontal === \"number\"\n ? obj.horizontal\n : DEFAULT_SLICE_BORDER;\n const vertical =\n typeof obj.vertical === \"number\" ? obj.vertical : DEFAULT_SLICE_BORDER;\n\n return {\n l: horizontal,\n r: horizontal,\n t: vertical,\n b: vertical,\n };\n }\n\n // Handle { left, right, top, bottom } format\n const left = typeof obj.left === \"number\" ? obj.left : DEFAULT_SLICE_BORDER;\n const right =\n typeof obj.right === \"number\" ? obj.right : DEFAULT_SLICE_BORDER;\n const top = typeof obj.top === \"number\" ? obj.top : DEFAULT_SLICE_BORDER;\n const bottom =\n typeof obj.bottom === \"number\" ? obj.bottom : DEFAULT_SLICE_BORDER;\n\n return { l: left, r: right, t: top, b: bottom };\n }\n\n // Fallback to default\n return {\n l: DEFAULT_SLICE_BORDER,\n r: DEFAULT_SLICE_BORDER,\n t: DEFAULT_SLICE_BORDER,\n b: DEFAULT_SLICE_BORDER,\n };\n}\n","import type { Texture, WebGLRenderer } from \"three\";\nimport { Vector4 } from \"three\";\nimport { type UILayer } from \"../layers/UILayer\";\nimport { assertValidPositiveNumber } from \"../miscellaneous/asserts\";\nimport { UIColor, UIColorEvent } from \"../miscellaneous/UIColor\";\nimport type { UIMode } from \"../miscellaneous/UIMode\";\nimport {\n resolveNineSliceBorders,\n type UINineSliceBorders,\n} from \"../miscellaneous/UINineSliceBorder\";\nimport source from \"../shaders/UINineSliceShader.glsl\";\nimport { UIElement } from \"./UIElement\";\n\n/**\n * Configuration options for creating a UINineSlice element.\n */\nexport interface UINineSliceOptions {\n /** X position of the element */\n x: number;\n /** Y position of the element */\n y: number;\n /** Color tint applied to the nine-slice element */\n color: UIColor;\n /** Nine-slice border configuration (can be number, object with horizontal/vertical, or full border object) */\n sliceBorders: UINineSliceBorders;\n /** Default UIMode */\n mode: UIMode;\n}\n\n/**\n * Nine-slice UI element for scalable images with preserved border regions.\n *\n * Nine-slice scaling divides an image into 9 regions: 4 corners, 4 edges, and 1 center.\n * The corners maintain their original size, edges scale in one dimension, and the center\n * scales in both dimensions. This technique is commonly used for creating scalable UI\n * panels, buttons, and borders that maintain visual quality at any size.\n */\nexport class UINineSlice extends UIElement {\n /** Internal storage for the current texture */\n private readonly textureInternal: Texture;\n /** Internal storage for the color tint */\n private readonly colorInternal: UIColor;\n /** Internal storage for the nine-slice border values (left, right, top, bottom) */\n private readonly sliceBordersInternal: Vector4;\n /** Internal storage for texture and world dimensions (texture width, texture height, world width, world height) */\n private readonly dimensions: Vector4;\n\n /**\n * Creates a new nine-slice UI element.\n *\n * The element initially sizes itself to match the texture's dimensions.\n * Border regions are defined by the slice borders configuration.\n *\n * @param layer - The UI layer to add this element to\n * @param texture - The texture to use for nine-slice rendering\n * @param options - Configuration options for the nine-slice element\n * @throws Will throw an error if the texture dimensions are not valid positive numbers\n */\n constructor(\n layer: UILayer,\n texture: Texture,\n options: Partial<UINineSliceOptions> = {},\n ) {\n const width = texture.image.width;\n const height = texture.image.height;\n\n const color = options.color ?? new UIColor();\n const resolvedSliceBorders = resolveNineSliceBorders(options.sliceBorders);\n const sliceBorders = new Vector4(\n resolvedSliceBorders.l,\n resolvedSliceBorders.r,\n resolvedSliceBorders.t,\n resolvedSliceBorders.b,\n );\n const dimensions = new Vector4(width, height, width, height);\n\n super(layer, options.x ?? 0, options.y ?? 0, width, height, source, {\n map: texture,\n color,\n sliceBorders,\n dimensions,\n });\n\n this.textureInternal = texture;\n this.sliceBordersInternal = sliceBorders;\n this.dimensions = dimensions;\n\n this.colorInternal = color;\n this.colorInternal.on(UIColorEvent.CHANGE, this.onColorChange);\n\n if (options.mode !== undefined) {\n this.mode = options.mode;\n }\n }\n\n /**\n * Gets the current texture being displayed.\n * @returns The current Three.js texture\n */\n public get texture(): Texture {\n return this.textureInternal;\n }\n\n /**\n * Gets the current color tint applied to the nine-slice element.\n * @returns The UIColor instance\n */\n public get color(): UIColor {\n return this.colorInternal;\n }\n\n /**\n * Gets the left border size for nine-slice scaling.\n * @returns The left border size as a percentage (0-1) of texture width\n */\n public get sliceBorderLeft(): number {\n return this.sliceBordersInternal.x;\n }\n\n /**\n * Gets the right border size for nine-slice scaling.\n * @returns The right border size as a percentage (0-1) of texture width\n */\n public get sliceBorderRight(): number {\n return this.sliceBordersInternal.y;\n }\n\n /**\n * Gets the top border size for nine-slice scaling.\n * @returns The top border size as a percentage (0-1) of texture height\n */\n public get sliceBorderTop(): number {\n return this.sliceBordersInternal.z;\n }\n\n /**\n * Gets the bottom border size for nine-slice scaling.\n * @returns The bottom border size as a percentage (0-1) of texture height\n */\n public get sliceBorderBottom(): number {\n return this.sliceBordersInternal.w;\n }\n\n /**\n * Sets a new texture for the nine-slice element.\n *\n * When setting a new texture, the element will update its internal dimensions\n * but maintain the current world size. The nine-slice borders remain unchanged.\n *\n * @param value - The new Three.js texture to display\n * @throws Will throw an error if the texture dimensions are not valid positive numbers\n * @see {@link assertValidPositiveNumber}\n */\n public set texture(value: Texture) {\n const w = value.image.width;\n const h = value.image.height;\n\n assertValidPositiveNumber(w, \"UINineSlice texture width\");\n assertValidPositiveNumber(h, \"UINineSlice texture height\");\n\n this.solverWrapper.suggestVariableValue(this.wVariable, w);\n this.solverWrapper.suggestVariableValue(this.hVariable, h);\n\n this.dimensions.x = w;\n this.dimensions.y = h;\n this.sceneWrapper.setUniform(\n this.planeHandler,\n \"dimensions\",\n this.dimensions,\n );\n this.sceneWrapper.setUniform(this.planeHandler, \"map\", value);\n }\n\n /**\n * Sets the color tint applied to the nine-slice element.\n * @param value - The UIColor instance\n */\n public set color(value: UIColor) {\n this.colorInternal.copy(value);\n }\n\n /**\n * Sets the left border size for nine-slice scaling.\n * @param value - The left border size as a percentage (0-1) of texture width\n */\n public set sliceBorderLeft(value: number) {\n this.sliceBordersInternal.x = value;\n this.sceneWrapper.setUniform(\n this.planeHandler,\n \"sliceBorders\",\n this.sliceBordersInternal,\n );\n }\n\n /**\n * Sets the right border size for nine-slice scaling.\n * @param value - The right border size as a percentage (0-1) of texture width\n */\n public set sliceBorderRight(value: number) {\n this.sliceBordersInternal.y = value;\n this.sceneWrapper.setUniform(\n this.planeHandler,\n \"sliceBorders\",\n this.sliceBordersInternal,\n );\n }\n\n /**\n * Sets the top border size for nine-slice scaling.\n * @param value - The top border size as a percentage (0-1) of texture height\n */\n public set sliceBorderTop(value: number) {\n this.sliceBordersInternal.z = value;\n this.sceneWrapper.setUniform(\n this.planeHandler,\n \"sliceBorders\",\n this.sliceBordersInternal,\n );\n }\n\n /**\n * Sets the bottom border size for nine-slice scaling.\n * @param value - The bottom border size as a percentage (0-1) of texture height\n */\n public set sliceBorderBottom(value: number) {\n this.sliceBordersInternal.w = value;\n this.sceneWrapper.setUniform(\n this.planeHandler,\n \"sliceBorders\",\n this.sliceBordersInternal,\n );\n }\n\n /**\n * Sets all four border sizes for nine-slice scaling at once.\n *\n * @param left - The left border size as a percentage (0-1) of texture width\n * @param right - The right border size as a percentage (0-1) of texture width\n * @param top - The top border size as a percentage (0-1) of texture height\n * @param bottom - The bottom border size as a percentage (0-1) of texture height\n */\n public setSliceBorders(\n left: number,\n right: number,\n top: number,\n bottom: number,\n ): void {\n this.sliceBordersInternal.set(left, right, top, bottom);\n this.sceneWrapper.setUniform(\n this.planeHandler,\n \"sliceBorders\",\n this.sliceBordersInternal,\n );\n }\n\n /**\n * Destroys the nine-slice UI element by cleaning up color event listeners and all associated resources.\n */\n public override destroy(): void {\n this.colorInternal.off(UIColorEvent.CHANGE, this.onColorChange);\n super.destroy();\n }\n\n /**\n * Called before each render frame to update the element's dimensions for nine-slice scaling.\n * Updates the world dimensions (z, w components) based on current width, height, and micro scaling.\n * @param renderer - The WebGL renderer\n * @param deltaTime - Time since last frame in seconds\n */\n protected override onWillRender(\n renderer: WebGLRenderer,\n deltaTime: number,\n ): void {\n super.onWillRender(renderer, deltaTime);\n\n this.dimensions.z = this.width * this.micro.scaleX;\n this.dimensions.w = this.height * this.micro.scaleY;\n this.sceneWrapper.setUniform(\n this.planeHandler,\n \"dimensions\",\n this.dimensions,\n );\n }\n\n /** Event handler for when the color changes */\n private readonly onColorChange = (color: UIColor): void => {\n this.sceneWrapper.setUniform(this.planeHandler, \"color\", color);\n };\n}\n","import { Texture } from \"three\";\nimport type { UILayer } from \"../layers/UILayer\";\nimport { assertValidPositiveNumber } from \"../miscellaneous/asserts\";\nimport { UIColor, UIColorEvent } from \"../miscellaneous/UIColor\";\nimport type { UIMode } from \"../miscellaneous/UIMode\";\nimport source from \"../shaders/UIProgressShader.glsl\";\nimport { UIElement } from \"./UIElement\";\n\nconst DEFAULT_TEXTURE = new Texture();\n\n/**\n * Predefined mask functions that control how the progress bar fills.\n * Each function defines a different fill pattern using GLSL shader code.\n */\nexport enum UIProgressMaskFunction {\n /** Fill horizontally from left to right (or right to left if inverse) */\n HORIZONTAL = `float calculateMask() {\n return step((direction * io_UV.x + (1.0 - direction) * 0.5), progress);\n }`,\n\n /** Fill vertically from bottom to top (or top to bottom if inverse) */\n VERTICAL = `float calculateMask() {\n return step((direction * io_UV.y + (1.0 - direction) * 0.5), progress);\n }`,\n\n /** Fill diagonally from bottom-left to top-right */\n DIAGONAL = `float calculateMask() {\n float d = (io_UV.x + io_UV.y) * (0.1);\n return step((direction * d + (1.0 - direction) * 0.5), progress);\n }`,\n\n /** Fill in a circular pattern around the center, starting from the left */\n CIRCLE_LEFT = `float calculateMask() {\n vec2 p = io_UV - 0.5;\n float angle = atan(p.y, p.x);\n angle = (angle + 3.14159265) / 3.14159265;\n angle *= 0.5;\n return step((direction * angle + (1.0 - direction) * 0.5), progress);\n }`,\n\n /** Fill in a circular pattern around the center, starting from the top */\n CIRCLE_TOP = `float calculateMask() {\n vec2 p = io_UV - 0.5;\n float angle = atan(p.y, p.x);\n angle = (angle + 3.14159265) / (2.0 * 3.14159265);\n angle = mod(angle + 0.25, 1.0);\n return step((direction * angle + (1.0 - direction) * 0.5), progress);\n }`,\n}\n\n/**\n * Configuration options for creating a UIProgress element.\n */\nexport interface UIProgressOptions {\n /** X position of the element */\n x: number;\n /** Y position of the element */\n y: number;\n /** Optional background texture (if not provided, default texture is used) */\n backgroundTexture: Texture;\n /** Overall color tint applied to the entire progress bar */\n color: UIColor;\n /** Foreground color tint applied to the filled portion */\n foregroundColor: UIColor;\n /** Background color tint applied to the unfilled portion */\n backgroundColor: UIColor;\n /** Mask function that defines how the progress bar fills (predefined enum or custom GLSL code) */\n maskFunction: UIProgressMaskFunction | string;\n /** Progress value between 0.0 (empty) and 1.0 (full) */\n progress: number;\n /** Whether to fill in reverse direction (true for reverse, false for normal) */\n inverseDirection: boolean;\n /** Default UIMode */\n mode: UIMode;\n}\n\n/**\n * Progress bar UI element with customizable fill direction and appearance.\n *\n * UIProgress displays a progress bar that can be filled in various directions\n * (horizontal, vertical, or at custom angles). It supports separate background\n * and foreground textures with independent color tinting and opacity control.\n *\n * The progress value ranges from 0.0 (empty) to 1.0 (completely filled).\n * The fill direction can be controlled both by angle and forward/reverse direction.\n */\nexport class UIProgress extends UIElement {\n /** Internal storage for the foreground texture */\n private foregroundTextureInternal: Texture;\n /** Internal storage for the optional background texture */\n private backgroundTextureInternal?: Texture;\n\n /** Internal storage for the overall color tint */\n private readonly colorInternal: UIColor;\n /** Internal storage for the foreground color tint */\n private readonly foregroundColorInternal: UIColor;\n /** Internal storage for the background color tint */\n private readonly backgroundColorInternal: UIColor;\n\n /** Internal storage for the current progress value */\n private progressInternal: number;\n /** Internal storage for the fill direction flag */\n private inverseDirectionInternal: boolean;\n\n /**\n * Creates a new progress bar UI element.\n *\n * @param layer - The UI layer to add this element to\n * @param foregroundTexture - The texture used for the progress fill\n * @param options - Configuration options for the progress bar\n */\n constructor(\n layer: UILayer,\n foregroundTexture: Texture,\n options: Partial<UIProgressOptions> = {},\n ) {\n const w = foregroundTexture.image?.width;\n const h = foregroundTexture.image?.height;\n\n assertValidPositiveNumber(w, \"UIProgress foreground texture width\");\n assertValidPositiveNumber(h, \"UIProgress foreground texture height\");\n\n if (options.backgroundTexture) {\n assertValidPositiveNumber(\n options.backgroundTexture.image.width,\n \"UIProgress background texture width\",\n );\n assertValidPositiveNumber(\n options.backgroundTexture.image.height,\n \"UIProgress background texture height\",\n );\n }\n\n const color = options.color ?? new UIColor();\n const foregroundColor = options.foregroundColor ?? new UIColor();\n const backgroundColor = options.backgroundColor ?? new UIColor();\n const progress = options.progress ?? 1;\n const inverseDirection = options.inverseDirection ?? false;\n\n super(\n layer,\n options.x ?? 0,\n options.y ?? 0,\n w,\n h,\n (options.maskFunction ?? UIProgressMaskFunction.HORIZONTAL) + source,\n {\n foregroundTexture,\n backgroundTexture: options.backgroundTexture ?? DEFAULT_TEXTURE,\n color,\n foregroundColor,\n backgroundColor,\n progress,\n direction: inverseDirection ? -1 : 1,\n },\n );\n\n this.foregroundTextureInternal = foregroundTexture;\n this.backgroundTextureInternal = options.backgroundTexture;\n\n this.colorInternal = color;\n this.foregroundColorInternal = foregroundColor;\n this.backgroundColorInternal = backgroundColor;\n\n this.progressInternal = progress;\n this.inverseDirectionInternal = inverseDirection;\n\n this.colorInternal.on(UIColorEvent.CHANGE, this.onColorChange);\n this.foregroundColorInternal.on(\n UIColorEvent.CHANGE,\n this.onForegroundColorChange,\n );\n this.backgroundColorInternal.on(\n UIColorEvent.CHANGE,\n this.onBackgroundColorChange,\n );\n\n if (options.mode !== undefined) {\n this.mode = options.mode;\n }\n }\n\n /**\n * Gets the foreground (fill) texture.\n * @returns The foreground texture\n */\n public get foregroundTexture(): Texture {\n return this.foregroundTextureInternal;\n }\n\n /**\n * Gets the background texture.\n * @returns The background texture, or undefined if none is set\n */\n public get backgroundTexture(): Texture | undefined {\n return this.backgroundTextureInternal;\n }\n\n /**\n * Gets the color tint.\n * @returns The UIColor instance\n */\n public get color(): UIColor {\n return this.colorInternal;\n }\n\n /**\n * Gets the foreground color tint.\n * @returns The foreground color UIColor instance\n */\n public get foregroundColor(): UIColor {\n return this.foregroundColorInternal;\n }\n\n /**\n * Gets the background color tint.\n * @returns The background color UIColor instance\n */\n public get backgroundColor(): UIColor {\n return this.backgroundColorInternal;\n }\n\n /**\n * Gets the current progress value.\n * @returns Progress value between 0.0 (empty) and 1.0 (full)\n */\n public get progress(): number {\n return this.progressInternal;\n }\n\n /**\n * Gets whether the progress fills in reverse direction.\n * @returns True if filling in reverse, false if filling forward\n */\n public get inverseDirection(): boolean {\n return this.inverseDirectionInternal;\n }\n\n /**\n * Sets the foreground (fill) texture.\n *\n * When setting a new texture, the progress bar will automatically resize\n * to match the new texture's dimensions.\n *\n * @param value - The new foreground texture\n * @throws Will throw an error if the texture dimensions are not valid positive numbers\n */\n public set foregroundTexture(value: Texture) {\n const w = value.image.width;\n const h = value.image.height;\n\n assertValidPositiveNumber(w, \"UIProgress foreground texture width\");\n assertValidPositiveNumber(h, \"UIProgress foreground texture height\");\n\n this.solverWrapper.suggestVariableValue(this.wVariable, w);\n this.solverWrapper.suggestVariableValue(this.hVariable, h);\n\n this.foregroundTextureInternal = value;\n this.sceneWrapper.setUniform(this.planeHandler, \"foregroundTexture\", value);\n }\n\n /**\n * Sets the background texture.\n * @param value - The background texture, or undefined to remove background\n */\n public set backgroundTexture(value: Texture | undefined) {\n if (value !== undefined) {\n assertValidPositiveNumber(\n value.image.width,\n \"UIProgress background texture width\",\n );\n assertValidPositiveNumber(\n value.image.height,\n \"UIProgress background texture height\",\n );\n }\n\n this.backgroundTextureInternal = value;\n this.sceneWrapper.setUniform(this.planeHandler, \"backgroundTexture\", value);\n }\n\n /**\n * Sets the color tint.\n * @param value - The UIColor instance\n */\n public set color(value: UIColor) {\n this.colorInternal.copy(value);\n }\n\n /**\n * Sets the foreground color tint.\n * @param value - The foreground color UIColor instance\n */\n public set foregroundColor(value: UIColor) {\n this.foregroundColorInternal.copy(value);\n }\n\n /**\n * Sets the background color tint.\n * @param value - The background color UIColor instance\n */\n public set backgroundColor(value: UIColor) {\n this.backgroundColorInternal.copy(value);\n }\n\n /**\n * Sets the progress fill direction.\n * @param value - True for reverse direction, false for forward\n */\n public set inverseDirection(value: boolean) {\n this.inverseDirectionInternal = value;\n this.sceneWrapper.setUniform(\n this.planeHandler,\n \"direction\",\n value ? -1 : 1,\n );\n }\n\n /**\n * Sets the progress value.\n * @param value - Progress value between 0.0 (empty) and 1.0 (full)\n */\n public set progress(value: number) {\n this.progressInternal = value;\n this.sceneWrapper.setUniform(this.planeHandler, \"progress\", value);\n }\n\n public override destroy(): void {\n this.colorInternal.off(UIColorEvent.CHANGE, this.onColorChange);\n this.foregroundColorInternal.off(\n UIColorEvent.CHANGE,\n this.onForegroundColorChange,\n );\n this.backgroundColorInternal.off(\n UIColorEvent.CHANGE,\n this.onBackgroundColorChange,\n );\n super.destroy();\n }\n\n /** Event handler for when the overall color changes */\n private readonly onColorChange = (color: UIColor): void => {\n this.sceneWrapper.setUniform(this.planeHandler, \"color\", color);\n };\n\n /** Event handler for when the foreground color changes */\n private readonly onForegroundColorChange = (color: UIColor): void => {\n this.sceneWrapper.setUniform(this.planeHandler, \"foregroundColor\", color);\n };\n\n /** Event handler for when the background color changes */\n private readonly onBackgroundColorChange = (color: UIColor): void => {\n this.sceneWrapper.setUniform(this.planeHandler, \"backgroundColor\", color);\n };\n}\n","import type { Camera, WebGLRenderer } from \"three\";\nimport {\n LinearFilter,\n Matrix3,\n PerspectiveCamera,\n RGBAFormat,\n Scene,\n UnsignedByteType,\n WebGLRenderTarget,\n} from \"three\";\nimport { type UILayer } from \"../layers/UILayer\";\nimport { UIColor, UIColorEvent } from \"../miscellaneous/UIColor\";\nimport type { UIMode } from \"../miscellaneous/UIMode\";\nimport source from \"../shaders/UIDefaultShader.glsl\";\nimport { UIElement } from \"./UIElement\";\n\n/**\n * Update modes for controlling when the 3D scene should be re-rendered.\n */\nexport enum UISceneUpdateMode {\n /** Re-render the scene every frame. */\n EACH_FRAME = 1,\n /** Re-render the scene every second frame for performance. */\n EACH_SECOND_FRAME = 2,\n /** Re-render the scene only when properties change. */\n PROPERTY_CHANGED = 3,\n /** Re-render the scene only when manually requested. */\n MANUAL = 4,\n}\n\n/** Default resolution factor for render target sizing. */\nconst DEFAULT_RESOLUTION_FACTOR = 0.5;\n/** Minimum allowed resolution factor to prevent performance issues. */\nconst MIN_RESOLUTION_FACTOR = 0.1;\n/** Maximum allowed resolution factor to prevent memory issues. */\nconst MAX_RESOLUTION_FACTOR = 2;\n/** Default width for the scene render target in pixels. */\nconst DEFAULT_WIDTH = 512;\n/** Default height for the scene render target in pixels. */\nconst DEFAULT_HEIGHT = 512;\n/** Default field of view for the perspective camera in degrees. */\nconst DEFAULT_CAMERA_FOV = 75;\n/** Default near clipping plane distance for the camera. */\nconst DEFAULT_CAMERA_NEAR = 0.1;\n/** Default far clipping plane distance for the camera. */\nconst DEFAULT_CAMERA_FAR = 100;\n/** Default update mode for scene rendering. */\nconst DEFAULT_UPDATE_MODE = UISceneUpdateMode.PROPERTY_CHANGED;\n/** Default clear color for the render target. */\nconst DEFAULT_CLEAR_COLOR = 0x000000;\n/** Default clear alpha for the render target. */\nconst DEFAULT_CLEAR_ALPHA = 0;\n/** Default depth buffer usage setting. */\nconst DEFAULT_USE_DEPTH = true;\n\n/**\n * Configuration options for UIScene element creation.\n */\nexport interface UISceneOptions {\n /** Initial x-coordinate position. */\n x: number;\n /** Initial y-coordinate position. */\n y: number;\n /** Width of the scene render target in pixels. */\n width: number;\n /** Height of the scene render target in pixels. */\n height: number;\n /** Color tint applied to the scene texture. */\n color: UIColor;\n /** Three.js scene to render. */\n scene: Scene;\n /** Camera to use for rendering the scene. */\n camera: Camera;\n /** Update mode controlling when the scene is re-rendered. */\n updateMode: UISceneUpdateMode;\n /** Resolution factor for render target sizing (0.1 to 2.0). */\n resolutionFactor: number;\n /** Clear color for the render target background. */\n clearColor: number;\n /** Clear alpha for the render target background. */\n clearAlpha: number;\n /** Whether to enable depth buffer for the render target. */\n enableDepthBuffer: boolean;\n /** Default UIMode */\n mode: UIMode;\n}\n\n/**\n * UI element for rendering 3D scenes to texture within the UI system.\n *\n * UIScene is a concrete implementation of UIElement that renders a Three.js\n * scene to a WebGL render target and displays it as a texture. It provides\n * control over rendering frequency, resolution, and visual properties. This\n * allows embedding complex 3D content within the 2D UI layout system with\n * performance optimizations through configurable update modes.\n *\n * @see {@link UIElement} - Base class providing UI element functionality\n * @see {@link UISceneUpdateMode} - Update mode configuration\n * @see {@link Scene} - Three.js scene for 3D content\n * @see {@link Camera} - Three.js camera for scene rendering\n */\nexport class UIScene extends UIElement {\n /** The WebGL render target for off-screen scene rendering. */\n private readonly renderTarget: WebGLRenderTarget;\n\n /** Internal storage for the color tint. */\n private readonly colorInternal: UIColor;\n /** Internal storage for the current Three.js scene. */\n private sceneInternal: Scene;\n /** Internal storage for the current camera. */\n private cameraInternal: Camera;\n /** Internal storage for the current update mode. */\n private updateModeInternal: UISceneUpdateMode;\n /** Internal storage for the current resolution factor. */\n private resolutionFactorInternal: number;\n /** Internal storage for the current clear color. */\n private clearColorInternal: number;\n /** Internal storage for the current clear alpha. */\n private clearAlphaInternal: number;\n\n /** Frame alternation boolean for EACH_SECOND_FRAME update mode. */\n private frameBoolean = true;\n /** Flag indicating if properties have changed requiring a re-render. */\n private propertyChanged = false;\n /** Flag indicating if a manual render has been requested. */\n private renderRequired = false;\n\n /**\n * Creates a new UIScene instance with 3D scene rendering capabilities.\n *\n * The scene element creates a WebGL render target for off-screen rendering\n * and displays the result as a texture. A default perspective camera is\n * created if none is provided.\n *\n * @param layer - The UI layer that contains this scene element\n * @param options - Configuration options for scene rendering\n * @throws Will throw an error if resolution factor is outside valid range (0.1-2.0)\n */\n constructor(layer: UILayer, options: Partial<UISceneOptions> = {}) {\n const resolutionFactor =\n options.resolutionFactor ?? DEFAULT_RESOLUTION_FACTOR;\n\n if (\n resolutionFactor < MIN_RESOLUTION_FACTOR ||\n resolutionFactor > MAX_RESOLUTION_FACTOR\n ) {\n throw new Error(\n `Invalid resolution factor: ${resolutionFactor}. Must be between ${MIN_RESOLUTION_FACTOR} and ${MAX_RESOLUTION_FACTOR}.`,\n );\n }\n\n const w = options.width ?? DEFAULT_WIDTH;\n const h = options.height ?? DEFAULT_HEIGHT;\n\n const renderTarget = new WebGLRenderTarget(\n w * resolutionFactor,\n h * resolutionFactor,\n {\n format: RGBAFormat,\n minFilter: LinearFilter,\n magFilter: LinearFilter,\n type: UnsignedByteType,\n depthBuffer: options.enableDepthBuffer ?? DEFAULT_USE_DEPTH,\n stencilBuffer: false,\n },\n );\n\n const color = options.color ?? new UIColor();\n\n super(layer, 0, 0, w, h, source, {\n map: renderTarget.texture,\n uvTransform: new Matrix3(),\n color,\n });\n\n this.renderTarget = renderTarget;\n\n this.sceneInternal = options.scene ?? new Scene();\n this.cameraInternal =\n options.camera ??\n new PerspectiveCamera(\n DEFAULT_CAMERA_FOV,\n w / h,\n DEFAULT_CAMERA_NEAR,\n DEFAULT_CAMERA_FAR,\n );\n\n this.resolutionFactorInternal = resolutionFactor;\n this.updateModeInternal = options.updateMode ?? DEFAULT_UPDATE_MODE;\n\n this.clearColorInternal = options.clearColor ?? DEFAULT_CLEAR_COLOR;\n this.clearAlphaInternal = options.clearAlpha ?? DEFAULT_CLEAR_ALPHA;\n\n if (options.updateMode === UISceneUpdateMode.PROPERTY_CHANGED) {\n this.renderRequired = true;\n }\n\n this.colorInternal = color;\n this.colorInternal.on(UIColorEvent.CHANGE, this.onColorChange);\n\n if (options.mode !== undefined) {\n this.mode = options.mode;\n }\n }\n\n /**\n * Gets the current color tint applied to the scene texture.\n * @returns The UIColor instance\n */\n public get color(): UIColor {\n return this.colorInternal;\n }\n\n /**\n * Gets the Three.js scene being rendered.\n * @returns The current Three.js scene\n */\n public get scene(): Scene {\n return this.sceneInternal;\n }\n\n /**\n * Gets the camera used for rendering the scene.\n * @returns The current Three.js camera\n */\n public get camera(): Camera {\n return this.cameraInternal;\n }\n\n /**\n * Gets the current update mode controlling render frequency.\n * @returns The current update mode\n */\n public get updateMode(): UISceneUpdateMode {\n return this.updateModeInternal;\n }\n\n /**\n * Gets the resolution factor for render target sizing.\n * @returns The resolution factor between 0.1 and 2.0\n */\n public get resolutionFactor(): number {\n return this.resolutionFactorInternal;\n }\n\n /**\n * Gets the clear color used for the render target background.\n * @returns The clear color as a number\n */\n public get clearColor(): number {\n return this.clearColorInternal;\n }\n\n /**\n * Gets the clear alpha used for the render target background.\n * @returns The clear alpha value between 0.0 and 1.0\n */\n public get clearAlpha(): number {\n return this.clearAlphaInternal;\n }\n\n /**\n * Sets the color tint applied to the scene texture.\n * @param value - The UIColor instance\n */\n public set color(value: UIColor) {\n this.colorInternal.copy(value);\n }\n\n /**\n * Sets a new Three.js scene to render and marks for re-render.\n * @param value - The new Three.js scene\n */\n public set scene(value: Scene) {\n if (this.sceneInternal !== value) {\n this.sceneInternal = value;\n this.propertyChanged = true;\n }\n }\n\n /**\n * Sets a new camera for rendering and marks for re-render.\n * @param value - The new Three.js camera\n */\n public set camera(value: Camera) {\n if (this.cameraInternal !== value) {\n this.cameraInternal = value;\n this.propertyChanged = true;\n }\n }\n\n /**\n * Sets the update mode controlling render frequency and marks for re-render.\n * @param value - The new update mode\n */\n public set updateMode(value: UISceneUpdateMode) {\n if (this.updateModeInternal !== value) {\n this.updateModeInternal = value;\n this.propertyChanged = true;\n }\n }\n\n /**\n * Sets the resolution factor and resizes the render target accordingly.\n * @param value - The new resolution factor between 0.1 and 2.0\n */\n public set resolutionFactor(value: number) {\n if (this.resolutionFactorInternal !== value) {\n this.resolutionFactorInternal = value;\n this.renderTarget.setSize(\n this.width * this.resolutionFactorInternal,\n this.height * this.resolutionFactorInternal,\n );\n this.propertyChanged = true;\n }\n }\n\n /**\n * Sets the clear color for the render target background and marks for re-render.\n * @param value - The new clear color as a number\n */\n public set clearColor(value: number) {\n if (this.clearColorInternal !== value) {\n this.clearColorInternal = value;\n this.propertyChanged = true;\n }\n }\n\n /**\n * Sets the clear alpha for the render target background and marks for re-render.\n * @param value - The new clear alpha value between 0.0 and 1.0\n */\n public set clearAlpha(value: number) {\n if (this.clearAlphaInternal !== value) {\n this.clearAlphaInternal = value;\n this.propertyChanged = true;\n }\n }\n\n /**\n * Destroys the scene element by cleaning up all associated resources.\n *\n * This method disposes of the material and render target resources,\n * and calls the parent destroy method to clean up the underlying UI element.\n * After calling this method, the scene element should not be used anymore.\n */\n public override destroy(): void {\n this.colorInternal.off(UIColorEvent.CHANGE, this.onColorChange);\n this.renderTarget.dispose();\n super.destroy();\n }\n\n /**\n * Manually requests a re-render of the scene.\n *\n * This method is useful when the update mode is set to MANUAL and you\n * want to trigger a scene re-render without changing any properties.\n */\n public requestRender(): void {\n this.renderRequired = true;\n }\n\n /**\n * Called before each render frame to update the 3D scene rendering.\n * Handles different update modes and renders the 3D scene to the render target\n * based on the current update mode and property change state.\n * @param renderer - The WebGL renderer used for scene rendering\n */\n protected override onWillRender(renderer: WebGLRenderer): void {\n if (\n this.updateModeInternal === UISceneUpdateMode.EACH_FRAME ||\n (this.updateModeInternal === UISceneUpdateMode.EACH_SECOND_FRAME &&\n this.frameBoolean) ||\n (this.updateModeInternal === UISceneUpdateMode.PROPERTY_CHANGED &&\n this.propertyChanged) ||\n (this.updateModeInternal === UISceneUpdateMode.MANUAL &&\n this.renderRequired)\n ) {\n this.renderRequired = false;\n this.propertyChanged = false;\n this.frameBoolean = !this.frameBoolean;\n\n this.renderTarget.setSize(\n this.width * this.resolutionFactorInternal,\n this.height * this.resolutionFactorInternal,\n );\n renderer.setClearColor(this.clearColorInternal, this.clearAlpha);\n renderer.setRenderTarget(this.renderTarget);\n renderer.clear(true, true, false);\n renderer.render(this.sceneInternal, this.cameraInternal);\n }\n }\n\n /** Event handler for when the color changes */\n private readonly onColorChange = (color: UIColor): void => {\n this.sceneWrapper.setUniform(this.planeHandler, \"color\", color);\n };\n}\n","import {\n assertValidNonNegativeNumber,\n assertValidNumber,\n assertValidPositiveNumber,\n} from \"./asserts\";\n\nexport interface UITextStyle {\n color: string;\n align: \"left\" | \"center\" | \"right\";\n\n fontFamily: string;\n fontSize: number;\n fontStyle: \"normal\" | \"italic\" | \"oblique\";\n fontWeight: \"normal\" | \"bold\" | \"bolder\" | \"lighter\" | number;\n lineHeight: number;\n\n enableShadow: boolean;\n shadowOffsetX: number;\n shadowOffsetY: number;\n shadowBlur: number;\n shadowColor: string;\n\n enableStroke: boolean;\n strokeColor: string;\n strokeWidth: number;\n}\n\nexport function isUITextStyle(obj: unknown): obj is UITextStyle {\n if (typeof obj !== \"object\" || obj === null) {\n return false;\n }\n\n const candidate = obj as Record<string, unknown>;\n\n return (\n typeof candidate.color === \"string\" &&\n (candidate.align === \"left\" ||\n candidate.align === \"center\" ||\n candidate.align === \"right\") &&\n typeof candidate.fontFamily === \"string\" &&\n typeof candidate.fontSize === \"number\" &&\n (candidate.fontStyle === \"normal\" ||\n candidate.fontStyle === \"italic\" ||\n candidate.fontStyle === \"oblique\") &&\n (candidate.fontWeight === \"normal\" ||\n candidate.fontWeight === \"bold\" ||\n candidate.fontWeight === \"bolder\" ||\n candidate.fontWeight === \"lighter\" ||\n typeof candidate.fontWeight === \"number\") &&\n typeof candidate.lineHeight === \"number\" &&\n typeof candidate.enableShadow === \"boolean\" &&\n typeof candidate.shadowOffsetX === \"number\" &&\n typeof candidate.shadowOffsetY === \"number\" &&\n typeof candidate.shadowBlur === \"number\" &&\n typeof candidate.shadowColor === \"string\" &&\n typeof candidate.enableStroke === \"boolean\" &&\n typeof candidate.strokeColor === \"string\" &&\n typeof candidate.strokeWidth === \"number\"\n );\n}\n\nexport const DEFAULT_TEXT_STYLE: UITextStyle = {\n color: \"#000000\",\n align: \"left\",\n\n fontFamily: \"Arial\",\n fontSize: 16,\n fontStyle: \"normal\",\n fontWeight: \"normal\",\n lineHeight: 1.2,\n\n enableShadow: false,\n shadowOffsetX: 0,\n shadowOffsetY: 0,\n shadowBlur: 0,\n shadowColor: \"transparent\",\n\n enableStroke: false,\n strokeColor: \"#000000\",\n strokeWidth: 0,\n};\n\nexport function resolveTextStyle(\n style?: Partial<UITextStyle>,\n commonStyle?: Partial<UITextStyle>,\n): UITextStyle {\n const fontSize =\n style?.fontSize ?? commonStyle?.fontSize ?? DEFAULT_TEXT_STYLE.fontSize;\n assertValidPositiveNumber(fontSize, \"Font size\");\n\n const fontWeight = style?.fontWeight ?? commonStyle?.fontWeight ?? \"normal\";\n if (typeof fontWeight === \"number\") {\n assertValidPositiveNumber(fontWeight, \"Font weight\");\n }\n\n const lineHeight =\n style?.lineHeight ??\n commonStyle?.lineHeight ??\n fontSize * DEFAULT_TEXT_STYLE.lineHeight;\n assertValidNumber(lineHeight, \"Line height\");\n\n const shadowOffsetX =\n style?.shadowOffsetX ??\n commonStyle?.shadowOffsetX ??\n DEFAULT_TEXT_STYLE.shadowOffsetX;\n assertValidNonNegativeNumber(shadowOffsetX, \"Shadow offset X\");\n\n const shadowOffsetY =\n style?.shadowOffsetY ??\n commonStyle?.shadowOffsetY ??\n DEFAULT_TEXT_STYLE.shadowOffsetY;\n assertValidNonNegativeNumber(shadowOffsetY, \"Shadow offset Y\");\n\n const shadowBlur =\n style?.shadowBlur ??\n commonStyle?.shadowBlur ??\n DEFAULT_TEXT_STYLE.shadowBlur;\n assertValidNonNegativeNumber(shadowBlur, \"Shadow blur\");\n\n const strokeWidth =\n style?.strokeWidth ??\n commonStyle?.strokeWidth ??\n DEFAULT_TEXT_STYLE.strokeWidth;\n assertValidNonNegativeNumber(strokeWidth, \"Stroke width\");\n\n return {\n color: style?.color ?? commonStyle?.color ?? DEFAULT_TEXT_STYLE.color,\n align: style?.align ?? commonStyle?.align ?? DEFAULT_TEXT_STYLE.align,\n\n fontFamily:\n style?.fontFamily ??\n commonStyle?.fontFamily ??\n DEFAULT_TEXT_STYLE.fontFamily,\n fontSize,\n fontStyle:\n style?.fontStyle ??\n commonStyle?.fontStyle ??\n DEFAULT_TEXT_STYLE.fontStyle,\n fontWeight,\n lineHeight,\n\n enableShadow:\n style?.enableShadow ??\n commonStyle?.enableShadow ??\n DEFAULT_TEXT_STYLE.enableShadow,\n shadowOffsetX,\n shadowOffsetY,\n shadowBlur,\n shadowColor:\n style?.shadowColor ??\n commonStyle?.shadowColor ??\n DEFAULT_TEXT_STYLE.shadowColor,\n\n enableStroke:\n style?.enableStroke ??\n commonStyle?.enableStroke ??\n DEFAULT_TEXT_STYLE.enableStroke,\n strokeColor:\n style?.strokeColor ??\n commonStyle?.strokeColor ??\n DEFAULT_TEXT_STYLE.strokeColor,\n strokeWidth,\n };\n}\n","import type {\n UIChunkMetrics,\n UITextChunk,\n UITextContent,\n UITextLine,\n UITextSize,\n} from \"./textInterfaces\";\nimport {\n DEFAULT_TEXT_STYLE,\n resolveTextStyle,\n type UITextStyle,\n} from \"./UITextStyle\";\n\nexport function splitText(text: string): string[] {\n return text.match(/\\S+|\\s|\\n/g) ?? [];\n}\n\nexport function measureTextChunk(\n context: OffscreenCanvasRenderingContext2D,\n chunk: string,\n style: UITextStyle,\n): UIChunkMetrics {\n context.font = `${style.fontStyle} ${style.fontWeight} ${style.fontSize}px ${style.fontFamily}`;\n\n if (chunk === \"\\n\") {\n return {\n width: Math.ceil(1),\n height: style.lineHeight,\n baseline: 0,\n lineHeight: style.lineHeight,\n };\n }\n\n const metrics = context.measureText(chunk);\n const width = Math.ceil(metrics.width);\n const height = Math.ceil(\n metrics.actualBoundingBoxAscent + metrics.actualBoundingBoxDescent,\n );\n\n return {\n width,\n height,\n baseline: metrics.actualBoundingBoxDescent,\n lineHeight: style.lineHeight,\n };\n}\n\nexport function buildLines(\n maxWidth: number,\n chunks: UITextChunk[],\n): UITextLine[] {\n const lines: UITextLine[] = [];\n let currentLine: UITextChunk[] = [];\n let currentWidth = 0;\n let currentHeight = 0;\n let currentBaseline = 0;\n let currentLineHeight = 0;\n\n for (const chunk of chunks) {\n if (chunk.text === \"\\n\") {\n if (currentLine.length > 0) {\n lines.push({\n chunks: currentLine,\n width: currentWidth,\n height: currentHeight,\n baseline: currentBaseline,\n lineHeight: currentLineHeight,\n });\n }\n currentLine = [];\n currentWidth = 0;\n currentHeight = 0;\n currentBaseline = 0;\n currentLineHeight = 0;\n continue;\n }\n\n if (\n currentWidth + chunk.metrics.width <= maxWidth ||\n currentLine.length === 0\n ) {\n currentLine.push(chunk);\n currentWidth += chunk.metrics.width;\n currentHeight = Math.max(currentHeight, chunk.metrics.height);\n currentBaseline = Math.max(currentBaseline, chunk.metrics.baseline);\n currentLineHeight = Math.max(currentLineHeight, chunk.metrics.lineHeight);\n } else {\n lines.push({\n chunks: currentLine,\n width: currentWidth,\n height: currentHeight,\n baseline: currentBaseline,\n lineHeight: currentLineHeight,\n });\n currentLine = [chunk];\n currentWidth = chunk.metrics.width;\n currentHeight = chunk.metrics.height;\n currentBaseline = chunk.metrics.baseline;\n currentLineHeight = chunk.metrics.lineHeight;\n }\n }\n\n if (currentLine.length > 0) {\n lines.push({\n chunks: currentLine,\n width: currentWidth,\n height: currentHeight,\n baseline: currentBaseline,\n lineHeight: currentLineHeight,\n });\n }\n\n return lines;\n}\n\nexport function calculateTextSize(lines: UITextLine[]): UITextSize {\n if (lines.length === 0) {\n return { width: 0, height: 0 };\n }\n\n const maxLineWidth = Math.max(...lines.map((line) => line.width));\n let totalHeight = 0;\n\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i];\n totalHeight += i === 0 ? line.height : line.lineHeight;\n }\n\n return { width: maxLineWidth, height: totalHeight };\n}\n\nexport function renderText(\n x: number,\n y: number,\n text: string,\n style: UITextStyle,\n context: OffscreenCanvasRenderingContext2D,\n): void {\n context.font = `${style.fontStyle} ${style.fontWeight} ${style.fontSize}px ${style.fontFamily}`;\n\n if (style.enableShadow) {\n context.shadowOffsetX = style.shadowOffsetX;\n context.shadowOffsetY = style.shadowOffsetY;\n context.shadowBlur = style.shadowBlur;\n context.shadowColor = style.shadowColor;\n }\n\n if (style.enableStroke) {\n context.strokeStyle = style.strokeColor;\n context.lineWidth = style.strokeWidth;\n context.strokeText(text, x, y);\n }\n\n context.fillStyle = style.color;\n context.fillText(text, x, y);\n}\n\nexport function renderTextLines(\n paddingTop: number,\n paddingLeft: number,\n lines: UITextLine[],\n context: OffscreenCanvasRenderingContext2D,\n): void {\n let currentY = paddingTop;\n\n let textWidth = 0;\n for (const line of lines) {\n textWidth = Math.max(line.width, textWidth);\n }\n\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i];\n\n const firstAlign = line.chunks[0]?.style.align ?? DEFAULT_TEXT_STYLE.align;\n const isUniformAlign = line.chunks.every(\n (c) => c.style.align === firstAlign,\n );\n const lineAlign = isUniformAlign ? firstAlign : DEFAULT_TEXT_STYLE.align;\n\n let offsetX = 0;\n\n if (lineAlign === \"center\") {\n offsetX = (textWidth - line.width) / 2;\n } else if (lineAlign === \"right\") {\n offsetX = textWidth - line.width;\n }\n\n let currentX = paddingLeft + offsetX;\n currentY += i === 0 ? line.height : line.lineHeight;\n\n for (const chunk of line.chunks) {\n renderText(currentX, currentY, chunk.text, chunk.style, context);\n currentX += chunk.metrics.width;\n }\n }\n}\n\nexport function calculateTextContentParameters(\n context: OffscreenCanvasRenderingContext2D,\n content: UITextContent,\n maxLineWidth: number,\n commonStyle?: Partial<UITextStyle>,\n): { lines: UITextLine[]; size: UITextSize } {\n const chunks: UITextChunk[] = [];\n\n for (const span of Array.isArray(content) ? content : [content]) {\n const isSpanString = typeof span === \"string\";\n const spanString = isSpanString ? span : span.text;\n const style = resolveTextStyle(\n isSpanString ? undefined : span.style,\n commonStyle,\n );\n\n for (const text of splitText(spanString)) {\n const metrics = measureTextChunk(context, text, style);\n chunks.push({ text, style, metrics });\n }\n }\n\n const lines = buildLines(maxLineWidth, chunks);\n return { lines, size: calculateTextSize(lines) };\n}\n","import { assertValidNonNegativeNumber } from \"./asserts\";\n\nexport interface UIPadding {\n left: number;\n right: number;\n top: number;\n bottom: number;\n}\n\nexport function resolveTextPadding(value: unknown): UIPadding {\n if (typeof value === \"number\") {\n return { left: value, right: value, top: value, bottom: value };\n }\n\n if (typeof value === \"object\" && value !== null) {\n const left =\n \"left\" in value && typeof value.left === \"number\" ? value.left : 0;\n const right =\n \"right\" in value && typeof value.right === \"number\" ? value.right : 0;\n const top = \"top\" in value && typeof value.top === \"number\" ? value.top : 0;\n const bottom =\n \"bottom\" in value && typeof value.bottom === \"number\" ? value.bottom : 0;\n\n assertValidNonNegativeNumber(left, \"Padding left\");\n assertValidNonNegativeNumber(right, \"Padding right\");\n assertValidNonNegativeNumber(top, \"Padding top\");\n assertValidNonNegativeNumber(bottom, \"Padding bottom\");\n\n return { left, right, top, bottom };\n }\n\n return { left: 0, right: 0, top: 0, bottom: 0 };\n}\n","import type { WebGLRenderer } from \"three\";\nimport { CanvasTexture, Matrix3 } from \"three\";\nimport { type UILayer } from \"../layers/UILayer\";\nimport type { UITextContent } from \"../miscellaneous/textInterfaces\";\nimport {\n calculateTextContentParameters,\n renderTextLines,\n} from \"../miscellaneous/textTools\";\nimport { UIColor, UIColorEvent } from \"../miscellaneous/UIColor\";\nimport type { UIMode } from \"../miscellaneous/UIMode\";\nimport {\n resolveTextPadding,\n type UIPadding,\n} from \"../miscellaneous/UITextPadding\";\nimport { type UITextStyle } from \"../miscellaneous/UITextStyle\";\nimport source from \"../shaders/UIDefaultShader.glsl\";\nimport { UIElement } from \"./UIElement\";\n\n/** Default maximum width for text elements in pixels. */\nconst DEFAULT_MAX_WIDTH = 1024;\n\n/**\n * Configuration options for UIText element creation.\n */\nexport interface UITextOptions {\n /** X-coordinate of the text element. */\n x: number;\n /** Y-coordinate of the text element. */\n y: number;\n /** Color tint applied to the text. */\n color: UIColor;\n /** Maximum width in pixels before text wrapping occurs. */\n maxWidth: number;\n /** Padding configuration for text content. */\n padding: Partial<UIPadding>;\n /** Common style properties applied to all text content. */\n commonStyle: Partial<UITextStyle>;\n /** Default UIMode */\n mode: UIMode;\n}\n\n/**\n * UI element for rendering dynamic text with canvas-based rendering.\n *\n * UIText is a concrete implementation of UIElement that renders text content\n * using HTML5 Canvas and displays it as a texture. It supports rich text\n * formatting, automatic text wrapping, padding, and dynamic resizing based\n * on content. The text is rendered to a canvas texture which is then applied\n * to a Three.js mesh for display in the 3D scene.\n *\n * @see {@link UIElement} - Base class providing UI element functionality\n * @see {@link UITextContent} - Text content structure\n * @see {@link UITextStyle} - Text styling options\n * @see {@link UIPadding} - Padding configuration\n */\nexport class UIText extends UIElement {\n /** The HTML canvas element used for text rendering. */\n private readonly canvas: OffscreenCanvas;\n\n /** The 2D rendering context for drawing text on the canvas. */\n private readonly context: OffscreenCanvasRenderingContext2D;\n\n /** The canvas texture containing the rendered text. */\n private texture: CanvasTexture;\n\n /** Internal storage for the color tint. */\n private readonly colorInternal: UIColor;\n\n /** Internal storage for the current text content. */\n private contentInternal: UITextContent;\n\n /** Internal storage for the maximum width before text wrapping. */\n private maxWidthInternal: number;\n\n /** Internal storage for the current padding configuration. */\n private paddingInternal: UIPadding;\n\n /** Internal storage for the common text style properties. */\n private commonStyleInternal: Partial<UITextStyle>;\n\n /** Target aspect ratio for the text element based on content. */\n private targetAspectRatio = 1;\n\n /**\n * Creates a new UIText instance with dynamic text rendering.\n *\n * The text element will automatically size itself based on the content\n * and specified options. A canvas is created for rendering the text,\n * which is then used as a texture for the 3D mesh.\n *\n * @param layer - The UI layer that contains this text element\n * @param content - The text content to display\n * @param options - Configuration options for text rendering\n * @throws Will throw an error if canvas context creation fails\n */\n constructor(\n layer: UILayer,\n content: UITextContent,\n options: Partial<UITextOptions> = {},\n ) {\n const canvas = new OffscreenCanvas(2, 2);\n const context = canvas.getContext(\"2d\");\n\n if (!context) {\n throw new Error(\"UIText failed to create canvas context\");\n }\n\n const texture = new CanvasTexture(canvas);\n const color = options.color ?? new UIColor();\n\n super(layer, options.x ?? 0, options.y ?? 0, 2, 2, source, {\n map: texture,\n uvTransform: new Matrix3(),\n color,\n });\n\n this.canvas = canvas;\n this.context = context;\n this.texture = texture;\n\n this.contentInternal = content;\n this.maxWidthInternal = options.maxWidth ?? DEFAULT_MAX_WIDTH;\n this.paddingInternal = resolveTextPadding(options.padding);\n this.commonStyleInternal = options.commonStyle ?? {};\n\n this.colorInternal = color;\n this.colorInternal.on(UIColorEvent.CHANGE, this.onColorChange);\n this.rebuildText();\n\n if (options.mode !== undefined) {\n this.mode = options.mode;\n }\n }\n\n /**\n * Gets the current color tint applied to the text.\n * @returns The UIColor instance\n */\n public get color(): UIColor {\n return this.colorInternal;\n }\n\n /**\n * Gets the current text content being displayed.\n * @returns The current text content structure\n */\n public get content(): UITextContent {\n return this.contentInternal;\n }\n\n /**\n * Gets the maximum width before text wrapping occurs.\n * @returns The maximum width in pixels\n */\n public get maxWidth(): number {\n return this.maxWidthInternal;\n }\n\n /**\n * Gets the current padding configuration.\n * @returns The padding configuration for all sides\n */\n public get padding(): UIPadding {\n return this.paddingInternal;\n }\n\n /**\n * Gets the common style properties applied to the text.\n * @returns The partial text style configuration\n */\n public get commonStyle(): Partial<UITextStyle> {\n return this.commonStyleInternal;\n }\n\n /**\n * Sets the color tint applied to the text.\n * @param value - The UIColor instance\n */\n public set color(value: UIColor) {\n this.colorInternal.copy(value);\n }\n\n /**\n * Sets new text content and triggers a rebuild.\n * @param value - The new text content structure\n */\n public set content(value: UITextContent) {\n this.contentInternal = value;\n this.rebuildText();\n }\n\n /**\n * Sets the maximum width before text wrapping and triggers a rebuild.\n * @param value - The new maximum width in pixels\n */\n public set maxWidth(value: number) {\n this.maxWidthInternal = value;\n this.rebuildText();\n }\n\n /**\n * Sets new padding configuration and triggers a rebuild.\n * @param value - The new padding configuration\n */\n public set padding(value: UIPadding) {\n this.paddingInternal = value;\n this.rebuildText();\n }\n\n /**\n * Sets new common style properties and triggers a rebuild.\n * @param value - The new partial text style configuration\n */\n public set commonStyle(value: Partial<UITextStyle>) {\n this.commonStyleInternal = value;\n this.rebuildText();\n }\n\n /**\n * Destroys the text element by cleaning up all associated resources.\n *\n * This method disposes of the texture resources and calls the parent destroy method\n * to clean up the underlying UI element. After calling this method,\n * the text element should not be used anymore.\n */\n public override destroy(): void {\n this.colorInternal.off(UIColorEvent.CHANGE, this.onColorChange);\n this.texture.dispose();\n super.destroy();\n }\n\n /**\n * Called before each render frame to maintain proper text aspect ratio.\n * Adjusts the height based on the target aspect ratio calculated from text content.\n * @param renderer - The WebGL renderer\n * @param deltaTime - Time since last frame in seconds\n */\n protected override onWillRender(\n renderer: WebGLRenderer,\n deltaTime: number,\n ): void {\n super.onWillRender(renderer, deltaTime);\n if (this.targetAspectRatio !== this.width / this.height) {\n this.height = this.width / this.targetAspectRatio;\n }\n }\n\n /**\n * Rebuilds the text canvas and texture based on current content and settings.\n *\n * This method calculates the text layout, resizes the canvas to fit the content\n * with padding, renders the text lines to the canvas, and updates the texture.\n * It also calculates and sets the target aspect ratio for proper display.\n */\n private rebuildText(): void {\n const { lines, size } = calculateTextContentParameters(\n this.context,\n this.content,\n this.maxWidthInternal,\n this.commonStyleInternal,\n );\n\n this.canvas.width =\n size.width + this.paddingInternal.left + this.paddingInternal.right;\n this.canvas.height =\n size.height + this.paddingInternal.top + this.paddingInternal.bottom;\n\n this.width = this.canvas.width;\n this.height = this.canvas.height;\n\n this.targetAspectRatio = this.canvas.width / this.canvas.height;\n\n renderTextLines(\n this.paddingInternal.top,\n this.paddingInternal.left,\n lines,\n this.context,\n );\n\n this.texture.dispose();\n this.texture = new CanvasTexture(this.canvas);\n this.texture.needsUpdate = true;\n this.sceneWrapper.setUniform(this.planeHandler, \"map\", this.texture);\n }\n\n /** Event handler for when the color changes */\n private readonly onColorChange = (color: UIColor): void => {\n this.sceneWrapper.setUniform(this.planeHandler, \"color\", color);\n };\n}\n","import { Eventail } from \"eventail\";\n\nexport enum UIResizePolicyEvent {\n CHANGE = 0,\n}\n\n/**\n * Base class for UI resize policies.\n *\n * Calculates scale factors based on viewport dimensions. Different policies\n * implement different scaling strategies.\n */\nexport abstract class UIResizePolicy extends Eventail {\n /**\n * Calculates scale factor for given dimensions.\n *\n * @param width - Viewport width in pixels\n * @param height - Viewport height in pixels\n * @returns Scale factor to apply\n * @protected\n */\n protected abstract calculateScaleInternal(\n width: number,\n height: number,\n ): number;\n}\n","import { UIResizePolicy } from \"./UIResizePolicy\";\n\n/**\n * No scaling applied, always returns 1:1 scale.\n */\nexport class UIResizePolicyNone extends UIResizePolicy {\n protected calculateScaleInternal(width: number, height: number): number {\n void width;\n void height;\n return 1;\n }\n}\n","import type { Vector2 } from \"three\";\nimport { MathUtils, Vector3, type Camera, type WebGLRenderer } from \"three\";\nimport { assertValidNumber } from \"../miscellaneous/asserts\";\nimport { UIInputEvent } from \"../miscellaneous/UIInputEvent\";\nimport { UIMode } from \"../miscellaneous/UIMode\";\nimport type { UIResizePolicy } from \"../miscellaneous/UIResizePolicy\";\nimport { UIResizePolicyEvent } from \"../miscellaneous/UIResizePolicy\";\nimport { UIResizePolicyNone } from \"../miscellaneous/UIResizePolicyNone\";\nimport { UILayer } from \"./UILayer\";\n\n/**\n * UI layer that covers the full browser window.\n *\n * Handles window resize and pointer events automatically. Scaling is controlled\n * by the assigned resize policy.\n *\n * @see {@link UILayer}\n * @see {@link UIResizePolicy}\n */\nexport class UIFullscreenLayer extends UILayer {\n private resizePolicyInternal: UIResizePolicy;\n\n /**\n * Creates a fullscreen layer and sets up window event listeners.\n */\n constructor(\n resizePolicy: UIResizePolicy = new UIResizePolicyNone(),\n mode: UIMode = UIMode.VISIBLE,\n ) {\n super(window.innerWidth, window.innerHeight);\n window.addEventListener(\"resize\", this.onResize);\n window.addEventListener(\"pointerdown\", this.onDown);\n window.addEventListener(\"pointermove\", this.onMove);\n window.addEventListener(\"pointerup\", this.onUp);\n this.mode = mode;\n this.resizePolicyInternal = resizePolicy;\n this.resizePolicyInternal.on(UIResizePolicyEvent.CHANGE, this.onResize);\n this.onResize();\n }\n\n /**\n * Gets the current resize policy.\n */\n public get resizePolicy(): UIResizePolicy {\n return this.resizePolicyInternal;\n }\n\n /**\n * Sets a new resize policy. Unsubscribes from old policy and subscribes to new one.\n */\n public set resizePolicy(value: UIResizePolicy) {\n if (this.resizePolicyInternal !== value) {\n this.resizePolicyInternal.off(UIResizePolicyEvent.CHANGE, this.onResize);\n this.resizePolicyInternal = value;\n this.resizePolicyInternal.on(UIResizePolicyEvent.CHANGE, this.onResize);\n this.onResize();\n }\n }\n\n /**\n * Removes window event listeners. The layer should not be used after this.\n */\n public destroy(): void {\n window.removeEventListener(\"resize\", this.onResize);\n window.removeEventListener(\"pointerdown\", this.onDown);\n window.removeEventListener(\"pointermove\", this.onMove);\n window.removeEventListener(\"pointerup\", this.onUp);\n this.resizePolicyInternal.off(UIResizePolicyEvent.CHANGE, this.onResize);\n }\n\n /**\n * Renders the layer.\n *\n * @param renderer - WebGL renderer\n * @param deltaTime - Time since last frame in seconds\n */\n public render(renderer: WebGLRenderer, deltaTime: number): void {\n assertValidNumber(deltaTime, \"UIFullscreenLayer.deltaTime\");\n super.renderInternal(renderer, deltaTime);\n }\n\n /**\n * Projects 3D world position to 2D layer coordinates.\n *\n * @param position - 3D world position\n * @param camera - Camera for projection\n * @returns 2D position in layer space\n */\n public projectWorldPosition(position: Vector3, camera: Camera): Vector3 {\n const projectedPosition = position.clone().project(camera);\n projectedPosition.x = MathUtils.mapLinear(\n projectedPosition.x,\n -1,\n 1,\n this.x,\n this.width,\n );\n projectedPosition.y = MathUtils.mapLinear(\n projectedPosition.y,\n -1,\n 1,\n this.y,\n this.height,\n );\n return projectedPosition;\n }\n\n /**\n * Projects 2D layer position to 3D world coordinates.\n *\n * @param position - 2D position in layer space\n * @param camera - Camera for unprojection\n * @param z - z in NDC space (defaults to -1)\n * @returns 3D position in world space\n */\n public projectLayerPosition(\n position: Vector2,\n camera: Camera,\n z = -1,\n ): Vector3 {\n return new Vector3(\n MathUtils.mapLinear(position.x, this.x, this.width, -1, 1),\n MathUtils.mapLinear(position.y, this.y, this.height, -1, 1),\n z,\n ).unproject(camera);\n }\n\n /**\n * Handles window resize. Updates layer dimensions according to resize policy.\n */\n private readonly onResize = (): void => {\n const scale = this.resizePolicyInternal[\"calculateScaleInternal\"](\n window.innerWidth,\n window.innerHeight,\n );\n this.resizeInternal(window.innerWidth * scale, window.innerHeight * scale);\n };\n\n private readonly onDown = (event: PointerEvent): void => {\n this.handleWindowInput(event, \"onPointerDownInternal\", UIInputEvent.DOWN);\n };\n\n private readonly onMove = (event: PointerEvent): void => {\n this.handleWindowInput(event, \"onPointerMoveInternal\", UIInputEvent.MOVE);\n };\n\n private readonly onUp = (event: PointerEvent): void => {\n this.handleWindowInput(event, \"onPointerUpInternal\", UIInputEvent.UP);\n };\n\n private handleWindowInput(\n event: PointerEvent,\n pointerFunctionName:\n | \"onPointerDownInternal\"\n | \"onPointerMoveInternal\"\n | \"onPointerUpInternal\",\n inputEvent: UIInputEvent,\n ): void {\n const rect =\n event.target instanceof HTMLElement\n ? event.target.getBoundingClientRect()\n : null;\n\n const x = rect ? event.clientX - rect.left : event.clientX;\n const y = rect\n ? rect.bottom - event.clientY\n : window.innerHeight - event.clientY;\n\n const scale = this.resizePolicyInternal[\"calculateScaleInternal\"](\n window.innerWidth,\n window.innerHeight,\n );\n const scaledX = x * scale;\n const scaledY = y * scale;\n\n if (this.mode === UIMode.INTERACTIVE) {\n this.emit(inputEvent, scaledX, scaledY, event.pointerId);\n }\n\n this[pointerFunctionName](scaledX, scaledY, event.pointerId);\n }\n}\n","import type { IUniform } from \"three\";\nimport {\n InstancedBufferAttribute,\n InstancedBufferGeometry,\n Matrix2,\n Matrix3,\n Matrix4,\n Mesh,\n PlaneGeometry,\n ShaderMaterial,\n Texture,\n Vector2,\n Vector3,\n Vector4,\n} from \"three\";\nimport { UIColor } from \"../miscellaneous/UIColor\";\nimport { UITransparencyMode } from \"./UITransparencyMode\";\nimport { assertValidNonNegativeNumber } from \"./asserts\";\n\nexport type UIPropertyType =\n | Texture\n | UIColor\n | Vector2\n | Vector3\n | Vector4\n | Matrix2\n | Matrix3\n | Matrix4\n | number;\n\nexport type UIPropertyTypeName =\n | \"Texture\"\n | \"UIColor\"\n | \"Vector2\"\n | \"Vector3\"\n | \"Vector4\"\n | \"Matrix2\"\n | \"Matrix3\"\n | \"Matrix4\"\n | \"number\";\n\ninterface Descriptor {\n firstIndex: number;\n count: number;\n}\n\nconst INSTANCED_GEOMETRY = ((): InstancedBufferGeometry => {\n const planeGeometry = new PlaneGeometry(1, 1);\n const geometry = new InstancedBufferGeometry();\n geometry.index = planeGeometry.index;\n geometry.setAttribute(\"position\", planeGeometry.attributes[\"position\"]);\n geometry.setAttribute(\"uv\", planeGeometry.attributes[\"uv\"]);\n planeGeometry.dispose();\n return geometry;\n})();\n\nconst ITEM_1_OFFSET = 1;\nconst ITEM_2_OFFSET = 2;\nconst ITEM_3_OFFSET = 3;\n\nconst CAPACITY_STEP = 16;\nconst ALPHA_TEST = 0.5;\n\nfunction resolveTypeInfo(property: UIPropertyType | UIPropertyTypeName): {\n instantiable: boolean;\n glslType: string;\n itemSize: number;\n} {\n if (property === \"Texture\" || property instanceof Texture) {\n return { glslType: \"sampler2D\", instantiable: false, itemSize: -1 };\n } else if (property === \"UIColor\" || property instanceof UIColor) {\n return { glslType: \"vec4\", instantiable: true, itemSize: 4 };\n } else if (property === \"Vector2\" || property instanceof Vector2) {\n return { glslType: \"vec2\", instantiable: true, itemSize: 2 };\n } else if (property === \"Vector3\" || property instanceof Vector3) {\n return { glslType: \"vec3\", instantiable: true, itemSize: 3 };\n } else if (property === \"Vector4\" || property instanceof Vector4) {\n return { glslType: \"vec4\", instantiable: true, itemSize: 4 };\n } else if (property === \"Matrix2\" || property instanceof Matrix2) {\n return { glslType: \"mat2\", instantiable: true, itemSize: 4 };\n } else if (property === \"Matrix3\" || property instanceof Matrix3) {\n return { glslType: \"mat3\", instantiable: true, itemSize: 9 };\n } else if (property === \"Matrix4\" || property instanceof Matrix4) {\n return { glslType: \"mat4\", instantiable: true, itemSize: 16 };\n } else if (property === \"number\" || typeof property === \"number\") {\n return { glslType: \"float\", instantiable: true, itemSize: 1 };\n } else {\n throw new Error(`Unsupported property type: ${property}`);\n }\n}\n\nfunction udpateProperty(\n value: UIPropertyType,\n attribute: InstancedBufferAttribute,\n itemOffset: number,\n): void {\n const array = attribute.array as Float32Array;\n\n if (value instanceof UIColor) {\n array[itemOffset] = value.r;\n array[itemOffset + ITEM_1_OFFSET] = value.g;\n array[itemOffset + ITEM_2_OFFSET] = value.b;\n array[itemOffset + ITEM_3_OFFSET] = value.a;\n } else if (value instanceof Vector2) {\n array[itemOffset] = value.x;\n array[itemOffset + ITEM_1_OFFSET] = value.y;\n } else if (value instanceof Vector3) {\n array[itemOffset] = value.x;\n array[itemOffset + ITEM_1_OFFSET] = value.y;\n array[itemOffset + ITEM_2_OFFSET] = value.z;\n } else if (value instanceof Vector4) {\n array[itemOffset] = value.x;\n array[itemOffset + ITEM_1_OFFSET] = value.y;\n array[itemOffset + ITEM_2_OFFSET] = value.z;\n array[itemOffset + ITEM_3_OFFSET] = value.w;\n } else if (value instanceof Matrix2) {\n const elements = value.elements;\n for (let j = 0; j < elements.length; j++) {\n array[itemOffset + j] = elements[j];\n }\n } else if (value instanceof Matrix3) {\n const elements = value.elements;\n for (let j = 0; j < elements.length; j++) {\n array[itemOffset + j] = elements[j];\n }\n } else if (value instanceof Matrix4) {\n const elements = value.elements;\n for (let j = 0; j < elements.length; j++) {\n array[itemOffset + j] = elements[j];\n }\n } else if (typeof value === \"number\") {\n array[itemOffset] = value;\n }\n\n attribute.needsUpdate = true;\n}\n\nfunction buildEmptyInstancedBufferAttribute(\n property: UIPropertyType | UIPropertyTypeName,\n capacity: number,\n): InstancedBufferAttribute {\n const info = resolveTypeInfo(property);\n if (!info.instantiable) {\n throw new Error(`Invalid property type: ${property}`);\n }\n return new InstancedBufferAttribute(\n new Float32Array(capacity * info.itemSize),\n info.itemSize,\n );\n}\n\nfunction buildMaterial(\n source: string,\n uniformLayout: Record<string, UIPropertyTypeName>,\n varyingLayout: Record<string, UIPropertyTypeName>,\n transparency: UITransparencyMode,\n): ShaderMaterial {\n const uniforms: Record<string, { value: null }> = {};\n\n const uniformDeclarations: string[] = [];\n const attributeDeclarations: string[] = [];\n const varyingDeclarations: string[] = [];\n const vertexAssignments: string[] = [];\n\n for (const [name, propertyTypeName] of Object.entries(uniformLayout)) {\n const glslType = resolveTypeInfo(propertyTypeName).glslType;\n uniforms[`u_${name}`] = { value: null };\n uniformDeclarations.push(`uniform ${glslType} u_${name};`);\n }\n\n for (const [name, propertyTypeName] of Object.entries(varyingLayout)) {\n const glslType = resolveTypeInfo(propertyTypeName).glslType;\n attributeDeclarations.push(`attribute ${glslType} a_${name};`);\n varyingDeclarations.push(`varying ${glslType} v_${name};`);\n vertexAssignments.push(`v_${name} = a_${name};`);\n }\n\n const vertexShader = `\n ${attributeDeclarations.join(\"\\n\")}\n\n ${uniformDeclarations.join(\"\\n\")}\n\n ${varyingDeclarations.join(\"\\n\")}\n varying vec3 v_position;\n varying vec2 v_uv;\n\n void main() {\n if (a_visibility < 0.5) {\n gl_Position = vec4(2.0, 2.0, 2.0, 2.0);\n return;\n }\n\n ${vertexAssignments.join(\"\\n\")}\n\n v_position = position;\n v_uv = (a_uvTransform * vec3(uv, 1.0)).xy;\n\n gl_Position = projectionMatrix * modelViewMatrix * a_instanceTransform * vec4(position, 1.0);\n }\n `;\n\n const fragmentShader = `\n ${uniformDeclarations.join(\"\\n\")}\n\n ${varyingDeclarations.join(\"\\n\")}\n varying vec3 v_position;\n varying vec2 v_uv;\n\n #include <alphahash_pars_fragment>\n\n // Source have to define 'draw' function\n ${source}\n\n void main() {\n vec4 diffuseColor = draw();\n\n #ifdef USE_ALPHATEST\n if (diffuseColor.a < v_alphaTest) {\n discard;\n }\n #endif\n\n #ifdef USE_ALPHAHASH\n if (diffuseColor.a < getAlphaHashThreshold(v_position)) {\n discard;\n }\n #endif\n\n gl_FragColor = linearToOutputTexel(diffuseColor);\n }\n `;\n\n return new ShaderMaterial({\n uniforms,\n vertexShader,\n fragmentShader,\n transparent: transparency === UITransparencyMode.BLEND,\n alphaTest: transparency === UITransparencyMode.CLIP ? ALPHA_TEST : 0.0,\n alphaHash: transparency === UITransparencyMode.HASH,\n });\n}\n\nexport class UIGenericInstancedPlane extends Mesh {\n protected handlerToDescriptor: Map<number, Descriptor> = new Map();\n\n protected lastHandler = 0;\n protected capacity = 0;\n protected propertyBuffers: Map<string, InstancedBufferAttribute> = new Map();\n\n private readonly instancedGeometry: InstancedBufferGeometry;\n private readonly shaderMaterial: ShaderMaterial;\n\n constructor(\n source: string,\n layout: Record<string, UIPropertyTypeName>,\n transparency: UITransparencyMode = UITransparencyMode.CLIP,\n capacity: number = CAPACITY_STEP,\n ) {\n const uniformLayout: Record<string, UIPropertyTypeName> = {};\n const varyingLayout: Record<string, UIPropertyTypeName> = {\n instanceTransform: \"Matrix4\",\n uvTransform: \"Matrix3\",\n ...(transparency === UITransparencyMode.CLIP\n ? { alphaTest: \"number\" }\n : {}),\n };\n\n for (const [name, propertyTypeName] of Object.entries(layout)) {\n (resolveTypeInfo(propertyTypeName).instantiable\n ? varyingLayout\n : uniformLayout)[name] = propertyTypeName;\n }\n\n const instancedGeometry = INSTANCED_GEOMETRY.clone();\n const shaderMaterial = buildMaterial(\n source,\n uniformLayout,\n varyingLayout,\n transparency,\n );\n\n super(instancedGeometry, shaderMaterial);\n\n this.instancedGeometry = instancedGeometry;\n this.instancedGeometry.instanceCount = 0;\n\n this.shaderMaterial = shaderMaterial;\n this.capacity = Math.max(capacity, CAPACITY_STEP);\n\n for (const [name, propertyTypeName] of Object.entries(varyingLayout)) {\n const attribute = buildEmptyInstancedBufferAttribute(\n propertyTypeName,\n this.capacity,\n );\n\n this.instancedGeometry.setAttribute(`a_${name}`, attribute);\n this.propertyBuffers.set(`a_${name}`, attribute);\n }\n }\n\n public createInstances(count: number): number {\n const handler = this.lastHandler++;\n\n if (this.instancedGeometry.instanceCount + count > this.capacity) {\n this.resizeGeometry(\n Math.ceil((this.capacity + count) / CAPACITY_STEP) * CAPACITY_STEP,\n );\n }\n\n this.handlerToDescriptor.set(handler, {\n firstIndex: this.instancedGeometry.instanceCount,\n count,\n });\n\n this.instancedGeometry.instanceCount += count;\n return handler;\n }\n\n public destroyInstances(handler: number): void {\n const releasedDescriptor = this.handlerToDescriptor.get(handler);\n if (releasedDescriptor === undefined) {\n throw new Error(`No range found for userIndex: ${handler}`);\n }\n\n this.handlerToDescriptor.delete(handler);\n\n const values = Array.from(this.handlerToDescriptor.values());\n const edge = releasedDescriptor.firstIndex + releasedDescriptor.count;\n let replacementDescriptor: Descriptor | undefined;\n\n for (let i = values.length - 1; i > edge; i--) {\n const descriptor = values[i];\n if (descriptor.count === releasedDescriptor.count) {\n replacementDescriptor = descriptor;\n break;\n }\n }\n\n if (replacementDescriptor) {\n this.copyRangeData(replacementDescriptor, releasedDescriptor);\n replacementDescriptor.firstIndex = releasedDescriptor.firstIndex;\n\n this.shiftRangesDown(\n replacementDescriptor.firstIndex + replacementDescriptor.count,\n replacementDescriptor.count,\n );\n } else {\n this.shiftRangesDown(\n releasedDescriptor.firstIndex + releasedDescriptor.count,\n releasedDescriptor.count,\n );\n }\n\n this.instancedGeometry.instanceCount -= releasedDescriptor.count;\n }\n\n public updateProperties(\n handler: number,\n offset: number,\n instancesProperties: Record<string, UIPropertyType>[],\n ): void {\n assertValidNonNegativeNumber(\n offset,\n \"UIGenericInstancedPlane updateProperties offset\",\n );\n\n const descriptor = this.resolveDescriptor(handler);\n\n if (instancesProperties.length + offset > descriptor.count) {\n throw new Error(\n `Too many instances for handler: ${handler}, offset: ${offset}, and count: ${instancesProperties.length}`,\n );\n }\n\n for (let i = 0; i < instancesProperties.length; i++) {\n const instanceProperties = instancesProperties[i];\n const instanceOffset = descriptor.firstIndex + offset + i;\n\n for (const [name, value] of Object.entries(instanceProperties)) {\n if (resolveTypeInfo(value).instantiable) {\n const attribute = this.resolveBufferAttribute(name);\n const itemOffset = instanceOffset * attribute.itemSize;\n udpateProperty(value, attribute, itemOffset);\n } else {\n const uniform = this.resolveUniform(name);\n uniform.value = value;\n this.shaderMaterial.uniformsNeedUpdate = true;\n }\n }\n }\n }\n\n public updateTransforms(\n handler: number,\n offset: number,\n instancesTransforms: Matrix4[],\n ): void {\n assertValidNonNegativeNumber(\n offset,\n \"UIGenericInstancedPlane updateTransforms offset\",\n );\n\n const descriptor = this.resolveDescriptor(handler);\n\n if (instancesTransforms.length + offset > descriptor.count) {\n throw new Error(\n `Too many instances for handler: ${handler}, offset: ${offset}, and count: ${instancesTransforms.length}`,\n );\n }\n\n for (let i = 0; i < instancesTransforms.length; i++) {\n const attribute = this.resolveBufferAttribute(\"instanceTransform\");\n const instanceOffset = descriptor.firstIndex + offset + i;\n\n const array = attribute.array as Float32Array;\n const itemOffset = instanceOffset * attribute.itemSize;\n const elements = instancesTransforms[i].elements;\n for (let j = 0; j < elements.length; j++) {\n array[itemOffset + j] = elements[j];\n }\n attribute.needsUpdate = true;\n }\n }\n\n public updateUVTransforms(\n handler: number,\n offset: number,\n uvTransforms: Matrix3[],\n ): void {\n assertValidNonNegativeNumber(\n offset,\n \"UIGenericInstancedPlane updateUVTransforms offset\",\n );\n\n const descriptor = this.resolveDescriptor(handler);\n\n if (uvTransforms.length + offset > descriptor.count) {\n throw new Error(\n `Too many instances for handler: ${handler}, offset: ${offset}, and count: ${uvTransforms.length}`,\n );\n }\n\n for (let i = 0; i < uvTransforms.length; i++) {\n const attribute = this.resolveBufferAttribute(\"uvTransform\");\n const instanceOffset = descriptor.firstIndex + offset + i;\n\n const array = attribute.array as Float32Array;\n const itemOffset = instanceOffset * attribute.itemSize;\n const elements = uvTransforms[i].elements;\n for (let j = 0; j < elements.length; j++) {\n array[itemOffset + j] = elements[j];\n }\n attribute.needsUpdate = true;\n }\n }\n\n public updateVisibility(\n handler: number,\n offset: number,\n instancesVisibility: boolean[],\n ): void {\n assertValidNonNegativeNumber(\n offset,\n \"UIGenericInstancedPlane updateVisibility offset\",\n );\n\n const descriptor = this.resolveDescriptor(handler);\n\n if (instancesVisibility.length + offset > descriptor.count) {\n throw new Error(\n `Too many instances for handler: ${handler}, offset: ${offset}, and count: ${instancesVisibility.length}`,\n );\n }\n\n for (let i = 0; i < instancesVisibility.length; i++) {\n const attribute = this.resolveBufferAttribute(\"visibility\");\n const instanceOffset = descriptor.firstIndex + offset + i;\n\n const array = attribute.array as Float32Array;\n const itemOffset = instanceOffset * attribute.itemSize;\n array[itemOffset] = instancesVisibility[i] ? 1 : 0;\n attribute.needsUpdate = true;\n }\n }\n\n public destroy(): void {\n this.instancedGeometry.dispose();\n this.shaderMaterial.dispose();\n }\n\n private resolveDescriptor(handler: number): Descriptor {\n const descriptor = this.handlerToDescriptor.get(handler);\n if (descriptor === undefined) {\n throw new Error(`No active range found for handler: ${handler}`);\n }\n return descriptor;\n }\n\n private resolveBufferAttribute(name: string): InstancedBufferAttribute {\n const attribute = this.propertyBuffers.get(`a_${name}`);\n if (attribute === undefined) {\n throw new Error(`No attribute found for property: ${name} (a_${name})`);\n }\n return attribute;\n }\n\n private resolveUniform(name: string): IUniform<unknown> {\n const uniform = this.shaderMaterial.uniforms[`u_${name}`] as\n | IUniform<unknown>\n | undefined;\n\n if (uniform === undefined) {\n throw new Error(`No uniform found for handler: ${name}`);\n }\n return uniform;\n }\n\n private resizeGeometry(newCapacity: number): void {\n for (const [name, oldAttribute] of this.propertyBuffers.entries()) {\n const itemSize = oldAttribute.itemSize;\n const newArray = new Float32Array(newCapacity * itemSize);\n\n newArray.set(oldAttribute.array as Float32Array);\n const newAttribute = new InstancedBufferAttribute(newArray, itemSize);\n\n this.instancedGeometry.setAttribute(`a_${name}`, newAttribute);\n this.propertyBuffers.set(`a_${name}`, newAttribute);\n }\n\n this.capacity = newCapacity;\n }\n\n private copyRangeData(\n sourceRange: Descriptor,\n targetRange: Descriptor,\n ): void {\n for (const attribute of this.propertyBuffers.values()) {\n const array = attribute.array as Float32Array;\n const itemSize = attribute.itemSize;\n\n const sourceStart = sourceRange.firstIndex * itemSize;\n const targetStart = targetRange.firstIndex * itemSize;\n const dataLength = sourceRange.count * itemSize;\n\n for (let i = 0; i < dataLength; i++) {\n array[targetStart + i] = array[sourceStart + i];\n }\n\n attribute.needsUpdate = true;\n }\n }\n\n private shiftRangesDown(startIndex: number, shiftAmount: number): void {\n for (const descriptor of this.handlerToDescriptor.values()) {\n if (descriptor.firstIndex >= startIndex) {\n descriptor.firstIndex -= shiftAmount;\n }\n }\n\n for (const attribute of this.propertyBuffers.values()) {\n const array = attribute.array as Float32Array;\n const itemSize = attribute.itemSize;\n\n const startByteIndex = startIndex * itemSize;\n const endByteIndex = this.instancedGeometry.instanceCount * itemSize;\n const shiftByteAmount = shiftAmount * itemSize;\n\n for (let i = startByteIndex; i < endByteIndex - shiftByteAmount; i++) {\n array[i] = array[i + shiftByteAmount];\n }\n\n attribute.needsUpdate = true;\n }\n }\n}\n","import { assertValidPositiveNumber } from \"./asserts\";\nimport { UIResizePolicy, UIResizePolicyEvent } from \"./UIResizePolicy\";\n\n/**\n * Scales by width in landscape, by height in portrait.\n */\nexport class UIResizePolicyCross extends UIResizePolicy {\n private fixedWidthLandscapeInternal: number;\n private fixedHeightPortraitInternal: number;\n\n constructor(fixedWidthLandscape: number, fixedHeightPortrait: number) {\n super();\n assertValidPositiveNumber(\n fixedWidthLandscape,\n \"UIResizePolicyCross.fixedWidthLandscape\",\n );\n assertValidPositiveNumber(\n fixedHeightPortrait,\n \"UIResizePolicyCross.fixedHeightPortrait\",\n );\n\n this.fixedWidthLandscapeInternal = fixedWidthLandscape;\n this.fixedHeightPortraitInternal = fixedHeightPortrait;\n }\n\n public get fixedWidthLandscape(): number {\n return this.fixedWidthLandscapeInternal;\n }\n public get fixedHeightPortrait(): number {\n return this.fixedHeightPortraitInternal;\n }\n\n public set fixedWidthLandscape(value: number) {\n assertValidPositiveNumber(value, \"UIResizePolicyCross.fixedWidthLandscape\");\n if (value !== this.fixedWidthLandscapeInternal) {\n this.fixedWidthLandscapeInternal = value;\n this.emit(UIResizePolicyEvent.CHANGE);\n }\n }\n\n public set fixedHeightPortrait(value: number) {\n assertValidPositiveNumber(value, \"UIResizePolicyCross.fixedHeightPortrait\");\n if (value !== this.fixedHeightPortraitInternal) {\n this.fixedHeightPortraitInternal = value;\n this.emit(UIResizePolicyEvent.CHANGE);\n }\n }\n\n public calculateScaleInternal(width: number, height: number): number {\n return width > height\n ? this.fixedWidthLandscapeInternal / width\n : this.fixedHeightPortraitInternal / height;\n }\n}\n","import { assertValidPositiveNumber } from \"./asserts\";\nimport { UIResizePolicy, UIResizePolicyEvent } from \"./UIResizePolicy\";\n\n/**\n * Scales by height in landscape, by width in portrait.\n */\nexport class UIResizePolicyCrossInverted extends UIResizePolicy {\n private fixedHeightLandscapeInternal: number;\n private fixedWidthPortraitInternal: number;\n\n constructor(fixedHeightLandscape: number, fixedWidthPortrait: number) {\n super();\n assertValidPositiveNumber(\n fixedHeightLandscape,\n \"UIResizePolicyCrossInverted.fixedHeightLandscape\",\n );\n assertValidPositiveNumber(\n fixedWidthPortrait,\n \"UIResizePolicyCrossInverted.fixedWidthPortrait\",\n );\n\n this.fixedHeightLandscapeInternal = fixedHeightLandscape;\n this.fixedWidthPortraitInternal = fixedWidthPortrait;\n }\n\n public get fixedHeightLandscape(): number {\n return this.fixedHeightLandscapeInternal;\n }\n public get fixedWidthPortrait(): number {\n return this.fixedWidthPortraitInternal;\n }\n\n public set fixedHeightLandscape(value: number) {\n assertValidPositiveNumber(\n value,\n \"UIResizePolicyCrossInverted.fixedHeightLandscape\",\n );\n if (value !== this.fixedHeightLandscapeInternal) {\n this.fixedHeightLandscapeInternal = value;\n this.emit(UIResizePolicyEvent.CHANGE);\n }\n }\n\n public set fixedWidthPortrait(value: number) {\n assertValidPositiveNumber(\n value,\n \"UIResizePolicyCrossInverted.fixedWidthPortrait\",\n );\n if (value !== this.fixedWidthPortraitInternal) {\n this.fixedWidthPortraitInternal = value;\n this.emit(UIResizePolicyEvent.CHANGE);\n }\n }\n\n protected calculateScaleInternal(width: number, height: number): number {\n return width > height\n ? this.fixedHeightLandscapeInternal / height\n : this.fixedWidthPortraitInternal / width;\n }\n}\n","import { assertValidPositiveNumber } from \"./asserts\";\nimport { UIResizePolicy, UIResizePolicyEvent } from \"./UIResizePolicy\";\n\n/**\n * Maintains fixed height, scales based on window height.\n *\n * Uses different heights for landscape vs portrait orientation,\n * and optionally for near-square aspect ratios.\n */\nexport class UIResizePolicyFixedHeight extends UIResizePolicy {\n private fixedHeightLandscapeInternal: number;\n private fixedHeightPortraitInternal: number;\n private fixedHeightSquareInternal: number;\n private squareEpsilonInternal: number;\n\n constructor(\n fixedHeightLandscape: number,\n fixedHeightPortrait: number,\n fixedHeightSquare: number = fixedHeightPortrait,\n squareEpsilon = 0.1,\n ) {\n super();\n assertValidPositiveNumber(\n fixedHeightLandscape,\n \"UIResizePolicyFixedHeight.fixedHeightLandscape\",\n );\n assertValidPositiveNumber(\n fixedHeightPortrait,\n \"UIResizePolicyFixedHeight.fixedHeightPortrait\",\n );\n assertValidPositiveNumber(\n fixedHeightSquare,\n \"UIResizePolicyFixedHeight.fixedHeightSquare\",\n );\n assertValidPositiveNumber(squareEpsilon, \"UIResizePolicy.squareEpsilon\");\n\n this.fixedHeightLandscapeInternal = fixedHeightLandscape;\n this.fixedHeightPortraitInternal = fixedHeightPortrait;\n this.fixedHeightSquareInternal = fixedHeightSquare;\n this.squareEpsilonInternal = squareEpsilon;\n }\n\n public get fixedHeightLandscape(): number {\n return this.fixedHeightLandscapeInternal;\n }\n public get fixedHeightPortrait(): number {\n return this.fixedHeightPortraitInternal;\n }\n public get fixedHeightSquare(): number {\n return this.fixedHeightSquareInternal;\n }\n public get squareEpsilon(): number {\n return this.squareEpsilonInternal;\n }\n\n public set fixedHeightLandscape(value: number) {\n assertValidPositiveNumber(\n value,\n \"UIResizePolicyFixedHeight.fixedHeightLandscape\",\n );\n if (value !== this.fixedHeightLandscapeInternal) {\n this.fixedHeightLandscapeInternal = value;\n this.emit(UIResizePolicyEvent.CHANGE);\n }\n }\n\n public set fixedHeightPortrait(value: number) {\n assertValidPositiveNumber(\n value,\n \"UIResizePolicyFixedHeight.fixedHeightPortrait\",\n );\n if (value !== this.fixedHeightPortraitInternal) {\n this.fixedHeightPortraitInternal = value;\n this.emit(UIResizePolicyEvent.CHANGE);\n }\n }\n\n public set fixedHeightSquare(value: number) {\n assertValidPositiveNumber(\n value,\n \"UIResizePolicyFixedHeight.fixedHeightSquare\",\n );\n if (value !== this.fixedHeightSquareInternal) {\n this.fixedHeightSquareInternal = value;\n this.emit(UIResizePolicyEvent.CHANGE);\n }\n }\n\n public set squareEpsilon(value: number) {\n assertValidPositiveNumber(value, \"UIResizePolicy.squareEpsilon\");\n if (value !== this.squareEpsilonInternal) {\n this.squareEpsilonInternal = value;\n this.emit(UIResizePolicyEvent.CHANGE);\n }\n }\n\n protected calculateScaleInternal(width: number, height: number): number {\n if (this.isSquare(width, height)) {\n return this.fixedHeightSquareInternal / height;\n }\n return width > height\n ? this.fixedHeightLandscapeInternal / height\n : this.fixedHeightPortraitInternal / height;\n }\n\n private isSquare(width: number, height: number): boolean {\n const ratio = width / height;\n return Math.abs(ratio - 1) <= this.squareEpsilonInternal;\n }\n}\n","import { assertValidPositiveNumber } from \"./asserts\";\nimport { UIResizePolicy, UIResizePolicyEvent } from \"./UIResizePolicy\";\n\n/**\n * Maintains fixed width, scales based on window width.\n *\n * Uses different widths for landscape vs portrait orientation, and optionally\n * a third width for near-square aspect ratios.\n */\nexport class UIResizePolicyFixedWidth extends UIResizePolicy {\n private fixedWidthLandscapeInternal: number;\n private fixedWidthPortraitInternal: number;\n private fixedWidthSquareInternal: number;\n private squareEpsilonInternal: number;\n\n constructor(\n fixedWidthLandscape: number,\n fixedWidthPortrait: number,\n fixedWidthSquare: number = fixedWidthPortrait,\n squareEpsilon = 0.1,\n ) {\n super();\n assertValidPositiveNumber(\n fixedWidthLandscape,\n \"UIResizePolicyFixedWidth.fixedWidthLandscape\",\n );\n assertValidPositiveNumber(\n fixedWidthPortrait,\n \"UIResizePolicyFixedWidth.fixedWidthPortrait\",\n );\n assertValidPositiveNumber(\n fixedWidthSquare,\n \"UIResizePolicyFixedWidth.fixedWidthSquare\",\n );\n assertValidPositiveNumber(squareEpsilon, \"UIResizePolicy.squareEpsilon\");\n\n this.fixedWidthLandscapeInternal = fixedWidthLandscape;\n this.fixedWidthPortraitInternal = fixedWidthPortrait;\n this.fixedWidthSquareInternal = fixedWidthSquare;\n this.squareEpsilonInternal = squareEpsilon;\n }\n\n public get fixedWidthLandscape(): number {\n return this.fixedWidthLandscapeInternal;\n }\n public get fixedWidthPortrait(): number {\n return this.fixedWidthPortraitInternal;\n }\n public get fixedWidthSquare(): number {\n return this.fixedWidthSquareInternal;\n }\n public get squareEpsilon(): number {\n return this.squareEpsilonInternal;\n }\n\n public set fixedWidthLandscape(value: number) {\n assertValidPositiveNumber(\n value,\n \"UIResizePolicyFixedWidth.fixedWidthLandscape\",\n );\n if (value !== this.fixedWidthLandscapeInternal) {\n this.fixedWidthLandscapeInternal = value;\n this.emit(UIResizePolicyEvent.CHANGE);\n }\n }\n\n public set fixedWidthPortrait(value: number) {\n assertValidPositiveNumber(\n value,\n \"UIResizePolicyFixedWidth.fixedWidthPortrait\",\n );\n if (value !== this.fixedWidthPortraitInternal) {\n this.fixedWidthPortraitInternal = value;\n this.emit(UIResizePolicyEvent.CHANGE);\n }\n }\n\n public set fixedWidthSquare(value: number) {\n assertValidPositiveNumber(\n value,\n \"UIResizePolicyFixedWidth.fixedWidthSquare\",\n );\n if (value !== this.fixedWidthSquareInternal) {\n this.fixedWidthSquareInternal = value;\n this.emit(UIResizePolicyEvent.CHANGE);\n }\n }\n\n public set squareEpsilon(value: number) {\n assertValidPositiveNumber(value, \"UIResizePolicy.squareEpsilon\");\n if (value !== this.squareEpsilonInternal) {\n this.squareEpsilonInternal = value;\n this.emit(UIResizePolicyEvent.CHANGE);\n }\n }\n\n protected calculateScaleInternal(width: number, height: number): number {\n if (this.isSquare(width, height)) {\n return this.fixedWidthSquareInternal / width;\n }\n return width > height\n ? this.fixedWidthLandscapeInternal / width\n : this.fixedWidthPortraitInternal / width;\n }\n\n /**\n * Determines if viewport aspect ratio is close to 1:1.\n */\n private isSquare(width: number, height: number): boolean {\n const ratio = width / height;\n return Math.abs(ratio - 1) <= this.squareEpsilonInternal;\n }\n}\n","import { isUITextStyle, type UITextStyle } from \"./UITextStyle\";\n\nexport interface UITextSpan {\n text: string;\n style?: Partial<UITextStyle>;\n}\n\nexport function isUITextSpan(obj?: unknown): obj is UITextSpan {\n return (\n obj !== null &&\n typeof obj === \"object\" &&\n \"text\" in obj &&\n typeof obj.text === \"string\" &&\n (!(\"style\" in obj) || isUITextStyle(obj.style))\n );\n}\n"],"names":["Eventail","DEFAULT_ANCHOR","source"],"mappings":";;AAAA;;;;;;;;;;;;AAYG;MACU,YAAY,CAAA;AAMvB;;;;;AAKG;AACH,IAAA,WAAA,CAAY,QAAQ,GAAG,CAAC,EAAE,KAA0B,EAAA;AAClD,QAAA,IAAI,CAAC,QAAQ,GAAG,QAAQ;AACxB,QAAA,IAAI,kBAAS,KAAK,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,IAAI,GAAG,EAAE;IACjD;AAEA;;;;;;;;;AASG;AACI,IAAA,OAAO,IAAI,CAAC,CAAe,EAAE,CAAe,EAAA;QACjD,MAAM,MAAM,GAAG,IAAI,YAAY,CAC7B,CAAC,CAAC,QAAQ,GAA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AC5C,QAAA,MAAM,KAAK,GAAG,KAAK,GAAG,MAAM;QAC5B,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,IAAI,IAAI,CAAA,8BAAsB;IAC1D;AACD;;ACzGK,SAAU,YAAY,CAAC,GAAa,EAAA;IACxC,QACE,GAAG,KAAK,IAAI;QACZ,OAAO,GAAG,KAAK,QAAQ;AACvB,QAAA,MAAM,IAAI,GAAG;AACb,QAAA,OAAO,GAAG,CAAC,IAAI,KAAK,QAAQ;AAC5B,SAAC,EAAE,OAAO,IAAI,GAAG,CAAC,IAAI,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AAEnD;;;;","x_google_ignoreList":[1,4,5,6,7,8,9]}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../node_modules/eventail/dist/index.min.js","../src/miscellaneous/UIMode.ts","../src/miscellaneous/UIOrientation.ts","../node_modules/@lume/kiwi/dist/maptype.js","../node_modules/@lume/kiwi/dist/variable.js","../node_modules/@lume/kiwi/dist/expression.js","../node_modules/@lume/kiwi/dist/strength.js","../node_modules/@lume/kiwi/dist/constraint.js","../node_modules/@lume/kiwi/dist/solver.js","../src/miscellaneous/UIPriority.ts","../src/wrappers/UIInputWrapper.ts","../src/miscellaneous/UITransparencyMode.ts","../node_modules/three/src/math/ColorManagement.js","../src/miscellaneous/color/UIColor.Internal.ts","../src/miscellaneous/color/UIColor.ts","../src/miscellaneous/generic-plane/shared.ts","../src/miscellaneous/generic-plane/UIGenericInstancedPlane.Internal.ts","../src/miscellaneous/generic-plane/UIGenericInstancedPlane.ts","../src/miscellaneous/generic-plane/UIGenericPlane.Internal.ts","../src/miscellaneous/generic-plane/UIGenericPlane.ts","../src/miscellaneous/generic-plane/UIGenericPlaneRegistry.ts","../src/wrappers/UISceneWrapper.ts","../src/miscellaneous/UIExpression.ts","../src/miscellaneous/UIRelation.ts","../src/wrappers/UISolverWrapper.ts","../src/layers/UILayer.Internal.ts","../src/layers/UILayer.ts","../src/miscellaneous/asserts.ts","../src/constraints/UIConstraint.ts","../src/constraints/UISingleParameterConstraint.ts","../src/constraints/UIHeightConstraint.ts","../src/constraints/UIHorizontalDistanceConstraint.Internal.ts","../src/constraints/UIHorizontalDistanceConstraint.ts","../src/constraints/UIHorizontalProportionConstraint.ts","../src/constraints/UIVerticalDistanceConstraint.Internal.ts","../src/constraints/UIVerticalDistanceConstraint.ts","../src/constraints/UIVerticalProportionConstraint.ts","../src/constraints/UIWidthConstraint.ts","../src/constraints/builders/UIConstraint2DBuilder.ts","../src/constraints/UIAspectConstraint.ts","../src/constraints/builders/UICoverConstraintBuilder.Internal.ts","../src/constraints/builders/UICoverConstraintBuilder.ts","../src/constraints/builders/UIFitConstraintBuilder.Internal.ts","../src/constraints/builders/UIFitConstraintBuilder.ts","../src/constraints/UICustomConstraint.ts","../src/elements/UIAnchor.Internal.ts","../src/elements/UIAnchor.ts","../src/miscellaneous/micro/UIMicro.Internal.ts","../src/miscellaneous/computeTransform.ts","../src/miscellaneous/texture/UITextureView.Internal.ts","../src/miscellaneous/texture/UITextureView.ts","../src/elements/UIAnimatedImage.Internal.ts","../src/miscellaneous/micro/UIMicro.ts","../src/miscellaneous/area/UIArea.ts","../src/miscellaneous/area/UIAreaRectangle.ts","../src/miscellaneous/UIInputEvent.ts","../src/elements/UIDummy.Internal.ts","../src/elements/UIDummy.ts","../src/elements/UIElement.Internal.ts","../src/elements/UIElement.ts","../src/elements/UIAnimatedImage.ts","../src/elements/UIGraphics.ts","../src/elements/UIImage.ts","../src/miscellaneous/padding/UIPadding.Internal.ts","../src/miscellaneous/padding/UIPadding.ts","../src/elements/UINineSlice.Internal.ts","../src/elements/UINineSlice.ts","../src/miscellaneous/mask-function/UIProgressMaskFunction.ts","../src/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.ts","../src/elements/UIProgress.Internal.ts","../src/elements/UIProgress.ts","../src/elements/UIScene.Internal.ts","../src/elements/UIScene.ts","../src/miscellaneous/text-style/UITextStyle.Internal.ts","../src/miscellaneous/text-style/UITextStyle.ts","../src/miscellaneous/text-span/UITextSpan.ts","../src/elements/UIText/UIText.Internal.ts","../src/elements/UIText/UIText.Measuring.ts","../src/elements/UIText/UIText.Rendering.ts","../src/elements/UIText/UIText.ts","../src/miscellaneous/resize-policy/UIResizePolicy.ts","../src/miscellaneous/resize-policy/UIResizePolicyNone.ts","../src/layers/UIFullscreenLayer.ts","../src/miscellaneous/area/UIAreaCircle.ts","../src/miscellaneous/area/UIAreaPolygon.ts","../src/miscellaneous/area/UIAreaRoundedRectangle.ts","../src/miscellaneous/mask-function/UIProgressMaskFunctionCircular.ts","../src/miscellaneous/resize-policy/UIResizePolicyCross.ts","../src/miscellaneous/resize-policy/UIResizePolicyCrossInverted.ts","../src/miscellaneous/resize-policy/UIResizePolicyFixedHeight.ts","../src/miscellaneous/resize-policy/UIResizePolicyFixedWidth.ts"],"sourcesContent":["class t{constructor(t,i,r=0){this.t=new WeakMap,this.i=new Map,void 0!==t&&(void 0===i?this.i.set(t,r):this.t.set(i,new Map([[t,r]])))}insert(t,i,r=0){if(void 0===i){if(this.i.has(t))return;return void this.i.set(t,r)}const s=this.t.get(i);void 0===s?this.t.set(i,new Map([[t,r]])):s.has(t)||s.set(t,r)}remove(t,i){if(void 0===i)return void this.i.delete(t);const r=this.t.get(i);void 0!==r&&(r.delete(t),0===r.size&&this.t.delete(i))}has(t,i){if(void 0===i)return this.i.has(t);const r=this.t.get(i);return void 0!==r&&r.has(t)}getPriority(t,i){if(void 0===i)return this.i.get(t);const r=this.t.get(i);return void 0!==r?r.get(t):void 0}}class i{constructor(){this.o=new Map}on(t,i,r,s=0){return this.h(t,!1,s,i,r),this}once(t,i,r,s=0){return this.h(t,!0,s,i,r),this}off(t,i,r){const s=this.o.get(t);if(void 0===s)return this;s.u&&(s.u=!1,s.v=s.v.slice());const o=s.v;if(0===o.length)return this.o.delete(t),this;if(void 0===i){this.o.delete(t);for(let t=0;t<o.length;t++){const i=o[t];s.l.remove(i._,i.p)}return this}{const e=o.length;if(o[0]._===i&&o[0].p===r)return 1===e?this.o.delete(t):o.shift(),this;const n=e-1;if(o[n]._===i&&o[n].p===r)return o.pop(),this;if(e<10||o[0].M===o[n].M)for(let t=1;t<n;t++){const s=o[t];if(s._===i&&s.p===r)return o.splice(t,1),this}else{const t=s.l.getPriority(i,r);if(void 0===t)return this;let e=0,n=o.length-1;for(;e<=n;){const i=e+n>>>1;o[i].M<t?e=i+1:n=i-1}const c=e;for(n=o.length-1;e<=n;){const i=e+n>>>1;o[i].M<=t?e=i+1:n=i-1}const h=n;for(let t=c;t<=h;t++)if(o[t]._===i&&o[t].p===r)return o.splice(t,1),this}}return this}emit(t,...i){const r=this.o.get(t);if(void 0===r)return!1;if(0===r.v.length)return!1;r.u?r.v=r.v.slice():r.u=!0;const s=r.v;let o=!1;for(let t=0;t<s.length;t++){const r=s[t];r._.apply(r.p,i),r.k&&(o=!0,r.m=!0)}const e=this.o.get(t);if(void 0===e)return!0;e.v===s&&(e.u=!1);const n=e.v;if(o){let i=0;for(let t=0;t<n.length;t++){const r=n[t];r.m?e.l.remove(r._,r.p):n[i++]=r}0===i?this.o.delete(t):n.length=i}return!0}h(i,r,s,o,e){let n=this.o.get(i);if(void 0===n)return void this.o.set(i,{v:[{_:o,p:e,M:s,k:r,m:!1}],u:!1,l:new t(o,e,s)});if(n.l.has(o,e))throw Error(\"Event listener already exists\");n.l.insert(o,e,s);const c={_:o,p:e,M:s,k:r,m:!1};n.u&&(n.u=!1,n.v=n.v.slice());{const t=n.v,i=c.M;if(0===t.length||t[t.length-1].M<=i)return void t.push(c);if(t[0].M>=i)return void t.unshift(c);{let r=0,s=t.length;for(;r<s;){const o=r+s>>>1;t[o].M<i?r=o+1:s=o}t.splice(r,0,c)}}}}export{i as Eventail};\n//# sourceMappingURL=index.min.js.map\n","/** Visibility and interactivity state */\nexport enum UIMode {\n /** Not rendered, no input */\n HIDDEN = 0,\n /** Rendered, no input */\n VISIBLE = 1,\n /** Rendered, receives input, blocks input to elements behind */\n INTERACTIVE = 2,\n /** Rendered, receives input, passes input to elements behind */\n INTERACTIVE_TRANSPARENT = 3,\n}\n\n/**\n * Checks if mode allows input events.\n * @param mode Mode to check\n * @returns True if interactive\n */\nexport function isUIModeInteractive(mode: UIMode): boolean {\n return mode === UIMode.INTERACTIVE || mode === UIMode.INTERACTIVE_TRANSPARENT;\n}\n\n/**\n * Checks if mode is rendered.\n * @param mode Mode to check\n * @returns True if visible\n */\nexport function isUIModeVisible(mode: UIMode): boolean {\n return mode !== UIMode.HIDDEN;\n}\n","/** Screen orientation for conditional constraints */\nexport enum UIOrientation {\n /** Landscape (width > height) */\n HORIZONTAL = 0,\n /** Portrait (height > width) */\n VERTICAL = 1,\n /** Active in any orientation */\n ALWAYS = 2,\n}\n\n/**\n * Resolves optional orientation.\n * @param orientation Orientation to resolve\n * @returns Orientation or ALWAYS if undefined\n */\nexport function resolveOrientation(orientation?: UIOrientation): UIOrientation {\n return orientation ?? UIOrientation.ALWAYS;\n}\n","export function createMap() {\n return new IndexedMap();\n}\nclass IndexedMap {\n index = {};\n array = [];\n /**\n * Returns the number of items in the array.\n */\n size() {\n return this.array.length;\n }\n /**\n * Returns true if the array is empty.\n */\n empty() {\n return this.array.length === 0;\n }\n /**\n * Returns the item at the given array index.\n *\n * @param index The integer index of the desired item.\n */\n itemAt(index) {\n return this.array[index];\n }\n /**\n * Returns true if the key is in the array, false otherwise.\n *\n * @param key The key to locate in the array.\n */\n contains(key) {\n return this.index[key.id()] !== undefined;\n }\n /**\n * Returns the pair associated with the given key, or undefined.\n *\n * @param key The key to locate in the array.\n */\n find(key) {\n const i = this.index[key.id()];\n return i === undefined ? undefined : this.array[i];\n }\n /**\n * Returns the pair associated with the key if it exists.\n *\n * If the key does not exist, a new pair will be created and\n * inserted using the value created by the given factory.\n *\n * @param key The key to locate in the array.\n * @param factory The function which creates the default value.\n */\n setDefault(key, factory) {\n const i = this.index[key.id()];\n if (i === undefined) {\n const pair = new Pair(key, factory());\n this.index[key.id()] = this.array.length;\n this.array.push(pair);\n return pair;\n }\n else {\n return this.array[i];\n }\n }\n /**\n * Insert the pair into the array and return the pair.\n *\n * This will overwrite any existing entry in the array.\n *\n * @param key The key portion of the pair.\n * @param value The value portion of the pair.\n */\n insert(key, value) {\n const pair = new Pair(key, value);\n const i = this.index[key.id()];\n if (i === undefined) {\n this.index[key.id()] = this.array.length;\n this.array.push(pair);\n }\n else {\n this.array[i] = pair;\n }\n return pair;\n }\n /**\n * Removes and returns the pair for the given key, or undefined.\n *\n * @param key The key to remove from the map.\n */\n erase(key) {\n const i = this.index[key.id()];\n if (i === undefined) {\n return undefined;\n }\n this.index[key.id()] = undefined;\n const pair = this.array[i];\n const last = this.array.pop();\n if (pair !== last) {\n this.array[i] = last;\n this.index[last.first.id()] = i;\n }\n return pair;\n }\n /**\n * Create a copy of this associative array.\n */\n copy() {\n const copy = new IndexedMap();\n for (let i = 0; i < this.array.length; i++) {\n const pair = this.array[i].copy();\n copy.array[i] = pair;\n copy.index[pair.first.id()] = i;\n }\n return copy;\n }\n}\n/**\n * A class which defines a generic pair object.\n * @private\n */\n// tslint:disable: max-classes-per-file\nclass Pair {\n first;\n second;\n /**\n * Construct a new Pair object.\n *\n * @param first The first item of the pair.\n * @param second The second item of the pair.\n */\n constructor(first, second) {\n this.first = first;\n this.second = second;\n }\n /**\n * Create a copy of the pair.\n */\n copy() {\n return new Pair(this.first, this.second);\n }\n}\n","import { Expression } from './expression.js';\n/**\n * The primary user constraint variable.\n *\n * @class\n * @param {String} [name=\"\"] The name to associated with the variable.\n */\nexport class Variable {\n constructor(name = '') {\n this._name = name;\n }\n /**\n * Returns the unique id number of the variable.\n * @private\n */\n id() {\n return this._id;\n }\n /**\n * Returns the name of the variable.\n *\n * @return {String} name of the variable\n */\n name() {\n return this._name;\n }\n /**\n * Set the name of the variable.\n *\n * @param {String} name Name of the variable\n */\n setName(name) {\n this._name = name;\n }\n /**\n * Returns the user context object of the variable.\n * @private\n */\n context() {\n return this._context;\n }\n /**\n * Set the user context object of the variable.\n * @private\n */\n setContext(context) {\n this._context = context;\n }\n /**\n * Returns the value of the variable.\n *\n * @return {Number} Calculated value\n */\n value() {\n return this._value;\n }\n /**\n * Set the value of the variable.\n * @private\n */\n setValue(value) {\n this._value = value;\n }\n /**\n * Creates a new Expression by adding a number, variable or expression\n * to the variable.\n *\n * @param {Number|Variable|Expression} value Value to add.\n * @return {Expression} expression\n */\n plus(value) {\n return new Expression(this, value);\n }\n /**\n * Creates a new Expression by substracting a number, variable or expression\n * from the variable.\n *\n * @param {Number|Variable|Expression} value Value to substract.\n * @return {Expression} expression\n */\n minus(value) {\n return new Expression(this, typeof value === 'number' ? -value : [-1, value]);\n }\n /**\n * Creates a new Expression by multiplying with a fixed number.\n *\n * @param {Number} coefficient Coefficient to multiply with.\n * @return {Expression} expression\n */\n multiply(coefficient) {\n return new Expression([coefficient, this]);\n }\n /**\n * Creates a new Expression by dividing with a fixed number.\n *\n * @param {Number} coefficient Coefficient to divide by.\n * @return {Expression} expression\n */\n divide(coefficient) {\n return new Expression([1 / coefficient, this]);\n }\n /**\n * Returns the JSON representation of the variable.\n * @private\n */\n toJSON() {\n return {\n name: this._name,\n value: this._value,\n };\n }\n toString() {\n return this._context + '[' + this._name + ':' + this._value + ']';\n }\n _name;\n _value = 0.0;\n _context = null;\n _id = VarId++;\n}\n/**\n * The internal variable id counter.\n * @private\n */\nlet VarId = 0;\n","import { createMap } from './maptype.js';\nimport { Variable } from './variable.js';\n/**\n * An expression of variable terms and a constant.\n *\n * The constructor accepts an arbitrary number of parameters,\n * each of which must be one of the following types:\n * - number\n * - Variable\n * - Expression\n * - 2-tuple of [number, Variable|Expression]\n *\n * The parameters are summed. The tuples are multiplied.\n *\n * @class\n * @param {...(number|Variable|Expression|Array)} args\n */\nexport class Expression {\n constructor() {\n let parsed = parseArgs(arguments);\n this._terms = parsed.terms;\n this._constant = parsed.constant;\n }\n /**\n * Returns the mapping of terms in the expression.\n *\n * This *must* be treated as const.\n * @private\n */\n terms() {\n return this._terms;\n }\n /**\n * Returns the constant of the expression.\n * @private\n */\n constant() {\n return this._constant;\n }\n /**\n * Returns the computed value of the expression.\n *\n * @private\n * @return {Number} computed value of the expression\n */\n value() {\n let result = this._constant;\n for (let i = 0, n = this._terms.size(); i < n; i++) {\n let pair = this._terms.itemAt(i);\n result += pair.first.value() * pair.second;\n }\n return result;\n }\n /**\n * Creates a new Expression by adding a number, variable or expression\n * to the expression.\n *\n * @param {Number|Variable|Expression} value Value to add.\n * @return {Expression} expression\n */\n plus(value) {\n return new Expression(this, value);\n }\n /**\n * Creates a new Expression by substracting a number, variable or expression\n * from the expression.\n *\n * @param {Number|Variable|Expression} value Value to substract.\n * @return {Expression} expression\n */\n minus(value) {\n return new Expression(this, typeof value === 'number' ? -value : [-1, value]);\n }\n /**\n * Creates a new Expression by multiplying with a fixed number.\n *\n * @param {Number} coefficient Coefficient to multiply with.\n * @return {Expression} expression\n */\n multiply(coefficient) {\n return new Expression([coefficient, this]);\n }\n /**\n * Creates a new Expression by dividing with a fixed number.\n *\n * @param {Number} coefficient Coefficient to divide by.\n * @return {Expression} expression\n */\n divide(coefficient) {\n return new Expression([1 / coefficient, this]);\n }\n isConstant() {\n return this._terms.size() == 0;\n }\n toString() {\n let result = this._terms.array\n .map(function (pair) {\n return pair.second + '*' + pair.first.toString();\n })\n .join(' + ');\n if (!this.isConstant() && this._constant !== 0) {\n result += ' + ';\n }\n result += this._constant;\n return result;\n }\n _terms;\n _constant;\n}\n/**\n * An internal argument parsing function.\n * @private\n */\nfunction parseArgs(args) {\n let constant = 0.0;\n let factory = () => 0.0;\n let terms = createMap();\n for (let i = 0, n = args.length; i < n; ++i) {\n let item = args[i];\n if (typeof item === 'number') {\n constant += item;\n }\n else if (item instanceof Variable) {\n terms.setDefault(item, factory).second += 1.0;\n }\n else if (item instanceof Expression) {\n constant += item.constant();\n let terms2 = item.terms();\n for (let j = 0, k = terms2.size(); j < k; j++) {\n let termPair = terms2.itemAt(j);\n terms.setDefault(termPair.first, factory).second += termPair.second;\n }\n }\n else if (item instanceof Array) {\n if (item.length !== 2) {\n throw new Error('array must have length 2');\n }\n let value = item[0];\n let value2 = item[1];\n if (typeof value !== 'number') {\n throw new Error('array item 0 must be a number');\n }\n if (value2 instanceof Variable) {\n terms.setDefault(value2, factory).second += value;\n }\n else if (value2 instanceof Expression) {\n constant += value2.constant() * value;\n let terms2 = value2.terms();\n for (let j = 0, k = terms2.size(); j < k; j++) {\n let termPair = terms2.itemAt(j);\n terms.setDefault(termPair.first, factory).second += termPair.second * value;\n }\n }\n else {\n throw new Error('array item 1 must be a variable or expression');\n }\n }\n else {\n throw new Error('invalid Expression argument: ' + item);\n }\n }\n return { terms, constant };\n}\n","/**\n * @class Strength\n */\nexport class Strength {\n /**\n * Create a new symbolic strength.\n *\n * @param a strong\n * @param b medium\n * @param c weak\n * @param [w] weight\n * @return strength\n */\n static create(a, b, c, w = 1.0) {\n let result = 0.0;\n result += Math.max(0.0, Math.min(1000.0, a * w)) * 1000000.0;\n result += Math.max(0.0, Math.min(1000.0, b * w)) * 1000.0;\n result += Math.max(0.0, Math.min(1000.0, c * w));\n return result;\n }\n /**\n * The 'required' symbolic strength.\n */\n static required = Strength.create(1000.0, 1000.0, 1000.0);\n /**\n * The 'strong' symbolic strength.\n */\n static strong = Strength.create(1.0, 0.0, 0.0);\n /**\n * The 'medium' symbolic strength.\n */\n static medium = Strength.create(0.0, 1.0, 0.0);\n /**\n * The 'weak' symbolic strength.\n */\n static weak = Strength.create(0.0, 0.0, 1.0);\n /**\n * Clip a symbolic strength to the allowed min and max.\n * @private\n */\n static clip(value) {\n return Math.max(0.0, Math.min(Strength.required, value));\n }\n}\n","import { Expression } from './expression.js';\nimport { Strength } from './strength.js';\n/**\n * An enum defining the linear constraint operators.\n *\n * |Value|Operator|Description|\n * |----|-----|-----|\n * |`Le`|<=|Less than equal|\n * |`Ge`|>=|Greater than equal|\n * |`Eq`|==|Equal|\n *\n * @enum {Number}\n */\nexport var Operator;\n(function (Operator) {\n Operator[Operator[\"Le\"] = 0] = \"Le\";\n Operator[Operator[\"Ge\"] = 1] = \"Ge\";\n Operator[Operator[\"Eq\"] = 2] = \"Eq\";\n})(Operator || (Operator = {}));\n/**\n * A linear constraint equation.\n *\n * A constraint equation is composed of an expression, an operator,\n * and a strength. The RHS of the equation is implicitly zero.\n *\n * @class\n * @param {Expression} expression The constraint expression (LHS).\n * @param {Operator} operator The equation operator.\n * @param {Expression} [rhs] Right hand side of the expression.\n * @param {Number} [strength=Strength.required] The strength of the constraint.\n */\nexport class Constraint {\n constructor(expression, operator, rhs, strength = Strength.required) {\n this._operator = operator;\n this._strength = Strength.clip(strength);\n if (rhs === undefined && expression instanceof Expression) {\n this._expression = expression;\n }\n else {\n this._expression = expression.minus(rhs);\n }\n }\n /**\n * Returns the unique id number of the constraint.\n * @private\n */\n id() {\n return this._id;\n }\n /**\n * Returns the expression of the constraint.\n *\n * @return {Expression} expression\n */\n expression() {\n return this._expression;\n }\n /**\n * Returns the relational operator of the constraint.\n *\n * @return {Operator} linear constraint operator\n */\n op() {\n return this._operator;\n }\n /**\n * Returns the strength of the constraint.\n *\n * @return {Number} strength\n */\n strength() {\n return this._strength;\n }\n toString() {\n return (this._expression.toString() + ' ' + ['<=', '>=', '='][this._operator] + ' 0 (' + this._strength.toString() + ')');\n }\n _expression;\n _operator;\n _strength;\n _id = CnId++;\n}\n/**\n * The internal constraint id counter.\n * @private\n */\nlet CnId = 0;\n","import { Constraint, Operator } from './constraint.js';\nimport { Expression } from './expression.js';\nimport { createMap } from './maptype.js';\nimport { Strength } from './strength.js';\n/**\n * The constraint solver class.\n *\n * @class\n */\nexport class Solver {\n /**\n * @type {number} - The max number of solver iterations before an error\n * is thrown, in order to prevent infinite iteration. Default: `10,000`.\n */\n maxIterations = 1000;\n /**\n * Construct a new Solver.\n */\n constructor() { }\n /**\n * Creates and add a constraint to the solver.\n *\n * @param {Expression|Variable} lhs Left hand side of the expression\n * @param {Operator} operator Operator\n * @param {Expression|Variable|Number} rhs Right hand side of the expression\n * @param {Number} [strength=Strength.required] Strength\n */\n createConstraint(lhs, operator, rhs, strength = Strength.required) {\n let cn = new Constraint(lhs, operator, rhs, strength);\n this.addConstraint(cn);\n return cn;\n }\n /**\n * Add a constraint to the solver.\n *\n * @param {Constraint} constraint Constraint to add to the solver\n */\n addConstraint(constraint) {\n let cnPair = this._cnMap.find(constraint);\n if (cnPair !== undefined) {\n throw new Error('duplicate constraint');\n }\n // Creating a row causes symbols to be reserved for the variables\n // in the constraint. If this method exits with an exception,\n // then its possible those variables will linger in the var map.\n // Since its likely that those variables will be used in other\n // constraints and since exceptional conditions are uncommon,\n // i'm not too worried about aggressive cleanup of the var map.\n let data = this._createRow(constraint);\n let row = data.row;\n let tag = data.tag;\n let subject = this._chooseSubject(row, tag);\n // If chooseSubject couldnt find a valid entering symbol, one\n // last option is available if the entire row is composed of\n // dummy variables. If the constant of the row is zero, then\n // this represents redundant constraints and the new dummy\n // marker can enter the basis. If the constant is non-zero,\n // then it represents an unsatisfiable constraint.\n if (subject.type() === SymbolType.Invalid && row.allDummies()) {\n if (!nearZero(row.constant())) {\n throw new Error('unsatisfiable constraint');\n }\n else {\n subject = tag.marker;\n }\n }\n // If an entering symbol still isn't found, then the row must\n // be added using an artificial variable. If that fails, then\n // the row represents an unsatisfiable constraint.\n if (subject.type() === SymbolType.Invalid) {\n if (!this._addWithArtificialVariable(row)) {\n throw new Error('unsatisfiable constraint');\n }\n }\n else {\n row.solveFor(subject);\n this._substitute(subject, row);\n this._rowMap.insert(subject, row);\n }\n this._cnMap.insert(constraint, tag);\n // Optimizing after each constraint is added performs less\n // aggregate work due to a smaller average system size. It\n // also ensures the solver remains in a consistent state.\n this._optimize(this._objective);\n }\n /**\n * Remove a constraint from the solver.\n *\n * @param {Constraint} constraint Constraint to remove from the solver\n */\n removeConstraint(constraint) {\n let cnPair = this._cnMap.erase(constraint);\n if (cnPair === undefined) {\n throw new Error('unknown constraint');\n }\n // Remove the error effects from the objective function\n // *before* pivoting, or substitutions into the objective\n // will lead to incorrect solver results.\n this._removeConstraintEffects(constraint, cnPair.second);\n // If the marker is basic, simply drop the row. Otherwise,\n // pivot the marker into the basis and then drop the row.\n let marker = cnPair.second.marker;\n let rowPair = this._rowMap.erase(marker);\n if (rowPair === undefined) {\n let leaving = this._getMarkerLeavingSymbol(marker);\n if (leaving.type() === SymbolType.Invalid) {\n throw new Error('failed to find leaving row');\n }\n rowPair = this._rowMap.erase(leaving);\n rowPair.second.solveForEx(leaving, marker);\n this._substitute(marker, rowPair.second);\n }\n // Optimizing after each constraint is removed ensures that the\n // solver remains consistent. It makes the solver api easier to\n // use at a small tradeoff for speed.\n this._optimize(this._objective);\n }\n /**\n * Test whether the solver contains the constraint.\n *\n * @param {Constraint} constraint Constraint to test for\n * @return {Bool} true or false\n */\n hasConstraint(constraint) {\n return this._cnMap.contains(constraint);\n }\n /**\n * Get an array of the current constraints.\n *\n * @return {Constraint[]}\n */\n getConstraints() {\n return this._cnMap.array.map(({ first }) => first);\n }\n /**\n * Add an edit variable to the solver.\n *\n * @param {Variable} variable Edit variable to add to the solver\n * @param {Number} strength Strength, should be less than `Strength.required`\n */\n addEditVariable(variable, strength) {\n let editPair = this._editMap.find(variable);\n if (editPair !== undefined) {\n throw new Error('duplicate edit variable');\n }\n strength = Strength.clip(strength);\n if (strength === Strength.required) {\n throw new Error('bad required strength');\n }\n let expr = new Expression(variable);\n let cn = new Constraint(expr, Operator.Eq, undefined, strength);\n this.addConstraint(cn);\n let tag = this._cnMap.find(cn).second;\n let info = { tag, constraint: cn, constant: 0.0 };\n this._editMap.insert(variable, info);\n }\n /**\n * Remove an edit variable from the solver.\n *\n * @param {Variable} variable Edit variable to remove from the solver\n */\n removeEditVariable(variable) {\n let editPair = this._editMap.erase(variable);\n if (editPair === undefined) {\n throw new Error('unknown edit variable');\n }\n this.removeConstraint(editPair.second.constraint);\n }\n /**\n * Test whether the solver contains the edit variable.\n *\n * @param {Variable} variable Edit variable to test for\n * @return {Bool} true or false\n */\n hasEditVariable(variable) {\n return this._editMap.contains(variable);\n }\n /**\n * Suggest the value of an edit variable.\n *\n * @param {Variable} variable Edit variable to suggest a value for\n * @param {Number} value Suggested value\n */\n suggestValue(variable, value) {\n let editPair = this._editMap.find(variable);\n if (editPair === undefined) {\n throw new Error('unknown edit variable');\n }\n let rows = this._rowMap;\n let info = editPair.second;\n let delta = value - info.constant;\n info.constant = value;\n // Check first if the positive error variable is basic.\n let marker = info.tag.marker;\n let rowPair = rows.find(marker);\n if (rowPair !== undefined) {\n if (rowPair.second.add(-delta) < 0.0) {\n this._infeasibleRows.push(marker);\n }\n this._dualOptimize();\n return;\n }\n // Check next if the negative error variable is basic.\n let other = info.tag.other;\n rowPair = rows.find(other);\n if (rowPair !== undefined) {\n if (rowPair.second.add(delta) < 0.0) {\n this._infeasibleRows.push(other);\n }\n this._dualOptimize();\n return;\n }\n // Otherwise update each row where the error variables exist.\n for (let i = 0, n = rows.size(); i < n; ++i) {\n let rowPair = rows.itemAt(i);\n let row = rowPair.second;\n let coeff = row.coefficientFor(marker);\n if (coeff !== 0.0 && row.add(delta * coeff) < 0.0 && rowPair.first.type() !== SymbolType.External) {\n this._infeasibleRows.push(rowPair.first);\n }\n }\n this._dualOptimize();\n }\n /**\n * Update the values of the variables.\n */\n updateVariables() {\n let vars = this._varMap;\n let rows = this._rowMap;\n for (let i = 0, n = vars.size(); i < n; ++i) {\n let pair = vars.itemAt(i);\n let rowPair = rows.find(pair.second);\n if (rowPair !== undefined) {\n pair.first.setValue(rowPair.second.constant());\n }\n else {\n pair.first.setValue(0.0);\n }\n }\n }\n /**\n * Get the symbol for the given variable.\n *\n * If a symbol does not exist for the variable, one will be created.\n * @private\n */\n _getVarSymbol(variable) {\n let factory = () => this._makeSymbol(SymbolType.External);\n return this._varMap.setDefault(variable, factory).second;\n }\n /**\n * Create a new Row object for the given constraint.\n *\n * The terms in the constraint will be converted to cells in the row.\n * Any term in the constraint with a coefficient of zero is ignored.\n * This method uses the `_getVarSymbol` method to get the symbol for\n * the variables added to the row. If the symbol for a given cell\n * variable is basic, the cell variable will be substituted with the\n * basic row.\n *\n * The necessary slack and error variables will be added to the row.\n * If the constant for the row is negative, the sign for the row\n * will be inverted so the constant becomes positive.\n *\n * Returns the created Row and the tag for tracking the constraint.\n * @private\n */\n _createRow(constraint) {\n let expr = constraint.expression();\n let row = new Row(expr.constant());\n // Substitute the current basic variables into the row.\n let terms = expr.terms();\n for (let i = 0, n = terms.size(); i < n; ++i) {\n let termPair = terms.itemAt(i);\n if (!nearZero(termPair.second)) {\n let symbol = this._getVarSymbol(termPair.first);\n let basicPair = this._rowMap.find(symbol);\n if (basicPair !== undefined) {\n row.insertRow(basicPair.second, termPair.second);\n }\n else {\n row.insertSymbol(symbol, termPair.second);\n }\n }\n }\n // Add the necessary slack, error, and dummy variables.\n let objective = this._objective;\n let strength = constraint.strength();\n let tag = { marker: INVALID_SYMBOL, other: INVALID_SYMBOL };\n switch (constraint.op()) {\n case Operator.Le:\n case Operator.Ge: {\n let coeff = constraint.op() === Operator.Le ? 1.0 : -1.0;\n let slack = this._makeSymbol(SymbolType.Slack);\n tag.marker = slack;\n row.insertSymbol(slack, coeff);\n if (strength < Strength.required) {\n let error = this._makeSymbol(SymbolType.Error);\n tag.other = error;\n row.insertSymbol(error, -coeff);\n objective.insertSymbol(error, strength);\n }\n break;\n }\n case Operator.Eq: {\n if (strength < Strength.required) {\n let errplus = this._makeSymbol(SymbolType.Error);\n let errminus = this._makeSymbol(SymbolType.Error);\n tag.marker = errplus;\n tag.other = errminus;\n row.insertSymbol(errplus, -1.0); // v = eplus - eminus\n row.insertSymbol(errminus, 1.0); // v - eplus + eminus = 0\n objective.insertSymbol(errplus, strength);\n objective.insertSymbol(errminus, strength);\n }\n else {\n let dummy = this._makeSymbol(SymbolType.Dummy);\n tag.marker = dummy;\n row.insertSymbol(dummy);\n }\n break;\n }\n }\n // Ensure the row has a positive constant.\n if (row.constant() < 0.0) {\n row.reverseSign();\n }\n return { row, tag };\n }\n /**\n * Choose the subject for solving for the row.\n *\n * This method will choose the best subject for using as the solve\n * target for the row. An invalid symbol will be returned if there\n * is no valid target.\n *\n * The symbols are chosen according to the following precedence:\n *\n * 1) The first symbol representing an external variable.\n * 2) A negative slack or error tag variable.\n *\n * If a subject cannot be found, an invalid symbol will be returned.\n *\n * @private\n */\n _chooseSubject(row, tag) {\n let cells = row.cells();\n for (let i = 0, n = cells.size(); i < n; ++i) {\n let pair = cells.itemAt(i);\n if (pair.first.type() === SymbolType.External) {\n return pair.first;\n }\n }\n let type = tag.marker.type();\n if (type === SymbolType.Slack || type === SymbolType.Error) {\n if (row.coefficientFor(tag.marker) < 0.0) {\n return tag.marker;\n }\n }\n type = tag.other.type();\n if (type === SymbolType.Slack || type === SymbolType.Error) {\n if (row.coefficientFor(tag.other) < 0.0) {\n return tag.other;\n }\n }\n return INVALID_SYMBOL;\n }\n /**\n * Add the row to the tableau using an artificial variable.\n *\n * This will return false if the constraint cannot be satisfied.\n *\n * @private\n */\n _addWithArtificialVariable(row) {\n // Create and add the artificial variable to the tableau.\n let art = this._makeSymbol(SymbolType.Slack);\n this._rowMap.insert(art, row.copy());\n this._artificial = row.copy();\n // Optimize the artificial objective. This is successful\n // only if the artificial objective is optimized to zero.\n this._optimize(this._artificial);\n let success = nearZero(this._artificial.constant());\n this._artificial = null;\n // If the artificial variable is basic, pivot the row so that\n // it becomes non-basic. If the row is constant, exit early.\n let pair = this._rowMap.erase(art);\n if (pair !== undefined) {\n let basicRow = pair.second;\n if (basicRow.isConstant()) {\n return success;\n }\n let entering = this._anyPivotableSymbol(basicRow);\n if (entering.type() === SymbolType.Invalid) {\n return false; // unsatisfiable (will this ever happen?)\n }\n basicRow.solveForEx(art, entering);\n this._substitute(entering, basicRow);\n this._rowMap.insert(entering, basicRow);\n }\n // Remove the artificial variable from the tableau.\n let rows = this._rowMap;\n for (let i = 0, n = rows.size(); i < n; ++i) {\n rows.itemAt(i).second.removeSymbol(art);\n }\n this._objective.removeSymbol(art);\n return success;\n }\n /**\n * Substitute the parametric symbol with the given row.\n *\n * This method will substitute all instances of the parametric symbol\n * in the tableau and the objective function with the given row.\n *\n * @private\n */\n _substitute(symbol, row) {\n let rows = this._rowMap;\n for (let i = 0, n = rows.size(); i < n; ++i) {\n let pair = rows.itemAt(i);\n pair.second.substitute(symbol, row);\n if (pair.second.constant() < 0.0 && pair.first.type() !== SymbolType.External) {\n this._infeasibleRows.push(pair.first);\n }\n }\n this._objective.substitute(symbol, row);\n if (this._artificial) {\n this._artificial.substitute(symbol, row);\n }\n }\n /**\n * Optimize the system for the given objective function.\n *\n * This method performs iterations of Phase 2 of the simplex method\n * until the objective function reaches a minimum.\n *\n * @private\n */\n _optimize(objective) {\n let iterations = 0;\n while (iterations < this.maxIterations) {\n let entering = this._getEnteringSymbol(objective);\n if (entering.type() === SymbolType.Invalid) {\n return;\n }\n let leaving = this._getLeavingSymbol(entering);\n if (leaving.type() === SymbolType.Invalid) {\n throw new Error('the objective is unbounded');\n }\n // pivot the entering symbol into the basis\n let row = this._rowMap.erase(leaving).second;\n row.solveForEx(leaving, entering);\n this._substitute(entering, row);\n this._rowMap.insert(entering, row);\n iterations++;\n }\n throw new Error('solver iterations exceeded');\n }\n /**\n * Optimize the system using the dual of the simplex method.\n *\n * The current state of the system should be such that the objective\n * function is optimal, but not feasible. This method will perform\n * an iteration of the dual simplex method to make the solution both\n * optimal and feasible.\n *\n * @private\n */\n _dualOptimize() {\n let rows = this._rowMap;\n let infeasible = this._infeasibleRows;\n while (infeasible.length !== 0) {\n let leaving = infeasible.pop();\n let pair = rows.find(leaving);\n if (pair !== undefined && pair.second.constant() < 0.0) {\n let entering = this._getDualEnteringSymbol(pair.second);\n if (entering.type() === SymbolType.Invalid) {\n throw new Error('dual optimize failed');\n }\n // pivot the entering symbol into the basis\n let row = pair.second;\n rows.erase(leaving);\n row.solveForEx(leaving, entering);\n this._substitute(entering, row);\n rows.insert(entering, row);\n }\n }\n }\n /**\n * Compute the entering variable for a pivot operation.\n *\n * This method will return first symbol in the objective function which\n * is non-dummy and has a coefficient less than zero. If no symbol meets\n * the criteria, it means the objective function is at a minimum, and an\n * invalid symbol is returned.\n *\n * @private\n */\n _getEnteringSymbol(objective) {\n let cells = objective.cells();\n for (let i = 0, n = cells.size(); i < n; ++i) {\n let pair = cells.itemAt(i);\n let symbol = pair.first;\n if (pair.second < 0.0 && symbol.type() !== SymbolType.Dummy) {\n return symbol;\n }\n }\n return INVALID_SYMBOL;\n }\n /**\n * Compute the entering symbol for the dual optimize operation.\n *\n * This method will return the symbol in the row which has a positive\n * coefficient and yields the minimum ratio for its respective symbol\n * in the objective function. The provided row *must* be infeasible.\n * If no symbol is found which meats the criteria, an invalid symbol\n * is returned.\n *\n * @private\n */\n _getDualEnteringSymbol(row) {\n let ratio = Number.MAX_VALUE;\n let entering = INVALID_SYMBOL;\n let cells = row.cells();\n for (let i = 0, n = cells.size(); i < n; ++i) {\n let pair = cells.itemAt(i);\n let symbol = pair.first;\n let c = pair.second;\n if (c > 0.0 && symbol.type() !== SymbolType.Dummy) {\n let coeff = this._objective.coefficientFor(symbol);\n let r = coeff / c;\n if (r < ratio) {\n ratio = r;\n entering = symbol;\n }\n }\n }\n return entering;\n }\n /**\n * Compute the symbol for pivot exit row.\n *\n * This method will return the symbol for the exit row in the row\n * map. If no appropriate exit symbol is found, an invalid symbol\n * will be returned. This indicates that the objective function is\n * unbounded.\n *\n * @private\n */\n _getLeavingSymbol(entering) {\n let ratio = Number.MAX_VALUE;\n let found = INVALID_SYMBOL;\n let rows = this._rowMap;\n for (let i = 0, n = rows.size(); i < n; ++i) {\n let pair = rows.itemAt(i);\n let symbol = pair.first;\n if (symbol.type() !== SymbolType.External) {\n let row = pair.second;\n let temp = row.coefficientFor(entering);\n if (temp < 0.0) {\n let temp_ratio = -row.constant() / temp;\n if (temp_ratio < ratio) {\n ratio = temp_ratio;\n found = symbol;\n }\n }\n }\n }\n return found;\n }\n /**\n * Compute the leaving symbol for a marker variable.\n *\n * This method will return a symbol corresponding to a basic row\n * which holds the given marker variable. The row will be chosen\n * according to the following precedence:\n *\n * 1) The row with a restricted basic varible and a negative coefficient\n * for the marker with the smallest ratio of -constant / coefficient.\n *\n * 2) The row with a restricted basic variable and the smallest ratio\n * of constant / coefficient.\n *\n * 3) The last unrestricted row which contains the marker.\n *\n * If the marker does not exist in any row, an invalid symbol will be\n * returned. This indicates an internal solver error since the marker\n * *should* exist somewhere in the tableau.\n *\n * @private\n */\n _getMarkerLeavingSymbol(marker) {\n let dmax = Number.MAX_VALUE;\n let r1 = dmax;\n let r2 = dmax;\n let invalid = INVALID_SYMBOL;\n let first = invalid;\n let second = invalid;\n let third = invalid;\n let rows = this._rowMap;\n for (let i = 0, n = rows.size(); i < n; ++i) {\n let pair = rows.itemAt(i);\n let row = pair.second;\n let c = row.coefficientFor(marker);\n if (c === 0.0) {\n continue;\n }\n let symbol = pair.first;\n if (symbol.type() === SymbolType.External) {\n third = symbol;\n }\n else if (c < 0.0) {\n let r = -row.constant() / c;\n if (r < r1) {\n r1 = r;\n first = symbol;\n }\n }\n else {\n let r = row.constant() / c;\n if (r < r2) {\n r2 = r;\n second = symbol;\n }\n }\n }\n if (first !== invalid) {\n return first;\n }\n if (second !== invalid) {\n return second;\n }\n return third;\n }\n /**\n * Remove the effects of a constraint on the objective function.\n *\n * @private\n */\n _removeConstraintEffects(cn, tag) {\n if (tag.marker.type() === SymbolType.Error) {\n this._removeMarkerEffects(tag.marker, cn.strength());\n }\n if (tag.other.type() === SymbolType.Error) {\n this._removeMarkerEffects(tag.other, cn.strength());\n }\n }\n /**\n * Remove the effects of an error marker on the objective function.\n *\n * @private\n */\n _removeMarkerEffects(marker, strength) {\n let pair = this._rowMap.find(marker);\n if (pair !== undefined) {\n this._objective.insertRow(pair.second, -strength);\n }\n else {\n this._objective.insertSymbol(marker, -strength);\n }\n }\n /**\n * Get the first Slack or Error symbol in the row.\n *\n * If no such symbol is present, an invalid symbol will be returned.\n *\n * @private\n */\n _anyPivotableSymbol(row) {\n let cells = row.cells();\n for (let i = 0, n = cells.size(); i < n; ++i) {\n let pair = cells.itemAt(i);\n let type = pair.first.type();\n if (type === SymbolType.Slack || type === SymbolType.Error) {\n return pair.first;\n }\n }\n return INVALID_SYMBOL;\n }\n /**\n * Returns a new Symbol of the given type.\n *\n * @private\n */\n _makeSymbol(type) {\n return new Symbol(type, this._idTick++);\n }\n _cnMap = createCnMap();\n _rowMap = createRowMap();\n _varMap = createVarMap();\n _editMap = createEditMap();\n _infeasibleRows = [];\n _objective = new Row();\n _artificial = null;\n _idTick = 0;\n}\n/**\n * Test whether a value is approximately zero.\n * @private\n */\nfunction nearZero(value) {\n let eps = 1.0e-8;\n return value < 0.0 ? -value < eps : value < eps;\n}\n/**\n * An internal function for creating a constraint map.\n * @private\n */\nfunction createCnMap() {\n return createMap();\n}\n/**\n * An internal function for creating a row map.\n * @private\n */\nfunction createRowMap() {\n return createMap();\n}\n/**\n * An internal function for creating a variable map.\n * @private\n */\nfunction createVarMap() {\n return createMap();\n}\n/**\n * An internal function for creating an edit map.\n * @private\n */\nfunction createEditMap() {\n return createMap();\n}\n/**\n * An enum defining the available symbol types.\n * @private\n */\nvar SymbolType;\n(function (SymbolType) {\n SymbolType[SymbolType[\"Invalid\"] = 0] = \"Invalid\";\n SymbolType[SymbolType[\"External\"] = 1] = \"External\";\n SymbolType[SymbolType[\"Slack\"] = 2] = \"Slack\";\n SymbolType[SymbolType[\"Error\"] = 3] = \"Error\";\n SymbolType[SymbolType[\"Dummy\"] = 4] = \"Dummy\";\n})(SymbolType || (SymbolType = {}));\n/**\n * An internal class representing a symbol in the solver.\n * @private\n */\nclass Symbol {\n /**\n * Construct a new Symbol\n *\n * @param [type] The type of the symbol.\n * @param [id] The unique id number of the symbol.\n */\n constructor(type, id) {\n this._id = id;\n this._type = type;\n }\n /**\n * Returns the unique id number of the symbol.\n */\n id() {\n return this._id;\n }\n /**\n * Returns the type of the symbol.\n */\n type() {\n return this._type;\n }\n _id;\n _type;\n}\n/**\n * A static invalid symbol\n * @private\n */\nlet INVALID_SYMBOL = new Symbol(SymbolType.Invalid, -1);\n/**\n * An internal row class used by the solver.\n * @private\n */\nclass Row {\n /**\n * Construct a new Row.\n */\n constructor(constant = 0.0) {\n this._constant = constant;\n }\n /**\n * Returns the mapping of symbols to coefficients.\n */\n cells() {\n return this._cellMap;\n }\n /**\n * Returns the constant for the row.\n */\n constant() {\n return this._constant;\n }\n /**\n * Returns true if the row is a constant value.\n */\n isConstant() {\n return this._cellMap.empty();\n }\n /**\n * Returns true if the Row has all dummy symbols.\n */\n allDummies() {\n let cells = this._cellMap;\n for (let i = 0, n = cells.size(); i < n; ++i) {\n let pair = cells.itemAt(i);\n if (pair.first.type() !== SymbolType.Dummy) {\n return false;\n }\n }\n return true;\n }\n /**\n * Create a copy of the row.\n */\n copy() {\n let theCopy = new Row(this._constant);\n theCopy._cellMap = this._cellMap.copy();\n return theCopy;\n }\n /**\n * Add a constant value to the row constant.\n *\n * Returns the new value of the constant.\n */\n add(value) {\n return (this._constant += value);\n }\n /**\n * Insert the symbol into the row with the given coefficient.\n *\n * If the symbol already exists in the row, the coefficient\n * will be added to the existing coefficient. If the resulting\n * coefficient is zero, the symbol will be removed from the row.\n */\n insertSymbol(symbol, coefficient = 1.0) {\n let pair = this._cellMap.setDefault(symbol, () => 0.0);\n if (nearZero((pair.second += coefficient))) {\n this._cellMap.erase(symbol);\n }\n }\n /**\n * Insert a row into this row with a given coefficient.\n *\n * The constant and the cells of the other row will be\n * multiplied by the coefficient and added to this row. Any\n * cell with a resulting coefficient of zero will be removed\n * from the row.\n */\n insertRow(other, coefficient = 1.0) {\n this._constant += other._constant * coefficient;\n let cells = other._cellMap;\n for (let i = 0, n = cells.size(); i < n; ++i) {\n let pair = cells.itemAt(i);\n this.insertSymbol(pair.first, pair.second * coefficient);\n }\n }\n /**\n * Remove a symbol from the row.\n */\n removeSymbol(symbol) {\n this._cellMap.erase(symbol);\n }\n /**\n * Reverse the sign of the constant and cells in the row.\n */\n reverseSign() {\n this._constant = -this._constant;\n let cells = this._cellMap;\n for (let i = 0, n = cells.size(); i < n; ++i) {\n let pair = cells.itemAt(i);\n pair.second = -pair.second;\n }\n }\n /**\n * Solve the row for the given symbol.\n *\n * This method assumes the row is of the form\n * a * x + b * y + c = 0 and (assuming solve for x) will modify\n * the row to represent the right hand side of\n * x = -b/a * y - c / a. The target symbol will be removed from\n * the row, and the constant and other cells will be multiplied\n * by the negative inverse of the target coefficient.\n *\n * The given symbol *must* exist in the row.\n */\n solveFor(symbol) {\n let cells = this._cellMap;\n let pair = cells.erase(symbol);\n let coeff = -1.0 / pair.second;\n this._constant *= coeff;\n for (let i = 0, n = cells.size(); i < n; ++i) {\n cells.itemAt(i).second *= coeff;\n }\n }\n /**\n * Solve the row for the given symbols.\n *\n * This method assumes the row is of the form\n * x = b * y + c and will solve the row such that\n * y = x / b - c / b. The rhs symbol will be removed from the\n * row, the lhs added, and the result divided by the negative\n * inverse of the rhs coefficient.\n *\n * The lhs symbol *must not* exist in the row, and the rhs\n * symbol must* exist in the row.\n */\n solveForEx(lhs, rhs) {\n this.insertSymbol(lhs, -1.0);\n this.solveFor(rhs);\n }\n /**\n * Returns the coefficient for the given symbol.\n */\n coefficientFor(symbol) {\n let pair = this._cellMap.find(symbol);\n return pair !== undefined ? pair.second : 0.0;\n }\n /**\n * Substitute a symbol with the data from another row.\n *\n * Given a row of the form a * x + b and a substitution of the\n * form x = 3 * y + c the row will be updated to reflect the\n * expression 3 * a * y + a * c + b.\n *\n * If the symbol does not exist in the row, this is a no-op.\n */\n substitute(symbol, row) {\n let pair = this._cellMap.erase(symbol);\n if (pair !== undefined) {\n this.insertRow(row, pair.second);\n }\n }\n _cellMap = createMap();\n _constant;\n}\n","import { Strength } from \"@lume/kiwi\";\n\nconst HIGH_PRIORITY = 1000;\nconst MEDIUM_PRIORITY = 100;\nconst LOW_PRIORITY = 10;\n\n/** Constraint solver priority levels */\nexport enum UIPriority {\n /** Highest priority */\n P0 = 0,\n /** High priority */\n P1 = 1,\n /** Medium-high priority */\n P2 = 2,\n /** Medium priority */\n P3 = 3,\n /** Medium-low priority */\n P4 = 4,\n /** Low priority */\n P5 = 5,\n /** Very low priority */\n P6 = 6,\n /** Lowest priority */\n P7 = 7,\n}\n\n/**\n * Converts priority to solver strength.\n * @param priority Priority level\n * @returns Solver strength value\n * @throws If priority is invalid\n */\nexport function convertPriority(priority: UIPriority): number {\n switch (priority) {\n case UIPriority.P0:\n return Strength.create(HIGH_PRIORITY, HIGH_PRIORITY, HIGH_PRIORITY);\n case UIPriority.P1:\n return Strength.create(MEDIUM_PRIORITY, 0, 0);\n case UIPriority.P2:\n return Strength.create(LOW_PRIORITY, 0, 0);\n case UIPriority.P3:\n return Strength.create(0, MEDIUM_PRIORITY, 0);\n case UIPriority.P4:\n return Strength.create(0, LOW_PRIORITY, 0);\n case UIPriority.P5:\n return Strength.create(0, 0, MEDIUM_PRIORITY);\n case UIPriority.P6:\n return Strength.create(0, 0, LOW_PRIORITY);\n case UIPriority.P7:\n return Strength.create(0, 0, 1);\n default:\n throw new Error(`convertPriority: invalid priority`);\n }\n}\n\n/**\n * Resolves optional priority.\n * @param priority Priority to resolve\n * @returns Priority or P0 if undefined\n */\nexport function resolvePriority(priority?: UIPriority): UIPriority {\n return priority ?? UIPriority.P0;\n}\n","import type {\n UIInputWrapperCatcher,\n UIInputWrapperInterface,\n} from \"./UIInputWrapper.Internal\";\n\nexport class UIInputWrapper implements UIInputWrapperInterface {\n /** @internal */\n public dirty = false;\n\n private zIndicesDirty = false;\n private readonly catchers: UIInputWrapperCatcher[] = [];\n private lastHandler = 0;\n\n public createInputCatcher(\n catchPointerDown: (x: number, y: number, identifier: number) => boolean,\n catchPointerMove: (x: number, y: number, identifier: number) => boolean,\n catchPointerUp: (x: number, y: number, identifier: number) => boolean,\n zIndex: number,\n ): number {\n const handler = this.lastHandler++;\n this.catchers.push({\n handler,\n catchPointerDown,\n catchPointerMove,\n catchPointerUp,\n zIndex,\n active: true,\n });\n this.zIndicesDirty = true;\n this.dirty = true;\n return handler;\n }\n\n public destroyInputCatcher(handler: number): void {\n const index = this.catchers.findIndex((item) => item.handler === handler);\n if (index === -1) {\n throw new Error(\"UIInputWrapper.destroyInputCatcher: handler not found\");\n }\n this.catchers.splice(index, 1);\n }\n\n public getZIndex(handler: number): number {\n this.ensureSorted();\n const found = this.catchers.find((item) => item.handler === handler);\n if (!found) {\n throw new Error(\"UIInputWrapper.getZIndex: handler not found\");\n }\n return found.zIndex;\n }\n\n public setZIndex(handler: number, zIndex: number): void {\n const found = this.catchers.find((item) => item.handler === handler);\n if (!found) {\n throw new Error(\"UIInputWrapper.setZIndex: handler not found\");\n }\n if (found.zIndex !== zIndex) {\n found.zIndex = zIndex;\n this.zIndicesDirty = true;\n this.dirty = true;\n }\n }\n\n public getActive(handler: number): boolean {\n const found = this.catchers.find((item) => item.handler === handler);\n if (!found) {\n throw new Error(\"UIInputWrapper.getActive: handler not found\");\n }\n return found.active;\n }\n\n public setActive(handler: number, active: boolean): void {\n const found = this.catchers.find((item) => item.handler === handler);\n if (!found) {\n throw new Error(\"UIInputWrapper.setActive: handler not found\");\n }\n if (found.active !== active) {\n found.active = active;\n }\n }\n\n /** @internal */\n public onPointerDown(x: number, y: number, identifier: number): void {\n this.ensureSorted();\n for (let index = this.catchers.length - 1; index >= 0; index--) {\n const item = this.catchers[index];\n if (item.active && item.catchPointerDown(x, y, identifier)) {\n break;\n }\n }\n }\n\n /** @internal */\n public onPointerMove(x: number, y: number, identifier: number): void {\n this.ensureSorted();\n for (let index = this.catchers.length - 1; index >= 0; index--) {\n const item = this.catchers[index];\n if (item.active && item.catchPointerMove(x, y, identifier)) {\n break;\n }\n }\n }\n\n /** @internal */\n public onPointerUp(x: number, y: number, identifier: number): void {\n this.ensureSorted();\n for (let index = this.catchers.length - 1; index >= 0; index--) {\n const item = this.catchers[index];\n if (item.active && item.catchPointerUp(x, y, identifier)) {\n break;\n }\n }\n }\n\n private ensureSorted(): void {\n if (this.zIndicesDirty) {\n this.catchers.sort((a, b) => a.zIndex - b.zIndex);\n\n const count = this.catchers.length;\n const step = count < 1024 ? 1 : 1024 / count;\n for (let index = 0; index < count; index++) {\n this.catchers[index].zIndex = index * step;\n }\n\n this.zIndicesDirty = false;\n }\n }\n}\n","/** Transparency rendering modes */\nexport enum UITransparencyMode {\n /** Binary transparency. Best performance. */\n CLIP = 0,\n /** Dithered transparency. Good performance. */\n HASH = 1,\n /** Alpha blending. Best quality, requires depth sorting. */\n BLEND = 2,\n}\n","import { SRGBColorSpace, LinearSRGBColorSpace, SRGBTransfer, LinearTransfer, NoColorSpace } from '../constants.js';\nimport { Matrix3 } from './Matrix3.js';\nimport { warnOnce } from '../utils.js';\n\nconst LINEAR_REC709_TO_XYZ = /*@__PURE__*/ new Matrix3().set(\n\t0.4123908, 0.3575843, 0.1804808,\n\t0.2126390, 0.7151687, 0.0721923,\n\t0.0193308, 0.1191948, 0.9505322\n);\n\nconst XYZ_TO_LINEAR_REC709 = /*@__PURE__*/ new Matrix3().set(\n\t3.2409699, - 1.5373832, - 0.4986108,\n\t- 0.9692436, 1.8759675, 0.0415551,\n\t0.0556301, - 0.2039770, 1.0569715\n);\n\nfunction createColorManagement() {\n\n\tconst ColorManagement = {\n\n\t\tenabled: true,\n\n\t\tworkingColorSpace: LinearSRGBColorSpace,\n\n\t\t/**\n\t\t * Implementations of supported color spaces.\n\t\t *\n\t\t * Required:\n\t\t *\t- primaries: chromaticity coordinates [ rx ry gx gy bx by ]\n\t\t *\t- whitePoint: reference white [ x y ]\n\t\t *\t- transfer: transfer function (pre-defined)\n\t\t *\t- toXYZ: Matrix3 RGB to XYZ transform\n\t\t *\t- fromXYZ: Matrix3 XYZ to RGB transform\n\t\t *\t- luminanceCoefficients: RGB luminance coefficients\n\t\t *\n\t\t * Optional:\n\t\t * - outputColorSpaceConfig: { drawingBufferColorSpace: ColorSpace }\n\t\t * - workingColorSpaceConfig: { unpackColorSpace: ColorSpace }\n\t\t *\n\t\t * Reference:\n\t\t * - https://www.russellcottrell.com/photo/matrixCalculator.htm\n\t\t */\n\t\tspaces: {},\n\n\t\tconvert: function ( color, sourceColorSpace, targetColorSpace ) {\n\n\t\t\tif ( this.enabled === false || sourceColorSpace === targetColorSpace || ! sourceColorSpace || ! targetColorSpace ) {\n\n\t\t\t\treturn color;\n\n\t\t\t}\n\n\t\t\tif ( this.spaces[ sourceColorSpace ].transfer === SRGBTransfer ) {\n\n\t\t\t\tcolor.r = SRGBToLinear( color.r );\n\t\t\t\tcolor.g = SRGBToLinear( color.g );\n\t\t\t\tcolor.b = SRGBToLinear( color.b );\n\n\t\t\t}\n\n\t\t\tif ( this.spaces[ sourceColorSpace ].primaries !== this.spaces[ targetColorSpace ].primaries ) {\n\n\t\t\t\tcolor.applyMatrix3( this.spaces[ sourceColorSpace ].toXYZ );\n\t\t\t\tcolor.applyMatrix3( this.spaces[ targetColorSpace ].fromXYZ );\n\n\t\t\t}\n\n\t\t\tif ( this.spaces[ targetColorSpace ].transfer === SRGBTransfer ) {\n\n\t\t\t\tcolor.r = LinearToSRGB( color.r );\n\t\t\t\tcolor.g = LinearToSRGB( color.g );\n\t\t\t\tcolor.b = LinearToSRGB( color.b );\n\n\t\t\t}\n\n\t\t\treturn color;\n\n\t\t},\n\n\t\tworkingToColorSpace: function ( color, targetColorSpace ) {\n\n\t\t\treturn this.convert( color, this.workingColorSpace, targetColorSpace );\n\n\t\t},\n\n\t\tcolorSpaceToWorking: function ( color, sourceColorSpace ) {\n\n\t\t\treturn this.convert( color, sourceColorSpace, this.workingColorSpace );\n\n\t\t},\n\n\t\tgetPrimaries: function ( colorSpace ) {\n\n\t\t\treturn this.spaces[ colorSpace ].primaries;\n\n\t\t},\n\n\t\tgetTransfer: function ( colorSpace ) {\n\n\t\t\tif ( colorSpace === NoColorSpace ) return LinearTransfer;\n\n\t\t\treturn this.spaces[ colorSpace ].transfer;\n\n\t\t},\n\n\t\tgetLuminanceCoefficients: function ( target, colorSpace = this.workingColorSpace ) {\n\n\t\t\treturn target.fromArray( this.spaces[ colorSpace ].luminanceCoefficients );\n\n\t\t},\n\n\t\tdefine: function ( colorSpaces ) {\n\n\t\t\tObject.assign( this.spaces, colorSpaces );\n\n\t\t},\n\n\t\t// Internal APIs\n\n\t\t_getMatrix: function ( targetMatrix, sourceColorSpace, targetColorSpace ) {\n\n\t\t\treturn targetMatrix\n\t\t\t\t.copy( this.spaces[ sourceColorSpace ].toXYZ )\n\t\t\t\t.multiply( this.spaces[ targetColorSpace ].fromXYZ );\n\n\t\t},\n\n\t\t_getDrawingBufferColorSpace: function ( colorSpace ) {\n\n\t\t\treturn this.spaces[ colorSpace ].outputColorSpaceConfig.drawingBufferColorSpace;\n\n\t\t},\n\n\t\t_getUnpackColorSpace: function ( colorSpace = this.workingColorSpace ) {\n\n\t\t\treturn this.spaces[ colorSpace ].workingColorSpaceConfig.unpackColorSpace;\n\n\t\t},\n\n\t\t// Deprecated\n\n\t\tfromWorkingColorSpace: function ( color, targetColorSpace ) {\n\n\t\t\twarnOnce( 'THREE.ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace().' ); // @deprecated, r177\n\n\t\t\treturn ColorManagement.workingToColorSpace( color, targetColorSpace );\n\n\t\t},\n\n\t\ttoWorkingColorSpace: function ( color, sourceColorSpace ) {\n\n\t\t\twarnOnce( 'THREE.ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking().' ); // @deprecated, r177\n\n\t\t\treturn ColorManagement.colorSpaceToWorking( color, sourceColorSpace );\n\n\t\t},\n\n\t};\n\n\t/******************************************************************************\n\t * sRGB definitions\n\t */\n\n\tconst REC709_PRIMARIES = [ 0.640, 0.330, 0.300, 0.600, 0.150, 0.060 ];\n\tconst REC709_LUMINANCE_COEFFICIENTS = [ 0.2126, 0.7152, 0.0722 ];\n\tconst D65 = [ 0.3127, 0.3290 ];\n\n\tColorManagement.define( {\n\n\t\t[ LinearSRGBColorSpace ]: {\n\t\t\tprimaries: REC709_PRIMARIES,\n\t\t\twhitePoint: D65,\n\t\t\ttransfer: LinearTransfer,\n\t\t\ttoXYZ: LINEAR_REC709_TO_XYZ,\n\t\t\tfromXYZ: XYZ_TO_LINEAR_REC709,\n\t\t\tluminanceCoefficients: REC709_LUMINANCE_COEFFICIENTS,\n\t\t\tworkingColorSpaceConfig: { unpackColorSpace: SRGBColorSpace },\n\t\t\toutputColorSpaceConfig: { drawingBufferColorSpace: SRGBColorSpace }\n\t\t},\n\n\t\t[ SRGBColorSpace ]: {\n\t\t\tprimaries: REC709_PRIMARIES,\n\t\t\twhitePoint: D65,\n\t\t\ttransfer: SRGBTransfer,\n\t\t\ttoXYZ: LINEAR_REC709_TO_XYZ,\n\t\t\tfromXYZ: XYZ_TO_LINEAR_REC709,\n\t\t\tluminanceCoefficients: REC709_LUMINANCE_COEFFICIENTS,\n\t\t\toutputColorSpaceConfig: { drawingBufferColorSpace: SRGBColorSpace }\n\t\t},\n\n\t} );\n\n\treturn ColorManagement;\n\n}\n\nexport const ColorManagement = /*@__PURE__*/ createColorManagement();\n\nexport function SRGBToLinear( c ) {\n\n\treturn ( c < 0.04045 ) ? c * 0.0773993808 : Math.pow( c * 0.9478672986 + 0.0521327014, 2.4 );\n\n}\n\nexport function LinearToSRGB( c ) {\n\n\treturn ( c < 0.0031308 ) ? c * 12.92 : 1.055 * ( Math.pow( c, 0.41666 ) ) - 0.055;\n\n}\n","import type { Color } from \"three\";\nimport type { UIColor } from \"./UIColor\";\n\n/** Color configuration as Three.js Color, hex number, hex string, or UIColor */\nexport type UIColorConfig = Color | number | string | UIColor;\n\n/** Predefined color names */\nexport type UIColorName =\n | \"black\"\n | \"white\"\n | \"red\"\n | \"green\"\n | \"blue\"\n | \"yellow\"\n | \"cyan\"\n | \"magenta\"\n | \"gray\"\n | \"grey\"\n | \"silver\"\n | \"maroon\"\n | \"olive\"\n | \"lime\"\n | \"aqua\"\n | \"teal\"\n | \"navy\"\n | \"fuchsia\"\n | \"purple\"\n | \"orange\"\n | \"pink\"\n | \"brown\"\n | \"gold\"\n | \"violet\"\n | \"indigo\"\n | \"coral\"\n | \"salmon\"\n | \"khaki\"\n | \"plum\"\n | \"orchid\"\n | \"tan\"\n | \"beige\"\n | \"mint\"\n | \"lavender\"\n | \"crimson\"\n | \"azure\"\n | \"ivory\"\n | \"snow\";\n\nexport const COLORS: Record<string, number | undefined> = {\n black: 0x000000,\n white: 0xffffff,\n red: 0xff0000,\n green: 0x008000,\n blue: 0x0000ff,\n yellow: 0xffff00,\n cyan: 0x00ffff,\n magenta: 0xff00ff,\n\n gray: 0x808080,\n grey: 0x808080,\n silver: 0xc0c0c0,\n maroon: 0x800000,\n olive: 0x808000,\n lime: 0x00ff00,\n aqua: 0x00ffff,\n teal: 0x008080,\n navy: 0x000080,\n fuchsia: 0xff00ff,\n purple: 0x800080,\n\n orange: 0xffa500,\n pink: 0xffc0cb,\n brown: 0xa52a2a,\n gold: 0xffd700,\n violet: 0xee82ee,\n indigo: 0x4b0082,\n coral: 0xff7f50,\n salmon: 0xfa8072,\n khaki: 0xf0e68c,\n plum: 0xdda0dd,\n orchid: 0xda70d6,\n tan: 0xd2b48c,\n beige: 0xf5f5dc,\n mint: 0x98fb98,\n lavender: 0xe6e6fa,\n crimson: 0xdc143c,\n azure: 0xf0ffff,\n ivory: 0xfffff0,\n snow: 0xfffafa,\n};\n","import { Color, Vector4 } from \"three\";\nimport { LinearToSRGB, SRGBToLinear } from \"three/src/math/ColorManagement.js\";\nimport type { UIColorConfig, UIColorName } from \"./UIColor.Internal\";\nimport { COLORS } from \"./UIColor.Internal\";\n\n/** RGBA color with RGB, HSL, hex, and named color support */\nexport class UIColor {\n private rInternal = 1;\n private gInternal = 1;\n private bInternal = 1;\n private aInternal = 1;\n\n private hInternal = 0;\n private sInternal = 0;\n private lInternal = 1;\n\n private dirtyInternal = false;\n private rgbDirty = false;\n private hslDirty = false;\n\n constructor();\n /**\n * @param r - Red (0-1)\n * @param g - Green (0-1)\n * @param b - Blue (0-1)\n * @param a - Alpha (0-1)\n */\n // eslint-disable-next-line @typescript-eslint/unified-signatures -- Separate overloads make the different constructor patterns more clear\n constructor(r: number, g: number, b: number, a?: number);\n /**\n * @param colorName - Named color\n * @param a - Alpha (0-1)\n */\n // eslint-disable-next-line @typescript-eslint/unified-signatures -- Separate overloads make the different constructor patterns more clear\n constructor(colorName: UIColorName, a?: number);\n /**\n * @param threeColor - Three.js Color object\n * @param a - Alpha (0-1)\n */\n // eslint-disable-next-line @typescript-eslint/unified-signatures -- Separate overloads make the different constructor patterns more clear\n constructor(threeColor: Color, a?: number);\n /**\n * @param hexRGB - Hex RGB value (e.g., 0xff0000)\n * @param a - Alpha (0-1)\n */\n // eslint-disable-next-line @typescript-eslint/unified-signatures -- Separate overloads make the different constructor patterns more clear\n constructor(hexRGB: number, a?: number);\n /**\n * @param hexString - Hex string (e.g., \"#ffffff\" or \"#ffffffff\")\n */\n // eslint-disable-next-line @typescript-eslint/unified-signatures -- Separate overloads make the different constructor patterns more clear\n constructor(hexString?: string);\n /**\n * @param uiColor - UIColor object to copy from\n */\n // eslint-disable-next-line @typescript-eslint/unified-signatures -- Separate overloads make the different constructor patterns more clear\n constructor(uiColor?: UIColor);\n /**\n * @param uiColorConfig - UIColorConfig object\n */\n // eslint-disable-next-line @typescript-eslint/unified-signatures -- Separate overloads make the different constructor patterns more clear\n constructor(uiColorConfig?: UIColorConfig);\n constructor(...args: unknown[]) {\n if (args.length >= 3 && typeof args[0] === \"number\") {\n const [r, g, b, a = 1] = args as number[];\n this.rInternal = r;\n this.gInternal = g;\n this.bInternal = b;\n this.aInternal = a;\n } else if (args.length >= 1 && args[0] !== undefined) {\n const [firstArgument, a = 1] = args;\n if (typeof firstArgument === \"string\") {\n if (firstArgument.startsWith(\"#\")) {\n this.setHexString(firstArgument);\n } else {\n this.setColorName(firstArgument as UIColorName, a as number);\n }\n } else if (firstArgument instanceof UIColor) {\n firstArgument.ensureRGBUpdatedFromHSL();\n this.rInternal = firstArgument.rInternal;\n this.gInternal = firstArgument.gInternal;\n this.bInternal = firstArgument.bInternal;\n this.aInternal = firstArgument.aInternal;\n } else if (firstArgument instanceof Color) {\n this.rInternal = firstArgument.r;\n this.gInternal = firstArgument.g;\n this.bInternal = firstArgument.b;\n this.aInternal = a as number;\n } else if (typeof firstArgument === \"number\") {\n this.setHexRGB(firstArgument, a as number);\n }\n }\n }\n\n /** Black (0x000000) */\n public static get black(): UIColor {\n return new UIColor(\"black\");\n }\n\n /** White (0xffffff) */\n public static get white(): UIColor {\n return new UIColor(\"white\");\n }\n\n /** Red (0xff0000) */\n public static get red(): UIColor {\n return new UIColor(\"red\");\n }\n\n /** Green (0x008000) */\n public static get green(): UIColor {\n return new UIColor(\"green\");\n }\n\n /** Blue (0x0000ff) */\n public static get blue(): UIColor {\n return new UIColor(\"blue\");\n }\n\n /** Yellow (0xffff00) */\n public static get yellow(): UIColor {\n return new UIColor(\"yellow\");\n }\n\n /** Cyan (0x00ffff) */\n public static get cyan(): UIColor {\n return new UIColor(\"cyan\");\n }\n\n /** Magenta (0xff00ff) */\n public static get magenta(): UIColor {\n return new UIColor(\"magenta\");\n }\n\n /** Gray (0x808080) */\n public static get gray(): UIColor {\n return new UIColor(\"gray\");\n }\n\n /** Grey (0x808080) */\n public static get grey(): UIColor {\n return new UIColor(\"grey\");\n }\n\n /** Silver (0xc0c0c0) */\n public static get silver(): UIColor {\n return new UIColor(\"silver\");\n }\n\n /** Maroon (0x800000) */\n public static get maroon(): UIColor {\n return new UIColor(\"maroon\");\n }\n\n /** Olive (0x808000) */\n public static get olive(): UIColor {\n return new UIColor(\"olive\");\n }\n\n /** Lime (0x00ff00) */\n public static get lime(): UIColor {\n return new UIColor(\"lime\");\n }\n\n /** Aqua (0x00ffff) */\n public static get aqua(): UIColor {\n return new UIColor(\"aqua\");\n }\n\n /** Teal (0x008080) */\n public static get teal(): UIColor {\n return new UIColor(\"teal\");\n }\n\n /** Navy (0x000080) */\n public static get navy(): UIColor {\n return new UIColor(\"navy\");\n }\n\n /** Fuchsia (0xff00ff) */\n public static get fuchsia(): UIColor {\n return new UIColor(\"fuchsia\");\n }\n\n /** Purple (0x800080) */\n public static get purple(): UIColor {\n return new UIColor(\"purple\");\n }\n\n /** Orange (0xffa500) */\n public static get orange(): UIColor {\n return new UIColor(\"orange\");\n }\n\n /** Pink (0xffc0cb) */\n public static get pink(): UIColor {\n return new UIColor(\"pink\");\n }\n\n /** Brown (0xa52a2a) */\n public static get brown(): UIColor {\n return new UIColor(\"brown\");\n }\n\n /** Gold (0xffd700) */\n public static get gold(): UIColor {\n return new UIColor(\"gold\");\n }\n\n /** Violet (0xee82ee) */\n public static get violet(): UIColor {\n return new UIColor(\"violet\");\n }\n\n /** Indigo (0x4b0082) */\n public static get indigo(): UIColor {\n return new UIColor(\"indigo\");\n }\n\n /** Coral (0xff7f50) */\n public static get coral(): UIColor {\n return new UIColor(\"coral\");\n }\n\n /** Salmon (0xfa8072) */\n public static get salmon(): UIColor {\n return new UIColor(\"salmon\");\n }\n\n /** Khaki (0xf0e68c) */\n public static get khaki(): UIColor {\n return new UIColor(\"khaki\");\n }\n\n /** Plum (0xdda0dd) */\n public static get plum(): UIColor {\n return new UIColor(\"plum\");\n }\n\n /** Orchid (0xda70d6) */\n public static get orchid(): UIColor {\n return new UIColor(\"orchid\");\n }\n\n /** Tan (0xd2b48c) */\n public static get tan(): UIColor {\n return new UIColor(\"tan\");\n }\n\n /** Beige (0xf5f5dc) */\n public static get beige(): UIColor {\n return new UIColor(\"beige\");\n }\n\n /** Mint (0x98fb98) */\n public static get mint(): UIColor {\n return new UIColor(\"mint\");\n }\n\n /** Lavender (0xe6e6fa) */\n public static get lavender(): UIColor {\n return new UIColor(\"lavender\");\n }\n\n /** Crimson (0xdc143c) */\n public static get crimson(): UIColor {\n return new UIColor(\"crimson\");\n }\n\n /** Azure (0xf0ffff) */\n public static get azure(): UIColor {\n return new UIColor(\"azure\");\n }\n\n /** Ivory (0xfffff0) */\n public static get ivory(): UIColor {\n return new UIColor(\"ivory\");\n }\n\n /** Snow (0xfffafa) */\n public static get snow(): UIColor {\n return new UIColor(\"snow\");\n }\n\n /** Red component (0 to 1) */\n public get r(): number {\n this.ensureRGBUpdatedFromHSL();\n return this.rInternal;\n }\n\n /** Green component (0 to 1) */\n public get g(): number {\n this.ensureRGBUpdatedFromHSL();\n return this.gInternal;\n }\n\n /** Blue component (0 to 1) */\n public get b(): number {\n this.ensureRGBUpdatedFromHSL();\n return this.bInternal;\n }\n\n /** Alpha component (0 to 1) */\n public get a(): number {\n return this.aInternal;\n }\n\n /** Hue component (0 to 360) */\n public get hue(): number {\n this.ensureHSLUpdatedFromRGB();\n return this.hInternal;\n }\n\n /** Saturation component (0 to 1) */\n public get saturation(): number {\n this.ensureHSLUpdatedFromRGB();\n return this.sInternal;\n }\n\n /** Lightness component (0 to 1) */\n public get lightness(): number {\n this.ensureHSLUpdatedFromRGB();\n return this.lInternal;\n }\n\n /** @internal */\n public get dirty(): boolean {\n return this.dirtyInternal;\n }\n\n /** Red component (0 to 1) */\n public set r(value: number) {\n this.ensureRGBUpdatedFromHSL();\n if (value !== this.rInternal) {\n this.rInternal = value;\n this.hslDirty = true;\n this.dirtyInternal = true;\n }\n }\n\n /** Green component (0 to 1) */\n public set g(value: number) {\n this.ensureRGBUpdatedFromHSL();\n if (value !== this.gInternal) {\n this.gInternal = value;\n this.hslDirty = true;\n this.dirtyInternal = true;\n }\n }\n\n /** Blue component (0 to 1) */\n public set b(value: number) {\n this.ensureRGBUpdatedFromHSL();\n if (value !== this.bInternal) {\n this.bInternal = value;\n this.hslDirty = true;\n this.dirtyInternal = true;\n }\n }\n\n /** Alpha component (0 to 1) */\n public set a(value: number) {\n if (value !== this.aInternal) {\n this.aInternal = value;\n this.dirtyInternal = true;\n }\n }\n\n /** Hue component (0 to 360) */\n public set hue(value: number) {\n this.ensureHSLUpdatedFromRGB();\n if (value !== this.hInternal) {\n this.hInternal = value;\n this.rgbDirty = true;\n this.dirtyInternal = true;\n }\n }\n\n /** Saturation component (0 to 1) */\n public set saturation(value: number) {\n this.ensureHSLUpdatedFromRGB();\n if (value !== this.sInternal) {\n this.sInternal = value;\n this.rgbDirty = true;\n this.dirtyInternal = true;\n }\n }\n\n /** Lightness component (0 to 1) */\n public set lightness(value: number) {\n this.ensureHSLUpdatedFromRGB();\n if (value !== this.lInternal) {\n this.lInternal = value;\n this.rgbDirty = true;\n this.dirtyInternal = true;\n }\n }\n\n /** @internal */\n public setDirtyFalse(): void {\n this.dirtyInternal = false;\n }\n\n /** Sets RGB(A) components */\n public set(\n r: number,\n g: number,\n b: number,\n a: number = this.aInternal,\n ): this {\n this.ensureRGBUpdatedFromHSL();\n if (\n r !== this.rInternal ||\n g !== this.gInternal ||\n b !== this.bInternal ||\n a !== this.aInternal\n ) {\n this.rInternal = r;\n this.gInternal = g;\n this.bInternal = b;\n this.aInternal = a;\n this.hslDirty = true;\n this.dirtyInternal = true;\n }\n return this;\n }\n\n /** Returns RGBA as 32-bit hex (RRGGBBAA) */\n public getHexRGBA(): number {\n this.ensureRGBUpdatedFromHSL();\n return (\n (Math.round(this.rInternal * 255) << 24) |\n (Math.round(this.gInternal * 255) << 16) |\n (Math.round(this.bInternal * 255) << 8) |\n Math.round(this.aInternal * 255)\n );\n }\n\n /** Returns RGB as 24-bit hex (RRGGBB) */\n public getHexRGB(): number {\n this.ensureRGBUpdatedFromHSL();\n return (\n (Math.round(this.rInternal * 255) << 16) |\n (Math.round(this.gInternal * 255) << 8) |\n Math.round(this.bInternal * 255)\n );\n }\n\n /** Returns RGB as hex string (\"#ffffff\") */\n public getHexStringRGB(): string {\n const hex = this.getHexRGB();\n return `#${hex.toString(16).padStart(6, \"0\")}`;\n }\n\n /** Returns RGBA as hex string (\"#ffffffff\") */\n public getHexStringRGBA(): string {\n const hex = this.getHexRGBA();\n return `#${hex.toString(16).padStart(8, \"0\")}`;\n }\n\n /** Sets from 32-bit hex RGBA (RRGGBBAA) */\n public setHexRGBA(hex: number): this {\n this.ensureRGBUpdatedFromHSL();\n const r = ((hex >> 16) & 0xff) / 255;\n const g = ((hex >> 8) & 0xff) / 255;\n const b = (hex & 0xff) / 255;\n const a = ((hex >> 24) & 0xff) / 255;\n if (\n r !== this.rInternal ||\n g !== this.gInternal ||\n b !== this.bInternal ||\n a !== this.aInternal\n ) {\n this.rInternal = r;\n this.gInternal = g;\n this.bInternal = b;\n this.aInternal = a;\n this.hslDirty = true;\n this.dirtyInternal = true;\n }\n return this;\n }\n\n /** Sets from 24-bit hex RGB (RRGGBB) */\n public setHexRGB(hex: number, a = this.aInternal): this {\n this.ensureRGBUpdatedFromHSL();\n const r = ((hex >> 16) & 0xff) / 255;\n const g = ((hex >> 8) & 0xff) / 255;\n const b = (hex & 0xff) / 255;\n if (\n r !== this.rInternal ||\n g !== this.gInternal ||\n b !== this.bInternal ||\n a !== this.aInternal\n ) {\n this.rInternal = r;\n this.gInternal = g;\n this.bInternal = b;\n this.aInternal = a;\n this.hslDirty = true;\n this.dirtyInternal = true;\n }\n return this;\n }\n\n /**\n * Sets from hex string.\n *\n * @param hexString - Format: \"#ffffff\" or \"#ffffffff\"\n * @throws If format invalid\n */\n public setHexString(hexString: string): this {\n if (!hexString.startsWith(\"#\")) {\n throw new Error(\n `UIColor.setHexString.hexString: invalid hex string format. expected format: \"#ffffff\" or \"#ffffffff\"`,\n );\n }\n\n const hex = hexString.slice(1);\n\n if (hex.length === 6) {\n const hexNumber = parseInt(hex, 16);\n if (isNaN(hexNumber)) {\n throw new Error(\n `UIColor.setHexString.hexString: invalid hex string format. expected format: \"#ffffff\" or \"#ffffffff\"`,\n );\n }\n return this.setHexRGB(hexNumber);\n } else if (hex.length === 8) {\n const hexNumber = parseInt(hex, 16);\n if (isNaN(hexNumber)) {\n throw new Error(\n `UIColor.setHexString.hexString: invalid hex string format. expected format: \"#ffffff\" or \"#ffffffff\"`,\n );\n }\n return this.setHexRGBA(hexNumber);\n } else {\n throw new Error(\n `UIColor.setHexString.hexString: invalid hex string format. expected format: \"#ffffff\" or \"#ffffffff\"`,\n );\n }\n }\n\n /** Sets from HSL values */\n public setHSL(h: number, s: number, l: number, a = this.aInternal): this {\n this.ensureHSLUpdatedFromRGB();\n if (\n h !== this.hInternal ||\n s !== this.sInternal ||\n l !== this.lInternal ||\n a !== this.aInternal\n ) {\n this.hInternal = h;\n this.sInternal = s;\n this.lInternal = l;\n this.aInternal = a;\n this.rgbDirty = true;\n this.dirtyInternal = true;\n }\n return this;\n }\n\n /**\n * Sets from predefined name.\n *\n * @throws If color name unknown\n */\n public setColorName(colorName: UIColorName, a = this.aInternal): this {\n const normalizedName = colorName.toLowerCase().trim();\n const hex = COLORS[normalizedName];\n\n if (hex === undefined) {\n throw new Error(`UIColor.setColorName.colorName: unknown color name`);\n }\n\n return this.setHexRGB(hex, a);\n }\n\n /** Sets from linear (GLSL) color space */\n public setGLSLColor(\n r: number,\n g: number,\n b: number,\n a = this.aInternal,\n ): this {\n this.ensureRGBUpdatedFromHSL();\n\n const sRGBR = LinearToSRGB(r);\n const sRGBG = LinearToSRGB(g);\n const sRGBB = LinearToSRGB(b);\n\n if (\n sRGBR !== this.rInternal ||\n sRGBG !== this.gInternal ||\n sRGBB !== this.bInternal ||\n a !== this.aInternal\n ) {\n this.rInternal = sRGBR;\n this.gInternal = sRGBG;\n this.bInternal = sRGBB;\n this.aInternal = a;\n this.hslDirty = true;\n this.dirtyInternal = true;\n }\n\n return this;\n }\n\n /** Sets from Three.js Color */\n public setThreeColor(threeColor: Color, a = this.aInternal): this {\n this.ensureRGBUpdatedFromHSL();\n if (\n threeColor.r !== this.rInternal ||\n threeColor.g !== this.gInternal ||\n threeColor.b !== this.bInternal ||\n a !== this.aInternal\n ) {\n this.rInternal = threeColor.r;\n this.gInternal = threeColor.g;\n this.bInternal = threeColor.b;\n this.aInternal = a;\n this.hslDirty = true;\n this.dirtyInternal = true;\n }\n return this;\n }\n\n /** Returns CSS color string (\"rgba(255, 0, 0, 1)\") */\n public toCSSColor(): string {\n this.ensureRGBUpdatedFromHSL();\n const r = Math.round(this.rInternal * 255);\n const g = Math.round(this.gInternal * 255);\n const b = Math.round(this.bInternal * 255);\n return `rgba(${r}, ${g}, ${b}, ${this.aInternal})`;\n }\n\n /** Converts to linear (GLSL) color space */\n public toGLSLColor(result: Vector4 = new Vector4()): Vector4 {\n this.ensureRGBUpdatedFromHSL();\n\n result.x = SRGBToLinear(this.rInternal);\n result.y = SRGBToLinear(this.gInternal);\n result.z = SRGBToLinear(this.bInternal);\n result.w = this.aInternal;\n\n return result;\n }\n\n /** Converts to Three.js Color (without alpha) */\n public toThreeColor(result: Color = new Color()): Color {\n this.ensureRGBUpdatedFromHSL();\n\n result.r = this.rInternal;\n result.g = this.gInternal;\n result.b = this.bInternal;\n\n return result;\n }\n\n /** Copies from another color */\n public copy(color: UIColor | Color): this {\n if (color instanceof UIColor) {\n this.ensureRGBUpdatedFromHSL();\n color.ensureRGBUpdatedFromHSL();\n\n if (\n this.rInternal !== color.rInternal ||\n this.gInternal !== color.gInternal ||\n this.bInternal !== color.bInternal ||\n this.aInternal !== color.aInternal\n ) {\n this.rInternal = color.rInternal;\n this.gInternal = color.gInternal;\n this.bInternal = color.bInternal;\n this.aInternal = color.aInternal;\n this.hslDirty = true;\n this.dirtyInternal = true;\n }\n } else {\n this.ensureRGBUpdatedFromHSL();\n if (\n this.rInternal !== color.r ||\n this.gInternal !== color.g ||\n this.bInternal !== color.b ||\n this.aInternal !== 1\n ) {\n this.rInternal = color.r;\n this.gInternal = color.g;\n this.bInternal = color.b;\n this.aInternal = 1;\n this.hslDirty = true;\n this.dirtyInternal = true;\n }\n }\n\n return this;\n }\n\n /** Returns copy of this color */\n public clone(): UIColor {\n this.ensureRGBUpdatedFromHSL();\n return new UIColor(\n this.rInternal,\n this.gInternal,\n this.bInternal,\n this.aInternal,\n );\n }\n\n /** @internal */\n private ensureRGBUpdatedFromHSL(): void {\n if (this.rgbDirty) {\n const { hInternal: h, sInternal: s, lInternal: l } = this;\n const c = (1 - Math.abs(2 * l - 1)) * s;\n const hp = h / 60;\n const x = c * (1 - Math.abs((hp % 2) - 1));\n let [r, g, b] =\n hp < 1\n ? [c, x, 0]\n : hp < 2\n ? [x, c, 0]\n : hp < 3\n ? [0, c, x]\n : hp < 4\n ? [0, x, c]\n : hp < 5\n ? [x, 0, c]\n : [c, 0, x];\n\n const m = l - c / 2;\n this.rInternal = r + m;\n this.gInternal = g + m;\n this.bInternal = b + m;\n this.rgbDirty = false;\n }\n }\n\n /** @internal */\n private ensureHSLUpdatedFromRGB(): void {\n if (this.hslDirty) {\n const { rInternal: r, gInternal: g, bInternal: b } = this;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const d = max - min;\n const l = (max + min) / 2;\n\n let h = 0;\n if (d !== 0) {\n if (max === r) {\n h = (g - b) / d + (g < b ? 6 : 0);\n } else if (max === g) {\n h = (b - r) / d + 2;\n } else {\n h = (r - g) / d + 4;\n }\n h *= 60;\n }\n\n const s = d === 0 ? 0 : d / (1 - Math.abs(2 * l - 1));\n this.hInternal = h;\n this.sInternal = s;\n this.lInternal = l;\n this.hslDirty = false;\n }\n }\n}\n","import type { IUniform, ShaderMaterial } from \"three\";\nimport { Matrix3, Matrix4, Texture, Vector2, Vector3, Vector4 } from \"three\";\nimport type { UITransparencyMode } from \"../UITransparencyMode\";\nimport { UIColor } from \"../color/UIColor\";\n\nexport type UIPropertyType =\n | Texture\n | UIColor\n | Vector2\n | Vector3\n | Vector4\n | Matrix3\n | Matrix4\n | number;\n\nexport interface GLSLTypeInfo {\n instantiable: boolean;\n glslType: string;\n itemSize: number;\n}\n\nexport interface GenericPlaneData {\n source: string;\n properties: Record<string, UIPropertyType>;\n transparency: UITransparencyMode;\n transform: Matrix4;\n visibility: boolean;\n}\n\nexport const DEFAULT_ALPHA_TEST = 0.5;\n\nexport function resolveGLSLTypeInfo(value: UIPropertyType): GLSLTypeInfo {\n if (typeof value === \"number\") {\n return { glslType: \"float\", instantiable: true, itemSize: 1 };\n }\n if (value instanceof Texture) {\n return { glslType: \"sampler2D\", instantiable: false, itemSize: -1 };\n }\n if (value instanceof UIColor) {\n return { glslType: \"vec4\", instantiable: true, itemSize: 4 };\n }\n if (value instanceof Vector2) {\n return { glslType: \"vec2\", instantiable: true, itemSize: 2 };\n }\n if (value instanceof Vector3) {\n return { glslType: \"vec3\", instantiable: true, itemSize: 3 };\n }\n if (value instanceof Vector4) {\n return { glslType: \"vec4\", instantiable: true, itemSize: 4 };\n }\n if (value instanceof Matrix3) {\n return { glslType: \"mat3\", instantiable: true, itemSize: 9 };\n }\n if (value instanceof Matrix4) {\n return { glslType: \"mat4\", instantiable: true, itemSize: 16 };\n }\n throw new Error(`resolveGLSLTypeInfo.value: unsupported property type`);\n}\n\nexport function resolveUniform(\n name: string,\n material: ShaderMaterial,\n): IUniform<unknown> {\n const uniform = material.uniforms[`p_${name}`] as\n | IUniform<unknown>\n | undefined;\n if (uniform === undefined) {\n throw new Error(`resolveUniform.name: unknown uniform`);\n }\n return uniform;\n}\n\nexport function arePropertiesCompatible(\n currentProperties: Record<string, UIPropertyType>,\n newProperties: Record<string, UIPropertyType>,\n): boolean {\n const currentKeys = Object.keys(currentProperties);\n const newKeys = Object.keys(newProperties);\n\n if (currentKeys.length !== newKeys.length) {\n return false;\n }\n\n for (const newKey of newKeys) {\n if (!(newKey in currentProperties)) {\n return false;\n }\n\n const currentInfo = resolveGLSLTypeInfo(currentProperties[newKey]);\n const newInfo = resolveGLSLTypeInfo(newProperties[newKey]);\n\n if (currentInfo.glslType !== newInfo.glslType) {\n return false;\n }\n\n // Non-instantiable (textures) must match by reference\n if (\n !newInfo.instantiable &&\n newProperties[newKey] !== currentProperties[newKey]\n ) {\n return false;\n }\n }\n\n return true;\n}\n\nexport function buildGenericPlaneFragmentShader(\n uniformDeclarations: string[],\n varyingDeclarations: string[],\n source: string,\n): string {\n return `\n // Defines\n #define PI 3.14159265359\n\n // Uniforms\n ${uniformDeclarations.join(\"\\n\")}\n\n // Builtin varyings\n varying vec3 p_position;\n varying vec2 p_uv;\n\n // User varyings\n ${varyingDeclarations.join(\"\\n\")}\n\n #include <alphahash_pars_fragment>\n\n // Source must define vec4 draw() function\n ${source}\n\n void main() {\n vec4 diffuseColor = draw();\n\n #ifdef USE_ALPHATEST\n if (diffuseColor.a < ${DEFAULT_ALPHA_TEST.toFixed(2)}) {\n discard;\n }\n #endif\n\n #ifdef USE_ALPHAHASH\n if (diffuseColor.a < getAlphaHashThreshold(p_position)) {\n discard;\n }\n #endif\n\n gl_FragColor = linearToOutputTexel(diffuseColor);\n }\n `;\n}\n","import {\n InstancedBufferAttribute,\n InstancedBufferGeometry,\n Matrix3,\n Matrix4,\n PlaneGeometry,\n ShaderMaterial,\n Vector2,\n Vector3,\n Vector4,\n} from \"three\";\nimport { UIColor } from \"../color/UIColor\";\nimport { UITransparencyMode } from \"../UITransparencyMode\";\nimport type { UIPropertyType } from \"./shared\";\nimport {\n buildGenericPlaneFragmentShader,\n DEFAULT_ALPHA_TEST,\n resolveGLSLTypeInfo,\n} from \"./shared\";\n\nexport const INSTANCED_PLANE_GEOMETRY = ((): InstancedBufferGeometry => {\n const planeGeometry = new PlaneGeometry(1, 1);\n planeGeometry.translate(0.5, 0.5, 0);\n const geometry = new InstancedBufferGeometry();\n geometry.index = planeGeometry.index;\n geometry.setAttribute(\"position\", planeGeometry.attributes[\"position\"]);\n geometry.setAttribute(\"uv\", planeGeometry.attributes[\"uv\"]);\n planeGeometry.dispose();\n return geometry;\n})();\n\nexport const CAPACITY_STEP = 4;\n\nconst TEMP_COLOR_VECTOR = new Vector4();\nconst IDENTITY_MATRIX_ELEMENTS = [\n 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1,\n];\n\nexport function writePropertyToArray(\n value: UIPropertyType,\n array: Float32Array,\n offset: number,\n): void {\n if (value instanceof UIColor) {\n value.toGLSLColor(TEMP_COLOR_VECTOR);\n array[offset] = TEMP_COLOR_VECTOR.x;\n array[offset + 1] = TEMP_COLOR_VECTOR.y;\n array[offset + 2] = TEMP_COLOR_VECTOR.z;\n array[offset + 3] = TEMP_COLOR_VECTOR.w;\n } else if (value instanceof Vector2) {\n array[offset] = value.x;\n array[offset + 1] = value.y;\n } else if (value instanceof Vector3) {\n array[offset] = value.x;\n array[offset + 1] = value.y;\n array[offset + 2] = value.z;\n } else if (value instanceof Vector4) {\n array[offset] = value.x;\n array[offset + 1] = value.y;\n array[offset + 2] = value.z;\n array[offset + 3] = value.w;\n } else if (value instanceof Matrix3 || value instanceof Matrix4) {\n const elements = value.elements;\n for (let j = 0; j < elements.length; j++) {\n array[offset + j] = elements[j];\n }\n } else if (typeof value === \"number\") {\n array[offset] = value;\n }\n}\n\nexport function writeInstanceDefaults(\n visibilityArray: Float32Array,\n transformArray: Float32Array,\n index: number,\n): void {\n visibilityArray[index] = 1;\n\n const transformOffset = index * 16;\n for (let j = 0; j < 16; j++) {\n transformArray[transformOffset + j] = IDENTITY_MATRIX_ELEMENTS[j];\n }\n}\n\nexport function buildEmptyInstancedBufferAttribute(\n value: UIPropertyType,\n capacity: number,\n): InstancedBufferAttribute {\n const info = resolveGLSLTypeInfo(value);\n if (!info.instantiable) {\n throw new Error(\n `buildEmptyInstancedBufferAttribute.value: cannot create instanced attribute for non-instantiable type`,\n );\n }\n return new InstancedBufferAttribute(\n new Float32Array(capacity * info.itemSize),\n info.itemSize,\n );\n}\n\nexport function buildMaterial(\n source: string,\n uniformProperties: Record<string, UIPropertyType>,\n varyingProperties: Record<string, UIPropertyType>,\n transparency: UITransparencyMode,\n): ShaderMaterial {\n const uniforms: Record<string, { value: unknown }> = {};\n\n const uniformDeclarations: string[] = [];\n const attributeDeclarations: string[] = [];\n const varyingDeclarations: string[] = [];\n const vertexAssignments: string[] = [];\n\n for (const [name, value] of Object.entries(uniformProperties)) {\n const info = resolveGLSLTypeInfo(value);\n uniforms[`p_${name}`] = {\n value: value instanceof UIColor ? value.toGLSLColor() : value,\n };\n uniformDeclarations.push(`uniform ${info.glslType} p_${name};`);\n }\n\n for (const [name, value] of Object.entries(varyingProperties)) {\n const info = resolveGLSLTypeInfo(value);\n attributeDeclarations.push(`attribute ${info.glslType} a_${name};`);\n varyingDeclarations.push(`varying ${info.glslType} p_${name};`);\n vertexAssignments.push(`p_${name} = a_${name};`);\n }\n\n const vertexShader = `\n // User attributes\n ${attributeDeclarations.join(\"\\n\")}\n\n // Uniforms\n ${uniformDeclarations.join(\"\\n\")}\n\n // Builtin varyings\n varying vec3 p_position;\n varying vec2 p_uv;\n\n // User varyings\n ${varyingDeclarations.join(\"\\n\")}\n\n void main() {\n if (a_instanceVisibility < 0.5) {\n gl_Position = vec4(2.0, 2.0, 2.0, 1.0);\n return;\n }\n\n ${vertexAssignments.join(\"\\n\")}\n\n p_position = position;\n p_uv = uv;\n\n gl_Position = projectionMatrix * a_instanceTransform * vec4(position, 1.0);\n }\n `;\n\n const fragmentShader = buildGenericPlaneFragmentShader(\n uniformDeclarations,\n varyingDeclarations,\n source,\n );\n\n return new ShaderMaterial({\n uniforms,\n vertexShader,\n fragmentShader,\n transparent: transparency === UITransparencyMode.BLEND,\n alphaTest:\n transparency === UITransparencyMode.CLIP ? DEFAULT_ALPHA_TEST : 0.0,\n alphaHash: transparency === UITransparencyMode.HASH,\n depthWrite: transparency !== UITransparencyMode.BLEND,\n depthTest: true,\n });\n}\n\nexport function reconstructValue(\n referenceValue: UIPropertyType,\n array: Float32Array,\n offset: number,\n): UIPropertyType {\n if (typeof referenceValue === \"number\") {\n return array[offset];\n }\n if (referenceValue instanceof Vector2) {\n return new Vector2(array[offset], array[offset + 1]);\n }\n if (referenceValue instanceof Vector3) {\n return new Vector3(array[offset], array[offset + 1], array[offset + 2]);\n }\n if (referenceValue instanceof Vector4) {\n return new Vector4(\n array[offset],\n array[offset + 1],\n array[offset + 2],\n array[offset + 3],\n );\n }\n if (referenceValue instanceof UIColor) {\n return new UIColor().setGLSLColor(\n array[offset],\n array[offset + 1],\n array[offset + 2],\n array[offset + 3],\n );\n }\n if (referenceValue instanceof Matrix3) {\n const matrix = new Matrix3();\n matrix.fromArray(array, offset);\n return matrix;\n }\n if (referenceValue instanceof Matrix4) {\n const matrix = new Matrix4();\n matrix.fromArray(array, offset);\n return matrix;\n }\n throw new Error(\n `reconstructValue.referenceValue: cannot reconstruct value for type`,\n );\n}\n","import type { InstancedBufferGeometry, ShaderMaterial } from \"three\";\nimport { InstancedBufferAttribute, Matrix4, Mesh } from \"three\";\nimport { UITransparencyMode } from \"../UITransparencyMode\";\nimport type { GenericPlaneData, UIPropertyType } from \"./shared\";\nimport {\n arePropertiesCompatible,\n resolveGLSLTypeInfo,\n resolveUniform,\n} from \"./shared\";\nimport {\n buildEmptyInstancedBufferAttribute,\n buildMaterial,\n CAPACITY_STEP,\n INSTANCED_PLANE_GEOMETRY,\n reconstructValue,\n writeInstanceDefaults,\n writePropertyToArray,\n} from \"./UIGenericInstancedPlane.Internal\";\n\nexport class UIGenericInstancedPlane extends Mesh {\n private readonly handlerToIndex = new Map<number, number>();\n private readonly propertyBuffers = new Map<\n string,\n InstancedBufferAttribute\n >();\n private readonly instancedGeometry: InstancedBufferGeometry;\n private readonly shaderMaterial: ShaderMaterial;\n\n private readonly uniformProperties: Record<string, UIPropertyType>;\n private readonly varyingProperties: Record<string, UIPropertyType>;\n\n private lastHandler = 0;\n private capacity: number;\n\n constructor(\n public readonly source: string,\n properties: Record<string, UIPropertyType>,\n public readonly transparency: UITransparencyMode = UITransparencyMode.BLEND,\n initialCapacity: number = CAPACITY_STEP,\n ) {\n const uniformProperties: Record<string, UIPropertyType> = {};\n const varyingProperties: Record<string, UIPropertyType> = {\n instanceVisibility: 1,\n instanceTransform: new Matrix4().identity(),\n };\n\n for (const [name, value] of Object.entries(properties)) {\n const info = resolveGLSLTypeInfo(value);\n if (info.instantiable) {\n varyingProperties[name] = value;\n } else {\n uniformProperties[name] = value;\n }\n }\n\n const instancedGeometry = INSTANCED_PLANE_GEOMETRY.clone();\n const shaderMaterial = buildMaterial(\n source,\n uniformProperties,\n varyingProperties,\n transparency,\n );\n\n super(instancedGeometry, shaderMaterial);\n\n this.frustumCulled = false;\n this.matrixAutoUpdate = false;\n this.matrixWorldAutoUpdate = false;\n\n this.instancedGeometry = instancedGeometry;\n this.instancedGeometry.instanceCount = 0;\n this.shaderMaterial = shaderMaterial;\n this.uniformProperties = uniformProperties;\n this.varyingProperties = varyingProperties;\n this.capacity = Math.max(\n Math.ceil(initialCapacity / CAPACITY_STEP) * CAPACITY_STEP,\n CAPACITY_STEP,\n );\n\n {\n for (const [name, value] of Object.entries(this.varyingProperties)) {\n const attribute = buildEmptyInstancedBufferAttribute(\n value,\n this.capacity,\n );\n this.instancedGeometry.setAttribute(`a_${name}`, attribute);\n this.propertyBuffers.set(name, attribute);\n }\n }\n\n {\n for (const [name, value] of Object.entries(this.uniformProperties)) {\n const uniform = resolveUniform(name, this.shaderMaterial);\n uniform.value = value;\n }\n this.shaderMaterial.uniformsNeedUpdate = true;\n }\n }\n\n public get instanceCount(): number {\n return this.instancedGeometry.instanceCount;\n }\n\n public get properties(): Record<string, UIPropertyType> {\n return { ...this.uniformProperties, ...this.varyingProperties };\n }\n\n public createInstance(): number {\n const handler = this.lastHandler++;\n const index = this.instancedGeometry.instanceCount;\n\n this.ensureCapacity(index + 1);\n\n this.handlerToIndex.set(handler, index);\n this.instancedGeometry.instanceCount++;\n\n this.initializeInstanceDefaults(index);\n return handler;\n }\n\n public destroyInstance(handler: number): void {\n const index = this.resolveIndex(handler);\n\n this.handlerToIndex.delete(handler);\n\n const lastIndex = this.instancedGeometry.instanceCount - 1;\n\n if (index < lastIndex) {\n this.moveInstanceData(lastIndex, index);\n this.updateIndicesAfterMove(lastIndex, index);\n }\n\n this.instancedGeometry.instanceCount--;\n }\n\n public setProperties(\n handler: number,\n properties: Record<string, UIPropertyType>,\n ): void {\n const index = this.resolveIndex(handler);\n\n for (const [name, value] of Object.entries(properties)) {\n const typeInfo = resolveGLSLTypeInfo(value);\n\n if (typeInfo.instantiable) {\n const attribute = this.resolveAttribute(name);\n const offset = index * attribute.itemSize;\n writePropertyToArray(value, attribute.array as Float32Array, offset);\n attribute.needsUpdate = true;\n } else {\n const uniform = resolveUniform(name, this.shaderMaterial);\n uniform.value = value;\n this.shaderMaterial.uniformsNeedUpdate = true;\n }\n }\n }\n\n public setTransform(handler: number, transform: Matrix4): void {\n const index = this.resolveIndex(handler);\n\n const attribute = this.resolveAttribute(\"instanceTransform\");\n const array = attribute.array as Float32Array;\n const offset = index * 16;\n\n const elements = transform.elements;\n for (let j = 0; j < 16; j++) {\n array[offset + j] = elements[j];\n }\n\n attribute.needsUpdate = true;\n }\n\n public setVisibility(handler: number, visible: boolean): void {\n const index = this.resolveIndex(handler);\n\n const attribute = this.resolveAttribute(\"instanceVisibility\");\n const array = attribute.array as Float32Array;\n array[index] = visible ? 1 : 0;\n\n attribute.needsUpdate = true;\n }\n\n public isCompatible(\n source: string,\n properties: Record<string, UIPropertyType>,\n transparency: UITransparencyMode = UITransparencyMode.BLEND,\n ): boolean {\n if (this.source !== source || this.transparency !== transparency) {\n return false;\n }\n\n return arePropertiesCompatible(this.properties, properties);\n }\n\n public arePropertiesCompatible(\n properties: Record<string, UIPropertyType>,\n ): boolean {\n return arePropertiesCompatible(this.properties, properties);\n }\n\n public extractInstanceData(handler: number): GenericPlaneData {\n return {\n source: this.source,\n properties: this.extractProperties(handler),\n transparency: this.transparency,\n transform: this.extractTransform(handler),\n visibility: this.extractVisibility(handler),\n };\n }\n\n public extractProperties(handler: number): Record<string, UIPropertyType> {\n const index = this.resolveIndex(handler);\n const result: Record<string, UIPropertyType> = {};\n\n for (const [name, value] of Object.entries(this.uniformProperties)) {\n result[name] = value;\n }\n\n for (const [name, referenceValue] of Object.entries(\n this.varyingProperties,\n )) {\n const attribute = this.propertyBuffers.get(\n name,\n ) as InstancedBufferAttribute;\n const array = attribute.array as Float32Array;\n const offset = index * attribute.itemSize;\n result[name] = reconstructValue(referenceValue, array, offset);\n }\n\n return result;\n }\n\n public extractTransform(handler: number): Matrix4 {\n const index = this.resolveIndex(handler);\n const attribute = this.propertyBuffers.get(\n \"instanceTransform\",\n ) as InstancedBufferAttribute;\n const array = attribute.array as Float32Array;\n\n const matrix = new Matrix4();\n matrix.fromArray(array, index * 16);\n return matrix;\n }\n\n public extractVisibility(handler: number): boolean {\n const index = this.resolveIndex(handler);\n const attribute = this.propertyBuffers.get(\n \"instanceVisibility\",\n ) as InstancedBufferAttribute;\n const array = attribute.array as Float32Array;\n return array[index] >= 0.5;\n }\n\n public destroy(): void {\n this.instancedGeometry.dispose();\n this.shaderMaterial.dispose();\n this.propertyBuffers.clear();\n this.handlerToIndex.clear();\n }\n\n private initializeInstanceDefaults(index: number): void {\n const visibilityAttr = this.propertyBuffers.get(\n \"instanceVisibility\",\n ) as InstancedBufferAttribute;\n const transformAttr = this.propertyBuffers.get(\n \"instanceTransform\",\n ) as InstancedBufferAttribute;\n\n writeInstanceDefaults(\n visibilityAttr.array as Float32Array,\n transformAttr.array as Float32Array,\n index,\n );\n\n visibilityAttr.needsUpdate = true;\n transformAttr.needsUpdate = true;\n }\n\n private ensureCapacity(requiredCapacity: number): void {\n if (requiredCapacity <= this.capacity) {\n return;\n }\n\n const newCapacity =\n Math.ceil(requiredCapacity / CAPACITY_STEP) * CAPACITY_STEP;\n\n for (const [name, oldAttribute] of this.propertyBuffers.entries()) {\n const itemSize = oldAttribute.itemSize;\n const newArray = new Float32Array(newCapacity * itemSize);\n newArray.set(oldAttribute.array as Float32Array);\n\n const newAttribute = new InstancedBufferAttribute(newArray, itemSize);\n this.instancedGeometry.setAttribute(`a_${name}`, newAttribute);\n this.propertyBuffers.set(name, newAttribute);\n }\n\n this.capacity = newCapacity;\n }\n\n private moveInstanceData(sourceIndex: number, targetIndex: number): void {\n for (const attribute of this.propertyBuffers.values()) {\n const array = attribute.array as Float32Array;\n const itemSize = attribute.itemSize;\n\n const srcOffset = sourceIndex * itemSize;\n const dstOffset = targetIndex * itemSize;\n\n for (let i = 0; i < itemSize; i++) {\n array[dstOffset + i] = array[srcOffset + i];\n }\n\n attribute.needsUpdate = true;\n }\n }\n\n private updateIndicesAfterMove(oldIndex: number, newIndex: number): void {\n for (const [handler, index] of this.handlerToIndex) {\n if (index === oldIndex) {\n this.handlerToIndex.set(handler, newIndex);\n break;\n }\n }\n }\n\n private resolveIndex(handler: number): number {\n const index = this.handlerToIndex.get(handler);\n if (index === undefined) {\n throw new Error(\n `UIGenericInstancedPlane.resolveIndex.handler: invalid handler`,\n );\n }\n return index;\n }\n\n private resolveAttribute(name: string): InstancedBufferAttribute {\n const attribute = this.propertyBuffers.get(name);\n if (attribute === undefined) {\n throw new Error(\n `UIGenericInstancedPlane.resolveAttribute.name: unknown attribute`,\n );\n }\n return attribute;\n }\n}\n","import { Matrix4, PlaneGeometry, ShaderMaterial } from \"three\";\n\nimport { UIColor } from \"../color/UIColor\";\nimport { UITransparencyMode } from \"../UITransparencyMode\";\nimport type { UIPropertyType } from \"./shared\";\nimport {\n buildGenericPlaneFragmentShader,\n DEFAULT_ALPHA_TEST,\n resolveGLSLTypeInfo,\n} from \"./shared\";\n\nexport const PLANE_GEOMETRY = new PlaneGeometry(1, 1).translate(0.5, 0.5, 0);\n\nexport function buildGenericPlaneMaterial(\n source: string,\n properties: Record<string, UIPropertyType>,\n transparency: UITransparencyMode,\n): ShaderMaterial {\n const uniforms: Record<string, { value: unknown }> = {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n p_transform: { value: new Matrix4() },\n };\n\n const uniformDeclarations: string[] = [];\n\n for (const [name, value] of Object.entries(properties)) {\n const info = resolveGLSLTypeInfo(value);\n uniforms[`p_${name}`] = {\n value: value instanceof UIColor ? value.toGLSLColor() : value,\n };\n uniformDeclarations.push(`uniform ${info.glslType} p_${name};`);\n }\n\n const vertexShader = `\n // Default uniform declarations\n uniform mat4 p_transform;\n\n // Custom uniform declarations\n ${uniformDeclarations.join(\"\\n\")}\n\n // Default varying declarations\n varying vec3 p_position;\n varying vec2 p_uv;\n\n void main() {\n p_position = position;\n p_uv = uv;\n\n gl_Position = projectionMatrix * p_transform * vec4(position, 1.0);\n }\n `;\n\n const fragmentShader = buildGenericPlaneFragmentShader(\n uniformDeclarations,\n [],\n source,\n );\n\n const material = new ShaderMaterial({\n uniforms,\n vertexShader,\n fragmentShader,\n transparent: transparency === UITransparencyMode.BLEND,\n alphaTest:\n transparency === UITransparencyMode.CLIP ? DEFAULT_ALPHA_TEST : 0.0,\n alphaHash: transparency === UITransparencyMode.HASH,\n depthWrite: transparency !== UITransparencyMode.BLEND,\n depthTest: true,\n });\n\n return material;\n}\n","import type { ShaderMaterial, Vector4 } from \"three\";\nimport { Matrix4, Mesh } from \"three\";\n\nimport { UIColor } from \"../color/UIColor\";\nimport { UITransparencyMode } from \"../UITransparencyMode\";\nimport type { GenericPlaneData, UIPropertyType } from \"./shared\";\nimport {\n arePropertiesCompatible,\n DEFAULT_ALPHA_TEST,\n resolveUniform,\n} from \"./shared\";\nimport {\n buildGenericPlaneMaterial,\n PLANE_GEOMETRY,\n} from \"./UIGenericPlane.Internal\";\n\nexport class UIGenericPlane extends Mesh {\n private readonly shaderMaterial: ShaderMaterial;\n private readonly propertiesInternal: Record<string, UIPropertyType>;\n private readonly transformInternal = new Matrix4().identity();\n private transparencyInternal: UITransparencyMode;\n\n constructor(\n public readonly source: string,\n properties: Record<string, UIPropertyType>,\n transparency: UITransparencyMode,\n ) {\n const shaderMaterial = buildGenericPlaneMaterial(\n source,\n properties,\n transparency,\n );\n super(PLANE_GEOMETRY, shaderMaterial);\n\n this.frustumCulled = false;\n this.matrixAutoUpdate = false;\n this.matrixWorldAutoUpdate = false;\n\n this.shaderMaterial = shaderMaterial;\n this.propertiesInternal = { ...properties };\n this.transparencyInternal = transparency;\n }\n\n public get properties(): Record<string, UIPropertyType> {\n return { ...this.propertiesInternal };\n }\n\n public get transform(): Matrix4 {\n return this.transformInternal;\n }\n\n public get visibility(): boolean {\n return this.visible;\n }\n\n public get transparency(): UITransparencyMode {\n return this.transparencyInternal;\n }\n\n public setProperties(properties: Record<string, UIPropertyType>): void {\n for (const [name, value] of Object.entries(properties)) {\n const uniform = resolveUniform(name, this.shaderMaterial);\n if (value instanceof UIColor) {\n value.toGLSLColor(uniform.value as Vector4);\n } else {\n uniform.value = value;\n }\n this.propertiesInternal[name] = value;\n }\n this.shaderMaterial.uniformsNeedUpdate = true;\n }\n\n public setTransform(transform: Matrix4): void {\n const uniform = resolveUniform(\"transform\", this.shaderMaterial);\n (uniform.value as Matrix4).copy(transform);\n this.shaderMaterial.uniformsNeedUpdate = true;\n this.transformInternal.copy(transform);\n }\n\n public setVisibility(visibility: boolean): void {\n this.visible = visibility;\n }\n\n public setTransparency(transparency: UITransparencyMode): void {\n if (this.transparencyInternal !== transparency) {\n this.shaderMaterial.transparent =\n transparency === UITransparencyMode.BLEND;\n this.shaderMaterial.alphaTest =\n transparency === UITransparencyMode.CLIP ? DEFAULT_ALPHA_TEST : 0.0;\n this.shaderMaterial.alphaHash = transparency === UITransparencyMode.HASH;\n this.shaderMaterial.depthWrite =\n transparency !== UITransparencyMode.BLEND;\n this.shaderMaterial.needsUpdate = true;\n\n this.transparencyInternal = transparency;\n }\n }\n\n public extractInstanceData(): GenericPlaneData {\n return {\n source: this.source,\n properties: this.properties,\n transparency: this.transparencyInternal,\n transform: this.transformInternal.clone(),\n visibility: this.visible,\n };\n }\n\n public isCompatible(\n source: string,\n properties: Record<string, UIPropertyType>,\n transparency: UITransparencyMode,\n ): boolean {\n if (this.transparencyInternal !== transparency || this.source !== source) {\n return false;\n }\n\n return arePropertiesCompatible(this.propertiesInternal, properties);\n }\n\n public arePropertiesCompatible(\n properties: Record<string, UIPropertyType>,\n ): boolean {\n return arePropertiesCompatible(this.propertiesInternal, properties);\n }\n\n public destroy(): void {\n this.shaderMaterial.dispose();\n }\n}\n","import type { Matrix4, Scene } from \"three\";\nimport type { UITransparencyMode } from \"../UITransparencyMode\";\nimport type { GenericPlaneData, UIPropertyType } from \"./shared\";\nimport { UIGenericInstancedPlane } from \"./UIGenericInstancedPlane\";\nimport { UIGenericPlane } from \"./UIGenericPlane\";\nimport type { GenericPlaneDescriptor } from \"./UIGenericPlaneRegistry.Internal\";\n\nexport class UIPlaneRegistry {\n private readonly descriptors = new Map<number, GenericPlaneDescriptor>();\n private lastHandler = 0;\n\n constructor(private readonly scene: Scene) {}\n\n public create(\n source: string,\n properties: Record<string, UIPropertyType>,\n transparency: UITransparencyMode,\n ): number {\n const handler = this.lastHandler++;\n\n const descriptor: GenericPlaneDescriptor = {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n plane: undefined!,\n };\n this.descriptors.set(handler, descriptor);\n\n this.placeInstance(descriptor, {\n source,\n properties,\n transparency,\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n transform: undefined!,\n visibility: true,\n });\n\n return handler;\n }\n\n public destroy(handler: number): void {\n const descriptor = this.resolveDescriptor(handler);\n this.descriptors.delete(handler);\n this.removeFromCurrentPlane(descriptor);\n }\n\n public setTransform(handler: number, transform: Matrix4): void {\n const descriptor = this.resolveDescriptor(handler);\n\n if (\n descriptor.plane instanceof UIGenericInstancedPlane &&\n descriptor.instanceHandler !== undefined\n ) {\n descriptor.plane.setTransform(descriptor.instanceHandler, transform);\n } else if (descriptor.plane instanceof UIGenericPlane) {\n descriptor.plane.setTransform(transform);\n }\n }\n\n public setProperties(\n handler: number,\n properties: Record<string, UIPropertyType>,\n ): void {\n const descriptor = this.resolveDescriptor(handler);\n\n const currentData = this.extractInstanceData(descriptor);\n const newProperties = { ...currentData.properties, ...properties };\n\n const needsRelocation = this.checkNeedsRelocation(\n descriptor,\n currentData,\n newProperties,\n currentData.transparency,\n );\n\n if (needsRelocation) {\n this.removeFromCurrentPlane(descriptor);\n this.placeInstance(descriptor, {\n ...currentData,\n properties: newProperties,\n });\n } else {\n this.updatePropertiesInPlace(descriptor, properties);\n }\n }\n\n public setVisibility(handler: number, visible: boolean): void {\n const descriptor = this.resolveDescriptor(handler);\n\n if (\n descriptor.plane instanceof UIGenericInstancedPlane &&\n descriptor.instanceHandler !== undefined\n ) {\n descriptor.plane.setVisibility(descriptor.instanceHandler, visible);\n } else if (descriptor.plane instanceof UIGenericPlane) {\n descriptor.plane.setVisibility(visible);\n }\n }\n\n public setTransparency(\n handler: number,\n transparency: UITransparencyMode,\n ): void {\n const descriptor = this.resolveDescriptor(handler);\n const currentData = this.extractInstanceData(descriptor);\n\n if (currentData.transparency === transparency) {\n return;\n }\n\n const needsRelocation = this.checkNeedsRelocation(\n descriptor,\n currentData,\n currentData.properties,\n transparency,\n );\n\n if (needsRelocation) {\n this.removeFromCurrentPlane(descriptor);\n this.placeInstance(descriptor, {\n ...currentData,\n transparency,\n });\n } else if (descriptor.plane instanceof UIGenericPlane) {\n descriptor.plane.setTransparency(transparency);\n }\n }\n\n private placeInstance(\n descriptor: GenericPlaneDescriptor,\n data: GenericPlaneData,\n ): void {\n const { source, properties, transparency, transform, visibility } = data;\n\n const compatibleInstanced = this.findCompatibleInstancedPlane(\n source,\n properties,\n transparency,\n );\n\n if (compatibleInstanced) {\n this.attachToInstancedPlane(\n descriptor,\n compatibleInstanced,\n properties,\n transform,\n visibility,\n );\n return;\n }\n\n const promotable = this.findCompatibleSinglePlane(\n source,\n properties,\n transparency,\n descriptor,\n );\n\n if (promotable) {\n const instancedPlane = this.promoteToInstanced(promotable, properties);\n this.attachToInstancedPlane(\n descriptor,\n instancedPlane,\n properties,\n transform,\n visibility,\n );\n return;\n }\n\n this.createSinglePlane(\n descriptor,\n source,\n properties,\n transparency,\n transform,\n visibility,\n );\n }\n\n private extractInstanceData(\n descriptor: GenericPlaneDescriptor,\n ): GenericPlaneData {\n if (\n descriptor.plane instanceof UIGenericInstancedPlane &&\n descriptor.instanceHandler !== undefined\n ) {\n return descriptor.plane.extractInstanceData(descriptor.instanceHandler);\n }\n\n return (descriptor.plane as UIGenericPlane).extractInstanceData();\n }\n\n private removeFromCurrentPlane(descriptor: GenericPlaneDescriptor): void {\n if (\n descriptor.plane instanceof UIGenericInstancedPlane &&\n descriptor.instanceHandler !== undefined\n ) {\n const instancedPlane = descriptor.plane;\n instancedPlane.destroyInstance(descriptor.instanceHandler);\n\n if (instancedPlane.instanceCount === 0) {\n this.scene.remove(instancedPlane);\n instancedPlane.destroy();\n } else if (instancedPlane.instanceCount === 1) {\n this.demoteToSingle(instancedPlane, descriptor);\n }\n } else if (descriptor.plane instanceof UIGenericPlane) {\n this.scene.remove(descriptor.plane);\n descriptor.plane.destroy();\n }\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n descriptor.plane = undefined!;\n delete descriptor.instanceHandler;\n }\n\n private updatePropertiesInPlace(\n descriptor: GenericPlaneDescriptor,\n properties: Record<string, UIPropertyType>,\n ): void {\n if (\n descriptor.plane instanceof UIGenericInstancedPlane &&\n descriptor.instanceHandler !== undefined\n ) {\n descriptor.plane.setProperties(descriptor.instanceHandler, properties);\n } else if (descriptor.plane instanceof UIGenericPlane) {\n descriptor.plane.setProperties(properties);\n }\n }\n\n private checkNeedsRelocation(\n descriptor: GenericPlaneDescriptor,\n currentData: GenericPlaneData,\n newProperties: Record<string, UIPropertyType>,\n newTransparency: UITransparencyMode,\n ): boolean {\n const isInstanced = descriptor.plane instanceof UIGenericInstancedPlane;\n\n if (isInstanced) {\n if (currentData.transparency !== newTransparency) {\n return true;\n }\n\n return !descriptor.plane.arePropertiesCompatible(newProperties);\n }\n\n const compatibleInstanced = this.findCompatibleInstancedPlane(\n currentData.source,\n newProperties,\n newTransparency,\n );\n if (compatibleInstanced) {\n return true;\n }\n\n const promotable = this.findCompatibleSinglePlane(\n currentData.source,\n newProperties,\n newTransparency,\n descriptor,\n );\n if (promotable) {\n return true;\n }\n\n return false;\n }\n\n private attachToInstancedPlane(\n descriptor: GenericPlaneDescriptor,\n instancedPlane: UIGenericInstancedPlane,\n properties: Record<string, UIPropertyType>,\n transform: Matrix4 | undefined,\n visibility: boolean,\n ): void {\n const instanceHandler = instancedPlane.createInstance();\n instancedPlane.setProperties(instanceHandler, properties);\n if (transform) {\n instancedPlane.setTransform(instanceHandler, transform);\n }\n instancedPlane.setVisibility(instanceHandler, visibility);\n\n descriptor.plane = instancedPlane;\n descriptor.instanceHandler = instanceHandler;\n }\n\n private createSinglePlane(\n descriptor: GenericPlaneDescriptor,\n source: string,\n properties: Record<string, UIPropertyType>,\n transparency: UITransparencyMode,\n transform: Matrix4 | undefined,\n visibility: boolean,\n ): void {\n const singlePlane = new UIGenericPlane(source, properties, transparency);\n singlePlane.setProperties(properties);\n if (transform) {\n singlePlane.setTransform(transform);\n }\n singlePlane.setVisibility(visibility);\n this.scene.add(singlePlane);\n\n descriptor.plane = singlePlane;\n delete descriptor.instanceHandler;\n }\n\n private findCompatibleSinglePlane(\n source: string,\n properties: Record<string, UIPropertyType>,\n transparency: UITransparencyMode,\n excludeDescriptor?: GenericPlaneDescriptor,\n ): GenericPlaneDescriptor | undefined {\n for (const descriptor of this.descriptors.values()) {\n if (descriptor === excludeDescriptor) {\n continue;\n }\n\n if (\n descriptor.plane instanceof UIGenericPlane &&\n descriptor.plane.isCompatible(source, properties, transparency)\n ) {\n return descriptor;\n }\n }\n return undefined;\n }\n\n private findCompatibleInstancedPlane(\n source: string,\n properties: Record<string, UIPropertyType>,\n transparency: UITransparencyMode,\n ): UIGenericInstancedPlane | undefined {\n for (const descriptor of this.descriptors.values()) {\n if (\n descriptor.plane instanceof UIGenericInstancedPlane &&\n descriptor.plane.isCompatible(source, properties, transparency)\n ) {\n return descriptor.plane;\n }\n }\n return undefined;\n }\n\n private promoteToInstanced(\n promotableDescriptor: GenericPlaneDescriptor,\n templateProperties: Record<string, UIPropertyType>,\n ): UIGenericInstancedPlane {\n const oldPlane = promotableDescriptor.plane as UIGenericPlane;\n const oldData = oldPlane.extractInstanceData();\n\n const instancedPlane = new UIGenericInstancedPlane(\n oldData.source,\n templateProperties,\n oldData.transparency,\n );\n\n const oldInstanceHandler = instancedPlane.createInstance();\n instancedPlane.setProperties(oldInstanceHandler, oldData.properties);\n instancedPlane.setTransform(oldInstanceHandler, oldData.transform);\n instancedPlane.setVisibility(oldInstanceHandler, oldData.visibility);\n\n promotableDescriptor.plane = instancedPlane;\n promotableDescriptor.instanceHandler = oldInstanceHandler;\n\n this.scene.remove(oldPlane);\n oldPlane.destroy();\n this.scene.add(instancedPlane);\n\n return instancedPlane;\n }\n\n private demoteToSingle(\n instancedPlane: UIGenericInstancedPlane,\n removedDescriptor: GenericPlaneDescriptor,\n ): void {\n let remainingDescriptor: GenericPlaneDescriptor | undefined;\n\n for (const descriptor of this.descriptors.values()) {\n if (\n descriptor !== removedDescriptor &&\n descriptor.plane === instancedPlane &&\n descriptor.instanceHandler !== undefined\n ) {\n remainingDescriptor = descriptor;\n break;\n }\n }\n\n if (!remainingDescriptor) {\n return;\n }\n\n const data = instancedPlane.extractInstanceData(\n remainingDescriptor.instanceHandler as number,\n );\n\n const singlePlane = new UIGenericPlane(\n data.source,\n data.properties,\n data.transparency,\n );\n singlePlane.setProperties(data.properties);\n singlePlane.setTransform(data.transform);\n singlePlane.setVisibility(data.visibility);\n\n this.scene.remove(instancedPlane);\n instancedPlane.destroy();\n this.scene.add(singlePlane);\n\n remainingDescriptor.plane = singlePlane;\n delete remainingDescriptor.instanceHandler;\n }\n\n private resolveDescriptor(handler: number): GenericPlaneDescriptor {\n const descriptor = this.descriptors.get(handler);\n if (!descriptor) {\n throw new Error(\n `UIGenericPlaneRegistry.resolveDescriptor.handler: descriptor not found`,\n );\n }\n return descriptor;\n }\n}\n","import type { Matrix4, Object3D, WebGLRenderer } from \"three\";\nimport { Color, OrthographicCamera, Scene } from \"three\";\nimport type { UIPropertyType } from \"../miscellaneous/generic-plane/shared\";\nimport { UIPlaneRegistry } from \"../miscellaneous/generic-plane/UIGenericPlaneRegistry\";\nimport type { UITransparencyMode } from \"../miscellaneous/UITransparencyMode\";\n\nlet originalClearColor = new Color();\nlet originalClearAlpha = 0;\nlet originalAutoClear = false;\nlet originalAutoClearColor = false;\nlet originalAutoClearDepth = false;\nlet originalAutoClearStencil = false;\n\nexport class UISceneWrapper {\n private readonly scene = new Scene();\n private readonly camera: OrthographicCamera;\n private readonly registry = new UIPlaneRegistry(this.scene);\n\n constructor(width: number, height: number) {\n this.camera = new OrthographicCamera(0, width, height, 0, -1024, 1024);\n }\n\n public createPlane(\n source: string,\n properties: Record<string, UIPropertyType>,\n transparency: UITransparencyMode,\n ): number {\n return this.registry.create(source, properties, transparency);\n }\n\n public destroyPlane(handler: number): void {\n this.registry.destroy(handler);\n }\n\n public setTransform(handler: number, transform: Matrix4): void {\n this.registry.setTransform(handler, transform);\n }\n\n public setProperties(\n handler: number,\n properties: Record<string, UIPropertyType>,\n ): void {\n this.registry.setProperties(handler, properties);\n }\n\n public setVisibility(handler: number, visible: boolean): void {\n this.registry.setVisibility(handler, visible);\n }\n\n public setTransparency(\n handler: number,\n transparency: UITransparencyMode,\n ): void {\n this.registry.setTransparency(handler, transparency);\n }\n\n public insertCustomObject(object: Object3D): this {\n this.scene.add(object);\n return this;\n }\n\n public removeCustomObject(object: Object3D): this {\n this.scene.remove(object);\n return this;\n }\n\n public resize(width: number, height: number): this {\n this.camera.right = width;\n this.camera.top = height;\n this.camera.updateProjectionMatrix();\n return this;\n }\n\n public render(renderer: WebGLRenderer): this {\n originalClearColor = renderer.getClearColor(originalClearColor);\n originalClearAlpha = renderer.getClearAlpha();\n originalAutoClear = renderer.autoClear;\n originalAutoClearColor = renderer.autoClearColor;\n originalAutoClearDepth = renderer.autoClearDepth;\n originalAutoClearStencil = renderer.autoClearStencil;\n\n renderer.autoClear = false;\n renderer.autoClearColor = false;\n renderer.autoClearDepth = false;\n renderer.autoClearStencil = false;\n renderer.setClearColor(0x000000, 1);\n\n renderer.clear(false, true, true);\n renderer.render(this.scene, this.camera);\n\n renderer.setClearColor(originalClearColor);\n renderer.setClearAlpha(originalClearAlpha);\n renderer.autoClear = originalAutoClear;\n renderer.autoClearColor = originalAutoClearColor;\n renderer.autoClearDepth = originalAutoClearDepth;\n renderer.autoClearStencil = originalAutoClearStencil;\n\n return this;\n }\n}\n","/** Linear expression for constraint equations */\nexport class UIExpression {\n /** Constant term */\n public constant: number;\n /** Variable coefficients */\n private readonly terms: Map<number, number>;\n\n /**\n * @param constant Constant term\n * @param terms Variable-coefficient pairs\n */\n constructor(constant = 0, terms?: [number, number][]) {\n this.constant = constant;\n this.terms = terms ? new Map(terms) : new Map();\n }\n\n /**\n * Creates expression representing a + b.\n * @param a First expression\n * @param b Second expression\n * @returns Sum of expressions\n */\n public static plus(a: UIExpression, b: UIExpression): UIExpression {\n const result = new UIExpression(\n a.constant + b.constant,\n Array.from(a.terms.entries()),\n );\n for (const [variableIndex, coefficient] of b.terms) {\n result.plus(variableIndex, coefficient);\n }\n return result;\n }\n\n /**\n * Creates expression representing a - b.\n * @param a First expression\n * @param b Second expression\n * @returns Difference of expressions\n */\n public static minus(a: UIExpression, b: UIExpression): UIExpression {\n const result = new UIExpression(\n a.constant - b.constant,\n Array.from(a.terms.entries()),\n );\n for (const [variableIndex, coefficient] of b.terms) {\n result.minus(variableIndex, coefficient);\n }\n return result;\n }\n\n /**\n * Adds variable term to expression.\n * @param variableIndex Variable descriptor\n * @param coefficient Coefficient to add\n * @returns This instance for chaining\n */\n public plus(variableIndex: number, coefficient: number): this {\n this.terms.set(\n variableIndex,\n (this.terms.get(variableIndex) ?? 0) + coefficient,\n );\n return this;\n }\n\n /**\n * Subtracts variable term from expression.\n * @param variableIndex Variable descriptor\n * @param coefficient Coefficient to subtract\n * @returns This instance for chaining\n */\n public minus(variableIndex: number, coefficient: number): this {\n return this.plus(variableIndex, -coefficient);\n }\n\n /**\n * Multiplies all terms by scalar.\n * @param value Scalar multiplier\n * @returns This instance for chaining\n */\n public multiply(value: number): this {\n this.constant *= value;\n for (const [variableIndex, coefficient] of this.terms) {\n this.terms.set(variableIndex, coefficient * value);\n }\n return this;\n }\n\n /**\n * Divides all terms by scalar.\n * @param value Scalar divisor\n * @returns This instance for chaining\n */\n public divide(value: number): this {\n return this.multiply(1 / value);\n }\n\n /**\n * Checks if expression contains variable term.\n * @param variableIndex Variable descriptor\n * @returns True if variable has term\n */\n public hasTerm(variableIndex: number): boolean {\n return this.terms.has(variableIndex);\n }\n\n /**\n * Copies from another expression.\n * @param expression Source expression\n * @returns This instance for chaining\n */\n public copy(expression: UIExpression): this {\n this.constant = expression.constant;\n this.terms.clear();\n for (const [variableIndex, coefficient] of expression.terms) {\n this.terms.set(variableIndex, coefficient);\n }\n return this;\n }\n\n /**\n * Creates independent copy.\n * @returns New expression with same content\n */\n public clone(): UIExpression {\n return new UIExpression(this.constant, Array.from(this.terms.entries()));\n }\n\n /**\n * Prepares terms for solver.\n * @returns Variable-coefficient pairs\n * @internal\n */\n public prepareTerms(): [number, number][] {\n return Array.from(this.terms.entries());\n }\n}\n","import { Operator } from \"@lume/kiwi\";\n\n/** Relational operators for constraints */\nexport enum UIRelation {\n /** Equality: LHS = RHS */\n EQUAL = 0,\n /** Less than or equal: LHS ≤ RHS */\n LESS_THAN = 1,\n /** Greater than or equal: LHS ≥ RHS */\n GREATER_THAN = 2,\n}\n\n/**\n * Converts relation to solver operator.\n * @param relation Relation type\n * @returns Solver operator\n * @throws If relation is invalid\n */\nexport function convertRelation(relation: UIRelation): Operator {\n switch (relation) {\n case UIRelation.EQUAL:\n return Operator.Eq;\n case UIRelation.LESS_THAN:\n return Operator.Le;\n case UIRelation.GREATER_THAN:\n return Operator.Ge;\n default:\n throw new Error(`convertRelation: invalid relation`);\n }\n}\n\n/**\n * Resolves optional relation.\n * @param relation Relation to resolve\n * @returns Relation or EQUAL if undefined\n */\nexport function resolveRelation(relation?: UIRelation): UIRelation {\n return relation ?? UIRelation.EQUAL;\n}\n","import { Constraint, Expression, Solver, Variable } from \"@lume/kiwi\";\nimport { UIExpression } from \"../miscellaneous/UIExpression\";\nimport { convertPriority, UIPriority } from \"../miscellaneous/UIPriority\";\nimport { convertRelation, UIRelation } from \"../miscellaneous/UIRelation\";\nimport type {\n ConstraintDescription,\n UISolverWrapperInterface,\n VariableDescription,\n} from \"./UISolverWrapper.Internal\";\n\n/**\n * Wrapper around the Kiwi constraint solver providing enhanced UI-specific functionality.\n *\n * UISolverWrapper abstracts the Kiwi (Cassowary) constraint solver to provide a more\n * UI-friendly interface with additional features like dynamic constraint modification,\n * required variables (P0 priority), partial constraint updates, and automatic solver\n * recovery. It manages variables and constraints through index-based references,\n * allowing for easy tracking and modification of layout constraints.\n *\n * Key features:\n * - Index-based variable and constraint management\n * - Required variables with P0 priority (always satisfied)\n * - Dynamic constraint modification without full rebuilds\n * - Automatic solver recovery on constraint conflicts\n * - Lazy evaluation with recalculation flags\n *\n * @see {@link UIExpression} - Expression system for constraint definitions\n * @see {@link UIPriority} - Priority levels for variables and constraints\n * @see {@link UIRelation} - Relational operators for constraints\n */\nexport class UISolverWrapper implements UISolverWrapperInterface {\n /** @internal */\n public dirty = false;\n\n /** The underlying Kiwi solver instance, undefined when solver needs rebuilding. */\n private solver? = new Solver();\n /** Flag indicating whether variable values need recalculation. */\n private recalculationRequired = false;\n\n /** Map of variable indices to their descriptions. */\n private readonly variables = new Map<number, VariableDescription>();\n /** Counter for generating unique variable indices. */\n private lastVariableIndex = 0;\n\n /** Map of constraint indices to their descriptions. */\n private readonly constraints = new Map<number, ConstraintDescription>();\n /** Counter for generating unique constraint indices. */\n private lastConstraintIndex = 0;\n\n /**\n * Creates a new solver variable with the specified value and priority.\n *\n * Variables with P0 priority are treated as required (must be satisfied exactly)\n * and are implemented using equality constraints. Other priorities use edit\n * variables that can be adjusted by the solver.\n *\n * @param value - Initial value for the variable\n * @param priority - Priority level for constraint solving\n * @returns Unique index identifier for the created variable\n */\n public createVariable(value: number, priority: UIPriority): number {\n const index = this.lastVariableIndex++;\n const variable = new Variable();\n\n if (priority === UIPriority.P0) {\n const description: VariableDescription = { variable, priority, value };\n this.variables.set(index, description);\n\n description.constraint = this.buildConstraint(\n new UIExpression(0, [[index, 1]]),\n new UIExpression(value),\n UIRelation.EQUAL,\n priority,\n );\n try {\n this.solver?.addConstraint(description.constraint);\n } catch {\n this.solver = undefined;\n }\n } else {\n this.variables.set(index, { variable, priority, value });\n\n try {\n this.solver?.addEditVariable(variable, convertPriority(priority));\n this.solver?.suggestValue(variable, value);\n } catch {\n this.solver = undefined;\n }\n }\n\n this.recalculationRequired = true;\n this.dirty = true;\n return index;\n }\n\n /**\n * Removes a variable from the solver system.\n *\n * The variable must not be referenced by any existing constraints.\n * Cleans up both the variable itself and any associated required constraint.\n *\n * @param index - Index of the variable to remove\n * @throws Will throw an error if the variable doesn't exist or is still in use\n */\n public removeVariable(index: number): void {\n const description = this.variables.get(index);\n if (description === undefined) {\n throw new Error(\n `UISolverWrapper.removeVariable.index: variable does not exist`,\n );\n }\n\n for (const cDescription of this.constraints.values()) {\n if (cDescription.lhs.hasTerm(index) || cDescription.rhs.hasTerm(index)) {\n throw new Error(\n `UISolverWrapper.removeVariable.index: variable is used in constraint`,\n );\n }\n }\n\n try {\n description.constraint\n ? this.solver?.removeConstraint(description.constraint)\n : this.solver?.removeEditVariable(description.variable);\n } catch {\n this.solver = undefined;\n }\n\n this.variables.delete(index);\n this.recalculationRequired = true;\n this.dirty = true;\n }\n\n /**\n * Suggests a new value for an existing variable.\n *\n * For P0 priority variables, rebuilds the associated constraint.\n * For other priorities, suggests the value to the solver's edit system.\n * Only triggers updates if the value actually changes.\n *\n * @param index - Index of the variable to update\n * @param value - New suggested value\n * @throws Will throw an error if the variable doesn't exist\n */\n public suggestVariableValue(index: number, value: number): void {\n const description = this.variables.get(index);\n if (description === undefined) {\n throw new Error(\n `UISolverWrapper.suggestVariableValue.index: variable does not exist`,\n );\n }\n\n if (description.value !== value) {\n description.value = value;\n\n if (description.constraint) {\n description.constraint = this.rebuildConstraint(\n description.constraint,\n new UIExpression().plus(index, 1),\n new UIExpression(description.value),\n UIRelation.EQUAL,\n description.priority,\n );\n } else {\n this.solver?.suggestValue(description.variable, value);\n }\n\n this.recalculationRequired = true;\n this.dirty = true;\n }\n }\n\n /**\n * Changes the priority of an existing variable.\n *\n * Switching to/from P0 priority changes how the variable is handled:\n * - P0: Creates required constraint (must be satisfied exactly)\n * - Other: Uses edit variable system (can be adjusted by solver)\n *\n * @param index - Index of the variable to modify\n * @param priority - New priority level\n * @throws Will throw an error if the variable doesn't exist\n */\n public setVariablePriority(index: number, priority: UIPriority): void {\n const description = this.variables.get(index);\n if (description === undefined) {\n throw new Error(\n `UISolverWrapper.setVariablePriority.index: variable does not exist`,\n );\n }\n\n if (priority !== description.priority) {\n description.priority = priority;\n\n if (description.priority === UIPriority.P0) {\n const lhs = new UIExpression().plus(index, 1);\n const rhs = new UIExpression(description.value);\n\n description.constraint = this.buildConstraint(\n lhs,\n rhs,\n UIRelation.EQUAL,\n description.priority,\n );\n\n try {\n this.solver?.addConstraint(description.constraint);\n } catch {\n this.solver = undefined;\n }\n } else {\n if (description.constraint) {\n try {\n this.solver?.removeConstraint(description.constraint);\n } catch {\n this.solver = undefined;\n }\n }\n\n description.constraint = undefined;\n this.rebuildVariable(index, description);\n }\n\n this.recalculationRequired = true;\n this.dirty = true;\n }\n }\n\n /**\n * Reads the current solved value of a variable.\n *\n * Triggers solver recalculation if needed and rebuilds the solver\n * if it was invalidated due to constraint conflicts.\n *\n * @param index - Index of the variable to read\n * @returns Current solved value of the variable\n * @throws Will throw an error if the variable doesn't exist\n */\n public readVariableValue(index: number): number {\n const description = this.variables.get(index);\n if (description === undefined) {\n throw new Error(\n `UISolverWrapper.readVariableValue.index: variable does not exist`,\n );\n }\n\n if (this.solver === undefined) {\n this.rebuildSolver();\n }\n\n if (this.recalculationRequired) {\n this.solver?.updateVariables();\n this.recalculationRequired = false;\n }\n\n return description.variable.value();\n }\n\n /**\n * Creates a new constraint between two expressions.\n *\n * Constraints can be enabled or disabled, and all properties can be\n * modified later without recreating the constraint.\n *\n * @param lhs - Left-hand side expression\n * @param rhs - Right-hand side expression\n * @param relation - Relational operator (equal, less than, greater than)\n * @param priority - Priority level for constraint solving\n * @param enabled - Whether the constraint is initially active\n * @returns Unique index identifier for the created constraint\n */\n public createConstraint(\n lhs: UIExpression,\n rhs: UIExpression,\n relation: UIRelation,\n priority: UIPriority,\n enabled: boolean,\n ): number {\n const index = this.lastConstraintIndex++;\n const constraint = this.buildConstraint(lhs, rhs, relation, priority);\n this.constraints.set(index, {\n constraint,\n lhs: lhs.clone(),\n rhs: rhs.clone(),\n priority,\n relation,\n enabled,\n });\n if (enabled) {\n try {\n this.solver?.addConstraint(constraint);\n } catch {\n this.solver = undefined;\n }\n this.recalculationRequired = true;\n this.dirty = true;\n }\n return index;\n }\n\n /**\n * Removes a constraint from the solver system.\n *\n * If the constraint is currently enabled, it will be removed from\n * the active solver before deletion.\n *\n * @param index - Index of the constraint to remove\n * @throws Will throw an error if the constraint doesn't exist\n */\n public removeConstraint(index: number): void {\n const description = this.constraints.get(index);\n if (description === undefined) {\n throw new Error(\n `UISolverWrapper.removeConstraint.index: constraint does not exist`,\n );\n }\n\n if (description.enabled) {\n try {\n this.solver?.removeConstraint(description.constraint);\n } catch {\n this.solver = undefined;\n }\n }\n\n this.constraints.delete(index);\n this.recalculationRequired = true;\n this.dirty = true;\n }\n\n /**\n * Updates the left-hand side expression of an existing constraint.\n *\n * Rebuilds the underlying constraint with the new expression while\n * preserving all other properties.\n *\n * @param index - Index of the constraint to modify\n * @param lhs - New left-hand side expression\n * @throws Will throw an error if the constraint doesn't exist\n */\n public setConstraintLHS(index: number, lhs: UIExpression): void {\n const description = this.constraints.get(index);\n if (description === undefined) {\n throw new Error(\n `UISolverWrapper.setConstraintLHS.index: constraint does not exist`,\n );\n }\n\n description.lhs.copy(lhs);\n this.rebuildConstraintByDescription(description);\n this.recalculationRequired = true;\n this.dirty = true;\n }\n\n /**\n * Updates the right-hand side expression of an existing constraint.\n *\n * Rebuilds the underlying constraint with the new expression while\n * preserving all other properties.\n *\n * @param index - Index of the constraint to modify\n * @param rhs - New right-hand side expression\n * @throws Will throw an error if the constraint doesn't exist\n */\n public setConstraintRHS(index: number, rhs: UIExpression): void {\n const description = this.constraints.get(index);\n if (description === undefined) {\n throw new Error(\n `UISolverWrapper.setConstraintRHS.index: constraint does not exist`,\n );\n }\n\n description.rhs.copy(rhs);\n this.rebuildConstraintByDescription(description);\n this.recalculationRequired = true;\n this.dirty = true;\n }\n\n /**\n * Updates the relational operator of an existing constraint.\n *\n * Changes how the left and right expressions are compared\n * (equal, less than, greater than).\n *\n * @param index - Index of the constraint to modify\n * @param relation - New relational operator\n * @throws Will throw an error if the constraint doesn't exist\n */\n public setConstraintRelation(index: number, relation: UIRelation): void {\n const description = this.constraints.get(index);\n if (description === undefined) {\n throw new Error(\n `UISolverWrapper.setConstraintRelation.index: constraint does not exist`,\n );\n }\n\n if (description.relation !== relation) {\n description.relation = relation;\n this.rebuildConstraintByDescription(description);\n this.recalculationRequired = true;\n this.dirty = true;\n }\n }\n\n /**\n * Updates the priority level of an existing constraint.\n *\n * Higher priority constraints are more likely to be satisfied\n * when conflicts arise.\n *\n * @param index - Index of the constraint to modify\n * @param priority - New priority level\n * @throws Will throw an error if the constraint doesn't exist\n */\n public setConstraintPriority(index: number, priority: UIPriority): void {\n const description = this.constraints.get(index);\n if (description === undefined) {\n throw new Error(\n `UISolverWrapper.setConstraintPriority.index: constraint does not exist`,\n );\n }\n\n if (description.priority !== priority) {\n description.priority = priority;\n this.rebuildConstraintByDescription(description);\n this.recalculationRequired = true;\n this.dirty = true;\n }\n }\n\n /**\n * Enables or disables an existing constraint.\n *\n * Disabled constraints are not considered during solving but\n * remain in the system for potential re-enabling.\n *\n * @param index - Index of the constraint to modify\n * @param enabled - Whether the constraint should be active\n * @throws Will throw an error if the constraint doesn't exist\n */\n public setConstraintEnabled(index: number, enabled: boolean): void {\n const description = this.constraints.get(index);\n if (description === undefined) {\n throw new Error(\n `UISolverWrapper.setConstraintEnabled.index: constraint does not exist`,\n );\n }\n\n if (enabled !== description.enabled) {\n description.enabled = enabled;\n try {\n description.enabled\n ? this.solver?.addConstraint(description.constraint)\n : this.solver?.removeConstraint(description.constraint);\n } catch {\n this.solver = undefined;\n }\n this.recalculationRequired = true;\n this.dirty = true;\n }\n }\n\n /**\n * Rebuilds a variable in the solver system with new properties.\n *\n * Temporarily removes all constraints that reference the variable,\n * updates the variable configuration, then rebuilds and re-adds\n * the dependent constraints.\n */\n private rebuildVariable(\n index: number,\n description: VariableDescription,\n ): void {\n const dependConstraints: ConstraintDescription[] = [];\n\n for (const cDescription of this.constraints.values()) {\n if (cDescription.lhs.hasTerm(index) || cDescription.rhs.hasTerm(index)) {\n try {\n this.solver?.removeConstraint(cDescription.constraint);\n } catch {\n this.solver = undefined;\n }\n dependConstraints.push(cDescription);\n }\n }\n\n this.solver?.removeEditVariable(description.variable);\n this.solver?.addEditVariable(\n description.variable,\n convertPriority(description.priority),\n );\n\n for (const cDescription of dependConstraints) {\n cDescription.constraint = this.buildConstraint(\n cDescription.lhs,\n cDescription.rhs,\n cDescription.relation,\n cDescription.priority,\n );\n }\n\n for (const cDescription of dependConstraints) {\n try {\n this.solver?.addConstraint(cDescription.constraint);\n } catch {\n this.solver = undefined;\n break;\n }\n }\n }\n\n /**\n * Rebuilds a constraint based on its current description.\n *\n * Uses different rebuild strategies depending on whether the\n * constraint is currently enabled.\n */\n private rebuildConstraintByDescription(\n description: ConstraintDescription,\n ): void {\n description.constraint = description.enabled\n ? this.rebuildConstraint(\n description.constraint,\n description.lhs,\n description.rhs,\n description.relation,\n description.priority,\n )\n : this.buildConstraint(\n description.lhs,\n description.rhs,\n description.relation,\n description.priority,\n );\n }\n\n /**\n * Rebuilds a constraint by removing the old one and creating a new one.\n *\n * Safely handles solver state transitions and constraint replacement.\n */\n private rebuildConstraint(\n oldConstraint: Constraint,\n lhs: UIExpression,\n rhs: UIExpression,\n relation: UIRelation,\n priority: UIPriority,\n ): Constraint {\n try {\n this.solver?.removeConstraint(oldConstraint);\n } catch {\n this.solver = undefined;\n }\n\n const constraint = this.buildConstraint(lhs, rhs, relation, priority);\n\n try {\n this.solver?.addConstraint(constraint);\n } catch {\n this.solver = undefined;\n }\n\n return constraint;\n }\n\n /**\n * Creates a new Kiwi constraint from UI expressions and parameters.\n *\n * Converts UI-level expressions and enums to Kiwi-compatible formats.\n */\n private buildConstraint(\n lhs: UIExpression,\n rhs: UIExpression,\n relation: UIRelation,\n priority: UIPriority,\n ): Constraint {\n return new Constraint(\n this.convertExpression(lhs),\n convertRelation(relation),\n this.convertExpression(rhs),\n convertPriority(priority),\n );\n }\n\n /**\n * Converts a UIExpression to a Kiwi Expression.\n *\n * Maps variable indices to their corresponding Kiwi Variable instances\n * and preserves coefficients and constants.\n */\n private convertExpression(expression: UIExpression): Expression {\n return new Expression(\n ...expression\n .prepareTerms()\n .map(([variableIndex, coefficient]): [number, Variable] => {\n const description = this.variables.get(variableIndex);\n if (description === undefined) {\n throw new Error(\n `UISolverWrapper.convertExpression: variable does not exist`,\n );\n }\n return [coefficient, description.variable];\n }),\n expression.constant,\n );\n }\n\n /**\n * Completely rebuilds the solver from scratch.\n *\n * Re-adds all variables and constraints to a fresh solver instance.\n * Used for recovery when the solver enters an invalid state.\n */\n private rebuildSolver(): void {\n if (this.solver) {\n throw new Error(\"UISolverWrapper.rebuildSolver: solver already exists\");\n }\n\n this.solver = new Solver();\n\n for (const description of this.variables.values()) {\n if (description.constraint) {\n this.solver.addConstraint(description.constraint);\n } else {\n this.solver.addEditVariable(\n description.variable,\n convertPriority(description.priority),\n );\n this.solver.suggestValue(description.variable, description.value);\n }\n }\n\n for (const description of this.constraints.values()) {\n if (description.enabled) {\n this.solver.addConstraint(description.constraint);\n }\n }\n\n this.recalculationRequired = true;\n this.dirty = true;\n }\n}\n","import type { UIMode } from \"../miscellaneous/UIMode\";\nimport type { UIOrientation } from \"../miscellaneous/UIOrientation\";\n\n/** Layer lifecycle and state events */\nexport enum UILayerEvent {\n /** Fired when orientation changes */\n ORIENTATION_CHANGED = \"orientation_changed\",\n /** Fired when mode changes */\n MODE_CHANGED = \"mode_changed\",\n /** Fired during rendering */\n RENDERING = \"rendering\",\n}\n\n/** Layer visibility and interactivity state */\nexport type UILayerMode = UIMode.HIDDEN | UIMode.VISIBLE | UIMode.INTERACTIVE;\n\n/** Layer orientation state */\nexport type UILayerOrientation =\n | UIOrientation.VERTICAL\n | UIOrientation.HORIZONTAL;\n","import { Eventail } from \"eventail\";\nimport type { WebGLRenderer } from \"three\";\nimport type { UIPlaneElement } from \"../miscellaneous/asserts\";\n\nimport { isUIModeVisible } from \"../miscellaneous/UIMode\";\nimport { UIOrientation } from \"../miscellaneous/UIOrientation\";\nimport { UIPriority } from \"../miscellaneous/UIPriority\";\nimport { UIInputWrapper } from \"../wrappers/UIInputWrapper\";\nimport type { UIInputWrapperInterface } from \"../wrappers/UIInputWrapper.Internal\";\nimport { UISceneWrapper } from \"../wrappers/UISceneWrapper\";\nimport type { UISceneWrapperInterface } from \"../wrappers/UISceneWrapper.Internal\";\nimport { UISolverWrapper } from \"../wrappers/UISolverWrapper\";\nimport type { UISolverWrapperInterface } from \"../wrappers/UISolverWrapper.Internal\";\nimport type { UILayerMode, UILayerOrientation } from \"./UILayer.Internal\";\nimport { UILayerEvent } from \"./UILayer.Internal\";\n\n/** Base layer for UI rendering and layout management */\nexport abstract class UILayer extends Eventail implements UIPlaneElement {\n /** Optional layer name */\n public name = \"\";\n /** Solver variable for x coordinate */\n public readonly xVariable: number;\n /** Solver variable for y coordinate */\n public readonly yVariable: number;\n /** Solver variable for width */\n public readonly wVariable: number;\n /** Solver variable for height */\n public readonly hVariable: number;\n\n protected readonly inputWrapperInternal = new UIInputWrapper();\n private readonly solverWrapperInternal = new UISolverWrapper();\n private readonly sceneWrapperInternal: UISceneWrapper;\n\n private modeInternal: UILayerMode;\n private orientationInternal: UILayerOrientation;\n\n /**\n * @param w Initial width in world units\n * @param h Initial height in world units\n * @param mode Initial visibility and interactivity mode\n */\n constructor(w: number, h: number, mode: UILayerMode) {\n super();\n this.sceneWrapperInternal = new UISceneWrapper(w, h);\n this.modeInternal = mode;\n this.orientationInternal =\n w > h ? UIOrientation.HORIZONTAL : UIOrientation.VERTICAL;\n\n this.xVariable = this.solverWrapperInternal.createVariable(\n 0,\n UIPriority.P0,\n );\n this.yVariable = this.solverWrapperInternal.createVariable(\n 0,\n UIPriority.P0,\n );\n this.wVariable = this.solverWrapperInternal.createVariable(\n w,\n UIPriority.P0,\n );\n this.hVariable = this.solverWrapperInternal.createVariable(\n h,\n UIPriority.P0,\n );\n }\n\n /** @internal */\n public get sceneWrapper(): UISceneWrapperInterface {\n return this.sceneWrapperInternal;\n }\n\n /** @internal */\n public get solverWrapper(): UISolverWrapperInterface {\n return this.solverWrapperInternal;\n }\n\n /** @internal */\n public get inputWrapper(): UIInputWrapperInterface {\n return this.inputWrapperInternal;\n }\n\n /** X coordinate in world units (always 0 for layers) */\n public get x(): number {\n return this.solverWrapperInternal.readVariableValue(this.xVariable);\n }\n\n /** Y coordinate in world units (always 0 for layers) */\n public get y(): number {\n return this.solverWrapperInternal.readVariableValue(this.yVariable);\n }\n\n /** Layer width in world units */\n public get width(): number {\n return this.solverWrapperInternal.readVariableValue(this.wVariable);\n }\n\n /** Layer height in world units */\n public get height(): number {\n return this.solverWrapperInternal.readVariableValue(this.hVariable);\n }\n\n /** Current visibility and interactivity mode */\n public get mode(): UILayerMode {\n return this.modeInternal;\n }\n\n /** Current orientation based on aspect ratio */\n public get orientation(): UILayerOrientation {\n return this.orientationInternal;\n }\n\n /** Updates visibility and interactivity mode */\n public set mode(value: UILayerMode) {\n if (value !== this.modeInternal) {\n this.modeInternal = value;\n this.emit(UILayerEvent.MODE_CHANGED, this.modeInternal, this);\n }\n }\n\n protected resizeInternal(width: number, height: number): void {\n this.solverWrapperInternal.suggestVariableValue(this.wVariable, width);\n this.solverWrapperInternal.suggestVariableValue(this.hVariable, height);\n this.sceneWrapperInternal.resize(width, height);\n\n const orientation =\n width > height ? UIOrientation.HORIZONTAL : UIOrientation.VERTICAL;\n\n if (orientation !== this.orientationInternal) {\n this.orientationInternal = orientation;\n this.emit(\n UILayerEvent.ORIENTATION_CHANGED,\n this.orientationInternal,\n this,\n );\n }\n }\n\n protected renderInternal(renderer: WebGLRenderer, deltaTime: number): void {\n if (isUIModeVisible(this.mode)) {\n this.emit(UILayerEvent.RENDERING, renderer, deltaTime, this);\n this.sceneWrapperInternal.render(renderer);\n }\n\n this.solverWrapperInternal.dirty = false;\n this.inputWrapperInternal.dirty = false;\n }\n}\n","import { UILayer } from \"../layers/UILayer\";\n\nexport const EPSILON = 1e-6;\n\n/** Objects that belong to a UI layer */\nexport interface UILayerElement {\n /** The UI layer containing this element */\n readonly layer: UILayer;\n}\n\n/** UI elements with position in 2D space */\nexport interface UIPointElement {\n /** Solver variable for x coordinate */\n readonly xVariable: number;\n /** Solver variable for y coordinate */\n readonly yVariable: number;\n\n /** X coordinate in world units */\n readonly x: number;\n /** Y coordinate in world units */\n readonly y: number;\n}\n\n/** UI elements with position and dimensions */\nexport interface UIPlaneElement extends UIPointElement {\n /** Solver variable for width */\n readonly wVariable: number;\n /** Solver variable for height */\n readonly hVariable: number;\n\n /** Width in world units */\n readonly width: number;\n /** Height in world units */\n readonly height: number;\n}\n\n/**\n * Checks if object implements UILayerElement.\n * @param obj Object to check\n * @returns True if object has valid layer property\n */\nexport function isUILayerElement(obj: unknown): obj is UILayerElement {\n return (\n typeof obj === \"object\" &&\n obj !== null &&\n \"layer\" in obj &&\n obj.layer instanceof UILayer\n );\n}\n\n/**\n * Checks if object implements UIPointElement.\n * @param obj Object to check\n * @returns True if object has valid position variables\n */\nexport function isUIPointElement(obj: unknown): obj is UIPointElement {\n return (\n typeof obj === \"object\" &&\n obj !== null &&\n \"xVariable\" in obj &&\n typeof obj.xVariable === \"number\" &&\n \"yVariable\" in obj &&\n typeof obj.yVariable === \"number\" &&\n \"width\" in obj &&\n typeof obj.width === \"number\" &&\n \"height\" in obj &&\n typeof obj.height === \"number\"\n );\n}\n\n/**\n * Checks if object implements UIPlaneElement.\n * @param obj Object to check\n * @returns True if object has valid dimension variables\n */\nexport function isUIPlaneElement(obj: unknown): obj is UIPlaneElement {\n return (\n typeof obj === \"object\" &&\n obj !== null &&\n \"wVariable\" in obj &&\n typeof obj.wVariable === \"number\" &&\n \"hVariable\" in obj &&\n typeof obj.hVariable === \"number\" &&\n \"width\" in obj &&\n typeof obj.width === \"number\" &&\n \"height\" in obj &&\n typeof obj.height === \"number\"\n );\n}\n\n/**\n * Validates constraint subjects are from same layer.\n * @param a First constraint subject\n * @param b Second constraint subject\n * @param subject Constraint name for error messages\n * @returns Common layer for both subjects\n * @throws If subjects are invalid or from different layers\n */\nexport function assertValidConstraintSubjects(\n a: unknown,\n b: unknown,\n subject: string,\n): UILayer {\n if (a instanceof UILayer && b instanceof UILayer) {\n throw new Error(`${subject}: layer cannot be snapped to another layer`);\n }\n\n let layerA: UILayer;\n let layerB: UILayer;\n\n if (a instanceof UILayer || isUILayerElement(a)) {\n layerA = a instanceof UILayer ? a : a.layer;\n } else {\n throw new Error(`${subject}: A must be a UILayer or a UIPointElement`);\n }\n\n if (b instanceof UILayer || isUILayerElement(b)) {\n layerB = b instanceof UILayer ? b : b.layer;\n } else {\n throw new Error(`${subject}: B must be a UILayer or a UIPointElement`);\n }\n\n if (layerA !== layerB) {\n throw new Error(`${subject}: elements must be on the same layer`);\n }\n\n return layerA;\n}\n\n/**\n * Validates value is finite number within safe range.\n * @param value Number to validate\n * @param subject Value name for error messages\n * @throws If value is not finite or exceeds safe range\n */\nexport function assertValidNumber(value: number, subject: string): void {\n if (process.env.NODE_ENV !== \"production\") {\n if (!Number.isFinite(value)) {\n throw new Error(`${subject}: value must be a finite number`);\n }\n\n if (Math.abs(value) > Number.MAX_SAFE_INTEGER) {\n throw new Error(`${subject}: value exceeds maximum safe integer range`);\n }\n }\n}\n\n/**\n * Validates value is positive (>= EPSILON).\n * @param value Number to validate\n * @param subject Value name for error messages\n * @throws If value is invalid or below EPSILON\n */\nexport function assertValidPositiveNumber(\n value: number,\n subject: string,\n): void {\n if (process.env.NODE_ENV !== \"production\") {\n assertValidNumber(value, subject);\n if (value < EPSILON) {\n throw new Error(\n `${subject}: value must be greater than or equal to ${EPSILON}`,\n );\n }\n }\n}\n\n/**\n * Validates value is non-negative (>= 0).\n * @param value Number to validate\n * @param subject Value name for error messages\n * @throws If value is invalid or negative\n */\nexport function assertValidNonNegativeNumber(\n value: number,\n subject: string,\n): void {\n if (process.env.NODE_ENV !== \"production\") {\n assertValidNumber(value, subject);\n if (value < 0) {\n throw new Error(`${subject}: value must be greater than or equal to 0`);\n }\n }\n}\n","import type { UILayer } from \"../layers/UILayer\";\nimport type { UISolverWrapperInterface } from \"../wrappers/UISolverWrapper.Internal\";\n\n/** Base class for layout constraints */\nexport abstract class UIConstraint {\n /** Optional constraint name */\n public name = \"\";\n\n /** Constraint solver wrapper */\n protected readonly solverWrapper: UISolverWrapperInterface;\n\n /** @param layer Layer containing this constraint */\n constructor(public readonly layer: UILayer) {\n this.solverWrapper = this.layer.solverWrapper;\n }\n}\n","import type { UILayer } from \"../layers/UILayer\";\nimport { UILayerEvent } from \"../layers/UILayer.Internal\";\nimport {\n resolveOrientation,\n UIOrientation,\n} from \"../miscellaneous/UIOrientation\";\nimport type { UIPriority } from \"../miscellaneous/UIPriority\";\nimport { resolvePriority } from \"../miscellaneous/UIPriority\";\nimport type { UIRelation } from \"../miscellaneous/UIRelation\";\nimport { resolveRelation } from \"../miscellaneous/UIRelation\";\nimport { UIConstraint } from \"./UIConstraint\";\nimport type { UISingleParameterConstraintOptions } from \"./UISingleParameterConstraint.Internal\";\n\n/** Base class for constraints with priority, relation, and orientation */\nexport abstract class UISingleParameterConstraint extends UIConstraint {\n /** Constraint priority */\n private priorityInternal: UIPriority;\n /** Constraint relation */\n private relationInternal: UIRelation;\n /** Constraint orientation */\n private orientationInternal: UIOrientation;\n\n /** Solver constraint descriptor */\n protected abstract readonly constraint: number;\n\n /**\n * @param layer Layer containing this constraint\n * @param options Constraint configuration\n */\n constructor(\n layer: UILayer,\n options?: Partial<UISingleParameterConstraintOptions>,\n ) {\n super(layer);\n this.priorityInternal = resolvePriority(options?.priority);\n this.relationInternal = resolveRelation(options?.relation);\n this.orientationInternal = resolveOrientation(options?.orientation);\n this.layer.on(UILayerEvent.ORIENTATION_CHANGED, this.onOrientationChange);\n }\n\n /** Constraint priority */\n public get priority(): UIPriority {\n return this.priorityInternal;\n }\n\n /** Constraint relation */\n public get relation(): UIRelation {\n return this.relationInternal;\n }\n\n /** When constraint is active */\n public get orientation(): UIOrientation {\n return this.orientationInternal;\n }\n\n /** Updates constraint priority */\n public set priority(value: UIPriority) {\n if (value !== this.priorityInternal) {\n this.priorityInternal = value;\n this.solverWrapper.setConstraintPriority(\n this.constraint,\n this.priorityInternal,\n );\n }\n }\n\n /** Updates constraint relation */\n public set relation(value: UIRelation) {\n if (value !== this.relationInternal) {\n this.relationInternal = value;\n this.solverWrapper.setConstraintRelation(\n this.constraint,\n this.relationInternal,\n );\n }\n }\n\n /** Updates when constraint is active */\n public set orientation(value: UIOrientation) {\n if (value !== this.orientationInternal) {\n this.orientationInternal = value;\n this.onOrientationChange();\n }\n }\n\n /** Removes constraint from solver and cleans up listeners */\n public destroy(): void {\n this.layer.off(UILayerEvent.ORIENTATION_CHANGED, this.onOrientationChange);\n this.solverWrapper.removeConstraint(this.constraint);\n }\n\n /**\n * Checks if constraint should be active for current orientation.\n * @returns True if orientation is ALWAYS or matches layer orientation\n */\n protected isConstraintEnabled(): boolean {\n return (\n this.orientationInternal === UIOrientation.ALWAYS ||\n this.orientationInternal === this.layer.orientation\n );\n }\n\n /** Updates constraint enabled state when layer orientation changes */\n private readonly onOrientationChange = (): void => {\n this.solverWrapper.setConstraintEnabled(\n this.constraint,\n this.isConstraintEnabled(),\n );\n };\n}\n","import type { UILayerElement, UIPlaneElement } from \"../miscellaneous/asserts\";\nimport { assertValidPositiveNumber } from \"../miscellaneous/asserts\";\nimport { UIExpression } from \"../miscellaneous/UIExpression\";\nimport type { UIHeightConstraintOptions } from \"./UIHeightConstraint.Internal\";\nimport { UISingleParameterConstraint } from \"./UISingleParameterConstraint\";\n\n/** Fixes element height to constant value */\nexport class UIHeightConstraint extends UISingleParameterConstraint {\n /** Solver constraint descriptor */\n protected override readonly constraint: number;\n\n /** Current height value */\n private heightInternal: number;\n\n /**\n * @param element Element to constrain\n * @param options Height configuration. Defaults to element's current height.\n */\n constructor(\n private readonly element: UIPlaneElement & UILayerElement,\n options: Partial<UIHeightConstraintOptions> = {},\n ) {\n super(element.layer, options);\n\n if (options.height !== undefined) {\n assertValidPositiveNumber(\n options.height,\n \"UIHeightConstraint.constructor.options.height\",\n );\n }\n\n this.heightInternal = options.height ?? element.height;\n this.constraint = this.solverWrapper.createConstraint(\n new UIExpression(0, [[this.element.hVariable, 1]]),\n new UIExpression(this.heightInternal),\n this.relation,\n this.priority,\n this.isConstraintEnabled(),\n );\n }\n\n /** Current height in world units */\n public get height(): number {\n return this.heightInternal;\n }\n\n /** Updates height */\n public set height(value: number) {\n assertValidPositiveNumber(value, \"UIHeightConstraint.height\");\n if (this.heightInternal !== value) {\n this.heightInternal = value;\n this.solverWrapper.setConstraintRHS(\n this.constraint,\n new UIExpression(value),\n );\n }\n }\n}\n","import type { UISingleParameterConstraintOptions } from \"./UISingleParameterConstraint.Internal\";\n\nexport const DEFAULT_ANCHOR = 0.5;\n\n/** Horizontal distance constraint options */\nexport interface UIHorizontalDistanceConstraintOptions\n extends UISingleParameterConstraintOptions {\n /** Anchor on element A (0 = left, 0.5 = center, 1 = right) */\n anchorA: number;\n /** Anchor on element B (0 = left, 0.5 = center, 1 = right) */\n anchorB: number;\n /** Distance in world units */\n distance: number;\n}\n","import type { UIPlaneElement, UIPointElement } from \"../miscellaneous/asserts\";\nimport {\n assertValidConstraintSubjects,\n assertValidNumber,\n isUIPlaneElement,\n isUIPointElement,\n} from \"../miscellaneous/asserts\";\nimport { UIExpression } from \"../miscellaneous/UIExpression\";\nimport type { UIHorizontalDistanceConstraintOptions } from \"./UIHorizontalDistanceConstraint.Internal\";\nimport { DEFAULT_ANCHOR } from \"./UIHorizontalDistanceConstraint.Internal\";\nimport { UISingleParameterConstraint } from \"./UISingleParameterConstraint\";\n\n/** Maintains horizontal distance between elements with configurable anchors */\nexport class UIHorizontalDistanceConstraint extends UISingleParameterConstraint {\n /** Solver constraint descriptor */\n protected override readonly constraint: number;\n\n /** Anchor on element A */\n private anchorAInternal: number;\n /** Anchor on element B */\n private anchorBInternal: number;\n /** Current distance */\n private distanceInternal: number;\n\n /**\n * @param a First element\n * @param b Second element\n * @param options Distance configuration\n */\n constructor(\n private readonly a: UIPointElement | UIPlaneElement,\n private readonly b: UIPointElement | UIPlaneElement,\n options: Partial<UIHorizontalDistanceConstraintOptions> = {},\n ) {\n super(\n assertValidConstraintSubjects(a, b, \"UIHorizontalDistanceConstraint\"),\n options,\n );\n\n if (options.anchorA !== undefined) {\n assertValidNumber(\n options.anchorA,\n \"UIHorizontalDistanceConstraint.constructor.options.anchorA\",\n );\n }\n if (options.anchorB !== undefined) {\n assertValidNumber(\n options.anchorB,\n \"UIHorizontalDistanceConstraint.constructor.options.anchorB\",\n );\n }\n if (options.distance !== undefined) {\n assertValidNumber(\n options.distance,\n \"UIHorizontalDistanceConstraint.constructor.options.distance\",\n );\n }\n\n this.anchorAInternal = options.anchorA ?? DEFAULT_ANCHOR;\n this.anchorBInternal = options.anchorB ?? DEFAULT_ANCHOR;\n this.distanceInternal = options.distance ?? 0;\n\n this.constraint = this.solverWrapper.createConstraint(\n this.buildLHS(),\n new UIExpression(this.distanceInternal),\n this.relation,\n this.priority,\n this.isConstraintEnabled(),\n );\n }\n\n /** Current distance in world units */\n public get distance(): number {\n return this.distanceInternal;\n }\n\n /** Anchor on element A (0 = left, 0.5 = center, 1 = right) */\n public get anchorA(): number {\n return this.anchorAInternal;\n }\n\n /** Anchor on element B (0 = left, 0.5 = center, 1 = right) */\n public get anchorB(): number {\n return this.anchorBInternal;\n }\n\n /** Updates distance */\n public set distance(value: number) {\n assertValidNumber(value, \"UIHorizontalDistanceConstraint.distance\");\n if (this.distanceInternal !== value) {\n this.distanceInternal = value;\n this.solverWrapper.setConstraintRHS(\n this.constraint,\n new UIExpression(this.distanceInternal),\n );\n }\n }\n\n /** Updates anchor on element A */\n public set anchorA(value: number) {\n assertValidNumber(value, \"UIHorizontalDistanceConstraint.anchorA\");\n if (this.anchorAInternal !== value) {\n this.anchorAInternal = value;\n this.solverWrapper.setConstraintLHS(this.constraint, this.buildLHS());\n }\n }\n\n /** Updates anchor on element B */\n public set anchorB(value: number) {\n assertValidNumber(value, \"UIHorizontalDistanceConstraint.anchorB\");\n if (this.anchorBInternal !== value) {\n this.anchorBInternal = value;\n this.solverWrapper.setConstraintLHS(this.constraint, this.buildLHS());\n }\n }\n\n /** Builds constraint expression for distance between anchored positions */\n private buildLHS(): UIExpression {\n let aExpression: UIExpression;\n let bExpression: UIExpression;\n\n if (isUIPlaneElement(this.a)) {\n aExpression = new UIExpression(0, [\n [this.a.xVariable, 1],\n [this.a.wVariable, this.anchorAInternal],\n ]);\n } else if (isUIPointElement(this.a)) {\n aExpression = new UIExpression().plus(this.a.xVariable, 1);\n } else {\n throw new Error(\n \"UIHorizontalDistanceConstraint.buildLHS.a: invalid element type\",\n );\n }\n\n if (isUIPlaneElement(this.b)) {\n bExpression = new UIExpression(0, [\n [this.b.xVariable, 1],\n [this.b.wVariable, this.anchorBInternal],\n ]);\n } else if (isUIPointElement(this.b)) {\n bExpression = new UIExpression().plus(this.b.xVariable, 1);\n } else {\n throw new Error(\n \"UIHorizontalDistanceConstraint.buildLHS.b: invalid element type\",\n );\n }\n\n return UIExpression.minus(bExpression, aExpression);\n }\n}\n","import type { UIPlaneElement } from \"../miscellaneous/asserts\";\nimport {\n assertValidConstraintSubjects,\n assertValidPositiveNumber,\n} from \"../miscellaneous/asserts\";\nimport { UIExpression } from \"../miscellaneous/UIExpression\";\nimport type { UIHorizontalProportionConstraintOptions } from \"./UIHorizontalProportionConstraint.Internal\";\nimport { UISingleParameterConstraint } from \"./UISingleParameterConstraint\";\n\n/** Maintains proportional width relationship (A.width * proportion = B.width) */\nexport class UIHorizontalProportionConstraint extends UISingleParameterConstraint {\n protected override readonly constraint: number;\n private proportionInternal: number;\n\n /**\n * @param a First element\n * @param b Second element\n * @param options Proportion configuration\n */\n constructor(\n private readonly a: UIPlaneElement,\n private readonly b: UIPlaneElement,\n options: Partial<UIHorizontalProportionConstraintOptions> = {},\n ) {\n super(\n assertValidConstraintSubjects(a, b, \"UIHorizontalProportionConstraint\"),\n options,\n );\n\n if (options.proportion !== undefined) {\n assertValidPositiveNumber(\n options.proportion,\n \"UIHorizontalProportionConstraint.constructor.options.proportion\",\n );\n }\n\n this.proportionInternal = options.proportion ?? 1;\n this.constraint = this.solverWrapper.createConstraint(\n new UIExpression(0),\n this.buildRHS(),\n this.relation,\n this.priority,\n this.isConstraintEnabled(),\n );\n }\n\n /** Current proportion multiplier */\n public get proportion(): number {\n return this.proportionInternal;\n }\n\n /** Updates proportion multiplier */\n public set proportion(value: number) {\n assertValidPositiveNumber(\n value,\n \"UIHorizontalProportionConstraint.proportion\",\n );\n if (this.proportionInternal !== value) {\n this.proportionInternal = value;\n this.solverWrapper.setConstraintRHS(this.constraint, this.buildRHS());\n }\n }\n\n /** Builds constraint expression for proportional relationship */\n private buildRHS(): UIExpression {\n return UIExpression.minus(\n new UIExpression(0, [[this.a.wVariable, this.proportionInternal]]),\n new UIExpression(0, [[this.b.wVariable, 1]]),\n );\n }\n}\n","import type { UISingleParameterConstraintOptions } from \"./UISingleParameterConstraint.Internal\";\n\nexport const DEFAULT_ANCHOR = 0.5;\n\n/** Vertical distance constraint options */\nexport interface UIVerticalDistanceConstraintOptions\n extends UISingleParameterConstraintOptions {\n /** Anchor on element A (0 = bottom, 0.5 = center, 1 = top) */\n anchorA: number;\n /** Anchor on element B (0 = bottom, 0.5 = center, 1 = top) */\n anchorB: number;\n /** Distance in world units */\n distance: number;\n}\n","import type { UIPlaneElement, UIPointElement } from \"../miscellaneous/asserts\";\nimport {\n assertValidConstraintSubjects,\n assertValidNumber,\n isUIPlaneElement,\n isUIPointElement,\n} from \"../miscellaneous/asserts\";\nimport { UIExpression } from \"../miscellaneous/UIExpression\";\nimport { UISingleParameterConstraint } from \"./UISingleParameterConstraint\";\nimport type { UIVerticalDistanceConstraintOptions } from \"./UIVerticalDistanceConstraint.Internal\";\nimport { DEFAULT_ANCHOR } from \"./UIVerticalDistanceConstraint.Internal\";\n\n/** Maintains vertical distance between elements with configurable anchors */\nexport class UIVerticalDistanceConstraint extends UISingleParameterConstraint {\n protected override readonly constraint: number;\n\n private anchorAInternal: number;\n private anchorBInternal: number;\n private distanceInternal: number;\n\n /**\n * @param a First element\n * @param b Second element\n * @param options Distance configuration\n */\n constructor(\n private readonly a: UIPointElement | UIPlaneElement,\n private readonly b: UIPointElement | UIPlaneElement,\n options: Partial<UIVerticalDistanceConstraintOptions> = {},\n ) {\n super(\n assertValidConstraintSubjects(a, b, \"UIVerticalDistanceConstraint\"),\n options,\n );\n\n if (options.anchorA !== undefined) {\n assertValidNumber(\n options.anchorA,\n \"UIVerticalDistanceConstraint.constructor.options.anchorA\",\n );\n }\n if (options.anchorB !== undefined) {\n assertValidNumber(\n options.anchorB,\n \"UIVerticalDistanceConstraint.constructor.options.anchorB\",\n );\n }\n if (options.distance !== undefined) {\n assertValidNumber(\n options.distance,\n \"UIVerticalDistanceConstraint.constructor.options.distance\",\n );\n }\n\n this.anchorAInternal = options.anchorA ?? DEFAULT_ANCHOR;\n this.anchorBInternal = options.anchorB ?? DEFAULT_ANCHOR;\n this.distanceInternal = options.distance ?? 0;\n\n this.constraint = this.solverWrapper.createConstraint(\n this.buildLHS(),\n new UIExpression(this.distanceInternal),\n this.relation,\n this.priority,\n this.isConstraintEnabled(),\n );\n }\n\n /** Current distance in world units */\n public get distance(): number {\n return this.distanceInternal;\n }\n\n /** Anchor on element A (0 = bottom, 0.5 = center, 1 = top) */\n public get anchorA(): number {\n return this.anchorAInternal;\n }\n\n /** Anchor on element B (0 = bottom, 0.5 = center, 1 = top) */\n public get anchorB(): number {\n return this.anchorBInternal;\n }\n\n /** Updates distance */\n public set distance(value: number) {\n assertValidNumber(value, \"UIVerticalDistanceConstraint.distance\");\n if (this.distanceInternal !== value) {\n this.distanceInternal = value;\n this.solverWrapper.setConstraintRHS(\n this.constraint,\n new UIExpression(this.distanceInternal),\n );\n }\n }\n\n /** Updates anchor on element A */\n public set anchorA(value: number) {\n assertValidNumber(value, \"UIVerticalDistanceConstraint.anchorA\");\n if (this.anchorAInternal !== value) {\n this.anchorAInternal = value;\n this.solverWrapper.setConstraintLHS(this.constraint, this.buildLHS());\n }\n }\n\n /** Updates anchor on element B */\n public set anchorB(value: number) {\n assertValidNumber(value, \"UIVerticalDistanceConstraint.anchorB\");\n if (this.anchorBInternal !== value) {\n this.anchorBInternal = value;\n this.solverWrapper.setConstraintLHS(this.constraint, this.buildLHS());\n }\n }\n\n /** Builds constraint expression for distance between anchored positions */\n private buildLHS(): UIExpression {\n let aExpression: UIExpression;\n let bExpression: UIExpression;\n\n if (isUIPlaneElement(this.a)) {\n aExpression = new UIExpression(0, [\n [this.a.yVariable, 1],\n [this.a.hVariable, this.anchorAInternal],\n ]);\n } else if (isUIPointElement(this.a)) {\n aExpression = new UIExpression().plus(this.a.yVariable, 1);\n } else {\n throw new Error(\n \"UIVerticalDistanceConstraint.buildLHS.a: invalid element type\",\n );\n }\n\n if (isUIPlaneElement(this.b)) {\n bExpression = new UIExpression(0, [\n [this.b.yVariable, 1],\n [this.b.hVariable, this.anchorBInternal],\n ]);\n } else if (isUIPointElement(this.b)) {\n bExpression = new UIExpression().plus(this.b.yVariable, 1);\n } else {\n throw new Error(\n \"UIVerticalDistanceConstraint.buildLHS.b: invalid element type\",\n );\n }\n\n return UIExpression.minus(bExpression, aExpression);\n }\n}\n","import type { UIPlaneElement } from \"../miscellaneous/asserts\";\nimport {\n assertValidConstraintSubjects,\n assertValidPositiveNumber,\n} from \"../miscellaneous/asserts\";\nimport { UIExpression } from \"../miscellaneous/UIExpression\";\nimport { UISingleParameterConstraint } from \"./UISingleParameterConstraint\";\nimport type { UIVerticalProportionConstraintOptions } from \"./UIVerticalProportionConstraint.Internal\";\n\n/** Maintains proportional height relationship (A.height * proportion = B.height) */\nexport class UIVerticalProportionConstraint extends UISingleParameterConstraint {\n protected override readonly constraint: number;\n private proportionInternal: number;\n\n /**\n * @param a First element\n * @param b Second element\n * @param options Proportion configuration\n */\n constructor(\n private readonly a: UIPlaneElement,\n private readonly b: UIPlaneElement,\n options: Partial<UIVerticalProportionConstraintOptions> = {},\n ) {\n super(\n assertValidConstraintSubjects(a, b, \"UIVerticalProportionConstraint\"),\n options,\n );\n\n if (options.proportion !== undefined) {\n assertValidPositiveNumber(\n options.proportion,\n \"UIVerticalProportionConstraint.constructor.options.proportion\",\n );\n }\n\n this.proportionInternal = options.proportion ?? 1;\n this.constraint = this.solverWrapper.createConstraint(\n new UIExpression(0),\n this.buildRHS(),\n this.relation,\n this.priority,\n this.isConstraintEnabled(),\n );\n }\n\n /** Current proportion multiplier */\n public get proportion(): number {\n return this.proportionInternal;\n }\n\n /** Updates proportion multiplier */\n public set proportion(value: number) {\n assertValidPositiveNumber(\n value,\n \"UIVerticalProportionConstraint.proportion\",\n );\n if (this.proportionInternal !== value) {\n this.proportionInternal = value;\n this.solverWrapper.setConstraintRHS(this.constraint, this.buildRHS());\n }\n }\n\n /** Builds constraint expression for proportional relationship */\n private buildRHS(): UIExpression {\n return UIExpression.minus(\n new UIExpression(0, [[this.a.hVariable, this.proportionInternal]]),\n new UIExpression(0, [[this.b.hVariable, 1]]),\n );\n }\n}\n","import type { UILayerElement, UIPlaneElement } from \"../miscellaneous/asserts\";\nimport { assertValidPositiveNumber } from \"../miscellaneous/asserts\";\nimport { UIExpression } from \"../miscellaneous/UIExpression\";\nimport { UISingleParameterConstraint } from \"./UISingleParameterConstraint\";\nimport type { UIWidthConstraintOptions } from \"./UIWidthConstraint.Internal\";\n\n/** Fixes element width to constant value */\nexport class UIWidthConstraint extends UISingleParameterConstraint {\n /** Solver constraint descriptor */\n protected override readonly constraint: number;\n\n /** Current width value */\n private widthInternal: number;\n\n /**\n * @param element Element to constrain\n * @param options Width configuration. Defaults to element's current width.\n */\n constructor(\n private readonly element: UIPlaneElement & UILayerElement,\n options: Partial<UIWidthConstraintOptions> = {},\n ) {\n super(element.layer, options);\n\n if (options.width !== undefined) {\n assertValidPositiveNumber(\n options.width,\n \"UIWidthConstraint.constructor.options.width\",\n );\n }\n\n this.widthInternal = options.width ?? element.width;\n this.constraint = this.solverWrapper.createConstraint(\n new UIExpression(0, [[this.element.wVariable, 1]]),\n new UIExpression(this.widthInternal),\n this.relation,\n this.priority,\n this.isConstraintEnabled(),\n );\n }\n\n /** Current width in world units */\n public get width(): number {\n return this.widthInternal;\n }\n\n /** Updates width */\n public set width(value: number) {\n assertValidPositiveNumber(value, \"UIWidthConstraint.width\");\n if (this.widthInternal !== value) {\n this.widthInternal = value;\n this.solverWrapper.setConstraintRHS(\n this.constraint,\n new UIExpression(value),\n );\n }\n }\n}\n","import { UIHeightConstraint } from \"../../constraints/UIHeightConstraint\";\nimport { UIHorizontalDistanceConstraint } from \"../../constraints/UIHorizontalDistanceConstraint\";\nimport { UIHorizontalProportionConstraint } from \"../../constraints/UIHorizontalProportionConstraint\";\nimport { UIVerticalDistanceConstraint } from \"../../constraints/UIVerticalDistanceConstraint\";\nimport { UIVerticalProportionConstraint } from \"../../constraints/UIVerticalProportionConstraint\";\nimport { UIWidthConstraint } from \"../../constraints/UIWidthConstraint\";\nimport type { UIElement } from \"../../elements/UIElement\";\nimport type {\n UIPlaneElement,\n UIPointElement,\n} from \"../../miscellaneous/asserts\";\nimport type {\n UIConstraint2DResult,\n UIConstraintDistance2DOptions,\n UIConstraintProportion2DOptions,\n UIConstraintSize2DOptions,\n} from \"./UIConstraint2DBuilder.Internal\";\n\n/** Builder for paired horizontal and vertical constraints */\nexport class UIConstraint2DBuilder {\n /**\n * Creates width and height constraints.\n * @param element Element to constrain\n * @param options Size configuration for both axes\n * @returns Width and height constraints\n */\n public static size(\n element: UIElement,\n options: Partial<UIConstraintSize2DOptions> = {},\n ): UIConstraint2DResult<UIWidthConstraint, UIHeightConstraint> {\n return {\n h: new UIWidthConstraint(element, {\n width: options.size?.h,\n priority: options.priority?.h,\n relation: options.relation?.h,\n orientation: options.orientation?.h,\n }),\n v: new UIHeightConstraint(element, {\n height: options.size?.v,\n priority: options.priority?.v,\n relation: options.relation?.v,\n orientation: options.orientation?.v,\n }),\n };\n }\n\n /**\n * Creates horizontal and vertical distance constraints.\n * @param a First element\n * @param b Second element\n * @param options Distance configuration for both axes\n * @returns Horizontal and vertical distance constraints\n */\n public static distance(\n a: UIPointElement | UIPlaneElement,\n b: UIPointElement | UIPlaneElement,\n options: Partial<UIConstraintDistance2DOptions> = {},\n ): UIConstraint2DResult<\n UIHorizontalDistanceConstraint,\n UIVerticalDistanceConstraint\n > {\n return {\n h: new UIHorizontalDistanceConstraint(a, b, {\n anchorA: options.anchorA?.h,\n anchorB: options.anchorB?.h,\n distance: options.distance?.h,\n priority: options.priority?.h,\n relation: options.relation?.h,\n orientation: options.orientation?.h,\n }),\n v: new UIVerticalDistanceConstraint(a, b, {\n anchorA: options.anchorA?.v,\n anchorB: options.anchorB?.v,\n distance: options.distance?.v,\n priority: options.priority?.v,\n relation: options.relation?.v,\n orientation: options.orientation?.v,\n }),\n };\n }\n\n /**\n * Creates horizontal and vertical proportion constraints.\n * @param a Element with proportional dimensions\n * @param b Target element\n * @param options Proportion configuration for both axes\n * @returns Horizontal and vertical proportion constraints\n */\n public static proportion(\n a: UIPlaneElement,\n b: UIPlaneElement,\n options: Partial<UIConstraintProportion2DOptions> = {},\n ): UIConstraint2DResult<\n UIHorizontalProportionConstraint,\n UIVerticalProportionConstraint\n > {\n return {\n h: new UIHorizontalProportionConstraint(a, b, {\n proportion: options.proportion?.h,\n priority: options.priority?.h,\n relation: options.relation?.h,\n orientation: options.orientation?.h,\n }),\n v: new UIVerticalProportionConstraint(a, b, {\n proportion: options.proportion?.v,\n priority: options.priority?.v,\n relation: options.relation?.v,\n orientation: options.orientation?.v,\n }),\n };\n }\n}\n","import type { UILayerElement, UIPlaneElement } from \"../miscellaneous/asserts\";\nimport { assertValidPositiveNumber } from \"../miscellaneous/asserts\";\nimport { UIExpression } from \"../miscellaneous/UIExpression\";\nimport type { UIAspectConstraintOptions } from \"./UIAspectConstraint.Internal\";\nimport { UISingleParameterConstraint } from \"./UISingleParameterConstraint\";\n\n/** Maintains element aspect ratio (width = height * aspect) */\nexport class UIAspectConstraint extends UISingleParameterConstraint {\n /** Solver constraint descriptor */\n protected override readonly constraint: number;\n\n /** Current aspect ratio */\n private aspectInternal: number;\n\n /**\n * @param element Element to constrain\n * @param options Aspect configuration. Defaults to element's current ratio.\n */\n constructor(\n private readonly element: UIPlaneElement & UILayerElement,\n options: Partial<UIAspectConstraintOptions> = {},\n ) {\n super(element.layer, options);\n\n if (options.aspect !== undefined) {\n assertValidPositiveNumber(\n options.aspect,\n \"UIAspectConstraint.constructor.options.aspect\",\n );\n }\n\n this.aspectInternal = options.aspect ?? element.width / element.height;\n this.constraint = this.solverWrapper.createConstraint(\n this.buildLHS(),\n new UIExpression(0),\n this.relation,\n this.priority,\n this.isConstraintEnabled(),\n );\n }\n\n /** Current aspect ratio (width/height) */\n public get aspect(): number {\n return this.aspectInternal;\n }\n\n /** Updates aspect ratio */\n public set aspect(value: number) {\n assertValidPositiveNumber(value, \"UIAspectConstraint.aspect\");\n if (this.aspectInternal !== value) {\n this.aspectInternal = value;\n this.solverWrapper.setConstraintLHS(this.constraint, this.buildLHS());\n }\n }\n\n /** Builds constraint expression: width - (height * aspect) = 0 */\n private buildLHS(): UIExpression {\n return new UIExpression(0, [\n [this.element.wVariable, 1],\n [this.element.hVariable, -this.aspectInternal],\n ]);\n }\n}\n","import type { UIOrientation } from \"../../miscellaneous/UIOrientation\";\n\nexport const COVER_CONSTRAINT_DEFAULT_ANCHOR = 0.5;\n\n/** Cover constraint builder options */\nexport interface UICoverConstraintBuilderOptions {\n /** Whether to maintain active element aspect ratio */\n keepActiveAspect: boolean;\n /** Horizontal anchor (0 = left, 0.5 = center, 1 = right) */\n anchorH: number;\n /** Vertical anchor (0 = bottom, 0.5 = center, 1 = top) */\n anchorV: number;\n /** Orientation for constraints */\n orientation: UIOrientation;\n}\n","import { UIHorizontalDistanceConstraint } from \"../../constraints/UIHorizontalDistanceConstraint\";\nimport { UIHorizontalProportionConstraint } from \"../../constraints/UIHorizontalProportionConstraint\";\nimport { UIVerticalDistanceConstraint } from \"../../constraints/UIVerticalDistanceConstraint\";\nimport { UIVerticalProportionConstraint } from \"../../constraints/UIVerticalProportionConstraint\";\nimport type {\n UILayerElement,\n UIPlaneElement,\n} from \"../../miscellaneous/asserts\";\nimport { assertValidNumber } from \"../../miscellaneous/asserts\";\nimport { UIPriority } from \"../../miscellaneous/UIPriority\";\nimport { UIRelation } from \"../../miscellaneous/UIRelation\";\nimport { UIAspectConstraint } from \"../UIAspectConstraint\";\nimport type { UICoverConstraintBuilderOptions } from \"./UICoverConstraintBuilder.Internal\";\nimport { COVER_CONSTRAINT_DEFAULT_ANCHOR } from \"./UICoverConstraintBuilder.Internal\";\n\n/** Builder for cover layout (like CSS object-fit: cover) */\nexport class UICoverConstraintBuilder {\n /**\n * Creates cover layout constraints.\n * @param passive Container element\n * @param active Content element that covers container\n * @param options Cover configuration\n * @returns Created constraints\n */\n public static build(\n passive: UIPlaneElement,\n active: UIPlaneElement & UILayerElement,\n options: Partial<UICoverConstraintBuilderOptions> = {},\n ): {\n /** Aspect constraint if keepActiveAspect is true */\n activeAspectConstraint?: UIAspectConstraint;\n /** Horizontal position constraint */\n xConstraint: UIHorizontalDistanceConstraint;\n /** Vertical position constraint */\n yConstraint: UIVerticalDistanceConstraint;\n /** Width constraint (ensures coverage) */\n widthConstraint: UIHorizontalProportionConstraint;\n /** Height constraint (ensures coverage) */\n heightConstraint: UIVerticalProportionConstraint;\n } {\n if (options.anchorH !== undefined) {\n assertValidNumber(\n options.anchorH,\n \"UICoverConstraintBuilder.build.anchorH\",\n );\n }\n if (options.anchorV !== undefined) {\n assertValidNumber(\n options.anchorV,\n \"UICoverConstraintBuilder.build.anchorV\",\n );\n }\n\n let activeAspectConstraint: UIAspectConstraint | undefined;\n if (options.keepActiveAspect === true) {\n activeAspectConstraint = new UIAspectConstraint(active, {\n orientation: options.orientation,\n });\n }\n\n const xConstraint = new UIHorizontalDistanceConstraint(passive, active, {\n anchorA: options.anchorH ?? COVER_CONSTRAINT_DEFAULT_ANCHOR,\n anchorB: options.anchorH ?? COVER_CONSTRAINT_DEFAULT_ANCHOR,\n orientation: options.orientation,\n });\n\n const yConstraint = new UIVerticalDistanceConstraint(passive, active, {\n anchorA: options.anchorV ?? COVER_CONSTRAINT_DEFAULT_ANCHOR,\n anchorB: options.anchorV ?? COVER_CONSTRAINT_DEFAULT_ANCHOR,\n orientation: options.orientation,\n });\n\n const widthConstraint = new UIHorizontalProportionConstraint(\n passive,\n active,\n {\n proportion: 1,\n relation: UIRelation.GREATER_THAN,\n orientation: options.orientation,\n },\n );\n\n const heightConstraint = new UIVerticalProportionConstraint(\n passive,\n active,\n {\n proportion: 1,\n priority: UIPriority.P1,\n orientation: options.orientation,\n },\n );\n\n return {\n activeAspectConstraint,\n xConstraint,\n yConstraint,\n widthConstraint,\n heightConstraint,\n };\n }\n}\n","import type { UIOrientation } from \"../../miscellaneous/UIOrientation\";\n\nexport const DEFAULT_ANCHOR = 0.5;\n\n/** Fit constraint builder options */\nexport interface UIFitConstraintBuilderOptions {\n /** Whether to maintain active element aspect ratio */\n keepActiveAspect: boolean;\n /** Horizontal anchor (0 = left, 0.5 = center, 1 = right) */\n anchorH: number;\n /** Vertical anchor (0 = bottom, 0.5 = center, 1 = top) */\n anchorV: number;\n /** Orientation for constraints */\n orientation: UIOrientation;\n}\n","import { UIHorizontalDistanceConstraint } from \"../../constraints/UIHorizontalDistanceConstraint\";\nimport { UIHorizontalProportionConstraint } from \"../../constraints/UIHorizontalProportionConstraint\";\nimport { UIVerticalDistanceConstraint } from \"../../constraints/UIVerticalDistanceConstraint\";\nimport { UIVerticalProportionConstraint } from \"../../constraints/UIVerticalProportionConstraint\";\nimport type {\n UILayerElement,\n UIPlaneElement,\n} from \"../../miscellaneous/asserts\";\nimport { assertValidNumber } from \"../../miscellaneous/asserts\";\nimport { UIPriority } from \"../../miscellaneous/UIPriority\";\nimport { UIRelation } from \"../../miscellaneous/UIRelation\";\nimport { UIAspectConstraint } from \"../UIAspectConstraint\";\nimport type { UIFitConstraintBuilderOptions } from \"./UIFitConstraintBuilder.Internal\";\nimport { DEFAULT_ANCHOR } from \"./UIFitConstraintBuilder.Internal\";\n\n/** Builder for fit layout (like CSS object-fit: contain) */\nexport class UIFitConstraintBuilder {\n /**\n * Creates fit layout constraints.\n * @param passive Container element\n * @param active Content element that fits within container\n * @param options Fit configuration\n * @returns Created constraints\n */\n public static build(\n passive: UIPlaneElement,\n active: UIPlaneElement & UILayerElement,\n options: Partial<UIFitConstraintBuilderOptions> = {},\n ): {\n /** Aspect constraint if keepActiveAspect is true */\n activeAspectConstraint?: UIAspectConstraint;\n /** Horizontal position constraint */\n xConstraint: UIHorizontalDistanceConstraint;\n /** Vertical position constraint */\n yConstraint: UIVerticalDistanceConstraint;\n /** Width constraint (ensures fitting) */\n widthConstraint: UIHorizontalProportionConstraint;\n /** Height constraint (ensures fitting) */\n heightConstraint: UIVerticalProportionConstraint;\n } {\n if (options.anchorH !== undefined) {\n assertValidNumber(\n options.anchorH,\n \"UIFitConstraintBuilder.build.anchorH\",\n );\n }\n if (options.anchorV !== undefined) {\n assertValidNumber(\n options.anchorV,\n \"UIFitConstraintBuilder.build.anchorV\",\n );\n }\n\n let activeAspectConstraint: UIAspectConstraint | undefined;\n if (options.keepActiveAspect === true) {\n activeAspectConstraint = new UIAspectConstraint(active, {\n orientation: options.orientation,\n });\n }\n\n const xConstraint = new UIHorizontalDistanceConstraint(passive, active, {\n anchorA: options.anchorH ?? DEFAULT_ANCHOR,\n anchorB: options.anchorH ?? DEFAULT_ANCHOR,\n orientation: options.orientation,\n });\n\n const yConstraint = new UIVerticalDistanceConstraint(passive, active, {\n anchorA: options.anchorV ?? DEFAULT_ANCHOR,\n anchorB: options.anchorV ?? DEFAULT_ANCHOR,\n orientation: options.orientation,\n });\n\n const widthConstraint = new UIHorizontalProportionConstraint(\n passive,\n active,\n {\n proportion: 1,\n relation: UIRelation.LESS_THAN,\n orientation: options.orientation,\n },\n );\n\n const heightConstraint = new UIVerticalProportionConstraint(\n passive,\n active,\n {\n proportion: 1,\n priority: UIPriority.P1,\n orientation: options.orientation,\n },\n );\n\n return {\n activeAspectConstraint,\n xConstraint,\n yConstraint,\n widthConstraint,\n heightConstraint,\n };\n }\n}\n","import type { UILayer } from \"../layers/UILayer\";\nimport type { UIExpression } from \"../miscellaneous/UIExpression\";\nimport { UISingleParameterConstraint } from \"./UISingleParameterConstraint\";\nimport type { UISingleParameterConstraintOptions } from \"./UISingleParameterConstraint.Internal\";\n\n/** Constraint with custom LHS and RHS expressions */\nexport class UICustomConstraint extends UISingleParameterConstraint {\n /** Solver constraint descriptor */\n protected override readonly constraint: number;\n /** Left-hand side expression */\n private lhsInternal: UIExpression;\n /** Right-hand side expression */\n private rhsInternal: UIExpression;\n\n /**\n * @param layer Layer containing this constraint\n * @param lhs Left-hand side expression\n * @param rhs Right-hand side expression\n * @param options Constraint configuration\n */\n constructor(\n layer: UILayer,\n lhs: UIExpression,\n rhs: UIExpression,\n options: Partial<UISingleParameterConstraintOptions> = {},\n ) {\n super(layer, options);\n\n this.lhsInternal = lhs;\n this.rhsInternal = rhs;\n\n this.constraint = this.solverWrapper.createConstraint(\n this.lhsInternal,\n this.rhsInternal,\n this.relation,\n this.priority,\n this.isConstraintEnabled(),\n );\n }\n\n /** Left-hand side expression */\n public get lhs(): UIExpression {\n return this.lhsInternal;\n }\n\n /** Right-hand side expression */\n public get rhs(): UIExpression {\n return this.rhsInternal;\n }\n\n /** Updates left-hand side expression */\n public setLHS(value: UIExpression): void {\n this.lhsInternal = value;\n this.solverWrapper.setConstraintLHS(this.constraint, this.lhsInternal);\n }\n\n /** Updates right-hand side expression */\n public setRHS(value: UIExpression): void {\n this.rhsInternal = value;\n this.solverWrapper.setConstraintRHS(this.constraint, this.rhsInternal);\n }\n}\n","/** Configuration options for UIAnchor */\nexport interface UIAnchorOptions {\n /** X coordinate in world units */\n x: number;\n /** Y coordinate in world units */\n y: number;\n}\n\nexport const ANCHOR_DEFAULT_X = 0;\nexport const ANCHOR_DEFAULT_Y = 0;\n","import { Eventail } from \"eventail\";\nimport type { UILayer } from \"../layers/UILayer\";\nimport type { UILayerElement, UIPointElement } from \"../miscellaneous/asserts\";\nimport { assertValidNumber } from \"../miscellaneous/asserts\";\nimport { UIPriority } from \"../miscellaneous/UIPriority\";\nimport type { UISolverWrapperInterface } from \"../wrappers/UISolverWrapper.Internal\";\nimport type { UIAnchorOptions } from \"./UIAnchor.Internal\";\nimport { ANCHOR_DEFAULT_X, ANCHOR_DEFAULT_Y } from \"./UIAnchor.Internal\";\n\n/** Point in 2D space with constraint-based positioning */\nexport class UIAnchor\n extends Eventail\n implements UILayerElement, UIPointElement\n{\n /** Optional identifier for debugging */\n public name = \"\";\n\n /** Solver variable for x coordinate */\n public readonly xVariable: number;\n\n /** Solver variable for y coordinate */\n public readonly yVariable: number;\n\n protected readonly solverWrapper: UISolverWrapperInterface;\n\n /**\n * Creates a new UIAnchor instance.\n *\n * @param layer - Layer containing this anchor\n * @param options - Configuration options\n */\n constructor(\n public readonly layer: UILayer,\n options?: Partial<UIAnchorOptions>,\n ) {\n const x = options?.x ?? ANCHOR_DEFAULT_X;\n const y = options?.y ?? ANCHOR_DEFAULT_Y;\n assertValidNumber(x, \"UIAnchor.constructor.options.x\");\n assertValidNumber(y, \"UIAnchor.constructor.options.y\");\n\n super();\n this.solverWrapper = this.layer.solverWrapper;\n this.xVariable = this.solverWrapper.createVariable(x, UIPriority.P7);\n this.yVariable = this.solverWrapper.createVariable(y, UIPriority.P7);\n }\n\n /** X coordinate relative to layer origin (bottom-left) */\n public get x(): number {\n return this.solverWrapper.readVariableValue(this.xVariable);\n }\n\n /** Y coordinate relative to layer origin (bottom-left) */\n public get y(): number {\n return this.solverWrapper.readVariableValue(this.yVariable);\n }\n\n /** X coordinate relative to layer origin (bottom-left) */\n public set x(value: number) {\n assertValidNumber(value, \"UIAnchor.x\");\n this.solverWrapper.suggestVariableValue(this.xVariable, value);\n }\n\n /** Y coordinate relative to layer origin (bottom-left) */\n public set y(value: number) {\n assertValidNumber(value, \"UIAnchor.y\");\n this.solverWrapper.suggestVariableValue(this.yVariable, value);\n }\n\n /** Removes anchor and frees resources */\n public destroy(): void {\n this.solverWrapper.removeVariable(this.yVariable);\n this.solverWrapper.removeVariable(this.xVariable);\n }\n}\n","/** Controls which transforms apply relative to anchor */\nexport enum UIMicroAnchorMode {\n /** Apply rotation and scale around anchor point */\n ROTATION_SCALE = 0,\n /** Apply position, rotation, and scale around anchor point */\n POSITION_ROTATION_SCALE = 1,\n}\n\n/** Configuration options for UIMicro */\nexport interface UIMicroConfig {\n /** X offset in world units */\n x: number;\n /** Y offset in world units */\n y: number;\n /** X anchor in normalized coordinates (0 to 1) */\n anchorX: number;\n /** Y anchor in normalized coordinates (0 to 1) */\n anchorY: number;\n /** X scale multiplier */\n scaleX: number;\n /** Y scale multiplier */\n scaleY: number;\n /** Rotation in radians */\n rotation: number;\n /** Which transforms apply relative to anchor */\n anchorMode: UIMicroAnchorMode;\n}\n\nexport const MICRO_DEFAULT_POSITION = 0;\nexport const MICRO_DEFAULT_ANCHOR = 0.5;\nexport const MICRO_DEFAULT_SCALE = 1;\nexport const MICRO_DEFAULT_ROTATION = 0;\nexport const MICRO_DEFAULT_ANCHOR_MODE = UIMicroAnchorMode.ROTATION_SCALE;\n","import { Matrix4, Quaternion, Vector3 } from \"three\";\nimport { UIMicroAnchorMode } from \"../miscellaneous/micro/UIMicro.Internal\";\n\nconst TEMP_POSITION = new Vector3();\nconst TEMP_QUATERNION = new Quaternion();\nconst TEMP_SCALE = new Vector3();\nconst TEMP_MATRIX = new Matrix4();\nconst Z_AXIS = new Vector3(0, 0, 1);\n\n/**\n * Computes element transform matrix.\n * @returns Transform matrix (reused, do not store reference)\n */\nexport function computeTransformMatrix(\n x: number,\n y: number,\n width: number,\n height: number,\n zIndex: number,\n microX: number,\n microY: number,\n microAnchorX: number,\n microAnchorY: number,\n microScaleX: number,\n microScaleY: number,\n microRotation: number,\n microAnchorMode: UIMicroAnchorMode,\n): Matrix4 {\n const scaledWidth = width * microScaleX;\n const scaledHeight = height * microScaleY;\n\n const anchorOffsetX = microAnchorX * scaledWidth;\n const anchorOffsetY = microAnchorY * scaledHeight;\n\n const cos = Math.cos(microRotation);\n const sin = Math.sin(microRotation);\n\n const rotatedAnchorX = anchorOffsetX * cos - anchorOffsetY * sin;\n const rotatedAnchorY = anchorOffsetX * sin + anchorOffsetY * cos;\n\n if (microAnchorMode === UIMicroAnchorMode.POSITION_ROTATION_SCALE) {\n TEMP_POSITION.x = x + microX - rotatedAnchorX;\n TEMP_POSITION.y = y + microY - rotatedAnchorY;\n } else {\n const rawAnchorOffsetX = microAnchorX * width;\n const rawAnchorOffsetY = microAnchorY * height;\n TEMP_POSITION.x = x + rawAnchorOffsetX - rotatedAnchorX + microX;\n TEMP_POSITION.y = y + rawAnchorOffsetY - rotatedAnchorY + microY;\n }\n\n TEMP_POSITION.z = zIndex;\n TEMP_SCALE.x = scaledWidth;\n TEMP_SCALE.y = scaledHeight;\n TEMP_QUATERNION.setFromAxisAngle(Z_AXIS, microRotation);\n\n TEMP_MATRIX.compose(TEMP_POSITION, TEMP_QUATERNION, TEMP_SCALE);\n return TEMP_MATRIX;\n}\n\n/**\n * Computes transform matrix for trimmed sprite.\n * @param width Source width including trimmed areas\n * @param height Source height including trimmed areas\n * @param trimLeft Pixels trimmed from left\n * @param trimRight Pixels trimmed from right\n * @param trimTop Pixels trimmed from top\n * @param trimBottom Pixels trimmed from bottom\n * @returns Transform matrix (reused, do not store reference)\n */\nexport function computeTrimmedTransformMatrix(\n x: number,\n y: number,\n width: number,\n height: number,\n zIndex: number,\n microX: number,\n microY: number,\n microAnchorX: number,\n microAnchorY: number,\n microScaleX: number,\n microScaleY: number,\n microRotation: number,\n microAnchorMode: UIMicroAnchorMode,\n trimLeft: number,\n trimRight: number,\n trimTop: number,\n trimBottom: number,\n): Matrix4 {\n const trimmedWidth = width - trimLeft - trimRight;\n const trimmedHeight = height - trimTop - trimBottom;\n\n const scaledWidth = width * microScaleX;\n const scaledHeight = height * microScaleY;\n\n const anchorOffsetX = microAnchorX * scaledWidth;\n const anchorOffsetY = microAnchorY * scaledHeight;\n\n const cos = Math.cos(microRotation);\n const sin = Math.sin(microRotation);\n\n const rotatedAnchorX = anchorOffsetX * cos - anchorOffsetY * sin;\n const rotatedAnchorY = anchorOffsetX * sin + anchorOffsetY * cos;\n\n const trimOffsetX = trimLeft * microScaleX;\n const trimOffsetY = trimBottom * microScaleY;\n\n const rotatedTrimX = trimOffsetX * cos - trimOffsetY * sin;\n const rotatedTrimY = trimOffsetX * sin + trimOffsetY * cos;\n\n if (microAnchorMode === UIMicroAnchorMode.POSITION_ROTATION_SCALE) {\n TEMP_POSITION.x = x + microX - rotatedAnchorX + rotatedTrimX;\n TEMP_POSITION.y = y + microY - rotatedAnchorY + rotatedTrimY;\n } else {\n const rawAnchorOffsetX = microAnchorX * width;\n const rawAnchorOffsetY = microAnchorY * height;\n TEMP_POSITION.x =\n x + rawAnchorOffsetX - rotatedAnchorX + microX + rotatedTrimX;\n TEMP_POSITION.y =\n y + rawAnchorOffsetY - rotatedAnchorY + microY + rotatedTrimY;\n }\n\n TEMP_POSITION.z = zIndex;\n TEMP_SCALE.x = trimmedWidth * microScaleX;\n TEMP_SCALE.y = trimmedHeight * microScaleY;\n TEMP_QUATERNION.setFromAxisAngle(Z_AXIS, microRotation);\n\n TEMP_MATRIX.compose(TEMP_POSITION, TEMP_QUATERNION, TEMP_SCALE);\n return TEMP_MATRIX;\n}\n","import { Texture } from \"three\";\n\nexport const TEXTURE_DEFAULT_TEXTURE = new Texture();\nexport const TEXTURE_DEFAULT_SIZE = 2;\n\n/** Events emitted by UITexture */\nexport enum UITextureViewEvent {\n /** Emitted when width or height changes */\n DIMENSIONS_CHANGED = 0,\n}\n\n/** Rectangle coordinates and dimensions in atlas */\nexport interface UITextureRect {\n /** X coordinate in pixels */\n x: number;\n /** Y coordinate in pixels */\n y: number;\n /** Width in pixels */\n w: number;\n /** Height in pixels */\n h: number;\n}\n\n/** Size dimensions */\nexport interface UITextureSize {\n /** Width in pixels */\n w: number;\n /** Height in pixels */\n h: number;\n}\n\n/** Transparent padding around visible content */\nexport interface UITextureTrim {\n /** Left padding in world units */\n left: number;\n /** Right padding in world units */\n right: number;\n /** Top padding in world units */\n top: number;\n /** Bottom padding in world units */\n bottom: number;\n}\n\n/** Configuration for texture atlas sprite */\nexport interface UITextureAtlasConfig {\n /** Source texture atlas */\n texture: Texture;\n /** Rectangle in atlas containing sprite */\n frame: UITextureRect;\n /** Whether sprite is rotated 90 degrees clockwise */\n rotated?: boolean;\n /** Position and size within original image before trimming */\n spriteSourceSize: UITextureRect;\n /** Original image dimensions before trimming */\n sourceSize: UITextureSize;\n /** Scale factor for resolution independence */\n scale?: number;\n}\n\n/** Texture configuration from direct texture or atlas sprite */\nexport type UITextureConfig = Texture | UITextureAtlasConfig;\n","import { Eventail } from \"eventail\";\nimport { Matrix3, Texture, Vector2 } from \"three\";\nimport type {\n UITextureAtlasConfig,\n UITextureConfig,\n UITextureTrim,\n} from \"./UITextureView.Internal\";\nimport {\n TEXTURE_DEFAULT_SIZE,\n TEXTURE_DEFAULT_TEXTURE,\n UITextureViewEvent,\n} from \"./UITextureView.Internal\";\n\n/** Wrapper for Three.js texture with atlas and trim support. Does not own the underlying texture; user must dispose it. */\nexport class UITextureView extends Eventail {\n private textureInternal: Texture = TEXTURE_DEFAULT_TEXTURE;\n private rotatedInternal = false;\n\n private frameX = 0;\n private frameY = 0;\n private frameWidth = TEXTURE_DEFAULT_SIZE;\n private frameHeight = TEXTURE_DEFAULT_SIZE;\n\n private sourceWidth = TEXTURE_DEFAULT_SIZE;\n private sourceHeight = TEXTURE_DEFAULT_SIZE;\n\n private trimLeft = 0;\n private trimRight = 0;\n private trimTop = 0;\n private trimBottom = 0;\n\n private scaleInternal = 1;\n private dirtyInternal = false;\n\n /** @param config Texture or atlas configuration */\n constructor(config?: UITextureConfig) {\n super();\n if (config !== undefined) {\n this.set(config);\n }\n }\n\n /** Original width before trimming in world units */\n public get width(): number {\n return this.sourceWidth / this.scaleInternal;\n }\n\n /** Original height before trimming in world units */\n public get height(): number {\n return this.sourceHeight / this.scaleInternal;\n }\n\n /** Visible width after trimming in world units */\n public get trimmedWidth(): number {\n const frameSize = this.rotatedInternal ? this.frameHeight : this.frameWidth;\n return frameSize / this.scaleInternal;\n }\n\n /** Visible height after trimming in world units */\n public get trimmedHeight(): number {\n const frameSize = this.rotatedInternal ? this.frameWidth : this.frameHeight;\n return frameSize / this.scaleInternal;\n }\n\n /** Underlying Three.js texture */\n public get texture(): Texture {\n return this.textureInternal;\n }\n\n /** Whether sprite is rotated in atlas */\n public get rotated(): boolean {\n return this.rotatedInternal;\n }\n\n /** Scale factor for resolution independence */\n public get scale(): number {\n return this.scaleInternal;\n }\n\n /** Transparent padding around visible content */\n public get trim(): Readonly<UITextureTrim> {\n const s = this.scaleInternal;\n return {\n left: this.trimLeft / s,\n right: this.trimRight / s,\n top: this.trimTop / s,\n bottom: this.trimBottom / s,\n };\n }\n\n /** Whether texture has been modified since last check */\n public get dirty(): boolean {\n return this.dirtyInternal;\n }\n\n /** Marks texture as clean. @internal */\n public setDirtyFalse(): void {\n this.dirtyInternal = false;\n }\n\n /**\n * Calculates UV transform matrix for shader sampling.\n * @param result Matrix to store result in\n * @returns UV transform matrix\n */\n public calculateUVTransform(result = new Matrix3()): Matrix3 {\n const atlasWidth =\n this.textureInternal.image?.naturalWidth ?? TEXTURE_DEFAULT_SIZE;\n const atlasHeight =\n this.textureInternal.image?.naturalHeight ?? TEXTURE_DEFAULT_SIZE;\n\n if (this.rotatedInternal) {\n const physicalWidth = this.frameHeight;\n const physicalHeight = this.frameWidth;\n\n const u0 = this.frameX / atlasWidth;\n const v0 = (atlasHeight - this.frameY - physicalHeight) / atlasHeight;\n const uSize = physicalWidth / atlasWidth;\n const vSize = physicalHeight / atlasHeight;\n\n result.set(0, uSize, u0, -vSize, 0, v0 + vSize, 0, 0, 1);\n } else {\n const u0 = this.frameX / atlasWidth;\n const v0 = (atlasHeight - this.frameY - this.frameHeight) / atlasHeight;\n const uSize = this.frameWidth / atlasWidth;\n const vSize = this.frameHeight / atlasHeight;\n\n result.set(uSize, 0, u0, 0, vSize, v0, 0, 0, 1);\n }\n\n return result;\n }\n\n /**\n * Gets original dimensions before trimming.\n * @param result Vector to store result in\n * @returns Width and height in world units\n */\n public getResolution(result = new Vector2()): Vector2 {\n return result.set(this.width, this.height);\n }\n\n /**\n * Replaces texture with new configuration.\n * @param config Texture or atlas configuration\n */\n public set(config: UITextureConfig): void {\n const previousWidth = this.width;\n const previousHeight = this.height;\n\n if (config instanceof Texture) {\n this.setFromTexture(config);\n } else {\n this.setFromAtlasConfig(config);\n }\n\n this.dirtyInternal = true;\n\n if (this.width !== previousWidth || this.height !== previousHeight) {\n this.emit(\n UITextureViewEvent.DIMENSIONS_CHANGED,\n this.width,\n this.height,\n this,\n );\n }\n }\n\n /** Resets to default empty texture */\n public reset(): void {\n const previousWidth = this.width;\n const previousHeight = this.height;\n\n this.textureInternal = new Texture();\n this.frameX = 0;\n this.frameY = 0;\n this.frameWidth = TEXTURE_DEFAULT_SIZE;\n this.frameHeight = TEXTURE_DEFAULT_SIZE;\n this.rotatedInternal = false;\n this.sourceWidth = TEXTURE_DEFAULT_SIZE;\n this.sourceHeight = TEXTURE_DEFAULT_SIZE;\n this.trimLeft = 0;\n this.trimRight = 0;\n this.trimTop = 0;\n this.trimBottom = 0;\n this.scaleInternal = 1;\n this.dirtyInternal = true;\n\n if (this.width !== previousWidth || this.height !== previousHeight) {\n this.emit(UITextureViewEvent.DIMENSIONS_CHANGED, this.width, this.height);\n }\n }\n\n private setFromTexture(texture: Texture): void {\n const width = texture.image?.naturalWidth ?? TEXTURE_DEFAULT_SIZE;\n const height = texture.image?.naturalHeight ?? TEXTURE_DEFAULT_SIZE;\n\n this.textureInternal = texture;\n this.frameX = 0;\n this.frameY = 0;\n this.frameWidth = width;\n this.frameHeight = height;\n this.rotatedInternal = false;\n this.sourceWidth = width;\n this.sourceHeight = height;\n this.trimLeft = 0;\n this.trimRight = 0;\n this.trimTop = 0;\n this.trimBottom = 0;\n this.scaleInternal = 1;\n }\n\n private setFromAtlasConfig(config: UITextureAtlasConfig): void {\n this.textureInternal = config.texture;\n this.frameX = config.frame.x;\n this.frameY = config.frame.y;\n this.frameWidth = config.frame.w;\n this.frameHeight = config.frame.h;\n this.rotatedInternal = config.rotated ?? false;\n this.sourceWidth = config.sourceSize.w;\n this.sourceHeight = config.sourceSize.h;\n this.scaleInternal = config.scale ?? 1;\n\n const spriteSource = config.spriteSourceSize;\n this.trimLeft = spriteSource.x;\n this.trimTop = spriteSource.y;\n this.trimRight = this.sourceWidth - spriteSource.x - spriteSource.w;\n this.trimBottom = this.sourceHeight - spriteSource.y - spriteSource.h;\n }\n}\n","import type { UIColorConfig } from \"../miscellaneous/color/UIColor.Internal\";\nimport type { UIElementOptions } from \"./UIElement.Internal\";\n\n/** Animation playback events */\nexport enum UIAnimatedImageEvent {\n /** Animation started or resumed */\n PLAYED = 0,\n /** Animation paused */\n PAUSED = 1,\n /** Animation stopped and reset */\n STOPPED = 2,\n}\n\n/** Configuration options for UIAnimatedImage */\nexport interface UIAnimatedImageOptions extends UIElementOptions {\n /** Multiplicative tint */\n color: UIColorConfig;\n /** Animation speed in frames per second */\n frameRate: number;\n /** Whether animation repeats after completion */\n loop: boolean;\n /** Whether to start playing immediately */\n playByDefault: boolean;\n}\n\nexport const ANIMATED_IMAGE_DEFAULT_FRAME_RATE = 24;\nexport const ANIMATED_IMAGE_DEFAULT_LOOP = true;\n","import { MathUtils } from \"three\";\nimport { assertValidNumber } from \"../asserts\";\nimport type { UIMicroAnchorMode, UIMicroConfig } from \"./UIMicro.Internal\";\nimport {\n MICRO_DEFAULT_ANCHOR,\n MICRO_DEFAULT_ANCHOR_MODE,\n MICRO_DEFAULT_POSITION,\n MICRO_DEFAULT_ROTATION,\n MICRO_DEFAULT_SCALE,\n} from \"./UIMicro.Internal\";\n\n/** Transforms that don't affect constraints */\nexport class UIMicro {\n private xInternal: number;\n private yInternal: number;\n private anchorXInternal: number;\n private anchorYInternal: number;\n private scaleXInternal: number;\n private scaleYInternal: number;\n private rotationInternal: number;\n private anchorModeInternal: UIMicroAnchorMode;\n\n private dirtyInternal = true;\n\n /**\n * Creates UIMicro instance.\n *\n * @param config - Transform configuration\n */\n constructor(config?: Partial<UIMicroConfig>) {\n this.xInternal = config?.x ?? MICRO_DEFAULT_POSITION;\n this.yInternal = config?.y ?? MICRO_DEFAULT_POSITION;\n this.anchorXInternal = config?.anchorX ?? MICRO_DEFAULT_ANCHOR;\n this.anchorYInternal = config?.anchorY ?? MICRO_DEFAULT_ANCHOR;\n this.scaleXInternal = config?.scaleX ?? MICRO_DEFAULT_SCALE;\n this.scaleYInternal = config?.scaleY ?? MICRO_DEFAULT_SCALE;\n this.rotationInternal = config?.rotation ?? MICRO_DEFAULT_ROTATION;\n this.anchorModeInternal = config?.anchorMode ?? MICRO_DEFAULT_ANCHOR_MODE;\n }\n\n /** X offset in world units */\n public get x(): number {\n return this.xInternal;\n }\n\n /** Y offset in world units */\n public get y(): number {\n return this.yInternal;\n }\n\n /** X anchor in normalized coordinates (0 to 1) */\n public get anchorX(): number {\n return this.anchorXInternal;\n }\n\n /** Y anchor in normalized coordinates (0 to 1) */\n public get anchorY(): number {\n return this.anchorYInternal;\n }\n\n /** X scale multiplier */\n public get scaleX(): number {\n return this.scaleXInternal;\n }\n\n /** Y scale multiplier */\n public get scaleY(): number {\n return this.scaleYInternal;\n }\n\n /** Rotation in degrees */\n public get angle(): number {\n return MathUtils.radToDeg(this.rotationInternal);\n }\n\n /** Which transforms apply relative to anchor */\n public get anchorMode(): UIMicroAnchorMode {\n return this.anchorModeInternal;\n }\n\n /** Rotation in radians */\n public get rotation(): number {\n return this.rotationInternal;\n }\n\n /** @internal */\n public get dirty(): boolean {\n return this.dirtyInternal;\n }\n\n /** X offset in world units */\n public set x(value: number) {\n assertValidNumber(value, \"UIMicro.x\");\n if (value !== this.xInternal) {\n this.xInternal = value;\n this.dirtyInternal = true;\n }\n }\n\n /** Y offset in world units */\n public set y(value: number) {\n assertValidNumber(value, \"UIMicro.y\");\n if (value !== this.yInternal) {\n this.yInternal = value;\n this.dirtyInternal = true;\n }\n }\n\n /** X anchor in normalized coordinates (0 to 1) */\n public set anchorX(value: number) {\n assertValidNumber(value, \"UIMicro.anchorX\");\n if (value !== this.anchorXInternal) {\n this.anchorXInternal = value;\n this.dirtyInternal = true;\n }\n }\n\n /** Y anchor in normalized coordinates (0 to 1) */\n public set anchorY(value: number) {\n assertValidNumber(value, \"UIMicro.anchorY\");\n if (value !== this.anchorYInternal) {\n this.anchorYInternal = value;\n this.dirtyInternal = true;\n }\n }\n\n /** X scale multiplier */\n public set scaleX(value: number) {\n assertValidNumber(value, \"UIMicro.scaleX\");\n if (value !== this.scaleXInternal) {\n this.scaleXInternal = value;\n this.dirtyInternal = true;\n }\n }\n\n /** Y scale multiplier */\n public set scaleY(value: number) {\n assertValidNumber(value, \"UIMicro.scaleY\");\n if (value !== this.scaleYInternal) {\n this.scaleYInternal = value;\n this.dirtyInternal = true;\n }\n }\n\n /** Rotation in degrees */\n public set angle(value: number) {\n assertValidNumber(value, \"UIMicro.angle\");\n const rotation = MathUtils.degToRad(value);\n if (rotation !== this.rotationInternal) {\n this.rotationInternal = rotation;\n this.dirtyInternal = true;\n }\n }\n\n /** Rotation in radians */\n public set rotation(value: number) {\n assertValidNumber(value, \"UIMicro.rotation\");\n if (value !== this.rotationInternal) {\n this.rotationInternal = value;\n this.dirtyInternal = true;\n }\n }\n\n /** Which transforms apply relative to anchor */\n public set anchorMode(value: UIMicroAnchorMode) {\n if (value !== this.anchorModeInternal) {\n this.anchorModeInternal = value;\n this.dirtyInternal = true;\n }\n }\n\n /** @internal */\n public setDirtyFalse(): void {\n this.dirtyInternal = false;\n }\n\n /** Resets all transforms to defaults */\n public reset(): void {\n if (\n this.xInternal !== MICRO_DEFAULT_POSITION ||\n this.yInternal !== MICRO_DEFAULT_POSITION ||\n this.anchorXInternal !== MICRO_DEFAULT_ANCHOR ||\n this.anchorYInternal !== MICRO_DEFAULT_ANCHOR ||\n this.scaleXInternal !== MICRO_DEFAULT_SCALE ||\n this.scaleYInternal !== MICRO_DEFAULT_SCALE ||\n this.rotationInternal !== MICRO_DEFAULT_ROTATION\n ) {\n this.xInternal = MICRO_DEFAULT_POSITION;\n this.yInternal = MICRO_DEFAULT_POSITION;\n this.anchorXInternal = MICRO_DEFAULT_ANCHOR;\n this.anchorYInternal = MICRO_DEFAULT_ANCHOR;\n this.scaleXInternal = MICRO_DEFAULT_SCALE;\n this.scaleYInternal = MICRO_DEFAULT_SCALE;\n this.rotationInternal = MICRO_DEFAULT_ROTATION;\n this.dirtyInternal = true;\n }\n }\n\n /** Copies transforms from another instance */\n public copy(value: UIMicro): void {\n if (\n this.xInternal !== value.xInternal ||\n this.yInternal !== value.yInternal ||\n this.anchorXInternal !== value.anchorXInternal ||\n this.anchorYInternal !== value.anchorYInternal ||\n this.scaleXInternal !== value.scaleXInternal ||\n this.scaleYInternal !== value.scaleYInternal ||\n this.rotationInternal !== value.rotationInternal ||\n this.anchorModeInternal !== value.anchorModeInternal\n ) {\n this.xInternal = value.xInternal;\n this.yInternal = value.yInternal;\n this.anchorXInternal = value.anchorXInternal;\n this.anchorYInternal = value.anchorYInternal;\n this.scaleXInternal = value.scaleXInternal;\n this.scaleYInternal = value.scaleYInternal;\n this.rotationInternal = value.rotationInternal;\n this.anchorModeInternal = value.anchorModeInternal;\n this.dirtyInternal = true;\n }\n }\n}\n","/** Base class for interaction area shapes */\nexport abstract class UIArea {\n /** @internal */\n public abstract contains(pointX: number, pointY: number): boolean;\n}\n","import { UIArea } from \"./UIArea\";\n\n/** Rectangular interaction area */\nexport class UIAreaRectangle extends UIArea {\n /**\n * Creates rectangular area.\n *\n * @param x - X position in normalized coordinates (0 to 1)\n * @param y - Y position in normalized coordinates (0 to 1)\n * @param width - Width in normalized coordinates (0 to 1)\n * @param height - Height in normalized coordinates (0 to 1)\n */\n constructor(\n public x: number,\n public y: number,\n public width: number,\n public height: number,\n ) {\n super();\n }\n\n /** @internal */\n public contains(pointX: number, pointY: number): boolean {\n return (\n pointX >= this.x &&\n pointX <= this.x + this.width &&\n pointY >= this.y &&\n pointY <= this.y + this.height\n );\n }\n}\n","/** Input events emitted by UI elements */\nexport enum UIInputEvent {\n /** Pointer pressed */\n PRESSED = \"pointerdown\",\n /** Pointer moved */\n MOVED = \"pointermove\",\n /** Pointer released */\n RELEASED = \"pointerup\",\n /** Pointer entered element */\n ENTERED = \"pointerenter\",\n /** Pointer left element */\n LEFT = \"pointerleave\",\n}\n","import type { UIArea } from \"../miscellaneous/area/UIArea\";\nimport { UIMode } from \"../miscellaneous/UIMode\";\nimport type { UIAnchorOptions } from \"./UIAnchor.Internal\";\n\n/** Configuration options for UIDummy */\nexport interface UIDummyOptions extends UIAnchorOptions {\n /** Width in world units */\n width: number;\n /** Height in world units */\n height: number;\n /** Shape defining interactive region in normalized coordinates */\n interactionArea: UIArea;\n /** Controls visibility and interactivity */\n mode: UIMode;\n}\n\nexport const DUMMY_DEFAULT_WIDTH = 64;\nexport const DUMMY_DEFAULT_HEIGHT = 32;\nexport const DUMMY_DEFAULT_MODE = UIMode.VISIBLE;\nexport const DUMMY_DEFAULT_Z_INDEX = 0;\n","import { MathUtils } from \"three\";\nimport type { UILayer } from \"../layers/UILayer\";\nimport type { UIArea } from \"../miscellaneous/area/UIArea\";\nimport { UIAreaRectangle } from \"../miscellaneous/area/UIAreaRectangle\";\nimport type { UIPlaneElement } from \"../miscellaneous/asserts\";\nimport {\n assertValidNumber,\n assertValidPositiveNumber,\n} from \"../miscellaneous/asserts\";\nimport { UIInputEvent } from \"../miscellaneous/UIInputEvent\";\nimport { isUIModeInteractive, UIMode } from \"../miscellaneous/UIMode\";\nimport { UIPriority } from \"../miscellaneous/UIPriority\";\nimport type { UIInputWrapperInterface } from \"../wrappers/UIInputWrapper.Internal\";\nimport { UIAnchor } from \"./UIAnchor\";\nimport type { UIDummyOptions } from \"./UIDummy.Internal\";\nimport {\n DUMMY_DEFAULT_HEIGHT,\n DUMMY_DEFAULT_MODE,\n DUMMY_DEFAULT_WIDTH,\n DUMMY_DEFAULT_Z_INDEX,\n} from \"./UIDummy.Internal\";\n\n/** Rectangular area with dimensions but no rendering */\nexport class UIDummy extends UIAnchor implements UIPlaneElement {\n /** Shape defining interactive region in normalized coordinates */\n public interactionArea: UIArea;\n\n /** Solver variable for width */\n public readonly wVariable: number;\n\n /** Solver variable for height */\n public readonly hVariable: number;\n\n protected modeInternal: UIMode;\n protected readonly inputWrapper: UIInputWrapperInterface;\n private readonly catcherHandler: number;\n private lastPointerInside = false;\n\n /**\n * Creates a new UIDummy instance.\n *\n * @param layer - Layer containing this element\n * @param options - Configuration options\n */\n constructor(layer: UILayer, options?: Partial<UIDummyOptions>) {\n const w = options?.width ?? DUMMY_DEFAULT_WIDTH;\n const h = options?.height ?? DUMMY_DEFAULT_HEIGHT;\n\n assertValidPositiveNumber(w, \"UIDummy.constructor.width\");\n assertValidPositiveNumber(h, \"UIDummy.constructor.height\");\n\n super(layer, options);\n this.interactionArea =\n options?.interactionArea ?? new UIAreaRectangle(0, 0, 1, 1);\n this.modeInternal = options?.mode ?? DUMMY_DEFAULT_MODE;\n this.inputWrapper = this.layer.inputWrapper;\n\n this.wVariable = this.solverWrapper.createVariable(w, UIPriority.P6);\n this.hVariable = this.solverWrapper.createVariable(h, UIPriority.P6);\n\n this.catcherHandler = this.inputWrapper.createInputCatcher(\n this.catchPointerDown,\n this.catchPointerMove,\n this.catchPointerUp,\n DUMMY_DEFAULT_Z_INDEX,\n );\n\n this.inputWrapper.setActive(\n this.catcherHandler,\n isUIModeInteractive(this.modeInternal),\n );\n }\n\n /** Width in world units */\n public get width(): number {\n return this.solverWrapper.readVariableValue(this.wVariable);\n }\n\n /** Height in world units */\n public get height(): number {\n return this.solverWrapper.readVariableValue(this.hVariable);\n }\n\n /** X coordinate of right edge */\n public get oppositeX(): number {\n return this.x + this.width;\n }\n\n /** Y coordinate of top edge */\n public get oppositeY(): number {\n return this.y + this.height;\n }\n\n /** X coordinate of horizontal center */\n public get centerX(): number {\n return this.x + this.width / 2;\n }\n\n /** Y coordinate of vertical center */\n public get centerY(): number {\n return this.y + this.height / 2;\n }\n\n /** Controls visibility and interactivity */\n public get mode(): UIMode {\n return this.modeInternal;\n }\n\n /** Rendering and input priority. Higher values on top. */\n public get zIndex(): number {\n return this.inputWrapper.getZIndex(this.catcherHandler);\n }\n\n /** Width in world units */\n public set width(value: number) {\n assertValidPositiveNumber(value, \"UIDummy.width\");\n this.solverWrapper.suggestVariableValue(this.wVariable, value);\n }\n\n /** Height in world units */\n public set height(value: number) {\n assertValidPositiveNumber(value, \"UIDummy.height\");\n this.solverWrapper.suggestVariableValue(this.hVariable, value);\n }\n\n /** X coordinate of right edge */\n public set oppositeX(value: number) {\n assertValidNumber(value, \"UIDummy.oppositeX\");\n this.x = value - this.width;\n }\n\n /** Y coordinate of top edge */\n public set oppositeY(value: number) {\n assertValidNumber(value, \"UIDummy.oppositeY\");\n this.y = value - this.height;\n }\n\n /** X coordinate of horizontal center */\n public set centerX(value: number) {\n assertValidNumber(value, \"UIDummy.centerX\");\n this.x = value - this.width / 2;\n }\n\n /** Y coordinate of vertical center */\n public set centerY(value: number) {\n assertValidNumber(value, \"UIDummy.centerY\");\n this.y = value - this.height / 2;\n }\n\n /** Controls visibility and interactivity */\n public set mode(value: UIMode) {\n if (this.modeInternal !== value) {\n const newInteractivity = isUIModeInteractive(value);\n this.inputWrapper.setActive(this.catcherHandler, newInteractivity);\n this.modeInternal = value;\n }\n }\n\n /** Rendering and input priority. Higher values on top. */\n public set zIndex(value: number) {\n assertValidNumber(value, \"UIDummy.zIndex\");\n this.inputWrapper.setZIndex(this.catcherHandler, value);\n }\n\n /** Removes element and frees resources */\n public override destroy(): void {\n this.solverWrapper.removeVariable(this.hVariable);\n this.solverWrapper.removeVariable(this.wVariable);\n this.inputWrapper.destroyInputCatcher(this.catcherHandler);\n super.destroy();\n }\n\n protected readonly catchPointerDown = (\n x: number,\n y: number,\n identifier: number,\n ): boolean => {\n return this.handleInputEvent(x, y, identifier, UIInputEvent.PRESSED);\n };\n\n protected readonly catchPointerMove = (\n x: number,\n y: number,\n identifier: number,\n ): boolean => {\n return this.handleInputEvent(x, y, identifier, UIInputEvent.MOVED);\n };\n\n protected readonly catchPointerUp = (\n x: number,\n y: number,\n identifier: number,\n ): boolean => {\n return this.handleInputEvent(x, y, identifier, UIInputEvent.RELEASED);\n };\n\n protected handleInputEvent(\n x: number,\n y: number,\n identifier: number,\n inputEvent: UIInputEvent,\n ): boolean {\n assertValidNumber(x, \"UIDummy.handleInputEvent.x\");\n assertValidNumber(y, \"UIDummy.handleInputEvent.y\");\n assertValidNumber(identifier, \"UIDummy.handleInputEvent.identifier\");\n\n const isPointerInside = this.interactionArea.contains(\n MathUtils.mapLinear(x, this.x, this.oppositeX, 0, 1),\n MathUtils.mapLinear(y, this.y, this.oppositeY, 0, 1),\n );\n\n if (isPointerInside) {\n this.emit(inputEvent, x, y, identifier, this);\n }\n\n if (this.lastPointerInside && !isPointerInside) {\n this.emit(UIInputEvent.LEFT, x, y, identifier, this);\n } else if (!this.lastPointerInside && isPointerInside) {\n this.emit(UIInputEvent.ENTERED, x, y, identifier, this);\n }\n\n this.lastPointerInside = isPointerInside;\n return this.modeInternal === UIMode.INTERACTIVE_TRANSPARENT\n ? false\n : isPointerInside;\n }\n}\n","import type { UIMicroConfig } from \"../miscellaneous/micro/UIMicro.Internal\";\nimport { UITransparencyMode } from \"../miscellaneous/UITransparencyMode\";\nimport type { UIDummyOptions } from \"./UIDummy.Internal\";\n\n/** Configuration options for UIElement */\nexport interface UIElementOptions extends UIDummyOptions {\n /** Transforms that don't affect constraints */\n micro: UIMicroConfig;\n /** Alpha blending mode */\n transparencyMode: UITransparencyMode;\n}\n\nexport const ELEMENT_DEFAULT_TRANSPARENCY_MODE = UITransparencyMode.BLEND;\n","import type { WebGLRenderer } from \"three\";\nimport type { UILayer } from \"../layers/UILayer\";\nimport { UILayerEvent } from \"../layers/UILayer.Internal\";\nimport { computeTransformMatrix } from \"../miscellaneous/computeTransform\";\nimport type { UIPropertyType } from \"../miscellaneous/generic-plane/shared\";\nimport { UIMicro } from \"../miscellaneous/micro/UIMicro\";\nimport type { UIMode } from \"../miscellaneous/UIMode\";\nimport { isUIModeVisible } from \"../miscellaneous/UIMode\";\nimport type { UITransparencyMode } from \"../miscellaneous/UITransparencyMode\";\nimport type { UISceneWrapperInterface } from \"../wrappers/UISceneWrapper.Internal\";\nimport { UIDummy } from \"./UIDummy\";\nimport type { UIElementOptions } from \"./UIElement.Internal\";\nimport { ELEMENT_DEFAULT_TRANSPARENCY_MODE } from \"./UIElement.Internal\";\n\n/** Base class for renderable UI elements */\nexport abstract class UIElement extends UIDummy {\n /** Transforms that don't affect constraints */\n public readonly micro: UIMicro;\n\n protected readonly sceneWrapper: UISceneWrapperInterface;\n protected readonly planeHandler: number;\n\n private transparencyModeInternal: UITransparencyMode;\n private transparencyModeDirty = false;\n\n private visibilityDirty = false;\n\n /**\n * Creates a new UIElement instance.\n *\n * @param layer - Layer containing this element\n * @param source - GLSL shader source code\n * @param properties - Shader uniform properties\n * @param options - Configuration options\n */\n constructor(\n layer: UILayer,\n source: string,\n properties: Record<string, UIPropertyType>,\n options?: Partial<UIElementOptions>,\n ) {\n super(layer, options);\n this.micro = new UIMicro(options?.micro);\n\n this.transparencyModeInternal =\n options?.transparencyMode ?? ELEMENT_DEFAULT_TRANSPARENCY_MODE;\n\n this.sceneWrapper = this.layer.sceneWrapper;\n this.planeHandler = this.sceneWrapper.createPlane(\n source,\n properties,\n this.transparencyModeInternal,\n );\n\n this.layer.on(UILayerEvent.RENDERING, this.onWillRender, this);\n }\n\n /** Alpha blending mode */\n public get transparencyMode(): UITransparencyMode {\n return this.transparencyModeInternal;\n }\n\n /** Alpha blending mode */\n public set transparencyMode(value: UITransparencyMode) {\n if (this.transparencyModeInternal !== value) {\n this.transparencyModeInternal = value;\n this.transparencyModeDirty = true;\n }\n }\n\n public override set mode(value: UIMode) {\n if (this.modeInternal !== value) {\n this.visibilityDirty =\n isUIModeVisible(this.modeInternal) !== isUIModeVisible(value);\n super.mode = value;\n }\n }\n\n /** Removes element and frees resources */\n public override destroy(): void {\n this.layer.off(UILayerEvent.RENDERING, this.onWillRender, this);\n this.sceneWrapper.destroyPlane(this.planeHandler);\n super.destroy();\n }\n\n protected updatePlaneTransform(): void {\n if (\n this.micro.dirty ||\n this.inputWrapper.dirty ||\n this.solverWrapper.dirty\n ) {\n this.sceneWrapper.setTransform(\n this.planeHandler,\n computeTransformMatrix(\n this.x,\n this.y,\n this.width,\n this.height,\n this.zIndex,\n this.micro.x,\n this.micro.y,\n this.micro.anchorX,\n this.micro.anchorY,\n this.micro.scaleX,\n this.micro.scaleY,\n this.micro.rotation,\n this.micro.anchorMode,\n ),\n );\n this.micro.setDirtyFalse();\n }\n }\n\n protected onWillRender(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars -- Required by UILayer event interface but not used in base implementation\n renderer: WebGLRenderer,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars -- Required by UILayer event interface but not used in base implementation\n deltaTime: number,\n ): void {\n if (this.transparencyModeDirty) {\n this.sceneWrapper.setTransparency(\n this.planeHandler,\n this.transparencyModeInternal,\n );\n this.transparencyModeDirty = false;\n }\n\n if (this.visibilityDirty) {\n this.sceneWrapper.setVisibility(\n this.planeHandler,\n isUIModeVisible(this.modeInternal),\n );\n this.visibilityDirty = false;\n }\n\n this.updatePlaneTransform();\n }\n}\n","import type { Matrix3, WebGLRenderer } from \"three\";\nimport type { UILayer } from \"../layers/UILayer\";\nimport { assertValidPositiveNumber } from \"../miscellaneous/asserts\";\nimport { UIColor } from \"../miscellaneous/color/UIColor\";\nimport { computeTrimmedTransformMatrix } from \"../miscellaneous/computeTransform\";\nimport { UITextureView } from \"../miscellaneous/texture/UITextureView\";\nimport type { UITextureConfig } from \"../miscellaneous/texture/UITextureView.Internal\";\nimport { UITextureViewEvent } from \"../miscellaneous/texture/UITextureView.Internal\";\nimport source from \"../shaders/UIImage.glsl\";\nimport type { UIAnimatedImageOptions } from \"./UIAnimatedImage.Internal\";\nimport {\n ANIMATED_IMAGE_DEFAULT_FRAME_RATE,\n ANIMATED_IMAGE_DEFAULT_LOOP,\n UIAnimatedImageEvent,\n} from \"./UIAnimatedImage.Internal\";\nimport { UIElement } from \"./UIElement\";\n\n/** Frame-based texture animation element */\nexport class UIAnimatedImage extends UIElement {\n /** Multiplicative tint. Alpha channel controls opacity. */\n public readonly color: UIColor;\n\n private readonly sequenceInternal: UITextureView[];\n\n private frameRateInternal: number;\n private loopInternal: boolean;\n private readonly textureTransform: Matrix3;\n\n private isPlaying = false;\n private sequenceFrameIndex = 0;\n private currentFrameIndexDirty = false;\n private accumulatedTime = 0;\n\n /**\n * Creates a new UIAnimatedImage instance.\n *\n * Defaults size to first frame dimensions if width and height not provided.\n *\n * @param layer - Layer containing this element\n * @param sequence - Array of textures forming animation\n * @param options - Configuration options\n */\n constructor(\n layer: UILayer,\n sequence: UITextureConfig[],\n options: Partial<UIAnimatedImageOptions> = {},\n ) {\n const color = new UIColor(options.color);\n const uiTextures = sequence.map(\n (textureConfig) => new UITextureView(textureConfig),\n );\n\n const frame = uiTextures[0];\n options.width = options.width ?? frame.width;\n options.height = options.height ?? frame.height;\n\n const textureTransform = frame.calculateUVTransform();\n\n super(\n layer,\n source,\n {\n texture: frame.texture,\n textureTransform: textureTransform,\n color,\n },\n options,\n );\n\n this.sequenceInternal = uiTextures;\n this.textureTransform = textureTransform;\n this.frameRateInternal =\n options.frameRate ?? ANIMATED_IMAGE_DEFAULT_FRAME_RATE;\n this.loopInternal = options.loop ?? ANIMATED_IMAGE_DEFAULT_LOOP;\n this.color = color;\n\n this.subscribeSequenceEvents();\n\n if (options.playByDefault === true) {\n this.play();\n }\n }\n\n /** Animation frames as readonly array */\n public get sequence(): readonly UITextureView[] {\n return this.sequenceInternal;\n }\n\n /** Animation speed in frames per second */\n public get frameRate(): number {\n return this.frameRateInternal;\n }\n\n /** Whether animation repeats after completion */\n public get loop(): boolean {\n return this.loopInternal;\n }\n\n /** Total animation duration in seconds */\n public get duration(): number {\n return this.sequenceInternal.length / this.frameRateInternal;\n }\n\n /** Replaces animation frames. Stops playback. */\n public set sequence(sequence: UITextureConfig[]) {\n this.stop();\n this.unsubscribeSequenceEvents();\n\n const newLength = sequence.length;\n const currentLength = this.sequenceInternal.length;\n\n for (let i = 0; i < Math.min(newLength, currentLength); i++) {\n this.sequenceInternal[i].set(sequence[i]);\n }\n\n if (newLength < currentLength) {\n this.sequenceInternal.length = newLength;\n } else if (newLength > currentLength) {\n for (let i = currentLength; i < newLength; i++) {\n this.sequenceInternal.push(new UITextureView(sequence[i]));\n }\n }\n\n this.subscribeSequenceEvents();\n }\n\n /** Animation speed in frames per second */\n public set frameRate(value: number) {\n assertValidPositiveNumber(value, \"UIAnimatedImage.frameRate\");\n this.frameRateInternal = value;\n }\n\n /** Whether animation repeats after completion */\n public set loop(value: boolean) {\n this.loopInternal = value;\n }\n\n /** Removes element and frees resources */\n public override destroy(): void {\n this.unsubscribeSequenceEvents();\n super.destroy();\n }\n\n /** Starts or resumes animation playback */\n public play(): void {\n if (!this.isPlaying) {\n this.isPlaying = true;\n this.emit(UIAnimatedImageEvent.PLAYED);\n }\n }\n\n /** Pauses animation at current frame */\n public pause(): void {\n if (this.isPlaying) {\n this.isPlaying = false;\n this.emit(UIAnimatedImageEvent.PAUSED);\n }\n }\n\n /** Stops animation and resets to first frame */\n public stop(): void {\n if (\n this.isPlaying ||\n this.accumulatedTime > 0 ||\n this.sequenceFrameIndex > 0\n ) {\n this.isPlaying = false;\n this.accumulatedTime = 0;\n this.sequenceFrameIndex = 0;\n this.currentFrameIndexDirty = true;\n this.emit(UIAnimatedImageEvent.STOPPED);\n }\n }\n\n protected override onWillRender(\n renderer: WebGLRenderer,\n deltaTime: number,\n ): void {\n if (this.isPlaying) {\n this.accumulatedTime += deltaTime;\n const frameDuration = 1 / this.frameRateInternal;\n\n while (this.accumulatedTime >= frameDuration) {\n this.accumulatedTime -= frameDuration;\n this.sequenceFrameIndex += 1;\n\n if (this.loopInternal) {\n this.sequenceFrameIndex %= this.sequenceInternal.length;\n } else if (this.sequenceFrameIndex >= this.sequenceInternal.length) {\n this.sequenceFrameIndex = this.sequenceInternal.length - 1;\n this.isPlaying = false;\n this.emit(UIAnimatedImageEvent.PAUSED);\n break;\n }\n\n this.currentFrameIndexDirty = true;\n }\n }\n\n super.onWillRender(renderer, deltaTime);\n }\n\n protected override updatePlaneTransform(): void {\n const frame = this.sequenceInternal[this.sequenceFrameIndex];\n\n if (this.color.dirty || this.currentFrameIndexDirty) {\n this.sceneWrapper.setProperties(this.planeHandler, {\n texture: frame.texture,\n textureTransform: frame.calculateUVTransform(this.textureTransform),\n color: this.color,\n });\n\n this.color.setDirtyFalse();\n }\n\n if (\n this.currentFrameIndexDirty ||\n frame.dirty ||\n this.micro.dirty ||\n this.inputWrapper.dirty ||\n this.solverWrapper.dirty\n ) {\n const trim = frame.trim;\n const micro = this.micro;\n this.sceneWrapper.setTransform(\n this.planeHandler,\n computeTrimmedTransformMatrix(\n this.x,\n this.y,\n this.width,\n this.height,\n this.zIndex,\n micro.x,\n micro.y,\n micro.anchorX,\n micro.anchorY,\n micro.scaleX,\n micro.scaleY,\n micro.rotation,\n micro.anchorMode,\n trim.left,\n trim.right,\n trim.top,\n trim.bottom,\n ),\n );\n\n frame.setDirtyFalse();\n this.currentFrameIndexDirty = false;\n this.micro.setDirtyFalse();\n }\n }\n\n private readonly onTextureDimensionsChanged = (\n width: number,\n height: number,\n texture: UITextureView,\n ): void => {\n if (this.sequenceInternal[this.sequenceFrameIndex] === texture) {\n this.width = width;\n this.height = height;\n }\n };\n\n private subscribeSequenceEvents(): void {\n for (const frame of this.sequenceInternal) {\n frame.on(\n UITextureViewEvent.DIMENSIONS_CHANGED,\n this.onTextureDimensionsChanged,\n );\n }\n }\n\n private unsubscribeSequenceEvents(): void {\n for (const frame of this.sequenceInternal) {\n frame.off(\n UITextureViewEvent.DIMENSIONS_CHANGED,\n this.onTextureDimensionsChanged,\n );\n }\n }\n}\n","import type { WebGLRenderer } from \"three\";\nimport { CanvasTexture, LinearFilter } from \"three\";\nimport type { UILayer } from \"../layers/UILayer\";\nimport { UIColor } from \"../miscellaneous/color/UIColor\";\nimport source from \"../shaders/UIImage.glsl\";\nimport { DUMMY_DEFAULT_HEIGHT, DUMMY_DEFAULT_WIDTH } from \"./UIDummy.Internal\";\nimport { UIElement } from \"./UIElement\";\nimport type { UIGraphicsOptions } from \"./UIGraphics.Internal\";\n\n/** Canvas-based 2D drawing element */\nexport class UIGraphics extends UIElement {\n /** Multiplicative tint. Alpha channel controls opacity. */\n public readonly color: UIColor;\n\n private readonly canvas: OffscreenCanvas;\n private readonly context: OffscreenCanvasRenderingContext2D;\n private readonly texture: CanvasTexture;\n\n /**\n * Creates a new UIGraphics instance.\n *\n * @param layer - Layer containing this element\n * @param options - Configuration options\n */\n constructor(layer: UILayer, options?: Partial<UIGraphicsOptions>) {\n const w = options?.width ?? DUMMY_DEFAULT_WIDTH;\n const h = options?.width ?? DUMMY_DEFAULT_HEIGHT;\n const color = new UIColor(options?.color);\n\n const canvas = new OffscreenCanvas(w, h);\n const context = canvas.getContext(\"2d\");\n\n if (!context) {\n throw new Error(\n \"UIGraphics.constructor: failed to get 2D context from OffscreenCanvas\",\n );\n }\n\n const texture = new CanvasTexture(canvas);\n texture.minFilter = LinearFilter;\n texture.magFilter = LinearFilter;\n\n super(\n layer,\n source,\n {\n texture: texture,\n textureTransform: texture.matrix,\n color,\n },\n options,\n );\n\n this.canvas = canvas;\n this.context = context;\n this.texture = texture;\n this.color = color;\n }\n\n /**\n * Clears canvas. Optionally fills with color.\n *\n * @param color - Fill color after clearing\n */\n public clear(color?: UIColor): this {\n this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n if (color !== undefined) {\n this.context.fillStyle = color.toCSSColor();\n this.context.fillRect(0, 0, this.canvas.width, this.canvas.height);\n }\n this.texture.needsUpdate = true;\n return this;\n }\n\n /** Draws filled rectangle */\n public drawRect(\n x: number,\n y: number,\n width: number,\n height: number,\n color: UIColor,\n ): this {\n this.context.fillStyle = color.toCSSColor();\n this.context.fillRect(x, y, width, height);\n this.texture.needsUpdate = true;\n return this;\n }\n\n /** Draws filled circle */\n public drawCircle(\n x: number,\n y: number,\n radius: number,\n color: UIColor,\n ): this {\n this.context.fillStyle = color.toCSSColor();\n this.context.beginPath();\n this.context.arc(x, y, radius, 0, Math.PI * 2);\n this.context.fill();\n this.texture.needsUpdate = true;\n return this;\n }\n\n /**\n * Draws filled arc.\n *\n * @param startAngle - Start angle in radians\n * @param endAngle - End angle in radians\n */\n public drawArc(\n x: number,\n y: number,\n radius: number,\n startAngle: number,\n endAngle: number,\n color: UIColor,\n ): this {\n this.context.fillStyle = color.toCSSColor();\n this.context.beginPath();\n this.context.arc(x, y, radius, startAngle, endAngle);\n this.context.fill();\n this.texture.needsUpdate = true;\n return this;\n }\n\n /**\n * Draws connected line segments.\n *\n * @param points - Array of [x, y] pairs\n * @param lineWidth - Line width in pixels\n */\n public drawPolyline(\n points: [number, number][],\n color: UIColor,\n lineWidth = 1,\n ): this {\n if (points.length < 2) {\n return this;\n }\n\n this.context.strokeStyle = color.toCSSColor();\n this.context.lineWidth = lineWidth;\n this.context.beginPath();\n this.context.moveTo(points[0][0], points[0][1]);\n\n for (let i = 1; i < points.length; i++) {\n this.context.lineTo(points[i][0], points[i][1]);\n }\n\n this.context.stroke();\n this.texture.needsUpdate = true;\n return this;\n }\n\n /** Removes element and frees resources */\n public override destroy(): void {\n this.texture.dispose();\n super.destroy();\n }\n\n protected override onWillRender(\n renderer: WebGLRenderer,\n deltaTime: number,\n ): void {\n if (this.color.dirty) {\n this.sceneWrapper.setProperties(this.planeHandler, { color: this.color });\n this.color.setDirtyFalse();\n }\n super.onWillRender(renderer, deltaTime);\n }\n}\n","import type { Matrix3 } from \"three\";\nimport type { UILayer } from \"../layers/UILayer\";\nimport { UIColor } from \"../miscellaneous/color/UIColor\";\nimport { computeTrimmedTransformMatrix } from \"../miscellaneous/computeTransform\";\nimport { UITextureView } from \"../miscellaneous/texture/UITextureView\";\nimport type { UITextureConfig } from \"../miscellaneous/texture/UITextureView.Internal\";\nimport { UITextureViewEvent } from \"../miscellaneous/texture/UITextureView.Internal\";\nimport source from \"../shaders/UIImage.glsl\";\nimport { UIElement } from \"./UIElement\";\nimport type { UIImageOptions } from \"./UIImage.Internal\";\n\n/** Textured image element */\nexport class UIImage extends UIElement {\n /** Texture displayed by this image */\n public readonly texture: UITextureView;\n /** Multiplicative tint. Alpha channel controls opacity. */\n public readonly color: UIColor;\n\n private readonly textureTransform: Matrix3;\n\n /**\n * Creates a new UIImage instance.\n *\n * Defaults size to texture dimensions if width and height not provided.\n *\n * @param layer - Layer containing this image\n * @param texture - Texture to display\n * @param options - Configuration options\n */\n constructor(\n layer: UILayer,\n texture: UITextureConfig,\n options: Partial<UIImageOptions> = {},\n ) {\n const color = new UIColor(options.color);\n const textureView = new UITextureView(texture);\n const textureTransform = textureView.calculateUVTransform();\n\n options.width = options.width ?? textureView.width;\n options.height = options.height ?? textureView.height;\n\n super(\n layer,\n source,\n {\n texture: textureView.texture,\n textureTransform: textureTransform,\n color,\n },\n options,\n );\n\n this.texture = textureView;\n this.textureTransform = textureTransform;\n this.color = color;\n\n this.texture.on(\n UITextureViewEvent.DIMENSIONS_CHANGED,\n this.onTextureDimensionsChanged,\n );\n }\n\n /** Removes image and frees resources */\n public override destroy(): void {\n this.texture.off(\n UITextureViewEvent.DIMENSIONS_CHANGED,\n this.onTextureDimensionsChanged,\n );\n super.destroy();\n }\n\n protected override updatePlaneTransform(): void {\n if (this.texture.dirty || this.color.dirty) {\n this.sceneWrapper.setProperties(this.planeHandler, {\n texture: this.texture.texture,\n textureTransform: this.texture.calculateUVTransform(\n this.textureTransform,\n ),\n color: this.color,\n });\n\n this.color.setDirtyFalse();\n }\n\n if (\n this.texture.dirty ||\n this.micro.dirty ||\n this.inputWrapper.dirty ||\n this.solverWrapper.dirty\n ) {\n const trim = this.texture.trim;\n const micro = this.micro;\n this.sceneWrapper.setTransform(\n this.planeHandler,\n computeTrimmedTransformMatrix(\n this.x,\n this.y,\n this.width,\n this.height,\n this.zIndex,\n micro.x,\n micro.y,\n micro.anchorX,\n micro.anchorY,\n micro.scaleX,\n micro.scaleY,\n micro.rotation,\n micro.anchorMode,\n trim.left,\n trim.right,\n trim.top,\n trim.bottom,\n ),\n );\n this.texture.setDirtyFalse();\n this.micro.setDirtyFalse();\n }\n }\n\n private readonly onTextureDimensionsChanged = (\n width: number,\n height: number,\n ): void => {\n this.width = width;\n this.height = height;\n };\n}\n","/** Padding configuration as number, per-side, or per-axis */\nexport type UIPaddingConfig =\n | { horizontal: number; vertical: number }\n | { left: number; right: number; top: number; bottom: number }\n | number;\n\nexport const PADDING_DEFAULT_VALUE = 0;\n","import { Vector4 } from \"three\";\nimport { assertValidNonNegativeNumber } from \"../asserts\";\nimport type { UIPaddingConfig } from \"./UIPadding.Internal\";\nimport { PADDING_DEFAULT_VALUE } from \"./UIPadding.Internal\";\n\n/** Padding values for four sides */\nexport class UIPadding {\n private lInternal: number;\n private rInternal: number;\n private tInternal: number;\n private bInternal: number;\n\n private dirtyInternal = false;\n\n /**\n * Creates UIPadding instance.\n *\n * @param config - Padding configuration\n */\n constructor(config?: UIPaddingConfig) {\n if (config === undefined) {\n this.lInternal = PADDING_DEFAULT_VALUE;\n this.rInternal = PADDING_DEFAULT_VALUE;\n this.tInternal = PADDING_DEFAULT_VALUE;\n this.bInternal = PADDING_DEFAULT_VALUE;\n } else if (typeof config === \"number\") {\n assertValidNonNegativeNumber(config, \"UIPadding.constructor.config\");\n this.lInternal = config;\n this.rInternal = config;\n this.tInternal = config;\n this.bInternal = config;\n } else if (\"left\" in config) {\n const left = config.left;\n const right = config.right;\n const top = config.top;\n const bottom = config.bottom;\n assertValidNonNegativeNumber(left, \"UIPadding.constructor.config.left\");\n assertValidNonNegativeNumber(right, \"UIPadding.constructor.config.right\");\n assertValidNonNegativeNumber(top, \"UIPadding.constructor.config.top\");\n assertValidNonNegativeNumber(\n bottom,\n \"UIPadding.constructor.config.bottom\",\n );\n this.lInternal = left;\n this.rInternal = right;\n this.tInternal = top;\n this.bInternal = bottom;\n } else {\n const horizontal = config.horizontal;\n const vertical = config.vertical;\n assertValidNonNegativeNumber(\n horizontal,\n \"UIPadding.constructor.config.horizontal\",\n );\n assertValidNonNegativeNumber(\n vertical,\n \"UIPadding.constructor.config.vertical\",\n );\n this.lInternal = horizontal;\n this.rInternal = horizontal;\n this.tInternal = vertical;\n this.bInternal = vertical;\n }\n }\n\n /** Left padding */\n public get left(): number {\n return this.lInternal;\n }\n\n /** Right padding */\n public get right(): number {\n return this.rInternal;\n }\n\n /** Top padding */\n public get top(): number {\n return this.tInternal;\n }\n\n /** Bottom padding */\n public get bottom(): number {\n return this.bInternal;\n }\n\n /** @internal */\n public get dirty(): boolean {\n return this.dirtyInternal;\n }\n\n /** Left padding */\n public set left(value: number) {\n assertValidNonNegativeNumber(value, \"UIPadding.left\");\n if (this.lInternal !== value) {\n this.lInternal = value;\n this.dirtyInternal = true;\n }\n }\n\n /** Right padding */\n public set right(value: number) {\n assertValidNonNegativeNumber(value, \"UIPadding.right\");\n if (this.rInternal !== value) {\n this.rInternal = value;\n this.dirtyInternal = true;\n }\n }\n\n /** Top padding */\n public set top(value: number) {\n assertValidNonNegativeNumber(value, \"UIPadding.top\");\n if (this.tInternal !== value) {\n this.tInternal = value;\n this.dirtyInternal = true;\n }\n }\n\n /** Bottom padding */\n public set bottom(value: number) {\n assertValidNonNegativeNumber(value, \"UIPadding.bottom\");\n if (this.bInternal !== value) {\n this.bInternal = value;\n this.dirtyInternal = true;\n }\n }\n\n /** Sets left and right to same value */\n public setHorizontal(value: number): void {\n assertValidNonNegativeNumber(value, \"UIPadding.setHorizontal.value\");\n if (this.lInternal !== value || this.rInternal !== value) {\n this.lInternal = value;\n this.rInternal = value;\n this.dirtyInternal = true;\n }\n }\n\n /** Sets top and bottom to same value */\n public setVertical(value: number): void {\n assertValidNonNegativeNumber(value, \"UIPadding.setVertical.value\");\n if (this.tInternal !== value || this.bInternal !== value) {\n this.tInternal = value;\n this.bInternal = value;\n this.dirtyInternal = true;\n }\n }\n\n /** Sets all sides to same value */\n public setUnified(value: number): void {\n assertValidNonNegativeNumber(value, \"UIPadding.setUnified.value\");\n if (\n this.lInternal !== value ||\n this.rInternal !== value ||\n this.tInternal !== value ||\n this.bInternal !== value\n ) {\n this.lInternal = value;\n this.rInternal = value;\n this.tInternal = value;\n this.bInternal = value;\n this.dirtyInternal = true;\n }\n }\n\n /** Sets from Vector4 (x=left, y=right, z=top, w=bottom) */\n public setVector4(vector: Vector4): void {\n assertValidNonNegativeNumber(vector.x, \"UIPadding.setVector4.vector.x\");\n assertValidNonNegativeNumber(vector.y, \"UIPadding.setVector4.vector.y\");\n assertValidNonNegativeNumber(vector.z, \"UIPadding.setVector4.vector.z\");\n assertValidNonNegativeNumber(vector.w, \"UIPadding.setVector4.vector.w\");\n if (\n this.lInternal !== vector.x ||\n this.rInternal !== vector.y ||\n this.tInternal !== vector.z ||\n this.bInternal !== vector.w\n ) {\n this.lInternal = vector.x;\n this.rInternal = vector.y;\n this.tInternal = vector.z;\n this.bInternal = vector.w;\n this.dirtyInternal = true;\n }\n }\n\n /** Converts to Vector4 (left, right, top, bottom) */\n public toVector4(result = new Vector4()): Vector4 {\n return result.set(\n this.lInternal,\n this.rInternal,\n this.tInternal,\n this.bInternal,\n );\n }\n\n /** Resets all sides to 0 */\n public reset(): void {\n this.setUnified(0);\n }\n\n /** Copies from another instance */\n public copy(other: UIPadding): void {\n if (\n this.lInternal !== other.lInternal ||\n this.rInternal !== other.rInternal ||\n this.tInternal !== other.tInternal ||\n this.bInternal !== other.bInternal\n ) {\n this.lInternal = other.lInternal;\n this.rInternal = other.rInternal;\n this.tInternal = other.tInternal;\n this.bInternal = other.bInternal;\n this.dirtyInternal = true;\n }\n }\n\n /** @internal */\n public setDirtyFalse(): void {\n this.dirtyInternal = false;\n }\n}\n","import type { UIColorConfig } from \"../miscellaneous/color/UIColor.Internal\";\nimport type { UIPaddingConfig } from \"../miscellaneous/padding/UIPadding.Internal\";\nimport type { UIElementOptions } from \"./UIElement.Internal\";\n\n/** Controls how sliceRegions values are interpreted */\nexport enum UINineSliceRegionMode {\n /** sliceRegions in normalized coordinates (0 to 1) */\n NORMALIZED = 0,\n /** sliceRegions in world units */\n WORLD = 1,\n}\n\n/** Configuration options for UINineSlice */\nexport interface UINineSliceOptions extends UIElementOptions {\n /** Multiplicative tint */\n color: UIColorConfig;\n /** Border size in normalized texture coordinates (0 to 1) */\n sliceBorders: UIPaddingConfig;\n /** Region size. Interpretation depends on regionMode. */\n sliceRegions: UIPaddingConfig;\n /** How sliceRegions values are interpreted */\n regionMode: UINineSliceRegionMode;\n}\n\nexport const NINE_SLICE_DEFAULT_BORDER = 0.1;\nexport const NINE_SLICE_DEFAULT_REGION_MODE = UINineSliceRegionMode.WORLD;\n","import type { Matrix3 } from \"three\";\nimport { Vector4 } from \"three\";\nimport type { UILayer } from \"../layers/UILayer\";\nimport { UIColor } from \"../miscellaneous/color/UIColor\";\nimport { computeTrimmedTransformMatrix } from \"../miscellaneous/computeTransform\";\nimport { UIPadding } from \"../miscellaneous/padding/UIPadding\";\nimport { UITextureView } from \"../miscellaneous/texture/UITextureView\";\nimport type { UITextureConfig } from \"../miscellaneous/texture/UITextureView.Internal\";\nimport source from \"../shaders/UINineSlice.glsl\";\nimport { UIElement } from \"./UIElement\";\nimport type { UINineSliceOptions } from \"./UINineSlice.Internal\";\nimport {\n NINE_SLICE_DEFAULT_BORDER,\n NINE_SLICE_DEFAULT_REGION_MODE,\n UINineSliceRegionMode,\n} from \"./UINineSlice.Internal\";\n\n/** Scalable textured image preserving border regions */\nexport class UINineSlice extends UIElement {\n /** Texture displayed by this element */\n public readonly texture: UITextureView;\n /** Multiplicative tint. Alpha channel controls opacity. */\n public readonly color: UIColor;\n /** Border size in normalized texture coordinates (0 to 1) */\n public readonly sliceBorders: UIPadding;\n /** Region size. Interpretation depends on regionMode. */\n public readonly sliceRegions: UIPadding;\n\n private regionModeInternal: UINineSliceRegionMode;\n private regionModeDirty = false;\n\n private readonly textureTransform: Matrix3;\n private readonly sliceBordersVector = new Vector4();\n private readonly sliceRegionsVector = new Vector4();\n\n private lastWidth: number;\n private lastHeight: number;\n\n /**\n * Creates a new UINineSlice instance.\n *\n * Defaults size to texture dimensions if width and height not provided.\n *\n * @param layer - Layer containing this element\n * @param texture - Texture to display\n * @param options - Configuration options\n */\n constructor(\n layer: UILayer,\n texture: UITextureConfig,\n options: Partial<UINineSliceOptions> = {},\n ) {\n const color = new UIColor(options.color);\n const textureView = new UITextureView(texture);\n const textureTransform = textureView.calculateUVTransform();\n\n options.width = options.width ?? textureView.width;\n options.height = options.height ?? textureView.height;\n\n const sliceBorders = new UIPadding(\n options.sliceBorders ?? NINE_SLICE_DEFAULT_BORDER,\n );\n const sliceRegions = new UIPadding(\n options.sliceRegions ?? NINE_SLICE_DEFAULT_BORDER,\n );\n\n const regionMode = options.regionMode ?? NINE_SLICE_DEFAULT_REGION_MODE;\n\n const sliceBordersVector = new Vector4();\n const sliceRegionsVector = new Vector4();\n\n super(\n layer,\n source,\n {\n texture: textureView.texture,\n textureTransform: textureTransform,\n color,\n sliceBorders: sliceBordersVector,\n sliceRegions: sliceRegionsVector,\n },\n options,\n );\n\n this.texture = textureView;\n this.textureTransform = textureTransform;\n this.color = color;\n this.sliceBorders = sliceBorders;\n this.sliceRegions = sliceRegions;\n this.regionModeInternal = regionMode;\n\n this.sliceBordersVector = sliceBordersVector;\n this.sliceRegionsVector = sliceRegionsVector;\n\n this.lastWidth = this.width;\n this.lastHeight = this.height;\n }\n\n /** Controls how sliceRegions values are interpreted */\n public get regionMode(): UINineSliceRegionMode {\n return this.regionModeInternal;\n }\n\n /** Controls how sliceRegions values are interpreted */\n public set regionMode(value: UINineSliceRegionMode) {\n if (this.regionModeInternal !== value) {\n this.regionModeInternal = value;\n this.regionModeDirty = true;\n }\n }\n\n protected override updatePlaneTransform(): void {\n if (\n this.regionModeDirty ||\n this.texture.dirty ||\n this.color.dirty ||\n this.sliceBorders.dirty ||\n this.sliceRegions.dirty ||\n (this.regionModeInternal === UINineSliceRegionMode.WORLD &&\n this.checkDimensionsDirty())\n ) {\n this.calculateSliceBordersForShader(this.sliceBordersVector);\n this.calculateSliceRegionsForShader(this.sliceRegionsVector);\n\n this.sceneWrapper.setProperties(this.planeHandler, {\n texture: this.texture.texture,\n textureTransform: this.texture.calculateUVTransform(\n this.textureTransform,\n ),\n color: this.color,\n sliceBorders: this.sliceBordersVector,\n sliceRegions: this.sliceRegionsVector,\n });\n\n this.regionModeDirty = false;\n this.color.setDirtyFalse();\n this.sliceBorders.setDirtyFalse();\n this.sliceRegions.setDirtyFalse();\n this.setDimensionsDirtyFalse();\n }\n\n if (\n this.texture.dirty ||\n this.micro.dirty ||\n this.inputWrapper.dirty ||\n this.solverWrapper.dirty\n ) {\n const trim = this.texture.trim;\n const micro = this.micro;\n this.sceneWrapper.setTransform(\n this.planeHandler,\n computeTrimmedTransformMatrix(\n this.x,\n this.y,\n this.width,\n this.height,\n this.zIndex,\n micro.x,\n micro.y,\n micro.anchorX,\n micro.anchorY,\n micro.scaleX,\n micro.scaleY,\n micro.rotation,\n micro.anchorMode,\n trim.left,\n trim.right,\n trim.top,\n trim.bottom,\n ),\n );\n this.texture.setDirtyFalse();\n this.micro.setDirtyFalse();\n }\n }\n\n private calculateSliceBordersForShader(result: Vector4): Vector4 {\n const sourceWidth = this.texture.width;\n const sourceHeight = this.texture.height;\n const trim = this.texture.trim;\n\n const trimmedWidth = sourceWidth - trim.left - trim.right;\n const trimmedHeight = sourceHeight - trim.top - trim.bottom;\n\n const trimNLeft = trim.left / sourceWidth;\n const trimNRight = trim.right / sourceWidth;\n const trimNTop = trim.top / sourceHeight;\n const trimNBottom = trim.bottom / sourceHeight;\n\n const trimmedWidthNorm = trimmedWidth / sourceWidth;\n const trimmedHeightNorm = trimmedHeight / sourceHeight;\n\n const srcLeft = this.sliceBorders.left;\n const srcRight = this.sliceBorders.right;\n const srcTop = this.sliceBorders.top;\n const srcBottom = this.sliceBorders.bottom;\n\n const left = Math.max(0, srcLeft - trimNLeft) / trimmedWidthNorm;\n const right = Math.max(0, srcRight - trimNRight) / trimmedWidthNorm;\n const top = Math.max(0, srcTop - trimNTop) / trimmedHeightNorm;\n const bottom = Math.max(0, srcBottom - trimNBottom) / trimmedHeightNorm;\n\n return result.set(\n Math.min(1, left),\n Math.min(1, right),\n Math.min(1, top),\n Math.min(1, bottom),\n );\n }\n\n private calculateSliceRegionsForShader(result: Vector4): Vector4 {\n if (this.regionModeInternal === UINineSliceRegionMode.NORMALIZED) {\n return result.set(\n this.sliceRegions.left,\n this.sliceRegions.right,\n this.sliceRegions.top,\n this.sliceRegions.bottom,\n );\n }\n\n const width = this.width;\n const height = this.height;\n\n return result.set(\n this.sliceRegions.left / width,\n this.sliceRegions.right / width,\n this.sliceRegions.top / height,\n this.sliceRegions.bottom / height,\n );\n }\n\n private checkDimensionsDirty(): boolean {\n return (\n this.solverWrapper.dirty &&\n (this.lastWidth !== Math.round(this.width) ||\n this.lastHeight !== Math.round(this.height))\n );\n }\n\n private setDimensionsDirtyFalse(): void {\n this.lastWidth = Math.round(this.width);\n this.lastHeight = Math.round(this.height);\n }\n}\n","import type { UIPropertyType } from \"../generic-plane/shared\";\n\n/** Base class for progress bar fill functions */\nexport abstract class UIProgressMaskFunction {\n protected dirtyInternal = false;\n\n protected constructor(\n /** GLSL shader source code defining fill behavior */\n public readonly source: string,\n ) {}\n\n /** @internal */\n public get dirty(): boolean {\n return this.dirtyInternal;\n }\n\n /** @internal */\n public setDirtyFalse(): void {\n this.dirtyInternal = false;\n }\n\n /** @internal */\n public abstract enumerateProperties(): Record<string, UIPropertyType>;\n}\n","import type { Vector2Like } from \"three\";\nimport { Vector2 } from \"three\";\nimport source from \"../../shaders/UIProgressMaskFunctionDirectional.glsl\";\nimport { EPSILON } from \"../asserts\";\nimport type { UIPropertyType } from \"../generic-plane/shared\";\nimport { UIProgressMaskFunction } from \"./UIProgressMaskFunction\";\n\n/** Linear directional progress fill */\nexport class UIProgressMaskFunctionDirectional extends UIProgressMaskFunction {\n /** Fill direction as normalized vector */\n public readonly direction = new Vector2();\n private readonly cachedDirection = new Vector2();\n\n /**\n * Creates directional mask function.\n *\n * @param direction - Fill direction vector. Automatically normalized.\n */\n constructor(direction: Vector2Like = { x: 1, y: 0 }) {\n super(source);\n this.direction.copy(direction).normalize();\n this.cachedDirection.copy(this.direction);\n }\n\n /** @internal */\n public override get dirty(): boolean {\n this.ensureDirectionNormalized();\n return this.dirtyInternal || !this.cachedDirection.equals(this.direction);\n }\n\n /** @internal */\n public override setDirtyFalse(): void {\n this.ensureDirectionNormalized();\n this.cachedDirection.copy(this.direction);\n super.setDirtyFalse();\n }\n\n /** @internal */\n public enumerateProperties(): Record<string, UIPropertyType> {\n this.ensureDirectionNormalized();\n return { direction: this.direction };\n }\n\n private ensureDirectionNormalized(): void {\n const squaredLength = this.direction.lengthSq();\n if (Math.abs(squaredLength) <= EPSILON) {\n this.direction.set(1, 0);\n } else if (Math.abs(squaredLength - 1) > EPSILON) {\n this.direction.divideScalar(squaredLength);\n }\n }\n}\n","import type { UIColorConfig } from \"../miscellaneous/color/UIColor.Internal\";\nimport type { UIProgressMaskFunction } from \"../miscellaneous/mask-function/UIProgressMaskFunction\";\nimport type { UIElementOptions } from \"./UIElement.Internal\";\n\n/** Configuration options for UIProgress */\nexport interface UIProgressOptions extends UIElementOptions {\n /** Multiplicative tint */\n color: UIColorConfig;\n /** Function controlling fill direction and shape */\n maskFunction: UIProgressMaskFunction;\n /** Progress from 0 (empty) to 1 (full) */\n progress: number;\n}\n\nexport const PROGRESS_DEFAULT_VALUE = 1;\n\nexport function simplifyGLSLSource(source: string): string {\n return source\n .replace(/\\/\\*[\\s\\S]*?\\*\\//g, \"\")\n .replace(/\\/\\/[^\\n]*/g, \"\")\n .replace(/\\s*([{}(),=;+\\-*/<>])\\s*/g, \"$1\")\n .replace(/\\s+/g, \" \")\n .trim();\n}\n","import type { Matrix3, Texture, Vector2 } from \"three\";\nimport type { UILayer } from \"../layers/UILayer\";\nimport { UIColor } from \"../miscellaneous/color/UIColor\";\nimport { computeTrimmedTransformMatrix } from \"../miscellaneous/computeTransform\";\nimport type { UIProgressMaskFunction } from \"../miscellaneous/mask-function/UIProgressMaskFunction\";\nimport { UIProgressMaskFunctionDirectional } from \"../miscellaneous/mask-function/UIProgressMaskFunctionDirectional\";\nimport { UITextureView } from \"../miscellaneous/texture/UITextureView\";\nimport { UITextureViewEvent } from \"../miscellaneous/texture/UITextureView.Internal\";\nimport source from \"../shaders/UIProgress.glsl\";\nimport { UIElement } from \"./UIElement\";\nimport type { UIProgressOptions } from \"./UIProgress.Internal\";\nimport {\n PROGRESS_DEFAULT_VALUE,\n simplifyGLSLSource,\n} from \"./UIProgress.Internal\";\n\n/** Progress bar with customizable fill direction */\nexport class UIProgress extends UIElement {\n /** Texture displayed by this element */\n public readonly texture: UITextureView;\n /** Multiplicative tint. Alpha channel controls opacity. */\n public readonly color: UIColor;\n /** Function controlling fill direction and shape */\n public readonly maskFunction: UIProgressMaskFunction;\n\n private readonly textureTransform: Matrix3;\n private readonly textureResolution: Vector2;\n\n private progressInternal: number;\n private dirty = false;\n\n /**\n * Creates a new UIProgress instance.\n *\n * Defaults size to texture dimensions if width and height not provided.\n *\n * @param layer - Layer containing this element\n * @param texture - Texture to display\n * @param options - Configuration options\n */\n constructor(\n layer: UILayer,\n texture: Texture,\n options: Partial<UIProgressOptions> = {},\n ) {\n const color = new UIColor(options.color);\n const textureView = new UITextureView(texture);\n const textureTransform = textureView.calculateUVTransform();\n const textureResolution = textureView.getResolution();\n\n options.width = options.width ?? textureView.width;\n options.height = options.height ?? textureView.height;\n\n const progress = options.progress ?? PROGRESS_DEFAULT_VALUE;\n\n const maskFunction =\n options.maskFunction ?? new UIProgressMaskFunctionDirectional();\n const simplifiedSource = simplifyGLSLSource(maskFunction.source + source);\n\n super(\n layer,\n simplifiedSource,\n {\n texture: textureView.texture,\n textureTransform,\n textureResolution,\n color,\n progress,\n ...maskFunction.enumerateProperties(),\n },\n options,\n );\n\n this.texture = textureView;\n this.textureTransform = textureTransform;\n this.textureResolution = textureResolution;\n this.color = color;\n this.progressInternal = progress;\n this.maskFunction = maskFunction;\n\n this.texture.on(\n UITextureViewEvent.DIMENSIONS_CHANGED,\n this.onTextureDimensionsChanged,\n );\n }\n\n /** Progress from 0 (empty) to 1 (full) */\n public get progress(): number {\n return this.progressInternal;\n }\n\n /** Progress from 0 (empty) to 1 (full). Clamped by shader. */\n public set progress(value: number) {\n if (this.progressInternal !== value) {\n this.progressInternal = value;\n this.dirty = true;\n }\n }\n\n protected override updatePlaneTransform(): void {\n if (\n this.dirty ||\n this.texture.dirty ||\n this.color.dirty ||\n this.maskFunction.dirty\n ) {\n this.sceneWrapper.setProperties(this.planeHandler, {\n texture: this.texture.texture,\n textureTransform: this.texture.calculateUVTransform(\n this.textureTransform,\n ),\n textureResolution: this.texture.getResolution(this.textureResolution),\n color: this.color,\n progress: this.progressInternal,\n });\n\n this.dirty = false;\n this.color.setDirtyFalse();\n this.maskFunction.setDirtyFalse();\n }\n\n if (\n this.solverWrapper.dirty ||\n this.inputWrapper.dirty ||\n this.texture.dirty ||\n this.micro.dirty\n ) {\n this.sceneWrapper.setTransform(\n this.planeHandler,\n computeTrimmedTransformMatrix(\n this.x,\n this.y,\n this.width,\n this.height,\n this.zIndex,\n this.micro.x,\n this.micro.y,\n this.micro.anchorX,\n this.micro.anchorY,\n this.micro.scaleX,\n this.micro.scaleY,\n this.micro.rotation,\n this.micro.anchorMode,\n this.texture.trim.left,\n this.texture.trim.right,\n this.texture.trim.top,\n this.texture.trim.bottom,\n ),\n );\n\n this.texture.setDirtyFalse();\n this.micro.setDirtyFalse();\n }\n }\n\n private readonly onTextureDimensionsChanged = (\n width: number,\n height: number,\n ): void => {\n this.width = width;\n this.height = height;\n };\n}\n","import type { Camera, Scene } from \"three\";\nimport { UIColor } from \"../miscellaneous/color/UIColor\";\nimport type { UIColorConfig } from \"../miscellaneous/color/UIColor.Internal\";\nimport type { UIElementOptions } from \"./UIElement.Internal\";\n\n/** Controls when scene re-renders */\nexport enum UISceneUpdateMode {\n /** Re-render every frame */\n EACH_FRAME = 1,\n /** Re-render every other frame */\n EVERY_SECOND_FRAME = 2,\n /** Re-render when scene, camera, or updateMode changes */\n ON_PROPERTIES_CHANGE = 3,\n /** Re-render when dimensions or resolutionFactor changes */\n ON_DIMENSIONS_CHANGE = 4,\n /** Re-render only via requestUpdate() */\n MANUAL = 5,\n}\n\n/** Configuration options for UIScene */\nexport interface UISceneOptions extends UIElementOptions {\n /** Multiplicative tint */\n color: UIColorConfig;\n /** Three.js scene to render */\n scene: Scene;\n /** Camera used for rendering */\n camera: Camera;\n /** When to re-render */\n updateMode: UISceneUpdateMode;\n /** Render target resolution multiplier. Range 0.1 to 2.0. */\n resolutionFactor: number;\n /** Background color */\n clearColor: UIColorConfig;\n /** Whether to use depth buffer */\n enableDepthBuffer: boolean;\n}\n\nexport const SCENE_DEFAULT_RESOLUTION_FACTOR = 0.5;\nexport const SCENE_MIN_RESOLUTION_FACTOR = 0.1;\nexport const SCENE_MAX_RESOLUTION_FACTOR = 2;\nexport const SCENE_DEFAULT_CAMERA_FOV = 60;\nexport const SCENE_DEFAULT_CAMERA_NEAR = 0.1;\nexport const SCENE_DEFAULT_CAMERA_FAR = 100;\nexport const SCENE_DEFAULT_UPDATE_MODE = UISceneUpdateMode.ON_PROPERTIES_CHANGE;\nexport const SCENE_DEFAULT_CLEAR_COLOR = new UIColor(0, 0, 0, 1);\nexport const SCENE_DEFAULT_USE_DEPTH = true;\n","import type { Camera, WebGLRenderer } from \"three\";\nimport {\n LinearFilter,\n Matrix3,\n PerspectiveCamera,\n RGBAFormat,\n Scene,\n UnsignedByteType,\n WebGLRenderTarget,\n} from \"three\";\nimport type { UILayer } from \"../layers/UILayer\";\nimport { UIColor } from \"../miscellaneous/color/UIColor\";\nimport source from \"../shaders/UIImage.glsl\";\nimport { DUMMY_DEFAULT_HEIGHT, DUMMY_DEFAULT_WIDTH } from \"./UIDummy.Internal\";\nimport { UIElement } from \"./UIElement\";\nimport type { UISceneOptions } from \"./UIScene.Internal\";\nimport {\n SCENE_DEFAULT_CAMERA_FAR,\n SCENE_DEFAULT_CAMERA_FOV,\n SCENE_DEFAULT_CAMERA_NEAR,\n SCENE_DEFAULT_CLEAR_COLOR,\n SCENE_DEFAULT_RESOLUTION_FACTOR,\n SCENE_DEFAULT_UPDATE_MODE,\n SCENE_DEFAULT_USE_DEPTH,\n SCENE_MAX_RESOLUTION_FACTOR,\n SCENE_MIN_RESOLUTION_FACTOR,\n UISceneUpdateMode,\n} from \"./UIScene.Internal\";\n\n/** Renders Three.js scene to texture */\nexport class UIScene extends UIElement {\n /** Multiplicative tint. Alpha channel controls opacity. */\n public readonly color: UIColor;\n /** Background color for render target */\n public readonly clearColor: UIColor;\n\n private readonly renderTarget: WebGLRenderTarget;\n private sceneInternal: Scene;\n private cameraInternal: Camera;\n private updateModeInternal: UISceneUpdateMode;\n private resolutionFactorInternal: number;\n private evenFrame = true;\n\n private updateRequired = false;\n private resolutionFactorDirty = false;\n private propertyDirty = false;\n\n /**\n * Creates a new UIScene instance.\n *\n * @param layer - Layer containing this element\n * @param options - Configuration options\n * @throws If resolutionFactor outside range 0.1 to 2.0\n */\n constructor(layer: UILayer, options: Partial<UISceneOptions> = {}) {\n const resolutionFactor =\n options.resolutionFactor ?? SCENE_DEFAULT_RESOLUTION_FACTOR;\n\n if (\n resolutionFactor < SCENE_MIN_RESOLUTION_FACTOR ||\n resolutionFactor > SCENE_MAX_RESOLUTION_FACTOR\n ) {\n throw new Error(\n `UIScene.constructor.resolutionFactor: must be between ${SCENE_MIN_RESOLUTION_FACTOR} and ${SCENE_MAX_RESOLUTION_FACTOR}.`,\n );\n }\n\n const w = options.width ?? DUMMY_DEFAULT_WIDTH;\n const h = options.height ?? DUMMY_DEFAULT_HEIGHT;\n\n const renderTarget = new WebGLRenderTarget(\n w * resolutionFactor,\n h * resolutionFactor,\n {\n format: RGBAFormat,\n minFilter: LinearFilter,\n magFilter: LinearFilter,\n type: UnsignedByteType,\n depthBuffer: options.enableDepthBuffer ?? SCENE_DEFAULT_USE_DEPTH,\n stencilBuffer: false,\n },\n );\n\n const color = new UIColor(options.color);\n\n super(\n layer,\n source,\n {\n texture: renderTarget.texture,\n textureTransform: new Matrix3(),\n color,\n },\n options,\n );\n\n this.color = color;\n this.clearColor = new UIColor(\n options.clearColor ?? SCENE_DEFAULT_CLEAR_COLOR,\n );\n\n this.renderTarget = renderTarget;\n this.sceneInternal = options.scene ?? new Scene();\n\n this.cameraInternal =\n options.camera ??\n new PerspectiveCamera(\n SCENE_DEFAULT_CAMERA_FOV,\n w / h,\n SCENE_DEFAULT_CAMERA_NEAR,\n SCENE_DEFAULT_CAMERA_FAR,\n );\n\n this.resolutionFactorInternal = resolutionFactor;\n this.updateModeInternal = options.updateMode ?? SCENE_DEFAULT_UPDATE_MODE;\n this.propertyDirty = options.updateMode !== UISceneUpdateMode.MANUAL;\n }\n\n /** Three.js scene to render */\n public get scene(): Scene {\n return this.sceneInternal;\n }\n\n /** Camera used for rendering */\n public get camera(): Camera {\n return this.cameraInternal;\n }\n\n /** Controls when scene re-renders */\n public get updateMode(): UISceneUpdateMode {\n return this.updateModeInternal;\n }\n\n /** Render target resolution multiplier. Range 0.1 to 2.0. */\n public get resolutionFactor(): number {\n return this.resolutionFactorInternal;\n }\n\n /** Three.js scene to render */\n public set scene(value: Scene) {\n if (this.sceneInternal !== value) {\n this.sceneInternal = value;\n this.propertyDirty = true;\n }\n }\n\n /** Camera used for rendering */\n public set camera(value: Camera) {\n if (this.cameraInternal !== value) {\n this.cameraInternal = value;\n this.propertyDirty = true;\n }\n }\n\n /** Controls when scene re-renders */\n public set updateMode(value: UISceneUpdateMode) {\n if (this.updateModeInternal !== value) {\n this.updateModeInternal = value;\n this.propertyDirty = true;\n }\n }\n\n /** Render target resolution multiplier. Range 0.1 to 2.0. */\n public set resolutionFactor(value: number) {\n if (this.resolutionFactorInternal !== value) {\n this.resolutionFactorInternal = value;\n this.resolutionFactorDirty = true;\n }\n }\n\n /** Removes element and frees resources */\n public override destroy(): void {\n this.renderTarget.dispose();\n super.destroy();\n }\n\n /** Triggers re-render on next frame. Useful in MANUAL mode. */\n public requestUpdate(): void {\n this.updateRequired = true;\n }\n\n protected override onWillRender(\n renderer: WebGLRenderer,\n deltaTime: number,\n ): void {\n this.evenFrame = !this.evenFrame;\n\n if (\n this.updateRequired ||\n this.updateModeInternal === UISceneUpdateMode.EACH_FRAME ||\n (this.updateModeInternal === UISceneUpdateMode.EVERY_SECOND_FRAME &&\n this.evenFrame) ||\n (this.updateModeInternal === UISceneUpdateMode.ON_PROPERTIES_CHANGE &&\n this.propertyDirty) ||\n this.color.dirty ||\n this.clearColor.dirty ||\n (this.updateModeInternal === UISceneUpdateMode.ON_DIMENSIONS_CHANGE &&\n (this.resolutionFactorDirty || this.solverWrapper.dirty))\n ) {\n if (this.resolutionFactorDirty || this.solverWrapper.dirty) {\n this.renderTarget.setSize(\n this.width * this.resolutionFactorInternal,\n this.height * this.resolutionFactorInternal,\n );\n this.resolutionFactorDirty = false;\n }\n\n if (this.color.dirty) {\n this.sceneWrapper.setProperties(this.planeHandler, {\n color: this.color,\n });\n this.color.setDirtyFalse();\n }\n\n renderer.setClearColor(this.clearColor.getHexRGB(), this.clearColor.a);\n renderer.setRenderTarget(this.renderTarget);\n renderer.clear(true, true, false);\n renderer.render(this.sceneInternal, this.cameraInternal);\n\n this.propertyDirty = false;\n this.updateRequired = false;\n }\n super.onWillRender(renderer, deltaTime);\n }\n}\n","/** Complete text style configuration with all properties resolved */\nexport interface UITextStyleConfig {\n /** Text color */\n color: string;\n /** Text alignment */\n align: \"left\" | \"center\" | \"right\";\n\n /** Font family name */\n fontFamily: string;\n /** Font size in pixels */\n fontSize: number;\n /** Font style */\n fontStyle: \"normal\" | \"italic\" | \"oblique\";\n /** Font weight */\n fontWeight: \"normal\" | \"bold\" | \"bolder\" | \"lighter\" | number;\n /** Line height in pixels */\n lineHeight: number;\n\n /** Whether shadow is enabled */\n enableShadow: boolean;\n /** Shadow horizontal offset in pixels */\n shadowOffsetX: number;\n /** Shadow vertical offset in pixels */\n shadowOffsetY: number;\n /** Shadow blur radius in pixels */\n shadowBlur: number;\n /** Shadow color */\n shadowColor: string;\n\n /** Whether stroke is enabled */\n enableStroke: boolean;\n /** Stroke color */\n strokeColor: string;\n /** Stroke thickness in pixels */\n strokeThickness: number;\n}\n\nexport const TEXT_STYLE_DEFAULT_COLOR = \"#000000\";\nexport const TEXT_STYLE_DEFAULT_ALIGN = \"left\" as const;\nexport const TEXT_STYLE_DEFAULT_FONT_FAMILY = \"Arial\";\nexport const TEXT_STYLE_DEFAULT_FONT_SIZE = 16;\nexport const TEXT_STYLE_DEFAULT_FONT_STYLE = \"normal\" as const;\nexport const TEXT_STYLE_DEFAULT_FONT_WEIGHT = \"normal\" as const;\nexport const TEXT_STYLE_DEFAULT_LINE_HEIGHT = 1.2;\nexport const TEXT_STYLE_DEFAULT_ENABLE_SHADOW = false;\nexport const TEXT_STYLE_DEFAULT_SHADOW_OFFSET_X = 0;\nexport const TEXT_STYLE_DEFAULT_SHADOW_OFFSET_Y = 0;\nexport const TEXT_STYLE_DEFAULT_SHADOW_BLUR = 0;\nexport const TEXT_STYLE_DEFAULT_SHADOW_COLOR = \"transparent\";\nexport const TEXT_STYLE_DEFAULT_ENABLE_STROKE = false;\nexport const TEXT_STYLE_DEFAULT_STROKE_COLOR = \"#000000\";\nexport const TEXT_STYLE_DEFAULT_STROKE_THICKNESS = 0;\n","import {\n assertValidNonNegativeNumber,\n assertValidNumber,\n assertValidPositiveNumber,\n} from \"../asserts\";\nimport type { UITextStyleConfig } from \"./UITextStyle.Internal\";\nimport {\n TEXT_STYLE_DEFAULT_ALIGN,\n TEXT_STYLE_DEFAULT_COLOR,\n TEXT_STYLE_DEFAULT_ENABLE_SHADOW,\n TEXT_STYLE_DEFAULT_ENABLE_STROKE,\n TEXT_STYLE_DEFAULT_FONT_FAMILY,\n TEXT_STYLE_DEFAULT_FONT_SIZE,\n TEXT_STYLE_DEFAULT_FONT_STYLE,\n TEXT_STYLE_DEFAULT_FONT_WEIGHT,\n TEXT_STYLE_DEFAULT_LINE_HEIGHT,\n TEXT_STYLE_DEFAULT_SHADOW_BLUR,\n TEXT_STYLE_DEFAULT_SHADOW_COLOR,\n TEXT_STYLE_DEFAULT_SHADOW_OFFSET_X,\n TEXT_STYLE_DEFAULT_SHADOW_OFFSET_Y,\n TEXT_STYLE_DEFAULT_STROKE_COLOR,\n TEXT_STYLE_DEFAULT_STROKE_THICKNESS,\n} from \"./UITextStyle.Internal\";\n\n/** Text style configuration for UI text rendering */\nexport class UITextStyle {\n private colorInternal?: string;\n private alignInternal?: \"left\" | \"center\" | \"right\";\n private fontFamilyInternal?: string;\n private fontSizeInternal?: number;\n private fontStyleInternal?: \"normal\" | \"italic\" | \"oblique\";\n private fontWeightInternal?:\n | \"normal\"\n | \"bold\"\n | \"bolder\"\n | \"lighter\"\n | number;\n private lineHeightInternal?: number;\n private enableShadowInternal?: boolean;\n private shadowOffsetXInternal?: number;\n private shadowOffsetYInternal?: number;\n private shadowBlurInternal?: number;\n private shadowColorInternal?: string;\n private enableStrokeInternal?: boolean;\n private strokeColorInternal?: string;\n private strokeThicknessInternal?: number;\n\n private dirtyInternal = true;\n\n /** @param config Partial style configuration. Unspecified properties remain undefined. */\n constructor(config?: Partial<UITextStyleConfig>) {\n this.colorInternal = config?.color;\n this.alignInternal = config?.align;\n this.fontFamilyInternal = config?.fontFamily;\n this.fontSizeInternal = config?.fontSize;\n this.fontStyleInternal = config?.fontStyle;\n this.fontWeightInternal = config?.fontWeight;\n this.lineHeightInternal = config?.lineHeight;\n this.enableShadowInternal = config?.enableShadow;\n this.shadowOffsetXInternal = config?.shadowOffsetX;\n this.shadowOffsetYInternal = config?.shadowOffsetY;\n this.shadowBlurInternal = config?.shadowBlur;\n this.shadowColorInternal = config?.shadowColor;\n this.enableStrokeInternal = config?.enableStroke;\n this.strokeColorInternal = config?.strokeColor;\n this.strokeThicknessInternal = config?.strokeThickness;\n }\n\n /** Text color */\n public get color(): string | undefined {\n return this.colorInternal;\n }\n\n /** Text alignment */\n public get align(): \"left\" | \"center\" | \"right\" | undefined {\n return this.alignInternal;\n }\n\n /** Font family name */\n public get fontFamily(): string | undefined {\n return this.fontFamilyInternal;\n }\n\n /** Font size in pixels */\n public get fontSize(): number | undefined {\n return this.fontSizeInternal;\n }\n\n /** Font style */\n public get fontStyle(): \"normal\" | \"italic\" | \"oblique\" | undefined {\n return this.fontStyleInternal;\n }\n\n /** Font weight */\n public get fontWeight():\n | \"normal\"\n | \"bold\"\n | \"bolder\"\n | \"lighter\"\n | number\n | undefined {\n return this.fontWeightInternal;\n }\n\n /** Line height in pixels */\n public get lineHeight(): number | undefined {\n return this.lineHeightInternal;\n }\n\n /** Whether shadow is enabled */\n public get enableShadow(): boolean | undefined {\n return this.enableShadowInternal;\n }\n\n /** Shadow horizontal offset in pixels */\n public get shadowOffsetX(): number | undefined {\n return this.shadowOffsetXInternal;\n }\n\n /** Shadow vertical offset in pixels */\n public get shadowOffsetY(): number | undefined {\n return this.shadowOffsetYInternal;\n }\n\n /** Shadow blur radius in pixels */\n public get shadowBlur(): number | undefined {\n return this.shadowBlurInternal;\n }\n\n /** Shadow color */\n public get shadowColor(): string | undefined {\n return this.shadowColorInternal;\n }\n\n /** Whether stroke is enabled */\n public get enableStroke(): boolean | undefined {\n return this.enableStrokeInternal;\n }\n\n /** Stroke color */\n public get strokeColor(): string | undefined {\n return this.strokeColorInternal;\n }\n\n /** Stroke thickness in pixels */\n public get strokeThickness(): number | undefined {\n return this.strokeThicknessInternal;\n }\n\n /**\n * Indicates whether any property has been modified.\n * Must be reset to `false` externally by the owner.\n * @internal\n */\n public get dirty(): boolean {\n return this.dirtyInternal;\n }\n\n public set color(value: string | undefined) {\n if (value !== this.colorInternal) {\n this.colorInternal = value;\n this.dirtyInternal = true;\n }\n }\n\n public set align(value: \"left\" | \"center\" | \"right\" | undefined) {\n if (value !== this.alignInternal) {\n this.alignInternal = value;\n this.dirtyInternal = true;\n }\n }\n\n public set fontFamily(value: string | undefined) {\n if (value !== this.fontFamilyInternal) {\n this.fontFamilyInternal = value;\n this.dirtyInternal = true;\n }\n }\n\n public set fontSize(value: number | undefined) {\n if (value !== undefined) {\n assertValidPositiveNumber(value, \"UITextStyle.fontSize\");\n }\n if (value !== this.fontSizeInternal) {\n this.fontSizeInternal = value;\n this.dirtyInternal = true;\n }\n }\n\n public set fontStyle(value: \"normal\" | \"italic\" | \"oblique\" | undefined) {\n if (value !== this.fontStyleInternal) {\n this.fontStyleInternal = value;\n this.dirtyInternal = true;\n }\n }\n\n public set fontWeight(\n value: \"normal\" | \"bold\" | \"bolder\" | \"lighter\" | number | undefined,\n ) {\n if (typeof value === \"number\") {\n assertValidPositiveNumber(value, \"UITextStyle.fontWeight\");\n }\n if (value !== this.fontWeightInternal) {\n this.fontWeightInternal = value;\n this.dirtyInternal = true;\n }\n }\n\n public set lineHeight(value: number | undefined) {\n if (value !== undefined) {\n assertValidNumber(value, \"UITextStyle.lineHeight\");\n }\n if (value !== this.lineHeightInternal) {\n this.lineHeightInternal = value;\n this.dirtyInternal = true;\n }\n }\n\n public set enableShadow(value: boolean | undefined) {\n if (value !== this.enableShadowInternal) {\n this.enableShadowInternal = value;\n this.dirtyInternal = true;\n }\n }\n\n public set shadowOffsetX(value: number | undefined) {\n if (value !== undefined) {\n assertValidNonNegativeNumber(value, \"UITextStyle.shadowOffsetX\");\n }\n if (value !== this.shadowOffsetXInternal) {\n this.shadowOffsetXInternal = value;\n this.dirtyInternal = true;\n }\n }\n\n public set shadowOffsetY(value: number | undefined) {\n if (value !== undefined) {\n assertValidNonNegativeNumber(value, \"UITextStyle.shadowOffsetY\");\n }\n if (value !== this.shadowOffsetYInternal) {\n this.shadowOffsetYInternal = value;\n this.dirtyInternal = true;\n }\n }\n\n public set shadowBlur(value: number | undefined) {\n if (value !== undefined) {\n assertValidNonNegativeNumber(value, \"UITextStyle.shadowBlur\");\n }\n if (value !== this.shadowBlurInternal) {\n this.shadowBlurInternal = value;\n this.dirtyInternal = true;\n }\n }\n\n public set shadowColor(value: string | undefined) {\n if (value !== this.shadowColorInternal) {\n this.shadowColorInternal = value;\n this.dirtyInternal = true;\n }\n }\n\n public set enableStroke(value: boolean | undefined) {\n if (value !== this.enableStrokeInternal) {\n this.enableStrokeInternal = value;\n this.dirtyInternal = true;\n }\n }\n\n public set strokeColor(value: string | undefined) {\n if (value !== this.strokeColorInternal) {\n this.strokeColorInternal = value;\n this.dirtyInternal = true;\n }\n }\n\n public set strokeThickness(value: number | undefined) {\n if (value !== undefined) {\n assertValidNonNegativeNumber(value, \"UITextStyle.strokeThickness\");\n }\n if (value !== this.strokeThicknessInternal) {\n this.strokeThicknessInternal = value;\n this.dirtyInternal = true;\n }\n }\n\n /**\n * Resolves complete style from primary and fallback sources.\n * @param primary First style to check for each property\n * @param fallback Second style to check if primary is undefined\n * @returns Complete style configuration with all defaults applied\n */\n public static resolve(\n primary?: UITextStyle,\n fallback?: UITextStyle,\n ): UITextStyleConfig {\n const fontSize =\n primary?.fontSizeInternal ??\n fallback?.fontSizeInternal ??\n TEXT_STYLE_DEFAULT_FONT_SIZE;\n\n return {\n color:\n primary?.colorInternal ??\n fallback?.colorInternal ??\n TEXT_STYLE_DEFAULT_COLOR,\n align:\n primary?.alignInternal ??\n fallback?.alignInternal ??\n TEXT_STYLE_DEFAULT_ALIGN,\n fontFamily:\n primary?.fontFamilyInternal ??\n fallback?.fontFamilyInternal ??\n TEXT_STYLE_DEFAULT_FONT_FAMILY,\n fontSize,\n fontStyle:\n primary?.fontStyleInternal ??\n fallback?.fontStyleInternal ??\n TEXT_STYLE_DEFAULT_FONT_STYLE,\n fontWeight:\n primary?.fontWeightInternal ??\n fallback?.fontWeightInternal ??\n TEXT_STYLE_DEFAULT_FONT_WEIGHT,\n lineHeight:\n primary?.lineHeightInternal ??\n fallback?.lineHeightInternal ??\n fontSize * TEXT_STYLE_DEFAULT_LINE_HEIGHT,\n enableShadow:\n primary?.enableShadowInternal ??\n fallback?.enableShadowInternal ??\n TEXT_STYLE_DEFAULT_ENABLE_SHADOW,\n shadowOffsetX:\n primary?.shadowOffsetXInternal ??\n fallback?.shadowOffsetXInternal ??\n TEXT_STYLE_DEFAULT_SHADOW_OFFSET_X,\n shadowOffsetY:\n primary?.shadowOffsetYInternal ??\n fallback?.shadowOffsetYInternal ??\n TEXT_STYLE_DEFAULT_SHADOW_OFFSET_Y,\n shadowBlur:\n primary?.shadowBlurInternal ??\n fallback?.shadowBlurInternal ??\n TEXT_STYLE_DEFAULT_SHADOW_BLUR,\n shadowColor:\n primary?.shadowColorInternal ??\n fallback?.shadowColorInternal ??\n TEXT_STYLE_DEFAULT_SHADOW_COLOR,\n enableStroke:\n primary?.enableStrokeInternal ??\n fallback?.enableStrokeInternal ??\n TEXT_STYLE_DEFAULT_ENABLE_STROKE,\n strokeColor:\n primary?.strokeColorInternal ??\n fallback?.strokeColorInternal ??\n TEXT_STYLE_DEFAULT_STROKE_COLOR,\n strokeThickness:\n primary?.strokeThicknessInternal ??\n fallback?.strokeThicknessInternal ??\n TEXT_STYLE_DEFAULT_STROKE_THICKNESS,\n };\n }\n\n /** @internal */\n public setDirtyFalse(): void {\n this.dirtyInternal = false;\n }\n\n /** Sets all properties to default values */\n public setDefaults(): void {\n if (\n this.colorInternal !== TEXT_STYLE_DEFAULT_COLOR ||\n this.alignInternal !== TEXT_STYLE_DEFAULT_ALIGN ||\n this.fontFamilyInternal !== TEXT_STYLE_DEFAULT_FONT_FAMILY ||\n this.fontSizeInternal !== TEXT_STYLE_DEFAULT_FONT_SIZE ||\n this.fontStyleInternal !== TEXT_STYLE_DEFAULT_FONT_STYLE ||\n this.fontWeightInternal !== TEXT_STYLE_DEFAULT_FONT_WEIGHT ||\n this.lineHeightInternal !==\n TEXT_STYLE_DEFAULT_FONT_SIZE * TEXT_STYLE_DEFAULT_LINE_HEIGHT ||\n this.enableShadowInternal !== TEXT_STYLE_DEFAULT_ENABLE_SHADOW ||\n this.shadowOffsetXInternal !== TEXT_STYLE_DEFAULT_SHADOW_OFFSET_X ||\n this.shadowOffsetYInternal !== TEXT_STYLE_DEFAULT_SHADOW_OFFSET_Y ||\n this.shadowBlurInternal !== TEXT_STYLE_DEFAULT_SHADOW_BLUR ||\n this.shadowColorInternal !== TEXT_STYLE_DEFAULT_SHADOW_COLOR ||\n this.enableStrokeInternal !== TEXT_STYLE_DEFAULT_ENABLE_STROKE ||\n this.strokeColorInternal !== TEXT_STYLE_DEFAULT_STROKE_COLOR ||\n this.strokeThicknessInternal !== TEXT_STYLE_DEFAULT_STROKE_THICKNESS\n ) {\n this.colorInternal = TEXT_STYLE_DEFAULT_COLOR;\n this.alignInternal = TEXT_STYLE_DEFAULT_ALIGN;\n this.fontFamilyInternal = TEXT_STYLE_DEFAULT_FONT_FAMILY;\n this.fontSizeInternal = TEXT_STYLE_DEFAULT_FONT_SIZE;\n this.fontStyleInternal = TEXT_STYLE_DEFAULT_FONT_STYLE;\n this.fontWeightInternal = TEXT_STYLE_DEFAULT_FONT_WEIGHT;\n this.lineHeightInternal =\n TEXT_STYLE_DEFAULT_FONT_SIZE * TEXT_STYLE_DEFAULT_LINE_HEIGHT;\n this.enableShadowInternal = TEXT_STYLE_DEFAULT_ENABLE_SHADOW;\n this.shadowOffsetXInternal = TEXT_STYLE_DEFAULT_SHADOW_OFFSET_X;\n this.shadowOffsetYInternal = TEXT_STYLE_DEFAULT_SHADOW_OFFSET_Y;\n this.shadowBlurInternal = TEXT_STYLE_DEFAULT_SHADOW_BLUR;\n this.shadowColorInternal = TEXT_STYLE_DEFAULT_SHADOW_COLOR;\n this.enableStrokeInternal = TEXT_STYLE_DEFAULT_ENABLE_STROKE;\n this.strokeColorInternal = TEXT_STYLE_DEFAULT_STROKE_COLOR;\n this.strokeThicknessInternal = TEXT_STYLE_DEFAULT_STROKE_THICKNESS;\n this.dirtyInternal = true;\n }\n }\n\n /** Sets all properties to undefined */\n public clear(): void {\n if (\n this.colorInternal !== undefined ||\n this.alignInternal !== undefined ||\n this.fontFamilyInternal !== undefined ||\n this.fontSizeInternal !== undefined ||\n this.fontStyleInternal !== undefined ||\n this.fontWeightInternal !== undefined ||\n this.lineHeightInternal !== undefined ||\n this.enableShadowInternal !== undefined ||\n this.shadowOffsetXInternal !== undefined ||\n this.shadowOffsetYInternal !== undefined ||\n this.shadowBlurInternal !== undefined ||\n this.shadowColorInternal !== undefined ||\n this.enableStrokeInternal !== undefined ||\n this.strokeColorInternal !== undefined ||\n this.strokeThicknessInternal !== undefined\n ) {\n this.colorInternal = undefined;\n this.alignInternal = undefined;\n this.fontFamilyInternal = undefined;\n this.fontSizeInternal = undefined;\n this.fontStyleInternal = undefined;\n this.fontWeightInternal = undefined;\n this.lineHeightInternal = undefined;\n this.enableShadowInternal = undefined;\n this.shadowOffsetXInternal = undefined;\n this.shadowOffsetYInternal = undefined;\n this.shadowBlurInternal = undefined;\n this.shadowColorInternal = undefined;\n this.enableStrokeInternal = undefined;\n this.strokeColorInternal = undefined;\n this.strokeThicknessInternal = undefined;\n this.dirtyInternal = true;\n }\n }\n\n /** Copies from another style instance */\n public copy(value: UITextStyle): void {\n if (\n this.colorInternal !== value.colorInternal ||\n this.alignInternal !== value.alignInternal ||\n this.fontFamilyInternal !== value.fontFamilyInternal ||\n this.fontSizeInternal !== value.fontSizeInternal ||\n this.fontStyleInternal !== value.fontStyleInternal ||\n this.fontWeightInternal !== value.fontWeightInternal ||\n this.lineHeightInternal !== value.lineHeightInternal ||\n this.enableShadowInternal !== value.enableShadowInternal ||\n this.shadowOffsetXInternal !== value.shadowOffsetXInternal ||\n this.shadowOffsetYInternal !== value.shadowOffsetYInternal ||\n this.shadowBlurInternal !== value.shadowBlurInternal ||\n this.shadowColorInternal !== value.shadowColorInternal ||\n this.enableStrokeInternal !== value.enableStrokeInternal ||\n this.strokeColorInternal !== value.strokeColorInternal ||\n this.strokeThicknessInternal !== value.strokeThicknessInternal\n ) {\n this.colorInternal = value.colorInternal;\n this.alignInternal = value.alignInternal;\n this.fontFamilyInternal = value.fontFamilyInternal;\n this.fontSizeInternal = value.fontSizeInternal;\n this.fontStyleInternal = value.fontStyleInternal;\n this.fontWeightInternal = value.fontWeightInternal;\n this.lineHeightInternal = value.lineHeightInternal;\n this.enableShadowInternal = value.enableShadowInternal;\n this.shadowOffsetXInternal = value.shadowOffsetXInternal;\n this.shadowOffsetYInternal = value.shadowOffsetYInternal;\n this.shadowBlurInternal = value.shadowBlurInternal;\n this.shadowColorInternal = value.shadowColorInternal;\n this.enableStrokeInternal = value.enableStrokeInternal;\n this.strokeColorInternal = value.strokeColorInternal;\n this.strokeThicknessInternal = value.strokeThicknessInternal;\n this.dirtyInternal = true;\n }\n }\n\n /**\n * Calculates maximum padding required for stroke and shadow.\n * @returns Padding in pixels needed on all sides\n */\n public calculatePadding(): number {\n let padding = 0;\n\n if (this.enableStrokeInternal !== undefined) {\n padding += this.strokeThicknessInternal ?? 0;\n }\n\n if (this.enableShadowInternal !== undefined) {\n const blur = this.shadowBlurInternal ?? 0;\n const offsetX = this.shadowOffsetXInternal ?? 0;\n const offsetY = this.shadowOffsetYInternal ?? 0;\n const shadowSpread = blur * 2;\n const shadowMaxX = Math.abs(offsetX) + shadowSpread;\n const shadowMaxY = Math.abs(offsetY) + shadowSpread;\n padding += Math.max(shadowMaxX, shadowMaxY);\n }\n\n return Math.ceil(padding);\n }\n}\n","import { UITextStyle } from \"../text-style/UITextStyle\";\nimport type { UITextSpanConfig } from \"./UITextSpan.Internal\";\n\n/** Text span with associated style */\nexport class UITextSpan {\n /** Text style */\n public style: UITextStyle;\n private textInternal: string;\n private dirtyInternal = true;\n\n /** @param config Text span configuration */\n constructor(config: UITextSpanConfig) {\n this.textInternal = config.text;\n this.style = new UITextStyle(config.style);\n }\n\n /** Text content */\n public get text(): string {\n return this.textInternal;\n }\n\n /**\n * Indicates whether text or style has been modified.\n * Must be reset to `false` externally by the owner.\n * @internal\n */\n public get dirty(): boolean {\n return this.dirtyInternal || this.style.dirty;\n }\n\n public set text(value: string) {\n if (value !== this.textInternal) {\n this.textInternal = value;\n this.dirtyInternal = true;\n }\n }\n\n /** @internal */\n public setDirtyFalse(): void {\n this.dirtyInternal = false;\n this.style.setDirtyFalse();\n }\n}\n","import type { UIColorConfig } from \"../../miscellaneous/color/UIColor.Internal\";\nimport type { UIPaddingConfig } from \"../../miscellaneous/padding/UIPadding.Internal\";\nimport type { UITextStyleConfig } from \"../../miscellaneous/text-style/UITextStyle.Internal\";\nimport type { UIElementOptions } from \"../UIElement.Internal\";\n\n/** Controls how text adapts to element size */\nexport enum UITextResizeMode {\n /** Break text into multiple lines when narrower than content*/\n BREAK = 0,\n /** Scale text to fit fixed element size */\n SCALE = 1,\n}\n\n/** Configuration options for UIText */\nexport interface UITextOptions extends UIElementOptions {\n /** Multiplicative tint */\n color: UIColorConfig;\n /** Text padding in world units */\n padding: UIPaddingConfig;\n /** Default style applied to all spans */\n commonStyle: Partial<UITextStyleConfig>;\n /** How text adapts to size constraints */\n resizeMode: UITextResizeMode;\n /** Maximum line width before wrapping in pixels */\n maxLineWidth: number;\n}\n\nexport const TEXT_DEFAULT_MAX_LINE_WIDTH = 1024;\nexport const TEXT_DEFAULT_RESIZE_MODE = UITextResizeMode.SCALE;\n","import type { UITextSpan } from \"../../miscellaneous/text-span/UITextSpan\";\nimport { UITextStyle } from \"../../miscellaneous/text-style/UITextStyle\";\nimport type { UITextStyleConfig } from \"../../miscellaneous/text-style/UITextStyle.Internal\";\nimport type {\n UIChunkMetrics,\n UITextChunk,\n UITextLine,\n UITextSize,\n} from \"./UIText.Interfaces\";\n\n/**\n * Splits text into renderable chunks.\n * @param text Text to split\n * @returns Array of words, spaces, and newlines\n */\nexport function splitTextIntoChunks(text: string): string[] {\n return text.match(/\\S+|\\s|\\n/g) ?? [];\n}\n\n/**\n * Measures single text chunk.\n * @param context Canvas context for measurement\n * @param text Chunk text\n * @param textStyle Resolved text style\n * @returns Chunk metrics\n */\nexport function measureTextChunk(\n context: OffscreenCanvasRenderingContext2D,\n text: string,\n textStyle: UITextStyleConfig,\n): UIChunkMetrics {\n context.font = `${textStyle.fontStyle} ${textStyle.fontWeight} ${textStyle.fontSize}px \"${textStyle.fontFamily}\"`;\n\n if (text === \"\\n\") {\n return {\n width: Math.ceil(1),\n height: textStyle.lineHeight,\n baseline: 0,\n lineHeight: textStyle.lineHeight,\n };\n }\n\n const metrics = context.measureText(text);\n const width = Math.ceil(metrics.width);\n const height = Math.ceil(\n metrics.actualBoundingBoxAscent + metrics.actualBoundingBoxDescent,\n );\n\n return {\n width,\n height,\n baseline: metrics.actualBoundingBoxDescent,\n lineHeight: textStyle.lineHeight,\n };\n}\n\n/**\n * Builds text lines with word wrapping.\n * @param maxWidth Maximum line width in pixels\n * @param textChunks Measured text chunks\n * @returns Array of text lines\n */\nexport function buildTextLines(\n maxWidth: number,\n textChunks: UITextChunk[],\n): UITextLine[] {\n const lines: UITextLine[] = [];\n let currentLine: UITextChunk[] = [];\n let currentWidth = 0;\n let currentHeight = 0;\n let currentBaseline = 0;\n let currentLineHeight = 0;\n\n for (const textChunk of textChunks) {\n if (textChunk.text === \"\\n\") {\n if (currentLine.length > 0) {\n lines.push({\n chunks: currentLine,\n width: currentWidth,\n height: currentHeight,\n baseline: currentBaseline,\n lineHeight: currentLineHeight,\n });\n }\n currentLine = [];\n currentWidth = 0;\n currentHeight = 0;\n currentBaseline = 0;\n currentLineHeight = 0;\n continue;\n }\n\n if (\n currentLine.length === 0 ||\n currentWidth + textChunk.metrics.width <= maxWidth\n ) {\n currentLine.push(textChunk);\n currentWidth += textChunk.metrics.width;\n currentHeight = Math.max(currentHeight, textChunk.metrics.height);\n currentBaseline = Math.max(currentBaseline, textChunk.metrics.baseline);\n currentLineHeight = Math.max(\n currentLineHeight,\n textChunk.metrics.lineHeight,\n );\n } else {\n lines.push({\n chunks: currentLine,\n width: currentWidth,\n height: currentHeight,\n baseline: currentBaseline,\n lineHeight: currentLineHeight,\n });\n currentLine = [textChunk];\n currentWidth = textChunk.metrics.width;\n currentHeight = textChunk.metrics.height;\n currentBaseline = textChunk.metrics.baseline;\n currentLineHeight = textChunk.metrics.lineHeight;\n }\n }\n\n if (currentLine.length > 0) {\n lines.push({\n chunks: currentLine,\n width: currentWidth,\n height: currentHeight,\n baseline: currentBaseline,\n lineHeight: currentLineHeight,\n });\n }\n\n return lines;\n}\n\n/**\n * Calculates total text size from lines.\n * @param lines Text lines\n * @returns Total width and height\n */\nexport function calculateTextSize(lines: UITextLine[]): UITextSize {\n if (lines.length === 0) {\n return { width: 0, height: 0 };\n }\n\n const maxLineWidth = Math.max(...lines.map((line) => line.width));\n let totalHeight = 0;\n\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i];\n totalHeight += i === 0 ? line.height : line.lineHeight;\n }\n\n return { width: maxLineWidth, height: totalHeight };\n}\n\n/**\n * Builds measured text chunks from spans.\n * @param context Canvas context for measurement\n * @param textSpans Text spans with styles\n * @param commonStyle Fallback style\n * @returns Measured text chunks\n */\nexport function buildTextChunks(\n context: OffscreenCanvasRenderingContext2D,\n textSpans: UITextSpan[],\n commonStyle: UITextStyle,\n): UITextChunk[] {\n const textChunks: UITextChunk[] = [];\n\n for (const textSpan of textSpans) {\n const textStyle = UITextStyle.resolve(textSpan.style, commonStyle);\n\n for (const textChunk of splitTextIntoChunks(textSpan.text)) {\n const textChunkMetrics = measureTextChunk(context, textChunk, textStyle);\n textChunks.push({\n text: textChunk,\n style: textStyle,\n metrics: textChunkMetrics,\n });\n }\n }\n\n return textChunks;\n}\n\n/**\n * Calculates text layout parameters.\n * @param textChunks Measured text chunks\n * @param maxLineWidth Maximum line width in pixels\n * @returns Lines and total size\n */\nexport function calculateTextContentParameters(\n textChunks: UITextChunk[],\n maxLineWidth: number,\n): { lines: UITextLine[]; size: UITextSize } {\n const lines = buildTextLines(maxLineWidth, textChunks);\n const size = calculateTextSize(lines);\n return { lines, size };\n}\n","import type { UITextStyleConfig } from \"../../miscellaneous/text-style/UITextStyle.Internal\";\nimport { TEXT_STYLE_DEFAULT_ALIGN } from \"../../miscellaneous/text-style/UITextStyle.Internal\";\nimport type { UITextLine } from \"./UIText.Interfaces\";\n\n/**\n * Renders single text chunk.\n * @param x X coordinate in pixels\n * @param y Y coordinate in pixels\n * @param text Chunk text\n * @param style Resolved text style\n * @param context Canvas rendering context\n */\nexport function renderTextChunk(\n x: number,\n y: number,\n text: string,\n style: UITextStyleConfig,\n context: OffscreenCanvasRenderingContext2D,\n): void {\n context.font = `${style.fontStyle} ${style.fontWeight} ${style.fontSize}px \"${style.fontFamily}\"`;\n\n if (style.enableShadow) {\n context.shadowOffsetX = style.shadowOffsetX;\n context.shadowOffsetY = style.shadowOffsetY;\n context.shadowBlur = style.shadowBlur;\n context.shadowColor = style.shadowColor;\n }\n\n if (style.enableStroke) {\n context.strokeStyle = style.strokeColor;\n context.lineWidth = style.strokeThickness;\n context.strokeText(text, x, y);\n }\n\n context.fillStyle = style.color;\n context.fillText(text, x, y);\n}\n\n/**\n * Renders text lines to canvas.\n * @param paddingTop Top padding in pixels\n * @param paddingLeft Left padding in pixels\n * @param lines Text lines to render\n * @param context Canvas rendering context\n */\nexport function renderTextLines(\n paddingTop: number,\n paddingLeft: number,\n lines: UITextLine[],\n context: OffscreenCanvasRenderingContext2D,\n): void {\n let currentY = paddingTop;\n\n let textWidth = 0;\n for (const line of lines) {\n textWidth = Math.max(line.width, textWidth);\n }\n\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i];\n\n const firstAlign = line.chunks[0]?.style.align ?? TEXT_STYLE_DEFAULT_ALIGN;\n const isUniformAlign = line.chunks.every(\n (c) => c.style.align === firstAlign,\n );\n const lineAlign = isUniformAlign ? firstAlign : TEXT_STYLE_DEFAULT_ALIGN;\n\n let offsetX = 0;\n\n if (lineAlign === \"center\") {\n offsetX = (textWidth - line.width) / 2;\n } else if (lineAlign === \"right\") {\n offsetX = textWidth - line.width;\n }\n\n let currentX = paddingLeft + offsetX;\n currentY += i === 0 ? line.height : line.lineHeight;\n\n for (const chunk of line.chunks) {\n renderTextChunk(currentX, currentY, chunk.text, chunk.style, context);\n currentX += chunk.metrics.width;\n }\n }\n}\n","import type { WebGLRenderer } from \"three\";\nimport { CanvasTexture, Matrix3 } from \"three\";\nimport type { UILayer } from \"../../layers/UILayer\";\nimport { UIColor } from \"../../miscellaneous/color/UIColor\";\nimport { UIPadding } from \"../../miscellaneous/padding/UIPadding\";\nimport { UITextSpan } from \"../../miscellaneous/text-span/UITextSpan\";\nimport { UITextStyle } from \"../../miscellaneous/text-style/UITextStyle\";\nimport source from \"../../shaders/UIImage.glsl\";\nimport { UIElement } from \"../UIElement\";\nimport type { UITextChunk, UITextContent } from \"./UIText.Interfaces\";\nimport type { UITextOptions } from \"./UIText.Internal\";\nimport {\n TEXT_DEFAULT_MAX_LINE_WIDTH,\n TEXT_DEFAULT_RESIZE_MODE,\n UITextResizeMode,\n} from \"./UIText.Internal\";\nimport {\n buildTextChunks,\n calculateTextContentParameters,\n} from \"./UIText.Measuring\";\nimport { renderTextLines } from \"./UIText.Rendering\";\n\n/** Canvas-based text rendering element */\nexport class UIText extends UIElement {\n /** Multiplicative tint. Alpha channel controls opacity. */\n public readonly color: UIColor;\n /** Text padding in world units */\n public readonly padding: UIPadding;\n /** Default style applied to all text spans */\n public readonly commonStyle: UITextStyle;\n\n private readonly canvas: OffscreenCanvas;\n private readonly context: OffscreenCanvasRenderingContext2D;\n private texture: CanvasTexture;\n\n private contentInternal: UITextSpan[] = [];\n private contentDirty = false;\n\n private maxLineWidthInternal: number;\n private maxLineWidthDirty = false;\n\n private resizeModeInternal: UITextResizeMode;\n private resizeModeDirty = false;\n\n private lastWidth: number;\n private lastHeight: number;\n\n private textChunks: UITextChunk[] = [];\n private textChunksDirty = false;\n\n /**\n * Creates a new UIText instance.\n *\n * @param layer - Layer containing this element\n * @param content - Text content as string or styled spans\n * @param options - Configuration options\n */\n constructor(\n layer: UILayer,\n content: UITextContent,\n options: Partial<UITextOptions> = {},\n ) {\n const canvas = new OffscreenCanvas(2, 2);\n const context = canvas.getContext(\"2d\");\n\n if (!context) {\n throw new Error(\"UIText.constructor: failed to create canvas context\");\n }\n\n const texture = new CanvasTexture(canvas);\n const color = new UIColor(options.color);\n\n super(layer, source, {\n texture: texture,\n textureTransform: new Matrix3(),\n color,\n });\n\n this.color = color;\n this.padding = new UIPadding(options.padding);\n this.commonStyle = new UITextStyle(options.commonStyle);\n this.maxLineWidthInternal =\n options.maxLineWidth ?? TEXT_DEFAULT_MAX_LINE_WIDTH;\n this.resizeModeInternal = options.resizeMode ?? TEXT_DEFAULT_RESIZE_MODE;\n\n this.canvas = canvas;\n this.context = context;\n this.texture = texture;\n this.content = content;\n\n this.lastWidth = this.width;\n this.lastHeight = this.height;\n\n if (options.padding === undefined) {\n this.padding.setUnified(\n this.content.reduce(\n (a, b) => Math.max(a, b.style.calculatePadding()),\n this.commonStyle.calculatePadding(),\n ),\n );\n }\n\n switch (this.resizeModeInternal) {\n case UITextResizeMode.SCALE:\n this.tryToRenderTextScaleMode();\n break;\n\n case UITextResizeMode.BREAK:\n this.tryToRenderTextBreakMode();\n break;\n }\n }\n\n /** Text content as array of styled spans */\n public get content(): UITextSpan[] {\n return this.contentInternal;\n }\n\n /** Maximum line width before wrapping in pixels */\n public get maxLineWidth(): number {\n return this.maxLineWidthInternal;\n }\n\n /** Controls how text adapts to element size */\n public get resizeMode(): UITextResizeMode {\n return this.resizeModeInternal;\n }\n\n /** Text content as string, span config, or array */\n public set content(value: UITextContent) {\n if (this.contentInternal !== value) {\n if (typeof value === \"string\") {\n this.contentInternal = [\n new UITextSpan({ text: value, style: new UITextStyle() }),\n ];\n } else if (Array.isArray(value)) {\n this.contentInternal = value.map((span) =>\n typeof span === \"string\"\n ? new UITextSpan({ text: span, style: new UITextStyle() })\n : new UITextSpan({\n text: span.text,\n style: new UITextStyle(span.style),\n }),\n );\n } else {\n this.contentInternal = [\n new UITextSpan({\n text: value.text,\n style: new UITextStyle(value.style),\n }),\n ];\n }\n this.contentDirty = true;\n this.textChunksDirty = true;\n }\n }\n\n /** Maximum line width before wrapping in pixels */\n public set maxLineWidth(value: number) {\n if (this.maxLineWidthInternal !== value) {\n this.maxLineWidthInternal = value;\n this.maxLineWidthDirty = true;\n }\n }\n\n /** Controls how text adapts to size constraints */\n public set resizeMode(value: UITextResizeMode) {\n if (this.resizeModeInternal !== value) {\n this.resizeModeInternal = value;\n this.resizeModeDirty = true;\n }\n }\n\n /** Removes element and frees resources */\n public override destroy(): void {\n this.texture.dispose();\n super.destroy();\n }\n\n protected override onWillRender(\n renderer: WebGLRenderer,\n deltaTime: number,\n ): void {\n if (this.color.dirty) {\n this.sceneWrapper.setProperties(this.planeHandler, { color: this.color });\n this.color.setDirtyFalse();\n }\n\n switch (this.resizeModeInternal) {\n case UITextResizeMode.SCALE:\n this.tryToRenderTextScaleMode();\n break;\n\n case UITextResizeMode.BREAK:\n this.tryToRenderTextBreakMode();\n break;\n }\n\n super.onWillRender(renderer, deltaTime);\n }\n\n private tryToRenderTextScaleMode(): void {\n if (\n !this.resizeModeDirty &&\n !this.maxLineWidthDirty &&\n !this.padding.dirty &&\n !(\n this.solverWrapper.dirty &&\n this.lastWidth / this.lastHeight !==\n Math.round(this.width) / Math.round(this.height)\n ) &&\n !this.checkContentDirty()\n ) {\n return;\n }\n\n const textChunks = this.buildTextChunks();\n\n const { lines, size } = calculateTextContentParameters(\n textChunks,\n this.maxLineWidthInternal,\n );\n\n const paddingV = this.padding.top + this.padding.bottom;\n const paddingH = this.padding.left + this.padding.right;\n\n const desiredHeight = size.height + paddingV;\n const desiredWidth = size.width + paddingH;\n\n // Two calculation passes are required to cover both cases -\n // when the width is specified by a constraint and cannot be changed,\n // or when the height is specified by a constraint and cannot be changed,\n // but the width still has priority, because it is specified first and last.\n this.width = desiredWidth;\n this.height = (desiredHeight / desiredWidth) * Math.round(this.width);\n this.width = (desiredWidth / desiredHeight) * Math.round(this.height);\n\n const resolutionDirty =\n this.lastWidth !== desiredHeight || this.lastHeight !== desiredWidth;\n\n if (resolutionDirty) {\n this.canvas.height = desiredHeight;\n this.canvas.width = desiredWidth;\n }\n\n renderTextLines(this.padding.top, this.padding.left, lines, this.context);\n\n if (resolutionDirty) {\n this.rebuildTexture();\n }\n\n this.resizeModeDirty = false;\n this.maxLineWidthDirty = false;\n this.padding.setDirtyFalse();\n this.setDimensionsDirtyFalse();\n this.setContentDirtyFalse();\n }\n\n private tryToRenderTextBreakMode(): void {\n if (\n !this.resizeModeDirty &&\n !this.maxLineWidthDirty &&\n !this.padding.dirty &&\n !this.checkDimensionsDirty() &&\n !this.checkContentDirty()\n ) {\n return;\n }\n\n const textChunks = this.buildTextChunks();\n\n // Two passes of text size calculation are needed to first\n // suggest the desired sizes to the solver, and then\n // adjust our expectations based on the result obtained.\n\n const { size: desiredTextSize } = calculateTextContentParameters(\n textChunks,\n this.maxLineWidthInternal,\n );\n\n const paddingV = this.padding.top + this.padding.bottom;\n const paddingH = this.padding.left + this.padding.right;\n\n this.height = desiredTextSize.height + paddingV;\n this.width = desiredTextSize.width + paddingH; // Width should remain a priority, so it is set last.\n\n const { lines: realTextLines, size: realTextSize } =\n calculateTextContentParameters(\n textChunks,\n Math.round(this.width) - paddingH,\n );\n\n this.height = realTextSize.height + paddingV;\n this.width = realTextSize.width + paddingH;\n\n const safeWidth = Math.max(Math.round(this.width), 2);\n const safeHeight = Math.max(Math.round(this.height), 2);\n\n const resolutionDirty =\n this.lastWidth !== safeWidth || this.lastHeight !== safeHeight;\n\n if (resolutionDirty) {\n this.canvas.width = safeWidth;\n this.canvas.height = safeHeight;\n }\n\n renderTextLines(\n this.padding.top,\n this.padding.left,\n realTextLines,\n this.context,\n );\n\n if (resolutionDirty) {\n this.rebuildTexture();\n }\n\n this.resizeModeDirty = false;\n this.maxLineWidthDirty = false;\n this.padding.setDirtyFalse();\n this.setDimensionsDirtyFalse();\n this.setContentDirtyFalse();\n }\n\n private rebuildTexture(): void {\n this.texture.dispose();\n this.texture = new CanvasTexture(this.canvas);\n this.texture.needsUpdate = true;\n this.sceneWrapper.setProperties(this.planeHandler, {\n texture: this.texture,\n });\n }\n\n private buildTextChunks(): UITextChunk[] {\n if (this.textChunksDirty) {\n this.textChunks = buildTextChunks(\n this.context,\n this.contentInternal,\n this.commonStyle,\n );\n this.textChunksDirty = false;\n }\n\n return this.textChunks;\n }\n\n private checkDimensionsDirty(): boolean {\n return (\n this.solverWrapper.dirty &&\n (this.lastWidth !== Math.round(this.width) ||\n this.lastHeight !== Math.round(this.height))\n );\n }\n\n private setDimensionsDirtyFalse(): void {\n this.lastWidth = Math.round(this.width);\n this.lastHeight = Math.round(this.height);\n }\n\n private checkContentDirty(): boolean {\n return (\n this.contentDirty || this.content.some((span): boolean => span.dirty)\n );\n }\n\n private setContentDirtyFalse(): void {\n this.contentDirty = false;\n for (const span of this.content) {\n span.setDirtyFalse();\n }\n }\n}\n","/** Base class for viewport resize policies */\nexport abstract class UIResizePolicy {\n /** @internal */\n public dirty = false;\n\n /** @internal */\n public abstract calculateScale(width: number, height: number): number;\n}\n","import { assertValidPositiveNumber } from \"../asserts\";\nimport { UIResizePolicy } from \"./UIResizePolicy\";\n\n/** No scaling. Always returns 1. */\nexport class UIResizePolicyNone extends UIResizePolicy {\n public calculateScale(width: number, height: number): number {\n assertValidPositiveNumber(width, \"UIResizePolicyNone.calculateScale.width\");\n assertValidPositiveNumber(\n height,\n \"UIResizePolicyNone.calculateScale.height\",\n );\n return 1;\n }\n}\n","import type { Camera, Vector2, WebGLRenderer } from \"three\";\nimport { MathUtils, Ray, Vector3 } from \"three\";\nimport { assertValidNumber } from \"../miscellaneous/asserts\";\nimport type { UIResizePolicy } from \"../miscellaneous/resize-policy/UIResizePolicy\";\nimport { UIResizePolicyNone } from \"../miscellaneous/resize-policy/UIResizePolicyNone\";\nimport { UIInputEvent } from \"../miscellaneous/UIInputEvent\";\nimport { isUIModeInteractive, UIMode } from \"../miscellaneous/UIMode\";\nimport { UILayer } from \"./UILayer\";\nimport type { UILayerMode } from \"./UILayer.Internal\";\n\n/** Layer that automatically handles browser window resizing and input events */\nexport class UIFullscreenLayer extends UILayer {\n private resizePolicyInternal: UIResizePolicy;\n private resizePolicyDirty = false;\n\n /**\n * @param resizePolicy Strategy for handling window resize\n * @param mode Initial visibility and interactivity mode\n */\n constructor(\n resizePolicy: UIResizePolicy = new UIResizePolicyNone(),\n mode: UILayerMode = UIMode.VISIBLE,\n ) {\n const scale = resizePolicy.calculateScale(\n window.innerWidth,\n window.innerHeight,\n );\n super(window.innerWidth * scale, window.innerHeight * scale, mode);\n this.resizePolicyInternal = resizePolicy;\n window.addEventListener(\"resize\", this.onResize);\n window.addEventListener(\"pointerdown\", this.onPointerDown);\n window.addEventListener(\"pointermove\", this.onPointerMove);\n window.addEventListener(\"pointerup\", this.onPointerUp);\n }\n\n /** Current resize policy */\n public get resizePolicy(): UIResizePolicy {\n return this.resizePolicyInternal;\n }\n\n /** Updates resize policy */\n public set resizePolicy(value: UIResizePolicy) {\n if (this.resizePolicyInternal !== value) {\n this.resizePolicyInternal = value;\n this.resizePolicyDirty = true;\n }\n }\n\n /** Removes event listeners and frees resources */\n public destroy(): void {\n window.removeEventListener(\"resize\", this.onResize);\n window.removeEventListener(\"pointerdown\", this.onPointerDown);\n window.removeEventListener(\"pointermove\", this.onPointerMove);\n window.removeEventListener(\"pointerup\", this.onPointerUp);\n }\n\n /**\n * Renders layer and all visible elements\n * @param renderer Three.js WebGL renderer\n * @param deltaTime Time since last frame in seconds\n */\n public render(renderer: WebGLRenderer, deltaTime: number): void {\n assertValidNumber(deltaTime, \"UIFullscreenLayer.render.deltaTime\");\n if (this.resizePolicy.dirty || this.resizePolicyDirty) {\n this.onResize();\n }\n super.renderInternal(renderer, deltaTime);\n }\n\n /**\n * Projects 3D world position to 2D layer coordinates\n * @param position World position\n * @param camera Three.js camera\n * @returns Layer coordinates\n */\n public projectWorldPosition(position: Vector3, camera: Camera): Vector3 {\n const projectedPosition = position.clone().project(camera);\n projectedPosition.x = MathUtils.mapLinear(\n projectedPosition.x,\n -1,\n 1,\n this.x,\n this.width,\n );\n projectedPosition.y = MathUtils.mapLinear(\n projectedPosition.y,\n -1,\n 1,\n this.y,\n this.height,\n );\n return projectedPosition;\n }\n\n /**\n * Projects 2D layer coordinates to 3D world position\n * @param position Layer coordinates\n * @param camera Three.js camera\n * @param z Depth coordinate\n * @returns World position\n */\n public projectLayerPosition(\n position: Vector2,\n camera: Camera,\n z = -1,\n ): Vector3 {\n return new Vector3(\n MathUtils.mapLinear(position.x, this.x, this.width, -1, 1),\n MathUtils.mapLinear(position.y, this.y, this.height, -1, 1),\n z,\n ).unproject(camera);\n }\n\n /**\n * Builds ray from layer position through camera\n * @param position Layer coordinates\n * @param camera Three.js camera\n * @param result Reusable ray instance\n * @returns Ray from near to far plane\n */\n public buildRay(position: Vector2, camera: Camera, result = new Ray()): Ray {\n const near = new Vector3(\n MathUtils.mapLinear(position.x, this.x, this.width, -1, 1),\n MathUtils.mapLinear(position.y, this.y, this.height, -1, 1),\n -1,\n ).unproject(camera);\n\n const far = new Vector3(\n MathUtils.mapLinear(position.x, this.x, this.width, -1, 1),\n MathUtils.mapLinear(position.y, this.y, this.height, -1, 1),\n 1,\n ).unproject(camera);\n\n const direction = far.sub(near).normalize();\n return result.set(near, direction);\n }\n\n private readonly onResize = (): void => {\n const scale = this.resizePolicy.calculateScale(\n window.innerWidth,\n window.innerHeight,\n );\n this.resizePolicy.dirty = false;\n this.resizePolicyDirty = false;\n this.resizeInternal(window.innerWidth * scale, window.innerHeight * scale);\n };\n\n private readonly onPointerDown = (event: PointerEvent): void => {\n this.handleWindowInput(event, \"onPointerDown\", UIInputEvent.PRESSED);\n };\n\n private readonly onPointerMove = (event: PointerEvent): void => {\n this.handleWindowInput(event, \"onPointerMove\", UIInputEvent.MOVED);\n };\n\n private readonly onPointerUp = (event: PointerEvent): void => {\n this.handleWindowInput(event, \"onPointerUp\", UIInputEvent.RELEASED);\n };\n\n private handleWindowInput(\n event: PointerEvent,\n pointerFunctionName: \"onPointerDown\" | \"onPointerMove\" | \"onPointerUp\",\n inputEvent: UIInputEvent,\n ): void {\n const rect =\n event.target instanceof HTMLElement\n ? event.target.getBoundingClientRect()\n : null;\n\n const x = rect ? event.clientX - rect.left : event.clientX;\n const y = rect\n ? rect.bottom - event.clientY\n : window.innerHeight - event.clientY;\n\n const scale = this.resizePolicy.calculateScale(\n window.innerWidth,\n window.innerHeight,\n );\n const scaledX = x * scale;\n const scaledY = y * scale;\n\n if (isUIModeInteractive(this.mode)) {\n this.emit(inputEvent, scaledX, scaledY, event.pointerId);\n this.inputWrapperInternal[pointerFunctionName](\n scaledX,\n scaledY,\n event.pointerId,\n );\n }\n }\n}\n","import { UIArea } from \"./UIArea\";\n\n/** Circular interaction area */\nexport class UIAreaCircle extends UIArea {\n /**\n * Creates circular area.\n *\n * @param centerX - Center X in normalized coordinates (0 to 1)\n * @param centerY - Center Y in normalized coordinates (0 to 1)\n * @param radius - Radius in normalized coordinates (0 to 1)\n */\n constructor(\n public centerX: number,\n public centerY: number,\n public radius: number,\n ) {\n super();\n }\n\n /** @internal */\n public contains(pointX: number, pointY: number): boolean {\n const deltaX = pointX - this.centerX;\n const deltaY = pointY - this.centerY;\n return deltaX * deltaX + deltaY * deltaY <= this.radius * this.radius;\n }\n}\n","import type { Vector2Like } from \"three\";\nimport { UIArea } from \"./UIArea\";\n\n/** Polygonal interaction area using ray casting */\nexport class UIAreaPolygon extends UIArea {\n /**\n * Creates polygonal area.\n *\n * @param vertices - Vertices in normalized coordinates (0 to 1)\n */\n constructor(public vertices: Vector2Like[]) {\n super();\n }\n\n /** @internal */\n public contains(pointX: number, pointY: number): boolean {\n const vertexCount = this.vertices.length;\n if (vertexCount < 3) {\n return false;\n }\n\n let inside = false;\n\n for (\n let index = 0, previousIndex = vertexCount - 1;\n index < vertexCount;\n previousIndex = index++\n ) {\n const currentVertex = this.vertices[index];\n const previousVertex = this.vertices[previousIndex];\n\n const currentX = currentVertex.x;\n const currentY = currentVertex.y;\n const previousX = previousVertex.x;\n const previousY = previousVertex.y;\n\n if (\n currentY > pointY !== previousY > pointY &&\n pointX <\n ((previousX - currentX) * (pointY - currentY)) /\n (previousY - currentY) +\n currentX\n ) {\n inside = !inside;\n }\n }\n\n return inside;\n }\n}\n","import { UIArea } from \"./UIArea\";\n\n/** Rectangular interaction area with rounded corners */\nexport class UIAreaRoundedRectangle extends UIArea {\n /**\n * Creates rounded rectangular area.\n *\n * Radius clamped to half of smallest dimension.\n *\n * @param x - X position in normalized coordinates (0 to 1)\n * @param y - Y position in normalized coordinates (0 to 1)\n * @param width - Width in normalized coordinates (0 to 1)\n * @param height - Height in normalized coordinates (0 to 1)\n * @param radius - Corner radius in normalized coordinates (0 to 1)\n */\n constructor(\n public x: number,\n public y: number,\n public width: number,\n public height: number,\n public radius: number,\n ) {\n super();\n this.radius = Math.min(radius, Math.min(width, height) / 2);\n }\n\n /** @internal */\n public contains(pointX: number, pointY: number): boolean {\n const left = this.x;\n const right = this.x + this.width;\n const top = this.y;\n const bottom = this.y + this.height;\n\n if (pointX < left || pointX > right || pointY < top || pointY > bottom) {\n return false;\n }\n\n const cornerLeft = left + this.radius;\n const cornerRight = right - this.radius;\n const cornerTop = top + this.radius;\n const cornerBottom = bottom - this.radius;\n\n if (pointX >= cornerLeft && pointX <= cornerRight) {\n return true;\n }\n\n if (pointY >= cornerTop && pointY <= cornerBottom) {\n return true;\n }\n\n let centerX: number;\n let centerY: number;\n\n if (pointX < cornerLeft) {\n centerX = cornerLeft;\n } else {\n centerX = cornerRight;\n }\n\n if (pointY < cornerTop) {\n centerY = cornerTop;\n } else {\n centerY = cornerBottom;\n }\n\n const deltaX = pointX - centerX;\n const deltaY = pointY - centerY;\n return deltaX * deltaX + deltaY * deltaY <= this.radius * this.radius;\n }\n}\n","import source from \"../../shaders/UIProgressMaskFunctionCircular.glsl\";\nimport type { UIPropertyType } from \"../generic-plane/shared\";\nimport { UIProgressMaskFunction } from \"./UIProgressMaskFunction\";\n\n/** Circular radial progress fill */\nexport class UIProgressMaskFunctionCircular extends UIProgressMaskFunction {\n private startAngleInternal: number;\n private inverseDirectionInternal: boolean;\n\n /**\n * Creates circular mask function.\n *\n * @param startAngle - Starting angle in radians\n * @param inverseDirection - Whether to fill counter-clockwise\n */\n constructor(startAngle = 0, inverseDirection = false) {\n super(source);\n this.startAngleInternal = startAngle;\n this.inverseDirectionInternal = inverseDirection;\n }\n\n /** Starting angle in radians */\n public get startAngle(): number {\n return this.startAngleInternal;\n }\n\n /** Whether fill is counter-clockwise */\n public get inverseDirection(): boolean {\n return this.inverseDirectionInternal;\n }\n\n /** Starting angle in radians */\n public set startAngle(value: number) {\n if (this.startAngleInternal !== value) {\n this.startAngleInternal = value;\n this.dirtyInternal = true;\n }\n }\n\n /** Whether fill is counter-clockwise */\n public set inverseDirection(value: boolean) {\n if (this.inverseDirectionInternal !== value) {\n this.inverseDirectionInternal = value;\n this.dirtyInternal = true;\n }\n }\n\n /** @internal */\n public enumerateProperties(): Record<string, UIPropertyType> {\n return {\n direction: this.inverseDirectionInternal ? -1 : 1,\n startAngle: this.startAngleInternal,\n };\n }\n}\n","import { assertValidPositiveNumber } from \"../asserts\";\nimport { UIResizePolicy } from \"./UIResizePolicy\";\n\n/** Scales by width in landscape, by height in portrait */\nexport class UIResizePolicyCross extends UIResizePolicy {\n private fixedWidthLandscapeInternal: number;\n private fixedHeightPortraitInternal: number;\n\n /**\n * Creates cross resize policy.\n *\n * @param fixedWidthLandscape - Target width when landscape\n * @param fixedHeightPortrait - Target height when portrait\n */\n constructor(fixedWidthLandscape: number, fixedHeightPortrait: number) {\n super();\n assertValidPositiveNumber(\n fixedWidthLandscape,\n \"UIResizePolicyCross.constructor.fixedWidthLandscape\",\n );\n assertValidPositiveNumber(\n fixedHeightPortrait,\n \"UIResizePolicyCross.constructor.fixedHeightPortrait\",\n );\n\n this.fixedWidthLandscapeInternal = fixedWidthLandscape;\n this.fixedHeightPortraitInternal = fixedHeightPortrait;\n }\n\n /** Target width when landscape */\n public get fixedWidthLandscape(): number {\n return this.fixedWidthLandscapeInternal;\n }\n\n /** Target height when portrait */\n public get fixedHeightPortrait(): number {\n return this.fixedHeightPortraitInternal;\n }\n\n /** Target width when landscape */\n public set fixedWidthLandscape(value: number) {\n assertValidPositiveNumber(value, \"UIResizePolicyCross.fixedWidthLandscape\");\n if (value !== this.fixedWidthLandscapeInternal) {\n this.fixedWidthLandscapeInternal = value;\n this.dirty = true;\n }\n }\n\n /** Target height when portrait */\n public set fixedHeightPortrait(value: number) {\n assertValidPositiveNumber(value, \"UIResizePolicyCross.fixedHeightPortrait\");\n if (value !== this.fixedHeightPortraitInternal) {\n this.fixedHeightPortraitInternal = value;\n this.dirty = true;\n }\n }\n\n public calculateScale(width: number, height: number): number {\n assertValidPositiveNumber(\n width,\n \"UIResizePolicyCross.calculateScale.width\",\n );\n assertValidPositiveNumber(\n height,\n \"UIResizePolicyCross.calculateScale.height\",\n );\n return width > height\n ? this.fixedWidthLandscapeInternal / width\n : this.fixedHeightPortraitInternal / height;\n }\n}\n","import { assertValidPositiveNumber } from \"../asserts\";\nimport { UIResizePolicy } from \"./UIResizePolicy\";\n\n/** Scales by height in landscape, by width in portrait */\nexport class UIResizePolicyCrossInverted extends UIResizePolicy {\n private fixedHeightLandscapeInternal: number;\n private fixedWidthPortraitInternal: number;\n\n /**\n * Creates inverted cross resize policy.\n *\n * @param fixedHeightLandscape - Target height when landscape\n * @param fixedWidthPortrait - Target width when portrait\n */\n constructor(fixedHeightLandscape: number, fixedWidthPortrait: number) {\n super();\n assertValidPositiveNumber(\n fixedHeightLandscape,\n \"UIResizePolicyCrossInverted.constructor.fixedHeightLandscape\",\n );\n assertValidPositiveNumber(\n fixedWidthPortrait,\n \"UIResizePolicyCrossInverted.constructor.fixedWidthPortrait\",\n );\n\n this.fixedHeightLandscapeInternal = fixedHeightLandscape;\n this.fixedWidthPortraitInternal = fixedWidthPortrait;\n }\n\n /** Target height when landscape */\n public get fixedHeightLandscape(): number {\n return this.fixedHeightLandscapeInternal;\n }\n\n /** Target width when portrait */\n public get fixedWidthPortrait(): number {\n return this.fixedWidthPortraitInternal;\n }\n\n /** Target height when landscape */\n public set fixedHeightLandscape(value: number) {\n assertValidPositiveNumber(\n value,\n \"UIResizePolicyCrossInverted.fixedHeightLandscape\",\n );\n if (value !== this.fixedHeightLandscapeInternal) {\n this.fixedHeightLandscapeInternal = value;\n this.dirty = true;\n }\n }\n\n /** Target width when portrait */\n public set fixedWidthPortrait(value: number) {\n assertValidPositiveNumber(\n value,\n \"UIResizePolicyCrossInverted.fixedWidthPortrait\",\n );\n if (value !== this.fixedWidthPortraitInternal) {\n this.fixedWidthPortraitInternal = value;\n this.dirty = true;\n }\n }\n\n public calculateScale(width: number, height: number): number {\n assertValidPositiveNumber(\n width,\n \"UIResizePolicyCrossInverted.calculateScale.width\",\n );\n assertValidPositiveNumber(\n height,\n \"UIResizePolicyCrossInverted.calculateScale.height\",\n );\n return width > height\n ? this.fixedHeightLandscapeInternal / height\n : this.fixedWidthPortraitInternal / width;\n }\n}\n","import { assertValidPositiveNumber } from \"../asserts\";\nimport { UIResizePolicy } from \"./UIResizePolicy\";\n\n/** Scales by height with orientation-specific targets */\nexport class UIResizePolicyFixedHeight extends UIResizePolicy {\n private fixedHeightLandscapeInternal: number;\n private fixedHeightPortraitInternal: number;\n\n /**\n * Creates fixed height resize policy.\n *\n * @param fixedHeightLandscape - Target height when landscape\n * @param fixedHeightPortrait - Target height when portrait\n */\n constructor(fixedHeightLandscape: number, fixedHeightPortrait: number) {\n super();\n assertValidPositiveNumber(\n fixedHeightLandscape,\n \"UIResizePolicyFixedHeight.constructor.fixedHeightLandscape\",\n );\n assertValidPositiveNumber(\n fixedHeightPortrait,\n \"UIResizePolicyFixedHeight.constructor.fixedHeightPortrait\",\n );\n\n this.fixedHeightLandscapeInternal = fixedHeightLandscape;\n this.fixedHeightPortraitInternal = fixedHeightPortrait;\n }\n\n /** Target height when landscape */\n public get fixedHeightLandscape(): number {\n return this.fixedHeightLandscapeInternal;\n }\n\n /** Target height when portrait */\n public get fixedHeightPortrait(): number {\n return this.fixedHeightPortraitInternal;\n }\n\n /** Target height when landscape */\n public set fixedHeightLandscape(value: number) {\n assertValidPositiveNumber(\n value,\n \"UIResizePolicyFixedHeight.fixedHeightLandscape\",\n );\n if (value !== this.fixedHeightLandscapeInternal) {\n this.fixedHeightLandscapeInternal = value;\n this.dirty = true;\n }\n }\n\n /** Target height when portrait */\n public set fixedHeightPortrait(value: number) {\n assertValidPositiveNumber(\n value,\n \"UIResizePolicyFixedHeight.fixedHeightPortrait\",\n );\n if (value !== this.fixedHeightPortraitInternal) {\n this.fixedHeightPortraitInternal = value;\n this.dirty = true;\n }\n }\n\n public calculateScale(width: number, height: number): number {\n assertValidPositiveNumber(\n width,\n \"UIResizePolicyFixedHeight.calculateScale.width\",\n );\n assertValidPositiveNumber(\n height,\n \"UIResizePolicyFixedHeight.calculateScale.height\",\n );\n return width > height\n ? this.fixedHeightLandscapeInternal / height\n : this.fixedHeightPortraitInternal / height;\n }\n}\n","import { assertValidPositiveNumber } from \"../asserts\";\nimport { UIResizePolicy } from \"./UIResizePolicy\";\n\n/** Scales by width with orientation-specific targets */\nexport class UIResizePolicyFixedWidth extends UIResizePolicy {\n private fixedWidthLandscapeInternal: number;\n private fixedWidthPortraitInternal: number;\n\n /**\n * Creates fixed width resize policy.\n *\n * @param fixedWidthLandscape - Target width when landscape\n * @param fixedWidthPortrait - Target width when portrait\n */\n constructor(fixedWidthLandscape: number, fixedWidthPortrait: number) {\n super();\n assertValidPositiveNumber(\n fixedWidthLandscape,\n \"UIResizePolicyFixedWidth.constructor.fixedWidthLandscape\",\n );\n assertValidPositiveNumber(\n fixedWidthPortrait,\n \"UIResizePolicyFixedWidth.constructor.fixedWidthPortrait\",\n );\n\n this.fixedWidthLandscapeInternal = fixedWidthLandscape;\n this.fixedWidthPortraitInternal = fixedWidthPortrait;\n }\n\n /** Target width when landscape */\n public get fixedWidthLandscape(): number {\n return this.fixedWidthLandscapeInternal;\n }\n\n /** Target width when portrait */\n public get fixedWidthPortrait(): number {\n return this.fixedWidthPortraitInternal;\n }\n\n /** Target width when landscape */\n public set fixedWidthLandscape(value: number) {\n assertValidPositiveNumber(\n value,\n \"UIResizePolicyFixedWidth.fixedWidthLandscape\",\n );\n if (value !== this.fixedWidthLandscapeInternal) {\n this.fixedWidthLandscapeInternal = value;\n this.dirty = true;\n }\n }\n\n /** Target width when portrait */\n public set fixedWidthPortrait(value: number) {\n assertValidPositiveNumber(\n value,\n \"UIResizePolicyFixedWidth.fixedWidthPortrait\",\n );\n if (value !== this.fixedWidthPortraitInternal) {\n this.fixedWidthPortraitInternal = value;\n this.dirty = true;\n }\n }\n\n public calculateScale(width: number, height: number): number {\n assertValidPositiveNumber(\n width,\n \"UIResizePolicyFixedWidth.calculateScale.width\",\n );\n assertValidPositiveNumber(\n height,\n \"UIResizePolicyFixedWidth.calculateScale.height\",\n );\n return width > height\n ? this.fixedWidthLandscapeInternal / width\n : this.fixedWidthPortraitInternal / width;\n }\n}\n"],"names":["Eventail","DEFAULT_ANCHOR","source"],"mappings":";;AAAA,MAAM,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,GAAG,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,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