PageSourceSearch

https://levenza.com/_wa/_next/static/chunks/pages/book/[bookingId]…/cancel-19ae52afe3be0608.js

js levenza.com collected 2026-10-09 22:14:10 UTC 14,022 bytes, 1 lines download raw bytes

1try{!function(){var e="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{},r=(new e.Error).stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="6b4468d4-9510-4b86-92df-87f1867fc039",e._sentryDebugIdIdentifier="sentry-dbid-6b4468d4-9510-4b86-92df-87f1867fc039")}()}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4709],{22614:(e,r,t)=>{"use strict";t.d(r,{J:()=>s});var a=t(60548),n=t(76454),o=t(6598),l=t(62496);let s=({bookingId:e,bookingResponseId:r,manageToken:t})=>(0,a.I)({queryKey:[o.Vc,e,r,(0,l.vo)(t)],queryFn:async()=>{let a=(0,l.Kg)({bookingId:e,bookingResponseId:r,action:"status"}),o=await fetch(a,{headers:(0,l.Pb)(t)});if(404===o.status)return{bookingResponse:null,error:`${o.status}: ${o.statusText}`};if(!o.ok)throw new n.fk("Failed to fetch managed booking response",o.status,a);return{bookingResponse:(await o.json()).bookingResponse,error:null}}})},25844:(e,r,t)=>{"use strict";t.d(r,{Ox:()=>m,Wv:()=>f,fy:()=>c,hv:()=>g,w4:()=>b,zs:()=>u});var a=t(27416);let n=a.yAz.reduce((e,r,t)=>(e[`calendar${t}`]={100:r.flexible.background,200:r.flexible.background,300:r.somewhatFlexible.background,400:r.somewhatFlexible.background,500:r.nonFlexible.background,600:r.nonFlexible.background,700:r.busyColor,800:r.darkColor,900:r.darkColor},e),{}),o=a.yAz.reduce((e,r)=>(e[r.name]={100:r.flexible.background,200:r.flexible.background,300:r.somewhatFlexible.background,400:r.somewhatFlexible.background,500:r.nonFlexible.background,600:r.nonFlexible.background,700:r.busyColor,800:r.darkColor,900:r.darkColor},e),{}),l=a.OHe.reduce((e,r)=>(e[r.name]={100:r.flexible.background,200:r.flexible.background,300:r.somewhatFlexible.background,400:r.somewhatFlexible.background,500:r.nonFlexible.background,600:r.busyColor,700:r.darkColor,800:r.darkColor,900:r.darkColor},e),{}),s="#33063D",d="#8C49B4",i="#D286FF",c={deepPlum:s,mediumPlum:d,brightPlum:i},u={...n,...o,...l,userCalendar:{100:a.vAr.flexible.background,200:a.vAr.flexible.background,300:a.vAr.somewhatFlexible.background,400:a.vAr.somewhatFlexible.background,500:a.vAr.nonFlexible.background,600:a.vAr.nonFlexible.background,700:a.vAr.busyColor,800:a.vAr.darkColor,900:a.vAr.darkColor},scPurple:{50:"#FAF0FF",100:"#F0D6FF",150:"#EBC9FF",200:"#E6BBFF",300:i,350:i,400:d,500:d,550:d,600:d,700:s,800:s,900:s},scPurpleBright:{50:"#FAF0FF",100:"#F0D6FF",150:"#EBC9FF",200:"#E6BBFF",300:i,350:i,400:d,500:d,550:d,600:d,700:s,800:s,900:s},zoomBlue:{50:"#F2F8FF",100:"#DAE6FD",200:"#B0C9FB",300:"#86ACF9",350:"#6C9EF8",400:"#538FF6",500:"#3575F4",600:"#2962E2",700:"#1F4FCF",800:"#153C9D",900:"#0B296B"},teamsPurple:{50:"#c6c9f2",100:"#acafde",200:"#a2a4d2",300:"#8e90c9",400:"#7678b9",500:"#6264A7",600:"#4e5095",700:"#3a3c83",800:"#262870",900:"#12145e"}},b={colors:{...u,gray:{50:"#F7FAFC",100:"#EDF2F7",200:"#E2E8F0",300:"#CBD5E0",400:"#A0AEC0",500:"#718096",600:"#4A5568",700:"#2D3748",800:"#1A202C",900:"#171923"},white:"#FFFFFF",black:"#000000"}},x=b.colors,g=(e,r)=>{let t;if(!e)return null;let a=void 0!==(t=x[e])&&"object"==typeof t?t:null;return a?.[r]??null},m=b.colors.scPurple[500],f=b.colors.scPurple[600]},45864:(e,r,t)=>{"use strict";t.r(r),t.d(r,{default:()=>B});var a=t(62021),n=t(61227),o=t(69539),l=t(46343),s=t(70297),d=t(66880),i=t(95958),c=t(44654),u=t(74361),b=t(27416),x=t(94889),g=t(60548),m=t(60288),f=t(77159),k=t(22614),p=t(75832),h=t(80746),y=t(29250),F=t(50698),w=t(68804),v=t(85955),j=t(62496);class C extends Error{constructor(e){super("Failed to cancel booking"),this.status=e,this.name="BookingCancelRequestError"}}let N=({bookingId:e,bookingResponseId:r,manageToken:t})=>{let[n,o]=(0,u.useState)(!1),[l,i]=(0,u.useState)(!1),{data:p}=(0,g.I)({queryKey:["pollBookingResponseCancel",e,r],queryFn:async()=>{let a=await fetch((0,j.Kg)({bookingId:e,bookingResponseId:r,action:"status"}),{headers:(0,j.Pb)(t)});return!!a.ok&&(await a.json()).bookingResponse.status===x.BookingResponseStatus.CANCELLED},enabled:n&&!l,refetchInterval:e=>!!n&&!l&&!0!==e&&1e3}),h=(0,m.n)({mutationKey:["cancelBooking",e,r],mutationFn:async()=>{let a=await fetch((0,j.Kg)({bookingId:e,bookingResponseId:r,action:"cancel"}),{method:"POST",headers:{"Content-Type":"application/json",...(0,j.Pb)(t)}});if(!a.ok)throw new C(a.status);return a.json()},onMutate:()=>{(0,c.u4)("cancel-booking",{bookingId:e,bookingResponseId:r})},onSuccess:()=>{o(!0),null===t&&i(!0)},onError:e=>{e instanceof C&&404===e.status?w.oR.error("Failed to cancel booking",{description:j.xT,duration:7e3}):w.oR.error("Error",{description:"Failed to cancel booking"})}}),v=(0,f.e)({bookingId:e,skipExpiryCheck:!0}),N=(0,k.J)({bookingId:e,bookingResponseId:r,manageToken:t}),D=v.data?.booking??null,E=N.data?.bookingResponse??null,B=v.data?.bookingName;return v.data?.code===b.tpq.BOOKING_LINK_ACCESS_LOST?(0,a.jsx)(y._9,{bookingName:B}):v.data?.error?(0,a.jsx)(y.ub,{data:v.data,onRetry:()=>void v.refetch(),isRetrying:v.isFetching}):N.data?.error?(0,a.jsx)(y.Vd,{}):N.isError?(0,a.jsx)(y.ub,{onRetry:()=>void N.refetch(),isRetrying:N.isFetching}):v.isLoading||N.isLoading?(0,a.jsx)(F.t,{}):null===D?(0,a.jsx)(y.ub,{onRetry:()=>void v.refetch(),isRetrying:v.isFetching}):null===E?(0,a.jsx)(y.Vd,{}):(0,a.jsx)("div",{className:"flex items-center justify-center",children:(0,a.jsx)("div",{className:(0,s.cn)("w-[90%] max-w-[600px] rounded-md border p-7 shadow-xl md:w-[60%] md:rounded-lg md:shadow-2xl",d.eS),children:l||p||E.status===x.BookingResponseStatus.CANCELLED?(0,a.jsx)(A,{bookingResponse:E,booking:D,isCancellationConfirmed:!0===p||E.status===x.BookingResponseStatus.CANCELLED}):(0,a.jsx)(R,{bookingResponse:E,booking:D,onCancel:()=>{h.mutate()},isLoading:h.isLoading||n&&!p})})})},A=({booking:e,bookingResponse:r,isCancellationConfirmed:t})=>{let n=(0,b.FHm)(e.bookingId),l=(0,b.yKz)({...r,Booking:e},(e,r)=>{p.Cp(e,{extra:r})});return(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("div",{className:"mb-4 flex flex-col justify-between sm:flex-row md:mb-2",children:(0,a.jsx)("h2",{className:"mb-2 text-xl font-bold md:text-2xl",children:l})}),(0,a.jsxs)(o.Fc,{className:(0,s.cn)(d.Me,"flex h-[200px] flex-col items-center justify-center text-center"),children:[(0,a.jsx)(o._0,{icon:v.A,className:(0,s.cn)("h-[30px] w-[30px]",d.kR)}),(0,a.jsx)(o.XL,{className:"mt-4 mb-1 text-lg",children:t?"Meeting cancelled":"Cancellation request received"}),(0,a.jsx)(o.TN,{className:"mt-1 max-w-md",children:t?(0,a.jsxs)("p",{children:["Want to reschedule?"," ",(0,a.jsx)(h.Ay,{dark:!0,href:n,children:"Book another time"})]}):(0,a.jsx)("p",{children:"Check your calendar to confirm the meeting was removed."})})]})]})},R=({bookingResponse:e,booking:r,onCancel:t,isLoading:n})=>{let o=(0,b.yKz)({...e,Booking:r},(e,r)=>{p.Cp(e,{extra:r})}),s=i.c9.fromJSDate(new Date(e.start)).setZone(e.tz.iana).toFormat("cccc, LLLL d, yyyy"),d=i.c9.fromJSDate(new Date(e.start)).setZone(e.tz.iana).toFormat("t"),c=i.c9.fromJSDate(new Date(e.end)).setZone(e.tz.iana).toFormat("t"),u=(0,b.F_u)(i.c9.fromJSDate(new Date(e.start)).setZone(e.tz.iana),e.tz.iana);return(0,a.jsxs)("div",{className:"3xl:gap-10 flex flex-col gap-7",children:[(0,a.jsx)("div",{className:"flex flex-col justify-between sm:flex-row",children:(0,a.jsx)("h2",{className:"text-xl font-bold md:text-2xl",children:"Are you sure you want to cancel?"})}),(0,a.jsx)("div",{className:"flex justify-center",children:(0,a.jsxs)("div",{className:"rounded-md border border-gray-200 px-7 py-5 dark:border-white/[0.16]",children:[(0,a.jsx)("p",{className:"text-lg font-bold",children:o}),(0,a.jsx)("p",{className:"text-gray-600 dark:text-gray-300",children:s}),(0,a.jsx)("p",{className:"text-gray-600 dark:text-gray-300",children:`${d} - ${c} ${u}`}),(0,a.jsx)("br",{}),(0,a.jsx)("p",{className:"font-semibold",children:"Booked by"}),(0,a.jsx)("p",{className:"text-gray-600 dark:text-gray-300",children:e.name}),(0,a.jsx)("p",{className:"text-gray-600 dark:text-gray-300",children:e.email})]})}),(0,a.jsx)("div",{className:"flex w-full justify-end",children:(0,a.jsx)(l.$,{type:"button",onClick:t,isLoading:n,variant:"destructive",children:"Yes, c
1ancel this meeting"})})]})};var D=t(161),E=t(75532);let B=()=>{let{isReady:e,isTimedOut:r,query:t}=(0,E.U)(),o=t.bookingId,l=t.bookingResponseId,s=(0,j.CQ)();return r?(0,a.jsx)(n.Y,{headerVariant:"simple-transparent",children:(0,a.jsx)("div",{className:"mt-20 w-full",children:(0,a.jsx)(D.a,{})})}):e&&void 0!==s&&"string"==typeof o&&"string"==typeof l?(0,a.jsx)(n.Y,{headerVariant:"simple-transparent",children:(0,a.jsx)("div",{className:"mt-20 w-full",children:(0,a.jsx)(N,{bookingId:o,bookingResponseId:Number.parseInt(l),manageToken:s})})}):(0,a.jsx)(n.Y,{headerVariant:"simple-transparent",children:(0,a.jsx)("div",{className:"mt-20 w-full",children:(0,a.jsx)(F.t,{})})})}},49109:(e,r,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/book/[bookingId]/[bookingResponseId]/cancel",function(){return t(45864)}])},69539:(e,r,t)=>{"use strict";t.d(r,{Fc:()=>b,TN:()=>m,TO:()=>c,XL:()=>g,_0:()=>x,pK:()=>i,sB:()=>u});var a=t(62021),n=t(74361),o=t(7205),l=t(8771),s=t(70297);let d=(0,l.F)("relative w-full rounded-lg border px-4 py-3 text-sm",{variants:{variant:{default:"bg-background text-foreground",brandSubtle:"border-border bg-secondary text-secondary-foreground [&>svg]:text-secondary-foreground",destructive:"border-red-200 bg-red-50 text-red-900 dark:border-red-500/30 dark:bg-red-500/15 dark:text-red-100"}},defaultVariants:{variant:"default"}}),i={error:"border-red-200 bg-red-50 text-foreground dark:border-red-500/30 dark:bg-red-500/15",info:"border-levPlum-200 bg-levPlum-50 text-foreground dark:border-levPlum-500/30 dark:bg-levPlum-500/15",success:"border-green-200 bg-green-50 text-foreground dark:border-green-500/30 dark:bg-green-500/15",warning:"border-yellow-300 bg-yellow-50 text-foreground dark:border-yellow-500/30 dark:bg-yellow-500/15"},c={error:"border-l-4 border-l-red-500 dark:border-l-red-400",info:"border-l-4 border-l-levPlum-500 dark:border-l-levPlum-300",success:"border-l-4 border-l-green-500 dark:border-l-green-400",warning:"border-l-4 border-l-yellow-500 dark:border-l-yellow-400"},u={error:"text-red-600 dark:text-red-400",info:"text-levPlum-400 dark:text-levPlum-300",success:"text-green-600 dark:text-green-400",warning:"text-yellow-700 dark:text-yellow-300"},b=n.forwardRef(({className:e,variant:r,...t},n)=>(0,a.jsx)("div",{ref:n,role:"alert",className:(0,s.cn)(d({variant:r}),e),...t}));b.displayName="Alert";let x=n.forwardRef(({className:e,icon:r=o.A,...t},n)=>(0,a.jsx)(r,{ref:n,"aria-hidden":"true",className:(0,s.cn)("h-4 w-4 shrink-0",e),...t}));x.displayName="AlertIcon";let g=n.forwardRef(({className:e,...r},t)=>(0,a.jsx)("h5",{ref:t,className:(0,s.cn)("mb-1 font-medium leading-none tracking-tight",e),...r}));g.displayName="AlertTitle";let m=n.forwardRef(({className:e,...r},t)=>(0,a.jsx)("div",{ref:t,className:(0,s.cn)("text-sm [&_p]:leading-relaxed",e),...r}));m.displayName="AlertDescription"},80555:(e,r,t)=>{"use strict";t.d(r,{Ke:()=>w,R6:()=>y,bL:()=>C});var a=t(74361),n=t(42842),o=t(33996),l=t(95201),s=t(90805),d=t(8894),i=t(29183),c=t(49195),u=t(70085),b=t(62021),x="Collapsible",[g,m]=(0,o.A)(x),[f,k]=g(x),p=a.forwardRef((e,r)=>{let{__scopeCollapsible:t,open:n,defaultOpen:o,disabled:s,onOpenChange:d,...c}=e,[g,m]=(0,l.i)({prop:n,defaultProp:o??!1,onChange:d,caller:x});return(0,b.jsx)(f,{scope:t,disabled:s,contentId:(0,u.B)(),open:g,onOpenToggle:a.useCallback(()=>m(e=>!e),[m]),children:(0,b.jsx)(i.sG.div,{"data-state":j(g),"data-disabled":s?"":void 0,...c,ref:r})})});p.displayName=x;var h="CollapsibleTrigger",y=a.forwardRef((e,r)=>{let{__scopeCollapsible:t,...a}=e,o=k(h,t);return(0,b.jsx)(i.sG.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":j(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...a,ref:r,onClick:(0,n.m)(e.onClick,o.onOpenToggle)})});y.displayName=h;var F="CollapsibleContent",w=a.forwardRef((e,r)=>{let{forceMount:t,...a}=e,n=k(F,e.__scopeCollapsible);return(0,b.jsx)(c.C,{present:t||n.open,children:({present:e})=>(0,b.jsx)(v,{...a,ref:r,present:e})})});w.displayName=F;var v=a.forwardRef((e,r)=>{let{__scopeCollapsible:t,present:n,children:o,...l}
1=e,c=k(F,t),[u,x]=a.useState(n),g=a.useRef(null),m=(0,d.s)(r,g),f=a.useRef(0),p=f.current,h=a.useRef(0),y=h.current,w=c.open||u,v=a.useRef(w),C=a.useRef(void 0);return a.useEffect(()=>{let e=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,s.N)(()=>{let e=g.current;if(e){C.current=C.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration="0s",e.style.animationName="none";let r=e.getBoundingClientRect();f.current=r.height,h.current=r.width,v.current||(e.style.transitionDuration=C.current.transitionDuration,e.style.animationName=C.current.animationName),x(n)}},[c.open,n]),(0,b.jsx)(i.sG.div,{"data-state":j(c.open),"data-disabled":c.disabled?"":void 0,id:c.contentId,hidden:!w,...l,ref:m,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":y?`${y}px`:void 0,...e.style},children:w&&o})});function j(e){return e?"open":"closed"}var C=p},80746:(e,r,t)=>{"use strict";t.d(r,{Ay:()=>c,FH:()=>d,gX:()=>i});var a=t(62021),n=t(58347),o=t.n(n),l=t(70297),s=t(25844);let d="break-anywhere",i=({children:e,style:r,dark:t,className:n})=>(0,a.jsx)("span",{className:(0,l.cn)("text-levPlum-500 cursor-pointer underline",t&&"text-levPlum-400",n),style:r,children:e}),c=({href:e,children:r,target:t,style:n,dark:d,className:i})=>(0,a.jsx)(o(),{className:(0,l.cn)("manual-copy-friendly",i),style:{textDecoration:"underline",color:d?s.Wv:s.Ox,...n},href:e,target:t,children:r})},85955:(e,r,t)=>{"use strict";t.d(r,{A:()=>a});let a=(0,t(19556).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])}},e=>{e.O(0,[6757,4247,8347,9135,9139,8046,1227,6780,636,6593,8792],()=>e(e.s=49109)),_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.