PageSourceSearch

https://splashiq.ai/assets/marketing.brand-MrmgaqfG.js

js splashiq.ai collected 2026-10-05 12:44:39 UTC 6,798 bytes, 1 lines download raw bytes

1import{j as e,r as s,t as d,L as $,bQ as z,B as E,ar as J,I as x}from"./index-CzAkNt2W.js";import{u as F}from"./useServerFn-7MfwXlwR.js";import{L as l}from"./label-BwWVuV93.js";import{T as K}from"./textarea-CMw1Ny2O.js";import{C as A,a as I,b as P,c as G}from"./card-DyZ6_8_C.js";import{R as V}from"./RequireRole-DhUlFC_T.js";import{g as Y,u as Z,S as r,d as ee,b as ae,r as se,F as w,E as te,f as H}from"./EmailBuilder-CQ2A31Bm.js";import{L as q}from"./loader-circle-B0UeYsVT.js";import{W as re}from"./wand-sparkles-CH3levcj.js";import{S as ne}from"./save-CP_iJoQe.js";import"./mouse-pointer-click-BFf-ccJf.js";import"./grip-vertical-xb7LzVoA.js";import"./trash-2-Bb14b2qT.js";const D=/^#[0-9a-fA-F]{6}$/;function U(o,u){return o&&w.find(g=>g.stack===o||g.id===o)?.id||u}function le(){const o=F(Y),u=F(Z),[B,g]=s.useState(!0),[v,k]=s.useState(!1),[T,M]=s.useState(""),[c,N]=s.useState(""),[i,h]=s.useState(r.brandColor),[n,p]=s.useState(r.accentColor),[f,b]=s.useState("sora"),[j,S]=s.useState("inter"),[y,L]=s.useState(""),[m,C]=s.useState(r.footerTagline),[_,R]=s.useState("");function O(){N(""),h(r.brandColor),p(r.accentColor),b("sora"),S("inter"),C(r.footerTagline),d.success("Site Standard applied — review and click Save branding to persist")}const[Q]=s.useState(()=>ee());s.useEffect(()=>{(async()=>{try{const t=(await o({data:{}})).settings;M(t.company_name),N(t.logo_url||""),h(t.brand_color||r.brandColor),p(t.email_accent_color||r.accentColor||""),b(U(t.email_heading_font,"sora")),S(U(t.email_body_font,"inter")),L(t.email_physical_address||""),C(t.email_footer_tagline||r.footerTagline||""),R(t.email_from_name||"")}catch(a){d.error(a.message)}finally{g(!1)}})()},[o]);async function W(){if(!D.test(i)){d.error("Brand color must be a #RRGGBB hex value");return}if(n&&!D.test(n)){d.error("Accent color must be a #RRGGBB hex value");return}k(!0);try{await u({data:{logo_url:c.trim()?c.trim():null,brand_color:i,email_accent_color:n.trim()?n.trim():null,email_heading_font:H(f),email_body_font:H(j),email_physical_address:y.trim()?y.trim():null,email_footer_tagline:m.trim()?m.trim():null,email_from_name:_.trim()?_.trim():null}}),d.success("Branding saved — every marketing email will use these styles")}catch(a){d.error(a.message)}finally{k(!1)}}if(B)return e.jsxs("div",{className:"flex min-h-[40vh] items-center justify-center text-sm text-muted-foreground",children:[e.jsx(q,{className:"mr-2 h-4 w-4 animate-spin"})," Loading branding…"]});const X=ae({companyName:T,logoUrl:c,brandColor:i,accentColor:n,headingFontId:f,bodyFontId:j,footerTagline:m});return se(X),e.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-8 sm:px-6 lg:px-8",children:[e.jsxs($,{to:"/marketing",className:"mb-4 inline-flex items-center text-sm text-muted-foreground hover:text-foreground",children:[e.jsx(z,{className:"mr-1 h-3.5 w-3.5"})," Back to marketing"]}),e.jsxs("header",{className:"mb-6 flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"font-display text-2xl font-bold",children:"Email branding"}),e.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:["Applied automatically to every marketing email — header logo, button color, fonts, and footer. New companies start with ",e.jsx("strong",{children:"Site Standard"})," (Sora + Inter, sky-aqua) to match splashiq.ai — tweak any field below."]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(E,{variant:"outline",onClick:O,disabled:v,children:[e.jsx(re,{className:"mr-2 h-4 w-4"})," Reset to Site Standard"]}),e.jsxs(E,{onClick:W,disabled:v,children:[v?e.jsx(q,{className:"mr-2 h-4 w-4 animate-spin"}):e.jsx(ne,{className:"mr-2 h-4 w-4"}),"Save branding"]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-[420px_1fr]",children:[e.jsxs(A,{children:[e.jsx(I,{className:"pb-3",children:e.jsxs(P,{className:"flex items-center gap-2 text-base",children:[e.jsx(J,{className:"h-4 w-4"})," Brand"]})}),e.jsxs(G,{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(l,{className:"text-xs",children:"Logo URL"}),e.jsx(x,{value:c,onChange:a=>N(a.target.value),placeholder:"https://…/logo.png"}),e.jsx("p",{className:"mt-1 text-[10px] text-muted-foreground",children:"Leave blank to use the company initial badge."})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx(l,{className:"text-xs",children:"Brand color"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"color",value:i,onChange:a=>h(a.target.value),className:"h-9 w-12 cursor-pointer rounded border"}),e.jsx(x,{value:i,onChange:a=>h(a.target.value),className:"font-mono text-xs"})]})]}),e.jsxs("div",{children:[e.jsx(l,{className:"text-xs",children:"Accent color"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"color",value:n||"#0284c7",onChange:a=>p(a.target.value),className:"h-9 w-12 cursor-pointer rounded border"}),e.jsx(x,{value:n,onChange:a=>p(a.target.value),placeholder:"optional",className:"font-mono text-xs"})]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx(l,{className:"text-xs",children:"Heading font"}),e.jsx("select",{className:"h-9 w-full rounded-md border bg-background px-2 text-sm",value:f,onChange:a=>b(a.target.value),children:w.map(a=>e.jsx("option",{value:a.id,children:a.label},a.id))})]}),e.jsxs("div",{children:[e.jsx(l,{className:"text-xs",children:"Body font"}),e.jsx("select",{className:"h-9 w-full rounded-md border bg-background px-2 text-sm",value:j,onChange:a=>S(a.target.value),children:w.map(a=>e.jsx("option",{value:a.id,children:a.label},a.id))})]})]}),e.jsxs("div",{children:[e.jsx(l,{className:"text-xs",children:"From name"}
1),e.jsx(x,{value:_,onChange:a=>R(a.target.value),placeholder:"e.g. SplashIQ Team"})]}),e.jsxs("div",{children:[e.jsx(l,{className:"text-xs",children:"Footer tagline"}),e.jsx(x,{value:m,onChange:a=>C(a.target.value),placeholder:"Run your pool service smarter."})]}),e.jsxs("div",{children:[e.jsx(l,{className:"text-xs",children:"Physical address (CAN-SPAM)"}),e.jsx(K,{value:y,onChange:a=>L(a.target.value),rows:2,placeholder:"123 Main St, Suite 100, City, ST 12345"})]})]})]}),e.jsxs(A,{children:[e.jsx(I,{className:"pb-3",children:e.jsx(P,{className:"text-base",children:"Live preview"})}),e.jsxs(G,{children:[e.jsx(te,{value:Q,onChange:()=>{},brand:{companyName:T,logoUrl:c,brandColor:i,accentColor:n,headingFontId:f,bodyFontId:j,footerTagline:m}}),e.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:"This is a sample template using your branding. Open any campaign step to build templates with drag & drop."})]})]})]})]})}const Ne=()=>e.jsx(V,{allowed:["marketing","superadmin"],children:e.jsx(le,{})});export{Ne 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.