/**
 * Figma 样式餐桌/圆桌卡片：上下小条 + 白底卡片 + 状态色边框
 * 供 Floor Map Story 与 Sales Grid 平面图复用
 */
import React from 'react';
import { Avatar } from 'antd';
import { UserOutlined, ClockCircleOutlined, TeamOutlined, AuditOutlined, FieldTimeOutlined, EnvironmentOutlined } from '@ant-design/icons';
import { locales } from '@pisell/utils';
import { resolveSceneElementDisplayTitle } from "../utils/floorMapElementNameAsTitle";
var I18N_CARD = 'pisell-floor-map-layout.card-placeholder';
var I18N_FIGMA = 'pisell-floor-map-layout.figma-card';

/** Figma 设计 token（Pisell 2.0 Component Library） */
var FIGMA = {
  white: '#FFFFFF',
  gray100: '#F2F4F7',
  gray200: '#EAECF0',
  gray400: '#98A2B3',
  gray700: '#344054',
  gray900: '#101828',
  shadowSm: '0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.1)',
  fontFamily: 'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
  barFillAvailable: '#EAECF0',
  reserved: '#9254de',
  waiting: '#fa8c16',
  dining: '#1890ff',
  billed: '#52c41a',
  availableSoon: '#f5222d'
};
var STATUS_BORDER = {
  available: FIGMA.gray200,
  reserved: FIGMA.reserved,
  waiting: FIGMA.waiting,
  dining: FIGMA.dining,
  billed: FIGMA.billed,
  availableSoon: FIGMA.availableSoon
};

/**
 * 状态 tag 的浅色背景 / 深色文字配对。可用态走中性灰；其它态用对应状态色的浅版底 + 深版字，
 * 保证小字号下仍有足够对比度（≥ 4.5:1）。
 */
var STATUS_TAG_BG = {
  available: '#F2F4F7',
  reserved: '#F4ECFB',
  waiting: '#FEF0E0',
  dining: '#E6F4FF',
  billed: '#E8F8EA',
  availableSoon: '#FEE4E2'
};
var STATUS_TAG_FG = {
  available: '#475467',
  reserved: '#7B3CCB',
  waiting: '#C4690D',
  dining: '#0E6FD0',
  billed: '#347D3A',
  availableSoon: '#B42318'
};

/** 方桌/圆桌卡片展示用数据结构（与 Figma 设计一致，支持桌号/状态/人数/区域等） */

var STATUS_MAP = {
  available: 'available',
  reserved: 'reserved',
  waiting: 'waiting',
  dining: 'dining',
  billed: 'billed',
  availableSoon: 'availableSoon',
  空闲: 'available',
  已预订: 'reserved',
  等待: 'waiting',
  用餐中: 'dining',
  已结账: 'billed',
  即将可用: 'availableSoon'
};

