{"version":3,"file":"index.mjs","names":["isQuadraticPath2d","make","fromArray","append","length","QuadraticCurve2d.length","Interval.unit","solve","QuadraticCurve2d.solve","toPathData","isContinuous","asContinuous","isIncreasingX","QuadraticPolynomial.isIncreasing","isDecreasingX","QuadraticPolynomial.isDecreasing","isMonotonicX","isIncreasingY","isDecreasingY","isMonotonicY","asIncreasingX","asDecreasingX","asMonotonicX","asIncreasingY","asDecreasingY","asMonotonicY","solveAtX","Solution.one","QuadraticCurve2d.solveAtX","Solution.isNone","Solution.none","solveAtY","QuadraticCurve2d.solveAtY","boundingBox","QuadraticCurve2d.boundingBox","Interval2d.union","internal.make","internal.fromArray","internal.isQuadraticPath2d","internal.append","internal.length","internal.solve","internal.toPathData","internal.isContinuous","internal.asContinuous","internal.isIncreasingX","internal.isDecreasingX","internal.isMonotonicX","internal.isIncreasingY","internal.isDecreasingY","internal.isMonotonicY","internal.asIncreasingX","internal.asDecreasingX","internal.asMonotonicX","internal.asIncreasingY","internal.asDecreasingY","internal.asMonotonicY","internal.solveAtX","internal.solveAtY","internal.boundingBox"],"sources":["../../src/path/quadratic2d.internal.ts","../../src/path/quadratic2d.ts"],"sourcesContent":["import * as Interval2d from '../interval/interval2d.ts'\nimport * as QuadraticCurve2d from '../curve/quadratic2d.ts'\nimport * as Interval from '../interval/interval.ts'\nimport * as QuadraticPolynomial from '../polynomial/quadratic.ts'\nimport * as Solution from '../solution/solution.ts'\nimport { dual, Pipeable } from '../utils.ts'\nimport { invariant } from '../utils.ts'\nimport { EPSILON, epsEquals } from '../number.ts'\nimport type { Vector2 } from '../vector/vector2.ts'\nimport type { QuadraticPath2d } from './quadratic2d.ts'\nimport {\n  PathTraits,\n  type Continuous,\n  type DecreasingX,\n  type DecreasingY,\n  type IncreasingX,\n  type IncreasingY,\n  type MonotonicX,\n  type MonotonicY,\n} from './traits.ts'\n\nexport const QuadraticPath2dTypeId: unique symbol = Symbol('curvy/path/quadratic2d')\nexport type QuadraticPath2dTypeId = typeof QuadraticPath2dTypeId\n\n/** @internal */\nexport class QuadraticPath2dImpl extends Pipeable implements QuadraticPath2d<unknown> {\n  readonly [QuadraticPath2dTypeId]: QuadraticPath2dTypeId = QuadraticPath2dTypeId\n  declare readonly [PathTraits]: unknown\n\n  readonly curves: ReadonlyArray<QuadraticCurve2d.QuadraticCurve2d>\n\n  constructor(curves: ReadonlyArray<QuadraticCurve2d.QuadraticCurve2d>) {\n    super()\n    this.curves = curves\n  }\n\n  [Symbol.iterator](): Iterator<QuadraticCurve2d.QuadraticCurve2d> {\n    return this.curves[Symbol.iterator]()\n  }\n}\n\n/** @internal */\nexport const isQuadraticPath2d = (p: unknown): p is QuadraticPath2d =>\n  typeof p === 'object' && p !== null && QuadraticPath2dTypeId in p\n\n/** @internal */\nexport const make = (\n  ...curves: ReadonlyArray<QuadraticCurve2d.QuadraticCurve2d>\n): QuadraticPath2d => new QuadraticPath2dImpl(curves)\n\n/** @internal */\nexport const fromArray = (\n  curves: ReadonlyArray<QuadraticCurve2d.QuadraticCurve2d>,\n): QuadraticPath2d => new QuadraticPath2dImpl(curves)\n\n/** @internal */\nexport const append = dual<\n  (c: QuadraticCurve2d.QuadraticCurve2d) => (p: QuadraticPath2d) => QuadraticPath2d,\n  (p: QuadraticPath2d, c: QuadraticCurve2d.QuadraticCurve2d) => QuadraticPath2d\n>(2, (p: QuadraticPath2d, c: QuadraticCurve2d.QuadraticCurve2d) => fromArray([...p, c]))\n\n/** @internal */\nexport const length = (p: QuadraticPath2d) => {\n  let total = 0\n  for (const curve of p) {\n    total += QuadraticCurve2d.length(curve, Interval.unit)\n  }\n\n  return total\n}\n\n/** @internal */\nexport const solve = dual<\n  (u: number) => (p: QuadraticPath2d) => Vector2,\n  (p: QuadraticPath2d, u: number) => Vector2\n>(2, (p: QuadraticPath2d, u: number) => {\n  const curves = p instanceof QuadraticPath2dImpl ? p.curves : [...p]\n\n  if (u === 1) {\n    const last = curves.at(-1) as QuadraticCurve2d.QuadraticCurve2d\n    return QuadraticCurve2d.solve(last, 1)\n  }\n\n  const t = u * curves.length\n  const i = Math.floor(t)\n  const curve = curves[i] as QuadraticCurve2d.QuadraticCurve2d\n  return QuadraticCurve2d.solve(curve, t - i)\n})\n\n// Quadratic Bernstein basis: P(t) = (1-t)²·p0 + 2(1-t)t·p1 + t²·p2\n// expanded gives c0 = p0, c1 = -2p0 + 2p1, c2 = p0 - 2p1 + p2, so:\n//   p0 = c0, p1 = c0 + c1/2, p2 = c0 + c1 + c2.\n/** @internal */\nexport const toPathData = (p: QuadraticPath2d): string => {\n  let result = ''\n  let prevEndX = Number.NaN\n  let prevEndY = Number.NaN\n\n  for (const curve of p) {\n    const c0x = curve.x.c0\n    const c0y = curve.y.c0\n    const c1x = curve.x.c1\n    const c1y = curve.y.c1\n    const c2x = curve.x.c2\n    const c2y = curve.y.c2\n\n    const startX = c0x\n    const startY = c0y\n    const ctrlX = c0x + c1x / 2\n    const ctrlY = c0y + c1y / 2\n    const endX = c0x + c1x + c2x\n    const endY = c0y + c1y + c2y\n\n    if (!epsEquals(startX, prevEndX) || !epsEquals(startY, prevEndY)) {\n      result += ` M ${startX},${startY}`\n    }\n    result += ` Q ${ctrlX},${ctrlY} ${endX},${endY}`\n\n    prevEndX = endX\n    prevEndY = endY\n  }\n\n  return result.slice(1)\n}\n\n/** @internal */\nexport const isContinuous = <T>(p: QuadraticPath2d<T>): p is QuadraticPath2d<T & Continuous> => {\n  let prevEndX = Number.NaN\n  let prevEndY = Number.NaN\n  let first = true\n\n  for (const curve of p) {\n    const startX = curve.x.c0\n    const startY = curve.y.c0\n    if (!first && (!epsEquals(startX, prevEndX) || !epsEquals(startY, prevEndY))) {\n      return false\n    }\n    prevEndX = curve.x.c0 + curve.x.c1 + curve.x.c2\n    prevEndY = curve.y.c0 + curve.y.c1 + curve.y.c2\n    first = false\n  }\n  return true\n}\n\n/** @internal */\nexport const asContinuous = <T>(p: QuadraticPath2d<T>): QuadraticPath2d<T & Continuous> => {\n  invariant(isContinuous(p), 'quadratic path is not continuous')\n  return p\n}\n\n// Per-axis monotonicity for the path: every segment's axis polynomial must be\n// strictly monotonic over the unit interval AND adjacent segments' axis\n// ranges must not overlap (modulo EPSILON for float drift).\n/** @internal */\nexport const isIncreasingX = <T>(p: QuadraticPath2d<T>): p is QuadraticPath2d<T & IncreasingX> => {\n  let prevEnd = Number.NEGATIVE_INFINITY\n  for (const c of p) {\n    if (!QuadraticPolynomial.isIncreasing(c.x, Interval.unit)) {\n      return false\n    }\n    if (c.x.c0 < prevEnd - EPSILON) {\n      return false\n    }\n    prevEnd = c.x.c0 + c.x.c1 + c.x.c2\n  }\n  return true\n}\n\n/** @internal */\nexport const isDecreasingX = <T>(p: QuadraticPath2d<T>): p is QuadraticPath2d<T & DecreasingX> => {\n  let prevEnd = Number.POSITIVE_INFINITY\n  for (const c of p) {\n    if (!QuadraticPolynomial.isDecreasing(c.x, Interval.unit)) {\n      return false\n    }\n    if (c.x.c0 > prevEnd + EPSILON) {\n      return false\n    }\n    prevEnd = c.x.c0 + c.x.c1 + c.x.c2\n  }\n  return true\n}\n\n/** @internal */\nexport const isMonotonicX = <T>(p: QuadraticPath2d<T>): p is QuadraticPath2d<T & MonotonicX> =>\n  isIncreasingX(p) || isDecreasingX(p)\n\n/** @internal */\nexport const isIncreasingY = <T>(p: QuadraticPath2d<T>): p is QuadraticPath2d<T & IncreasingY> => {\n  let prevEnd = Number.NEGATIVE_INFINITY\n  for (const c of p) {\n    if (!QuadraticPolynomial.isIncreasing(c.y, Interval.unit)) {\n      return false\n    }\n    if (c.y.c0 < prevEnd - EPSILON) {\n      return false\n    }\n    prevEnd = c.y.c0 + c.y.c1 + c.y.c2\n  }\n  return true\n}\n\n/** @internal */\nexport const isDecreasingY = <T>(p: QuadraticPath2d<T>): p is QuadraticPath2d<T & DecreasingY> => {\n  let prevEnd = Number.POSITIVE_INFINITY\n  for (const c of p) {\n    if (!QuadraticPolynomial.isDecreasing(c.y, Interval.unit)) {\n      return false\n    }\n    if (c.y.c0 > prevEnd + EPSILON) {\n      return false\n    }\n    prevEnd = c.y.c0 + c.y.c1 + c.y.c2\n  }\n  return true\n}\n\n/** @internal */\nexport const isMonotonicY = <T>(p: QuadraticPath2d<T>): p is QuadraticPath2d<T & MonotonicY> =>\n  isIncreasingY(p) || isDecreasingY(p)\n\n/** @internal */\nexport const asIncreasingX = <T>(p: QuadraticPath2d<T>): QuadraticPath2d<T & IncreasingX> => {\n  invariant(isIncreasingX(p), 'quadratic path is not increasing in x')\n  return p\n}\n\n/** @internal */\nexport const asDecreasingX = <T>(p: QuadraticPath2d<T>): QuadraticPath2d<T & DecreasingX> => {\n  invariant(isDecreasingX(p), 'quadratic path is not decreasing in x')\n  return p\n}\n\n/** @internal */\nexport const asMonotonicX = <T>(p: QuadraticPath2d<T>): QuadraticPath2d<T & MonotonicX> => {\n  invariant(isMonotonicX(p), 'quadratic path is not monotonic in x')\n  return p\n}\n\n/** @internal */\nexport const asIncreasingY = <T>(p: QuadraticPath2d<T>): QuadraticPath2d<T & IncreasingY> => {\n  invariant(isIncreasingY(p), 'quadratic path is not increasing in y')\n  return p\n}\n\n/** @internal */\nexport const asDecreasingY = <T>(p: QuadraticPath2d<T>): QuadraticPath2d<T & DecreasingY> => {\n  invariant(isDecreasingY(p), 'quadratic path is not decreasing in y')\n  return p\n}\n\n/** @internal */\nexport const asMonotonicY = <T>(p: QuadraticPath2d<T>): QuadraticPath2d<T & MonotonicY> => {\n  invariant(isMonotonicY(p), 'quadratic path is not monotonic in y')\n  return p\n}\n\n// solveAtX/Y on a monotonic-axis path. Two defenses against float drift at\n// interior knots, where two adjacent segments both bracket the query and the\n// polynomial-inverse solver may return `none` for both:\n//   1. Snap to t=0/t=1 endpoint y when the query is within EPSILON of a\n//      segment's start or end — bypasses polynomial inversion at knots.\n//   2. Fall through to the next bracketing segment on `none`. `MonotonicX/Y`\n//      admits at most one real solution across the path, so retrying is safe.\n/** @internal */\nexport const solveAtX = dual(2, (p: QuadraticPath2d, x: number): Solution.AtMostOne<number> => {\n  for (const c of p) {\n    const sx = c.x.c0\n    const ex = c.x.c0 + c.x.c1 + c.x.c2\n    const lo = Math.min(sx, ex)\n    const hi = Math.max(sx, ex)\n    if (x >= lo - EPSILON && x <= hi + EPSILON) {\n      if (epsEquals(x, sx)) {\n        return Solution.one(c.y.c0)\n      }\n      if (epsEquals(x, ex)) {\n        return Solution.one(c.y.c0 + c.y.c1 + c.y.c2)\n      }\n      const sol = QuadraticCurve2d.solveAtX(c, x) as Solution.AtMostOne<number>\n      if (!Solution.isNone(sol)) {\n        return sol\n      }\n    }\n  }\n  return Solution.none\n})\n\n/** @internal */\nexport const solveAtY = dual(2, (p: QuadraticPath2d, y: number): Solution.AtMostOne<number> => {\n  for (const c of p) {\n    const sy = c.y.c0\n    const ey = c.y.c0 + c.y.c1 + c.y.c2\n    const lo = Math.min(sy, ey)\n    const hi = Math.max(sy, ey)\n    if (y >= lo - EPSILON && y <= hi + EPSILON) {\n      if (epsEquals(y, sy)) {\n        return Solution.one(c.x.c0)\n      }\n      if (epsEquals(y, ey)) {\n        return Solution.one(c.x.c0 + c.x.c1 + c.x.c2)\n      }\n      const sol = QuadraticCurve2d.solveAtY(c, y) as Solution.AtMostOne<number>\n      if (!Solution.isNone(sol)) {\n        return sol\n      }\n    }\n  }\n  return Solution.none\n})\n\n/** @internal */\nexport const boundingBox = (\n  p: QuadraticPath2d,\n): Interval2d.Interval2d<Interval.Closed, Interval.Closed> => {\n  const iter = p[Symbol.iterator]()\n  const first = iter.next()\n  let acc = QuadraticCurve2d.boundingBox(first.value as QuadraticCurve2d.QuadraticCurve2d)\n  for (let next = iter.next(); !next.done; next = iter.next()) {\n    acc = Interval2d.union(acc, QuadraticCurve2d.boundingBox(next.value))\n  }\n  return acc\n}\n","import type { Interval2d } from '../interval/interval2d.ts'\nimport type { QuadraticCurve2d } from '../curve/quadratic2d.ts'\nimport type { Closed } from '../interval/interval.ts'\nimport type * as Solution from '../solution/solution.ts'\nimport type { Pipeable } from '../utils.ts'\nimport type { Vector2 } from '../vector/vector2.ts'\nimport type { QuadraticPath2dTypeId } from './quadratic2d.internal.ts'\nimport * as internal from './quadratic2d.internal.ts'\nimport type {\n  Continuous,\n  DecreasingX,\n  DecreasingY,\n  IncreasingX,\n  IncreasingY,\n  MonotonicX,\n  MonotonicY,\n  PathTraits,\n} from './traits.ts'\n\nexport type {\n  Continuous,\n  DecreasingX,\n  DecreasingY,\n  IncreasingX,\n  IncreasingY,\n  MonotonicX,\n  MonotonicY,\n} from './traits.ts'\n\n/**\n * A quadratic path in 2D space.\n *\n * All fields are readonly and immutable, and all operations create new instances.\n *\n * The `Trait` type parameter accumulates trait brands as the path is refined\n * via `isContinuous` / `asContinuous`.\n *\n * @since 1.0.0\n */\nexport interface QuadraticPath2d<out Trait = unknown> extends Pipeable, Iterable<QuadraticCurve2d> {\n  readonly [QuadraticPath2dTypeId]: QuadraticPath2dTypeId\n  readonly [PathTraits]: Trait\n}\n\n/**\n * Creates a new `QuadraticPath2d` instance from a sequence of curves.\n *\n * @param curves - The curves to create the path from.\n * @returns A new `QuadraticPath2d` instance.\n * @since 2.0.0\n */\nexport const make: (...curves: ReadonlyArray<QuadraticCurve2d>) => QuadraticPath2d = internal.make\n\n/**\n * Creates a new `QuadraticPath2d` instance from an array of curves.\n *\n * @param curves - The curves to create the path from.\n * @returns A new `QuadraticPath2d` instance.\n * @since 2.0.0\n */\nexport const fromArray: (curves: ReadonlyArray<QuadraticCurve2d>) => QuadraticPath2d =\n  internal.fromArray\n\n/**\n * Checks if a value is a `QuadraticPath2d`.\n *\n * @param p - The value to check.\n * @returns `true` if the value is a `QuadraticPath2d`, `false` otherwise.\n * @since 1.0.0\n */\nexport const isQuadraticPath2d: (p: unknown) => p is QuadraticPath2d = internal.isQuadraticPath2d\n\nexport const append: {\n  /**\n   * Appends a quadratic curve to a quadratic path.\n   *\n   * @param c - The quadratic curve to append.\n   * @returns A function that takes a quadratic path and returns a new quadratic path.\n   * @since 1.0.0\n   */\n  (c: QuadraticCurve2d): (p: QuadraticPath2d) => QuadraticPath2d\n  /**\n   * Appends a quadratic curve to a quadratic path.\n   *\n   * @param p - The quadratic path to append to.\n   * @param c - The quadratic curve to append.\n   * @returns A new `QuadraticPath2d` instance with the appended curve.\n   * @since 1.0.0\n   */\n  (p: QuadraticPath2d, c: QuadraticCurve2d): QuadraticPath2d\n} = internal.append\n\n/**\n * Calculates the length of a quadratic path.\n *\n * @param p - The quadratic path to calculate the length of.\n * @returns The length of the path.\n */\nexport const length: (p: QuadraticPath2d) => number = internal.length\n\nexport const solve: {\n  /**\n   * Solves a quadratic path at a given parameter.\n   *\n   * @param u - The parameter to solve for.\n   * @returns A function that takes a quadratic path and returns the solved point.\n   * @since 1.0.0\n   */\n  (u: number): (p: QuadraticPath2d) => Vector2\n  /**\n   * Solves a quadratic path at a given parameter.\n   *\n   * @param p - The quadratic path to solve.\n   * @param u - The parameter to solve for.\n   * @returns The solved point.\n   * @since 1.0.0\n   */\n  (p: QuadraticPath2d, u: number): Vector2\n} = internal.solve\n\n/**\n * Serializes a quadratic path as an SVG path data string (the value of a\n * `<path>` element's `d` attribute), using `M` and `Q` commands. Discontinuities\n * between curves emit a fresh `M` command.\n *\n * @param p - The quadratic path to serialize.\n * @returns The SVG path data string.\n * @since 2.0.0\n */\nexport const toPathData: (p: QuadraticPath2d) => string = internal.toPathData\n\n/**\n * Type-narrowing predicate: refines `QuadraticPath2d<T>` to\n * `QuadraticPath2d<T & Continuous>` when adjacent curves connect.\n *\n * @since 2.0.0\n */\nexport const isContinuous: <T>(p: QuadraticPath2d<T>) => p is QuadraticPath2d<T & Continuous> =\n  internal.isContinuous\n\n/**\n * Asserts that the quadratic path is continuous, throwing on failure.\n *\n * @since 2.0.0\n */\nexport const asContinuous: <T>(p: QuadraticPath2d<T>) => QuadraticPath2d<T & Continuous> =\n  internal.asContinuous\n\n/**\n * Type-narrowing predicate: refines `QuadraticPath2d<T>` to\n * `QuadraticPath2d<T & IncreasingX>` when every segment's x-polynomial is\n * strictly increasing on `[0, 1]` and adjacent segments' x-ranges don't\n * overlap.\n *\n * @since 2.0.0\n */\nexport const isIncreasingX: <T>(p: QuadraticPath2d<T>) => p is QuadraticPath2d<T & IncreasingX> =\n  internal.isIncreasingX\n\n/**\n * Type-narrowing predicate: refines `QuadraticPath2d<T>` to\n * `QuadraticPath2d<T & DecreasingX>`.\n *\n * @since 2.0.0\n */\nexport const isDecreasingX: <T>(p: QuadraticPath2d<T>) => p is QuadraticPath2d<T & DecreasingX> =\n  internal.isDecreasingX\n\n/**\n * Type-narrowing predicate: refines `QuadraticPath2d<T>` to\n * `QuadraticPath2d<T & MonotonicX>`.\n *\n * @since 2.0.0\n */\nexport const isMonotonicX: <T>(p: QuadraticPath2d<T>) => p is QuadraticPath2d<T & MonotonicX> =\n  internal.isMonotonicX\n\n/**\n * Type-narrowing predicate: refines `QuadraticPath2d<T>` to\n * `QuadraticPath2d<T & IncreasingY>`.\n *\n * @since 2.0.0\n */\nexport const isIncreasingY: <T>(p: QuadraticPath2d<T>) => p is QuadraticPath2d<T & IncreasingY> =\n  internal.isIncreasingY\n\n/**\n * Type-narrowing predicate: refines `QuadraticPath2d<T>` to\n * `QuadraticPath2d<T & DecreasingY>`.\n *\n * @since 2.0.0\n */\nexport const isDecreasingY: <T>(p: QuadraticPath2d<T>) => p is QuadraticPath2d<T & DecreasingY> =\n  internal.isDecreasingY\n\n/**\n * Type-narrowing predicate: refines `QuadraticPath2d<T>` to\n * `QuadraticPath2d<T & MonotonicY>`.\n *\n * @since 2.0.0\n */\nexport const isMonotonicY: <T>(p: QuadraticPath2d<T>) => p is QuadraticPath2d<T & MonotonicY> =\n  internal.isMonotonicY\n\n/**\n * Asserts that the path is strictly increasing in x, throwing on failure.\n *\n * @since 2.0.0\n */\nexport const asIncreasingX: <T>(p: QuadraticPath2d<T>) => QuadraticPath2d<T & IncreasingX> =\n  internal.asIncreasingX\n\n/**\n * Asserts that the path is strictly decreasing in x, throwing on failure.\n *\n * @since 2.0.0\n */\nexport const asDecreasingX: <T>(p: QuadraticPath2d<T>) => QuadraticPath2d<T & DecreasingX> =\n  internal.asDecreasingX\n\n/**\n * Asserts that the path is monotonic in x, throwing on failure.\n *\n * @since 2.0.0\n */\nexport const asMonotonicX: <T>(p: QuadraticPath2d<T>) => QuadraticPath2d<T & MonotonicX> =\n  internal.asMonotonicX\n\n/**\n * Asserts that the path is strictly increasing in y, throwing on failure.\n *\n * @since 2.0.0\n */\nexport const asIncreasingY: <T>(p: QuadraticPath2d<T>) => QuadraticPath2d<T & IncreasingY> =\n  internal.asIncreasingY\n\n/**\n * Asserts that the path is strictly decreasing in y, throwing on failure.\n *\n * @since 2.0.0\n */\nexport const asDecreasingY: <T>(p: QuadraticPath2d<T>) => QuadraticPath2d<T & DecreasingY> =\n  internal.asDecreasingY\n\n/**\n * Asserts that the path is monotonic in y, throwing on failure.\n *\n * @since 2.0.0\n */\nexport const asMonotonicY: <T>(p: QuadraticPath2d<T>) => QuadraticPath2d<T & MonotonicY> =\n  internal.asMonotonicY\n\nexport const solveAtX: {\n  /**\n   * Evaluates the path's y value at a given x. Requires the path to carry\n   * the `MonotonicX` brand. Returns `Solution.none` when x is outside the\n   * path's x-range.\n   *\n   * @param p - A path branded `MonotonicX`.\n   * @param x - The x coordinate.\n   * @returns The y value at x, or `none` when x is outside the path's range.\n   * @since 2.0.0\n   */\n  <T extends MonotonicX>(p: QuadraticPath2d<T>, x: number): Solution.AtMostOne<number>\n  /** @since 2.0.0 */\n  (x: number): <T extends MonotonicX>(p: QuadraticPath2d<T>) => Solution.AtMostOne<number>\n} = internal.solveAtX as never\n\nexport const solveAtY: {\n  /**\n   * Evaluates the path's x value at a given y. Requires the path to carry\n   * the `MonotonicY` brand. Returns `Solution.none` when y is outside the\n   * path's y-range.\n   *\n   * @param p - A path branded `MonotonicY`.\n   * @param y - The y coordinate.\n   * @returns The x value at y, or `none` when y is outside the path's range.\n   * @since 2.0.0\n   */\n  <T extends MonotonicY>(p: QuadraticPath2d<T>, y: number): Solution.AtMostOne<number>\n  /** @since 2.0.0 */\n  (y: number): <T extends MonotonicY>(p: QuadraticPath2d<T>) => Solution.AtMostOne<number>\n} = internal.solveAtY as never\n\n/**\n * Computes the axis-aligned bounding box of the path — the smallest closed\n * `Box2d` enclosing every segment.\n *\n * @param p - The quadratic path.\n * @returns A closed `Box2d` enclosing the path.\n * @since 2.0.0\n */\nexport const boundingBox: (p: QuadraticPath2d) => Interval2d<Closed, Closed> = internal.boundingBox\n"],"mappings":";;;;;;;;;;AAqBA,MAAa,wBAAuC,OAAO,yBAAyB;;AAIpF,IAAa,sBAAb,cAAyC,SAA6C;CACpF,CAAU,yBAAgD;CAG1D;CAEA,YAAY,QAA0D;EACpE,OAAO;EACP,KAAK,SAAS;;CAGhB,CAAC,OAAO,YAAyD;EAC/D,OAAO,KAAK,OAAO,OAAO,WAAW;;;;AAKzC,MAAaA,uBAAqB,MAChC,OAAO,MAAM,YAAY,MAAM,QAAQ,yBAAyB;;AAGlE,MAAaC,UACX,GAAG,WACiB,IAAI,oBAAoB,OAAO;;AAGrD,MAAaC,eACX,WACoB,IAAI,oBAAoB,OAAO;;AAGrD,MAAaC,WAAS,KAGpB,IAAI,GAAoB,MAAyCD,YAAU,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC;;AAGxF,MAAaE,YAAU,MAAuB;CAC5C,IAAI,QAAQ;CACZ,KAAK,MAAM,SAAS,GAClB,SAASC,SAAwB,OAAOC,KAAc;CAGxD,OAAO;;;AAIT,MAAaC,UAAQ,KAGnB,IAAI,GAAoB,MAAc;CACtC,MAAM,SAAS,aAAa,sBAAsB,EAAE,SAAS,CAAC,GAAG,EAAE;CAEnE,IAAI,MAAM,GAER,OAAOC,QADM,OAAO,GAAG,GACO,EAAM,EAAE;CAGxC,MAAM,IAAI,IAAI,OAAO;CACrB,MAAM,IAAI,KAAK,MAAM,EAAE;CACvB,MAAM,QAAQ,OAAO;CACrB,OAAOA,QAAuB,OAAO,IAAI,EAAE;EAC3C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