1import{o as f,ai as N,A as F,al as B,a4 as R,a5 as I,U as k,j as e,aM as M,C as i,$ as O,T as a,D as o,G as y,L as b,X as C,ao as W}from"./index-dE8a1mPK.js";import{E as X}from"./ErrorState-gVNyx0--.js";import{I as q}from"./IconWand-C0msnEB9.js";import{T as u}from"./Textarea-BtbUvWWM.js";import{P as A}from"./Pill-yNBbBYnE.js";import{I as V}from"./IconDeviceFloppy-DgEyIcAH.js";import{R as E}from"./Radio-BhZSb0du.js";import"./IconCopy-B63sUmw8.js";import"./Code-YtMEZkZ5.js";import"./get-env-uyVen0u2.js";import"./InputsGroupFieldset-C0syow2C.js";function H(m,r,{debounceMs:c=600}={}){const p=`xlift:autosave:${m}`,[d,g]=f.useState(()=>{try{const h=localStorage.getItem(p);if(h)return JSON.parse(h)}catch{}return r}),n=f.useRef(null);return f.useEffect(()=>()=>{n.current&&clearTimeout(n.current)},[]),[d,h=>{g(x=>{const v=typeof h=="function"?h(x):h;return n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{try{localStorage.setItem(p,JSON.stringify(v))}catch{}},c),v})},()=>{n.current&&clearTimeout(n.current);try{localStorage.removeItem(p)}catch{}}]}const w={name:"",link:"",tagline:"",description:"",value:"",audience:"",sellingPoints:"",tones:[],voiceNotes:"",replyLength:"medium",emojis:"sometimes",hashtags:"never",pov:"i",questions:"balanced",topicsInclude:"",topicsExclude:"",hardRules:"",examples:"",ctaLink:"",ctaBlurb:""},G=["warm","witty","professional","bold","playful","direct","sharp","formal","curious","confident","friendly","contrarian"];function ae(){const m=N(),[r,c,p]=H("brand-form",w),[d,g]=f.useState(""),{data:n,isLoading:S,error:T}=F({queryKey:["brand"],queryFn:()=>k.getBrand()}),h=f.useRef(!1);f.useEffect(()=>{var l;if(h.current||!(n!=null&&n.brand))return;!r.tagline&&!r.description&&!r.value&&!r.audience&&!((l=r.tones)!=null&&l.length)&&c({...w,...n.brand}),n.brand.link&&g(n.brand.link),h.current=!0},[n,r,c]);const x=B({mutationFn:s=>k.saveBrand(s),onSuccess:s=>{m.setQueryData(["brand"],{brand:s.brand}),p(),I("Brand profile saved.")},onError:s=>R(s)}),v=B({mutationFn:s=>k.generateBrand(s),onSuccess:s=>{c(l=>({...l,...s.brand})),I("Draft loaded â review and save.")},onError:s=>R(s)});function t(s,l){c(z=>({...z,[s]:l}))}function P(s){c(l=>{const z=l.tones.includes(s);return{...l,tones:z?l.tones.filter(L=>L!==s):[...l.tones,s]}})}function D(){confirm("Reset the brand profile? This can't be undone.")&&(x.mutate(w),c(w),g(""))}return S?e.jsx(M,{}):T?e.jsx(X,{error:T,onRetry:()=>m.invalidateQueries({queryKey:["brand"]})}):e.jsxs(i,{gap:"md",children:[e.jsxs("div",{children:[e.jsx(O,{order:2,children:"Brand profile"}),e.jsx(a,{c:"dimmed",size:"sm",children:"Teach Xlift who you are. The more it knows, the better it sounds like you."})]}),e.jsx(o,{withBorder:!0,bg:"dark.9",c:"white",children:e.jsxs(i,{gap:"xs",children:[e.jsx(a,{fw:700,size:"sm",children:"Start from your link"}),e.jsx(a,{size:"xs",c:"gray.5",children:"Paste your site or X profile. We'll read it and fill the basics â you edit from there."}),e.jsxs(y,{gap:"xs",align:"flex-end",wrap:"nowrap",children:[e.jsx(b,{style:{flex:1},placeholder:"https://your-brand.com",value:d,onChange:s=>g(s.currentTarget.value),styles:{input:{background:"#1a1a1a",borderColor:"#333",color:"#fff"}}}),e.jsx(C,{leftSection:e.jsx(q,{size:14}),loading:v.isPending,onClick:()=>v.mutate(d.trim()),disabled:!d.trim(),variant:"white",c:"black",children:"Generate"})]})]})}),e.jsx(o,{withBorder:!0,children:e.jsxs(i,{gap:"xs",children:[e.jsx(a,{fw:700,size:"sm",children:"Who you are"}),e.jsx(b,{label:"Brand name",description:"How you want to be referred to in replies, DMs, and posts.",placeholder:"e.g. Xlift, Linear, Cal.com",value:r.name,onChange:s=>t("name",s.currentTarget.value)}),e.jsx(b,{label:"One-line pitch",placeholder:"The fastest way to grow on X â without sounding like a bot.",value:r.tagline,onChange:s=>t("tagline",s.currentTarget.value)}),e.jsx(u,{label:"Description",description:"Two or three sentences a stranger should walk away knowing.",placeholder:"What you do, who it's for, and why it exists.",autosize:!0,minRows:3,value:r.description,onChange:s=>t("description",s.currentTarget.value)})]})}),e.jsx(o,{withBorder:!0,children:e.jsxs(i,{gap:"xs",children:[e.jsx(a,{fw:700,size:"sm",children:"Value proposition"}),e.jsx(a,{size:"xs",c:"dimmed",children:"The wedge no one else has. The reason they pick you."}),e.jsx(u,{placeholder:"The unique outcome you deliver, in plain language.",autosize:!0,minRows:2,value:r.value,onChange:s=>t("value",s.currentTarget.value)})]})}),e.jsx(o,{withBorder:!0,children:e.jsxs(i,{gap:"xs",children:[e.jsx(a,{fw:700,size:"sm",children:"Who you're talking to"}
1),e.jsx(a,{size:"xs",c:"dimmed",children:"Indie devs? Solo founders? Marketing leads at scale-ups? Be specific â Xlift picks better conversations when you are."}),e.jsx(u,{placeholder:"The people whose problem you solve.",autosize:!0,minRows:2,value:r.audience,onChange:s=>t("audience",s.currentTarget.value)})]})}),e.jsx(o,{withBorder:!0,children:e.jsxs(i,{gap:"xs",children:[e.jsx(a,{fw:700,size:"sm",children:"Selling points"}),e.jsx(a,{size:"xs",c:"dimmed",children:"The concrete reasons people pick you. One per line. Plain and specific â no buzzwords. Used by replies, DMs, and the lead scorer."}),e.jsx(u,{placeholder:`e.g. 2Free tier covers real production use. 3Ships features the same week customers ask. 4Owner replies to every support email.`,autosize:!0,minRows:4,value:r.sellingPoints,onChange:s=>t("sellingPoints",s.currentTarget.value)})]})}),e.jsx(o,{withBorder:!0,children:e.jsxs(i,{gap:"xs",children:[e.jsx(a,{fw:700,size:"sm",children:"Voice & tone"}),e.jsx(a,{size:"xs",c:"dimmed",children:"Pick the words that fit. Mix and match."}),e.jsx(y,{gap:6,children:G.map(s=>e.jsx(A,{size:"md",style:{cursor:"pointer",textTransform:"capitalize",background:r.tones.includes(s)?"var(--mantine-color-dark-9)":void 0,color:r.tones.includes(s)?"#fff":void 0},onClick:()=>P(s),children:s},s))}),e.jsx(u,{label:"Voice notes",description:"Catchphrases you use, words you'd never say, sentence cadence.",placeholder:'e.g. "Always say âshipâ instead of âlaunchâ. Never use ârevolutionaryâ."',autosize:!0,minRows:2,value:r.voiceNotes,onChange:s=>t("voiceNotes",s.currentTarget.value)})]})}),e.jsx(o,{withBorder:!0,children:e.jsxs(i,{gap:"md",children:[e.jsxs("div",{children:[e.jsx(a,{fw:700,size:"sm",children:"Chat guidelines"}),e.jsx(a,{size:"xs",c:"dimmed",children:"How Xlift writes replies and DMs."})]}),e.jsx(j,{label:"Reply length",value:r.replyLength,onChange:s=>t("replyLength",s),options:[{value:"short",label:"Short"},{value:"medium",label:"Medium"},{value:"long",label:"Long"}]}),e.jsx(j,{label:"Emojis",value:r.emojis,onChange:s=>t("emojis",s),options:[{value:"never",label:"Never"},{value:"sometimes",label:"Sometimes"},{value:"often",label:"Often"}]}),e.jsx(j,{label:"Hashtags",value:r.hashtags,onChange:s=>t("hashtags",s),options:[{value:"never",label:"Never"},{value:"sometimes",label:"Sometimes"},{value:"often",label:"Often"}]}),e.jsx(j,{label:"Voice",value:r.pov,onChange:s=>t("pov",s),options:[{value:"i",label:'"I"'},{value:"we",label:'"We"'},{value:"brand",label:"Brand"}]}),e.jsx(j,{label:"Ask questions back",value:r.questions,onChange:s=>t("questions",s),options:[{value:"rare",label:"Rarely"},{value:"balanced",label:"Balanced"},{value:"often",label:"Often"}]})]})}),e.jsx(o,{withBorder:!0,children:e.jsxs(i,{gap:"xs",children:[e.jsx(a,{fw:700,size:"sm",children:"Topics to engage"}),e.jsx(a,{size:"xs",c:"dimmed",children:"One per line. Conversations Xlift should jump into."}),e.jsx(u,{autosize:!0,minRows:4,placeholder:`Indie SaaS 5Shopify dev 6Bootstrapping 7Side projects`,value:r.topicsInclude,onChange:s=>t("topicsInclude",s.currentTarget.value),styles:{input:{fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace"}}})]})}),e.jsx(o,{withBorder:!0,children:e.jsxs(i,{gap:"xs",children:[e.jsx(a,{fw:700,size:"sm",children:"Topics to avoid"}),e.jsx(a,{size:"xs",c:"dimmed",children:"Topics that aren't a fit. We'll stay out."}),e.jsx(u,{autosize:!0,minRows:3,placeholder:`Politics 8Crypto trading 9Drama / subtweets`,value:r.topicsExclude,onChange:s=>t("topicsExclude",s.currentTarget.value),styles:{input:{fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace"}}})]})}),e.jsx(o,{withBorder:!0,style:{borderColor:"rgba(244, 33, 46, 0.30)",background:"rgba(244, 33, 46, 0.03)"},children:e.jsxs(i,{gap:"xs",children:[e.jsx(a,{fw:700,size:"sm",children:"Hard rules"}),e.jsxs(a,{size:"xs",c:"dimmed",children:["Things we must ",e.jsx("b",{children:"never"})," say or claim. We respect these absolutely."]}),e.jsx(u,{autosize:!0,minRows:3,placeholder:`Never call us 'AI-powered'. 10Never mention competitor names directly. 11Never promise specific revenue numbers.`,value:r.hardRules,onChange:s=>t("hardRules",s.currentTarget.value)})]})}),e.jsx(o,{withBorder:!0,children:e.jsxs(i,{gap:"xs",children:[e.jsx(a,{fw:700,size:"sm",children:"Sample posts"}),e.jsx(a,{size:"xs",c:"dimmed",children:"Paste 2â5 of your best replies or posts. Xlift learns your cadence."}),e.jsx(u,{autosize:!0,minRows:5,placeholder:"Paste examples, separated by blank lines...",value:r.examples,onChange:s=>t("examples",s.currentTarget.value)})]})}),e.jsx(o,{withBorder:!0,children:e.jsxs(i,{gap:"xs",children:[e.jsx(a,{fw:700,size:"sm",children:"Promote"}),e.jsx(a,{size:"xs",c:"dimmed",children:"Where you want people to go when it fits. We only drop it when relevant."}),e.jsx(b,{label:"Link or offer",placeholder:"https://your-product.com/get-started",value:r.ctaLink,onChange:s=>t("ctaLink",s.currentTarget.value)}),e.jsx(u,{label:"How to introduce it",description:"A natural one-liner that fits a conversation.",placeholder:'e.g. "Built Xlift for exactly this â flow is at xlift.app if you want a look."',autosize:!0,minRows:2,value:r.ctaBlurb,onChange:s=>t("ctaBlurb",s.currentTarget.value)})]})}),e.jsxs(y,{justify:"space-between",pt:"xs",pb:"xl",children:[e.jsx(C,{variant:"default",leftSection:e.jsx(W,{size:14}),onClick:D,disabled:x.isPending,children:"Reset"}),e.jsx(C,{leftSection:e.jsx(V,{size:14}),loading:x.isPending,onClick:()=>x.mutate(r),children:"Save changes"})]})]})}function j({label:m,value:r,onChange:c,options:p}){return e.jsx(E.Group,{label:m,value:r,onChange:c,children:e.jsx(y,{gap:"lg",mt:4,children:p.map(d=>e.jsx(E,{value:d.value,label:d.label},d.value))})})}export{ae 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.