import { S as isObject_default } from "./_baseFor-BGiY-cm1.js";
import { n as toNumber_default, t as now_default } from "./now-Sgq5m3D-.js";
var FUNC_ERROR_TEXT = "Expected a function", nativeMax = Math.max, nativeMin = Math.min;
function debounce(o, s, c) {
  var l, u, d, f, p, m, h = 0, g = false, _ = false, v = true;
  if (typeof o != "function") throw TypeError(FUNC_ERROR_TEXT);
  s = toNumber_default(s) || 0, isObject_default(c) && (g = !!c.leading, _ = "maxWait" in c, d = _ ? nativeMax(toNumber_default(c.maxWait) || 0, s) : d, v = "trailing" in c ? !!c.trailing : v);
  function y(e) {
    var r = l, i = u;
    return l = u = void 0, h = e, f = o.apply(i, r), f;
  }
  function b(e) {
    return h = e, p = setTimeout(C, s), g ? y(e) : f;
  }
  function x(e) {
    var r = e - m, i = e - h, a = s - r;
    return _ ? nativeMin(a, d - i) : a;
  }
  function S(e) {
    var r = e - m, i = e - h;
    return m === void 0 || r >= s || r < 0 || _ && i >= d;
  }
  function C() {
    var e = now_default();
    if (S(e)) return w(e);
    p = setTimeout(C, x(e));
  }
  function w(e) {
    return p = void 0, v && l ? y(e) : (l = u = void 0, f);
  }
  function T() {
    p !== void 0 && clearTimeout(p), h = 0, l = m = u = p = void 0;
  }
  function E() {
    return p === void 0 ? f : w(now_default());
  }
  function D() {
    var e = now_default(), r = S(e);
    if (l = arguments, u = this, m = e, r) {
      if (p === void 0) return b(m);
      if (_) return clearTimeout(p), p = setTimeout(C, s), y(m);
    }
    return p === void 0 && (p = setTimeout(C, s)), f;
  }
  return D.cancel = T, D.flush = E, D;
}
var debounce_default = debounce;
const Constants = {
  githubPage: "https://github.com/marimo-team/marimo",
  releasesPage: "https://github.com/marimo-team/marimo/releases",
  issuesPage: "https://github.com/marimo-team/marimo/issues",
  feedbackForm: "https://marimo.io/feedback",
  discordLink: "https://marimo.io/discord?ref=notebook",
  docsPage: "https://docs.marimo.io",
  youtube: "https://www.youtube.com/@marimo-team",
  molab: "https://molab.marimo.io"
}, KnownQueryParams = {
  showCode: "show-code",
  includeCode: "include-code",
  sessionId: "session_id",
  kiosk: "kiosk",
  vscode: "vscode",
  filePath: "file",
  accessToken: "access_token",
  viewAs: "view-as",
  showChrome: "show-chrome"
}, CSSClasses = { outputArea: "output-area" };
export {
  debounce_default as i,
  Constants as n,
  KnownQueryParams as r,
  CSSClasses as t
};
