import { _ as f, gq as Ke, at as Ue, a6 as N, F as u, as as Ye, mU as Wt, X as v, ia as ae, G as L, g9 as be, gC as Ht, cB as Ot, ey as Ft, af as Mt, g8 as Bt, mV as Pt, mW as Xe, ag as Dt, e4 as Nt, ft as Lt, cC as jt, Y as h, mX as qt, dj as Gt, dk as Kt, mY as Ut, av as Yt, ln as Xt, mZ as Jt, q as Zt, g as Je, M as we, fN as Qt, bN as ie, S as D, w as S, v as He, O as oe, ad as eo, a3 as Oe, g3 as to, a as oo, cy as no, cz as Fe, dq as Me, dT as ro, dV as ge, bO as io, cs as Be, lw as Ze, g4 as Qe, g5 as et, g6 as tt, g7 as me, e3 as lo, dm as he, gd as ao, am as B, d$ as ne, fy as ot, an as so, gn as co, ap as uo, bq as ho, m_ as po, hd as go, dW as Pe, m$ as De, n0 as mo } from "./603b75d9.js";
import { useState as F, useContext as re, useMemo as w, useCallback as Ne, useEffect as nt, useRef as bo } from "react";
import { ColumnTypeCompMap as Le, ColumnTypeComp as wo } from "./18a95abc.js";
import { TextOverflowControl as yo } from "./be662667.js";
import { ColumnValueTooltip as fo } from "./62f393ec.js";
import { SummaryColumnComp as xo } from "./8064caf1.js";
import { TableRowContext as rt, TableCellContext as $o } from "./ffcffc16.js";
import { tableFilterOperatorMap as Co, TableToolbar as So } from "./d8fd0c14.js";
import { _ as vo } from "./4963ac97.js";
const V = "children", y = "__ob_origin_index", Vo = "__ob_origin_record", U = 55, it = 500;
function To(e, t, o, n) {
  let a = e;
  return t && (a = a.filter((i) => {
    let s = t == null ? void 0 : t.toLowerCase();
    return s ? Object.values(i).find((d) => d == null ? void 0 : d.toString().toLowerCase().includes(s)) : !0;
  })), n && o.filters.length > 0 && (a = a.filter((i) => {
    for (let s of o.filters) {
      const d = i[s.columnKey], c = Co[s.operator].filter(s.filterValue, d);
      if (o.stackType === "or" && c)
        return !0;
      if (o.stackType === "and" && !c)
        return !1;
    }
    return o.filters.length === 0 || o.stackType === "and" ? !0 : o.stackType !== "or";
  })), a;
}
function ko(e, t, o) {
  let n = e.map((a, i) => ({
    ...a,
    [y]: i + ""
  }));
  if (o.length > 0) {
    const [a, i] = f(o).filter((s) => {
      var d;
      return !!s.column && ((d = t[s.column]) == null ? void 0 : d.sortable);
    }).map((s) => [s.column, s.desc ? "desc" : "asc"]).unzip().value();
    n = f.orderBy(n, a.map((s) => (d) => {
      const c = d[s];
      return typeof c == "string" ? c.toLowerCase() : c;
    }), i);
  }
  return n;
}
function lt({
  hide: e,
  tempHide: t,
  enableColumnSetting: o
}) {
  return o && t || e;
}
function at(e, t) {
  return e + "-" + t;
}
function st(e, t) {
  const o = t + "";
  return Array.isArray(e[V]) ? {
    ...e,
    [y]: o,
    children: e[V].map((n, a) => st(n, at(o, a + "")))
  } : {
    ...e,
    [y]: o
  };
}
function dt(e, t, o) {
  return e.map((n, a) => {
    const i = {
      [y]: n[y]
    };
    return o.forEach((s) => {
      const d = s.render.wrap({
        currentCell: n[s.dataIndex],
        currentRow: f.omit(n, y),
        currentIndex: a % t,
        currentOriginalIndex: n[y]
      });
      Array.isArray(n[V]) && (i[V] = dt(n[V], t, o));
      const c = d.comp[vo](d.comp);
      c !== null && (i[s.dataIndex] = c);
    }), i;
  });
}
function ct(e, t) {
  return e.map((o) => {
    const n = f(o).omit(y).mapKeys((a, i) => t[i] || i).value();
    return Array.isArray(o[V]) ? {
      ...n,
      [V]: ct(o[V], t)
    } : n;
  });
}
function Ro(e, t) {
  return f.mapValues(t, (o, n) => {
    const a = o.wrap().compType, i = {
      compType: a
    };
    return a === "tag" ? i.uniqueTags = f(e).map((s) => s[n]).filter((s) => !!s).uniq().value() : a === "badgeStatus" && (i.uniqueStatus = f(e).map((s) => {
      const d = s[n];
      return d.split(" ")[1] ? {
        status: d.slice(0, d.indexOf(" ")),
        text: d.slice(d.indexOf(" ") + 1)
      } : {
        status: d,
        text: ""
      };
    }).uniqBy("text").value()), i;
  });
}
function zo(e) {
  const {
    title: t,
    tooltip: o,
    editable: n
  } = e;
  return /* @__PURE__ */ N("div", {
    children: [/* @__PURE__ */ u(Ye, {
      title: o,
      children: /* @__PURE__ */ u("span", {
        style: {
          borderBottom: o ? "1px dotted" : ""
        },
        children: t
      })
    }), n && /* @__PURE__ */ u(Wt, {
      style: {
        verticalAlign: "baseline",
        marginLeft: "4px"
      }
    })]
  });
}
function Io(e, t) {
  let o = [];
  return Object.keys(e).forEach((n) => {
    t.includes(n) || o.push({
      label: n,
      value: `{{currentRow.${n}}}`
    });
  }), o.push({
    label: "Select with handlebars",
    value: "{{currentCell}}"
  }), o;
}
function ut(e, t, o, n, a, i, s, d, c) {
  const p = e.filter((r) => r.isCustom).map((r) => r.dataIndex), b = Io(s, p), $ = new Map(t.map((r) => [r.column, r.desc ? "descend" : "ascend"]));
  return f.sortBy(e, (r) => {
    if (r.fixed === "left")
      return -1;
    if (r.fixed === "right")
      return Number.MAX_SAFE_INTEGER;
    if (i.length > 0) {
      const x = i.indexOf(r.isCustom ? r.title : r.dataIndex);
      if (x >= 0)
        return x;
    }
    return 0;
  }).flatMap((r, x) => {
    if (lt({
      hide: r.hide,
      tempHide: r.tempHide,
      enableColumnSetting: o
    }))
      return [];
    if (a && i.length > 0 && !i.includes(r.isCustom ? r.title : r.dataIndex))
      return [];
    const l = (s[r.dataIndex] ?? {}).uniqueTags ?? [], k = (s[r.dataIndex] ?? {}).uniqueStatus ?? [], j = zo({
      title: r.title,
      tooltip: r.titleTooltip,
      editable: r.editable
    });
    return {
      key: `${r.dataIndex}-${x}`,
      title: r.showTitle ? j : "",
      titleText: r.title,
      dataIndex: r.dataIndex,
      align: r.align,
      width: r.autoWidth === "auto" ? 0 : r.width,
      fixed: r.fixed === "close" ? !1 : r.fixed,
      style: {
        background: r.background,
        margin: r.margin,
        text: r.text,
        border: r.border,
        radius: r.radius,
        textSize: r.textSize,
        textWeight: r.textWeight,
        fontStyle: r.fontStyle,
        fontFamily: r.fontFamily,
        borderWidth: r.borderWidth
      },
      linkStyle: {
        text: r.linkColor,
        hoverText: r.linkHoverColor,
        activeText: r.linkActiveColor
      },
      cellColorFn: r.cellColor,
      onWidthResize: r.onWidthResize,
      render: (W, I, M) => {
        const _ = f.omit(I, y);
        return r.render({
          currentCell: W,
          currentRow: _,
          currentIndex: M,
          currentOriginalIndex: Ke(I[y]),
          initialColumns: b
        }, String(I[y])).getView().view({
          editable: I[y].startsWith(z) || r.editable,
          size: n,
          candidateTags: l,
          candidateStatus: k,
          textOverflow: r.textOverflow,
          cellTooltip: r.cellTooltip({
            currentCell: W,
            currentRow: _,
            currentIndex: M
          }),
          editMode: d,
          onTableEvent: c
        });
      },
      ...r.sortable ? {
        sorter: !0,
        sortOrder: $.get(r.dataIndex),
        showSorterTooltip: !1
      } : {}
    };
  });
}
function je(e) {
  var t;
  return (t = e.column) != null && t.dataIndex ? {
    column: e.column.dataIndex.toString(),
    desc: e.order === "descend"
  } : null;
}
function ht(e, t, o, n, a, i) {
  if (n.action === "sort") {
    let s = [];
    if (Array.isArray(o))
      o.forEach((d) => {
        const c = je(d);
        c && s.push(c);
      });
    else {
      const d = je(o);
      d && s.push(d);
    }
    a(Ue("sort", s, !0)), i("sortChange");
  }
}
function pt(e, t) {
  const o = (i) => {
    const s = new Blob([i]).size;
    return i.length === s ? i.length * 10 : i.length * 20;
  }, n = f.max(t.map((i) => {
    const s = i[e];
    return s ? o(s.toString()) : U;
  })) || 0, a = o(e);
  return Math.max(Math.min(it, Math.max(a, n) + 10), U);
}
function _o(e, t) {
  const o = e == null ? void 0 : e.findIndex((a) => a[y] === t);
  if (!e || o < 0)
    return;
  const n = e[o];
  return {
    currentRow: f.omit(n, y),
    currentIndex: o,
    currentOriginalIndex: Ke(n[y])
  };
}
function ye(e) {
  const t = xt(e);
  return t && Array.isArray(t[V]);
}
const bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  COLUMN_CHILDREN_KEY: V,
  COL_MAX_WIDTH: it,
  COL_MIN_WIDTH: U,
  OB_ROW_ORI_INDEX: y,
  OB_ROW_RECORD: Vo,
  buildOriginIndex: at,
  calcColumnWidth: pt,
  columnHide: lt,
  columnsToAntdFormat: ut,
  filterData: To,
  genSelectionParams: _o,
  getColumnsAggr: Ro,
  getOriDisplayData: dt,
  onTableChange: ht,
  sortData: ko,
  supportChildrenTree: ye,
  tranToTableRecord: st,
  transformDispalyData: ct
}, Symbol.toStringTag, { value: "Module" })), Eo = (e) => e.length === 1 ? `(${e[0]} + ${e[0]})` : e.length === 2 ? `(${e[0]} + ${e[0]})` : e.length === 3 || e.length === 4 ? `(${e[0]} + ${e[2]})` : "0px", Ao = v(ae.Summary.Row)`
  ${(e) => `background: ${e.$background}`};

  td:last-child {
    border-right: unset !important;
  }

  ${(e) => !e.$istoolbarPositionBelow && `
    &:last-child td {
      border-bottom: none !important;
    }
  `}
  
`, Wo = v(ae.Summary.Cell)`
  background: ${(e) => e.$style.background} !important;
  border-color: ${(e) => e.$style.border} !important;
  // border-width: ${(e) => e.$style.borderWidth} !important;
  // border-style: ${(e) => e.$style.borderStyle} !important;
  border-radius: ${(e) => e.$style.radius};
  padding: 0 !important;

  > div {
    margin: ${(e) => e.$style.margin};
    color: ${(e) => e.$style.text};
    font-weight: ${(e) => e.$style.textWeight};
    font-family: ${(e) => e.$style.fontFamily};
    overflow: hidden; 
    ${(e) => e.$tableSize === "small" && `
      padding: 1px 8px;
      font-size: ${e.$defaultThemeDetail.textSize == e.$style.textSize ? "14px !important" : e.$style.textSize + " !important"};
      font-style:${e.$style.fontStyle} !important;
      min-height: 14px;
      line-height: 20px;
      ${!e.$autoHeight && `
        overflow-y: auto;
        max-height: 28px;
      `};
    `};
    ${(e) => e.$tableSize === "middle" && `
      padding: 8px 8px;
      font-size: ${e.$defaultThemeDetail.textSize == e.$style.textSize ? "16px !important" : e.$style.textSize + " !important"};
      font-style:${e.$style.fontStyle} !important;
      min-height: 24px;
      line-height: 24px;
      ${!e.$autoHeight && `
        overflow-y: auto;
        max-height: 48px;
      `};
    `};
    ${(e) => e.$tableSize === "large" && `
      padding: 16px 16px;
      font-size: ${e.$defaultThemeDetail.textSize == e.$style.textSize ? "18px !important" : e.$style.textSize + " !important"};
      font-style:${e.$style.fontStyle} !important;
      min-height: 48px;
      ${!e.$autoHeight && `
        overflow-y: auto;
        max-height: 96px;
      `};
    `};
    
    > .ant-badge > .ant-badge-status-text,
    > div > .markdown-body {
      color: ${(e) => e.$style.text};
    }

    > div > svg g {
      stroke: ${(e) => e.$style.text};
    }

    > a,
    > div  a {
      color: ${(e) => {
  var t;
  return (t = e.$linkStyle) == null ? void 0 : t.text;
}};

      &:hover {
        color: ${(e) => {
  var t;
  return (t = e.$linkStyle) == null ? void 0 : t.hoverText;
}};
      }

      &:active {
        color: ${(e) => {
  var t;
  return (t = e.$linkStyle) == null ? void 0 : t.activeText;
}}};
      }
    }
  }
`, Ho = ({
  children: e,
  tooltipTitle: t
}) => t ? /* @__PURE__ */ u(Ye, {
  title: t,
  placement: "topLeft",
  children: e
}) : /* @__PURE__ */ u(L, {
  children: e
});
function Oo(e) {
  const {
    children: t,
    rowStyle: o,
    columnStyle: n,
    tableSize: a,
    autoHeight: i,
    cellColor: s,
    cellTooltip: d,
    ...c
  } = e, p = {
    background: s || n.background,
    margin: n.margin || o.margin,
    text: n.text || o.text,
    border: n.border || o.border,
    borderWidth: o.borderWidth,
    borderStyle: o.borderStyle,
    radius: n.radius || o.radius,
    textSize: n.textSize || o.textSize,
    textWeight: o.textWeight || n.textWeight,
    fontFamily: o.fontFamily || n.fontFamily,
    fontStyle: o.fontStyle || n.fontStyle
  };
  return /* @__PURE__ */ u(Wo, {
    ...c,
    $style: p,
    $defaultThemeDetail: be,
    $tableSize: a,
    $autoHeight: i,
    children: /* @__PURE__ */ u(Ho, {
      tooltipTitle: d,
      children: /* @__PURE__ */ u("div", {
        children: t
      })
    })
  });
}
function gt(e) {
  const {
    columns: t,
    summaryRows: o,
    summaryRowStyle: n,
    tableSize: a,
    expandableRows: i,
    multiSelectEnabled: s,
    istoolbarPositionBelow: d
  } = e;
  let c = t.filter((p) => !p.getView().hide);
  return i && c.unshift(new Y({})), s && c.unshift(new Y({})), c.length ? /* @__PURE__ */ u(ae.Summary, {
    children: Array.from(Array(o)).map((p, b) => /* @__PURE__ */ u(Ao, {
      $istoolbarPositionBelow: d,
      $background: n.background,
      children: c.map(($, g) => {
        const r = $.children.summaryColumns.getView()[b].getView();
        return /* @__PURE__ */ u(Oo, {
          index: g,
          tableSize: a,
          rowStyle: n,
          align: r.align,
          cellColor: r.cellColor,
          cellTooltip: r.cellTooltip,
          columnStyle: {
            background: r.background,
            margin: r.margin,
            text: r.text,
            border: r.border,
            radius: r.radius,
            textSize: r.textSize,
            textWeight: r.textWeight,
            fontStyle: r.fontStyle,
            fontFamily: r.fontFamily
          },
          linkStyle: {
            text: r.linkColor,
            hoverText: r.linkHoverColor,
            activeText: r.linkActiveColor
          },
          children: r.render({}, "").getView().view({})
        }, `summary-${b}-${$.getView().dataIndex}-${g}`);
      })
    }, b))
  }) : /* @__PURE__ */ u(L, {});
}
const wn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  TableSummary: gt
}, Symbol.toStringTag, { value: "Module" })), z = "empty_row";
function P(e) {
  return Xt(e) ? `linear-gradient(${e}, ${e})` : e;
}
const Fo = (e, t, o, n) => {
  const a = P(e.background), i = P(t.selectedRowBackground), s = P(t.hoverRowBackground), d = P(t.alternateBackground);
  return Yt`
    .ant-table-body {
      background: ${P(e.background)};
    }
    .ant-table-tbody {
      > tr:nth-of-type(2n + 1) {
        background: ${P(t.background)};
      }

      > tr:nth-of-type(2n) {
        background: ${d};
      }

      // selected row
      > tr:nth-of-type(2n + 1).ant-table-row-selected {
        background: ${i}, ${t.background} !important;
        > td.ant-table-cell {
          background: transparent !important;
        }

        // > td.ant-table-cell-row-hover,
        &:hover {
          background: ${s}, ${i}, ${t.background} !important;
        }
      }

      > tr:nth-of-type(2n).ant-table-row-selected {
        background: ${i}, ${d} !important;
        > td.ant-table-cell {
          background: transparent !important;
        }

        // > td.ant-table-cell-row-hover,
        &:hover {
          background: ${s}, ${i}, ${d} !important;
        }
      }

      // hover row
      > tr:nth-of-type(2n + 1):hover {
        background: ${s}, ${t.background} !important;
        > td.ant-table-cell-row-hover {
          background: transparent;
        }
      }
      > tr:nth-of-type(2n):hover {
        background: ${s}, ${d} !important;
        > td.ant-table-cell-row-hover {
          background: transparent;
        }
      }

      > tr.ant-table-expanded-row {
        background: ${a};
      }
    }
  `;
}, Mo = v.span`
  position: absolute;
  top: 0;
  right: -5px;
  width: 10px;
  height: 100%;
  cursor: col-resize;
  z-index: 1;
`, Bo = v.div`
  display: flex;
  flex-direction: column;
  background: ${(e) => e.$style.background} !important;
  border-radius: ${(e) => e.$style.radius} !important;
  padding: ${(e) => e.$style.padding} !important;
  margin: ${(e) => e.$style.margin} !important;
  border-style: ${(e) => e.$style.borderStyle} !important;
  border-width: ${(e) => `${e.$style.borderWidth} !important`};
  border-color: ${(e) => `${e.$style.border} !important`};
  height: calc(100% - ${(e) => e.$style.margin && Eo(e.$style.margin.split(" "))});
  overflow: hidden;

  > div.table-scrollbar-wrapper {
    overflow: auto;
    ${(e) => e.$fixedToolbar && "height: auto"};

    ${(e) => (e.$showHorizontalScrollbar || e.$showVerticalScrollbar) && `
      .simplebar-content-wrapper {
        overflow: auto !important;
      }  
    `}

    ${(e) => !e.$showHorizontalScrollbar && `
      div.simplebar-horizontal {
        visibility: hidden !important;
      }  
    `}
    ${(e) => !e.$showVerticalScrollbar && `
      div.simplebar-vertical {
        visibility: hidden !important;
      }  
    `}
  }
`, Po = v.div`
  .ant-table-wrapper {
    border-top: unset;
    border-color: inherit;
  }

  .ant-table-row-expand-icon {
    color: ${Ht};
  }

  .ant-table .ant-table-cell-with-append .ant-table-row-expand-icon {
    margin: 0;
    top: 18px;
    left: 4px;
  }

  .ant-table.ant-table-small .ant-table-cell-with-append .ant-table-row-expand-icon {
    top: 10px;
  }

  .ant-table.ant-table-middle .ant-table-cell-with-append .ant-table-row-expand-icon {
    top: 14px;
    margin-right:5px;
  }

  .ant-table {
    background: ${(e) => e.$style.background};
    .ant-table-container {
      border-left: unset;
      border-top: none !important;
      border-inline-start: none !important;

      &::after {
        box-shadow: none !important;
      }

      .ant-table-content {
        overflow: unset !important
      }

      // A table expand row contains table
      .ant-table-tbody .ant-table-wrapper:only-child .ant-table {
        margin: 0;
      }

      table {
        border-top: unset;

        > .ant-table-thead {
          ${(e) => e.$fixedHeader && `
              position: sticky;
              position: -webkit-sticky;
              // top: ${e.$fixedToolbar ? "47px" : "0"};
              top: 0;
              z-index: 99;
            `}
          > tr {
            background: ${(e) => e.$headerStyle.headerBackground}; 
          }
          > tr > th {
            background: transparent;
            border-color: ${(e) => e.$headerStyle.border};
            border-width: ${(e) => e.$headerStyle.borderWidth};
            color: ${(e) => e.$headerStyle.headerText};
            // border-inline-end: ${(e) => `${e.$headerStyle.borderWidth} solid ${e.$headerStyle.border}`} !important;
            

            > div {
              margin: ${(e) => e.$headerStyle.margin};

              &, .ant-table-column-title > div {
                font-size: ${(e) => e.$headerStyle.textSize};
                font-weight: ${(e) => e.$headerStyle.textWeight};
                font-family: ${(e) => e.$headerStyle.fontFamily};
                font-style: ${(e) => e.$headerStyle.fontStyle};
                color:${(e) => e.$headerStyle.text}
              }
            }

            &:last-child {
              border-inline-end: none !important;
            }
            &.ant-table-column-has-sorters:hover {
              background-color: ${(e) => Ot(e.$headerStyle.headerBackground, 0.05)};
            }
  
            > .ant-table-column-sorters > .ant-table-column-sorter {
              color: ${(e) => e.$headerStyle.headerText === be.textDark ? "#bfbfbf" : e.$headerStyle.headerText};
            }

            &::before {
              background-color: ${(e) => e.$headerStyle.border};
              width: ${(e) => e.$visibleResizables ? "1px" : "0px"} !important;
            }
          }
        }

        > thead > tr > th,
        > tbody > tr > td {
          border-color: ${(e) => e.$headerStyle.border};
          ${(e) => !e.$showHRowGridBorder && "border-bottom: 0px;"}
        }

        td {
          padding: 0px 0px;
          // ${(e) => e.$showHRowGridBorder ? "border-bottom: 1px solid #D7D9E0 !important;" : "border-bottom: 0px;"}
        }

        thead > tr:first-child {
          th:last-child {
            border-right: unset;
          }
        }

        tbody > tr > td:last-child {
          border-right: unset !important;
        }

        .ant-empty-img-simple-g {
          fill: #fff;
        }

        > thead > tr:first-child {
          th:first-child {
            border-top-left-radius: 0px;
          }

          th:last-child {
            border-top-right-radius: 0px;
          }
        }
      }

      .ant-table-expanded-row-fixed:after {
        border-right: unset !important;
      }
    }
  }
  
  ${(e) => e.$style && Fo(e.$style, e.$rowStyle, e.$headerStyle, e.$toolbarStyle)}
`, qe = v.th`
  overflow: hidden;

  > div {
    overflow: hidden;
    white-space: pre;
    text-overflow: ellipsis;
  }

  ${(e) => e.width && `width: ${e.width}px`};
`, Do = v.td`
  .ant-table-row-expand-icon,
  .ant-table-row-indent {
    display: ${(e) => e.$isEditing ? "none" : "initial"};
  }
  &.ant-table-row-expand-icon-cell {
    background: ${(e) => e.$background};
    border-color: ${(e) => e.$style.border};
  }
  background: ${(e) => e.$background} !important;
  border-color: ${(e) => e.$style.border} !important;
  border-radius: ${(e) => e.$style.radius};
  padding: 0 !important;

  > div:not(.editing-border, .editing-wrapper),
  .editing-wrapper .ant-input,
  .editing-wrapper .ant-input-number,
  .editing-wrapper .ant-picker {
    margin: ${(e) => e.$isEditing ? "0px" : e.$style.margin};
    color: ${(e) => e.$style.text};
    font-weight: ${(e) => e.$style.textWeight};
    font-family: ${(e) => e.$style.fontFamily};
    overflow: hidden; 
    ${(e) => e.$tableSize === "small" && `
      padding: 1px 8px;
      font-size: ${e.$defaultThemeDetail.textSize == e.$style.textSize ? "14px !important" : e.$style.textSize + " !important"};
      font-style:${e.$style.fontStyle} !important;
      min-height: ${e.$style.rowHeight || "14px"};
      line-height: 20px;
      ${!e.$autoHeight && `
        overflow-y: auto;
        max-height: ${e.$style.rowHeight || "28px"};
      `};
    `};
    ${(e) => e.$tableSize === "middle" && `
      padding: 8px 8px;
      font-size: ${e.$defaultThemeDetail.textSize == e.$style.textSize ? "16px !important" : e.$style.textSize + " !important"};
      font-style:${e.$style.fontStyle} !important;
      min-height: ${e.$style.rowHeight || "24px"};
      line-height: 24px;
      ${!e.$autoHeight && `
        overflow-y: auto;
        max-height: ${e.$style.rowHeight || "48px"};
      `};
    `};
    ${(e) => e.$tableSize === "large" && `
      padding: 16px 16px;
      font-size: ${e.$defaultThemeDetail.textSize == e.$style.textSize ? "18px !important" : e.$style.textSize + " !important"};
      font-style:${e.$style.fontStyle} !important;
      min-height: ${e.$style.rowHeight || "48px"};
      ${!e.$autoHeight && `
        overflow-y: auto;
        max-height: ${e.$style.rowHeight || "96px"};
      `};
    `};
    
    > .ant-badge > .ant-badge-status-text,
    > div > .markdown-body {
      color: ${(e) => e.$style.text};
    }

    > div > svg g {
      stroke: ${(e) => e.$style.text};
    }

    // dark link|links color
    > a,
    > div  a {
      color: ${(e) => {
  var t;
  return (t = e.$linkStyle) == null ? void 0 : t.text;
}};

      &:hover {
        color: ${(e) => {
  var t;
  return (t = e.$linkStyle) == null ? void 0 : t.hoverText;
}};
      }

      &:active {
        color: ${(e) => {
  var t;
  return (t = e.$linkStyle) == null ? void 0 : t.activeText;
}}};
      }
    }
  }
`, No = v(Ft.Button)`
  width: 90% !important;
  display: table !important;

  .ant-skeleton-button {
    min-width: auto !important;
    display: block !important;
    ${(e) => e.$tableSize === "small" && `
      height: 20px !important;
    `}
    ${(e) => e.$tableSize === "middle" && `
      height: 24px !important;
    `}
    ${(e) => e.$tableSize === "large" && `
      height: 28px !important;
    `}
  }
`, Lo = (e) => {
  const {
    onResize: t,
    onResizeStop: o,
    width: n,
    viewModeResizable: a,
    ...i
  } = e, [s, d] = F(0), c = bo(null), p = Xe(), b = () => {
    n && n > 0 || d(c.current.getBoundingClientRect().width);
  };
  nt(() => {
    c.current && b();
  }, []);
  const $ = f.isNil(i.title);
  return p && !a || $ ? /* @__PURE__ */ u(qe, {
    ref: c,
    ...i,
    width: n
  }) : /* @__PURE__ */ u(Jt, {
    width: n > 0 ? n : s,
    height: 0,
    onResize: (g, {
      size: r
    }) => t(r.width),
    onResizeStart: (g) => {
      b(), g.stopPropagation(), g.preventDefault();
    },
    onResizeStop: o,
    draggableOpts: {
      enableUserSelectHack: !1
    },
    handle: (g, r) => /* @__PURE__ */ u(Mo, {
      ref: r,
      onClick: (x) => {
        x.preventDefault(), x.stopPropagation();
      }
    }),
    children: /* @__PURE__ */ u(qe, {
      ref: c,
      ...i,
      title: ""
    })
  });
};
function jo(e) {
  const {
    record: t,
    title: o,
    rowIndex: n,
    rowColorFn: a,
    rowHeightFn: i,
    cellColorFn: s,
    children: d,
    columnsStyle: c,
    columnStyle: p,
    linkStyle: b,
    tableSize: $,
    autoHeight: g,
    loading: r,
    ...x
  } = e, [l, k] = F(!1), j = re(rt);
  let W;
  if (!t)
    W = /* @__PURE__ */ u("td", {
      ...x,
      children: d
    });
  else {
    const I = a({
      currentRow: t,
      currentIndex: n,
      currentOriginalIndex: t[y],
      columnTitle: o
    }), M = i({
      currentRow: t,
      currentIndex: n,
      currentOriginalIndex: t[y],
      columnTitle: o
    }), E = {
      background: s({
        currentCell: t[o],
        currentRow: t
      }) || I || p.background || c.background,
      margin: p.margin || c.margin,
      text: p.text || c.text,
      border: p.border || c.border,
      radius: p.radius || c.radius,
      // borderWidth: columnStyle.borderWidth || columnsStyle.borderWidth,
      textSize: p.textSize || c.textSize,
      textWeight: c.textWeight || p.textWeight,
      fontFamily: c.fontFamily || p.fontFamily,
      fontStyle: c.fontStyle || p.fontStyle,
      rowHeight: M
    };
    let {
      background: q
    } = E;
    j.hover && (q = "transparent"), W = /* @__PURE__ */ u(Do, {
      ...x,
      $background: q,
      $style: E,
      $defaultThemeDetail: be,
      $linkStyle: b,
      $isEditing: l,
      $tableSize: $,
      $autoHeight: g,
      children: r ? /* @__PURE__ */ u(No, {
        block: !0,
        active: !0,
        $tableSize: $
      }) : d
    });
  }
  return /* @__PURE__ */ u($o.Provider, {
    value: {
      isEditing: l,
      setIsEditing: k
    },
    children: W
  });
}
function qo(e) {
  const [t, o] = F(!1), [n, a] = F(!1);
  return /* @__PURE__ */ u(rt.Provider, {
    value: {
      hover: t,
      selected: n
    },
    children: /* @__PURE__ */ u("tr", {
      ...e,
      tabIndex: -1,
      onMouseEnter: () => o(!0),
      onMouseLeave: () => o(!1),
      onFocus: () => a(!0),
      onBlur: () => a(!1)
    })
  });
}
function mt(e) {
  const [t, o] = F({
    index: -1,
    width: -1
  }), {
    customLoading: n
  } = e, a = e.columns.map((i, s) => {
    const {
      width: d,
      style: c,
      linkStyle: p,
      cellColorFn: b,
      ...$
    } = i, g = (t.index === s ? t.width : i.width) ?? 0;
    let r = "auto", x = U;
    return typeof g == "number" && g > 0 && (x = "unset", r = g), {
      ...$,
      RC_TABLE_INTERNAL_COL_DEFINE: {
        style: {
          minWidth: x,
          width: r
        }
      },
      onCell: (l, k) => ({
        record: l,
        title: String(i.dataIndex),
        rowColorFn: e.rowColorFn,
        rowHeightFn: e.rowHeightFn,
        cellColorFn: b,
        rowIndex: k,
        columnsStyle: e.columnsStyle,
        columnStyle: c,
        linkStyle: p,
        tableSize: e.size,
        autoHeight: e.rowAutoHeight,
        onClick: () => {
          e.onCellClick(i.titleText, String(i.dataIndex));
        },
        loading: n
      }),
      onHeaderCell: () => ({
        width: g,
        title: i.titleText,
        viewModeResizable: e.viewModeResizable,
        onResize: (l) => {
          l && o({
            index: s,
            width: l
          });
        },
        onResizeStop: (l, {
          size: k
        }) => {
          o({
            index: -1,
            width: -1
          }), i.onWidthResize && i.onWidthResize(k.width);
        }
      })
    };
  });
  return /* @__PURE__ */ u(ae, {
    components: {
      header: {
        cell: Lo
      },
      body: {
        cell: jo,
        row: qo
      }
    },
    ...e,
    pagination: !1,
    columns: a,
    scroll: {
      x: U * a.length,
      y: void 0
    }
  });
}
mt.whyDidYouRender = !0;
const pe = (e, t) => {
  const o = {
    [y]: `${z}_${e}`
  };
  return Object.keys(t).forEach((n) => {
    o[n] = "";
  }), o;
};
function Go(e) {
  var ze;
  const [t, o] = F({}), n = re(Mt), a = (ze = re(Bt)) == null ? void 0 : ze.theme, i = a == null ? void 0 : a.showDataLoadingIndicators, {
    width: s,
    ref: d
  } = Pt({
    refreshMode: "debounce",
    refreshRate: 600,
    handleHeight: !1
  }), c = Xe(), p = re(Dt), [b, $] = F(!1), {
    comp: g,
    onDownload: r,
    onRefresh: x
  } = e, l = g.children, k = l.style.getView(), j = l.rowStyle.getView(), W = l.headerStyle.getView(), I = l.toolbarStyle.getView(), M = l.rowAutoHeight.getView(), _ = g.getTableAutoHeight(), E = l.showHorizontalScrollbar.getView(), q = l.showVerticalScrollbar.getView(), $t = l.visibleResizables.getView(), Ct = l.showHRowGridBorder.getView(), St = l.columnsStyle.getView(), vt = l.summaryRowStyle.getView(), $e = w(() => l.columns.getChangeSet(), [l.columns]), X = w(() => l.columns.getChangeSet(!0), [l.columns]), Vt = w(() => !f.isEmpty($e) || !f.isEmpty(X), [$e, X]), J = w(() => l.columns.getView(), [l.columns]), Ce = w(() => J.map((m) => m.getView()), [J]), Z = g.filterData, Se = w(() => l.sort.getView(), [l.sort]), C = w(() => l.toolbar.getView(), [l.toolbar]), Tt = w(() => l.showSummary.getView(), [l.showSummary]), kt = w(() => l.summaryRows.getView(), [l.summaryRows]), se = w(() => l.inlineAddNewRow.getView(), [l.inlineAddNewRow]), O = w(() => l.pagination.getView(), [l.pagination]), de = w(() => l.size.getView(), [l.size]), ve = w(() => l.editModeClicks.getView(), [l.editModeClicks]), Q = w(() => l.onEvent.getView(), [l.onEvent]), Ve = l.dynamicColumn.getView(), Te = w(() => l.dynamicColumnConfig.getView(), [l.dynamicColumnConfig]), ee = g.columnAggrData, ce = w(() => l.expansion.getView(), [l.expansion]), ke = w(() => ut(Ce, Se, C.columnSetting, de, Ve, Te, ee, ve, Q), [Ce, Se, C.columnSetting, de, Ve, Te, ee, ve]), Rt = w(() => ye(l.data.getView()), [l.data]), Re = Ne(() => {
    if (!se) {
      o({}), setTimeout(() => l.columns.dispatchClearInsertSet());
      return;
    }
    let m = {
      ...t
    };
    const T = Object.keys(m), H = T.length, R = Object.keys(X).filter((A) => A.startsWith(z)), Ie = R.length, _e = T.filter((A) => !R.includes(A));
    if (_e.length === H) {
      const K = `${z}_0`;
      o({
        [K]: pe(0, ee)
      });
      const We = document.querySelector(`[data-row-key=${K}]`);
      We && (We.style.display = "");
      return;
    }
    _e.forEach((A) => {
      if (A === T[H - 1] || A === T[H - 2])
        delete m[A];
      else {
        const K = document.querySelector(`[data-row-key=${A}]`);
        K && (K.style.display = "none");
      }
    });
    const Ee = Ie ? R[Ie - 1] : "", Ae = (Ee ? parseInt(Ee.replace(`${z}_`, "")) : -1) + 1, At = `${z}_${Ae}`;
    m[At] = pe(Ae, ee), o(m);
  }, [se, JSON.stringify(X), o, pe]);
  nt(() => {
    Re();
  }, [Re]);
  const ue = w(() => {
    let m = Z, T = O.current;
    const H = O.total || Z.length;
    if (Z.length > O.pageSize) {
      let R = (T - 1) * O.pageSize;
      R >= H && (T = 1, R = 0), m = m.slice(R, R + O.pageSize);
    }
    return {
      total: H,
      current: T,
      data: m
    };
  }, [O, Z]), zt = Nt(g.children);
  Lt(zt, g.dispatch);
  const G = Ne((m) => {
    if (m === "saveChanges" && !l.onEvent.isBind(m)) {
      !c && jt.warning(h("table.saveChangesNotBind"));
      return;
    }
    l.onEvent.getView()(m), setTimeout(() => l.columns.dispatchClearChangeSet());
  }, [c, l.onEvent, l.columns]), te = /* @__PURE__ */ u(So, {
    toolbar: C,
    $style: I,
    pagination: {
      ...O,
      total: ue.total,
      current: ue.current
    },
    columns: J,
    onRefresh: () => x(n.queryCompInfoList().map((m) => m.name), $),
    onDownload: () => {
      G("download"), r(`${p}-data`);
    },
    hasChange: Vt,
    onSaveChanges: () => G("saveChanges"),
    onCancelChanges: () => {
      G("cancelChanges"), se && o({});
    },
    onEvent: Q
  }), It = () => {
    if (Tt)
      return /* @__PURE__ */ u(gt, {
        tableSize: de,
        istoolbarPositionBelow: C.position === "below",
        multiSelectEnabled: l.selection.children.mode.value === "multiple",
        expandableRows: !!ce.expandModalView,
        summaryRows: parseInt(kt),
        columns: J,
        summaryRowStyle: vt
      });
  };
  if (ke.length === 0)
    return /* @__PURE__ */ u(qt, {
      text: h("table.emptyColumns")
    });
  const _t = !E && !q, Et = b || // fixme isLoading type
  (i || l.showDataLoadSpinner.getView()) && l.data.isLoading() || l.loading.getView();
  return /* @__PURE__ */ u(Gt.Provider, {
    value: k.background,
    children: /* @__PURE__ */ N(Bo, {
      ref: d,
      $style: k,
      $tableAutoHeight: _,
      $showHorizontalScrollbar: E,
      $showVerticalScrollbar: q,
      $fixedToolbar: C.fixedToolbar,
      children: [C.position === "above" && (C.fixedToolbar || _ && E) && te, /* @__PURE__ */ u(Kt, {
        className: "table-scrollbar-wrapper",
        style: {
          height: "100%",
          margin: "0px",
          padding: "0px"
        },
        hideScrollbar: _t,
        prefixNode: C.position === "above" && !C.fixedToolbar && !(_ && E) && te,
        suffixNode: C.position === "below" && !C.fixedToolbar && !(_ && E) && te,
        children: /* @__PURE__ */ N(Po, {
          $style: k,
          $rowStyle: j,
          $headerStyle: W,
          $toolbarStyle: I,
          $toolbarPosition: C.position,
          $fixedHeader: l.fixedHeader.getView(),
          $fixedToolbar: C.fixedToolbar && C.position === "above",
          $visibleResizables: $t,
          $showHRowGridBorder: Ct,
          children: [/* @__PURE__ */ u(mt, {
            expandable: {
              ...ce.expandableConfig,
              childrenColumnName: Rt ? V : "OB_CHILDREN_KEY_PLACEHOLDER",
              fixed: "left",
              onExpand: (m) => {
                G(m ? "rowExpand" : "rowShrink");
              }
            },
            rowColorFn: l.rowColor.getView(),
            rowHeightFn: l.rowHeight.getView(),
            ...l.selection.getView()(Q),
            bordered: l.showRowGridBorder.getView(),
            onChange: (m, T, H, R) => {
              ht(m, T, H, R, g.dispatch, Q);
            },
            showHeader: !l.hideHeader.getView(),
            columns: ke,
            columnsStyle: St,
            viewModeResizable: l.viewModeResizable.getView(),
            visibleResizables: l.visibleResizables.getView(),
            dataSource: ue.data.concat(Object.values(t)),
            size: l.size.getView(),
            rowAutoHeight: M,
            tableLayout: "fixed",
            customLoading: Et,
            onCellClick: (m, T) => {
              g.children.selectedCell.dispatchChangeValueAction({
                name: m,
                dataIndex: T
              });
            },
            summary: It
          }), /* @__PURE__ */ u(Ut.Provider, {
            value: {
              modalWidth: s && Math.max(s, 300)
            },
            children: ce.expandModalView
          })]
        })
      }), C.position === "below" && (C.fixedToolbar || _ && E) && te]
    })
  });
}
const yn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  EMPTY_ROW_KEY: z,
  TableCompView: Go
}, Symbol.toStringTag, { value: "Module" })), le = Zt(wo), Ko = [{
  label: h("table.auto"),
  value: "auto"
}, {
  label: h("table.fixed"),
  value: "fixed"
}], Uo = [{
  label: /* @__PURE__ */ u(so, {}),
  value: "left"
}, {
  label: /* @__PURE__ */ u(co, {}),
  value: "close"
}, {
  label: /* @__PURE__ */ u(uo, {}),
  value: "right"
}], bt = h("table.cellColor"), Yo = Je(new we({
  color: Qt
}, (e) => e.color).setPropertyViewFn((e) => e.color.propertyView({
  label: bt,
  tooltip: h("table.cellColorDesc")
})).build());
class fe extends Yo {
  getPropertyView() {
    return ie({
      filterText: bt
    }, super.getPropertyView());
  }
}
const wt = h("table.columnTooltip"), Xo = Je(new we({
  tooltip: D
}, (e) => e.tooltip).setPropertyViewFn((e) => e.tooltip.propertyView({
  label: wt,
  tooltip: fo
})).build());
class xe extends Xo {
  getPropertyView() {
    return ie({
      filterText: wt
    }, super.getPropertyView());
  }
}
const yt = {
  // column title
  title: D,
  titleTooltip: D,
  showTitle: S(oe, !0),
  cellTooltip: xe,
  // a custom column or a data column
  isCustom: He(!1),
  // If it is a data column, it must be the name of the column and cannot be duplicated as a react key
  dataIndex: He(""),
  hide: oe,
  sortable: oe,
  width: eo,
  autoWidth: Oe(Ko, "auto"),
  render: le,
  align: to,
  tempHide: oo(!1),
  fixed: Oe(Uo, "close"),
  editable: oe,
  background: S(B, ""),
  margin: S(ne, ""),
  text: S(B, ""),
  border: S(B, ""),
  borderWidth: S(ne, ""),
  radius: S(ne, ""),
  textSize: S(ne, ""),
  textWeight: S(D, "normal"),
  fontFamily: S(D, "sans-serif"),
  fontStyle: S(D, "normal"),
  cellColor: fe,
  textOverflow: S(yo, "ellipsis"),
  linkColor: S(B, "#3377ff"),
  linkHoverColor: S(B, ""),
  linkActiveColor: S(B, ""),
  summaryColumns: S(ot(xo), [{}, {}, {}])
}, Jo = v(Qe)` width: 24px; margin: 0 8px 0 -3px; padding: 3px;`, Zo = v(Ze)` width: 24px; margin: 0 8px 0 -3px; padding: 3px;`, Qo = v(et)` width: 24px; margin: 0 8px 0 -3px; padding: 3px;`, Ge = v(me)` width: 24px; margin: 0 8px 0 -3px; padding: 3px;`, en = v(tt)` width: 24px; margin: 0 8px 0 -3px; padding: 3px;`;
v(ho)` width: 24px; margin: 0 0px 0 -12px;`;
const tn = new we(yt, (e, t) => ({
  ...e,
  onWidthResize: (o) => {
    t(no({
      width: Fe(o, !0),
      autoWidth: Fe("fixed", !0)
    }));
  }
})).setPropertyViewFn(() => /* @__PURE__ */ u(L, {})).build();
class Y extends tn {
  reduce(t) {
    let o = super.reduce(t);
    if (t.type === Me.UPDATE_NODES_V2 && (o = o.setChild("cellColor", o.children.cellColor.reduce(fe.changeContextDataAction({
      currentCell: void 0,
      currentRow: {}
    }))), o = o.setChild("cellTooltip", o.children.cellTooltip.reduce(xe.changeContextDataAction({
      currentCell: void 0,
      currentRow: {},
      currentIndex: 0
    })))), t.type === Me.CHANGE_VALUE) {
      const n = o.children.title.unevaledValue, a = o.children.dataIndex.getView();
      n || o.children.title.dispatchChangeValueAction(a);
    }
    return o;
  }
  getView() {
    const t = super.getView(), o = this.children.render.getSelectedComp().getComp().children.compType.getView();
    return {
      ...t,
      editable: Le[o].canBeEditable() && t.editable
    };
  }
  exposingNode() {
    const t = this.children.dataIndex.exposingNode(), o = ro(this.children.render.node(), (n) => ({
      wrap: n.__comp__.wrap,
      map: f.mapValues(n.__map__, (a) => a.comp)
    }));
    return ge({
      dataIndex: t,
      render: o
    });
  }
  propertyView(t, o, n) {
    var p, b, $;
    const a = this.children.render.getSelectedComp().getComp().children.compType.getView(), i = ((p = this.children.render.getSelectedComp().getParams()) == null ? void 0 : p.initialColumns) || [], s = this.children.render.getSelectedComp().getComp().toJsonValue();
    let d = "{{currentCell}}";
    (b = s.comp) != null && b.hasOwnProperty("src") ? d = s.comp.src : ($ = s.comp) != null && $.hasOwnProperty("text") && (d = s.comp.text);
    const c = this.children.summaryColumns.getView();
    return /* @__PURE__ */ N(L, {
      children: [o === "summary" && c[n].propertyView(""), o === "normal" && /* @__PURE__ */ N(L, {
        children: [this.children.title.propertyView({
          label: h("table.columnTitle"),
          placeholder: this.children.dataIndex.getView()
        }), this.children.titleTooltip.propertyView({
          label: h("table.columnTitleTooltip")
        }), this.children.cellTooltip.getPropertyView(), /* @__PURE__ */ u(io, {
          showSearch: !0,
          defaultValue: d,
          options: i,
          label: h("table.dataMapping"),
          onChange: (g) => {
            const r = a;
            let x = {
              text: g
            };
            a === "image" && (x = {
              src: g
            }), this.children.render.dispatchChangeValueAction({
              compType: r,
              comp: x
            });
          }
        }), this.children.render.getPropertyView(), this.children.showTitle.propertyView({
          label: h("table.showTitle"),
          tooltip: h("table.showTitleTooltip")
        }), Le[a].canBeEditable() && this.children.editable.propertyView({
          label: h("table.editable")
        }), this.children.sortable.propertyView({
          label: h("table.sortable")
        }), this.children.hide.propertyView({
          label: h("prop.hide")
        }), this.children.align.propertyView({
          label: h("table.align"),
          radioButton: !0
        }), this.children.fixed.propertyView({
          label: h("table.fixedColumn"),
          radioButton: !0
        }), this.children.autoWidth.propertyView({
          label: h("table.autoWidth"),
          radioButton: !0
        }), this.children.autoWidth.getView() === "fixed" && this.children.width.propertyView({
          label: h("prop.width")
        }), (a === "link" || a === "links") && /* @__PURE__ */ N(L, {
          children: [/* @__PURE__ */ u(Be, {
            style: {
              margin: "12px 0"
            }
          }), ie({}, /* @__PURE__ */ u("div", {
            children: /* @__PURE__ */ u("b", {
              children: "Link Style"
            })
          })), this.children.linkColor.propertyView({
            label: h("text")
            // trans('style.background'),
          }), this.children.linkHoverColor.propertyView({
            label: "Hover text"
            // trans('style.background'),
          }), this.children.linkActiveColor.propertyView({
            label: "Active text"
            // trans('style.background'),
          })]
        }), /* @__PURE__ */ u(Be, {
          style: {
            margin: "12px 0"
          }
        }), ie({}, /* @__PURE__ */ u("div", {
          children: /* @__PURE__ */ u("b", {
            children: "Column Style"
          })
        })), this.children.background.propertyView({
          label: h("style.background")
        }), a !== "link" && this.children.text.propertyView({
          label: h("text")
        }), this.children.border.propertyView({
          label: h("style.border")
        }), this.children.borderWidth.propertyView({
          label: h("style.borderWidth"),
          preInputNode: /* @__PURE__ */ u(Zo, {
            as: Ze,
            title: ""
          }),
          placeholder: "1px"
        }), this.children.radius.propertyView({
          label: h("style.borderRadius"),
          preInputNode: /* @__PURE__ */ u(Jo, {
            as: Qe,
            title: ""
          }),
          placeholder: "3px"
        }), this.children.textSize.propertyView({
          label: h("style.textSize"),
          preInputNode: /* @__PURE__ */ u(Qo, {
            as: et,
            title: ""
          }),
          placeholder: "14px"
        }), this.children.textWeight.propertyView({
          label: h("style.textWeight"),
          preInputNode: /* @__PURE__ */ u(en, {
            as: tt,
            title: ""
          }),
          placeholder: "normal"
        }), this.children.fontFamily.propertyView({
          label: h("style.fontFamily"),
          preInputNode: /* @__PURE__ */ u(Ge, {
            as: me,
            title: ""
          }),
          placeholder: "sans-serif"
        }), this.children.fontStyle.propertyView({
          label: h("style.fontStyle"),
          preInputNode: /* @__PURE__ */ u(Ge, {
            as: me,
            title: ""
          }),
          placeholder: "normal"
        }), this.children.textOverflow.getPropertyView(), this.children.cellColor.getPropertyView()]
      })]
    });
  }
  getChangeSet() {
    const t = this.children.dataIndex.getView(), o = f.mapValues(this.children.render.getMap(), (n) => n.getComp().children.comp.children.changeValue.getView());
    return {
      [t]: o
    };
  }
  dispatchClearChangeSet() {
    this.children.render.dispatch(lo(le.forEachAction(he("comp", he("comp", Ue("changeValue", null, !1))))));
  }
  dispatchClearInsertSet() {
    const t = this.children.render.getMap();
    Object.keys(t).filter((n) => n.startsWith(z)).forEach((n) => {
      t[n].getComp().children.comp.children.changeValue.dispatchChangeValueAction(null);
    });
  }
  static setSelectionAction(t) {
    return he("render", le.setSelectionAction(t));
  }
}
function on() {
  return {
    title: h("table.customColumn"),
    dataIndex: ao(),
    isCustom: !0
  };
}
function ft(e, t, o, n) {
  return {
    title: o ?? e,
    dataIndex: e,
    isCustom: !1,
    autoWidth: "fixed",
    width: t + "",
    render: {
      compType: n ? "tag" : "text",
      comp: {
        text: "{{currentCell}}"
      }
    }
  };
}
const fn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  CellColorComp: fe,
  CellTooltipComp: xe,
  ColumnComp: Y,
  RenderComp: le,
  columnChildrenMap: yt,
  newCustomColumn: on,
  newPrimaryColumn: ft
}, Symbol.toStringTag, { value: "Module" })), nn = ot(Y);
function xt(e) {
  if (e.length <= 0 || typeof e[0] == "string")
    return;
  const t = {};
  return e.slice(0, 50).forEach((o) => {
    Object.keys(o).forEach((n) => {
      t.hasOwnProperty(n) || (t[n] = o[n]);
    });
  }), t;
}
class rn extends nn {
  reduce(t) {
    if (po(t, "dataChanged")) {
      const o = t.value.rowExample, {
        readOnly: n
      } = mo();
      let a = this;
      if (t.value.doGeneColumn && (t.value.dynamicColumn || !n)) {
        const i = this.geneColumnsAction(o, t.value.data);
        a = this.reduce(this.multiAction(i));
      }
      return a;
    }
    return super.reduce(t);
  }
  getChangeSet(t) {
    const o = {};
    return this.getView().forEach((a) => {
      const i = a.getChangeSet();
      Object.keys(i).forEach((s) => {
        Object.keys(i[s]).forEach((d) => {
          const c = t ? d.startsWith(z) : !d.startsWith(z);
          !f.isNil(i[s][d]) && c && (o[d] || (o[d] = {}), o[d][s] = i[s][d]);
        });
      });
    }), o;
  }
  dispatchClearChangeSet() {
    this.getView().forEach((o) => o.dispatchClearChangeSet());
  }
  dispatchClearInsertSet() {
    this.getView().forEach((o) => o.dispatchClearInsertSet());
  }
  /**
   * If the table data changes, call this method to trigger the action
   */
  dataChangedAction(t) {
    return go({
      type: "dataChanged",
      ...t
    }, !0);
  }
  /**
   * According to the data, adjust the column
   */
  geneColumnsAction(t, o) {
    if (t == null)
      return [];
    const n = Object.keys(t);
    if (n.length === 0)
      return [];
    const a = this.getView(), i = [];
    let s = 0;
    return a.forEach((d, c) => {
      if (d.getView().isCustom)
        return;
      const p = d.getView().dataIndex;
      (p === V || !n.find((b) => p === b)) && (i.push(this.deleteAction(c - s)), s += 1);
    }), n.forEach((d) => {
      d === V && ye(o) || a.find((c) => c.getView().dataIndex === d) || i.push(this.pushAction(ft(d, pt(d, o))));
    }), i.length === 0 ? [] : i;
  }
  withParamsNode() {
    const t = this.getView(), o = f(t).map((a) => a.children.render.getOriginalComp().node()).toPairs().fromPairs().value();
    return Pe(this, "withParamsNode", [ge(o), o], (a, i) => De(a[1], i[1]))[0];
  }
  getColumnsNode(t) {
    const o = this.getView(), n = f(o).map((i) => i.children[t].node()).toPairs().fromPairs().value();
    return Pe(this, "col_nodes_" + t, [ge(n), n], (i, s) => De(i[1], s[1]))[0];
  }
  setSelectionAction(t) {
    return this.forEachAction(Y.setSelectionAction(t));
  }
}
const xn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  ColumnListComp: rn,
  tableDataRowExample: xt
}, Symbol.toStringTag, { value: "Module" }));
export {
  Y as C,
  z as E,
  y as O,
  le as R,
  Go as T,
  st as a,
  dt as b,
  pt as c,
  Ro as d,
  lt as e,
  To as f,
  _o as g,
  ct as h,
  V as i,
  on as j,
  rn as k,
  ut as l,
  bn as m,
  ft as n,
  wn as o,
  yn as p,
  fn as q,
  xn as r,
  ko as s,
  xt as t
};
