1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4908],{3241:e=>{e.exports={list:"DWfwlaj",empty:"TGBT9pO",error:"jMNZrhr",card:"ZrJsB0F",cardMain:"__4XAbGJg",date:"__9yPvLWz",name:"Rp3kGBj",meta:"eDgr_3w",metaItem:"bQQXUZ9",cardSide:"TzymNlT",badges:"P3Vvna4",seatBadge:"C3uugFi",categoryBadge:"__6o3fI0j",cancel:"LNefrJc"}},49047:e=>{e.exports={wrapper:"_SvwrFr",title:"jhJL11I",sectionTitle:"ytE7EYd"}},54588:(e,a,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/virginactivelite/bookings",function(){return s(78636)}])},78636:(e,a,s)=>{"use strict";s.r(a),s.d(a,{__N_SSP:()=>k,default:()=>I});var l=s(37876),t=s(14232),i=s(34846),n=s(97373),r=s(3241),o=s.n(r),c=s(32179),d=s(37250);let u=e=>{var a;let{booking:s,clubName:n,cancelling:r,onCancel:u,onClick:m}=e,{t:p}=(0,i.Bd)("mylocker"),b=(0,t.useMemo)(()=>{let e=(0,d.ay)(s.startTime);return e?e.toLocaleDateString("en-GB",{weekday:"long",day:"numeric",month:"short",year:"numeric"}).toUpperCase():""},[s.startTime]),v=(0,d.AK)(s),g=(0,d.Qd)({name:s.className,groupName:s.activityGroupName}),N=d.R6.find(e=>e.key===g&&"ALL"!==e.key),k=N?p(N.labelKey):s.activityGroupName;return(0,l.jsxs)("div",{className:o().card,"data-testid":"mylocker-booking-card",role:"button",tabIndex:0,onClick:m,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),m())},children:[(0,l.jsxs)("div",{className:o().cardMain,children:[(0,l.jsx)("span",{className:o().date,children:b}),(0,l.jsx)("h3",{className:o().name,children:s.className}),(0,l.jsxs)("div",{className:o().meta,children:[(0,l.jsxs)("span",{className:o().metaItem,children:[(0,l.jsx)(c.O4,{size:14}),(0,d.fU)(s.startTime)," â"," ",(0,d.fU)(s.endTime),v?" \xb7 ".concat(p("timetable.minutes",{count:v})):""]}),(s.instructor||s.instructors)&&(0,l.jsxs)("span",{className:o().metaItem,children:[(0,l.jsx)(c.nX,{size:14}),s.instructor||s.instructors]}),(s.room||s.rooms)&&(0,l.jsxs)("span",{className:o().metaItem,children:[(0,l.jsx)(c.Rh,{size:14}),s.room||s.rooms]}),n&&(0,l.jsxs)("span",{className:o().metaItem,children:[(0,l.jsx)(c.ts,{size:14}),n]})]})]}),(0,l.jsxs)("div",{className:o().cardSide,children:[(0,l.jsxs)("div",{className:o().badges,children:[(null==(a=s.seat)?void 0:a.name)&&(0,l.jsx)("span",{className:o().seatBadge,children:p("bookings.seat",{seat:s.seat.name})}
1),k&&(0,l.jsx)("span",{className:o().categoryBadge,children:k})]}),(0,l.jsx)("button",{type:"button",className:o().cancel,onClick:e=>{e.stopPropagation(),Promise.resolve(u()).catch(()=>void 0)},disabled:r,"data-testid":"mylocker-cancel-booking",children:p(r?"bookings.cancelling":"bookings.cancel")})]})]})};var m=s(69912),p=s(17958);let b=(e,a)=>{var s;return{classId:e.classId,clubId:e.clubId,name:e.className,image:(null==a?void 0:a.image)||e.classImageUrl||void 0,groupName:(null==a?void 0:a.groupName)||e.activityGroupName,groupId:null!=(s=null==a?void 0:a.groupId)?s:e.activityGroupId,startTime:e.startTime,endTime:e.endTime,instructor:e.instructor||(null==a?void 0:a.instructor),instructors:e.instructors||(null==a?void 0:a.instructors),room:e.room||(null==a?void 0:a.room),rooms:e.rooms||(null==a?void 0:a.rooms),description:(null==a?void 0:a.description)||e.classDescription,classCapacity:null==a?void 0:a.classCapacity,bookedCount:null==a?void 0:a.bookedCount}},v=e=>{var a;let{initial:s,clubNames:n}=e,{t:r}=(0,i.Bd)("mylocker"),[c,d]=(0,t.useState)(s),[v,g]=(0,t.useState)(null),[N,k]=(0,t.useState)(!1),[I,h]=(0,t.useState)(null),[y,j]=(0,t.useState)(!1),[x,_]=(0,t.useState)(null);(0,t.useEffect)(()=>{if((null==I?void 0:I.clubId)==null||(null==I?void 0:I.classId)==null)return void _(null);let e=!0;return _(null),(async()=>{try{var a;let s=await (0,p.iq)("/mylocker/timetable",{clubId:I.clubId});if(!e)return;let l=(null!=(a=s.classes)?a:[]).find(e=>e.classId===I.classId);_(null!=l?l:null)}catch(a){e&&_(null)}})(),()=>{e=!1}},[I]);let f=async e=>{if(null==e.participationId||null==e.clubId)throw Error("Missing booking identifiers");k(!1),g(e.participationId);try{await (0,p.MB)("/mylocker/cancel",{clubId:e.clubId,participationId:e.participationId}),d(a=>a.filter(a=>a.participationId!==e.participationId))}catch(e){throw k(!0),e}finally{g(null)}},w=e=>{j(!1),h(e)},C=e=>{j(!0),h(e)},T=(null==I?void 0:I.clubId)!=null?n[I.clubId]:void 0;return(0,l.jsxs)(l.Fragment,{children:[0===c.length?(0,l.jsx)("p",{className:o().empty,"data-testid":"mylocker-no-bookings",children:r("bookings.noUpcoming")}):(0,l.jsxs)("div",{className:o().list,"data-testid":"mylocker-bookings-list",children:[N&&(0,l.jsx)("p",{className:o().error,children:r("bookings.cancelError")}),c.map((e,a)=>{var s,t;return(0,l.jsx)(u,{booking:e,clubName:null!=e.clubId?n[e.clubId]:void 0,cancelling:v===e.participationId,onCancel:()=>C(e),onClick:()=>w(e)},"".concat(null!=(t=null!=(s=e.participationId)?s:e.classId)?t:"b","-").concat(a))})]}),I&&(0,l.jsx)(m.A,{cls:b(I,x),clubName:T,bookingsRemaining:null,isBooked:!0,bookedSeatName:null==(a=I.seat)?void 0:a.name,startInCancelConfirm:y,onClose:()=>{h(null),j(!1)},onBooked:()=>void 0,onCancel:()=>f(I),cancelling:v===I.participationId})]})};var g=s(49047),N=s.n(g),k=!0;let I=e=>{let{memberInitials:a,memberName:s,memberEmail:t,upcoming:r,clubNames:o}=e,{t:d}=(0,i.Bd)("mylocker");return(0,l.jsx)(n.A,{variant:"full",memberInitials:a,memberName:s,memberEmail:t,children:(0,l.jsxs)("div",{className:N().wrapper,children:[(0,l.jsxs)("h1",{className:N().title,children:[(0,l.jsx)(c.cF,{size:22}),d("bookings.title")]}),(0,l.jsx)("h2",{className:N().sectionTitle,children:d("bookings.upcoming")}),(0,l.jsx)(v,{initial:r,clubNames:o})]})})}}},e=>{var a=a=>e(e.s=a);e.O(0,[1040,7373,9912,636,6593,8792],()=>a(54588)),_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.