/** 从 merged item + dataSources 得到卡片数据 */
export function getFigmaTableCardFromMerged(item, dataSources) {
  var _binding$recordId;
  var el = item._sceneElement;
  var binding = el === null || el === void 0 ? void 0 : el.dataBinding;
  var titleFromElement = (el === null || el === void 0 ? void 0 : el.name) != null && String(el.name).trim() ? String(el.name).trim() : '';
  var kindLabel = locales.getText(item.elementKind === 'roundTable' ? "".concat(I18N_FIGMA, ".kind-round-table") : "".concat(I18N_FIGMA, ".kind-square-table"));
  var hasDataSource = Boolean((binding === null || binding === void 0 ? void 0 : binding.dataSourceKey) && String(binding.dataSourceKey).trim() !== '');
  var rid = (binding === null || binding === void 0 ? void 0 : binding.recordId) != null ? String(binding.recordId).trim() : '';
  var boundToData = Boolean(hasDataSource && rid !== '');
  var list = binding !== null && binding !== void 0 && binding.dataSourceKey ? dataSources[binding.dataSourceKey] : undefined;
  var record = boundToData && list ? list.find(function (r) {
    return r.id === rid;
  }) : undefined;
  var hasLiveRow = Boolean(record);
  if (!hasLiveRow) {
    /** 记录缺失或与「未选数据源」占位同一视觉（虚线 #bfbfbf），便于识别为待处理态 */
    var borderColor = '#bfbfbf';
    var hint = !hasDataSource || !rid ? hasDataSource ? locales.getText("".concat(I18N_CARD, ".hint-select-row")) : locales.getText("".concat(I18N_CARD, ".hint-bind-datasource")) : rid.startsWith('new_') ? locales.getText("".concat(I18N_CARD, ".hint-new-slot")).replace(/\{kind\}/g, kindLabel) : locales.getText("".concat(I18N_CARD, ".hint-row-not-found"));
    return {
      id: item.id,
      isNoDataPlaceholder: true,
      placeholderBorderColor: borderColor,
      placeholderHint: hint,
      placeholderTitle: titleFromElement || kindLabel
    };
  }
  var displayId = (_binding$recordId = binding === null || binding === void 0 ? void 0 : binding.recordId) !== null && _binding$recordId !== void 0 ? _binding$recordId : item.id;
  var rawStatus = record === null || record === void 0 ? void 0 : record.status;
  var status = rawStatus && STATUS_MAP[rawStatus] || 'available';
  /**
   * 命中数据行的标题：默认仍用 `record.name`（保持历史行为）。
   * 若图元上勾选了「将图元名作为资源标题」，由 resolveSceneElementDisplayTitle 统一覆盖，
   * 与预约页 RoomCard 路径一致；未勾选 / 未启用 kind 都不会改动。
   */
  var recordName = (record === null || record === void 0 ? void 0 : record.name) != null ? String(record.name) : undefined;
  var resolvedTitle = resolveSceneElementDisplayTitle({
    sceneElement: el,
    recordTitle: recordName,
    fallback: kindLabel
  });
  return {
    id: displayId,
    displayName: resolvedTitle || undefined,
    status: status,
    customerName: record === null || record === void 0 ? void 0 : record.customerName,
    reserveTime: record === null || record === void 0 ? void 0 : record.reserveTime,
    guests: record === null || record === void 0 ? void 0 : record.guests,
    capacity: record === null || record === void 0 ? void 0 : record.capacity,
    dishes: record === null || record === void 0 ? void 0 : record.dishes,
    duration: record === null || record === void 0 ? void 0 : record.duration,
    area: record === null || record === void 0 ? void 0 : record.area
  };
}

/** 根据 item id 得到小条数量：S=1, M=2, L=3, X=3, XL=4 */
function getBarCountFromItemId(id) {
  var upper = id.toUpperCase();
  if (upper.startsWith('XL-') || id.endsWith('-XL')) return 4;
  if (upper.startsWith('L-') || upper.startsWith('X-') || id.endsWith('-L') || id.endsWith('-X')) return 3;
  if (upper.startsWith('M-') || id.endsWith('-M')) return 2;
  return 1;
}
var CARD_BAR_WIDTH = 80;
var CARD_BAR_HEIGHT = 12;
function CardBars(_ref) {
  var count = _ref.count,
    position = _ref.position,
    barColor = _ref.barColor;
  return /*#__PURE__*/React.createElement("div", {
    style: {
      display: 'flex',
      flexDirection: 'row',
      gap: 30,
      justifyContent: 'center',
      flexShrink: 0,
      padding: position === 'top' ? '0 0 4px 0' : '4px 0 0 0'
    }
  }, Array.from({
    length: count
  }, function (_, i) {
    return /*#__PURE__*/React.createElement("div", {
      key: i,
      style: {
        width: CARD_BAR_WIDTH,
        height: CARD_BAR_HEIGHT,
        borderRadius: 6,
        background: barColor
      }
    });
  }));
}
function FigmaCardRow(_ref2) {
  var icon = _ref2.icon,
    children = _ref2.children;
  return /*#__PURE__*/React.createElement("div", {
    style: {
      display: 'flex',
      alignItems: 'center',
      gap: 4,
      fontFamily: FIGMA.fontFamily,
      fontSize: 14,
      lineHeight: '20px',
      fontWeight: 400,
      color: FIGMA.gray700,
      flexShrink: 0,
      minHeight: '20px'
    }
  }, /*#__PURE__*/React.createElement("span", {
    style: {
      flexShrink: 0,
      color: FIGMA.gray400,
      fontSize: 14
    }
  }, icon), /*#__PURE__*/React.createElement("span", {
    style: {
      flexShrink: 0
    }
  }, children));
}

