var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: !0 });
}, __copyProps = (to, from, except, desc) => {
  if (from && typeof from == "object" || typeof from == "function")
    for (let key of __getOwnPropNames(from))
      !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
var render_exports = {};
__export(render_exports, {
  dateToHumanReadable: () => dateToHumanReadable,
  dateToHumanReadableDay: () => dateToHumanReadableDay,
  dateToHumanReadableRange: () => dateToHumanReadableRange,
  dateToHumanReadableTime: () => dateToHumanReadableTime,
  locationToAddress: () => locationToAddress,
  renderFileSize: () => renderFileSize,
  renderName: () => renderName,
  toCapitalCase: () => toCapitalCase,
  toSentenceCase: () => toSentenceCase
});
module.exports = __toCommonJS(render_exports);
var import_change_case = require("change-case"), import_date_fns = require("date-fns"), dateToHumanReadable = function(date) {
  return date ? (date = new Date(date), (0, import_date_fns.format)(date, "dd MMM yyyy HH:mm")) : "";
}, dateToHumanReadableDay = function(date) {
  return date ? (date = new Date(date), (0, import_date_fns.format)(date, "dd MMM yyyy")) : "";
}, dateToHumanReadableTime = function(date) {
  return date ? (date = new Date(date), (0, import_date_fns.format)(date, "HH:mm")) : "";
}, dateToHumanReadableRange = function(start, end, includeTime) {
  return includeTime ? `${dateToHumanReadable(start)} - ${dateToHumanReadable(end)}` : `${dateToHumanReadableDay(start)} - ${dateToHumanReadableDay(end)}`;
}, toCapitalCase = function(str) {
  return str ? (0, import_change_case.capitalCase)(str) : "";
}, toSentenceCase = function(str) {
  return str ? (0, import_change_case.sentenceCase)(str) : "";
}, renderName = function(param) {
  var { firstName, middleName, lastName } = param;
  if (!firstName && !middleName && !lastName) return "";
  var str = `${lastName}, ${firstName}`;
  return middleName && (str = `${str} ${middleName}`), str;
}, locationToAddress = function(location) {
  var _location_city, _location_stateOrRegion;
  return location ? `${location == null ? void 0 : location.streetAddressOne}, ${location == null ? void 0 : location.city}, ${(_location_city = location.city) === null || _location_city === void 0 ? void 0 : _location_city.toUpperCase()}, ${(_location_stateOrRegion = location.stateOrRegion) === null || _location_stateOrRegion === void 0 ? void 0 : _location_stateOrRegion.toUpperCase()}, ${location == null ? void 0 : location.postalCode}` : "";
}, renderFileSize = function(sizeInBytes) {
  if (sizeInBytes < 0)
    throw new Error("Size must be a non-negative integer.");
  var units = [
    "B",
    "KB",
    "MB",
    "GB",
    "TB",
    "PB",
    "EB",
    "ZB",
    "YB"
  ];
  if (sizeInBytes === 0)
    return "0 B";
  for (var i = 0, size = sizeInBytes; size >= 1024 && i < units.length - 1; )
    size /= 1024, i++;
  return `${size.toFixed(2)} ${units[i]}`;
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  dateToHumanReadable,
  dateToHumanReadableDay,
  dateToHumanReadableRange,
  dateToHumanReadableTime,
  locationToAddress,
  renderFileSize,
  renderName,
  toCapitalCase,
  toSentenceCase
});
//# sourceMappingURL=render.js.map
