PageSourceSearch

https://upgpt.ai/_next/static/chunks/70891.a230498f749a45de.js

js upgpt.ai collected 2026-10-05 13:12:11 UTC 11,295 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[70891],{70891:function(e,t,a){a.r(t),a.d(t,{default:function(){return s}});var o=a(57437),l=a(2265);let r=[{id:"strategy",label:"AI Strategy Call (30 min)"},{id:"demo",label:"Product Demo (45 min)"},{id:"technical",label:"Technical Deep-Dive (60 min)"},{id:"support",label:"Customer Support"},{id:"partnership",label:"Partnership Inquiry"},{id:"other",label:"General Inquiry"}],n=new Set(["strategy","demo","technical"]);function s(e){let{defaultName:t="",defaultEmail:a="",defaultPhone:s="",defaultCompany:i="",channel:c="chat",position:d="bottom-right",onOpenChange:u,logo:h="",company:m="",greeting:p="",cta:x="",hideBranding:b=!1}=e,[f,g]=(0,l.useState)(!1),y=e=>{g(e),null==u||u(e)},[w,v]=(0,l.useState)("greeting"),[j,k]=(0,l.useState)([]),[N,S]=(0,l.useState)(""),[C,_]=(0,l.useState)(!1),T=(0,l.useRef)(null),[L,P]=(0,l.useState)(""),[I,M]=(0,l.useState)(t),[W,D]=(0,l.useState)(a),[A,O]=(0,l.useState)(s),[Y,B]=(0,l.useState)(i),[E,G]=(0,l.useState)([]),[z,U]=(0,l.useState)(null),[q,F]=(0,l.useState)(null),[J,H]=(0,l.useState)(""),K="undefined"!=typeof Intl?Intl.DateTimeFormat().resolvedOptions().timeZone:"America/New_York";(0,l.useEffect)(()=>{var e;null===(e=T.current)||void 0===e||e.scrollTo({top:T.current.scrollHeight,behavior:"smooth"})},[j,w]);let R=(0,l.useCallback)((e,t)=>{k(a=>[...a,{id:"".concat(Date.now(),"-").concat(Math.random()),role:e,text:t,timestamp:new Date}])},[]);(0,l.useEffect)(()=>{f&&0===j.length&&(R("archer",p||"Hey! I'm UpSchedule, UpGPT's AI scheduling assistant. What can I help you with today?"),v("inquiry-type"))},[f,j.length,R]);let V=e=>{let t=r.find(t=>t.id===e);R("user",(null==t?void 0:t.label)||e),P(e),I?W?A?Q(e,I,W,A,Y):(R("archer","Great choice! What's the best phone number to reach you, ".concat(I.split(" ")[0],"?")),v("collect-phone")):(R("archer","Great choice! What's your work email, ".concat(I.split(" ")[0],"?")),v("collect-email")):(R("archer","Great choice! What's your name?"),v("collect-name"))},Z=()=>{let e=N.trim();if(e)switch(S(""),R("user",e),w){case"collect-name":M(e),R("archer","Nice to meet you, ".concat(e.split(" ")[0],"! What's your work email?")),v("collect-email");break;case"collect-email":if(!e.includes("@")){R("archer","That doesn't look like an email. Could you try again?");return}D(e),R("archer","And your phone number?"),v("collect-phone");break;case"collect-phone":O(e),R("archer","What company are you with? (or type 'skip')"),v("collect-company");break;case"collect-company":{let t="skip"===e.toLowerCase()?"":e;B(t),Q(L,I,W,A,t)}}},Q=async(e,t,a,o,l)=>{if(v("routing"),R("archer","Finding your best match and checking availability..."),_(!0),!n.has(e)){try{await fetch("/api/contact",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:t,email:a,phone:o,company:l,type:e,message:"",channel:c})}),R("archer","Your message has been submitted! We'll get back to you within one business day."),v("contact-submitted")}catch(e){R("archer","Something went wrong. Please try again or email [email protected].")}_(!1);return}try{var r;let n=await fetch("/api/route-lead",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:t,email:a,phone:o,company:l,meetingType:e,timezone:K,channel:c,custom_fields:{}})});if(!n.ok)throw Error("route failed");let s=await n.json();F(s.rep),G(s.availability||[]);let i=(null===(r=s.rep)||void 0===r?void 0:r.name)||"our team",d=(s.availability||[]).reduce((e,t)=>e+t.slots.length,0);R("archer","You'll be speaking with ".concat(i,". I found ").concat(d," available times. Pick one below!")),v("show-slots")}catch(e){R("archer","I couldn't fetch availability right now. Please try the booking page or email [email protected].")}_(!1)},X=(e,t,a)=>{U({date:e,label:t,start:a});let o=E.find(t=>t.date===e);R("user","".concat((null==o?void 0:o.day_label)||e," at ").concat(t)),R("archer","".concat((null==o?void 0:o.day_label)||e," at ").concat(t," — shall I confirm this booking?")),v("confirm-slot")},$=async()=>{if(z&&q){_(!0),R("user","Yes, confirm it!");try{let e=z.start.match(/T(\d{2}:\d{2})/),t=e?e[1]:z.label,a=await fetch("/api/bookings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({meetingType:L,date:z.date,time:t,timezone:K,name:I,email:W,phone:A,company:Y,notes:"Booked via ".concat(c," widget"),rep_email:q.email,rep_name:q.name,channel:c})});if(!a.ok)throw Error("booking failed");let o=await a.json();o.meet_link&&H(o.meet_link),R("archer","You're all set! Your meeting with ".concat(q.name," is confirmed. A calendar invite has been sent to ").concat(W,".").concat(o.meet_link?" You can join via Google Meet when it's time.":"")),v("confirmed")}catch(e){R("archer","Booking failed. Please try again."),v("show-slots")}_(!1)}},ee="bottom-left"===d?"left-5":"right-5";return(0,o.jsxs)(o.Fragment,{children:[!f&&(0,o.jsxs)("button",{onClick:()=>y(!0),className:"fixed bottom-5 ".concat(ee," z-50 rounded-full bg-electric-blue text-white shadow-lg hover:bg-electric-blue/90 transition-all flex items-center justify-center ").concat(x?"h-12 px-5 gap-2":"h-14 w-14"),"aria-label":"Open chat",children:[(0,o.jsx)("svg",{className:"h-6 w-6 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,o.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.25
15-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})}),x&&(0,o.jsx)("span",{className:"text-sm font-medium whitespace-nowrap",children:x})]}),f&&(0,o.jsxs)("div",{className:"fixed bottom-5 ".concat(ee," z-50 w-[380px] max-w-[calc(100vw-40px)] rounded-2xl border border-border bg-background shadow-2xl flex flex-col"),style:{height:"min(600px, calc(100vh - 100px))"},children:[(0,o.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-electric-blue rounded-t-2xl",children:[(0,o.jsxs)("div",{className:"flex items-center gap-2",children:[h?(0,o.jsx)("img",{src:h,alt:m||"Logo",className:"h-8 w-8 rounded-full object-cover"}):(0,o.jsx)("div",{className:"h-8 w-8 rounded-full bg-white/20 flex items-center justify-center text-white text-xs font-bold",children:m?m[0].toUpperCase():"A"}),(0,o.jsxs)("div",{children:[(0,o.jsx)("p",{className:"text-sm font-semibold text-white",children:m||"UpSchedule"}),(0,o.jsx)("p",{className:"text-xs text-white/70",children:"AI Scheduling Assistant"})]})]}),(0,o.jsx)("button",{onClick:()=>y(!1),className:"text-white/70 hover:text-white transition-colors","aria-label":"Close chat",children:(0,o.jsx)("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,o.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,o.jsxs)("div",{ref:T,className:"flex-1 overflow-y-auto px-4 py-3 space-y-3",children:[j.map(e=>(0,o.jsx)("div",{className:"flex ".concat("user"===e.role?"justify-end":"justify-start"),children:(0,o.jsx)("div",{className:"max-w-[80%] rounded-2xl px-4 py-2 text-sm leading-relaxed ".concat("user"===e.role?"bg-electric-blue text-white rounded-br-md":"bg-muted text-foreground rounded-bl-md"),children:e.text})},e.id)),C&&(0,o.jsx)("div",{className:"flex justify-start",children:(0,o.jsx)("div",{className:"bg-muted rounded-2xl rounded-bl-md px-4 py-2",children:(0,o.jsxs)("div",{className:"flex gap-1",children:[(0,o.jsx)("span",{className:"h-2 w-2 rounded-full bg-muted-foreground/40 animate-bounce",style:{animationDelay:"0ms"}}),(0,o.jsx)("span",{className:"h-2 w-2 rounded-full bg-muted-foreground/40 animate-bounce",style:{animationDelay:"150ms"}}),(0,o.jsx)("span",{className:"h-2 w-2 rounded-full bg-muted-foreground/40 animate-bounce",style:{animationDelay:"300ms"}})]})})}),"inquiry-type"===w&&(0,o.jsx)("div",{className:"space-y-2 pt-1",children:r.map(e=>(0,o.jsx)("button",{onClick:()=>V(e.id),className:"block w-full text-left rounded-xl border border-border px-4 py-2.5 text-sm hover:bg-muted/50 hover:border-electric-blue/30 transition-all",children:e.label},e.id))}),"show-slots"===w&&E.length>0&&(0,o.jsx)("div",{className:"space-y-3 pt-1",children:E.map(e=>e.slots.length>0?(0,o.jsxs)("div",{children:[(0,o.jsx)("p",{className:"text-xs font-semibold text-muted-foreground mb-1.5",children:e.day_label}),(0,o.jsx)("div",{className:"flex flex-wrap gap-1.5",children:e.slots.map(t=>(0,o.jsx)("button",{onClick:()=>X(e.date,t.label,t.start),className:"rounded-lg bg-muted px-3 py-1.5 text-xs font-medium text-muted-foreground hover:bg-electric-blue hover:text-white transition-colors",children:t.label},"".concat(e.date,"-").concat(t.label)))})]},e.date):null)}),"confirm-slot"===w&&(0,o.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,o.jsx)("button",{onClick:$,disabled:C,className:"flex-1 rounded-xl bg-green-600 hover:bg-green-700 text-white py-2 text-sm font-medium transition-colors disabled:opacity-50",children:C?"Booking...":"Confirm"}),(0,o.jsx)("button",{onClick:()=>{R("user","No, show me other times."),U(null),R("archer","No problem! Pick another time below."),v("show-slots")},className:"flex-1 rounded-xl border border-border text-muted-foreground py-2 text-sm font-medium hover:bg-muted transition-colors",children:"Pick another"})]}),"confirmed"===w&&J&&(0,o.jsx)("div",{className:"pt-1",children:(0,o.jsxs)("a",{href:J,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 rounded-xl bg-electric-blue text-white px-4 py-2 text-sm font-medium hover:bg-electric-blue/90 transition-colors",children:[(0,o.jsx)("svg",{className:"h-4 w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,children:(0,o.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 10l4.553-2.276A1 1 0 0121 8.618v6.764a1 1 0 01-1.447.894L15 14M5 18h8a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z"})}),"Join Google Meet"]})})]}),["collect-name","collect-email","collect-phone","collect-company"].includes(w)&&(0,o.jsx)("div",{className:"px-4 py-3 border-t border-border",children:(0,o.jsxs)("div",{className:"flex gap-2",children:[(0,o.jsx)("input",{type:"collect-email"===w?"email":"collect-phone"===w?"tel":"text",value:N,onChange:e=>S(e.target.value),onKeyDown:e=>"Enter"===e.key&&Z(),placeholder:"collect-name"===w?"Your name...":"collect-email"===w?"[email protected]":"collect-phone"===w?"+1 (555) 123-4567":"Company name or 'skip'",className:"flex-1 rounded-xl border border-border px-4 py-2 text-sm bg-background focus:outline-none focus:ring-2 focus:ring-electric-blue focus:border-transparent",autoFocus:!0}),(0,o.jsx)("button",{onClick:Z,disabled:!N.trim(),className:"rounded-xl bg-electric-blue text-white px-4 py-2 text-sm font-medium hover:bg-electric-blue/90 transition-colors disabled:opacity-50",children:(0,o.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,o.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 19l9 2-9-18-9 18 9-2zm0 0v-8"})})})]})}),!b&&(0,o.jsx)("div",{className:"px-4 py-2 border-t border-border text-center",children:(0,o.jsx)("p",{className:"text-[10px] text-muted-foreground
1/50",children:"Powered by UpSchedule"})})]})]})}}}]);

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.