1import{j as e}from"./vendor-radix-2ad2a0d8.js";import{r as n,L as y}from"./vendor-react-81447dfe.js";import{u as A,h as c}from"./index-32797dfd.js";import{b as Q}from"./index-be2fd14e.js";import{Q as T}from"./QiScanAgentEmbed-bc256012.js";import{b1 as v,ay as P,O as M,Q as z,X as F,bb as B,l as D,aZ as W,K as _}from"./vendor-icons-840a60e7.js";import"./vendor-firebase-core-e8e918c8.js";import"./vendor-firebase-firestore-d35b8fbb.js";import"./vendor-motion-612a96bc.js";const N=["Scan or report question","Session or protocol question","Something is not working","Login or account access","Billing or purchase","Practitioner workspace","Question or feedback"],$=d=>[{icon:W,title:"Scan and reports",copy:"Resume a scan or learn how priorities and report scores work.",href:"/scan/goal"},{icon:v,title:"Sessions and protocols",copy:"Get answers about timing, pausing, audio, and scheduled sessions.",href:"/scan/faq"},{icon:_,title:"Account and billing",copy:d?"Manage your access, account, billing, or membership.":"Sign in to manage your access, password, billing, or membership.",href:d?"/scan/membership":"/login"}];function Z(){const{user:d}=A(),[t,i]=n.useState({name:"",email:"",issueType:N[0],details:""}),[b,f]=n.useState(!1),[u,k]=n.useState(!1),[l,x]=n.useState(null),[r]=n.useState(()=>({a:2+Math.floor(Math.random()*7),b:1+Math.floor(Math.random()*8),startedAt:Date.now()})),[p,S]=n.useState(""),[j,q]=n.useState(""),C=async a=>{if(a.preventDefault(),!t.name.trim()||!t.email.trim()||!t.details.trim()){c.error("Please complete all required fields.");return}if(Number(p)!==r.a+r.b){c.error("Please answer the verification question.");return}f(!0);try{let s=null;if(l){const m=new FormData;m.append("file",l);const h=await fetch("/routes/support/attachment",{method:"POST",body:m});if(!h.ok){const g=await h.json().catch(()=>null);throw new Error((g==null?void 0:g.detail)||"The attachment could not be uploaded.")}s=await h.json()}const o=s?` 2 3Attachment: ${s.name} 4Secure link (expires in 7 days): ${s.url}`:"";if(!(await Q.submit_contact_form({name:t.name.trim(),email:t.email.trim(),issue_type:`QiScan â ${t.issueType}`,attempted:t.issueType,expected:"Receive help from the QiScan support team",actual:`${t.details.trim()}${o}`,reproducibility:"Not specified",impact:t.issueType==="Something is not working"||t.issueType==="Login or account access"?"blocked":"minor",page_url:window.location.href,diagnostics:{product:"QiScan",submittedAt:new Date().toISOString(),timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,browser:navigator.userAgent,viewport:`${window.innerWidth}x${window.innerHeight}`,attachmentStoragePath:(s==null?void 0:s.storage_path)||null,challengeA:r.a,challengeB:r.b,challengeAnswer:Number(p),formStartedAt:r.startedAt,website:j},screenshot_data_url:null})).ok)throw new Error("Support request failed");c.success("Your QiScan support request has been sent."),i(m=>({...m,details:""})),x(null)}catch(s){console.error("QiScan support request failed:",s),c.error(s instanceof Error?s.message:"We could not send your request. Please try again shortly.")}finally{f(!1)}};return e.jsx("main",{className:"qi-scan qi-scan-qiari qiscan-landing-light min-h-screen bg-[rgb(var(--qi-void))] text-ink-0",children:e.jsxs("section",{className:"mx-auto max-w-6xl px-5 py-12 sm:py-16",children:[e.jsxs("div",{className:"mx-auto max-w-3xl text-center",children:[e.jsx("p",{className:"font-mono text-xs uppercase tracking-[.22em] text-aurora",children:"QiScan Support"}),e.jsx("h1",{className:"mt-4 font-display text-4xl font-semibold sm:text-6xl",children:"How can we help?"}),e.jsx("p",{className:"mx-auto mt-5 max-w-2xl text-lg leading-relaxed text-ink-2",children:"Ask the support assistant for an instant answer. If you still need help, send our team a request."})]}),e.jsx("section",{className:"mx-auto mt-10 max-w-3xl",children:e.jsx(T,{persona:"support",display:"inline"})}),e.jsxs("section",{className:"mt-12",children:[e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-mono text-xs uppercase tracking-[.18em] text-aurora",children:"Browse by topic"}),e.jsx("h2",{className:"mt-2 text-2xl font-semibold",children:"Qu
4ick links"})]}),e.jsxs(y,{to:"/scan/faq",className:"inline-flex items-center gap-2 text-sm font-medium text-aurora hover:underline",children:[e.jsx(v,{size:17})," View all FAQs"]})]}),e.jsx("div",{className:"mt-5 grid gap-4 sm:grid-cols-3",children:$(!!d).map(({icon:a,title:s,copy:o,href:w})=>e.jsxs(y,{to:w,className:"rounded-xl border border-aurora/30 bg-surface-1 p-6 text-left shadow-sm transition hover:-translate-y-0.5 hover:border-aurora",children:[e.jsx(a,{className:"text-aurora",size:25}),e.jsx("h3",{className:"mt-4 text-lg font-semibold",children:s}),e.jsx("p",{className:"mt-2 text-sm leading-relaxed text-ink-2",children:o})]},s))})]}),e.jsxs("section",{className:"mx-auto mt-12 max-w-3xl overflow-hidden rounded-2xl border border-aurora/40 bg-surface-1 shadow-sm",children:[e.jsxs("button",{type:"button",onClick:()=>k(a=>!a),className:"flex w-full items-center justify-between gap-5 px-6 py-6 text-left sm:px-8","aria-expanded":u,children:[e.jsxs("span",{className:"flex items-start gap-4",children:[e.jsx("span",{className:"rounded-full bg-aurora/10 p-3 text-aurora",children:e.jsx(P,{size:24})}),e.jsxs("span",{children:[e.jsx("strong",{className:"block text-xl font-semibold",children:"Still need help? Contact support"}),e.jsx("span",{className:"mt-1 block text-sm leading-relaxed text-ink-2",children:"Send the QiScan team a detailed request."})]})]}),u?e.jsx(M,{className:"shrink-0 text-aurora"}):e.jsx(z,{className:"shrink-0 text-aurora"})]}),u&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"border-b border-aurora/25 px-6 py-7 sm:px-8",children:e.jsx("div",{className:"flex items-start gap-4",children:e.jsx("div",{children:e.jsx("p",{className:"text-sm leading-relaxed text-ink-2",children:"Tell us what you need help with. Never include your password or payment-card information."})})})}),e.jsxs("form",{onSubmit:C,className:"space-y-5 px-6 py-7 sm:px-8",children:[e.jsxs("div",{className:"grid gap-5 sm:grid-cols-2",children:[e.jsxs("label",{className:"block text-sm font-medium text-ink-1",children:["Name ",e.jsx("span",{className:"text-aurora",children:"*"}),e.jsx("input",{value:t.name,onChange:a=>i({...t,name:a.target.value}),autoComplete:"name",className:"mt-2 w-full rounded-lg border border-aurora/35 bg-[rgb(var(--qi-void))] px-4 py-3 text-base text-ink-0 outline-none placeholder:text-ink-3 focus:border-aurora focus:ring-2 focus:ring-aurora/15",placeholder:"Your name"})]}),e.jsxs("label",{className:"block text-sm font-medium text-ink-1",children:["Account email ",e.jsx("span",{className:"text-aurora",children:"*"}),e.jsx("input",{type:"email",value:t.email,onChange:a=>i({...t,email:a.target.value}),autoComplete:"email",className:"mt-2 w-full rounded-lg border border-aurora/35 bg-[rgb(var(--qi-void))] px-4 py-3 text-base text-ink-0 outline-none placeholder:text-ink-3 focus:border-aurora focus:ring-2 focus:ring-aurora/15",placeholder:"[email protected]"})]})]}),e.jsxs("label",{className:"block text-sm font-medium text-ink-1",children:["What do you need help with?",e.jsx("select",{value:t.issueType,onChange:a=>i({...t,issueType:a.target.value}),className:"mt-2 w-full rounded-lg border border-aurora/35 bg-[rgb(var(--qi-void))] px-4 py-3 text-base text-ink-0 outline-none focus:border-aurora focus:ring-2 focus:ring-aurora/15",children:N.map(a=>e.jsx("option",{children:a},a))})]}),e.jsxs("label",{className:"block text-sm font-medium text-ink-1",children:["How can we help? ",e.jsx("span",{className:"text-aurora",children:"*"}),e.jsx("textarea",{value:t.details,onChange:a=>i({...t,details:a.target.value}),rows:6,className:"mt-2 w-full resize-y rounded-lg border border-aurora/35 bg-[rgb(var(--qi-void))] px-4 py-3 text-base leading-relaxed text-ink-0 outline-none placeholder:text-ink-3 focus:border-aurora focus:ring-2 focus:ring-aurora/15",placeholder:"Include the page, what you tried, what you expected, and what happened instead."})]}),e.jsxs("label",{className:"hidden","aria-hidden":"true",children:["Website",e.jsx("input",{tabIndex:-1,autoComplete:"off",value:j,onChange:a=>q(a.target.value)})]}),e.jsxs("label",{className:"block max-w-xs text-sm font-medium text-ink-1",children:["Verification: What is ",r.a," + ",r.b,"? ",e.jsx("span",{className:"text-aurora",children:"*"}),e.jsx("input",{inputMode:"numeric",value:p,onChange:a=>S(a.target.value.replace(/\D/g,"").slice(0,2)),className:"mt-2 w-full rounded-lg border border-aurora/35 bg-[rgb(var(--qi-void))] px-4 py-3 text-base text-ink-0 outline-none focus:border-aurora focus:ring-2 focus:ring-aurora/15","aria-label":"Verification answer"})]}),e.jsxs("div",{children:[e.jsxs("span",{className:"block text-sm font-medium text-ink-1",children:["Attachment ",e.jsx("span",{className:"font-normal text-ink-3",children:"(optional)"})]}),l?e.jsxs("div",{className:"mt-2 flex items-center justify-between gap-3 rounded-lg border border-aurora/30 bg-[rgb(var(--qi-void))] px-4 py-3",children:[e.jsxs("span",{className:"min-w-0",children:[e.jsx("strong",{className:"block truncate text-sm text-ink-1",children:l.name}),e.jsxs("span",{className:"text-xs text-ink-3",children:[(l.size/1024/1024).toFixed(1)," MB"]})]}),e.jsx("button",{type:"button",onClick:()=>x(null),className:"rounded-md p-2 text-ink-2 hover:bg-aurora/10 hover:text-aurora","aria-label":"Remove attachment",children:e.jsx(F,{size:17})})]}):e.jsxs("label",{className:"mt-2 flex cursor-pointer items-center justify-center gap-2 rounded-lg border border-dashed border-aurora/40 bg-[rgb(var(--qi-void))] px-4 py-5 text-sm font-medium text-ink-1 hover:border-aurora hover:text-aurora",children:[e.jsx(B,{size:18})," Add screenshot, screen recording, PDF, or log",e.jsx("input",{type:"file",className:"sr-only",accept:"image/jpeg,image/png,image/webp,image/gif,video/mp4,video/webm,application/pdf,text/plain",onChange:a=>{var o;const s=((o=a.target.files)==null?void 0:o[0])||null;if(s&&s.size>15*1024*1024){c.error("Please choose a file smaller than 15 MB."),a.target.value="";return}x(s)}})]}),e.jsx("p",{className:"mt-2 text-xs text-ink-3",children:"One file, up to 15 MB. Images, MP4/WebM video, PDF, or plain text. Attachment links expire after 7 days."})]}),e.jsxs("button",{type:"submit",disabled:b,className:"inline-flex min-h-12 w-full items-center justify-center gap-2 rounded-lg bg-aurora px-6 py-3 font-semibold text-slate-950 transition hover:brightness-105 disabled:cursor-wait disabled:opacity-60",children:[e.jsx(D,{size:18})," ",b?"Sendingâ¦":"Send support request"]})]})]})]})]})})}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.