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/booking/info/clientVariant/vertical/index.tsx
var vertical_exports = {};
__export(vertical_exports, {
  default: () => vertical_default
});
module.exports = __toCommonJS(vertical_exports);
var import_PlusCircle = __toESM(require("@pisell/icon/es/PlusCircle"));
var import_User01 = __toESM(require("@pisell/icon/es/User01"));
var import_utils = require("@pisell/utils");
var import_ahooks = require("ahooks");
var import_antd = require("antd");
var import_classnames = __toESM(require("classnames"));
var import_react = __toESM(require("react"));
var import_pet = __toESM(require("../../pet"));
var import_useClientFn = __toESM(require("../hooks/useClientFn"));
var import_SelectDrawer = __toESM(require("./SelectDrawer"));
var import_useEngineContext = __toESM(require("../../../../../hooks/useEngineContext"));
var import_format = require("../../../forms/format");
var import_utils2 = require("../../../utils");
var import_model = require("../../model");
var import_ChangePetModal = __toESM(require("../../pet/ChangePetModal"));
var import_utils3 = require("../../service2/utils");
var import_utils4 = require("../../utils");
var import_index = require("./index.less");
var import_useAddHolder = __toESM(require("../../hooks/useAddHolder"));
var import_utils5 = require("../utils");
var import_useGetHolderList = __toESM(require("../../hooks/useGetHolderList"));
var VerticalClient = (0, import_react.forwardRef)((props, ref) => {
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O;
  const { globalState, setGlobalState } = props;
  const modalRef = (0, import_react.useRef)();
  const state = globalState;
  const stateRef = (0, import_react.useRef)(state);
  const prevCustomerId = (0, import_react.useRef)(null);
  const changePetRef = (0, import_react.useRef)(null);
  const context = (0, import_useEngineContext.default)();
  const [isHasFormRecord, setIsHasFormRecord] = (0, import_react.useState)(true);
  const isFranchisee = (_d = (_c = (_b = (_a = context == null ? void 0 : context.appHelper) == null ? void 0 : _a.utils) == null ? void 0 : _b.businessUtils) == null ? void 0 : _c.getAppByModal) == null ? void 0 : _d.call(_c, "franchisee");
  import_utils2.request.setRequest(context.appHelper.utils.request);
  state.isFranchisee = isFranchisee;
  stateRef.current = state;
  const {
    isWalkIn,
    setClient,
    handleSelectClient,
    menuChange,
    handleViewClient,
    menus,
    handleCreateItem,
    getClients,
    params,
    searchChange,
    loading,
    loadMore,
    handleOpenClientModal,
    getNickname,
    franchiseeLoading
  } = (0, import_useClientFn.default)({
    state,
    setGlobalState,
    modalRef,
    onRemoveClient: () => {
      setTimeout(() => {
        handleSelectPet({
          [boardConfig.form_id]: []
        });
      });
    }
  });
  console.log("state.modalOpen", state.modalOpen);
  const renderList = (0, import_react.useMemo)(() => {
    let _list = [...state.client.clients];
    return (0, import_utils4.moveItemToFront)(_list, state.client.value.id);
  }, [state.client.clients, state.client.value.id]);
  const handleClose = () => {
    setTimeout(() => {
      setClient({
        showModal: false
      });
    });
  };
  const petDispatch = ({ type, payload }) => {
    if (type === "setPet") {
      setGlobalState({
        pet: {
          ...stateRef.current.pet,
          ...payload
        }
      });
    }
    if (type === "setService") {
      setGlobalState({
        service: {
          ...stateRef.current.service,
          ...payload
        }
      });
    }
  };
  const getHolderList = (0, import_useGetHolderList.default)(state, petDispatch);
  const { waiverForm } = (0, import_useAddHolder.default)(state, petDispatch);
  const { isMinorAndWaiver } = (0, import_useAddHolder.useFormDataConfig)(state);
  const boardConfig = (0, import_react.useMemo)(() => {
    var _a2, _b2, _c2;
    return ((_c2 = (_b2 = (_a2 = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a2.config) == null ? void 0 : _b2.basic) == null ? void 0 : _c2.appointment_subject) || {};
  }, [(_f = (_e = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _e.config) == null ? void 0 : _f.basic]);
  (0, import_react.useEffect)(() => {
    var _a2, _b2, _c2, _d2;
    if (((_d2 = (_c2 = (_b2 = (_a2 = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a2.config) == null ? void 0 : _b2.basic) == null ? void 0 : _c2.appointment_customer) == null ? void 0 : _d2.type) === "customer" && (state == null ? void 0 : state.modalOpen) && !(state == null ? void 0 : state.bookingId)) {
      handleOpenClientModal();
    } else {
      modalRef.current.close();
      setClient({
        showModal: false
      });
    }
  }, [
    (_j = (_i = (_h = (_g = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _g.config) == null ? void 0 : _h.basic) == null ? void 0 : _i.appointment_customer) == null ? void 0 : _j.type,
    state == null ? void 0 : state.modalOpen
  ]);
  const handleSelectPet = (val) => {
    var _a2, _b2;
    if ((0, import_utils3.isDayBooking)(state)) {
      const { ids, lists } = (0, import_utils3.isOpenDeletePet)(state, val);
      if ((ids == null ? void 0 : ids.length) > 0 && (lists == null ? void 0 : lists.length) > 0) {
        (_b2 = changePetRef.current) == null ? void 0 : _b2.open({
          ids,
          setGlobalState,
          service: ((_a2 = state.service) == null ? void 0 : _a2.value) || [],
          state
        });
      }
    }
    setGlobalState({
      pet: {
        ...state.pet,
        edit: true,
        value: val
      }
    });
  };
  const handleOpenModal = (0, import_ahooks.useMemoizedFn)(() => {
    handleOpenClientModal();
  });
  const handleAddPet = (_client, cb) => {
    var _a2, _b2, _c2;
    let _data = {
      formDataConfig: isMinorAndWaiver ? {
        ...waiverForm,
        customer_id: _client.id,
        is_franchisor: (_b2 = (_a2 = state.pet.formData) == null ? void 0 : _a2[0]) == null ? void 0 : _b2.is_franchisor
      } : { ...((_c2 = state.pet.formData) == null ? void 0 : _c2[0]) || {} }
    };
    _data.customerId = _client.id;
    state.action({
      type: "pisell1.goCustomFormAddData",
      data: _data,
      callback: (res) => {
        if (isMinorAndWaiver) {
          getClients(params);
          getHolderList();
          return;
        }
        const newFormRecordObj = res.reduce((p, c) => {
          return {
            ...p,
            [c.key]: c.value
          };
        }, {});
        const newClients = stateRef.current.client.clients.map((item) => {
          if (item.id === _client.id) {
            return {
              ...item,
              form_record: [
                ...item.form_record,
                {
                  ...newFormRecordObj,
                  id: newFormRecordObj.form_record_id,
                  data: newFormRecordObj
                }
              ]
            };
          }
          return item;
        });
        setClient({
          clients: newClients
        });
        cb == null ? void 0 : cb(newFormRecordObj);
      }
    });
  };
  const previewItemTitleRender = (0, import_ahooks.useMemoizedFn)(
    (value, index, values) => {
      var _a2, _b2, _c2, _d2, _e2, _f2;
      const title = getNickname(value.customer) || ((_a2 = value == null ? void 0 : value.customer) == null ? void 0 : _a2.email) || ((_b2 = value == null ? void 0 : value.customer) == null ? void 0 : _b2.phone) || "";
      if (((_c2 = value == null ? void 0 : value.customer) == null ? void 0 : _c2.id) === prevCustomerId.current) {
        if (values.length === index + 1) {
          prevCustomerId.current = null;
        }
        return null;
      }
      prevCustomerId.current = (_d2 = value == null ? void 0 : value.customer) == null ? void 0 : _d2.id;
      if (values.length === index + 1) {
        prevCustomerId.current = null;
      }
      return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-pet-title" }, title, " ' ", ((_f2 = (_e2 = state.pet.formData) == null ? void 0 : _e2[0]) == null ? void 0 : _f2.title) || "");
    }
  );
  const isShowAddBtn = (0, import_react.useMemo)(() => {
    var _a2, _b2, _c2, _d2, _e2, _f2;
    const formId2 = (_c2 = (_b2 = (_a2 = state.pet) == null ? void 0 : _a2.formData) == null ? void 0 : _b2[0]) == null ? void 0 : _c2.form_id;
    if ((!isWalkIn || ((_f2 = (_e2 = (_d2 = state.pet) == null ? void 0 : _d2.value) == null ? void 0 : _e2[formId2]) == null ? void 0 : _f2.length)) && !(state == null ? void 0 : state.disabledEdit) && boardConfig.type === "form") {
      return true;
    }
    return false;
  }, [
    isWalkIn,
    state == null ? void 0 : state.disabledEdit,
    (_k = state.pet) == null ? void 0 : _k.value,
    (_l = state.pet) == null ? void 0 : _l.formData,
    boardConfig.type
  ]);
  const formId = (0, import_react.useMemo)(() => {
    var _a2, _b2, _c2;
    return (_c2 = (_b2 = (_a2 = state.pet) == null ? void 0 : _a2.formData) == null ? void 0 : _b2[0]) == null ? void 0 : _c2.form_id;
  }, [(_o = (_n = (_m = state.pet) == null ? void 0 : _m.formData) == null ? void 0 : _n[0]) == null ? void 0 : _o.form_id]);
  const currentPetValue = (0, import_react.useMemo)(() => {
    var _a2, _b2;
    return (_b2 = (_a2 = state.pet) == null ? void 0 : _a2.value) == null ? void 0 : _b2[formId];
  }, [(_p = state.pet) == null ? void 0 : _p.value, formId]);
  const getCurrentClientSearchValue = (0, import_react.useCallback)(() => {
    var _a2, _b2;
    let searchVal = getNickname(state.client.value) || ((_a2 = state.client.value) == null ? void 0 : _a2.email) || ((_b2 = state.client.value) == null ? void 0 : _b2.phone) || "";
    if (isWalkIn) {
      searchVal = "";
    }
    return searchVal;
  }, [state.client.value, isWalkIn]);
  (0, import_react.useEffect)(() => {
    if (!isWalkIn && formId && !(currentPetValue == null ? void 0 : currentPetValue.length) && boardConfig.type === "form") {
      const getData = async () => {
        var _a2, _b2, _c2, _d2, _e2, _f2;
        const findCurrentClient = (list) => {
          return list.find((item) => {
            var _a3, _b3;
            return item.id === ((_b3 = (_a3 = state.client) == null ? void 0 : _a3.value) == null ? void 0 : _b3.id);
          });
        };
        const clients = (_b2 = (_a2 = stateRef.current) == null ? void 0 : _a2.client) == null ? void 0 : _b2.clients;
        const currentClient = findCurrentClient(clients);
        if (currentClient) {
          setIsHasFormRecord(!!((_c2 = currentClient == null ? void 0 : currentClient.form_record) == null ? void 0 : _c2.length));
        } else {
          const val = await getClients(
            {
              with: ["formRecord", "contactsInfo"],
              relation_form_id: boardConfig == null ? void 0 : boardConfig.form_id,
              skip: 1,
              num: 20,
              customer_ids: [(_e2 = (_d2 = state.client) == null ? void 0 : _d2.value) == null ? void 0 : _e2.id]
            },
            true
          );
          const currentClient2 = findCurrentClient(val);
          setIsHasFormRecord(!!((_f2 = currentClient2 == null ? void 0 : currentClient2.form_record) == null ? void 0 : _f2.length));
        }
      };
      getData();
    }
  }, [isWalkIn, formId, (_q = state.client.value) == null ? void 0 : _q.id, currentPetValue, boardConfig]);
  const petRender = (0, import_react.useMemo)(() => {
    var _a2, _b2, _c2;
    if (((state == null ? void 0 : state.disabledEdit) || boardConfig.type !== "form") && !(0, import_utils3.isDayBooking)(state)) {
      return null;
    }
    return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, !(currentPetValue == null ? void 0 : currentPetValue.length) && !isHasFormRecord && !isWalkIn && /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
      import_antd.Empty,
      {
        style: { marginBottom: 0 },
        image: import_antd.Empty.PRESENTED_IMAGE_SIMPLE,
        description: import_utils.locales.getText(
          "pisell2.text.variant-client-no-data"
        )
      }
    ), /* @__PURE__ */ import_react.default.createElement(
      "div",
      {
        className: "pisell-lowcode__create-form-wrap",
        onClick: () => {
          var _a3;
          handleAddPet == null ? void 0 : handleAddPet((_a3 = state == null ? void 0 : state.client) == null ? void 0 : _a3.value, (addRecord = {}) => {
            setTimeout(() => {
              var _a4, _b3, _c3, _d2, _e2;
              handleSelectPet({
                [formId]: (0, import_format.formatAddFormValues)({
                  clientId: (_b3 = (_a4 = state == null ? void 0 : state.client) == null ? void 0 : _a4.value) == null ? void 0 : _b3.id,
                  value: [
                    { ...addRecord, customer: (_c3 = state == null ? void 0 : state.client) == null ? void 0 : _c3.value }
                  ],
                  data_range: (_e2 = (_d2 = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _d2.holder) == null ? void 0 : _e2.data_range
                })
              });
            }, 200);
          });
        }
      },
      /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(import_PlusCircle.default, { className: "pisell-lowcode__create-form-icon" }), /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-lowcode__create-form-txt" }, `${import_utils.locales.getText("pisell2.text.create-new")} ${((_c2 = (_b2 = (_a2 = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a2.holder) == null ? void 0 : _b2.form) == null ? void 0 : _c2.title) || "-"}`))
    )), /* @__PURE__ */ import_react.default.createElement(
      import_pet.default,
      {
        clientChangeNotSetPet: true,
        state,
        dispatch: petDispatch,
        hideTitle: true,
        handleOpenModal,
        addButtonProps: {
          onClick: handleOpenClientModal,
          style: { display: "none" }
        },
        previewItemTitleRender
      }
    ));
  }, [
    isWalkIn,
    isHasFormRecord,
    state == null ? void 0 : state.disabledEdit,
    boardConfig.type,
    (_t = (_s = (_r = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _r.holder) == null ? void 0 : _s.form) == null ? void 0 : _t.title,
    (_v = (_u = state.pet) == null ? void 0 : _u.formData) == null ? void 0 : _v[0],
    state,
    petDispatch,
    handleOpenModal,
    handleOpenClientModal,
    previewItemTitleRender,
    handleAddPet,
    currentPetValue,
    formId,
    (_x = (_w = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _w.holder) == null ? void 0 : _x.data_range,
    (_y = state.service) == null ? void 0 : _y.value
  ]);
  const handleOpenClient = () => {
    if (!isWalkIn || (state == null ? void 0 : state.disableEventBookingEdit)) {
      return;
    }
    handleOpenClientModal();
  };
  (0, import_react.useImperativeHandle)(ref, () => {
    var _a2, _b2;
    return {
      open: handleOpenClientModal,
      close: (_a2 = modalRef.current) == null ? void 0 : _a2.close,
      setSearch: (_b2 = modalRef.current) == null ? void 0 : _b2.setSearch
    };
  });
  const isOpenDeleteProduct = (0, import_react.useMemo)(() => {
    if (!(0, import_utils3.isDayBooking)(state)) return false;
    const pets = (0, import_utils3.getPets)(state);
    const appointmentServices = (0, import_utils3.getAppointmentService)(state);
    if ((pets == null ? void 0 : pets.length) && ((appointmentServices == null ? void 0 : appointmentServices.length) || (0, import_utils3.isEventBooking)(state))) {
      return true;
    }
    return false;
  }, [state]);
  const _handleSelectClient = async (e) => {
    var _a2, _b2, _c2, _d2, _e2;
    handleSelectClient(e);
    if ((0, import_utils3.isDayBooking)(state)) {
      let _value = (e == null ? void 0 : e[e.length - 1]) || import_model.walkInData;
      if (_value.loading) {
        return;
      }
      if ((0, import_utils3.isDayBooking)(state) && ((_b2 = (_a2 = state == null ? void 0 : state.service) == null ? void 0 : _a2.value) == null ? void 0 : _b2.length) > 0 && ((_c2 = state.client.value) == null ? void 0 : _c2.id) !== (_value == null ? void 0 : _value.id)) {
        const _state = {
          ...state,
          client: {
            ...state.client,
            value: {
              ..._value,
              name: getNickname(_value)
            }
          }
        };
        if (isOpenDeleteProduct) {
          (_e2 = changePetRef.current) == null ? void 0 : _e2.open({
            setGlobalState,
            service: ((_d2 = state.service) == null ? void 0 : _d2.value) || [],
            state,
            source: "changeClient"
          });
        }
        const services = await (0, import_utils3.updateServicePrice)(_state);
        console.log(services, state, _value, isOpenDeleteProduct, "wh98797686");
        setGlobalState({
          service: {
            ...stateRef.current.service,
            value: services,
            edit: true
          }
        });
      }
    }
  };
  return /* @__PURE__ */ import_react.default.createElement(
    "div",
    {
      className: (0, import_classnames.default)("pisell-lowcode__booking-vertical-client-wrap", {
        ["create-booking-page-vertical-client-wrap"]: state.isBookingCreatePage
      })
    },
    /* @__PURE__ */ import_react.default.createElement(
      "div",
      {
        className: (0, import_classnames.default)("pisell-lowcode__booking-vertical-client", {
          "pisell-lowcode__booking-vertical-client-walkin": isWalkIn
        }),
        onClick: handleOpenClient
      },
      /* @__PURE__ */ import_react.default.createElement(import_antd.Skeleton, { loading: false, active: true, round: true }, /* @__PURE__ */ import_react.default.createElement(
        import_antd.Avatar,
        {
          className: "pisell-lowcode__booking-client-avatar",
          src: import_utils.image.ali((_z = state.client.value) == null ? void 0 : _z.cover, 100),
          size: 64,
          icon: /* @__PURE__ */ import_react.default.createElement(import_User01.default, { className: "pisell-lowcode__booking-client-list-item-avatar-icon" })
        }
      ), isWalkIn ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-info-desc" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-title" }, import_utils.locales.getText("pisell2.text.add-client")), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-desc-item" }, import_utils.locales.getText("pisell2.text.leave-empty-for-walk-in"))) : /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-title" }, getNickname(state.client.value)), ((_A = state.client.value) == null ? void 0 : _A.email) ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-desc-item" }, (_B = state.client.value) == null ? void 0 : _B.email) : null, ((_C = state.client.value) == null ? void 0 : _C.phone) ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-desc-item" }, (_D = state.client.value) == null ? void 0 : _D.phone) : null, !!((_F = (_E = state.client.value) == null ? void 0 : _E.waiver_form) == null ? void 0 : _F.length) && /* @__PURE__ */ import_react.default.createElement(
        "div",
        {
          className: "pisell-lowcode__booking-client-waiver",
          title: (0, import_utils5.getWaiverTitle)((_G = state.client.value) == null ? void 0 : _G.waiver_form)
        },
        (_J = (_I = (_H = state.client.value) == null ? void 0 : _H.waiver_form) == null ? void 0 : _I.map) == null ? void 0 : _J.call(_I, (item) => {
          return /* @__PURE__ */ import_react.default.createElement("span", null, item.form_title, /* @__PURE__ */ import_react.default.createElement(
            "span",
            {
              className: "pisell-lowcode__booking-client-waiver-colon"
            },
            ":"
          ), item.is_filled ? /* @__PURE__ */ import_react.default.createElement(
            "span",
            {
              className: "pisell-lowcode__booking-client-waiver-filled"
            },
            import_utils.locales.getText("pisell2.text.filled")
          ) : /* @__PURE__ */ import_react.default.createElement(
            "span",
            {
              className: "pisell-lowcode__booking-client-waiver-not-filled"
            },
            import_utils.locales.getText("pisell2.text.not-filled")
          ), ` ; `);
        })
      )), !isWalkIn && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-action-wrap" }, !state.disabledEdit && /* @__PURE__ */ import_react.default.createElement(
        import_antd.Dropdown.Button,
        {
          menu: {
            items: menus,
            onClick: menuChange
          },
          placement: "bottomRight",
          onClick: () => handleOpenClientModal()
        },
        import_utils.locales.getText("pisell2.text.variant-client-change")
      ), /* @__PURE__ */ import_react.default.createElement(
        import_antd.Button,
        {
          onClick: (e) => {
            e.stopPropagation();
            handleViewClient();
          }
        },
        import_utils.locales.getText("pisell2.text.view-profile")
      )))
    ),
    /* @__PURE__ */ import_react.default.createElement(
      "div",
      {
        className: (0, import_classnames.default)("pisell-lowcode__booking-vertical-pet", {
          "pisell-lowcode__booking-vertical-pet-walkin": isWalkIn
        }),
        onClick: handleOpenClient
      },
      petRender
    ),
    isShowAddBtn && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-vertical-footer" }, /* @__PURE__ */ import_react.default.createElement(
      import_antd.Button,
      {
        onClick: () => {
          const currentClientSearchValue = getCurrentClientSearchValue();
          modalRef.current.setSearch(currentClientSearchValue);
          handleOpenClientModal(currentClientSearchValue);
        },
        block: true,
        size: "large"
      },
      import_utils.locales.getText("pisell2.text.select")
    )),
    /* @__PURE__ */ import_react.default.createElement(
      import_SelectDrawer.default,
      {
        showHeader: !state.isBookingCreatePage,
        modalOpen: state.modalOpen,
        loading,
        autoFocus: !((_M = (_L = (_K = context == null ? void 0 : context.appHelper) == null ? void 0 : _K.utils) == null ? void 0 : _L.isTerminal) == null ? void 0 : _M.call(_L)),
        ref: modalRef,
        onClose: handleClose,
        handleSelectClient: _handleSelectClient,
        handleCreateItem,
        childrenValue: state.pet.value,
        handleSelectPet,
        formData: state.pet.formData,
        searchChange,
        options: renderList,
        holder: (_N = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _N.holder,
        client: (_O = state == null ? void 0 : state.client) == null ? void 0 : _O.value,
        loadMore,
        showPet: (boardConfig == null ? void 0 : boardConfig.type) === "form",
        handleAddPet,
        franchiseeLoading,
        showWalkIn: !(0, import_utils3.isDayBooking)(state)
      }
    ),
    /* @__PURE__ */ import_react.default.createElement(import_ChangePetModal.default, { ref: changePetRef })
  );
});
var vertical_default = VerticalClient;
