1import{c as z,r as a,j as e,o as x,q as E,s as R,m as g,g as w,X as I,t as d,v as L}from"./index-5syZ9nLx.js";import{M as T}from"./message-circle-CVjnj9Xx.js";/** 2 * @license lucide-react v0.462.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const q=z("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]),D=E("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),N=a.forwardRef(({className:t,variant:s,size:n,asChild:o=!1,...i},m)=>{const l=o?R:"button";return e.jsx(l,{className:x(D({variant:s,size:n,className:t})),ref:m,...i})});N.displayName="Button";const u=a.forwardRef(({className:t,type:s,...n},o)=>e.jsx("input",{type:s,className:x("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),ref:o,...n}));u.displayName="Input";const k=a.forwardRef(({className:t,...s},n)=>e.jsx("textarea",{className:x("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
6ing-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),ref:n,...s}));k.displayName="Textarea";const $=t=>/^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(t.trim()),j=()=>{const t=Math.floor(Math.random()*6)+2,s=Math.floor(Math.random()*6)+2;return{a:t,b:s,answer:t+s}},O=()=>{const[t,s]=a.useState(!1),[n,o]=a.useState(""),[i,m]=a.useState(""),[l,S]=a.useState(""),[c,h]=a.useState(!1),[f,C]=a.useState(!1),[p,M]=a.useState(j),[b,y]=a.useState(""),v=a.useRef(null);a.useEffect(()=>{var r;t&&!f&&((r=v.current)==null||r.focus())},[t,f]);const _=async()=>{if(!c){if(!n.trim())return d.error("Tell us your artist name first.");if(!$(i))return d.error("Enter a valid email so Arum can reply.");if(l.trim().length<5)return d.error("Tell us what you need.");if(Number(b.trim())!==p.answer)return M(j()),y(""),d.error("Quick check failed. Try the new one.");h(!0);try{await L.functions.invoke("send-transactional-email",{body:{templateName:"chat-request",recipientEmail:"[email protected]",idempotencyKey:`chat-${i.toLowerCase()}-${Date.now()}`,templateData:{visitorName:n.trim(),visitorEmail:i.trim().toLowerCase(),page:"Homepage",transcript:[{role:"user",content:l.trim()}]}}})}catch{}h(!1),C(!0)}},A=()=>s(!1);return e.jsxs(e.Fragment,{children:[e.jsxs(g.button,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{delay:1.2,duration:.5},onClick:()=>t?A():s(!0),"aria-label":"Message the studio",className:"fixed bottom-20 right-4 md:bottom-6 md:right-6 z-[90] h-14 w-14 rounded-full bg-primary text-primary-foreground shadow-[0_10px_40px_-10px_hsl(var(--primary)/0.7)] flex items-center justify-center",children:[e.jsx(w,{mode:"wait",initial:!1,children:e.jsx(g.span,{initial:{rotate:-90,opacity:0},animate:{rotate:0,opacity:1},exit:{rotate:90,opacity:0},transition:{duration:.2},children:t?e.jsx(I,{className:"h-6 w-6"}):e.jsx(T,{className:"h-6 w-6"})},t?"x":"chat")}),!t&&e.jsx("span",{className:"absolute -top-0.5 -right-0.5 h-3.5 w-3.5 rounded-full bg-green-500 ring-2 ring-background"})]}),e.jsx(w,{children:t&&e.jsxs(g.div,{initial:{opacity:0,y:24,scale:.96},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:24,scale:.96},transition:{duration:.28,ease:[.22,1,.36,1]},className:"fixed bottom-36 right-4 md:bottom-24 md:right-6 z-[90] w-[calc(100vw-2rem)] max-w-sm overflow-hidden rounded-3xl border border-white/10 bg-background/70 backdrop-blur-2xl shadow-[0_30px_80px_-20px_rgba(0,0,0,0.8)]",children:[e.jsxs("div",{className:"flex items-center gap-3 border-b border-white/10 px-5 py-4",children:[e.jsxs("div",{className:"relative h-9 w-9 rounded-full bg-primary/20 flex items-center justify-center",children:[e.jsx("span",{className:"text-sm font-semibold text-primary",children:"M"}),e.jsx("span",{className:"absolute bottom-0 right-0 h-2.5 w-2.5 rounded-full bg-green-500 ring-2 ring-background"})]}),e.jsxs("div",{className:"leading-tight",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"Mia, studio assistant"}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Replies land in Arum's inbox"})]})]}),f?e.jsxs("div",{className:"p-6 space-y-3 text-center",children:[e.jsxs("p",{className:"text-sm text-foreground",children:["Got it, ",n.trim().split(" ")[0],". We have your request and Arum will reply to"," ",i.trim().toLowerCase()," personally."]}),e.jsx("a",{href:"mailto:[email protected]",className:"inline-block text-xs text-primary hover:underline",children:"[email protected]"})]}):e.jsxs("form",{onSubmit:r=>{r.preventDefault(),_()},className:"p-5 space-y-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Leave your name, email and what you need. It goes straight to Arum's inbox."}),e.jsx(u,{ref:v,value:n,onChange:r=>o(r.target.value),placeholder:"Artist name",className:"bg-white/5 border-white/10"}),e.jsx(u,{value:i,onChange:r=>m(r.target.value),type:"email",placeholder:"[email protected]",className:"bg-white/5 border-white/10"}
6),e.jsx(k,{value:l,onChange:r=>S(r.target.value),placeholder:"What do you want to work on?",rows:3,className:"bg-white/5 border-white/10 resize-none"}),e.jsxs("div",{className:"flex items-center gap-3 rounded-xl border border-white/10 bg-white/5 px-3 py-2",children:[e.jsxs("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:["Quick check: ",p.a," + ",p.b," ="]}),e.jsx(u,{value:b,onChange:r=>y(r.target.value),inputMode:"numeric",placeholder:"?","aria-label":"Human verification answer",className:"h-8 w-16 bg-transparent border-white/10 text-center"})]}),e.jsxs(N,{type:"submit",disabled:c,className:"w-full",children:[c?"Sending...":"Send to Arum",!c&&e.jsx(q,{className:"ml-2 h-4 w-4"})]})]})]})})]})};export{O 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.