PageSourceSearch

https://hotelvilainglesa.com.br/assets/NotFoundSettings-oakta_sT.js

js hotelvilainglesa.com.br collected 2026-09-26 10:28:18 UTC 7,888 bytes, 1 lines download raw bytes

1import{a as E,u as I,b as P,j as e}from"./vendor-query-CO_QYTkO.js";import{r as C}from"./vendor-react-DJfEFaqw.js";import{a7 as T,c as x,m as r,I as l,T as y,s as c}from"./index-BuBFkYNO.js";import{C as m,a as h,b as p,c as k,d as j}from"./card-6llgUU3N.js";import{bk as D,aq as F,aa as R,D as U,E as L}from"./vendor-icons-BmcpZVdY.js";import"./vendor-ui-CCUQhf4y.js";import"./vendor-supabase-MEHSyf2E.js";import"./vendor-router-CkFJCvFZ.js";import"./vendor-helmet-Cc4zoVvE.js";import"./vendor-sanitize-D9RiKzGB.js";import"./vendor-codemirror-kF8_xaBD.js";import"./vendor-dnd-Ds4KDHQQ.js";import"./vendor-carousel-DpjaRhUe.js";const u={title:"404",subtitle:"Página não encontrada",description:"A página que você está procurando não existe ou foi movida.",button_text:"Voltar para o início",button_url:"/",background_image:"",background_color:"",text_color:"",accent_color:"",show_search:!1,custom_css:""};async function Q(){const{data:n}=await c.from("site_settings").select("setting_value").eq("setting_key","not_found_page").maybeSingle();return n!=null&&n.setting_value?{...u,...n.setting_value}:u}function Z(){const{toast:n}=T(),f=E(),[s,d]=C.useState(u),{data:g,isLoading:w}=I({queryKey:["not-found-settings"],queryFn:Q});C.useEffect(()=>{g&&d(g)},[g]);const v=P({mutationFn:async a=>{const{data:i}=await c.from("site_settings").select("id").eq("setting_key","not_found_page").maybeSingle();if(i){const{error:o}=await c.from("site_settings").update({setting_value:a,updated_at:new Date().toISOString()}).eq("setting_key","not_found_page");if(o)throw o}else{const{error:o}=await c.from("site_settings").insert({setting_key:"not_found_page",setting_value:a});if(o)throw o}},onSuccess:()=>{f.invalidateQueries({queryKey:["not-found-settings"]}),f.invalidateQueries({queryKey:["all-site-settings"]}),n({title:"Salvo!",description:"Configurações da página 404 atualizadas."})},onError:()=>{n({title:"Erro",description:"Não foi possível salvar.",variant:"destructive"})}}),S=async a=>{var N;const i=(N=a.target.files)==null?void 0:N[0];if(!i)return;const o=i.name.split(".").pop(),b=`404-backgrounds/${Date.now()}.${o}`,{error:_}=await c.storage.from("media").upload(b,i,{upsert:!0});if(_){n({title:"Erro no upload",description:_.message,variant:"destructive"});return}const{data:q}=c.storage.from("media").getPublicUrl(b);d(z=>({...z,background_image:q.publicUrl}))},t=(a,i)=>d(o=>({...o,[a]:i}));return w?e.jsx("div",{className:"flex justify-center py-12",children:e.jsx("div",{className:"w-8 h-8 border-2 border-primary border-t-transparent rounded-full animate-spin"})}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-display font-bold text-foreground",children:"Página 404"}),e.jsx("p",{className:"text-muted-foreground mt-1",children:"Personalize a aparência da página de erro"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(x,{variant:"outline",size:"sm",onClick:()=>d(u),children:[e.jsx(D,{className:"h-4 w-4 mr-1"})," Restaurar padrão"]}),e.jsxs(x,{size:"sm",onClick:()=>v.mutate(s),disabled:v.isPending,children:[e.jsx(F,{className:"h-4 w-4 mr-1"})," Salvar"]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[e.jsxs(m,{children:[e.jsxs(h,{children:[e.jsx(p,{className:"text-lg",children:"Conteúdo"}
1),e.jsx(k,{children:"Textos exibidos na página de erro"})]}),e.jsxs(j,{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(r,{children:"Título principal"}),e.jsx(l,{value:s.title,onChange:a=>t("title",a.target.value),placeholder:"404"})]}),e.jsxs("div",{children:[e.jsx(r,{children:"Subtítulo"}),e.jsx(l,{value:s.subtitle,onChange:a=>t("subtitle",a.target.value),placeholder:"Página não encontrada"})]}),e.jsxs("div",{children:[e.jsx(r,{children:"Descrição"}),e.jsx(y,{value:s.description,onChange:a=>t("description",a.target.value),rows:3})]}),e.jsxs("div",{children:[e.jsx(r,{children:"Texto do botão"}),e.jsx(l,{value:s.button_text,onChange:a=>t("button_text",a.target.value)})]}),e.jsxs("div",{children:[e.jsx(r,{children:"URL do botão"}),e.jsx(l,{value:s.button_url,onChange:a=>t("button_url",a.target.value),placeholder:"/"})]})]})]}),e.jsxs(m,{children:[e.jsxs(h,{children:[e.jsx(p,{className:"text-lg",children:"Visual"}),e.jsx(k,{children:"Cores e imagem de fundo"})]}),e.jsxs(j,{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(r,{children:"Imagem de fundo"}),s.background_image?e.jsxs("div",{className:"relative mt-2",children:[e.jsx("img",{src:s.background_image,alt:"BG",className:"w-full h-32 object-cover rounded-lg"}),e.jsx(x,{size:"icon",variant:"destructive",className:"absolute top-2 right-2 h-7 w-7",onClick:()=>t("background_image",""),children:e.jsx(R,{className:"h-3 w-3"})})]}):e.jsxs("label",{className:"mt-2 flex flex-col items-center justify-center h-32 border-2 border-dashed rounded-lg cursor-pointer hover:bg-muted/50 transition",children:[e.jsx(U,{className:"h-8 w-8 text-muted-foreground mb-2"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"Clique para enviar"}),e.jsx("input",{type:"file",accept:"image/*",className:"hidden",onChange:S})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(r,{children:"Cor de fundo"}),e.jsxs("div",{className:"flex gap-2 mt-1",children:[e.jsx("input",{type:"color",value:s.background_color||"#f5f0eb",className:"h-9 w-12 rounded cursor-pointer",onChange:a=>t("background_color",a.target.value)}),e.jsx(l,{value:s.background_color,onChange:a=>t("background_color",a.target.value),placeholder:"#f5f0eb"})]})]}),e.jsxs("div",{children:[e.jsx(r,{children:"Cor do texto"}),e.jsxs("div",{className:"flex gap-2 mt-1",children:[e.jsx("input",{type:"color",value:s.text_color||"#1a3a4a",className:"h-9 w-12 rounded cursor-pointer",onChange:a=>t("text_color",a.target.value)}),e.jsx(l,{value:s.text_color,onChange:a=>t("text_color",a.target.value),placeholder:"#1a3a4a"})]})]})]}),e.jsxs("div",{children:[e.jsx(r,{children:"Cor do botão"}),e.jsxs("div",{className:"flex gap-2 mt-1",children:[e.jsx("input",{type:"color",value:s.accent_color||"#1a3a4a",className:"h-9 w-12 rounded cursor-pointer",onChange:a=>t("accent_color",a.target.value)}),e.jsx(l,{value:s.accent_color,onChange:a=>t("accent_color",a.target.value),placeholder:"#1a3a4a"})]})]}),e.jsxs("div",{children:[e.jsx(r,{children:"CSS personalizado"}),e.jsx(y,{value:s.custom_css,onChange:a=>t("custom_css",a.target.value),rows:4,placeholder:".not-found-page { ... }",className:"font-mono text-xs"})]})]})]})]}),e.jsxs(m,{children:[e.jsx(h,{children:e.jsxs(p,{className:"text-lg flex items-center gap-2",children:[e.jsx(L,{className:"h-4 w-4"})," Pré-visualização"]})}),e.jsx(j,{children:e.jsxs("div",{className:"rounded-lg overflow-hidden border",style:{backgroundColor:s.background_color||"#f5f0eb",color:s.text_color||"#1a3a4a",backgroundImage:s.background_image?`url(${s.background_image})`:void 0,backgroundSize:"cover",backgroundPosition:"center",minHeight:300,display:"flex",alignItems:"center",justifyContent:"center",position:"relative"},children:[s.background_image&&e.jsx("div",{className:"absolute inset-0 bg-black/40"}),e.jsxs("div",{className:"text-center relative z-10 p-8",style:{color:s.background_image?"#fff":s.text_color||"#1a3a4a"},children:[e.jsx("h1",{className:"text-6xl font-bold mb-2",children:s.title||"404"}),e.jsx("p",{className:"text-xl mb-2",children:s.subtitle||"Página não encontrada"}),e.jsx("p",{className:"text-sm opacity-80 mb-6 max-w-md mx-auto",children:s.description}),e.jsx("button",{style:{backgroundColor:s.accent_color||"#1a3a4a",color:"#fff",padding:"0.75rem 2rem",borderRadius:"0.5rem",border:"none",fontSize:"0.875rem",cursor:"pointer"},children:s.button_text||"Voltar para o início"})]})]})})]})]})}export{Z 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.