import { getDefaultExportFromCjs as l } from "../../_virtual/_commonjsHelpers.mjs";
import { b as j } from "./node_modules/debug/src/browser.mjs";
var u = j("jsonp"), w = E, g = 0;
function x() {
}
function E(n, e, o) {
  typeof e == "function" && (o = e, e = {}), e || (e = {});
  var p = e.prefix || "__jp", t = e.name || p + g++, d = e.param || "callback", c = e.timeout != null ? e.timeout : 6e4, v = encodeURIComponent, m = document.getElementsByTagName("script")[0] || document.head, r, i;
  c && (i = setTimeout(function() {
    a(), o && o(new Error("Timeout"));
  }, c));
  function a() {
    r.parentNode && r.parentNode.removeChild(r), window[t] = x, i && clearTimeout(i);
  }
  function s() {
    window[t] && a();
  }
  return window[t] = function(f) {
    u("jsonp got", f), a(), o && o(null, f);
  }, n += (~n.indexOf("?") ? "&" : "?") + d + "=" + v(t), n = n.replace("?&", "?"), u('jsonp req "%s"', n), r = document.createElement("script"), r.src = n, m.parentNode.insertBefore(r, m), s;
}
const T = /* @__PURE__ */ l(w);
export {
  T as default
};
