1import{r as i,b3 as h,b4 as p,j as e,I as u,b5 as y,aO as d}from"./index-CzMEFmtw.js";import{P as j,a as v,C as N}from"./ui-BklIU2Vp.js";import{S}from"./save-Bu384Y2v.js";import{E as C}from"./eye-off-B7JO2O_O.js";function L(){const[n,o]=i.useState({}),[m,x]=i.useState(!0),[c,l]=i.useState(!1);i.useEffect(()=>{h().then(s=>{o(s),x(!1)})},[]);const f=i.useMemo(()=>{const s=new Map;return p.forEach(t=>{s.set(t.page,[...s.get(t.page)??[],t])}),Array.from(s.entries())},[]);async function g(){l(!0);const{error:s}=await y(n);if(l(!1),s)return d.error(s.message);d.success("Section visibility saved â refresh the site to see changes")}return e.jsxs(j,{children:[e.jsx(v,{title:"Sections",description:"Turn any website section on or off. Hidden sections disappear from the live site instantly â nothing is deleted.",actions:e.jsxs("button",{onClick:g,disabled:c,className:"inline-flex items-center gap-1.5 h-9 px-4 rounded-lg bg-[#F9A01B] text-white text-sm font-semibold disabled:opacity-60",children:[e.jsx(S,{className:"w-4 h-4"})," ",c?"Savingâ¦":"Save changes"]})}),m&&e.jsx("div",{className:"text-sm text-gray-500",children:"Loadingâ¦"}),e.jsx("div",{className:"space-y-6",children:f.map(([s,t])=>e.jsxs(N,{className:"p-4",children:[e.jsx("div",{className:"text-sm font-bold text-gray-900 mb-3",children:s}),e.jsx("div",{className:"space-y-2",children:t.map(a=>{const r=n[a.key]!==!1;return e.jsxs("div",{className:"flex items-center justify-between gap-4 p-3 rounded-xl border border-gray-200",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm font-semibold text-gray-900",children:a.label}),e.jsx("div",{className:"text-xs text-gray-500",children:a.description})]}),e.jsxs("button",{onClick:()=>o(b=>({...b,[a.key]:!r})),className:`inline-flex items-center gap-2 h-9 px-3 rounded-lg text-sm font-semibold shrink-0 ${r?"bg-[#2CC5F4]/10 text-[#0b7fa0] border border-[#2CC5F4]/40":"bg-gray-100 text-gray-500 border border-gray-200"}`,children:[r?e.jsx(u,{className:"w-4 h-4"}):e.jsx(C,{className:"w-4 h-4"}),r?"Visible":"Hidden"]})]},a.key)})})]},s))})]})}export{L as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.