/**
 * 「资源信息」标题栏：把图元自身的属性（桌名 / 可坐人数 / 区域 / 状态）从卡片正文里抽出来
 * 单独占一栏置顶，正文专心展示当下的预订 / 用餐 / 结账信息。
 *
 * 布局：
 *   ┌─────────────────────────────────────┐
 *   │  桌名 (粗体)                  [状态 tag] │
 *   │  [人数] N · [区域] 区                    │
 *   └─────────────────────────────────────┘
 *
 * - 没有任何资源字段时返回 null，避免空标题栏占位；
 * - 状态 tag 用浅色底 + 深色字（status 配色对），保持小字号对比度；
 * - capacity · area 行仅在两者至少有一项时渲染。
 */
function ResourceHeaderBar(_ref3) {
  var _cardItem$displayName, _cardItem$status;
  var cardItem = _ref3.cardItem,
    variant = _ref3.variant;
  var hasCapacity = cardItem.capacity != null;
  var hasArea = cardItem.area != null && cardItem.area !== '';
  var titleText = (_cardItem$displayName = cardItem.displayName) !== null && _cardItem$displayName !== void 0 ? _cardItem$displayName : cardItem.id;
  var hasTitle = titleText != null && String(titleText).trim() !== '';
  var status = (_cardItem$status = cardItem.status) !== null && _cardItem$status !== void 0 ? _cardItem$status : 'available';
  var statusLabel = locales.getText("".concat(I18N_FIGMA, ".status-").concat(status));
  if (!hasTitle && !hasCapacity && !hasArea) return null;
  var metaEntries = [];
  if (hasCapacity) {
    metaEntries.push({
      key: 'capacity',
      icon: /*#__PURE__*/React.createElement(TeamOutlined, {
        style: {
          marginRight: 3
        }
      }),
      text: locales.getText("".concat(I18N_FIGMA, ".capacity-seats")).replace(/\{n\}/g, String(cardItem.capacity))
    });
  }
  if (hasArea) {
    metaEntries.push({
      key: 'area',
      icon: /*#__PURE__*/React.createElement(EnvironmentOutlined, {
        style: {
          marginRight: 3
        }
      }),
      text: String(cardItem.area)
    });
  }
  var isRound = variant === 'round';
  return /*#__PURE__*/React.createElement("div", {
    style: {
      display: 'flex',
      flexDirection: 'column',
      gap: 2,
      padding: isRound ? '4px 8px 6px' : '6px 8px',
      borderBottom: isRound ? 'none' : "1px dashed ".concat(FIGMA.gray200),
      flexShrink: 0,
      fontFamily: FIGMA.fontFamily
    }
  }, /*#__PURE__*/React.createElement("div", {
    style: {
      display: 'flex',
      alignItems: 'center',
      gap: 8,
      minHeight: 18
    }
  }, hasTitle ? /*#__PURE__*/React.createElement("span", {
    style: {
      fontWeight: 600,
      fontSize: 14,
      lineHeight: '18px',
      color: FIGMA.gray900,
      whiteSpace: 'nowrap',
      overflow: 'hidden',
      textOverflow: 'ellipsis',
      flex: '1 1 auto',
      minWidth: 0,
      textAlign: isRound ? 'center' : 'left'
    },
    title: String(titleText)
  }, titleText) : /*#__PURE__*/React.createElement("span", {
    style: {
      flex: '1 1 auto'
    }
  }), /*#__PURE__*/React.createElement("span", {
    style: {
      display: 'inline-flex',
      alignItems: 'center',
      justifyContent: 'center',
      padding: '1px 6px',
      borderRadius: 999,
      fontSize: 10,
      lineHeight: '14px',
      fontWeight: 600,
      background: STATUS_TAG_BG[status],
      color: STATUS_TAG_FG[status],
      flexShrink: 0,
      whiteSpace: 'nowrap',
      letterSpacing: 0.2
    }
  }, statusLabel)), metaEntries.length > 0 ? /*#__PURE__*/React.createElement("span", {
    style: {
      fontSize: 11,
      lineHeight: '16px',
      color: FIGMA.gray400,
      whiteSpace: 'nowrap',
      overflow: 'hidden',
      textOverflow: 'ellipsis',
      display: 'block',
      textAlign: isRound ? 'center' : 'left'
    }
  }, metaEntries.map(function (entry, index) {
    return /*#__PURE__*/React.createElement(React.Fragment, {
      key: entry.key
    }, index === 0 ? null : /*#__PURE__*/React.createElement("span", {
      style: {
        margin: '0 4px'
      }
    }, "\xB7"), entry.icon, entry.text);
  })) : null);
}

