1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9575],{11267:(e,t,a)=>{"use strict";a.d(t,{HomeClient:()=>eD});var r=a(95155),s=a(12115),l=a(26497),n=a(15599),i=a(90368),o=a(5208),d=a(58734),c=a(52056),m=a(89559),u=a(41696),x=a(64269),p=a(26614),h=a(77321);function g(e,t){h.pi&&p.Ay.capture(e,t)}var b=a(65229),f=a(95740),y=a(52987),v=a(85921),j=a(5917),N=a(35299);function w(e){let{variant:t="primary",size:a="md",loading:s=!1,className:l,children:n,disabled:i,...o}=e;return(0,r.jsxs)("button",{className:(0,x.cn)("inline-flex items-center justify-center gap-2 font-semibold rounded-none transition-all duration-200 select-none focus:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50 disabled:cursor-not-allowed",{primary:"bg-primary text-primary-foreground hover:bg-primary/90 active:scale-[0.98] shadow-sm hover:shadow-md",secondary:"bg-transparent border border-border text-muted-foreground hover:text-foreground hover:border-foreground/30 active:scale-[0.98]",ghost:"bg-transparent text-muted-foreground hover:text-foreground hover:bg-muted/60 active:scale-[0.98]",gold:"bg-secondary text-secondary-foreground border border-border hover:bg-muted active:scale-[0.98] shadow-sm",danger:"bg-red-500/10 border border-red-500/30 text-red-400 hover:bg-red-500/20 active:scale-[0.98]"}[t],{sm:"px-3 py-1.5 text-xs",md:"px-5 py-2.5 text-sm",lg:"px-7 py-3.5 text-base"}[a],l),disabled:i||s,...o,children:[s&&(0,r.jsx)(N.A,{className:"w-4 h-4 animate-spin"}),n]})}let k=[{label:"7 Skin Metrics",desc:"Scored with AR/VR facial mapping"},{label:"Treatment Recommendations",desc:"Personalised plan tailored to your results"},{label:"AM/PM Skincare Schedule",desc:"Custom morning and evening routines"},{label:"Personal Skin Advisor",desc:"Ask UMI anything about your results"},{label:"AR/VR AI Technology",desc:"Purpose-built vision AI, not a chatbot"},{label:"Private & Secure",desc:"Your data is never stored"}],S=[{score:84,label:"Eye Bags",posClass:"top-[22%] lg:top-[18%]",lineW:"2.2rem"},{score:88,label:"Firmness",posClass:"top-[39%] lg:top-[35%]",lineW:"1.8rem"},{score:79,label:"Texture",posClass:"top-[54%] lg:top-[50%]",lineW:"1.4rem"}],_=[{score:91,label:"Upper Eyelid",posClass:"top-[20%] lg:top-[16%]",lineW:"1.4rem"},{score:77,label:"Dark Circles",posClass:"top-[36%] lg:top-[32%]",lineW:"1.8rem"},{score:86,label:"Wrinkles",posClass:"top-[50%] lg:top-[46%]",lineW:"2.2rem"}];function C(e){let{score:t,label:a}=e,s=(0,x.YH)(t);return(0,r.jsxs)("div",{className:"backdrop-blur-md bg-card/95 border border-border rounded-none px-2 py-1.5 shrink-0 shadow-sm",children:[(0,r.jsx)("p",{className:"font-black text-sm leading-none",style:{color:s},children:t}),(0,r.jsx)("p",{className:"text-muted-foreground text-[9px] mt-0.5 leading-tight whitespace-nowrap",children:a})]})}function P(){return(0,r.jsx)("div",{className:"relative mx-auto",style:{maxWidth:460},children:(0,r.jsx)("div",{style:{WebkitMaskImage:"radial-gradient(ellipse 92% 88% at 50% 40%, black 45%, transparent 80%)",maskImage:"radial-gradient(ellipse 92% 88% at 50% 40%, black 45%, transparent 80%)"},children:(0,r.jsxs)("div",{className:"relative overflow-hidden rounded-xl aspect-[3/3.4] lg:aspect-[1/1]",children:[(0,r.jsx)("img",{src:"/umi.jpg",alt:"Skin analysis demo",className:"w-full h-full object-cover object-top lg:object-[center_15%]"}),(0,r.jsx)("div",{className:"absolute inset-0",style:{background:"radial-gradient(ellipse 70% 65% at 50% 36%, transparent 52%, rgba(9,9,21,0.45) 88%)"}}),(0,r.jsx)("div",{className:"absolute inset-0",style:{background:"linear-gradient(to top, rgba(9,9,21,1) 0%, transparent 35%)"}}),(0,r.jsx)("div",{className:"absolute inset-0",style:{background:"linear-gradient(to bottom, rgba(9,9,21,0.35) 0%, transparent 18%)"}}),(0,r.jsx)(n.P.div,{className:"absolute left-0 right-0 bottom-0",style:{backdropFilter:"blur(5px)",background:"rgba(9,9,21,0.28)"},animate:{height:["93%","7%"]},transition:{duration:3,repeat:1/0,ease:"linear",repeatDelay:1.5}}),(0,r.jsx)("div",{className:"absolute w-[38%] rounded-[50%] border border-primary/35 aspect-[3/4.6] lg:aspect-[3/3.8]",style:{to
1p:"4%",left:"50%",transform:"translateX(-50%)",boxShadow:"0 0 20px color-mix(in oklch, var(--foreground) 12%, transparent)"}}),(0,r.jsx)("div",{className:"absolute top-3 left-3 w-4 h-4 border-t-2 border-l-2 border-primary/55"}),(0,r.jsx)("div",{className:"absolute top-3 right-3 w-4 h-4 border-t-2 border-r-2 border-primary/55"}),(0,r.jsx)("div",{className:"absolute bottom-3 left-3 w-4 h-4 border-b-2 border-l-2 border-primary/55"}),(0,r.jsx)("div",{className:"absolute bottom-3 right-3 w-4 h-4 border-b-2 border-r-2 border-primary/55"}),(0,r.jsx)(n.P.div,{className:"absolute left-0 right-0 h-px pointer-events-none",style:{background:"linear-gradient(90deg, transparent, color-mix(in oklch, var(--foreground) 65%, transparent) 25%, color-mix(in oklch, var(--foreground) 65%, transparent) 75%, transparent)",boxShadow:"0 0 8px color-mix(in oklch, var(--foreground) 35%, transparent)"},animate:{top:["7%","90%"]},transition:{duration:3,repeat:1/0,ease:"linear",repeatDelay:1.5}}),(0,r.jsx)("div",{className:"absolute top-0 left-0 right-0 px-3 py-3",children:(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-primary animate-pulse"}),(0,r.jsx)("span",{className:"text-primary text-[8px] font-mono font-bold tracking-[0.15em]",children:"SCAN COMPLETE"})]})}),S.map(e=>{let{score:t,label:a,posClass:s,lineW:l}=e;return(0,r.jsxs)("div",{className:"absolute left-2 flex items-center gap-1 ".concat(s),children:[(0,r.jsx)(C,{score:t,label:a}),(0,r.jsx)("div",{className:"h-px bg-primary/30",style:{width:l}}),(0,r.jsx)("div",{className:"w-1 h-1 rounded-full bg-primary/50 shrink-0"})]},a)}),_.map(e=>{let{score:t,label:a,posClass:s,lineW:l}=e;return(0,r.jsxs)("div",{className:"absolute right-2 flex items-center flex-row-reverse gap-1 ".concat(s),children:[(0,r.jsx)(C,{score:t,label:a}),(0,r.jsx)("div",{className:"h-px bg-primary/30",style:{width:l}}),(0,r.jsx)("div",{className:"w-1 h-1 rounded-full bg-primary/50 shrink-0"})]},a)}),(0,r.jsx)("div",{className:"absolute bottom-0 left-0 right-0 px-4 py-3",children:(0,r.jsxs)("div",{className:"flex items-end justify-between",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-white/35 text-[8px] uppercase tracking-wider mb-0.5",children:"Overall Score"}),(0,r.jsxs)("div",{className:"flex items-baseline gap-1",children:[(0,r.jsx)("span",{className:"text-white text-3xl font-black leading-none tabular-nums",children:"84"}),(0,r.jsx)("span",{className:"text-white/30 text-xs",children:"/100"})]})]}),(0,r.jsxs)("div",{className:"text-right",children:[(0,r.jsx)("p",{className:"text-primary text-xs font-bold leading-tight",children:"The Glow Architect"}),(0,r.jsx)("p",{className:"text-white/30 text-[8px] mt-0.5 uppercase tracking-wide",children:"Tier 3"})]})]})})]})})})}function I(e){let{onClose:t}=e;return(0,r.jsx)(l.N,{children:(0,r.jsxs)(n.P.div,{className:"fixed inset-0 z-50 flex items-center justify-center p-4",initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},onClick:t,children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-black/80 backdrop-blur-sm"}),(0,r.jsxs)(n.P.div,{className:"relative w-full max-w-3xl z-10",initial:{opacity:0,scale:.94,y:12},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.94,y:12},transition:{type:"spring",stiffness:300,damping:28},onClick:e=>e.stopPropagation(),children:[(0,r.jsxs)("button",{onClick:t,className:"absolute -top-10 right-0 text-muted-foreground hover:text-foreground transition-colors flex items-center gap-1.5 text-sm","aria-label":"Close video",children:[(0,r.jsx)(b.A,{className:"w-4 h-4"}),"Close"]}),(0,r.jsx)("div",{className:"relative w-full rounded-none overflow-hidden border border-border bg-card",style:{paddingBottom:"56.25%",boxShadow:"0 32px 64px color-mix(in oklch, var(--foreground) 12%, transparent)"},children:(0,r.jsx)("iframe",{className:"absolute inset-0 w-full h-full",src:"https://www.youtube.com/embed/".concat("lJvo5F-8nwU","?autoplay=1&rel=0&modestbranding=1"),title:"How it works",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})})]},"modal")]},"backdrop")})}function A(e){let{onStart:t}=e,[a,l]=(0,s.useState)(!1);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("section",{className:"min-h-screen flex flex-col items-center justify-center px-4 py-24 relative overflow-hidden",children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-gradient-to-b from-muted/30 via-background to-background pointer-events-none"}),(0,r.jsx)("div",{className:"absolute top-1/3 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[600px] h-[400px] rounded-full bg-primary/[0.06] blur-[100px] pointer-events-none"}),(0,r.jsx)("div",{className:"relative z-10 w-full max-w-5xl mx-auto",children:(0,r.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-[1fr_auto] lg:grid-rows-[auto_1fr] gap-x-16 gap-y-6 lg:gap-y-8",children:[(0,r.jsxs)("div",{className:"text-center lg:text-left order-1 lg:col-start-1 lg:row-start-1",children:[(0,r.jsxs)(n.P.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{delay:.1},className:"inline-flex items-center gap-2 px-3 py-1.5 rounded-full border border-primary/25 bg-primary/10 text-primary text-xs font-medium mb-6",children:[(0,r.jsx)(f.A,{className:"w-3 h-3"}),"AI Skin Intelligence"]}),(0,r.jsxs)(n.P.h1,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2},className:"text-5xl md:text-6xl font-bold leading-tight mb-5",children:[(0,r.jsx)("span",{className:"text-foreground",children:"Know Your"}),(0,r.jsx)("br",{}),(0,r.jsx)("span",{className:"bg-gradient-to-r from-foreground via-foreground/70 to-muted-foreground bg-clip-text text-transparent",children:"Skin Score"})]}),(0,r.jsx)(n.P.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.28},className:"flex flex-wrap gap-2 justify-center lg:justify-start",children:["7 Skin Concerns","Treatment Plan","Daily Routine","Skin Advisor"].map(e=>(0,r.jsx)("span",{className:"text-[10px] font-medium px-2.5 py-1 rounded-full border border-border text-muted-foreground bg-muted/40",children:e},e))})]}),(0,r.jsx)(n.P.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{delay:.3},className:"order-2 lg:col-start-2 lg:row-start-1 lg:row-span-2 flex items-center",children:(0,r.jsx)(P,{})}),(0,r.jsxs)("div",{className:"text-center lg:text-left order-3 lg:col-start-1 lg:row-start-2",children:[(0,r.jsxs)(n.P.p,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.35},className:"text-muted-foreground text-lg max-w-md mx-auto lg:mx-0 mb-8 leading-relaxed",children:["Take a selfie. Get 7 skin metrics scored with AR/VR AI technology, a personalised treatment plan, daily AM/PM skincare routines, a personal skin advisor, and a"," ",(0,r.jsx)("span",{className:"shimmer-text font-semibold",children:"downloadable skin report"})," ","- all in under 60 seconds."]}),(0,r.jsxs)(n.P.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.4},className:"flex flex-col sm:flex-row items-center lg:items-start justify-center lg:justify-start gap-4 mb-14",children:[(0,r.jsxs)(w,{variant:"primary",size:"lg",onClick:t,className:"group min-w-[200px]",children:["Analyse My Skin",(0,r.jsx)(y.A,{className:"w-4 h-4 transition-transform group-hover:translate-x-1"})]}),(0,r.jsxs)("div",{className:"flex items-center gap-3 self-center",children:[(0,r.jsx)("span",{className:"text-muted-foreground text-sm font-medium",children:"$2.99/scan"}),(0,r.jsx)("span",{className:"text-border text-sm",children:"\xb7"}),(0,r.jsxs)("button",{onClick:()=>l(!0),className:"group flex items-center gap-1.5 text-muted-foreground text-sm font-medium hover:text-foreground transition-colors",children:[(0,r.jsxs)("span",{className:"relative flex items-center justify-center w-6 h-6 rounded-full border border-border bg-muted/40 group-hover:border-primary/40 group-hover:bg-primary/10 transition-all duration-200",children:[(0,r.jsx)(v.A,{className:"w-2.5 h-2.5 fill-current text-muted-foreground group-hover:text-primary transition-colors translate-x-px"}),(0,r.jsx)("span",{className:"absolute inset-0 rounded-full border border-primary/0 group-hover:border-primary/25 group-hover:scale-125 transition-all duration-300"})]}),"Watch how it works"]})]})]}),(0,r.jsxs)(n.P.div,{initial:{opacity:0,y:20}
1,animate:{opacity:1,y:0},transition:{delay:.5},className:"max-w-sm mx-auto lg:mx-0",children:[(0,r.jsx)("p",{className:"text-[10px] font-semibold uppercase tracking-[0.15em] text-primary/70 mb-3 text-center lg:text-left",children:"Everything included"}),(0,r.jsx)("div",{className:"flex flex-col gap-3 lg:hidden text-left",children:k.map(e=>{let{label:t,desc:a}=e;return(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"w-4 h-4 rounded-full bg-primary/10 border border-primary/25 flex items-center justify-center shrink-0",children:(0,r.jsx)(j.A,{className:"w-2.5 h-2.5 text-primary"})}),(0,r.jsxs)("p",{className:"text-sm text-foreground/90 leading-tight",children:[(0,r.jsx)("span",{className:"text-foreground font-medium",children:t}),(0,r.jsxs)("span",{className:"text-muted-foreground",children:[" - ",a]})]})]},t)})}),(0,r.jsx)("div",{className:"hidden lg:grid grid-cols-2 gap-x-6 gap-y-3.5",children:k.map(e=>{let{label:t,desc:a}=e;return(0,r.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,r.jsx)("div",{className:"w-4 h-4 rounded-full bg-primary/10 border border-primary/25 flex items-center justify-center shrink-0 mt-0.5",children:(0,r.jsx)(j.A,{className:"w-2.5 h-2.5 text-primary"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-foreground text-sm font-semibold leading-tight",children:t}),(0,r.jsx)("p",{className:"text-muted-foreground text-xs leading-snug mt-0.5",children:a})]})]},t)})})]})]})]})}),(0,r.jsx)(n.P.a,{initial:{opacity:0}
1,animate:{opacity:1},transition:{delay:.8},href:"/leaderboard",className:"mt-12 text-muted-foreground text-sm hover:text-primary transition-colors flex items-center gap-1.5",children:"View public leaderboard â"})]}),a&&(0,r.jsx)(I,{onClose:()=>l(!1)})]})}let F=["Texture","Firmness","Eye Bags","Dark Circles","Wrinkles","Radiance"],E=[0,60,120,180,240,300],T=["Detecting facial featuresâ¦","Scoring skin metricsâ¦","Analysing eye areaâ¦","Evaluating firmness & textureâ¦","Generating treatment planâ¦","Personalising recommendationsâ¦","Finalising your reportâ¦"];function z(e){let{loadingStep:t}=e;return(0,r.jsxs)("div",{className:"flex flex-col items-center text-center",children:[(0,r.jsxs)("div",{className:"relative w-72 h-72 mb-10",children:[(0,r.jsx)("div",{className:"absolute inset-0 rounded-full pointer-events-none",style:{background:"radial-gradient(circle, color-mix(in oklch, var(--foreground) 8%, transparent) 0%, transparent 68%)"}}),(0,r.jsx)("div",{className:"absolute top-1 left-1 w-5 h-5 border-t-2 border-l-2 border-primary/45"}),(0,r.jsx)("div",{className:"absolute top-1 right-1 w-5 h-5 border-t-2 border-r-2 border-primary/45"}),(0,r.jsx)("div",{className:"absolute bottom-1 left-1 w-5 h-5 border-b-2 border-l-2 border-primary/45"}),(0,r.jsx)("div",{className:"absolute bottom-1 right-1 w-5 h-5 border-b-2 border-r-2 border-primary/45"}),F.map((e,t)=>{let a=(E[t]-90)*Math.PI/180,s=50+46*Math.cos(a),l=50+46*Math.sin(a);return(0,r.jsx)(n.P.span,{className:"absolute text-[8px] font-bold uppercase tracking-[0.14em] text-primary/55 whitespace-nowrap pointer-events-none",style:{left:"".concat(s,"%"),top:"".concat(l,"%"),transform:"translate(-50%, -50%)"},animate:{opacity:[.25,.85,.25]},transition:{duration:2.8,repeat:1/0,delay:.46*t,ease:"easeInOut"},children:e},e)}),(0,r.jsxs)("div",{className:"absolute inset-12",children:[(0,r.jsx)("div",{className:"absolute inset-0 rounded-full border border-primary/15"}),(0,r.jsx)(n.P.div,{className:"absolute inset-0 rounded-full",animate:{rotate:360},transition:{duration:3.5,repeat:1/0,ease:"linear"},style:{background:"conic-gradient(from 0deg, transparent 0deg, color-mix(in oklch, var(--foreground) 18%, transparent) 65deg, transparent 65deg)"}}),(0,r.jsx)(n.P.div,{className:"absolute inset-0 rounded-full",animate:{rotate:360},transition:{duration:12,repeat:1/0,ease:"linear"},style:{border:"1.5px dashed color-mix(in oklch, var(--foreground) 28%, transparent)"}}),(0,r.jsx)(n.P.div,{className:"absolute inset-4 rounded-full",animate:{rotate:-360},transition:{duration:7,repeat:1/0,ease:"linear"},style:{border:"1.5px solid transparent",borderTopColor:"color-mix(in oklch, var(--foreground) 55%, transparent)",borderRightColor:"rgba(139,92,246,0.35)",borderBottomColor:"transparent",borderLeftColor:"rgba(139,92,246,0.2)"}}),(0,r.jsx)(n.P.div,{className:"absolute inset-8 rounded-full",animate:{rotate:360},transition:{duration:4.5,repeat:1/0,ease:"linear"},style:{border:"1px solid transparent",borderTopColor:"rgba(245,158,11,0.5)",borderBottomColor:"rgba(245,158,11,0.15)"}}),(0,r.jsx)(n.P.div,{className:"absolute inset-8 rounded-full",animate:{scale:[1,1.18,1],opacity:[.3,.65,.3]},transition:{duration:2.2,repeat:1/0,ease:"easeInOut"},style:{background:"radial-gradient(circle, color-mix(in oklch, var(--foreground) 22%, transparent) 0%, transparent 65%)"}}),E.map((e,t)=>{let a=(e-90)*Math.PI/180,s=50+38*Math.cos(a),l=50+38*Math.sin(a);return(0,r.jsx)(n.P.div,{className:"absolute w-1 h-1 rounded-full bg-primary",style:{left:"".concat(s,"%"),top:"".concat(l,"%"),transform:"translate(-50%, -50%)",boxShadow:"0 0 5px color-mix(in oklch, var(--foreground) 45%, transparent)"},animate:{opacity:[.2,1,.2],scale:[.7,1.4,.7]},transition:{duration:2,repeat:1/0,delay:.33*t,ease:"easeInOut"}},e)}),(0,r.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-1",children:[(0,r.jsx)(n.P.div,{className:"w-2 h-2 rounded-full bg-primary",animate:{opacity:[.5,1,.5],scale:[.9,1.2,.9]},transition:{duration:1.8,repeat:1/0},style:{boxShadow:"0 0 12px color-mix(in oklch, var(--foreground) 40%, transparent)"}}),(0,r.jsx)(n.P.p,{className:"text-primary text-[7px] font-black tracking-[0.25em] uppercase",animate:{o
1pacity:[.5,1,.5]},transition:{duration:1.8,repeat:1/0},children:"UMPH.AI"})]})]})]}),(0,r.jsx)("h2",{className:"text-2xl font-bold text-foreground mb-3 tracking-tight",children:"Analysing Your Skin"}),(0,r.jsx)(l.N,{mode:"wait",children:(0,r.jsxs)(n.P.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8},transition:{duration:.3},className:"flex items-center gap-2 mb-7",children:[(0,r.jsx)(n.P.span,{className:"w-1.5 h-1.5 rounded-full bg-primary shrink-0",animate:{opacity:[.4,1,.4]},transition:{duration:1.2,repeat:1/0}}),(0,r.jsx)("p",{className:"text-muted-foreground text-sm",children:T[t]})]},t)}),(0,r.jsx)("div",{className:"w-64 h-1.5 bg-border rounded-full overflow-hidden",children:(0,r.jsx)(n.P.div,{initial:{width:"5%"},animate:{width:"".concat((t+1)/T.length*95,"%")},transition:{duration:.6,ease:"easeOut"},className:"h-full bg-primary rounded-full",style:{boxShadow:"0 0 10px color-mix(in oklch, var(--foreground) 25%, transparent)"}})}),(0,r.jsxs)("p",{className:"text-muted-foreground/70 text-[10px] mt-2 tabular-nums",children:[t+1," / ",T.length]}),(0,r.jsx)("p",{className:"text-muted-foreground/70 text-[10px] mt-5",children:"Do not refresh - your analysis will be lost"})]})}var D=a(95664),M=a(48314),R=a(87855);let O=["No makeup or heavy filters","Good, even lighting - face the light source","Look straight at the camera","Keep a neutral expression"];function U(e){let{onCapture:t,onUploadMode:a}=e,l=(0,s.useRef)(null),i=(0,s.useRef)(null),o=(0,s.useRef)(null),[d,c]=(0,s.useState)(!1),[m,u]=(0,s.useState)(!1),[x,p]=(0,s.use
1State)(null),[h,g]=(0,s.useState)(null),[b,y]=(0,s.useState)(!1),[v,j]=(0,s.useState)(!1),[N,k]=(0,s.useState)(null);(0,s.useEffect)(()=>()=>{var e;o.current&&clearInterval(o.current),null==(e=i.current)||e.getTracks().forEach(e=>e.stop())},[]),(0,s.useEffect)(()=>{d&&!x&&l.current&&i.current&&(l.current.srcObject=i.current)},[d,x]);let S=(0,s.useCallback)(async()=>{var e;if(!(null==(e=navigator.mediaDevices)?void 0:e.getUserMedia))return void g("Camera requires a secure connection (HTTPS). Please upload a photo instead.");try{i.current=await navigator.mediaDevices.getUserMedia({video:{facingMode:"user",width:{ideal:1280},height:{ideal:720}},audio:!1}),c(!0)}catch(t){let e=t.name;"NotAllowedError"===e||"PermissionDeniedError"===e?g("Camera permission denied. Please allow camera access in your browser settings, or upload a photo instead."):"NotFoundError"===e||"DevicesNotFoundError"===e?g("No camera found on this device. Please upload a photo instead."):g("Could not access camera. Please upload a photo instead.")}},[]),_=(0,s.useCallback)(()=>{let e=l.current;if(!e)return;let t=e.videoWidth||1280,a=e.videoHeight||720,r=0,s=0,n=t,i=a,d=3/4;t/a>3/4?r=Math.round((t-(n=Math.round(a*d)))/2):s=Math.round((a-(i=Math.round(t/d)))/2);let c=document.createElement("canvas");c.width=n,c.height=i;let m=c.getContext("2d");m&&(m.translate(c.width,0),m.scale(-1,1),m.drawImage(e,r,s,n,i,0,0,n,i),o.current&&clearInterval(o.current),o.current=null,k(null),y(!1),p(c.toDataURL("image/jpeg",.92)))},[]);(0,s.useEffect)(()=>{if(!m||x){o.current&&clearInterval(o.current),o.current=null,k(null),y(!1),j(!1);return}let e=0,t=null,a=0;return o.current=setInterval(()=>{let r=l.current;if(!r)return;let{brightness:s,skinRatio:n}=function(e){try{let t=document.createElement("canvas");t.width=80,t.height=107;let a=t.getContext("2d");if(!a)return{brightness:128,skinRatio:0};a.drawImage(e,0,0,80,107);let r=a.getImageData(10,13,60,80).data,s=0,l=0,n=r.length/4;for(let e=0;e<r.length;e+=4){let t=r[e],a=r[e+1],n=r[e+2];s+=.299*t+.587*a+.114*n;let i=.299*t+.587*a+.114*n,o=-.169*t-.331*a+.5*n+128,d=.5*t-.419*a-.081*n+128;i>80&&o>=77&&o<=127&&d>=133&&d<=173&&l++}return{brightness:s/n,skinRatio:l/n}}catch(e){return{brightness:128,skinRatio:0}}}(r),i=s>=70&&s<=215,d=n>=.15,c=i&&d;if(y(i),j(d),c){if(++e>=4&&null===t&&(t=3,a=Date.now(),k(t)),null!==t){let e=Date.now();e-a>=1e3&&(t--,a=e,k(t),t<=0&&(clearInterval(o.current),o.current=null,_()))}}else e=0,null!==t&&(t=null,k(null))},250),()=>{o.current&&clearInterval(o.current),o.current=null,k(null),y(!1),j(!1)}},[m,x,_]);let C=(0,s.useCallback)(()=>{p(null),u(!1)},[]),P=(0,s.useCallback)(()=>{x&&fetch(x).then(e=>e.blob()).then(e=>t(e,x))},[x,t]),I=b&&v,A=null!==N?"#22c55e":I?"#fafafa":"rgba(255,255,255,0.35)",F=null!==N||I?"none":"8 5",E=null!==N?"Hold still\xe2â¬\xa6":I?"Good - hold still":b||v?b?"Move your face into the oval":"Improve your lighting":"Adjust lighting & move closer";return(0,r.jsxs)("div",{className:"max-w-xl mx-auto px-4 py-8",children:[(0,r.jsxs)("div",{className:"text-center mb-6",children:[(0,r.jsx)("h2",{className:"text-2xl font-bold text-white mb-1",children:"Position Your Face"}),(0,r.jsx)("p",{className:"text-muted-foreground text-sm",children:"Fit your face in the oval \xb7 Auto-captures when ready"})]}),(0,r.jsx)("div",{className:"relative rounded-3xl overflow-hidden bg-black aspect-[3/4] w-full max-w-sm mx-auto mb-4",children:x?(0,r.jsxs)("div",{className:"relative w-full h-full",children:[(0,r.jsx)("img",{src:x,alt:"Preview",className:"w-full h-full object-cover"}),(0,r.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-black/60 to-transparent"}),(0,r.jsxs)("div",{className:"absolute bottom-5 left-0 right-0 flex items-center justify-center gap-4 px-6",children:[(0,r.jsxs)("button",{onClick:C,className:"flex items-center gap-1.5 px-4 py-2 rounded-full bg-white/10 border border-white/20 backdrop-blur-sm text-white text-sm font-medium hover:bg-white/20 transition-all",children:[(0,r.jsx)(M.A,{className:"w-3.5 h-3.5"}),"Retake"]}),(0,r.jsxs)("button",{onClick:P,className:"flex items-center gap-1.5 px-5 py-2 rounded-full bg-primary text-primary-foreground text-sm font-bold hover:bg-primary/90 transition-all",children:[(0,r.jsx)(f.A,{className:"w-3.5 h-3.5"}),"Use Photo"]})]})]}):(0,r.jsx)(r.Fragment,{children:h?(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center h-full gap-3 p-6",children:[(0,r.jsx)(D.A,{className:"w-12 h-12 text-muted-foreground"}),(0,r.jsx)("p",{className:"text-muted-foreground text-sm text-center",children:h}),(0,r.jsx)(w,{variant:"secondary",size:"sm",onClick:a,children:"Upload photo instead"})]}):d?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("video",{ref:l,autoPlay:!0,playsInl
1ine:!0,muted:!0,onCanPlay:()=>u(!0),className:"w-full h-full object-cover",style:{transform:"scaleX(-1)"}}),m&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("svg",{className:"absolute inset-0 w-full h-full pointer-events-none",viewBox:"0 0 300 400",preserveAspectRatio:"none",children:[(0,r.jsx)("defs",{children:(0,r.jsxs)("mask",{id:"oval-mask",children:[(0,r.jsx)("rect",{width:"300",height:"400",fill:"white"}),(0,r.jsx)("ellipse",{cx:"150",cy:"190",rx:"120",ry:"154",fill:"black"})]})}),(0,r.jsx)("rect",{width:"300",height:"400",fill:"rgba(6,6,15,0.55)",mask:"url(#oval-mask)"}),(0,r.jsx)("ellipse",{cx:"150",cy:"190",rx:"105",ry:"137",fill:"none",stroke:A,strokeWidth:null!==N?3:2,strokeDasharray:F,style:{transition:"stroke 0.4s ease, stroke-width 0.2s ease"}})]}),null!==N&&N>0&&(0,r.jsx)("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:(0,r.jsx)(n.P.span,{initial:{scale:1.6,opacity:0},animate:{scale:1,opacity:1},transition:{duration:.25},className:"text-white font-black text-8xl",style:{textShadow:"0 0 40px rgba(34,197,94,0.9)"},children:N},N)}),(0,r.jsxs)("div",{className:"absolute bottom-5 left-0 right-0 flex flex-col items-center gap-3",children:[(0,r.jsx)("span",{className:"text-xs font-medium px-3 py-1 rounded-full bg-black/50 backdrop-blur-sm transition-colors duration-300",style:{color:null!==N?"#22c55e":b?"rgba(255,255,255,0.95)":"rgba(255,255,255,0.5)"},children:E}),(0,r.jsx)("button",{onClick:_,className:"w-16 h-16 rounded-full bg-white/10 border-2 border-white/60 backdrop-blur-sm flex items-center justify-center hover:bg-white/20 active:scale-95 transition-all",title:"Capture now",children:(0,r.jsx)("div",{className:"w-11 h-11 rounded-full bg-white"})})]})]})]}):(0,r.jsxs)("button",{onClick:S,className:"flex flex-col items-center justify-center h-full w-full gap-4 p-6 hover:bg-white/5 transition-colors",children:[(0,r.jsx)("div",{className:"w-16 h-16 rounded-full bg-primary/10 border border-primary/30 flex items-center justify-center",children:(0,r.jsx)(D.A,{className:"w-8 h-8 text-primary"})}),(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)("p",{className:"text-white font-semibold text-sm",children:"Tap to enable camera"}),(0,r.jsx)("p",{className:"text-muted-foreground text-xs mt-1",children:"You'll be asked to allow access"})]})]})})}),!x&&!h&&(0,r.jsx)(n.P.ul,{initial:{opacity:0}
1,animate:{opacity:1},className:"space-y-1.5 mb-6",children:O.map(e=>(0,r.jsxs)("li",{className:"flex items-start gap-2 text-muted-foreground text-xs",children:[(0,r.jsx)("span",{className:"text-primary mt-0.5",children:"â¢"}),e]},e))}),!x&&!h&&(0,r.jsxs)(w,{variant:"ghost",size:"md",onClick:a,className:"w-full",children:[(0,r.jsx)(R.A,{className:"w-4 h-4"}),"Upload from device instead"]})]})}var W=a(61654),H=a(42529);function L(e){let{onCapture:t,onCameraMode:a}=e,[l,i]=(0,s.useState)(null),[o,d]=(0,s.useState)(null),[c,m]=(0,s.useState)(!1),u=e=>e.type.match(/image\/(jpeg|jpg|png)/)?e.size>0xa00000?void alert("File too large. Maximum size is 10MB."):void(i(URL.createObjectURL(e)),d(e)):void alert("Only JPG and PNG files are supported."),x=(0,s.useCallback)(e=>{e.preventDefault(),m(!1);let t=e.dataTransfer.files[0];t&&u(t)},[]);return(0,r.jsxs)("div",{className:"max-w-xl mx-auto px-4 py-8",children:[(0,r.jsxs)("div",{className:"text-center mb-6",children:[(0,r.jsx)("h2",{className:"text-2xl font-bold text-white mb-1",children:"Upload Your Photo"}),(0,r.jsx)("p",{className:"text-muted-foreground text-sm",children:"JPG or PNG \xb7 Max 10MB \xb7 No makeup, good lighting"})]}),l?(0,r.jsxs)(n.P.div,{initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},className:"relative rounded-3xl overflow-hidden aspect-[3/4] max-w-sm mx-auto",children:[(0,r.jsx)("img",{src:l,alt:"Preview",className:"w-full h-full object-cover"}),(0,r.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-black/60 to-transparent"}),(0,r.jsx)("button",{onClick:()=>{i(null),d(null)},className:"absolute top-3 right-3 w-8 h-8 rounded-full bg-black/50 flex items-center justify-center text-white hover:bg-black/70 transition-colors",children:(0,r.jsx)(b.A,{className:"w-4 h-4"})}),(0,r.jsxs)("div",{className:"absolute bottom-4 left-0 right-0 flex items-center justify-center gap-2 text-white text-sm font-medium",children:[(0,r.jsx)(H.A,{className:"w-4 h-4 text-primary"}),"Ready to analyse"]})]}):(0,r.jsxs)(n.P.label,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},htmlFor:"file-upload",onDragOver:e=>{e.preventDefault(),m(!0)},onDragLeave:()=>m(!1),onDrop:x,className:"flex flex-col items-center justify-center gap-4 border-2 border-dashed rounded-3xl p-14 cursor-pointer transition-all ".concat(c?"border-primary bg-primary/10":"border-border hover:border-primary/40 hover:bg-muted/40"),children:[(0,r.jsx)("div",{className:"w-14 h-14 rounded-none bg-primary/10 flex items-center justify-center",children:(0,r.jsx)(W.A,{className:"w-7 h-7 ".concat(c?"text-primary":"text-muted-foreground")})}),(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)("p",{className:"text-white font-medium mb-1",children:"Drop your photo here"}),(0,r.jsx)("p",{className:"text-muted-foreground text-sm",children:"or click to browse"})]}),(0,r.jsx)("input",{id:"file-upload",type:"file",accept:"image/jpeg,image/jpg,image/png",className:"hidden",onChange:e=>{var t;let a=null==(t=e.target.files)?void 0:t[0];a&&u(a)}})]}),(0,r.jsxs)("div",{className:"mt-5 flex flex-col gap-3",children:[l&&(0,r.jsxs)(w,{variant:"primary",size:"lg",onClick:()=>{o&&l&&t(o,l)},className:"w-full",children:[(0,r.jsx)(H.A,{className:"w-4 h-4"}),"Use This Photo"]}),(0,r.jsxs)(w,{variant:"ghost",size:"md",onClick:a,className:"w-full",children:[(0,r.jsx)(D.A,{className:"w-4 h-4"}),"Use camera instead"]})]})]})}var B=a(24033);let Y=["18-26","27-34","35-44","45-54","55-64","65+"],G=["Woman","Man","Non-binary","Prefer not to say"],J=["Dry","Oily","Combination","Normal","Sensitive"],q=["Asian","Black / African","Hispanic / Latino","Middle Eastern","South Asian","White / Caucasian","Mixed","Other"],K=["glow up mode","snatched and sculpted","age gracefully","fresh faced","glass skin","texture erasure"],V=["no needles","no surgery","open to anything","minimal downtime","none"],X=["no treatment so far","botox","filler","laser treatments","chemical peels","microneedling","other"],$=["wrinkles","dark circles","eye bags","firmness","texture","droopy eyelids","overall aging"];function Q(e){let{label:t,active:a,onClick:s}=e;return(0,r.jsx)("button",{type:"button",onClick:s,className:(0,x.cn)("px-4 py-2.5 rounded-none text-sm font-medium border transition-all duration-150 capitalize",a?"bg-primary/10 border-primary text-primary":"bg-transparent border-border text-muted-foreground hover:border-primary/40 hover:text-foreground"),children:t})}function Z(e){let{options:t,selected:a,onChange:s,max:l=3}=e;return(0,r.jsx)("div",{className:"flex flex-wrap gap-2.5",children:t.map(e=>(0,r.jsx)(Q,{label:e,active:a.includes(e),onClick:()=>{a.includes(e)?s(a.filter(t=>t!==e)):a.length<l&&s([...a,e])}},e))})}function ee(e){let{label:t,options:a,value:s,onChange:l}=e;return(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsxs)("select",{value:s,onChange:e=>l(e.target.value),className:"w-full bg-background border border-border text-foreground rounded-none px-4 py-3.5 text-sm appearance-none cursor-pointer focus:outline-none focus:border-primary/60 transition-colors",children:[(0,r.jsx)("option",{value:"",className:"bg-background text-muted-foreground",children:t}),a.map(e=>(0,r.jsx)("option",{value:e,className:"bg-background",children:e},e))]}),(0,r.jsx)(B.A,{className:"absolute right-3.5 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground pointer-events-none"})]})}function et(e){let{title:t,hint:a,children:s}=e;return(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-foreground text-sm font-semibold",children:t}),a&&(0,r.jsx)("p",{className:"text-muted-foreground text-xs mt-0.5",children:a})]}),s]})}function ea(e){let{onSubmit:t,previewUrl:a,isRetry:l}
1=e,[i,o]=(0,s.useState)(""),[d,c]=(0,s.useState)(""),[m,u]=(0,s.useState)(""),[x,p]=(0,s.useState)(""),[h,g]=(0,s.useState)([]),[b,f]=(0,s.useState)(["none"]),[v,j]=(0,s.useState)(["no treatment so far"]),[N,k]=(0,s.useState)([]),S=i&&d&&m&&N.length>0;return(0,r.jsxs)("div",{className:"max-w-2xl mx-auto px-4 pb-12 pt-6",children:[(0,r.jsxs)("div",{className:"flex items-center gap-4 mb-8 sm:mb-10",children:[(0,r.jsx)("img",{src:a,alt:"Your photo",className:"w-16 h-16 sm:w-20 sm:h-20 rounded-none object-cover border border-border flex-shrink-0"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"text-foreground font-bold text-xl sm:text-2xl leading-tight",children:"About You"}),(0,r.jsx)("p",{className:"text-muted-foreground text-sm mt-0.5",children:"Helps us personalise your skin analysis"})]})]}),(0,r.jsxs)(n.P.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},className:"space-y-8",children:[(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,r.jsx)(et,{title:"Age Bracket *",children:(0,r.jsx)(ee,{label:"Select age",options:Y,value:i,onChange:o})}),(0,r.jsx)(et,{title:"Identity *",children:(0,r.jsx)(ee,{label:"Select",options:G,value:d,onChange:c})}),(0,r.jsx)(et,{title:"Skin Type *",children:(0,r.jsx)(ee,{label:"Select type",options:J,value:m,onChange:u})}),(0,r.jsx)(et,{title:"Ethnicity",children:(0,r.jsx)(ee,{label:"Select",options:q,value:x,onChange:p})})]}),(0,r.jsx)("div",{className:"h-px bg-border"}),(0,r.jsx)(et,{title:"Top Skin Concerns *",hint:"Pick up to 3",children:(0,r.jsx)(Z,{options:$,selected:N,onChange:k,max:3})}),(0,r.jsx)(et,{title:"Glow Goals",hint:"What are you aiming for? Pick up to 3",children:(0,r.jsx)(Z,{options:K,selected:h,onChange:g,max:3})}),(0,r.jsx)("div",{className:"h-px bg-border"}),(0,r.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-8",children:[(0,r.jsx)(et,{title:"Treatment Preferences",hint:"Pick up to 2",children:(0,r.jsx)(Z,{options:V,selected:b,onChange:f,max:2})}),(0,r.jsx)(et,{title:"Beauty History",hint:"Pick up to 3",children:(0,r.jsx)(Z,{options:X,selected:v,onChange:j,max:3})})]}),(0,r.jsxs)(w,{variant:"primary",size:"lg",onClick:()=>{S&&t({actual_age_bracket:i,identity:d,skin_type:m.toLowerCase(),ethnicity:x||"Other",skin_glow_goals:h.length?h:["glow up mode"],treatment_preferences:b.length?b:["none"],beauty_history:v.length?v:["no treatment so far"],concerns:N})},disabled:!S,className:"w-full",children:[l?"Retry Analysis":"Continue to Payment",(0,r.jsx)(y.A,{className:"w-4 h-4"})]}),!S&&(0,r.jsx)("p",{className:"text-center text-muted-foreground text-xs -mt-4",children:"Age, identity, skin type and at least one concern are required"})]})]})}var er=a(94511),es=a(78206),el=a(99708),en=a(45345);function ei(e){let{open:t,onClose:a,title:i,children:o,maxWidth:d="max-w-lg",closable:c=!0}=e;return(0,s.useEffect)(()=>{let e=e=>{"Escape"===e.key&&c&&(null==a||a())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[c,a]),(0,s.useEffect)(()=>(document.body.style.overflow=t?"hidden":"",()=>{document.body.style.overflow=""}),[t]),(0,r.jsx)(l.N,{children:t&&(0,r.jsxs)("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:[(0,r.jsx)(n.P.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-black/70 backdrop-blur-sm",onClick:c?a:void 0}),(0,r.jsx)("div",{className:"flex min-h-full items-center justify-center p-4",children:(0,r.jsxs)(n.P.div,{initial:{opacity:0,scale:.94,y:16},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.94,y:16},transition:{type:"spring",stiffness:300,damping:28},className:"relative my-auto w-full overflow-hidden border-2 border-foreground/10 bg-card shadow-[0_24px_64px_-20px_rgba(0,0,0,0.25)] ".concat(d),children:[(i||c)&&(0,r.jsxs)("div",{className:"flex items-center justify-between border-b-2 border-foreground/10 px-6 py-4",children:[i&&(0,r.jsx)("h2",{className:"font-display text-base font-black tracking-tight text-card-foreground",children:i}),c&&(0,r.jsx)("button",{onClick:a,className:"ml-auto text-muted-foreground hover:text-foreground transition-colors p-1 rounded-none hover:bg-muted/80",children:(0,r.jsx)(b.A,{className:"w-4 h-4"})})]}),(0,r.jsx)("div",{className:"p-6",children:o})]})})]})})}let eo=(0,er.c)("pk_live_51S2ElwHnWWm7fLKLGpJzhEnFOeSa8g7qDNAoWeqGMiGK0iQlq4xfCAs9UM3IjUH3PRIBIgoKXEb5knrvybfCj6rB00Fi5vWu9i"),ed={theme:"stripe",variables:{colorPrimary:"#000000",colorBackground:"#ffffff",colorText:"#000000",colorDanger:"#EF4444",fontFamily:'"Space Mono", ui-monospace, monospace',borderRadius:"0px",spacingUnit:"4px"},rules:{".Input":{border:"1px solid #e5e5e5",backgroundColor:"#ffffff"},".Input:focus":{border:"1px solid #000000"},".Label":{color:"#666666",fontSize:"12px"}}};function ec(e){let{onSuccess:t,onCancel:a}=e,l=(0,es.useStripe)(),i=(0,es.useElements)(),[o,d]=(0,s.useState)(!1),[c,m]=(0,s.useState)(null),[u,x]=(0,s.use
1State)(!1),p=async e=>{var a,r;if(e.preventDefault(),!l||!i)return;d(!0),m(null);let{error:s}=await i.submit();if(s){m(null!=(a=s.message)?a:"Card validation failed"),d(!1);return}let{error:n,paymentIntent:o}=await l.confirmPayment({elements:i,confirmParams:{return_url:window.location.href},redirect:"if_required"});if(n){m(null!=(r=n.message)?r:"Payment failed. Please try again."),d(!1);return}(null==o?void 0:o.status)==="succeeded"&&t(o.id),d(!1)};return(0,r.jsxs)("form",{onSubmit:p,className:"space-y-5",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between p-4 rounded-none bg-muted/50 border border-border",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"w-9 h-9 rounded-none bg-primary/10 flex items-center justify-center",children:(0,r.jsx)(f.A,{className:"w-4 h-4 text-primary"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-primary text-sm font-bold tracking-widest uppercase",children:"UMPH.AI"}),(0,r.jsx)("p",{className:"text-card-foreground text-sm font-semibold",children:"Full Skin Intelligence Report"})]})]}),(0,r.jsx)("span",{className:"text-primary font-bold text-lg",children:"$2.99"})]}),(0,r.jsx)(es.PaymentElement,{options:{layout:"tabs",paymentMethodOrder:["card","apple_pay","google_pay"]}}),c&&(0,r.jsx)(n.P.p,{initial:{opacity:0,y:-4},animate:{opacity:1,y:0},className:"text-red-400 text-sm bg-red-500/10 border border-red-500/20 rounded-xl px-4 py-3",children:c}),(0,r.jsxs)("label",{className:"flex items-start gap-2.5 cursor-pointer group",children:[(0,r.jsx)("input",{type:"checkbox",checked:u,onChange:e=>x(e.target.checked),className:"mt-0.5 accent-primary shrink-0 cursor-pointer"}),(0,r.jsxs)("span",{className:"text-muted-foreground text-xs leading-relaxed group-hover:text-foreground/80 transition-colors",children:["I agree to the"," ",(0,r.jsx)("a",{href:"/terms",target:"_blank",className:"text-primary hover:underline",children:"Terms of Service"})," ","and understand that all results, analysis, and treatment suggestions are for informational purposes only and do not constitute medical advice."]})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,r.jsxs)(w,{type:"submit",variant:"primary",size:"lg",loading:o,disabled:!l||!i||!u,className:"w-full",children:[(0,r.jsx)(el.A,{className:"w-4 h-4"}),"Pay $2.99 Securely"]}),(0,r.jsx)(w,{type:"button",variant:"ghost",size:"md",onClick:a,disabled:o,className:"w-full",children:"Cancel"})]}),(0,r.jsxs)("p",{className:"text-muted-foreground text-xs text-center flex items-center justify-center gap-1.5",children:[(0,r.jsx)(el.A,{className:"w-3 h-3"}),"Secured by Stripe \xb7 Your card info is never stored"]})]})}function em(e){let{open:t,onSuccess:a,onClose:l}=e,[i,o]=(0,s.useState)(null),[d,c]=(0,s.useState)(!1),[m,u]=(0,s.useState)(""),[x,p]=(0,s.use
1State)(null),[h,g]=(0,s.useState)(!1),[b,y]=(0,s.useState)(null),[v,j]=(0,s.useState)(!1),[N,k]=(0,s.useState)(!1);(0,s.useEffect)(()=>{t||(u(""),p(null),g(!1),y(null),o(null),j(!1),k(!1))},[t]),(0,s.useEffect)(()=>{t&&(c(!0),o(null),fetch("/api/stripe/checkout",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})}).then(e=>e.json()).then(e=>o(e.clientSecret)).finally(()=>c(!1)))},[t]);let S=async()=>{if(!m.trim())return;p(null),c(!0);let e=await fetch("/api/stripe/checkout",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({promoCode:m.trim().toUpperCase(),action:"validate"})}),t=await e.json();if(c(!1),t.error)return void p(t.error);0===t.finalAmount&&(g(!0),y(m.trim().toUpperCase()))},_=async()=>{if(!b)return;j(!0);let e=await fetch("/api/stripe/checkout",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({promoCode:b,action:"redeem"})}),t=await e.json();if(j(!1),t.error){p(t.error),g(!1),y(null);return}a(t.paymentIntentId)};return(0,r.jsxs)(ei,{open:t,onClose:l,title:"Complete Your Purchase",maxWidth:"max-w-md",children:[(0,r.jsxs)("div",{className:"flex gap-2 mb-5",children:[(0,r.jsxs)("div",{className:"relative flex-1",children:[(0,r.jsx)(en.A,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-muted-foreground"}),(0,r.jsx)("input",{type:"text",placeholder:"Promo code",value:m,onChange:e=>{u(e.target.value.toUpperCase()),p(null),g(!1),y(null),k(!1)},onKeyDown:e=>"Enter"===e.key&&S(),className:"w-full pl-9 pr-3 py-2 rounded-none bg-background border border-border text-foreground text-sm placeholder:text-muted-foreground focus:outline-none focus:border-primary"})]}),(0,r.jsx)(w,{variant:"ghost",size:"sm",onClick:S,disabled:!m.trim()||d||h,children:"Apply"})]}),x&&(0,r.jsx)(n.P.p,{initial:{opacity:0,y:-4},animate:{opacity:1,y:0},className:"text-red-400 text-xs mb-4 bg-red-500/10 border border-red-500/20 rounded-xl px-3 py-2",children:x}),h&&(0,r.jsx)(n.P.p,{initial:{opacity:0,y:-4},animate:{opacity:1,y:0},className:"text-primary text-xs mb-4 bg-primary/10 border border-border rounded-none px-3 py-2",children:"Promo applied â your scan is free!"}),d&&(0,r.jsx)("div",{className:"flex items-center justify-center py-10",children:(0,r.jsx)("div",{className:"w-8 h-8 border-2 border-border border-t-primary rounded-full animate-spin"})}),!d&&h&&(0,r.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,r.jsxs)("label",{className:"flex items-start gap-2.5 cursor-pointer group",children:[(0,r.jsx)("input",{type:"checkbox",checked:N,onChange:e=>k(e.target.checked),className:"mt-0.5 accent-primary shrink-0 cursor-pointer"}),(0,r.jsxs)("span",{className:"text-muted-foreground text-xs leading-relaxed group-hover:text-foreground/80 transition-colors",children:["I agree to the"," ",(0,r.jsx)("a",{href:"/terms",target:"_blank",className:"text-primary hover:underline",children:"Terms of Service"})," ","and understand that all results, analysis, and treatment suggestions are for informational purposes only and do not constitute medical advice."]})]}),(0,r.jsxs)(w,{variant:"primary",size:"lg",className:"w-full",loading:v,disabled:!N,onClick:_,children:[(0,r.jsx)(f.A,{className:"w-4 h-4"}),"Start Free Scan"]}),(0,r.jsx)(w,{variant:"ghost",size:"md",className:"w-full",onClick:l,disabled:v,children:"Cancel"})]}),!d&&!h&&i&&(0,r.jsx)(es.Elements,{stripe:eo,options:{clientSecret:i,appearance:ed},children:(0,r.jsx)(ec,{onSuccess:a,onCancel:l})})]})}var eu=a(39867),ex=a(6613),ep=a(17181),eh=a(27937);function eg(e){let{originalImage:t,masks:a}=e,[o,d]=(0,s.useState)(0),[c,m]=(0,s.useState)(.65),u=(0,s.useRef)(null),[p,h]=(0,s.use
1State)(0),g=a[o];(0,s.useEffect)(()=>{if(!u.current||!g)return;let e=u.current,a=e.getContext("2d");if(!a)return;let r=new Image,s=new Image,l=0,n=()=>{l<2||(e.width=r.naturalWidth||640,e.height=r.naturalHeight||480,a.clearRect(0,0,e.width,e.height),a.drawImage(r,0,0,e.width,e.height),a.globalAlpha=c,a.globalCompositeOperation="screen",a.drawImage(s,0,0,e.width,e.height),a.globalAlpha=1,a.globalCompositeOperation="source-over")};r.onload=()=>{l++,n()},s.onload=()=>{l++,n()},r.src=t,s.src=g.base64.startsWith("data:")?g.base64:"data:image/png;base64,".concat(g.base64)},[o,c,g,t]);let b=e=>{h(e),d(t=>(t+e+a.length)%a.length)};return a.length?(0,r.jsxs)("div",{className:"w-full",children:[(0,r.jsxs)("div",{className:"relative mx-auto aspect-square max-w-sm overflow-hidden border-2 border-foreground/15 bg-black shadow-[0_20px_50px_-20px_rgba(0,0,0,0.45)]",children:[(0,r.jsx)("canvas",{ref:u,className:"w-full h-full object-contain"}),(0,r.jsx)("button",{type:"button",onClick:()=>b(-1),className:"absolute left-2 top-1/2 flex h-10 w-10 -translate-y-1/2 items-center justify-center border border-white/15 bg-black/60 text-white backdrop-blur-md transition-colors hover:bg-black/80","aria-label":"Previous overlay",children:(0,r.jsx)(i.A,{className:"w-5 h-5"})}),(0,r.jsx)("button",{type:"button",onClick:()=>b(1),className:"absolute right-2 top-1/2 flex h-10 w-10 -translate-y-1/2 items-center justify-center border border-white/15 bg-black/60 text-white backdrop-blur-md transition-colors hover:bg-black/80","aria-label":"Next overlay",children:(0,r.jsx)(eh.A,{className:"w-5 h-5"})}),(0,r.jsx)(l.N,{mode:"wait",children:(0,r.jsx)(n.P.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8},className:"absolute bottom-3 left-0 right-0 flex justify-center",children:(0,r.jsxs)("div",{className:"flex items-center gap-2 border border-white/15 bg-black/70 px-3 py-1.5 font-mono text-[11px] backdrop-blur-md",children:[(0,r.jsx)("span",{className:"w-2 h-2 rounded-full",style:{background:(0,x.YH)(g.score)}}),(0,r.jsx)("span",{className:"text-white text-xs font-semibold",children:g.label}),(0,r.jsx)("span",{className:"text-xs font-bold",style:{color:(0,x.YH)(g.score)},children:g.score})]})},o)})]}),(0,r.jsxs)("div",{className:"mt-3 flex items-center gap-3 max-w-sm mx-auto",children:[(0,r.jsx)("span",{className:"text-muted-foreground text-[10px] font-medium w-16",children:"Overlay"}),(0,r.jsx)("input",{type:"range",min:0,max:1,step:.05,value:c,onChange:e=>m(parseFloat(e.target.value)),className:"flex-1 accent-primary cursor-pointer h-1"}),(0,r.jsxs)("span",{className:"text-muted-foreground text-[10px] w-10 text-right",children:[Math.round(100*c),"%"]})]}),(0,r.jsx)("div",{className:"flex items-center justify-center gap-1.5 mt-4",children:a.map((e,t)=>(0,r.jsx)("button",{type:"button",onClick:()=>{h(t>o?1:-1),d(t)},className:"transition-all duration-200 rounded-full ".concat(t===o?"w-5 h-1.5 bg-primary":"w-1.5 h-1.5 bg-border hover:bg-muted-foreground")},e.key))}),(0,r.jsx)("div",{className:"flex items-center justify-center gap-2 mt-3 overflow-x-auto pb-1 no-scrollbar",children:a.map((e,t)=>(0,r.jsx)("button",{type:"button",onClick:()=>{h(t>o?1:-1),d(t)},className:"shrink-0 px-2.5 py-1 rounded-none text-[11px] font-medium transition-all duration-150 ".concat(t===o?"bg-primary/10 text-primary border border-primary/30":"text-muted-foreground border border-transparent hover:text-foreground"),children:e.label},e.key))})]}):null}function eb(e){let{score:t,size:a=80,strokeWidth:l=5,label:n,sublabel:i,animate:o=!0}=e,d=(a-2*l)/2,c=2*Math.PI*d,m=t/100*c,u=(0,x.YH)(t),p=(0,s.useRef)(null);return(0,s.useEffect)(()=>{p.current&&o&&(p.current.style.strokeDashoffset=String(c),p.current.style.transition="none",requestAnimationFrame(()=>{requestAnimationFrame(()=>{p.current&&(p.current.style.transition="stroke-dashoffset 1.2s cubic-bezier(0.4,0,0.2,1)",p.current.style.strokeDashoffset=String(c-m))})}))},[t,o,c,m]),(0,r.jsxs)("div",{className:"flex flex-col items-center gap-1",children:[(0,r.jsxs)("div",{className:"relative",style:{width:a,height:a},children:[(0,r.jsxs)("svg",{width:a,height:a,className:"-rotate-90",children:[(0,r.jsx)("circle",{cx:a/2,cy:a/2,r:d,fill:"none",stroke:"var(--border)",strokeOpacity:.85,strokeWidth:l}),(0,r.jsx)("circle",{ref:p,cx:a/2,cy:a/2,r:d,fill:"none",stroke:u,strokeWidth:l,strokeLinecap:"round",strokeDasharray:c,strokeDashoffset:o?c:c-m,style:{filter:"drop-shadow(0 0 6px ".concat(u,"60)")}})]}),(0,r.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,r.jsx)("span",{className:"font-bold text-foreground",style:{fontSize:.22*a,lineHeight:1},children:t})})]}),n&&(0,r.jsx)("span",{className:"text-xs font-medium text-muted-foreground text-center leading-tight",children:n}),i&&(0,r.jsx)("span",{className:"text-[10px] text-muted-foreground text-center",children:i})]})}function ef(e){var t,a,s,l,i,o,d,c,m,u,p,h,g,b,f,y,v,j,N,w,k,S,_,C,P,I,A,F,E,T,z,D;let{analysis:M,showHeading:R=!0}=e,O=[{label:"Eye Bags",sublabel:(0,x.rH)(null!=(N=null==(t=M.hd_eye_bag)?void 0:t.ui_score)?N:0),score:null!=(w=null==(a=M.hd_eye_bag)?void 0:a.ui_score)?w:0},{label:"Dark Circles",sublabel:(0,x.rH)(null!=(k=null==(s=M.hd_dark_cir
1cle)?void 0:s.ui_score)?k:0),score:null!=(S=null==(l=M.hd_dark_circle)?void 0:l.ui_score)?S:0},{label:"Upper Eyelid",sublabel:(0,x.rH)(null!=(_=null==(i=M.hd_droopy_upper_eyelid)?void 0:i.ui_score)?_:0),score:null!=(C=null==(o=M.hd_droopy_upper_eyelid)?void 0:o.ui_score)?C:0},{label:"Lower Eyelid",sublabel:(0,x.rH)(null!=(P=null==(d=M.hd_droopy_lower_eyelid)?void 0:d.ui_score)?P:0),score:null!=(I=null==(c=M.hd_droopy_lower_eyelid)?void 0:c.ui_score)?I:0},{label:"Firmness",sublabel:(0,x.rH)(null!=(A=null==(m=M.hd_firmness)?void 0:m.ui_score)?A:0),score:null!=(F=null==(u=M.hd_firmness)?void 0:u.ui_score)?F:0},{label:"Texture",sublabel:(0,x.rH)(null!=(E=null==(h=M.hd_texture)||null==(p=h.whole)?void 0:p.ui_score)?E:0),score:null!=(T=null==(b=M.hd_texture)||null==(g=b.whole)?void 0:g.ui_score)?T:0},{label:"Wrinkles",sublabel:(0,x.rH)(null!=(z=null==(y=M.hd_wrinkle)||null==(f=y.whole)?void 0:f.ui_score)?z:0),score:null!=(D=null==(j=M.hd_wrinkle)||null==(v=j.whole)?void 0:v.ui_score)?D:0}];return(0,r.jsxs)("div",{children:[R?(0,r.jsxs)("div",{className:"mb-5 flex items-center gap-2.5",children:[(0,r.jsx)("span",{className:"h-4 w-0.5 rounded-full bg-pink-500/70"}),(0,r.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Skin scores"})]}):null,(0,r.jsx)("div",{className:"grid grid-cols-4 gap-3 sm:grid-cols-3 sm:gap-4",children:O.map((e,t)=>{let{label:a,sublabel:s,score:l}=e;return(0,r.jsx)(n.P.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.07*t},className:"flex justify-center",children:(0,r.jsx)(eb,{score:l,size:70,strokeWidth:4,label:a,sublabel:s})},a)})})]})}function ey(e){let{summary:t,overallScore:a,skinAge:s,tier:l}=e,i=(0,x.a_)(l);return(0,r.jsxs)(n.P.div,{initial:{opacity:0,y:24},animate:{opacity:1,y:0},transition:{delay:.08,duration:.5,ease:[.22,1,.36,1]}
1,className:"relative overflow-hidden border-2 border-foreground/10 bg-card shadow-[0_16px_48px_-16px_rgba(0,0,0,0.1)]",children:[(0,r.jsx)("div",{className:"pointer-events-none absolute inset-0 opacity-[0.35] mix-blend-overlay",style:{backgroundImage:'url("https://grainy-gradients.vercel.app/noise.svg")'}}),(0,r.jsx)("div",{className:"pointer-events-none absolute -right-32 -top-32 h-80 w-80 rounded-full blur-3xl",style:{background:"radial-gradient(circle, ".concat(i,"28, transparent 65%)")}}),(0,r.jsx)("div",{className:"pointer-events-none absolute inset-x-0 top-0 h-px bg-gradient-to-r from-transparent via-pink-500/40 to-transparent"}),(0,r.jsxs)("div",{className:"relative grid gap-8 p-6 sm:p-8 lg:grid-cols-[minmax(0,1fr)_minmax(0,1.15fr)] lg:gap-12 lg:p-10",children:[(0,r.jsxs)("div",{className:"flex flex-col justify-between",children:[(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"mb-6 flex flex-wrap items-center gap-3",children:[(0,r.jsx)("span",{className:"font-mono text-[10px] font-bold uppercase tracking-[0.2em] text-muted-foreground",children:"Skin identity"}),(0,r.jsx)("span",{className:"border px-2.5 py-1 font-mono text-[10px] font-bold uppercase tracking-widest",style:{color:i,borderColor:"".concat(i,"55"),background:"".concat(i,"10")},children:l})]}),(0,r.jsx)("h2",{className:"font-display text-3xl font-black leading-[1.05] tracking-tight text-foreground sm:text-4xl lg:text-5xl",children:t.nickname}),(0,r.jsxs)("div",{className:"mt-8 flex flex-wrap items-end gap-2",children:[(0,r.jsx)("span",{className:"font-display text-6xl font-black leading-none tracking-tighter text-foreground tabular-nums sm:text-7xl lg:text-8xl",children:a.toFixed(0)}),(0,r.jsx)("span",{className:"pb-2 font-mono text-sm font-bold text-muted-foreground",children:"/ 100"})]}),(0,r.jsx)("p",{className:"mt-2 font-mono text-[11px] uppercase tracking-[0.15em] text-pink-600",children:"Glow composite"})]}),(0,r.jsxs)("dl",{className:"mt-10 grid grid-cols-3 gap-4 border-t-2 border-foreground
1/10 pt-8 sm:max-w-md",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("dt",{className:"font-mono text-[9px] font-bold uppercase tracking-wider text-muted-foreground",children:"Skin age"}),(0,r.jsx)("dd",{className:"mt-1 font-display text-xl font-black tabular-nums",children:s})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("dt",{className:"font-mono text-[9px] font-bold uppercase tracking-wider text-muted-foreground",children:"Vibe"}),(0,r.jsx)("dd",{className:"mt-1 font-display text-lg font-bold leading-tight text-pink-600",children:t.vibe})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("dt",{className:"font-mono text-[9px] font-bold uppercase tracking-wider text-muted-foreground",children:"Symmetry"}),(0,r.jsxs)("dd",{className:"mt-1 font-display text-xl font-black tabular-nums",children:[t.symmetry_score,"/10"]})]})]})]}),(0,r.jsxs)("div",{className:"flex flex-col justify-center border-t-2 border-foreground/10 pt-8 lg:border-l-2 lg:border-t-0 lg:pl-10 lg:pt-0",children:[(0,r.jsx)("p",{className:"text-base font-medium leading-relaxed text-foreground/90 sm:text-lg",children:t.face_card_statement}),(0,r.jsxs)("div",{className:"relative mt-8 border-2 border-pink-500/20 bg-gradient-to-br from-pink-500/[0.06] to-indigo-500/[0.05] p-5 sm:p-6",children:[(0,r.jsx)("div",{className:"absolute left-0 top-0 h-full w-1 bg-gradient-to-b from-pink-500 to-indigo-500"}),(0,r.jsx)("p",{className:"pl-4 text-sm leading-loose text-muted-foreground sm:text-[15px]",children:t.glow_summary})]}),t.motivation_hook?(0,r.jsx)("p",{className:"mt-6 text-center font-display text-xs font-bold uppercase tracking-[0.12em] text-foreground/70",children:t.motivation_hook}):null]})]})]})}var ev=a(12108);let ej=["#ec4899","#a855f7","#6366f1","#8b5cf6"];function eN(e){let{recommendations:t,embedded:a=!1}=e,[l,i]=(0,s.useState)(null),o=t.summary.treatment_plan.map(e=>{let t=e.indexOf(": ");return -1!==t?{phase:e.slice(0,t),description:e.slice(t+2)}:{phase:e,description:""}});return(0,r.jsxs)("div",{children:[a?null:(0,r.jsxs)("div",{className:"mb-6 flex items-center gap-2.5",children:[(0,r.jsx)("span",{className:"h-4 w-0.5 rounded-full bg-pink-500/70"}),(0,r.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Your treatment plan"})]}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("div",{className:"absolute left-5 top-5 bottom-5 w-px pointer-events-none",style:{background:"linear-gradient(to bottom, color-mix(in oklch, var(--foreground) 20%, transparent), color-mix(in oklch, var(--foreground) 8%, transparent), transparent)"}}),(0,r.jsx)("div",{className:"space-y-3",children:o.map((e,a)=>{let{phase:s,description:o}=e,d=ej[a%ej.length],c=(e=>{var t,a;let r=e.match(/^([^to]+?)(?:\s+to\s+|\s+for\s+|$)/i);return null!=(a=null==r||null==(t=r[1])?void 0:t.trim())?a:e.split(" ").slice(0,3).join(" ")})(o),m=t.treatments[c],u=l===a;return(0,r.jsxs)(n.P.div,{initial:{opacity:0,x:-12},animate:{opacity:1,x:0},transition:{delay:.1*a},className:"flex gap-4",children:[(0,r.jsx)("div",{className:"shrink-0 z-10",children:(0,r.jsx)("div",{className:"w-10 h-10 rounded-full flex items-center justify-center text-xs font-black",style:{background:"".concat(d,"12"),border:"1.5px solid ".concat(d,"45"),color:d},children:String(a+1).padStart(2,"0")})}),(0,r.jsx)("div",{className:"flex-1 min-w-0 pb-1",children:(0,r.jsxs)("div",{className:"overflow-hidden border-2 border-foreground
1/10 bg-background/40",style:{borderColor:"".concat(d,"28"),background:"".concat(d,"08")},children:[(0,r.jsxs)("div",{className:"flex items-start justify-between gap-3 p-4",style:{cursor:m?"pointer":"default"},onClick:()=>m&&i(u?null:a),children:[(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("p",{className:"text-[11px] font-bold uppercase tracking-wider mb-1.5",style:{color:d},children:s}),(0,r.jsx)("p",{className:"text-foreground/90 text-sm leading-snug",children:o})]}),m&&(0,r.jsx)("button",{className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors mt-0.5",children:u?(0,r.jsx)(ev.A,{className:"w-4 h-4"}):(0,r.jsx)(B.A,{className:"w-4 h-4"})})]}),u&&m&&(0,r.jsx)(n.P.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},className:"px-4 pb-4",children:(0,r.jsx)("div",{className:"rounded-none p-3 text-xs text-muted-foreground leading-relaxed border border-border",style:{borderColor:"".concat(d,"20"),background:"".concat(d,"08")},children:m})})]})})]},"".concat(s,"-").concat(a))})})]})]})}var ew=a(59427),ek=a(37494);function eS(e){let{step:t,index:a,color:s}=e,l=t.indexOf(": "),i=-1!==l?t.slice(0,l):t,o=-1!==l?t.slice(l+2):"";return(0,r.jsxs)(n.P.div,{initial:{opacity:0,x:-8},animate:{opacity:1,x:0},transition:{delay:.05*a},className:"flex items-start gap-4",children:[(0,r.jsx)("span",{className:"w-6 h-6 rounded-full flex items-center justify-center text-[10px] font-black shrink-0 mt-0.5",style:{background:"".concat(s,"18"),color:s,border:"1px solid ".concat(s,"30")},children:a+1}),(0,r.jsxs)("div",{className:"flex-1 min-w-0 py-0.5",children:[(0,r.jsx)("p",{className:"text-foreground text-sm font-semibold leading-tight",children:i}),o&&(0,r.jsx)("p",{className:"text-muted-foreground text-xs leading-relaxed mt-0.5",children:o})]})]})}function e_(e){let{routine:t,embedded:a=!1}=e,[i,o]=(0,s.useState)("am"),d="am"===i,c=d?t.am:t.pm,m=d?"#F59E0B":"#8B5CF6";return(0,r.jsxs)("div",{children:[a?null:(0,r.jsxs)("div",{className:"mb-5 flex items-center gap-2.5",children:[(0,r.jsx)("span",{className:"h-4 w-0.5 rounded-full bg-pink-500/70"}),(0,r.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Daily skincare routine"})]}),(0,r.jsx)("div",{className:"mb-5 flex w-fit gap-1 border-2 border-foreground
1/10 bg-muted/30 p-1",children:["am","pm"].map(e=>{let t=i===e,a="am"===e?"#F59E0B":"#8B5CF6",s="am"===e?ew.A:ek.A;return(0,r.jsxs)("button",{onClick:()=>o(e),className:"flex items-center gap-2 px-4 py-2.5 text-sm font-bold transition-all ".concat(t?"":"text-muted-foreground"),style:t?{background:"".concat(a,"18"),color:a,boxShadow:"inset 0 0 0 1px ".concat(a,"30")}:void 0,children:[(0,r.jsx)(s,{className:"w-3.5 h-3.5"}),"am"===e?"Morning":"Evening"]},e)})}),(0,r.jsx)(l.N,{mode:"wait",children:(0,r.jsx)(n.P.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:"space-y-4 border-2 border-foreground/10 p-5 sm:p-6",style:{borderColor:"".concat(m,"25"),background:"".concat(m,"06")},children:c.map((e,t)=>(0,r.jsx)(eS,{step:e,index:t,color:m},t))},i)})]})}function eC(e){let{issues:t,embedded:a=!1}=e;return t.length?(0,r.jsxs)("div",{children:[a?null:(0,r.jsxs)("div",{className:"mb-5 flex items-center gap-2.5",children:[(0,r.jsx)("span",{className:"h-4 w-0.5 rounded-full bg-pink-500/70"}),(0,r.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Top concerns"})]}),(0,r.jsx)("div",{className:"space-y-4",children:t.map((e,t)=>{let a=e.issue_name.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase()),s=(0,x.YH)(e.score);return(0,r.jsxs)(n.P.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:.1*t}
1,className:"border-2 border-foreground/10 bg-background/50 p-5 sm:p-6",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3 mb-2",children:[(0,r.jsx)("h4",{className:"text-card-foreground font-semibold text-sm",children:a}),(0,r.jsxs)("span",{className:"text-sm font-black shrink-0 tabular-nums",style:{color:s},children:[e.score,(0,r.jsx)("span",{className:"text-muted-foreground font-normal text-xs",children:"/100"})]})]}),(0,r.jsx)("div",{className:"h-1 rounded-full bg-border mb-3 overflow-hidden",children:(0,r.jsx)("div",{className:"h-full rounded-full",style:{width:"".concat(e.score,"%"),background:s}})}),(0,r.jsx)("p",{className:"text-muted-foreground text-xs leading-relaxed mb-3",children:e.definition}),(0,r.jsx)("div",{className:"flex flex-wrap gap-1.5",children:e.treatments.map(e=>(0,r.jsx)("span",{className:"px-2.5 py-1 rounded-full text-[11px] font-medium",style:{background:"color-mix(in oklch, ".concat(s," 14%, transparent)"),border:"1px solid color-mix(in oklch, ".concat(s," 30%, transparent)"),color:s},children:e},e))})]},e.issue_name)})})]}):null}function eP(e){let{step:t,title:a,subtitle:s,children:l,className:i,contentClassName:o,id:d}=e;return(0,r.jsx)(n.P.section,{id:d,initial:{opacity:0,y:28},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-60px"},transition:{duration:.5,ease:[.22,1,.36,1]},className:(0,x.cn)("relative",i),children:(0,r.jsxs)("div",{className:(0,x.cn)("relative overflow-hidden border-2 border-foreground
1/10 bg-card","shadow-[0_12px_40px_-12px_rgba(0,0,0,0.08)]"),children:[(0,r.jsx)("div",{className:"pointer-events-none absolute inset-0 opacity-[0.4] mix-blend-overlay",style:{backgroundImage:'url("https://grainy-gradients.vercel.app/noise.svg")'}}),(0,r.jsx)("div",{className:"pointer-events-none absolute inset-x-0 top-0 h-px bg-gradient-to-r from-transparent via-pink-500/35 to-transparent"}),(0,r.jsx)("div",{className:"pointer-events-none absolute -right-24 -top-24 h-64 w-64 rounded-full bg-gradient-to-br from-pink-500/12 to-indigo-500/10 blur-3xl"}),(0,r.jsxs)("div",{className:"relative p-6 sm:p-8 lg:p-10",children:[(0,r.jsxs)("header",{className:"mb-8 max-w-3xl sm:mb-10",children:[t?(0,r.jsx)("p",{className:"mb-2 font-mono text-[10px] font-bold uppercase tracking-[0.22em] text-pink-600",children:t}):null,(0,r.jsx)("h2",{className:"font-display text-2xl font-black tracking-tight text-foreground sm:text-3xl lg:text-4xl",children:a}),s?(0,r.jsx)("p",{className:"mt-3 text-sm leading-relaxed text-muted-foreground",children:s}):null]}),(0,r.jsx)("div",{className:(0,x.cn)(o),children:l})]})]})})}async function eI(e,t,r){var s,l,n,i,o,d,c,m,u,p,h,g,b,f,y,v,j,N,w,k,S,_,C,P,I,A,F,E,T,z,D,M,R,O,U,W,H,L,B,Y,G;let J=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},{default:q}=await Promise.all([a.e(3930),a.e(7195)]).then(a.bind(a,55172)),K=new q({orientation:"portrait",unit:"mm",format:"a4"}),V=0,X=1,$="#0B0D1A",Q="#2D3748",Z="#6B7280",ee="#9CA3AF",et="#00897B",ea="#A67C00",er="#E5E7EB",es="#F9FAFB",el="#FFFFFF",en=e=>({r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16)}),ei=e=>{let{r:t,g:a,b:r}=en(e);K.setTextColor(t,a,r)},eo=(e,t,a,r,s)=>{let{r:l,g:n,b:i}=en(s);K.setFillColor(l,n,i),K.rect(e,t,a,r,"F")},ed=function(e,t,a,r){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.25,{r:l,g:n,b:i}=en(r);K.setDrawColor(l,n,i),K.setLineWidth(s),K.line(e,t,a,t)},ec=function(e,t,a,r,s){let l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:.25,{r:n,g:i,b:o}=en(s);K.setDrawColor(n,i,o),K.setLineWidth(l),K.rect(e,t,a,r,"S")},em=(e,t,a,r)=>{let{r:s,g:l,b:n}=en(r);K.setFillColor(s,l,n),K.setDrawColor(s,l,n),K.circle(e,t,a,"F")},eu=e=>e>=80?et:e>=60?ea:"#B91C1C",ex=e=>{if(eo(0,0,210,1.2,$),e){ei($),K.setFont("helvetica","bold"),K.setFontSize(14),K.text("UMPH",18,10.5);let e=K.getTextWidth("UMPH");ei(et),K.text(".AI",18+e,10.5),ei(ee),K.setFont("helvetica","normal"),K.setFontSize(6.5),K.text("SKIN INTELLIGENCE REPORT",192,7.5,{align:"right"});let t=new Date().toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"});K.text(t,192,12,{align:"right"})}else ei($),K.setFont("helvetica","bold"),K.setFontSize(10),K.text("UMPH.AI",18,10.5),ei(ee),K.setFont("helvetica","normal"),K.setFontSize(6.5),K.text("Skin Intelligence Report \xb7 Page ".concat(X),192,10.5,{align:"right"});ed(18,15,192,er)},ep=()=>{ed(18,284,192,er),ei(ee),K.setFont("helvetica","normal"),K.setFontSize(5.5),K.text("UMPH.AI \xb7 Personalised Skin Intelligence \xb7 For informational purposes only - not medical advice \xb7 Page ".concat(X),105,288,{align:"center"}),K.setTextColor(0,150,136),K.textWithLink("umph.ai/terms",18,292.5,{url:"https://umph.ai/terms"}),K.setFont("helvetica","normal"),ei(ee),K.text("\xb7",40,292.5),K.setTextColor(0,150,136),K.textWithLink("[email protected]",44,292.5,{url:"mailto:[email protected]"}),eo(0,296,210,1,$)},eh=e=>{V+e>283&&(ep(),K.addPage(),X++,eo(0,0,210,297,el),ex(!1),V=23)},eg=e=>{V+=8,eh(16),eo(18,V-4.5,2.5,6.5,et),ei($),K.setFont("helvetica","bold"),K.setFontSize(8),K.text(e.toUpperCase(),24,V),ed(24+K.getTextWidth(e.toUpperCase())+4,V-1,192,er),V+=8};eo(0,0,210,297,el),ex(!0),V=23;let eb=r.startsWith("data:")?r:"data:image/jpeg;base64,".concat(r),ef=await function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1200;return new Promise(a=>{let r=new Image;r.onload=()=>{let s=Math.min(1,t/r.naturalWidth),l=Math.round(r.naturalWidth*s),n=Math.round(r.naturalHeight*s),i=document.createElement("canvas");i.width=l,i.height=n;let o=i.getContext("2d");if(!o)return void a(e);o.drawImage(r,0,0,l,n),a(i.toDataURL("image/jpeg",.85))},r.onerror=()=>a(e),r.src=e})}(eb),ey=await new Promise(e=>{let t=new Image;t.onload=()=>
1e({w:t.naturalWidth,h:t.naturalHeight}),t.onerror=()=>e({w:3,h:4}),t.src=ef}),ev=null!=(S=null==(s=e.analysis.all)?void 0:s.score)?S:0,ej=null!=(_=e.analysis.skin_age)?_:0,eN=Math.min(Math.round(54*(ey.h/ey.w)),72),ew=Math.max(eN,72);try{K.addImage(ef,"JPEG",18,V,54,eN,void 0,"FAST")}catch(e){eo(18,V,54,eN,es)}ec(18,V,54,eN,er,.3);ei($),K.setFont("helvetica","bold"),K.setFontSize(52),K.text(ev.toFixed(0),84,V+22);let ek=K.getTextWidth(ev.toFixed(0));eo(84,V+24,ek,1.5,et),ei(ee),K.setFont("helvetica","normal"),K.setFontSize(7.5),K.text("/ 100",84+ek+2.5,V+14.5),K.text("OVERALL SCORE",84+ek+2.5,V+20);let eS=V+31;t.summary.nickname&&(ei(ea),K.setFont("helvetica","bold"),K.setFontSize(12.5),K.text(t.summary.nickname,84,eS),eS+=7);let e_=36;if([{label:"SKIN AGE",value:String(ej)},{label:"SYMMETRY",value:"".concat(null!=(C=t.summary.symmetry_score)?C:"-","/10")},{label:"VIBE",value:null!=(P=t.summary.vibe)?P:"-"}].forEach((e,t)=>{let{label:a,value:r}=e,s=84+t*e_;ei(ee),K.setFont("helvetica","normal"),K.setFontSize(5.5),K.text(a,s,eS),ei(Q),K.setFont("helvetica","bold"),K.setFontSize(8),K.text(r,s,eS+5.5)}),eS+=13,t.summary.glow_summary){let e=K.splitTextToSize(t.summary.glow_summary,108);ei(Z),K.setFont("helvetica","italic"),K.setFontSize(7.5),K.text(e.slice(0,2),84,eS)}V+=ew+10,eg("Skin Scores");let eC=[["Eye Bags",null!=(I=null==(l=e.analysis.hd_eye_bag)?void 0:l.ui_score)?I:0],["Dark Circles",null!=(A=null==(n=e.analysis.hd_dark_circle)?void 0:n.ui_score)?A:0],["Upper Eyelid",null!=(F=null==(i=e.analysis.hd_droopy_upper_eyelid)?void 0:i.ui_score)?F:0],["Lower Eyelid",null!=(E=null==(o=e.analysis.hd_droopy_lower_eyelid)?void 0:o.ui_score)?E:0],["Firmness",null!=(T=null==(d=e.analysis.hd_firmness)?void 0:d.ui_score)?T:0],["Texture",null!=(z=null==(m=e.analysis.hd_texture)||null==(c=m.whole)?void 0:c.ui_score)?z:0],["Wrinkles",null!=(D=null==(p=e.analysis.hd_wrinkle)||null==(u=p.whole)?void 0:u.ui_score)?D:0]],eP=87,eI=43;for(let e=0;e<Math.ceil(eC.length/2);e++){eh(13);for(let t=0;t<2;t++){let a=2*e+t;if(a>=eC.length)break;let[r,s]=eC[a],l=18+t*eP,n=eu(s);ei(Z),K.setFont("helvetica","normal"),K.setFontSize(7),K.text(r,l,V+5);let i=l+24;eo(i,V+3.2,eI,2,er),eo(i,V+3.2,Math.max(.5,s/100*eI),2,n),ei(n),K.setFont("helvetica","bold"),K.setFontSize(8),K.text("".concat(s),l+24+eI+2.5,V+5),ei(ee),K.setFont("helvetica","normal"),K.setFontSize(5.5),K.text((0,x.rH)(s).toUpperCase(),l+24+eI+2.5,V+9)}V+=13}if(V+=2,eg("Treatment Plan"),t.summary.glow_summary){let e=K.splitTextToSize(t.summary.glow_summary,174);eh(4.5*e.length+6),ei(Z),K.setFont("helvetica","italic"),K.setFontSize(8),K.text(e,18,V),V+=4.5*e.length+8}let eA=[et,ea,"#7C3AED","#D97706"];(null!=(M=t.summary.treatment_plan)?M:[]).forEach((e,t)=>{var a;let r=e.indexOf(": "),s=r>=0?e.slice(0,r):e,l=r>=0?e.slice(r+2):"",n=null!=(a=eA[t])?a:et,i=l?K.splitTextToSize(l,160):[],o=9+4.2*i.length+5;eh(o+3),eo(18,V,174,o,es),eo(18,V,2,o,n),em(27,V+5,3.5,n),ei(el),K.setFont("helvetica","bold"),K.setFontSize(6.5),K.text("".concat(t+1),27,V+6.3,{align:"center"}),ei(n),K.setFont("helvetica","bold"),K.setFontSize(8.5),K.text(s,35,V+6.5),i.length&&(ei(Z),K.setFont("helvetica","normal"),K.setFontSize(7.5),K.text(i,35,V+12)),V+=o+3}),V+=2;let eF=t.summary.daily_routine;if(eF){eg("Daily Skincare Routine");let e=84.5,t=[["AM \xb7 MORNING",eF.am,"#D97706"],["PM \xb7 EVENING",eF.pm,"#7C3AED"]];eh(12),t.forEach((t,a)=>{let[r,,s]=t,l=18+a*(e+5);eo(l,V,e,8,es),eo(l,V,e,1.5,s),ei(s),K.setFont("helvetica","bold"),K.setFontSize(7),K.text(r,l+5,V+5.5)}),V+=11;let a=Math.max(eF.am.length,eF.pm.length);for(let t=0;t<a;t++){let a=null!=(R=eF.am[t])?R:"",r=null!=(O=eF.pm[t])?O:"",s=a?K.splitTextToSize(a,e-11):[],l=r?K.splitTextToSize(r,e-11):[],n=4*Math.max(s.length,l.length,1)+5;eh(n+1),[a,r].forEach((a,r)=>{if(!a)return;let n=18+r*(e+5),i=0===r?"#D97706":"#7C3AED",o=0===r?s:l;em(n+4,V+3,2.5,i),ei(el),K.setFont("helvetica","bold"),K.setFontSize(6),K.text("".concat(t+1),n+4,V+4.1,{align:"center"}),ei(Q),K.setFont("helvetica","normal"),K.setFontSize(7),K.text(o,n+9,V+4)}),V+=n+1}V+=4}(null==(h=t.top_issues)?void 0:h.length)&&(eg("Top Concerns"),t.top_issues.slice(0,3).forEach((e,t)=>{var a,r;let s=e.issue_name.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase()),l=K.splitTextToSize(null!=(a=e.definition)?a:"",156),n="Treatments: ".concat((null!=(r=e.treatments)?r:[]).join(" \xb7 ")),i=K.splitTextToSize(n,156),o=18+(l.length+i.length)*4;eh(o+4),eo(18,V,174,o,es),ed(18,V,192,er),ed(18,V+o,192,er),ei(er),K.setFont("helvetica","bold"),K.setFontSize(22),K.text("0".concat(t+1),21,V+12);let d=eu(e.score);ei($),K.setFont("helvetica","bold"),K.setFontSize(9),K.text(s,34,V+6),ei(d),K.setFontSize(9),K.text("".concat(e.score,"/100"),190,V+6,{align:"right"}),ei(d),K.setFont("helvetica","normal"),K.setFontSize(6),K.text((0,x.rH)(e.score).toUpperCase(),190,V+11,{align:"right"}),ei(Z),K.setFont("helvetica","normal"),K.setFontSize(7.5),K.text(l,34,V+13);let c=V+13+4*l.length+2;ei(et),K.setFont("helvetica","normal"),K.setFontSize(6.5),K.text(i,34,c),V+=o+4}));let eE=[{key:"hd_eye_bag_output",label:"Eye Bags",score:null!=(U=null==(g=e.anal
1ysis.hd_eye_bag)?void 0:g.ui_score)?U:0},{key:"hd_dark_circle_output",label:"Dark Circles",score:null!=(W=null==(b=e.analysis.hd_dark_circle)?void 0:b.ui_score)?W:0},{key:"hd_droopy_upper_eyelid_output",label:"Upper Eyelid",score:null!=(H=null==(f=e.analysis.hd_droopy_upper_eyelid)?void 0:f.ui_score)?H:0},{key:"hd_droopy_lower_eyelid_output",label:"Lower Eyelid",score:null!=(L=null==(y=e.analysis.hd_droopy_lower_eyelid)?void 0:y.ui_score)?L:0},{key:"hd_firmness_output",label:"Firmness",score:null!=(B=null==(v=e.analysis.hd_firmness)?void 0:v.ui_score)?B:0},{key:"hd_texture_output",label:"Texture",score:null!=(Y=null==(N=e.analysis.hd_texture)||null==(j=N.whole)?void 0:j.ui_score)?Y:0},{key:"hd_wrinkle_output",label:"Wrinkles",score:null!=(G=null==(k=e.analysis.hd_wrinkle)||null==(w=k.whole)?void 0:w.ui_score)?G:0}],eT=[];for(let e of eE){let t=Object.keys(J).find(t=>{var a,r;return(null!=(r=null==(a=t.split("/").pop())?void 0:a.replace(".png",""))?r:"").startsWith(e.key)}),a=ef;if(t&&J[t])try{a=await function(e,t){return new Promise(a=>{let r=document.createElement("canvas"),s=r.getContext("2d"),l=new Image,n=new Image,i=0,o=()=>{i<2||(r.width=l.naturalWidth||640,r.height=l.naturalHeight||480,s.drawImage(l,0,0,r.width,r.height),s.globalAlpha=1,s.globalCompositeOperation="screen",s.drawImage(n,0,0,r.width,r.height),s.globalAlpha=1,s.globalCompositeOperation="source-over",a(r.toDataURL("image/jpeg",.85)))};l.onload=()=>{i++,o()},n.onload=()=>{i++,o()},l.onerror=()=>a(e),n.onerror=()=>a(e),l.src=e,n.src=t.startsWith("data:")?t:"data:image/png;base64,".concat(t)})}(ef,J[t])}catch(e){}eT.push({label:e.label,score:e.score,composited:a})}eg("Analysis Overlays");let ez=41.25,eD=Math.round(41.25*(ey.h/ey.w)),eM=eD+13;for(let e=0;e<Math.ceil(eT.length/4);e++){eh(eM+2);for(let t=0;t<4;t++){let a=4*e+t;if(a>=eT.length)break;let{label:r,score:s,composited:l}=eT[a],n=18+t*(ez+3),i=eu(s);try{K.addImage(l,"JPEG",n,V,ez,eD,void 0,"FAST")}catch(e){eo(n,V,ez,eD,es)}ec(n,V,ez,eD,er,.2),ei(Z),K.setFont("helvetica","normal"),K.setFontSize(6.5),K.text(r,n+ez/2,V+eD+5,{align:"center"}),ei(i),K.setFont("helvetica","bold"),K.setFontSize(7),K.text("".concat(s),n+ez/2,V+eD+10,{align:"center"})}V+=eM+3}if(t.summary.motivation_hook){let e=K.splitTextToSize('"'.concat(t.summary.motivation_hook,'"'),158);eh(5.5*e.length+20),eo(18,(V+=8)-4,2,5.5*e.length+8,ea),ei(ea),K.setFont("helvetica","italic"),K.setFontSize(9.5),K.text(e,26,V),V+=5.5*e.length+6}return ep(),K.output("blob")}function eA(e){var t,a,l,i;let{analysis:o,recommendations:d,capturedImage:p,onRescan:h,totalProcessingTime:g}=e,b=null!=(l=null==(t=o.analysis.all)?void 0:t.score)?l:0,f=null!=(i=o.analysis.skin_age)?i:0,y=b>=95?"Tier 5":b>=88?"Tier 4":b>=78?"Tier 3":b>=68?"Tier 2":"Tier 1",v=(0,x.Ho)(o.analysis,o.images),[j,N]=(0,s.useState)(!1),k=(0,s.useRef)(null),[S,_]=(0,s.useState)(!1),[C,P]=(0,s.useState)(""),[I,A]=(0,s.useState)(""),[F,E]=(0,s.useState)(!1),[T,z]=(0,s.useState)(!1),D=null==(a=null!=g?g:o.processing_time)?void 0:a.toFixed(1),M=(0,s.useCallback)(async()=>{if(k.current)return k.current;let e=await eI(o,d,p,o.images);return k.current=e,e},[o,d,p]),R=async()=>{N(!0);try{let e=await M(),t=URL.createObjectURL(e),a=document.createElement("a");a.href=t,a.download="UMPH_Skin_Report.pdf",document.body.appendChild(a),a.click(),document.body.removeChild(a),setTimeout(()=>URL.revokeObjectURL(t),1e3)}catch(e){console.error(e),alert("PDF generation failed. Please try again.")}finally{N(!1)}},O=async()=>{if(C.trim()){A(""),E(!0);try{let{available:e}=await (0,u.J$)(C.trim());if(!e){A("This username is already taken. Try another."),E(!1);return}await (0,u.qQ)({username:C.trim(),overall_score:b,nickname:d.summary.nickname,skin_age:f,tier:y,vibe:d.summary.vibe}),z(!0)}catch(e){A(e instanceof Error?e.message:"Failed")}finally{E(!1)}}};return(0,r.jsxs)("div",{className:"min-h-screen bg-background",id:"results-view",children:[(0,r.jsxs)("div",{className:"relative border-b-2 border-foreground
1/10 bg-gradient-to-br from-pink-500/[0.07] via-background to-indigo-500/[0.06]",children:[(0,r.jsx)("div",{className:"pointer-events-none absolute inset-0 opacity-[0.4] mix-blend-overlay",style:{backgroundImage:'url("https://grainy-gradients.vercel.app/noise.svg")'}}),(0,r.jsx)("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 h-32 bg-gradient-to-t from-background to-transparent"}),(0,r.jsxs)("div",{className:"relative mx-auto max-w-5xl px-4 pb-10 pt-10 sm:px-6 sm:pb-14 sm:pt-14",children:[(0,r.jsxs)(n.P.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.45},className:"flex flex-col gap-8 lg:flex-row lg:items-end lg:justify-between",children:[(0,r.jsxs)("div",{className:"max-w-2xl",children:[(0,r.jsx)("p",{className:"mb-3 font-mono text-[10px] font-bold uppercase tracking-[0.28em] text-pink-600",children:"Analysis complete"}),(0,r.jsxs)("h1",{className:"font-display text-4xl font-black leading-[0.92] tracking-tighter text-foreground sm:text-5xl lg:text-6xl",children:["YOUR SKIN",(0,r.jsx)("br",{}),"REPORT"]}),(0,r.jsxs)("p",{className:"mt-5 max-w-md font-mono text-xs leading-relaxed text-muted-foreground",children:["Rendered in ",(0,r.jsxs)("span",{className:"text-foreground",children:[D,"s"]}),(0,r.jsx)("span",{className:"mx-2 text-border",children:"\xb7"}),"Private session â save your PDF before you leave this page."]})]}),(0,r.jsxs)(w,{variant:"secondary",size:"md",onClick:h,className:"h-11 shrink-0 border-2 border-foreground
1/15 bg-background/80 backdrop-blur-sm hover:border-foreground/25",children:[(0,r.jsx)(m.A,{className:"h-4 w-4"}),"New scan"]})]}),(0,r.jsxs)(n.P.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.12,duration:.45},className:"mt-10 grid gap-4 sm:grid-cols-2",children:[(0,r.jsxs)("div",{className:"group relative overflow-hidden border-2 border-foreground/10 bg-card p-5 sm:p-6",children:[(0,r.jsx)("div",{className:"absolute right-0 top-0 h-24 w-24 translate-x-1/3 -translate-y-1/3 rounded-full bg-pink-500/10 blur-2xl transition-opacity group-hover:opacity-100"}),(0,r.jsxs)("div",{className:"relative flex items-start gap-4",children:[(0,r.jsx)("div",{className:"flex h-11 w-11 shrink-0 items-center justify-center border-2 border-pink-500/25 bg-pink-500/10",children:(0,r.jsx)(eu.A,{className:"h-5 w-5 text-pink-600"})}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("h3",{className:"font-display text-lg font-black tracking-tight",children:"Download report"}),(0,r.jsx)("p",{className:"mt-1 text-xs leading-relaxed text-muted-foreground",children:"Full breakdown as PDF â stays on your device only."}),(0,r.jsxs)(w,{variant:"primary",size:"md",className:"mt-4 w-full sm:w-auto",onClick:R,loading:j,children:[(0,r.jsx)(eu.A,{className:"h-4 w-4"}),"Get PDF"]})]})]})]}),(0,r.jsxs)("div",{className:"group relative overflow-hidden border-2 border-foreground
1/10 bg-card p-5 sm:p-6",children:[(0,r.jsx)("div",{className:"absolute right-0 top-0 h-24 w-24 translate-x-1/3 -translate-y-1/3 rounded-full bg-indigo-500/10 blur-2xl transition-opacity group-hover:opacity-100"}),(0,r.jsxs)("div",{className:"relative flex items-start gap-4",children:[(0,r.jsx)("div",{className:"flex h-11 w-11 shrink-0 items-center justify-center border-2 border-indigo-500/25 bg-indigo-500/10",children:(0,r.jsx)(ex.A,{className:"h-5 w-5 text-indigo-600"})}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("h3",{className:"font-display text-lg font-black tracking-tight",children:"Leaderboard"}),(0,r.jsx)("p",{className:"mt-1 text-xs leading-relaxed text-muted-foreground",children:"Publish your score with a public username â optional."}),(0,r.jsxs)(w,{variant:"gold",size:"md",className:"mt-4 w-full sm:w-auto",onClick:()=>_(!0),children:[(0,r.jsx)(ep.A,{className:"h-4 w-4"}),"Share score"]})]})]})]})]}),(0,r.jsxs)(n.P.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.2},className:"mt-6 space-y-3 border-2 border-amber-500/25 bg-amber-500/[0.06] p-4 sm:p-5",children:[(0,r.jsxs)("div",{className:"flex gap-3 text-sm text-amber-900 dark:text-amber-200/95",children:[(0,r.jsx)(c.A,{className:"mt-0.5 h-4 w-4 shrink-0"}),(0,r.jsxs)("p",{children:[(0,r.jsx)("span",{className:"font-bold",children:"Save first."})," Refreshing or leaving can clear this session. Download your PDF, then explore the sections below."]})]}),(0,r.jsxs)("div",{className:"flex gap-3 border-t border-amber-500/20 pt-3 text-xs text-muted-foreground",children:[(0,r.jsx)(el.A,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-pink-600/80"}),(0,r.jsx)("p",{children:"No email delivery â we don't send your skin data through third-party inboxes. Keep the file local."})]})]})]})]}),(0,r.jsxs)("div",{className:"mx-auto max-w-5xl space-y-10 px-4 py-12 sm:px-6 sm:space-y-14 sm:py-16 lg:space-y-16",children:[(0,r.jsx)(ey,{summary:d.summary,overallScore:b,skinAge:f,tier:y}),(0,r.jsx)(eP,{id:"analysis-depth",step:"02 \xb7 Signal",title:"Depth mapping & scores",subtitle:"Swipe through AI overlays on your photo, then compare seven structural and surface metrics.",children:(0,r.jsxs)("div",{className:"grid items-start gap-10 lg:grid-cols-2 lg:gap-14",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"mb-4 font-mono text-[10px] font-bold uppercase tracking-[0.2em] text-muted-foreground",children:"Visual layers"}),(0,r.jsx)(eg,{originalImage:p,masks:v})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"mb-4 font-mono text-[10px] font-bold uppercase tracking-[0.2em] text-muted-foreground",children:"Quant metrics"}),(0,r.jsx)(ef,{analysis:o.analysis,showHeading:!1})]})]})}),(0,r.jsx)(eP,{id:"treatment-plan",step:"03 \xb7 Plan",title:"Your treatment roadmap",subtitle:"Phased recommendations â tap a row when you see a chevron to read clinical detail.",children:(0,r.jsx)(eN,{recommendations:d,embedded:!0})}),d.summary.daily_routine?(0,r.jsx)(eP,{id:"daily-routine",step:"04 \xb7 Routine",title:"AM / PM ritual",subtitle:"Build habits around these steps â consistency beats intensity.",children:(0,r.jsx)(e_,{routine:d.summary.daily_routine,embedded:!0})}):null,d.top_issues&&d.top_issues.length>0?(0,r.jsx)(eP,{id:"top-issues",step:"05 \xb7 Focus",title:"Priority concerns",subtitle:"Where to focus first â scored with suggested treatment directions.",children:(0,r.jsx)(eC,{issues:d.top_issues,embedded:!0})}):null]}),(0,r.jsx)(ei,{open:S,onClose:()=>_(!1),title:"Join the leaderboard",children:T?(0,r.jsxs)("div",{className:"py-2 text-center",children:[(0,r.jsx)("div",{className:"mx-auto mb-4 flex h-14 w-14 items-center justify-center border-2 border-foreground
1/10 bg-muted/40",children:(0,r.jsx)(ex.A,{className:"h-6 w-6 text-foreground"})}),(0,r.jsx)("p",{className:"font-display text-lg font-black",children:"You're on the board"}),(0,r.jsxs)("p",{className:"mt-2 text-sm text-muted-foreground",children:["Ranking as ",(0,r.jsx)("span",{className:"font-bold text-foreground",children:C})," with"," ",(0,r.jsx)("span",{className:"font-bold text-foreground",children:b.toFixed(0)})," / 100"]}),(0,r.jsx)(w,{variant:"secondary",size:"md",className:"mt-6 border-2 border-foreground/15",onClick:()=>window.open("/leaderboard","_blank"),children:"View leaderboard"})]}):(0,r.jsxs)("div",{className:"space-y-5",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 border-2 border-foreground/10 bg-muted/30 p-4",children:[(0,r.jsx)(ex.A,{className:"h-5 w-5 shrink-0 text-foreground"}),(0,r.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Score"," ",(0,r.jsx)("span",{className:"font-display font-black text-foreground",children:b.toFixed(0)}),(0,r.jsx)("span",{className:"text-muted-foreground",children:"/100"}),(0,r.jsx)("span",{className:"mx-2 text-border",children:"\xb7"}),d.summary.nickname]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"mb-2 block font-mono text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:"Public username"}),(0,r.jsx)("input",{type:"text",value:C,onChange:e=>{P(e.target.value),A("")},placeholder:"e.g. glowqueen2024",maxLength:30,className:"w-full border-2 border-foreground
1/15 bg-background px-4 py-3 text-sm text-foreground placeholder:text-muted-foreground focus:border-pink-500/40 focus:outline-none"}),I?(0,r.jsx)("p",{className:"mt-2 text-xs text-red-600",children:I}):null]}),(0,r.jsxs)(w,{variant:"gold",size:"md",onClick:O,loading:F,disabled:!C.trim(),className:"w-full border-2 border-foreground/10",children:[(0,r.jsx)(ex.A,{className:"h-4 w-4"}),"Add my score"]})]})})]})}var eF=a(47650),eE=a(18085),eT=a(70856);function ez(e){let{recommendations:t,analysisData:a}=e,[i,o]=(0,s.useState)(!1),[d,c]=(0,s.useState)(()=>{try{var e;return Math.min(parseInt(null!=(e=sessionStorage.getItem("umph_chat_count"))?e:"0",10)||0,5)}catch(e){return 0}}),[m,u]=(0,s.useState)(()=>{try{let e=sessionStorage.getItem("umph_chat_messages");if(e)return JSON.parse(e)}catch(e){}let e=5-(()=>{try{var e;return Math.min(parseInt(null!=(e=sessionStorage.getItem("umph_chat_count"))?e:"0",10)||0,5)}catch(e){return 0}})();return[{role:"assistant",content:"Hi! I'm UMI, your personal AI skin advisor. I've reviewed your full results - you have ".concat(e," question").concat(1!==e?"s":""," to ask me anything. What would you like to know?"),timestamp:new Date().toISOString()}]}
1),[x,p]=(0,s.useState)(""),[h,g]=(0,s.useState)(!1),f=(0,s.useRef)(null),y=(0,s.useRef)(null),v=(0,s.useRef)(null),j=5-d,[w,k]=(0,s.useState)(!1);(0,s.useEffect)(()=>{k(!0)},[]),(0,s.useEffect)(()=>{var e;null==(e=f.current)||e.scrollIntoView({behavior:"smooth"});try{sessionStorage.setItem("umph_chat_messages",JSON.stringify(m))}catch(e){}},[m]),(0,s.useEffect)(()=>{i&&setTimeout(()=>{var e;return null==(e=v.current)?void 0:e.focus()},350)},[i]),(0,s.useEffect)(()=>{let e=v.current;e&&(e.style.height="auto",e.style.height="".concat(Math.min(e.scrollHeight,120),"px"))},[x]);let S=async()=>{if(!x.trim()||h||j<=0)return;let e={role:"user",content:x.trim(),timestamp:new Date().toISOString()},r=[...m,e];u(r),p(""),c(e=>{let t=e+1;try{sessionStorage.setItem("umph_chat_count",String(t))}catch(e){}return t}),g(!0);let s=r.slice(1).slice(0,-1).map(e=>({role:e.role,content:e.content})),l="",n={role:"assistant",content:"",timestamp:new Date().toISOString()};u(e=>[...e,n]);try{var i;y.current=new AbortController;let r=null==(i=(await fetch("/api/chat",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:e.content,conversation_history:s,current_treatment_recommendation:t,current_skin_scores:a}),signal:y.current.signal})).body)?void 0:i.getReader(),o=new TextDecoder;if(!r)throw Error("No stream");for(;;){let{done:e,value:t}=await r.read();if(e)break;for(let e of o.decode(t,{stream:!0}).split("\n"))if(e.startsWith("data: "))try{let t=JSON.parse(e.slice(6));"text_chunk"===t.type&&t.content&&(l+=t.content,u(e=>{let t=[...e];return t[t.length-1]={...n,content:l},t})),"final_response"===t.type&&t.response&&(l=t.response,u(e=>{let t=[...e];return t[t.length-1]={...n,content:l},t}))}catch(e){}}}catch(e){"AbortError"!==e.name&&u(e=>{let t=[...e];return t[t.length-1]={...n,content:"Sorry, I couldn't process that. Please try again."},t})}finally{g(!1)}};return w?(0,eF.createPortal)((0,r.jsxs)(r.Fragment,{children:[!i&&(0,r.jsxs)(n.P.button,{initial:{opacity:0,scale:.85},animate:{opacity:1,scale:1},onClick:()=>o(!0),className:"fixed bottom-6 right-5 z-40 flex items-center gap-3 pl-1.5 pr-4 py-1.5 rounded-full border border-border bg-card shadow-md hover:border-primary/40 transition-all",children:[(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("div",{className:"w-10 h-10 rounded-full overflow-hidden border-2 border-primary/40",children:(0,r.jsx)("img",{src:"/umi.jpg",alt:"UMI",className:"w-full h-full object-cover"})}),(0,r.jsx)("span",{className:"absolute bottom-0 right-0 w-2.5 h-2.5 rounded-full bg-emerald-500 border-2 border-card"})]}),(0,r.jsxs)("div",{className:"text-left",children:[(0,r.jsx)("p",{className:"text-card-foreground text-xs font-bold leading-tight",children:"Ask UMI"}),(0,r.jsx)("p",{className:"text-primary text-[10px] font-medium",children:"AI Skin Advisor"})]})]}),(0,r.jsx)(l.N,{children:i&&(0,r.jsxs)(n.P.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"fixed inset-0 z-50 flex flex-col justify-end sm:justify-end sm:items-end sm:p-6",children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:()=>o(!1)}),(0,r.jsxs)(n.P.div,{initial:{y:60},animate:{y:0},exit:{y:60},transition:{type:"spring",stiffness:320,damping:30},className:"relative z-10 flex flex-col w-full sm:w-[420px] bg-card border border-border rounded-t-none sm:rounded-none overflow-hidden",style:{height:"88vh",maxHeight:"620px"},onClick:e=>e.stopPropagation(),children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-border bg-card shrink-0",children:[(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("div",{className:"w-9 h-9 rounded-full overflow-hidden border border-primary/25",children:(0,r.jsx)("img",{src:"/umi.jpg",alt:"UMI",className:"w-full h-full object-cover"})}),(0,r.jsx)("span",{className:"absolute bottom-0 right-0 w-2.5 h-2.5 rounded-full bg-emerald-500 border-2 border-card"})]}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("p",{className:"text-card-foreground text-sm font-bold leading-tight",children:"UMI"}),(0,r.jsx)("p",{className:"text-muted-foreground text-[11px]",children:j>0?"".concat(j," question").concat(1!==j?"s":""," remaining"):"No questions remaining"})]}),(0,r.jsx)("button",{onClick:()=>o(!1),className:"text-muted-foreground hover:text-foreground transition-colors p-1.5 rounded-none hover:bg-muted/80",children:(0,r.jsx)(b.A,{className:"w-4 h-4"})})]}),(0,r.jsxs)("div",{className:"flex-1 overflow-y-auto p-4 space-y-4 min-h-0",children:[m.map((e,t)=>(0,r.jsxs)(n.P.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},className:"flex gap-2.5 ".concat("user"===e.role?"justify-end":"justify-start"),children:["assistant"===e.role&&(0,r.jsx)("div",{className:"w-7 h-7 rounded-full overflow-hidden shrink-0 mt-0.5 border border-primary/20",children:(0,r.jsx)("img",{src:"/umi.jpg",alt:"UMI",className:"w-full h-full object-cover"})}),(0,r.jsx)("div",{className:"max-w-[78%] rounded-none px-3.5 py-2.5 text-sm leading-relaxed ".concat("user"===e.role?"bg-primary text-primary-foreground font-medium rounded-br-sm":"bg-muted/60 text-foreground border border-border rounded-bl-sm"),children:e.content?(0,r.jsx)(eT.oz,{components:{p:e=>{let{children:t}=e;return(0,r.jsx)("p",{className:"mb-1 last:mb-0",children:t})},strong:e=>{let{children:t}=e;return(0,r.jsx)("strong",{className:"font-semibold text-foreground",children:t})},ol:e=>{let{children:t}=e;return(0,r.jsx)("ol",{className:"list-decimal pl-4 space-y-1",children:t})},li:e=>{let{children:t}=e;return(0,r.jsx)("li",{children:t})}},children:e.content}):(0,r.jsxs)("span",{className:"flex items-center gap-1.5 text-muted-foreground",children:[(0,r.jsx)(N.A,{className:"w-3 h-3 animate-spin"}),"Thinking..."]})})]},t)),(0,r.jsx)("div",{ref:f})]}),(0,r.jsx)("div",{className:"p-3 border-t border-border shrink-0",children:j<=0?(0,r.jsx)("p",{className:"text-muted-foreground text-xs text-center py-2",children:"You've used all your questions. Thank you for chatting with UMI!"}):(0,r.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,r.jsxs)("div",{className:"flex items-end gap-2 bg-muted/40 rounded-none px-3 py-2 border border-border focus-within:border-primary/40 transition-colors",children:[(0,r.jsx)("textarea",{ref:v,value:x,onChange:e=>p(e.target.value.slice(0,500)),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),S())},placeholder:"Ask about your skin results...",rows:1,disabled:h,className:"flex-1 bg-transparent text-foreground text-[16px] placeholder:text-muted-foreground resize-none focus:outline-none py-0.5 min-h-[28px] max-h-[120px]"}),(0,r.jsx)("button",{onClick:S,disabled:!x.trim()||h,className:"w-8 h-8 rounded-none bg-primary flex items-center justify-center text-primary-foreground hover:bg-primary/90 transition-colors disabled:opacity-40 disabled:cursor-not-allowed shrink-0",children:h?(0,r.jsx)(N.A,{className:"w-3.5 h-3.5 animate-spin"}):(0,r.jsx)(eE.A,{className:"w-3.5 h-3.5"})})]}),x.length>0&&(0,r.jsxs)("p",{className:"text-right text-[10px] ".concat(500-x.length<50?"text-red-400":"text-muted-foreground"),children:[x.length,"/",500]})]})})]})]},"umi-overlay")})]}),document.body):null}
1function eD(){let[e,t]=(0,s.useState)("landing"),[a,p]=(0,s.useState)("camera"),[h,b]=(0,s.useState)(null),[f,y]=(0,s.useState)(null),[v,j]=(0,s.useState)(null),[N,k]=(0,s.useState)(!1),[S,_]=(0,s.useState)(null),[C,P]=(0,s.useState)(null),[I,F]=(0,s.useState)(null),[E,T]=(0,s.useState)(null),[D,M]=(0,s.useState)(0),[R,O]=(0,s.useState)(null);(0,s.useEffect)(()=>{try{let e=sessionStorage.getItem("umph_analysis"),a=sessionStorage.getItem("umph_recs"),r=sessionStorage.getItem("umph_preview");e&&a&&r&&(P(JSON.parse(e)),F(JSON.parse(a)),y(r),t("results"))}catch(e){}},[]);let W=(e,a)=>{b(e),y(a);try{sessionStorage.setItem("umph_preview",a)}catch(e){}let r=null!=S?S:sessionStorage.getItem("umph_pi");r&&v?H(r,e,v):t("userInfo")},H=(0,s.useCallback)(async(e,a,r)=>{let s=null!=a?a:h,l=null!=r?r:v;if(!s||!l)return;t("analyzing"),O(null),M(0);let n=Date.now(),i=setInterval(()=>{M(e=>e<6?e+1:e)},1800);try{var o;let a=await (0,u.A1)(s,e);P(a),M(4);let r=(0,x.Zt)(a.analysis),d=await (0,u.Dz)(r,l,null!=(o=a.analysis.skin_age)?o:25,e);F(d),T((Date.now()-n)/1e3);try{sessionStorage.setItem("umph_analysis",JSON.stringify(a)),sessionStorage.setItem("umph_recs",JSON.stringify(d))}catch(e){}clearInterval(i),g("results_viewed",{processing_time_seconds:(Date.now()-n)/1e3}),t("results")}catch(l){clearInterval(i);let e=l instanceof Error?l.message:"Analysis failed",a=l.code,r=l.details,s=!["SESSION_EXPIRED","PAYMENT_UNVERIFIED","NO_PAYMENT","ALREADY_USED"].includes(null!=a?a:"");g("analysis_failed",{code:a,retryable:s}),O({message:e,code:a,details:r,retryable:s}),t("analyzing")}},[h,v]),B="scan"===e||"userInfo"===e,Y=["scan","userInfo","analyzing","results"].includes(e);return(0,r.jsxs)("div",{className:"relative min-h-screen bg-background font-sans text-foreground selection:bg-pink-500 selection:text-white",children:[Y&&(0,r.jsx)("div",{className:"sticky top-20 z-40 flex h-12 items-center border-b border-border bg-background/95 px-4 backdrop-blur-md sm:px-6",children:(0,r.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl items-center gap-4",children:[(0,r.jsx)("div",{className:"w-24 shrink-0",children:B?(0,r.jsxs)(w,{variant:"ghost",size:"sm",onClick:()=>{"scan"===e?t("landing"):"userInfo"===e&&t("scan")},className:"-ml-2 gap-1 px-2",children:[(0,r.jsx)(i.A,{className:"w-4 h-4"}),"Back"]}):null}),(0,r.jsx)("div",{className:"flex flex-1 items-center justify-center gap-1.5",children:["scan","userInfo","analyzing","results"].map(t=>(0,r.jsx)("div",{className:"h-1 rounded-full transition-all duration-300 ".concat(t===e?"w-6 bg-primary":["results","analyzing"].includes(e)&&["scan","userInfo"].includes(t)?"w-1.5 bg-primary/40":"w-1.5 bg-border")},t))}),(0,r.jsx)("div",{className:"w-24 shrink-0","aria-hidden":!0})]})}),(0,r.jsx)("div",{className:"overflow-x-hidden",children:(0,r.jsxs)(l.N,{mode:"wait",children:["landing"===e&&(0,r.jsx)(n.P.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},children:(0,r.jsx)(A,{onStart:()=>{g("scan_started"),t("scan")}})},"landing"),"scan"===e&&(0,r.jsxs)(n.P.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},className:"pt-4",children:[(0,r.jsxs)("div",{className:"flex justify-center mb-2 gap-3 px-4",children:[(0,r.jsxs)("button",{onClick:()=>p("camera"),className:"inline-flex items-center gap-2 px-4 py-2 rounded-none text-sm font-medium border transition-all ".concat("camera"===a?"bg-primary/10 border-primary/30 text-primary":"border-border text-muted-foreground hover:text-foreground"),children:[(0,r.jsx)(o.A,{className:"w-4 h-4"}),"Take Photo"]}),(0,r.jsxs)("button",{onClick:()=>p("upload"),className:"inline-flex items-center gap-2 px-4 py-2 rounded-none text-sm font-medium border transition-all ".concat("upload"===a?"bg-primary/10 border-primary/30 text-primary":"border-border text-muted-foreground hover:text-foreground"),children:[(0,r.jsx)(d.A,{className:"w-4 h-4"}),"Upload Photo"]})]}),"camera"===a?(0,r.jsx)(U,{onCapture:W,onUploadMode:()=>p("upload")}):(0,r.jsx)(L,{onCapture:W,onCameraMode:()=>p("camera")})]},"scan"),"userInfo"===e&&f&&(0,r.jsx)(n.P.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},className:"pt-4",children:(0,r.jsx)(ea,{onSubmit:e=>{j(e);let t=null!=S?S:sessionStorage.getItem("umph_pi");t?H(t,void 0,e):(g("payment_screen_viewed"),k(!0))},previewUrl:f,isRetry:!!(null!=S?S:sessionStorage.getItem("umph_pi"))})},"userInfo"),"analyzing"===e&&(0,r.jsx)(n.P.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},className:"pt-4 min-h-screen flex items-center justify-center px-4",children:R?(0,r.jsxs)("div",{className:"max-w-md w-full text-center",children:[(0,r.jsx)("div",{className:"w-16 h-16 rounded-2xl bg-red-500/10 flex items-center justify-center mx-auto mb-5",children:(0,r.jsx)(c.A,{className:"w-8 h-8 text-red-400"})}),(0,r.jsx)("h2",{className:"text-xl font-bold text-foreground mb-2",children:"Analysis Failed"}),(0,r.jsx)("p",{className:"text-muted-foreground text-sm leading-relaxed mb-1",children:R.message}),R.details&&(0,r.jsx)("p",{className:"text-foreground/90 text-sm leading-relaxed mb-2 bg-muted/50 border border-border rounded-none px-4 py-3",children:R.details}),R.retryable&&(0,r.jsx)("p",{className:"text-primary text-xs mb-6",children:"No additional charge - your payment is still valid for another attempt."}),(0,r.jsxs)("div",{className:"flex flex-col gap-3",children:[R.retryable&&(0,r.jsxs)(w,{variant:"primary",size:"lg",onClick:()=>{if(!(null!=S?S:sessionStorage.getItem("umph_pi")))return void(t("scan"),O(null),b(null),y(null));g("analysis_retried"),O(null),t("scan")},className:"w-full",children:[(0,r.jsx)(m.A,{className:"w-4 h-4"}),"Try Again - Retake Photo"]}),(0,r.jsx)(w,{variant:"ghost",size:"md",onClick:()=>t("landing"),className:"w-full",children:"Back to Home"})]})]}):(0,r.jsx)(z,{loadingStep:D})},"analyzing"),"results"===e&&C&&I&&f&&(0,r.jsx)(n.P.div,{initial:{opacity:0}
1,animate:{opacity:1},className:"pt-4",children:(0,r.jsx)(eA,{analysis:C,recommendations:I,capturedImage:f,totalProcessingTime:null!=E?E:void 0,onRescan:()=>{g("rescan_initiated"),t("landing"),P(null),F(null),y(null),_(null),sessionStorage.removeItem("umph_pi"),sessionStorage.removeItem("umph_analysis"),sessionStorage.removeItem("umph_recs"),sessionStorage.removeItem("umph_preview"),sessionStorage.removeItem("umph_chat_count"),sessionStorage.removeItem("umph_chat_messages")}})},"results")]})}),"results"===e&&C&&I&&(0,r.jsx)(ez,{recommendations:I,analysisData:C.analysis}),(0,r.jsx)(em,{open:N,onSuccess:e=>{g("payment_completed"),_(e),sessionStorage.setItem("umph_pi",e),k(!1),H(e)},onClose:()=>{g("payment_abandoned"),k(!1)}})]})}},72173:(e,t,a)=>{Promise.resolve().then(a.t.bind(a,52619,23)),Promise.resolve().then(a.bind(a,11267)),Promise.resolve().then(a.bind(a,89379))},77321:(e,t,a)=>{"use strict";a.d(t,{Jz:()=>i,bU:()=>o,pi:()=>n});var r=a(95704);let s="phc_UlmvNEpf26TJM5jyEAjMxBIZcSKF1RxITy93wcIXDIq",l="true"===r.env.NEXT_PUBLIC_POSTHOG_DISABLED||"1"===r.env.NEXT_PUBLIC_POSTHOG_DISABLED,n=!!s.length&&!l,i="https://us.i.posthog.com",o=s}},e=>{e.O(0,[8229,297,8657,4909,7580,4050,8441,1255,7358],()=>e(e.s=72173)),_N_E=e.O()}]);
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.