PageSourceSearch

https://gocard.app/assets/TrackedQRRedirect-Cr4Y-A2i.js

js gocard.app collected 2026-10-09 23:08:31 UTC 9,725 bytes, 1 lines download raw bytes

1import{a2 as F,r as x,j as e,A as U,$ as H}from"./index-DuFHDgjL.js";import{t as V}from"./trackedQrRedirect-Ck0MAp1x.js";import{g as N}from"./sparkPublicSafety--wmIdtDI.js";import{W as Y}from"./workflow-CLKd8WUl.js";import{R as z}from"./route-DLV44ZZc.js";import{C as X}from"./contact-BYspzVLm.js";import{U as Z}from"./user-plus-Cgiyw1ET.js";const D=new Map;function ee(o,n){const d=window.location.pathname,u=window.history.state&&typeof window.history.state=="object"?window.history.state:{},s=u.__gocard_oneqr_scan_request;if(s!=null&&s.id&&s.path===d&&s.shortCode===String(o||"")&&s.deploymentMode===n)return s.id;const c=crypto.randomUUID();try{window.history.replaceState({...u,__gocard_oneqr_scan_request:{id:c,path:d,shortCode:String(o||""),deploymentMode:n}},"",window.location.href)}catch{}return c}function te(){const o="gocard_tracked_qr_visitor_key";let n=localStorage.getItem(o);return n||(n=`${Date.now()}-${crypto.randomUUID()}`,localStorage.setItem(o,n)),n}function ne(){const o="gocard_oneqr_session_key";let n=sessionStorage.getItem(o);return n||(n=`${Date.now()}-${crypto.randomUUID()}`,sessionStorage.setItem(o,n)),n}function O(o){return`gocard_oneqr_contact_seen:${o}`}function re(){const o=navigator.userAgent||"";return/iPhone|iPad|iPod/i.test(o)||/Macintosh/i.test(o)&&navigator.maxTouchPoints>0}async function w({oneQrId:o,scanEventId:n,visitorKey:d,sessionKey:u,eventType:s}){if(!(!o||!n||!s))try{await fetch("/functions/recordOneQrJourneyEvent",{method:"POST",headers:{"content-type":"application/json"},keepalive:!0,body:JSON.stringify({oneqr_id:o,scan_event_id:n,visitor_key:d,session_key:u,event_type:s,referrer:document.referrer||"",user_agent:navigator.userAgent||"",platform:`${navigator.platform||""};maxTouchPoints=${navigator.maxTouchPoints||0}`})})}catch{}}function ue({deploymentMode:o=!1}){const{shortCode:n}=F(),d=x.useRef(""),u=x.useRef(""),s=x.useRef(null),[c,k]=x.useState(null),[r,A]=x.useState(null),[I,G]=x.useState(!1),[R,S]=x.useState(""),_=(f=s.current)=>{if(!f)return;k(null);const{stop:m,destinationUrl:a,destinationType:h,oneQrId:i,scanEventId:l}=f,v=d.current,t=u.current;if(!m){w({oneQrId:i,scanEventId:l,visitorKey:v,sessionKey:t,eventType:"destination_reached"}),window.location.replace(a);return}if(m.frequency==="first_visit"&&localStorage.getItem(O(i))==="1"){w({oneQrId:i,scanEventId:l,visitorKey:v,sessionKey:t,eventType:"destination_reached"}),window.location.replace(a);return}localStorage.setItem(O(i),"1");const j=N(m.vcf_url,{allowRelative:!0,allowContact:!1});A({...m,vcf_url:j,destinationUrl:a,destinationType:h,oneQrId:i,scanEventId:l}),w({oneQrId:i,scanEventId:l,visitorKey:v,sessionKey:t,eventType:"contact_prompt_shown"})};x.useEffect(()=>{let f=!1;return(async()=>{var K,P,$,q,Q;const a=te(),h=ne();d.current=a,u.current=h;const i=ee(n,o);let l=D.get(i);l||(l=V({...o?{deploymentToken:n}:{qrId:n},scanRequestId:i,visitorKey:a,sessionKey:h,referrer:document.referrer||"",userAgent:navigator.userAgent||"",platform:`${navigator.platform||""};maxTouchPoints=${navigator.maxTouchPoints||0}`}),D.set(i,l));const v=await l.catch(()=>null);if(f)return;const t=(v==null?void 0:v.data)||v,j=N(t==null?void 0:t.destination_url,{allowRelative:!0,allowContact:!1})||"https://gocard.app",g=((K=t==null?void 0:t.event)==null?void 0:K.event_id)||"",b=(t==null?void 0:t.oneqr_id)||(String(n||"").startsWith("profile__")?n:""),W=((P=t==null?void 0:t.journey)==null?void 0:P.stop)==="save_contact"?t.journey:null,B=(($=t==null?void 0:t.route)==null?void 0:$.effective_destination_type)||"profile",E={stop:W,destinationUrl:j,destinationType:B,oneQrId:b,scanEventId:g};s.current=E;const T=N((q=t==null?void 0:t.detour)==null?void 0:q.form_url,{allowRelative:!0,allowContact:!1});if(((Q=t==null?void 0:t.detour)==null?void 0:Q.type)==="pipeline"&&T){k({...t.detour,form_url:T,oneQrId:b,scanEventId:g}),w({oneQrId:b,scanEventId:g,visitorKey:a,sessionKey:h,eventType:"detour_entered"}),w({oneQrId:b,scanEventId:g,visitorKey:a,sessionKey:h,eventType:"pipeline_view"});return}_(E)})(),()=>{f=!0}},[n,o]),x.useEffect(()=>{if(!c)return;let f=!1;const m=a=>{var h,i,l;if(!(a.origin!==window.location.origin||((h=a.data)==null?void 0:h.detourId)!==c.id)){if(((i=a.data)==null?void 0:i.type)==="gocard-oneqr-pipeline-start"&&!f){f=!0,w({oneQrId:c.oneQrId,scanEventId:c.scanEventId,visitorKey:d.current,sessionKey:u.current,eventType:"pipeline_start"});return}((l=a.data)==null?void 0:l.type)==="gocard-oneqr-pipeline-submit"&&window.setTimeout(()=>_(),900)}};return window.addEventListener("message",m),()=>window.removeEventListener("message",m)},[c]);const p=(r==null?void 0:r.public_identity)||{},C=x.useMemo(()=>
1[p.job_title,p.company].filter(Boolean).join(" · "),[p.job_title,p.company]),y=(r==null?void 0:r.destinationType)==="spark"?"Spark":"Profile Page",J=()=>{if(!(r!=null&&r.vcf_url)){S(`Contact card couldn't open. Continue to ${y} instead.`);return}G(!0),w({oneQrId:r.oneQrId,scanEventId:r.scanEventId,visitorKey:d.current,sessionKey:u.current,eventType:"contact_opened"});const f=re()?"apple":"android",m=window.open(`${r.vcf_url}&mode=${f}&v=${Date.now()}`,"_blank");if(m)try{m.opener=null}catch{}else S(`Contact card couldn't open in a new tab. You can still continue to ${y}.`)},L=()=>{r!=null&&r.destinationUrl&&(I||w({oneQrId:r.oneQrId,scanEventId:r.scanEventId,visitorKey:d.current,sessionKey:u.current,eventType:"contact_prompt_skipped"}),w({oneQrId:r.oneQrId,scanEventId:r.scanEventId,visitorKey:d.current,sessionKey:u.current,eventType:"destination_reached"}),window.location.replace(r.destinationUrl))},M=()=>_();return c?e.jsx("main",{className:"min-h-screen bg-[radial-gradient(circle_at_top,#172554_0%,#07152b_42%,#020617_100%)] px-3 py-4 text-white sm:px-5 sm:py-6",children:e.jsxs("div",{className:"mx-auto w-full max-w-4xl overflow-hidden rounded-[1.75rem] border border-violet-300/20 bg-slate-950/92 shadow-2xl backdrop-blur-xl",children:[e.jsxs("div",{className:"flex flex-col gap-3 border-b border-white/10 px-4 py-4 sm:flex-row sm:items-center sm:justify-between sm:px-6",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-xl bg-violet-500/15",children:e.jsx(Y,{className:"h-5 w-5 text-violet-200"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-[0.22em] text-violet-200",children:"ONE-QR Temporary Detour"}),e.jsx("h1",{className:"text-lg font-black text-white",children:c.form_name||"Pipeline"})]})]}),e.jsxs("button",{onClick:M,className:"flex items-center justify-center rounded-xl border border-white/10 bg-white/5 px-4 py-2.5 text-xs font-black text-white hover:bg-white/10",children:["Skip and continue ",e.jsx(U,{className:"ml-2 h-4 w-4"})]})]}),e.jsx("div",{className:"bg-slate-950 p-2 sm:p-4",children:e.jsx("iframe",{src:c.form_url,title:c.form_name||"Pipeline Detour",className:"h-[calc(100vh-180px)] min-h-[520px] w-full rounded-xl border-0 bg-slate-950"})}),e.jsxs("div",{className:"flex items-center justify-center gap-2 border-t border-white/10 px-4 py-3 text-[10px] font-bold uppercase tracking-[0.16em] text-slate-500",children:[e.jsx(z,{className:"h-3.5 w-3.5"})," Temporary routing powered by GoCard ONE-QR"]})]})}):r?e.jsx("main",{className:"min-h-screen bg-[radial-gradient(circle_at_top,#12305b_0%,#07152b_45%,#020617_100%)] px-5 py-8 text-white",children:e.jsx("div",{className:"mx-auto flex min-h-[calc(100vh-4rem)] w-full max-w-md items-center justify-center",children:e.jsxs("section",{className:"w-full overflow-hidden rounded-[2rem] border border-cyan-300/20 bg-slate-950/90 p-6 text-center shadow-2xl backdrop-blur-xl sm:p-8",children:[e.jsx("div",{className:"mx-auto mb-5 flex h-24 w-24 items-center justify-center overflow-hidden rounded-3xl border border-cyan-200/20 bg-slate-900 shadow-xl",children:p.profile_photo_url?e.jsx("img",{src:p.profile_photo_url,alt:p.full_name||"GoCard member",className:"h-full w-full object-cover"}):p.logo_url?e.jsx("img",{src:p.logo_url,alt:"Company logo",className:"h-full w-full object-contain p-3"}):e.jsx(X,{className:"h-10 w-10 text-cyan-200"})}),e.jsx("p",{className:"text-[10px] font-black uppercase tracking-[0.28em] text-cyan-200",children:"ONE-QR Contact Exchange"}),e.jsxs("h1",{className:"mt-3 text-3xl font-black leading-tight text-white",children:["Save ",p.full_name||"this contact"," to your contacts?"]}),C&&e.jsx("p",{className:"mt-2 text-sm font-bold text-slate-300",children:C}),e.jsxs("p",{className:"mx-auto mt-4 max-w-sm text-sm font-semibold leading-relaxed text-slate-300",children:["Keep their latest GoCard contact information handy, then continue to ",y,"."]}),e.jsxs("button",{onClick:J,className:"mt-6 flex w-full items-center justify-center rounded-2xl bg-gradient-to-r from-emerald-500 to-cyan-500 px-5 py-4 text-base font-black text-white shadow-lg transition hover:brightness-110",children:[e.jsx(Z,{className:"mr-2 h-5 w-5"})," Save Contact"]}),e.jsxs("button",{onClick:L,className:"mt-3 flex w-full items-center justify-center rounded-2xl border border-white/10 bg-white/5 px-5 py-4 text-sm font-black text-white transition hover:bg-white/10",children:[I?`Continue to ${y}`:`Not now, continue to ${y}`," ",e.jsx(U,{className:"ml-2 h-4 w-4"})]}),R&&e.jsx("p",{className:"mt-4 rounded-xl border border-amber-300/20 bg-amber-500/10 px-3 py-2 text-xs font-bold text-amber-100",children:R}),e.jsxs("div",{className:"mt-6 flex items-center justify-center gap-2 text-[10px] font-bold uppercase tracking-[0.18em] text-slate-500",children:[e.jsx(H,{className:"h-3.5 w-3.5"})," Powered by GoCard · ONE-QR"]})]})})}):e.jsx("div",{className:"min-h-screen bg-black","aria-label":"Redirecting"})}export{ue as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.