1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8364],{850:function(e,t,n){"use strict";n.d(t,{P:function(){return T}});var a=n(50029),r=n(59499),i=n(87794),s=n.n(i),o=n(67294),c=n(17417),l=n(7258),u=n(29930),d=n(62590),m=n(87505),p=n(87655),v=n(76130),f=n(96461),h=n(85893);function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function x(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var b={instructionId:""},y=function(e){var t=e.values,n=e.setEventBookingData,a=e.setEventBookingProgressData,r=e.personalInstructions,i=e.isValid,s=e.isSubmitting,c=e.isFlexible,l=void 0!==c&&c,u=e.hasSelectedBooking,d=void 0!==u&&u;return(0,o.useEffect)((function(){if(t&&t.instructionId){var e=null===r||void 0===r?void 0:r.flatMap((function(e){return e.slots})).find((function(e){return e.instructionId===t.instructionId}));e&&(n((function(t){return x(x({},t),{},{personalInstructionHour:e.text})})),a((function(e){return x(x({},e),{},{isContinueButtonDisabled:!i||s||l&&!d})})))}}),[t,n,r,i,s,a]),null},T=(0,o.forwardRef)((function(e,t){var n=e.genderExplanation,r=(e.submitText,e.personalInstructions),i=e.initialValues,g=void 0===i?b:i,T=e.handleValues,w=e.error,I=e.isFlexible,D=void 0!==I&&I,S=e.hasSelectedBooking,j=void 0!==S&&S,E=(0,o.useRef)(null),k=(0,f.x)(),C=k.modal,N=k.handleShow,P=(0,m.p)().setEventBookingData,F=(0,p.o)().setEventBookingProgressData;(0,o.useImperativeHandle)(t,(function(){return{submitForm:function(){E.current&&E.current.submitForm()}}}));var R=(0,o.useMemo)((function(){return Object.values(d.GENDER_TYPE).every((function(e){return null===r||void 0===r?void 0:r.find((function(t){var n=t.gender;return e===n}))}))}),[r]);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(v.l,{modal:C,handleShow:N}),(0,h.jsx)(c.J9,{validateOnMount:!0,initialValues:g,innerRef:E,validationSchema:l.object({instructionId:l.string().required("You must select an instruction time to book")}),onSubmit:function(){var e=(0,a.Z)(s().mark((function e(t,n){var a,r;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=n.setSubmitting,r=x({},t),e.next=4,T(r);case 4:a(!1);case 5:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),children:function(e){var t=e.values,a=e.isSubmitting,i=e.isValid;return(0,h.jsxs)(c.l0,{className:"flex w-full flex-col justify-center",children:[(0,h.jsx)(y,{values:t,setEventBookingData:P,setEventBookingProgressData:F,personalInstructions:r,isValid:i,isSubmitting:a,isFlexible:D,hasSelectedBooking:j}),(0,h.jsxs)(h.Fragment,{children:[R?(0,h.jsxs)("div",{className:"pl-1 pb-6 sm:pb-8 text-sm leading-[22.4px]",children:[n," "]}):null,(0,h.jsx)("div",{role:"group","aria-labelledby":"teacher-group",className:"flex w-full flex-col justify-center gap-6 md:gap-8",id:"select-time-form-teacher-group",children:null===r||void 0===r?void 0:r.map((function(e){var n=e.teacherName,a=e.gender,r=e.slots;return(0,h.jsxs)("div",{role:"group","aria-labelledby":"radio-group",className:"flex w-full flex-col justify-center gap-2.5",children:[(0,h.jsxs)("p",{className:"text-base mb-2 pl-1",children:[n,R?" - ":"",R&&(0,h.jsx)("em",{children:a===d.GENDER_TYPE.MALE?"(male teacher)":"(female teacher)"})]}),r.map((function(e){return(0,h.jsx)(u.MS,{name:"instructionId",type:"radio",value:e.instructionId,isChecked:t.instructionId===e.instructionId,children:e.text},e.instructionId)}))]},n)}))}),w?(0,h.jsx)("span",{children:w}):null]})]})}})]})}));T.displayName="SelectTimeForm"},6199:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSG:function(){return ae}});var a=n(50029),r=n(16835),i=n(59499),s=n(87794),o=n.n(s),c=n(67294),l=n(9008),u=n.n(l),d=n(73241),m=n(90720),p=n(71864),v=n(11163),f=n(1517),h=n(1204),g=n(81055),x=n(1785),b=n.n(x),y=n(20288),T=n(79601),w=n(850),I=n(96190),D=n(34730),S=n(77101),j=n(94976),E=n(29390),k=n(11924),C=n(43882),N=n(80678),P=n(37182),F=n(72892),R=n(40507),O=n(1925),L=n(86664),M=n(54465),_=n(5382),B=n(10494),U=n(86631),A=n(99311),Z=n(104
164),V=n(37074),H=n(52372),G=n(87655),q=n(87505),W=n(50259),J=n(4403),z=n(92202),Y=n(31955),$=n(61930),K=n(86010),X=n(94662),Q=n(30396),ee=n(85893);function te(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function ne(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?te(Object(n),!0).forEach((function(t){(0,i.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):te(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ae=!0,re=function(e,t){return e.reduce((function(e,n){var a=n.slots.find((function(e){return e.instructionId===t}));return a?ne(ne({},a),{},{teacherName:n.teacherName,teacherNetsuiteId:n.teacherNetsuiteId}):e}),void 0)},ie=function(e){var t,n,s,l,x,H,te,ae=e.event,ie=e.page,oe=e.mockConfirmationData,ce=e.initialStep,le=void 0===ce?1:ce,ue=(e.navigation,e.centers),de=e.settings,me=(0,c.useState)({}),pe=me[0],ve=me[1],fe=(0,c.useState)(ie),he=fe[0],ge=fe[1],xe=(0,c.useState)(!1),be=xe[0],ye=xe[1],Te=null!==(t=ae.data.enableCoursePayment)&&void 0!==t&&t,we=null!==(n=ae.data.enableStripePayment)&&void 0!==n&&n,Ie=(0,c.useRef)(!1),De=(0,B.Mi)(),Se=(0,r.Z)(De,2)[1],je=(0,v.useRouter)(),Ee="test";Y.Z.get(E.pO)&&(Ee="control");var ke="test"===Ee,Ce=(0,G.o)().setEventBookingProgressData,Ne=(0,q.p)(),Pe=Ne.eventBookingData,Fe=Ne.setEventBookingData,Re=(0,y.SE)(ie,le,Te,!1,(0,V.Tg)(de),ae.data.startDate),Oe=Re.currentIdx,Le=Re.currentProgress,Me=Re.total,_e=Re.next,Be=Re.back,Ue=Re.getProgress,Ae=Re.setIdx,Ze=(0,c.useRef)(null),Ve=(0,c.useRef)(null),He=(0,c.useMemo)((function(){var e=ie.data.pricingDataLink;if(d.BI(e))return e.data}),[ie.data.pricingDataLink]),Ge=(0,W.xX)().executeRecaptcha;(0,c.useEffect)((function(){Se(ae.data)}),[Se,ae.data]),(0,c.useEffect)((function(){var e,t=null!==(e=Ee)&&void 0!==e?e:"Unbucketed";if(b().dataLayer({dataLayer:{event:"priceTest",variant:t}}),!pe.installments){var n={priceTier:"incomeTierFullPrice",installments:"1",income:"",bookingPath:"shopify"};ve((function(e){return ne(ne({},e),n)}))}}),[]),(0,c.useEffect)((function(){if(je.isReady&&"#contact-tm-center"===window.location.hash){var e=ae.data.centerSlugId;if(e){var t=(0,N.gc)({slug:e},!0)+window.location.hash;je.push(t)}}}),[je.isReady,je.asPath,je.push,ae.data.centerSlugId]),(0,c.useEffect)((function(){if(!Pe.price||!Pe.location||Pe.location!==ae.data.address){var e=d.BI(ie.data.pricingDataLink)&&ie.data.pricingDataLink.data,t=ae.data.address,n=ae.data.courseVenue||void 0,a=ue.find((function(e){return e.slug===ae.data.centerSlugId}));a&&a.privateLocation?(t="",n=void 0):a&&a.contact.address&&(t=a.contact.address),Fe((function(a){return ne(ne({},a),{},{location:t,courseVenue:n},!a.priceTier&&{price:ke?"$".concat(E.x.incomeTierFullPrice):e?(0,V.Jr)(e):void 0})}))}if("selectTimeEvent"===Le.viewMode){Fe((function(e){return ne(ne({},e),{},{stepTitle:ie.data.selectEventTimeTitle,stepDescription:ie.data.selectEventTimeDescription,schedule:ae.data.schedule||void 0,eventType:ae.data.locationType||void 0,personalInstructionHour:void 0,flexibleHours:void 0})}));var r=function(){(0,S.t6)({title:"Missing Information",message:(0,ee.jsxs)(ee.Fragment,{children:["Please select an ",(0,ee.jsx)("em",{children:"instruction time"})," to continue."]}),type:S.GT.WARNING,options:{duration:5e3}})};Ce((function(e){return ne(ne({},e),{},{isContinueButtonShowing:!0,continueButtonText:"Continue",onContinueClick:function(){var e;return console.log("onContinueClick!!!"),console.log("userData",pe),console.log("selectedBooking",qt),null===(e=Ve.current)||void 0===e?void 0:e.submitForm()},onDisabledContinueClick:r})}))}if("selectIncomeEvent"===Le.viewMode){var i=ke?"$".concat(E.x.incomeTierFullPrice):void 0;Fe((function(e){return ne(ne({},e),{},{stepTitle:ke?[{type:"paragraph",text:"Choose your payment plan",spans:[{start:12,end:24,type:"em"}]}]:"single"===ae.data.priceTierType?ie.data.selectPricePageTitle:ie.data.selectIncomePageTitle,stepDescription:ke?[{type:"paragraph",text:"Course fees reflect the value of personalized instruction, decades of research, and your investment in lifelong well-being. Assistance may be available for those in need.",spans:[]}]:"single"===ae.data.priceTierType?ie.data.selectPriceDescription:ie.data.selectIncomeDescription},!e.priceTier&&i&&{price:i})}))}}),[Fe,Ce,Le.viewMode,ae.data.address,ke]);var qe=(0,C.dd)(),We=qe.modalClosed,Je=qe.modal,ze=qe.setModal,Ye=(0,O.Wl)(null===ie||void 0===ie?void 0:ie.lang),$e=(0,z.r)({centerSlugIds:void 0,countryCode:Ye,showCookieCenter:!0}).customCenterSlugIds,Ke=function(){var e=(0,a.Z)(o().mark((function e(t){var n,a,r,i,s,c,l,u;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=ne({},t),"en-US",r=ne(ne({},(a=$e)?{centerData:{slug:a,countryCode:Ye},eventData:{}}:void 0),{},{locale:"en-US"}),e.prev=4,e.next=7,(0,I.$D)(ne(ne({countryCode:n["country-code"]||(null===r||void 0===r||null===(i=r.centerData)||void 0===i?void 0:i.countryCode)},n),{},{centerSlugId:null!==r&&void 0!==r&&r.centerData?null===(s=r.centerData)||void 0===s?void 0:s.slug:void 0,formType:null!==r&&void 0!==r&&r.centerData?null!==r&&void 0!==r&&r.eventData?E.tg.COURSE_FORM:E.tg.CENTER:E.tg.FIND_A_TEACHER,custentity83:null!==r&&void 0!==r&&r.eventData?E.Wx.COURSE_SCHEDULE_REQUEST:E.Wx.GENERIC_CONTACT,locale:null===r||void 0===r?void 0:r.locale}),null!==r&&void 0!==r&&r.centerData?(0,E.xb)().CENTER_PAGE_FORM:(0,E.xb)().FIND_A_TEACHER);case 7:u=e.sent,b().dataLayer({dataLayer:{event:"personalInfoSubmit",user:{firstName:n.forename,lastName:n.surname,email:n.email,phoneNumber:n.phone,acceptedPrivacyPolicy:!0,textReminder:!0,formSource:null!==r&&void 0!==r&&r.centerData?"Center Contact Form":"Contact Form",leadId:null!==(c=u.data.netsuiteLeadId)&&void 0!==c?c:"",leadType:u.data.isNewLead?"new":"existing",internalLeadId:null!==(l=u.data.leadId)&&void 0!==l?l:""}}}),ze(We),(0,S.t6)({title:Ct.centerContactFormSuccessTitle?m.S(Ct.centerContactFormSuccessTitle):"Success",message:Ct.ctaModalFormSuccessDescription?m.S(Ct.ctaModalFormSuccessDescription):"Success",type:S.GT.SUCCESS,options:{duration:5e3}}),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(4),ze(We);case 16:case"end":return e.stop()}}
1),e,null,[[4,13]])})));return function(t){return e.apply(this,arguments)}}();(0,c.useEffect)((function(){var e;"viewEvent"===Le.viewMode&&!1===(null===ae||void 0===ae||null===(e=ae.data)||void 0===e?void 0:e.enableCoursePayment)&&ze({modal:{show:!0,type:"form-fullscreen",content:{title:(0,ee.jsx)(ee.Fragment,{}),body:(0,ee.jsx)("div",{className:"flex flex-col items-center justify-center",children:(0,ee.jsxs)("div",{className:"w-full max-w-[480px]",children:[(0,ee.jsxs)("div",{className:"text-center",children:[(0,ee.jsx)("div",{className:"text-5xl",children:Ct.centerContactFormTitle&&(0,ee.jsx)(T.v,{field:Ct.centerContactFormTitle})}),(0,ee.jsx)("div",{className:"mt-4 text-sm",children:Ct.centerContactFormDescription&&(0,ee.jsx)(T.v,{field:Ct.centerContactFormDescription})})]}),(0,ee.jsx)(J.XJ,{formType:"center",handleValues:Ke,error:lt,contactFormData:Ct})]})})}}})}),[Le.viewMode,null===ae||void 0===ae||null===(s=ae.data)||void 0===s?void 0:s.enableCoursePayment,ze]);var Xe=function(e,t){var n=null===e||void 0===e?void 0:e[E.my],a=null===e||void 0===e?void 0:e[E.pw],r=new Date(a),i=null===e||void 0===e?void 0:e[E.W6],s=null===e||void 0===e?void 0:e[E.Ug];return{netsuiteLeadId:n,cardChargeDate:isNaN(r.getTime())?a:(0,f.p6)(r.toString(),t,{year:"numeric",weekday:void 0}),salesOrderNumber:i,instructionId:s}}(null!==oe&&void 0!==oe?oe:je.query,de.lang),Qe=Xe.netsuiteLeadId,et=Xe.instructionId,tt=Xe.salesOrderNumber,nt=Xe.cardChargeDate,at=(0,c.useState)(),rt=at[0],it=at[1];(0,c.useEffect)((function(){je.isReady&&(!1===Te||(0,V.Tg)(de)&&!(0,V.HJ)(ae.data.startDate))&&void 0!=(null===pe||void 0===pe?void 0:pe.forename)&&void 0!=(null===pe||void 0===pe?void 0:pe.surname)&&void 0!=(null===pe||void 0===pe?void 0:pe.email)&&(it({salesOrderNumber:"",netsuiteLeadId:"",cardChargeDate:"",teacherName:"",time:"",instructionTime:"",startDate:ae.data.startDate,endDate:ae.data.endDate,fullName:pe.forename+" "+pe.surname,email:pe.email}),Ae(Me),(0,S.t6)({title:ie.data.successNotificationTitle,message:ie.data.successNotificationRequested,type:S.GT.SUCCESS,options:{duration:5e3}}))}),[je.isReady,Te,pe.forename,pe.surname,pe.email,Ae,Me,ae.data.startDate,ae.data.endDate,ie.data.successNotificationRequested,ie.data.successNotificationTitle]),(0,c.useEffect)((function(){je.isReady&&we&&tt&&"succeeded"!==je.query.redirect_status&&(g.n_({level:"info",category:"stripePayment",message:"payment failed",data:{url:window.location.href}}),je.push("/events/course-tm/payment-error?"+new URLSearchParams((0,i.Z)({},E.TN,"GENERIC")).toString()))}),[je.isReady,je.push,je.query.redirect_status,we,tt]),(0,c.useEffect)((function(){var e=re(ae.data.personalInstruction,et);tt&&null!==e&&void 0!==e&&e.instructionId&&(it({salesOrderNumber:tt,netsuiteLeadId:Qe,cardChargeDate:nt,teacherName:e.teacherName,time:e.text,instructionTime:null!==e&&void 0!==e&&e.text?" \u2014 "+(null===e||void 0===e?void 0:e.text.replace("\u2014"," to ")):"",startDate:(0,j.wh)(e.start)?ae.data.startDate.split("T")[0]+"T"+(0,j.wh)(e.start)+"Z":void 0,endDate:(0,j.wh)(e.end)?ae.data.endDate.split("T")[0]+"T"+(0,j.wh)(e.end)+"Z":void 0}),b().dataLayer({dataLayer:{event:"courseBookingSuccess",courseType:ae.data.locationType,courseDate:ae.data.startDate.split("T")[0],leadId:Qe}}),Ae(Me),we&&"succeeded"!==je.query.redirect_status||(0,S.t6)({title:ie.data.successNotificationTitle,message:ie.data.successNotificationRequested,type:S.GT.SUCCESS,options:{duration:5e3}}))}),[Qe,nt,tt,et,ae.data.endDate,ae.data.startDate,ae.data.personalInstruction,ae.data.locationType,ie.data.successNotificationBooked,ie.data.successNotificationTitle,ie.data.successNotificationRequested,Ae,Me,we,null===(l=je.query)||void 0===l?void 0:l.redirect_status,je.isReady]);var st=(0,c.useMemo)((function(){return ae.data.personalInstruction.reduce((function(e,t){var n=t.slots.filter((function(e){return!e.taken}));return n.length>0&&e.push(ne(ne({},t),{},{slots:n})),e}),[])}),[ae.data.personalInstruction]),ot=(null===(x=ae.data)||void 0===x?void 0:x.name)||"",ct=(0,c.useState)(""),lt=ct[0],ut=ct[1];(0,c.useEffect)((function(){var e,t={"#instructionDate#":ae.data.schedule.instructionDate+(null!==(e=null===rt||void 0===rt?void 0:rt.instructionTime)&&void 0!==e?e:""),"#sessionTwoDateTime#":ae.data.schedule.sessionTwoDateTime,"#sessionThreeDateTime#":ae.data.schedule.sessionThreeDateTime,"#sessionFourDateTime#":ae.data.schedule.sessionFourDateTime,"#chooseTimeText#":"successEvent"!==Le.viewM
1ode?m.S(ie.data.chooseTimeText):"","#teacherForename#":null!==rt&&void 0!==rt&&rt.teacherName?rt.teacherName:""},n=D.AP.bind(null,t);ge((function(e){return ne(ne({},e),{},{data:ne(ne({},e.data),{},{scheduleDescriptionInPerson:n(ie.data.scheduleDescriptionInPerson),scheduleDescriptionHybrid:n(ie.data.scheduleDescriptionHybrid),tenSessionScheduleDescriptionInPerson:n(ie.data.tenSessionScheduleDescriptionInPerson),tenSessionScheduleDescriptionHybrid:n(ie.data.tenSessionScheduleDescriptionHybrid),selectEventTimeSlotsIntro:n(ie.data.selectEventTimeSlotsIntro),successEventName:n(ie.data.successEventName)})})}))}),[null===rt||void 0===rt?void 0:rt.teacherName,Le.viewMode,ae.data.schedule,null===rt||void 0===rt?void 0:rt.instructionTime,ie.data.scheduleDescriptionHybrid,ie.data.scheduleDescriptionInPerson,ie.data.tenSessionScheduleDescriptionHybrid,ie.data.tenSessionScheduleDescriptionInPerson,ie.data.selectEventTimeSlotsIntro,ie.data.chooseTimeText,ie.data.successEventName]);var dt=(0,c.useCallback)((function(){var e;"successEvent"===Le.viewMode?null!==(e=ae.data)&&void 0!==e&&e.centerSlugId&&je.push((0,N.gc)({slug:ae.data.centerSlugId},!0)):"listEvent"===Ue(Oe-1).viewMode?je.back():Be()}),[Le.viewMode,ae.data.centerSlugId,je.push,je.back,Ue,Oe,Be]);(0,c.useEffect)((function(){var e,t,n=(0,ee.jsx)(T.v,{field:ae.data.centerName?(0,D.AP)({"#centerName#":ae.data.centerName},null===(e=he.data)||void 0===e?void 0:e.progressMainTitle):null===(t=he.data)||void 0===t?void 0:t.progressMainTitleFallback});Ce((function(e){return ne(ne({},e),{},{pageTitle:n,sectionTitle:Le.sectionTitle,progress:Oe+1,total:Me,backButton:dt,isProgressShowing:je.isReady&&"successEvent"!==Le.viewMode,showSummaryRecaptchaDisclosure:"selectIncomeEvent"===Le.viewMode})}))}),[Oe,Le,Me,dt,Ce,ae.data.centerName,he.data,je.isReady]);var mt=function(){var e=(0,a.Z)(o().mark((function e(t){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ze({modal:{show:!0,type:"loading",content:"Loading"}}),e.prev=1,n=re(ae.data.personalInstruction,t.instructionId)){e.next=5;break}return e.abrupt("return");case 5:if(pe.netsuiteLeadId||pe.leadId||pe.gmgLeadId||V.Tg){e.next=9;break}return ut("Please fill out personal details"),Be(),e.abrupt("return");case 9:b().dataLayer({dataLayer:{event:"courseBookingPickTime",session:{sessionDate:(0,j.wh)(n.start)?ae.data.startDate.split("T")[0]+" "+(0,j.wh)(n.start):ae.data.startDate+" Time unknown"},bookingFlowStep:Oe+1,bookingFlowVersion:E.fi.v1}}),ve((function(e){return ne(ne({},e),n)})),ze(We),_e(),e.next=19;break;case 15:e.prev=15,e.t0=e.catch(1),g.Tb(e.t0),ze(We);case 19:case"end":return e.stop()}}),e,null,[[1,15]])})));return function(t){return e.apply(this,arguments)}}(),pt=function(){var e=(0,a.Z)(o().mark((function e(t){var n,a,r,i,s,c,l,u,d,m,p,v;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.prev=0,e.next=3;break;case 3:if(!Ge){e.next=9;break}return e.next=6,Ge("lead_submission");case 6:e.t0=e.sent,e.next=10;break;case 9:e.t0="";case 10:return r=e.t0,console.log("EXECUTED RECAPTCHA"),i={recaptchaToken:r,recaptchaKey:"6Le4trsrAAAAAOITDvc5C5orCoVd4AoCYnnmKVT9"},s=t.phone.replace(/\D/g,""),c=10===s.length?"+1".concat(s):s.length>0?"+".concat(s):t.phone,l={email:t.email,forename:t.forename,surname:t.surname,phone:c},e.next=18,(0,I.$D)(ne(ne({},l),{},{eventId:ae.data.eventId,netsuiteCenterId:ae.data.netsuiteCenterId,centerSlugId:ae.data.centerSlugId,centerId:ae.data.centerId,formType:E.tg.COURSE_FORM,countryCode:ae.data.countryCode,locale:de.lang},i),(0,E.xb)().COURSE_FORM);case 18:return u=e.sent,console.log("createLead Result:",u),d=ne(ne({},l),u.data),ve((function(e){return ne(ne({},e),d)})),b().dataLayer({dataLayer:{event:"emailLeadSubmit",user:{email:t.email,leadId:null!==(n=u.data.netsuiteLeadId)&&void 0!==n?n:"",leadType:u.data.isNewLead?"new":"existing",formSource:"Course Booking Email Lead",internalLeadId:null!==(a=u.data.leadId)&&void 0!==a?a:""},bookingFlowStep:Oe+1,bookingFlowVersion:"email-lead"}}),e.abrupt("return",d);case 26:e.prev=26,e.t1=e.catch(0),m=e.t1,p=JSON.parse(m.message),v=p[0],ut(v.instancePath+" "+v.message),ze(We);case 33:case"end":return e.stop()}}),e,null,[[0,26]])})));return function(t){return e.apply(this,arguments)}}(),vt=(0,c.useCallback)((function(e){ve((function(t){return ne(ne({},t),e)})),Fe((function(t){return ne(ne({},t),{},{priceTier:e.priceTier,usePaymentInstallments:"2"===e.installments})}))}),[ve,Fe]),ft=(0,c.useState)(null),ht=ft[0],gt=ft[1],xt=(0,c.useState)(),bt=xt[0],yt=xt[1],Tt=(0,c.useState)(),wt=Tt[0],It=Tt[1],Dt=(0,c.useState)(),St=Dt[0],jt=Dt[1],Et=(0,c.useCallback)((function(e){if(!St)throw new Error("Stripe product could not be loaded to match tiers.");var t=St.find((function(t){return t.lookup_key===e.priceTier}));if(!t)throw new Error("No stripe pricing found for ".concat(e.priceTier));return t}
1),[St]),kt=(0,c.useCallback)(function(){var e=(0,a.Z)(o().mark((function e(t,n,a){var r,s,c,l,u,m,p,v,f,x,y,T,w,I,D=arguments;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=D.length>3&&void 0!==D[3]?D[3]:pe,s=r,e.prev=2,null!==ae&&void 0!==ae&&null!==(c=ae.data)&&void 0!==c&&c.netsuiteCenterId||ae.data.centerId){e.next=7;break}return console.log("No center Id found"),ut("No center Id found"),e.abrupt("return");case 7:if(s.instructionId){e.next=12;break}return console.log("Please select an instruction time"),ut("Please select an instruction time"),Be(),e.abrupt("return");case 12:if(!s.priceTier||"scholarship"!==s.priceTier){e.next=16;break}return console.log("Please contact a teacher at your center to book a course"),ut("Please contact a teacher at your center to book a course"),e.abrupt("return");case 16:if(s.netsuiteLeadId||s.leadId){e.next=22;break}return console.log("Booking not created, please try again"),ut("Booking not created, please try again"),Be(),Be(),e.abrupt("return");case 22:if(!n){e.next=48;break}return u="","Remote"===Pe.eventType&&(u="3"),e.next=27,(0,U.a)({forename:s.forename,surname:s.surname,countryCode:ae.data.countryCode,email:s.email,eventId:ae.data.eventId,eventType:h.Ze.COURSE,netsuiteCenterId:ae.data.netsuiteCenterId,centerId:ae.data.centerId,centerSlugId:ae.data.centerSlugId,leadId:s.leadId,netsuiteLeadId:s.netsuiteLeadId,instructionDate:ae.data.startDate,teacherId:s.teacherId,netsuiteTeacherId:s.teacherNetsuiteId,priceTier:null!==(l=s.priceTier)&&void 0!==l?l:"incomeTierFullPrice",installments:s.installments,instructionId:s.instructionId,hasInstallments:!!a,success_redirect:"".concat(window.location.href,"?instructionid=").concat(s.instructionId),meeting_type:u});case 27:if(m=e.sent,(p=new URL(window.location.href)).searchParams.append(E.Ug,s.instructionId),v=new URL("/events/course-tm/payment-error",window.location.origin),console.log("result.data:",m.data),!m.data.paymentRedirect){e.next=47;break}return(f=new URL(m.data.paymentRedirect)).searchParams.append(E.nG,p.toString()),f.searchParams.append(E.WV,v.toString()),f.searchParams.append(E.PI,window.location.href),console.log("phone for query param:",s.phone),console.log("redirect:",f),console.log("redirect.href:",f.href),e.t0=je,e.next=43,(0,Z.Lu)(f,{hasInstallments:a,installments:s.installments,priceTier:s.priceTier});case 43:e.t1=e.sent,e.t0.push.call(e.t0,e.t1),e.next=48;break;case 47:throw new A.Ez(null===(x=m.data)||void 0===x?void 0:x.message);case 48:console.log("Creating standard booking with user data:",s),b().dataLayer({dataLayer:{event:"courseBookingCourseFee",course:{incomeLevel:s.income,courseFee:E.x[s.priceTier],installments:"1"===s.installments?1:4},bookingFlowStep:Oe+1,bookingFlowVersion:E.fi.v1}}),e.next=60;break;case 52:e.prev=52,e.t2=e.catch(2),y=e.t2,g.Tb(y),y instanceof P.VL?(w=[409,400],I=ie.data.errorMessages.find((function(e){var t=e.statusCode;return void 0!==(null===y||void 0===y?void 0:y.statusCode)&&t==="".concat(w.includes(y.statusCode)?y.statusCode:"Other")})),console.log("errorText:",I),(0,S.t6)({title:I&&d.Nn(I.title)?I.title:"Apologies, something went wrong",message:I&&d.Nn(I.message)?I.message:null!==(T=null===y||void 0===y?void 0:y.error)&&void 0!==T?T:"Please try again later",type:S.GT.ERROR})):(console.log("error",y),(0,S.t6)({title:"Apologies, something went wrong",message:y instanceof A.Ez?y.userMessage:A._x,type:S.GT.ERROR})),y instanceof P.VL&&409===y.statusCode&&(Be(),Be()),y instanceof P.VL&&y.message.match(/Unpaid sales entry IDs: \[.*\] -> terminated./g)&&je.push("/events/course-tm/payment-error?"+new URLSearchParams((0,i.Z)({},E.TN,"PENDING_SALES_ORDER")).toString()),ze(We);case 60:case"end":return e.stop()}}),e,null,[[2,52]])})));return function(t,n,a){return e.apply(this,arguments)}}(),[pe,ae.data,null===de||void 0===de?void 0:de.data,Be,je,we,Et,ie.data.errorMessages,ze,yt,It]);(0,c.useEffect)((function(){if("selectIncomeEvent"===Le.viewMode){var e=function(){var t=(0,a.Z)(o().mark((function t(){var n,a,r,i,s,c,l,u,d,m,p,v,f,h;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(console.log("handleContinue",e),n=Te||(0,V.Tg)(de)&&(0,V.HJ)(ae.data.startDate),t.prev=2,r=pe,ke&&!r.priceTier&&He&&(s=null===(i=He.pricingDataItem)||void 0===i?void 0:i.find((function(e){return"incomeTierFullPrice"
1===e.priceTier})))&&(r=ne(ne({},r),{},{priceTier:"incomeTierFullPrice",bookingPath:s.bookingPath,installments:r.installments||"1"})),c=Boolean(pe.leadId||pe.netsuiteLeadId),ze({modal:{show:!0,type:"loading",content:"Loading"}}),Ce((function(e){return ne(ne({},e),{},{isContinueButtonLoading:!0})})),c){t.next=26;break}if(u=null===(l=Ze.current)||void 0===l?void 0:l.getValues(),!(m=u)){t.next=15;break}return t.next=14,pt(m);case 14:d=t.sent;case 15:if(!d){t.next=19;break}r=ne(ne({},pe),d),t.next=22;break;case 19:return Ce((function(e){return ne(ne({},e),{},{isContinueButtonLoading:!1})})),ze(We),t.abrupt("return");case 22:if(r.leadId||r.netsuiteLeadId){t.next=26;break}return Ce((function(e){return ne(ne({},e),{},{isContinueButtonLoading:!1})})),ze(We),t.abrupt("return");case 26:if(p=null!==(a=r.bookingPath)&&void 0!==a?a:"shopify",console.log("BOOKINGPATH:",p),console.log("shouldHandlePayment",n),console.log("settings.data",de.data),console.log("latestUserData",r),!p){t.next=45;break}if("shopify"!==p){t.next=40;break}if(!n){t.next=39;break}return t.next=36,kt(null===de||void 0===de||null===(v=de.data)||void 0===v?void 0:v.shopifyToggle,null===de||void 0===de||null===(f=de.data)||void 0===f?void 0:f.useCombinedFlow,null===de||void 0===de||null===(h=de.data)||void 0===h?void 0:h.hasInstallments,r);case 36:return t.abrupt("return");case 39:_e();case 40:if("contactForm"!==p){t.next=43;break}return je.push("/contact-us").then((function(){ze(We)})),t.abrupt("return");case 43:t.next=48;break;case 45:console.log("error",lt),(0,S.t6)({title:"Apologies, something went wrong",message:"Please try again later",type:S.GT.ERROR}),ze(We);case 48:t.next=54;break;case 50:t.prev=50,t.t0=t.catch(2),console.error("Failed to submit email lead before booking",t.t0),ze(We);case 54:return t.prev=54,Ce((function(e){return ne(ne({},e),{},{isContinueButtonLoading:!1})})),ze(We),t.finish(54);case 58:case"end":return t.stop()}}),t,null,[[2,50,54,58]])})));return function(){return t.apply(this,arguments)}}(),t=function(){var e=[];pe.priceTier||e.push((0,ee.jsxs)(ee.Fragment,{children:["select an ",(0,ee.jsx)("em",{children:"income tier"})]})),be||e.push((0,ee.jsxs)(ee.Fragment,{children:["enter a valid ",(0,ee.jsx)("em",{children:"first name"}),", ",(0,ee.jsx)("em",{children:"last name"}),", and"," ",(0,ee.jsx)("em",{children:"email address"})]}));var t=(0,ee.jsxs)(ee.Fragment,{children:["Please"," ",e.map((function(t,n){return(0,ee.jsxs)("span",{children:[t,n<e.length-1&&" and "]},n)}))," to continue."]});(0,S.t6)({title:"Missing Information",message:t,type:S.GT.WARNING,options:{duration:5e3}})};Ce((function(n){return ne(ne({},n),{},{isContinueButtonShowing:!0,continueButtonText:"contactForm"===pe.bookingPath?"Apply Now":"Book Now",isContinueButtonDisabled:!ke&&!pe.priceTier||!be,onContinueClick:e,onDisabledContinueClick:t})}))}}),[Le.viewMode,Ce,pe,Te,de,ae.data.startDate,kt,_e,je,ze,be,ie.data.selectPriceBtnText,ie.data.selectIncomeBtnText,ke,He]);var Ct=(0,c.useMemo)((function(){return d.BI(ie.data.contactForm)?ie.data.contactForm.data:{}}),[ie.data.contactForm]),Nt=(0,c.useCallback)((function(e){vt({income:e.income,installments:"1",priceTier:e.priceTier,bookingPath:e.bookingPath});var t=E.x[e.priceTier];if(t){var n="$".concat(t);Fe((function(e){return ne(ne({},e),{},{price:n})}));try{localStorage.setItem("tm_selected_tier_price",JSON.stringify({price:n,priceTier:e.priceTier,timestamp:Date.now()}))}catch(a){}}}),[vt,Fe]),Pt=(0,c.useCallback)((function(e){if(ve((function(t){return ne(ne({},t),{},{installments:e})})),ke){var t=pe.priceTier?E.x[pe.priceTier]:E.x.incomeTierFullPrice,n="2"===e?"$".concat(Math.round(t/4)," x 4 months"):"$".concat(t);Fe((function(t){return ne(ne({},t),{},{price:n,usePaymentInstallments:"2"===e})}))}}),[ve,ke,pe.priceTier,Fe]),Ft=(0,c.useRef)(null),Rt=(0,$.Z)().screenWidth,Ot=(0,c.useCallback)((function(){Ft.current&&Rt<1028&&Ft.current.scrollIntoView({behavior:"smooth"})}),[Rt]),Lt=(0,C.Hw)({pricingData:He,contactFormData:Ct,setModal:ze,onTierSelected:Nt,onFlowComplete:Ot}),Mt=Lt.handleOpenAssistanceModal,_t=Lt.selectedPriceTierData;(0,c.useEffect)((function(){Fe((function(e){return ne(ne({},e),{},{onSeeIfYouQualify:Mt})}))}),[Mt,Fe]),(0,c.useEffect)((function(){var e,t=null===(e=je.query.event)||void 0===e?void 0:e[1];if(ae.data.slugId&&t!==ae.data.slugId){var n=new URL((0,f.L5)(ae.data),window.location.origin);n.search=window.location.search,je.push(n.toString())}}),[je.push,je.query.event,ae.data]),(0,c.useEffect)((function(){if(we&&"selectTimeEvent"===Le.viewM
1ode&&!1===Ie.current){Ie.current=!0;var e=function(){var e=(0,a.Z)(o().mark((function e(){var t,n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,_.RD)();case 2:t=e.sent,n=t.data.publishableKey,gt((0,M.J)(n));case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),t=function(){var e=(0,a.Z)(o().mark((function e(){var t;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,_.pP)();case 2:t=e.sent,jt(null===t||void 0===t?void 0:t.prices);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();ht||e().catch((function(e){g.n_({level:"error",category:"stripePayment",message:"Failed to load stripe configuration",data:{error:e}}),g.Tb(new Error("Failed to load stripe configuration"))})),St||t().catch((function(e){g.n_({level:"error",category:"stripePayment",message:"Failed to load stripe products",data:{error:e}}),g.Tb(new Error("Failed to load stripe products"))}))}}),[we,Le.viewMode,St,ht]),(0,c.useEffect)((function(){wt&&bt&&ze({modal:{show:!0,type:"form",elementId:"stripe-modal",content:{title:(0,ee.jsx)(ee.Fragment,{}),body:(0,ee.jsx)(ee.Fragment,{children:(0,ee.jsx)("div",{className:"flex flex-col items-center justify-center",children:(0,ee.jsxs)("div",{className:"w-full max-w-[480px]",children:[(0,ee.jsx)("div",{className:"text-center",children:(0,ee.jsx)("div",{className:"mb-10"})}),bt&&ht&&(0,ee.jsx)(ee.Fragment,{children:(0,ee.jsx)(L.Elements,{stripe:ht,options:{clientSecret:bt,appearance:E._q},children:(0,ee.jsx)(se,{userData:pe,paymentIntent:null===wt||void 0===wt?void 0:wt.paymentIntent})})})]})})})}}})}),[wt,bt]);var Bt=(0,O.pz)(ot,m.S(null===de||void 0===de||null===(H=de.data)||void 0===H?void 0:H.siteTitle)),Ut="flexible"===ae.data.locationType,At=ae.data.flexibleTimes.filter((function(e){return"1"===e.type})),Zt="";Zt=ae.data.schedule.sessionTwoDateTime.includes("\u2014")?(Zt=ae.data.schedule.sessionTwoDateTime.split("\u2014")[0]).split(", ")[1]:ae.data.schedule.sessionTwoDateTime.split(", ")[0];var Vt=ae.data.flexibleTimes.filter((function(e){return"3"===e.type})),Ht="";Ht=ae.data.schedule.sessionFourDateTime.includes("\u2014")?(Ht=ae.data.schedule.sessionFourDateTime.split("\u2014")[0]).split(", ")[1]:ae.data.schedule.sessionFourDateTime.split(", ")[0];var Gt=(0,c.useState)(""),qt=Gt[0],Wt=Gt[1],Jt=(0,c.useCallback)((function(e){if("inperson"===e){Wt("inperson");var t=Pe.schedule||{instructionDate:"",sessionTwoDateTime:"",sessionThreeDateTime:"",sessionFourDateTime:""};t.sessionTwoDateTime=At[0].date,t.sessionThreeDateTime=At[1].date,t.sessionFourDateTime=At[2].date,Fe((function(e){return ne(ne({},e),{},{eventType:"In-Person",schedule:t})})),Ce((function(e){return ne(ne({},e),{},{isContinueButtonDisabled:!Pe.personalInstructionHour})}))}if("inapp"===e){Wt("inapp");var n=Pe.schedule||{instructionDate:"",sessionTwoDateTime:"",sessionThreeDateTime:"",sessionFourDateTime:""};n.sessionTwoDateTime=Vt[0].date,n.sessionThreeDateTime=Vt[1].date,n.sessionFourDateTime=Vt[2].date,Fe((function(e){return ne(ne({},e),{},{eventType:"Remote",schedule:n})})),Ce((function(e){return ne(ne({},e),{},{isContinueButtonDisabled:!Pe.personalInstructionHour})}))}}),[qt,Pe]);return(0,ee.jsxs)(ee.Fragment,{children:[(0,ee.jsx)(u(),{children:(0,ee.jsx)("title",{children:Bt})}),(0,ee.jsx)(k.F,{modal:Je,setModal:ze}),"viewEvent"===Le.viewMode&&!1!==(null===ae||void 0===ae||null===(te=ae.data)||void 0===te?void 0:te.enableCoursePayment)&&(0,ee.jsx)("section",{className:"m-auto max-w-[390px] px-6 py-5 sm:max-w-[480px] sm:px-0 sm:py-12",children:(0,ee.jsx)(F.c0,{type:h.Ze.COURSE,page:he,event:ae,lang:de.lang,next:_e,setError:ut})}),"selectTimeEvent"===Le.viewMode&&(0,ee.jsx)("section",{children:"selectTimeEvent"===Le.viewMode?(0,ee.jsxs)(ee.Fragment,{children:[he.data.selectEventTimeSlotsIntro&&(0,ee.jsxs)(ee.Fragment,{children:[(0,ee.jsxs)("h2",{className:"text-lg pl-1 lg:mt-3",children:[(0,ee.jsx)("em",{children:"Session 1:"})," In-person, ",ae.data.schedule.instructionDate.split(",")[1].trim()," - Choose your one-on-one TM instruction time"]}),(0,ee.jsx)("div",{className:"text-tm-text-4-accessible mt-2 mb-6 md:mb-8 ",children:"Your course can be rescheduled at any time and is fully refund
1able until instruction begins."})]}),(0,ee.jsx)("div",{className:"max-w-[390px] sm:max-w-[480px]",children:(0,ee.jsx)(w.P,{ref:Ve,genderExplanation:(0,ee.jsx)(T.v,{field:ie.data.genderExplanation}),submitText:m.S(ie.data.timeBtnText),personalInstructions:st,handleValues:mt,initialValues:null!==pe&&void 0!==pe&&pe.instructionId?{instructionId:pe.instructionId}:void 0,isFlexible:Ut,hasSelectedBooking:""!==qt})}),(At.length>0||Vt.length>0)&&(0,ee.jsxs)("div",{className:"max-w-3xl border-t border-t-tm-midnight-soft border-dotted pt-6 md:pt-8 mt-6 md:mt-10",children:[(0,ee.jsxs)("h2",{className:"text-lg pl-1",children:[(0,ee.jsx)("em",{children:"Sessions 2-4:"})," ",Zt.trim()," - ",Ht.trim()," - Select in-person or remote for your three follow-up sessions"]}),(0,ee.jsx)("div",{className:"mt-2 mb-8 text-tm-text-4-accessible",children:"Select your session type and times."}),(0,ee.jsxs)("div",{className:"sm:flex gap-x-4",children:[At.length>0&&(0,ee.jsxs)("div",{className:(0,K.Z)("sm:w-1/2 rounded-2xl pt-6 px-8 pb-8 mb-8 sm:mb-0 xl:mb-8 2xl:mb-0 cursor-pointer hover:bg-tm-warm-yellow ease-out duration-300","inperson"===qt?"bg-tm-warm-yellow":"bg-tm-warm-neutral"),tabIndex:0,role:"button",onClick:function(){Jt("inperson")},onKeyDown:function(){Jt("inperson")},children:[(0,ee.jsxs)("h3",{className:"mb-3 text-[22px] relative",children:["In-Person sessions","inperson"===qt&&(0,ee.jsx)(X.M,{stroke:"rgb(var(--on-surface)",className:"absolute -right-3 sm:right-1 top-1/2 h-[15px] w-[21px] -translate-y-1/2 bg-transparent"})]}),(0,ee.jsx)("div",{className:"text-sm mb-4",children:(0,ee.jsx)("em",{children:"Your meetings will be in-person in a small group"})}),(0,ee.jsx)("div",{children:At.map((function(e){return(0,ee.jsxs)(ee.Fragment,{children:[(0,ee.jsx)("span",{className:"text-sm",children:e.date}),(0,ee.jsx)("br",{})]})}))}),(0,ee.jsx)("div",{className:"mt-8",children:(0,ee.jsx)(p.JG,{src:"/images/course-tm-in-person.jpg",alt:"In-Person",className:"rounded-[16px]",unoptimized:!0,width:"100%",height:"60%",objectFit:"cover",layout:"responsive",objectPosition:"center 20%"})})]}),Vt.length>0&&(0,ee.jsxs)("div",{className:(0,K.Z)("sm:w-1/2 bg-tm-warm-neutral rounded-2xl pt-6 px-8 pb-8 cursor-pointer hover:bg-tm-warm-yellow ease-out duration-300","inapp"===qt?"bg-tm-warm-yellow":"bg-tm-warm-neutral"),tabIndex:0,role:"button",onClick:function(){Jt("inapp")},onKeyDown:function(){Jt("inapp")},children:[(0,ee.jsxs)("h3",{className:"mb-3 text-[22px] relative",children:["Remote sessions","inapp"===qt&&(0,ee.jsx)(X.M,{stroke:"rgb(var(--on-surface)",className:"absolute -right-3 sm:right-1 top-1/2 h-[15px] w-[21px] -translate-y-1/2 bg-transparent"})]}),(0,ee.jsx)("div",{className:"text-sm mb-4",children:(0,ee.jsx)("em",{children:"Watch course content in the TM app and meet with a teacher on a video call"})}),(0,ee.jsx)("div",{children:Vt.map((function(e){return(0,ee.jsxs)(ee.Fragment,{children:[(0,ee.jsx)("span",{className:"text-sm",children:e.date}),(0,ee.jsx)("br",{})]})}))}),(0,ee.jsx)("div",{className:"mt-8",children:(0,ee.jsx)(p.JG,{src:"/images/course-tm-online.jpg",alt:"Hybrid",className:"rounded-[16px]",unoptimized:!0,width:"100%",height:"60%",objectFit:"cover",layout:"responsive",objectPosition:"center 20%"})})]})]})]}),he.data.selectEventTimeSlotsOutro&&(0,ee.jsx)("h2",{className:"text-lg mt-6 md:mt-8 pl-1 text-tm-text-4-accessible",children:(0,ee.jsx)(T.v,{field:he.data.selectEventTimeSlotsOutro})})]}):""}),"selectIncomeEvent"===Le.viewMode&&(0,ee.jsx)("section",{children:He&&(0,ee.jsx)(Q.x,{page:ie,priceCardRef:Ft,isTestVariant:ke,selectedPriceTierData:_t,handleOpenAssistanceModal:Mt,handleInstallmentChange:Pt,pricingData:He,event:ae,settings:de,stripePaymentEnabled:we,handleSelectedPaymentData:vt,learnerInfoFormRef:Ze,handleLearnerInfoLead:pt,contactFormData:Ct,error:lt,setIsLearnerInfoValid:ye})}),"paymentEvent"===Le.viewMode&&(0,ee.jsx)(R.E,{courseFee:pe.priceTier&&"scholarship"!=pe.priceTier?E.x[pe.priceTier]:0,installments:"1"===pe.installments?1:4,type:h.Ze.COURSE,lang:de.lang,next:_e,setError:ut}),"successEvent"===Le.viewMode&&rt&&(0,ee.jsx)("section",{className:"m-auto max-w-[390px] px-6 py-12 sm:max-w-[480px] sm:px-0",children:(0,ee.jsx)(F.WE,{type:h.Ze.COURSE,page:he,event:ae,confirmationData:rt,settings:de,coursePaymentEnabled:Te})})]})};ie.getLayout=function(e){var t=e.props,n=t.navigation,a=t.settings,r=t.alternateLanguages;return(0,ee.jsx)(H.Z,{alternateLanguages:r,navigation:n,settings:a,backgroundColor:"alt-2-container",page:e.props.page,children:e})},t.default=ie;var se=function(e){var t=e.userData,n=e.paymentIntent,r=(0,L.use
1Stripe)(),i=(0,L.useElements)(),s=(0,c.useState)(void 0),l=s[0],u=s[1],d=(0,c.useState)(!1),m=d[0],v=d[1],f=function(){var e=(0,a.Z)(o().mark((function e(a){var s,c,l;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a.preventDefault(),r&&i){e.next=3;break}return e.abrupt("return");case 3:return v(!0),s=new URL(window.location.href),t.instructionId&&null!==n&&void 0!==n&&n.id&&(s.searchParams.append(E.Ug,t.instructionId),s.searchParams.append(E.W6,n.id)),e.next=8,r.confirmPayment({elements:i,confirmParams:{return_url:"".concat(s)}});case 8:c=e.sent,"card_error"===(null===(l=c.error)||void 0===l?void 0:l.type)||"validation_error"===(null===l||void 0===l?void 0:l.type)?u(l.message):u("An unexpected error occured."),v(!1);case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return(0,ee.jsxs)("form",{id:"payment-form",onSubmit:f,children:[(0,ee.jsx)(L.PaymentElement,{id:"payment-element"}),(0,ee.jsx)(p.zx,{disabled:m||!r||!i,size:"large",buttonText:m?"Processing ...":"Pay ".concat(null!==n&&void 0!==n&&n.amount?(null===n||void 0===n?void 0:n.amount)/100:""," ").concat(null===n||void 0===n?void 0:n.currency.toUpperCase()),className:"mt-10 w-full",elementId:"stripe-payment-button"}),l&&(0,ee.jsx)("div",{id:"payment-message",children:l})]})}},94976:function(e,t,n){"use strict";n.d(t,{wh:function(){return s}});var a=function(e,t){return e.toString().padStart(t,"0")},r=6e4,i=36e5,s=function(e){if(!(void 0===e||e>=864e5)){for(var t=0,n=0;e>=i;)e-=i,t++;for(;e>=r;)e-=r,n++;return"".concat(a(t,2),":").concat(a(n,2))}}},34137:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/events/course-tm/[...event]",function(){return n(6199)}])}},function(e){e.O(0,[9101,9600,3120,9774,2888,179],(function(){return t=34137,e(e.s=t);var t}));var t=e.O();_N_E=t}]);
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.