PageSourceSearch

https://id.movevn.com/assets/UserWaitingListInformation-BjuFWb2S.js

js movevn.com collected 2026-09-24 14:01:02 UTC 5,927 bytes, 1 lines download raw bytes

1import{j as e,B as l,D as K,ae as Q,T as r,S as M,a3 as h,ai as X,a0 as Z}from"./vendor-mui-DFXKyM2E.js";import{u as $,a as ee,P as se,d as _,h as te}from"./index-DGSpuRBj.js";import{h as ae,c as ne}from"./UserInformation-D7XOpBWw.js";import{b as re,a as ie}from"./UserWaitingList-BVqu13bQ.js";import{l as oe,a as n,u as ce}from"./vendor-react-CrXZvyk_.js";import{a as le}from"./validate-RN34gYor.js";import{N as de}from"./NavHeader-BROh2czj.js";import{P as ue}from"./PolicyAcceptanceModal-C4ntrL0e.js";import{n as D,t as f}from"./timezone-DGogyvEL.js";import{i as pe}from"./SessionInstructors-CkwnpgoK.js";import"./vendor-redux-Bi3kFs4E.js";import"./vendor-utils-BFUpClQh.js";import"./vendor-form-Df9-JY-v.js";import"./Home-CqZgsyW_.js";_.extend(te);const me="2026-02-02",fe=()=>_().isAfter(_(me).startOf("day")),xe=d=>fe()?f(d).diff(D(),"minute")<240:!1,De=()=>{const{id:d}=oe(),{t:s}=$(),{showMessage:o,startProgress:g,completeProgress:b}=ee(),[I,y]=n.useState(!1),[Y,u]=n.useState(!1),[W,j]=n.useState(!1),w=ce(),[B,C]=n.useState(!1),[c,U]=n.useState(null),[q,E]=n.useState(!1),[he,_e]=n.useState(!1),[ge,O]=n.useState(!1),R=c?.user,a=c?.session,F=c?.subscription;c?.trainer;const S=c?.name_shared,x=c?.id,k=c?.queue_position,v=c?.total_in_queue,P=()=>{y(!1)};async function H(){if(a?.max_sessions=="-1"?!0:a?.class_session_user_count<a?.max_sessions)return o("error",s("Your current subscription is invalid!"));let i={waiting_list_id:x,subscription_id:F?.id,session_id:a?.id};S&&(i={...i,shared:[S],is_only_shared:1});let J={waiting_list_id:{presence:!0},session_id:{presence:!0},subscription_id:{presence:!0}};const N=le.validate(i,J);if(!N)try{C(!0);const m=await ne(i);if(m&&!m.error){const{session_id:L}=m;L&&w("/account/waiting-list/"+L)}else o("error",s("An error occurred, please try later"))}catch{o("error",s("An error occurred, please try later"))}finally{C(!1)}O(N)}const T=n.useCallback(async()=>{try{const t=await ae({});if(t&&!t.error){const{data:i}=t}}catch{}},[]),A=n.useCallback(async()=>{try{g();const t=await re(Number(d));if(t&&!t.error){const{data:i}=t;i&&U(i)}}catch{}finally{b(),E(!0)}},[d,g,b]);n.useEffect(()=>{T(),A()},[T,A]),n.useMemo(()=>{if(!a?.start_time)return 0;const t=D();return f(a.start_time).diff(t,"hour")},[a?.start_time]);const p=n.useMemo(()=>a?.start_time?xe(a.start_time):!1,[a?.start_time]),V=()=>{u(!0)},z=async()=>{if(x)try{j(!0);const t=await ie(x,{policy_accepted:!0});t&&!t.error?(o("success",s("Waiting list entry cancelled successfully")),w("/account/waiting-list")):t?.cancellation_blocked?o("error",s("cannot_cancel_within_4_hours","Cannot cancel within 4 hours of session start")):t?.requires_policy_acceptance?o("error",s("policy_acceptance_required","Please accept the policy to continue")):o("error",t?.message||s("An error occurred, please try later"))}catch{o("error",s("An error occurred, please try later"))}finally{j(!1),u(!1)}},G={position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:540,bgcolor:"background.paper",boxShadow:24,pt:2,px:4,pb:3};return q?e.jsxs(l,{sx:{width:"100%"},children:[e.jsx(de,{title:s("Your waiting list"),breadcrumb:[{title:s("Your waiting list")}],backLink:"/account/waiting-list/"}),e.jsxs("div",{className:"max-w-[520px] mx-auto",children:[e.jsxs(l,{children:[e.jsx(K,{sx:{mb:2},children:e.jsx(Q,{label:s("Session information"),className:"uppercase",sx:{borderRadius:0}})}),e.jsxs(l,{sx:{mb:3},children:[e.jsx(r,{children:e.jsx("span",{className:"text-2xl font-bold uppercase",children:s(a?.class_types||"")})}),e.jsx(r,{className:"text-sm",sx:{mb:3},children:s(a?.description||"")}),e.jsxs(r,{children:[s("on")," ",e.jsxs("span",{className:"font-bold uppercase",children:[" ",f(a?.start_time).format("ddd, DD/MM/YYYY")]})]}),e.jsxs(r,{children:[s("at")," ",e.jsx("span",{className:"font-bold uppercase",children:f(a?.start_time).format("HH:mm")})]}),e.jsxs(r,{children:[s("Duration"),":"," ",e.jsxs("span",{className:"font-bold",children:[a?.duration_minutes," minutes"]})]}),e.jsxs(r,{sx:{mb:2},children:[s("Instructor"),":"," ",e.jsx("strong",{children:pe(a)})]}),k&&e.jsxs(l,{sx:{mt:2,p:2,bgcolor:"#f5f5f5",borderRadius:1,textAlign:"center"},children:[e.jsxs(r,{variant:"h4",sx:{fontWeight:700,color:"#000"},children:["#",k]}),e.jsxs(r,{variant:"body2",color:"text.secondary",children:[s("your_queue_position","Your position in line"),v&&e.jsxs("span",{children:[" (",s("of")," ",v,")"]})]})]})]})]}),e.jsxs(M,{direction:"row",spacing:2,sx:{mb:3},children:[e.jsx(h,{variant:"contained",onClick:()=>y(!0),sx:{background:"#000",borderRadius:0,flex:1},children:s("Book session")}),e.jsx(h,{variant:"outlined",onClick:V,disabled:p,sx:{borderRadius:0,flex:1,borderColor:p?"#999":"#d32f2f",color:p?"#999":"#d32f2f"},children:p?s("cannot_cancel_within_4_hours","Cannot cancel (< 4 hours)"):s("Cancel waiting list")})]})]}),e.jsx(X,{open:I,onClose:P,children:e.jsxs(l,{sx:{...G,maxWidth:540},children:[e.jsx(r,{sx:{fontWeight:600},id:"modal-modal-title",variant:"h5",component:"h2",children:s("Do you want to book this session?")}),e.jsxs(r,{id:"modal-modal-description",sx:{mt:2},children:[s("We will send the appointment booking information to the email address")," ",e.jsx("strong",{children:R?.email}),"."," ",s("You will receive an email containing the appointment details and an attached event file. Please open the attachment and add it to your calendar.")]}),e.jsxs(M,{direction:"row",justifyContent:"space-between",mt:4,children:[e.jsx(h,{onClick:P,variant:"outlined",sx:{padding:"10px 20px",textTransform:"uppercase",borderRadius:0},children:s("close")}),a?e.jsx(Z,{loading:B,onClick:()=>H(),variant:"contained",sx:{backgroundColor:"#000",color:"#fff",padding:"10px 20px",textTransform:"uppercase",borderRadius:0},children:s("Confirm")}):""]})]})}),e.jsx(ue,{open:Y,setOpen:u,isLoading:W,onAccept:z,onDecline:()=>u(!1),policyType:"cancellation"})]}):e.jsx(se,{height:500})};export{De as default};

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.