import { RANGE_SEPARATOR as o } from "../constants/index.js";
import u from "../../date-picker/utils/formatDateInput.js";
import d from "../../../utils/parseDate.js";
function A(e, n, s) {
  var c, m;
  if (!e)
    return "";
  const i = e.split(o), l = ((c = i[0]) == null ? void 0 : c.trim()) || "", a = ((m = i[1]) == null ? void 0 : m.trim()) || "", t = l ? u(l, s) : "", r = a ? u(a, s) : "", f = t.length === n.length ? d(t, n) : null, p = r.length === n.length ? d(r, n) : null;
  return f && p && f > p ? `${r}${o}${t}` : t && r ? `${t}${o}${r}` : t || "";
}
export {
  A as default
};
//# sourceMappingURL=validateAndSwapDates.js.map
