{"version":3,"sources":["../src/components/GlassButton/GlassButton.tsx","../src/engine/press.ts","../src/engine/spring.ts","../src/engine/selection.ts","../src/engine/refraction.ts","../src/engine/mirror.ts","../src/engine/quality.ts","../src/engine/haptics.ts","../src/components/GlassCard/GlassCard.tsx","../src/components/GlassInput/GlassInput.tsx","../src/components/internal/Symbol.tsx","../src/components/internal/inputSymbols.ts","../src/components/GlassSheet/GlassSheet.tsx","../src/components/GlassMenu/GlassMenu.tsx","../src/components/GlassNav/GlassNav.tsx","../src/components/internal/LensTrack.tsx","../src/engine/lensTrack.ts","../src/components/GlassSegmented/GlassSegmented.tsx","../src/components/GlassSlider/GlassSlider.tsx","../src/components/GlassSwitch/GlassSwitch.tsx","../src/filters/LiquidGlassFilter.tsx","../src/hooks/useGlassEffect.ts","../src/hooks/useGlassAnimation.ts"],"sourcesContent":["import React, { useImperativeHandle, useRef } from 'react';\nimport { usePress } from '../../engine/press';\nimport { useRefraction } from '../../engine/refraction';\nimport { haptic } from '../../engine/haptics';\nimport './GlassButton.css';\n\nexport interface GlassButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n  /** Refraction strength from 1 (subtle) to 10 (heavy). Default 5. */\n  intensity?: number;\n  /** Any CSS colour. Colours the label (`tinted`) or the fill (`filled`). Default accent blue. */\n  tint?: string;\n  /** Light bloom under the finger while pressed. Default true. */\n  shimmer?: boolean;\n  /** Rim bevel scale (1–4). Wider bevels bend more of the backdrop. Default 1. */\n  thickness?: number;\n  /** Height preset: 36 / 44 / 52 px. Default 'md'. */\n  size?: 'sm' | 'md' | 'lg';\n  /**\n   * `glass` (alias `default`) regular glass · `clear` (alias `ghost`) see-through\n   * glass · `tinted` glass with a coloured label · `tinted-filled` a soft wash\n   * of the colour with a label in that colour · `filled` solid colour.\n   * Combine with `tint` for any colour, or `destructive` for red.\n   */\n  variant?: 'glass' | 'default' | 'clear' | 'ghost' | 'tinted' | 'tinted-filled' | 'filled' | 'destructive';\n  /** Marks a delete / irreversible action: red label, or red fill with `filled`. */\n  destructive?: boolean;\n  /** Leading icon. With no children the button becomes a circle. */\n  icon?: React.ReactNode;\n  /**\n   * Renders a real link (`<a>`) instead of a button, so it opens in a new tab\n   * with cmd/ctrl-click and shows its URL on hover. Use with `target`/`rel`.\n   */\n  href?: string;\n  target?: string;\n  rel?: string;\n  children?: React.ReactNode;\n}\n\nexport const GlassButton = React.forwardRef<HTMLButtonElement, GlassButtonProps>(\n  (\n    {\n      intensity = 5,\n      tint,\n      shimmer = true,\n      thickness = 1,\n      size = 'md',\n      variant = 'glass',\n      destructive = false,\n      icon,\n      className,\n      style,\n      children,\n      type = 'button',\n      href,\n      target,\n      rel,\n      onPointerDown,\n      ...rest\n    },\n    forwardedRef,\n  ) => {\n    const ref = useRef<HTMLButtonElement>(null);\n    useImperativeHandle(forwardedRef, () => ref.current!);\n\n    const level = Math.max(1, Math.min(10, intensity));\n    const height = size === 'sm' ? 36 : size === 'lg' ? 52 : 44;\n    usePress(ref, { disabled: rest.disabled });\n    useRefraction(ref, {\n      kind: 'surface',\n      strength: level / 5,\n      bezel: Math.min(height * 0.36, 22) * Math.max(0.5, thickness),\n    });\n\n    const iconOnly = icon != null && (children == null || children === false);\n    // `destructive` as a variant predates the flag; both mean a red tint.\n    const red = destructive || variant === 'destructive';\n    const kind = variant === 'ghost' ? 'clear' : variant === 'default' || variant === 'destructive' ? 'glass' : variant;\n\n    const classes = ['lg-glass', 'lg-button', `lg-button--${size}`, `lg-button--${kind}`, className]\n      .filter(Boolean)\n      .join(' ');\n\n    // A link keeps the same look and press, but is an anchor for the browser.\n    // Not draggable, so moving the finger stretches the glass instead of picking up the link.\n    const Element = (href != null ? 'a' : 'button') as 'button';\n    const link =\n      href != null\n        ? ({ href, target, rel: rel ?? (target === '_blank' ? 'noopener noreferrer' : undefined), draggable: false } as object)\n        : { type };\n\n    return (\n      <Element\n        ref={ref}\n        {...link}\n        className={classes}\n        data-liquid-glass=\"\"\n        data-icon-only={iconOnly ? '' : undefined}\n        data-shimmer={shimmer ? '' : undefined}\n        data-destructive={red ? '' : undefined}\n        style={tint ? ({ '--lg-tint': tint, ...style } as React.CSSProperties) : style}\n        onPointerDown={(event) => {\n          if (!rest.disabled) haptic();\n          onPointerDown?.(event);\n        }}\n        {...rest}\n      >\n        {icon != null && <span className=\"lg-button__icon\">{icon}</span>}\n        {!iconOnly && children != null && <span className=\"lg-button__label\">{children}</span>}\n      </Element>\n    );\n  },\n);\n\nGlassButton.displayName = 'GlassButton';\n","/**\n * The Liquid Glass touch response: the shape swells under the finger, leans\n * and stretches toward a drag like a droplet held by surface tension, lights\n * up where it's touched, then lets go with a soft jelly wobble.\n */\nimport { useEffect } from 'react';\nimport { SPRINGS, createSpring, rubberband, springFrom } from './spring';\nimport { guardSelection } from './selection';\n\n/** Finger-following feel: quick but never twitchy. */\nconst FOLLOW = springFrom(0.2, 0.82);\n\nexport interface PressOptions {\n  /** Swell on touch as a fraction (0.14 = 14%). Defaults to iOS sizing: small\n   *  circles swell ~20%, wide pills ~10%. Mouse presses swell a little less. */\n  grow?: number;\n  /** How far (px) the shape may lean toward a drag. */\n  lean?: number;\n  /** Max anisotropic stretch while dragging (0.1 = 10%). */\n  stretch?: number;\n  disabled?: boolean;\n}\n\nexport function usePress(ref: React.RefObject<HTMLElement | null>, options: PressOptions = {}) {\n  const { grow, lean = 10, stretch = 0.2, disabled = false } = options;\n\n  useEffect(() => {\n    const el = ref.current;\n    if (!el || disabled) return;\n\n    const v = { sx: 1, sy: 1, tx: 0, ty: 0 };\n    const paint = () => {\n      el.style.scale = `${v.sx} ${v.sy}`;\n      el.style.translate = `${v.tx}px ${v.ty}px`;\n    };\n    const springs = (['sx', 'sy', 'tx', 'ty'] as const).map((key) =>\n      createSpring(key[0] === 's' ? 1 : 0, SPRINGS.release, (value) => {\n        v[key] = value;\n        paint();\n      }),\n    );\n    const to = (targets: number[], feel: typeof SPRINGS.press) =>\n      springs.forEach((s, i) => {\n        s.tune(feel);\n        s.set(targets[i]);\n      });\n\n    let pointer: { id: number; x: number; y: number; box: DOMRect; base: number; w: number; h: number } | null = null;\n\n    const light = (event: PointerEvent, box: DOMRect) => {\n      el.style.setProperty('--lg-x', `${((event.clientX - box.left) / box.width) * 100}%`);\n      el.style.setProperty('--lg-y', `${((event.clientY - box.top) / box.height) * 100}%`);\n    };\n\n    const track = (event: PointerEvent) => {\n      if (!pointer) return;\n      const { box, base, w, h } = pointer;\n      light(event, box);\n      const dx = event.clientX - pointer.x;\n      const dy = event.clientY - pointer.y;\n      const dist = Math.hypot(dx, dy);\n      // Surface tension: the drop stays held in its place and is drawn out\n      // toward the finger, like taffy. The far edge barely moves; only the\n      // near edge reaches, saturating so it never tears free. The stretch\n      // blends with direction (cos²/sin²), so a sideways drag morphs into a\n      // downward one instead of flipping.\n      const cx = dist ? (dx / dist) ** 2 : 0;\n      const cy = dist ? (dy / dist) ** 2 : 0;\n      const span = Math.min(w * cx + h * cy, 64);\n      const reach = rubberband(dist, span * stretch * 2, 0.55);\n      const ex = (reach * cx) / w;\n      const ey = (reach * cy) / h;\n      // Half the added length shifts the centre, pinning the trailing edge;\n      // a small lean on top lets the whole drop give a little.\n      const tx = Math.sign(dx) * (reach * cx * base) / 2 + rubberband(dx, lean * 0.6, 0.4);\n      const ty = Math.sign(dy) * (reach * cy * base) / 2 + rubberband(dy, lean * 0.6, 0.4);\n      to([base * (1 + ex - ey * 0.35), base * (1 + ey - ex * 0.35), tx, ty], FOLLOW);\n    };\n\n    const move = (event: PointerEvent) => {\n      if (event.pointerId === pointer?.id) track(event);\n    };\n\n    const up = (event?: PointerEvent) => {\n      if (event && event.pointerId !== pointer?.id) return;\n      pointer = null;\n      delete el.dataset.pressed;\n      window.removeEventListener('pointermove', move);\n      window.removeEventListener('pointerup', up);\n      window.removeEventListener('pointercancel', up);\n      to([1, 1, 0, 0], SPRINGS.release);\n    };\n\n    const down = (event: PointerEvent) => {\n      if (!event.isPrimary || event.button !== 0 || pointer) return;\n      if ((el as HTMLButtonElement).disabled || el.getAttribute('aria-disabled') === 'true') return;\n      const box = el.getBoundingClientRect();\n      const w = el.offsetWidth || 1;\n      const h = el.offsetHeight || 1;\n      const natural = Math.min(0.22, Math.max(0.07, 9 / Math.sqrt(w * h)));\n      const amount = (grow ?? natural) * (event.pointerType === 'mouse' ? 0.75 : 1);\n      const base = 1 + amount;\n      pointer = { id: event.pointerId, x: event.clientX, y: event.clientY, box, base, w, h };\n      el.dataset.pressed = '';\n      light(event, box);\n      to([base, base, 0, 0], SPRINGS.press);\n      window.addEventListener('pointermove', move);\n      window.addEventListener('pointerup', up);\n      window.addEventListener('pointercancel', up);\n    };\n\n    const blur = () => up();\n    // Older iOS ignores touch-action on some elements; a held press owns the gesture.\n    const hold = (event: TouchEvent) => {\n      if (pointer && event.cancelable) event.preventDefault();\n    };\n    // A link or image inside the glass would otherwise be picked up by the\n    // browser's own drag (Safari shows a floating link and steals the\n    // pointer), so the glass stops following until the drag is pulled\n    // further. Pressed glass is held, never dragged out.\n    const noDrag = (event: DragEvent) => event.preventDefault();\n    el.setAttribute('data-lg-press', '');\n    el.addEventListener('dragstart', noDrag);\n    const unguard = guardSelection(el);\n    el.addEventListener('touchmove', hold, { passive: false });\n    el.addEventListener('pointerdown', down);\n    window.addEventListener('blur', blur);\n    return () => {\n      up();\n      springs.forEach((s) => s.stop());\n      unguard();\n      el.removeEventListener('pointerdown', down);\n      el.removeEventListener('touchmove', hold);\n      el.removeEventListener('dragstart', noDrag);\n      el.removeAttribute('data-lg-press');\n      window.removeEventListener('blur', blur);\n      el.style.removeProperty('scale');\n      el.style.removeProperty('translate');\n    };\n  }, [ref, grow, lean, stretch, disabled]);\n}\n","/**\n * Closed-form damped harmonic springs, stepped on a shared rAF loop.\n *\n * Each spring is solved analytically per frame (no Euler drift), so stiff\n * presses stay stable and soft releases wobble exactly as tuned.\n */\n\nexport interface SpringConfig {\n  /** Spring constant k (mass is 1). */\n  stiffness: number;\n  /** Damping coefficient c. ζ = c / (2√k); below 1 it overshoots. */\n  damping: number;\n}\n\nexport interface Spring {\n  readonly value: number;\n  readonly velocity: number;\n  readonly target: number;\n  /** Animate toward `target`. `instant` jumps there. */\n  set(target: number, instant?: boolean): void;\n  /** Change the feel mid-flight without losing velocity. */\n  tune(config: SpringConfig): void;\n  /** Give the spring a kick (px/s or units/s). */\n  impulse(velocity: number): void;\n  stop(): void;\n}\n\ninterface State {\n  value: number;\n  target: number;\n  velocity: number;\n  k: number;\n  c: number;\n  onUpdate: (value: number, velocity: number) => void;\n}\n\nconst active = new Set<State>();\nlet frame = 0;\nlet last = 0;\n\nfunction step(s: State, dt: number) {\n  const x = s.value - s.target;\n  const v = s.velocity;\n  const half = s.c / 2;\n  const disc = half * half - s.k;\n\n  if (Math.abs(disc) < 1e-6) {\n    // Critically damped\n    const decay = Math.exp(-half * dt);\n    const b = v + half * x;\n    s.value = s.target + decay * (x + b * dt);\n    s.velocity = decay * (v - half * b * dt);\n  } else if (disc > 0) {\n    // Overdamped\n    const root = Math.sqrt(disc);\n    const r1 = -half + root;\n    const r2 = -half - root;\n    const a = (v - r2 * x) / (r1 - r2);\n    const b = x - a;\n    const e1 = Math.exp(r1 * dt);\n    const e2 = Math.exp(r2 * dt);\n    s.value = s.target + a * e1 + b * e2;\n    s.velocity = a * r1 * e1 + b * r2 * e2;\n  } else {\n    // Underdamped: the jiggle\n    const w = Math.sqrt(-disc);\n    const decay = Math.exp(-half * dt);\n    const cos = Math.cos(w * dt);\n    const sin = Math.sin(w * dt);\n    s.value = s.target + decay * (x * cos + ((v + half * x) / w) * sin);\n    s.velocity = decay * (v * cos - ((half * v + s.k * x) / w) * sin);\n  }\n}\n\nfunction loop(time: number) {\n  frame = 0;\n  const dt = Math.min(0.064, Math.max(0, (time - last) / 1000));\n  last = time;\n  // A snapshot: an update may wake another spring (a drag feeding its\n  // jelly), which must wait for the next frame rather than be revisited.\n  for (const s of [...active]) {\n    step(s, dt);\n    if (Math.abs(s.value - s.target) < 1e-4 && Math.abs(s.velocity) < 1e-3) {\n      s.value = s.target;\n      s.velocity = 0;\n      active.delete(s);\n    }\n    s.onUpdate(s.value, s.velocity);\n  }\n  // A spring woken during this pass has already queued the next frame;\n  // queueing another would double the loop every frame.\n  if (active.size && !frame) frame = requestAnimationFrame(loop);\n}\n\nfunction wake() {\n  if (frame) return;\n  last = performance.now();\n  frame = requestAnimationFrame(loop);\n}\n\nexport function prefersReducedMotion(): boolean {\n  return typeof matchMedia === 'function' && matchMedia('(prefers-reduced-motion: reduce)').matches;\n}\n\nexport function createSpring(\n  initial: number,\n  config: SpringConfig,\n  onUpdate: (value: number, velocity: number) => void,\n): Spring {\n  const s: State = {\n    value: initial,\n    target: initial,\n    velocity: 0,\n    k: config.stiffness,\n    c: config.damping,\n    onUpdate,\n  };\n\n  return {\n    get value() {\n      return s.value;\n    },\n    get velocity() {\n      return s.velocity;\n    },\n    get target() {\n      return s.target;\n    },\n    set(target, instant = false) {\n      s.target = target;\n      if (instant || prefersReducedMotion() || (typeof document !== 'undefined' && document.hidden)) {\n        s.value = target;\n        s.velocity = 0;\n        active.delete(s);\n        onUpdate(s.value, 0);\n        return;\n      }\n      active.add(s);\n      wake();\n    },\n    tune(next) {\n      s.k = next.stiffness;\n      s.c = next.damping;\n    },\n    impulse(velocity) {\n      s.velocity += velocity;\n      active.add(s);\n      wake();\n    },\n    stop() {\n      active.delete(s);\n    },\n  };\n}\n\n/** Converts Apple-style (response, dampingFraction) into k/c. */\nexport function springFrom(response: number, dampingFraction: number): SpringConfig {\n  const w = (2 * Math.PI) / response;\n  return { stiffness: w * w, damping: 2 * dampingFraction * w };\n}\n\n/** Feel presets, tuned by eye against iOS 26 screen recordings. */\nexport const SPRINGS = {\n  /** Finger down: quick, almost no overshoot. */\n  press: springFrom(0.22, 0.86),\n  /** Finger up: soft settle with the gentle jelly wobble. */\n  release: springFrom(0.42, 0.5),\n  /** Following the finger during a drag. */\n  drag: springFrom(0.12, 0.92),\n  /** Sliding into a new slot after release. */\n  snap: springFrom(0.36, 0.72),\n  /** Lens inflating out of a selection pill. */\n  lift: springFrom(0.26, 0.78),\n  /** Lens deflating back into a pill: visibly wobbly. */\n  settle: springFrom(0.45, 0.46),\n  /** Colour cross-fades. */\n  fade: springFrom(0.3, 1),\n  /** A dragged lens's stretch: loose, so it wobbles when the drag stops. */\n  jelly: springFrom(0.3, 0.3),\n} as const;\n\n/**\n * Speed-driven stretch for a dragged droplet. Feed it the travel velocity\n * every frame: the faster the drag the more it stretches (easing off so a\n * flick never smears it), and when the motion slows or stops the stretch\n * springs back past round and wobbles once or twice before it settles.\n * The value is positive when stretched along the path, negative when the\n * rebound briefly makes it narrower and taller.\n */\nexport function createJelly(onUpdate: (stretch: number) => void, max: number, speed: number) {\n  const spring = createSpring(0, SPRINGS.jelly, (value) => onUpdate(value));\n  return {\n    feed(velocity: number, reach = max) {\n      spring.set(reach * Math.tanh(Math.abs(velocity) / speed));\n    },\n    tune(next: SpringConfig) {\n      spring.tune(next);\n    },\n    stop() {\n      spring.stop();\n    },\n  };\n}\n\n/** iOS-style rubber banding for overscroll. */\nexport function rubberband(offset: number, dimension: number, constant = 0.55): number {\n  const sign = Math.sign(offset);\n  const x = Math.abs(offset);\n  return sign * (1 - 1 / ((x * constant) / dimension + 1)) * dimension;\n}\n\nexport const clamp = (value: number, min: number, max: number) => Math.min(max, Math.max(min, value));\n","/**\n * Holding or dragging a control must never select text. iOS starts a\n * selection from a long press and happily extends it into a neighbouring\n * label, so while a gesture that began on `el` is down, any new selection is\n * cancelled and a stray one is cleared. Returns a cleanup function.\n */\nexport function guardSelection(el: HTMLElement): () => void {\n  let held = false;\n  const block = (event: Event) => {\n    if (held) event.preventDefault();\n  };\n  const clear = () => {\n    const selection = window.getSelection?.();\n    if (selection && !selection.isCollapsed) selection.removeAllRanges();\n  };\n  const down = () => {\n    held = true;\n    clear();\n  };\n  const up = () => {\n    if (!held) return;\n    held = false;\n    clear();\n  };\n  el.addEventListener('pointerdown', down, true);\n  document.addEventListener('selectstart', block, true);\n  window.addEventListener('pointerup', up, true);\n  window.addEventListener('pointercancel', up, true);\n  return () => {\n    el.removeEventListener('pointerdown', down, true);\n    document.removeEventListener('selectstart', block, true);\n    window.removeEventListener('pointerup', up, true);\n    window.removeEventListener('pointercancel', up, true);\n  };\n}\n","/**\n * The refraction engine.\n *\n * For every glass shape we ray-trace a displacement field through a convex\n * squircle bevel using Snell's law, bake it to an image, and hand it to an SVG\n * `feDisplacementMap`. Chromium can run that filter on the live backdrop\n * (`backdrop-filter: url(#…)`), which bends whatever sits behind the glass.\n * Elsewhere (Safari, Firefox) lenses refract a live copy of what's beneath\n * with the same field, as a normal filter in box units. Every engine also\n * gets a baked specular rim.\n */\nimport { useEffect } from 'react';\n// Components reach the material through this module, so the tokens always load\n// even when a bundler skips the barrel's side effects.\nimport '../styles/base.css';\nimport { clamp } from './spring';\nimport { mirrorBackdrop } from './mirror';\nimport { governRefraction } from './quality';\n\nexport type GlassKind = 'surface' | 'lens';\n\nexport interface GlassShape {\n  /** `surface` bends the backdrop inward at the rim (bars, buttons, cards).\n   *  `lens` is a thick droplet: magnifies, bends outward and splits colour. */\n  kind?: GlassKind;\n  /** Width of the curved rim in px. */\n  bezel?: number;\n  /** Optical depth of the glass in px; deeper bends more. */\n  thickness?: number;\n  /** Index of refraction. Glass ≈ 1.5. */\n  ior?: number;\n  /** Interior magnification (lens only). 1 = none, below 1 minifies. */\n  zoom?: number;\n  /** Horizontal magnification of a copied lens, when it differs from `zoom`\n   *  (e.g. a switch knob thins the track without shortening it). */\n  zoomX?: number;\n  /** Chromatic split strength, 0–1. */\n  dispersion?: number;\n  /** Overall displacement multiplier. */\n  strength?: number;\n  /**\n   * Rim stretch, 0–1 (lens only). Instead of pulling in light from past the\n   * edge, the rim samples inward ever more steeply, so whatever sits under it\n   * smears out to the edge in streaks: the thick-droplet look of iOS tab bars.\n   */\n  stretch?: number;\n  /**\n   * Margin (px) along the top and bottom of a lens that stays clear and\n   * unbent, e.g. where a tab-bar lens rises past its bar: only the part over\n   * the bar refracts, so the bar's edge isn't pulled into a second outline.\n   */\n  inset?: number;\n  /**\n   * Draw the lens from a live copy of `mirror` in every browser, not only\n   * where backdrop refraction is missing. Needed for a minifying lens: a\n   * backdrop filter can't see past the element's own edge. `'refract'` also\n   * bends the copy at the rim where SVG filters run on elements (Chromium),\n   * so content the rim draws in is styled like the rest of the copy.\n   */\n  copy?: boolean | 'refract';\n  /**\n   * With a copied lens, never refract the live backdrop too (Chromium would):\n   * the glass behind the copy stays clear in every browser, so the lens looks\n   * the same everywhere.\n   */\n  copyOnly?: boolean;\n}\n\ninterface Baked {\n  filter: string;\n  rim: string;\n  /** Exact shape alpha (CSS mask for non-filter lenses): a crisp rim, like real glass. */\n  inner: string;\n}\n\nconst SVG_NS = 'http://www.w3.org/2000/svg';\nconst cache = new Map<string, Promise<Baked>>();\n\n/**\n * PNG-encodes the canvas off the main thread. toDataURL encodes in place and\n * held up the page for tens of ms per shape, enough to stutter a sheet rising\n * over glass. toBlob copies the pixels now (so the canvas can be redrawn at\n * once) and encodes in the background; the result is the same data URL.\n */\nfunction encode(canvas: HTMLCanvasElement): Promise<string> {\n  return new Promise((done) => {\n    if (typeof canvas.toBlob !== 'function' || typeof FileReader !== 'function') return done(canvas.toDataURL());\n    canvas.toBlob((blob) => {\n      if (!blob) return done(canvas.toDataURL());\n      const reader = new FileReader();\n      reader.onload = () => done(reader.result as string);\n      reader.onerror = () => done(canvas.toDataURL());\n      reader.readAsDataURL(blob);\n    });\n  });\n}\nlet defs: SVGDefsElement | null = null;\nlet counter = 0;\n\nfunction el<K extends keyof SVGElementTagNameMap>(name: K, attrs: Record<string, string | number>) {\n  const node = document.createElementNS(SVG_NS, name);\n  for (const key in attrs) node.setAttribute(key, String(attrs[key]));\n  return node;\n}\n\nfunction container(): SVGDefsElement {\n  if (defs?.isConnected) return defs;\n  const root = el('svg', { width: 0, height: 0, 'aria-hidden': 'true', 'data-liquid-glass-defs': '' });\n  root.style.cssText = 'position:absolute;width:0;height:0;overflow:hidden;pointer-events:none';\n  defs = el('defs', {});\n  root.append(defs);\n  document.body.append(root);\n  return defs;\n}\n\n/** Only Chromium runs SVG filters inside `backdrop-filter`. */\nexport function canRefractBackdrop(): boolean {\n  if (typeof navigator === 'undefined') return false;\n  const ua = navigator.userAgent;\n  return /Chrom(e|ium)\\/|Edg\\//.test(ua) && !/CriOS|FxiOS|EdgiOS/.test(ua);\n}\n\n/**\n * WebKit before Safari 26 (iOS 18 and older, every iOS browser there) paints\n * an SVG filter over a lens's live copy from stale tiles: as the lens moves,\n * glyphs inside it tear into fragments. CSS anchor positioning arrived in\n * Safari 26, so its absence tells those engines apart.\n */\nfunction filtersTearWhileMoving(): boolean {\n  if (typeof navigator === 'undefined' || typeof CSS === 'undefined') return false;\n  const ua = navigator.userAgent;\n  const webkit = /AppleWebKit\\//.test(ua) && !/Chrom(e|ium)\\/|Edg\\//.test(ua);\n  return webkit && !CSS.supports('anchor-name', '--lg');\n}\n\n/** Lateral shift (px) for light leaving the bevel, sampled across its width. */\nfunction bevelProfile(bezel: number, thickness: number, ior: number) {\n  const N = 256;\n  const out = new Float32Array(N);\n  for (let i = 0; i < N; i++) {\n    const t = Math.max(0.002, i / (N - 1));\n    const q = 1 - t;\n    // Convex squircle: h(t) = (1 - (1 - t)^4)^(1/4)\n    const base = 1 - q ** 4;\n    const height = base ** 0.25;\n    const slope = q ** 3 / Math.max(1e-4, base ** 0.75);\n    const incident = Math.atan(slope);\n    const refracted = Math.asin(Math.sin(incident) / ior);\n    out[i] = Math.tan(incident - refracted) * thickness * (0.35 + 0.65 * height);\n  }\n  return (distance: number) => {\n    if (distance < 0 || distance >= bezel) return 0;\n    const f = (distance / bezel) * (N - 1);\n    const i = Math.floor(f);\n    const a = out[i];\n    const b = out[Math.min(i + 1, N - 1)];\n    return a + (b - a) * (f - i);\n  };\n}\n\n/** Sets every pixel of `image` to one colour, a word at a time. */\nfunction fillPixels(image: ImageData, r: number, g: number, b: number, a: number) {\n  const word = new Uint32Array(new Uint8ClampedArray([r, g, b, a]).buffer)[0];\n  new Uint32Array(image.data.buffer, image.data.byteOffset, image.data.length / 4).fill(word);\n}\n\nfunction bake(width: number, height: number, radius: number, shape: Required<GlassShape>, pad = 0, simple = false, fringe = false, box = false): Promise<Baked> {\n  // `simple`: one displacement pass (edge bend + magnification baked into a\n  // single map), no colour split. Safari's GPU filter path renders chained\n  // displacement + arithmetic composites black, so its mirrors use this.\n  // `pad` widens the baked canvas around the shape: mirrored backdrops need\n  // room for light the rim bends in from beyond the glass's own edge.\n  // `box`: every filter unit is a fraction of the filtered element's box.\n  // WebKit only draws feImage maps and displacement scales right that way;\n  // in px units it misplaces the map and renders a colour split as nothing.\n  const W = width + pad * 2;\n  const H = height + pad * 2;\n  // Keep the bake under ~1M samples. The field is smooth, but the rim is a\n  // hairline: below about one sample per CSS pixel it breaks into dots on a\n  // large sheet, so big glass keeps close to full resolution. Only the rim\n  // band is computed per pixel (see `outer`), so this stays cheap.\n  let density = Math.min(typeof devicePixelRatio === 'number' ? devicePixelRatio : 1, 2);\n  while (W * H * density * density > 1_000_000 && density > 0.35) density *= 0.85;\n  const cw = Math.max(1, Math.ceil(W * density));\n  const ch = Math.max(1, Math.ceil(H * density));\n\n  const lens = shape.kind === 'lens';\n  const shift = bevelProfile(shape.bezel, shape.thickness, shape.ior);\n  // Below 1 the lens minifies (iOS switch knobs show the track slightly smaller).\n  const magnify = lens ? 1 - 1 / Math.max(0.5, shape.zoom) : 0;\n  const direction = lens ? 1 : -1;\n\n  const dx = new Float32Array(cw * ch);\n  const dy = new Float32Array(cw * ch);\n  const rimA = new Float32Array(cw * ch);\n  // Only lenses use these two; a surface skips them (writes past an empty\n  // typed array are no-ops), which halves a large sheet's working memory.\n  const rimHue = new Float32Array(lens && shape.dispersion > 0 ? cw * ch : 0);\n  const inside = new Float32Array(cw * ch);\n  // Where the rim compresses the backdrop hardest. feDisplacementMap samples\n  // without filtering, so there the bent image steps and aliases; it gets a\n  // touch of smoothing while the centre stays sharp.\n  const zone = new Float32Array(lens && !simple ? cw * ch : 0);\n  // Pixels outside the settled interior: the only ones whose outputs vary.\n  // Every pass below fills the interior in one go and visits just these.\n  const outer = new Int32Array(cw * ch);\n  let edges = 0;\n  let max = 0.0001;\n  let maxX = 0.0001;\n  let maxY = 0.0001;\n\n  const hw = width / 2;\n  const hh = height / 2;\n  const px1 = 1 / density;\n  // How much of the bend applies at a given height: all of it inside the band,\n  // fading to none across ~3px into the clear top/bottom margins.\n  const edge = hh - shape.inset;\n  const band = (py: number) => {\n    if (!shape.inset) return 1;\n    const t = clamp((Math.abs(py) - (edge - 2)) / 3, 0, 1);\n    return 1 - t * t * (3 - 2 * t);\n  };\n\n  // Deep inside the shape every output is settled: no bend (past the bevel),\n  // fully inside, outside the softening zone, and the rim's glow has decayed\n  // to nothing. Large surfaces are mostly interior, so this skips most of\n  // the per-pixel maths.\n  const flat = simple && magnify ? Infinity : Math.max(shape.bezel * 1.7, 5);\n\n  for (let y = 0; y < ch; y++) {\n    for (let x = 0; x < cw; x++) {\n      const px = ((x + 0.5) * W) / cw - W / 2;\n      const py = ((y + 0.5) * H) / ch - H / 2;\n\n      // Signed distance to a rounded rect (positive inside, from the edge).\n      const qx = Math.abs(px) - (hw - radius);\n      const qy = Math.abs(py) - (hh - radius);\n      const ox = Math.max(qx, 0);\n      const oy = Math.max(qy, 0);\n      const len = Math.hypot(ox, oy);\n      const d = radius - (len + Math.min(Math.max(qx, qy), 0));\n      if (d > flat) {\n        inside[y * cw + x] = 1;\n        continue;\n      }\n      outer[edges++] = y * cw + x;\n\n      let nx: number;\n      let ny: number;\n      if (len > 0) {\n        nx = (ox / len) * Math.sign(px);\n        ny = (oy / len) * Math.sign(py);\n      } else if (qx > qy) {\n        nx = Math.sign(px);\n        ny = 0;\n      } else {\n        nx = 0;\n        ny = Math.sign(py);\n      }\n\n      const i = y * cw + x;\n      // Stretch: the sample point moves inward by bezel·k·(1-u)², so at the\n      // edge it barely moves while the rim sweeps across it (k = 0.5 holds\n      // the image still at the very edge; more would fold it back).\n      const u = d / shape.bezel;\n      const s = (lens && shape.stretch > 0\n        ? d >= 0 && u < 1\n          ? -shape.bezel * shape.stretch * 0.5 * (1 - u) ** 2\n          : 0\n        : shift(d) * direction) * shape.strength * band(py);\n      // Edge bend only; magnification runs as its own pass so colour\n      // splits only where the glass actually curves.\n      let vx = nx * s;\n      let vy = ny * s;\n      if (simple && magnify) {\n        vx -= px * magnify * band(py);\n        vy -= py * magnify * band(py);\n      }\n      dx[i] = vx;\n      dy[i] = vy;\n      const m = Math.max(Math.abs(vx), Math.abs(vy));\n      if (m > max) max = m;\n      if (Math.abs(vx) > maxX) maxX = Math.abs(vx);\n      if (Math.abs(vy) > maxY) maxY = Math.abs(vy);\n\n      inside[i] = clamp(d / px1 + 0.5, 0, 1);\n      zone[i] = (d <= 0 ? 1 : clamp(1 - d / Math.max(1, shape.bezel), 0, 1) ** 1.3) * band(py);\n\n      if (d >= -px1) {\n        // Light falls from the upper left; Liquid Glass catches it on both\n        // diagonal corners (direct + internally reflected).\n        const facing = -(nx + ny) * Math.SQRT1_2;\n        const light = 0.22 + 0.78 * Math.abs(facing) ** 2.2 * (facing > 0 ? 1 : 0.62);\n        // A hairline, but never thinner than about a sample: sampled any\n        // finer it shows as dots once the bake drops below full resolution.\n        const hair = Math.max(0.55, px1 * 0.75);\n        const line = Math.exp(-(((d - hair) / hair) ** 2));\n        const inner = Math.exp(-((d / (shape.bezel * 0.55)) ** 2)) * 0.14;\n        const edgeAA = clamp(d / px1 + 1, 0, 1);\n        rimA[i] = clamp((line * (lens ? 0.95 : 0.7) + inner) * light * edgeAA, 0, 1);\n        rimHue[i] = Math.atan2(ny, nx);\n      }\n    }\n  }\n\n  const canvas = document.createElement('canvas');\n  canvas.width = cw;\n  canvas.height = ch;\n  const ctx = canvas.getContext('2d', { willReadFrequently: true })!;\n\n  // In box units a displacement scale s moves x by s·W and y by s·H, so each\n  // axis is encoded against its own side; in px both share one scale.\n  const scale = box ? 2 * Math.max(maxX / W, maxY / H) : max * 2;\n  const spanX = box ? (scale * W) / 2 : max;\n  const spanY = box ? (scale * H) / 2 : max;\n  const field = ctx.createImageData(cw, ch);\n  fillPixels(field, 128, 128, 128, 255);\n  for (let e = 0; e < edges; e++) {\n    const i = outer[e];\n    const o = i * 4;\n    field.data[o] = Math.round(127.5 + (dx[i] / spanX) * 127.5);\n    field.data[o + 1] = Math.round(127.5 + (dy[i] / spanY) * 127.5);\n    field.data[o + 2] = 128;\n    field.data[o + 3] = 255;\n  }\n  ctx.putImageData(field, 0, 0);\n  const map = encode(canvas);\n\n  const reach = Math.max(W, H) / 2;\n  let zoomMap: Promise<string> = Promise.resolve('');\n  if (magnify && !simple) {\n    const ramp = ctx.createImageData(cw, ch);\n    for (let y = 0; y < ch; y++) {\n      for (let x = 0; x < cw; x++) {\n        const o = (y * cw + x) * 4;\n        const px = ((x + 0.5) * W) / cw - W / 2;\n        const py = ((y + 0.5) * H) / ch - H / 2;\n        const k = band(py);\n        ramp.data[o] = Math.round(127.5 - (px / (box ? W / 2 : reach)) * 127.5 * k);\n        ramp.data[o + 1] = Math.round(127.5 - (py / (box ? H / 2 : reach)) * 127.5 * k);\n        ramp.data[o + 2] = 128;\n        ramp.data[o + 3] = 255;\n      }\n    }\n    ctx.putImageData(ramp, 0, 0);\n    zoomMap = encode(canvas);\n  }\n\n  const shine = ctx.createImageData(cw, ch);\n  fillPixels(shine, 255, 255, 255, 0);\n  for (let e = 0; e < edges; e++) {\n    const i = outer[e];\n    const o = i * 4;\n    let r = 255;\n    let g = 255;\n    let b = 255;\n    if (lens && shape.dispersion > 0) {\n      // Iridescent rim on lenses: hue drifts around the edge.\n      const h = rimHue[i];\n      const k = 0.14 * shape.dispersion;\n      r = 255 * (1 - k + k * (0.5 + 0.5 * Math.cos(h)));\n      g = 255 * (1 - k + k * (0.5 + 0.5 * Math.cos(h - 2.1)));\n      b = 255 * (1 - k + k * (0.5 + 0.5 * Math.cos(h + 2.1)));\n    }\n    shine.data[o] = r;\n    shine.data[o + 1] = g;\n    shine.data[o + 2] = b;\n    shine.data[o + 3] = Math.round(rimA[i] * 255);\n  }\n  ctx.putImageData(shine, 0, 0);\n  const rim = encode(canvas);\n\n  // Exact rounded-rect alpha: the filter's output is a rectangle, and bent\n  // light sampled past the rim must not leak into the corners.\n  const shapeMask = ctx.createImageData(cw, ch);\n  fillPixels(shapeMask, 255, 255, 255, 255);\n  for (let e = 0; e < edges; e++) {\n    const i = outer[e];\n    const o = i * 4;\n    shapeMask.data[o] = shapeMask.data[o + 1] = shapeMask.data[o + 2] = 255;\n    shapeMask.data[o + 3] = Math.round(inside[i] * 255);\n  }\n  ctx.putImageData(shapeMask, 0, 0);\n  const mask = encode(canvas);\n\n  let smooth: Promise<string> = Promise.resolve('');\n  if (lens && !simple) {\n    const soft = ctx.createImageData(cw, ch);\n    fillPixels(soft, 255, 255, 255, 0);\n    for (let e = 0; e < edges; e++) {\n      const i = outer[e];\n      const o = i * 4;\n      soft.data[o] = soft.data[o + 1] = soft.data[o + 2] = 255;\n      soft.data[o + 3] = Math.round(zone[i] * 255);\n    }\n    ctx.putImageData(soft, 0, 0);\n    smooth = encode(canvas);\n  }\n\n  return Promise.all([map, zoomMap, rim, mask, smooth]).then(([map, zoomMap, rim, mask, smooth]) =>\n    assemble(W, H, box, magnify, reach, scale, shape, simple, fringe, map, zoomMap, rim, mask, smooth),\n  );\n}\n\nfunction assemble(\n  W: number,\n  H: number,\n  box: boolean,\n  magnify: number,\n  reach: number,\n  scale: number,\n  shape: Required<GlassShape>,\n  simple: boolean,\n  fringe: boolean,\n  map: string,\n  zoomMap: string,\n  rim: string,\n  mask: string,\n  smooth: string,\n): Baked {\n  const id = `lg-refract-${++counter}`;\n  // Chromium (backdrop filters): primitive units in px, so displacement\n  // scales are real pixels and maps get explicit px sizes.\n  // Everywhere else (`box`): the filter and every primitive in the element's\n  // own box, the only form WebKit and Gecko draw correctly.\n  const area = box ? { x: 0, y: 0, width: 1, height: 1 } : { x: 0, y: 0, width: W, height: H };\n  const filter = el(\n    'filter',\n    box\n      ? { id, filterUnits: 'objectBoundingBox', primitiveUnits: 'objectBoundingBox', x: 0, y: 0, width: 1, height: 1, 'color-interpolation-filters': 'sRGB' }\n      : {\n          id,\n          // Generous region: the rim samples content from beyond the glass edge.\n          x: -0.25,\n          y: -0.25,\n          width: 1.5,\n          height: 1.5,\n          'color-interpolation-filters': 'sRGB',\n        },\n  );\n  filter.append(el('feImage', { href: map, ...area, preserveAspectRatio: 'none', result: 'field' }));\n  let source = 'SourceGraphic';\n  if (zoomMap) {\n    filter.append(\n      el('feImage', { href: zoomMap, ...area, preserveAspectRatio: 'none', result: 'zoom' }),\n      el('feDisplacementMap', {\n        in: 'SourceGraphic',\n        in2: 'zoom',\n        scale: box ? magnify : 2 * reach * magnify,\n        xChannelSelector: 'R',\n        yChannelSelector: 'G',\n        result: 'magnified',\n      }),\n    );\n    source = 'magnified';\n  }\n\n  if (shape.dispersion > 0 && !simple && fringe) {\n    // A transparent copy (glyphs, a track) can't be split by summing three\n    // single-channel images: where their alphas overlap the sum saturates and\n    // the glyph edges go grey. Instead the green ray is the image, and only\n    // light the red and blue rays carry past it shows, as a thin warm and cool\n    // fringe on either side of each edge (purple outside, green inside, as\n    // on iOS): the rainbow a water drop throws.\n    const spread = (shape.stretch > 0 ? 0.12 : 0.3) * shape.dispersion;\n    for (const [name, factor] of [['r', 1 + spread], ['g', 1], ['b', 1 - spread]] as const) {\n      filter.append(\n        el('feDisplacementMap', {\n          in: source,\n          in2: 'field',\n          scale: scale * factor,\n          xChannelSelector: 'R',\n          yChannelSelector: 'G',\n          result: `${name}-ray`,\n        }),\n      );\n    }\n    filter.append(\n      el('feComposite', { in: 'r-ray', in2: 'g-ray', operator: 'out', result: 'r-edge' }),\n      el('feColorMatrix', { in: 'r-edge', type: 'matrix', values: '0.2 0 0 0 0.62  0 0.2 0 0 0.16  0 0 0.2 0 0.8  0 0 0 1 0', result: 'warm' }),\n      el('feComposite', { in: 'b-ray', in2: 'g-ray', operator: 'out', result: 'b-edge' }),\n      el('feColorMatrix', { in: 'b-edge', type: 'matrix', values: '0.2 0 0 0 0.1  0 0.2 0 0 0.78  0 0 0.2 0 0.62  0 0 0 1 0', result: 'cool' }),\n      el('feMerge', {}),\n    );\n    const merge = filter.lastElementChild!;\n    for (const name of ['warm', 'cool', 'g-ray']) merge.append(el('feMergeNode', { in: name }));\n    merge.setAttribute('result', 'bent');\n  } else if (shape.dispersion > 0 && !simple) {\n    const spread = 0.16 * shape.dispersion;\n    const channels: Array<[string, number, string]> = [\n      ['r', 1 + spread, '1 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 1 0'],\n      ['g', 1, '0 0 0 0 0  0 1 0 0 0  0 0 0 0 0  0 0 0 1 0'],\n      ['b', 1 - spread, '0 0 0 0 0  0 0 0 0 0  0 0 1 0 0  0 0 0 1 0'],\n    ];\n    for (const [name, factor, matrix] of channels) {\n      filter.append(\n        el('feDisplacementMap', {\n          in: source,\n          in2: 'field',\n          scale: scale * factor,\n          xChannelSelector: 'R',\n          yChannelSelector: 'G',\n          result: `${name}-ray`,\n        }),\n        el('feColorMatrix', { in: `${name}-ray`, type: 'matrix', values: matrix, result: name }),\n      );\n    }\n    filter.append(\n      el('feComposite', { in: 'r', in2: 'g', operator: 'arithmetic', k2: 1, k3: 1, result: 'rg' }),\n      el('feComposite', { in: 'rg', in2: 'b', operator: 'arithmetic', k2: 1, k3: 1, result: 'bent' }),\n    );\n  } else {\n    filter.append(\n      el('feDisplacementMap', {\n        in: source,\n        in2: 'field',\n        scale,\n        xChannelSelector: 'R',\n        yChannelSelector: 'G',\n        result: 'bent',\n      }),\n    );\n  }\n  let out = 'bent';\n  const soften = shape.stretch > 0 ? 1.1 : 0.65;\n  if (smooth) {\n    // Blend a slightly softened copy in across the rim only.\n    filter.append(\n      // A stretched rim magnifies the pixel steps of whatever edge it smears,\n      // so it gets a little more softening.\n      el('feGaussianBlur', { in: 'bent', stdDeviation: box ? `${soften / W} ${soften / H}` : soften, result: 'bent-soft' }),\n      el('feImage', { href: smooth, ...area, preserveAspectRatio: 'none', result: 'rim-zone' }),\n      el('feComposite', { in: 'bent-soft', in2: 'rim-zone', operator: 'in', result: 'rim-soft' }),\n      el('feComposite', { in: 'bent', in2: 'rim-zone', operator: 'out', result: 'core' }),\n      el('feComposite', { in: 'rim-soft', in2: 'core', operator: 'arithmetic', k2: 1, k3: 1, result: 'smoothed' }),\n    );\n    out = 'smoothed';\n  }\n  filter.append(\n    el('feImage', { href: mask, ...area, preserveAspectRatio: 'none', result: 'shape' }),\n    el('feComposite', { in: out, in2: 'shape', operator: 'in' }),\n  );\n\n  container().append(filter);\n  return { filter: `url(#${id})`, rim: `url(\"${rim}\")`, inner: `url(\"${mask}\")` };\n}\n\nfunction resolve(shape: GlassShape, width: number, height: number): Required<GlassShape> {\n  const kind = shape.kind ?? 'surface';\n  const short = Math.min(width, height);\n  const lens = kind === 'lens';\n  return {\n    kind,\n    bezel: shape.bezel ?? (lens ? short * 0.32 : clamp(short * 0.2, 5, 16)),\n    thickness: shape.thickness ?? (lens ? short * 0.55 : clamp(short * 0.32, 8, 26)),\n    ior: shape.ior ?? 1.5,\n    zoom: shape.zoom ?? (lens ? 1.16 : 1),\n    zoomX: shape.zoomX ?? shape.zoom ?? (lens ? 1.16 : 1),\n    dispersion: shape.dispersion ?? (lens ? 1 : 0),\n    strength: shape.strength ?? 1,\n    inset: shape.inset ?? 0,\n    stretch: shape.stretch ?? 0,\n    copy: shape.copy ?? false,\n    copyOnly: shape.copyOnly ?? false,\n  };\n}\n\nexport function glassFor(width: number, height: number, radius: number, shape: GlassShape = {}, pad = 0, simple = false, fringe = false, box = false): Promise<Baked> {\n  const w = Math.round(width);\n  const h = Math.round(height);\n  const r = Math.min(w / 2, h / 2, Math.max(0, radius));\n  const full = resolve(shape, w, h);\n  const key = [w, h, Math.round(r * 2) / 2, full.kind, full.bezel.toFixed(1), full.thickness.toFixed(1), full.ior, full.zoom, full.dispersion, full.strength, full.inset, full.stretch, pad, simple, fringe, box].join('|');\n  let baked = cache.get(key);\n  if (!baked) {\n    baked = bake(w, h, r, full, pad, simple, fringe, box);\n    cache.set(key, baked);\n  }\n  return baked;\n}\n\n/**\n * Bakes wait their turn: a page full of glass would otherwise bake every\n * shape in one long task on load. Glass near the viewport goes first; the\n * rest of the page follows in the background, so it's ready before it's\n * scrolled to. Each slice runs fits until its time is spent (always at least\n * one), so the page stays responsive while glass fills in.\n */\nconst soon: Array<() => void> = [];\nconst later: Array<() => void> = [];\nlet pumping = false;\n\n/** Fits whose maps are still encoding. */\nlet encoding = 0;\nlet settled: Array<() => void> = [];\nconst quiet = () => !soon.length && !later.length && !encoding;\nfunction checkSettled() {\n  if (!quiet()) return;\n  const waiting = settled;\n  settled = [];\n  waiting.forEach((done) => done());\n}\n\n/**\n * Resolves once every queued glass bake has finished, or after `timeout` ms.\n * A sheet waits on this before it rises, so the glass in it is complete from\n * the first frame (nothing pops in when it lands) and no bake runs while it\n * moves.\n */\nexport function whenBaked(timeout = 160): Promise<void> {\n  return new Promise((resolve) => {\n    if (quiet()) return resolve();\n    let done = false;\n    const finish = () => {\n      if (done) return;\n      done = true;\n      resolve();\n    };\n    settled.push(finish);\n    setTimeout(finish, timeout);\n  });\n}\n\nfunction pump() {\n  pumping = true;\n  const run = (deadline?: IdleDeadline) => {\n\n    // Without idle callbacks (Safari) a slice gets a fixed budget instead.\n    const end = performance.now() + 8;\n    const left = () => (deadline ? deadline.timeRemaining() > 4 : performance.now() < end);\n    let ran = 0;\n    while ((soon.length || later.length) && (ran === 0 || left())) {\n      (soon.shift() ?? later.shift())!();\n      ran++;\n    }\n    if (soon.length || later.length) idle(run);\n    else {\n      pumping = false;\n      checkSettled();\n    }\n  };\n  idle(run);\n}\n\nfunction bakeSoon(job: () => void, urgent = true): () => void {\n  (urgent ? soon : later).push(job);\n  if (!pumping) pump();\n  return () => {\n    for (const list of [soon, later]) {\n      const at = list.indexOf(job);\n      if (at >= 0) list.splice(at, 1);\n    }\n  };\n}\n\nfunction idle(callback: (deadline?: IdleDeadline) => void): () => void {\n  if (typeof requestIdleCallback === 'function') {\n    const handle = requestIdleCallback(callback, { timeout: 120 });\n    return () => cancelIdleCallback(handle);\n  }\n  const handle = setTimeout(callback, 16);\n  return () => clearTimeout(handle);\n}\n\nfunction cornerRadius(element: HTMLElement, width: number, height: number): number {\n  const value = getComputedStyle(element).borderTopLeftRadius;\n  const n = parseFloat(value);\n  if (!Number.isFinite(n)) return 0;\n  return value.endsWith('%') ? (Math.min(width, height) * n) / 100 : n;\n}\n\n/**\n * Bakes refraction for `ref`'s current box (untransformed) and keeps it fresh\n * on resize. Writes `--lg-refraction` (Chromium) and `--lg-rim` on the element;\n * CSS maps the first to `--lg-filter` unless the page is scrolling, the glass\n * is off screen, or a weak device rests it (see quality.ts).\n *\n * `mirror` names the content that sits beneath the glass. Where the browser\n * can't refract the live backdrop (Safari, Firefox), a live copy of it is\n * refracted inside the glass instead, so lenses still bend light everywhere.\n */\nexport function useRefraction(\n  ref: React.RefObject<HTMLElement | null>,\n  shape: GlassShape = {},\n  enabled = true,\n  mirror?: React.RefObject<HTMLElement | null>,\n  /** While false the mirror sleeps (Safari/Firefox only). */\n  mirrorActive?: () => boolean,\n) {\n  const signature = JSON.stringify(shape);\n  useEffect(() => {\n    const element = ref.current;\n    if (!element || !enabled) return;\n    const live = canRefractBackdrop() && !(shape.copy && mirror);\n    let cancel: (() => void) | undefined;\n    let filter = '';\n    let pad = 0;\n    let zoom = 1;\n    let zoomX = 1;\n    // The rim bend runs on the copy itself, as a normal filter. Chromium only\n    // does this when asked (it can bend the live backdrop instead); every\n    // other engine bends a mirrored lens's copy, in box units.\n    const chromium = canRefractBackdrop();\n    // Older WebKit can't filter a moving copy at all; its lenses show the copy\n    // unbent instead.\n    const tears = filtersTearWhileMoving();\n    const bendCopy = !!mirror && (shape.copy === 'refract' || !chromium) && !tears;\n    let copyFilter = '';\n    const applyCopyFilter = () => {\n      const viewport = element.querySelector<HTMLElement>(':scope > .lg-mirror > .lg-mirror__viewport');\n      if (viewport && copyFilter) viewport.style.filter = copyFilter;\n    };\n\n    // Each fit supersedes the last: maps that finish encoding after a newer\n    // fit (or after unmount) are dropped.\n    let fits = 0;\n    let gone = false;\n    const fit = () => {\n      const width = element.offsetWidth;\n      const height = element.offsetHeight;\n      if (!width || !height) return;\n      const run = ++fits;\n      const radius = cornerRadius(element, width, height);\n      const mirrored = !live && !!mirror?.current;\n      if (mirrored) {\n        // The lens is a magnified copy of what's beneath, bent at its rim.\n        pad = Math.ceil(Math.min(width, height) * 0.45 + 6);\n        ({ zoom, zoomX } = resolve(shape, width, height));\n        if (tears) {\n          // Without a bent rim to carry it, magnification pushes the content\n          // at the lens edge out of view while the real glyphs there are cut\n          // away: letters lose a slice. Keep the copy 1:1 there (minifying\n          // lenses only ever repeat what's around them, so they stay).\n          zoom = Math.min(zoom, 1);\n          zoomX = Math.min(zoomX, 1);\n        }\n      }\n      // A bent copy also refracts the real backdrop: the bar's glass, its edge\n      // and the page bend and split into colour at the rim, so the lens\n      // merges with what's beneath instead of sitting on it.\n      const refractBackdrop = live || (bendCopy && chromium && !shape.copyOnly);\n      const none = Promise.resolve(null);\n      encoding++;\n      Promise.all([\n        glassFor(width, height, radius, shape),\n        // The copy is magnified by CSS; the filter only bends the rim and\n        // fringes what it bends with colour.\n        mirrored && bendCopy ? glassFor(width, height, radius, { ...shape, zoom: 1, zoomX: 1 }, pad, false, true, !chromium) : none,\n        // Behind a bent copy the backdrop only carries the bar's glass and\n        // edges: the copy already magnifies the content, so the backdrop isn't\n        // zoomed (that pushed the bar's edge into a ring inside the lens) and\n        // its rim bends gently, curling the bar's edge into thin arcs.\n        refractBackdrop && !live ? glassFor(width, height, radius, { ...shape, zoom: 1, zoomX: 1, strength: (shape.strength ?? 1) * 0.45 }) : none,\n      ]).then(([baked, copy, behind]) => {\n        if (run !== fits || gone) return;\n        filter = baked.filter;\n        if (mirrored) {\n          element.style.setProperty('--lg-inner-mask', baked.inner);\n          if (copy) {\n            copyFilter = copy.filter;\n            applyCopyFilter();\n          }\n        }\n        if (refractBackdrop) {\n          element.style.setProperty('--lg-refraction', live ? baked.filter : behind!.filter);\n          // Lets CSS keep its softening/saturation for real refraction only, and\n          // tells resting surfaces from lenses.\n          element.setAttribute('data-lg-refract', shape.kind ?? 'surface');\n        }\n        element.style.setProperty('--lg-rim', baked.rim);\n      }).finally(() => {\n        encoding--;\n        checkSettled();\n      });\n    };\n\n    // Refit once resizing settles: a bake is a full canvas pass, and a\n    // surface that animates its size (a nav growing a slot) would otherwise\n    // rebake nearly every frame on Safari, which has no idle callback. The\n    // rim stretches to the box meanwhile.\n    // Glass near the viewport bakes first; the rest waits behind it.\n    let seen = typeof IntersectionObserver !== 'function';\n    // A queued fit reads the box when it runs, so it already covers any\n    // resize before then.\n    let queued = false;\n    const job = () => {\n      queued = false;\n      fit();\n    };\n    const request = () => {\n      cancel?.();\n      queued = true;\n      cancel = bakeSoon(job, seen);\n    };\n    const near =\n      typeof IntersectionObserver === 'function'\n        ? new IntersectionObserver(\n            (entries) => {\n              if (!entries.some((entry) => entry.isIntersecting)) return;\n              seen = true;\n              near?.disconnect();\n              request();\n            },\n            { rootMargin: '100% 0px' },\n          )\n        : null;\n    near?.observe(element);\n\n    const observer = new ResizeObserver(() => {\n      // The observer reports once on mount too: cancelling the queued fit\n      // there would leave the glass rimless for a moment (and a sheet that\n      // waits for its glass would rise without it).\n      if (queued) return;\n      cancel?.();\n      const timer = setTimeout(request, 140);\n      cancel = () => clearTimeout(timer);\n    });\n    observer.observe(element);\n    request();\n\n    const source = mirror?.current;\n    const unmirror = !live && source ? mirrorBackdrop(element, source, () => pad, () => [zoomX, zoom], mirrorActive) : undefined;\n    applyCopyFilter();\n    const ungovern = governRefraction(element);\n\n    return () => {\n      gone = true;\n      cancel?.();\n      unmirror?.();\n      ungovern();\n      near?.disconnect();\n      observer.disconnect();\n      element.style.removeProperty('--lg-refraction');\n      element.style.removeProperty('--lg-rim');\n      element.removeAttribute('data-lg-refract');\n    };\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [ref, signature, enabled, mirror]);\n}\n","/**\n * Lenses for engines that can't filter the live backdrop (Safari, Firefox).\n *\n * We keep a live copy of what sits beneath the glass inside the glass itself,\n * aligned pixel-for-pixel, and magnify it around the lens centre with a plain\n * CSS transform; useRefraction bends its rim with an SVG filter in box units\n * (the form WebKit draws correctly). Inline styles are re-synced each frame so\n * animated content stays in step.\n */\n\nconst SELF = 'data-lg-mirror-self';\n\ninterface Pair {\n  original: HTMLElement;\n  copy: HTMLElement;\n  css: string;\n  cls: string;\n}\n\nfunction clone(source: HTMLElement): { root: HTMLElement; pairs: Pair[] } {\n  const root = source.cloneNode(true) as HTMLElement;\n  const originals = [source, ...Array.from(source.querySelectorAll<HTMLElement>('*'))];\n  const copies = [root, ...Array.from(root.querySelectorAll<HTMLElement>('*'))];\n  const pairs: Pair[] = [];\n  originals.forEach((original, i) => {\n    const copy = copies[i];\n    if (!copy) return;\n    copy.removeAttribute('id');\n    copy.removeAttribute('tabindex');\n    if (copy instanceof HTMLImageElement) copy.loading = 'eager';\n    pairs.push({ original, copy, css: original.style.cssText, cls: original.className.toString() });\n  });\n  root.querySelectorAll(`[${SELF}], .lg-mirror, [data-lg-mirror-skip], input, textarea, select`).forEach((n) => n.remove());\n  // The source may cut a hole for the lens (data-mirror); the copy must not.\n  root.removeAttribute('data-mirror');\n  // Lets styles tell the copy apart from the real control.\n  root.setAttribute('data-lg-copy', '');\n  root.setAttribute('inert', '');\n  root.setAttribute('aria-hidden', 'true');\n  return { root, pairs };\n}\n\nconst alpha = (color: string) => {\n  const m = color.match(/rgba?\\(([^)]+)\\)/);\n  if (!m) return color === 'transparent' ? 0 : 1;\n  const parts = m[1].split(/[\\s,/]+/).filter(Boolean);\n  return parts.length > 3 ? parseFloat(parts[3]) : 1;\n};\n\n/**\n * The painted layers behind the glass that the source copy doesn't cover:\n * every ancestor with a background, outermost first, down from the first\n * opaque one. Their backgrounds are replayed under the copy so the lens shows\n * one complete image instead of the copy floating over the real page.\n */\nfunction backdropChain(glass: HTMLElement, source: HTMLElement): HTMLElement[] {\n  const chain: HTMLElement[] = [];\n  // Bare lenses (e.g. a slider thumb over its rail) show only the copied\n  // source; the real frosted backdrop shows through around it.\n  if (glass.hasAttribute('data-lg-mirror-bare')) return chain;\n  for (let node = glass.parentElement; node; node = node.parentElement) {\n    if (node === source || source.contains(node)) continue;\n    const cs = getComputedStyle(node);\n    const image = cs.backgroundImage !== 'none';\n    const a = alpha(cs.backgroundColor);\n    if (image || a > 0) chain.unshift(node);\n    // Stop at a gradient/image or solid colour (it hides everything further\n    // back), or at the glass surface the lens rests on: past that, the real\n    // backdrop is frosted anyway and an opaque replay would read as a blob.\n    if (image || a >= 1 || node.classList.contains('lg-glass')) break;\n  }\n  return chain;\n}\n\n/** The source's own `data-*` state flags, as a sorted, space-separated list. */\nconst stateOf = (el: HTMLElement) =>\n  Array.from(el.attributes)\n    .map((a) => a.name)\n    .filter((name) => name.startsWith('data-') && name !== 'data-mirror' && !name.startsWith('data-lg-mirror'))\n    .sort()\n    .join(' ');\n\n/**\n * Whether an attribute change alters what the content draws (an icon's fill,\n * a path's d, an image's src). Those only reach the copy through a fresh\n * clone. Styles and classes are followed every frame by sync(), and state\n * flags (data-*, aria-*) change on every press, so they never rebuild it.\n */\nconst paints = (name: string | null) =>\n  !!name && name !== 'style' && name !== 'class' && name !== 'tabindex' && !name.startsWith('data-') && !name.startsWith('aria-');\n\nconst BACKGROUND = ['background-color', 'background-image', 'background-size', 'background-position', 'background-repeat', 'border-radius'];\n\n// align() owns the clone root's placement. Animation variables and colours\n// still follow the source without clearing and rebuilding that placement.\nconst PLACEMENT = new Set(['position', 'left', 'top', 'margin', 'margin-top', 'margin-right', 'margin-bottom', 'margin-left', 'width', 'height', 'max-width', 'max-height', 'min-width', 'min-height', 'scale', 'translate', 'transform-origin', 'transform']);\n\nfunction syncStyle(original: HTMLElement, copy: HTMLElement, root: boolean) {\n  for (const name of Array.from(copy.style)) {\n    if (root && PLACEMENT.has(name)) continue;\n    if (!original.style.getPropertyValue(name)) copy.style.removeProperty(name);\n  }\n  for (const name of Array.from(original.style)) {\n    if (root && PLACEMENT.has(name)) continue;\n    const value = original.style.getPropertyValue(name);\n    const priority = original.style.getPropertyPriority(name);\n    if (copy.style.getPropertyValue(name) !== value || copy.style.getPropertyPriority(name) !== priority) {\n      copy.style.setProperty(name, value, priority);\n    }\n  }\n}\n\nexport function mirrorBackdrop(\n  glass: HTMLElement,\n  source: HTMLElement,\n  padding: () => number,\n  /** Interior magnification of the lens. */\n  zoom: () => number | [number, number],\n  /** Work only while this is true (e.g. a lens is lifted); idle otherwise. */\n  active: () => boolean = () => true,\n) {\n  const layer = document.createElement('div');\n  layer.className = 'lg-mirror';\n  layer.setAttribute('aria-hidden', 'true');\n  glass.setAttribute(SELF, '');\n  glass.prepend(layer);\n  // `layer` is glass-sized and carries the feathered mask; the copy lives in\n  // a clipped viewport that overhangs it so magnification has edge content.\n  const viewport = document.createElement('div');\n  viewport.className = 'lg-mirror__viewport';\n  layer.append(viewport);\n  const zoomer = document.createElement('div');\n  zoomer.className = 'lg-mirror__zoom';\n  viewport.append(zoomer);\n\n  let copy = clone(source);\n  let under: Array<{ original: HTMLElement; copy: HTMLElement; placed: string }> = [];\n  const buildUnder = () => {\n    under.forEach((u) => u.copy.remove());\n    under = backdropChain(glass, source).map((original) => {\n      const div = document.createElement('div');\n      const cs = getComputedStyle(original);\n      for (const name of BACKGROUND) div.style.setProperty(name, cs.getPropertyValue(name));\n      div.style.position = 'absolute';\n      div.style.left = '0px';\n      div.style.top = '0px';\n      div.style.transformOrigin = '0 0';\n      return { original, copy: div, placed: '' };\n    });\n    zoomer.prepend(...under.map((u) => u.copy));\n  };\n  zoomer.append(copy.root);\n  buildUnder();\n  let stopped = false;\n  let frame = 0;\n  let visible = true;\n  let placed = '';\n  let shown = true;\n\n  /** Maps `from`'s rendered box into glass-local coordinates. */\n  let pad = 0;\n  const place = (from: HTMLElement, g: DOMRect, sgx: number, sgy: number) => {\n    const sw = from.offsetWidth;\n    const sh = from.offsetHeight;\n    if (!sw || !sh) return null;\n    const s = from.getBoundingClientRect();\n    const kx = s.width / sw / sgx;\n    const ky = s.height / sh / sgy;\n    const px = (s.left - g.left) / sgx + pad;\n    const py = (s.top - g.top) / sgy + pad;\n    return { sw, sh, key: `${sw}|${sh}|${px.toFixed(2)}|${py.toFixed(2)}|${kx.toFixed(4)}|${ky.toFixed(4)}`, transform: `translate(${px}px, ${py}px) scale(${kx}, ${ky})` };\n  };\n\n  const align = () => {\n    const nextPad = padding();\n    if (nextPad !== pad) {\n      pad = nextPad;\n      viewport.style.inset = `${-pad}px`;\n      under.forEach((u) => (u.placed = ''));\n      placed = '';\n    }\n    const gw = glass.offsetWidth;\n    const gh = glass.offsetHeight;\n    if (!gw || !gh) return;\n    const g = glass.getBoundingClientRect();\n    const sgx = g.width / gw;\n    const sgy = g.height / gh;\n    for (const u of under) {\n      const at = place(u.original, g, sgx, sgy);\n      if (!at || at.key === u.placed) continue;\n      u.placed = at.key;\n      u.copy.style.width = `${at.sw}px`;\n      u.copy.style.height = `${at.sh}px`;\n      u.copy.style.transform = at.transform;\n    }\n    const at = place(source, g, sgx, sgy);\n    if (!at) return;\n    const { sw, sh } = at;\n    const next = at.key;\n    if (next === placed) return;\n    placed = next;\n    const root = copy.root;\n    root.style.position = 'absolute';\n    root.style.left = '0px';\n    root.style.top = '0px';\n    root.style.margin = '0px';\n    root.style.width = `${sw}px`;\n    root.style.height = `${sh}px`;\n    // The copy sits in a small viewport; size limits like max-width: 100%\n    // would squeeze it there instead of matching the original.\n    root.style.maxWidth = 'none';\n    root.style.maxHeight = 'none';\n    root.style.minWidth = '0px';\n    root.style.minHeight = '0px';\n    root.style.scale = 'none';\n    root.style.translate = 'none';\n    root.style.transformOrigin = '0 0';\n    root.style.transform = at.transform;\n  };\n\n  const sync = () => {\n    for (const pair of copy.pairs) {\n      const css = pair.original.style.cssText;\n      const cls = pair.original.className.toString();\n      if (css !== pair.css) {\n        pair.css = css;\n        // Reassigning cssText also resets unchanged mask images. Safari can\n        // drop their cached pixels during a drag, especially after reload.\n        syncStyle(pair.original, pair.copy, pair.copy === copy.root);\n      }\n      if (cls !== pair.cls) {\n        pair.cls = cls;\n        pair.copy.className = cls;\n      }\n    }\n    // State flags on the source (data-lifted, data-previewing, …) drive how\n    // its content is painted, so the copy follows them too.\n    const flags = stateOf(source);\n    if (flags !== copyFlags) {\n      const now = new Set(flags.split(' '));\n      for (const name of copyFlags.split(' ')) if (name && !now.has(name)) copy.root.removeAttribute(name);\n      for (const name of flags.split(' ')) if (name) copy.root.setAttribute(name, source.getAttribute(name) ?? '');\n      copyFlags = flags;\n    }\n  };\n\n  let copyFlags = '';\n  let zoomed = '';\n  const applyZoom = () => {\n    const z = zoom();\n    const value = Array.isArray(z) ? `scale(${z[0]}, ${z[1]})` : `scale(${z})`;\n    if (value !== zoomed) zoomer.style.transform = zoomed = value;\n  };\n\n  const tick = () => {\n    frame = 0;\n    if (stopped) return;\n    const on = visible && !document.hidden && active();\n    if (on !== shown) {\n      shown = on;\n      layer.style.visibility = on ? '' : 'hidden';\n    }\n    if (!on) return;\n    applyZoom();\n    sync();\n    align();\n    frame = requestAnimationFrame(tick);\n  };\n  // While its lens rests the copy sleeps: no frames at all, so a page full of\n  // controls lets the CPU idle. Lifting writes the source's style, which the\n  // observer below sees, and that wakes it again.\n  const wake = () => {\n    if (!frame && !stopped) frame = requestAnimationFrame(tick);\n  };\n  wake();\n\n  let pending = 0;\n  const recopy = () => {\n    pending = 0;\n    if (stopped) return;\n    const next = clone(source);\n    copy.root.replaceWith(next.root);\n    copy = next;\n    copyFlags = '';\n    placed = '';\n    buildUnder();\n    align();\n  };\n  const mutations = new MutationObserver((records) => {\n    // Our own copies live inside the glass, which may sit inside the source.\n    if (records.every((r) => layer.contains(r.target) || r.target === layer || r.target === glass)) return;\n    wake();\n    const structural = records.some((r) => !layer.contains(r.target) && (r.type !== 'attributes' || paints(r.attributeName)));\n    if (structural && !pending) pending = requestAnimationFrame(recopy);\n    else if (!structural && !stopped && visible && !document.hidden && active()) {\n      // Spring callbacks can run after our rAF tick. Follow their final\n      // styles before this frame is painted so the copy and hide mask agree.\n      applyZoom();\n      sync();\n      align();\n    }\n  });\n  mutations.observe(source, { childList: true, characterData: true, attributes: true, subtree: true });\n\n  const io =\n    typeof IntersectionObserver === 'function'\n      ? new IntersectionObserver((entries) => {\n          visible = entries.some((e) => e.isIntersecting);\n          wake();\n        })\n      : null;\n  io?.observe(glass);\n  document.addEventListener('visibilitychange', wake);\n\n  return () => {\n    stopped = true;\n    cancelAnimationFrame(frame);\n    cancelAnimationFrame(pending);\n    mutations.disconnect();\n    io?.disconnect();\n    document.removeEventListener('visibilitychange', wake);\n    layer.remove();\n    glass.removeAttribute(SELF);\n  };\n}\n","/**\n * Keeps refraction affordable.\n *\n * A refracting surface re-runs its SVG displacement over the live backdrop on\n * every frame the backdrop moves. Fast GPUs shrug that off; mid-range phones\n * drop frames as soon as a page holds a few dozen of them. So:\n *\n * - while the page scrolls, `html[data-lg-scrolling]` turns refraction off\n *   (blur and the baked rim stay, which reads the same in motion);\n * - glass well outside the viewport gets `data-lg-offscreen` and skips it;\n * - on weak devices (`html[data-lg-quality='low']`) resting surfaces keep blur\n *   and rim only; lenses still bend while they're held.\n *\n * The quality starts from device hints and drops to low if the first seconds\n * of scrolling miss frames. `setGlassQuality` pins it either way.\n */\n\nexport type GlassQuality = 'auto' | 'high' | 'low';\n\nlet started = false;\nlet pinned: GlassQuality = 'auto';\nlet probing = false;\nlet offscreen: IntersectionObserver | null = null;\n\nconst root = () => document.documentElement;\n\nfunction apply(level: 'high' | 'low') {\n  if (root().getAttribute('data-lg-quality') !== level) root().setAttribute('data-lg-quality', level);\n}\n\n/** Device hints: few cores or little memory (Chromium reports both). */\nfunction guess(): 'high' | 'low' {\n  const nav = navigator as Navigator & { deviceMemory?: number };\n  if (typeof nav.deviceMemory === 'number' && nav.deviceMemory <= 4) return 'low';\n  if (typeof nav.hardwareConcurrency === 'number' && nav.hardwareConcurrency <= 4) return 'low';\n  return 'high';\n}\n\n/**\n * Times frames while the page scrolls with refraction paused and resumed.\n * If too many miss the frame budget the device can't carry it: go low.\n */\nfunction probe() {\n  if (probing || pinned !== 'auto' || root().getAttribute('data-lg-quality') === 'low') return;\n  probing = true;\n  const gaps: number[] = [];\n  let last = 0;\n  let frame = 0;\n  const end = performance.now() + 2000;\n  const step = (now: number) => {\n    if (last) gaps.push(now - last);\n    last = now;\n    if (now < end && gaps.length < 120) {\n      frame = requestAnimationFrame(step);\n      return;\n    }\n    probing = false;\n    if (gaps.length < 20 || pinned !== 'auto') return;\n    const slow = gaps.filter((gap) => gap > 26).length / gaps.length;\n    if (slow > 0.2) apply('low');\n  };\n  frame = requestAnimationFrame(step);\n  void frame;\n}\n\nfunction watchScroll() {\n  let timer = 0;\n  let probes = 0;\n  const settle = () => {\n    timer = 0;\n    root().removeAttribute('data-lg-scrolling');\n  };\n  const onScroll = () => {\n    if (!timer) {\n      root().setAttribute('data-lg-scrolling', '');\n      // Sample the first couple of scrolls after load: that's when a page\n      // full of glass is most expensive.\n      if (probes < 2) {\n        probes++;\n        probe();\n      }\n    } else {\n      clearTimeout(timer);\n    }\n    timer = window.setTimeout(settle, 140);\n  };\n  // Capture: nested scrollers (sheets, panels) count too.\n  document.addEventListener('scroll', onScroll, { capture: true, passive: true });\n}\n\nfunction start() {\n  if (started || typeof window === 'undefined') return;\n  started = true;\n  apply(pinned === 'auto' ? guess() : pinned);\n  watchScroll();\n  if (typeof IntersectionObserver === 'function') {\n    offscreen = new IntersectionObserver(\n      (entries) => {\n        for (const entry of entries) {\n          const el = entry.target as HTMLElement;\n          if (entry.isIntersecting) el.removeAttribute('data-lg-offscreen');\n          else el.setAttribute('data-lg-offscreen', '');\n        }\n      },\n      // Turn back on a little before it scrolls into view.\n      { rootMargin: '25% 0px' },\n    );\n  }\n}\n\n/** Starts the governor and tracks `element`'s visibility. Returns a cleanup. */\nexport function governRefraction(element: HTMLElement): () => void {\n  start();\n  offscreen?.observe(element);\n  return () => {\n    offscreen?.unobserve(element);\n    element.removeAttribute('data-lg-offscreen');\n  };\n}\n\n/**\n * Pins the refraction quality. `'auto'` (default) picks from device hints and\n * drops to `'low'` if scrolling misses frames; `'high'` always refracts\n * resting surfaces; `'low'` refracts lenses only while they're held.\n */\nexport function setGlassQuality(quality: GlassQuality) {\n  pinned = quality;\n  if (typeof window === 'undefined') return;\n  if (!started) start();\n  apply(quality === 'auto' ? guess() : quality);\n}\n","/**\n * Best-effort haptic tick for the web.\n *\n * Android: Vibration API. iOS Safari 18+: toggling a native `<input switch>`\n * through its label fires the system selection haptic, so we keep one hidden.\n */\nlet label: HTMLLabelElement | null = null;\n\nconst isIOS = () =>\n  typeof navigator !== 'undefined' &&\n  (/iP(hone|ad|od)/.test(navigator.userAgent) ||\n    (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1));\n\nexport function haptic(): void {\n  if (typeof window === 'undefined') return;\n  // Only touch screens can buzz; skip the call (and Chrome's console warning) elsewhere.\n  if (!matchMedia('(pointer: coarse)').matches) return;\n  try {\n    if (typeof navigator.vibrate === 'function' && !isIOS()) {\n      navigator.vibrate(8);\n      return;\n    }\n    if (!isIOS()) return;\n    if (!label?.isConnected) {\n      label = document.createElement('label');\n      label.setAttribute('aria-hidden', 'true');\n      label.style.cssText = 'position:fixed;width:1px;height:1px;overflow:hidden;opacity:0;pointer-events:none;left:-9px;top:-9px';\n      const input = document.createElement('input');\n      input.type = 'checkbox';\n      input.setAttribute('switch', '');\n      input.tabIndex = -1;\n      label.append(input);\n      document.body.append(label);\n    }\n    label.click();\n  } catch {\n    /* haptics are a nicety */\n  }\n}\n","import React, { useImperativeHandle, useRef } from 'react';\nimport { useRefraction } from '../../engine/refraction';\nimport './GlassCard.css';\n\nexport interface GlassCardProps extends React.HTMLAttributes<HTMLDivElement> {\n  /** Refraction strength from 1 (subtle) to 10 (heavy). Default 5. */\n  intensity?: number;\n  /** CSS colour washed over the glass. */\n  tint?: string;\n  /** Kept for API compatibility. */\n  shimmer?: boolean;\n  /** Rim bevel scale (1–4). Default 1. */\n  thickness?: number;\n  /** Inner padding. Default '24px'. */\n  padding?: string;\n  /** Corner radius. Default '28px'. */\n  radius?: string;\n  /** `regular` frosted panel (default) or `clear` see-through glass. */\n  variant?: 'regular' | 'clear';\n  children?: React.ReactNode;\n}\n\n/** A refracting glass panel for grouping content. */\nexport const GlassCard = React.forwardRef<HTMLDivElement, GlassCardProps>(\n  (\n    { intensity = 5, tint, shimmer: _shimmer, thickness = 1, padding = '24px', radius = '28px', variant = 'regular', className, style, children, ...rest },\n    forwardedRef,\n  ) => {\n    const ref = useRef<HTMLDivElement>(null);\n    useImperativeHandle(forwardedRef, () => ref.current!);\n    useRefraction(ref, {\n      kind: 'surface',\n      strength: Math.max(1, Math.min(10, intensity)) / 5,\n      bezel: 16 * Math.max(0.5, thickness),\n      thickness: 22 * Math.max(0.5, thickness),\n    });\n\n    return (\n      <div\n        ref={ref}\n        className={['lg-glass', 'lg-glass--host', 'lg-card', `lg-card--${variant}`, className].filter(Boolean).join(' ')}\n        data-liquid-glass=\"\"\n        style={{ padding, borderRadius: radius, ...(tint ? { '--lg-host-tint': tint } : {}), ...style } as React.CSSProperties}\n        {...rest}\n      >\n        {children}\n      </div>\n    );\n  },\n);\n\nGlassCard.displayName = 'GlassCard';\n","import React, { useImperativeHandle, useRef, useState } from 'react';\nimport { usePress } from '../../engine/press';\nimport { useRefraction } from '../../engine/refraction';\nimport { Symbol } from '../internal/Symbol';\nimport { searchSymbol, clearSymbol } from '../internal/inputSymbols';\nimport './GlassInput.css';\n\nexport interface GlassInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange'> {\n  /** Refraction strength from 1 (subtle) to 10 (heavy). Default 5. */\n  intensity?: number;\n  /** Colour for the caret and focus glow. */\n  tint?: string;\n  placeholder?: string;\n  value?: string;\n  onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;\n  /** Small label above the field. */\n  label?: string;\n  /** Leading icon. `type=\"search\"` gets a magnifier by default. */\n  icon?: React.ReactNode;\n  /** Trailing accessory, e.g. a microphone glyph. */\n  trailing?: React.ReactNode;\n  /** Called by the clear button. Without it, clearing emits an empty `onChange`. */\n  onClear?: () => void;\n}\n\nconst Magnifier = <Symbol source={searchSymbol} size={20} />;\nconst ClearGlyph = <Symbol source={clearSymbol} size={20} />;\n\n/** iOS 26 search / text field on regular glass. */\nexport const GlassInput = React.forwardRef<HTMLInputElement, GlassInputProps>(\n  (\n    { intensity = 5, tint, label, icon, trailing, onClear, className, style, value, onChange, type = 'text', disabled, onFocus, onBlur, ...rest },\n    forwardedRef,\n  ) => {\n    const fieldRef = useRef<HTMLDivElement>(null);\n    const inputRef = useRef<HTMLInputElement>(null);\n    useImperativeHandle(forwardedRef, () => inputRef.current!);\n    const [focused, setFocused] = useState(false);\n    const [inner, setInner] = useState('');\n    const current = value ?? inner;\n\n    useRefraction(fieldRef, { kind: 'surface', strength: Math.max(1, Math.min(10, intensity)) / 5 });\n    usePress(fieldRef, { grow: 0.03, lean: 3, stretch: 0.03, disabled });\n\n    const leading = icon ?? (type === 'search' ? Magnifier : null);\n\n    const clear = () => {\n      if (onClear) onClear();\n      else {\n        const input = inputRef.current!;\n        const setter = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value')?.set;\n        setter?.call(input, '');\n        input.dispatchEvent(new Event('input', { bubbles: true }));\n      }\n      inputRef.current?.focus();\n    };\n\n    return (\n      <label\n        className={['lg-input', className].filter(Boolean).join(' ')}\n        data-liquid-glass=\"\"\n        style={tint ? ({ '--lg-input-tint': tint, ...style } as React.CSSProperties) : style}\n      >\n        {label && <span className=\"lg-input__label\">{label}</span>}\n        <div ref={fieldRef} className=\"lg-glass lg-input__field\" data-focused={focused ? '' : undefined}>\n          {leading && <span className=\"lg-input__icon\">{leading}</span>}\n          <input\n            ref={inputRef}\n            type={type}\n            value={current}\n            disabled={disabled}\n            onChange={(event) => {\n              if (value === undefined) setInner(event.target.value);\n              onChange?.(event);\n            }}\n            onFocus={(event) => {\n              setFocused(true);\n              onFocus?.(event);\n            }}\n            onBlur={(event) => {\n              setFocused(false);\n              onBlur?.(event);\n            }}\n            {...rest}\n          />\n          {current && !disabled ? (\n            <button\n              type=\"button\"\n              className=\"lg-input__clear\"\n              aria-label=\"Clear\"\n              onPointerDown={(event) => event.preventDefault()}\n              onClick={clear}\n            >\n              {ClearGlyph}\n            </button>\n          ) : (\n            trailing && <span className=\"lg-input__icon lg-input__trailing\">{trailing}</span>\n          )}\n        </div>\n      </label>\n    );\n  },\n);\n\nGlassInput.displayName = 'GlassInput';\n","import React from 'react';\n\nexport interface SymbolProps extends React.HTMLAttributes<HTMLSpanElement> {\n  source: string;\n  size?: number;\n}\n\n/** A monochrome symbol mask: inherits the control's colour in either theme. */\nexport function Symbol({ source, size = 24, className, style, ...props }: SymbolProps) {\n  const mask = `url(\"${source}\")`;\n  return (\n    <span\n      aria-hidden=\"true\"\n      {...props}\n      className={['lg-symbol', className].filter(Boolean).join(' ')}\n      style={{ '--lg-symbol-size': `${size}px`, WebkitMaskImage: mask, maskImage: mask, ...style } as React.CSSProperties}\n    />\n  );\n}\n","// Phosphor Icons (MIT, https://phosphoricons.com), inlined as SVG masks so\n// the input's glyphs follow its colour with no extra files or requests.\nexport const searchSymbol = \"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256' fill='black'%3E%3Cpath d='M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z'/%3E%3C/svg%3E\";\nexport const clearSymbol = \"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256' fill='black'%3E%3Cpath d='M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm37.66,130.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32L139.31,128Z'/%3E%3C/svg%3E\";\n","import React, { useEffect, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\nimport { clamp, createSpring, rubberband, springFrom } from '../../engine/spring';\nimport { useRefraction, whenBaked } from '../../engine/refraction';\nimport './GlassSheet.css';\n\nexport interface GlassSheetProps {\n  /** Whether the sheet is open. */\n  open: boolean;\n  /** Called when the user dismisses the sheet (scrim, Escape, or swipe down). */\n  onClose?: () => void;\n  /** Refraction strength from 1 (subtle) to 10 (heavy). Default 5. */\n  intensity?: number;\n  /** CSS colour washed over the glass. */\n  tint?: string;\n  /** Optional portal host for a sheet contained within an app preview. */\n  container?: HTMLElement | null;\n  /**\n   * Resting heights, like iOS `.presentationDetents`. `['medium', 'large']`\n   * opens at half height; drag or flick up for full screen, down to settle or\n   * dismiss. Leave unset for a sheet that fits its content.\n   */\n  detents?: Array<'medium' | 'large'>;\n  /** Accessible name for the dialog. */\n  'aria-label'?: string;\n  children?: React.ReactNode;\n}\n\nconst OPEN = springFrom(0.42, 0.86);\nconst CLOSE = springFrom(0.34, 1);\n/** Settling onto a detent after a drag. */\nconst SNAP = springFrom(0.4, 0.84);\n\n/**\n * iOS 26 floating sheet. Rises on a spring, can be flicked or dragged down to\n * dismiss, and rubber-bands when pulled up. With `detents` it rests at half\n * height and expands to full screen.\n */\nexport const GlassSheet: React.FC<GlassSheetProps> = ({ open, onClose, intensity = 5, tint, container, detents, children, 'aria-label': ariaLabel }) => {\n  const [mounted, setMounted] = useState(open);\n  const sheetRef = useRef<HTMLDivElement>(null);\n  const scrimRef = useRef<HTMLDivElement>(null);\n  const api = useRef<{ close: () => void } | null>(null);\n  const stopsKey = detents?.join(',') ?? '';\n  const closeRef = useRef(onClose);\n  closeRef.current = onClose;\n\n  useEffect(() => {\n    if (open) setMounted(true);\n    else api.current?.close();\n  }, [open]);\n\n  useRefraction(sheetRef, { kind: 'surface', strength: Math.max(1, Math.min(10, intensity)) / 5, bezel: 20, thickness: 28 }, mounted);\n\n  useEffect(() => {\n    if (!mounted) return;\n    const sheet = sheetRef.current!;\n    const scrim = scrimRef.current!;\n    const layer = sheet.parentElement!;\n    const wanted = stopsKey ? (stopsKey.split(',') as Array<'medium' | 'large'>) : [];\n\n    // Positions are the sheet's translateY in px: 0 is fully raised.\n    let height = 0;\n    let hidden = 0;\n    let stops: number[] = [0];\n    let rest = 0;\n    let medium = 0;\n    const measure = () => {\n      height = sheet.offsetHeight || 400;\n      // Measured from the sheet's top edge: a detent sheet runs on past the\n      // bottom of the screen, so its own height isn't what's on show.\n      const top = sheet.offsetTop;\n      hidden = layer.clientHeight - top + 24;\n      // Medium shows the sheet's top half of the screen's height.\n      medium = Math.max(0, layer.clientHeight * 0.5 - top);\n      stops = wanted.length ? wanted.map((d) => (d === 'large' ? 0 : medium)).sort((x, y) => x - y) : [0];\n      rest = wanted.includes('medium') ? medium : stops[0];\n    };\n    measure();\n\n    const paint = (y: number) => {\n      sheet.style.transform = `translateY(${y}px)`;\n      // iOS leaves the page undimmed at the medium detent and dims it as the\n      // sheet rises to full height.\n      const dim = wanted.includes('medium') && medium > 0\n        ? clamp(1 - y / medium, 0, 1)\n        : clamp(1 - y / Math.max(1, height), 0, 1);\n      scrim.style.opacity = String(dim);\n      const raised = y <= 1;\n      if (wanted.length && sheet.hasAttribute('data-raised') !== raised) sheet.toggleAttribute('data-raised', raised);\n    };\n    let closing = false;\n    const position = createSpring(hidden, OPEN, (y) => {\n      paint(y);\n      if (closing && y >= hidden - 1) setMounted(false);\n    });\n    const go = (y: number, feel: typeof OPEN) => {\n      position.tune(feel);\n      position.set(y);\n    };\n    api.current = {\n      close() {\n        closing = true;\n        go(hidden, CLOSE);\n      },\n    };\n    paint(hidden);\n    // The glass in the sheet bakes first (a few ms, or nothing once cached),\n    // so it rises complete: no rims or tint popping in when it lands, and no\n    // bake competing with the spring for frames.\n    let stale = false;\n    let started = false;\n    whenBaked().then(() =>\n      requestAnimationFrame(() => {\n        if (stale || closing) return;\n        started = true;\n        measure();\n        position.set(hidden, true);\n        if (open) go(rest, OPEN);\n      }),\n    );\n\n    let gesture: { id: number; y: number; from: number; t: number; v: number; last: number } | null = null;\n    const down = (event: PointerEvent) => {\n      if (event.defaultPrevented || closing) return;\n      const target = event.target as HTMLElement;\n      // Fully raised, the content scrolls; drag from the grabber or the top.\n      const raised = position.value <= 1;\n      if (raised && !target.closest('.lg-sheet__grabber-zone') && sheet.scrollTop > 0) return;\n      if (target.closest('input, textarea, button, a, [role=\"slider\"], [role=\"switch\"]')) return;\n      position.stop();\n      gesture = { id: event.pointerId, y: event.clientY, from: position.value, t: event.timeStamp, v: 0, last: position.value };\n      sheet.setPointerCapture(event.pointerId);\n    };\n    const move = (event: PointerEvent) => {\n      if (event.pointerId !== gesture?.id) return;\n      const raw = gesture.from + event.clientY - gesture.y;\n      // Past full height the sheet only gives a little.\n      const y = raw < 0 ? rubberband(raw, height, 0.3) : raw;\n      const dt = Math.max(1, event.timeStamp - gesture.t);\n      gesture.v = gesture.v * 0.2 + ((y - gesture.last) / dt) * 0.8;\n      gesture.t = event.timeStamp;\n      gesture.last = y;\n      position.set(y, true);\n      paint(y);\n    };\n    const up = (event: PointerEvent) => {\n      if (event.pointerId !== gesture?.id) return;\n      const { v, last } = gesture;\n      gesture = null;\n      // Where the throw would carry it, then the nearest resting place.\n      const projected = last + v * 180;\n      const lowest = stops[stops.length - 1];\n      if (projected > lowest + (hidden - lowest) * 0.45 || (v > 0.9 && last >= lowest - 4)) {\n        closing = true;\n        go(hidden, CLOSE);\n        closeRef.current?.();\n        return;\n      }\n      const target = stops.reduce((best, stop) => (Math.abs(stop - projected) < Math.abs(best - projected) ? stop : best), stops[0]);\n      go(target, SNAP);\n    };\n    const key = (event: KeyboardEvent) => {\n      if (event.key === 'Escape') closeRef.current?.();\n    };\n    const resize = () => {\n      // The observer also reports on mount; the sheet rises on its own once\n      // its glass is ready.\n      if (!started) return;\n      const at = position.target;\n      const was = stops.indexOf(at);\n      measure();\n      if (!closing) go(was >= 0 ? stops[Math.min(was, stops.length - 1)] : rest, SNAP);\n    };\n    const observer = new ResizeObserver(resize);\n    observer.observe(layer);\n    sheet.addEventListener('pointerdown', down);\n    sheet.addEventListener('pointermove', move);\n    sheet.addEventListener('pointerup', up);\n    sheet.addEventListener('pointercancel', up);\n    window.addEventListener('keydown', key);\n    const overflow = document.body.style.overflow;\n    if (!container) document.body.style.overflow = 'hidden';\n    sheet.focus({ preventScroll: true });\n    return () => {\n      stale = true;\n      position.stop();\n      api.current = null;\n      observer.disconnect();\n      sheet.removeEventListener('pointerdown', down);\n      sheet.removeEventListener('pointermove', move);\n      sheet.removeEventListener('pointerup', up);\n      sheet.removeEventListener('pointercancel', up);\n      window.removeEventListener('keydown', key);\n      if (!container) document.body.style.overflow = overflow;\n    };\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [mounted, container, stopsKey]);\n\n  if (!mounted || typeof document === 'undefined') return null;\n\n  return createPortal(\n    <div className=\"lg-sheet-layer\" data-liquid-glass=\"\" style={container ? { position: 'absolute' } : undefined}>\n      <div ref={scrimRef} className=\"lg-sheet__scrim\" onClick={() => onClose?.()} aria-hidden=\"true\" />\n      <div\n        ref={sheetRef}\n        role=\"dialog\"\n        aria-modal=\"true\"\n        aria-label={ariaLabel}\n        tabIndex={-1}\n        className={['lg-glass', 'lg-glass--host', 'lg-sheet', detents?.length ? 'lg-sheet--detents' : ''].filter(Boolean).join(' ')}\n        style={tint ? ({ '--lg-host-tint': tint } as React.CSSProperties) : undefined}\n      >\n        <div className=\"lg-sheet__grabber-zone\" aria-hidden=\"true\">\n          <span className=\"lg-sheet__grabber\" />\n        </div>\n        <div className=\"lg-sheet__content\">{children}</div>\n      </div>\n    </div>,\n    container ?? document.body,\n  );\n};\n\nGlassSheet.displayName = 'GlassSheet';\n","import React, { useEffect, useLayoutEffect, useRef, useState } from 'react';\nimport { createSpring, clamp, springFrom } from '../../engine/spring';\nimport { haptic } from '../../engine/haptics';\nimport { usePress } from '../../engine/press';\nimport { GlassButton } from '../GlassButton';\nimport './GlassMenu.css';\n\nexport interface GlassMenuItem {\n  label: React.ReactNode;\n  /** Leading icon. */\n  icon?: React.ReactNode;\n  /**\n   * Shows a trailing checkmark. Set it (true or false) on every item of a\n   * pick-one menu: those items become `menuitemradio` with `aria-checked`,\n   * so screen readers announce which one is selected.\n   */\n  checked?: boolean;\n  /** Red label for irreversible actions. */\n  destructive?: boolean;\n  disabled?: boolean;\n  onSelect?: () => void;\n}\n\nexport interface GlassMenuProps {\n  /** Icon for the trigger button (e.g. an ellipsis). */\n  icon: React.ReactNode;\n  items: GlassMenuItem[];\n  /** Accessible name for the trigger. */\n  'aria-label': string;\n  /** Which edge of the trigger the menu grows from. Default 'end' (right). */\n  align?: 'start' | 'end';\n  /** Trigger size, as for GlassButton. Default 'md'. */\n  size?: 'sm' | 'md' | 'lg';\n  /** Menu width in px. Default 230. */\n  width?: number;\n  /** Trailing checkmark icon. */\n  check?: React.ReactNode;\n  className?: string;\n}\n\nconst OPEN = springFrom(0.36, 0.74);\n/** Underdamped, so the droplet lands in the button with a slight jiggle. */\nconst CLOSE = springFrom(0.42, 0.66);\nconst FADE = springFrom(0.24, 1);\nconst FADE_OUT = springFrom(0.2, 1);\n\nconst Tick = () => (\n  <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\">\n    <path d=\"M3.5 8.5l3 3 6-7\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n  </svg>\n);\n\n/**\n * iOS 26 pull-down menu. The glass button itself grows into the menu from its\n * corner, its items sharpening out of a blur as it opens, and on close the\n * menu folds back down into the button.\n */\nexport const GlassMenu: React.FC<GlassMenuProps> = ({\n  icon,\n  items,\n  'aria-label': ariaLabel,\n  align = 'end',\n  size = 'md',\n  width = 230,\n  check,\n  className,\n}) => {\n  const [open, setOpen] = useState(false);\n  const [mounted, setMounted] = useState(false);\n  const anchorRef = useRef<HTMLSpanElement>(null);\n  const triggerRef = useRef<HTMLButtonElement>(null);\n  const surfaceRef = useRef<HTMLDivElement>(null);\n  const panelRef = useRef<HTMLDivElement>(null);\n  const contentRef = useRef<HTMLDivElement>(null);\n  const spring = useRef<ReturnType<typeof createSpring> | null>(null);\n  const itemsRef = useRef(items);\n  itemsRef.current = items;\n\n  // Held, the open menu behaves like any glass button: it swells and is drawn\n  // out toward the finger, then wobbles back.\n  usePress(surfaceRef, { grow: 0.035, lean: 6, stretch: 0.1, disabled: !mounted });\n\n  useEffect(() => {\n    if (open) {\n      setMounted(true);\n      // Reopened mid-close: grow back out from wherever the droplet is.\n      if (spring.current) {\n        spring.current.tune(OPEN);\n        spring.current.set(1);\n      }\n    } else if (spring.current) {\n      spring.current.tune(CLOSE);\n      spring.current.set(0);\n    }\n  }, [open]);\n\n  useLayoutEffect(() => {\n    if (!mounted) return;\n    const surface = surfaceRef.current!;\n    const panel = panelRef.current!;\n    const content = contentRef.current!;\n    const trigger = triggerRef.current!;\n    const w = trigger.offsetWidth;\n    const h = trigger.offsetHeight;\n    const W = Math.max(w, Math.min(width, window.innerWidth - 24));\n    content.style.width = `${W}px`;\n    const H = Math.max(h, content.offsetHeight);\n    // The glass keeps its final size and morphs with a transform from the\n    // trigger's corner. Resizing a backdrop-filtered layer every frame makes\n    // Safari paint stray colours along its edges.\n    surface.style.width = `${W}px`;\n    surface.style.height = `${H}px`;\n    const end = align === 'end';\n    // The live droplet outline, shared by the glass and the items above it.\n    const box = { cw: w, ch: h, r: h / 2 };\n    let scaleNow = 1;\n    let closing = false;\n    const clipContent = () => {\n      // Items are scaled about the trigger's corner; clip in their own units.\n      const k = scaleNow;\n      const right = Math.max(0, W - box.cw / k);\n      const bottom = Math.max(0, H - box.ch / k);\n      content.style.clipPath = box.cw >= W - 0.5 && box.ch >= H - 0.5 && k === 1\n        ? ''\n        : `inset(0 ${end ? 0 : right}px ${bottom}px ${end ? right : 0}px round ${box.r / k}px)`;\n    };\n    const shape = (p: number) => {\n      const cw = Math.max(1, w + (W - w) * p);\n      const ch = Math.max(1, h + (H - h) * p);\n      const sx = cw / W;\n      const sy = ch / H;\n      panel.style.transform = `scale(${sx}, ${sy})`;\n      // In flight it's a round droplet (fully rounded on its short side) and\n      // only squares off into the menu's corners as it lands. The radius is\n      // given in the panel's own, unscaled units.\n      const land = clamp((p - 0.5) / 0.5, 0, 1);\n      const r = (Math.min(cw, ch) / 2) * (1 - land) + 24 * land;\n      panel.style.borderRadius = `${r / sx}px / ${r / sy}px`;\n      box.cw = cw;\n      box.ch = ch;\n      box.r = r;\n      clipContent();\n      // Near the button's size the two shapes coincide, so the button and the\n      // menu cross-fade there: the button melts into the menu on open and\n      // reappears inside the shrinking droplet on close.\n      // Closing, the button starts showing through early so the droplet\n      // never sits as a blank pill between the items and the label.\n      const k = clamp(p / (closing ? 0.7 : 0.35), 0, 1);\n      panel.style.opacity = String(closing ? Math.min(1, k * 1.4) : k);\n      trigger.style.opacity = String(1 - k);\n      // Past the button's size the close overshoots: the button squashes\n      // and springs back as part of the same motion.\n      trigger.style.scale = closing && p < -0.0005 ? `${1 - p * 0.6} ${1 + p * 1.2}` : '';\n    };\n    // The items ride above the glass on their own layer: they grow out of a\n    // blur as the droplet lands, on a critically damped curve so they sharpen\n    // once and stay sharp.\n    const reveal = (q: number) => {\n      const t = clamp(q, 0, 1);\n      const blur = 9 * (1 - t) ** 2.5;\n      content.style.opacity = String(t);\n      scaleNow = t < 0.999 ? 0.82 + 0.18 * t : 1;\n      content.style.scale = scaleNow === 1 ? '' : String(scaleNow);\n      clipContent();\n      content.style.filter = blur > 0.05 ? `blur(${blur.toFixed(2)}px)` : 'none';\n    };\n    shape(0);\n    reveal(0);\n    const s = createSpring(0, OPEN, (p, v) => {\n      shape(p);\n      // Unmount only once the landing jiggle has fully settled.\n      if (s.target === 0 && p === 0 && v === 0) {\n        trigger.style.opacity = '';\n        trigger.style.scale = '';\n        setMounted(false);\n      }\n    });\n    const fade = createSpring(0, FADE, reveal);\n    spring.current = {\n      ...s,\n      tune: s.tune,\n      set(target: number, instant?: boolean) {\n        closing = target === 0;\n        // A closing menu lets clicks through to the button beneath it.\n        surface.style.pointerEvents = closing ? 'none' : '';\n        fade.tune(target ? FADE : FADE_OUT);\n        fade.set(target, instant);\n        s.set(target, instant);\n      },\n    } as typeof s;\n    spring.current.set(1);\n    content.querySelector<HTMLElement>('[role^=\"menuitem\"]:not([disabled])')?.focus({ preventScroll: true });\n    return () => {\n      s.stop();\n      fade.stop();\n      spring.current = null;\n      trigger.style.opacity = '';\n      trigger.style.scale = '';\n    };\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [mounted]);\n\n  // Slide a finger across the items: the one beneath it lights up, and\n  // letting go there picks it, as on iOS.\n  useEffect(() => {\n    if (!mounted) return;\n    const panel = surfaceRef.current!;\n    let held: number | null = null;\n    let hot: HTMLElement | null = null;\n    const itemAt = (x: number, y: number) =>\n      (document.elementFromPoint(x, y) as HTMLElement | null)?.closest<HTMLElement>('.lg-menu__item:not(:disabled)') ?? null;\n    const light = (next: HTMLElement | null) => {\n      if (next === hot) return;\n      hot?.removeAttribute('data-active');\n      hot = next;\n      if (hot) {\n        hot.setAttribute('data-active', '');\n        haptic();\n      }\n    };\n    const down = (event: PointerEvent) => {\n      if (!event.isPrimary || event.button !== 0) return;\n      held = event.pointerId;\n      hot = null;\n      light(itemAt(event.clientX, event.clientY));\n    };\n    const move = (event: PointerEvent) => {\n      if (event.pointerId === held) light(itemAt(event.clientX, event.clientY));\n    };\n    const up = (event: PointerEvent) => {\n      if (event.pointerId !== held) return;\n      held = null;\n      const target = hot;\n      light(null);\n      const index = target ? Number(target.dataset.index) : -1;\n      const item = itemsRef.current[index];\n      if (item && !item.disabled) {\n        event.preventDefault();\n        haptic();\n        item.onSelect?.();\n        setOpen(false);\n      }\n    };\n    const cancel = (event: PointerEvent) => {\n      if (event.pointerId !== held) return;\n      held = null;\n      light(null);\n    };\n    // Touch drags must not scroll the page while scrubbing the menu.\n    const hold = (event: TouchEvent) => {\n      if (held !== null && event.cancelable) event.preventDefault();\n    };\n    panel.addEventListener('pointerdown', down);\n    window.addEventListener('pointermove', move);\n    window.addEventListener('pointerup', up);\n    window.addEventListener('pointercancel', cancel);\n    panel.addEventListener('touchmove', hold, { passive: false });\n    return () => {\n      panel.removeEventListener('pointerdown', down);\n      window.removeEventListener('pointermove', move);\n      window.removeEventListener('pointerup', up);\n      window.removeEventListener('pointercancel', cancel);\n      panel.removeEventListener('touchmove', hold);\n    };\n  }, [mounted]);\n\n  useEffect(() => {\n    if (!open) return;\n    const outside = (event: PointerEvent) => {\n      if (!anchorRef.current?.contains(event.target as Node)) setOpen(false);\n    };\n    const key = (event: KeyboardEvent) => {\n      if (event.key === 'Escape') {\n        setOpen(false);\n        triggerRef.current?.focus({ preventScroll: true });\n      }\n    };\n    document.addEventListener('pointerdown', outside, true);\n    window.addEventListener('keydown', key);\n    return () => {\n      document.removeEventListener('pointerdown', outside, true);\n      window.removeEventListener('keydown', key);\n    };\n  }, [open]);\n\n  const select = (item: GlassMenuItem) => {\n    haptic();\n    item.onSelect?.();\n    setOpen(false);\n  };\n\n  return (\n    <span ref={anchorRef} className={['lg-menu-anchor', className].filter(Boolean).join(' ')} data-align={align}>\n      <GlassButton\n        ref={triggerRef}\n        size={size}\n        icon={icon}\n        aria-label={ariaLabel}\n        aria-haspopup=\"menu\"\n        aria-expanded={open}\n        onClick={() => setOpen((value) => !value)}\n      />\n      {mounted && (\n        <div ref={surfaceRef} className=\"lg-menu-surface\">\n          <div ref={panelRef} className=\"lg-glass lg-menu\" data-liquid-glass=\"\" aria-hidden=\"true\" />\n          <div ref={contentRef} className=\"lg-menu__content\" role=\"menu\" aria-label={ariaLabel}>\n            {items.map((item, index) => (\n              <button\n                key={index}\n                type=\"button\"\n                // A pickable item (one with `checked` set) reports its state.\n                role={item.checked === undefined ? 'menuitem' : 'menuitemradio'}\n                aria-checked={item.checked === undefined ? undefined : item.checked}\n                className=\"lg-menu__item\"\n                data-destructive={item.destructive ? '' : undefined}\n                data-index={index}\n                disabled={item.disabled}\n                onClick={(event) => {\n                  // Pointer picks are handled on release; this is keyboard.\n                  if (event.detail === 0) select(item);\n                }}\n              >\n                {item.icon != null && <span className=\"lg-menu__icon\">{item.icon}</span>}\n                <span className=\"lg-menu__label\">{item.label}</span>\n                {item.checked && <span className=\"lg-menu__check\">{check ?? <Tick />}</span>}\n              </button>\n            ))}\n          </div>\n        </div>\n      )}\n    </span>\n  );\n};\n\nGlassMenu.displayName = 'GlassMenu';\n","import React from 'react';\nimport { LensTrack } from '../internal/LensTrack';\n\nexport interface GlassNavItem {\n  label: string;\n  icon?: React.ReactNode;\n  /** The selected look of `icon`, e.g. its filled version. The lens always\n   *  draws this one: whatever part of an icon it covers fills in, right up to\n   *  its edge, and the rest stays as `icon`, as on the iOS 26 tab bar. */\n  activeIcon?: React.ReactNode;\n}\n\nexport interface GlassNavProps {\n  /** Tabs to render. Icons sit above labels, like the iOS 26 tab bar. */\n  items: GlassNavItem[];\n  /** Zero-based index of the selected tab. Default 0. */\n  activeIndex?: number;\n  /** Called when a tab is tapped, or when the lens is dragged onto one. */\n  onChange?: (index: number) => void;\n  /** Refraction strength from 1 (subtle) to 10 (heavy). Default 5. */\n  intensity?: number;\n  /** Show the label under each icon. With `false` the bar is icons only and\n   *  the labels become the tabs' accessible names. Default true. */\n  showLabels?: boolean;\n  className?: string;\n  style?: React.CSSProperties;\n  'aria-label'?: string;\n}\n\n/**\n * The iOS 26 floating tab bar. Press a tab and the selection inflates into a\n * liquid lens you can drag across the bar; let go and it drops into place.\n */\nexport const GlassNav: React.FC<GlassNavProps> = ({\n  items,\n  activeIndex = 0,\n  onChange,\n  intensity = 5,\n  showLabels = true,\n  className,\n  style,\n  'aria-label': ariaLabel = 'Tabs',\n}) => {\n  const hasIcons = items.some((item) => item.icon != null);\n  const iconsOnly = hasIcons && !showLabels;\n  return (\n    <LensTrack\n      variant=\"tabbar\"\n      className={['lg-nav', hasIcons ? '' : 'lg-track--labels-only', iconsOnly ? 'lg-track--icons-only' : '', className].filter(Boolean).join(' ')}\n      style={style}\n      aria-label={ariaLabel}\n      intensity={intensity}\n      index={activeIndex}\n      onChange={onChange}\n      labels={items.map((item) => item.label)}\n      items={items.map((item, i) => (\n        <React.Fragment key={i}>\n          {item.icon != null &&\n            (item.activeIcon != null ? (\n              <span className=\"lg-nav__icons\">\n                <span className=\"lg-nav__icon lg-nav__icon--idle\">{item.icon}</span>\n                <span className=\"lg-nav__icon lg-nav__icon--active\">{item.activeIcon}</span>\n              </span>\n            ) : (\n              <span className=\"lg-nav__icon\">{item.icon}</span>\n            ))}\n          {!iconsOnly && <span className=\"lg-nav__label\">{item.label}</span>}\n        </React.Fragment>\n      ))}\n    />\n  );\n};\n\nGlassNav.displayName = 'GlassNav';\n","import React, { useRef } from 'react';\nimport { useLensTrack } from '../../engine/lensTrack';\nimport { useRefraction } from '../../engine/refraction';\nimport './LensTrack.css';\n\nexport interface LensTrackProps {\n  items: React.ReactNode[];\n  labels: string[];\n  index: number;\n  onChange?: (index: number) => void;\n  variant: 'tabbar' | 'segmented';\n  intensity?: number;\n  className?: string;\n  style?: React.CSSProperties;\n  'aria-label'?: string;\n}\n\nexport function LensTrack({\n  items,\n  labels,\n  index,\n  onChange,\n  variant,\n  intensity = 5,\n  className,\n  style,\n  'aria-label': ariaLabel,\n}: LensTrackProps) {\n  const bar = useRef<HTMLDivElement>(null);\n  const glass = useRef<HTMLSpanElement>(null);\n  const lens = useRef<HTMLSpanElement>(null);\n  const select = useRef<HTMLSpanElement>(null);\n  const strength = Math.max(1, Math.min(10, intensity)) / 5;\n  const tabbar = variant === 'tabbar';\n  const zoom = tabbar ? 1.04 : 1.1;\n\n  useRefraction(glass, { kind: 'surface', strength });\n  // iOS: a magnified centre and a thick rounded rim that bends whatever sits\n  // under its edge (icons, labels, the bar's own border) with a faint\n  // rainbow fringe.\n  // Where the backdrop can't be filtered (Safari, Firefox) the lens refracts a\n  // live copy of the bar instead, so the icons still magnify inside it. Both\n  // lenses work that way in every browser, so they look the same everywhere.\n  const overhang = tabbar ? 14 : 12;\n  // Only the part of the lens over the bar bends; where it rises past the bar\n  // it stays clear glass.\n  // The lens shows a magnified, fully tinted copy of the bar, bent at its rim\n  // where the browser can filter it: whatever the rim draws in is tinted too,\n  // as on iOS, instead of the real glyphs showing white through it.\n  useRefraction(lens, { kind: 'lens', strength: 1, stretch: 1, bezel: tabbar ? 24 : 16, zoom, dispersion: 1, copy: 'refract', copyOnly: true }, true, bar, () =>\n    bar.current?.hasAttribute('data-lifted') ?? false,\n  );\n\n  useLensTrack(\n    { bar, glass, lens, select },\n    {\n      count: items.length,\n      index,\n      onSelect: (next) => onChange?.(next),\n      overhang,\n      spread: tabbar ? 0.3 : 0.16,\n      contentZoom: zoom,\n      copied: true,\n      swell: tabbar ? 8 : 14,\n      // Neither bar stretches or moves up and down.\n      pull: false,\n    },\n  );\n\n  return (\n    <div\n      ref={bar}\n      role=\"tablist\"\n      aria-label={ariaLabel}\n      className={['lg-track', `lg-track--${variant}`, className].filter(Boolean).join(' ')}\n      data-liquid-glass=\"\"\n      style={{ ...style, '--lg-count': items.length, '--lg-index': index } as React.CSSProperties}\n    >\n      <span ref={glass} className=\"lg-glass lg-track__glass\" aria-hidden=\"true\" />\n      <span ref={select} className=\"lg-track__select\" aria-hidden=\"true\" />\n      {items.map((item, i) => (\n        <button\n          key={i}\n          type=\"button\"\n          role=\"tab\"\n          data-lg-item={i}\n          aria-selected={i === index}\n          aria-label={labels[i]}\n          tabIndex={i === index ? 0 : -1}\n          className=\"lg-track__item\"\n        >\n          {item}\n        </button>\n      ))}\n      <span ref={lens} className=\"lg-glass lg-track__lens\" data-lg-mirror-bare=\"\" aria-hidden=\"true\" />\n    </div>\n  );\n}\n","/**\n * Shared behaviour for tab bars and segmented controls.\n *\n * At rest the selection is a flat pill. Touch it and the pill inflates into a\n * clear refracting lens that rides above the bar, follows the finger (leaning\n * and stretching with speed), magnifies and tints what passes beneath it, then\n * drops into the nearest slot with a wobble.\n */\nimport { useEffect, useRef } from 'react';\nimport { guardSelection } from './selection';\nimport { SPRINGS, clamp, createJelly, createSpring, rubberband, springFrom } from './spring';\nimport { haptic } from './haptics';\n\n/** Finger-following feel for the bar's pull, as on buttons. */\nconst FOLLOW = springFrom(0.2, 0.82);\n/** A dragged lens's stretch: looser and further than the default jelly, so a\n *  fast drag jiggles when it stops. Taps keep the standard feel. */\nconst WOBBLE = springFrom(0.3, 0.24);\nconst WOBBLE_REACH = 0.17;\n\nexport interface LensTrackRefs {\n  bar: React.RefObject<HTMLElement | null>;\n  lens: React.RefObject<HTMLElement | null>;\n  select: React.RefObject<HTMLElement | null>;\n  glass: React.RefObject<HTMLElement | null>;\n}\n\nexport interface LensTrackOptions {\n  count: number;\n  index: number;\n  onSelect: (index: number) => void;\n  /** How far past the bar's height the lifted lens reaches (px). */\n  overhang: number;\n  /** Extra width (as a fraction of a slot) the lifted lens gains. */\n  spread: number;\n  /** Magnification applied by the backdrop filter to the original glyphs. */\n  contentZoom?: number;\n  /**\n   * The lens draws a magnified copy of the bar (Safari, Firefox). The real\n   * glyphs then fade out beneath the lens so they don't show doubled through\n   * its clear glass.\n   */\n  copied?: boolean;\n  /** How much the whole bar swells while touched (px on its long side). */\n  swell: number;\n  /** Whether a vertical drag stretches the bar toward the finger. Off for a\n   *  tab bar, which never moves up or down. */\n  pull?: boolean;\n}\n\nexport function useLensTrack(refs: LensTrackRefs, options: LensTrackOptions) {\n  const latest = useRef(options);\n  latest.current = options;\n  const api = useRef<{ setIndex: (index: number, instant?: boolean) => void } | null>(null);\n\n  useEffect(() => {\n    const bar = refs.bar.current;\n    const lens = refs.lens.current;\n    const glass = refs.glass.current;\n    const select = refs.select.current;\n    if (!bar || !lens || !glass || !select) return;\n\n    // The swell and pull move the whole component. A bar that is the only\n    // thing inside a glass shell (a dock that frosts the page for it) moves\n    // with that shell; otherwise its own glass would stay put while the\n    // icons and labels moved.\n    const parent = bar.parentElement;\n    const shell = parent?.classList.contains('lg-glass') && parent.childElementCount === 1 ? parent : bar;\n\n    let slot = 0;\n    let height = 0;\n    let pad = 0;\n    let padY = 0;\n    // The lens is laid out at its full lifted size (W×H) and only scaled\n    // *down* toward the resting pill. At full lift it renders 1:1: true pill\n    // curves and a pixel-sharp baked rim, never a stretched bitmap.\n    let W = 0;\n    let H = 0;\n    const state = { x: 0, lift: 0, swell: 0, squash: 0, pull: 0 };\n    let current = latest.current.index;\n    let gesture: {\n      id: number;\n      startX: number;\n      startY: number;\n      anchor: number;\n      moved: boolean;\n      box: DOMRect;\n      hovered: number;\n      startedAt: number;\n    } | null = null;\n    let dropTimer = 0;\n    let suppressClick = false;\n    // Direct children only: a copied lens (Safari) holds inert clones of them.\n    const buttons = Array.from(bar.querySelectorAll<HTMLElement>(':scope > [data-lg-item]'));\n    let glyphs: Array<{ node: HTMLElement; x: number; y: number; width: number; height: number; label: boolean; host: HTMLElement; dx: number; dy: number }> = [];\n    const preview = (index?: number) => {\n      if (index === undefined) delete bar.dataset.previewing;\n      else bar.dataset.previewing = '';\n      buttons.forEach((button, i) => button.toggleAttribute('data-lg-preview', i === index));\n    };\n\n    const measure = () => {\n      const style = getComputedStyle(bar);\n      pad = parseFloat(style.paddingLeft) || 0;\n      padY = parseFloat(style.paddingTop) || 0;\n      slot = (bar.clientWidth - pad - (parseFloat(style.paddingRight) || 0)) / latest.current.count;\n      height = bar.clientHeight - padY - (parseFloat(style.paddingBottom) || 0);\n      const { overhang, spread } = latest.current;\n      H = Math.round(bar.offsetHeight + overhang);\n      // Give narrow segments the same lifted clearance at their sides as\n      // above/below. A percentage alone leaves short labels tightly boxed.\n      W = Math.round(Math.max(slot * (1 + spread), slot + H - height));\n      lens.style.width = `${W}px`;\n      lens.style.height = `${H}px`;\n      lens.style.left = `${pad + (slot - W) / 2}px`;\n      lens.style.top = `${padY + (height - H) / 2}px`;\n      select.style.width = `${slot}px`;\n      select.style.left = `${pad}px`;\n      glyphs = buttons.flatMap((button) =>\n        Array.from(button.querySelectorAll<HTMLElement>('.lg-nav__label, .lg-nav__icon')).map((box) => {\n          // Symbols are already masked to their shape, so their hide mask\n          // goes on the icon box around them. Any other icon (an SVG, an\n          // image) is measured and masked by its box.\n          const label = box.classList.contains('lg-nav__label');\n          const node = label ? box : (box.querySelector<HTMLElement>(':scope > .lg-symbol') ?? box);\n          const host = box;\n          const n = node.getBoundingClientRect();\n          const h = host.getBoundingClientRect();\n          return {\n            node,\n            x: button.offsetLeft + node.offsetLeft - pad,\n            y: node.offsetTop,\n            width: node.offsetWidth,\n            height: node.offsetHeight,\n            label,\n            host,\n            dx: n.left - h.left,\n            dy: n.top - h.top,\n          };\n        }),\n      );\n    };\n\n    const paint = () => {\n      const { swell, squash } = state;\n      const x = state.x;\n      const lift = clamp(state.lift, 0, 1.08);\n      if (!W || !H) return;\n      const kx = ((slot + (W - slot) * lift) / W) * (1 + squash);\n      const ky = ((height + (H - height) * lift) / H) * (1 - squash * 0.6);\n      const grow = 1 + (latest.current.swell / Math.max(bar.offsetWidth, 1)) * swell;\n      // The bar is held by the finger like a button, but only vertically:\n      // sideways drags move the lens, never the bar. Pulled up or down it\n      // leans a few px and draws out a little that way, thinning across.\n      const pull = state.pull;\n      const ey = Math.abs(pull) / Math.max(bar.offsetHeight, 1);\n      const transform = `translateX(${x}px) scale(${kx}, ${ky})`;\n      lens.style.transform = transform;\n      select.style.transform = `translateX(${x}px)`;\n      lens.style.opacity = String(clamp(lift * 4, 0, 1));\n      // A bar that doesn't pull only swells sideways: it never moves up or down.\n      shell.style.scale = latest.current.pull === false ? `${grow} 1` : `${grow * (1 - ey * 0.15)} ${grow * (1 + ey * 0.5)}`;\n      shell.style.translate = `0px ${pull / 2}px`;\n      lens.style.setProperty('--lg-lift', String(clamp(lift, 0, 1)));\n      bar.style.setProperty('--lg-lift', String(clamp(lift, 0, 1)));\n      // Paint a true capsule over each original glyph. A single horizontal\n      // gradient turns an icon blue in a rectangular strip before the curved\n      // end reaches it. Account for the filter's source magnification too.\n      for (const glyph of glyphs) {\n        if (lift <= 0.02 && !gesture) {\n          glyph.node.style.removeProperty('--lg-content-tint');\n          glyph.node.style.removeProperty('transform');\n          glyph.host.style.removeProperty('--lg-content-hide');\n          continue;\n        }\n        if (latest.current.copied) {\n          // Cut the lens's true footprint out of the real glyph.\n          const hy = H * ky / 2;\n          const hx = H * kx / 2;\n          const run = Math.max(0, (W - H) * kx / 2);\n          const ccx = x + slot / 2 - glyph.x + glyph.dx;\n          const ccy = height / 2 - glyph.y + glyph.dy;\n          const fade = clamp(lift * 3, 0, 1);\n          const solid = `rgb(0 0 0 / ${fade})`;\n          glyph.host.style.setProperty('--lg-content-hide', [\n            'linear-gradient(#000, #000)',\n            `radial-gradient(ellipse ${hx}px ${hy}px at ${ccx - run}px ${ccy}px, ${solid} calc(100% - 1px), transparent 100%)`,\n            `radial-gradient(ellipse ${hx}px ${hy}px at ${ccx + run}px ${ccy}px, ${solid} calc(100% - 1px), transparent 100%)`,\n            `linear-gradient(${solid}, ${solid}) ${ccx - run}px ${ccy - hy}px / ${run * 2}px ${hy * 2}px no-repeat`,\n          ].join(', '));\n        }\n        const zoom = latest.current.contentZoom ?? 1;\n        const ry = H * ky / (2 * zoom);\n        const rx = H * kx / (2 * zoom);\n        const straight = Math.max(0, (W - H) * kx / (2 * zoom));\n        const dy = clamp(Math.abs(glyph.y + glyph.height / 2 - height / 2) / ry, 0, 1);\n        const half = straight + rx * Math.sqrt(1 - dy * dy);\n        const from = x + slot / 2 - half - glyph.x;\n        const to = x + slot / 2 + half - glyph.x;\n        const normal = 'var(--lg-fg)';\n        const active = 'var(--lg-track-active, var(--lg-accent))';\n        const coverage = clamp((Math.min(glyph.width, to) - Math.max(0, from)) / Math.max(1, glyph.width), 0, 1);\n        const scale = 1 + clamp(lift, 0, 1) * coverage * (glyph.label ? 0.035 : 0.08);\n        const cx = (x + slot / 2 - glyph.x - glyph.width / 2) / scale + glyph.width / 2;\n        const cy = (height / 2 - glyph.y - glyph.height / 2) / scale + glyph.height / 2;\n        const left = cx - straight / scale;\n        const right = cx + straight / scale;\n        const radiusX = rx / scale;\n        const radiusY = ry / scale;\n        glyph.node.style.setProperty('--lg-content-tint', [\n          `radial-gradient(ellipse ${radiusX}px ${radiusY}px at ${left}px ${cy}px, ${active} calc(100% - 0.5px), transparent 100%)`,\n          `radial-gradient(ellipse ${radiusX}px ${radiusY}px at ${right}px ${cy}px, ${active} calc(100% - 0.5px), transparent 100%)`,\n          `linear-gradient(${active}, ${active}) ${left}px ${cy - radiusY}px / ${right - left}px ${radiusY * 2}px no-repeat`,\n          `linear-gradient(${normal}, ${normal})`,\n        ].join(', '));\n        glyph.node.style.transform = `scale(${scale})`;\n      }\n      if (!gesture && lift < 0.02) delete bar.dataset.lifted;\n    };\n\n    // Travel stretches the droplet along its path, more the faster it goes,\n    // and it jiggles back to round when the drag slows or stops.\n    // Set while a drag moves the lens (and until it lands): only then does\n    // it get the looser wobble.\n    let dragging = false;\n    const jelly = createJelly((value) => {\n      state.squash = value;\n      paint();\n    }, 0.13, 1600);\n    const x = createSpring(current * slot, SPRINGS.snap, (value, velocity) => {\n      state.x = value;\n      jelly.feed(velocity, dragging ? WOBBLE_REACH : undefined);\n      paint();\n    });\n    const lift = createSpring(0, SPRINGS.lift, (value) => {\n      state.lift = value;\n      paint();\n    });\n    const swell = createSpring(0, SPRINGS.press, (value) => {\n      state.swell = value;\n      paint();\n    });\n    const pullY = createSpring(0, SPRINGS.release, (value) => {\n      state.pull = value;\n      paint();\n    });\n    const pull = (dy: number) => {\n      if (latest.current.pull === false) return;\n      // Saturating reach (rubber band): a long drag barely adds to it, so the\n      // bar gives like a droplet held in place and never slides away.\n      pullY.tune(FOLLOW);\n      pullY.set(rubberband(dy, Math.min(10, bar.offsetHeight * 0.2), 0.5));\n    };\n    const letGo = () => {\n      pullY.tune(SPRINGS.release);\n      pullY.set(0);\n    };\n\n    const place = (index: number, instant = false) => {\n      current = index;\n      if (!gesture) {\n        x.tune(SPRINGS.snap);\n        x.set(index * slot, instant);\n      }\n    };\n\n    const position = (clientX: number) => {\n      if (!gesture) return 0;\n      const raw = gesture.anchor + (clientX - gesture.startX) * bar.offsetWidth / Math.max(1, gesture.box.width);\n      const max = slot * (latest.current.count - 1);\n      // iOS gives only a few points of overscroll past the end segments.\n      const give = Math.min(14, slot * 0.12);\n      if (raw < 0) return rubberband(raw, give, 0.55);\n      if (raw > max) return max + rubberband(raw - max, give, 0.55);\n      return raw;\n    };\n\n    const light = (clientX: number, box: DOMRect) => {\n      glass.style.setProperty('--lg-x', `${clamp(((clientX - box.left) / box.width) * 100, 0, 100)}%`);\n      lens.style.setProperty('--lg-x', `${clamp(((clientX - box.left - pad - state.x) / slot) * 100, 0, 100)}%`);\n    };\n\n    const itemAt = (event: PointerEvent) => {\n      const target = (event.target as HTMLElement).closest<HTMLElement>('[data-lg-item]');\n      return target && bar.contains(target) ? Number(target.dataset.lgItem) : -1;\n    };\n\n    const onDown = (event: PointerEvent) => {\n      delete bar.dataset.keyboard;\n      if (!event.isPrimary || event.button !== 0 || gesture) return;\n      const index = itemAt(event);\n      if (index < 0) return;\n      clearTimeout(dropTimer);\n      measure();\n      dragging = false;\n      jelly.tune(SPRINGS.jelly);\n      const box = bar.getBoundingClientRect();\n      gesture = { id: event.pointerId, startX: event.clientX, startY: event.clientY, anchor: index * slot, moved: false, box, hovered: index, startedAt: performance.now() };\n      suppressClick = false;\n      bar.dataset.lifted = '';\n      preview(index);\n      lens.dataset.pressed = '';\n      light(event.clientX, box);\n      haptic();\n      lift.tune(SPRINGS.lift);\n      lift.set(1);\n      swell.tune(SPRINGS.press);\n      swell.set(1);\n      // The lens slides out of the old selection toward the finger.\n      x.tune(SPRINGS.snap);\n      x.set(index * slot);\n      paint();\n    };\n\n    const onMove = (event: PointerEvent) => {\n      if (event.pointerId !== gesture?.id) return;\n      if (!gesture.moved && Math.abs(event.clientX - gesture.startX) > 5) {\n        gesture.moved = true;\n        try {\n          bar.setPointerCapture(event.pointerId);\n        } catch {\n          /* already released */\n        }\n      }\n      light(event.clientX, gesture.box);\n      pull(event.clientY - gesture.startY);\n      if (!gesture.moved) return;\n      const at = position(event.clientX);\n      if (!dragging) {\n        dragging = true;\n        jelly.tune(WOBBLE);\n      }\n      x.tune(SPRINGS.drag);\n      x.set(at);\n      const hovered = clamp(Math.round(at / slot), 0, latest.current.count - 1);\n      if (hovered !== gesture.hovered) {\n        gesture.hovered = hovered;\n        preview(hovered);\n        haptic();\n      }\n    };\n\n    const finish = (event: PointerEvent, commit: boolean) => {\n      if (event.pointerId !== gesture?.id) return;\n      const { moved, box, startedAt } = gesture;\n      const at = moved ? position(event.clientX) : gesture.anchor;\n      const index = clamp(Math.round(at / slot), 0, latest.current.count - 1);\n      gesture = null;\n      preview();\n      delete lens.dataset.pressed;\n      if (bar.hasPointerCapture?.(event.pointerId)) bar.releasePointerCapture(event.pointerId);\n      const inside = event.clientY >= box.top - 30 && event.clientY <= box.bottom + 30;\n      // A quick tap should show the full lift, just like holding the tab.\n      // Drags still settle immediately when the pointer is released.\n      const drop = () => {\n        lift.tune(SPRINGS.settle);\n        lift.set(0);\n      };\n      const hold = commit && !moved ? Math.max(0, 200 - (performance.now() - startedAt)) : 0;\n      if (hold) dropTimer = window.setTimeout(drop, hold);\n      else drop();\n      swell.tune(SPRINGS.release);\n      swell.set(0);\n      letGo();\n      x.tune(SPRINGS.snap);\n      if (commit && (moved || inside)) {\n        suppressClick = true;\n        current = index;\n        x.set(index * slot);\n        if (index !== latest.current.index) latest.current.onSelect(index);\n      } else {\n        x.set(current * slot);\n      }\n    };\n\n    const onUp = (event: PointerEvent) => finish(event, true);\n    const onCancel = (event: PointerEvent) => finish(event, false);\n    const onBlur = () => {\n      clearTimeout(dropTimer);\n      if (!gesture) {\n        lift.tune(SPRINGS.settle);\n        lift.set(0);\n        return;\n      }\n      const id = gesture.id;\n      gesture = null;\n      preview();\n      delete lens.dataset.pressed;\n      if (bar.hasPointerCapture(id)) bar.releasePointerCapture(id);\n      lift.tune(SPRINGS.settle);\n      lift.set(0);\n      swell.tune(SPRINGS.release);\n      swell.set(0);\n      letGo();\n      x.tune(SPRINGS.snap);\n      x.set(current * slot);\n    };\n\n    const onClick = (event: MouseEvent) => {\n      if (suppressClick && event.detail !== 0) {\n        suppressClick = false;\n        event.preventDefault();\n        event.stopPropagation();\n        return;\n      }\n      const target = (event.target as HTMLElement).closest<HTMLElement>('[data-lg-item]');\n      if (!target) return;\n      const index = Number(target.dataset.lgItem);\n      if (index !== latest.current.index) latest.current.onSelect(index);\n    };\n\n    const onKey = (event: KeyboardEvent) => {\n      const keys = ['ArrowLeft', 'ArrowRight', 'Home', 'End'];\n      if (!keys.includes(event.key)) return;\n      bar.dataset.keyboard = '';\n      event.preventDefault();\n      const { count, index } = latest.current;\n      const next =\n        event.key === 'Home'\n          ? 0\n          : event.key === 'End'\n            ? count - 1\n            : (index + (event.key === 'ArrowRight' ? 1 : count - 1)) % count;\n      latest.current.onSelect(next);\n      bar.querySelector<HTMLElement>(`[data-lg-item=\"${next}\"]`)?.focus();\n    };\n\n    const onTouchMove = (event: TouchEvent) => {\n      // Holding the lens owns the gesture: the page must not scroll under it.\n      if (gesture && event.cancelable) event.preventDefault();\n    };\n\n    const observer = new ResizeObserver(() => {\n      measure();\n      if (!gesture) x.set(current * slot, true);\n    });\n\n    measure();\n    x.set(current * slot, true);\n    bar.dataset.ready = '';\n    observer.observe(bar);\n    const unguard = guardSelection(bar);\n    bar.addEventListener('pointerdown', onDown);\n    window.addEventListener('pointermove', onMove);\n    window.addEventListener('pointerup', onUp);\n    window.addEventListener('pointercancel', onCancel);\n    window.addEventListener('blur', onBlur);\n    bar.addEventListener('click', onClick, true);\n    bar.addEventListener('keydown', onKey);\n    bar.addEventListener('touchmove', onTouchMove, { passive: false });\n\n    api.current = { setIndex: place };\n\n    return () => {\n      clearTimeout(dropTimer);\n      api.current = null;\n      [x, lift, swell, pullY, jelly].forEach((s) => s.stop());\n      shell.style.removeProperty('scale');\n      shell.style.removeProperty('translate');\n      unguard();\n      observer.disconnect();\n      bar.removeEventListener('pointerdown', onDown);\n      window.removeEventListener('pointermove', onMove);\n      window.removeEventListener('pointerup', onUp);\n      window.removeEventListener('pointercancel', onCancel);\n      window.removeEventListener('blur', onBlur);\n      bar.removeEventListener('click', onClick, true);\n      bar.removeEventListener('keydown', onKey);\n      bar.removeEventListener('touchmove', onTouchMove);\n      delete bar.dataset.ready;\n      delete bar.dataset.lifted;\n      preview();\n      glyphs.forEach(({ node, host }) => {\n        node.style.removeProperty('--lg-content-tint');\n        node.style.removeProperty('transform');\n        host.style.removeProperty('--lg-content-hide');\n      });\n    };\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [options.count]);\n\n  useEffect(() => {\n    api.current?.setIndex(options.index);\n  }, [options.index]);\n}\n","import React from 'react';\nimport { LensTrack } from '../internal/LensTrack';\n\nexport interface GlassSegmentedOption {\n  label: string;\n  icon?: React.ReactNode;\n}\n\nexport interface GlassSegmentedProps {\n  /** Segment labels, or `{ label, icon }` objects. */\n  options: Array<string | GlassSegmentedOption>;\n  /** Zero-based index of the selected segment. */\n  value: number;\n  onChange?: (index: number) => void;\n  /** 36px (default) or compact 28px. */\n  size?: 'sm' | 'md';\n  /** Refraction strength from 1 (subtle) to 10 (heavy). Default 5. */\n  intensity?: number;\n  className?: string;\n  style?: React.CSSProperties;\n  'aria-label'?: string;\n}\n\n/**\n * iOS 26 segmented control. The whole control swells under the finger and the\n * selection lifts into a clear lens that can be dragged between segments.\n */\nexport const GlassSegmented: React.FC<GlassSegmentedProps> = ({\n  options,\n  value,\n  onChange,\n  size = 'md',\n  intensity = 5,\n  className,\n  style,\n  'aria-label': ariaLabel,\n}) => {\n  const normalized = options.map((option) => (typeof option === 'string' ? { label: option } : option));\n  return (\n    <LensTrack\n      variant=\"segmented\"\n      className={[size === 'sm' ? 'lg-track--sm' : '', className].filter(Boolean).join(' ')}\n      style={style}\n      aria-label={ariaLabel}\n      intensity={intensity}\n      index={value}\n      onChange={onChange}\n      labels={normalized.map((option) => option.label)}\n      items={normalized.map((option, i) => (\n        <React.Fragment key={i}>\n          {/* Wrapped like tab bar icons, so the real icon hides under the lens\n              (only its magnified copy shows) and takes the lens tint. */}\n          {option.icon != null && <span className=\"lg-nav__icon\">{option.icon}</span>}\n          <span className=\"lg-nav__label\">{option.label}</span>\n        </React.Fragment>\n      ))}\n    />\n  );\n};\n\nGlassSegmented.displayName = 'GlassSegmented';\n","import React, { useEffect, useImperativeHandle, useRef } from 'react';\nimport { SPRINGS, clamp, createSpring, rubberband } from '../../engine/spring';\nimport { canRefractBackdrop, useRefraction } from '../../engine/refraction';\nimport { haptic } from '../../engine/haptics';\nimport { guardSelection } from '../../engine/selection';\nimport './GlassSlider.css';\n\nexport interface GlassSliderProps\n  extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'type' | 'value' | 'min' | 'max'> {\n  value?: number;\n  min?: number;\n  max?: number;\n  /** Continuous dragging by default (`\"any\"`). Set a numeric step to snap. */\n  step?: React.InputHTMLAttributes<HTMLInputElement>['step'];\n  /** Refraction strength from 1 (subtle) to 10 (heavy). Default 5. */\n  intensity?: number;\n  /** Fill colour. Defaults to the accent blue (white in block mode). */\n  tint?: string;\n  /** Kept for API compatibility. */\n  shimmer?: boolean;\n  /** Kept for API compatibility. */\n  thickness?: number;\n  /**\n   * `true` (default): thin iOS track with a glass thumb that lifts into a lens.\n   * `false`: Control Center block that fills and stretches under the finger.\n   */\n  showThumb?: boolean;\n  /** Icon shown inside the block slider. */\n  icon?: React.ReactNode;\n  /** Label shown inside the block slider. */\n  label?: string;\n  onChange?: (value: number) => void;\n}\n\nexport const GlassSlider = React.forwardRef<HTMLInputElement, GlassSliderProps>(\n  (\n    {\n      value = 0,\n      min = 0,\n      max = 100,\n      step = 'any',\n      intensity = 5,\n      tint,\n      shimmer: _shimmer,\n      thickness: _thickness,\n      showThumb = true,\n      icon,\n      label,\n      onChange,\n      className,\n      style,\n      disabled,\n      ...rest\n    },\n    forwardedRef,\n  ) => {\n    const rootRef = useRef<HTMLDivElement>(null);\n    const inputRef = useRef<HTMLInputElement>(null);\n    const thumbRef = useRef<HTMLSpanElement>(null);\n    const faceRef = useRef<HTMLSpanElement>(null);\n    const blockRef = useRef<HTMLDivElement>(null);\n    /** How far (px) the finger has dragged past either end; drives overscroll. */\n    const pastRef = useRef(0);\n    useImperativeHandle(forwardedRef, () => inputRef.current!);\n\n    // Sliding is relative, like iOS: touching the track never jumps the value,\n    // only moving the finger changes it. A numeric step remains an explicit\n    // opt-in, and the native range still owns keyboard/accessibility.\n    useEffect(() => {\n      const input = inputRef.current!;\n      const root = rootRef.current!;\n      const setValue = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value')!.set!;\n      let drag: { id: number; x: number; from: number; travel: number } | null = null;\n      const update = (clientX: number) => {\n        if (!drag || max <= min) return;\n        const raw = drag.from + (clientX - drag.x) / drag.travel;\n        const fraction = clamp(raw, 0, 1);\n        pastRef.current = (raw - fraction) * drag.travel;\n        let next = min + fraction * (max - min);\n        const increment = Number(step);\n        if (step !== 'any' && Number.isFinite(increment) && increment > 0) {\n          next = clamp(min + Math.round((next - min) / increment) * increment, min, max);\n          next = Number(next.toFixed(10));\n        }\n        root.style.setProperty('--lg-progress', String((next - min) / (max - min)));\n        if (next === input.valueAsNumber) return;\n        // Use the native setter so React receives a real input update exactly\n        // once; consumers' onInput handlers keep working too.\n        setValue.call(input, String(next));\n        input.dispatchEvent(new Event('input', { bubbles: true }));\n      };\n      const down = (event: PointerEvent) => {\n        if (input.disabled || !event.isPrimary || event.button !== 0 || drag) return;\n        event.preventDefault();\n        delete root.dataset.keyboard;\n        // Focusing the hidden native range during a touch can immediately\n        // blur it on iOS. Pointer capture, not input focus, owns the gesture.\n        if (event.pointerType !== 'touch') input.focus({ preventScroll: true });\n        const box = root.getBoundingClientRect();\n        const inset = showThumb ? 19 * box.width / root.offsetWidth : 0;\n        const from = max > min ? clamp((input.valueAsNumber - min) / (max - min), 0, 1) : 0;\n        drag = { id: event.pointerId, x: event.clientX, from, travel: Math.max(1, box.width - inset * 2) };\n        pastRef.current = 0;\n        root.dataset.dragging = '';\n        root.setPointerCapture(event.pointerId);\n      };\n      const move = (event: PointerEvent) => {\n        if (event.pointerId !== drag?.id) return;\n        event.preventDefault();\n        update(event.clientX);\n      };\n      const release = () => {\n        if (!drag) return;\n        const id = drag.id;\n        drag = null;\n        pastRef.current = 0;\n        delete root.dataset.dragging;\n        if (root.hasPointerCapture(id)) root.releasePointerCapture(id);\n      };\n      const up = (event: PointerEvent) => {\n        if (event.pointerId !== drag?.id) return;\n        update(event.clientX);\n        release();\n      };\n      // Hit-test the custom surface, not WebKit's native range control.\n      // On iOS the native thumb can cancel pointer events as it takes over\n      // the drag, dropping the glass lift while values continue changing.\n      const unguard = guardSelection(root);\n      root.addEventListener('pointerdown', down);\n      root.addEventListener('pointermove', move);\n      root.addEventListener('pointerup', up);\n      root.addEventListener('pointercancel', release);\n      root.addEventListener('lostpointercapture', release);\n      window.addEventListener('blur', release);\n      return () => {\n        release();\n        unguard();\n        root.removeEventListener('pointerdown', down);\n        root.removeEventListener('pointermove', move);\n        root.removeEventListener('pointerup', up);\n        root.removeEventListener('pointercancel', release);\n        root.removeEventListener('lostpointercapture', release);\n        window.removeEventListener('blur', release);\n      };\n    }, [min, max, step, showThumb]);\n\n    const strength = Math.max(1, Math.min(10, intensity)) / 5;\n    // Safari/Firefox draw the magnified rail as a copy inside the thumb.\n    const [mirrored, setMirrored] = React.useState(false);\n    useEffect(() => setMirrored(!canRefractBackdrop()), []);\n    const progress = max > min ? clamp((Number(value) - min) / (max - min), 0, 1) : 0;\n\n    // iOS magnifies the rail ~2× inside the lifted thumb.\n    // Only the band around the rail bends; above and below it the lens stays\n    // clear, so its rim doesn't drag a sliver of the fill to the top edge.\n    useRefraction(thumbRef, { kind: 'lens', zoom: 1.95, bezel: 7, thickness: 16, strength, dispersion: 0.6, inset: 11 }, showThumb, rootRef, () =>\n      parseFloat(rootRef.current?.style.getPropertyValue('--lg-lift') || '0') > 0.01,\n    );\n    useRefraction(blockRef, { kind: 'surface', strength }, !showThumb);\n\n    // Thumb lift (thin slider)\n    useEffect(() => {\n      if (!showThumb) return;\n      const input = inputRef.current!;\n      const thumb = thumbRef.current!;\n      const face = faceRef.current!;\n      const root = rootRef.current!;\n      const v = { lift: 0, stretch: 0, over: 0 };\n      const paint = () => {\n        const s = 0.655 + 0.345 * v.lift;\n        // Pulled past an end, the lens slides a little further and stretches\n        // toward the finger, then springs back on release.\n        const pull = (Math.abs(v.over) / 58) * 0.6;\n        thumb.style.scale = `${s * (1 + v.stretch + pull)} ${s * (1 - v.stretch * 0.5 - pull * 0.4)}`;\n        face.style.opacity = String(1 - clamp(v.lift, 0, 1) * 0.92);\n        root.style.setProperty('--lg-lift', String(clamp(v.lift, 0, 1)));\n        root.style.setProperty('--lg-over', `${v.over.toFixed(2)}px`);\n        if (v.lift < 0.01 && lift.target === 0) delete root.dataset.lifted;\n      };\n      const lift = createSpring(0, SPRINGS.lift, (x) => {\n        v.lift = x;\n        paint();\n      });\n      const stretch = createSpring(0, SPRINGS.release, (x) => {\n        v.stretch = x;\n        paint();\n      });\n      const over = createSpring(0, SPRINGS.release, (x) => {\n        v.over = x;\n        paint();\n      });\n      paint();\n      let lastX = 0;\n      let lastT = 0;\n      const down = (event: PointerEvent) => {\n        if (input.disabled || !event.isPrimary || event.button !== 0) return;\n        lastX = event.clientX;\n        lastT = event.timeStamp;\n        root.dataset.lifted = '';\n        lift.tune(SPRINGS.lift);\n        lift.set(1);\n        haptic();\n      };\n      const move = (event: PointerEvent) => {\n        if (lift.target !== 1) return;\n        const dt = Math.max(1, event.timeStamp - lastT);\n        const speed = Math.abs(event.clientX - lastX) / dt;\n        lastX = event.clientX;\n        lastT = event.timeStamp;\n        stretch.tune(SPRINGS.drag);\n        stretch.set(clamp(speed * 0.015, 0, 0.035));\n        over.tune(SPRINGS.drag);\n        over.set(rubberband(pastRef.current, 12, 0.5));\n      };\n      const up = () => {\n        if (lift.target === 0) return;\n        lift.tune(SPRINGS.settle);\n        lift.set(0);\n        stretch.tune(SPRINGS.release);\n        stretch.set(0);\n        over.tune(SPRINGS.release);\n        over.set(0);\n      };\n      root.addEventListener('pointerdown', down);\n      window.addEventListener('pointermove', move);\n      window.addEventListener('pointerup', up);\n      window.addEventListener('pointercancel', up);\n      root.addEventListener('lostpointercapture', up);\n      window.addEventListener('blur', up);\n      return () => {\n        lift.stop();\n        stretch.stop();\n        over.stop();\n        root.removeEventListener('pointerdown', down);\n        window.removeEventListener('pointermove', move);\n        window.removeEventListener('pointerup', up);\n        window.removeEventListener('pointercancel', up);\n        root.removeEventListener('lostpointercapture', up);\n        window.removeEventListener('blur', up);\n        delete root.dataset.lifted;\n      };\n    }, [showThumb]);\n\n    // Block stretch (Control Center style): swells on touch, rubber-bands past the ends.\n    useEffect(() => {\n      if (showThumb) return;\n      const input = inputRef.current!;\n      const block = blockRef.current!;\n      const root = rootRef.current!;\n      const v = { swell: 0, over: 0 };\n      const paint = () => {\n        const w = block.offsetWidth || 1;\n        const grow = 1 + (10 / Math.max(w, 1)) * v.swell;\n        const stretchX = 1 + Math.abs(v.over) / w;\n        block.style.scale = `${grow * stretchX} ${grow * (1 - Math.abs(v.over) / w / 2)}`;\n        block.style.translate = `${v.over / 2}px 0`;\n      };\n      const swell = createSpring(0, SPRINGS.press, (x) => {\n        v.swell = x;\n        paint();\n      });\n      const over = createSpring(0, SPRINGS.release, (x) => {\n        v.over = x;\n        paint();\n      });\n      let active: { id: number } | null = null;\n      const down = (event: PointerEvent) => {\n        if (input.disabled || !event.isPrimary || event.button !== 0) return;\n        active = { id: event.pointerId };\n        swell.tune(SPRINGS.press);\n        swell.set(1);\n        haptic();\n      };\n      const move = (event: PointerEvent) => {\n        if (event.pointerId !== active?.id) return;\n        over.tune(SPRINGS.drag);\n        // A short, firm overscroll: the block only gives a few px past its end.\n        over.set(rubberband(pastRef.current, 26, 0.6));\n      };\n      const reset = () => {\n        if (!active) return;\n        active = null;\n        swell.tune(SPRINGS.release);\n        swell.set(0);\n        over.tune(SPRINGS.release);\n        over.set(0);\n      };\n      const up = (event: PointerEvent) => {\n        if (event.pointerId === active?.id) reset();\n      };\n      root.addEventListener('pointerdown', down);\n      root.addEventListener('lostpointercapture', reset);\n      window.addEventListener('blur', reset);\n      window.addEventListener('pointermove', move);\n      window.addEventListener('pointerup', up);\n      window.addEventListener('pointercancel', up);\n      return () => {\n        swell.stop();\n        over.stop();\n        root.removeEventListener('pointerdown', down);\n        root.removeEventListener('lostpointercapture', reset);\n        window.removeEventListener('blur', reset);\n        window.removeEventListener('pointermove', move);\n        window.removeEventListener('pointerup', up);\n        window.removeEventListener('pointercancel', up);\n      };\n    }, [showThumb]);\n\n    const input = (\n      <input\n        ref={inputRef}\n        type=\"range\"\n        min={min}\n        max={max}\n        step={step}\n        value={value}\n        disabled={disabled}\n        aria-label={rest['aria-label'] ?? label}\n        onChange={(event) => onChange?.(Number(event.currentTarget.value))}\n        onKeyDown={() => rootRef.current?.setAttribute('data-keyboard', '')}\n        onPointerDown={() => rootRef.current?.removeAttribute('data-keyboard')}\n        className=\"lg-slider__input\"\n        {...rest}\n      />\n    );\n\n    const vars = { '--lg-progress': progress, ...(tint ? { '--lg-slider-fill': tint } : {}), ...style } as React.CSSProperties;\n\n    if (!showThumb) {\n      return (\n        <div\n          ref={rootRef}\n          className={['lg-slider', 'lg-slider--block', className].filter(Boolean).join(' ')}\n          data-liquid-glass=\"\"\n          style={vars}\n        >\n          <div ref={blockRef} className=\"lg-glass lg-slider__block\">\n            <span className=\"lg-slider__block-content\" aria-hidden=\"true\">\n              {icon && <span className=\"lg-slider__icon\">{icon}</span>}\n              {label && <span className=\"lg-slider__label\">{label}</span>}\n              <span className=\"lg-slider__value\">{Math.round(Number(value))}</span>\n            </span>\n            {/* The lit part, with its own dark glyphs so they read on white. */}\n            <span className=\"lg-slider__block-fill\" aria-hidden=\"true\">\n              <span className=\"lg-slider__block-content lg-slider__block-content--lit\">\n                {icon && <span className=\"lg-slider__icon\">{icon}</span>}\n                {label && <span className=\"lg-slider__label\">{label}</span>}\n                <span className=\"lg-slider__value\">{Math.round(Number(value))}</span>\n              </span>\n            </span>\n          </div>\n          {input}\n        </div>\n      );\n    }\n\n    return (\n      <div\n        ref={rootRef}\n        className={['lg-slider', className].filter(Boolean).join(' ')}\n        data-liquid-glass=\"\"\n        data-mirror={mirrored ? '' : undefined}\n        style={vars}\n      >\n        <span className=\"lg-slider__rail\" aria-hidden=\"true\">\n          <span className=\"lg-slider__fill\" />\n        </span>\n        <span className=\"lg-slider__thumb-slot\" aria-hidden=\"true\">\n          <span ref={thumbRef} className=\"lg-glass lg-slider__thumb\" data-lg-mirror-bare=\"\">\n            <span ref={faceRef} className=\"lg-slider__face\" />\n          </span>\n        </span>\n        {input}\n      </div>\n    );\n  },\n);\n\nGlassSlider.displayName = 'GlassSlider';\n","import React, { useEffect, useImperativeHandle, useRef, useState } from 'react';\nimport { SPRINGS, clamp, createJelly, createSpring, rubberband, springFrom } from '../../engine/spring';\n\n/** The knob drops back with a short, gentle settle rather than a jelly bounce. */\nconst SETTLE = springFrom(0.36, 0.68);\n/** The track colour eases in and out over about a third of a second, evenly\n *  enough that it never reads as a snap to green. */\nconst TINT = springFrom(0.5, 1);\nimport { useRefraction } from '../../engine/refraction';\nimport { haptic } from '../../engine/haptics';\nimport { guardSelection } from '../../engine/selection';\nimport './GlassSwitch.css';\n\nexport interface GlassSwitchProps\n  extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'onChange' | 'value' | 'defaultValue'> {\n  checked?: boolean;\n  defaultChecked?: boolean;\n  onChange?: (checked: boolean) => void;\n  /** On-state colour. Defaults to system green. */\n  tint?: string;\n  /** Refraction strength from 1 (subtle) to 10 (heavy). Default 5. */\n  intensity?: number;\n}\n\n/** Thumb lens box at full lift; at rest it is scaled down to a 38×24 pill. */\nconst REST = 0.655;\nconst TRAVEL = 22;\n\n/**\n * iOS 26 switch. Touch the knob and it inflates into a clear lens that hangs\n * over the track, refracting it; drag it across or tap, and it drops back\n * into a white pill with a jelly wobble.\n */\nexport const GlassSwitch = React.forwardRef<HTMLButtonElement, GlassSwitchProps>(\n  (\n    { checked: checkedProp, defaultChecked = false, onChange, tint, intensity = 5, className, style, disabled, ...rest },\n    forwardedRef,\n  ) => {\n    const ref = useRef<HTMLButtonElement>(null);\n    const thumbRef = useRef<HTMLSpanElement>(null);\n    const fillRef = useRef<HTMLSpanElement>(null);\n    const faceRef = useRef<HTMLSpanElement>(null);\n    useImperativeHandle(forwardedRef, () => ref.current!);\n\n    const [inner, setInner] = useState(defaultChecked);\n    const controlled = checkedProp !== undefined;\n    const checked = controlled ? checkedProp : inner;\n\n    const latest = useRef({ checked, set: (_: boolean) => {}, disabled });\n    latest.current = {\n      checked,\n      disabled,\n      set: (next: boolean) => {\n        if (!controlled) setInner(next);\n        onChange?.(next);\n      },\n    };\n    const sync = useRef<((value: boolean) => void) | null>(null);\n\n    // iOS: the lifted knob is a lens that thins the track beneath it. The\n    // track runs on through the lens, thinner inside and flaring back to full\n    // height at the rim where it meets the track outside. It's drawn from a\n    // live copy of the switch so it can show past its own edge. No colour\n    // split: over a flat track it only reads as a pink smear at the rim.\n    useRefraction(thumbRef, { kind: 'lens', zoom: 0.72, zoomX: 1, dispersion: 0, stretch: 1, copy: 'refract', strength: Math.max(1, Math.min(10, intensity)) / 5 }, true, ref, () =>\n      parseFloat(ref.current?.style.getPropertyValue('--lg-lift') || '0') > 0.01,\n    );\n\n    useEffect(() => {\n      const el = ref.current!;\n      const thumb = thumbRef.current!;\n      const fill = fillRef.current!;\n      // `glass` is how far the knob reads as a lens. It follows the lift up,\n      // but on the way down it only falls: the lift spring bounces past rest\n      // to wobble the knob's size, and letting the lens look ride that bounce\n      // flashed it back on before it snapped off.\n      const v = { x: checked ? 1 : 0, lift: 0, glass: 0, stretch: 0 };\n\n      const paint = () => {\n        const s = REST + (1 - REST) * v.lift;\n        const sx = s * (1 + v.stretch);\n        const sy = s * (1 - v.stretch * 0.5);\n        thumb.style.transform = `translate(${v.x * TRAVEL}px, -50%) scale(${sx}, ${sy})`;\n        const l = clamp(v.glass, 0, 1);\n        // Open a gap in the real track under the lifted lens; the lens shows\n        // the track shrunk inside it, so drawing it here too would double it.\n        el.style.setProperty('--lg-knob-x', `${(21 + v.x * TRAVEL).toFixed(2)}px`);\n        el.style.setProperty('--lg-hole', `${(l > 0.01 ? 23 * sx : 0).toFixed(2)}px`);\n        el.style.setProperty('--lg-lift', String(l));\n        el.toggleAttribute('data-lifted', l > 0.01);\n      };\n      // The knob stretches with its speed and jiggles round when it stops.\n      const jelly = createJelly((value) => {\n        v.stretch = value;\n        paint();\n      }, 0.14, 5);\n      const position = createSpring(v.x, SPRINGS.snap, (value, velocity) => {\n        v.x = value;\n        jelly.feed(velocity);\n        paint();\n      });\n      const lift = createSpring(0, SPRINGS.lift, (value) => {\n        v.lift = value;\n        v.glass = lift.target ? value : Math.min(v.glass, value);\n        paint();\n      });\n      const color = createSpring(checked ? 1 : 0, TINT, (value) => {\n        fill.style.opacity = String(clamp(value, 0, 1));\n      });\n      fill.style.opacity = checked ? '1' : '0';\n      paint();\n\n      sync.current = (value) => {\n        position.tune(SPRINGS.snap);\n        position.set(value ? 1 : 0);\n        color.set(value ? 1 : 0);\n      };\n\n      // The knob has to travel most of the way before the switch flips, so a\n      // drag that wanders past the middle doesn't toggle it by accident.\n      const flips = (from: number, raw: number) => (from ? raw > 0.3 : raw > 0.7);\n\n      let gesture: { id: number; x: number; from: number; moved: boolean; at: number } | null = null;\n      let dropTimer = 0;\n      let ignoreClick = false;\n\n      const drop = (delay: number) => {\n        clearTimeout(dropTimer);\n        dropTimer = window.setTimeout(() => {\n          lift.tune(SETTLE);\n          lift.set(0);\n        }, delay);\n      };\n\n      const down = (event: PointerEvent) => {\n        el.removeAttribute('data-keyboard');\n        if (!event.isPrimary || event.button !== 0 || latest.current.disabled) return;\n        clearTimeout(dropTimer);\n        gesture = { id: event.pointerId, x: event.clientX, from: latest.current.checked ? 1 : 0, moved: false, at: performance.now() };\n        try {\n          el.setPointerCapture(event.pointerId);\n        } catch {\n          /* noop */\n        }\n        lift.tune(SPRINGS.lift);\n        lift.set(1);\n        haptic();\n      };\n      const move = (event: PointerEvent) => {\n        if (event.pointerId !== gesture?.id) return;\n        const dx = event.clientX - gesture.x;\n        if (!gesture.moved && Math.abs(dx) < 3) return;\n        gesture.moved = true;\n        const raw = gesture.from + dx / TRAVEL;\n        const over = raw < 0 ? rubberband(raw * TRAVEL, TRAVEL, 0.6) / TRAVEL : raw > 1 ? 1 + rubberband((raw - 1) * TRAVEL, TRAVEL, 0.6) / TRAVEL : raw;\n        position.tune(SPRINGS.drag);\n        position.set(over);\n        const on = flips(gesture.from, raw);\n        if ((color.target === 1) !== on) haptic();\n        color.set(on ? 1 : 0);\n      };\n      const up = (event: PointerEvent) => {\n        if (event.pointerId !== gesture?.id) return;\n        const { from, x, moved, at } = gesture;\n        gesture = null;\n        ignoreClick = true;\n        const next = moved ? flips(from, from + (event.clientX - x) / TRAVEL) : !latest.current.checked;\n        position.tune(SPRINGS.snap);\n        position.set(next ? 1 : 0);\n        color.set(next ? 1 : 0);\n        if (next !== latest.current.checked) latest.current.set(next);\n        // A quick tap keeps the lens up long enough to be seen crossing.\n        drop(moved ? 0 : Math.max(0, 200 - (performance.now() - at)));\n      };\n      const cancel = (event: PointerEvent) => {\n        if (event.pointerId !== gesture?.id) return;\n        gesture = null;\n        sync.current?.(latest.current.checked);\n        drop(0);\n      };\n      const click = (event: MouseEvent) => {\n        if (ignoreClick) {\n          ignoreClick = false;\n          return;\n        }\n        if (latest.current.disabled) return;\n        // Keyboard / assistive activation\n        event.preventDefault();\n        const next = !latest.current.checked;\n        lift.set(1);\n        drop(220);\n        latest.current.set(next);\n        sync.current?.(next);\n      };\n\n      const unguard = guardSelection(el);\n      el.addEventListener('pointerdown', down);\n      el.addEventListener('pointermove', move);\n      el.addEventListener('pointerup', up);\n      el.addEventListener('pointercancel', cancel);\n      el.addEventListener('click', click);\n      return () => {\n        clearTimeout(dropTimer);\n        [position, lift, color, jelly].forEach((s) => s.stop());\n        unguard();\n        el.removeEventListener('pointerdown', down);\n        el.removeEventListener('pointermove', move);\n        el.removeEventListener('pointerup', up);\n        el.removeEventListener('pointercancel', cancel);\n        el.removeEventListener('click', click);\n      };\n      // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, []);\n\n    useEffect(() => {\n      sync.current?.(checked);\n    }, [checked]);\n\n    return (\n      <button\n        ref={ref}\n        type=\"button\"\n        role=\"switch\"\n        aria-checked={checked}\n        disabled={disabled}\n        className={['lg-switch', className].filter(Boolean).join(' ')}\n        data-liquid-glass=\"\"\n        style={tint ? ({ '--lg-switch-on': tint, ...style } as React.CSSProperties) : style}\n        {...rest}\n        onKeyDown={(event) => {\n          event.currentTarget.setAttribute('data-keyboard', '');\n          rest.onKeyDown?.(event);\n        }}\n      >\n        <span className=\"lg-switch__track\" aria-hidden=\"true\" />\n        <span ref={fillRef} className=\"lg-switch__fill\" aria-hidden=\"true\" />\n        <span ref={thumbRef} className=\"lg-glass lg-switch__thumb\" aria-hidden=\"true\">\n          <span ref={faceRef} className=\"lg-switch__face\" />\n        </span>\n      </button>\n    );\n  },\n);\n\nGlassSwitch.displayName = 'GlassSwitch';\n","import React, { createContext, useContext } from 'react';\n\nconst GlassFilterContext = createContext(false);\n\nexport function useGlassFilterMounted(): boolean {\n  return useContext(GlassFilterContext);\n}\n\nexport interface LiquidGlassFilterProps {\n  children?: React.ReactNode;\n}\n\n/**\n * @deprecated Left over from v0.1 and no longer used by any component: each\n * surface now builds its own refraction. Wrapping an app in it has no effect.\n * It will be removed in the next breaking release (0.4.0).\n */\nexport function LiquidGlassFilter({ children }: LiquidGlassFilterProps) {\n  return (\n    <GlassFilterContext.Provider value={true}>\n      <GlassFilterSVG />\n      {children}\n    </GlassFilterContext.Provider>\n  );\n}\n\nfunction GlassFilterSVG() {\n  return (\n    <svg\n      width=\"0\"\n      height=\"0\"\n      style={{ position: 'absolute', pointerEvents: 'none' }}\n      aria-hidden=\"true\"\n    >\n      <defs>\n        {/* Light refraction filter with increasing intensity */}\n        {Array.from({ length: 10 }, (_, i) => {\n          const level = i + 1;\n          const scale = level * 2;\n          const freq1 = 0.012 + level * 0.001;\n          const freq2 = 0.01 + level * 0.0008;\n          return (\n            <filter\n              key={level}\n              id={`liquid-glass-refract-${level}`}\n              x=\"-10%\"\n              y=\"-10%\"\n              width=\"120%\"\n              height=\"120%\"\n              colorInterpolationFilters=\"sRGB\"\n            >\n              <feTurbulence\n                type=\"fractalNoise\"\n                baseFrequency={`${freq1} ${freq2}`}\n                numOctaves={3}\n                seed={42}\n                result=\"noise\"\n              />\n              <feDisplacementMap\n                in=\"SourceGraphic\"\n                in2=\"noise\"\n                scale={scale}\n                xChannelSelector=\"R\"\n                yChannelSelector=\"G\"\n              />\n            </filter>\n          );\n        })}\n      </defs>\n    </svg>\n  );\n}\n","import { useMemo } from 'react';\n\nexport interface UseGlassEffectOptions {\n  intensity?: number;\n  tint?: string;\n  shimmer?: boolean;\n  thickness?: number;\n  blur?: number;\n}\n\ninterface GlassEffectResult {\n  style: React.CSSProperties;\n  filterId: string;\n}\n\nfunction parseTintColor(tint: string): { h: number; s: number; l: number; a: number } {\n  // Default values\n  const defaults = { h: 0, s: 0, l: 100, a: 0.1 };\n\n  if (!tint) return defaults;\n\n  // Handle rgba\n  const rgbaMatch = tint.match(/rgba?\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*(?:,\\s*([\\d.]+))?\\s*\\)/);\n  if (rgbaMatch) {\n    const r = parseInt(rgbaMatch[1]) / 255;\n    const g = parseInt(rgbaMatch[2]) / 255;\n    const b = parseInt(rgbaMatch[3]) / 255;\n    const a = rgbaMatch[4] ? parseFloat(rgbaMatch[4]) : 1;\n\n    const max = Math.max(r, g, b);\n    const min = Math.min(r, g, b);\n    const l = (max + min) / 2;\n\n    if (max === min) return { h: 0, s: 0, l: l * 100, a };\n\n    const d = max - min;\n    const s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n    let h = 0;\n    if (max === r) h = ((g - b) / d + (g < b ? 6 : 0)) / 6;\n    else if (max === g) h = ((b - r) / d + 2) / 6;\n    else h = ((r - g) / d + 4) / 6;\n\n    return { h: h * 360, s: s * 100, l: l * 100, a };\n  }\n\n  // Handle hex\n  const hexMatch = tint.match(/^#([\\da-f]{3,8})$/i);\n  if (hexMatch) {\n    let hex = hexMatch[1];\n    if (hex.length === 3) hex = hex.split('').map(c => c + c).join('');\n    const r = parseInt(hex.slice(0, 2), 16) / 255;\n    const g = parseInt(hex.slice(2, 4), 16) / 255;\n    const b = parseInt(hex.slice(4, 6), 16) / 255;\n    const a = hex.length === 8 ? parseInt(hex.slice(6, 8), 16) / 255 : 1;\n\n    const max = Math.max(r, g, b);\n    const min = Math.min(r, g, b);\n    const l = (max + min) / 2;\n\n    if (max === min) return { h: 0, s: 0, l: l * 100, a };\n\n    const d = max - min;\n    const s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n    let h = 0;\n    if (max === r) h = ((g - b) / d + (g < b ? 6 : 0)) / 6;\n    else if (max === g) h = ((b - r) / d + 2) / 6;\n    else h = ((r - g) / d + 4) / 6;\n\n    return { h: h * 360, s: s * 100, l: l * 100, a };\n  }\n\n  return defaults;\n}\n\nexport function useGlassEffect(options: UseGlassEffectOptions = {}): GlassEffectResult {\n  const {\n    intensity = 5,\n    tint,\n    shimmer = true,\n    thickness,\n    blur,\n  } = options;\n\n  return useMemo(() => {\n    const clampedIntensity = Math.max(1, Math.min(10, Math.round(intensity)));\n    const filterId = `liquid-glass-refract-${clampedIntensity}`;\n\n    const style: React.CSSProperties = {\n      '--glass-intensity': clampedIntensity,\n      '--glass-shimmer': shimmer ? 1 : 0,\n    } as React.CSSProperties;\n\n    if (tint) {\n      const parsed = parseTintColor(tint);\n      (style as Record<string, unknown>)['--glass-tint-h'] = parsed.h;\n      (style as Record<string, unknown>)['--glass-tint-s'] = `${parsed.s}%`;\n      (style as Record<string, unknown>)['--glass-tint-l'] = `${parsed.l}%`;\n      (style as Record<string, unknown>)['--glass-tint-a'] = parsed.a;\n    }\n\n    if (thickness !== undefined) {\n      (style as Record<string, unknown>)['--glass-border-width'] = `${thickness}px`;\n    }\n\n    if (blur !== undefined) {\n      (style as Record<string, unknown>)['--glass-blur'] = `${blur}px`;\n    }\n\n    return { style, filterId };\n  }, [intensity, tint, shimmer, thickness, blur]);\n}\n","import { useCallback, useState } from 'react';\n\nexport interface GlassAnimationState {\n  isHovered: boolean;\n  isPressed: boolean;\n  isFocused: boolean;\n  handlers: {\n    onPointerEnter: () => void;\n    onPointerLeave: () => void;\n    onPointerDown: () => void;\n    onPointerUp: () => void;\n    onFocus: () => void;\n    onBlur: () => void;\n  };\n}\n\nexport function useGlassAnimation(): GlassAnimationState {\n  const [isHovered, setIsHovered] = useState(false);\n  const [isPressed, setIsPressed] = useState(false);\n  const [isFocused, setIsFocused] = useState(false);\n\n  const handlers = {\n    onPointerEnter: useCallback(() => setIsHovered(true), []),\n    onPointerLeave: useCallback(() => {\n      setIsHovered(false);\n      setIsPressed(false);\n    }, []),\n    onPointerDown: useCallback(() => setIsPressed(true), []),\n    onPointerUp: useCallback(() => setIsPressed(false), []),\n    onFocus: useCallback(() => setIsFocused(true), []),\n    onBlur: useCallback(() => setIsFocused(false), []),\n  };\n\n  return { isHovered, isPressed, isFocused, handlers };\n}\n"],"mappings":";;;AAAA,OAAO,SAAS,qBAAqB,cAAc;;;ACKnD,SAAS,iBAAiB;;;AC+B1B,IAAM,SAAS,oBAAI,IAAW;AAC9B,IAAI,QAAQ;AACZ,IAAI,OAAO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3B,MAAC,MAAkC,sBAAsB,IAAI,GAAG,SAAS;AAAA,IAC3E;AAEA,QAAI,SAAS,QAAW;AACtB,MAAC,MAAkC,cAAc,IAAI,GAAG,IAAI;AAAA,IAC9D;AAEA,WAAO,EAAE,OAAO,SAAS;AAAA,EAC3B,GAAG,CAAC,WAAW,MAAM,SAAS,WAAW,IAAI,CAAC;AAChD;;;AC9GA,SAAS,aAAa,YAAAC,iBAAgB;AAgB/B,SAAS,oBAAyC;AACvD,QAAM,CAAC,WAAW,YAAY,IAAIA,UAAS,KAAK;AAChD,QAAM,CAAC,WAAW,YAAY,IAAIA,UAAS,KAAK;AAChD,QAAM,CAAC,WAAW,YAAY,IAAIA,UAAS,KAAK;AAEhD,QAAM,WAAW;AAAA,IACf,gBAAgB,YAAY,MAAM,aAAa,IAAI,GAAG,CAAC,CAAC;AAAA,IACxD,gBAAgB,YAAY,MAAM;AAChC,mBAAa,KAAK;AAClB,mBAAa,KAAK;AAAA,IACpB,GAAG,CAAC,CAAC;AAAA,IACL,eAAe,YAAY,MAAM,aAAa,IAAI,GAAG,CAAC,CAAC;AAAA,IACvD,aAAa,YAAY,MAAM,aAAa,KAAK,GAAG,CAAC,CAAC;AAAA,IACtD,SAAS,YAAY,MAAM,aAAa,IAAI,GAAG,CAAC,CAAC;AAAA,IACjD,QAAQ,YAAY,MAAM,aAAa,KAAK,GAAG,CAAC,CAAC;AAAA,EACnD;AAEA,SAAO,EAAE,WAAW,WAAW,WAAW,SAAS;AACrD;","names":["root","el","el","useEffect","root","el","active","frame","at","wake","last","frame","step","el","root","map","zoomMap","rim","mask","smooth","resolve","handle","useEffect","React","useImperativeHandle","useRef","jsx","React","useRef","useImperativeHandle","React","useImperativeHandle","useRef","jsx","jsx","jsxs","React","label","useRef","useImperativeHandle","useEffect","useRef","useState","jsx","jsxs","container","useState","useRef","useEffect","started","last","useEffect","useRef","useState","jsx","jsxs","OPEN","CLOSE","useState","useRef","useEffect","React","useRef","useEffect","useRef","FOLLOW","useRef","useEffect","label","swell","x","lift","pull","active","jsx","jsxs","useRef","jsx","jsxs","React","React","jsx","jsxs","React","React","useEffect","useImperativeHandle","useRef","jsx","jsxs","React","step","label","useRef","useImperativeHandle","useEffect","input","root","active","React","useEffect","useImperativeHandle","useRef","useState","jsx","jsxs","React","useRef","useImperativeHandle","useState","useEffect","el","jsx","jsxs","jsxs","jsx","useState"]}