import { K as N, D as _, M as L, N as E, O as V, Q as c, V as m, H as A, j as d, W as O, X as W, Y as w, Z as b, $ as j } from "./index-b203ecbb.js";
import { useMemo as u, useCallback as o } from "react";
import { r as P, g as M } from "./util-63c4ca8a.js";
import "react-dom";
const U = N`
  width: 100%;
  padding: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
`, Y = N`
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
`, k = (h) => {
  const {
    className: g,
    placeholder: f,
    attrName: a,
    handleUpdateDsl: p,
    value: n,
    widgetDisplayName: l,
    labelName: y,
    detailedDescription: C,
    labelDesc: I,
    widgetType: i
  } = h, r = _(
    L
  ), s = u(() => {
    const e = Object.keys(r);
    for (let t = 0; t < e.length; t++)
      if (r[e[t]].includes(l))
        return e[t];
    return "";
  }, [r, l]), x = u(() => {
    let e = n;
    return s && (e = P(n, s)), E(e, !0);
  }, [s, n]), D = o(
    (e) => {
      let t = e;
      s && V(e ?? "") && e.includes("currentItem") && (t = M(e, s)), t = j(t, !0), p(a, t);
    },
    [a, s, p]
  ), S = o(() => {
    c(m.FOCUS, {
      element: "component_inspect_code_mirror",
      parameter1: i,
      parameter2: a
    });
  }, [a, i]), T = o(
    (e) => {
      c(m.BLUR, {
        element: "component_inspect_code_mirror",
        parameter1: i,
        parameter2: a,
        parameter3: e.length
      });
    },
    [a, i]
  );
  return /* @__PURE__ */ A("div", { css: U, children: [
    /* @__PURE__ */ d("div", { css: Y, children: "docIcon" }),
    /* @__PURE__ */ d(
      b,
      {
        scopeOfAutoComplete: "page",
        className: g,
        value: x,
        onChange: D,
        showLineNumbers: !1,
        placeholder: f,
        expectValueType: O.STRING,
        lang: W.JAVASCRIPT,
        maxHeight: "208px",
        minHeight: "120px",
        maxWidth: "100%",
        codeType: w.FUNCTION,
        modalTitle: y,
        canShowCompleteInfo: !0,
        modalDescription: C ?? I,
        onFocus: S,
        onBlur: T
      }
    )
  ] });
};
k.displayName = "BaseInput";
export {
  k as default
};
//# sourceMappingURL=index-e8a7c87c.js.map
