import { __require as n } from "./index-utils10.js";
import { __require as _ } from "./index-transformData.js";
import { __require as R } from "./index-isCancel.js";
import { __require as v } from "./index-defaults.js";
import { __require as C } from "./index-CanceledError.js";
import { __require as c } from "./index-normalizeHeaderName.js";
var u, h;
function I() {
  if (h) return u;
  h = 1;
  var d = n(), t = _(), p = R(), i = v(), q = C(), l = c();
  function s(a) {
    if (a.cancelToken && a.cancelToken.throwIfRequested(), a.signal && a.signal.aborted)
      throw new q();
  }
  return u = function(e) {
    s(e), e.headers = e.headers || {}, e.data = t.call(
      e,
      e.data,
      e.headers,
      null,
      e.transformRequest
    ), l(e.headers, "Accept"), l(e.headers, "Content-Type"), e.headers = d.merge(
      e.headers.common || {},
      e.headers[e.method] || {},
      e.headers
    ), d.forEach(
      ["delete", "get", "head", "post", "put", "patch", "common"],
      function(r) {
        delete e.headers[r];
      }
    );
    var o = e.adapter || i.adapter;
    return o(e).then(function(r) {
      return s(e), r.data = t.call(
        e,
        r.data,
        r.headers,
        r.status,
        e.transformResponse
      ), r;
    }, function(r) {
      return p(r) || (s(e), r && r.response && (r.response.data = t.call(
        e,
        r.response.data,
        r.response.headers,
        r.response.status,
        e.transformResponse
      ))), Promise.reject(r);
    });
  }, u;
}
export {
  I as __require
};
