@ixfx/components 0.7.1 → 0.7.2

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.
Files changed (49) hide show
  1. package/bundle/index.d.ts +24 -17
  2. package/bundle/index.d.ts.map +1 -1
  3. package/bundle/index.js +29 -1
  4. package/bundle/index.js.map +1 -1
  5. package/dist/{index-CG2vIgPv.d.ts → index-UvnoZUAo.d.ts} +4 -4
  6. package/dist/{index-CG2vIgPv.d.ts.map → index-UvnoZUAo.d.ts.map} +1 -1
  7. package/dist/index.d.ts +8 -3
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +27 -4
  10. package/dist/index.js.map +1 -1
  11. package/dist/labelled-radial-input.d.ts +1 -1
  12. package/dist/labelled-radial-input.js +1 -1
  13. package/dist/{labelled-slider-input-DzigjMwP.js → labelled-slider-input-BInB5GKL.js} +3 -3
  14. package/dist/{labelled-slider-input-DzigjMwP.js.map → labelled-slider-input-BInB5GKL.js.map} +1 -1
  15. package/dist/labelled-slider-input.d.ts +1 -1
  16. package/dist/labelled-slider-input.js +1 -1
  17. package/dist/polar-pad.d.ts +2 -2
  18. package/dist/polar-pad.js +1 -1
  19. package/dist/{radial-input-Dp5qz0ly.js → radial-input-BfA3GO0H.js} +2 -2
  20. package/dist/{radial-input-Dp5qz0ly.js.map → radial-input-BfA3GO0H.js.map} +1 -1
  21. package/dist/{radial-input-DXMN55Nz.d.ts → radial-input-DU6t2hYO.d.ts} +3 -3
  22. package/dist/{radial-input-DXMN55Nz.d.ts.map → radial-input-DU6t2hYO.d.ts.map} +1 -1
  23. package/dist/radial-input.d.ts +1 -1
  24. package/dist/radial-input.js +1 -1
  25. package/dist/range-input.d.ts +2 -2
  26. package/dist/range-input.js +1 -1
  27. package/dist/range.d.ts +2 -2
  28. package/dist/range.js +1 -1
  29. package/dist/select-horiz.d.ts +2 -2
  30. package/dist/select-horiz.js +1 -1
  31. package/dist/{slider-input-De4eoT11.js → slider-input-Bl1hFE89.js} +2 -2
  32. package/dist/{slider-input-De4eoT11.js.map → slider-input-Bl1hFE89.js.map} +1 -1
  33. package/dist/{slider-input-BfRUW2ZB.d.ts → slider-input-BxURAAmD.d.ts} +3 -3
  34. package/dist/{slider-input-BfRUW2ZB.d.ts.map → slider-input-BxURAAmD.d.ts.map} +1 -1
  35. package/dist/slider-input.d.ts +1 -1
  36. package/dist/slider-input.js +1 -1
  37. package/dist/swipe.d.ts +2 -2
  38. package/dist/swipe.js +1 -1
  39. package/dist/wheel-nudge-By5s_ioH.d.ts +31 -0
  40. package/dist/wheel-nudge-By5s_ioH.d.ts.map +1 -0
  41. package/dist/{wheel-nudge-BlSCe_hD.js → wheel-nudge-D5rmht3v.js} +6 -1
  42. package/dist/wheel-nudge-D5rmht3v.js.map +1 -0
  43. package/dist/xy-pad.d.ts +2 -2
  44. package/dist/xy-pad.js +1 -1
  45. package/docs-user/index.json +2 -2
  46. package/package.json +1 -1
  47. package/dist/wheel-nudge-BlSCe_hD.js.map +0 -1
  48. package/dist/wheel-nudge-DGrNzWuE.d.ts +0 -29
  49. package/dist/wheel-nudge-DGrNzWuE.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"slider-input-De4eoT11.js","names":["#currentCrossPx","#currentLongPx","#onKeyDown","#ensureUserGradientDefs","#applySwipeFromPointer","#relativeFromTrackPos","#lastInteractedHandle","#dragHandle","#setSingleValueFromRelative","#dragging","#activePointerId","#dragStartClientPos","#poleValueAtDragStart","#onPointerMove","#onPointerUp","#getRelativeValueA","#getRelativeValueB","#poleA","#poleB","#getRelativeValueC","#lowKey","#highKey","#lengthDragStart","#lengthDragLowKey","#lengthDragHighKey","#lengthDragLength","#lengthDragStartLow","#lengthDragStartRelative","#setDualOrTripleValueFromRelative","#applyLengthDragFromRelative","#onPointerMoveCursor","#lastPointerClient","#poleC","#low","#stepHandleByRelativeDelta","#cursorAtRelative","#lanes","#onHostKeyDown","#onSwipePointerDown","#onSwipePointerMove","#onSwipePointerEnter","#syncGradientDefs","#gradientObserver","#sizeObserver","#onHostResize","#userGradientDefs","#quantise","#isUserInteraction","#applySingleStyleValueLane","#emitInputAndChange","#resolvePoleChange","#poles","#syncPoleProperties","#detectChanged","#high","#hasInitialisedValueC","#getEffectiveValueMin","#buildInputDetail","#buildChangeDetail","#scheduleChangeEvent","#fireChangeEvent","#changeDebounceTimer","#laneWidthNumber","#currentLanePxMax","#getCssVar","#dotRadiusPx","#dotRadiusFraction","#activeMarkerStyles","#contentFraction","#currentInsetStart","#currentInsetEnd","#relativeFromSwipePointer","#currentCross","#getCssVarColor","#laneStrokePx","#circleRadiiUnits","#measureLanes","#computeCross","#computeInsets","#isMultiHandle","#renderHandleGroup","#renderValueMarker","#viewBox","#onPointerDown","#onPointerLeaveCursor","#onFocusIn","#renderTrack","#renderLane","#renderMidpointMarker","customElement"],"sources":["../src/slider-input/svg-utils.ts","../src/slider-input/slider-input.ts"],"sourcesContent":["/**\n * SVG utilities for the slider-input component.\n * Linear track geometry helpers (mirrors radial-input's svg-utils for arc maths).\n */\n\nimport type { SliderOrientation, SliderSingleStyle } from './types.js';\n\nexport interface Point {\n x: number;\n y: number;\n}\n\n/**\n * Track geometry in viewBox units.\n * Horizontal: trackStart = insetStart, trackEnd = 100 - insetEnd (along x).\n * Vertical: trackStart = insetStart, trackEnd = 100 - insetEnd (along y,\n * top = high). \"Start\" is the low-value end (left / bottom).\n */\nexport interface TrackBounds {\n trackStart: number;\n trackEnd: number;\n /** Centre along the long axis (midpoint of the drawn track span). */\n centre: number;\n /** Cross-axis size of the viewBox (dynamic per instance; CROSS is the legacy default). */\n cross: number;\n /** Centre along the cross axis (cross / 2). */\n crossCentre: number;\n}\n\nexport const INSET = 5;\nexport const LONG = 100;\nexport const CROSS = 24;\n\n/**\n * Get the track bounds in viewBox units for a given orientation.\n *\n * `cross` is the dynamic cross-axis size (see `SliderInputElement`'s\n * cross computation); `insetStart`/`insetEnd` are the long-axis end\n * paddings (low-value end / high-value end). LONG stays fixed at 100.\n */\nexport function getTrackBounds(\n orientation: SliderOrientation,\n cross: number = CROSS,\n insetStart: number = INSET,\n insetEnd: number = INSET,\n): TrackBounds {\n const trackStart = insetStart;\n const trackEnd = LONG - insetEnd;\n if (orientation === `horizontal`) {\n return {\n trackStart,\n trackEnd,\n centre: (trackStart + trackEnd) / 2,\n cross,\n crossCentre: cross / 2,\n };\n }\n // Vertical: viewBox is 0 0 cross LONG; the track runs along the y axis from\n // insetStart to LONG-insetEnd. `centre` is the middle of the drawn track\n // span; `crossCentre` is the middle of the cross (x) axis.\n return {\n trackStart,\n trackEnd,\n centre: (trackStart + trackEnd) / 2,\n cross,\n crossCentre: cross / 2,\n };\n}\n\n/**\n * Map a relative value (0..1) to a leader point on the track for the given\n * orientation and single-style.\n *\n * Range: grows from trackStart to trackEnd.\n * Bipolar: track centre is 0.5; values spread from centre outward.\n * Unipolar: spread symmetrically around centre.\n *\n * For vertical orientation, higher values are toward the top of the track,\n * matching the spec (\"higher values → top of track\").\n */\nexport function valueToPosition(\n relativeValue: number,\n singleStyle: SliderSingleStyle,\n trackBounds: TrackBounds,\n orientation: SliderOrientation,\n): Point {\n const span = trackBounds.trackEnd - trackBounds.trackStart;\n const centre = trackBounds.centre;\n const crossCentre = trackBounds.crossCentre;\n\n let pos: number;\n if (singleStyle === `range`) {\n pos = trackBounds.trackStart + relativeValue * span;\n } else if (singleStyle === `bipolar`) {\n // Mid (0.5) -> centre; <0.5 below centre, >0.5 above.\n if (relativeValue <= 0.5) {\n const t = relativeValue / 0.5;\n pos = trackBounds.trackStart + t * (centre - trackBounds.trackStart);\n } else {\n const t = (relativeValue - 0.5) / 0.5;\n pos = centre + t * (trackBounds.trackEnd - centre);\n }\n } else {\n // unipolar: spread symmetrically around centre\n const halfLen = (relativeValue * span) / 2;\n pos = centre + halfLen;\n }\n\n if (orientation === `horizontal`) {\n return { x: pos, y: crossCentre };\n }\n // Vertical: higher values toward top (smaller y). `pos` is a value along the\n // long axis (0..LONG), so the SVG y coordinate (0 at top) is LONG - pos.\n return { x: crossCentre, y: LONG - pos };\n}\n\n/**\n * Get the segment endpoints for a 'value' lane. The lane is drawn from\n * the lane's lower relative value to its upper relative value.\n *\n * For 'range' and 'bipolar' styles, the endpoints are obtained by mapping\n * each value through `valueToPosition`. For 'unipolar', the bar is centred\n * on the track centre with length proportional to valueMax (valueMin is\n * ignored), matching the spec: \"spreads symmetrically around centre\".\n */\nexport function getValueSegment(\n valueMin: number,\n valueMax: number,\n singleStyle: SliderSingleStyle,\n trackBounds: TrackBounds,\n orientation: SliderOrientation,\n): { start: Point; end: Point } {\n if (singleStyle === `unipolar`) {\n const span = trackBounds.trackEnd - trackBounds.trackStart;\n const centre = trackBounds.centre;\n const crossCentre = trackBounds.crossCentre;\n const halfLen = (valueMax * span) / 2;\n if (orientation === `horizontal`) {\n return {\n start: { x: centre - halfLen, y: crossCentre },\n end: { x: centre + halfLen, y: crossCentre },\n };\n }\n // Vertical: spread the bar symmetrically around the track centre along y.\n return {\n start: { x: crossCentre, y: centre - halfLen },\n end: { x: crossCentre, y: centre + halfLen },\n };\n }\n\n return {\n start: valueToPosition(valueMin, singleStyle, trackBounds, orientation),\n end: valueToPosition(valueMax, singleStyle, trackBounds, orientation),\n };\n}\n\n/**\n * Get the segment endpoints for an 'anchored' lane. The lane is centered\n * on the current value, with length controlled by laneValue (0..1).\n */\nexport function getAnchoredSegment(\n relativeValue: number,\n laneValue: number,\n singleStyle: SliderSingleStyle,\n trackBounds: TrackBounds,\n orientation: SliderOrientation,\n): { start: Point; end: Point } {\n const span = trackBounds.trackEnd - trackBounds.trackStart;\n const halfLen = (laneValue * span) / 2;\n\n // For unipolar, the value represents the size of a bar centred on the track\n // centre, not a spatial position. Anchor the lane to the track centre so it\n // follows the value's \"magnitude\" rather than the bar's right-end.\n // Mirrors radial-input's getAnchoredArcAngles for unipolar.\n // `centre.x` is along the track axis; `centre.y` is perpendicular. For\n // horizontal that's (LONG/2, cross/2); for vertical that's (cross/2, LONG/2).\n const centre = singleStyle === `unipolar`\n ? (orientation === `horizontal`\n ? { x: trackBounds.centre, y: trackBounds.crossCentre }\n : { x: trackBounds.crossCentre, y: trackBounds.centre })\n : valueToPosition(relativeValue, singleStyle, trackBounds, orientation);\n\n // Compute along-axis offsets\n let startPos: number;\n let endPos: number;\n if (orientation === `horizontal`) {\n startPos = centre.x - halfLen;\n endPos = centre.x + halfLen;\n } else {\n startPos = centre.y - halfLen;\n endPos = centre.y + halfLen;\n }\n\n const start = orientation === `horizontal`\n ? { x: startPos, y: centre.y }\n : { x: centre.x, y: startPos };\n const end = orientation === `horizontal`\n ? { x: endPos, y: centre.y }\n : { x: centre.x, y: endPos };\n return { start, end };\n}\n\n/**\n * Generate an SVG path string for a straight line. Returns '' for a\n * zero-length segment (start ≈ end), mirroring the radial-input arc\n * helper's edge case.\n */\nexport function generateLinePath(start: Point, end: Point): string {\n if (Math.abs(start.x - end.x) < 0.001 && Math.abs(start.y - end.y) < 0.001) {\n return ``;\n }\n return `M ${start.x} ${start.y} L ${end.x} ${end.y}`;\n}\n\n/**\n * Generate a closed SVG `<path>` for a filled rectangle (used for filled\n * lane segments). `halfWidth` is the perpendicular half-thickness; `perpOffset`\n * shifts the rect perpendicularly from the track centreline.\n */\nexport function generateRectPath(\n start: Point,\n end: Point,\n halfWidth: number,\n perpOffset: number,\n orientation: SliderOrientation,\n): string {\n // Direction vector along the track\n const dx = end.x - start.x;\n const dy = end.y - start.y;\n const len = Math.sqrt(dx * dx + dy * dy);\n if (len < 0.001)\n return ``;\n\n // Unit perpendicular\n const perpX = -dy / len;\n const perpY = dx / len;\n\n // Inset corners slightly so the rect's ends don't extend past the start/end\n const insetX = (dx / len) * halfWidth;\n const insetY = (dy / len) * halfWidth;\n\n const sIn = { x: start.x + insetX, y: start.y + insetY };\n const eIn = { x: end.x - insetX, y: end.y - insetY };\n\n const c1 = { x: sIn.x + perpX * (halfWidth + perpOffset), y: sIn.y + perpY * (halfWidth + perpOffset) };\n const c2 = { x: eIn.x + perpX * (halfWidth + perpOffset), y: eIn.y + perpY * (halfWidth + perpOffset) };\n const c3 = { x: eIn.x + perpX * (-halfWidth + perpOffset), y: eIn.y + perpY * (-halfWidth + perpOffset) };\n const c4 = { x: sIn.x + perpX * (-halfWidth + perpOffset), y: sIn.y + perpY * (-halfWidth + perpOffset) };\n\n // Silence unused-orientation warning — kept for API parity\n void orientation;\n\n return `M ${c1.x} ${c1.y} L ${c2.x} ${c2.y} L ${c3.x} ${c3.y} L ${c4.x} ${c4.y} Z`;\n}\n\n/**\n * Clamp `value` to the [min, max] range.\n */\nexport function clamp(value: number, min: number, max: number): number {\n return Math.min(Math.max(value, min), max);\n}\n\n/**\n * Linear-reinterpolate `value` from [fromMin, fromMax] to [toMin, toMax].\n */\nexport function scale(\n value: number,\n fromMin: number,\n fromMax: number,\n toMin: number,\n toMax: number,\n): number {\n if (fromMax === fromMin)\n return toMin;\n const normalized = (value - fromMin) / (fromMax - fromMin);\n return toMin + normalized * (toMax - toMin);\n}\n\n/**\n * Convert a relative value (0..1) to an absolute value in the min..max range.\n */\nexport function relativeToValue(\n relativeValue: number,\n min: number,\n max: number,\n): number {\n return scale(relativeValue, 0, 1, min, max);\n}\n\n/**\n * Convert an absolute value to a relative (0..1) position.\n */\nexport function valueToRelative(\n value: number,\n min: number,\n max: number,\n): number {\n return scale(value, min, max, 0, 1);\n}\n\n/**\n * Convert a pointer client position (clientX or clientY depending on\n * orientation) to a relative value (0..1) given the host element's\n * bounding rect on the long axis.\n */\nexport function clientPosToRelative(\n clientPos: number,\n hostStart: number,\n hostSize: number,\n): number {\n if (hostSize <= 0)\n return 0;\n return clamp((clientPos - hostStart) / hostSize, 0, 1);\n}\n\n/**\n * Inverse: relative value (0..1) → client position offset from host start.\n */\nexport function relativeToClientPos(\n relativeValue: number,\n hostStart: number,\n hostSize: number,\n): number {\n return hostStart + relativeValue * hostSize;\n}\n","/* eslint-disable ts/no-unsafe-declaration-merging */\n/**\n * <ixfx-slider-input> — linear SVG-based slider.\n *\n * Mirrors `ixfx-radial-input` as closely as possible, swapping arc geometry\n * for a linear track. Supports horizontal and vertical orientations, three\n * value modes (single/dual/triple), triple-segment \"value\" lanes, and\n * `value-drag` length-drag gestures for dual/triple modes.\n *\n * Attributes / properties\n * value-a, value-b, value-c — primary/secondary/tertiary handle values\n * min, max — value range\n * step, stops — keyboard/wheel/pointer step resolution\n * value-mode — 'single' | 'dual' | 'triple'\n * single-style — 'range' | 'bipolar' | 'unipolar' (single mode only)\n * orientation — 'horizontal' | 'vertical'\n * marker-style — 'needle' | 'dot' | 'none'\n * crossover — 'none' | 'allow' (dual/triple modes)\n * value-drag — 'none' | 'stop' | 'flex' (dual/triple modes)\n * value-min — minimum gap between A and B (dual/triple modes)\n * disabled — boolean\n * lighttouch — boolean — wheel adjusts value on hover instead of requiring focus\n * swipeable — boolean — swipe-to-draw gesture (no pointer capture,\n * enter/move with buttons pressed sets value, for\n * step-sequencer layouts; mirrors ixfx-range-input)\n *\n * Events\n * input — fires continuously during user interaction\n * change — debounced 150ms after interaction; immediate for programmatic\n *\n * Mouse wheel (via WheelNudgeMixin): up = increase, down = decrease. In multi-handle\n * modes wheel targets the last-interacted-with handle (focus or pointerdown).\n * Shift+wheel halves the step. See docs/infra-mousewheel.md.\n */\nimport type { PropertyValues } from 'lit';\nimport type { WheelDirection } from '../mixins/wheel-nudge.js';\nimport type { Point } from './svg-utils.js';\nimport type {\n SliderChangedField,\n SliderCrossover,\n SliderHandleKey,\n SliderInputChangeDetail,\n SliderInputElementEventMap,\n SliderInputInputDetail,\n SliderLaneData,\n SliderLaneType,\n SliderMarkerStyle,\n SliderOrientation,\n SliderSingleStyle,\n SliderValueCFollow,\n SliderValueDrag,\n SliderValueMode,\n} from './types.js';\nimport { css, html, LitElement, svg } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { resolveAxisStep } from '../keyboard.js';\nimport { WheelNudgeMixin } from '../mixins/wheel-nudge.js';\nimport { themeFallbacks } from '../styles/fallbacks.js';\nimport { prominenceStyles } from '../styles/prominence.js';\nimport { safeCustomElement as customElement } from '../util/custom-elements.js';\nimport {\n clamp,\n CROSS,\n generateLinePath,\n getAnchoredSegment,\n getTrackBounds,\n getValueSegment,\n INSET,\n LONG,\n scale,\n valueToPosition,\n valueToRelative,\n} from './svg-utils.js';\n\nconst HANDLE_HIT_RADIUS = 0.06;\nconst DEFAULT_VALUE_MIN_FRACTION = 0.01;\nconst CHANGE_DEBOUNCE_MS = 150;\n\n@customElement(`ixfx-slider-input`)\nexport class SliderInputElement extends WheelNudgeMixin(LitElement) {\n // ─── Public properties ───────────────────────────────────────────────\n @property({ type: Number, attribute: `value-a` })\n valueA = 50;\n\n @property({ type: Number, attribute: `value-b` })\n valueB = 0;\n\n /**\n * Triple-mode middle handle. `undefined` until first willUpdate, then\n * defaulted to the midpoint of valueA/valueB (matching radial-input's\n * deferred lane-correction pattern).\n */\n @property({ type: Number, attribute: `value-c` })\n valueC: number | undefined = undefined;\n\n @property({ type: Number })\n min = 0;\n\n @property({ type: Number })\n max = 100;\n\n @property({ type: Number })\n step: number | undefined = undefined;\n\n @property({ type: Number })\n stops: number | undefined = undefined;\n\n @property({ type: String, attribute: `value-mode` })\n valueMode: SliderValueMode = `single`;\n\n @property({ type: String, attribute: `single-style` })\n singleStyle: SliderSingleStyle = `range`;\n\n @property({ type: String })\n orientation: SliderOrientation = `horizontal`;\n\n @property({ type: String, attribute: `marker-style` })\n markerStyle: SliderMarkerStyle = `needle`;\n\n /**\n * Optional marker-style override for the C handle in triple mode. Lets\n * consumers give C a different shape (e.g. dot) from the global\n * `markerStyle` applied to A/B.\n */\n @property({ type: String, attribute: `marker-style-c` })\n markerStyleC: SliderMarkerStyle | undefined = undefined;\n\n @property({ type: String })\n crossover: SliderCrossover = `allow`;\n\n @property({ type: String, attribute: `value-drag` })\n valueDrag: SliderValueDrag = `none`;\n\n /**\n * In triple mode, how the C handle reacts when A or B moves the [A, B]\n * band. `none` (default): C keeps its value unless pushed outside the\n * new band. `proportional`: C is re-anchored at the same fractional\n * position it had within the *old* band, so it moves with A/B.\n */\n @property({ type: String, attribute: `value-c-follow` })\n valueCFollow: SliderValueCFollow = `none`;\n\n @property({ type: Number, attribute: `value-min` })\n valueMin = 1;\n\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Swipe-to-draw gesture, mirroring `ixfx-range-input[swipeable]`.\n * When active, pressing down on the slider or entering it while the\n * pointer is pressed sets the value from the cursor coordinate.\n * Pointer capture is NOT held, so the cursor can move to adjacent\n * swipeable sliders and update them too (step-sequencer style).\n * Leaving the slider (above/below for horizontal, left/right for\n * vertical) freezes the value; re-entering re-engages.\n *\n * Single mode sets value-A directly. Dual/triple modes move the\n * nearest handle to the cursor.\n */\n @property({ type: Boolean, reflect: true })\n swipeable = false;\n\n // ─── Internal state ──────────────────────────────────────────────────\n #lanes: Map<string, SliderLaneData> = new Map();\n\n /** Raw pole values: independent of which is \"low\" or \"high\". */\n #poleA = 50;\n #poleB = 0;\n #poleC: number | undefined = undefined;\n\n #dragging = false;\n /** Pointer ID being tracked (fixes radial-input's hardcoded pointerId). */\n #activePointerId: number | undefined = undefined;\n #dragStartClientPos = 0;\n #poleValueAtDragStart = 0;\n /** Which handle is currently being dragged, or 'length' for segment drag. */\n #dragHandle: SliderHandleKey | `length` | undefined = undefined;\n /** Snapshotted poles at length-drag start. */\n #lengthDragStart: { poleA: number; poleB: number } | undefined = undefined;\n /** Track the low/high identity at length-drag start (so we know which raw pole gets which end). */\n #lengthDragLowKey: SliderHandleKey | undefined = undefined;\n #lengthDragHighKey: SliderHandleKey | undefined = undefined;\n #lengthDragLength = 0;\n #lengthDragStartLow = 0;\n /**\n * Where the pointer was when the length drag began (in host-relative\n * 0..1 terms). Preserves the grab offset so dragging the bar doesn't snap\n * its low edge under the cursor.\n */\n #lengthDragStartRelative = 0;\n\n /** The handle that last received direct interaction (pointerdown/keydown/wheel/focus). */\n #lastInteractedHandle: SliderHandleKey = `a`;\n\n /**\n * Last pointer client position seen by #onPointerMoveCursor, used to\n * recompute the cursor after a drag ends (without waiting for a fresh\n * pointermove).\n */\n #lastPointerClient = { x: 0, y: 0 };\n\n #changeDebounceTimer: number | undefined = undefined;\n #isUserInteraction = false;\n #hasInitialisedValueC = false;\n\n /**\n * Holds `<linearGradient>`/`<radialGradient>` elements authored as light-DOM\n * children of this element, once relocated into the shadow root (see\n * `#syncGradientDefs`). Lets consumers reference `url(#id)` paint servers\n * from `--lane-*-color` / `--track-color` etc. — CSS custom properties\n * pierce the shadow boundary, but `url(#id)` paint-server *resolution* does\n * not, so the gradient definitions themselves must physically live inside\n * this element's shadow root to be resolvable by lanes/track painted there.\n */\n #userGradientDefs: SVGDefsElement | undefined;\n #gradientObserver: MutationObserver | undefined;\n /**\n * Lane strokes are resolved to screen px per render (see #laneStrokePx), so\n * a host resize must re-render to keep them (and the measured box) exact.\n */\n #sizeObserver: ResizeObserver | undefined;\n\n // ─── Construction ───────────────────────────────────────────────────\n constructor() {\n super();\n // Make the host focusable so users can Tab to the slider. The actual\n // focus indicator + keyboard listener are on the inner <svg> (which\n // sits inside the shadow DOM), but the host needs an HTML tabindex\n // attribute to be reachable from the document's tab order.\n if (!this.disabled) {\n this.setAttribute(`tabindex`, `0`);\n }\n this.#lanes.set(`track`, {\n key: `track`,\n value: 1,\n type: `fixed`,\n offset: 0,\n width: 0.16,\n });\n this.#lanes.set(`value`, {\n key: `value`,\n valueMin: 0,\n valueMax: 0,\n type: `value`,\n offset: 0,\n width: 0.24,\n });\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n this.setAttribute(`tabindex`, this.disabled ? `-1` : `0`);\n // Listen for keydown on the host itself (in addition to the SVG in\n // shadow DOM) so the keyboard handler fires when the host has focus\n // from Tab navigation. The host is the focusable element (via its\n // tabindex attribute set in the constructor); events fired while the\n // host is focused don't reach the inner <svg>'s lit listener.\n this.addEventListener(`keydown`, this.#onHostKeyDown as EventListener);\n this.addEventListener(`pointerdown`, this.#onSwipePointerDown as EventListener);\n this.addEventListener(`pointermove`, this.#onSwipePointerMove as EventListener);\n this.addEventListener(`pointerenter`, this.#onSwipePointerEnter as EventListener);\n this.#syncGradientDefs();\n this.#gradientObserver = new MutationObserver(this.#syncGradientDefs);\n this.#gradientObserver.observe(this, { childList: true, subtree: true });\n this.#sizeObserver = new ResizeObserver(this.#onHostResize);\n this.#sizeObserver.observe(this);\n }\n\n #onHostResize = (): void => {\n const rect = this.getBoundingClientRect();\n const crossPx = this.orientation === `vertical` ? rect.width : rect.height;\n const longPx = this.orientation === `vertical` ? rect.height : rect.width;\n if (crossPx !== this.#currentCrossPx || longPx !== this.#currentLongPx) {\n this.requestUpdate();\n }\n };\n\n #onHostKeyDown = (event: KeyboardEvent): void => {\n this.#onKeyDown(event);\n };\n\n // ─── Gradient defs relocation ───────────────────────────────────────\n /**\n * Lazily creates the inert `<svg><defs>` carrier that user-authored\n * gradients get moved into. Kept entirely outside Lit's managed template —\n * it's a plain sibling of the interactive `<svg class=\"slider-svg\">` inside\n * the shadow root, so `url(#id)` references from lane/track paint\n * properties resolve against it regardless of render() re-runs.\n */\n #ensureUserGradientDefs(): SVGDefsElement {\n if (this.#userGradientDefs)\n return this.#userGradientDefs;\n const svgNs = `http://www.w3.org/2000/svg`;\n const carrier = document.createElementNS(svgNs, `svg`);\n carrier.setAttribute(`width`, `0`);\n carrier.setAttribute(`height`, `0`);\n carrier.setAttribute(`aria-hidden`, `true`);\n // Inline (not classed) so no shadow stylesheet rule — including a broad\n // `svg { width: 100%; ... }` selector — can ever stretch this carrier\n // into a click-blocking overlay; `:host` has no explicit `position`, so\n // an accidentally-enlarged `position: absolute` box here would escape to\n // whatever ancestor up the *light* DOM happens to be positioned.\n carrier.style.cssText = `position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none;`;\n const defs = document.createElementNS(svgNs, `defs`) as SVGDefsElement;\n carrier.append(defs);\n this.renderRoot.append(carrier);\n this.#userGradientDefs = defs;\n return defs;\n }\n\n /**\n * Moves any `<linearGradient>`/`<radialGradient>` authored as light-DOM\n * descendants of this element into the shadow root (see\n * `#ensureUserGradientDefs`). This *reparents* rather than clones the\n * nodes, so consumers get normal, live SVG paint-server semantics — e.g.\n * animating a `<stop>`'s `stop-color` \"just works\" — with no gradient\n * management on the component's part. Idempotent: once moved, a node is no\n * longer a light-DOM descendant of `this`, so it won't be found again.\n */\n #syncGradientDefs = (): void => {\n const found = this.querySelectorAll(`linearGradient, radialGradient`);\n if (found.length === 0)\n return;\n const defs = this.#ensureUserGradientDefs();\n for (const node of found) {\n defs.append(node);\n }\n };\n\n // ─── Lane management API ────────────────────────────────────────────\n addLane(\n key: string,\n options?: {\n value?: number;\n valueMin?: number;\n valueMax?: number;\n type?: SliderLaneType;\n offset?: number;\n width?: number;\n },\n ): void {\n const rel = this.#getRelativeValueA();\n this.#lanes.set(key, {\n key,\n value: options?.value ?? rel,\n valueMin: options?.valueMin ?? 0,\n valueMax: options?.valueMax ?? rel,\n type: options?.type ?? `value`,\n offset: options?.offset ?? 0,\n width: options?.width ?? 0.1,\n });\n this.requestUpdate();\n }\n\n setLaneValue(key: string, value: number): void {\n const lane = this.#lanes.get(key);\n if (lane) {\n lane.value = clamp(value, 0, 1);\n this.requestUpdate();\n }\n }\n\n setLaneRange(key: string, valueMin: number, valueMax: number): void {\n const lane = this.#lanes.get(key);\n if (!lane)\n return;\n const lo = clamp(Math.min(valueMin, valueMax), 0, 1);\n const hi = clamp(Math.max(valueMin, valueMax), 0, 1);\n lane.valueMin = lo;\n lane.valueMax = hi;\n this.requestUpdate();\n }\n\n removeLane(key: string): void {\n this.#lanes.delete(key);\n this.requestUpdate();\n }\n\n getLanes(): ReadonlyMap<string, SliderLaneData> {\n return new Map(this.#lanes);\n }\n\n getLane(key: string): SliderLaneData | undefined {\n return this.#lanes.get(key);\n }\n\n // ─── Derived getters ────────────────────────────────────────────────\n #getRelativeValueA(): number {\n return valueToRelative(this.valueA, this.min, this.max);\n }\n\n #getRelativeValueB(): number {\n return valueToRelative(this.valueB, this.min, this.max);\n }\n\n #getRelativeValueC(): number {\n const c = this.valueC ?? (this.#poleA + this.#poleB) / 2;\n return valueToRelative(c, this.min, this.max);\n }\n\n #low(): number {\n return Math.min(this.#poleA, this.#poleB);\n }\n\n #high(): number {\n return Math.max(this.#poleA, this.#poleB);\n }\n\n #lowKey(): SliderHandleKey {\n return this.#poleA <= this.#poleB ? `a` : `b`;\n }\n\n #highKey(): SliderHandleKey {\n return this.#poleA > this.#poleB ? `a` : `b`;\n }\n\n /**\n * Effective `valueMin` in value units between A and B. Mirrors radial-input's\n * default of 1% of max-min when the property holds the literal minimum.\n */\n #getEffectiveValueMin(): number {\n const range = this.max - this.min;\n if (this.valueMin && this.valueMin > 0)\n return this.valueMin;\n return range * DEFAULT_VALUE_MIN_FRACTION;\n }\n\n #quantise(value: number): number {\n if (this.stops && this.stops > 1) {\n const range = this.max - this.min;\n const step = range / this.stops;\n const snapped = Math.round((value - this.min) / step) * step + this.min;\n return clamp(snapped, this.min, this.max);\n }\n if (this.step !== undefined && this.step > 0) {\n const snapped = Math.round((value - this.min) / this.step) * this.step + this.min;\n return clamp(snapped, this.min, this.max);\n }\n return value;\n }\n\n // ─── Value setting ──────────────────────────────────────────────────\n #setSingleValueFromRelative(relativeValue: number, isUserInteraction = false): void {\n const newValue = scale(relativeValue, 0, 1, this.min, this.max);\n const clampedValue = this.#quantise(clamp(newValue, this.min, this.max));\n\n if (clampedValue === this.valueA)\n return;\n\n const previousValue = this.valueA;\n this.valueA = clampedValue;\n this.#poleA = clampedValue;\n this.#isUserInteraction = isUserInteraction;\n\n const valueLane = this.#lanes.get(`value`);\n if (valueLane && valueLane.type === `value`) {\n this.#applySingleStyleValueLane(valueLane, this.#getRelativeValueA());\n }\n\n if (this.hasAttribute(`data-tooltip-live`)) {\n const percentage = Math.round(this.#getRelativeValueA() * 100);\n this.setAttribute(`data-tooltip`, `${percentage}%`);\n }\n\n this.#emitInputAndChange(\n { previousValue },\n isUserInteraction,\n );\n }\n\n #setDualOrTripleValueFromRelative(\n relativeValue: number,\n handle: SliderHandleKey,\n isUserInteraction = false,\n ): void {\n const newValue = scale(relativeValue, 0, 1, this.min, this.max);\n const clamped = clamp(newValue, this.min, this.max);\n\n const result = this.#resolvePoleChange(handle, clamped, this.#lastInteractedHandle);\n if (!result)\n return;\n\n const previous = { ...this.#poles() };\n this.#poleA = result.poleA;\n this.#poleB = result.poleB;\n if (result.poleC !== undefined)\n this.#poleC = result.poleC;\n this.#syncPoleProperties();\n\n const changed = this.#detectChanged(previous, this.#poles());\n this.#isUserInteraction = isUserInteraction;\n\n const valueLane = this.#lanes.get(`value`);\n if (valueLane && valueLane.type === `value`) {\n valueLane.valueMin = valueToRelative(this.#low(), this.min, this.max);\n valueLane.valueMax = valueToRelative(this.#high(), this.min, this.max);\n }\n\n if (this.hasAttribute(`data-tooltip-live`)) {\n const percentage = Math.round(valueToRelative(this.#high(), this.min, this.max) * 100);\n this.setAttribute(`data-tooltip`, `${percentage}%`);\n }\n\n this.#emitInputAndChange(\n {\n previousValue: Math.max(previous.poleA, previous.poleB),\n previousValueMin: Math.min(previous.poleA, previous.poleB),\n previousValueMax: Math.max(previous.poleA, previous.poleB),\n previousValueC: previous.poleC,\n },\n isUserInteraction,\n changed,\n );\n }\n\n #poles(): { poleA: number; poleB: number; poleC: number | undefined } {\n return { poleA: this.#poleA, poleB: this.#poleB, poleC: this.#poleC };\n }\n\n #syncPoleProperties(): void {\n this.valueA = this.#poleA;\n this.valueB = this.#poleB;\n if (this.valueMode === `triple` && this.#poleC !== undefined) {\n this.valueC = this.#poleC;\n this.#hasInitialisedValueC = true;\n }\n }\n\n #resolvePoleChange(\n handle: SliderHandleKey,\n proposed: number,\n originalHandle: SliderHandleKey,\n ): { poleA: number; poleB: number; poleC?: number } | null {\n let poleA = this.#poleA;\n let poleB = this.#poleB;\n let poleC = this.#poleC;\n\n if (this.valueMode === `triple` && handle === `c`) {\n const lo = this.#low();\n const hi = this.#high();\n const clamped = clamp(proposed, lo, hi);\n const quantised = this.#quantise(clamped);\n if (quantised === this.#poleC)\n return null;\n return { poleA, poleB, poleC: quantised };\n }\n\n const gap = this.#getEffectiveValueMin();\n const other = handle === `a` ? poleB : poleA;\n\n let desired = this.#quantise(clamp(proposed, this.min, this.max));\n\n if (this.crossover === `none`) {\n // Pin to the side this handle started on relative to the other one.\n const startedLow = (handle === `a` ? poleA : poleB) <= other;\n if (startedLow) {\n desired = Math.min(desired, other - gap);\n } else {\n desired = Math.max(desired, other + gap);\n }\n } else {\n // 'allow' — snap into the forbidden band, but allow crossover beyond.\n if (desired > other - gap && desired < other + gap) {\n // Within forbidden band; snap to nearer edge.\n const distToLow = Math.abs(desired - (other - gap));\n const distToHigh = Math.abs(desired - (other + gap));\n desired = distToLow <= distToHigh ? other - gap : other + gap;\n }\n }\n\n // Final clamp to [min, max]\n desired = clamp(desired, this.min, this.max);\n\n if (handle === `a`) {\n if (desired === poleA)\n return null;\n poleA = desired;\n } else {\n if (desired === poleB)\n return null;\n poleB = desired;\n }\n\n // Triple-mode: re-anchor C relative to the new [low, high]\n if (this.valueMode === `triple` && poleC !== undefined) {\n const oldLo = Math.min(this.#poleA, this.#poleB);\n const oldHi = Math.max(this.#poleA, this.#poleB);\n const newLo = Math.min(poleA, poleB);\n const newHi = Math.max(poleA, poleB);\n if (this.valueCFollow === `proportional` && oldHi > oldLo) {\n const frac = clamp((poleC - oldLo) / (oldHi - oldLo), 0, 1);\n poleC = newLo + frac * (newHi - newLo);\n } else {\n if (poleC < newLo)\n poleC = newLo;\n if (poleC > newHi)\n poleC = newHi;\n }\n }\n\n // Avoid unused-warning for originalHandle (used in caller for tie-breaking)\n void originalHandle;\n return { poleA, poleB, poleC };\n }\n\n #detectChanged(\n prev: { poleA: number; poleB: number; poleC: number | undefined },\n curr: { poleA: number; poleB: number; poleC: number | undefined },\n ): SliderChangedField {\n const aDiff = prev.poleA !== curr.poleA;\n const bDiff = prev.poleB !== curr.poleB;\n const cDiff = prev.poleC !== curr.poleC;\n\n if (this.valueMode === `triple`) {\n if (aDiff && bDiff && !cDiff)\n return `both`;\n if (aDiff && bDiff)\n return `both`;\n if (aDiff)\n return `min`;\n if (bDiff)\n return `max`;\n if (cDiff)\n return `c`;\n return `min`;\n }\n if (aDiff && bDiff)\n return `both`;\n if (aDiff)\n return `min`;\n if (bDiff)\n return `max`;\n return `min`;\n }\n\n #emitInputAndChange(\n previous: {\n previousValue: number;\n previousValueMin?: number;\n previousValueMax?: number;\n previousValueC?: number;\n },\n isUserInteraction: boolean,\n changed?: SliderChangedField,\n ): void {\n const detailInput = this.#buildInputDetail(changed);\n const detailChange = this.#buildChangeDetail(previous, changed);\n\n if (isUserInteraction) {\n this.dispatchEvent(\n new CustomEvent<SliderInputInputDetail>(`input`, {\n detail: detailInput,\n bubbles: true,\n composed: true,\n }),\n );\n this.#scheduleChangeEvent(detailChange);\n } else {\n this.#fireChangeEvent(detailChange);\n }\n }\n\n #buildInputDetail(changed?: SliderChangedField): SliderInputInputDetail {\n if (this.valueMode === `single`) {\n return {\n value: this.valueA,\n valueRelative: this.#getRelativeValueA(),\n };\n }\n\n const lo = this.#low();\n const hi = this.#high();\n const valueMinRel = valueToRelative(lo, this.min, this.max);\n const valueMaxRel = valueToRelative(hi, this.min, this.max);\n\n if (this.valueMode === `triple` && this.#poleC !== undefined) {\n return {\n value: hi,\n valueRelative: valueMaxRel,\n valueMin: lo,\n valueMax: hi,\n valueMinRelative: valueMinRel,\n valueMaxRelative: valueMaxRel,\n valueC: this.#poleC,\n valueCRelative: valueToRelative(this.#poleC, this.min, this.max),\n changed,\n };\n }\n\n return {\n value: hi,\n valueRelative: valueMaxRel,\n valueMin: lo,\n valueMax: hi,\n valueMinRelative: valueMinRel,\n valueMaxRelative: valueMaxRel,\n changed,\n };\n }\n\n #buildChangeDetail(\n previous: {\n previousValue: number;\n previousValueMin?: number;\n previousValueMax?: number;\n previousValueC?: number;\n },\n changed?: SliderChangedField,\n ): SliderInputChangeDetail {\n if (this.valueMode === `single`) {\n return {\n value: this.valueA,\n valueRelative: this.#getRelativeValueA(),\n previousValue: previous.previousValue,\n };\n }\n\n const lo = this.#low();\n const hi = this.#high();\n const valueMaxRel = valueToRelative(hi, this.min, this.max);\n\n if (this.valueMode === `triple` && this.#poleC !== undefined) {\n return {\n value: hi,\n valueRelative: valueMaxRel,\n previousValue: previous.previousValue,\n valueMin: lo,\n valueMax: hi,\n previousValueMin: previous.previousValueMin ?? lo,\n previousValueMax: previous.previousValueMax ?? hi,\n valueC: this.#poleC,\n previousValueC: previous.previousValueC ?? this.#poleC,\n changed,\n };\n }\n\n return {\n value: hi,\n valueRelative: valueMaxRel,\n previousValue: previous.previousValue,\n valueMin: lo,\n valueMax: hi,\n previousValueMin: previous.previousValueMin ?? lo,\n previousValueMax: previous.previousValueMax ?? hi,\n changed,\n };\n }\n\n #scheduleChangeEvent(detail: SliderInputChangeDetail): void {\n if (this.#changeDebounceTimer !== undefined) {\n clearTimeout(this.#changeDebounceTimer);\n }\n this.#changeDebounceTimer = window.setTimeout(() => {\n this.#fireChangeEvent(detail);\n this.#changeDebounceTimer = undefined;\n }, CHANGE_DEBOUNCE_MS);\n }\n\n #fireChangeEvent(detail: SliderInputChangeDetail): void {\n this.dispatchEvent(\n new CustomEvent<SliderInputChangeDetail>(`change`, {\n detail,\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n // ─── Dynamic cross-axis sizing ────────────────────────────────────\n /**\n * Cross-axis viewBox size for this render, hugging the actual content.\n * Computed once per render into `#currentCross` (sub-renderers read it\n * via `getTrackBounds(orientation, cross)` / `bounds.cross`).\n *\n * LONG stays fixed; only the cross axis and the long-axis end inset\n * tighten. Pointer mapping is calibrated to the drawn track span, so\n * clicks on the visible track ends hit min/max exactly.\n */\n #currentCross = CROSS;\n\n /**\n * Long-axis end insets (viewBox units) for this render: low-value end /\n * high-value end (left/right horizontal, bottom/top vertical).\n */\n #currentInsetStart = INSET;\n #currentInsetEnd = INSET;\n\n /**\n * Lane width variable cascade for `key`:\n * 1. `--lane-<key>-width` (explicit per-lane width)\n * 2. for the `value` lane only: `--lane-track-width`, so the value bar\n * matches a customised track thickness automatically\n * 3. for custom lanes only: the generic `--lane-width`\n * 4. `fallback` (0.08 track / 0.12 value / 0.16 custom)\n *\n * Mirrors the `var()` fallback chains in `#renderLane` — the two must stay\n * in sync or the measured viewBox diverges from the drawn strokes.\n */\n #laneWidthNumber(key: string, fallback: number): number {\n const style = getComputedStyle(this);\n const parse = (raw: string): number | undefined => {\n const trimmed = raw.trim();\n if (!trimmed)\n return undefined;\n const parsed = Number.parseFloat(trimmed);\n return Number.isNaN(parsed) ? undefined : parsed;\n };\n const perLane = parse(style.getPropertyValue(`--lane-${key}-width`));\n if (perLane !== undefined)\n return perLane;\n if (key === `value`) {\n const track = parse(style.getPropertyValue(`--lane-track-width`));\n if (track !== undefined)\n return track;\n return fallback;\n }\n if (key !== `track`) {\n const generic = parse(style.getPropertyValue(`--lane-width`));\n if (generic !== undefined)\n return generic;\n }\n return fallback;\n }\n\n /**\n * Lane `key` as screen px: width fraction × measured cross-axis px. Lane\n * widths are fractions of the cross axis, so multiplying by the host's\n * cross px (measured per render in #measureLanes) is exact — unlike the old\n * `calc(var * 24%)` percentage, which resolved against the\n * host-size-independent viewBox diagonal and painted ~10x too thin.\n */\n #laneStrokePx(key: string): number {\n const fallback = key === `track` ? 0.08 : key === `value` ? 0.12 : 0.16;\n return this.#laneWidthNumber(key, fallback) * this.#currentCrossPx;\n }\n\n /**\n * Widest lane stroke in screen px + the host's cross-axis px, measured\n * once per render. Lane strokes render as JS-computed px (see\n * #laneStrokePx) with `non-scaling-stroke`, so the number paints verbatim\n * in screen px regardless of the viewBox.\n */\n #currentLanePxMax = 0;\n #currentCrossPx = 0;\n #currentLongPx = 0;\n\n #measureLanes(): void {\n const rect = this.getBoundingClientRect();\n const crossPx = this.orientation === `vertical` ? rect.width : rect.height;\n this.#currentCrossPx = crossPx;\n this.#currentLongPx = this.orientation === `vertical` ? rect.height : rect.width;\n if (rect.width <= 0 || rect.height <= 0) {\n this.#currentLanePxMax = 0;\n return;\n }\n let max = 0;\n for (const lane of this.#lanes.values()) {\n const fallback = lane.key === `track` ? 0.08 : lane.key === `value` ? 0.12 : 0.16;\n max = Math.max(max, Math.abs(this.#laneWidthNumber(lane.key, fallback)) * crossPx);\n }\n this.#currentLanePxMax = max;\n }\n\n /**\n * Dot radius as a fraction of the cross axis. The fractional\n * `--marker-thickness` size shrinks with the tight box, so a screen-px\n * floor (widest lane + 2px) guarantees the dot always reads larger than\n * the value track it sits on.\n */\n #dotRadiusFraction(): number {\n if (this.#currentCrossPx <= 0) {\n const markerThickness = Math.abs(this.#getCssVar(`--marker-thickness`, 0.15));\n return markerThickness / 2;\n }\n return this.#dotRadiusPx() / this.#currentCrossPx;\n }\n\n /** Desired dot radius in screen px (fractional size vs lane-based floor). */\n #dotRadiusPx(): number {\n const markerThickness = Math.abs(this.#getCssVar(`--marker-thickness`, 0.15));\n if (this.#currentCrossPx <= 0)\n return 0;\n return Math.max(markerThickness * this.#currentCrossPx / 2, this.#currentLanePxMax / 2 + 1);\n }\n\n /**\n * Radii (viewBox units) for a screen-space circle of `rPx` px.\n * `preserveAspectRatio=\"none\"` scales axes differently, so a viewBox\n * `<circle>` renders as an oval — pre-compensate with an `<ellipse>`.\n */\n #circleRadiiUnits(rPx: number, cross: number): { rx: number; ry: number } {\n const longPx = this.#currentLongPx;\n const crossPx = this.#currentCrossPx;\n if (longPx <= 0 || crossPx <= 0 || cross <= 0)\n return { rx: rPx, ry: rPx };\n const longScale = longPx / 100;\n const crossScale = crossPx / cross;\n if (this.orientation === `vertical`)\n return { rx: rPx / crossScale, ry: rPx / longScale };\n return { rx: rPx / longScale, ry: rPx / crossScale };\n }\n\n /** Marker styles actually rendered this render (global + triple C override). */\n #activeMarkerStyles(): SliderMarkerStyle[] {\n if (this.valueMode === `single`)\n return [this.markerStyle];\n if (this.valueMode === `triple` && this.markerStyleC)\n return [...new Set([this.markerStyle, this.markerStyleC])];\n return [this.markerStyle];\n }\n\n /**\n * Largest fractional half-extent of the content, as a fraction of the\n * (unknown) cross size: boxHalf = F * cross + pad. Markers, lane widths\n * and offsets are all defined as fractions of the cross axis, so the\n * tightest box is the fixed point cross = pad / (0.5 - F).\n */\n #contentFraction(): number {\n let f = 0;\n\n for (const lane of this.#lanes.values()) {\n const fallback = lane.key === `track` ? 0.08 : lane.key === `value` ? 0.12 : 0.16;\n const w = this.#laneWidthNumber(lane.key, fallback);\n f = Math.max(f, Math.abs(w) / 2 + Math.abs(lane.offset) / 2);\n }\n\n const markerOffset = Math.abs(this.#getCssVar(`--marker-offset`, 0));\n const markerLength = Math.abs(this.#getCssVar(`--marker-length`, 0.8));\n const styleF = (marker: SliderMarkerStyle): number => {\n if (marker === `none`)\n return 0;\n if (marker === `dot`)\n return this.#dotRadiusFraction() + markerOffset / 2;\n // needle + triangle extend markerLength/4 from the centreline\n return markerLength / 4 + markerOffset / 2;\n };\n for (const marker of this.#activeMarkerStyles()) {\n f = Math.max(f, styleF(marker));\n }\n\n if (this.valueMode === `single` && (this.singleStyle === `bipolar` || this.singleStyle === `unipolar`)) {\n const midLength = Math.abs(this.#getCssVar(`--midpoint-length`, 0.15));\n f = Math.max(f, midLength / 4);\n }\n\n const trackWidth = Math.abs(this.#getCssVar(`--track-width`, 2));\n // Track width is absolute viewBox units (legacy CROSS=24 scale).\n f = Math.max(f, trackWidth / 2 / CROSS);\n\n // Clamp so the fixed point stays finite and leaves room for strokes.\n return Math.min(f, 0.45);\n }\n\n #computeCross(): number {\n const pad = 2;\n const cross = pad / (0.5 - this.#contentFraction());\n return clamp(cross, 4, 40);\n }\n\n /**\n * Long-axis end inset (viewBox units) hugging the markers: dot/triangle\n * markers extend half their width past the track ends at min/max, so the\n * inset is that extent plus a stroke pad. Needle markers are\n * perpendicular to the track and need no along-axis room beyond the pad.\n *\n * Authored `--track-margin` (both ends) / `--track-margin-start` /\n * `--track-margin-end` (viewBox units) are added on top, so demos can\n * reserve room for things like anchored lanes that overhang the value\n * at the extremes. Start = low-value end (left / bottom).\n */\n #computeInsets(cross: number): { start: number; end: number } {\n const markerThickness = Math.abs(this.#getCssVar(`--marker-thickness`, 0.15));\n // Dot along-axis half-width: aspect-corrected rx (falls back to the\n // cross-axis radius when unlaid-out).\n const dotHalf = this.#currentLongPx > 0\n ? this.#dotRadiusPx() * 100 / this.#currentLongPx\n : this.#dotRadiusFraction() * cross;\n let half = 0;\n for (const marker of this.#activeMarkerStyles()) {\n if (marker === `dot`)\n half = Math.max(half, dotHalf);\n else if (marker === `triangle`)\n half = Math.max(half, markerThickness * cross / 4);\n }\n const base = clamp(half + 1.5, 1, INSET);\n const both = Math.max(0, this.#getCssVar(`--track-margin`, 0));\n const extraStart = Math.max(0, this.#getCssVar(`--track-margin-start`, both));\n const extraEnd = Math.max(0, this.#getCssVar(`--track-margin-end`, both));\n let start = base + extraStart;\n let end = base + extraEnd;\n // Keep a usable track span: scale back proportionally if overbooked.\n const maxTotal = LONG - 10;\n if (start + end > maxTotal && start + end > 0) {\n const scale = maxTotal / (start + end);\n start *= scale;\n end *= scale;\n }\n return { start, end };\n }\n\n /**\n * Pointer client position (clientX/clientY along the long axis) mapped\n * onto the *drawn track span* (0 at track start, 1 at track end, clamped;\n * flipped for vertical where the top is the high value). Mapping to the\n * track rather than the host edges means the visible track ends hit\n * min/max exactly and no horizontal space is dead.\n */\n #relativeFromTrackPos(clientPos: number): number {\n const rect = this.getBoundingClientRect();\n const isVertical = this.orientation === `vertical`;\n const hostStart = isVertical ? rect.top : rect.left;\n const hostSize = isVertical ? rect.height : rect.width;\n if (hostSize <= 0)\n return 0;\n const trackStart = hostStart + hostSize * this.#currentInsetStart / LONG;\n const trackSpan = hostSize * (LONG - this.#currentInsetStart - this.#currentInsetEnd) / LONG;\n if (trackSpan <= 0)\n return 0;\n const raw = clamp((clientPos - trackStart) / trackSpan, 0, 1);\n return isVertical ? 1 - raw : raw;\n }\n\n // ─── CSS-var lookup ────────────────────────────────────────────────\n #getCssVar(name: string, defaultValue: number): number {\n const style = getComputedStyle(this);\n const val = style.getPropertyValue(name).trim();\n if (!val)\n return defaultValue;\n\n if (val.includes(`calc(`)) {\n const valueRelative = style.getPropertyValue(`--value-relative`).trim();\n if (!valueRelative) {\n const parsed = Number.parseFloat(val.replace(/[^0-9.-]/g, ``));\n return Number.isNaN(parsed) ? defaultValue : parsed;\n }\n const evalStr = val.replace(/var\\(--value-relative\\)/g, valueRelative);\n try {\n const fn = new Function(`return ${evalStr.replace(/calc\\s*\\(([^)]+)\\)/g, `$1`)}`);\n const result = fn();\n return typeof result === `number` && !Number.isNaN(result) ? result : defaultValue;\n } catch {\n const parsed = Number.parseFloat(val.replace(/[^0-9.-]/g, ``));\n return Number.isNaN(parsed) ? defaultValue : parsed;\n }\n }\n\n const parsed = Number.parseFloat(val);\n return Number.isNaN(parsed) ? defaultValue : parsed;\n }\n\n // ─── Swipeable mode (mirrors ixfx-range-input) ──────────────────────\n /**\n * Track-span-relative 0..1 position for a pointer event, with vertical\n * flip and unipolar V-shape mapping applied. Positions outside the drawn\n * track are clamped to 0..1.\n */\n #relativeFromSwipePointer(event: PointerEvent): number {\n const clientPos = this.orientation === `vertical` ? event.clientY : event.clientX;\n const relativeValue = this.#relativeFromTrackPos(clientPos);\n if (this.valueMode === `single` && this.singleStyle === `unipolar`) {\n return Math.abs(2 * relativeValue - 1);\n }\n return relativeValue;\n }\n\n /**\n * Apply a swipe value from a pointer coordinate. Single mode sets\n * value-A directly; dual/triple modes move the nearest handle.\n * Focus follows the slider being controlled, so keyboard/wheel keep\n * working on the slider under the cursor as a swipe travels across\n * adjacent sliders (no-op when already focused).\n */\n #applySwipeFromPointer(event: PointerEvent): void {\n this.focus();\n const relativeValue = this.#relativeFromSwipePointer(event);\n if (this.valueMode === `single`) {\n this.#lastInteractedHandle = `a`;\n this.#setSingleValueFromRelative(relativeValue, true);\n return;\n }\n const aRel = this.#getRelativeValueA();\n const bRel = this.#getRelativeValueB();\n let nearest: SliderHandleKey = Math.abs(relativeValue - aRel) <= Math.abs(relativeValue - bRel) ? `a` : `b`;\n if (this.valueMode === `triple`) {\n const cRel = this.#getRelativeValueC();\n const distA = Math.abs(relativeValue - aRel);\n const distB = Math.abs(relativeValue - bRel);\n const distC = Math.abs(relativeValue - cRel);\n nearest = distA <= distB && distA <= distC ? `a` : distB <= distC ? `b` : `c`;\n }\n // Raw-pole identity for tie-breaking is irrelevant here (unlike the\n // drag hit-test which distinguishes overlapping handles); nearest wins.\n if (nearest === `a` || nearest === `b`) {\n this.#lastInteractedHandle = nearest;\n } else {\n this.#lastInteractedHandle = `c`;\n }\n this.#setDualOrTripleValueFromRelative(relativeValue, nearest, true);\n }\n\n #onSwipePointerDown = (event: PointerEvent): void => {\n if (!this.swipeable || this.disabled)\n return;\n event.preventDefault();\n this.#applySwipeFromPointer(event);\n };\n\n #onSwipePointerMove = (event: PointerEvent): void => {\n if (!this.swipeable || this.disabled || event.buttons === 0)\n return;\n this.#applySwipeFromPointer(event);\n };\n\n #onSwipePointerEnter = (event: PointerEvent): void => {\n if (!this.swipeable || this.disabled || event.buttons === 0)\n return;\n this.#applySwipeFromPointer(event);\n };\n\n // ─── Pointer interaction ────────────────────────────────────────────\n #onPointerDown = (event: PointerEvent): void => {\n if (this.disabled)\n return;\n // In swipeable mode the host-level swipe handlers own the gesture\n // (no pointer capture, so the pointer can travel across sliders).\n if (this.swipeable)\n return;\n\n const svg = this.renderRoot.querySelector(`svg.slider-svg`) as SVGElement | null;\n if (!svg)\n return;\n\n event.preventDefault();\n\n // Move focus to the host so keyboard interaction (arrows, wheel)\n // continues to work after a click/drag, and the focus indicator shows.\n this.focus();\n\n // Force the dragging cursor immediately, since the pointer may move\n // outside the SVG bounds while dragged (and #onPointerMoveCursor is\n // bound to the SVG only).\n svg.style.cursor = `grabbing`;\n\n const clientPos = this.orientation === `vertical` ? event.clientY : event.clientX;\n // Calibrated to the drawn track span (track ends hit min/max exactly).\n let relativeValue = this.#relativeFromTrackPos(clientPos);\n // For unipolar (single mode), the value bar is symmetric around the track\n // centre, so the click position maps to the value via a V-shape: 0 at\n // the centre, 1 at either end. Clicking 25% in from either side sets\n // the same value (0.5), as does clicking at the very start or end (1).\n if (this.valueMode === `single` && this.singleStyle === `unipolar`) {\n relativeValue = Math.abs(2 * relativeValue - 1);\n }\n\n // Resolve handle\n if (this.valueMode === `single`) {\n this.#lastInteractedHandle = `a`;\n this.#dragHandle = `a`;\n this.#setSingleValueFromRelative(relativeValue, true);\n this.#dragging = true;\n this.toggleAttribute(`dragging`, true);\n this.#activePointerId = event.pointerId;\n try {\n svg.setPointerCapture(event.pointerId);\n } catch {\n // ignore\n }\n this.#dragStartClientPos = clientPos;\n this.#poleValueAtDragStart = this.valueA;\n window.addEventListener(`pointermove`, this.#onPointerMove);\n window.addEventListener(`pointerup`, this.#onPointerUp);\n window.addEventListener(`pointercancel`, this.#onPointerUp);\n return;\n }\n\n // Multi-handle: hit-test\n const aRel = this.#getRelativeValueA();\n const bRel = this.#getRelativeValueB();\n const lo = Math.min(aRel, bRel);\n const hi = Math.max(aRel, bRel);\n const aHandle = this.#poleA <= this.#poleB ? `a` : `b`;\n const bHandle = this.#poleA > this.#poleB ? `a` : `b`;\n const posA = aRel;\n const posB = bRel;\n const isTriple = this.valueMode === `triple`;\n const cRel = isTriple ? this.#getRelativeValueC() : 0;\n const posC = cRel;\n const nearA = Math.abs(relativeValue - posA) < HANDLE_HIT_RADIUS;\n const nearB = Math.abs(relativeValue - posB) < HANDLE_HIT_RADIUS;\n const nearC = isTriple && Math.abs(relativeValue - posC) < HANDLE_HIT_RADIUS;\n\n let chosenHandle: SliderHandleKey | `length` | undefined;\n\n // When two or more handles overlap (e.g. A and C, A and B, etc.), pick\n // the one whose raw pole was NOT last-interacted, so repeated clicks\n // on a near-coincident pair alternate rather than sticking.\n const pickNonLast = (candidates: SliderHandleKey[]): SliderHandleKey => {\n const notLast = candidates.find(h => h !== this.#lastInteractedHandle);\n return notLast ?? candidates[0];\n };\n if (nearA && nearB && nearC) {\n chosenHandle = pickNonLast([aHandle, bHandle, `c`]);\n } else if (nearA && nearB) {\n chosenHandle = pickNonLast([aHandle, bHandle]);\n } else if (nearA && nearC) {\n chosenHandle = pickNonLast([aHandle, `c`]);\n } else if (nearB && nearC) {\n chosenHandle = pickNonLast([bHandle, `c`]);\n } else if (nearA) {\n chosenHandle = aHandle;\n } else if (nearB) {\n chosenHandle = bHandle;\n } else if (nearC) {\n chosenHandle = `c`;\n } else if (this.valueDrag !== `none` && relativeValue > lo && relativeValue < hi) {\n chosenHandle = `length`;\n } else if (this.valueDrag === `none` && relativeValue <= lo) {\n // Dead zone on low side — click-to-set low handle (only when\n // value-drag is off; otherwise clicks outside the bar are a no-op).\n chosenHandle = this.#lowKey();\n } else if (this.valueDrag === `none` && relativeValue >= hi) {\n // Dead zone on high side — click-to-set high handle (only when\n // value-drag is off; otherwise clicks outside the bar are a no-op).\n chosenHandle = this.#highKey();\n } else {\n // Not on a handle, not on a draggable segment, not on a click-to-set\n // dead zone (when value-drag is off). No-op — the pointer event will\n // still register and release cleanly via #onPointerUp, but no value\n // changes.\n chosenHandle = undefined;\n }\n\n this.#dragging = true;\n this.toggleAttribute(`dragging`, true);\n this.#activePointerId = event.pointerId;\n try {\n svg.setPointerCapture(event.pointerId);\n } catch {\n // ignore\n }\n this.#dragStartClientPos = clientPos;\n\n if (chosenHandle === undefined) {\n // Linger-as-track-click but no drag started.\n window.addEventListener(`pointermove`, this.#onPointerMove);\n window.addEventListener(`pointerup`, this.#onPointerUp);\n window.addEventListener(`pointercancel`, this.#onPointerUp);\n return;\n }\n\n this.#dragHandle = chosenHandle;\n\n if (chosenHandle === `length`) {\n this.#lengthDragStart = { poleA: this.#poleA, poleB: this.#poleB };\n this.#lengthDragLowKey = this.#lowKey();\n this.#lengthDragHighKey = this.#highKey();\n this.#lengthDragLength = this.#poleB - this.#poleA < 0\n ? this.#poleA - this.#poleB\n : this.#poleB - this.#poleA;\n this.#lengthDragStartLow = Math.min(this.#poleA, this.#poleB);\n // Remember where the user grabbed the bar (host-relative). Without\n // this, the low edge would jump under the cursor at drag-start.\n this.#lengthDragStartRelative = relativeValue;\n } else {\n this.#lastInteractedHandle = chosenHandle;\n this.#poleValueAtDragStart = chosenHandle === `a` ? this.#poleA : this.#poleB;\n // Click-to-set immediately\n this.#setDualOrTripleValueFromRelative(relativeValue, chosenHandle, true);\n }\n\n window.addEventListener(`pointermove`, this.#onPointerMove);\n window.addEventListener(`pointerup`, this.#onPointerUp);\n window.addEventListener(`pointercancel`, this.#onPointerUp);\n };\n\n #onPointerMove = (event: PointerEvent): void => {\n if (!this.#dragging)\n return;\n\n event.preventDefault();\n\n const clientPos = this.orientation === `vertical` ? event.clientY : event.clientX;\n let relativeValue = this.#relativeFromTrackPos(clientPos);\n if (this.valueMode === `single` && this.singleStyle === `unipolar`) {\n relativeValue = Math.abs(2 * relativeValue - 1);\n }\n\n if (this.valueMode === `single`) {\n this.#setSingleValueFromRelative(relativeValue, true);\n return;\n }\n\n if (this.#dragHandle === `length`) {\n this.#applyLengthDragFromRelative(relativeValue);\n } else if (this.#dragHandle) {\n this.#setDualOrTripleValueFromRelative(relativeValue, this.#dragHandle, true);\n }\n };\n\n #applyLengthDragFromRelative(relativeValue: number): void {\n if (!this.#lengthDragStart)\n return;\n const range = this.max - this.min;\n const deltaR = relativeValue - this.#lengthDragStartRelative;\n const deltaValue = deltaR * range;\n\n let proposedLow = this.#lengthDragStartLow + deltaValue;\n let proposedHigh = proposedLow + this.#lengthDragLength;\n\n if (this.valueDrag === `stop`) {\n const originalLength = this.#lengthDragLength;\n let candidateLow = proposedLow;\n let candidateHigh = proposedLow + originalLength;\n if (candidateLow < this.min) {\n const maxDelta = this.min - this.#lengthDragStartLow;\n candidateLow = this.#lengthDragStartLow + maxDelta;\n candidateHigh = candidateLow + originalLength;\n }\n if (candidateHigh > this.max) {\n // Translate back so high sits at max.\n const shift = this.max - candidateHigh;\n candidateLow += shift;\n candidateHigh += shift;\n }\n proposedLow = candidateLow;\n proposedHigh = candidateHigh;\n } else if (this.valueDrag === `flex`) {\n proposedLow = clamp(proposedLow, this.min, this.max);\n proposedHigh = clamp(proposedHigh, this.min, this.max);\n }\n\n const lowKey = this.#lengthDragLowKey ?? this.#lowKey();\n const highKey = this.#lengthDragHighKey ?? this.#highKey();\n\n const previous = this.#poles();\n const newPoleA = lowKey === `a` ? proposedLow : proposedHigh;\n const newPoleB = lowKey === `b` ? proposedLow : proposedHigh;\n this.#poleA = newPoleA;\n this.#poleB = newPoleB;\n if (this.valueMode === `triple` && this.#poleC !== undefined) {\n const oldLo = Math.min(previous.poleA, previous.poleB);\n const oldHi = Math.max(previous.poleA, previous.poleB);\n const newLo = Math.min(newPoleA, newPoleB);\n const newHi = Math.max(newPoleA, newPoleB);\n if (this.valueCFollow === `proportional` && oldHi > oldLo) {\n const frac = clamp((this.#poleC - oldLo) / (oldHi - oldLo), 0, 1);\n this.#poleC = newLo + frac * (newHi - newLo);\n } else {\n if (this.#poleC < newLo)\n this.#poleC = newLo;\n if (this.#poleC > newHi)\n this.#poleC = newHi;\n }\n }\n this.#syncPoleProperties();\n\n const changed: SliderChangedField = `both`;\n this.#isUserInteraction = true;\n\n const valueLane = this.#lanes.get(`value`);\n if (valueLane && valueLane.type === `value`) {\n valueLane.valueMin = valueToRelative(this.#low(), this.min, this.max);\n valueLane.valueMax = valueToRelative(this.#high(), this.min, this.max);\n }\n\n this.#emitInputAndChange(\n {\n previousValue: previous.poleA,\n previousValueMin: Math.min(previous.poleA, previous.poleB),\n previousValueMax: Math.max(previous.poleA, previous.poleB),\n previousValueC: previous.poleC,\n },\n true,\n changed,\n );\n }\n\n #onPointerUp = (): void => {\n this.#dragging = false;\n this.#dragHandle = undefined;\n this.#lengthDragStart = undefined;\n this.#lengthDragLowKey = undefined;\n this.#lengthDragHighKey = undefined;\n this.toggleAttribute(`dragging`, false);\n\n // Re-evaluate cursor at the last known pointer position so the cursor\n // doesn't stay stuck at `grabbing` after release.\n this.#onPointerMoveCursor(\n new PointerEvent(`pointermove`, {\n clientX: this.#lastPointerClient.x,\n clientY: this.#lastPointerClient.y,\n }),\n );\n\n const svg = this.renderRoot.querySelector(`svg.slider-svg`);\n if (\n svg\n && this.#activePointerId !== undefined\n && `hasPointerCapture` in svg\n && typeof (svg as Element & { hasPointerCapture?: (id: number) => boolean }).hasPointerCapture === `function`\n ) {\n const has = (svg as Element & { hasPointerCapture: (id: number) => boolean }).hasPointerCapture;\n if (has.call(svg, this.#activePointerId)) {\n try {\n (svg as Element & { releasePointerCapture: (id: number) => void }).releasePointerCapture(this.#activePointerId);\n } catch {\n // ignore\n }\n }\n }\n this.#activePointerId = undefined;\n\n window.removeEventListener(`pointermove`, this.#onPointerMove);\n window.removeEventListener(`pointerup`, this.#onPointerUp);\n window.removeEventListener(`pointercancel`, this.#onPointerUp);\n };\n\n // ─── Keyboard interaction ───────────────────────────────────────────\n #onKeyDown = (event: KeyboardEvent): void => {\n if (this.disabled)\n return;\n\n const range = this.max - this.min;\n const effectiveStep = resolveAxisStep(range, this.stops, this.step, event.shiftKey);\n\n // Determine which handle to act on\n let handle: SliderHandleKey = `a`;\n const target = event.target as Element | null;\n if (target && typeof target.closest === `function`) {\n const handleEl = target.closest(`[data-handle]`) as HTMLElement | null;\n if (handleEl) {\n const h = handleEl.dataset?.handle as SliderHandleKey | undefined;\n if (h === `a` || h === `b` || h === `c`)\n handle = h;\n }\n }\n if (this.valueMode === `single`)\n handle = `a`;\n this.#lastInteractedHandle = handle;\n\n let handled = false;\n\n switch (event.key) {\n case `ArrowUp`:\n case `ArrowRight`:\n if (this.valueMode === `single`) {\n const r = this.#getRelativeValueA() + effectiveStep / range;\n this.#setSingleValueFromRelative(clamp(r, 0, 1), true);\n } else {\n const current = handle === `a` ? this.#poleA : (handle === `b` ? this.#poleB : (this.#poleC ?? this.#low()));\n const r = valueToRelative(current, this.min, this.max) + effectiveStep / range;\n this.#stepHandleByRelativeDelta(handle, r);\n }\n handled = true;\n break;\n\n case `ArrowDown`:\n case `ArrowLeft`:\n if (this.valueMode === `single`) {\n const r = this.#getRelativeValueA() - effectiveStep / range;\n this.#setSingleValueFromRelative(clamp(r, 0, 1), true);\n } else {\n const current = handle === `a` ? this.#poleA : (handle === `b` ? this.#poleB : (this.#poleC ?? this.#low()));\n const r = valueToRelative(current, this.min, this.max) - effectiveStep / range;\n this.#stepHandleByRelativeDelta(handle, r);\n }\n handled = true;\n break;\n\n case `Home`:\n if (this.valueMode === `single`) {\n this.#setSingleValueFromRelative(0, true);\n } else {\n this.#stepHandleByRelativeDelta(handle, 0);\n }\n handled = true;\n break;\n\n case `End`:\n if (this.valueMode === `single`) {\n this.#setSingleValueFromRelative(1, true);\n } else {\n this.#stepHandleByRelativeDelta(handle, 1);\n }\n handled = true;\n break;\n }\n\n if (handled)\n event.preventDefault();\n };\n\n #stepHandleByRelativeDelta(handle: SliderHandleKey, targetRelative: number): void {\n if (this.valueMode === `single`) {\n this.#setSingleValueFromRelative(clamp(targetRelative, 0, 1), true);\n return;\n }\n if (handle === `c`) {\n const lo = this.#low();\n const hi = this.#high();\n const proposed = scale(clamp(targetRelative, 0, 1), 0, 1, this.min, this.max);\n const clamped = clamp(proposed, lo, hi);\n const q = this.#quantise(clamped);\n if (q === this.#poleC)\n return;\n const previous = this.#poles();\n this.#poleC = q;\n this.#syncPoleProperties();\n this.#isUserInteraction = true;\n this.#emitInputAndChange(\n {\n previousValue: previous.poleA,\n previousValueMin: Math.min(previous.poleA, previous.poleB),\n previousValueMax: Math.max(previous.poleA, previous.poleB),\n previousValueC: previous.poleC,\n },\n true,\n `c`,\n );\n return;\n }\n\n this.#setDualOrTripleValueFromRelative(clamp(targetRelative, 0, 1), handle, true);\n }\n\n // ─── Wheel interaction ──────────────────────────────────────────────\n // The WheelNudgeMixin installs a host-level `wheel` listener; this method is\n // called once per handled tick with the resolved direction.\n override _applyWheelDelta(direction: WheelDirection, event: WheelEvent): void {\n // Resolve target handle from event target, falling back to last-interacted.\n let handle: SliderHandleKey = this.#lastInteractedHandle;\n const target = event.target as Element | null;\n if (target && typeof target.closest === `function`) {\n const handleEl = target.closest(`[data-handle]`) as HTMLElement | null;\n if (handleEl) {\n const h = handleEl.dataset?.handle as SliderHandleKey | undefined;\n if (h === `a` || h === `b` || h === `c`)\n handle = h;\n }\n }\n if (this.valueMode === `single`)\n handle = `a`;\n this.#lastInteractedHandle = handle;\n\n const range = this.max - this.min;\n const effectiveStep = resolveAxisStep(range, this.stops, this.step, event.shiftKey);\n\n const current = handle === `a`\n ? this.#poleA\n : handle === `b`\n ? this.#poleB\n : (this.#poleC ?? this.#low());\n const currentRel = valueToRelative(current, this.min, this.max);\n // Negate the direction so \"wheel forward\" always increases the value,\n // regardless of the platform's deltaY convention (Windows reports\n // deltaY < 0 for forward, Mac natural-scrolling reports deltaY > 0).\n // Shift narrows the step but doesn't change polarity.\n const targetRel = clamp(currentRel - direction * effectiveStep / range, 0, 1);\n\n this.#stepHandleByRelativeDelta(handle, targetRel);\n }\n\n #onFocusIn = (event: FocusEvent): void => {\n const target = event.target as Element | null;\n if (target && typeof target.closest === `function`) {\n const handleEl = target.closest(`[data-handle]`) as HTMLElement | null;\n if (handleEl) {\n const h = handleEl.dataset?.handle as SliderHandleKey | undefined;\n if (h === `a` || h === `b` || h === `c`)\n this.#lastInteractedHandle = h;\n }\n }\n };\n\n // ─── Rendering ──────────────────────────────────────────────────────\n #viewBox(): string {\n const cross = this.#currentCross;\n if (this.orientation === `horizontal`)\n return `0 0 ${LONG} ${cross}`;\n return `0 0 ${cross} ${LONG}`;\n }\n\n #renderTrack() {\n const isVertical = this.orientation === `vertical`;\n const cross = this.#currentCross;\n const insetStart = this.#currentInsetStart;\n const insetEnd = this.#currentInsetEnd;\n const strokeWidth = this.#getCssVar(`--track-width`, 2);\n const color = this.#getCssVarColor(`--track-color`, `var(--surface-4)`);\n const fill = this.#getCssVarColor(`--track-fill`, `transparent`);\n\n if (isVertical) {\n return svg`\n <rect\n class=\"track\"\n x=\"${cross / 2 - strokeWidth / 2}\"\n y=\"${insetStart}\"\n width=\"${strokeWidth}\"\n height=\"${LONG - insetStart - insetEnd}\"\n fill=\"${fill}\"\n stroke=\"${color}\"\n stroke-width=\"0\"\n />\n `;\n }\n return svg`\n <rect\n class=\"track\"\n x=\"${insetStart}\"\n y=\"${cross / 2 - strokeWidth / 2}\"\n width=\"${LONG - insetStart - insetEnd}\"\n height=\"${strokeWidth}\"\n fill=\"${fill}\"\n stroke=\"${color}\"\n stroke-width=\"0\"\n />\n `;\n }\n\n #getCssVarColor(name: string, fallback: string): string {\n const style = getComputedStyle(this);\n const val = style.getPropertyValue(name).trim();\n return val || fallback;\n }\n\n #renderLane(lane: SliderLaneData) {\n const bounds = getTrackBounds(this.orientation, this.#currentCross, this.#currentInsetStart, this.#currentInsetEnd);\n let path = ``;\n\n if (lane.type === `fixed`) {\n const start = this.orientation === `horizontal`\n ? { x: bounds.trackStart, y: bounds.crossCentre }\n : { x: bounds.crossCentre, y: bounds.trackStart };\n const end = this.orientation === `horizontal`\n ? { x: bounds.trackEnd, y: bounds.crossCentre }\n : { x: bounds.crossCentre, y: bounds.trackEnd };\n path = generateLinePath(start, end);\n } else if (lane.type === `anchored`) {\n const rel = this.#getRelativeValueA();\n const seg = getAnchoredSegment(rel, lane.value ?? 0.1, this.singleStyle, bounds, this.orientation);\n path = generateLinePath(seg.start, seg.end);\n } else {\n // 'value' lane: from valueMin to valueMax.\n const lo = lane.valueMin ?? 0;\n const hi = lane.valueMax ?? 0;\n const seg = getValueSegment(lo, hi, this.singleStyle, bounds, this.orientation);\n path = generateLinePath(seg.start, seg.end);\n }\n\n if (!path)\n return svg``;\n\n // Lane widths are true fractions of the cross axis, resolved to screen px\n // per render (see #laneStrokePx). A `calc(var * 24%)` percentage cannot do\n // this: percentages resolve against the viewBox-local diagonal (~71 units\n // and host-size independent), so documented 0..1 fractions painted ~10x\n // too thin and never scaled with the host. With `non-scaling-stroke` the\n // px number below renders verbatim, keeping dashes frozen as before.\n // Width cascade mirrors #laneWidthNumber: the value lane follows the\n // track width unless explicitly overridden, so a thick track doesn't end\n // up with a hairline value bar.\n const w = `${this.#laneStrokePx(lane.key)}px`;\n // Offsets are likewise cross-relative (see SliderLaneData), not legacy\n // CROSS units.\n const offsetPx = lane.offset * this.#currentCrossPx / 2;\n const transform = this.orientation === `horizontal`\n ? `translateY(${offsetPx}px)`\n : `translateX(${offsetPx}px)`;\n\n return svg`\n <path\n class=\"lane\"\n data-lane-key=\"${lane.key}\"\n part=\"lane lane-${lane.key}\"\n d=\"${path}\"\n style=\"\n stroke-width: ${w};\n stroke-linecap: var(--lane-linecap, round);\n transform: ${transform};\n \"\n />\n `;\n }\n\n #renderValueMarker(handle: SliderHandleKey | undefined, defs: unknown[]) {\n const bounds = getTrackBounds(this.orientation, this.#currentCross, this.#currentInsetStart, this.#currentInsetEnd);\n const cross = bounds.cross;\n const isHorizontal = this.orientation === `horizontal`;\n\n let value: number;\n if (this.valueMode === `single`) {\n value = this.#getRelativeValueA();\n } else {\n if (handle === `a`)\n value = this.#getRelativeValueA();\n else if (handle === `b`)\n value = this.#getRelativeValueB();\n else value = this.#getRelativeValueC();\n }\n\n const pos = valueToPosition(value, this.singleStyle, bounds, this.orientation);\n\n const markerOffset = this.#getCssVar(`--marker-offset`, 0);\n const markerLength = this.#getCssVar(`--marker-length`, 0.8);\n const markerThickness = this.#getCssVar(`--marker-thickness`, 0.15);\n const markerBorderWidth = this.#getCssVar(`--marker-border-width`, 0);\n\n const center = isHorizontal\n ? { x: pos.x, y: bounds.crossCentre + markerOffset * (cross / 2) }\n : { x: bounds.crossCentre + markerOffset * (cross / 2), y: pos.y };\n\n // For unipolar, the value bar is symmetric around the track centre, so\n // the \"low end\" is the reflection of the high end across the centre.\n const isUnipolarSingle = this.valueMode === `single` && this.singleStyle === `unipolar`;\n const lowCenter = isUnipolarSingle\n ? (isHorizontal\n ? { x: 2 * bounds.centre - center.x, y: center.y }\n : { x: center.x, y: 2 * bounds.centre - center.y })\n : undefined;\n\n const id = handle ?? `s`;\n\n // Per-handle marker-style override: in triple mode the C handle can\n // take a different shape than the global `markerStyle` applied to A/B.\n const effectiveMarkerStyle = handle === `c` && this.markerStyleC\n ? this.markerStyleC\n : this.markerStyle;\n\n if (effectiveMarkerStyle === `dot`) {\n const { rx, ry } = this.#circleRadiiUnits(this.#dotRadiusPx(), cross);\n const renderDot = (cx: number, cy: number, mid: string) => {\n if (markerBorderWidth > 0) {\n defs.push(svg`<ellipse id=\"dot-${mid}-path\" cx=\"${cx}\" cy=\"${cy}\" rx=\"${rx}\" ry=\"${ry}\" />`);\n return svg`\n <use href=\"#dot-${mid}-path\" class=\"marker-border\" />\n <use href=\"#dot-${mid}-path\" class=\"marker-fill\" />\n `;\n }\n return svg`<ellipse cx=\"${cx}\" cy=\"${cy}\" rx=\"${rx}\" ry=\"${ry}\" />`;\n };\n\n const high = renderDot(center.x, center.y, id);\n if (lowCenter) {\n return svg`${high}${renderDot(lowCenter.x, lowCenter.y, `${id}-low`)}`;\n }\n return high;\n }\n\n if (effectiveMarkerStyle === `needle`) {\n const halfLen = (markerLength * cross) / 4;\n // Draw perpendicular to the track\n const renderNeedle = (cx: number, cy: number, mid: string) => {\n let start: Point;\n let end: Point;\n if (isHorizontal) {\n start = { x: cx, y: cy - halfLen };\n end = { x: cx, y: cy + halfLen };\n } else {\n start = { x: cx - halfLen, y: cy };\n end = { x: cx + halfLen, y: cy };\n }\n const path = `M ${start.x} ${start.y} L ${end.x} ${end.y}`;\n if (markerBorderWidth > 0) {\n defs.push(svg`<path id=\"needle-${mid}-path\" d=\"${path}\" />`);\n return svg`\n <use href=\"#needle-${mid}-path\" class=\"marker-border\" />\n <use href=\"#needle-${mid}-path\" class=\"marker-fill\" />\n `;\n }\n return svg`<path d=\"${path}\" stroke-linecap=\"round\" />`;\n };\n\n const high = renderNeedle(center.x, center.y, id);\n if (lowCenter) {\n return svg`${high}${renderNeedle(lowCenter.x, lowCenter.y, `${id}-low`)}`;\n }\n return high;\n }\n\n if (effectiveMarkerStyle === `triangle`) {\n // Apex sits on the value-track centreline at `center`; base sits\n // perpendicular to the track, offset *outward* by markerLength so the\n // shape hangs outside the value band with its point facing in.\n const halfLen = (markerLength * cross) / 4;\n // Narrow base: half the cross-fraction so the triangle reads as a\n // pointer rather than a flattened wedge once axes are scaled.\n const halfBase = (markerThickness * cross) / 4;\n const renderTriangle = (cx: number, cy: number, mid: string) => {\n let apex: Point;\n let base1: Point;\n let base2: Point;\n if (isHorizontal) {\n apex = { x: cx, y: cy };\n base1 = { x: cx - halfBase, y: cy + halfLen };\n base2 = { x: cx + halfBase, y: cy + halfLen };\n } else {\n apex = { x: cx, y: cy };\n base1 = { x: cx + halfLen, y: cy - halfBase };\n base2 = { x: cx + halfLen, y: cy + halfBase };\n }\n const points = `${apex.x},${apex.y} ${base1.x},${base1.y} ${base2.x},${base2.y}`;\n if (markerBorderWidth > 0) {\n defs.push(svg`<polygon id=\"triangle-${mid}-path\" points=\"${points}\" />`);\n return svg`\n <use href=\"#triangle-${mid}-path\" class=\"marker-border\" />\n <use href=\"#triangle-${mid}-path\" class=\"marker-fill\" />\n `;\n }\n return svg`<polygon points=\"${points}\" />`;\n };\n\n const high = renderTriangle(center.x, center.y, id);\n if (lowCenter) {\n return svg`${high}${renderTriangle(lowCenter.x, lowCenter.y, `${id}-low`)}`;\n }\n return high;\n }\n\n return svg``;\n }\n\n #renderMidpointMarker() {\n if (this.valueMode !== `single`)\n return svg``;\n if (this.singleStyle !== `bipolar` && this.singleStyle !== `unipolar`)\n return svg``;\n const bounds = getTrackBounds(this.orientation, this.#currentCross, this.#currentInsetStart, this.#currentInsetEnd);\n const cross = bounds.cross;\n const isHorizontal = this.orientation === `horizontal`;\n const length = this.#getCssVar(`--midpoint-length`, 0.15);\n const halfLen = (length * cross) / 4;\n\n const center = isHorizontal\n ? { x: bounds.centre, y: bounds.crossCentre }\n : { x: bounds.crossCentre, y: bounds.centre };\n\n if (this.markerStyle === `dot`) {\n const size = this.#getCssVar(`--midpoint-thickness`, 0.08);\n const rPx = this.#currentCrossPx > 0 ? size * this.#currentCrossPx / 2 : size * (cross / 2);\n const { rx, ry } = this.#circleRadiiUnits(rPx, cross);\n return svg`\n <g class=\"midpoint-marker\" part=\"midpoint-marker\">\n <ellipse cx=\"${center.x}\" cy=\"${center.y}\" rx=\"${rx}\" ry=\"${ry}\" />\n </g>\n `;\n }\n\n let start: Point;\n let end: Point;\n if (isHorizontal) {\n start = { x: center.x, y: center.y - halfLen };\n end = { x: center.x, y: center.y + halfLen };\n } else {\n start = { x: center.x - halfLen, y: center.y };\n end = { x: center.x + halfLen, y: center.y };\n }\n\n return svg`\n <g class=\"midpoint-marker\" part=\"midpoint-marker\">\n <line x1=\"${start.x}\" y1=\"${start.y}\" x2=\"${end.x}\" y2=\"${end.y}\" />\n </g>\n `;\n }\n\n #renderHandleGroup(handle: SliderHandleKey | undefined, content: unknown) {\n if (!handle) {\n // Single-mode: don't put tabindex on the `<g>`. The host itself is\n // the focusable element (the inner SVG is tabindex=-1 so there is\n // exactly one tab stop and one focus outline), and keydown reaches\n // the handler via the host-level listener.\n return svg`<g role=\"slider\"\n class=\"value-marker\"\n aria-orientation=\"${this.orientation}\"\n aria-valuemin=\"${this.min}\" aria-valuemax=\"${this.max}\"\n aria-valuenow=\"${this.valueA}\"\n part=\"value-marker\">${content}</g>`;\n }\n const partName = `value-marker value-marker-${handle}`;\n const value = handle === `a`\n ? this.valueA\n : handle === `b`\n ? this.valueB\n : (this.valueC ?? (this.#poleA + this.#poleB) / 2);\n // Multi-handle: each handle is its own focusable group so Tab moves\n // between them independently.\n return svg`<g tabindex=\"${this.disabled ? -1 : 0}\" role=\"slider\"\n class=\"value-marker\"\n data-handle=\"${handle}\"\n aria-label=\"${handle}\"\n aria-orientation=\"${this.orientation}\"\n aria-valuemin=\"${this.min}\" aria-valuemax=\"${this.max}\"\n aria-valuenow=\"${value}\"\n part=\"${partName}\">${content}</g>`;\n }\n\n #isMultiHandle(): boolean {\n return this.valueMode !== `single`;\n }\n\n // ─── Lifecycle ──────────────────────────────────────────────────────\n protected override willUpdate(changed: PropertyValues): void {\n super.willUpdate(changed);\n\n // Sync internal poles from public properties\n if (changed.has(`valueA`) || changed.has(`valueB`) || !this.hasUpdated) {\n this.#poleA = this.valueA;\n this.#poleB = this.valueB;\n }\n\n // Initial / mode-change valueC defaulting\n if (this.valueMode === `triple`) {\n if (\n this.valueC === undefined\n || !this.#hasInitialisedValueC\n || changed.has(`valueMode`)\n ) {\n this.#poleC = (this.#poleA + this.#poleB) / 2;\n this.valueC = this.#poleC;\n this.#hasInitialisedValueC = true;\n } else {\n this.#poleC = this.valueC;\n }\n // Clamp C to [low, high]\n const lo = Math.min(this.#poleA, this.#poleB);\n const hi = Math.max(this.#poleA, this.#poleB);\n if (this.#poleC < lo)\n this.#poleC = lo;\n if (this.#poleC > hi)\n this.#poleC = hi;\n this.valueC = this.#poleC;\n } else {\n this.#poleC = undefined;\n }\n\n // Sync value lane before render\n if (\n changed.has(`valueA`)\n || changed.has(`valueB`)\n || changed.has(`valueMode`)\n || changed.has(`singleStyle`)\n || !this.hasUpdated\n ) {\n const valueLane = this.#lanes.get(`value`);\n if (valueLane && valueLane.type === `value`) {\n if (this.valueMode === `single`) {\n this.#applySingleStyleValueLane(valueLane, this.#getRelativeValueA());\n } else {\n valueLane.valueMin = valueToRelative(this.#low(), this.min, this.max);\n valueLane.valueMax = valueToRelative(this.#high(), this.min, this.max);\n }\n }\n }\n }\n\n /**\n * Sync the default 'value' lane's valueMin/valueMax for single-mode single-styles.\n * Range: bar from trackStart to value.\n * Bipolar: bar grows from track centre outward to value (or value to centre if below midpoint).\n * Unipolar: bar is centred on the track centre with length proportional to value.\n */\n #applySingleStyleValueLane(valueLane: SliderLaneData, relativeValue: number): void {\n if (this.singleStyle === `bipolar`) {\n valueLane.valueMin = Math.min(0.5, relativeValue);\n valueLane.valueMax = Math.max(0.5, relativeValue);\n } else {\n valueLane.valueMin = 0;\n valueLane.valueMax = relativeValue;\n }\n }\n\n override render(): unknown {\n // Size the viewBox to hug this render's content (markers, lanes,\n // track) before any sub-renderer reads the current insets.\n // Lane measuring comes first (dot floor + box math depend on it);\n // insets need the cross (dot/triangle along-axis extent scales with it).\n this.#measureLanes();\n this.#currentCross = this.#computeCross();\n const insets = this.#computeInsets(this.#currentCross);\n this.#currentInsetStart = insets.start;\n this.#currentInsetEnd = insets.end;\n const lanes = Array.from(this.#lanes.values());\n\n // Initial cursor before the first pointermove arrives. The dynamic\n // cursor (#onPointerMoveCursor) takes over as soon as the user moves\n // the pointer. In single mode the default `pointer` matches \"click to\n // set\"; in multi mode `default` matches \"no implicit interaction for\n // arbitrary track positions\".\n const cursor = this.disabled\n ? `not-allowed`\n : this.valueMode === `single`\n ? `pointer`\n : `default`;\n\n const handles: SliderHandleKey[] = this.#isMultiHandle()\n ? (this.valueMode === `triple` ? [`a`, `b`, `c`] : [`a`, `b`])\n : [];\n\n // Halo shapes for --marker-border-width>0 are pushed here so they end up\n // inside a single root <defs>, matching radial-input's pattern.\n // Compute marker content first so the defs list is populated, then\n // reference both in the template below.\n const markerDefs: unknown[] = [];\n const handleGroups = this.#isMultiHandle()\n ? handles.map(h => this.#renderHandleGroup(h, this.#renderValueMarker(h, markerDefs)))\n : this.#renderHandleGroup(undefined, this.#renderValueMarker(undefined, markerDefs));\n\n return html`\n <svg\n class=\"slider-svg\"\n viewBox=\"${this.#viewBox()}\"\n preserveAspectRatio=\"none\"\n tabindex=\"-1\"\n style=\"cursor: ${cursor}; width: 100%; height: 100%;\"\n @pointerdown=\"${this.#onPointerDown}\"\n @pointermove=\"${this.#onPointerMoveCursor}\"\n @pointerleave=\"${this.#onPointerLeaveCursor}\"\n @keydown=\"${this.#onKeyDown}\"\n @focusin=\"${this.#onFocusIn}\"\n >\n ${markerDefs.length > 0 ? svg`<defs>${markerDefs}</defs>` : svg``}\n ${this.#renderTrack()}\n ${lanes.map(lane => this.#renderLane(lane))}\n ${this.#renderMidpointMarker()}\n ${handleGroups}\n </svg>\n `;\n }\n\n /**\n * Compute the cursor for the current pointer position. The mapping:\n * - `grab` over a marker handle (single A, or multi A/B/C)\n * - `move` over a draggable segment (between A and B when value-drag is on)\n * - `pointer` over empty track where clicking sets a value (single mode,\n * or the dead zones outside A/B in multi mode)\n * - `default` over no-op segments (between A and B in dual mode when\n * value-drag is none, or between A-C/C-B in triple when value-drag is none)\n * - `not-allowed` when disabled\n *\n * `relativeValue` is in the host's long-axis space (0 = start, 1 = end,\n * already flipped for vertical). For unipolar single mode, the value\n * bar's marker positions are computed in the same space; the abs(2x-1)\n * remap only applies when setting the value on click/drag.\n */\n #cursorAtRelative(relativeValue: number): string {\n if (this.disabled)\n return `not-allowed`;\n if (this.#dragging)\n return `grabbing`;\n\n const HANDLE_HIT = 0.06;\n\n if (this.valueMode === `single`) {\n if (this.singleStyle === `unipolar`) {\n // In unipolar the bar is symmetric around the track centre; the\n // value bar's two ends sit at `0.5 ± value/2`.\n const halfLen = this.#getRelativeValueA() / 2;\n const low = 0.5 - halfLen;\n const high = 0.5 + halfLen;\n if (\n Math.abs(relativeValue - low) < HANDLE_HIT\n || Math.abs(relativeValue - high) < HANDLE_HIT\n ) {\n return `grab`;\n }\n return `pointer`;\n }\n const aRel = this.#getRelativeValueA();\n if (Math.abs(relativeValue - aRel) < HANDLE_HIT) {\n return `grab`;\n }\n return `pointer`;\n }\n\n const aRel = this.#getRelativeValueA();\n const bRel = this.#getRelativeValueB();\n const lo = Math.min(aRel, bRel);\n const hi = Math.max(aRel, bRel);\n\n // Over a handle: grab\n if (Math.abs(relativeValue - aRel) < HANDLE_HIT)\n return `grab`;\n if (Math.abs(relativeValue - bRel) < HANDLE_HIT)\n return `grab`;\n if (this.valueMode === `triple`) {\n const cRel = this.#getRelativeValueC();\n if (Math.abs(relativeValue - cRel) < HANDLE_HIT)\n return `grab`;\n }\n\n // Inside the segment between A and B\n if (relativeValue > lo && relativeValue < hi) {\n return this.valueDrag !== `none` ? `move` : `default`;\n }\n\n // Outside A/B (dead zone) — clicking here jumps A or B to that position\n return `pointer`;\n }\n\n #onPointerMoveCursor = (event: PointerEvent): void => {\n const svg = this.renderRoot.querySelector(`svg.slider-svg`) as SVGElement | null;\n if (!svg)\n return;\n this.#lastPointerClient = { x: event.clientX, y: event.clientY };\n const clientPos = this.orientation === `vertical` ? event.clientY : event.clientX;\n // Unipolar click mapping is NOT applied here — it's only for click-to-set;\n // the cursor needs the track-relative position to find the markers.\n const relativeValue = this.#relativeFromTrackPos(clientPos);\n const cursor = this.#cursorAtRelative(relativeValue);\n if (svg.style.cursor !== cursor) {\n svg.style.cursor = cursor;\n }\n };\n\n #onPointerLeaveCursor = (): void => {\n // Reset to the default cursor (whatever the host sets) when the pointer\n // leaves the slider area, so the cursor doesn't stay stuck on `grab` etc.\n const svg = this.renderRoot.querySelector(`svg.slider-svg`) as SVGElement | null;\n if (!svg)\n return;\n const cursor = this.disabled ? `not-allowed` : `default`;\n if (svg.style.cursor !== cursor) {\n svg.style.cursor = cursor;\n }\n };\n\n protected override updated(changed: PropertyValues): void {\n super.updated(changed);\n\n // Update --value-relative / min/max/c CSS variables unconditionally\n if (this.valueMode === `single`) {\n this.style.setProperty(`--value-relative`, this.#getRelativeValueA().toString());\n } else {\n const lo = valueToRelative(this.#low(), this.min, this.max);\n const hi = valueToRelative(this.#high(), this.min, this.max);\n this.style.setProperty(`--value-min-relative`, lo.toString());\n this.style.setProperty(`--value-max-relative`, hi.toString());\n this.style.setProperty(`--value-relative`, hi.toString());\n if (this.valueMode === `triple` && this.#poleC !== undefined) {\n this.style.setProperty(`--value-c-relative`, valueToRelative(this.#poleC, this.min, this.max).toString());\n }\n }\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.removeEventListener(`keydown`, this.#onHostKeyDown);\n this.removeEventListener(`pointerdown`, this.#onSwipePointerDown as EventListener);\n this.removeEventListener(`pointermove`, this.#onSwipePointerMove as EventListener);\n this.removeEventListener(`pointerenter`, this.#onSwipePointerEnter as EventListener);\n this.#gradientObserver?.disconnect();\n this.#gradientObserver = undefined;\n this.#sizeObserver?.disconnect();\n this.#sizeObserver = undefined;\n if (this.#changeDebounceTimer !== undefined) {\n clearTimeout(this.#changeDebounceTimer);\n this.#changeDebounceTimer = undefined;\n }\n this.#onPointerUp();\n }\n\n static override styles = [themeFallbacks, prominenceStyles, css`\n :host {\n display: inline-block;\n width: 200px;\n height: 12px;\n touch-action: none;\n user-select: none;\n tabindex: 0;\n --value-relative: 0;\n --value-min-relative: 0;\n --value-max-relative: 0;\n --value-c-relative: 0;\n\n --lane-width: 0.16;\n }\n\n :host([orientation=\"vertical\"]) {\n width: 12px;\n height: 200px;\n }\n\n :host([disabled]) {\n cursor: not-allowed;\n }\n\n :host {\n outline: none;\n }\n\n :host(:focus-visible) {\n outline: var(--slider-input-svg-focus-outline, 2px solid var(--accent));\n outline-offset: var(--slider-input-svg-focus-outline-offset, 2px);\n }\n\n svg.slider-svg {\n display: block;\n width: 100%;\n height: 100%;\n outline: none;\n overflow: visible;\n }\n\n svg.slider-svg:focus {\n outline: none;\n }\n\n svg.slider-svg:focus-visible {\n outline: var(--slider-input-svg-focus-outline, 2px solid var(--accent));\n outline-offset: var(--slider-input-svg-focus-outline-offset, 2px);\n }\n\n .track {\n stroke: var(--track-color, var(--surface-4));\n /* Default 0 (not the stroke-width=\"0\" attribute below, which this\n rule overrides): the lanes carry the default visuals, so the rect\n is an opt-in backdrop via --track-fill / --track-width. A nonzero\n default here ballooned with the tight viewBox (2 units ≈ 60% of\n the cross axis) and swamped the lanes. */\n stroke-width: var(--track-width, 0);\n }\n\n .lane {\n fill: none;\n /* Rounded ends by default; set --lane-linecap: butt for square ends\n (reads cleaner under a needle/line marker). The inline style on the\n <path> repeats this so it wins over authored .lane rules. */\n stroke-linecap: var(--lane-linecap, round);\n stroke-dasharray: var(--lane-dasharray, none);\n stroke-dashoffset: var(--lane-dashoffset, 0);\n vector-effect: non-scaling-stroke;\n }\n\n .lane[data-lane-key='track'] {\n stroke: var(--lane-track-color, var(--surface-4));\n }\n\n .lane[data-lane-key='value'] {\n stroke: var(--lane-value-color, var(--accent));\n }\n\n .lane:not([data-lane-key='track']):not([data-lane-key='value']) {\n stroke: var(--lane-color, var(--accent));\n }\n\n .value-marker > path:not(.marker-border):not(.marker-fill),\n .value-marker > .marker-fill {\n stroke: var(--marker-color, var(--accent));\n stroke-width: calc(var(--marker-thickness, 0.15) * 12px);\n stroke-linecap: round;\n stroke-dasharray: var(--marker-dasharray, none);\n stroke-dashoffset: var(--marker-dashoffset, 0);\n vector-effect: non-scaling-stroke;\n }\n\n .value-marker > .marker-border {\n stroke: var(--marker-border-color, transparent);\n stroke-width: calc((var(--marker-thickness, 0.15) + var(--marker-border-width, 0) * 2) * 12px);\n stroke-linecap: round;\n vector-effect: non-scaling-stroke;\n }\n\n .value-marker .marker-fill,\n .value-marker circle,\n .value-marker polygon {\n fill: var(--marker-color, var(--accent));\n stroke-width: calc(var(--marker-thickness, 0.15) * 12px);\n }\n\n .value-marker[data-handle=\"a\"] > path:not(.marker-border):not(.marker-fill),\n .value-marker[data-handle=\"a\"] > .marker-fill,\n .value-marker[data-handle=\"a\"] > circle,\n .value-marker[data-handle=\"a\"] > polygon {\n stroke: var(--marker-a-color, var(--marker-color, var(--accent)));\n fill: var(--marker-a-color, var(--marker-color, var(--accent)));\n }\n\n .value-marker[data-handle=\"b\"] > path:not(.marker-border):not(.marker-fill),\n .value-marker[data-handle=\"b\"] > .marker-fill,\n .value-marker[data-handle=\"b\"] > circle,\n .value-marker[data-handle=\"b\"] > polygon {\n stroke: var(--marker-b-color, var(--marker-color, var(--accent)));\n fill: var(--marker-b-color, var(--marker-color, var(--accent)));\n }\n\n .value-marker[data-handle=\"c\"] > path:not(.marker-border):not(.marker-fill),\n .value-marker[data-handle=\"c\"] > .marker-fill,\n .value-marker[data-handle=\"c\"] > circle,\n .value-marker[data-handle=\"c\"] > polygon {\n stroke: var(--marker-c-color, var(--marker-color, var(--accent)));\n fill: var(--marker-c-color, var(--marker-color, var(--accent)));\n }\n\n .midpoint-marker line {\n stroke: var(--midpoint-color, var(--surface-muted-text));\n stroke-width: var(--midpoint-thickness, 1px);\n stroke-linecap: round;\n vector-effect: non-scaling-stroke;\n }\n\n .midpoint-marker circle {\n fill: var(--midpoint-color, var(--surface-muted-text));\n stroke: var(--midpoint-border-color, transparent);\n stroke-width: var(--midpoint-border-width, 0);\n vector-effect: non-scaling-stroke;\n }\n `];\n}\n\n// ─── Tag-name registration ───────────────────────────────────────────\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ixfx-slider-input': SliderInputElement;\n }\n}\n\n// ─── Module-scope interface merge (typed addEventListener) ─────────────\nexport interface SliderInputElement {\n addEventListener: (<K extends keyof SliderInputElementEventMap>(\n type: K,\n listener: (this: SliderInputElement, event: SliderInputElementEventMap[K]) => void,\n options?: boolean | AddEventListenerOptions,\n ) => void) & ((\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | AddEventListenerOptions,\n ) => void);\n}\n"],"mappings":";;;;;;;;;;;;;;AAwCA,SAAgB,eACd,aACA,QAAA,IACA,aAAA,GACA,WAAA,GACa;CACb,MAAM,aAAa;CACnB,MAAM,WAAA,MAAkB;CACxB,IAAI,gBAAgB,cAClB,OAAO;EACL;EACA;EACA,SAAS,aAAa,YAAY;EAClC;EACA,aAAa,QAAQ;CACvB;CAKF,OAAO;EACL;EACA;EACA,SAAS,aAAa,YAAY;EAClC;EACA,aAAa,QAAQ;CACvB;AACF;;;;;;;;;;;;AAaA,SAAgB,gBACd,eACA,aACA,aACA,aACO;CACP,MAAM,OAAO,YAAY,WAAW,YAAY;CAChD,MAAM,SAAS,YAAY;CAC3B,MAAM,cAAc,YAAY;CAEhC,IAAI;CACJ,IAAI,gBAAgB,SAClB,MAAM,YAAY,aAAa,gBAAgB;MAC1C,IAAI,gBAAgB,WAAW;EAEpC,IAAI,iBAAiB,IAAK;GACxB,MAAM,IAAI,gBAA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,WAAA,eAAA,KAAA,CAAA;AAGpD,WAAA,CAAA,SAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAA,mBAAA,WAAA,eAAA,KAAA,CAAA;AAGzB,WAAA,CAAA,SAAS;CAAE,MAAM;CAAQ,WAAW;AAAe,CAAC,CAAA,GAAA,mBAAA,WAAA,eAAA,KAAA,CAAA;AAQpD,WAAA,CAAA,SAAS;CAAE,MAAM;CAAQ,WAAW;AAAiB,CAAC,CAAA,GAAA,mBAAA,WAAA,gBAAA,KAAA,CAAA;AAGtD,WAAA,CAAA,SAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAA,mBAAA,WAAA,aAAA,KAAA,CAAA;AAGzB,WAAA,CAAA,SAAS;CAAE,MAAM;CAAQ,WAAW;AAAa,CAAC,CAAA,GAAA,mBAAA,WAAA,aAAA,KAAA,CAAA;AASlD,WAAA,CAAA,SAAS;CAAE,MAAM;CAAQ,WAAW;AAAiB,CAAC,CAAA,GAAA,mBAAA,WAAA,gBAAA,KAAA,CAAA;AAGtD,WAAA,CAAA,SAAS;CAAE,MAAM;CAAQ,WAAW;AAAY,CAAC,CAAA,GAAA,mBAAA,WAAA,YAAA,KAAA,CAAA;AAGjD,WAAA,CAAA,SAAS;CAAE,MAAM;CAAS,SAAS;AAAK,CAAC,CAAA,GAAA,mBAAA,WAAA,YAAA,KAAA,CAAA;AAezC,WAAA,CAAA,SAAS;CAAE,MAAM;CAAS,SAAS;AAAK,CAAC,CAAA,GAAA,mBAAA,WAAA,aAAA,KAAA,CAAA;AAlF3C2E,qBAAAA,WAAAA,CAAAA,kBAAc,mBAAmB,CAAA,GAAA,kBAAA"}
