1import{j as r,a as n}from"./react-vendor-DJtAp8P_.js";import{S as Z,s as R,H as U,c as ee}from"./index-BsiPhTjw.js";import{aG as re}from"./query-CcmDMjHA.js";import{S as se,a as oe}from"./ArrowUp-BTarMPYZ.js";import{aI as te,aJ as ie}from"./swiper-react-DcF17yCe.js";import{e as ae,c as ne,u as w,g as pe,v as ce}from"./app-DT7WuczB.js";import{bi as E}from"./index-CyS3LFy6.js";import{bA as le}from"./mutation--iSLlBrt.js";import"./dayjs-CFxoC4n5.js";import"./moment-Bj79pgB5.js";import"./index.esm-CWqXbt53.js";import{e as ge}from"./SessionPlannerMobile-85wkJ1ZS.js";import{s as de}from"./club-CAt4PSJ5.js";import{z as h,E as g,T as S,a7 as B,u as me,ao as ue,aq as xe,aH as be}from"./mui-DvP2hOwX.js";import{n as he,e as fe}from"./apollo-DL0KWP0Y.js";import"./mui-styles-C9F12l22.js";import"./babel-helpers-D2wBBc1I.js";import"./filters-D4RYviTZ.js";import"./search-DNkl80Xk.js";import"./Trailer-gVffTodC.js";import"./PlaylistTwoTone-C2NT716u.js";import"./Apple-CZyH-Klh.js";import"./AddPlaylistModal-CnE-eNO7.js";import"./ArrowLeft-Da6iFsoD.js";import"./Modal-BzPnYVEi.js";import"./Button-C4goEOKP.js";import"./Add-DRSElN7O.js";import"./AddBlack-qFPS8CaB.js";import"./PlaylistThumbnail-BQGQtBTO.js";import"./Search-BEYvHCFs.js";import"./Tabs-lVcpmzV2.js";import"./SearchHeader-BOq_PWig.js";import"./Filter-vdZeYdaV.js";import"./SearchBlue-Cq--C03-.js";import"./some-YFJAbcVi.js";import"./_baseIndexOf-DqPIyCu4.js";import"./values-DeBIqcD0.js";import"./omitBy-CVfI2Mdq.js";import"./_basePickBy-jHhPNsuZ.js";import"./_baseClone-DByvJCmO.js";import"./_baseAssignValue-CjtYt4eh.js";import"./VideoPlayerModal-BgJm66DJ.js";import"./orderBy-FNWL2R8s.js";import"./compact-DZdspzxW.js";import"./_baseDifference-BHjDay7E.js";import"./_arrayIncludes-DFQcso6E.js";import"./browser-B3fhYDhb.js";import"./isArrayLikeObject-CcVCHQro.js";import"./Carousel-CQBE7uOi.js";import"./EngineRoomMobileFilters-CUIuI1gK.js";import"./mapValues-CGRglPEa.js";import"./mapKeys-BOig4Tgf.js";import"./UpgradePlanModal-Cx-12O2U.js";import"./ArrowRightUp-CfAFwt7J.js";import"./Graphic-BzX0DM42.js";import"./useCoordinatedLoading-XKQda0nS.js";import"./InlineHint-BwtPd7HF.js";import"./AddPracticeToSessionModalGate-BB6n61YO.js";import"./seededSessionFill-BljGszd4.js";import"./popover-DQmY_bgT.js";import"./index-C53T7JDS.js";import"./floating-ui.dom-CpqR1Q5s.js";import"./index-CrwW5ro-.js";import"./subMonths-CpZP7vPB.js";import"./chevron-left-hHkvU2-n.js";import"./chevron-right-Bx281FLM.js";import"./s3FileHandler-Bp64keCt.js";import"./sessionSections-a-lprBoU.js";import"./index-CvVUxn0l.js";import"./check-njpSxvzl.js";import"./index-Cor9x_UP.js";import"./checkbox-BCFY1QRf.js";import"./input-CuTRSUQZ.js";import"./editable-input-BbmoAFqJ.js";import"./chevron-down-D9vZfud1.js";import"./label-DlgL8a7V.js";import"./plus-jTnJ9Ylg.js";import"./arrow-right-CPcr9UUY.js";import"./funnel-CHKnj2yC.js";import"./QuickViewDrawer-CaXFXbuw.js";import"./usePlaybackProgress-_1fECkJ3.js";import"./TextareaAutosize-t2TCv3sg.js";import"./SaveToPopover-DIvTKqx9.js";import"./Playlist-CukyolQ2.js";import"./Download-Bk4TTf4W.js";/* empty css */import"./ManagePracticeModal-CuLKk-Zk.js";import"./CoachNotesNew-Bns5SEHM.js";import"./ClubNotes-CwYSQnQ2.js";import"./index-w5DYIDvu.js";import"./index-_emSioTI.js";import"./isNumber-C5LS83rw.js";import"./index-C29Qg2hZ.js";import"./CreateEditSeasonModal-CSydoVwi.js";import"./AlertModal-CGXcj45Q.js";import"./DatePicker-BFwkswR8.js";import"./mui-x-DMY3qA32.js";import"./SortMenu-CjsJdGGV.js";import"./DeleteModal-BX6BaNP3.js";import"./cloneDeep-mVQ3twB2.js";import"./imageOptimization-zUL1CBPb.js";import"./lodash-icp7yO-G.js";import"./merge-TfBrBrIh.js";import"./map-BI8CQ8np.js";import"./hello-pangea-dnd-1bhs5THC.js";import"./index-B79atc36.js";import"./omit-BaIHraq0.js";import"./index-bEsv4Yks.js";import"./useRecentlyViewed-B56pK0QT.js";try{let t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="48361176-f6bd-401a-b986-3b5dbca2e829",t._sentryDebugIdIdentifier="sentry-dbid-48361176-f6bd-401a-b986-3b5dbca2e829")}catch{}const ye=({completed:t})=>({checkCircleBox:{background:o=>o.chip.win.backgroundColor,height:"44px",width:"44px",borderRadius:"12px",display:"flex",justifyContent:"center",alignItems:"center"},percentageBox:{top:0,left:0,bottom:0,right:0,position:"absolute",display:"flex",alignItems:"center",justifyContent:"center"},percentageTypography:{color:o=>o.palette.text.secondary,fontSize:"12px"},circularProgress:{height:"44px",width:"44px"},heading:{fontWeight:600,lineHeight:"24px",color:t?"#2E7D32":"unset"}
1,container:{border:t?"1px solid #ABCBAD":o=>`1px solid ${o.backgroundColor.body}`,borderRadius:"4px",bgcolor:t?"#2e7d3214":"unset",alignItems:"center","&:hover":{backgroundColor:o=>o.chip.draw.backgroundColor}},description:{fontSize:"14px",lineHeight:"22px",color:t?"#6DA470":o=>o.palette.text.secondary}}),x=({completed:t=!1,heading:o,description:i,progressValue:a=0})=>{const p=ye({completed:t}),l=E(),d=()=>{switch(o){case"Add Your First Team":l("/dugout/teams");break;case"Add 5 Players":l("/dugout/players");break;case"Create 3 Player Objectives":l("/dugout/players");break;case"Create 3 Sessions":l("/dugout/sessions");break;case"Add 2 Videos to a Session":l("/dugout/sessions");break}},k=()=>r.jsxs(g,{sx:{position:"relative",display:"inline-flex"},children:[r.jsx(B,{variant:"determinate",sx:m=>({color:m.backgroundColor.skeleton}),value:100,size:44}),r.jsx(B,{variant:"determinate",sx:m=>({color:m.palette.primary.main,position:"absolute",left:0}),value:a,size:44}),r.jsx(g,{sx:p.percentageBox,children:r.jsxs(S,{variant:"caption",sx:p.percentageTypography,children:[a,"%"]})})]});return r.jsxs(h,{container:!0,flexGrow:1,p:2,gap:"12px",sx:p.container,onClick:d,children:[r.jsxs(h,{container:!0,flex:1,gap:"12px",children:[t?r.jsx(g,{sx:p.checkCircleBox,children:r.jsx(Z,{})}):r.jsx(g,{sx:p.circularProgress,children:r.jsx(k,{value:50})}),r.jsxs(h,{flex:1,children:[r.jsx(S,{sx:p.heading,children:o}),r.jsx(S,{sx:p.description,children:i})]})]}),r.jsx(ge,{cursor:"pointer",height:"24px",width:"24px"})]})},b={cardContent:{padding:"0px","&:last-child":{padding:"0px"}},linearProgress:{"&.MuiLinearProgress-colorPrimary > .MuiLinearProgress-bar":{backgroundColor:t=>t.availability.available},"&.MuiLinearProgress-root":{backgroundColor:t=>t.backgroundColor.body},height:"6px"},progressCard:{width:"100%",padding:"0",cursor:"grab",borderRadius:"16px",boxShadow:"0px 12px 24px -4px rgba(145, 158, 171, 0.12), 0px 0px 2px 0px rgba(145, 158, 171, 0.20)"},draggableBox:{position:"absolute",top:"24px",right:"24px",zIndex:1e3,width:"400px",borderRadius:"12px",cursor:"pointer",border:t=>`1px solid ${t.backgroundColor.skeleton}`,backgroundColor:t=>t.backgroundColor.light},progressBarText:{fontSize:"18px",fontWeight:700,lineHeight:"28px"}},js=()=>{const{t}=ae("engineRoom"),o=ne(),i=w(s=>s.club),{lastViewedVideo:a}=w(s=>s.app),{isOnboardingProgress:p}=w(s=>s.onboarding),l=o!=null&&o.club_id?o==null?void 0:o.club_id:i!=null&&i.club_id?i==null?void 0:i.club_id:0,d=o==null?void 0:o.isSuperAdmin,[k,m]=n.useState([]),[D,M]=n.useState([]),[V,z]=n.useState([]),[I,L]=n.useState([]),[G,H]=n.useState([]),f=me(s=>s.breakpoints.down("md")),_=n.useRef(null),O=n.useRef(null),[F]=he(le),v=pe(),[C,N]=n.useState(0),T=n.useRef(null),$=E();n.useEffect(()=>{if(a!=null&&a.id){const s=ce(a.title,a.id,a.collectionId,a.contentType);$(`/collections?${s}`)}},[a]);const{data:u}=fe(re,{variables:{club_id:l},skip:i==null?void 0:i.is_onboarding_completed,fetchPolicy:"no-cache"});n.useEffect(()=>{if(u){const s=u==null?void 0:u.getClubProgress;if(s!=null&&s.success){const e=s==null?void 0:s.data;m(e==null?void 0:e.teams),M(e==null?void 0:e.players),z(e==null?void 0:e.playerObjectives),L(e==null?void 0:e.trainingSessions),H(e==null?void 0:e.sessionPractices),J({progressTeams:e==null?void 0:e.teams,progressPlayers:e==null?void 0:e.players,progressSessions:e==null?void 0:e.trainingSessions,progressPlayerObjectives:e==null?void 0:e.playerObjectives,progressSessionPractices:e==null?void 0:e.sessionPractices})}}},[u]);const A=()=>v(R({isOnboardingProgress:!p}));n.useEffect(()=>{if(!(a!=null&&a.id))return()=>
1{v(R({isOnboardingProgress:!1}))}},[]);const W=({progressTeams:s,progressPlayers:e,progressPlayerObjectives:y,progressSessions:P,progressSessionPractices:j,getProgressValuePlayers:c,getProgressValuePlayerObjectives:K,getProgressValueSessions:X})=>r.jsxs(r.Fragment,{children:[r.jsx(x,{completed:s.length===1,heading:"Add Your First Team",description:"Get started by adding a team"}),r.jsx(x,{completed:e.length===5,heading:"Add 5 Players",description:"Add or import your players",progressValue:c(e.length)}),r.jsx(x,{completed:y.length===3,heading:"Create 3 Player Objectives",description:"Build and track player goals",progressValue:K(y.length)}),r.jsx(x,{completed:P.length===3,heading:"Create 3 Sessions",description:"Put together team sessions",progressValue:X(P.length)}),r.jsx(x,{completed:j.length===2,heading:"Add 2 Videos to a Session",description:"Select any Engine Room video",progressValue:j.length===1?50:0})]}),q=s=>{let e;switch(s){case 1:e=20;break;case 2:e=40;break;case 3:e=60;break;case 4:e=80;break;default:e=0;break}return e},Q=s=>{let e;switch(s){case 1:e=33;break;case 2:e=66;break;default:e=0;break}return e},Y=s=>{let e;switch(s){case 1:e=33;break;case 2:e=66;break;default:e=0;break}return e},J=({progressTeams:s,progressPlayers:e,progressPlayerObjectives:y,progressSessions:P,progressSessionPractices:j})=>{let c=0;return s.length===1&&(c+=20),e.length===5&&(c+=20),y.length===3&&(c+=20),P.length===3&&(c+=20),j.length===2&&(c+=20),N(c),c};return n.useEffect(()=>{async function s(){C===100&&!f&&d&&(i==null?void 0:i.is_onboarding_completed)===!1&&(await F(),v(de({is_onboarding_completed:!0})),_.current.triggerConfetti(),O.current.handleOpenSuccessBar("Congratulations, you have completed your onboarding!","Time to push forward and accelerate your club!"))}s()},[C,f,d,i==null?void 0:i.is_onboarding_completed]),r.jsxs(r.Fragment,{children:[!f&&d&&r.jsxs(r.Fragment,{children:[r.jsx(te,{ref:_}),r.jsx(ie,{ref:O})]}),r.jsx(U,{}),!f&&!i.is_onboarding_completed&&d&&r.jsx(ee,{nodeRef:T,children:r.jsx(g,{ref:T,sx:b.draggableBox,children:r.jsx(ue,{onTouchEnd:A,elevation:0,sx:b.progressCard,children:r.jsxs(xe,{sx:b.cardContent,children:[r.jsxs(h,{container:!0,p:3,className:"drag-handle",onClick:A,children:[r.jsx(S,{sx:b.progressBarText,children:t("home.yourProgress")}),r.jsx(g,{sx:{marginLeft:"auto",cursor:"pointer"},children:p?r.jsx(se,{}):r.jsx(oe,{})})]}),r.jsx(g,{sx:{width:"100%"},children:r.jsx(be,{variant:"determinate",value:C,sx:b.linearProgress})}),p&&r.jsx(h,{container:!0,p:2,gap:"10px",sx:{background:"red"},children:r.jsx(W,{progressTeams:k,progressPlayers:D,progressPlayerObjectives:V,progressSessions:I,progressSessionPractices:G,getProgressValuePlayers:q,getProgressValuePlayerObjectives:Q,getProgressValueSessions:Y})})]})})})})]})};export{js 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.