1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,1048,e=>{"use strict";let a=(0,e.i(75254).default)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);e.s(["CircleCheck",0,a],1048)},93767,e=>{"use strict";var a=e.i(43476),s=e.i(71645),t=e.i(22016),n=e.i(1048),r=e.i(75254);let i=(0,r.default)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),l=(0,r.default)("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]),d=(0,r.default)("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"}]]),o=(0,r.default)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),m="NEXT_PUBLIC_WEB3FORMS_KEY",c="contact-form-outage",h=["A question about a case study","The open-source Flutter packages","An article on the blog","Something else"],u={"case-study":"A question about a case study",packages:"The open-source Flutter packages",blog:"An article on the blog",other:"Something else"},x={"":"Your message","A question about a case study":"Your question","The open-source Flutter packages":"Your message","An article on the blog":"Your message","Something else":"Your message"},g={"":"What's on your mind?","A question about a case study":"Which case study, and what would you like to know?","The open-source Flutter packages":"Which package, and what's up â a bug, a question, an idea?","An article on the blog":"Which article, and what would you add or push back on?","Something else":"Whatever's on your mind â or just hello."},p={"":"Message from sherazi.dev","A question about a case study":"Case study question","The open-source Flutter packages":"Flutter packages","An article on the blog":"Blog","Something else":"Message from sherazi.dev"},f=/^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/;function b(e){let a={};return e.reason||(a.reason="Pick what this is about."),e.name.trim()||(a.name="Please add your name."),e.email.trim()?f.test(e.email.trim())||(a.email="That email address doesn't look quite right."):a.email="Please add an email so I can reply.",e.message.trim().length<10&&(a.message="A little more detail, please â at least 10 characters."),a}function j({htmlFor:e,flag:s,children:t}){return(0,a.jsxs)("label",{htmlFor:e,className:"mb-1.5 flex items-baseline justify-between gap-3 text-sm font-medium text-fg",children:[(0,a.jsx)("span",{children:t}),(0,a.jsx)("span",{"aria-hidden":!0,className:"font-mono text-[11px] font-normal text-code-gutter",children:s})]})}function y({field:e,error:s}){return s?(0,a.jsxs)("p",{id:`${e}-error`,className:"mt-1.5 flex items-start gap-1.5 text-xs text-red-300",children:[(0,a.jsx)(o,{className:"mt-px h-3.5 w-3.5 shrink-0","aria-hidden":!0}),s]}):null}let v={name:"",email:"",reason:"",message:""};e.s(["default",0,function({mailtoTarget:e=null}){let[r,f]=(0,s.useState)(v),[N,w]=(0,s.useState)("idle"),[k,C]=(0,s.useState)(!1),[S,T]=(0,s.useState)(!1),q=(0,s.useRef)(null),A=(0,s.useRef)(null);(0,s.useEffect)(()=>{let e=new URLSearchParams(window.location.search).get("reason"),a=e?u[e]:void 0;a&&f(e=>e.reason?e:{...e,reason:a})},[]);let F=!!e,M=!!m||F;(0,s.useEffect)(()=>{"sent"===N&&q.current?.focus()},[N]);let $=k?b(r):{},P=e=>a=>f(s=>({...s,[e]:a.target.value})),z=`${p[r.reason]} â ${r.name.trim()}`,L=async e=>{if(e.preventDefault(),S)return void w("sent");C(!0);let a=b(r),s=["reason","name","email","message"].find(e=>a[e]);if(s)return void A.current?.querySelector(`#${s}`)?.focus();w("sending");try{let e=await fetch("https://api.web3forms.com/submit",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({access_key:m,botcheck:S,subject:z,from_name:r.name.trim(),email:r.email.trim(),"Reaching out about":r.reason,message:r.message.trim()})}),a=await e.json();w(a.success?"sent":"error")}catch{w("error")}},O=e=>`w-full rounded-lg border bg-surface px-4 py-3 text-sm text-fg placeholder:text-dim transition-colors focus:border-brand-500 ${$[e]?"border-red-400/60":"border-line hover:border-white/15"}`,R=(e,a)=>[$[e]?`${e}
1-error`:null,a].filter(Boolean).join(" ")||void 0,Y=(0,a.jsxs)("div",{className:"code-window",children:[(0,a.jsxs)("div",{className:"code-window-bar",children:[(0,a.jsx)("span",{className:"code-dots","aria-hidden":!0}),(0,a.jsx)("span",{className:"ml-2 min-w-0 truncate",children:"~/contact â zsh"})]}),(0,a.jsxs)("div",{className:"px-6 py-8 sm:px-9 sm:py-10",children:[(0,a.jsxs)("p",{"aria-hidden":!0,className:"font-mono text-xs leading-relaxed",children:[(0,a.jsx)("span",{className:"text-syn-kw",children:"$"})," ",(0,a.jsx)("span",{className:"text-syn-id",children:"./say-hello"}),(0,a.jsx)("br",{}),(0,a.jsx)("span",{className:"text-syn-str",children:"â message delivered"}),(0,a.jsx)("span",{className:"term-caret"})]}),(0,a.jsxs)("div",{className:"mt-6 flex items-start gap-4",children:[(0,a.jsx)("span",{className:"shrink-0 rounded-full bg-emerald-500/10 p-3 text-emerald-400",children:(0,a.jsx)(n.CircleCheck,{className:"h-6 w-6","aria-hidden":!0})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{ref:q,tabIndex:-1,className:"sr-focus-target font-display text-2xl font-bold",children:"Message sent â thank you!"}),(0,a.jsxs)("p",{className:"mt-2 max-w-sm text-sm leading-relaxed text-muted",children:["I read every message myself and will get back to you at the address you gave. Meanwhile, the"," ",(0,a.jsx)(t.default,{href:"/projects",className:"font-medium text-brand-300 hover:text-brand-400",children:"case studies"})," ","and the"," ",(0,a.jsx)(t.default,{href:"/blog",className:"font-medium text-brand-300 hover:text-brand-400",children:"notes"})," ","are a good read."]}),(0,a.jsxs)("button",{type:"button",onClick:()=>{f(v),C(!1),w("idle")},className:"mt-5 inline-flex items-center gap-2 rounded-full border border-line bg-card px-5 py-2.5 text-sm font-semibold transition-colors hover:border-brand-500/50",children:[(0,a.jsx)(l,{className:"h-4 w-4","aria-hidden":!0})," Send another message"]})]})]})]})]});return(0,a.jsxs)("div",{id:"contact-form",className:"scroll-mt-28",children:[(0,a.jsx)("p",{"aria-live":"polite",className:"sr-only",children:"sent"===N?"Message sent â thank you!":""}),"sent"===N?Y:(0,a.jsxs)("form",{ref:A,onSubmit:L,noValidate:!0,"aria-label":"Send a message",className:"code-window",children:[(0,a.jsxs)("div",{className:"code-window-bar",children:[(0,a.jsx)("span",{className:"code-dots","aria-hidden":!0}),(0,a.jsx)("span",{className:"ml-2 min-w-0 truncate",children:"new-message.md"}),(0,a.jsx)("span",{className:"ml-auto hidden shrink-0 text-code-gutter sm:inline",children:r.message.length>0?"â unsaved":"UTF-8"})]}),(0,a.jsxs)("div",{className:"p-6 sm:p-8",children:[(0,a.jsx)("input",{type:"checkbox",name:"botcheck",checked:S,onChange:e=>T(e.target.checked),tabIndex:-1,autoComplete:"off","aria-hidden":"true",className:"hidden"}),!M&&(0,a.jsxs)("p",{id:c,role:"status",className:"mb-6 flex items-start gap-2.5 rounded-lg border border-amber-500/30 bg-amber-500/10 p-3.5 text-sm text-amber-300",children:[(0,a.jsx)(o,{className:"mt-0.5 h-4 w-4 shrink-0","aria-hidden":!0}),(0,a.jsxs)("span",{children:[(0,a.jsx)("strong",{className:"font-semibold",children:"This form isn't live yet."})," ","The message endpoint is still being configured, so nothing typed here can be delivered â please don't write it out and lose it. In the meantime the"," ",(0,a.jsx)(t.default,{href:"/projects",className:"font-medium underline underline-offset-4",children:"case studies"})," ","and"," ",(0,a.jsx)(t.default,{href:"/resume",className:"font-medium underline underline-offset-4",children:"resume"})," ","cover most of what people write in about."]})]}),k&&Object.keys($).length>0&&(0,a.jsx)("p",{role:"alert",className:"sr-only",children:`Please fix ${Object.keys($).length} field${Object.keys($).length>1?"s":""} before sending.`}),(0,a.jsxs)("div",{className:"grid grid-cols-[minmax(0,1fr)] gap-5 sm:grid-cols-2",children:[(0,a.jsxs)("div",{className:"sm:col-span-2",children:[(0,a.jsx)(j,{htmlFor:"reason",flag:"--about",children:"What brings you here?"}),(0,a.jsxs)("select",{id:"reason",name:"reason",required:!0,value:r.reason,onChange:P("reason"),"aria-invalid":!!$.reason||void 0,"aria-describedby":R("reason"),className:O("reason"),children:[(0,a.jsx)("option",{value:"",disabled:!0,children:"Choose oneâ¦"}),h.map(e=>(0,a.jsx)("option",{children:e},e))]}),(0,a.jsx)(y,{field:"reason",error:$.reason})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(j,{htmlFor:"name",flag:"--name",children:"Your name"}),(0,a.jsx)("input",{id:"name",name:"name",autoComplete:"name",required:!0,maxLength:120,value:r.name,onChange:P("name"),placeholder:"Jane Smith","aria-invalid":!!$.name||void 0,"aria-describedby":R("name"),className:O("name")}
1),(0,a.jsx)(y,{field:"name",error:$.name})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(j,{htmlFor:"email",flag:"--email",children:"Email"}),(0,a.jsx)("input",{id:"email",name:"email",type:"email",autoComplete:"email",inputMode:"email",spellCheck:!1,required:!0,maxLength:254,value:r.email,onChange:P("email"),placeholder:"[email protected]","aria-invalid":!!$.email||void 0,"aria-describedby":R("email"),className:O("email")}),(0,a.jsx)(y,{field:"email",error:$.email})]}),(0,a.jsxs)("div",{className:"sm:col-span-2",children:[(0,a.jsx)(j,{htmlFor:"message",flag:"--message",children:x[r.reason]}),(0,a.jsx)("textarea",{id:"message",name:"message",required:!0,rows:6,minLength:10,maxLength:5e3,value:r.message,onChange:P("message"),placeholder:g[r.reason],"aria-invalid":!!$.message||void 0,"aria-describedby":R("message","message-count"),className:`${O("message")} resize-y leading-relaxed`}),(0,a.jsxs)("div",{className:"mt-1.5 flex items-start justify-between gap-3",children:[(0,a.jsx)(y,{field:"message",error:$.message}),(0,a.jsxs)("p",{id:"message-count",className:"ml-auto shrink-0 font-mono text-[11px] text-dim",children:[r.message.length,"/",5e3]})]})]})]}),(0,a.jsx)("button",{type:"submit",disabled:"sending"===N||!M,"aria-describedby":M?void 0:c,className:`mt-7 inline-flex w-full items-center justify-center gap-2 rounded-full px-8 py-4 text-base font-semibold transition-colors disabled:cursor-not-allowed ${M?"btn-primary shadow-xl shadow-brand-500/25 disabled:opacity-70":"border border-line bg-card text-dim"}`,children:"sending"===N?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i,{className:"h-4.5 w-4.5 animate-spin motion-reduce:animate-none","aria-hidden":!0})," ","Sendingâ¦"]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d,{className:"h-4.5 w-4.5","aria-hidden":!0})," ",M?"Send message":"Contact form not configured yet"]})}),(0,a.jsxs)("div",{"aria-live":"polite",children:["error"===N&&(0,a.jsxs)("p",{className:"mt-4 flex items-start justify-center gap-2 rounded-lg border border-red-500/30 bg-red-500/10 p-3.5 text-center text-sm text-red-300",children:[(0,a.jsx)(o,{className:"mt-0.5 h-4 w-4 shrink-0","aria-hidden":!0}),(0,a.jsx)("span",{children:M?"Something went wrong sending the message â nothing you typed was lost. Please try again in a moment.":"The message was not sent â the form endpoint is not configured yet, so nothing was delivered or stored."})]}),"mailto"===N&&(0,a.jsx)("p",{className:"mt-4 rounded-lg border border-brand-500/30 bg-brand-500/10 p-3.5 text-center text-sm text-brand-300",children:"Your email app should have opened with the message pre-filled. If nothing happened, your browser has no mail client configured."})]}),e?(0,a.jsxs)("p",{className:"mt-4 text-center text-xs text-dim",children:["Prefer email?"," ",(0,a.jsx)("a",{href:`mailto:${e}`,className:"font-medium text-muted hover:text-fg",children:e})]}):null]})]})]})}],93767)}]);
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.