import { j as v } from "../../../../../_virtual/jsx-runtime.js";
import b from "./json-form/FormNavigator.js";
import { e as m } from "../../../../sdk/dist/shared/chunk-NLEWXPVM.js";
import "@sinclair/typebox";
import "../../../../sdk/dist/shared/chunk-AQPN5SE2.js";
import "../../../../sdk/dist/shared/chunk-DQXDGV67.js";
import "../../../../sdk/dist/shared/chunk-7DMUDZ4H.js";
import "../../../../sdk/dist/shared/chunk-LSPN22SI.js";
import "../../../../sdk/dist/shared/chunk-ETYYRWLK.js";
import "../../../../sdk/dist/shared/chunk-4TH3C76A.js";
import "../../../../sdk/dist/shared/chunk-FKNNTHWX.js";
import "../../../../sdk/dist/shared/chunk-JS4K5JRM.js";
import "../../../../sdk/dist/shared/chunk-WU6Q4WYD.js";
import "../../../../sdk/dist/shared/chunk-QISTDGPP.js";
import "../../../../sdk/dist/shared/chunk-LFQZRGHS.js";
import "../../../../sdk/dist/shared/chunk-SLRU4CT6.js";
import "../../../../sdk/dist/shared/chunk-TTTXV7TJ.js";
import "../../../../sdk/dist/shared/chunk-UHF6IEKV.js";
import "../../../../sdk/dist/shared/chunk-LGP6GWIY.js";
import "../../../../sdk/dist/shared/chunk-X43MB5WD.js";
import "../../../../sdk/dist/shared/chunk-NNI225RG.js";
import "../../../../sdk/dist/shared/chunk-ZQGNYK5I.js";
import "../../../../sdk/dist/shared/chunk-KHFNN4P3.js";
import "../../../../sdk/dist/shared/chunk-BZGNY7LB.js";
import "../../../../sdk/dist/shared/chunk-IIFTGWFZ.js";
import { merge as n, set as w } from "lodash-es";
import "../../../../sdk/dist/shared/chunk-UU2MSQXY.js";
import "../../../../sdk/dist/shared/chunk-T3LIA4YB.js";
import "../../../../sdk/dist/shared/chunk-YBGPPF7T.js";
import "../../../../sdk/dist/shared/chunk-UMHXXXVP.js";
import "../../../../sdk/dist/shared/chunk-5N6MBJJ4.js";
import { b as S } from "../../../../sdk/dist/shared/chunk-I46VBMLF.js";
import { useCallback as d, useMemo as u } from "react";
import { usePreviewMode as x } from "../../../../../use-editor.js";
import { getNavItemsFromManifest as h } from "./json-form/form-utils.js";
import { useLocalStorage as y } from "../../../../../node_modules/.pnpm/usehooks-ts@3.1.1_react@18.3.0-canary-3d9b20132-20240124/node_modules/usehooks-ts/dist/index.js";
import { useDraftHelpers as M } from "../../../../../use-page-data.js";
function ao({ section: t, group: f }) {
  const { updateSectionProps: s } = M(), r = x(), [p, P] = y("upstart:editor:show-advanced", !1), a = d(
    (o) => (typeof o.metadata?.["ui:responsive"] > "u" || o.metadata?.["ui:responsive"] === !0 || o.metadata?.["ui:responsive"] === r) && (typeof o["ui:responsive"] > "u" || o["ui:responsive"] === !0 || o["ui:responsive"] === r) && (!o.metadata?.category || o.metadata?.category === "settings") && (!o["ui:advanced"] || p),
    [r, p]
  ), c = u(() => h(m.properties.props, a), [a]), l = u(() => {
    const o = S(m.properties.props, r);
    return r === "mobile" ? n({}, o, t.props, t.mobileProps) : n({}, o, t.props ?? {});
  }, [r, t.props, t.mobileProps]), g = d(
    (o, e) => {
      if (!e) {
        console.warn("propertyChangedPath is missing in style tab");
        return;
      }
      const i = structuredClone(t?.props ?? {});
      w(i, e, o[e]), console.log("SectionSettingsView onChange", {
        props: i
      }), s(t.id, i, r === "mobile");
    },
    [t.id, r, s, t.props]
  );
  return /* @__PURE__ */ v.jsx(
    b,
    {
      title: "Section settings",
      initialGroup: f,
      navItems: c,
      formSchema: m.properties.props,
      className: "flex-grow",
      formData: l,
      onChange: g,
      brickId: t.id
    },
    `section-settings-${t.id}-${r}`
  );
}
export {
  ao as default
};
//# sourceMappingURL=SectionSettingsView.js.map
