"use client";
import { linearish as f } from "./linear.js";
import { initRange as m } from "./init.js";
import { bisectRight as s } from "../../d3-array/src/bisect.js";
function g() {
  var i = 0, u = 1, t = 1, e = [0.5], a = [0, 1], c;
  function r(n) {
    return n != null && n <= n ? a[s(e, n, 0, t)] : c;
  }
  function l() {
    var n = -1;
    for (e = new Array(t); ++n < t; ) e[n] = ((n + 1) * u - (n - t) * i) / (t + 1);
    return r;
  }
  return r.domain = function(n) {
    return arguments.length ? ([i, u] = n, i = +i, u = +u, l()) : [i, u];
  }, r.range = function(n) {
    return arguments.length ? (t = (a = Array.from(n)).length - 1, l()) : a.slice();
  }, r.invertExtent = function(n) {
    var o = a.indexOf(n);
    return o < 0 ? [NaN, NaN] : o < 1 ? [i, e[0]] : o >= t ? [e[t - 1], u] : [e[o - 1], e[o]];
  }, r.unknown = function(n) {
    return arguments.length && (c = n), r;
  }, r.thresholds = function() {
    return e.slice();
  }, r.copy = function() {
    return g().domain([i, u]).range(a).unknown(c);
  }, m.apply(f(r), arguments);
}
export {
  g as default
};
