var d = Object.defineProperty;
var f = (i, s, e) => s in i ? d(i, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[s] = e;
var l = (i, s, e) => (f(i, typeof s != "symbol" ? s + "" : s, e), e);
import { H as m, he as c, fI as y, hf as E, hg as p, e0 as a, cc as g, cd as C, M as Q } from "./56c67d3b.js";
import { Fragment as A } from "react";
import "react-dom";
const x = new Q({}, (i) => i).build();
class w extends x {
  constructor(e) {
    super(e);
    l(this, "params", {});
    l(this, "inputs", []);
    this.params = e;
  }
  getView() {
    return this.children;
  }
  getPropertyView() {
    return this.inputs.length === 0 ? null : this.inputs.map(({
      name: e,
      description: t
    }) => {
      const u = this.children[e];
      return u ? /* @__PURE__ */ m(A, {
        children: u.propertyView({
          label: e,
          tooltip: t,
          layout: "vertical"
        })
      }, e) : null;
    });
  }
  setInputs(e) {
    const t = {};
    e.forEach(({
      name: n,
      type: r
    }) => {
      c[r] && (t[n] = c[r]);
    });
    const u = y(this.params, t);
    return E(this, {
      children: u,
      inputs: e
    });
  }
  getInputNodes() {
    const e = {};
    return this.inputs.forEach(({
      name: t,
      type: u
    }) => {
      const n = this.children[t];
      if (n) {
        if (u === p.Query) {
          const r = n.children.value.getView();
          if (!r)
            return;
          e[t] = r;
          return;
        }
        if (n.unevaledValue) {
          const r = n.node();
          r && (e[t] = r);
        }
      }
    }), e;
  }
  getInputQueryExecAction(e) {
    var r;
    if (e.type !== a.ROUTE_BY_NAME || e.action.type !== a.EXECUTE_QUERY)
      return null;
    const t = e.name;
    if (!this.inputs.some(({
      name: o,
      type: h
    }) => t === o && h === p.Query))
      return null;
    const n = (r = Object.entries(this.children).find(([o]) => o === t)) == null ? void 0 : r[1];
    return n ? g(n.getView().value, C(e.action)) : null;
  }
}
export {
  w as default
};
