import { a0 as l, fw as w, ea as c, bb as a, a as s } from "./684d2f28.js";
import { O as u } from "./bdf03194.js";
import "react";
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 y = [{
  label: l("selectionControl.single"),
  value: "single"
}, {
  label: l("selectionControl.multiple"),
  value: "multiple"
}, {
  label: l("selectionControl.close"),
  value: "close"
}];
function i(r) {
  return r[u];
}
function E(r) {
  switch (r.children.mode.getView()) {
    case "single":
      return [r.children.selectedRowKey.getView()];
    case "multiple":
      return r.children.selectedRowKeys.getView();
  }
  return [];
}
const ee = function() {
  const r = {
    mode: a(y, "single"),
    selectedRowKey: s("0"),
    selectedRowKeys: s([])
  };
  return new w(r, (e, m) => {
    const n = (t) => {
      i(t) !== e.selectedRowKey && m(c("selectedRowKey", i(t), !1));
    };
    return (t) => {
      if (e.mode === "single" || e.mode === "close")
        return {
          rowKey: i,
          rowClassName: (o, d, C) => e.mode === "close" ? "" : i(o) === e.selectedRowKey ? "ant-table-row-selected" : "",
          onRow: (o, d) => ({
            onClick: () => {
              n(o), t("rowClick"), i(o) !== e.selectedRowKey && t("rowSelectChange");
            }
          })
        };
      const p = {
        type: "checkbox",
        selectedRowKeys: e.selectedRowKeys,
        preserveSelectedRowKeys: !0,
        onChange: (o) => {
          m(c("selectedRowKeys", o, !1)), t("rowSelectChange");
        },
        // click checkbox also trigger row click event
        onSelect: (o) => {
          n(o), t("rowClick");
        }
      };
      return {
        rowKey: i,
        rowSelection: p,
        onRow: (o) => ({
          onClick: () => {
            n(o), t("rowClick");
          }
        })
      };
    };
  }).setPropertyViewFn((e) => e.mode.propertyView({
    label: l("selectionControl.mode"),
    radioButton: !0
  })).build();
}();
export {
  ee as SelectionControl,
  E as getSelectedRowKeys
};
