import { iw as e, ix as t, iy as n, iz as a, iA as i, iB as r, iC as o, iD as l, iE as s, iF as d, iG as g, iH as c, iI as p, iJ as m, iK as u, iL as h, iM as y, iN as v, g2 as f, cr as b, dV as x, fu as C, iO as k, ge as I, g3 as S, g5 as B, g6 as j, av as N, g7 as w, gb as K, gc as E, gd as T } from "./index-f50c05c4.js";
import { useState as R, useEffect as P, useContext as A, useRef as U, useCallback as V, useMemo as $ } from "react";
import { lR as z, lA as L, lS as D, nn as F } from "./ant-design-icons-b1480d8d.js";
import { _ as H, g as O } from "./lodash-f1e42446.js";
import { d as W } from "./styled-components-1e696d6b.js";
import { D as q, C as M, N as X } from "./styledComponents-d8f6d0ac.js";
import { z as Y, o as G, B as J, F as Q, M as Z, E as _, S as ee, I as te, G as ne, D as ae } from "./antd-04a23d13.js";
import "./axios-84bb1c75.js";
import "./redux-devtools-d38e5b33.js";
import "./alasql-0ff6dabf.js";
import "./react-router-a1807b5b.js";
import "./fontawesome-2445f580.js";
import "react-dom";
import "./dnd-kit-56a2f36f.js";
import "./dayjs-844325ae.js";
import "./numbro-c1edb412.js";
import "./papaparse-1bac8e5f.js";
import "./uuid-82f303b2.js";
import "./supabase-c27c62e3.js";
import "./fetch-a3c8ad94.js";
import "./react-draggable-60f59f09.js";
import "./remark-gfm-f2973785.js";
import "./buffer-d3713d77.js";
import "./rehype-raw-41b6145f.js";
import "./parse5-6476676e.js";
import "./rehype-sanitize-deb53e9a.js";
import "./simplebar-react-e1b123a3.js";
import "./react-best-gradient-color-picker-4dd60dac.js";
import "./ua-parser-js-094f59ba.js";
import "./clsx-469c2c43.js";
import "./loglevel-6fb66d22.js";
import "./crypto-js-d5eac8ba.js";
import "./codemirror-73d8c217.js";
import "./really-relaxed-json-49b6a70d.js";
import "./immer-c0428a8d.js";
import "./redux-saga-5514e228.js";
import "./hotkeys-js-0dddb21a.js";
import "./cnchar-5678e6bc.js";
import "./react-documents-eb6de859.js";
import "./sql-formatter-69e8df59.js";
import "./rc-trigger-5125aafe.js";
import "./react-json-view-9403d8a1.js";
import "./qrcode-react-cb73d2b6.js";
import "./katex-a34f0265.js";
import "./ecogis-maps-bb0d63f9.js";
import "./devextreme-2fa5bb9a.js";
function ie(f2) {
  const { themeSettingKey: b2, name: x2, desc: C2, color: k2, radius: I2, configChange: S2, showVarName: B2 = true, margin: j2, padding: N2, borderStyle: w2, borderWidth: K2, borderColor: E2, fontFamily: T2, showComponentLoadingIndicators: A2, showDataLoadingIndicators: U2, dataLoadingIndicator: V2, gridColumns: $2, gridRowHeight: D2, gridRowCount: F2, gridPaddingX: O2, gridPaddingY: W2, gridBgImage: q2, gridBgImageRepeat: M2, gridBgImageSize: X2, gridBgImagePosition: Q2, gridBgImageOrigin: Z2 } = f2, _2 = H.debounce(S2, 0), [ee2, te2] = R(k2), [ne2, ae2] = R(I2), [ie2, re2] = R(j2), [oe2, le2] = R(N2), [se2, de] = R(w2), [ge, ce] = R(K2), [pe, me] = R(E2), [ue, he] = R(T2), [ye, ve] = R(A2), [fe, be] = R(U2), [xe, Ce] = R(V2), [ke, Ie] = R($2), [Se, Be] = R(D2), [je, Ne] = R(F2), [we, Ke] = R(O2), [Ee, Te] = R(W2), [Re, Pe] = R(q2), [Ae, Ue] = R(M2), [Ve, $e] = R(X2), [ze, Le] = R(Q2), [De, Fe] = R(Z2), He = `(${b2})`, Oe = () => {
    ee2 && e(ee2) && t(ee2) ? t(ee2) ? (te2(ee2), S2({ themeSettingKey: b2, color: ee2 })) : (te2(v(ee2)), S2({ themeSettingKey: b2, color: v(ee2) })) : te2(k2);
  }, We = (e2) => {
    let t2 = "";
    t2 = e2 && 0 !== Number(e2) ? /^[0-9]+$/.test(e2) ? Number(e2) + "px" : /^[0-9]+(px|%)$/.test(e2) ? e2 : "0" : "0", ae2(t2), S2({ themeSettingKey: b2, radius: t2 });
  }, qe = (e2) => {
    let t2 = "";
    t2 = e2 && 0 !== Number(e2) ? /^[0-9]+$/.test(e2) ? Number(e2) + "px" : /^[0-9]+(px|%)$/.test(e2) ? e2 : "3px" : "0", re2(t2), S2({ themeSettingKey: b2, margin: t2 });
  }, Me = (e2) => {
    let t2 = "";
    t2 = e2 && 0 !== Number(e2) ? /^[0-9]+$/.test(e2) ? Number(e2) + "px" : /^[0-9]+(px|%)$/.test(e2) ? e2 : "3px" : "0", le2(t2), S2({ themeSettingKey: b2, padding: t2 });
  }, Xe = (e2) => {
    let t2 = "";
    t2 = e2 || "solid", de(t2), S2({ themeSettingKey: b2, borderStyle: t2 });
  }, Ye = (e2) => {
    let t2 = "";
    t2 = e2 && 0 !== Number(e2) ? /^[0-9]+$/.test(e2) ? Number(e2) + "px" : /^[0-9]+(px|%)$/.test(e2) ? e2 : "1px" : "0", ce(e2), S2({ themeSettingKey: b2, borderWidth: t2 });
  }, Ge = (e2) => {
    let t2 = "";
    t2 = e2 || "Roboto, sans-serif", he(t2), S2({ themeSettingKey: b2, fontFamily: t2 });
  }, Je = (e2) => {
    let t2 = "";
    if (t2 = e2 || ("gridRowHeight" === b2 ? "8" : "24"), "gridRowHeight" === b2)
      return Be(t2), void S2({ themeSettingKey: b2, gridRowHeight: t2 });
    Ie(t2), S2({ themeSettingKey: b2, gridColumns: t2 });
  }, Qe = (e2) => {
    let t2 = 1 / 0;
    "" !== e2 && (t2 = Number(e2)), Ne(t2), S2({ themeSettingKey: b2, gridRowCount: t2 });
  }, Ze = (e2) => {
    let t2 = 20;
    return "" !== e2 && (t2 = Number(e2)), "gridPaddingX" === b2 ? (Ke(t2), void S2({ themeSettingKey: b2, gridPaddingX: t2 })) : "gridPaddingY" === b2 ? (Te(t2), void S2({ themeSettingKey: b2, gridPaddingY: t2 })) : void 0;
  }, _e = (e2) => {
    switch (b2) {
      case "gridBgImage":
        Pe(e2), S2({ themeSettingKey: b2, gridBgImage: e2 });
        break;
      case "gridBgImageRepeat":
        Ue(e2 || "no-repeat"), S2({ themeSettingKey: b2, gridBgImageRepeat: e2 });
        break;
      case "gridBgImageSize":
        $e(e2 || "cover"), S2({ themeSettingKey: b2, gridBgImageSize: e2 });
        break;
      case "gridBgImagePosition":
        Le(e2 || "center"), S2({ themeSettingKey: b2, gridBgImagePosition: e2 });
        break;
      case "gridBgImageOrigin":
        Fe(e2 || "padding-box"), S2({ themeSettingKey: b2, gridBgImageOrigin: e2 });
    }
  };
  return P(() => {
    ee2 && (e(ee2) || t(ee2)) && _2({ themeSettingKey: b2, color: ee2 });
  }, [ee2]), P(() => {
    te2(k2);
  }, [k2]), P(() => {
    ae2(I2);
  }, [I2]), P(() => {
    re2(j2);
  }, [j2]), P(() => {
    le2(N2);
  }, [N2]), P(() => {
    Ie($2);
  }, [$2]), P(() => {
    Ne(F2);
  }, [F2]), P(() => {
    de(w2);
  }, [w2]), P(() => {
    ce(K2);
  }, [K2]), P(() => {
    me(E2);
  }, [E2]), P(() => {
    he(T2);
  }, [T2]), P(() => {
    ve(A2);
  }, [A2]), P(() => {
    be(U2);
  }, [U2]), P(() => {
    Ce(V2);
  }, [V2]), P(() => {
    Ke(O2);
  }, [O2]), P(() => {
    Te(W2);
  }, [W2]), z(n, { className: f2.className, children: ["showDataLoadingIndicators" !== b2 && "showComponentLoadingIndicators" !== b2 && z("div", { className: "text-desc", children: [z("div", { className: "name", children: [x2, " ", B2 && L("span", { children: He })] }), L("div", { className: "desc", children: C2 })] }), "radius" !== b2 && "margin" !== b2 && "padding" !== b2 && "borderStyle" !== b2 && "borderWidth" !== b2 && "fontFamily" !== b2 && "showComponentLoadingIndicators" !== b2 && "showDataLoadingIndicators" !== b2 && "dataLoadingIndicator" !== b2 && "gridColumns" !== b2 && "gridRowHeight" !== b2 && "gridRowCount" !== b2 && "gridPaddingX" !== b2 && "gridPaddingY" !== b2 && "gridBgImage" !== b2 && "gridBgImageRepeat" !== b2 && "gridBgImageSize" !== b2 && "gridBgImagePosition" !== b2 && "gridBgImageOrigin" !== b2 && z("div", { className: "config-input", children: [L(a, { changeColor: te2, color: ee2, trigger: "hover", allowGradient: "canvas" === b2 || "primarySurface" === b2 }), L(i, { value: ee2, onChange: (e2) => te2(e2.target.value), onBlur: Oe, onKeyUp: (e2) => "Enter" === e2.nativeEvent.key && Oe() })] }), "radius" === b2 && z("div", { className: "config-input", children: [L(r, { $radius: I2 || "0", children: L("div", { children: L(o, { style: { width: "16px", margin: "-2px 0 2px -2px", padding: "0px" } }) }) }), L(i, { value: ne2, onChange: (e2) => ae2(e2.target.value), onBlur: (e2) => We(e2.target.value), onKeyUp: (e2) => "Enter" === e2.nativeEvent.key && We(e2.currentTarget.value) })] }), "borderStyle" === b2 && z("div", { className: "config-input", children: [L(l, { $borderStyle: w2 || "solid", children: L("div", { children: L(s, { style: { width: "16px", margin: "2px 0 0 2px", padding: "0px" } }) }) }), L(i, { value: se2, onChange: (e2) => de(e2.target.value), onBlur: (e2) => Xe(e2.target.value), onKeyUp: (e2) => "Enter" === e2.nativeEvent.key && Xe(e2.currentTarget.value) })] }), "borderWidth" === b2 && z("div", { className: "config-input", children: [L(d, { $borderWidth: K2 || "1px", children: L("div", { children: L(g, { style: { width: "16px", margin: "2px 0 0 2px", padding: "0px" } }) }) }), L(i, { value: ge, onChange: (e2) => ce(e2.target.value), onBlur: (e2) => Ye(e2.target.value), onKeyUp: (e2) => "Enter" === e2.nativeEvent.key && Ye(e2.currentTarget.value) })] }), "margin" === b2 && z("div", { className: "config-input", children: [L(c, { $margin: j2 || "4px", children: L("div", { children: L(p, { title: "" }) }) }), L(i, { value: ie2, onChange: (e2) => re2(e2.target.value), onBlur: (e2) => qe(e2.target.value), onKeyUp: (e2) => "Enter" === e2.nativeEvent.key && qe(e2.currentTarget.value) })] }), "padding" === b2 && z("div", { className: "config-input", children: [L(m, { $padding: N2 || "4px", children: L("div", { children: L(u, { title: "" }) }) }), L(i, { value: oe2, onChange: (e2) => le2(e2.target.value), onBlur: (e2) => Me(e2.target.value), onKeyUp: (e2) => "Enter" === e2.nativeEvent.key && Me(e2.currentTarget.value) })] }), "fontFamily" === b2 && L("div", { className: "config-input", children: L(i, { value: ue, onChange: (e2) => he(e2.target.value), onBlur: (e2) => Ge(e2.target.value), onKeyUp: (e2) => "Enter" === e2.nativeEvent.key && Ge(e2.currentTarget.value) }) }), "showComponentLoadingIndicators" === b2 && z("div", { style: { display: "flex", gap: "6px", lineHeight: "normal" }, children: [L(Y, { size: "small", checked: ye, onChange: (e2) => {
    ve(e2), S2({ themeSettingKey: b2, showComponentLoadingIndicators: e2 });
  } }), L("span", { children: x2 })] }), "showDataLoadingIndicators" === b2 && z("div", { style: { display: "flex", gap: "6px", lineHeight: "normal" }, children: [L(Y, { size: "small", checked: fe, onChange: (e2) => {
    be(e2), S2({ themeSettingKey: b2, showDataLoadingIndicators: e2 });
  } }), L("span", { children: x2 })] }), "dataLoadingIndicator" === b2 && L("div", { style: { marginTop: "6px" }, children: L(G, { block: true, value: xe, options: [{ value: "spinner", label: "Spinner" }, { value: "skeleton", label: "Skeleton" }], onChange: (e2) => {
    Ce(e2), S2({ themeSettingKey: b2, dataLoadingIndicator: e2 });
  } }) }), "gridColumns" === b2 && z("div", { className: "config-input", children: [L(h, { $gridColumns: $2 || "24", children: L("div", { children: L(y, { title: "" }) }) }), L(J, { style: { width: "90%", margin: "8px 5% 0 5%" }, min: 8, max: 48, value: parseInt(ke || "24"), onChange: (e2) => Ie(e2.toString()), onChangeComplete: (e2) => Je(e2.toString()) })] }), "gridRowHeight" === b2 && z("div", { className: "config-input", children: [L(h, { $gridColumns: $2 || "24", children: L("div", { children: L(y, { title: "" }) }) }), L(J, { style: { width: "90%", margin: "8px 5% 0 5%" }, min: 4, max: 100, value: parseInt(Se || "8"), onChange: (e2) => Be(e2.toString()), onChangeComplete: (e2) => Je(e2.toString()) })] }), "gridRowCount" === b2 && z("div", { className: "config-input", children: [L(h, { $gridColumns: $2 || "24", children: L("div", { children: L(y, { title: "" }) }) }), L(i, { type: "number", min: 0, value: je, onChange: (e2) => {
    if ("" === e2.target.value)
      return Ne(1 / 0);
    Ne(Number(e2.target.value));
  }, onBlur: (e2) => Qe(e2.target.value), onKeyUp: (e2) => "Enter" === e2.nativeEvent.key && Qe(e2.currentTarget.value) })] }), "gridPaddingX" === b2 && z("div", { className: "config-input", children: [L(m, { $padding: "3px", children: L("div", { children: L(u, { title: "" }) }) }), L(i, { type: "number", min: 0, value: we, onChange: (e2) => {
    if ("" === e2.target.value)
      return Ke(void 0);
    Ke(Number(e2.target.value));
  }, onBlur: (e2) => Ze(e2.target.value), onKeyUp: (e2) => "Enter" === e2.nativeEvent.key && Ze(e2.currentTarget.value) })] }), "gridPaddingY" === b2 && z("div", { className: "config-input", children: [L(m, { $padding: "3px", children: L("div", { children: L(u, { title: "" }) }) }), L(i, { type: "number", min: 0, value: Ee, onChange: (e2) => {
    if ("" === e2.target.value)
      return Te(void 0);
    Te(Number(e2.target.value));
  }, onBlur: (e2) => Ze(e2.target.value), onKeyUp: (e2) => "Enter" === e2.nativeEvent.key && Ze(e2.currentTarget.value) })] }), "gridBgImage" === b2 && L("div", { className: "config-input", children: L(i, { value: Re, onChange: (e2) => Pe(e2.target.value), onBlur: (e2) => _e(e2.target.value), onKeyUp: (e2) => "Enter" === e2.nativeEvent.key && _e(e2.currentTarget.value) }) }), "gridBgImageRepeat" === b2 && L("div", { className: "config-input", children: L(i, { value: Ae, onChange: (e2) => Ue(e2.target.value), onBlur: (e2) => _e(e2.target.value), onKeyUp: (e2) => "Enter" === e2.nativeEvent.key && _e(e2.currentTarget.value) }) }), "gridBgImageSize" === b2 && L("div", { className: "config-input", children: L(i, { value: Ve, onChange: (e2) => $e(e2.target.value), onBlur: (e2) => _e(e2.target.value), onKeyUp: (e2) => "Enter" === e2.nativeEvent.key && _e(e2.currentTarget.value) }) }), "gridBgImagePosition" === b2 && L("div", { className: "config-input", children: L(i, { value: ze, onChange: (e2) => Le(e2.target.value), onBlur: (e2) => _e(e2.target.value), onKeyUp: (e2) => "Enter" === e2.nativeEvent.key && _e(e2.currentTarget.value) }) }), "gridBgImageOrigin" === b2 && L("div", { className: "config-input", children: L(i, { value: De, onChange: (e2) => Fe(e2.target.value), onBlur: (e2) => _e(e2.target.value), onKeyUp: (e2) => "Enter" === e2.nativeEvent.key && _e(e2.currentTarget.value) }) })] });
}
const re = [{ label: "Hide Component", key: "hidden" }, { label: "Disable Component", key: "disable" }, { label: "Margin", key: "style.margin" }, { label: "Padding", key: "style.padding" }, { label: "Font Size", key: "style.textSize" }, { label: "Font Weight", key: "style.textWeight" }, { label: "Font Family", key: "style.fontFamily" }, { label: "Font Style", key: "style.fontStyle" }, { label: "Text Transform", key: "style.textTransform" }, { label: "Text Decoration", key: "style.textDecoration" }, { label: "Border Radius", key: "style.borderRadius" }, { label: "Border Width", key: "style.borderWidth" }, { label: "Border Style", key: "style.borderStyle" }, { label: "Background Image", key: "style.backgroundImage" }, { label: "Background Image Repeat", key: "style.backgroundImageRepeat" }, { label: "Background Image Size", key: "style.backgroundImageSize" }, { label: "Background Image Position", key: "style.backgroundImagePosition" }, { label: "Background Image Origin", key: "style.backgroundImageOrigin" }], oe = W.div`
  height: calc(100vh - ${f});
`, le = W(ae)`
  .ant-dropdown-menu-item-icon {
    width: 14px !important;
    height: 14px !important; 
    max-width: 14px !important;
  }
`, se = (e2) => {
  const t2 = A(b), [n2, a2] = R([]);
  x(), C();
  const [i2, r2] = R(t2.getCollisionStatus()), [o2, l2] = R([]), [s2, d2] = R(""), [g2, c2] = R(null), [p2, m2] = R(""), u2 = U(null);
  P(() => {
    k(i2);
  }, [i2]);
  const h2 = V((e3) => {
    c2(e3);
  }, []), y2 = (e3, t3, n3) => {
    const { items: a3, children: i3 } = e3;
    if (Object.keys(a3).length)
      for (const e4 in a3) {
        const i4 = { title: a3[e4].children.name.getView(), type: a3[e4].children.compType.getView(), key: e4, children: [] };
        if (n3) {
          const e5 = I(t3, n3);
          i4.disabled = true, e5 == null ? void 0 : e5.children.push(i4);
        } else
          t3.push(i4);
      }
    if (Object.keys(i3).length)
      for (const e4 in i3)
        y2(i3[e4], t3, e4);
    return t3;
  }, v2 = V((e3) => {
    t2.setSelectedCompNames(/* @__PURE__ */ new Set([e3]), "leftPanel");
  }, [t2]), [f2, W2] = R([]);
  P(() => {
    const e3 = G2();
    W2(e3);
  }, [t2]);
  const G2 = () => {
    const e3 = t2.getUIComp().getTree(), n3 = y2(e3, []), a3 = t2.rootComp.toJsonValue();
    return "module" === a3.ui.compType ? n3.forEach((e4) => {
      e4.pos = a3.ui.comp.container.layout[e4.key].pos;
    }) : n3.forEach((e4) => {
      e4.pos = a3.ui.layout[e4.key].pos;
    }), n3.sort((e4, t3) => {
      const n4 = (e4 == null ? void 0 : e4.pos) || 0, a4 = (t3 == null ? void 0 : t3.pos) || 0;
      return n4 < a4 ? -1 : n4 > a4 ? 1 : 0;
    }), n3;
  }, J2 = (e3) => {
    const { expandedKeys: t3 } = e3;
    t3.includes(e3.node.key) || a2(t3);
  }, ae2 = (e3, t3) => {
    const n3 = t3.split("-").map((e4) => Number(e4));
    let a3 = { children: e3 };
    for (let e4 = 0; e4 < n3.length; e4++)
      a3 = a3.children[n3[e4]];
    return a3;
  };
  V((e3) => {
    switch (e3) {
      case "hidden":
      case "disable":
        return "true | false";
      case "style.border":
        return "e.g., #ffffff";
      case "style.borderRadius":
      case "style.radius":
        return "e.g., 4px";
      case "style.borderWidth":
        return "e.g., 2px";
      case "style.borderStyle":
        return "solid | dashed | dotted";
      case "style.backgroundImage":
        return "URL as string";
      case "style.backgroundImageRepeat":
        return "repeat | repeat-x | repeat-y | no-repeat";
      case "style.backgroundImageSize":
        return "cover | contain | % | px";
      case "style.backgroundImagePosition":
        return "top | bottom | center | % | px";
      case "style.backgroundImageOrigin":
        return "padding-box | border-box | content-box";
      case "style.margin":
      case "style.padding":
        return "e.g., 4px 8px 16px 32px";
      case "style.textSize":
        return "e.g., 16px";
      case "style.textWeight":
        return "bold | 900 | normal | 400";
      case "style.fontFamily":
        return "Arial, sans-serif";
      case "style.fontStyle":
        return "normal | italic | oblique";
      case "style.textTransform":
        return "none | capitalize | uppercase | lowercase";
      case "style.textDecoration":
        return "none | underline | overline | line-through";
      default:
        return "Action Value";
    }
  }, []);
  const se2 = (e3, n3) => {
    var _a, _b, _c, _d, _e;
    for (let a3 of ge()) {
      const i3 = I(f2, a3), r3 = t2.getUICompByName(i3.title);
      if (r3) {
        const { children: t3 } = r3.children.comp, a4 = r3.children.compType.getView(), i4 = n3.split(".");
        1 === i4.length ? (_a = t3[i4[0]]) == null ? void 0 : _a.dispatchChangeValueAction(e3) : 2 === i4.length && (t3[i4[0]] ? t3[i4[0]].children[i4[1]] ? (_b = t3[i4[0]].children[i4[1]]) == null ? void 0 : _b.dispatchChangeValueAction(e3) : (_c = t3[i4[0]][i4[1]]) == null ? void 0 : _c.dispatchChangeValueAction(e3) : ((_d = t3[a4].children[i4[0]]) == null ? void 0 : _d.children[i4[1]]) && ((_e = t3[a4].children[i4[0]].children[i4[1]]) == null ? void 0 : _e.dispatchChangeValueAction(e3)));
      }
    }
  };
  P(() => {
    l2([]);
    const e3 = [], n3 = t2.getUIComp().getTree(), a3 = y2(n3, []);
    for (let n4 of t2.selectedCompNames)
      for (let t3 of a3)
        t3.title === n4 && e3.push(t3.key);
    l2(e3);
  }, [t2]);
  const de = (e3, n3) => {
    l2(e3);
    const a3 = /* @__PURE__ */ new Set();
    for (let e4 of n3.checkedNodes)
      a3.add(e4.title);
    t2.setSelectedCompNames(a3, "leftPanel");
  }, ge = () => o2, ce = () => s2, pe = V((e3) => {
    var _a, _b, _c, _d, _e;
    const n3 = ce();
    for (let a3 of ge()) {
      const i3 = I(f2, a3), r3 = t2.getUICompByName(i3.title);
      if (r3) {
        const { children: t3 } = r3.children.comp, a4 = r3.children.compType.getView(), i4 = e3.split(".");
        1 === i4.length ? (_a = t3[i4[0]]) == null ? void 0 : _a.dispatchChangeValueAction(n3) : 2 === i4.length && (t3[i4[0]] ? t3[i4[0]].children[i4[1]] ? (_b = t3[i4[0]].children[i4[1]]) == null ? void 0 : _b.dispatchChangeValueAction(n3) : (_c = t3[i4[0]][i4[1]]) == null ? void 0 : _c.dispatchChangeValueAction(n3) : ((_d = t3[a4].children[i4[0]]) == null ? void 0 : _d.children[i4[1]]) && ((_e = t3[a4].children[i4[0]].children[i4[1]]) == null ? void 0 : _e.dispatchChangeValueAction(n3)));
      }
    }
  }, [ce, ge]), me = () => {
    const e3 = H.sortBy(t2.uiCompInfoList(), [(e4) => e4.name]), l3 = t2.getCollisionStatus();
    return z(D, { children: [z("div", { style: { margin: "0px 16px" }, children: [z("div", { style: { marginBottom: "10px" }, children: [N("leftPanel.activatelayers"), L(Y, { style: { margin: "0px 10px" }, size: "small", defaultChecked: i2, disabled: false, onChange: (e4) => {
      var n3;
      n3 = e4, t2.rootComp.children.settings.children.disableCollision.dispatchChangeValueAction(n3), r2(n3);
    } })] }), L(q, { checkable: true, onCheck: de, selectable: false, checkedKeys: o2, draggable: l3, onDragEnter: J2, onDrop: (e4) => ((e5) => {
      const n3 = e5.node.pos.split("-"), a3 = e5.dragNode.pos.split("-");
      n3.length === a3.length && W2((i3) => {
        let r3 = O(i3);
        const o3 = Number(n3[n3.length - 1]), l4 = Number(a3[a3.length - 1]), s3 = n3.slice(0, -1).join("-"), d3 = "0" === s3 ? { children: r3 } : ae2(r3, s3);
        if (d3 && d3.children) {
          const t3 = d3.children.findIndex((t4) => t4.key === e5.dragNode.key);
          if (-1 !== t3) {
            const [e6] = d3.children.splice(t3, 1);
            d3.children.splice(o3 > l4 ? o3 - 1 : o3, 0, e6);
          }
        }
        const g3 = t2.rootComp.toJsonValue();
        let c3 = {};
        if ("module" === g3.ui.compType) {
          d3.children.forEach((e7, t3) => {
            c3[e7.key] = { ...g3.ui.comp.container.layout[e7.key], pos: t3 };
          });
          const e6 = t2.rootComp.children.ui.getModuleLayoutComp();
          e6 == null ? void 0 : e6.children.container.dispatchChangeValueAction({ ...g3.ui.comp.container, layout: c3 });
        } else
          d3.children.forEach((e6, t3) => {
            c3[e6.key] = { ...g3.ui.layout[e6.key], pos: t3 };
          }), t2.rootComp.children.ui.dispatchChangeValueAction({ ...g3.ui, layout: c3 });
        return r3;
      });
    })(e4), treeData: f2, icon: (e4) => e4.type && L("div", { style: { margin: "16px 5px 0 -3px" }, children: M[e4.type] || L(K, {}) }), switcherIcon: (e4) => e4.expanded ? L(E, {}) : L(T, {}), expandedKeys: n2, onExpand: (e4) => a2(e4), titleRender: (t3) => ((e4, t4) => (t4.find((t5) => t5.name === e4.title), L(X, { children: L("span", { children: L("span", { children: e4.title }) }) })))(t3, e3) }), L("div", { style: { margin: "10px 0px" }, children: z(Q, { gap: "small", vertical: true, children: [L(le, { popupRender: () => L(Z, { items: re, onClick: ({ key: e4 }) => {
      h2(e4);
    } }), children: L(_, { size: "small", children: z(ee, { children: ["Action ", L(F, {})] }) }) }), L(te, { ref: u2, value: s2, onChange: (e4) => d2(e4.target.value), placeholder: p2 }), L(_, { type: "primary", disabled: !g2, onClick: () => g2 && pe(g2), children: "Apply Action" }), L("br", {}), L(ie, { themeSettingKey: "background", name: N("componentDoc.styleBackgroundColor"), color: "#ffffff", configChange: (e4) => se2(e4.color, "style.background") }), L(ie, { themeSettingKey: "border", name: N("componentDoc.styleBorderColor"), color: "#ffffff", configChange: (e4) => se2(e4.color, "style.border") }), L(ie, { themeSettingKey: "text", name: N("style.textColor"), color: "#ffffff", configChange: (e4) => se2(e4.color, "style.text") })] }) })] }), L(ne, {})] });
  }, ue = $(() => {
    if (!S(t2.getAppType()))
      return me();
  }, [t2, v2, n2, f2, s2]), he = L(B, { children: L("div", { style: { paddingBottom: 80 }, children: L(j, { name: N("leftPanel.layers"), width: 288, noMargin: true, children: L("div", { className: w, children: ue }) }) }) });
  return L(oe, { className: "cypress-left-content", children: he });
};
export {
  se as LeftLayersContent
};
