PageSourceSearch

https://upgpt.ai/_next/static/chunks/19182.0d2183d738ccfae9.js

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

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[19182],{92369:function(e,t,a){a.d(t,{Z:function(){return s}});let s=(0,a(79205).Z)("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]])},19182:function(e,t,a){a.r(t),a.d(t,{default:function(){return d}});var s=a(57437),l=a(2265),n=a(44743),r=a(31047),i=a(92369),c=a(40875);let o=[{id:"consultation",name:"Consultation"},{id:"demo",name:"Demo"},{id:"onboarding",name:"Onboarding"},{id:"support",name:"Support"}];function d(e){let{panelProps:t,onEvent:a}=e,d=(null==t?void 0:t.clientId)||"",[u,x]=(0,l.useState)(""),[m,p]=(0,l.useState)(""),[h,g]=(0,l.useState)(""),[f,y]=(0,l.useState)(""),[b,v]=(0,l.useState)(""),[j,N]=(0,l.useState)(!1),[S,k]=(0,l.useState)(!1),[w,C]=(0,l.useState)(""),[Z,T]=(0,l.useState)(o);async function _(){if(!u||!m||!h||!f){C("Please fill in all required fields");return}C(""),N(!0);try{(await fetch("/api/upschedule/bookings",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({tenant_id:d,name:u,email:m,service:h,datetime:f,notes:b})})).ok?(k(!0),a({type:"upschedule.booking.created",payload:{name:u,service:h,datetime:f}}),setTimeout(()=>{k(!1),x(""),p(""),g(""),y(""),v("")},3e3)):C("Failed to create booking. Please try again.")}catch(e){C("Network error. Please try again.")}finally{N(!1)}}if((0,l.useEffect)(()=>{fetch("/api/upschedule/event-types",{credentials:"include"}).then(e=>e.ok?e.json():null).then(e=>{let t=null==e?void 0:e.eventTypes;Array.isArray(t)&&t.length>0&&T(t.filter(e=>!1!==e.is_active))}).catch(()=>{})},[]),S)return(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center h-full gap-3 p-6 text-center",children:[(0,s.jsx)("div",{className:"h-12 w-12 rounded-full bg-green-100 flex items-center justify-center",children:(0,s.jsx)(n.Z,{className:"h-6 w-6 text-green-600"})}),(0,s.jsx)("p",{className:"text-sm font-semibold text-gray-800",children:"Booking Confirmed!"}),(0,s.jsxs)("p",{className:"text-xs text-gray-500",children:[u," has been booked for ",h,".",(0,s.jsx)("br",{}),"A confirmation email has been sent."]})]});let P="w-full rounded-lg border border-gray-200 px-3 py-2 text-xs text-gray-800 placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-blue-500";return(0,s.jsxs)("div",{className:"p-4 flex flex-col gap-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,s.jsx)(r.Z,{className:"h-4 w-4 text-blue-500"}),(0,s.jsx)("h3",{className:"text-sm font-semibold text-gray-800",children:"New Booking"})]}),w&&(0,s.jsx)("div",{className:"rounded-lg bg-red-50 border border-red-200 px-3 py-2 text-xs text-red-700",children:w}),(0,s.jsxs)("div",{className:"space-y-2.5",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-[10px] font-semibold text-gray-500 uppercase",children:"Name"}),(0,s.jsxs)("div",{className:"relative mt-1",children:[(0,s.jsx)(i.Z,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-gray-400"}),(0,s.jsx)("input",{type:"text",value:u,onChange:e=>x(e.target.value),placeholder:"Full name",className:"".concat(P," pl-8")})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-[10px] font-semibold text-gray-500 uppercase",children:"Email"}),(0,s.jsx)("input",{type:"email",value:m,onChange:e=>p(e.target.value),placeholder:"[email protected]",className:"mt-1 ".concat(P)})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-[10px] font-semibold text-gray-500 uppercase",children:"Service Type"}),(0,s.jsxs)("div",{className:"relative mt-1",children:[(0,s.jsxs)("select",{value:h,onChange:e=>g(e.target.value),className:"".concat(P," appearance-none pr-8"),children:[(0,s.jsx)("option",{value:"",children:"Select service…"}),Z.map(e=>{var t;return(0,s.jsx)("option",{value:String(e.name),children:String(e.name)},String(null!==(t=e.id)&&void 0!==t?t:e.slug))})]}),(0,s.jsx)(c.Z,{className:"absolute right-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-gray-400 pointer-events-none"})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-[10px] font-semibold text-gray-500 uppercase",children:"Preferred Date & Time"}),(0,s.jsx)("input",{type:"datetime-local",value:f,onChange:e=>y(e.target.value),min:new Date().toISOString().slice(0,16),className:"mt-1 ".concat(P)})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-[10px] font-semibold text-gray-500 uppercase",children:"Notes"}),(0,s.jsx)("textarea",{value:b,onChange:e=>v(e.target.value),placeholder:"Any additional details…",rows:2,className:"mt-1 ".concat(P," resize-none")})]})]}),(0,s.jsxs)("button",{type:"button",onClick:_,disabled:j,className:"flex items-center justify-center gap-1.5 rounded-xl bg-blue-600 py-2.5 text-xs font-medium text-white hover:bg-blue-700 transition-colors disabled:opacity-60 mt-1",children:[(0,s.jsx)(r.Z,{className:"h-3.5 w-3.5"}),j?"Creating…":"Create Booking"]})]})}}}]);

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.