import { q as s, a0 as n, gr as m, bv as d, P as c, bh as u, c1 as g, gs as x, V as i, d8 as C, d5 as b, d7 as w, db as V } from "./684d2f28.js";
import { SlotControl as f } from "./36711569.js";
import { useContext as h } from "react";
import { O as r } from "./bdf03194.js";
import "react-dom";
import "./0667825e.js";
import "./49a8125c.js";
import "./7281819e.js";
import "./9869e60a.js";
import "./b1144c16.js";
import "./d404aae1.js";
import "./926d8ea1.js";
import "./d6402597.js";
import "./7a630f06.js";
import "./d883a28b.js";
import "./6be5dc74.js";
import "./1312a48b.js";
import "./00dac55d.js";
import "./622ce240.js";
import "./0c4ef413.js";
import "./b8f8370b.js";
import "./ca17ca0f.js";
import "./d9d1e856.js";
import "./6538ec2e.js";
import "./226f78bd.js";
import "./8e06f4ed.js";
import "./a014bc57.js";
import "./6cf5f7c0.js";
import "./7f2964c3.js";
import "./602ac28f.js";
import "./f9c25fbe.js";
import "./2d5fc5ff.js";
import "./0f3d7a1a.js";
import "./698a4355.js";
import "./cf2c1864.js";
import "./fcd1d96f.js";
import "./6cb1f6af.js";
const a = s(f), S = (o) => /* @__PURE__ */ i(V, {
  ...o,
  emptyRows: 15,
  autoHeight: !0
});
function I(o) {
  const {
    containerProps: t
  } = o, e = h(b);
  return /* @__PURE__ */ i(S, {
    ...t,
    isDroppable: !1,
    isDraggable: !1,
    isResizable: !1,
    isSelectable: !1,
    bgColor: e,
    items: w(t.items),
    hintPlaceholder: "",
    containerPadding: [4, 4]
  });
}
let P = function() {
  const o = n("table.expandable");
  return new m({
    expandable: d,
    slot: a
  }, () => ({
    expandableConfig: {},
    expandModalView: null
  })).setControlItemData({
    filterText: o
  }).setPropertyViewFn((t, e) => /* @__PURE__ */ c(u, {
    children: [t.expandable.propertyView({
      label: o
    }), t.expandable.getView() && t.slot.getSelectedComp().getComp().propertyView({
      buttonText: n("table.configExpandedView")
    })]
  })).build();
}();
class st extends P {
  getView() {
    if (!this.children.expandable.getView())
      return {
        expandableConfig: {},
        expandModalView: null
      };
    const t = this.children.slot.getSelectedComp();
    return {
      expandableConfig: {
        expandedRowRender: (e, p) => {
          const l = this.children.slot.getView()({
            currentRow: g.omit(e, r),
            currentIndex: p,
            currentOriginalIndex: x(e[r])
          }, String(e[r])).children.container.getView();
          return /* @__PURE__ */ i(I, {
            containerProps: l
          }, e[r]);
        }
      },
      expandModalView: t.getView()
    };
  }
  setSelectionAction(t, e) {
    return C("slot", a.setSelectionAction(t, e));
  }
  getPasteValue(t) {
    return {
      ...this.toJsonValue(),
      slot: this.children.slot.getSelectedComp().getComp().getPasteValue(t)
    };
  }
  reduce(t) {
    return super.reduce(t);
  }
}
export {
  st as ExpansionControl
};
