/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
const n = "cube";
function u(e, t) {
  switch (e.type) {
    case "oid":
      return "key";
    case "small-integer":
    case "big-integer":
    case "integer":
    case "single":
    case "double":
    case "long":
      return "number";
    case "global-id":
    case "guid":
      return "key";
    case "string":
      if (t?.some((a) => a.name === e.name && a.type === "array")) {
        const a = t?.find((c) => c.name === e.name);
        return a && r(a) && r(a) ? s(a.elementType.type) : "double-float-set";
      }
      return "string";
    case "date":
      return "date-time";
    case "date-only":
      return "calendar";
    case "time-only":
      return "clock";
    case "timestamp-offset":
      return "time-zone";
    default:
      return "cube";
  }
}
function i(e) {
  switch (e.type) {
    case "number":
      return "number";
    case "text":
      return "string";
    case "array":
      return r(e) ? s(e.elementType.type) : n;
    case "date":
      return "date-time";
    case "dateOnly":
      return "calendar";
    case "time":
      return "clock";
    default:
      return n;
  }
}
function l(e) {
  switch (e.type) {
    case "small-integer":
    case "integer":
    case "big-integer":
    case "single":
    case "double":
    case "long":
    case "oid":
      return "number";
    case "global-id":
    case "guid":
    case "string":
      return "text";
    case "date":
      return "date";
    case "date-only":
      return "dateOnly";
    case "time-only":
      return "time";
    default:
      return "text";
  }
}
function o(e) {
  return (e ?? []).filter((t) => {
    switch (t.type) {
      case "string":
      case "small-integer":
      case "integer":
      case "big-integer":
      case "single":
      case "double":
      case "long":
      case "date":
      case "date-only":
      case "time-only":
      case "timestamp-offset":
      case "oid":
      case "guid":
      case "global-id":
        return !0;
      default:
        return !1;
    }
  });
}
function d(e) {
  return e.alias || e.name;
}
function r(e) {
  if (typeof e == "object" && e !== null && "elementType" in e) {
    const t = e.elementType;
    return typeof t == "object" && t !== null && "type" in t && typeof t.type == "string";
  }
  return !1;
}
function s(e) {
  switch (e) {
    case "text":
      return "string-set";
    case "number":
      return "double-float-set";
    default:
      return n;
  }
}
export {
  d as a,
  l as b,
  u as f,
  i as m,
  o as s
};