/**
 * 方桌内容区（不含资源信息——桌名 / 可坐人数 / 区域已上移到 ResourceHeaderBar）。
 *
 * - available：正文留空（视觉上是一个浅灰边框白底），所有"我是哪张桌"已在标题栏交代；
 * - reserved：客人 + 预订时间；
 * - dining / waiting / billed / availableSoon：当前用餐人数 + 菜品 + 用餐时长。
 */
function TableCardContent(_ref4) {
  var _cardItem$status2;
  var cardItem = _ref4.cardItem;
  var status = (_cardItem$status2 = cardItem.status) !== null && _cardItem$status2 !== void 0 ? _cardItem$status2 : 'available';
  var borderColor = STATUS_BORDER[status];
  var isAvailable = status === 'available';
  return /*#__PURE__*/React.createElement("div", {
    style: {
      flex: 1,
      minHeight: 0,
      /** 方桌内容区内边距：原 8 减半为 4，留出更多内容显示空间 */
      padding: 4,
      boxSizing: 'border-box',
      background: FIGMA.white,
      border: isAvailable ? "4px solid ".concat(FIGMA.gray200) : "4px solid ".concat(borderColor),
      borderTopLeftRadius: 0,
      borderTopRightRadius: 0,
      borderBottomLeftRadius: 8,
      borderBottomRightRadius: 8,
      display: 'flex',
      flexDirection: 'column',
      justifyContent: 'center',
      alignItems: isAvailable ? 'stretch' : 'center',
      gap: 4
    }
  }, isAvailable ? null : /*#__PURE__*/React.createElement(React.Fragment, null, status === 'reserved' && (cardItem.customerName != null && cardItem.customerName !== '' || cardItem.reserveTime != null && cardItem.reserveTime !== '') && /*#__PURE__*/React.createElement(React.Fragment, null, cardItem.customerName != null && cardItem.customerName !== '' && /*#__PURE__*/React.createElement(FigmaCardRow, {
    icon: /*#__PURE__*/React.createElement(Avatar, {
      size: 16,
      icon: /*#__PURE__*/React.createElement(UserOutlined, null),
      style: {
        backgroundColor: FIGMA.gray200
      }
    })
  }, /*#__PURE__*/React.createElement("span", null, cardItem.customerName)), cardItem.reserveTime != null && cardItem.reserveTime !== '' && /*#__PURE__*/React.createElement(FigmaCardRow, {
    icon: /*#__PURE__*/React.createElement(ClockCircleOutlined, null)
  }, /*#__PURE__*/React.createElement("span", null, cardItem.reserveTime))), (status === 'dining' || status === 'waiting' || status === 'billed' || status === 'availableSoon') && cardItem.guests != null && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FigmaCardRow, {
    icon: /*#__PURE__*/React.createElement(TeamOutlined, null)
  }, /*#__PURE__*/React.createElement("span", null, locales.getText("".concat(I18N_FIGMA, ".guests-count")).replace(/\{n\}/g, String(cardItem.guests)))), cardItem.dishes && /*#__PURE__*/React.createElement(FigmaCardRow, {
    icon: /*#__PURE__*/React.createElement(AuditOutlined, null)
  }, /*#__PURE__*/React.createElement("span", null, cardItem.dishes)), cardItem.duration && /*#__PURE__*/React.createElement(FigmaCardRow, {
    icon: /*#__PURE__*/React.createElement(FieldTimeOutlined, null)
  }, /*#__PURE__*/React.createElement("span", null, cardItem.duration)))));
}

/** 无数据占位：与蘸料摆台 Story 中占位卡片视觉对齐（虚线框 + #fafafa） */
function renderTableKindNoDataPlaceholder(cardItem, shape) {
  var _cardItem$placeholder, _cardItem$placeholder2, _cardItem$placeholder3;
  var borderColor = (_cardItem$placeholder = cardItem.placeholderBorderColor) !== null && _cardItem$placeholder !== void 0 ? _cardItem$placeholder : '#bfbfbf';
  var title = (_cardItem$placeholder2 = cardItem.placeholderTitle) !== null && _cardItem$placeholder2 !== void 0 ? _cardItem$placeholder2 : locales.getText("".concat(I18N_FIGMA, ".default-table"));
  var hint = (_cardItem$placeholder3 = cardItem.placeholderHint) !== null && _cardItem$placeholder3 !== void 0 ? _cardItem$placeholder3 : '';
  return /*#__PURE__*/React.createElement("div", {
    style: {
      width: '100%',
      height: '100%',
      boxSizing: 'border-box',
      padding: '8px 10px',
      display: 'flex',
      flexDirection: 'column',
      justifyContent: 'center',
      minHeight: 0,
      fontSize: 11,
      lineHeight: 1.35,
      background: '#fafafa',
      borderRadius: shape === 'circle' ? '50%' : 8,
      border: "2px dashed ".concat(borderColor),
      boxShadow: 'none',
      overflow: 'hidden'
    }
  }, /*#__PURE__*/React.createElement("div", {
    style: {
      fontWeight: 600,
      color: '#595959',
      overflow: 'hidden',
      textOverflow: 'ellipsis',
      whiteSpace: 'nowrap',
      textAlign: shape === 'circle' ? 'center' : undefined
    }
  }, title), hint ? /*#__PURE__*/React.createElement("div", {
    style: {
      color: '#8c8c8c',
      marginTop: 6,
      flexShrink: 0,
      fontSize: 10,
      textAlign: shape === 'circle' ? 'center' : undefined
    }
  }, hint) : null);
}

