1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3824],{16126:(e,t,a)=>{a.d(t,{A:()=>n});var r=a(95155),s=a(12115);function n(){let e=(0,s.useRef)(null);return(0,s.useEffect)(()=>{if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;let t=e.current;if(!t)return;let a=t.getContext("2d");if(!a)return;let r=0,s=0,n=[],l=[],i=0,o=0,c=()=>{let e=Math.min(window.devicePixelRatio||1,2);r=window.innerWidth,s=window.innerHeight,t.width=r*e,t.height=s*e,t.style.width="".concat(r,"px"),t.style.height="".concat(s,"px"),a.scale(e,e),d()},d=()=>{n=Array.from({length:Math.min(Math.floor(r*s/6e3),250)},()=>({x:Math.random()*r,y:Math.random()*s,r:1.5*Math.random()+.3,a:Math.random(),s:.008*Math.random()+.002})),l=Array.from({length:3},()=>({x:Math.random()*r,y:Math.random()*s,r:200*Math.random()+120,h:Math.random()>.5?270:40,a:.035*Math.random()+.015}))},u=()=>{for(let e of(a.clearRect(0,0,r,s),l)){let t=a.createRadialGradient(e.x,e.y,0,e.x,e.y,e.r);t.addColorStop(0,"hsla(".concat(e.h,",70%,50%,").concat(e.a,")")),t.addColorStop(1,"transparent"),a.fillStyle=t,a.fillRect(e.x-e.r,e.y-e.r,2*e.r,2*e.r)}for(let e of n){let t=.4+.6*Math.sin(i*e.s*6+100*e.a);a.beginPath(),a.arc(e.x,e.y,e.r,0,2*Math.PI),a.fillStyle="rgba(230,220,255,".concat(.8*t,")"),a.fill()}i++,o=requestAnimationFrame(u)};return window.addEventListener("resize",c),c(),u(),()=>{window.removeEventListener("resize",c),cancelAnimationFrame(o)}},[]),(0,r.jsx)("canvas",{ref:e,id:"cosmos","aria-hidden":"true",style:{position:"fixed",inset:0,zIndex:0,pointerEvents:"none"}})}},29293:(e,t,a)=>{a.d(t,{A:()=>c,AuthProvider:()=>o});var r=a(95155),s=a(12115),n=a(20063),l=a(37621);let i=(0,s.createContext)(void 0);function o(e){let{children:t}=e,[a,o]=(0,s.useState)(null),[c,d]=(0,s.useState)(!0),u=(0,n.useRouter)();(0,s.useEffect)(()=>{h()},[]);let h=async()=>{try{let e=await l.R2.me();o(e)}catch(e){o(null)}finally{d(!1)}},m=async(e,t)=>{try{let a=await l.R2.login(e,t);o(a.user),u.push("/dashboard")}catch(e){if(e instanceof l.LG)throw Error(e.message);throw Error("Login failed")}},x=async e=>{try{let t=await l.R2.register(e);o(t.user);let a=!1;try{a=!!sessionStorage.getItem("pendingScanTarget")||!!sessionStorage.getItem("pendingPeopleSearch")}catch(e){}u.push(a?"/":"/dashboard")}catch(e){if(e instanceof l.LG)throw Error(e.message);throw Error("Registration failed")}},g=async()=>{try{await l.R2.logout()}catch(e){console.error("Logout error:",e)}finally{o(null),u.push("/login")}},p=async e=>{o(await l.R2.updateBottomNavTabs(e))};return(0,r.jsx)(i.Provider,{value:{user:a,loading:c,login:m,register:x,logout:g,isAuthenticated:!!a,updateBottomNavTabs:p},children:t})}function c(){let e=(0,s.useContext)(i);if(void 0===e)throw Error("useAuth must be used within an AuthProvider");return e}},44893:(e,t,a)=>{a.d(t,{A:()=>x});var r=a(95155),s=a(12115),n=a(52619),l=a.n(n),i=a(56154),o=a(12108),c=a(24033),d=a(25563),u=a(9582),h=a(65229),m=a(90953);function x(e){let{compact:t=!0}=e,{status:a,activateKey:n,clearTrial:x}=(0,m.c)(),[g,p]=(0,s.useState)(!1),[f,b]=(0,s.useState)(""),[y,w]=(0,s.useState)(null),[v,k]=(0,s.useState)(!1),j=async e=>{e.preventDefault(),k(!0),w(null);let t=await n(f);w({ok:t.ok,text:t.message}),t.ok&&b(""),k(!1)};if(!a||a.isLoading)return t?(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsxs)("button",{onClick:()=>p(e=>!e),className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full text-xs font-mono font-medium transition-all",style:{background:"rgba(240,184,64,0.08)",border:"1px solid rgba(240,184,64,0.25)",color:"#f0b840"},"aria-label":"Activate trial key",children:[(0,r.jsx)(i.A,{className:"w-3 h-3"}),(null==a?void 0:a.isLoading)?"Checkingâ¦":"Trial",g?(0,r.jsx)(o.A,{className:"w-3 h-3"}):(0,r.jsx)(c.A,{className:"w-3 h-3"})]}),g&&(0,r.jsxs)("div",{className:"absolute top-full right-0 mt-2 w-72 rounded-xl p-4 z-50 text-left",style:{background:"rgba(8,8,42,0.97)",border:"1px solid rgba(240,184,64,0.25)",backdropFilter:"blur(20px)",boxShadow:"0 8px 32px rgba(0,0,0,0.5)"},onClick:e=>e.stopPropagation(),children:[(0,r.jsx)("p",{className:"text-xs font-mono uppercase tracking-widest mb-2",style:{color:"#f0b840"},children:"Activate trial key"}),(0,r.jsxs)("p",{className:"text-xs mb-3",style:{color:"#8878a9"},children:["Enter the ",(0,r.jsx)("code",{className:"font-mono",children:"sk-trial-â¦"})," key you received via SMS."]}),(0,r.jsxs)("form",{onSubmit:j,className:"flex flex-col gap-2",children:[(0,r.jsx)("input",{value:f,onChange:e=>b(e.target.value),placeholder:"sk-trial-...",className:"input-field font-mono text-xs",disabled:v}),(0,r.jsx)("button",{type:"submit",disabled:v||!f,className:"btn-premium text-xs py-2 disabled:opacity-50 disabled:cursor-not-allowed",children:v?"Activatingâ¦":"Activate"})]}),y&&(0,r.jsxs)("p",{className:"mt-2 text-xs font-medium flex items-center gap-1 ".concat(y.ok?"text-green-400":"text-red-400"),children:[y.ok?(0,r.jsx)(d.A,{className:"w-3 h-3"}):(0,r.jsx)(u.A,{className:"w-3 h-3"}),y.text]})]})]}):null;let S=a.percentUsed,N=a.scansRemaining,A=a.totalScans,E=a.isBlocked,R=E?"#f05a5a":S>=67?"#f0b840":"#50c878",C=E?"#f05a5a":"#f0b840";return t?(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsxs)("button",{onClick:()=>p(e=>!e),className:"inline-flex items-center gap-2 px-3 py-1.5 rounded-full text-xs font-mono font-medium transition-all",style:{background:E?"rgba(240,90,90,0.1)":"rgba(240,184,64,0.08)",border:"1px solid ".concat(E?"rgba(240,90,90,0.3)":"rgba(240,184,64,0.25)"),color:C},"aria-label":"Trial: ".concat(N,"/").concat(A," scans remaining"),children:[E?(0,r.jsx)(u.A,{className:"w-3 h-3"}):(0,r.jsx)(i.A,{className:"w-3 h-3"}),(0,r.jsx)("span",{children:"Trial"}),(0,r.jsx)("span",{className:"relative w-12 h-1.5 rounded-full overflow-hidden",style:{background:"rgba(255,255,255,0.1)"},children:(0,r.jsx)("span",{className:"absolute inset-y-0 left-0 rounded-full transition-all",style:{width:"".concat(100-S,"%"),background:R}})}),(0,r.jsxs)("span",{children:[N,"/",A]}),g?(0,r.jsx)(o.A,{className:"w-3 h-3"}):(0,r.jsx)(c.A,{className:"w-3 h-3"})]}),g&&(0,r.jsxs)("div",{className:"absolute top-full right-0 mt-2 w-64 roun
1ded-xl p-4 z-50",style:{background:"rgba(8,8,42,0.97)",border:"1px solid ".concat(E?"rgba(240,90,90,0.3)":"rgba(240,184,64,0.25)"),backdropFilter:"blur(20px)",boxShadow:"0 8px 32px rgba(0,0,0,0.5)"},children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,r.jsx)("p",{className:"text-xs font-mono uppercase tracking-widest",style:{color:C},children:"Trial quota"}),(0,r.jsx)("button",{onClick:x,className:"text-gray-500 hover:text-gray-300 transition-colors","aria-label":"Remove trial key",children:(0,r.jsx)(h.A,{className:"w-3.5 h-3.5"})})]}),(0,r.jsxs)("div",{className:"mb-3",children:[(0,r.jsxs)("div",{className:"flex justify-between text-xs mb-1",style:{color:"#8878a9"},children:[(0,r.jsx)("span",{children:"Used"}),(0,r.jsxs)("span",{style:{color:C},children:[S,"%"]})]}),(0,r.jsx)("div",{className:"h-2 rounded-full overflow-hidden",style:{background:"rgba(255,255,255,0.08)"},children:(0,r.jsx)("div",{className:"h-full rounded-full transition-all duration-500",style:{width:"".concat(S,"%"),background:"linear-gradient(90deg, ".concat(R,", ").concat(R,"99)")}})})]}),(0,r.jsx)("p",{className:"text-xs",style:{color:"#8878a9"},children:E?"Trial exhausted. Register for full access.":"".concat(N," of ").concat(A," trial scans remaining.")}),E&&(0,r.jsx)(l(),{href:"/register",className:"mt-3 block text-center text-xs py-2 rounded-lg btn-premium",children:"Create full account"})]})]}):null}},90953:(e,t,a)=>{a.d(t,{c:()=>i});var r=a(12115);let s="spectrapro_trial_key",n="spectrapro:trial-status-updated";function l(e){let t="".replace(/\/$/,"");return t?"".concat(t).concat(e):e}function i(){let[e,t]=(0,r.useState)(null),[a,i]=(0,r.useState)(!1),o=(0,r.useCallback)(()=>{localStorage.removeItem(s),t(null),window.dispatchEvent(new Event(n))},[]),c=(0,r.useCallback)(async e=>{try{let a=await fetch(l("/api/trial/status"),{headers:{Authorization:"Bearer ".concat(e)},credentials:"include"});if(404===a.status)return localStorage.removeItem(s),t(null),!1;if(!a.ok)return t(t=>(null==t?void 0:t.key)===e?{...t,isLoading:!1,error:"Trial status check failed (HTTP ".concat(a.status,").")}:t),!1;let r=await a.json();if(!r.success)return t(t=>{var a,s;return(null==t?void 0:t.key)===e?{...t,isLoading:!1,error:null!=(s=null==(a=r.error)?void 0:a.message)?s:"Trial status could not be verified."}:t}),!1;let n=r.data;return t({key:e,scansRemaining:n.scansRemaining,totalScans:n.totalScans,isBlocked:n.isBlocked,expiresAt:n.expiresAt,percentUsed:n.totalScans>0?Math.round((n.totalScans-n.scansRemaining)/n.totalScans*100):100,isLoading:!1,error:null}),"number"==typeof n.creditBalance&&window.dispatchEvent(new Event("spectrapro:credits-updated")),!0}catch(a){return t(t=>(null==t?void 0:t.key)===e?{...t,isLoading:!1,error:"Trial status is temporarily unavailable. Check your connection and retry."}:t),!1}},[]),d=(0,r.useCallback)(async e=>{let a=e.trim();if(!/^sk-trial-[0-9a-f]{24}$/.test(a))return{ok:!1,message:"Invalid trial key format. It should look like sk-trial-..."};t(e=>e?{...e,isLoading:!0}:{key:a,scansRemaining:0,totalScans:3,isBlocked:!1,expiresAt:null,percentUsed:0,isLoading:!0,error:null});try{let e=await fetch(l("/api/trial/activate"),{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({key:a})}),o=await e.json();if(!o.success){var r,i;return t(null),{ok:!1,message:null!=(i=null==(r=o.error)?void 0:r.message)?i:"Could not activate key."}}let c=o.data;localStorage.setItem(s,a);let d={key:a,scansRemaining:c.scansRemaining,totalScans:c.totalScans,isBlocked:c.isBlocked,expiresAt:c.expiresAt,percentUsed:c.totalScans>0?Math.round((c.totalScans-c.scansRemaining)/c.totalScans*100):100,isLoading:!1,error:null};return t(d),window.dispatchEvent(new Event("spectrapro:credits-updated")),window.dispatchEvent(new Event(n)),{ok:!0,message:c.isBlocked?"Trial exhausted.":"Activated! ".concat(c.scansRemaining,"/").concat(c.totalScans," scans remaining.")}}catch(e){return t(null),{ok:!1,message:"Network error. Please try again."}}},[]),u=(0,r.useCallback)(()=>{let e=localStorage.getItem(s);if(!e){t(null),i(!0);return}t(t=>(null==t?void 0:t.key)===e?t:{key:e,scansRemaining:0,totalScans:3,isBlocked:!1,expiresAt:null,percentUsed:0,isLoading:!0,error:null}),i(!0),c(e)},[c]);return(0,r.useEffect)(()=>{u();let e=setInterval(u,6e4);return window.addEventListener(n,u),()=>{clearInterval(e),window.removeEventListener(n,u)}},[u]),{status:e,initialized:a,activateKey:d,clearTrial:o,refresh:u}}}}]);
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.