// App for /calculadora-presupuesto-eventos — only the Experience Designer experience

function DesignerApp() {
  const initLang = (() => {
    try { return localStorage.getItem("rossetto.lang") || "es"; } catch { return "es"; }
  })();
  const [lang, setLangRaw] = React.useState(initLang);
  const setLang = (l) => {
    setLangRaw(l);
    try { localStorage.setItem("rossetto.lang", l); } catch {}
    document.documentElement.setAttribute("lang", l);
  };
  React.useEffect(() => { document.documentElement.setAttribute("lang", lang); }, [lang]);

  const tr = window.TR[lang];

  return (
    <window.LangContext.Provider value={{ lang, setLang, t: tr }}>
      <window.Spine />
      <window.Nav />
      <window.Designer />
      <window.Footer />
    </window.LangContext.Provider>
  );
}

ReactDOM.createRoot(document.getElementById("root")).render(<DesignerApp />);
