var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
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 __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/components/ticketBooking/sync.ts
var sync_exports = {};
__export(sync_exports, {
  formatSyncData: () => formatSyncData,
  mergeSyncData: () => mergeSyncData
});
module.exports = __toCommonJS(sync_exports);
var import_lodash = __toESM(require("lodash"));
var import_dayjs = __toESM(require("dayjs"));
var formatSyncData = (store) => {
  return JSON.stringify({
    modalState: {
      client: store.modalState.client,
      date: store.modalState.date,
      pet: store.modalState.pet,
      notes: store.modalState.notes,
      contacts_info: store.modalState.contacts_info,
      service: {
        value: store.modalState.service.value
      }
    }
  });
};
var mergeSyncData = (store, data) => {
  let _data = typeof data === "string" ? JSON.parse(data) : data;
  return {
    ...store,
    modalState: {
      ...store.modalState,
      client: _data.modalState.client,
      date: {
        ...store.modalState.date,
        value: (0, import_dayjs.default)(_data.modalState.date.value)
      },
      pet: _data.modalState.pet,
      notes: _data.modalState.notes,
      contacts_info: _data.modalState.contacts_info,
      service: {
        ...store.modalState.service,
        value: _data.modalState.service.value.map((item) => {
          return {
            ...item,
            _extend: {
              ...item._extend,
              start_date: (0, import_dayjs.default)(item._extend.start_date),
              startDate: (0, import_dayjs.default)(item._extend.startDate),
              endDate: (0, import_dayjs.default)(item._extend.endDate)
            }
          };
        })
      }
    }
  };
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  formatSyncData,
  mergeSyncData
});
