1import{p as d,q as u,v as g,o as b,t as l,j as e,L as j}from"./index-hs4a0mYW.js";import{u as i}from"./useServerFn-DgMZqDJQ.js";import{u as A}from"./useQuery-C-iGd3mh.js";import{u as N}from"./useMutation-CsVV5qgy.js";import{I,C as F,a as v,N as t,e as c,G as m,d as w,j as L,h as O}from"./brand-BVAz6htY.js";import{A as G}from"./arrow-left-bJxZenjV.js";const S=d({method:"GET"}).handler(u("d4d9c2961a5958c2e64fc568e2c6cb70fc9f0c16e3029101c0fdcc7db49fe619")),k=d({method:"POST"}).middleware([g]).handler(u("71e4d88fa5e145f77cde687fd63a7d2f324971d88b308524426e8cbabdf560cc")),C={"openai/gpt-4o":{name:"OpenAI GPT-4o",sub:"Warm in conversation. Uses your OpenAI key."},"openai/gpt-4o-mini":{name:"OpenAI GPT-4o mini",sub:"Cheaper, faster OpenAI. Uses your OpenAI key."},"google/gemini-2.5-flash":{name:"Google Gemini 2.5 Flash",sub:"Free through Lovable AI gateway."},"google/gemini-2.5-pro":{name:"Google Gemini 2.5 Pro",sub:"Strongest reasoning, slower. Lovable AI gateway."}};function _(){const p=i(S),x=i(k),y=b(),{data:o}=A({queryKey:["chat-model"],queryFn:()=>p()}),n=N({mutationFn:s=>x({data:{model:s}}),onSuccess:()=>{l.success("Model updated"),y.invalidateQueries({queryKey:["chat-model"]})},onError:s=>l.error(s.message)}),h=o?.model||"openai/gpt-4o",f=o?.allowed??[];return e.jsxs("div",{className:"min-h-screen",style:{background:F,color:I,fontFamily:"'Inter', system-ui, sans-serif"},children:[e.jsx("header",{style:{borderBottom:`1px solid ${v}`},children:e.jsx("div",{className:"mx-auto max-w-3xl px-8 py-5",children:e.jsxs(j,{to:"/books/admin",className:"inline-flex items-center gap-2 text-sm",style:{color:t},children:[e.jsx(G,{className:"h-4 w-4"})," Admin"]})})}),e.jsxs("main",{className:"mx-auto max-w-3xl px-8 py-12",children:[e.jsx("h1",{style:{fontFamily:"'Playfair Display', serif",fontSize:36,color:t},children:"Engine settings"}),e.jsx("p",{className:"mt-2 text-sm",style:{color:`${c}`},children:"The chat model used by every book and by Living Footnotes."}),e.jsx("div",{className:"mt-8 space-y-3",children:f.map(s=>{const r=C[s]??{name:s,sub:""},a=s===h;return e.jsx("button",{onClick:()=>n.mutate(s),disabled:n.isPending,className:"w-full text-left p-5 transition",style:{background:a?`${L}`:"#FBF8F1",border:`1px solid ${a?m:`${w}`}`},children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{style:{fontFamily:"'Playfair Display', serif",fontSize:18,color:t},children:r.name}),e.jsx("p",{className:"text-xs mt-0.5",style:{color:`${c}`},children:r.sub})]}),a&&e.jsx("span",{className:"text-xs",style:{color:m},children:"In use"})]})},s)})}),e.jsx("p",{className:"mt-8 text-xs",style:{color:`${O}`},children:"Embeddings always use OpenAI text-embedding-3-small on your OpenAI key, regardless of chat model."})]})]})}export{_ as component};
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.