import { a3 as r, dp as h, g9 as u, _ as p, ad as b, H as i, ga as f, gb as g, gc as w, gd as c } from "./56c67d3b.js";
import "react";
import "react-dom";
const x = r.div`
  flex-shrink: 0;
  width: ${(n) => n.$placement === "right" ? "96px" : "112px"};
`, v = r.div`
  ${h};
  width: 100%;
  font-size: 13px;
  line-height: 15px;
`, C = r.div`
  display: flex;
  justify-content: space-between;
  width: 100%;
  flex-direction: row;
  align-items: center;

  .ant-select .ant-select-selector {
    margin: 0;
  }

  .ant-select-selection-item {
    height: 26px;
  }
`;
function V(n, d) {
  return class extends u {
    getDefaultValue() {
      return d;
    }
    propertyView(e) {
      const {
        placement: a = "right"
      } = e, s = p.fromPairs(n.map((l) => [l.value, l]));
      return /* @__PURE__ */ b(C, {
        children: [e.label && /* @__PURE__ */ i(x, {
          $placement: a,
          children: /* @__PURE__ */ i(f, {
            title: e.tooltip,
            label: e.label
          })
        }), /* @__PURE__ */ i(g, {
          title: e.label ? void 0 : e.tooltip,
          children: /* @__PURE__ */ i(w, {
            $placement: a,
            children: /* @__PURE__ */ i(c, {
              mode: "multiple",
              popupClassName: "ob-dropdown-control-select",
              filterOption: (l, t) => {
                if (!(t != null && t.value))
                  return !1;
                const o = s[t.value].label;
                return typeof o == "number" || typeof o == "string" || typeof o == "boolean" ? o.toString().toLowerCase().includes(l) : !1;
              },
              border: e.border,
              defaultValue: this.getDefaultValue(),
              value: this.value,
              style: {
                width: "100%"
              },
              onChange: (l) => {
                var t;
                e.disableDispatchValueChange || this.dispatchChangeValueAction(l), (t = e.onChange) == null || t.call(e, l);
              },
              disabled: e.disabled,
              allowClear: !0,
              placeholder: e.placeholder,
              optionLabelProp: "children",
              children: n.map((l) => /* @__PURE__ */ i(c.Option, {
                value: l.value,
                children: /* @__PURE__ */ i(v, {
                  children: l.label
                })
              }, l.value))
            })
          })
        })]
      });
    }
    getPropertyView() {
      throw new Error("Method not implemented.");
    }
  };
}
export {
  V as multiSelectControl
};