/**
 * 资源信息栏的"独立 chip"包裹：保持与下方卡片正文相同的状态色边框，但
 * 视觉上紧贴在卡片顶端，形成 [资源 chip][正文卡片] 的两段式结构。
 *
 * 边框策略：与正文 4px 状态色等宽，上面圆角、底部直边、底部 0 边以"贴合"正文。
 */
function ResourceHeaderShell(_ref5) {
  var _cardItem$status3;
  var cardItem = _ref5.cardItem,
    variant = _ref5.variant;
  var status = (_cardItem$status3 = cardItem.status) !== null && _cardItem$status3 !== void 0 ? _cardItem$status3 : 'available';
  var borderColor = status === 'available' ? FIGMA.gray200 : STATUS_BORDER[status];
  return /*#__PURE__*/React.createElement("div", {
    style: {
      background: FIGMA.white,
      border: "4px solid ".concat(borderColor),
      /** 去掉底部边，与下方 TableCardContent 拼合成一张卡片，再由内部 dashed line 分隔上下两段 */
      borderBottom: 'none',
      borderTopLeftRadius: 8,
      borderTopRightRadius: 8,
      flexShrink: 0,
      boxSizing: 'border-box'
    }
  }, /*#__PURE__*/React.createElement(ResourceHeaderBar, {
    cardItem: cardItem,
    variant: variant
  }));
}

/** 渲染 Figma 样式的方桌卡片（上下小条 + 资源信息标题栏 + 白底卡片 + 状态色边框） */
export function renderFigmaStyleTableCard(cardItem) {
  var _cardItem$status4;
  if (cardItem.isNoDataPlaceholder) {
    return renderTableKindNoDataPlaceholder(cardItem, 'rect');
  }
  var status = (_cardItem$status4 = cardItem.status) !== null && _cardItem$status4 !== void 0 ? _cardItem$status4 : 'available';
  var borderColor = STATUS_BORDER[status];
  var isAvailable = status === 'available';
  return /*#__PURE__*/React.createElement("div", {
    style: {
      width: '100%',
      height: '100%',
      boxSizing: 'border-box',
      display: 'flex',
      flexDirection: 'column',
      justifyContent: 'flex-start',
      gap: 0,
      fontFamily: FIGMA.fontFamily,
      overflow: 'hidden'
    }
  }, /*#__PURE__*/React.createElement(CardBars, {
    count: getBarCountFromItemId(cardItem.id),
    position: "top",
    barColor: isAvailable ? FIGMA.barFillAvailable : borderColor
  }), /*#__PURE__*/React.createElement("div", {
    style: {
      flex: 1,
      minHeight: 0,
      display: 'flex',
      flexDirection: 'column',
      borderRadius: 8,
      boxShadow: FIGMA.shadowSm,
      overflow: 'hidden'
    }
  }, /*#__PURE__*/React.createElement(ResourceHeaderShell, {
    cardItem: cardItem,
    variant: "rect"
  }), /*#__PURE__*/React.createElement(TableCardContent, {
    cardItem: cardItem
  })), /*#__PURE__*/React.createElement(CardBars, {
    count: getBarCountFromItemId(cardItem.id),
    position: "bottom",
    barColor: isAvailable ? FIGMA.barFillAvailable : borderColor
  }));
}

/**
 * 圆桌专用：独立 pill 形资源信息标题栏，悬挂在圆形之上。
 *
 * 圆形不能在顶部"切一刀"放标题栏，所以做成独立 chip：保持圆形主体不被破坏，
 * 同时把"我是哪张桌、能坐几人、属于哪个区"这些资源属性单独展示在最上方。
 */
