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: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__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: true }), mod);

// src/modules/BookingContext/utils/flexible.ts
var flexible_exports = {};
__export(flexible_exports, {
  flexibleObj: () => flexibleObj,
  getDurationValue: () => getDurationValue,
  isProductFlexibleDuration: () => isProductFlexibleDuration
});
module.exports = __toCommonJS(flexible_exports);
var PREFIX = "flexible_";
var flexibleObj = {
  create(num) {
    return `${PREFIX}${num}`;
  },
  getValue(str) {
    if (typeof str === "string" && flexibleObj.isFlexible(str)) {
      return Number(str.replace(PREFIX, ""));
    }
    return Number(str);
  },
  isFlexible(str) {
    if (typeof str !== "string")
      return false;
    return str.indexOf(PREFIX) > -1;
  },
  add(current, duration) {
    if (flexibleObj.isFlexible(current)) {
      return flexibleObj.create(flexibleObj.getValue(current) + duration);
    }
    return Number(current) + duration;
  }
};
function isProductFlexibleDuration(duration) {
  return Boolean(
    duration && typeof duration === "object" && duration.type === "flexible"
  );
}
function getDurationValue(duration) {
  if (duration === void 0 || duration === null)
    return void 0;
  if (typeof duration === "number")
    return duration;
  if (typeof duration === "string") {
    if (flexibleObj.isFlexible(duration))
      return "flexible";
    return Number(duration);
  }
  if (typeof duration === "object") {
    if (duration.type === "minutes")
      return duration.value;
    if (duration.type === "flexible")
      return "flexible";
    if (duration.type === "days")
      return duration.value;
  }
  return void 0;
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  flexibleObj,
  getDurationValue,
  isProductFlexibleDuration
});
