PageSourceSearch

https://mx-ix.com/assets/PageVisibilityAdminPanel-DL6TjPe0.js

js mx-ix.com collected 2026-10-08 17:22:41 UTC 4,634 bytes, 1 lines download raw bytes

1import{r,ad as u,j as e,E as V,ae as f,af as c,N as y,ag as L,ah as C}from"./index-B6K9s3YO.js";import{P as I,N as w}from"./ui-CkEBtdjH.js";import{L as j}from"./loader-circle-Bz0WfNwm.js";import{E as v}from"./eye-BsqMsqOA.js";import{E as N}from"./AdminDashboard-DThxhBY2.js";import{R as A}from"./refresh-cw-CaeZZZEa.js";import"./chevron-left-hN7gRL3G.js";import"./circle-check-BtOx15vy.js";import"./info-bo1V3tWI.js";import"./triangle-alert-Bs7lIqDR.js";import"./chevron-right-DBIsrBXN.js";import"./arrow-left-D1Bb3Mq-.js";import"./shopping-cart-6VK4Sj8L.js";import"./network-Duq8qtfJ.js";import"./cable-DCtDz_G_.js";import"./globe-CkpINKYT.js";import"./layers-DMA9p4Au.js";import"./server-DGLVCCcA.js";import"./activity-Dp8l3Qy1.js";import"./users-DGktSJon.js";import"./map-pin-DQM9wB_k.js";import"./building-2-DvvQiYh9.js";const R=["Main website","Resources","Utility & legal"],ie=({embedded:E,onBack:P})=>{const[n,d]=r.useState({...u}),[m,g]=r.useState(!0),[b,h]=r.useState(null),[x,o]=r.useState(null),p=async()=>{g(!0),o(null);const i=await y.get();i.success&&i.data?d({...u,...i.data.siteVisibility}):o({tone:"error",text:i.error||"Page visibility settings could not be loaded."}),g(!1)};r.useEffect(()=>{p()},[]);const S=async i=>{const s={...n,[i]:!c(n,i)},t=f.find(l=>l.id===i);d(s),h(i),o(null);const a=await y.update({siteVisibility:s});if(a.success){const l=c(s,i);window.localStorage.setItem(L,JSON.stringify(s)),window.dispatchEvent(new CustomEvent(C,{detail:s})),o({tone:"success",text:`${(t==null?void 0:t.label)||"Page"} is now ${l?"visible":"hidden"} on the public website.`})}else d(n),o({tone:"error",text:a.error||"The visibility change could not be saved."});h(null)};return e.jsxs(I,{title:"Page Visibility",subtitle:"Show or hide public website pages",icon:V,embedded:E,onBack:P,actions:e.jsxs("button",{type:"button",onClick:p,disabled:m||b!==null,className:"inline-flex items-center gap-2 rounded bg-gray-700 px-3 py-2 text-sm font-bold text-white transition-colors hover:bg-gray-600 disabled:cursor-not-allowed disabled:opacity-50",children:[e.jsx(A,{className:`h-4 w-4 ${m?"animate-spin":""}`}),"Reload"]}),children:[e.jsx(w,{tone:"info",children:"Hidden pages are removed from the website navigation and footer. Visiting their URL directly shows a 404 page. Changes apply immediately to the public site in this browser."}),x&&e.jsx(w,{tone:x.tone,children:x.text}),m?e.jsx("div",{className:"flex min-h-[320px] items-center justify-center",children:e.jsx(j,{className:"h-8 w-8 animate-spin text-[#F20732]"})}):R.map(i=>{const s=f.filter(t=>t.group===i);return e.jsxs("section",{"aria-labelledby":`visibility-${i.replace(/[^a-z]/gi,"-").toLowerCase()}`,children:[e.jsxs("div",{className:"mb-3 flex items-baseline justify-between gap-4",children:[e.jsx("h2",{id:`visibility-${i.replace(/[^a-z]/gi,"-").toLowerCase()}`,className:"font-mono text-xs font-bold uppercase tracking-wider text-gray-400",children:i}),e.jsxs("span",{className:"text-xs text-gray-500",children:[s.filter(t=>c(n,t.id)).length," of ",s.length," visible"]})]}),e.jsx("div",{className:"grid grid-cols-1 gap-3 lg:grid-cols-2",children:s.map(t=>{const a=c(n,t.id),l=b===t.id;return e.jsxs("article",{className:"flex items-center gap-4 roun
1ded-lg border border-gray-700 bg-gray-800 p-4",children:[e.jsx("div",{className:"flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-lg bg-gray-700 text-gray-500","aria-hidden":"true",children:a?e.jsx(v,{className:"h-5 w-5"}):e.jsx(N,{className:"h-5 w-5"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h3",{className:"font-semibold text-white",children:t.label}),e.jsx("p",{className:"mt-0.5 truncate font-mono text-[11px] text-gray-500",children:t.path})]}),e.jsxs("button",{type:"button",onClick:()=>S(t.id),disabled:b!==null,"aria-label":`${a?"Hide":"Show"} ${t.label}`,className:`inline-flex min-w-[102px] cursor-pointer items-center justify-center gap-2 rounded px-3 py-2.5 text-xs font-bold transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-[#F20732] focus-visible:ring-offset-2 focus-visible:ring-offset-gray-800 disabled:cursor-not-allowed disabled:opacity-50 ${a?"bg-[#F20732] text-white hover:bg-[#C00628]":"bg-gray-700 text-white hover:bg-gray-600"}`,children:[l?e.jsx(j,{className:"h-4 w-4 animate-spin"}):a?e.jsx(N,{className:"h-4 w-4"}):e.jsx(v,{className:"h-4 w-4"}),l?"Saving...":a?"Hide page":"Show page"]})]},t.id)})})]},i)}),e.jsx("p",{className:"text-xs leading-relaxed text-gray-500",children:"Admin and Member Portal routes are intentionally not listed, so management access remains available."})]})};export{ie 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.