1var u=(c,r,t)=>new Promise((l,i)=>{var n=a=>{try{s(t.next(a))}catch(o){i(o)}},d=a=>{try{s(t.throw(a))}catch(o){i(o)}},s=a=>a.done?l(a.value):Promise.resolve(a.value).then(n,d);s((t=t.apply(c,r)).next())});import{y as m,n as x,z as p,j as e,C as h,c as f,e as j,aE as y,H as g,f as N,k as b,h as v,p as C,s as w}from"./index-B5rOVEZ1.js";import{u as F}from"./useQuery-dtr7-jD-.js";import{S as k}from"./switch-z1cuhfKe.js";function M(){var d;const c=m(),{toast:r}=x(),{data:t,isLoading:l}=F({queryKey:["/api/admin/feature-flags"],queryFn:w({on401:"throw"})}),i=p({mutationFn:o=>u(null,[o],function*({key:s,enabled:a}){yield C("PUT",`/api/admin/feature-flags/${s}`,{enabled:a})}),onSuccess:()=>{c.invalidateQueries({queryKey:["/api/admin/feature-flags"]}),r({title:"Feature flag updated"})},onError:s=>{r({title:"Update failed",description:v(s),variant:"destructive"})}}),n=(d=t==null?void 0:t.data)!=null?d:[];return e.jsxs("div",{className:"space-y-6 max-w-2xl",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-heading",children:"Settings"}),e.jsx("p",{className:"text-muted-foreground",children:"Feature flags and system configuration."})]}),e.jsxs(h,{children:[e.jsxs(f,{children:[e.jsxs(j,{className:"flex items-center gap-2",children:[e.jsx(y,{className:"h-5 w-5"}),"Feature Flags"]}),e.jsx(g,{children:"Enable or disable features across the application."})]}),e.jsx(N,{children:l?e.jsx("div",{className:"flex justify-center py-8",children:e.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-primary"})}):n.length===0?e.jsx("p",{className:"text-muted-foreground text-sm",children:"No feature flags configured."}):e.jsx("div",{className:"space-y-4",children:n.map(s=>e.jsxs("div",{className:"flex items-center justify-between py-3 border-b last:border-0",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"text-sm font-mono",children:s.key}),e.jsx(b,{variant:s.enabled?"default":"secondary",children:s.enabled?"On":"Off"})]}),s.description&&e.jsx("p",{className:"text-sm text-muted-foreground",children:s.description})]}),e.jsx(k,{checked:s.enabled,onCheckedChange:a=>i.mutate({key:s.key,enabled:a})})]},s.id))})})]})]})}export{M 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.