1
+ {"version":3,"file":"slider-input-Bl1hFE89.js","names":["#currentCrossPx","#currentLongPx","#onKeyDown","#ensureUserGradientDefs","#applySwipeFromPointer","#relativeFromTrackPos","#lastInteractedHandle","#dragHandle","#setSingleValueFromRelative","#dragging","#activePointerId","#dragStartClientPos","#poleValueAtDragStart","#onPointerMove","#onPointerUp","#getRelativeValueA","#getRelativeValueB","#poleA","#poleB","#getRelativeValueC","#lowKey","#highKey","#lengthDragStart","#lengthDragLowKey","#lengthDragHighKey","#lengthDragLength","#lengthDragStartLow","#lengthDragStartRelative","#setDualOrTripleValueFromRelative","#applyLengthDragFromRelative","#onPointerMoveCursor","#lastPointerClient","#poleC","#low","#stepHandleByRelativeDelta","#cursorAtRelative","#lanes","#onHostKeyDown","#onSwipePointerDown","#onSwipePointerMove","#onSwipePointerEnter","#syncGradientDefs","#gradientObserver","#sizeObserver","#onHostResize","#userGradientDefs","#quantise","#isUserInteraction","#applySingleStyleValueLane","#emitInputAndChange","#resolvePoleChange","#poles","#syncPoleProperties","#detectChanged","#high","#hasInitialisedValueC","#getEffectiveValueMin","#buildInputDetail","#buildChangeDetail","#scheduleChangeEvent","#fireChangeEvent","#changeDebounceTimer","#laneWidthNumber","#currentLanePxMax","#getCssVar","#dotRadiusPx","#dotRadiusFraction","#activeMarkerStyles","#contentFraction","#currentInsetStart","#currentInsetEnd","#relativeFromSwipePointer","#currentCross","#getCssVarColor","#laneStrokePx","#circleRadiiUnits","#measureLanes","#computeCross","#computeInsets","#isMultiHandle","#renderHandleGroup","#renderValueMarker","#viewBox","#onPointerDown","#onPointerLeaveCursor","#onFocusIn","#renderTrack","#renderLane","#renderMidpointMarker","customElement"],"sources":["../src/slider-input/svg-utils.ts","../src/slider-input/slider-input.ts"],"sourcesContent":["/**\n * SVG utilities for the slider-input component.\n * Linear track geometry helpers (mirrors radial-input's svg-utils for arc maths).\n */\n\nimport type { SliderOrientation, SliderSingleStyle } from './types.js';\n\nexport interface Point {\n x: number;\n y: number;\n}\n\n/**\n * Track geometry in viewBox units.\n * Horizontal: trackStart = insetStart, trackEnd = 100 - insetEnd (along x).\n * Vertical: trackStart = insetStart, trackEnd = 100 - insetEnd (along y,\n * top = high). \"Start\" is the low-value end (left / bottom).\n */\nexport interface TrackBounds {\n trackStart: number;\n trackEnd: number;\n /** Centre along the long axis (midpoint of the drawn track span). */\n centre: number;\n /** Cross-axis size of the viewBox (dynamic per instance; CROSS is the legacy default). */\n cross: number;\n /** Centre along the cross axis (cross / 2). */\n crossCentre: number;\n}\n\nexport const INSET = 5;\nexport const LONG = 100;\nexport const CROSS = 24;\n\n/**\n * Get the track bounds in viewBox units for a given orientation.\n *\n * `cross` is the dynamic cross-axis size (see `SliderInputElement`'s\n * cross computation); `insetStart`/`insetEnd` are the long-axis end\n * paddings (low-value end / high-value end). LONG stays fixed at 100.\n */\nexport function getTrackBounds(\n orientation: SliderOrientation,\n cross: number = CROSS,\n insetStart: number = INSET,\n insetEnd: number = INSET,\n): TrackBounds {\n const trackStart = insetStart;\n const trackEnd = LONG - insetEnd;\n if (orientation === `horizontal`) {\n return {\n trackStart,\n trackEnd,\n centre: (trackStart + trackEnd) / 2,\n cross,\n crossCentre: cross / 2,\n };\n }\n // Vertical: viewBox is 0 0 cross LONG; the track runs along the y axis from\n // insetStart to LONG-insetEnd. `centre` is the middle of the drawn track\n // span; `crossCentre` is the middle of the cross (x) axis.\n return {\n trackStart,\n trackEnd,\n centre: (trackStart + trackEnd) / 2,\n cross,\n crossCentre: cross / 2,\n };\n}\n\n/**\n * Map a relative value (0..1) to a leader point on the track for the given\n * orientation and single-style.\n *\n * Range: grows from trackStart to trackEnd.\n * Bipolar: track centre is 0.5; values spread from centre outward.\n * Unipolar: spread symmetrically around centre.\n *\n * For vertical orientation, higher values are toward the top of the track,\n * matching the spec (\"higher values → top of track\").\n */\nexport function valueToPosition(\n relativeValue: number,\n singleStyle: SliderSingleStyle,\n trackBounds: TrackBounds,\n orientation: SliderOrientation,\n): Point {\n const span = trackBounds.trackEnd - trackBounds.trackStart;\n const centre = trackBounds.centre;\n const crossCentre = trackBounds.crossCentre;\n\n let pos: number;\n if (singleStyle === `range`) {\n pos = trackBounds.trackStart + relativeValue * span;\n } else if (singleStyle === `bipolar`) {\n // Mid (0.5) -> centre; <0.5 below centre, >0.5 above.\n if (relativeValue <= 0.5) {\n const t = relativeValue / 0.5;\n pos = trackBounds.trackStart + t * (centre - trackBounds.trackStart);\n } else {\n const t = (relativeValue - 0.5) / 0.5;\n pos = centre + t * (trackBounds.trackEnd - centre);\n }\n } else {\n // unipolar: spread symmetrically around centre\n const halfLen = (relativeValue * span) / 2;\n pos = centre + halfLen;\n }\n\n if (orientation === `horizontal`) {\n return { x: pos, y: crossCentre };\n }\n // Vertical: higher values toward top (smaller y). `pos` is a value along the\n // long axis (0..LONG), so the SVG y coordinate (0 at top) is LONG - pos.\n return { x: crossCentre, y: LONG - pos };\n}\n\n/**\n * Get the segment endpoints for a 'value' lane. The lane is drawn from\n * the lane's lower relative value to its upper relative value.\n *\n * For 'range' and 'bipolar' styles, the endpoints are obtained by mapping\n * each value through `valueToPosition`. For 'unipolar', the bar is centred\n * on the track centre with length proportional to valueMax (valueMin is\n * ignored), matching the spec: \"spreads symmetrically around centre\".\n */\nexport function getValueSegment(\n valueMin: number,\n valueMax: number,\n singleStyle: SliderSingleStyle,\n trackBounds: TrackBounds,\n orientation: SliderOrientation,\n): { start: Point; end: Point } {\n if (singleStyle === `unipolar`) {\n const span = trackBounds.trackEnd - trackBounds.trackStart;\n const centre = trackBounds.centre;\n const crossCentre = trackBounds.crossCentre;\n const halfLen = (valueMax * span) / 2;\n if (orientation === `horizontal`) {\n return {\n start: { x: centre - halfLen, y: crossCentre },\n end: { x: centre + halfLen, y: crossCentre },\n };\n }\n // Vertical: spread the bar symmetrically around the track centre along y.\n return {\n start: { x: crossCentre, y: centre - halfLen },\n end: { x: crossCentre, y: centre + halfLen },\n };\n }\n\n return {\n start: valueToPosition(valueMin, singleStyle, trackBounds, orientation),\n end: valueToPosition(valueMax, singleStyle, trackBounds, orientation),\n };\n}\n\n/**\n * Get the segment endpoints for an 'anchored' lane. The lane is centered\n * on the current value, with length controlled by laneValue (0..1).\n */\nexport function getAnchoredSegment(\n relativeValue: number,\n laneValue: number,\n singleStyle: SliderSingleStyle,\n trackBounds: TrackBounds,\n orientation: SliderOrientation,\n): { start: Point; end: Point } {\n const span = trackBounds.trackEnd - trackBounds.trackStart;\n const halfLen = (laneValue * span) / 2;\n\n // For unipolar, the value represents the size of a bar centred on the track\n // centre, not a spatial position. Anchor the lane to the track centre so it\n // follows the value's \"magnitude\" rather than the bar's right-end.\n // Mirrors radial-input's getAnchoredArcAngles for unipolar.\n // `centre.x` is along the track axis; `centre.y` is perpendicular. For\n // horizontal that's (LONG/2, cross/2); for vertical that's (cross/2, LONG/2).\n const centre = singleStyle === `unipolar`\n ? (orientation === `horizontal`\n ? { x: trackBounds.centre, y: trackBounds.crossCentre }\n : { x: trackBounds.crossCentre, y: trackBounds.centre })\n : valueToPosition(relativeValue, singleStyle, trackBounds, orientation);\n\n // Compute along-axis offsets\n let startPos: number;\n let endPos: number;\n if (orientation === `horizontal`) {\n startPos = centre.x - halfLen;\n endPos = centre.x + halfLen;\n } else {\n startPos = centre.y - halfLen;\n endPos = centre.y + halfLen;\n }\n\n const start = orientation === `horizontal`\n ? { x: startPos, y: centre.y }\n : { x: centre.x, y: startPos };\n const end = orientation === `horizontal`\n ? { x: endPos, y: centre.y }\n : { x: centre.x, y: endPos };\n return { start, end };\n}\n\n/**\n * Generate an SVG path string for a straight line. Returns '' for a\n * zero-length segment (start ≈ end), mirroring the radial-input arc\n * helper's edge case.\n */\nexport function generateLinePath(start: Point, end: Point): string {\n if (Math.abs(start.x - end.x) < 0.001 && Math.abs(start.y - end.y) < 0.001) {\n return ``;\n }\n return `M ${start.x} ${start.y} L ${end.x} ${end.y}`;\n}\n\n/**\n * Generate a closed SVG `<path>` for a filled rectangle (used for filled\n * lane segments). `halfWidth` is the perpendicular half-thickness; `perpOffset`\n * shifts the rect perpendicularly from the track centreline.\n */\nexport function generateRectPath(\n start: Point,\n end: Point,\n halfWidth: number,\n perpOffset: number,\n orientation: SliderOrientation,\n): string {\n // Direction vector along the track\n const dx = end.x - start.x;\n const dy = end.y - start.y;\n const len = Math.sqrt(dx * dx + dy * dy);\n if (len < 0.001)\n return ``;\n\n // Unit perpendicular\n const perpX = -dy / len;\n const perpY = dx / len;\n\n // Inset corners slightly so the rect's ends don't extend past the start/end\n const insetX = (dx / len) * halfWidth;\n const insetY = (dy / len) * halfWidth;\n\n const sIn = { x: start.x + insetX, y: start.y + insetY };\n const eIn = { x: end.x - insetX, y: end.y - insetY };\n\n const c1 = { x: sIn.x + perpX * (halfWidth + perpOffset), y: sIn.y + perpY * (halfWidth + perpOffset) };\n const c2 = { x: eIn.x + perpX * (halfWidth + perpOffset), y: eIn.y + perpY * (halfWidth + perpOffset) };\n const c3 = { x: eIn.x + perpX * (-halfWidth + perpOffset), y: eIn.y + perpY * (-halfWidth + perpOffset) };\n const c4 = { x: sIn.x + perpX * (-halfWidth + perpOffset), y: sIn.y + perpY * (-halfWidth + perpOffset) };\n\n // Silence unused-orientation warning — kept for API parity\n void orientation;\n\n return `M ${c1.x} ${c1.y} L ${c2.x} ${c2.y} L ${c3.x} ${c3.y} L ${c4.x} ${c4.y} Z`;\n}\n\n/**\n * Clamp `value` to the [min, max] range.\n */\nexport function clamp(value: number, min: number, max: number): number {\n return Math.min(Math.max(value, min), max);\n}\n\n/**\n * Linear-reinterpolate `value` from [fromMin, fromMax] to [toMin, toMax].\n */\nexport function scale(\n value: number,\n fromMin: number,\n fromMax: number,\n toMin: number,\n toMax: number,\n): number {\n if (fromMax === fromMin)\n return toMin;\n const normalized = (value - fromMin) / (fromMax - fromMin);\n return toMin + normalized * (toMax - toMin);\n}\n\n/**\n * Convert a relative value (0..1) to an absolute value in the min..max range.\n */\nexport function relativeToValue(\n relativeValue: number,\n min: number,\n max: number,\n): number {\n return scale(relativeValue, 0, 1, min, max);\n}\n\n/**\n * Convert an absolute value to a relative (0..1) position.\n */\nexport function valueToRelative(\n value: number,\n min: number,\n max: number,\n): number {\n return scale(value, min, max, 0, 1);\n}\n\n/**\n * Convert a pointer client position (clientX or clientY depending on\n * orientation) to a relative value (0..1) given the host element's\n * bounding rect on the long axis.\n */\nexport function clientPosToRelative(\n clientPos: number,\n hostStart: number,\n hostSize: number,\n): number {\n if (hostSize <= 0)\n return 0;\n return clamp((clientPos - hostStart) / hostSize, 0, 1);\n}\n\n/**\n * Inverse: relative value (0..1) → client position offset from host start.\n */\nexport function relativeToClientPos(\n relativeValue: number,\n hostStart: number,\n hostSize: number,\n): number {\n return hostStart + relativeValue * hostSize;\n}\n","/* eslint-disable ts/no-unsafe-declaration-merging */\n/**\n * <ixfx-slider-input> — linear SVG-based slider.\n *\n * Mirrors `ixfx-radial-input` as closely as possible, swapping arc geometry\n * for a linear track. Supports horizontal and vertical orientations, three\n * value modes (single/dual/triple), triple-segment \"value\" lanes, and\n * `value-drag` length-drag gestures for dual/triple modes.\n *\n * Attributes / properties\n * value-a, value-b, value-c — primary/secondary/tertiary handle values\n * min, max — value range\n * step, stops — keyboard/wheel/pointer step resolution\n * value-mode — 'single' | 'dual' | 'triple'\n * single-style — 'range' | 'bipolar' | 'unipolar' (single mode only)\n * orientation — 'horizontal' | 'vertical'\n * marker-style — 'needle' | 'dot' | 'none'\n * crossover — 'none' | 'allow' (dual/triple modes)\n * value-drag — 'none' | 'stop' | 'flex' (dual/triple modes)\n * value-min — minimum gap between A and B (dual/triple modes)\n * disabled — boolean\n * lighttouch — boolean — wheel adjusts value on hover instead of requiring focus\n * swipeable — boolean — swipe-to-draw gesture (no pointer capture,\n * enter/move with buttons pressed sets value, for\n * step-sequencer layouts; mirrors ixfx-range-input)\n *\n * Events\n * input — fires continuously during user interaction\n * change — debounced 150ms after interaction; immediate for programmatic\n *\n * Mouse wheel (via WheelNudgeMixin): up = increase, down = decrease. In multi-handle\n * modes wheel targets the last-interacted-with handle (focus or pointerdown).\n * Shift+wheel halves the step. See docs/infra-mousewheel.md.\n */\nimport type { PropertyValues } from 'lit';\nimport type { WheelDirection } from '../mixins/wheel-nudge.js';\nimport type { Point } from './svg-utils.js';\nimport type {\n SliderChangedField,\n SliderCrossover,\n SliderHandleKey,\n SliderInputChangeDetail,\n SliderInputElementEventMap,\n SliderInputInputDetail,\n SliderLaneData,\n SliderLaneType,\n SliderMarkerStyle,\n SliderOrientation,\n SliderSingleStyle,\n SliderValueCFollow,\n SliderValueDrag,\n SliderValueMode,\n} from './types.js';\nimport { css, html, LitElement, svg } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { resolveAxisStep } from '../keyboard.js';\nimport { WheelNudgeMixin } from '../mixins/wheel-nudge.js';\nimport { themeFallbacks } from '../styles/fallbacks.js';\nimport { prominenceStyles } from '../styles/prominence.js';\nimport { safeCustomElement as customElement } from '../util/custom-elements.js';\nimport {\n clamp,\n CROSS,\n generateLinePath,\n getAnchoredSegment,\n getTrackBounds,\n getValueSegment,\n INSET,\n LONG,\n scale,\n valueToPosition,\n valueToRelative,\n} from './svg-utils.js';\n\nconst HANDLE_HIT_RADIUS = 0.06;\nconst DEFAULT_VALUE_MIN_FRACTION = 0.01;\nconst CHANGE_DEBOUNCE_MS = 150;\n\n@customElement(`ixfx-slider-input`)\nexport class SliderInputElement extends WheelNudgeMixin(LitElement) {\n // ─── Public properties ───────────────────────────────────────────────\n @property({ type: Number, attribute: `value-a` })\n valueA = 50;\n\n @property({ type: Number, attribute: `value-b` })\n valueB = 0;\n\n /**\n * Triple-mode middle handle. `undefined` until first willUpdate, then\n * defaulted to the midpoint of valueA/valueB (matching radial-input's\n * deferred lane-correction pattern).\n */\n @property({ type: Number, attribute: `value-c` })\n valueC: number | undefined = undefined;\n\n @property({ type: Number })\n min = 0;\n\n @property({ type: Number })\n max = 100;\n\n @property({ type: Number })\n step: number | undefined = undefined;\n\n @property({ type: Number })\n stops: number | undefined = undefined;\n\n @property({ type: String, attribute: `value-mode` })\n valueMode: SliderValueMode = `single`;\n\n @property({ type: String, attribute: `single-style` })\n singleStyle: SliderSingleStyle = `range`;\n\n @property({ type: String })\n orientation: SliderOrientation = `horizontal`;\n\n @property({ type: String, attribute: `marker-style` })\n markerStyle: SliderMarkerStyle = `needle`;\n\n /**\n * Optional marker-style override for the C handle in triple mode. Lets\n * consumers give C a different shape (e.g. dot) from the global\n * `markerStyle` applied to A/B.\n */\n @property({ type: String, attribute: `marker-style-c` })\n markerStyleC: SliderMarkerStyle | undefined = undefined;\n\n @property({ type: String })\n crossover: SliderCrossover = `allow`;\n\n @property({ type: String, attribute: `value-drag` })\n valueDrag: SliderValueDrag = `none`;\n\n /**\n * In triple mode, how the C handle reacts when A or B moves the [A, B]\n * band. `none` (default): C keeps its value unless pushed outside the\n * new band. `proportional`: C is re-anchored at the same fractional\n * position it had within the *old* band, so it moves with A/B.\n */\n @property({ type: String, attribute: `value-c-follow` })\n valueCFollow: SliderValueCFollow = `none`;\n\n @property({ type: Number, attribute: `value-min` })\n valueMin = 1;\n\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Swipe-to-draw gesture, mirroring `ixfx-range-input[swipeable]`.\n * When active, pressing down on the slider or entering it while the\n * pointer is pressed sets the value from the cursor coordinate.\n * Pointer capture is NOT held, so the cursor can move to adjacent\n * swipeable sliders and update them too (step-sequencer style).\n * Leaving the slider (above/below for horizontal, left/right for\n * vertical) freezes the value; re-entering re-engages.\n *\n * Single mode sets value-A directly. Dual/triple modes move the\n * nearest handle to the cursor.\n */\n @property({ type: Boolean, reflect: true })\n swipeable = false;\n\n // ─── Internal state ──────────────────────────────────────────────────\n #lanes: Map<string, SliderLaneData> = new Map();\n\n /** Raw pole values: independent of which is \"low\" or \"high\". */\n #poleA = 50;\n #poleB = 0;\n #poleC: number | undefined = undefined;\n\n #dragging = false;\n /** Pointer ID being tracked (fixes radial-input's hardcoded pointerId). */\n #activePointerId: number | undefined = undefined;\n #dragStartClientPos = 0;\n #poleValueAtDragStart = 0;\n /** Which handle is currently being dragged, or 'length' for segment drag. */\n #dragHandle: SliderHandleKey | `length` | undefined = undefined;\n /** Snapshotted poles at length-drag start. */\n #lengthDragStart: { poleA: number; poleB: number } | undefined = undefined;\n /** Track the low/high identity at length-drag start (so we know which raw pole gets which end). */\n #lengthDragLowKey: SliderHandleKey | undefined = undefined;\n #lengthDragHighKey: SliderHandleKey | undefined = undefined;\n #lengthDragLength = 0;\n #lengthDragStartLow = 0;\n /**\n * Where the pointer was when the length drag began (in host-relative\n * 0..1 terms). Preserves the grab offset so dragging the bar doesn't snap\n * its low edge under the cursor.\n */\n #lengthDragStartRelative = 0;\n\n /** The handle that last received direct interaction (pointerdown/keydown/wheel/focus). */\n #lastInteractedHandle: SliderHandleKey = `a`;\n\n /**\n * Last pointer client position seen by #onPointerMoveCursor, used to\n * recompute the cursor after a drag ends (without waiting for a fresh\n * pointermove).\n */\n #lastPointerClient = { x: 0, y: 0 };\n\n #changeDebounceTimer: number | undefined = undefined;\n #isUserInteraction = false;\n #hasInitialisedValueC = false;\n\n /**\n * Holds `<linearGradient>`/`<radialGradient>` elements authored as light-DOM\n * children of this element, once relocated into the shadow root (see\n * `#syncGradientDefs`). Lets consumers reference `url(#id)` paint servers\n * from `--lane-*-color` / `--track-color` etc. — CSS custom properties\n * pierce the shadow boundary, but `url(#id)` paint-server *resolution* does\n * not, so the gradient definitions themselves must physically live inside\n * this element's shadow root to be resolvable by lanes/track painted there.\n */\n #userGradientDefs: SVGDefsElement | undefined;\n #gradientObserver: MutationObserver | undefined;\n /**\n * Lane strokes are resolved to screen px per render (see #laneStrokePx), so\n * a host resize must re-render to keep them (and the measured box) exact.\n */\n #sizeObserver: ResizeObserver | undefined;\n\n // ─── Construction ───────────────────────────────────────────────────\n constructor() {\n super();\n // Make the host focusable so users can Tab to the slider. The actual\n // focus indicator + keyboard listener are on the inner <svg> (which\n // sits inside the shadow DOM), but the host needs an HTML tabindex\n // attribute to be reachable from the document's tab order.\n if (!this.disabled) {\n this.setAttribute(`tabindex`, `0`);\n }\n this.#lanes.set(`track`, {\n key: `track`,\n value: 1,\n type: `fixed`,\n offset: 0,\n width: 0.16,\n });\n this.#lanes.set(`value`, {\n key: `value`,\n valueMin: 0,\n valueMax: 0,\n type: `value`,\n offset: 0,\n width: 0.24,\n });\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n this.setAttribute(`tabindex`, this.disabled ? `-1` : `0`);\n // Listen for keydown on the host itself (in addition to the SVG in\n // shadow DOM) so the keyboard handler fires when the host has focus\n // from Tab navigation. The host is the focusable element (via its\n // tabindex attribute set in the constructor); events fired while the\n // host is focused don't reach the inner <svg>'s lit listener.\n this.addEventListener(`keydown`, this.#onHostKeyDown as EventListener);\n this.addEventListener(`pointerdown`, this.#onSwipePointerDown as EventListener);\n this.addEventListener(`pointermove`, this.#onSwipePointerMove as EventListener);\n this.addEventListener(`pointerenter`, this.#onSwipePointerEnter as EventListener);\n this.#syncGradientDefs();\n this.#gradientObserver = new MutationObserver(this.#syncGradientDefs);\n this.#gradientObserver.observe(this, { childList: true, subtree: true });\n this.#sizeObserver = new ResizeObserver(this.#onHostResize);\n this.#sizeObserver.observe(this);\n }\n\n #onHostResize = (): void => {\n const rect = this.getBoundingClientRect();\n const crossPx = this.orientation === `vertical` ? rect.width : rect.height;\n const longPx = this.orientation === `vertical` ? rect.height : rect.width;\n if (crossPx !== this.#currentCrossPx || longPx !== this.#currentLongPx) {\n this.requestUpdate();\n }\n };\n\n #onHostKeyDown = (event: KeyboardEvent): void => {\n this.#onKeyDown(event);\n };\n\n // ─── Gradient defs relocation ───────────────────────────────────────\n /**\n * Lazily creates the inert `<svg><defs>` carrier that user-authored\n * gradients get moved into. Kept entirely outside Lit's managed template —\n * it's a plain sibling of the interactive `<svg class=\"slider-svg\">` inside\n * the shadow root, so `url(#id)` references from lane/track paint\n * properties resolve against it regardless of render() re-runs.\n */\n #ensureUserGradientDefs(): SVGDefsElement {\n if (this.#userGradientDefs)\n return this.#userGradientDefs;\n const svgNs = `http://www.w3.org/2000/svg`;\n const carrier = document.createElementNS(svgNs, `svg`);\n carrier.setAttribute(`width`, `0`);\n carrier.setAttribute(`height`, `0`);\n carrier.setAttribute(`aria-hidden`, `true`);\n // Inline (not classed) so no shadow stylesheet rule — including a broad\n // `svg { width: 100%; ... }` selector — can ever stretch this carrier\n // into a click-blocking overlay; `:host` has no explicit `position`, so\n // an accidentally-enlarged `position: absolute` box here would escape to\n // whatever ancestor up the *light* DOM happens to be positioned.\n carrier.style.cssText = `position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none;`;\n const defs = document.createElementNS(svgNs, `defs`) as SVGDefsElement;\n carrier.append(defs);\n this.renderRoot.append(carrier);\n this.#userGradientDefs = defs;\n return defs;\n }\n\n /**\n * Moves any `<linearGradient>`/`<radialGradient>` authored as light-DOM\n * descendants of this element into the shadow root (see\n * `#ensureUserGradientDefs`). This *reparents* rather than clones the\n * nodes, so consumers get normal, live SVG paint-server semantics — e.g.\n * animating a `<stop>`'s `stop-color` \"just works\" — with no gradient\n * management on the component's part. Idempotent: once moved, a node is no\n * longer a light-DOM descendant of `this`, so it won't be found again.\n */\n #syncGradientDefs = (): void => {\n const found = this.querySelectorAll(`linearGradient, radialGradient`);\n if (found.length === 0)\n return;\n const defs = this.#ensureUserGradientDefs();\n for (const node of found) {\n defs.append(node);\n }\n };\n\n // ─── Lane management API ────────────────────────────────────────────\n addLane(\n key: string,\n options?: {\n value?: number;\n valueMin?: number;\n valueMax?: number;\n type?: SliderLaneType;\n offset?: number;\n width?: number;\n },\n ): void {\n const rel = this.#getRelativeValueA();\n this.#lanes.set(key, {\n key,\n value: options?.value ?? rel,\n valueMin: options?.valueMin ?? 0,\n valueMax: options?.valueMax ?? rel,\n type: options?.type ?? `value`,\n offset: options?.offset ?? 0,\n width: options?.width ?? 0.1,\n });\n this.requestUpdate();\n }\n\n setLaneValue(key: string, value: number): void {\n const lane = this.#lanes.get(key);\n if (lane) {\n lane.value = clamp(value, 0, 1);\n this.requestUpdate();\n }\n }\n\n setLaneRange(key: string, valueMin: number, valueMax: number): void {\n const lane = this.#lanes.get(key);\n if (!lane)\n return;\n const lo = clamp(Math.min(valueMin, valueMax), 0, 1);\n const hi = clamp(Math.max(valueMin, valueMax), 0, 1);\n lane.valueMin = lo;\n lane.valueMax = hi;\n this.requestUpdate();\n }\n\n removeLane(key: string): void {\n this.#lanes.delete(key);\n this.requestUpdate();\n }\n\n getLanes(): ReadonlyMap<string, SliderLaneData> {\n return new Map(this.#lanes);\n }\n\n getLane(key: string): SliderLaneData | undefined {\n return this.#lanes.get(key);\n }\n\n // ─── Derived getters ────────────────────────────────────────────────\n #getRelativeValueA(): number {\n return valueToRelative(this.valueA, this.min, this.max);\n }\n\n #getRelativeValueB(): number {\n return valueToRelative(this.valueB, this.min, this.max);\n }\n\n #getRelativeValueC(): number {\n const c = this.valueC ?? (this.#poleA + this.#poleB) / 2;\n return valueToRelative(c, this.min, this.max);\n }\n\n #low(): number {\n return Math.min(this.#poleA, this.#poleB);\n }\n\n #high(): number {\n return Math.max(this.#poleA, this.#poleB);\n }\n\n #lowKey(): SliderHandleKey {\n return this.#poleA <= this.#poleB ? `a` : `b`;\n }\n\n #highKey(): SliderHandleKey {\n return this.#poleA > this.#poleB ? `a` : `b`;\n }\n\n /**\n * Effective `valueMin` in value units between A and B. Mirrors radial-input's\n * default of 1% of max-min when the property holds the literal minimum.\n */\n #getEffectiveValueMin(): number {\n const range = this.max - this.min;\n if (this.valueMin && this.valueMin > 0)\n return this.valueMin;\n return range * DEFAULT_VALUE_MIN_FRACTION;\n }\n\n #quantise(value: number): number {\n if (this.stops && this.stops > 1) {\n const range = this.max - this.min;\n const step = range / this.stops;\n const snapped = Math.round((value - this.min) / step) * step + this.min;\n return clamp(snapped, this.min, this.max);\n }\n if (this.step !== undefined && this.step > 0) {\n const snapped = Math.round((value - this.min) / this.step) * this.step + this.min;\n return clamp(snapped, this.min, this.max);\n }\n return value;\n }\n\n // ─── Value setting ──────────────────────────────────────────────────\n #setSingleValueFromRelative(relativeValue: number, isUserInteraction = false): void {\n const newValue = scale(relativeValue, 0, 1, this.min, this.max);\n const clampedValue = this.#quantise(clamp(newValue, this.min, this.max));\n\n if (clampedValue === this.valueA)\n return;\n\n const previousValue = this.valueA;\n this.valueA = clampedValue;\n this.#poleA = clampedValue;\n this.#isUserInteraction = isUserInteraction;\n\n const valueLane = this.#lanes.get(`value`);\n if (valueLane && valueLane.type === `value`) {\n this.#applySingleStyleValueLane(valueLane, this.#getRelativeValueA());\n }\n\n if (this.hasAttribute(`data-tooltip-live`)) {\n const percentage = Math.round(this.#getRelativeValueA() * 100);\n this.setAttribute(`data-tooltip`, `${percentage}%`);\n }\n\n this.#emitInputAndChange(\n { previousValue },\n isUserInteraction,\n );\n }\n\n #setDualOrTripleValueFromRelative(\n relativeValue: number,\n handle: SliderHandleKey,\n isUserInteraction = false,\n ): void {\n const newValue = scale(relativeValue, 0, 1, this.min, this.max);\n const clamped = clamp(newValue, this.min, this.max);\n\n const result = this.#resolvePoleChange(handle, clamped, this.#lastInteractedHandle);\n if (!result)\n return;\n\n const previous = { ...this.#poles() };\n this.#poleA = result.poleA;\n this.#poleB = result.poleB;\n if (result.poleC !== undefined)\n this.#poleC = result.poleC;\n this.#syncPoleProperties();\n\n const changed = this.#detectChanged(previous, this.#poles());\n this.#isUserInteraction = isUserInteraction;\n\n const valueLane = this.#lanes.get(`value`);\n if (valueLane && valueLane.type === `value`) {\n valueLane.valueMin = valueToRelative(this.#low(), this.min, this.max);\n valueLane.valueMax = valueToRelative(this.#high(), this.min, this.max);\n }\n\n if (this.hasAttribute(`data-tooltip-live`)) {\n const percentage = Math.round(valueToRelative(this.#high(), this.min, this.max) * 100);\n this.setAttribute(`data-tooltip`, `${percentage}%`);\n }\n\n this.#emitInputAndChange(\n {\n previousValue: Math.max(previous.poleA, previous.poleB),\n previousValueMin: Math.min(previous.poleA, previous.poleB),\n previousValueMax: Math.max(previous.poleA, previous.poleB),\n previousValueC: previous.poleC,\n },\n isUserInteraction,\n changed,\n );\n }\n\n #poles(): { poleA: number; poleB: number; poleC: number | undefined } {\n return { poleA: this.#poleA, poleB: this.#poleB, poleC: this.#poleC };\n }\n\n #syncPoleProperties(): void {\n this.valueA = this.#poleA;\n this.valueB = this.#poleB;\n if (this.valueMode === `triple` && this.#poleC !== undefined) {\n this.valueC = this.#poleC;\n this.#hasInitialisedValueC = true;\n }\n }\n\n #resolvePoleChange(\n handle: SliderHandleKey,\n proposed: number,\n originalHandle: SliderHandleKey,\n ): { poleA: number; poleB: number; poleC?: number } | null {\n let poleA = this.#poleA;\n let poleB = this.#poleB;\n let poleC = this.#poleC;\n\n if (this.valueMode === `triple` && handle === `c`) {\n const lo = this.#low();\n const hi = this.#high();\n const clamped = clamp(proposed, lo, hi);\n const quantised = this.#quantise(clamped);\n if (quantised === this.#poleC)\n return null;\n return { poleA, poleB, poleC: quantised };\n }\n\n const gap = this.#getEffectiveValueMin();\n const other = handle === `a` ? poleB : poleA;\n\n let desired = this.#quantise(clamp(proposed, this.min, this.max));\n\n if (this.crossover === `none`) {\n // Pin to the side this handle started on relative to the other one.\n const startedLow = (handle === `a` ? poleA : poleB) <= other;\n if (startedLow) {\n desired = Math.min(desired, other - gap);\n } else {\n desired = Math.max(desired, other + gap);\n }\n } else {\n // 'allow' — snap into the forbidden band, but allow crossover beyond.\n if (desired > other - gap && desired < other + gap) {\n // Within forbidden band; snap to nearer edge.\n const distToLow = Math.abs(desired - (other - gap));\n const distToHigh = Math.abs(desired - (other + gap));\n desired = distToLow <= distToHigh ? other - gap : other + gap;\n }\n }\n\n // Final clamp to [min, max]\n desired = clamp(desired, this.min, this.max);\n\n if (handle === `a`) {\n if (desired === poleA)\n return null;\n poleA = desired;\n } else {\n if (desired === poleB)\n return null;\n poleB = desired;\n }\n\n // Triple-mode: re-anchor C relative to the new [low, high]\n if (this.valueMode === `triple` && poleC !== undefined) {\n const oldLo = Math.min(this.#poleA, this.#poleB);\n const oldHi = Math.max(this.#poleA, this.#poleB);\n const newLo = Math.min(poleA, poleB);\n const newHi = Math.max(poleA, poleB);\n if (this.valueCFollow === `proportional` && oldHi > oldLo) {\n const frac = clamp((poleC - oldLo) / (oldHi - oldLo), 0, 1);\n poleC = newLo + frac * (newHi - newLo);\n } else {\n if (poleC < newLo)\n poleC = newLo;\n if (poleC > newHi)\n poleC = newHi;\n }\n }\n\n // Avoid unused-warning for originalHandle (used in caller for tie-breaking)\n void originalHandle;\n return { poleA, poleB, poleC };\n }\n\n #detectChanged(\n prev: { poleA: number; poleB: number; poleC: number | undefined },\n curr: { poleA: number; poleB: number; poleC: number | undefined },\n ): SliderChangedField {\n const aDiff = prev.poleA !== curr.poleA;\n const bDiff = prev.poleB !== curr.poleB;\n const cDiff = prev.poleC !== curr.poleC;\n\n if (this.valueMode === `triple`) {\n if (aDiff && bDiff && !cDiff)\n return `both`;\n if (aDiff && bDiff)\n return `both`;\n if (aDiff)\n return `min`;\n if (bDiff)\n return `max`;\n if (cDiff)\n return `c`;\n return `min`;\n }\n if (aDiff && bDiff)\n return `both`;\n if (aDiff)\n return `min`;\n if (bDiff)\n return `max`;\n return `min`;\n }\n\n #emitInputAndChange(\n previous: {\n previousValue: number;\n previousValueMin?: number;\n previousValueMax?: number;\n previousValueC?: number;\n },\n isUserInteraction: boolean,\n changed?: SliderChangedField,\n ): void {\n const detailInput = this.#buildInputDetail(changed);\n const detailChange = this.#buildChangeDetail(previous, changed);\n\n if (isUserInteraction) {\n this.dispatchEvent(\n new CustomEvent<SliderInputInputDetail>(`input`, {\n detail: detailInput,\n bubbles: true,\n composed: true,\n }),\n );\n this.#scheduleChangeEvent(detailChange);\n } else {\n this.#fireChangeEvent(detailChange);\n }\n }\n\n #buildInputDetail(changed?: SliderChangedField): SliderInputInputDetail {\n if (this.valueMode === `single`) {\n return {\n value: this.valueA,\n valueRelative: this.#getRelativeValueA(),\n };\n }\n\n const lo = this.#low();\n const hi = this.#high();\n const valueMinRel = valueToRelative(lo, this.min, this.max);\n const valueMaxRel = valueToRelative(hi, this.min, this.max);\n\n if (this.valueMode === `triple` && this.#poleC !== undefined) {\n return {\n value: hi,\n valueRelative: valueMaxRel,\n valueMin: lo,\n valueMax: hi,\n valueMinRelative: valueMinRel,\n valueMaxRelative: valueMaxRel,\n valueC: this.#poleC,\n valueCRelative: valueToRelative(this.#poleC, this.min, this.max),\n changed,\n };\n }\n\n return {\n value: hi,\n valueRelative: valueMaxRel,\n valueMin: lo,\n valueMax: hi,\n valueMinRelative: valueMinRel,\n valueMaxRelative: valueMaxRel,\n changed,\n };\n }\n\n #buildChangeDetail(\n previous: {\n previousValue: number;\n previousValueMin?: number;\n previousValueMax?: number;\n previousValueC?: number;\n },\n changed?: SliderChangedField,\n ): SliderInputChangeDetail {\n if (this.valueMode === `single`) {\n return {\n value: this.valueA,\n valueRelative: this.#getRelativeValueA(),\n previousValue: previous.previousValue,\n };\n }\n\n const lo = this.#low();\n const hi = this.#high();\n const valueMaxRel = valueToRelative(hi, this.min, this.max);\n\n if (this.valueMode === `triple` && this.#poleC !== undefined) {\n return {\n value: hi,\n valueRelative: valueMaxRel,\n previousValue: previous.previousValue,\n valueMin: lo,\n valueMax: hi,\n previousValueMin: previous.previousValueMin ?? lo,\n previousValueMax: previous.previousValueMax ?? hi,\n valueC: this.#poleC,\n previousValueC: previous.previousValueC ?? this.#poleC,\n changed,\n };\n }\n\n return {\n value: hi,\n valueRelative: valueMaxRel,\n previousValue: previous.previousValue,\n valueMin: lo,\n valueMax: hi,\n previousValueMin: previous.previousValueMin ?? lo,\n previousValueMax: previous.previousValueMax ?? hi,\n changed,\n };\n }\n\n #scheduleChangeEvent(detail: SliderInputChangeDetail): void {\n if (this.#changeDebounceTimer !== undefined) {\n clearTimeout(this.#changeDebounceTimer);\n }\n this.#changeDebounceTimer = window.setTimeout(() => {\n this.#fireChangeEvent(detail);\n this.#changeDebounceTimer = undefined;\n }, CHANGE_DEBOUNCE_MS);\n }\n\n #fireChangeEvent(detail: SliderInputChangeDetail): void {\n this.dispatchEvent(\n new CustomEvent<SliderInputChangeDetail>(`change`, {\n detail,\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n // ─── Dynamic cross-axis sizing ────────────────────────────────────\n /**\n * Cross-axis viewBox size for this render, hugging the actual content.\n * Computed once per render into `#currentCross` (sub-renderers read it\n * via `getTrackBounds(orientation, cross)` / `bounds.cross`).\n *\n * LONG stays fixed; only the cross axis and the long-axis end inset\n * tighten. Pointer mapping is calibrated to the drawn track span, so\n * clicks on the visible track ends hit min/max exactly.\n */\n #currentCross = CROSS;\n\n /**\n * Long-axis end insets (viewBox units) for this render: low-value end /\n * high-value end (left/right horizontal, bottom/top vertical).\n */\n #currentInsetStart = INSET;\n #currentInsetEnd = INSET;\n\n /**\n * Lane width variable cascade for `key`:\n * 1. `--lane-<key>-width` (explicit per-lane width)\n * 2. for the `value` lane only: `--lane-track-width`, so the value bar\n * matches a customised track thickness automatically\n * 3. for custom lanes only: the generic `--lane-width`\n * 4. `fallback` (0.08 track / 0.12 value / 0.16 custom)\n *\n * Mirrors the `var()` fallback chains in `#renderLane` — the two must stay\n * in sync or the measured viewBox diverges from the drawn strokes.\n */\n #laneWidthNumber(key: string, fallback: number): number {\n const style = getComputedStyle(this);\n const parse = (raw: string): number | undefined => {\n const trimmed = raw.trim();\n if (!trimmed)\n return undefined;\n const parsed = Number.parseFloat(trimmed);\n return Number.isNaN(parsed) ? undefined : parsed;\n };\n const perLane = parse(style.getPropertyValue(`--lane-${key}-width`));\n if (perLane !== undefined)\n return perLane;\n if (key === `value`) {\n const track = parse(style.getPropertyValue(`--lane-track-width`));\n if (track !== undefined)\n return track;\n return fallback;\n }\n if (key !== `track`) {\n const generic = parse(style.getPropertyValue(`--lane-width`));\n if (generic !== undefined)\n return generic;\n }\n return fallback;\n }\n\n /**\n * Lane `key` as screen px: width fraction × measured cross-axis px. Lane\n * widths are fractions of the cross axis, so multiplying by the host's\n * cross px (measured per render in #measureLanes) is exact — unlike the old\n * `calc(var * 24%)` percentage, which resolved against the\n * host-size-independent viewBox diagonal and painted ~10x too thin.\n */\n #laneStrokePx(key: string): number {\n const fallback = key === `track` ? 0.08 : key === `value` ? 0.12 : 0.16;\n return this.#laneWidthNumber(key, fallback) * this.#currentCrossPx;\n }\n\n /**\n * Widest lane stroke in screen px + the host's cross-axis px, measured\n * once per render. Lane strokes render as JS-computed px (see\n * #laneStrokePx) with `non-scaling-stroke`, so the number paints verbatim\n * in screen px regardless of the viewBox.\n */\n #currentLanePxMax = 0;\n #currentCrossPx = 0;\n #currentLongPx = 0;\n\n #measureLanes(): void {\n const rect = this.getBoundingClientRect();\n const crossPx = this.orientation === `vertical` ? rect.width : rect.height;\n this.#currentCrossPx = crossPx;\n this.#currentLongPx = this.orientation === `vertical` ? rect.height : rect.width;\n if (rect.width <= 0 || rect.height <= 0) {\n this.#currentLanePxMax = 0;\n return;\n }\n let max = 0;\n for (const lane of this.#lanes.values()) {\n const fallback = lane.key === `track` ? 0.08 : lane.key === `value` ? 0.12 : 0.16;\n max = Math.max(max, Math.abs(this.#laneWidthNumber(lane.key, fallback)) * crossPx);\n }\n this.#currentLanePxMax = max;\n }\n\n /**\n * Dot radius as a fraction of the cross axis. The fractional\n * `--marker-thickness` size shrinks with the tight box, so a screen-px\n * floor (widest lane + 2px) guarantees the dot always reads larger than\n * the value track it sits on.\n */\n #dotRadiusFraction(): number {\n if (this.#currentCrossPx <= 0) {\n const markerThickness = Math.abs(this.#getCssVar(`--marker-thickness`, 0.15));\n return markerThickness / 2;\n }\n return this.#dotRadiusPx() / this.#currentCrossPx;\n }\n\n /** Desired dot radius in screen px (fractional size vs lane-based floor). */\n #dotRadiusPx(): number {\n const markerThickness = Math.abs(this.#getCssVar(`--marker-thickness`, 0.15));\n if (this.#currentCrossPx <= 0)\n return 0;\n return Math.max(markerThickness * this.#currentCrossPx / 2, this.#currentLanePxMax / 2 + 1);\n }\n\n /**\n * Radii (viewBox units) for a screen-space circle of `rPx` px.\n * `preserveAspectRatio=\"none\"` scales axes differently, so a viewBox\n * `<circle>` renders as an oval — pre-compensate with an `<ellipse>`.\n */\n #circleRadiiUnits(rPx: number, cross: number): { rx: number; ry: number } {\n const longPx = this.#currentLongPx;\n const crossPx = this.#currentCrossPx;\n if (longPx <= 0 || crossPx <= 0 || cross <= 0)\n return { rx: rPx, ry: rPx };\n const longScale = longPx / 100;\n const crossScale = crossPx / cross;\n if (this.orientation === `vertical`)\n return { rx: rPx / crossScale, ry: rPx / longScale };\n return { rx: rPx / longScale, ry: rPx / crossScale };\n }\n\n /** Marker styles actually rendered this render (global + triple C override). */\n #activeMarkerStyles(): SliderMarkerStyle[] {\n if (this.valueMode === `single`)\n return [this.markerStyle];\n if (this.valueMode === `triple` && this.markerStyleC)\n return [...new Set([this.markerStyle, this.markerStyleC])];\n return [this.markerStyle];\n }\n\n /**\n * Largest fractional half-extent of the content, as a fraction of the\n * (unknown) cross size: boxHalf = F * cross + pad. Markers, lane widths\n * and offsets are all defined as fractions of the cross axis, so the\n * tightest box is the fixed point cross = pad / (0.5 - F).\n */\n #contentFraction(): number {\n let f = 0;\n\n for (const lane of this.#lanes.values()) {\n const fallback = lane.key === `track` ? 0.08 : lane.key === `value` ? 0.12 : 0.16;\n const w = this.#laneWidthNumber(lane.key, fallback);\n f = Math.max(f, Math.abs(w) / 2 + Math.abs(lane.offset) / 2);\n }\n\n const markerOffset = Math.abs(this.#getCssVar(`--marker-offset`, 0));\n const markerLength = Math.abs(this.#getCssVar(`--marker-length`, 0.8));\n const styleF = (marker: SliderMarkerStyle): number => {\n if (marker === `none`)\n return 0;\n if (marker === `dot`)\n return this.#dotRadiusFraction() + markerOffset / 2;\n // needle + triangle extend markerLength/4 from the centreline\n return markerLength / 4 + markerOffset / 2;\n };\n for (const marker of this.#activeMarkerStyles()) {\n f = Math.max(f, styleF(marker));\n }\n\n if (this.valueMode === `single` && (this.singleStyle === `bipolar` || this.singleStyle === `unipolar`)) {\n const midLength = Math.abs(this.#getCssVar(`--midpoint-length`, 0.15));\n f = Math.max(f, midLength / 4);\n }\n\n const trackWidth = Math.abs(this.#getCssVar(`--track-width`, 2));\n // Track width is absolute viewBox units (legacy CROSS=24 scale).\n f = Math.max(f, trackWidth / 2 / CROSS);\n\n // Clamp so the fixed point stays finite and leaves room for strokes.\n return Math.min(f, 0.45);\n }\n\n #computeCross(): number {\n const pad = 2;\n const cross = pad / (0.5 - this.#contentFraction());\n return clamp(cross, 4, 40);\n }\n\n /**\n * Long-axis end inset (viewBox units) hugging the markers: dot/triangle\n * markers extend half their width past the track ends at min/max, so the\n * inset is that extent plus a stroke pad. Needle markers are\n * perpendicular to the track and need no along-axis room beyond the pad.\n *\n * Authored `--track-margin` (both ends) / `--track-margin-start` /\n * `--track-margin-end` (viewBox units) are added on top, so demos can\n * reserve room for things like anchored lanes that overhang the value\n * at the extremes. Start = low-value end (left / bottom).\n */\n #computeInsets(cross: number): { start: number; end: number } {\n const markerThickness = Math.abs(this.#getCssVar(`--marker-thickness`, 0.15));\n // Dot along-axis half-width: aspect-corrected rx (falls back to the\n // cross-axis radius when unlaid-out).\n const dotHalf = this.#currentLongPx > 0\n ? this.#dotRadiusPx() * 100 / this.#currentLongPx\n : this.#dotRadiusFraction() * cross;\n let half = 0;\n for (const marker of this.#activeMarkerStyles()) {\n if (marker === `dot`)\n half = Math.max(half, dotHalf);\n else if (marker === `triangle`)\n half = Math.max(half, markerThickness * cross / 4);\n }\n const base = clamp(half + 1.5, 1, INSET);\n const both = Math.max(0, this.#getCssVar(`--track-margin`, 0));\n const extraStart = Math.max(0, this.#getCssVar(`--track-margin-start`, both));\n const extraEnd = Math.max(0, this.#getCssVar(`--track-margin-end`, both));\n let start = base + extraStart;\n let end = base + extraEnd;\n // Keep a usable track span: scale back proportionally if overbooked.\n const maxTotal = LONG - 10;\n if (start + end > maxTotal && start + end > 0) {\n const scale = maxTotal / (start + end);\n start *= scale;\n end *= scale;\n }\n return { start, end };\n }\n\n /**\n * Pointer client position (clientX/clientY along the long axis) mapped\n * onto the *drawn track span* (0 at track start, 1 at track end, clamped;\n * flipped for vertical where the top is the high value). Mapping to the\n * track rather than the host edges means the visible track ends hit\n * min/max exactly and no horizontal space is dead.\n */\n #relativeFromTrackPos(clientPos: number): number {\n const rect = this.getBoundingClientRect();\n const isVertical = this.orientation === `vertical`;\n const hostStart = isVertical ? rect.top : rect.left;\n const hostSize = isVertical ? rect.height : rect.width;\n if (hostSize <= 0)\n return 0;\n const trackStart = hostStart + hostSize * this.#currentInsetStart / LONG;\n const trackSpan = hostSize * (LONG - this.#currentInsetStart - this.#currentInsetEnd) / LONG;\n if (trackSpan <= 0)\n return 0;\n const raw = clamp((clientPos - trackStart) / trackSpan, 0, 1);\n return isVertical ? 1 - raw : raw;\n }\n\n // ─── CSS-var lookup ────────────────────────────────────────────────\n #getCssVar(name: string, defaultValue: number): number {\n const style = getComputedStyle(this);\n const val = style.getPropertyValue(name).trim();\n if (!val)\n return defaultValue;\n\n if (val.includes(`calc(`)) {\n const valueRelative = style.getPropertyValue(`--value-relative`).trim();\n if (!valueRelative) {\n const parsed = Number.parseFloat(val.replace(/[^0-9.-]/g, ``));\n return Number.isNaN(parsed) ? defaultValue : parsed;\n }\n const evalStr = val.replace(/var\\(--value-relative\\)/g, valueRelative);\n try {\n const fn = new Function(`return ${evalStr.replace(/calc\\s*\\(([^)]+)\\)/g, `$1`)}`);\n const result = fn();\n return typeof result === `number` && !Number.isNaN(result) ? result : defaultValue;\n } catch {\n const parsed = Number.parseFloat(val.replace(/[^0-9.-]/g, ``));\n return Number.isNaN(parsed) ? defaultValue : parsed;\n }\n }\n\n const parsed = Number.parseFloat(val);\n return Number.isNaN(parsed) ? defaultValue : parsed;\n }\n\n // ─── Swipeable mode (mirrors ixfx-range-input) ──────────────────────\n /**\n * Track-span-relative 0..1 position for a pointer event, with vertical\n * flip and unipolar V-shape mapping applied. Positions outside the drawn\n * track are clamped to 0..1.\n */\n #relativeFromSwipePointer(event: PointerEvent): number {\n const clientPos = this.orientation === `vertical` ? event.clientY : event.clientX;\n const relativeValue = this.#relativeFromTrackPos(clientPos);\n if (this.valueMode === `single` && this.singleStyle === `unipolar`) {\n return Math.abs(2 * relativeValue - 1);\n }\n return relativeValue;\n }\n\n /**\n * Apply a swipe value from a pointer coordinate. Single mode sets\n * value-A directly; dual/triple modes move the nearest handle.\n * Focus follows the slider being controlled, so keyboard/wheel keep\n * working on the slider under the cursor as a swipe travels across\n * adjacent sliders (no-op when already focused).\n */\n #applySwipeFromPointer(event: PointerEvent): void {\n this.focus();\n const relativeValue = this.#relativeFromSwipePointer(event);\n if (this.valueMode === `single`) {\n this.#lastInteractedHandle = `a`;\n this.#setSingleValueFromRelative(relativeValue, true);\n return;\n }\n const aRel = this.#getRelativeValueA();\n const bRel = this.#getRelativeValueB();\n let nearest: SliderHandleKey = Math.abs(relativeValue - aRel) <= Math.abs(relativeValue - bRel) ? `a` : `b`;\n if (this.valueMode === `triple`) {\n const cRel = this.#getRelativeValueC();\n const distA = Math.abs(relativeValue - aRel);\n const distB = Math.abs(relativeValue - bRel);\n const distC = Math.abs(relativeValue - cRel);\n nearest = distA <= distB && distA <= distC ? `a` : distB <= distC ? `b` : `c`;\n }\n // Raw-pole identity for tie-breaking is irrelevant here (unlike the\n // drag hit-test which distinguishes overlapping handles); nearest wins.\n if (nearest === `a` || nearest === `b`) {\n this.#lastInteractedHandle = nearest;\n } else {\n this.#lastInteractedHandle = `c`;\n }\n this.#setDualOrTripleValueFromRelative(relativeValue, nearest, true);\n }\n\n #onSwipePointerDown = (event: PointerEvent): void => {\n if (!this.swipeable || this.disabled)\n return;\n event.preventDefault();\n this.#applySwipeFromPointer(event);\n };\n\n #onSwipePointerMove = (event: PointerEvent): void => {\n if (!this.swipeable || this.disabled || event.buttons === 0)\n return;\n this.#applySwipeFromPointer(event);\n };\n\n #onSwipePointerEnter = (event: PointerEvent): void => {\n if (!this.swipeable || this.disabled || event.buttons === 0)\n return;\n this.#applySwipeFromPointer(event);\n };\n\n // ─── Pointer interaction ────────────────────────────────────────────\n #onPointerDown = (event: PointerEvent): void => {\n if (this.disabled)\n return;\n // In swipeable mode the host-level swipe handlers own the gesture\n // (no pointer capture, so the pointer can travel across sliders).\n if (this.swipeable)\n return;\n\n const svg = this.renderRoot.querySelector(`svg.slider-svg`) as SVGElement | null;\n if (!svg)\n return;\n\n event.preventDefault();\n\n // Move focus to the host so keyboard interaction (arrows, wheel)\n // continues to work after a click/drag, and the focus indicator shows.\n this.focus();\n\n // Force the dragging cursor immediately, since the pointer may move\n // outside the SVG bounds while dragged (and #onPointerMoveCursor is\n // bound to the SVG only).\n svg.style.cursor = `grabbing`;\n\n const clientPos = this.orientation === `vertical` ? event.clientY : event.clientX;\n // Calibrated to the drawn track span (track ends hit min/max exactly).\n let relativeValue = this.#relativeFromTrackPos(clientPos);\n // For unipolar (single mode), the value bar is symmetric around the track\n // centre, so the click position maps to the value via a V-shape: 0 at\n // the centre, 1 at either end. Clicking 25% in from either side sets\n // the same value (0.5), as does clicking at the very start or end (1).\n if (this.valueMode === `single` && this.singleStyle === `unipolar`) {\n relativeValue = Math.abs(2 * relativeValue - 1);\n }\n\n // Resolve handle\n if (this.valueMode === `single`) {\n this.#lastInteractedHandle = `a`;\n this.#dragHandle = `a`;\n this.#setSingleValueFromRelative(relativeValue, true);\n this.#dragging = true;\n this.toggleAttribute(`dragging`, true);\n this.#activePointerId = event.pointerId;\n try {\n svg.setPointerCapture(event.pointerId);\n } catch {\n // ignore\n }\n this.#dragStartClientPos = clientPos;\n this.#poleValueAtDragStart = this.valueA;\n window.addEventListener(`pointermove`, this.#onPointerMove);\n window.addEventListener(`pointerup`, this.#onPointerUp);\n window.addEventListener(`pointercancel`, this.#onPointerUp);\n return;\n }\n\n // Multi-handle: hit-test\n const aRel = this.#getRelativeValueA();\n const bRel = this.#getRelativeValueB();\n const lo = Math.min(aRel, bRel);\n const hi = Math.max(aRel, bRel);\n const aHandle = this.#poleA <= this.#poleB ? `a` : `b`;\n const bHandle = this.#poleA > this.#poleB ? `a` : `b`;\n const posA = aRel;\n const posB = bRel;\n const isTriple = this.valueMode === `triple`;\n const cRel = isTriple ? this.#getRelativeValueC() : 0;\n const posC = cRel;\n const nearA = Math.abs(relativeValue - posA) < HANDLE_HIT_RADIUS;\n const nearB = Math.abs(relativeValue - posB) < HANDLE_HIT_RADIUS;\n const nearC = isTriple && Math.abs(relativeValue - posC) < HANDLE_HIT_RADIUS;\n\n let chosenHandle: SliderHandleKey | `length` | undefined;\n\n // When two or more handles overlap (e.g. A and C, A and B, etc.), pick\n // the one whose raw pole was NOT last-interacted, so repeated clicks\n // on a near-coincident pair alternate rather than sticking.\n const pickNonLast = (candidates: SliderHandleKey[]): SliderHandleKey => {\n const notLast = candidates.find(h => h !== this.#lastInteractedHandle);\n return notLast ?? candidates[0];\n };\n if (nearA && nearB && nearC) {\n chosenHandle = pickNonLast([aHandle, bHandle, `c`]);\n } else if (nearA && nearB) {\n chosenHandle = pickNonLast([aHandle, bHandle]);\n } else if (nearA && nearC) {\n chosenHandle = pickNonLast([aHandle, `c`]);\n } else if (nearB && nearC) {\n chosenHandle = pickNonLast([bHandle, `c`]);\n } else if (nearA) {\n chosenHandle = aHandle;\n } else if (nearB) {\n chosenHandle = bHandle;\n } else if (nearC) {\n chosenHandle = `c`;\n } else if (this.valueDrag !== `none` && relativeValue > lo && relativeValue < hi) {\n chosenHandle = `length`;\n } else if (this.valueDrag === `none` && relativeValue <= lo) {\n // Dead zone on low side — click-to-set low handle (only when\n // value-drag is off; otherwise clicks outside the bar are a no-op).\n chosenHandle = this.#lowKey();\n } else if (this.valueDrag === `none` && relativeValue >= hi) {\n // Dead zone on high side — click-to-set high handle (only when\n // value-drag is off; otherwise clicks outside the bar are a no-op).\n chosenHandle = this.#highKey();\n } else {\n // Not on a handle, not on a draggable segment, not on a click-to-set\n // dead zone (when value-drag is off). No-op — the pointer event will\n // still register and release cleanly via #onPointerUp, but no value\n // changes.\n chosenHandle = undefined;\n }\n\n this.#dragging = true;\n this.toggleAttribute(`dragging`, true);\n this.#activePointerId = event.pointerId;\n try {\n svg.setPointerCapture(event.pointerId);\n } catch {\n // ignore\n }\n this.#dragStartClientPos = clientPos;\n\n if (chosenHandle === undefined) {\n // Linger-as-track-click but no drag started.\n window.addEventListener(`pointermove`, this.#onPointerMove);\n window.addEventListener(`pointerup`, this.#onPointerUp);\n window.addEventListener(`pointercancel`, this.#onPointerUp);\n return;\n }\n\n this.#dragHandle = chosenHandle;\n\n if (chosenHandle === `length`) {\n this.#lengthDragStart = { poleA: this.#poleA, poleB: this.#poleB };\n this.#lengthDragLowKey = this.#lowKey();\n this.#lengthDragHighKey = this.#highKey();\n this.#lengthDragLength = this.#poleB - this.#poleA < 0\n ? this.#poleA - this.#poleB\n : this.#poleB - this.#poleA;\n this.#lengthDragStartLow = Math.min(this.#poleA, this.#poleB);\n // Remember where the user grabbed the bar (host-relative). Without\n // this, the low edge would jump under the cursor at drag-start.\n this.#lengthDragStartRelative = relativeValue;\n } else {\n this.#lastInteractedHandle = chosenHandle;\n this.#poleValueAtDragStart = chosenHandle === `a` ? this.#poleA : this.#poleB;\n // Click-to-set immediately\n this.#setDualOrTripleValueFromRelative(relativeValue, chosenHandle, true);\n }\n\n window.addEventListener(`pointermove`, this.#onPointerMove);\n window.addEventListener(`pointerup`, this.#onPointerUp);\n window.addEventListener(`pointercancel`, this.#onPointerUp);\n };\n\n #onPointerMove = (event: PointerEvent): void => {\n if (!this.#dragging)\n return;\n\n event.preventDefault();\n\n const clientPos = this.orientation === `vertical` ? event.clientY : event.clientX;\n let relativeValue = this.#relativeFromTrackPos(clientPos);\n if (this.valueMode === `single` && this.singleStyle === `unipolar`) {\n relativeValue = Math.abs(2 * relativeValue - 1);\n }\n\n if (this.valueMode === `single`) {\n this.#setSingleValueFromRelative(relativeValue, true);\n return;\n }\n\n if (this.#dragHandle === `length`) {\n this.#applyLengthDragFromRelative(relativeValue);\n } else if (this.#dragHandle) {\n this.#setDualOrTripleValueFromRelative(relativeValue, this.#dragHandle, true);\n }\n };\n\n #applyLengthDragFromRelative(relativeValue: number): void {\n if (!this.#lengthDragStart)\n return;\n const range = this.max - this.min;\n const deltaR = relativeValue - this.#lengthDragStartRelative;\n const deltaValue = deltaR * range;\n\n let proposedLow = this.#lengthDragStartLow + deltaValue;\n let proposedHigh = proposedLow + this.#lengthDragLength;\n\n if (this.valueDrag === `stop`) {\n const originalLength = this.#lengthDragLength;\n let candidateLow = proposedLow;\n let candidateHigh = proposedLow + originalLength;\n if (candidateLow < this.min) {\n const maxDelta = this.min - this.#lengthDragStartLow;\n candidateLow = this.#lengthDragStartLow + maxDelta;\n candidateHigh = candidateLow + originalLength;\n }\n if (candidateHigh > this.max) {\n // Translate back so high sits at max.\n const shift = this.max - candidateHigh;\n candidateLow += shift;\n candidateHigh += shift;\n }\n proposedLow = candidateLow;\n proposedHigh = candidateHigh;\n } else if (this.valueDrag === `flex`) {\n proposedLow = clamp(proposedLow, this.min, this.max);\n proposedHigh = clamp(proposedHigh, this.min, this.max);\n }\n\n const lowKey = this.#lengthDragLowKey ?? this.#lowKey();\n const highKey = this.#lengthDragHighKey ?? this.#highKey();\n\n const previous = this.#poles();\n const newPoleA = lowKey === `a` ? proposedLow : proposedHigh;\n const newPoleB = lowKey === `b` ? proposedLow : proposedHigh;\n this.#poleA = newPoleA;\n this.#poleB = newPoleB;\n if (this.valueMode === `triple` && this.#poleC !== undefined) {\n const oldLo = Math.min(previous.poleA, previous.poleB);\n const oldHi = Math.max(previous.poleA, previous.poleB);\n const newLo = Math.min(newPoleA, newPoleB);\n const newHi = Math.max(newPoleA, newPoleB);\n if (this.valueCFollow === `proportional` && oldHi > oldLo) {\n const frac = clamp((this.#poleC - oldLo) / (oldHi - oldLo), 0, 1);\n this.#poleC = newLo + frac * (newHi - newLo);\n } else {\n if (this.#poleC < newLo)\n this.#poleC = newLo;\n if (this.#poleC > newHi)\n this.#poleC = newHi;\n }\n }\n this.#syncPoleProperties();\n\n const changed: SliderChangedField = `both`;\n this.#isUserInteraction = true;\n\n const valueLane = this.#lanes.get(`value`);\n if (valueLane && valueLane.type === `value`) {\n valueLane.valueMin = valueToRelative(this.#low(), this.min, this.max);\n valueLane.valueMax = valueToRelative(this.#high(), this.min, this.max);\n }\n\n this.#emitInputAndChange(\n {\n previousValue: previous.poleA,\n previousValueMin: Math.min(previous.poleA, previous.poleB),\n previousValueMax: Math.max(previous.poleA, previous.poleB),\n previousValueC: previous.poleC,\n },\n true,\n changed,\n );\n }\n\n #onPointerUp = (): void => {\n this.#dragging = false;\n this.#dragHandle = undefined;\n this.#lengthDragStart = undefined;\n this.#lengthDragLowKey = undefined;\n this.#lengthDragHighKey = undefined;\n this.toggleAttribute(`dragging`, false);\n\n // Re-evaluate cursor at the last known pointer position so the cursor\n // doesn't stay stuck at `grabbing` after release.\n this.#onPointerMoveCursor(\n new PointerEvent(`pointermove`, {\n clientX: this.#lastPointerClient.x,\n clientY: this.#lastPointerClient.y,\n }),\n );\n\n const svg = this.renderRoot.querySelector(`svg.slider-svg`);\n if (\n svg\n && this.#activePointerId !== undefined\n && `hasPointerCapture` in svg\n && typeof (svg as Element & { hasPointerCapture?: (id: number) => boolean }).hasPointerCapture === `function`\n ) {\n const has = (svg as Element & { hasPointerCapture: (id: number) => boolean }).hasPointerCapture;\n if (has.call(svg, this.#activePointerId)) {\n try {\n (svg as Element & { releasePointerCapture: (id: number) => void }).releasePointerCapture(this.#activePointerId);\n } catch {\n // ignore\n }\n }\n }\n this.#activePointerId = undefined;\n\n window.removeEventListener(`pointermove`, this.#onPointerMove);\n window.removeEventListener(`pointerup`, this.#onPointerUp);\n window.removeEventListener(`pointercancel`, this.#onPointerUp);\n };\n\n // ─── Keyboard interaction ───────────────────────────────────────────\n #onKeyDown = (event: KeyboardEvent): void => {\n if (this.disabled)\n return;\n\n const range = this.max - this.min;\n const effectiveStep = resolveAxisStep(range, this.stops, this.step, event.shiftKey);\n\n // Determine which handle to act on\n let handle: SliderHandleKey = `a`;\n const target = event.target as Element | null;\n if (target && typeof target.closest === `function`) {\n const handleEl = target.closest(`[data-handle]`) as HTMLElement | null;\n if (handleEl) {\n const h = handleEl.dataset?.handle as SliderHandleKey | undefined;\n if (h === `a` || h === `b` || h === `c`)\n handle = h;\n }\n }\n if (this.valueMode === `single`)\n handle = `a`;\n this.#lastInteractedHandle = handle;\n\n let handled = false;\n\n switch (event.key) {\n case `ArrowUp`:\n case `ArrowRight`:\n if (this.valueMode === `single`) {\n const r = this.#getRelativeValueA() + effectiveStep / range;\n this.#setSingleValueFromRelative(clamp(r, 0, 1), true);\n } else {\n const current = handle === `a` ? this.#poleA : (handle === `b` ? this.#poleB : (this.#poleC ?? this.#low()));\n const r = valueToRelative(current, this.min, this.max) + effectiveStep / range;\n this.#stepHandleByRelativeDelta(handle, r);\n }\n handled = true;\n break;\n\n case `ArrowDown`:\n case `ArrowLeft`:\n if (this.valueMode === `single`) {\n const r = this.#getRelativeValueA() - effectiveStep / range;\n this.#setSingleValueFromRelative(clamp(r, 0, 1), true);\n } else {\n const current = handle === `a` ? this.#poleA : (handle === `b` ? this.#poleB : (this.#poleC ?? this.#low()));\n const r = valueToRelative(current, this.min, this.max) - effectiveStep / range;\n this.#stepHandleByRelativeDelta(handle, r);\n }\n handled = true;\n break;\n\n case `Home`:\n if (this.valueMode === `single`) {\n this.#setSingleValueFromRelative(0, true);\n } else {\n this.#stepHandleByRelativeDelta(handle, 0);\n }\n handled = true;\n break;\n\n case `End`:\n if (this.valueMode === `single`) {\n this.#setSingleValueFromRelative(1, true);\n } else {\n this.#stepHandleByRelativeDelta(handle, 1);\n }\n handled = true;\n break;\n }\n\n if (handled)\n event.preventDefault();\n };\n\n #stepHandleByRelativeDelta(handle: SliderHandleKey, targetRelative: number): void {\n if (this.valueMode === `single`) {\n this.#setSingleValueFromRelative(clamp(targetRelative, 0, 1), true);\n return;\n }\n if (handle === `c`) {\n const lo = this.#low();\n const hi = this.#high();\n const proposed = scale(clamp(targetRelative, 0, 1), 0, 1, this.min, this.max);\n const clamped = clamp(proposed, lo, hi);\n const q = this.#quantise(clamped);\n if (q === this.#poleC)\n return;\n const previous = this.#poles();\n this.#poleC = q;\n this.#syncPoleProperties();\n this.#isUserInteraction = true;\n this.#emitInputAndChange(\n {\n previousValue: previous.poleA,\n previousValueMin: Math.min(previous.poleA, previous.poleB),\n previousValueMax: Math.max(previous.poleA, previous.poleB),\n previousValueC: previous.poleC,\n },\n true,\n `c`,\n );\n return;\n }\n\n this.#setDualOrTripleValueFromRelative(clamp(targetRelative, 0, 1), handle, true);\n }\n\n // ─── Wheel interaction ──────────────────────────────────────────────\n // The WheelNudgeMixin installs a host-level `wheel` listener; this method is\n // called once per handled tick with the resolved direction.\n override _applyWheelDelta(direction: WheelDirection, event: WheelEvent): void {\n // Resolve target handle from event target, falling back to last-interacted.\n let handle: SliderHandleKey = this.#lastInteractedHandle;\n const target = event.target as Element | null;\n if (target && typeof target.closest === `function`) {\n const handleEl = target.closest(`[data-handle]`) as HTMLElement | null;\n if (handleEl) {\n const h = handleEl.dataset?.handle as SliderHandleKey | undefined;\n if (h === `a` || h === `b` || h === `c`)\n handle = h;\n }\n }\n if (this.valueMode === `single`)\n handle = `a`;\n this.#lastInteractedHandle = handle;\n\n const range = this.max - this.min;\n const effectiveStep = resolveAxisStep(range, this.stops, this.step, event.shiftKey);\n\n const current = handle === `a`\n ? this.#poleA\n : handle === `b`\n ? this.#poleB\n : (this.#poleC ?? this.#low());\n const currentRel = valueToRelative(current, this.min, this.max);\n // Negate the direction so \"wheel forward\" always increases the value,\n // regardless of the platform's deltaY convention (Windows reports\n // deltaY < 0 for forward, Mac natural-scrolling reports deltaY > 0).\n // Shift narrows the step but doesn't change polarity.\n const targetRel = clamp(currentRel - direction * effectiveStep / range, 0, 1);\n\n this.#stepHandleByRelativeDelta(handle, targetRel);\n }\n\n #onFocusIn = (event: FocusEvent): void => {\n const target = event.target as Element | null;\n if (target && typeof target.closest === `function`) {\n const handleEl = target.closest(`[data-handle]`) as HTMLElement | null;\n if (handleEl) {\n const h = handleEl.dataset?.handle as SliderHandleKey | undefined;\n if (h === `a` || h === `b` || h === `c`)\n this.#lastInteractedHandle = h;\n }\n }\n };\n\n // ─── Rendering ──────────────────────────────────────────────────────\n #viewBox(): string {\n const cross = this.#currentCross;\n if (this.orientation === `horizontal`)\n return `0 0 ${LONG} ${cross}`;\n return `0 0 ${cross} ${LONG}`;\n }\n\n #renderTrack() {\n const isVertical = this.orientation === `vertical`;\n const cross = this.#currentCross;\n const insetStart = this.#currentInsetStart;\n const insetEnd = this.#currentInsetEnd;\n const strokeWidth = this.#getCssVar(`--track-width`, 2);\n const color = this.#getCssVarColor(`--track-color`, `var(--surface-4)`);\n const fill = this.#getCssVarColor(`--track-fill`, `transparent`);\n\n if (isVertical) {\n return svg`\n <rect\n class=\"track\"\n x=\"${cross / 2 - strokeWidth / 2}\"\n y=\"${insetStart}\"\n width=\"${strokeWidth}\"\n height=\"${LONG - insetStart - insetEnd}\"\n fill=\"${fill}\"\n stroke=\"${color}\"\n stroke-width=\"0\"\n />\n `;\n }\n return svg`\n <rect\n class=\"track\"\n x=\"${insetStart}\"\n y=\"${cross / 2 - strokeWidth / 2}\"\n width=\"${LONG - insetStart - insetEnd}\"\n height=\"${strokeWidth}\"\n fill=\"${fill}\"\n stroke=\"${color}\"\n stroke-width=\"0\"\n />\n `;\n }\n\n #getCssVarColor(name: string, fallback: string): string {\n const style = getComputedStyle(this);\n const val = style.getPropertyValue(name).trim();\n return val || fallback;\n }\n\n #renderLane(lane: SliderLaneData) {\n const bounds = getTrackBounds(this.orientation, this.#currentCross, this.#currentInsetStart, this.#currentInsetEnd);\n let path = ``;\n\n if (lane.type === `fixed`) {\n const start = this.orientation === `horizontal`\n ? { x: bounds.trackStart, y: bounds.crossCentre }\n : { x: bounds.crossCentre, y: bounds.trackStart };\n const end = this.orientation === `horizontal`\n ? { x: bounds.trackEnd, y: bounds.crossCentre }\n : { x: bounds.crossCentre, y: bounds.trackEnd };\n path = generateLinePath(start, end);\n } else if (lane.type === `anchored`) {\n const rel = this.#getRelativeValueA();\n const seg = getAnchoredSegment(rel, lane.value ?? 0.1, this.singleStyle, bounds, this.orientation);\n path = generateLinePath(seg.start, seg.end);\n } else {\n // 'value' lane: from valueMin to valueMax.\n const lo = lane.valueMin ?? 0;\n const hi = lane.valueMax ?? 0;\n const seg = getValueSegment(lo, hi, this.singleStyle, bounds, this.orientation);\n path = generateLinePath(seg.start, seg.end);\n }\n\n if (!path)\n return svg``;\n\n // Lane widths are true fractions of the cross axis, resolved to screen px\n // per render (see #laneStrokePx). A `calc(var * 24%)` percentage cannot do\n // this: percentages resolve against the viewBox-local diagonal (~71 units\n // and host-size independent), so documented 0..1 fractions painted ~10x\n // too thin and never scaled with the host. With `non-scaling-stroke` the\n // px number below renders verbatim, keeping dashes frozen as before.\n // Width cascade mirrors #laneWidthNumber: the value lane follows the\n // track width unless explicitly overridden, so a thick track doesn't end\n // up with a hairline value bar.\n const w = `${this.#laneStrokePx(lane.key)}px`;\n // Offsets are likewise cross-relative (see SliderLaneData), not legacy\n // CROSS units.\n const offsetPx = lane.offset * this.#currentCrossPx / 2;\n const transform = this.orientation === `horizontal`\n ? `translateY(${offsetPx}px)`\n : `translateX(${offsetPx}px)`;\n\n return svg`\n <path\n class=\"lane\"\n data-lane-key=\"${lane.key}\"\n part=\"lane lane-${lane.key}\"\n d=\"${path}\"\n style=\"\n stroke-width: ${w};\n stroke-linecap: var(--lane-linecap, round);\n transform: ${transform};\n \"\n />\n `;\n }\n\n #renderValueMarker(handle: SliderHandleKey | undefined, defs: unknown[]) {\n const bounds = getTrackBounds(this.orientation, this.#currentCross, this.#currentInsetStart, this.#currentInsetEnd);\n const cross = bounds.cross;\n const isHorizontal = this.orientation === `horizontal`;\n\n let value: number;\n if (this.valueMode === `single`) {\n value = this.#getRelativeValueA();\n } else {\n if (handle === `a`)\n value = this.#getRelativeValueA();\n else if (handle === `b`)\n value = this.#getRelativeValueB();\n else value = this.#getRelativeValueC();\n }\n\n const pos = valueToPosition(value, this.singleStyle, bounds, this.orientation);\n\n const markerOffset = this.#getCssVar(`--marker-offset`, 0);\n const markerLength = this.#getCssVar(`--marker-length`, 0.8);\n const markerThickness = this.#getCssVar(`--marker-thickness`, 0.15);\n const markerBorderWidth = this.#getCssVar(`--marker-border-width`, 0);\n\n const center = isHorizontal\n ? { x: pos.x, y: bounds.crossCentre + markerOffset * (cross / 2) }\n : { x: bounds.crossCentre + markerOffset * (cross / 2), y: pos.y };\n\n // For unipolar, the value bar is symmetric around the track centre, so\n // the \"low end\" is the reflection of the high end across the centre.\n const isUnipolarSingle = this.valueMode === `single` && this.singleStyle === `unipolar`;\n const lowCenter = isUnipolarSingle\n ? (isHorizontal\n ? { x: 2 * bounds.centre - center.x, y: center.y }\n : { x: center.x, y: 2 * bounds.centre - center.y })\n : undefined;\n\n const id = handle ?? `s`;\n\n // Per-handle marker-style override: in triple mode the C handle can\n // take a different shape than the global `markerStyle` applied to A/B.\n const effectiveMarkerStyle = handle === `c` && this.markerStyleC\n ? this.markerStyleC\n : this.markerStyle;\n\n if (effectiveMarkerStyle === `dot`) {\n const { rx, ry } = this.#circleRadiiUnits(this.#dotRadiusPx(), cross);\n const renderDot = (cx: number, cy: number, mid: string) => {\n if (markerBorderWidth > 0) {\n defs.push(svg`<ellipse id=\"dot-${mid}-path\" cx=\"${cx}\" cy=\"${cy}\" rx=\"${rx}\" ry=\"${ry}\" />`);\n return svg`\n <use href=\"#dot-${mid}-path\" class=\"marker-border\" />\n <use href=\"#dot-${mid}-path\" class=\"marker-fill\" />\n `;\n }\n return svg`<ellipse cx=\"${cx}\" cy=\"${cy}\" rx=\"${rx}\" ry=\"${ry}\" />`;\n };\n\n const high = renderDot(center.x, center.y, id);\n if (lowCenter) {\n return svg`${high}${renderDot(lowCenter.x, lowCenter.y, `${id}-low`)}`;\n }\n return high;\n }\n\n if (effectiveMarkerStyle === `needle`) {\n const halfLen = (markerLength * cross) / 4;\n // Draw perpendicular to the track\n const renderNeedle = (cx: number, cy: number, mid: string) => {\n let start: Point;\n let end: Point;\n if (isHorizontal) {\n start = { x: cx, y: cy - halfLen };\n end = { x: cx, y: cy + halfLen };\n } else {\n start = { x: cx - halfLen, y: cy };\n end = { x: cx + halfLen, y: cy };\n }\n const path = `M ${start.x} ${start.y} L ${end.x} ${end.y}`;\n if (markerBorderWidth > 0) {\n defs.push(svg`<path id=\"needle-${mid}-path\" d=\"${path}\" />`);\n return svg`\n <use href=\"#needle-${mid}-path\" class=\"marker-border\" />\n <use href=\"#needle-${mid}-path\" class=\"marker-fill\" />\n `;\n }\n return svg`<path d=\"${path}\" stroke-linecap=\"round\" />`;\n };\n\n const high = renderNeedle(center.x, center.y, id);\n if (lowCenter) {\n return svg`${high}${renderNeedle(lowCenter.x, lowCenter.y, `${id}-low`)}`;\n }\n return high;\n }\n\n if (effectiveMarkerStyle === `triangle`) {\n // Apex sits on the value-track centreline at `center`; base sits\n // perpendicular to the track, offset *outward* by markerLength so the\n // shape hangs outside the value band with its point facing in.\n const halfLen = (markerLength * cross) / 4;\n // Narrow base: half the cross-fraction so the triangle reads as a\n // pointer rather than a flattened wedge once axes are scaled.\n const halfBase = (markerThickness * cross) / 4;\n const renderTriangle = (cx: number, cy: number, mid: string) => {\n let apex: Point;\n let base1: Point;\n let base2: Point;\n if (isHorizontal) {\n apex = { x: cx, y: cy };\n base1 = { x: cx - halfBase, y: cy + halfLen };\n base2 = { x: cx + halfBase, y: cy + halfLen };\n } else {\n apex = { x: cx, y: cy };\n base1 = { x: cx + halfLen, y: cy - halfBase };\n base2 = { x: cx + halfLen, y: cy + halfBase };\n }\n const points = `${apex.x},${apex.y} ${base1.x},${base1.y} ${base2.x},${base2.y}`;\n if (markerBorderWidth > 0) {\n defs.push(svg`<polygon id=\"triangle-${mid}-path\" points=\"${points}\" />`);\n return svg`\n <use href=\"#triangle-${mid}-path\" class=\"marker-border\" />\n <use href=\"#triangle-${mid}-path\" class=\"marker-fill\" />\n `;\n }\n return svg`<polygon points=\"${points}\" />`;\n };\n\n const high = renderTriangle(center.x, center.y, id);\n if (lowCenter) {\n return svg`${high}${renderTriangle(lowCenter.x, lowCenter.y, `${id}-low`)}`;\n }\n return high;\n }\n\n return svg``;\n }\n\n #renderMidpointMarker() {\n if (this.valueMode !== `single`)\n return svg``;\n if (this.singleStyle !== `bipolar` && this.singleStyle !== `unipolar`)\n return svg``;\n const bounds = getTrackBounds(this.orientation, this.#currentCross, this.#currentInsetStart, this.#currentInsetEnd);\n const cross = bounds.cross;\n const isHorizontal = this.orientation === `horizontal`;\n const length = this.#getCssVar(`--midpoint-length`, 0.15);\n const halfLen = (length * cross) / 4;\n\n const center = isHorizontal\n ? { x: bounds.centre, y: bounds.crossCentre }\n : { x: bounds.crossCentre, y: bounds.centre };\n\n if (this.markerStyle === `dot`) {\n const size = this.#getCssVar(`--midpoint-thickness`, 0.08);\n const rPx = this.#currentCrossPx > 0 ? size * this.#currentCrossPx / 2 : size * (cross / 2);\n const { rx, ry } = this.#circleRadiiUnits(rPx, cross);\n return svg`\n <g class=\"midpoint-marker\" part=\"midpoint-marker\">\n <ellipse cx=\"${center.x}\" cy=\"${center.y}\" rx=\"${rx}\" ry=\"${ry}\" />\n </g>\n `;\n }\n\n let start: Point;\n let end: Point;\n if (isHorizontal) {\n start = { x: center.x, y: center.y - halfLen };\n end = { x: center.x, y: center.y + halfLen };\n } else {\n start = { x: center.x - halfLen, y: center.y };\n end = { x: center.x + halfLen, y: center.y };\n }\n\n return svg`\n <g class=\"midpoint-marker\" part=\"midpoint-marker\">\n <line x1=\"${start.x}\" y1=\"${start.y}\" x2=\"${end.x}\" y2=\"${end.y}\" />\n </g>\n `;\n }\n\n #renderHandleGroup(handle: SliderHandleKey | undefined, content: unknown) {\n if (!handle) {\n // Single-mode: don't put tabindex on the `<g>`. The host itself is\n // the focusable element (the inner SVG is tabindex=-1 so there is\n // exactly one tab stop and one focus outline), and keydown reaches\n // the handler via the host-level listener.\n return svg`<g role=\"slider\"\n class=\"value-marker\"\n aria-orientation=\"${this.orientation}\"\n aria-valuemin=\"${this.min}\" aria-valuemax=\"${this.max}\"\n aria-valuenow=\"${this.valueA}\"\n part=\"value-marker\">${content}</g>`;\n }\n const partName = `value-marker value-marker-${handle}`;\n const value = handle === `a`\n ? this.valueA\n : handle === `b`\n ? this.valueB\n : (this.valueC ?? (this.#poleA + this.#poleB) / 2);\n // Multi-handle: each handle is its own focusable group so Tab moves\n // between them independently.\n return svg`<g tabindex=\"${this.disabled ? -1 : 0}\" role=\"slider\"\n class=\"value-marker\"\n data-handle=\"${handle}\"\n aria-label=\"${handle}\"\n aria-orientation=\"${this.orientation}\"\n aria-valuemin=\"${this.min}\" aria-valuemax=\"${this.max}\"\n aria-valuenow=\"${value}\"\n part=\"${partName}\">${content}</g>`;\n }\n\n #isMultiHandle(): boolean {\n return this.valueMode !== `single`;\n }\n\n // ─── Lifecycle ──────────────────────────────────────────────────────\n protected override willUpdate(changed: PropertyValues): void {\n super.willUpdate(changed);\n\n // Sync internal poles from public properties\n if (changed.has(`valueA`) || changed.has(`valueB`) || !this.hasUpdated) {\n this.#poleA = this.valueA;\n this.#poleB = this.valueB;\n }\n\n // Initial / mode-change valueC defaulting\n if (this.valueMode === `triple`) {\n if (\n this.valueC === undefined\n || !this.#hasInitialisedValueC\n || changed.has(`valueMode`)\n ) {\n this.#poleC = (this.#poleA + this.#poleB) / 2;\n this.valueC = this.#poleC;\n this.#hasInitialisedValueC = true;\n } else {\n this.#poleC = this.valueC;\n }\n // Clamp C to [low, high]\n const lo = Math.min(this.#poleA, this.#poleB);\n const hi = Math.max(this.#poleA, this.#poleB);\n if (this.#poleC < lo)\n this.#poleC = lo;\n if (this.#poleC > hi)\n this.#poleC = hi;\n this.valueC = this.#poleC;\n } else {\n this.#poleC = undefined;\n }\n\n // Sync value lane before render\n if (\n changed.has(`valueA`)\n || changed.has(`valueB`)\n || changed.has(`valueMode`)\n || changed.has(`singleStyle`)\n || !this.hasUpdated\n ) {\n const valueLane = this.#lanes.get(`value`);\n if (valueLane && valueLane.type === `value`) {\n if (this.valueMode === `single`) {\n this.#applySingleStyleValueLane(valueLane, this.#getRelativeValueA());\n } else {\n valueLane.valueMin = valueToRelative(this.#low(), this.min, this.max);\n valueLane.valueMax = valueToRelative(this.#high(), this.min, this.max);\n }\n }\n }\n }\n\n /**\n * Sync the default 'value' lane's valueMin/valueMax for single-mode single-styles.\n * Range: bar from trackStart to value.\n * Bipolar: bar grows from track centre outward to value (or value to centre if below midpoint).\n * Unipolar: bar is centred on the track centre with length proportional to value.\n */\n #applySingleStyleValueLane(valueLane: SliderLaneData, relativeValue: number): void {\n if (this.singleStyle === `bipolar`) {\n valueLane.valueMin = Math.min(0.5, relativeValue);\n valueLane.valueMax = Math.max(0.5, relativeValue);\n } else {\n valueLane.valueMin = 0;\n valueLane.valueMax = relativeValue;\n }\n }\n\n override render(): unknown {\n // Size the viewBox to hug this render's content (markers, lanes,\n // track) before any sub-renderer reads the current insets.\n // Lane measuring comes first (dot floor + box math depend on it);\n // insets need the cross (dot/triangle along-axis extent scales with it).\n this.#measureLanes();\n this.#currentCross = this.#computeCross();\n const insets = this.#computeInsets(this.#currentCross);\n this.#currentInsetStart = insets.start;\n this.#currentInsetEnd = insets.end;\n const lanes = Array.from(this.#lanes.values());\n\n // Initial cursor before the first pointermove arrives. The dynamic\n // cursor (#onPointerMoveCursor) takes over as soon as the user moves\n // the pointer. In single mode the default `pointer` matches \"click to\n // set\"; in multi mode `default` matches \"no implicit interaction for\n // arbitrary track positions\".\n const cursor = this.disabled\n ? `not-allowed`\n : this.valueMode === `single`\n ? `pointer`\n : `default`;\n\n const handles: SliderHandleKey[] = this.#isMultiHandle()\n ? (this.valueMode === `triple` ? [`a`, `b`, `c`] : [`a`, `b`])\n : [];\n\n // Halo shapes for --marker-border-width>0 are pushed here so they end up\n // inside a single root <defs>, matching radial-input's pattern.\n // Compute marker content first so the defs list is populated, then\n // reference both in the template below.\n const markerDefs: unknown[] = [];\n const handleGroups = this.#isMultiHandle()\n ? handles.map(h => this.#renderHandleGroup(h, this.#renderValueMarker(h, markerDefs)))\n : this.#renderHandleGroup(undefined, this.#renderValueMarker(undefined, markerDefs));\n\n return html`\n <svg\n class=\"slider-svg\"\n viewBox=\"${this.#viewBox()}\"\n preserveAspectRatio=\"none\"\n tabindex=\"-1\"\n style=\"cursor: ${cursor}; width: 100%; height: 100%;\"\n @pointerdown=\"${this.#onPointerDown}\"\n @pointermove=\"${this.#onPointerMoveCursor}\"\n @pointerleave=\"${this.#onPointerLeaveCursor}\"\n @keydown=\"${this.#onKeyDown}\"\n @focusin=\"${this.#onFocusIn}\"\n >\n ${markerDefs.length > 0 ? svg`<defs>${markerDefs}</defs>` : svg``}\n ${this.#renderTrack()}\n ${lanes.map(lane => this.#renderLane(lane))}\n ${this.#renderMidpointMarker()}\n ${handleGroups}\n </svg>\n `;\n }\n\n /**\n * Compute the cursor for the current pointer position. The mapping:\n * - `grab` over a marker handle (single A, or multi A/B/C)\n * - `move` over a draggable segment (between A and B when value-drag is on)\n * - `pointer` over empty track where clicking sets a value (single mode,\n * or the dead zones outside A/B in multi mode)\n * - `default` over no-op segments (between A and B in dual mode when\n * value-drag is none, or between A-C/C-B in triple when value-drag is none)\n * - `not-allowed` when disabled\n *\n * `relativeValue` is in the host's long-axis space (0 = start, 1 = end,\n * already flipped for vertical). For unipolar single mode, the value\n * bar's marker positions are computed in the same space; the abs(2x-1)\n * remap only applies when setting the value on click/drag.\n */\n #cursorAtRelative(relativeValue: number): string {\n if (this.disabled)\n return `not-allowed`;\n if (this.#dragging)\n return `grabbing`;\n\n const HANDLE_HIT = 0.06;\n\n if (this.valueMode === `single`) {\n if (this.singleStyle === `unipolar`) {\n // In unipolar the bar is symmetric around the track centre; the\n // value bar's two ends sit at `0.5 ± value/2`.\n const halfLen = this.#getRelativeValueA() / 2;\n const low = 0.5 - halfLen;\n const high = 0.5 + halfLen;\n if (\n Math.abs(relativeValue - low) < HANDLE_HIT\n || Math.abs(relativeValue - high) < HANDLE_HIT\n ) {\n return `grab`;\n }\n return `pointer`;\n }\n const aRel = this.#getRelativeValueA();\n if (Math.abs(relativeValue - aRel) < HANDLE_HIT) {\n return `grab`;\n }\n return `pointer`;\n }\n\n const aRel = this.#getRelativeValueA();\n const bRel = this.#getRelativeValueB();\n const lo = Math.min(aRel, bRel);\n const hi = Math.max(aRel, bRel);\n\n // Over a handle: grab\n if (Math.abs(relativeValue - aRel) < HANDLE_HIT)\n return `grab`;\n if (Math.abs(relativeValue - bRel) < HANDLE_HIT)\n return `grab`;\n if (this.valueMode === `triple`) {\n const cRel = this.#getRelativeValueC();\n if (Math.abs(relativeValue - cRel) < HANDLE_HIT)\n return `grab`;\n }\n\n // Inside the segment between A and B\n if (relativeValue > lo && relativeValue < hi) {\n return this.valueDrag !== `none` ? `move` : `default`;\n }\n\n // Outside A/B (dead zone) — clicking here jumps A or B to that position\n return `pointer`;\n }\n\n #onPointerMoveCursor = (event: PointerEvent): void => {\n const svg = this.renderRoot.querySelector(`svg.slider-svg`) as SVGElement | null;\n if (!svg)\n return;\n this.#lastPointerClient = { x: event.clientX, y: event.clientY };\n const clientPos = this.orientation === `vertical` ? event.clientY : event.clientX;\n // Unipolar click mapping is NOT applied here — it's only for click-to-set;\n // the cursor needs the track-relative position to find the markers.\n const relativeValue = this.#relativeFromTrackPos(clientPos);\n const cursor = this.#cursorAtRelative(relativeValue);\n if (svg.style.cursor !== cursor) {\n svg.style.cursor = cursor;\n }\n };\n\n #onPointerLeaveCursor = (): void => {\n // Reset to the default cursor (whatever the host sets) when the pointer\n // leaves the slider area, so the cursor doesn't stay stuck on `grab` etc.\n const svg = this.renderRoot.querySelector(`svg.slider-svg`) as SVGElement | null;\n if (!svg)\n return;\n const cursor = this.disabled ? `not-allowed` : `default`;\n if (svg.style.cursor !== cursor) {\n svg.style.cursor = cursor;\n }\n };\n\n protected override updated(changed: PropertyValues): void {\n super.updated(changed);\n\n // Update --value-relative / min/max/c CSS variables unconditionally\n if (this.valueMode === `single`) {\n this.style.setProperty(`--value-relative`, this.#getRelativeValueA().toString());\n } else {\n const lo = valueToRelative(this.#low(), this.min, this.max);\n const hi = valueToRelative(this.#high(), this.min, this.max);\n this.style.setProperty(`--value-min-relative`, lo.toString());\n this.style.setProperty(`--value-max-relative`, hi.toString());\n this.style.setProperty(`--value-relative`, hi.toString());\n if (this.valueMode === `triple` && this.#poleC !== undefined) {\n this.style.setProperty(`--value-c-relative`, valueToRelative(this.#poleC, this.min, this.max).toString());\n }\n }\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.removeEventListener(`keydown`, this.#onHostKeyDown);\n this.removeEventListener(`pointerdown`, this.#onSwipePointerDown as EventListener);\n this.removeEventListener(`pointermove`, this.#onSwipePointerMove as EventListener);\n this.removeEventListener(`pointerenter`, this.#onSwipePointerEnter as EventListener);\n this.#gradientObserver?.disconnect();\n this.#gradientObserver = undefined;\n this.#sizeObserver?.disconnect();\n this.#sizeObserver = undefined;\n if (this.#changeDebounceTimer !== undefined) {\n clearTimeout(this.#changeDebounceTimer);\n this.#changeDebounceTimer = undefined;\n }\n this.#onPointerUp();\n }\n\n static override styles = [themeFallbacks, prominenceStyles, css`\n :host {\n display: inline-block;\n width: 200px;\n height: 12px;\n touch-action: none;\n user-select: none;\n tabindex: 0;\n --value-relative: 0;\n --value-min-relative: 0;\n --value-max-relative: 0;\n --value-c-relative: 0;\n\n --lane-width: 0.16;\n }\n\n :host([orientation=\"vertical\"]) {\n width: 12px;\n height: 200px;\n }\n\n :host([disabled]) {\n cursor: not-allowed;\n }\n\n :host {\n outline: none;\n }\n\n :host(:focus-visible) {\n outline: var(--slider-input-svg-focus-outline, 2px solid var(--accent));\n outline-offset: var(--slider-input-svg-focus-outline-offset, 2px);\n }\n\n svg.slider-svg {\n display: block;\n width: 100%;\n height: 100%;\n outline: none;\n overflow: visible;\n }\n\n svg.slider-svg:focus {\n outline: none;\n }\n\n svg.slider-svg:focus-visible {\n outline: var(--slider-input-svg-focus-outline, 2px solid var(--accent));\n outline-offset: var(--slider-input-svg-focus-outline-offset, 2px);\n }\n\n .track {\n stroke: var(--track-color, var(--surface-4));\n /* Default 0 (not the stroke-width=\"0\" attribute below, which this\n rule overrides): the lanes carry the default visuals, so the rect\n is an opt-in backdrop via --track-fill / --track-width. A nonzero\n default here ballooned with the tight viewBox (2 units ≈ 60% of\n the cross axis) and swamped the lanes. */\n stroke-width: var(--track-width, 0);\n }\n\n .lane {\n fill: none;\n /* Rounded ends by default; set --lane-linecap: butt for square ends\n (reads cleaner under a needle/line marker). The inline style on the\n <path> repeats this so it wins over authored .lane rules. */\n stroke-linecap: var(--lane-linecap, round);\n stroke-dasharray: var(--lane-dasharray, none);\n stroke-dashoffset: var(--lane-dashoffset, 0);\n vector-effect: non-scaling-stroke;\n }\n\n .lane[data-lane-key='track'] {\n stroke: var(--lane-track-color, var(--surface-4));\n }\n\n .lane[data-lane-key='value'] {\n stroke: var(--lane-value-color, var(--accent));\n }\n\n .lane:not([data-lane-key='track']):not([data-lane-key='value']) {\n stroke: var(--lane-color, var(--accent));\n }\n\n .value-marker > path:not(.marker-border):not(.marker-fill),\n .value-marker > .marker-fill {\n stroke: var(--marker-color, var(--accent));\n stroke-width: calc(var(--marker-thickness, 0.15) * 12px);\n stroke-linecap: round;\n stroke-dasharray: var(--marker-dasharray, none);\n stroke-dashoffset: var(--marker-dashoffset, 0);\n vector-effect: non-scaling-stroke;\n }\n\n .value-marker > .marker-border {\n stroke: var(--marker-border-color, transparent);\n stroke-width: calc((var(--marker-thickness, 0.15) + var(--marker-border-width, 0) * 2) * 12px);\n stroke-linecap: round;\n vector-effect: non-scaling-stroke;\n }\n\n .value-marker .marker-fill,\n .value-marker circle,\n .value-marker polygon {\n fill: var(--marker-color, var(--accent));\n stroke-width: calc(var(--marker-thickness, 0.15) * 12px);\n }\n\n .value-marker[data-handle=\"a\"] > path:not(.marker-border):not(.marker-fill),\n .value-marker[data-handle=\"a\"] > .marker-fill,\n .value-marker[data-handle=\"a\"] > circle,\n .value-marker[data-handle=\"a\"] > polygon {\n stroke: var(--marker-a-color, var(--marker-color, var(--accent)));\n fill: var(--marker-a-color, var(--marker-color, var(--accent)));\n }\n\n .value-marker[data-handle=\"b\"] > path:not(.marker-border):not(.marker-fill),\n .value-marker[data-handle=\"b\"] > .marker-fill,\n .value-marker[data-handle=\"b\"] > circle,\n .value-marker[data-handle=\"b\"] > polygon {\n stroke: var(--marker-b-color, var(--marker-color, var(--accent)));\n fill: var(--marker-b-color, var(--marker-color, var(--accent)));\n }\n\n .value-marker[data-handle=\"c\"] > path:not(.marker-border):not(.marker-fill),\n .value-marker[data-handle=\"c\"] > .marker-fill,\n .value-marker[data-handle=\"c\"] > circle,\n .value-marker[data-handle=\"c\"] > polygon {\n stroke: var(--marker-c-color, var(--marker-color, var(--accent)));\n fill: var(--marker-c-color, var(--marker-color, var(--accent)));\n }\n\n .midpoint-marker line {\n stroke: var(--midpoint-color, var(--surface-muted-text));\n stroke-width: var(--midpoint-thickness, 1px);\n stroke-linecap: round;\n vector-effect: non-scaling-stroke;\n }\n\n .midpoint-marker circle {\n fill: var(--midpoint-color, var(--surface-muted-text));\n stroke: var(--midpoint-border-color, transparent);\n stroke-width: var(--midpoint-border-width, 0);\n vector-effect: non-scaling-stroke;\n }\n `];\n}\n\n// ─── Tag-name registration ───────────────────────────────────────────\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ixfx-slider-input': SliderInputElement;\n }\n}\n\n// ─── Module-scope interface merge (typed addEventListener) ─────────────\nexport interface SliderInputElement {\n addEventListener: (<K extends keyof SliderInputElementEventMap>(\n type: K,\n listener: (this: SliderInputElement, event: SliderInputElementEventMap[K]) => void,\n options?: boolean | AddEventListenerOptions,\n ) => void) & ((\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | AddEventListenerOptions,\n ) => void);\n}\n"],"mappings":";;;;;;;;;;;;;;AAwCA,SAAgB,eACd,aACA,QAAA,IACA,aAAA,GACA,WAAA,GACa;CACb,MAAM,aAAa;CACnB,MAAM,WAAA,MAAkB;CACxB,IAAI,gBAAgB,cAClB,OAAO;EACL;EACA;EACA,SAAS,aAAa,YAAY;EAClC;EACA,aAAa,QAAQ;CACvB;CAKF,OAAO;EACL;EACA;EACA,SAAS,aAAa,YAAY;EAClC;EACA,aAAa,QAA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