function RoundResourceHeaderChip(_ref6) {
  var _cardItem$status5;
  var cardItem = _ref6.cardItem;
  var status = (_cardItem$status5 = cardItem.status) !== null && _cardItem$status5 !== void 0 ? _cardItem$status5 : 'available';
  var borderColor = status === 'available' ? FIGMA.gray200 : STATUS_BORDER[status];
  return /*#__PURE__*/React.createElement("div", {
    style: {
      flexShrink: 0,
      background: FIGMA.white,
      border: "2px solid ".concat(borderColor),
      borderRadius: 999,
      boxShadow: FIGMA.shadowSm,
      margin: '0 auto 4px',
      boxSizing: 'border-box',
      maxWidth: '100%'
    }
  }, /*#__PURE__*/React.createElement(ResourceHeaderBar, {
    cardItem: cardItem,
    variant: "round"
  }));
}

/** 渲染 Figma 样式的圆桌卡片（顶部资源信息 chip + 圆形主体，圆形主体只展示状态相关内容） */
export function renderFigmaStyleRoundTableCard(cardItem) {
  var _cardItem$status6;
  if (cardItem.isNoDataPlaceholder) {
    return renderTableKindNoDataPlaceholder(cardItem, 'circle');
  }
  var status = (_cardItem$status6 = cardItem.status) !== null && _cardItem$status6 !== void 0 ? _cardItem$status6 : 'available';
  var borderColor = STATUS_BORDER[status];
  var isAvailable = status === 'available';
  return /*#__PURE__*/React.createElement("div", {
    style: {
      width: '100%',
      height: '100%',
      boxSizing: 'border-box',
      display: 'flex',
      flexDirection: 'column',
      alignItems: 'stretch',
      gap: 0,
      fontFamily: FIGMA.fontFamily,
      overflow: 'hidden'
    }
  }, /*#__PURE__*/React.createElement(RoundResourceHeaderChip, {
    cardItem: cardItem
  }), /*#__PURE__*/React.createElement("div", {
    style: {
      flex: 1,
      minHeight: 0,
      display: 'flex',
      flexDirection: 'column',
      justifyContent: 'center',
      alignItems: 'center',
      overflow: 'hidden',
      borderRadius: '50%',
      border: isAvailable ? "4px solid ".concat(FIGMA.gray200) : "4px solid ".concat(borderColor),
      background: FIGMA.white,
      boxShadow: FIGMA.shadowSm,
      padding: 8
    }
  }, /*#__PURE__*/React.createElement("div", {
    style: {
      flex: 1,
      minHeight: 0,
      display: 'flex',
      flexDirection: 'column',
      justifyContent: 'center',
      alignItems: 'center',
      width: '100%',
      overflow: 'hidden',
      gap: 2
    }
  }, isAvailable ? null : /*#__PURE__*/React.createElement(React.Fragment, null, status === 'reserved' && cardItem.customerName && /*#__PURE__*/React.createElement("div", {
    style: {
      fontSize: 12,
      color: FIGMA.gray700
    }
  }, cardItem.customerName), status === 'reserved' && cardItem.reserveTime && /*#__PURE__*/React.createElement("div", {
    style: {
      fontSize: 12,
      color: FIGMA.gray700
    }
  }, cardItem.reserveTime), (status === 'dining' || status === 'waiting' || status === 'billed' || status === 'availableSoon') && cardItem.guests != null && /*#__PURE__*/React.createElement("div", {
    style: {
      fontSize: 12,
      color: FIGMA.gray700
    }
  }, locales.getText("".concat(I18N_FIGMA, ".guests-count")).replace(/\{n\}/g, String(cardItem.guests)))))));
}

/** 返回用于 renderItemByKind.table 的渲染函数（方桌） */
export function getRenderItemByKindTable(dataSources) {
  return function (item) {
    var cardItem = getFigmaTableCardFromMerged(item, dataSources);
    return renderFigmaStyleTableCard(cardItem);
  };
}

/** 返回用于 renderItemByKind.roundTable 的渲染函数（圆桌） */
export function getRenderItemByKindRoundTable(dataSources) {
  return function (item) {
    var cardItem = getFigmaTableCardFromMerged(item, dataSources);
    return renderFigmaStyleRoundTableCard(cardItem);
  };
}