PageSourceSearch

https://www.goswim.tv/_next/static/chunks/pages/gallery/[lessonId]-79b96a44ac114959.js

js goswim.tv collected 2026-09-24 20:04:17 UTC 137,579 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5618,9721],{45185:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/gallery/[lessonId]",function(){return n(24789)}])},24789:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSP:function(){return eq},default:function(){return eQ}});var i=n(26042),a=n(35944),o=n(9008),r=n.n(o),l=n(25617),s=n(66432),c=n(9721),d=n(828),u=n(30120),p=n(53337),m=n(11163),h=n(67294),v=n(28396),g=n(77116),f=n(14924),E=n(36305),S=n(62097),y=n(61225),b=n(49837),x=n(55343),_=n(3695),w=n(53442),T=n(31538),k=n(72389),N=n(90244),A=n(93978),Z=n(69417),C=n(5605),I=n(39807),O=n(57412),F=n(79072),D=n(35644),R=n(93451),L=n(41796),M=n(29630),B=n(73327),P=n(20843),G=n(2415),U=(0,p.Z)(function(e){return(0,B.Z)({cardWrapper:{width:"100%",margin:0,padding:0,boxShadow:"0px 0px !important",borderRadius:"8px",backgroundImage:"none","& :hover":{"& img":{border:"6px solid",borderColor:(0,L.Fq)(e.palette.secondary.main,.11)},background:(0,L.Fq)(e.palette.secondary.main,.11)}},cardMedia:{width:"35%",maxWidth:"90px",maxHeight:"60px",minWidth:"90px","& :hover":{background:"transparent"}},flexContainer:{display:"flex",flexDirection:"row",padding:0,minHeight:"60px","& :hover":{background:"transparent"}},divRelative:{position:"relative"},contentArea:{display:"flex",justifyContent:"center",alignItems:"center",margin:0,padding:0,boxSizing:"border-box","& :hover":{background:"transparent"},"&:last-child":{paddingBottom:0}},typography:(0,f.Z)({boxSizing:"border-box",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:1,overflow:"hidden",textOverflow:"ellipsis",wordWrap:"normal",margin:"8px !important",color:e.palette.text.primary},e.breakpoints.down("sm"),{maxWidth:"55vw"}),cardImage:{borderRadius:"8px"}})}),V=function(e){var t,n,i=U(),o=(0,l.v9)(function(e){return e.account.theme}),r=(0,G.vQ)(G.xB),c=o||r,u=!c&&!r||c===s.JV.LIGHT,p=(0,d.Z)((0,h.useState)(e.videoData.thumbnailUrl?e.videoData.thumbnailUrl:u?s.E8:s.U5),1)[0];return(0,a.tZ)(b.Z,{className:i.cardWrapper,children:(0,a.BX)("div",{className:i.flexContainer,style:{gap:"16px"},children:[(0,a.tZ)("div",{className:i.cardMedia,children:(0,a.tZ)(P.Z,{src:p,alt:"annotated image",className:i.cardImage,width:"0",height:"0",sizes:"50%",style:{width:"100%",height:"100%",objectFit:"cover"},priority:!0})}),(0,a.tZ)(M.Z,{variant:"body1",component:"h1",children:(null==e?void 0:null===(t=e.videoData)||void 0===t?void 0:t.video_file_name)?null==e?void 0:null===(n=e.videoData)||void 0===n?void 0:n.video_file_name:""})]})})},W=n(16792),z=(0,p.Z)(function(e){var t;return{rootCard:(t={},(0,f.Z)(t,e.breakpoints.up("sm"),{margin:e.spacing(2)}),(0,f.Z)(t,e.breakpoints.down("sm"),{margin:"".concat(e.spacing(0)," ").concat(e.spacing(1)," ").concat(e.spacing(2))}),(0,f.Z)(t,"maxHeight","100%"),(0,f.Z)(t,"overflow","auto"),(0,f.Z)(t,"borderRadius",e.spacing(1)),(0,f.Z)(t,"backgroundImage","none"),t),relatedVideoCard:{marginBottom:"".concat(e.spacing(2)," !important"),"& a":{textDecoration:"none"}},noSpace:{margin:0,padding:0},noRelatedVideos:{textAlign:"center",height:"100%"},norelatedDiv:{padding:"32px",margin:"24px",background:(0,L.Fq)(e.palette.primary.main,.04)},header:{marginBottom:e.spacing(.5),padding:e.spacing(2),backgroundColor:(0,L.Fq)(e.palette.text.primary,.1)},listContainer:{padding:e.spacing(2)}}}),X=function(){var e,t,n=z(),i=(0,m.useRouter)(),o=(0,l.v9)(function(e){var t;return null==e?void 0:null===(t=e.userVideos)||void 0===t?void 0:t.annotationsList}).results,r=(0,l.v9)(function(e){var t;return null==e?void 0:null===(t=e.userVideos)||void 0===t?void 0:t.isAnnotationListLoading}),s=null==i?void 0:null===(e=i.query)||void 0===e?void 0:e.isFreeVideo,c=null==i?void 0:null===(t=i.asPath)||void 0===t?void 0:t.split("=")[1];return(0,a.BX)(b.Z,{elevation:12,className:n.rootCard,children:[(0,a.tZ)(F.ZP,{item:!0,xs:12,children:(0,a.tZ)("div",{className:n.header,children:(0,a.tZ)(M.Z,{variant:"h5",component:"h2",children:"Annotated Videos"})})}),(0,a.tZ)("div",{className:n.listContainer,children:r?(0,a.tZ)(W.Z,{}):o&&(null==o?void 0:o.length)>0?null==o?void 0:o.map(function(e,t){return(0,a.tZ)(F.ZP,{item:!0,xs:12,className:n.relatedVideoCard,
1children:(0,a.tZ)(u.Z,{style:{cursor:"pointer"},onClick:function(){i.push({pathname:c?"/gallery/".concat(null==e?void 0:e.lv_guid,"?team_id=").concat(c,"&annotationVideo=true"):"/gallery/".concat(null==e?void 0:e.lv_guid,"?annotationVideo=true"),query:{isFreeVideo:s}},c?"/gallery/".concat(null==e?void 0:e.lv_guid,"?team_id=").concat(c,"&annotationVideo=true"):"/gallery/".concat(null==e?void 0:e.lv_guid,"?annotationVideo=true"))},children:(0,a.tZ)("div",{className:n.noSpace,children:(0,a.tZ)(V,{videoData:e})})})},"detail_".concat(e._id,"_").concat(t))}):o&&(null==o?void 0:o.length)===0&&(0,a.tZ)("div",{className:n.norelatedDiv,children:(0,a.tZ)(M.Z,{variant:"body2",className:n.noRelatedVideos,children:"NO VIDEOS"})})})]})},H=n(4291),Y=n(86010),j=n(41664),K=n.n(j),q=n(97186),Q=n(80800),J=n(62904),$={BTN_TOOLTIP:"Your personal guide to understanding race data and performance trends."},ee=n(47568),et=n(20414),en=n(51438),ei=n(23367),ea=n(42546),eo=n(97460),er=(function(){function e(){var t;(0,en.Z)(this,e),this.feedbackSummary=(t=(0,ee.Z)(function(e){var t,n,i;return(0,et.__generator)(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,ea.s.post("api/v1/openai/feedback-summary",e)];case 1:return[2,a.sent().data.data];case 2:throw t=a.sent(),eo.Z.error((null===(n=t.response)||void 0===n?void 0:null===(i=n.data)||void 0===i?void 0:i.message)||s.EE,ei.v),t;case 3:return[2]}})}),function(e){return t.apply(this,arguments)})}return e.getInstance=function(){return this.instance||(this.instance=new e),this.instance},e})().getInstance(),el=n(88230),es=function(e){var t;return t=(0,ee.Z)(function(t){var n,i;return(0,et.__generator)(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),t({type:el.Ts}),[4,er.feedbackSummary(e)];case 1:return n=a.sent(),t({type:el.Tw,payload:n}),[3,3];case 2:return i=a.sent(),t({type:el.Up,error:i}),[3,3];case 3:return[2]}})}),function(e){return t.apply(this,arguments)}},ec=function(){var e;return e=(0,ee.Z)(function(e){return(0,et.__generator)(this,function(t){return e({type:el.WS}),[2]})}),function(t){return e.apply(this,arguments)}},ed=n(2548),eu=(0,p.Z)(function(e){var t;return{rootCard:(t={},(0,f.Z)(t,e.breakpoints.up("sm"),{margin:e.spacing(2)}),(0,f.Z)(t,e.breakpoints.down("sm"),{margin:"".concat(e.spacing(0)," ").concat(e.spacing(1)," ").concat(e.spacing(2)," !important"),marginRight:"".concat(e.spacing(1)," !important"),marginLeft:"".concat(e.spacing(1)," !important")}),(0,f.Z)(t,"maxHeight","100%"),(0,f.Z)(t,"overflow","auto"),(0,f.Z)(t,"borderRadius",e.spacing(1)),(0,f.Z)(t,"backgroundImage","none"),t),relatedVideoCard:{marginBottom:"".concat(e.spacing(2)," !important"),"& a":{textDecoration:"none"}},progressCenter:{padding:16,display:"flex",justifyContent:"center",alignContent:"center",alignItems:"center"},header:{padding:e.spacing(2),backgroundColor:(0,L.Fq)(e.palette.text.primary,.1),display:"flex",alignContent:"center"},listContainer:{padding:e.spacing(2)},scrollForSummary:{overflowY:"scroll"},summaryCard:{minHeight:"150px",maxHeight:"700px",alignContent:"center","& code":{whiteSpace:"normal"}},mailCTA:{padding:"".concat(e.spacing(1)," !important"),background:"light"===e.palette.mode?e.palette.grey[200]:(0,L.Fq)(e.palette.primary.main,.04),borderRadius:"".concat(e.spacing(1)," !important")},link:{color:"".concat(e.palette.primary.main," !important")}}}),ep=function(){var e=eu(),t=(0,l.I0)(),n=(0,l.v9)(function(e){return{feedbackSummaryDetail:e.openAI.feedbackSummaryDetail,isLoading:e.openAI.isLoading,videoDetail:e.userVideos.videoDetail}}),i=n.isLoading,o=n.feedbackSummaryDetail,r=n.videoDetail;return(0,h.useEffect)(function(){return function(){t(ec())}},[]),(0,a.BX)(b.Z,{elevation:12,className:e.rootCard,children:[(0,a.tZ)(F.ZP,{item:!0,xs:12,children:(0,a.BX)("div",{className:e.header,children:[(0,a.tZ)(M.Z,{variant:"h5",component:"h2",mr:1,children:"GoSwim Assistant"}),(0,a.tZ)(J.Z,{title:$.BTN_TOOLTIP,children:(0,a.tZ)(ed.Z,{})})]})}),(0,a.BX)("div",{className:!i&&o?(0,Y.Z)(e.listContainer,e.scrollForSummary,e.summaryCard):(0,Y.Z)(e.listContainer,e.summaryCard),children:[!i&&!o&&(0,a.BX)(u.Z,{textAlign:"center",children:[(0,a.tZ)(M.Z,{variant:"body2",color:"textSecondary",mb:1,children:"See what the data says about your swim."}),(0,a.tZ)(u.Z,{mb:1,children:(0,a.tZ)(q.Z,{onClick:function(){var e,n,i,a,o,l;t(es({eventLength:null==r?void 0:null===(e=r.race)||void 0===e?void 0:e.race_length,strokeType:null==r?void 0:null===(n=r.race)||void 0===n?void 0:n.event,lapData:null==r?void 0:null===(i=r.race)||void 0===i?void 0:null===(a=i.summary)||void 0===a?void 0:null===(o=a.swimmer)||void 0===o?void 0:null===(l=o[0])||void 0===l?void 0:l.lap}))},children:"Click for Race Insights"})})]}),i?(0,a.tZ)(W.Z,{minHeight:!0}):(0,a.tZ)(F.ZP,{item:!0,xs:12,children:o&&(0,a.BX)(a.HY,{children:[(0,a.tZ)(Q.Z,{markDown:o}),(0,a.tZ)(u.Z,{className:e.mailCTA,children:(0,a.BX)(M.Z,{variant:"subtitle2",children:["Have questions or want personalized guidance? Contact us at"," ",(0,a.tZ)(K(),{className:e.link,href:"mailto:[email protected]",children:"[email protected]"})," ","— we’re happy to help!"]})})]})})]})]})},em=n(70754),eh=(0,p.Z)(function(e){return(0,B.Z)({cardWrapper:{width:"100%",margin:0,padding:0,boxShadow:"0px 0px !important",borderRadius:"8px",backgroundImage:"none","& :hover":{"& img":{border:"6px solid",borderColor:(0,L.Fq)(e.palette.secondary.main,.11)},background:(0,L.Fq)(e.palette.secondary.main,.11)}}
1,cardMedia:{width:"35%",maxWidth:"90px",maxHeight:"60px",minWidth:"90px","& :hover":{background:"transparent"}},flexContainer:{display:"flex",flexDirection:"row",padding:0,minHeight:"60px","& :hover":{background:"transparent"},alignItems:"center"},divRelative:{position:"relative"},contentArea:{display:"flex",justifyContent:"center",alignItems:"center",margin:0,padding:0,boxSizing:"border-box","& :hover":{background:"transparent"},"&:last-child":{paddingBottom:0}},typography:(0,f.Z)({boxSizing:"border-box",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:1,overflow:"hidden",textOverflow:"ellipsis",wordWrap:"normal",margin:"8px !important",color:e.palette.text.primary},e.breakpoints.down("sm"),{maxWidth:"55vw"}),cardImage:{borderRadius:"8px"}})}),ev=function(e){var t,n,i=eh(),o=(0,l.v9)(function(e){return e.account.theme}),r=(0,G.vQ)(G.xB),c=o||r,u=!c&&!r||c===s.JV.LIGHT,p=(0,d.Z)((0,h.useState)(e.videoData.thumbnailUrl?e.videoData.thumbnailUrl:u?s.E8:s.U5),1)[0];return(0,a.tZ)(b.Z,{className:i.cardWrapper,children:(0,a.BX)("div",{className:i.flexContainer,style:{gap:"16px"},children:[(0,a.tZ)("div",{className:i.cardMedia,children:(0,a.tZ)(P.Z,{src:p,alt:"recommended thumbnail",className:i.cardImage,width:"0",height:"0",sizes:"50%",style:{width:"100%",height:"100%",objectFit:"cover"},priority:!0})}),(0,a.tZ)("div",{children:(0,a.tZ)(M.Z,{variant:"body2",children:(null==e?void 0:null===(t=e.videoData)||void 0===t?void 0:t.name)?null==e?void 0:null===(n=e.videoData)||void 0===n?void 0:n.name:""})})]})})},eg=n(58533),ef=(0,p.Z)(function(e){var t;return{rootCard:(t={},(0,f.Z)(t,e.breakpoints.up("sm"),{margin:e.spacing(2)}),(0,f.Z)(t,e.breakpoints.down("sm"),{margin:"".concat(e.spacing(0)," ").concat(e.spacing(1)," ").concat(e.spacing(2))}),(0,f.Z)(t,"borderRadius",e.spacing(1)),(0,f.Z)(t,"backgroundImage","none"),t),relatedVideoCard:{marginBottom:"".concat(e.spacing(2)," !important"),"& a":{textDecoration:"none"}},noSpace:{margin:0,padding:0},noRelatedVideos:{textAlign:"center",height:"100%"},norelatedDiv:{padding:"32px",margin:"24px",background:(0,L.Fq)(e.palette.primary.main,.04)},header:{marginBottom:e.spacing(.5),padding:e.spacing(2),backgroundColor:(0,L.Fq)(e.palette.text.primary,.1)},listContainer:(0,f.Z)({padding:e.spacing(2),maxHeight:"300px",overflow:"auto"},e.breakpoints.down("sm"),{padding:e.spacing(1)}),progressCenter:{padding:16,display:"flex",justifyContent:"center",alignContent:"center",alignItems:"center"}}}),eE=function(e){var t=e.page,n=e.setPage,i=ef(),o=(0,m.useRouter)(),r=(0,l.v9)(function(e){var t;return null==e?void 0:null===(t=e.userVideos)||void 0===t?void 0:t.recommendedVideosList}),s=r.results,c=r.totalCount,p=(0,l.v9)(function(e){var t;return null==e?void 0:null===(t=e.userVideos)||void 0===t?void 0:t.isRecommendedVideosLoading}),v=(0,d.Z)((0,h.useState)(c!==s.length),2),g=v[0],f=v[1];return(0,a.BX)(b.Z,{elevation:12,className:i.rootCard,children:[(0,a.tZ)(F.ZP,{item:!0,xs:12,children:(0,a.tZ)("div",{className:i.header,children:(0,a.tZ)(M.Z,{variant:"h5",component:"h2",children:"Recommended Videos"})})}),(0,a.tZ)("div",{id:"recommended-videos-container",className:i.listContainer,children:(0,a.tZ)(eg.Z,{dataLength:null==s?void 0:s.length,next:function(){Math.round((null==s?void 0:s.length)/5)<=t&&(null==s?void 0:s.length)<c?n(t+1):f(!1)},hasMore:g,scrollableTarget:"recommended-videos-container",loader:1!==t&&(0,a.tZ)("div",{className:i.progressCenter,style:{display:p?"flex":"none"},children:(0,a.tZ)(em.Z,{color:"secondary",disableShrink:!0,suppressHydrationWarning:!0})}),children:p&&1===t?(0,a.tZ)(W.Z,{minHeight:!0}):s&&(null==s?void 0:s.length)>0?null==s?void 0:s.map(function(e,t){return(0,a.tZ)(F.ZP,{item:!0,xs:12,className:i.relatedVideoCard,children:(0,a.tZ)(u.Z,{style:{cursor:"pointer"},onClick:function(){o.push("/lessons/".concat(null==e?void 0:e.id,"-").concat(null==e?void 0:e.permalink))},children:(0,a.tZ)("div",{className:i.noSpace,children:(0,a.tZ)(ev,{videoData:e})})})},"detail_".concat(e._id,"_").concat(t))}):s&&(null==s?void 0:s.length)===0&&(0,a.tZ)("div",{className:i.norelatedDiv,children:(0,a.tZ)(M.Z,{variant:"body2",className:i.noRelatedVideos,children:"NO VIDEOS"})})})})]})},eS=n(25281),ey=n(9747),eb=n(38530),ex=n(83461),e_=n(34073),ew=n(353),eT=n(19589),ek=n(77703),eN=n(69396),eA=n(29620),eZ=n(77745),eC=n(21448),eI=n(80562),eO=n(95398),eF=n(50594),eD=n(98583),eR=n(40051),eL=n(72866),eM=["#2563EB","#16A34A","#DB2777","#EAB308","#8B5CF6","#EC4899","#06B6D4","#F97316","#10B981","#6366F1","#D97706","#0284C7","#4F46E5","#059669","#BE185D","#CA8A04"],eB=function(e){var t=e.reportData,n=t.swimmerName,i=t.eventName,o=t.event,r=t.poolType,l=t.raceLength,s=t.unit,c=t.velUnit,d=t.dateStr,u=t.finalTimeFormatted,p=t.splitsSummaryStr,m=t.avgSwimVelocityStr,h=t.velocityTrajectoryStr,v=t.totalStrokes,g=t.strokesPerLapStr,f=t.peakPulloutSpeedStr,S=t.peakPulloutSubt
1itle,y=t.backHalfFadeStr,b=t.backHalfSubtitle,x=t.laps,_=t.lapPhases,w=t.legs,T=t.isIM,k=t.totalDistance,N=t.notesText,A=t.generatedDateStr,Z=t.narrative,C=Boolean(T)||Boolean(o)&&(o.toLowerCase().includes("im")||o.toLowerCase().includes("medley"))||Boolean(i)&&(i.toLowerCase().includes("im")||i.toLowerCase().includes("medley")),I=C||Boolean(x)&&x.length>8,O=function(e,t,n){if(e.strokeType)return e.strokeType;if(w&&w.length>0){var i=w.find(function(t){return e.lap>=t.startLap&&e.lap<=t.endLap});if(i&&i.stroke)return i.stroke}if(C){var a=["Butterfly","Backstroke","Breaststroke","Freestyle"];return n>=4?a[Math.min(3,Math.floor(t/n*4))]:a[t%4]}return""},F=function(e){var t={top:22,right:65,bottom:26,left:45},n=840-t.left-t.right,i=175-t.top-t.bottom,o="dpc"===e,r=[],l=[];x.forEach(function(e,t){var n=eM[t%eM.length],i=_[t],a=[];if(i&&i.strokePhases&&i.strokePhases.length>0)i.strokePhases.forEach(function(t,n){var i=o?t.distance:t.duration,r=i>0?i:o?e.avgDpc:e.avgTempo;if(r>0){var s=Number(r.toFixed(2));a.push({stroke:n+1,val:s}),l.push(s)}});else{var s=o?e.avgDpc:e.avgTempo;if(s>0){var c=Number(s.toFixed(2));a.push({stroke:1,val:c}),l.push(c);for(var d=Math.max(2,Math.min(6,e.strokeCount||2)),u=2;u<=d;u++)a.push({stroke:u,val:c}),l.push(c)}}a.length>0&&r.push({lapIndex:t,lapNumber:e.lap,color:n,points:a.map(function(e){return{x:0,y:0,val:e.val,stroke:e.stroke}})})});var c=(h=Math).max.apply(h,[2].concat((0,E.Z)(r.map(function(e){return e.points.length})))),d=o?1.8:1,u=o?3.2:2,p=[d,u],m=1;if(l.length>0){var h,v,g,f=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5,i=(t-e||Math.abs(t)||1)/n,a=Math.pow(10,Math.floor(Math.log10(i))),o=i/a,r=(o<=1?1:o<=2?2:o<=2.5?2.5:o<=5?5:10)*a,l=Math.floor(e/r)*r,s=Math.ceil(t/r)*r;s-t<.15*r&&(s+=r),e-l<.15*r&&(l-=r);for(var c=Math.max(0,-Math.floor(Math.log10(r)+1e-9)),d=[],u=l;u<=s+1e-6*r;)d.push(Number(u.toFixed(c))),u+=r;return{min:l,max:s,step:r,decimals:c,ticks:d}}((v=Math).min.apply(v,(0,E.Z)(l)),(g=Math).max.apply(g,(0,E.Z)(l)),5);d=f.min,u=f.max,p=f.ticks,m=f.decimals}if(I){var S={t:10,r:8,b:18,l:30},y=280-S.l-S.r,b=120-S.t-S.b,w=[d,(d+u)/2,u];return(0,a.tZ)("div",{className:"minis",children:x.map(function(t,n){var i=O(t,n,x.length),o=i?"Lap ".concat(t.lap," \xb7 ").concat(i):"Lap ".concat(t.lap),l=r.find(function(e){return e.lapNumber===t.lap}),s=l?l.points:[],c="";return s.forEach(function(e,t){var n=S.l+t/Math.max(1,s.length-1)*y,i=S.t+(u-e.val)/Math.max(.001,u-d)*b;c+=(0===t?"M ":" L ")+"".concat(n.toFixed(1)," ").concat(i.toFixed(1))}),(0,a.BX)("div",{className:"mini",children:[(0,a.tZ)("h3",{children:o}),(0,a.BX)("svg",{width:"100%",height:"auto",viewBox:"0 0 ".concat(280," ").concat(120),role:"img","aria-label":"Lap ".concat(t.lap),children:[w.map(function(e,n){var i=S.t+(u-e)/Math.max(.001,u-d)*b;return(0,a.BX)("g",{children:[(0,a.tZ)("line",{x1:S.l,x2:280-S.r,y1:i,y2:i,stroke:"#E5E7EB",strokeWidth:"1"}),(0,a.tZ)("text",{x:S.l-5,y:i+3,textAnchor:"end",fontSize:"9",fill:"#6B7280",fontFamily:"sans-serif",children:e.toFixed(m)})]},"mini-grid-".concat(t.lap,"-").concat(n))}),c&&(0,a.tZ)("path",{d:c,fill:"none",stroke:"#2563EB",strokeWidth:"2",strokeLinejoin:"round"})]})]},"mini-".concat(e,"-").concat(t.lap))})})}var T=function(e){return t.left+(e-1)/Math.max(1,c-1)*n},k=function(e){return t.top+i-(Math.max(d,Math.min(e,u))-d)/Math.max(.01,u-d)*i};r.forEach(function(e){e.points.forEach(function(e){e.x=T(e.stroke),e.y=k(e.val)})});for(var N=r.map(function(e){var t=e.points[e.points.length-1];return{lapNumber:e.lapNumber,color:e.color,x:t?t.x+8:0,y:t?t.y:0,adjustedY:t?t.y:0}}).sort(function(e,t){return e.y-t.y}),A=1;A<N.length;A++){var Z=N[A-1],C=N[A];70>Math.abs(C.x-Z.x)&&C.adjustedY-Z.adjustedY<12&&(C.adjustedY=Z.adjustedY+12)}for(var F=[],D=1;D<=c;D++)F.push(D);return(0,a.BX)("svg",{width:"100%",height:175,viewBox:"0 0 ".concat(840," ").concat(175),className:"vector-chart",children:[p.map(function(e){return(0,a.BX)("g",{children:[(0,a.tZ)("line",{x1:t.left,y1:k(e),x2:840-t.right,y2:k(e),stroke:"#E5E7EB",strokeWidth:"1"}),(0,a.tZ)("text",{x:t.left-8,y:k(e)+3.5,fontSize:"10",fill:"#6B7280",textAnchor:"end",fontFamily:"sans-serif",children:e.toFixed(m)})]},"y-".concat(e))}),(0,a.tZ)("text",{x:t.left-8,y:t.top-10,fontSize:"9",fill:"#6B7280",textAnchor:"end",fontFamily:"sans-serif",children:o?"".concat(s,"/cycle"):"sec/cycle"}),r.map(function(e){var t="";
1return e.points.forEach(function(e,n){t+=(0===n?"M ":" L ")+"".concat(e.x.toFixed(1)," ").concat(e.y.toFixed(1))}),(0,a.BX)("g",{children:[(0,a.tZ)("path",{d:t,fill:"none",stroke:e.color,strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"}),e.points.map(function(t,n){return(0,a.tZ)("circle",{cx:t.x,cy:t.y,r:"3.5",fill:e.color,stroke:"#FFFFFF",strokeWidth:"1.5"},"pt-".concat(e.lapNumber,"-").concat(n))})]},"lap-series-".concat(e.lapNumber))}),N.map(function(e){return(0,a.BX)("text",{x:e.x,y:e.adjustedY+3.5,fontSize:"10",fill:"#1F2937",fontWeight:"600",fontFamily:"sans-serif",children:["Lap ",e.lapNumber]},"lbl-lap-".concat(e.lapNumber))}),F.map(function(e){return(0,a.BX)("g",{children:[(0,a.tZ)("line",{x1:T(e),y1:t.top+i,x2:T(e),y2:t.top+i+4,stroke:"#D1D5DB",strokeWidth:"1"}),(1===e||e%2==0||c<=4)&&(0,a.tZ)("text",{x:T(e),y:t.top+i+16,fontSize:"10",fill:"#6B7280",textAnchor:"middle",fontFamily:"sans-serif",children:e})]},"x-stk-".concat(e))}),(0,a.tZ)("line",{x1:t.left,y1:t.top+i,x2:840-t.right,y2:t.top+i,stroke:"#D1D5DB",strokeWidth:"1"}),(0,a.tZ)("text",{x:t.left+n/2,y:171,fontSize:"9.5",fill:"#6B7280",textAnchor:"middle",fontFamily:"sans-serif",children:"stroke number"})]})};return(0,a.BX)("div",{className:"race-report-wrapper",children:[(0,a.tZ)("style",{children:'\n        .race-report-wrapper {\n          font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;\n          color: #111827;\n          background-color: #F3F4F6;\n          padding: 20px;\n        }\n\n        .report-page {\n          background: #FFFFFF;\n          max-width: 820px;\n          margin: 0 auto 20px auto;\n          padding: 26px 30px;\n          border-radius: 8px;\n          box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);\n          position: relative;\n          box-sizing: border-box;\n        }\n\n        .report-header-tag {\n          font-size: 10px;\n          font-weight: 700;\n          letter-spacing: 0.08em;\n          color: #6B7280;\n          text-transform: uppercase;\n          margin-bottom: 4px;\n        }\n\n        .report-main-title {\n          font-size: 20px;\n          font-weight: 800;\n          line-height: 1.25;\n          color: #111827;\n          margin: 0 0 2px 0;\n        }\n\n        .report-subtitle {\n          font-size: 11.5px;\n          color: #6B7280;\n          margin-bottom: 14px;\n        }\n\n        .stat-cards-grid {\n          display: grid;\n          grid-template-columns: repeat(5, 1fr);\n          gap: 8px;\n          margin-bottom: 12px;\n        }\n\n        .stat-card {\n          border: 1px solid #E5E7EB;\n          border-radius: 6px;\n          padding: 7px 9px;\n          background: #FFFFFF;\n          min-height: 72px;\n          display: flex;\n          flex-direction: column;\n          justifyContent: space-between;\n        }\n\n        .stat-card-label {\n          font-size: 9px;\n          color: #4B5563;\n          font-weight: 500;\n          line-height: 1.15;\n          margin-bottom: 2px;\n        }\n\n        .stat-card-value {\n          font-size: 17px;\n          font-weight: 800;\n          color: #111827;\n          line-height: 1.1;\n          margin-bottom: 2px;\n        }\n\n        .stat-card-subtext {\n          font-size: 8.5px;\n          color: #6B7280;\n          line-height: 1.2;\n        }\n\n        .report-section-card {\n          border: 1px solid #E5E7EB;\n          border-radius: 10px;\n          padding: 12px 16px;\n          margin-bottom: 12px;\n          background: #FFFFFF;\n        }\n\n        .report-section-title {\n          font-size: 14px;\n          font-weight: 700;\n          color: #111827;\n          margin: 0 0 2px 0;\n        }\n\n        .report-section-subtitle {\n          font-size: 11px;\n          color: #4B5563;\n          margin: 0 0 8px 0;\n        }\n\n        .legend-row {\n          display: flex;\n          align-items: center;\n          justifyContent: space-between;\n          font-size: 11px;\n          color: #374151;\n          margin-bottom: 8px;\n          flex-wrap: wrap;\n          gap: 8px;\n        }\n\n        .legend-items {\n          display: flex;\n          align-items: center;\n          gap: 10px;\n          flex-wrap: wrap;\n          flex: 1;\n        }\n\n        .legend-item {\n          display: inline-flex;\n          align-items: center;\n          gap: 5px;\n          font-weight: 500;\n          color: #374151;\n          font-size: 10px;\n        }\n\n        .legend-dash {\n          width: 12px;\n          height: 2.5px;\n          border-radius: 1px;\n          display: inline-block;\n        }\n\n        .legend-note {\n          font-size: 10px;\n          color: #6B7280;\n          white-space: nowrap;\n          margin-left: auto;\n        }\n\n        .minis {\n          display: grid;\n          grid-template-columns: repeat(3, 1fr);\n          gap: 8px 22px;\n        }\n\n        .mini {\n          min-width: 0;\n        }\n\n        .mini h3 {\n          font-size: 11.5px;\n          font-weight: 600;\n          color: #374151;\n          margin: 8px 0 2px 0;\n          white-space: nowrap;\n          overflow: hidden;\n          text-overflow: ellipsis;\n        }\n\n        .report-table {\n          width: 100%;\n          border-collapse: collapse;\n          font-size: 9.5px;\n          margin-top: 8px;\n        }\n\n        .report-table th {\n          border-bottom: 1.5px solid #D1D5DB;\n          padding: 4px 3px;\n          text-align: right;\n          color: #374151;\n          font-weight: 700;\n          font-size: 9px;\n          line-height: 1.15;\n        }\n\n        .report-table th:first-child {\n          text-align: left;\n        }\n\n        .report-table td {\n          border-bottom: 1px solid #F3F4F6;\n          padding: 3.5px 3px;\n          text-align: right;\n          color: #1F2937;\n        }\n\n        .report-table td:first-child {\n          text-align: left;\n          font-weight: 600;\n        }\n\n        .report-footnotes {\n          font-size: 8.5px;\n          color: #6B7280;\n          line-height: 1.35;\n          margin-top: 8px;\n        }\n\n        .narrative-heading {\n          font-size: 15px;\n          font-weight: 800;\n          color: #111827;\n          margin: 0 0 10px 0;\n        }\n\n        .narrative-subheading {\n          font-size: 12px;\n          font-weight: 700;\n          color: #111827;\n          margin: 12px 0 4px 0;\n        }\n\n        .narrative-paragraph {\n          font-size: 11px;\n          line-height: 1.5;\n          color: #374151;\n          margin: 0 0 8px 0;\n        }\n\n        .callout-box {\n          border-left: 3px solid #0EA5E9;\n          background: #F0F9FF;\n          padding: 10px 14px;\n          margin: 12px 0;\n          border-radius: 0 6px 6px 0;\n          font-size: 11px;\n          line-height: 1.45;\n          color: #0369A1;\n          font-weight: 500;\n        }\n\n        .action-point-title {\n          font-size: 11px;\n          font-weight: 800;\n          color: #111827;\n          display: inline;\n        }\n\n        .action-point-text {\n          font-size: 11px;\n          line-height: 1.5;\n          color: #374151;\n          display: inline;\n        }\n\n        .ai-feedback-container {\n          background: #F8FAFC;\n          border: 1px solid #E2E8F0;\n          border-left: 4px solid #2563EB;\n          border-radius: 6px;\n          padding: 12px 16px;\n          margin-bottom: 16px;\n        }\n\n        .ai-feedback-badge {\n          display: inline-block;\n          font-size: 9.5px;\n          font-weight: 700;\n          letter-spacing: 0.05em;\n          text-transform: uppercase;\n          color: #1D4ED8;\n          background: #EFF6FF;\n          border: 1px solid #DBEAFE;\n          padding: 2px 8px;\n          border-radius: 4px;\n          margin-bottom: 8px;\n        }\n\n        .ai-feedback-markdown {\n          font-size: 11px;\n          line-height: 1.55;\n          color: #374151;\n        }\n\n        .ai-feedback-markdown h1,\n        .ai-feedback-markdown h2,\n        .ai-feedback-markdown h3 {\n          font-size: 11.5px;\n          font-weight: 700;\n          color: #111827;\n          margin: 8px 0 3px 0;\n        }\n\n        .ai-feedback-markdown p {\n          margin: 0 0 6px 0;\n        }\n\n        .ai-feedback-markdown ul,\n        .ai-feedback-markdown ol {\n          margin: 4px 0 8px 16px;\n          padding: 0;\n        }\n\n        .ai-feedback-markdown li {\n          margin-bottom: 3px;\n        }\n\n        .page-footer {\n          margin-top: 14px;\n          padding-top: 6px;\n          border-top: 1px solid #F3F4F6;\n          font-size: 8.5px;\n          color: #9CA3AF;\n          text-align: right;\n        }\n\n        @media print {\n          @page {\n            size: A4 portrait;\n            margin: 8mm 10mm 8mm 10mm;\n          }\n\n          html, body {\n            background: #FFFFFF !important;\n            margin: 0 !important;\n            padding: 0 !important;\n            -webkit-print-color-adjust: exact !important;\n            print-color-adjust: exact !important;\n          }\n\n          .race-report-wrapper {\n            background: #FFFFFF !important;\n            padding: 0 !important;\n            margin: 0 !important;\n            width: 100% !important;\n          }\n\n          .report-page {\n            box-shadow: none !important;\n            border-radius: 0 !important;\n            margin: 0 !important;\n            padding: 0 !important;\n            page-break-after: always !important;\n            page-break-inside: avoid !important;\n            break-after: page !important;\n            break-inside: avoid !important;\n            width: 100% !important;\n            max-width: 100% !important;\n            box-sizing: border-box !important;\n          }\n\n          .report-page:last-child {\n            page-break-after: auto !important;\n            break-after: auto !important;\n          }\n\n          .minis {\n            display: grid !important;\n            grid-template-columns: repeat(3, 1fr) !important;\n            gap: 8px 22px !important;\n          }\n        }\n      '}),(0,a.BX)("div",{className:"report-page",children:[(0,a.BX)("div",{className:"report-header-tag",children:["RACE REPORT \xb7 ",i.toUpperCase()]}),(0,a.BX)("h1",{className:"report-main-title",children:[n," — ",l," ",o,", ",r]}),(0,a.tZ)("div",{className:"report-subtitle",children:d}),(0,a.BX)("div",{className:"stat-cards-grid",children:[(0,a.BX)("div",{className:"stat-card",children:[(0,a.tZ)("div",{className:"stat-card-label",children:"Final time"}),(0,a.tZ)("div",{className:"stat-card-value",children:u}),(0,a.tZ)("div",{className:"stat-card-subtext",children:p})]}),(0,a.BX)("div",{className:"stat-card",children:[(0,a.tZ)("div",{className:"stat-card-label",children:"Average swim velocity"}),(0,a.tZ)("div",{className:"stat-card-value",children:m}),(0,a.tZ)("div",{className:"stat-card-subtext",children:h})]}),(0,a.BX)("div",{className:"stat-card",children:[(0,a.tZ)("div",{className:"stat-card-label",children:"Total strokes"}),(0,a.tZ)("div",{className:"stat-card-value",children:v}),(0,a.tZ)("div",{className:"stat-card-subtext",children:g})]}),(0,a.BX)("div",{className:"stat-card",children:[(0,a.tZ)("div",{className:"stat-card-label",children:"Peak pullout speed"}),(0,a.tZ)("div",{className:"stat-card-value",children:f}),(0,a.tZ)("div",{className:"stat-card-subtext",children:S})]}),(0,a.BX)("div",{className:"stat-card",children:[(0,a.tZ)("div",{className:"stat-card-label",children:"Back-half fade"}),(0,a.tZ)("div",{className:"stat-card-value",children:y}),(0,a.tZ)("div",{className:"stat-card-subtext",children:b})]})]}),(0,a.BX)("div",{className:"report-section-card",style:{marginBottom:I?0:12},children:[(0,a.tZ)("h2",{className:"report-section-title",children:"Velocity through the race"}),(0,a.BX)("div",{className:"report-section-subtitle",children:["Speed of every phase — each pullout and every stroke cycle — across all ",k," ","y"===s?"yards":"meters",". Shaded bands are the underwater pullout phases."]}),function(){var e,n,i={top:26,right:35,bottom:28,left:45},o=840-i.left-i.right,l=185-i.top-i.bottom,d=k>0?k/(x.length||1):r.includes("Long")?50:25,u=k>0?k:x.length*d,p=.5,m=2.5,h=[];
1if(x.forEach(function(e){e.swimVelocity>0&&h.push(e.swimVelocity),e.uwVelocity>0&&h.push(e.uwVelocity)}),_.forEach(function(e){e.uwVelocity>0&&h.push(e.uwVelocity),e.strokePhases.forEach(function(e){e.velocity>0&&h.push(e.velocity)})}),h.length>0){var v,g,f=(v=Math).min.apply(v,(0,E.Z)(h)),S=(g=Math).max.apply(g,(0,E.Z)(h));m=Math.max((p=Math.max(0,Math.floor((f-.1)*10)/10))+.4,Math.ceil((S+.1)*10)/10)}for(var y=function(e){return i.left+Math.max(0,Math.min(e,u))/u*o},b=function(e){return i.top+l-(Math.max(p,Math.min(e,m))-p)/(m-p)*l},N=[],A=p;A<=m+.05;A+=.2)N.push(Number(A.toFixed(1)));for(var Z=u<=50?25:u<=100?25:u<=200?50:u<=400?100:25*Math.ceil(u/8/25),C=[],I=0;I<=u;I+=Z)C.push(I);var O=[];x.forEach(function(e,t){var n=t*d,i=(t+1)*d,a=_[t],o=n+Math.min(e.breakoutDistance>0?e.breakoutDistance:0,d>2?d-1:d),r=e.uwVelocity>0?e.uwVelocity:e.swimVelocity;if(o>n&&r>0&&(O.push({x:y(n),y:b(r)}),O.push({x:y(o),y:b(r)})),a&&a.strokePhases.length>0){var l=(i-o)/a.strokePhases.length;a.strokePhases.forEach(function(t,n){var i=t.velocity>0?t.velocity:e.swimVelocity;O.push({x:y(o+n*l),y:b(i)}),O.push({x:y(o+(n+1)*l),y:b(i)})})}else{var s=e.swimVelocity;O.push({x:y(o>n?o:n),y:b(s)}),O.push({x:y(i),y:b(s)})}});var F="";O.forEach(function(e,t){F+=(0===t?"M ":" L ")+"".concat(e.x.toFixed(1)," ").concat(e.y.toFixed(1))});var D=t.peakPulloutSpeed,R=x.findIndex(function(e){return .01>Math.abs(e.uwVelocity-D)}),L=R>=0?R:0,M=x[L],B=y(L*d+(M&&M.breakoutDistance>0?.5*M.breakoutDistance:.2*d)),P=b(D);return(0,a.BX)("svg",{width:"100%",height:185,viewBox:"0 0 ".concat(840," ").concat(185),className:"vector-chart",children:[(0,a.tZ)("defs",{children:(0,a.BX)("linearGradient",{id:"uwGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,a.tZ)("stop",{offset:"0%",stopColor:"#0284C7",stopOpacity:"0.16"}),(0,a.tZ)("stop",{offset:"100%",stopColor:"#0284C7",stopOpacity:"0.06"})]})}),N.map(function(e){return(0,a.BX)("g",{children:[(0,a.tZ)("line",{x1:i.left,y1:b(e),x2:840-i.right,y2:b(e),stroke:"#E5E7EB",strokeDasharray:"2,2"}),(0,a.tZ)("text",{x:i.left-8,y:b(e)+4,fontSize:"10",fill:"#6B7280",textAnchor:"end",fontFamily:"sans-serif",children:e.toFixed(1)})]},"y-".concat(e))}),(0,a.tZ)("text",{x:i.left-26,y:i.top-12,fontSize:"10",fill:"#6B7280",fontFamily:"sans-serif",children:c}),x.map(function(e,t){var n=t*d,o=e.breakoutDistance>0?e.breakoutDistance:0,r=y(n),s=y(n+Math.min(o,.6*d)),c=y((t+1)*d),u=w.find(function(t){return t.startLap<=e.lap&&t.endLap>=e.lap}),p=T&&u&&u.startLap===e.lap;return(0,a.BX)("g",{children:[(0,a.tZ)("rect",{x:r,y:i.top,width:Math.max(1,s-r),height:l,fill:"url(#uwGradient)"}),0===t&&o>0&&s-r>=16&&(0,a.tZ)("text",{x:r+(s-r)/2,y:i.top+l-8,fontSize:"9",fill:"#0369A1",textAnchor:"middle",fontFamily:"sans-serif",fontWeight:"500",children:"Pullout"}),(0,a.tZ)("line",{x1:c,y1:i.top,x2:c,y2:i.top+l,stroke:"#D1D5DB",strokeWidth:"1"}),!T&&(0,a.BX)("g",{children:[(0,a.BX)("text",{x:r+(c-r)/2,y:i.top-16,fontSize:"10",fill:"#1F2937",fontWeight:"600",textAnchor:"middle",fontFamily:"sans-serif",children:["Lap ",e.lap]}),(0,a.tZ)("text",{x:r+(c-r)/2,y:i.top-4,fontSize:"9",fill:"#6B7280",textAnchor:"middle",fontFamily:"sans-serif",children:e.split.toFixed(2)})]}),p&&(0,a.BX)("g",{children:[(0,a.tZ)("text",{x:r+(y((t+(u.endLap-u.startLap+1))*d)-r)/2,y:i.top-16,fontSize:"10",fill:"#1F2937",fontWeight:"700",textAnchor:"middle",fontFamily:"sans-serif",children:u.stroke}),(0,a.BX)("text",{x:r+(y((t+(u.endLap-u.startLap+1))*d)-r)/2,y:i.top-4,fontSize:"9",fill:"#6B7280",textAnchor:"middle",fontFamily:"sans-serif",children:["Lap ",u.startLap,"–",u.endLap]})]})]},"lap-band-".concat(t))}),(0,a.tZ)("path",{d:F,fill:"none",stroke:"#2563EB",strokeWidth:"2",strokeLinejoin:"round"}),D>0&&(n=(e=B+47+54>840-i.right)?B-47-54:B+47,(0,a.BX)("g",{children:[(0,a.tZ)("line",{x1:i.left,y1:P,x2:e?B-45:B+45,y2:P,stroke:"#1E40AF",strokeWidth:"1"}),(0,a.tZ)("rect",{x:n,y:P-9,width:54,height:"18",fill:"#FFFFFF",stroke:"#93C5FD",strokeWidth:"1",rx:"2"}),(0,a.BX)("text",{x:n+27,y:P+4,fontSize:"9.5",fill:"#1E3A8A",fontWeight:"600",textAnchor:"middle",fontFamily:"sans-serif",children:[D.toFixed(2)," ",c]})]})),C.map(function(e){return(0,a.BX)("g",{children:[(0,a.tZ)("line",{x1:y(e),y1:i.top+l,x2:y(e),y2:i.top+l+5,stroke:"#6B7280"}),(0,a.BX)("text",{x:y(e),y:i.top+l+17,fontSize:"10",fill:"#6B7280",textAnchor:"middle",fontFamily:"sans-serif",children:[e,s]})]},"x-".concat(e))}),(0,a.tZ)("line",{x1:i.left,y1:i.top+l,x2:840-i.right,y2:i.top+l,stroke:"#6B7280",strokeWidth:"1"})]})}()]}),!I&&(0,a.BX)("div",{className:"report-section-card",style:{marginBottom:0},children:[(0,a.tZ)("h2",{className:"report-section-title",children:"Distance per cycle, stroke by stroke"}),(0,a.tZ)("div",{className:"report-section-subtitle",children:"How far each stroke cycle travels, for every stroke of each lap. Longer is better."}),(0,a.BX)("div",{className:"legend-row",children:[(0,a.tZ)("div",{className:"legend-items",children:x.map(function(e,t){return(0,a.BX)("span",{className:"legend-item",children:[(0,a.tZ)("span",{className:"legend-dash",style:{background:eM[t%eM.length]}}),"Lap ",e.lap]},"leg-dpc-".concat(t))})}),(0,a.tZ)("span",{className:"legend-note",children:"longer = better"})]}),F("dpc")]}),(0,a.tZ)("div",{className:"page-footer",children:A})]}),I&&(0,a.BX)("div",{className:"report-page",children:[(0,a.BX)("div",{className:"report-section-card",style:{marginBottom:0},children:[(0,a.tZ)("h2",{className:"report-section-title",children:"Distance per cycle, stroke by stroke"}),(0,a.tZ)("div",{className:"report-section-subtitle",children:"How far each stroke cycle travels, for every stroke of each lap. Longer is better."}),(0,a.tZ)("div",{style:{color:"#6B7280",fontSize:"10.5px",marginBottom:"8px"},children:"longer = better"}),F("dpc")]}),(0,a.tZ)("div",{className:"page-footer",children:A})]}),I&&(0,a.BX)("div",{className:"report-page",children:[(0,a.BX)("div",{className:"report-section-card",style:{marginBottom:0},children:[(0,a.tZ)("h2",{className:"report-section-title",children:"Tempo, stroke by stroke"}),(0,a.tZ)("div",{className:"report-section-subtitle",children:"Seconds per stroke cycle — lower means faster turnover."}),(0,a.tZ)("div",{style:{color:"#6B7280",fontSize:"10.5px",marginBottom:"8px"},children:"lower = faster turnover"}),F("tempo")]}),(0,a.tZ)("div",{className:"page-footer",children:A})]}),(0,a.BX)("div",{className:"report-page",children:[!I&&(0,a.BX)("div",{className:"report-section-card",children:[(0,a.tZ)("h2",{className:"report-section-title",children:"Tempo, stroke by stroke"}),(0,a.tZ)("div",{className:"report-section-subtitle",children:"Seconds per stroke cycle — lower means faster turnover."}),(0,a.BX)("div",{className:"legend-row",children:[(0,a.tZ)("div",{className:"legend-items",children:x.map(function(e,t){return(0,a.BX)("span",{className:"legend-item",children:[(0,a.tZ)("span",{className:"legend-dash",style:{background:eM[t%eM.length]}}),"Lap ",e.lap]},"leg-tmp-".concat(t))})}),(0,a.tZ)("span",{className:"legend-note",children:"lower = faster turnover"})]}),F("tempo")]}),(0,a.BX)("div",{className:"report-section-card",style:{marginBottom:0},children:[(0,a.tZ)("h2",{className:"report-section-title",children:"Lap-by-lap comparison"}),(0,a.tZ)("div",{className:"report-section-subtitle",children:"The shape of the race in six measures."}),(0,a.tZ)("div",{className:"legend-items",style:{marginBottom:"8px"},children:x.map(function(e,t){return(0,a.BX)("span",{className:"legend-item",children:[(0,a.tZ)("span",{className:"legend-dash",style:{background:eM[t%eM.length]}}),"Lap ",e.lap]},"leg-bar-".concat(t))})}),(0,a.tZ)("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"16px 20px",marginTop:"14px"},children:[{key:"split",title:"Split (s)",val:function(e){return e.split},format:function(e){return e.toFixed(2)},unit:"s"},{key:"strokeCount",title:"Stroke count",val:function(e){return e.strokeCount},format:function(e){return"".concat(e)},unit:""},{key:"avgDpc",title:"Avg distance per cycle (".concat(s,")"),val:function(e){return e.avgDpc},format:function(e){return e.toFixed(2)},unit:s},{key:"avgTempo",title:"Avg tempo (s/cycle)",val:function(e){return e.avgTempo},format:function(e){return e.toFixed(2)},unit:"s"},{key:"breakoutDistance",title:"Breakout distance (".concat(s,")"),val:function(e){return e.breakoutDistance},format:function(e){return e.toFixed(1)},unit:s},{key:"uwVelocity",title:"Underwater velocity (".concat(c,")"),val:function(e){return e.uwVelocity},format:function(e){return e.toFixed(2)},unit:c}].map(function(e){var t,n=x.map(function(t){return e.val(t)}),i=(t=Math).max.apply(t,(0,E.Z)(n).concat([1])),o=Math.min(22,224/x.length*.7),r=224/x.length;return(0,a.BX)("div",{style:{background:"#FAFAFA",borderRadius:"6px",padding:"6px 10px"},children:[(0,a.tZ)("div",{style:{fontSize:"10.5px",fontWeight:"700",color:"#1F2937",marginBottom:"4px"},children:e.title}),(0,a.BX)("svg",{width:"100%",height:100,viewBox:"0 0 ".concat(240," ").concat(100),children:[x.map(function(t,n){var l=e.val(t),s=l/i*66,c=8+n*r+(r-o)/2,d=82-s,u=eM[n%eM.length];return(0,a.BX)("g",{children:[(0,a.tZ)("text",{x:c+o/2,y:Math.max(10,d-3),fontSize:x.length>8?"6.5":"8",fill:"#111827",fontWeight:"600",textAnchor:"middle",fontFamily:"sans-serif",children:e.format(l)}
1),(0,a.tZ)("rect",{x:c,y:d,width:o,height:Math.max(2,s),fill:u,rx:"1.5"}),(0,a.BX)("text",{x:c+o/2,y:93,fontSize:x.length>8?"6":"7.5",fill:"#6B7280",textAnchor:"middle",fontFamily:"sans-serif",children:["L",t.lap]})]},"bar-".concat(e.key,"-").concat(n))}),(0,a.tZ)("line",{x1:8,y1:82,x2:232,y2:82,stroke:"#E5E7EB"})]})]},e.key)})}),(0,a.BX)("table",{className:"report-table",children:[(0,a.tZ)("thead",{children:(0,a.BX)("tr",{children:[(0,a.tZ)("th",{children:"Lap"}),(0,a.tZ)("th",{children:"Split"}),(0,a.BX)("th",{children:["Velocity (",c,")"]}),(0,a.tZ)("th",{children:"Strokes"}),(0,a.tZ)("th",{children:"Avg tempo (s)"}),(0,a.BX)("th",{children:["Avg DPC (",s,")"]}),(0,a.BX)("th",{children:["Breakout (",s,")"]}),(0,a.tZ)("th",{children:"Breakout split (s)"}),(0,a.BX)("th",{children:["UW velocity (",c,")"]}),(0,a.tZ)("th",{children:"15m split (s)"}),(0,a.tZ)("th",{children:"Turn/finish (s)"})]})}),(0,a.tZ)("tbody",{children:x.map(function(e,t){return(0,a.BX)("tr",{children:[(0,a.BX)("td",{children:["Lap ",e.lap]}),(0,a.tZ)("td",{children:e.split.toFixed(2)}),(0,a.tZ)("td",{children:e.swimVelocity.toFixed(2)}),(0,a.tZ)("td",{children:e.strokeCount}),(0,a.tZ)("td",{children:e.avgTempo.toFixed(2)}),(0,a.tZ)("td",{children:e.avgDpc.toFixed(2)}),(0,a.tZ)("td",{children:e.breakoutDistance.toFixed(2)}),(0,a.tZ)("td",{children:e.breakoutSplit.toFixed(2)}),(0,a.tZ)("td",{children:e.uwVelocity.toFixed(2)}),(0,a.tZ)("td",{children:e.fifteenMeterSplit.toFixed(2)}),(0,a.tZ)("td",{children:e.turnOrFinishTime.toFixed(2)})]},"tr-".concat(t))})})]}),(0,a.tZ)("div",{className:"report-footnotes",children:N})]}),(0,a.tZ)("div",{className:"page-footer",children:A})]}),(0,a.BX)("div",{className:"report-page",children:[(0,a.tZ)("h2",{className:"narrative-heading",children:"What the data says about this race"}),(0,a.tZ)("div",{className:"narrative-subheading",children:Z.shapeTitle}),(0,a.tZ)("p",{className:"narrative-paragraph",children:Z.shapeParagraph}),Z.noteParagraph&&(0,a.tZ)("p",{className:"narrative-paragraph",style:{color:"#6B7280",fontSize:"11.5px"},children:Z.noteParagraph}),(0,a.tZ)("div",{className:"narrative-subheading",children:Z.subheading1}),(0,a.tZ)("p",{className:"narrative-paragraph",children:Z.paragraph1}),Z.paragraph1Extra&&(0,a.tZ)("p",{className:"narrative-paragraph",children:Z.paragraph1Extra}),(0,a.tZ)("div",{className:"narrative-subheading",children:Z.subheading2}),(0,a.tZ)("p",{className:"narrative-paragraph",children:Z.paragraph2}),Z.paragraph2Extra&&(0,a.tZ)("p",{className:"narrative-paragraph",children:Z.paragraph2Extra}),(0,a.tZ)("div",{className:"narrative-subheading",children:Z.strokeSubheading}),(0,a.tZ)("p",{className:"narrative-paragraph",children:Z.strokeParagraph}),Z.wallParagraph&&(0,a.tZ)("p",{className:"narrative-paragraph",children:Z.wallParagraph}),(0,a.tZ)("div",{className:"callout-box",children:Z.highlightQuote}),(0,a.tZ)("div",{style:{marginTop:"16px"},children:Z.actionPoints.map(function(e,t){return(0,a.BX)("div",{style:{marginBottom:"12px"},children:[(0,a.BX)("div",{className:"action-point-title",children:[e.title," "]}),(0,a.tZ)("div",{className:"action-point-text",children:e.text})]},"ap-".concat(t))})}),(0,a.tZ)("div",{className:"page-footer",children:A})]})]})},eP=(0,p.Z)(function(e){return{dialogPaper:{backgroundColor:"#F3F4F6",borderRadius:"12px",maxWidth:"960px !important",width:"100%",margin:e.spacing(2),maxHeight:"92vh",display:"flex",flexDirection:"column","@media print":{backgroundColor:"#FFFFFF",margin:0,maxWidth:"100% !important",width:"100%",maxHeight:"none",overflow:"visible",boxShadow:"none",borderRadius:0}},dialogTitle:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"".concat(e.spacing(1.5)," ").concat(e.spacing(3)),borderBottom:"1px solid #E5E7EB",backgroundColor:"#FFFFFF","@media print":{display:"none !important"}},dialogContent:{padding:"0 !important",overflowY:"auto",backgroundColor:"#F3F4F6","@media print":{backgroundColor:"#FFFFFF",overflow:"visible",padding:"0 !important"}},actionGroup:{display:"flex",alignItems:"center",gap:e.spacing(1.5)}}}),eG=function(e){var t,n=e.open,o=e.onClose,r=e.reportData,l=eP(),s=(0,S.Z)(),c=(0,y.Z)(s.breakpoints.down("sm")),p=(0,d.Z)((0,h.useState)(null),2),m=p[0],v=p[1],g=(0,d.Z)((0,h.useState)(!1),2),f=g[0],E=g[1],b=(0,d.Z)((0,h.useState)(null),2),x=b[0],_=b[1],w=(0,d.Z)((0,h.useState)(null),2),T=w[0],N=w[1],A=(0,h.useCallback)((t=(0,ee.Z)(function(e){var t,n,i,a,o,r,l,s,c,d,u,p,m,h,g,f,S;return(0,et.__generator)(this,function(y){switch(y.label){case 0:if(!e)return[2];E(!0),N(null),y.label=1;case 1:return y.trys.push([1,9,10,11]),[4,fetch("/api/race-report-ai",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({swimmerName:e.swimmerName,eventName:e.eventName,event:e.event,poolType:e.poolType,raceLength:e.raceLength,unit:e.unit,velUnit:e.velUnit,finalTimeFormatted:e.finalTimeFormatted,splitsSummaryStr:e.splitsSummaryStr,avgSwimVelocityStr:e.avgSwimVelocityStr,totalStrokes:e.totalStrokes,peakPulloutSpeedStr:e.peakPulloutSpeedStr,backHalfFadeStr:e.backHalfFadeStr,backHalfFade:e.backHalfFade,laps:e.laps,fallbackNarrative:e.narrative})})];case 2:if(!(t=y.sent()).ok)throw Error("HTTP ".concat(t.status));if(n=null,!((t.headers.get("content-type")||"").includes("text/event-stream")&&t.body))return[3,6];i=t.body.getReader(),a=new TextDecoder,o="",y.label=3;case 3:return[4,i.read()];case 4:if(l=(r=y.sent()).done,s=r.value,l)return[3,5];o+=a.decode(s,{stream:!0}),o=(c=o.split("\n")).pop()||"",d=!0,u=!1,p=void 0;try{for(m=c[Symbol.iterator]();!(d=(h=m.next()).done);d=!0)if((g=h.value.trim()).startsWith("data: "))try{f=JSON.parse(g.slice(6)),("done"===f.type||void 0!==f.success)&&(n=f)}catch(b){}}catch(x){u=!0,p=x}finally{try{d||null==m.return||m.return()}finally{if(u)throw p}
1}return[3,3];case 5:return[3,8];case 6:return[4,t.json()];case 7:n=y.sent(),y.label=8;case 8:return n&&n.success&&n.narrative&&n.model?(v(n.narrative),_(n.model)):N((null==n?void 0:n.message)||"AI model response incomplete"),[3,11];case 9:return console.warn("[RaceReportModal] Could not fetch AI narrative from model:",S=y.sent()),N((null==S?void 0:S.message)||"AI model connection unavailable"),[3,11];case 10:return E(!1),[7];case 11:return[2]}})}),function(e){return t.apply(this,arguments)}),[]);(0,h.useEffect)(function(){n&&r&&(v(null),_(null),N(null),A(r))},[n,r,A]);var Z=(0,h.useMemo)(function(){return r?m?(0,eN.Z)((0,i.Z)({},r),{narrative:(0,i.Z)({},r.narrative,m)}):r:null},[r,m]);return Z?(0,a.BX)(eA.Z,{open:n,onClose:o,fullScreen:c,maxWidth:"md",fullWidth:!0,PaperProps:{className:l.dialogPaper},children:[(0,a.BX)(eZ.Z,{className:l.dialogTitle,children:[(0,a.BX)(u.Z,{display:"flex",flexDirection:"column",children:[(0,a.BX)(u.Z,{display:"flex",alignItems:"center",gap:1.5,children:[(0,a.tZ)(M.Z,{variant:"h5",style:{fontWeight:700,color:"#111827"},children:"Race Report Preview"}),f&&(0,a.tZ)(eC.Z,{icon:(0,a.tZ)(em.Z,{size:12,color:"inherit"}),label:"Analyzing with local model...",size:"small",style:{backgroundColor:"#EFF6FF",color:"#1D4ED8",border:"1px solid #BFDBFE",fontSize:"11px",fontWeight:600}}),!f&&x&&(0,a.BX)(u.Z,{display:"flex",alignItems:"center",gap:.5,children:[(0,a.tZ)(eC.Z,{icon:(0,a.tZ)(eD.Z,{size:12,style:{color:"#059669"}}),label:"Local Model: ".concat(x),size:"small",style:{backgroundColor:"#ECFDF5",color:"#065F46",border:"1px solid #A7F3D0",fontSize:"11px",fontWeight:600}}),(0,a.tZ)(k.Z,{title:"Regenerate analysis with local model",children:(0,a.tZ)(eI.Z,{size:"small",onClick:function(){return A(r)},style:{color:"#4B5563",padding:4},children:(0,a.tZ)(eR.Z,{size:13})})})]}),!f&&T&&(0,a.tZ)(k.Z,{title:"Local model notice: ".concat(T,". Using built-in GoSwim analytics."),children:(0,a.BX)(u.Z,{display:"flex",alignItems:"center",gap:.5,children:[(0,a.tZ)(eC.Z,{label:"GoSwim Analytics Active",size:"small",style:{backgroundColor:"#F3F4F6",color:"#4B5563",border:"1px solid #E5E7EB",fontSize:"11px"}}),(0,a.tZ)(eI.Z,{size:"small",onClick:function(){return A(r)},style:{color:"#4B5563",padding:4},children:(0,a.tZ)(eR.Z,{size:13})})]})})]}),(0,a.BX)(M.Z,{variant:"caption",style:{color:"#6B7280"},children:[Z.swimmerName," — ",Z.raceLength," ",Z.event]})]}),(0,a.BX)(u.Z,{className:l.actionGroup,children:[(0,a.tZ)(q.Z,{variant:"contained",color:"primary",size:"medium",startIcon:(0,a.tZ)(eL.Z,{size:16}),onClick:function(){window.print()},children:"Export / Save as PDF"}),(0,a.tZ)(eI.Z,{onClick:o,size:"medium",style:{color:"#6B7280"},children:(0,a.tZ)(eF.Z,{})})]})]}),(0,a.tZ)(eO.Z,{className:l.dialogContent,children:(0,a.tZ)(eB,{reportData:Z})})]}):null},eU=function(e){return 1.09361*e};function eV(e){if(isNaN(e)||e<=0)return"0.00";if(e<60)return e.toFixed(2);var t=(e%60).toFixed(2),n=10>Number(t)?"0".concat(t):t;return"".concat(Math.floor(e/60),":").concat(n)}function eW(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(null==e||""===e||"N/A"===e)return t;var n=parseFloat(String(e).replace(/[^0-9.-]/g,""));return isNaN(n)?t:n}var ez=n(83454),eX=(0,p.Z)(function(e){var t,n;return{root:{overflow:"hidden","@global":{".MuiSvgIcon-colorSecondary":{color:e.palette.secondary.main},".MuiTableCell-root":{borderBottom:"none"}}},rootCard:(t={},(0,f.Z)(t,e.breakpoints.up("sm"),{margin:e.spacing(2)}),(0,f.Z)(t,e.breakpoints.down("sm"),{margin:e.spacing(0),padding:e.spacing(0)}),(0,f.Z)(t,"padding",e.spacing(2)),(0,f.Z)(t,"paddingTop",e.spacing(1)),(0,f.Z)(t,"maxHeight","100%"),(0,f.Z)(t,"overflow","auto"),(0,f.Z)(t,"borderRadius",e.spacing(1)),(0,f.Z)(t,"backgroundImage","none"),t),player:(n={margin:e.spacing(2)},(0,f.Z)(n,e.breakpoints.up("sm"),{marginRight:0}),(0,f.Z)(n,e.breakpoints.down("sm"),{margin:e.spacing(1)}),n),playerWrapper:(0,f.Z)({},e.breakpoints.down("sm"),{margin:e.spacing(1)}),gallaryTableSection:(0,f.Z)({margin:e.spacing(2)},e.breakpoints.down("sm"),{margin:"".concat(e.spacing(2)," ").concat(e.spacing(1))}),fullHeightCard:{backgroundColor:e.palette.background.paper,boxShadow:"0 4px 24px 0 rgb(34 41 47 / 10%)","& .MuiBox-root":{padding:0}},selectSwimmer:(0,f.Z)({margin:e.spacing(2)},e.breakpoints.down("sm"),{flexDirection:"column",alignItems:"flex-start"}),swimmerSelectFormControl:(0,f.Z)({minWidth:"200px"},e.breakpoints.down("sm"),{marginBottom:e.spacing(2)}),responsiveTable:{overflowX:"auto",position:"relative"},lockedTableBody:{filter:"blur(5px)",userSelect:"none",pointerEvents:"none"},lockOverlay:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",zIndex:10,gap:e.spacing(1),backgroundColor:"rgba(0, 0, 0, 0.22)",backdropFilter:"blur(3px)",borderRadius:e.spacing(.5)},lockIcon:{color:"dark"===e.palette.mode?e.palette.common.white:e.palette.text.primary,opacity:.9},tableHead:{"& .MuiTableRow-head":{background:e.palette.primary.main},"& .MuiTableCell-root":{color:e.palette.common.white,textAlign:"center"}},tableBody:{"& .MuiTableCell-root":{textAlign:"center"}},wrapText:{whiteSpace:"nowrap"},spanText:(0,i.Z)({},(0,i.Z)({},ek.Z.body3)),columnOne:(0,i.Z)({},(0,i.Z)({},ek.Z.h6))}}),eH=function(e){var t,n,i,o,r,p,v,g,f,L,M,B,P,G,U=eX(),V=(0,m.useRouter)(),z=(0,S.Z)(),j=(0,l.v9)(function(e){return{videoDetail:e.userVideos.videoDetail,isLoading:e.userVideos.isLoading,user:e.account.user,feedbackSummaryDetail:e.openAI.feedbackSummaryDetail}}),K=j.isLoading,Q=j.videoDetail,J=j.user,$=j.feedbackSummaryDetail,ee=(null==J?void 0:J.isChinaUser)&&!(null==J?void 0:J.sales_rep_id)&&
1(null==J?void 0:null===(t=J.subscription)||void 0===t?void 0:t.product_name)==="Free",et=V.asPath.includes("annotationVideo"),en=(null==Q?void 0:null===(n=Q.race)||void 0===n?void 0:n.pool_length)==="SCY",ei=null==Q?void 0:null===(i=Q.race)||void 0===i?void 0:null===(o=i.summary)||void 0===o?void 0:null===(r=o.swimmer)||void 0===r?void 0:r.length,ea=null==Q?void 0:null===(p=Q.race)||void 0===p?void 0:p.summary,eo=(0,y.Z)(z.breakpoints.down("lg")),er=(0,y.Z)(z.breakpoints.up("lg")),el=!(null==Q?void 0:Q.videoUrl)&&ee,es=(0,d.Z)((0,h.useState)(!1),2),ec=es[0],ed=es[1],eu="true"===ez.env.NEXT_PUBLIC_ENABLE_REPORT_FOR_ALL,em=(null==J?void 0:J.role)===s.Qm.ADMIN,eh=em||Boolean(eu||em),ev=(0,h.useMemo)(function(){return!!e.tableBodyData&&0!==e.tableBodyData.length&&e.tableBodyData.some(function(e){var t=parseFloat(String((null==e?void 0:e.stroke_count)||0))||0,n=parseFloat(String((null==e?void 0:e.tempo)||0))||0,i=parseFloat(String((null==e?void 0:e.distance_per_cycle_m)||0))||0;return t>0||n>0||i>0})},[e.tableBodyData]),eg=e.selectedSwimmerId||(null==Q?void 0:null===(v=Q.race)||void 0===v?void 0:null===(g=v.summary)||void 0===g?void 0:null===(f=g.swimmer)||void 0===f?void 0:null===(L=f[e.activeSwimmerIndex])||void 0===L?void 0:L.swimmer_id)||(null==Q?void 0:null===(M=Q.race)||void 0===M?void 0:null===(B=M.summary)||void 0===B?void 0:null===(P=B.swimmer)||void 0===P?void 0:null===(G=P[0])||void 0===G?void 0:G.swimmer_id),ef=(0,h.useMemo)(function(){return function(e,t,n,i,a){if(!e||!t||!Array.isArray(t)||0===t.length)return null;var o,r=null==e?void 0:null===(C=e.race)||void 0===C?void 0:C.summary,l=(null==r?void 0:null===(I=r.swimmer)||void 0===I?void 0:I[n])||(null==r?void 0:null===(O=r.swimmer)||void 0===O?void 0:O[0])||{},s=l.full_name||"Swimmer",c=(null==e?void 0:null===(F=e.race)||void 0===F?void 0:F.pool_length)||"SCY",d="SCY"===c,u=d?"y":"m",p=d?"y/s":"m/s",m=((null==e?void 0:null===(D=e.race)||void 0===D?void 0:D.event)||"Swim").trim(),h=(null==e?void 0:null===(R=e.race)||void 0===R?void 0:R.race_length)||"",v=null==e?void 0:null===(L=e.race)||void 0===L?void 0:null===(M=L.event_details)||void 0===M?void 0:M.event_name,g=(null==e?void 0:null===(B=e.race)||void 0===B?void 0:B.event_type)||"MEET SWIM",f=v||g,S=eW(h)||((null==t?void 0:t.length)?t.length*("LCM"===c?50:25):0),y=(null==e?void 0:null===(P=e.video_summary)||void 0===P?void 0:null===(G=P.recorder)||void 0===G?void 0:G.created_datetime)||(null==e?void 0:e.updated_at)||Date.now(),b=(0,eb.i8)(y),x="Generated ".concat(new Date().toISOString().slice(0,16).replace("T"," "),"Z \xb7 GoSwim race report generator v1.0.0"),_=null==e?void 0:null===(U=e.race)||void 0===U?void 0:U.pin_data;if("string"==typeof _)try{_=JSON.parse(_)}catch(w){}var T=null==_?void 0:_.versions;if("string"==typeof T)try{T=JSON.parse(T)}catch(k){}var N=i||(null==l?void 0:l.swimmer_id)||(null==l?void 0:l._id)||(null==l?void 0:l.id);if(Array.isArray(T)&&T.length>0){if(N){var A=T.find(function(e){return String(e.version_id)===String(N)||String(e.swimmer_id)===String(N)||String(e._id)===String(N)||String(e.id)===String(N)});(null==A?void 0:A.pins)&&A.pins.length>0&&(H=A.pins)}if(!H&&"number"==typeof n&&n>=0&&n<T.length&&(null===(Y=T[n])||void 0===Y?void 0:null===(j=Y.pins)||void 0===j?void 0:j.length)&&(H=T[n].pins),!H){var Z,C,I,O,F,D,R,L,M,B,P,G,U,V,W,z,X,H,Y,j,K,q=T.find(function(e){return Array.isArray(null==e?void 0:e.pins)&&e.pins.length>0});H=(null==q?void 0:q.pins)||(null===(K=T[0])||void 0===K?void 0:K.pins)}}(!H||0===H.length)&&(Array.isArray(null==e?void 0:null===(ew=e.race)||void 0===ew?void 0:ew.pin)&&e.race.pin.length>0?H=e.race.pin:Array.isArray(null==e?void 0:null===(eT=e.race)||void 0===eT?void 0:eT.temp_pin)&&e.race.temp_pin.length>0&&(H=e.race.temp_pin));var Q=[];if(H&&H.length>0){var J=function(e){var t=String(e||"").trim().toLowerCase();return"race boundary"===t||"race_boundary"===t||"lap"===t||"start"===t||"finish"===t||"turn"===t},$=function(e){var t=String(e||"").trim().toLowerCase();return"stroke"===t||"breakout"===t},ee=[];H.forEach(function(e,t){J(e.type)&&ee.push(t)}),ee.length<2&&H.length>=2&&(ee.length=0,ee.push(0,H.length-1));for(var et=0;et<ee.length-1;et++)!function(e){var t,n,i,a,o=ee[e],r=ee[e+1];if(!(r-o<1)){for(var l=H[o],s=H.slice(o+1,r),c=s.find(function(e){return"breakout"===String(e.type||"").trim().toLowerCase()}),u=null!=c?c:s.length>0?s[0]:H[r],p=Math.max(0,(null!==(t=null==u?void 0:u.distance_m)&&void 0!==t?t:0)-(null!==(n=null==l?void 0:l.distance_m)&&void 0!==n?n:0)),m=Math.max(0,(null!==(i=null==u?void 0:u.pin_time_s)&&void 0!==i?i:0)-(null!==(a=null==l?void 0:l.pin_time_s)&&void 0!==a?a:0)),h=d?eU(p):p,v=s.filter(function(e){return $(e.type)}),g=[],f=0;f<v.length-1;f++){var E=v[f],S=v[f+1],y=Math.max(0,S.pin_time_s-E.pin_time_s),b=Math.max(0,S.distance_m-E.distance_m),x=d?eU(b):b,_=y>0?x/y:0;g.push({strokeNumber:f+1,distance:x,duration:y,velocity:_})}Q.push({lapNumber:e+1,uwDistance:h,uwDuration:m,uwVelocity:m>0?h/m:0,strokePhases:g})}}(et)}var en=(t||[]).map(function(e,t){var n=eW(e.lap_split_s),i=eW(e.stroke_count),a=eW(e.distance_per_cycle_m),o=d?eU(a):a,r=eW(e.tempo),l=eW(e.breakout_distance_m),s=d?eU(l):l,c=eW(e.underwater_velocity),u=d?eU(c):c,p=eW(e.breakout_split_s),m=eW(e.fifteen_meter_split_s),h=eW(e.turn_time_s),v=eW(e.swim_velocity),g=d?eU(v):v;return{lap:t+1,label:"L".concat(t+1),split:n,strokeCount:i,avgDpc:o,avgTempo:r,breakoutDistance:s,uwVelocity:u,breakoutSplit:p,fifteenMeterSplit:m,turnOrFinishTime:h,swimVelocity:g}}),ei=en.length||1,ea=m.toLowerCase().includes("medley")||m.toLowerCase().includes("im")||f.toLowerCase().includes("medley")||f.toLowerCase().includes("im"),eo=[];if(ea&&ei>=4)for(var er=function(e){var t=e*el,n=3===e?ei:(e+1)*el,i=en.slice(t,n);
1i.forEach(function(t){t.strokeType=es[e]}),Q.length>=n&&Q.slice(t,n).forEach(function(t){t.strokeType=es[e]});var a=i.reduce(function(e,t){return e+t.split},0),o=i.reduce(function(e,t){return e+t.avgTempo},0)/(i.length||1),r=i.reduce(function(e,t){return e+t.avgDpc},0)/(i.length||1),l=i.reduce(function(e,t){return e+t.uwVelocity},0)/(i.length||1),s=i.reduce(function(e,t){return e+t.breakoutDistance},0)/(i.length||1);eo.push({stroke:es[e],startLap:t+1,endLap:n,totalTime:a,avgTempo:o,avgDpc:r,avgUwVel:l,avgBreakoutDist:s,laps:i})},el=Math.floor(ei/4),es=["Butterfly","Backstroke","Breaststroke","Freestyle"],ec=0;ec<4;ec++)er(ec);var ed=en.reduce(function(e,t){return e+(t.split||0)},0),eu=eV(ed),ep="";if(en.length<=4)ep=en.map(function(e){return e.split.toFixed(2)}).join(" \xb7 ");else{var em=en.slice(0,4).map(function(e){return e.split.toFixed(2)}).join(" \xb7 "),eh=en.slice(-3).map(function(e){return e.split.toFixed(2)}).join(" \xb7 ");ep="".concat(em," … ").concat(eh)}var ev=en.map(function(e){return e.swimVelocity}).filter(function(e){return e>0}),eg=ev.length>0?ev.reduce(function(e,t){return e+t},0)/ev.length:(null===(V=en[0])||void 0===V?void 0:V.swimVelocity)||0,ef="".concat(eg.toFixed(2)," ").concat(p),eE=(null===(W=en[0])||void 0===W?void 0:W.swimVelocity)||0,eS=(null===(z=en[en.length-1])||void 0===z?void 0:z.swimVelocity)||0,ey=ev.length>=2?"".concat(eE.toFixed(2)," → ").concat(eS.toFixed(2)," lap 1 → lap ").concat(ei):"".concat(ef," on lap 1"),ex=en.reduce(function(e,t){return e+t.strokeCount},0),e_="";if(en.length<=4)e_="".concat(en.map(function(e){return e.strokeCount}).join(" \xb7 ")," by lap");else{var ew,eT,ek,eN,eA=(ek=Math).min.apply(ek,(0,E.Z)(en.map(function(e){return e.strokeCount}))),eZ=(eN=Math).max.apply(eN,(0,E.Z)(en.map(function(e){return e.strokeCount})));e_="".concat(eA,"–").concat(eZ," per lap")}var eC=en.map(function(e){return e.uwVelocity}).filter(function(e){return e>0}),eI=eC.length>0?(Z=Math).max.apply(Z,(0,E.Z)(eC)):(null===(X=en[0])||void 0===X?void 0:X.uwVelocity)||0,eO="".concat(eI.toFixed(2)," ").concat(p),eF=en.findIndex(function(e){return .01>Math.abs(e.uwVelocity-eI)}),eD=eF>=0?en[eF].lap:1,eR=en.filter(function(e,t){return t!==eF}).map(function(e){return e.uwVelocity}).filter(function(e){return e>0}),eL=eR.length>0?eR.reduce(function(e,t){return e+t},0)/eR.length:0,eM=eL>0?"Lap ".concat(eD," — then ~").concat(eL.toFixed(2)," other laps"):"Lap ".concat(eD," peak speed"),eB=0,eP="N/A",eG="Single-length sprint",ez=0,eX=0;if(ei>=2){var eH=Math.floor(ei/2),eY=en.slice(0,eH),ej=en.slice(eH);ez=eY.reduce(function(e,t){return e+t.split},0);var eK=(eB=(eX=ej.reduce(function(e,t){return e+t.split},0))-ez)>=0?"+":"";eP="".concat(eK).concat(eB.toFixed(2)," s"),eG="".concat(eV(ez)," out \xb7 ").concat(eV(eX)," back")}var eq="Notes: data recorded as a ".concat(g.toLowerCase(),", ").concat(b,". Stroke-level distance and time reconstruct slightly under the official split per lap — the final glide into each wall isn't captured as a stroke cycle, so the velocity trace ends just before each wall. Lap positions in the velocity chart are proportionally scaled so the walls fall at the true distances. Velocity per stroke is computed as DPC \xf7 tempo. The last lap's \"turn/finish\" value is the finish, not a turn. Total race time is ").concat(eu," (sum of ").concat(ei," lap splits)."),eQ=s&&"Swimmer"!==s?s:"The swimmer",eJ=s&&"Swimmer"!==s?s.split(" ")[0]:"The swimmer";if(ea&&4===eo.length){var e$=eo[0],e0=eo[1],e1=eo[2],e2=eo[3],e5=e2.totalTime-e$.totalTime,e4=Math.abs(e5).toFixed(2),e3=eo.map(function(e){var t,n,i=(null===(t=e.laps[0])||void 0===t?void 0:t.split)||0,a=(null===(n=e.laps[e.laps.length-1])||void 0===n?void 0:n.split)||0;return{stroke:e.stroke,totalTime:e.totalTime,firstSplit:i,lastSplit:a,drop:a-i,avgUwVel:e.avgUwVel,avgBreakoutDist:e.avgBreakoutDist,laps:e.laps}}),e8=(0,E.Z)(e3).sort(function(e,t){return t.drop-e.drop})[0],e6=(0,E.Z)(e3).sort(function(e,t){return e.drop-t.drop})[0],e7=e2.laps||[],e9=e7[0]||{lap:e2.startLap,split:0,swimVelocity:0},te=e7[e7.length-1]||e9,tt=e7.map(function(e){return(e.split||0).toFixed(2)}).join(" \xb7 "),tn=e7.map(function(e){return(e.swimVelocity||0).toFixed(2)}).join(" \xb7 "),ti=(te.split||0)<(e9.split||0),ta="Four-stroke medley distribution (".concat(eV(ed),")"),to="Stroke legs completed in: Butterfly ".concat(eV(e$.totalTime),", Backstroke ").concat(eV(e0.totalTime),", Breaststroke ").concat(eV(e1.totalTime),", and Freestyle ").concat(eV(e2.totalTime),". The freestyle closing leg touched ").concat(e5>=0?"+".concat(e4,"s slower than"):"".concat(e4,"s faster than")," the opening butterfly leg. Across all 4 strokes, total elapsed time was ").concat(eu,"."),tr="Stroke mechanics naturally differ between strokes: average tempo measured ".concat(e$.avgTempo.toFixed(2),"s (Fly), ").concat(e0.avgTempo.toFixed(2),"s (Back), ").concat(e1.avgTempo.toFixed(2),"s (Breast), and ").concat(e2.avgTempo.toFixed(2),"s (Free). Distance per cycle averaged ").concat(e$.avgDpc.toFixed(2)," ").concat(u," (Fly), ").concat(e0.avgDpc.toFixed(2)," ").concat(u," (Back), ").concat(e1.avgDpc.toFixed(2)," ").concat(u," (Breast), and ").concat(e2.avgDpc.toFixed(2)," ").concat(u," (Free). Compare pacing and efficie
1ncy within each stroke rather than across strokes."),tl="On the final freestyle leg (Lengths ".concat(e9.lap," to ").concat(te.lap,"), lap splits recorded ").concat(tt," with surface swim velocities of ").concat(tn," ").concat(p,". The closing length touched the wall at ").concat((te.split||0).toFixed(2),"s."),ts=ti?"".concat(eJ," accelerated through the final length, demonstrating strong back-end reserve and aerobic capacity in the closing stage."):"Split times increased by +".concat(Math.abs((te.split||0)-(e9.split||0)).toFixed(2),"s across the freestyle leg, indicating accumulating fatigue toward the final touch."),tc="Pacing stability across stroke transitions: ".concat(e8.stroke," showed greatest within-leg shift"),td="Comparing within-leg splits: Butterfly recorded ".concat(e$.laps.map(function(e){return e.split.toFixed(2)}).join(" \xb7 ")," (").concat(e3[0].drop>=0?"+":"").concat(e3[0].drop.toFixed(2),"s), Backstroke recorded ").concat(e0.laps.map(function(e){return e.split.toFixed(2)}).join(" \xb7 ")," (").concat(e3[1].drop>=0?"+":"").concat(e3[1].drop.toFixed(2),"s), Breaststroke recorded ").concat(e1.laps.map(function(e){return e.split.toFixed(2)}).join(" \xb7 ")," (").concat(e3[2].drop>=0?"+":"").concat(e3[2].drop.toFixed(2),"s), and Freestyle recorded ").concat(tt," (").concat(e3[3].drop>=0?"+":"").concat(e3[3].drop.toFixed(2),"s)."),tu="The ".concat(e8.stroke," leg demonstrated the largest split deceleration (+").concat(e8.drop.toFixed(2),"s from first to last length), whereas ").concat(e6.stroke," held the most consistent pacing (").concat(e6.drop>=0?"+":"").concat(e6.drop.toFixed(2),"s shift)."),tp=(0,E.Z)(e3).sort(function(e,t){return e.avgBreakoutDist-t.avgBreakoutDist})[0],tm=(0,E.Z)(e3).sort(function(e,t){return t.avgBreakoutDist-e.avgBreakoutDist})[0],th=(0,E.Z)(e3).sort(function(e,t){return t.avgUwVel-e.avgUwVel})[0],tv="Underwater execution: breakouts ranged from ".concat((tp.avgBreakoutDist||0).toFixed(1)," ").concat(u," (").concat(tp.stroke,") to ").concat((tm.avgBreakoutDist||0).toFixed(1)," ").concat(u," (").concat(tm.stroke,")"),tg="Average breakout distances measured ".concat((e$.avgBreakoutDist||0).toFixed(1)," ").concat(u," in Fly, ").concat((e0.avgBreakoutDist||0).toFixed(1)," ").concat(u," in Back, ").concat((e1.avgBreakoutDist||0).toFixed(1)," ").concat(u," in Breast, and ").concat((e2.avgBreakoutDist||0).toFixed(1)," ").concat(u," in Freestyle. Underwater velocities averaged ").concat((e$.avgUwVel||0).toFixed(2)," ").concat(p," (Fly), ").concat((e0.avgUwVel||0).toFixed(2)," ").concat(p," (Back), ").concat((e1.avgUwVel||0).toFixed(2)," ").concat(p," (Breast), and ").concat((e2.avgUwVel||0).toFixed(2)," ").concat(p," (Free). The fastest underwater velocity was generated on ").concat(th.stroke," at ").concat((th.avgUwVel||0).toFixed(2)," ").concat(p,"."),tf=function(e){var t=(e.laps||[]).map(function(e){return e.turnOrFinishTime}).filter(function(e){return e>0});return 0===t.length?"N/A":(t.reduce(function(e,t){return e+t},0)/t.length).toFixed(2)},tE="Wall turn times averaged ".concat(tf(e$),"s in Fly, ").concat(tf(e0),"s in Back, ").concat(tf(e1),"s in Breast, and ").concat(tf(e2),"s in Freestyle."),tS="Race distribution showed strongest pacing stability in ".concat(e6.stroke," (").concat(e6.drop>=0?"+":"").concat(e6.drop.toFixed(2),"s), while the biggest time gain opportunity lies in managing the ").concat(e8.stroke," leg and extending ").concat(tp.stroke.toLowerCase()," breakouts from ").concat((tp.avgBreakoutDist||0).toFixed(1)," ").concat(u,"."),ty=[{title:"Pacing focus on the ".concat(e8.stroke," leg."),text:"The ".concat(e8.stroke," leg exhibited the greatest split decay of the race, slowing by +").concat(e8.drop.toFixed(2),"s from ").concat(e8.firstSplit.toFixed(2),"s to ").concat(e8.lastSplit.toFixed(2),"s. Focusing on threshold speed endurance to hold length splits closer to ").concat((e8.firstSplit+.25*e8.drop).toFixed(2),"s will yield significant aggregate time improvements.")},{title:"Extend breakouts on ".concat(tp.stroke,"."),text:"Breakouts on ".concat(tp.stroke," averaged ").concat((tp.avgBreakoutDist||0).toFixed(1)," ").concat(u,", compared to ").concat((tm.avgBreakoutDist||0).toFixed(1)," ").concat(u," on ").concat(tm.stroke,". With underwater velocity reaching ").concat((tp.avgUwVel||0).toFixed(2)," ").concat(p,", extending the streamline kick ph
1ase toward ").concat((tm.avgBreakoutDist||tp.avgBreakoutDist).toFixed(1)," ").concat(u," minimizes drag and conserves stroke energy.")},{title:"Stroke transition and wall execution.",text:"Transitions across stroke changes require strict focus on wall approach and exit momentum. Maintaining underwater speed beyond the ".concat((tp.avgBreakoutDist||0).toFixed(1)," ").concat(u," mark on each turn will preserve velocity carryover into surface swimming.")}];o={shapeTitle:ta,shapeParagraph:to,noteParagraph:tr,subheading1:ti?"Freestyle leg accelerated into the finish (".concat(tt,")"):"Freestyle closing execution (".concat(tt,")"),paragraph1:tl,paragraph1Extra:ts,subheading2:tc,paragraph2:td,paragraph2Extra:tu,strokeSubheading:tv,strokeParagraph:tg,wallParagraph:tE,highlightQuote:tS,actionPoints:ty}}else{for(var tb=en[0]||{split:0,breakoutDistance:0,uwVelocity:0,breakoutSplit:0,avgDpc:0,turnOrFinishTime:0,fifteenMeterSplit:0,strokeCount:0,avgTempo:0,swimVelocity:0},tx=en[en.length-1]||tb,t_=en.map(function(e){return(e.split||0).toFixed(2)}).join(" \xb7 "),tw=en.map(function(e){return(e.breakoutDistance||0).toFixed(1)}).join(", "),tT=en.map(function(e){return(e.uwVelocity||0).toFixed(2)}).join(", "),tk=en.map(function(e){return(e.avgDpc||0).toFixed(2)}).join(", "),tN=en.map(function(e){return(e.avgTempo||0).toFixed(2)}).join(", "),tA=en.map(function(e){return e.strokeCount}).join(" \xb7 "),tZ=en.slice(0,Math.max(1,ei-1)).map(function(e){return(e.turnOrFinishTime||0).toFixed(2)}).join(", "),tC=en.map(function(e){return(e.fifteenMeterSplit||0).toFixed(2)}).join(", "),tI={lap:2,prevLap:1,diff:0},tO=1;tO<en.length;tO++){var tF=en[tO].split-en[tO-1].split;tF>tI.diff&&(tI={lap:tO+1,prevLap:tO,diff:tF})}var tD=(0,E.Z)(en).sort(function(e,t){return e.split-t.split}),tR=tD[0],tL=tD[tD.length-1],tM="Pacing distribution",tB="";1===ei?(tM="Single-length sprint profile (".concat(eu,")"),tB="Lap 1 split touched the wall in ".concat((tb.split||0).toFixed(2),"s with surface swim velocity of ").concat((tb.swimVelocity||0).toFixed(2)," ").concat(p," and ").concat(tb.strokeCount," strokes.")):2===ei?(tM="Two-length sprint profile (".concat(eu,")"),tB="".concat(t_," — Lap 1 opened in ").concat((tb.split||0).toFixed(2),"s (dive length) followed by Lap 2 in ").concat((tx.split||0).toFixed(2),"s, an overall differential of +").concat(((tx.split||0)-(tb.split||0)).toFixed(2),"s.")):eB<=-.25?(tM="Negative-split race distribution (".concat(eV(ed),")"),tB="".concat(t_," — ").concat(eQ," negative-split the race, going out in ").concat(eV(ez)," and closing in ").concat(eV(eX)," (a ").concat(Math.abs(eB).toFixed(2),"s faster back half). Fastest length was Lap ").concat(tR.lap," at ").concat(tR.split.toFixed(2),"s.")):.35>=Math.abs(eB)?(tM="Even-split race distribution (".concat(eV(ed),")"),tB="".concat(t_," — ").concat(eQ," maintained even pacing across both halves, splitting ").concat(eV(ez)," out against ").concat(eV(eX)," back (differential of only ").concat(Math.abs(eB).toFixed(2),"s).")):eB<=1.25?(tM="Controlled positive-split pacing (".concat(eV(ed),")"),tB="".concat(t_," — The race opened in ").concat(eV(ez)," on the front half and returned in ").concat(eV(eX)," on the second half (+").concat(eB.toFixed(2),"s fade).")):(tM="Front-loaded speed with back-half fade (+".concat(eB.toFixed(2),"s)"),tB="".concat(t_," — The swim opened in ").concat(eV(ez)," before split decay increased to ").concat(eV(eX)," on the back half (+").concat(eB.toFixed(2),"s fade)."));var tP=ei<=2?tB:"".concat(tB," Fastest length was Lap ").concat(tR.lap," (").concat(tR.split.toFixed(2),"s) and slowest length was Lap ").concat(tL.lap," (").concat(tL.split.toFixed(2),"s).").concat(tI.diff>.3?" The largest single-lap deceleration took place on Lap ".concat(tI.lap,", which slowed by +").concat(tI.diff.toFixed(2),"s compared to Lap ").concat(tI.prevLap,"."):""),tG=en.filter(function(e){return e.breakoutDistance>0}),tU=en.filter(function(e){return e.uwVelocity>0}),tV=en.filter(function(e){return e.avgDpc>0}),tW=en.filter(function(e){return e.avgTempo>0}),tz=en.filter(function(e){return e.strokeCount>0}),tX=tG[0]||tb,tH=tG[tG.length-1]||tx,tY=tG.length>=2?(tH.breakoutDistance||0)-(tX.breakoutDistance||0):0,tj=tU[0]||tb,tK=tU[tU.length-1]||tx,tq=tU.length>=2?(tK.uwVelocity||0)-(tj.uwVelocity||0):0,tQ=tV[0]||tb,tJ=tV[tV.length-1]||tx,t$=tV.length>=2&&tQ.avgDpc>0?((tJ.avgDpc||0)-tQ.avgDpc)/tQ.avgDpc*100:0,t0=tW[0]||tb,t1=tW[tW.length-1]||tx,t2=tW.length>=2&&t0.avgTempo>0?((t1.avgTempo||0)-t0.avgTempo)/t0.avgTempo*100:0,t5=tz[0]||tb,t4=tz[tz.length-1]||tx,t3=tz.length>=2?(t4.strokeCount||0)-(t5.strokeCount||0):0,t8="Underwater breakout consistency",t6="",t7=Q.some(function(e){return e.uwDistance>0}),t9=t7?Q.map(function(e){return(e.uwDistance||0).toFixed(2)}).join(", "):"";if(tG.length>=2)tY<-.7?(t8="Breakout distance shortened by ".concat(Math.abs(tY).toFixed(1)," ").concat(u," across the race"),t6="Breakout distance began at ".concat((tX.breakoutDistance||0).toFixed(2)," ").concat(u," on lap ").concat(tX.lap," and shortened to ").concat((tH.breakoutDistance||0).toFixed(2)," ").concat(u," on lap ").concat(tH.lap," (progression: ").concat(tw," ").concat(u,"). Surfacing earlier under fatigue reduces streamline glide distance.")):tY>.7?(t8="Breakouts extended by +".concat(tY.toFixed(1)," ").concat(u," in the back half"),t6="Breakout distance increased from ".concat((tX.breakoutDistance||0).toFixed(2)," ").concat(u," on lap ").concat(tX.lap," to ").concat((tH.breakoutDistance||0).toFixed(2)," ").concat(u," on lap ").concat(tH.lap," (progression: ").concat(tw," ").concat(u,"), showing committed underwater discipline late in the swim.")):(t8="".concat(eJ," holds underwater distance across lengths — that is the strength here"),t6="Breakout distance remained consistent from start to finish: ".concat(tw," ").concat(u," (delta of only ").concat(Math.abs(tY).toFixed(2)," ").concat(u,"). Holding streamline distance late in the race demonstrates excellent discipline under fatigue."));else if(1===tG.length){var ne=tG[0];t8="Underwater breakout execution on Lap ".concat(ne.lap," (").concat(ne.breakoutDistance.toFixed(2)," ").concat(u,")"),t6="Lap ".concat(ne.lap," breakout measured ").concat(ne.breakoutDistance.toFixed(2)," ").concat(u," with an underwater velocity of ").concat(ne.uwVelocity.toFixed(2)," ").concat(p," and breakout time of ").concat(ne.breakoutSplit.toFixed(2),"s.")}else t8="Underwater breakout tracking",t6="Breakout metrics recorded across available lengths.";var nt="".concat(t7?"Underwater distance by length: ".concat(t9,". "):"","Breakout distance by length: ").concat(tw,". ").concat(t6),nn=eI-eg,ni=nn>.1?"Pullouts run +".concat(nn.toFixed(2)," ").concat(p," faster than surface swimming (").concat(ef,"), so time spent underwater is time spent in the fastest gear."):"Underwater velocity averaged ".concat((en.reduce(function(e,t){return e+t.uwVelocity},0)/ei).toFixed(2)," ").concat(p," against ").concat(ef," surface swim velocity."),na=en.map(function(e){return e.breakoutSplit>0?e.breakoutSplit:e.uwVelocity>0&&e.breakoutDistance>0?e.breakoutDistance/e.uwVelocity:0}),no=na.map(function(e){return e.toFixed(2)}).join(", "),nr=na[0]||0,nl=na[na.length-1]||nr,ns="Underwater velocity and time distribution",nc="",nd="";tU.length>=2?tq<-.15&&nl>nr?(ns="The fade is underwater time, not underwater distance",nc="The velocity tells the other half. Underwater velocity falls ".concat(tT," ").concat(p,", and the time spent down there grows ").concat(no," s. Distance was held by staying under longer, not by travelling faster."),nd="Comparing lengths, underwater time was ".concat(nl.toFixed(2),"s on the last length against ").concat(nr.toFixed(2),"s on the first, on a length that was ").concat((tx.split||0).toFixed(2),"s against ").concat((tb.split||0).toFixed(2),"s. ").concat(nl-nr>.3?"A notable portion of time lost on the final length occurred before taking the first stroke.":"")):tq<-.15?(ns="Underwater velocity decreased by ".concat(Math.abs(tq).toFixed(2)," ").concat(p," across walls"),nc="Underwater velocity falls ".concat(tT," ").concat(p," across lengths, while pullout times measured ").concat(no,"s."),nd="Velocity off the final wall was ".concat((tK.uwVelocity||0).toFixed(2)," ").concat(p," compared to ").concat((tj.uwVelocity||0).toFixed(2)," ").concat(p," on the opening length.")):(ns="Consistent underwater velocity across lengths (".concat(tT," ").concat(p,")"),nc="Underwater velocity held stable at ".concat(tT," ").concat(p,", with pullout times of ").concat(no,"s across lengths."),nd="Maintaining streamline momentum off each wall preserved propulsion without excessive fatigue."):(ns="Underwater velocity tracking",nc="Underwater velocity measured ".concat(tT," ").concat(p," with pullout time of ").concat(no,"s."),nd="");var nu=en.length>1&&en.every(function(e){return e.strokeCount===en[0].strokeCount&&e.strokeCount>0}),np="The stroke is not the problem",nm="";tV.length>=2?t$<-4&&t3>0?(np="Distance per cycle dropped ".concat(Math.abs(t$).toFixed(1),"%, adding +").concat(t3," strokes on lap ").concat(t4.lap),nm="".concat(tA," strokes per length. Distance per cycle decreased from ").concat((tQ.avgDpc||0).toFixed(2)," to ").concat((tJ.avgDpc||0).toFixed(2)," ").concat(u,"/cycle (").concat(tk,"), while tempo moved from ").concat((t0.avgTempo||0).toFixed(2)," to ").concat((t1.avgTempo||0).toFixed(2),"s per cycle.")):t2>4?(np="Stroke tempo slowed by +".concat(((t1.avgTempo||0)-(t0.avgTempo||0)).toFixed(2),"s per cycle under late fatigue"),nm="".concat(tA," strokes per length. Tempo shifted from ").concat((t0.avgTempo||0).toFixed(2)," to ").concat((t1.avgTempo||0).toFixed(2),"s per cycle (").concat(tN,"), while distance per cycle held steady at ").concat(tk," ").concat(u,"/cycle.")):(np=nu?"".concat(en[0].strokeCount," strokes a length, every length, all race"):"The stroke is not the problem",nm="".concat(nu?"".concat(en[0].strokeCount," strokes a length, every length, all race."):"Stroke counts progressed ".concat(tA," strokes per length.")," Distance per cycle recorded ").concat(tk," ").concat(u,"/cycle, and tempo measured ").concat(tN," s/cycle. Closing distance per cycle was ").concat(Math.abs(t$).toFixed(1),"% ").concat(t$>=0?"longer":"shorter"," per cycle and ").concat(Math.abs(t2).toFixed(1),"% ").concat(t2>=0?"slower":"faster"," in tempo.")):(np="Stroke mechanics: ".concat(tA," strokes per length"),nm="Throughout the race, stroke count recorded ".concat(tA,". Velocity per length measured ").concat(en.map(function(e){return(e.swimVelocity||0).toFixed(2)}).join(" \xb7 ")," ").concat(p,"."));var nh=tZ?"The walls tell the story: turn times of ".concat(tZ,"s, and 15 m splits of ").concat(tC,"s."):"15 m splits measured ".concat(tC,"s."),nv="";nv=eB<=-.25?"".concat(eQ," executed an impressive negative split (-").concat(Math.abs(eB).toFixed(2),"s), accelerating to a ").concat(tx.split.toFixed(2),"s finish with strong stroke mechanics."):tY>=-.5&&tq<-.2?"Breakout distance was held under fatigue — velocity slowed inside the pullout. The fade is underwater speed, and the stroke is already doing its job.":Math.abs(tY)>1&&tY<0?"The primary time-saving opportunity is off the walls: breakout distance shortened by ".concat(Math.abs(tY).toFixed(1)," ").concat(u,", losing streamline momentum into the breakout."):t$<-4?"Pacing decay was linked to stroke length: DPC shortened by ".concat(Math.abs(t$).toFixed(1),"%, adding ").concat(t3," extra strokes on the final lap."):t2>5?"Turnover cadence was the main variable: tempo slowed by +".concat(((tx.avgTempo||0)-(tb.avgTempo||0)).toFixed(2),"s, driving the split increase while stroke distance held steady."):"Steady race management: holding an average swim velocity of ".concat(eg.toFixed(2)," ").concat(p," and average tempo of ").concat((en.reduce(function(e,t){return e+t.avgTempo},0)/ei).toFixed(2),"s across all lengths.");var ng=[];if(eB>.8){var nf=(.25*eB).toFixed(2);ng.push({title:"Pacing distribution and front-half control.",text:"With a fade of +".concat(eB.toFixed(2),"s (").concat(eV(ez)," out vs ").concat(eV(eX)," back), target a more controlled opening pace. Calibrating the opening lap by +").concat(nf,"s will preserve energy and prevent the ").concat(tI.diff>.3?"Lap ".concat(tI.lap," split drop of +").concat(tI.diff.toFixed(2),"s"):"second-half deceleration",".")})}else eB<=-.25?ng.push({title:"Capitalize on closing speed with an earlier build.",text:"Closing ".concat(Math.abs(eB).toFixed(2),"s faster on the back half indicates remaining aerobic capacity. Experiment in training with initiating the race build one length earlier to maximize overall race time.")}):ng.push({title:"Maintain disciplined pacing consistency.",text:"Pacing was well balanced across halves (".concat(eV(ez)," out vs ").concat(eV(eX)," back). Progress by fine-tuning the third quarter split to shave marginal time.")});if(tq<-.2?ng.push({title:"Underwater speed endurance is the whole target.",text:"Underwater velocity fell from ".concat((tj.uwVelocity||0).toFixed(2)," ").concat(p," off the first wall to ").concat((tK.uwVelocity||0).toFixed(2)," ").concat(p," off the final wall. Focus on high-frequency streamline dolphin kicking to hold underwater velocity closer to ").concat((tj.uwVelocity||0).toFixed(2)," ").concat(p," through the final breakout.")}):tY<-.7?ng.push({title:"Preserve breakout distance under fatigue.",text:"Breakout distance shortened from ".concat((tX.breakoutDistance||0).toFixed(1)," ").concat(u," to ").concat((tH.breakoutDistance||0).toFixed(1)," ").concat(u,". Train late-race kick sets to hold consistent breakout distance at the ").concat((tX.breakoutDistance||0).toFixed(1)," ").concat(u," mark on every wall.")}):ng.push({title:"Work the kick late, at distance.",text:"With breakout distance steady at ".concat((tH.breakoutDistance||0).toFixed(1)," ").concat(u,", the training target is time rather than distance: maintain high-power kick cadence to cover ").concat((tH.breakoutDistance||0).toFixed(1)," ").concat(u," under ").concat(nr.toFixed(2),"s.")}),t2>3&&t$>=-2){var nE=(((t0.avgTempo||0)+(t1.avgTempo||0))/2).toFixed(2);ng.push({title:"Protect the tempo.",text:"Tempo slipped from ".concat((t0.avgTempo||0).toFixed(2)," to ").concat((t1.avgTempo||0).toFixed(2),"s per cycle while distance per cycle held at ").concat((tJ.avgDpc||0).toFixed(2)," ").concat(u,". With stroke distance maintained, sustaining cadence near ").concat(nE,"s through the final length will preserve speed.")})}else t$<-3.5?ng.push({title:"Hold distance per cycle in the back half.",text:"Distance per cycle decreased by ".concat(Math.abs(t$).toFixed(1),"% (from ").concat((tQ.avgDpc||0).toFixed(2)," to ").concat((tJ.avgDpc||0).toFixed(2)," ").concat(u,"/cycle). Prioritize catch stability and core connection in the final 25% of sets to prevent stroke slippage.")}):ng.push({title:"Refine turnover rate and stroke length ratio.",text:"Stroke mechanics remained stable at ".concat(tA," strokes per lap. The next step is slightly elevating stroke tempo while preserving the current ").concat((tQ.avgDpc||0).toFixed(2)," ").concat(u," distance per cycle.")});o={shapeTitle:tM,shapeParagraph:tP,subheading1:t8,paragraph1:nt,paragraph1Extra:ni,subheading2:ns,paragraph2:nc,paragraph2Extra:nd,strokeSubheading:np,strokeParagraph:nm,wallParagraph:nh,highlightQuote:nv,actionPoints:ng}}return{swimmerName:s,eventName:f,event:m,poolLength:c,poolType:d?"Short Course Yards":"SCM"===c?"Short Course Meters":"LCM"===c?"Long Course Meters":c,raceLength:h||"".concat(S).concat(u),isSCY:d,unit:u,velUnit:p,dateStr:"".concat(b," \xb7 GoSwim race data export"),finalTimeFormatted:eu,finalTimeSeconds:ed,splitsSummaryStr:ep,avgSwimVelocity:eg,avgSwimVelocityStr:ef,velocityTrajectoryStr:ey,totalStrokes:ex,strokesPerLapStr:e_,peakPulloutSpeed:eI,peakPulloutSpeedStr:eO,peakPulloutSubt
1itle:eM,backHalfFade:eB,backHalfFadeStr:eP,backHalfSubtitle:eG,laps:en,lapPhases:Q,legs:eo,isIM:ea,totalDistance:S,notesText:eq,generatedDateStr:x,aiFeedback:a,narrative:o}}(Q,e.tableBodyData,e.activeSwimmerIndex,eg,$)},[Q,e.tableBodyData,e.activeSwimmerIndex,e.selectedSwimmerId,eg,$]),ek=Boolean(el||!ef||!ev),eN=ek?"Please add the necessary data to the race to access the export report":"",eA=(0,h.useMemo)(function(){if(!e.tableBodyData||0===e.tableBodyData.length)return[];var t=(null==ea?void 0:null===(s=ea.swimmer)||void 0===s?void 0:s[e.activeSwimmerIndex])||{},n=null==Q?void 0:null===(c=Q.race)||void 0===c?void 0:c.pin_data;if("string"==typeof n)try{n=JSON.parse(n)}catch(i){}var a=null==n?void 0:n.versions;if("string"==typeof a)try{a=JSON.parse(a)}catch(o){}var r=null==Q?void 0:null===(d=Q.race)||void 0===d?void 0:d.duration_s;if(Array.isArray(a)&&a.length>0){if(eg){var l=a.find(function(e){return String(e.version_id)===String(eg)||String(e.swimmer_id)===String(eg)||String(e._id)===String(eg)});(null==l?void 0:l.pins)&&l.pins.length>0&&(f=l.pins)}if(!f&&"number"==typeof e.activeSwimmerIndex&&e.activeSwimmerIndex>=0&&e.activeSwimmerIndex<a.length&&(null===(S=a[e.activeSwimmerIndex])||void 0===S?void 0:null===(y=S.pins)||void 0===y?void 0:y.length)&&(f=a[e.activeSwimmerIndex].pins),!f){var s,c,d,u,p,m,h,v,g,f,S,y,b,x=a.find(function(e){return Array.isArray(null==e?void 0:e.pins)&&e.pins.length>0});f=(null==x?void 0:x.pins)||(null===(b=a[0])||void 0===b?void 0:b.pins)}}if((!f||0===f.length)&&(Array.isArray(null==Q?void 0:null===(_=Q.race)||void 0===_?void 0:_.pin)&&Q.race.pin.length>0?f=Q.race.pin:Array.isArray(null==Q?void 0:null===(w=Q.race)||void 0===w?void 0:w.temp_pin)&&Q.race.temp_pin.length>0&&(f=Q.race.temp_pin)),f&&f.length>0){var _,w,T,k,N,A,Z=null!==(N=null===(T=f[0])||void 0===T?void 0:T.pin_time_s)&&void 0!==N?N:0,C=null!==(A=null===(k=f[f.length-1])||void 0===k?void 0:k.pin_time_s)&&void 0!==A?A:0;C&&Z&&(r=C-Z)}var I=null==Q?void 0:Q.updated_at,O=[],F=(null==Q?void 0:null===(u=Q.race)||void 0===u?void 0:null===(p=u.event_details)||void 0===p?void 0:p.event_name)||"",D=null==Q?void 0:null===(m=Q.race)||void 0===m?void 0:m.event,R=null==Q?void 0:null===(h=Q.race)||void 0===h?void 0:h.pool_length,L=null==Q?void 0:null===(v=Q.race)||void 0===v?void 0:v.race_length,M=[t.full_name,L,R,D,null==Q?void 0:null===(g=Q.race)||void 0===g?void 0:g.event_type,F].filter(Boolean).join(" | ");O.push([M]);var B="";I&&(B+="".concat((0,eb.i8)(I))),r&&(B&&(B+=" "),B+="".concat((0,ey.Cx)(r))),B&&O.push([B]),O.push([]);var P=[eS.z.tableText.lap,eS.z.tableText.breakoutSplit,"".concat(eS.z.tableText.breakoutDistance," (").concat(en?eS.z.tableText.yard:eS.z.tableText.meter,")"),eS.z.tableText.stroke,eS.z.tableText.tempo,"".concat(eS.z.tableText.dpc," (").concat(en?eS.z.tableText.yardOrCycle:eS.z.tableText.meterOrCycle,")"),eS.z.tableText.mSplit,"".concat(eS.z.tableText.swimVelocity," (").concat(en?eS.z.tableText.yardOrSec:eS.z.tableText.meterOrSec,")"),eS.z.tableText.turnOrFinishTime,"".concat(eS.z.tableText.splits," (").concat(eS.z.tableText.seconds,")"),"".concat(eS.z.tableText.underwaterVelocity," (").concat(en?eS.z.tableText.yardOrSec:eS.z.tableText.meterOrSec,")")],G=e.tableBodyData.map(function(n,i){var a,o,r,l,s,c,d,u,p,m=i+1===e.tableBodyData.length;return["Lap ".concat(i+1<10?"0":"").concat(i+1),null!==(a=null==n?void 0:n.breakout_split_s)&&void 0!==a?a:"N/A",en?(null==n?void 0:n.breakout_distance_m)?(0,ey.Kd)(n.breakout_distance_m):"N/A":null!==(o=null==n?void 0:n.breakout_distance_m)&&void 0!==o?o:"N/A",null!==(r=null==n?void 0:n.stroke_count)&&void 0!==r?r:"N/A",null!==(l=null==n?void 0:n.tempo)&&void 0!==l?l:"N/A",en?(null==n?void 0:n.distance_per_cycle_m)?(0,ey.Kd)(n.distance_per_cycle_m):"N/A":null!==(s=null==n?void 0:n.distance_per_cycle_m)&&void 0!==s?s:"N/A",null!==(c=null==n?void 0:n.fifteen_meter_split_s)&&void 0!==c?c:"N/A",en?(null==n?void 0:n.swim_velocity)?(0,ey.Kd)(n.swim_velocity):"N/A":null!==(d=null==n?void 0:n.swim_velocity)&&void 0!==d?d:"N/A",m?(null==t?void 0:t.finish_time)||(null==ea?void 0:ea.finish_time_s)||"N/A":null!==(u=null==n?void 0:n.turn_time_s)&&void 0!==u?u:"N/A",(null==n?void 0:n.lap_split_s)?"​".concat((0,eb.dN)(n.lap_split_s)):"N/A",en?(null==n?void 0:n.underwater_velocity)?(0,ey.Kd)(n.underwater_velocity):"N/A":null!==(p=null==n?void 0:n.underwater_velocity)&&void 0!==p?p:"N/A"]}),U=[];if(f&&f.length>0){var V=new Set(["Race Boundary","Lap"]),W=new Set(["Breakout","Stroke"]),z=function(e){return 1.09361*e},X=[];f.forEach(function(e,t){V.has(e.type)&&X.push(t)});for(var H=0;H<X.length-1;H++)!function(e){var t=X[e],n=X[e+1];if(!(n-t<1)){for(var i=f[t],a=f.slice(t+1,n),o=a.find(function(e){return"Breakout"===e.type}),r=null!=o?o:a.length>0?a[0]:f[n],l=r.pin_time_s-i.pin_time_s,s=r.distance_m-i.distance_m,c=l>0?s/l:0,d=en?z(s).toFixed(2):s.toFixed(2),u=l.toFixed(2),p=en?z(c).toFixed(2):c.toFixed(2),m=a.filter(function(e){return W.has(e.type)}),h=[],v=[],g=0;g<m.length-1;g++){var S=m[g],y=m[g+1],b=y.pin_time_s-S.pin_time_s,x=y.distance_m-S.distance_m;h.push(x>0?en?z(x).toFixed(2):x.toFixed(2):"N/A"),v.push(b>0?b.toFixed(2):"N/A")}var _=h.length>0,w=h.map(function(e,t){return 0===t?"Swim Phase":""});U.push([]),U.push(["Lap ".concat(e+1),"Underwater Phase"].concat((0,E.Z)(w))),U.push(["DPC",_?d:"0"].concat((0,E.Z)(h))),U.push(["TEMPO",_?u:"0"].concat((0,E.Z)(v))),U.push(["UW Velocity",_?p:"0"].concat((0,E.Z)(h.map(function(){return""}))))}}
1(H)}return(0,E.Z)(O).concat([P],(0,E.Z)(G),(0,E.Z)(U))},[e.tableBodyData,Q,e.activeSwimmerIndex,ea,en,e.selectedSwimmerId]),eZ=function(){var t,n,i,o,r,l,s,d;return(0,a.tZ)(u.Z,{className:U.gallaryTableSection,children:(0,a.BX)(b.Z,{className:U.fullHeightCard,children:[(0,a.BX)(u.Z,{className:U.selectSwimmer,display:"flex",justifyContent:ei&&ei<2||et?"flex-end":"space-between",alignItems:"center",children:[!(ei&&ei<2)&&!et&&(0,a.BX)(x.Z,{className:U.swimmerSelectFormControl,variant:"outlined",size:"medium",children:[(0,a.tZ)(_.Z,{children:eS.z.SELECT_SWIMMER}),(0,a.tZ)(w.Z,{onChange:function(t){e.setSelectedSwimmerId(t.target.value)},label:eS.z.SELECT_SWIMMER,fullWidth:!0,value:(null==Q?void 0:null===(t=Q.race)||void 0===t?void 0:null===(n=t.summary)||void 0===n?void 0:null===(i=n.swimmer)||void 0===i?void 0:null===(o=i[e.activeSwimmerIndex])||void 0===o?void 0:o.swimmer_id)||"",children:null==ea?void 0:null===(r=ea.swimmer)||void 0===r?void 0:r.map(function(e){return(0,a.tZ)(T.Z,{value:e.swimmer_id,children:e.full_name},e.swimmer_id)})})]}),e.tableBodyData&&e.tableBodyData.length>0&&(0,a.BX)(u.Z,{display:"flex",alignItems:"center",gap:1.5,flexWrap:"wrap",children:[eh&&(0,a.tZ)(k.Z,{title:eN,children:(0,a.tZ)("span",{style:{display:"inline-flex"},children:(0,a.tZ)(q.Z,{variant:"contained",color:"primary",size:"large",disabled:ek,startIcon:(0,a.tZ)(e_.Z,{size:16}),onClick:function(){return ed(!0)},children:"Export Report"})})}),(0,a.tZ)(ex.CSVLink,{data:el?[]:eA,filename:"".concat((null==ea?void 0:null===(l=ea.swimmer)||void 0===l?void 0:null===(s=l[e.activeSwimmerIndex])||void 0===s?void 0:s.full_name)||"Swimmer","_").concat(null==Q?void 0:null===(d=Q.race)||void 0===d?void 0:d.event,".csv"),style:{textDecoration:"none",pointerEvents:el?"none":"auto"},children:(0,a.tZ)(q.Z,{variant:"outlined",color:"secondary",size:"large",disabled:!!el,startIcon:(0,a.tZ)(ew.Z,{size:16}),children:"Export Data"})})]})]}),(0,a.tZ)("div",{className:U.responsiveTable,children:(0,a.BX)(N.Z,{children:[(0,a.tZ)(A.Z,{className:U.tableHead,children:(0,a.BX)(Z.Z,{children:[(0,a.tZ)(C.Z,{children:eS.z.tableText.lap}),(0,a.tZ)(C.Z,{className:U.wrapText,children:eS.z.tableText.breakoutSplit}),(0,a.BX)(C.Z,{children:[(0,a.tZ)("div",{className:U.wrapText,children:eS.z.tableText.breakoutDistance}),(0,a.tZ)("span",{className:U.spanText,children:en?eS.z.tableText.yard:eS.z.tableText.meter})]}),(0,a.tZ)(C.Z,{children:eS.z.tableText.stroke}),(0,a.tZ)(C.Z,{children:eS.z.tableText.tempo}),(0,a.BX)(C.Z,{children:[(0,a.tZ)("div",{children:eS.z.tableText.dpc}),(0,a.tZ)("span",{className:U.spanText,children:en?eS.z.tableText.yardOrCycle:eS.z.tableText.meterOrCycle})]}),(0,a.tZ)(C.Z,{children:eS.z.tableText.mSplit}),(0,a.BX)(C.Z,{children:[(0,a.tZ)("div",{className:U.wrapText,children:eS.z.tableText.swimVelocity}),(0,a.tZ)("span",{className:U.spanText,children:en?eS.z.tableText.yardOrSec:eS.z.tableText.meterOrSec})]}),(0,a.tZ)(C.Z,{className:U.wrapText,children:eS.z.tableText.turnOrFinishTime}),(0,a.BX)(C.Z,{children:[(0,a.tZ)("div",{className:U.wrapText,children:eS.z.tableText.splits}),(0,a.tZ)("span",{className:U.spanText,children:eS.z.tableText.seconds})]}),(0,a.BX)(C.Z,{children:[(0,a.tZ)("div",{className:U.wrapText,children:eS.z.tableText.underwaterVelocity}),(0,a.tZ)("span",{className:U.spanText,children:en?eS.z.tableText.yardOrSec:eS.z.tableText.meterOrSec})]})]})}),(0,a.BX)(I.Z,{className:U.tableBody,style:{position:"relative"},children:[el&&(0,a.tZ)(Z.Z,{style:{position:"absolute",inset:0,zIndex:5,display:"flex",alignItems:"center",justifyContent:"center",filter:"none"},children:(0,a.tZ)(C.Z,{colSpan:11,style:{border:"none",width:"100%"},children:(0,a.tZ)(u.Z,{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",py:4,gap:1,children:(0,a.tZ)(eT.Z,{className:U.lockIcon,size:36})})})}),e.tableBodyData&&e.tableBodyData.length>0?e.tableBodyData.map(function(t,n){var i,o,r;return(0,a.BX)(Z.Z,{style:el?{filter:"blur(5px)",pointerEvents:"none",userSelect:"none"}:void 0,children:[(0,a.tZ)(C.Z,{className:(0,Y.Z)(U.columnOne,U.wrapText),children:"Lap ".concat(n+1<10?"0":"").concat(n+1)}),(0,a.tZ)(C.Z,{children:null==t?void 0:t.breakout_split_s}),(0,a.tZ)(C.Z,{children:en?(0,ey.Kd)(null==t?void 0:t.breakout_distance_m):null==t?void 0:t.breakout_distance_m}),(0,a.tZ)(C.Z,{children:null==t?void 0:t.stroke_count}),(0,a.tZ)(C.Z,{children:null==t?void 0:t.tempo}),(0,a.tZ)(C.Z,{children:en?(0,ey.Kd)(null==t?void 0:t.distance_per_cycle_m):null==t?void 0:t.distance_per_cycle_m}),(0,a.tZ)(C.Z,{children:null==t?void 0:t.fifteen_meter_split_s}),(0,a.tZ)(C.Z,{children:en?(0,ey.Kd)(null==t?void 0:t.swim_velocity):null==t?void 0:t.swim_velocity}),(0,a.tZ)(C.Z,{children:n+1===(null===(i=e.tableBodyData)||void 0===i?void 0:i.length)?(null==ea?void 0:null===(o=ea.swimmer)||void 0===o?void 0:null===(r=o[e.activeSwimmerIndex])||void 0===r?void 0:r.finish_time)||(null==ea?void 0:ea.finish_time_s):null==t?void 0:t.turn_time_s}),(0,a.tZ)(C.Z,{children:(null==t?void 0:t.lap_split_s)?(0,eb.dN)(t.lap_split_s):"N/A"}),(0,a.tZ)(C.Z,{children:en?(0,ey.Kd)(null==t?void 0:t.underwater_velocity):null==t?void 0:t.underwater_velocity})]})}):!K&&e.tableBodyData&&0===e.tableBodyData.length?(0,a.tZ)(Z.Z,{children:(0,a.tZ)(C.Z,{colSpan:11,align:"center",children:c.kW.SEARCH_RESULTS_EMPTY})}):(0,a.tZ)(Z.Z,{children:(0,a.tZ)(C.Z,{colSpan:11,children:(0,E.Z)([,,,,,]).map(function(e,t){return(0,a.tZ)(O.Z,{height:80,animation:"wave"},t)})})})]})]})})]})})};return(0,a.BX)("div",{className:U.root,children:[(0,a.tZ)(u.Z,{children:(0,a.BX)(F.ZP,{container:!0,children:[(0,a.tZ)(F.ZP,{className:U.playerWrapper,item:!0,xs:12,lg:8,style:{position:"relative"},children:(0,a.BX)(b.Z,{className:U.rootCard,children:[(null==Q?void 0:Q.isMarketplaceVideo)||(null==Q?void 0:Q.isTutorial)||et?(0,a.tZ)(H.Z,{label:(null==Q?void 0:Q.isMarketplaceVideo)?"Marketplace":(null==Q?void 0:Q.isTutorial)?"Broadcast Content":et?"Annotation Video":""}):(0,a.tZ)(a.HY,{}),K?(0,a.tZ)(W.Z,{}):(0,a.BX)(a.HY,{children:[(0,a.tZ)(R.Z,{activeSwimmerIndex:e.activeSwimmerIndex,lesson:Q,selectedSwimmerId:e.selectedSwimmerId}),(0,a.tZ)("div",{className:U.player,children:function(e){if(e)return(0,a.tZ)(D.Z,{lesson:e})}(Q)})]})]})}),eo&&(0,a.tZ)(F.ZP,{item:!0,xs:12,children:eZ()}),!et&&!ee&&(0,a.BX)(F.ZP,{item:!0,xs:12,lg:4,children:[(0,a.tZ)(ep,{}),(0,a.tZ)(eE,{page:e.page,setPage:e.setPage}),(0,a.tZ)(X,{})]}),er&&(0,a.tZ)(F.ZP,{item:!0,xs:12,children:eZ()})]})}),(0,a.tZ)(eG,{open:ec,onClose:function(){return ed(!1)},reportData:ef})]})},eY=n(21023),ej=(0,p.Z)(function(e){return{backButton:{margin:"".concat(e.spacing(2)," ").concat(e.spacing(2)," 0 0"),textAlign:"end"}}}),eK=function(){var e,t,n,i,o,r,p,f,E,S,y,b,x,_,w=(0,m.useRouter)(),T=(0,l.I0)(),k=ej(),N=(0,d.Z)((0,h.useState)(!0),2),A=N[0],Z=N[1];A&&(T({type:v.CZ}),Z(!1));var C=(0,l.v9)(function(e){return null==e?void 0:e.userVideos}),I=C.videoDetail,O=C.isLoading,F=(0,l.v9)(function(e){var t,n;return null==e?void 0:null===(t=e.account)||void 0===t?void 0:null===(n=t.user)||void 0===n?void 0:n.role}),D=null==I?void 0:null===(e=I.race)||void 0===e?void 0:null===(t=e.summary)||void 0===t?void 0:null===(n=t.swimmer)||void 0===n?void 0:null===(i=n[0])||void 0===i?void 0:i.swimmer_id,R=null==I?void 0:null===(o=I.race)||void 0===o?void 0:o.summary,L=(0,d.Z)((0,h.useState)(D),2),M=L[0],B=L[1],P=(0,d.Z)((0,h.useState)(0),2),U=P[0],V=P[1],z=(0,d.Z)((0,h.useState)([]),2),X=z[0],H=z[1],Y=(0,d.Z)((0,h.useState)(0),2),j=Y[0],K=Y[1],Q=(0,d.Z)((0,h.useState)(1),2),J=Q[0],$=Q[1],ee=null==I?void 0:null===(r=I.race)||void 0===r?void 0:null===(p=r.summary)||void 0===p?void 0:null===(f=p.swimmer)||void 0===f?void 0:f.length,et=null==I?void 0:null===(E=I.race)||void 0===E?void 0:null===(S=E.summary)||void 0===S?void 0:null===(y=S.swimmer)||void 0===y?void 0:null===(b=y[0])||void 0===b?void 0:b.lap,en=w.asPath.split("?")[0].split("/"),ei=en[en.length-1],ea=w.asPath.includes("gallery")&&(null==en?void 0:en.length)>2,eo=w.asPath.split("?")[1]||"",er=new URLSearchParams(eo),el=er.get("team_id"),es=er.get("child_id"),ec=w&&w.query&&w.query.swimmerId?null==w?void 0:null===(x=w.query)||void 0===x?void 0:x.swimmerId:"",ed=w.asPath.includes("annotationVideo"),eu=w.asPath.includes("promoVideo"),ep=(0,l.v9)(function(e){var t;return null==e?void 0:null===(t=e.account)||void 0===t?void 0:t.user}),em=(null==ep?void 0:ep.isChinaUser)&&!(null==ep?void 0:ep.sales_rep_id)&&
1(null==ep?void 0:null===(_=ep.subscription)||void 0===_?void 0:_.product_id)===G.An,eh="free"===w.query.isFreeVideo&&em,ev=function(){if(F===s.Qm.SWIMMER)H(et||[]);else{var e;null==R||null===(e=R.swimmer)||void 0===e||e.map(function(e,t){M===e.swimmer_id&&(H(e.lap||[]),V(t))})}},eg=function(e){var t=100*Number(e);return t>=375?"5 - elite swimming":t<375&&t>=275?"4 - competitive swimming":t<275&&t>=175?"3 - learning swimming skills":t<175&&t>=100?"2 - learning strokes":t<100&&t>0?"1 - beginner":void 0};return(0,h.useEffect)(function(){ev()},[M]),(0,h.useEffect)(function(){I&&1===ee?(H(et||[]),B(D||"")):I&&(ec?"string"==typeof ec&&B(ec):B(D||""))},[I]),(0,h.useEffect)(function(){if(ea){var e={videoId:ei,teamId:el||"",childId:es||"",isPromoUnlockedVideo:eu,swimmerId:ed?M:"",isFreeVideo:Boolean(eh)};T((0,g.sf)(e))}},[ea,ei,ed]),(0,h.useEffect)(function(){I&&!ed&&M&&T((0,g.FG)({lesson_id:ei,pageID:1,limit:5,teamId:el,swimmerId:M}))},[I,j,M]),(0,h.useEffect)(function(){if(I){var e,t,n,i,a,o,r,l,c,d={back:"Back",breast:"Breast",fly:"Fly",free:"Free"},u=d[(null!==(c=I.race.event)&&void 0!==c?c:"").toLowerCase()],p={stroke:u?s.A_[u]:(t=(e=Object.keys(d))[Math.floor(Math.random()*e.length)],s.A_[d[t]]),expertise:(null===(n=I.race.summary)||void 0===n?void 0:null===(i=n.swimmer)||void 0===i?void 0:null===(a=i[0])||void 0===a?void 0:a.stroke_index_value)?eg(null===(o=I.race.summary)||void 0===o?void 0:null===(r=o.swimmer)||void 0===r?void 0:null===(l=r[0])||void 0===l?void 0:l.stroke_index_value):"",limit:5,page:J};T((0,g.T$)(p))}},[I,J]),(0,a.tZ)(a.HY,{children:O?(0,a.tZ)(W.Z,{}):(0,a.BX)(a.HY,{children:[ed&&(0,a.tZ)(u.Z,{className:k.backButton,children:(0,a.tZ)(q.Z,{variant:"contained",startIcon:(0,a.tZ)(eY.Z,{}),size:"small",onClick:function(){K(0),w.back()},children:c.Y2.actions.back.name})}),(0,a.tZ)(eH,{tableBodyData:X,selectedSwimmerId:M,setSelectedSwimmerId:B,activeSwimmerIndex:U,setPage:$,page:J})]})})},eq=!0,eQ=function(e){var t=(0,l.v9)(function(e){return e.userVideos.videoDetail});return(0,a.BX)("div",{children:[(0,a.BX)(r(),{children:[(0,a.tZ)("title",{children:c._y.GOSWIM_GALLERY}),(0,a.tZ)("link",{rel:"icon",href:"/favicon.ico"}),(0,a.tZ)("meta",{property:"fb:app_id",content:c._y.APP_ID}),(0,a.tZ)("meta",{property:"og:site_name",content:c._y.GOSWIM}),(0,a.tZ)("meta",{property:"og:title",content:c._y.GOSWIM_GALLERY}),(0,a.tZ)("meta",{property:"og:type",content:c._y.WEBSITE}),(0,a.tZ)("meta",{property:"og:image",content:null==t?void 0:t.thumbnailUrl}),(0,a.tZ)("meta",{property:"og:image:secure_url",content:null==t?void 0:t.thumbnailUrl}),(0,a.tZ)("meta",{property:"og:url",content:s._n}),(0,a.tZ)("meta",{name:"author",content:c._y.GOSWIM})]}),(0,a.tZ)("main",{children:(0,a.tZ)(eK,(0,i.Z)({},e))})]})}},4291:function(e,t,n){"use strict";var i=n(14924),a=n(35944);n(67294);var o=n(53337),r=n(29630),l=(0,o.Z)(function(e){return{ribbon:(0,i.Z)({zIndex:1,"--f":"10px","--r":"0px","--t":"10px",position:"absolute",inset:"var(--t) calc(-1 * var(--f)) auto auto",padding:"4px 32px 12px 32px",clipPath:"polygon(\n    0 0,\n    100% 0,\n    100% calc(100% - var(--f)),\n    calc(100% - var(--f)) 100%,\n    calc(100% - var(--f)) calc(100% - var(--f)),\n    0 calc(100% - var(--f)),\n    var(--r) calc(50% - var(--f) / 2)\n  )",backgroundImage:"linear-gradient(to right, #E9EEF4, #C3D7EE)",boxShadow:"0 calc(-1 * var(--f)) 0 inset #7C9ABF",borderRadius:"5px 5px 0 0px"},e.breakpoints.down("sm"),{margin:0}),titleSection:{color:"light"===e.palette.mode?e.palette.primary.main:e.palette.primary.dark}}});t.Z=function(e){var t=l();return(0,a.tZ)("div",{className:t.ribbon,style:{margin:"card"===e.component?"0px":"16px"},children:(0,a.tZ)(r.Z,{variant:"h6",className:t.titleSection,children:e.label})})}},9721:function(e,t,n){"use strict";n.d(t,{BL:function(){return a},C3:function(){return C},CB:function(){return h},E4:function(){return y},EL:function(){return i},JY:function(){return d},LZ:function(){return T},Ms:function(){return l},RC:function(){return E},RW:function(){return I},Rm:function(){return m},Rq:function(){return r},V4:function(){return N},Wb:function(){return c},Wd:function(){return g},Y2:function(){return k},_y:function(){return Z},aZ:function(){return p},be:function(){return f},dQ:function(){return w},dp:function(){return x},gM:function(){return _},hy:function(){return b},kC:function(){return s},kW:function(){return o},l4:function(){return v},ln:function(){return A},o_:function(){return S},sY:function(){return u}});var i={PRICING:"PRICING",BLOG:{name:"Blog",title:"BLOG"},SUPPORT:"Support",TUTORIALS:"Tutorials",COLLEGE:{name:"College",title:"COLLEGE"},PARENT:{name:"Parent",title:"PARENT"},CTA_TITLE:"KEEP LEARNING DAILY WITH OUR AUTO-DELIVERY FEATURE.",CTA_DESCRIPTION_ONE:" We at GoSwim, believe that learning never stops. We share videos everyday, following weekly themes to help you learn a skill better.",CTA_DESCRIPTION_TWO:"C
1ombine this with your ability to easily search through over 3,000 technique videos to find just the right video for you.",FAQ_TITLE:"COACHES CAN SHARE VIDEOS WITH THEIR SWIMMERS EVERY DAY.",FAQ_DESCRIPTION_ONE:"The Coach can shape the technique education to their athletes and seasonal plan.",FAQ_DESCRIPTION_TWO:"When the coach shares technique videos with the athletes BEFORE practice, the coach can spend less time explaining a skill, and more time practicing that skill.",FAQ_DESCRIPTION_THREE:"Check out all the features below in more detail.",FEATURES_TITLE:"WHAT CAN MAKE YOU FASTER?",FEATURE_DESCRIPTION_ONE:"Subscribe to GoSwim and gain access to thousands of videos that will help increase your swimming knowledge. Find the techniques and fine points that will help you individualize your stroke for better performance.",FEATURE_DESCRIPTION_TWO:"Take the images and ideas with you to the pool.",HERO_TITLE:"Become A Better Swimmer",HERO_DESCRIPTION_ONE:"Subscribe to GoSwim and gain access to thousands of videos that will help increase your swimming knowledge. Find the techniques and fine points that will help you individualize your stroke for better performance.",HERO_DESCRIPTION_TWO:"The more you know, the faster you’ll go",TESTMONIALS_TITLE:"IMPROVE WITH DATA",TESTIMONIALS_DESCRIPTION_ONE:"When you subscribe to GoSwim, you'll have access to our new app that can evaluate your swims. You'll learn important information about stroke rate, distance per stroke, swim velocity, and much more.",TESIMONIALS_DESCRIPTION_TWO:"We will then take that information, and recommend which videos will be the most appropriate to help you improve."},a={COURSE_PAGE_DESCRIPTION:"Each Course contains a collection of Lessons on a single topic or featuring a specific swimmer. The Lessons within a Course can also be scheduled for auto-delivery to your inbox, so you can start to direct your own learning on a daily basis.",SELECT_DAYS_TO_SCHEDULE:"Select the days of the week to schedule lessons",SCHEDULING_RESTRICTED_FOR_LOCKED_COURSE:"Can't schedule this course. Part of the lessons are locked",SEARCH_RESULTS_EMPTY_DESCRIPTION:"Please check the course name or try searching some other courses",DELETE_COURSE_CONFIRMATION_TITLE:"Delete this Course?",NO_GROUPS_TOAST_TEXT:"Please create a group before schedule course!!",OVERWRITE_PREVIOUS_SCHEDULE:"Overwrite previously scheduled lessons?",OVERWRITE_CHECKBOX_LABEL:"Yes, overwrite lessons",ADMIN_COURSES_PAGE_TITLE:"COURSES",COURSE_CREATE_BUTTON:"NEW COURSE",ADMIN_COURSE_CARD_TITLE:"Lessons of this course",COURSE_LABEL:"COURSE"},o={SEARCH_RESULTS_EMPTY:"Sorry, No results available!"},r={DELETE_GROUP:"Delete Group",LEAVE_GROUP:"Leave Group",EXIT_GROUP:"Exit Group",SEE_LISTOF_GROUPS:"Here you can see the list of groups you are in",PLEASE_SUBSCRIBE:"Please Subscribe to Continue",GROUPS_PAGE_DESCRIPTION:"Quickly add groups to share videos and data, and distribute invite links to athletes.",TO_MANAGE_MEMBERS:"To manage members, ",NO_GROUPS_FOUND:"No groups found",YOUR_FREE_LESSON:"YOUR FREE LESSON FOR TODAY",DONT_BELONG_GROUP:"Looks like You don't belong to this group",REMEMBER_FOR_GROUPS_MENU:"Remember, there's always a shared video in the Go Swim Group listed under the GROUPS menu.",NOTHING_TO_WATCH_IN_GROUP:"Looks like there is nothing to watch in your group today.",INDIVIDUAL_GROUP_REMOVE_USER:"Select individual group to remove user",GROUP_LABEL:"Group",UPPER_CASE_ALL:"ALL",PASCAL_CASE_ALL:"All",LOWER_CASE_ALL:"all",PREMIUM_GROUPS_PAGE_TITLE:"PREMIUM GROUPS",CREATE_NEW_GROUP:"Create New Group",ADD_GROUP:"Add Group",CHOOSE_GROUP_LOGO:"Choose Group Logo",GROUP_DETAILS:"Group Details",EDIT_GROUP:"Edit Group",SEARCH_GROUPS:"Search Groups",SELECTED_GROUPS_COUNT:"Selected ( %s ) %s",PREMIUM:"Premium",ACTIVATE_PREMIUM_TITLE:"Activate Premium Groups",ASK_PG_UPGRADE:"Do you want to upgrade %s premium group?",PREMIUM_GROUP_LABEL:"Premium Group",OWNER_LABEL:"Owner",DELETE_PREMIUM_GROUP:"Delete Premium Group",ADD_MEET_NAME:"Add Meet Name",CSV_BULK:"Or Bulk Upload Meet Names via CSV",IMPORT_CSV:"Import & Upload CSV"},l={PAGE_TITLE:"Calendar",CALENDAR_DESCRIPTION:"This summary page shows all videos shared by your coach and GoSwim",LESSON_ALREADY_EXISTS:"Lesson %s is already scheduled on %s."},s={NOT_AVAILABLE:"No Weekly Themes Available",WeeklyThemePageDescription:"Every week, GoSwim presents a series of videos focused on one focused skill. Dig deeper into the fine points of swimming.",SELECT_LESSON_TO_ASSIGN:"Select a lesson to assign for each date.",DELETE_CONFIRMATION:"Delete this weekly theme?",SEARCH_WEEKLY_THEMES:"Search Weekly Themes"},c={NO_FAVORITES_DESCRIPTION:"You haven't added any lessons to favorites."},d={CREATE_PREMIUM_GROUP:"Create Premium Group",EDIT_PREMIUM_GROUP:"Edit Premium Group",PREMIUM_GROUPS_ACTION:"%s Premium Group"},u={SEARCH_RESULTS_EMPTY_DESCRIPTION:"Please check the lesson name or try searching some other lessons",DELETE_SCHEDULE_LESSON_CONFIRMATION:"Do you want to delete this scheduled lesson?",DELETE_ALL_SCHEDULE_LESSON_CONFIRMATION:"Do you want to delete all scheduled lesson?",ALREADY_EXISTS:"Lesson Already Exists",ALREADY_SCHEDULED:"is already scheduled on",SIGN_IN_TO_WATCH:"Sign In to watch video",SUBSCRIBE_TO_WATCH:"Subscribe to watch",ADD_TO_FAVORITE:"Add to favorite",REMOVE_FROM_FAVORITE:"Remove from Favorite",DIALOG_TITLE:"Lesson Already Exists",SCHEDULING_RESTRICTED_FOR_LOCKED_LESSON:"You do not have access to the lesson, so you can’t schedule the lesson",LESSON_PAGE_DESCRIPTION:"Browse through our thousands of Lessons to gain a deeper understanding of swimming. Use our search bar located above or, if you're new to the site, use the Guided View to help narrow down the Lessons presented to you. If you use the Guided View, you’ll also be able to add your Expertise Level as an additional filter.",DELETE_CONFIRMATION:"Delete this Lesson?",NO_GROUPS_TOAST_TEXT:"Please create a group before schedule lesson!",CLICK_TO_SUBSCRIBE:"CLICK HERE TO SUBSCRIBE NOW",NO_LESSONS_AVAIALBLE:"No Lessons are available!!",CLICK_TO_ADD_LESSONS:"Click here to add lessons to this course",ADMIN_LESSONS_TITLE:"LESSONS",
1LESSON_CREATE_BUTTON_TEXT:"NEW LESSON",ADMIN_LESSONS_ACTION:"%s Lesson",LESSON_LABEL:"Lesson",TODAYS_LESSON_HEADER:"YOUR LESSON%s FOR TODAY",MESSAGE_FROM:"Message from %s",PREVIOUS_WEEKLY_THEMES:"Previous Weekly Themes",FAVORITES_PAGE_TITLE:"Favorites",WEEKLY_THEMES:"Weekly Themes",NEW_WEEKLY_THEME:"New Weekly Theme",PURCHASE:"Purchase to watch"},p={MEMBERS_PAGE_DESCRIPTION:"See which members of your Training Group are active, who still needs to accept their invitation, and add new members quickly.",SETTINGS_UPDATE_FAILED:"Unable to update settings",SELECT_TO_INVITE_OR_REMOVE:"*Please select individual group to invite or remove user",NO_ACCESS_TO_EDIT_GROUP:"You don't have access to edit this group",SELECT_GROUP_TO_REMOVE_USER:"Select individual group to remove user",NO_MEMBERS:"No members found",SEND_INVITE_TITLE:"Send Invitation",SEND_INVITE_DESCRIPTION:"Are you sure to send e-mail invitations to selected members?",IMPORT_TITLE:"Import",EXPORT_TITLE:"Export",IMPORT_DESCRIPTION:"Please select a Group to Import the members",EXPORT_DESCRIPTION:"Please select a Group to Export the members",REMOVE_MEMBER_TITLE:"Remove Member",DELETE_MEMBER_TITLE:"Delete Member",REMOVE_USER_TITLE:"Remove User",DELETE_USER_TITLE:"Delete User",SELECTED_MEMBER_COUNT:"Selected ( %s ) member",SELECTED_MEMBERS_COUNT:"Selected ( %s ) members",SEND_TRIAL:"Send Trial",SEARCH_MEMBERS:"Search Members",ALL:"All",ADD_NEW_MEMBER:"Add New Member",SUBSCRIBE_TO_ADD_MEMBERS:"Subscribe To Add Members",ADD_NEW_GROUP:"Add New Group",EXISTING_MEMBER_ROLE_CONFIRMATON:"%s is already a %s",CAN_ADD_NEW_GROUPS:"Can add new Groups?",CAN_MANAGE_GROUPS:"Can manage current Groups?",MEMBER_DETAILS:"Member Details",EDIT_MEMBER:"Edit Member",ENABLE_FREE_SUBSCRIPTION:"Enable Free Subscription",SELECT_MEMBER:"Select Member"},m={MAX_SWIMMER_COUNT:"Maximum swimmer count reached for %s group",MAX_COACH_COUNT:"Maximum coach count reached for %s group",CONIFRM_DELETE:"Delete User Confirmation",ASK_DELETE:"Do you want to delete this user?",ROLE_CHANGE:"Role Change Confirmation",ADMIN_USERS_TITLE:"USERS",ADMIN_NCAA_USERS_TITLE:"NCAA USERS",ADMIN_SALES_REPS_TITLE:"SALES REP",USERS_PASCAL_CASE:"Users",ROLE_CHANGE_CONFIRMATION:"Do you want to change the role to %s?",ADD_MEMBER:"Add Member",USER_ALREADY_EXIST_IN_GROUP:"User already exists in %s group"},h={VIDEOS:"VIDEOS",SEARCH_VIDEOS:"Search Videos",CHOOSE_FILE:"CHOOSE FILE",DELETE_TITLE:"Delete this video?",NO_VIDEOS:"NO VIDEOS AVAILABLE",FILE_NAME_REQUIERED:"Video File Name is required",VIDEO_DEREFERENCE_WARNING:"Be very careful about changing this, this will not rename the remote file name and you risk dereferencing the video",DOWNLOAD_LIST:"Download a list of video plays to track your progress.",NO_RELATED_VIDEOS:"No related videos available",STEPS_COMPLETED:"All steps completed - you're finished",FAILED_TO_PLAY:"Failed to load! Try again later.",RELATED_VIDEOS_TITLE:"Related Videos",MORE_VIDEOS_BUTTON_TEXT:"More Videos",DOWNLOAD_PLAYS:"Download Plays",RECOMMENDED_VIDEOS:"Recommended videos related to your current lesson %s"},v={TITLE:"THIS WEBSITE USES COOKIES",DESCRIPTION:"GoSwim uses cookies on its websites to personalize content and to analyze our traffic. By clicking to allow cookies below, you are consenting to use of cookies as described in our",COOKIE_POLICY_LINK:"Cookie Policy",STRICTLY_NECESSARY:"Strictly Necessary",STATISCTICS_COOKIES:"Statistics Cookies",CONFIRM_BUTTON:"Confirm my choices",ACCEPT_BUTTON:"Accept all"},g={DESCRIPTION_ONE:"An Official Technique Video Supplier to USA Swimming.",TERMS_LABEL:"TERMS OF %s",USE_LABEL:"USE",SERVICE_LABEL:"SERVICE",PRIVACY_NOTICE:"PRIVACY NOTICE",TERMS_SERVICE:"Terms of Service",TERMS_USE:"Terms of Use",COOKIE_SETTINGS:" Cookie Settings",GS:"Goswim"},f={COURSES_LABEL:"Courses",LESSONS_LABEL:"Lessons",CONTRACTS_LABEL:"Contracts",SALESREP_LABEL:"Sales Rep *",VIDEOS_LABEL:"Videos",GROUPS_LABEL:{name:"Groups",formTitle:"GROUPS"},DEFAULT_GROUP:"Default Group",STROKE_LABEL:"Stroke",EXPERTISE_LABEL:"Expertise",TAG_LABEL:"Tag",ANATOMY_LABEL:"Anatomy",CAMERA_POSITION:"Camera Position",TIMEZONE_LABEL:"Timezone",HOME:"Home",TEAMS:"Teams",TEAM:"Team",P
1LAYS:{TITLE:"PLAYS",NAME:"Plays"},PLANS:"Plans",GS_WEEKLY_THEME:"Goswim Weekly Theme",TIME:"Time",TYPE:"Type",PIP:"Picture-in-picture",ABOUT:"About",FAQ:"FAQ",COMPANY:"Company",PRIVACY:"Privacy",STATISTICS:{name:"Statistics",title:"STATISTICS"},PRE_GROUPS:"Premium Groups",PRE_USERS:"NCAA Users",SELECT_DATE_RANGE:"Select Date Range",NO_RESULTS:"No Results Found",SELECT_EVENT:"Event",EVENT_TYPE:"Event Type",CHILDREN:"Children",SELECT_MEMBER:"Select Member",MEET_NAME:"Meet Name",MEET_NAMES:"Meet Names",SELECT_GROUPS:"Select Groups",SALES_REPS:"Sales Reps"},E={TITLE:"Reset Password",RESET_PASSWORD_CANCEL_ACTION_BUTTON_TEXT:"Cancel"},S={CONFIRM_LOGOUT_TITLE:{name:"Log Out",formTitle:"LOG OUT"},CONFIRM_LOGOUT_DESCRIPTION:"Are you sure you want to Logout?"},y={CANCEL:"Cancel",REMOVE:"Remove",DELETE:"Delete",YES:"Yes",NO:"No",OK:"Ok",SUBSCRIBE:{name:"Subscribe",formTitle:"SUBSCRIBE"},CONFIRMATION:"Confirmation",ACTIVATE:"ACTIVATE",UPGRADE:"UPGRADE",CREATE_ACCOUNT:"CREATE ACCOUNT",SIGN_IN:"Sign In",RESET_PASSORD_BUTTON_TEXT:"Change My Password",CLEAR_FILTER:"CLEAR FILTER",APPLY:"Apply",SCHEDULE_BUTTON_TEXT:"Schedule %s",DOWNLOAD_VIDEO:"Download Video",DOWNLOAD_FILE:"Download File",SUBMIT:"Submit",CLEAR:"Clear",SORT:"SORT",RESEND_INVITE:"Resend Invite",LOOP:"Loop Video"},b={CONFIRM_DELETE_WORKOUT_TITLE:"Do you want to delete this Workout?",CONFIRM_DELETE_WORKOUT_ACTION:"Delete"},x={CONFIRM_REMOVE_TITLE:"Remove this course?"},_={LABEL:"Search %s"},w={FILTER_BUTTON_TEXT:"FILTERS",RESET_BUTTON_TEXT:"RESET",FILTERS:{role:{name:"Role",type:"role",options:{}},sort:{name:"Sort",type:"sort",options:{recent:"Recent",most_active:"Most Active",least_active:"Least Active",alphabetical:"Alphabetical",reverse_alphabetical:"Reverse Alphabetical"}},subscription_status:{name:"Subscription Status",type:"subscription_status",options:{}},state:{name:"State",type:"state",options:{all:"All",published:"Published",incomplete:"Incomplete",untagged:"Untagged"}}}},T={TABLE_COLUMNS:{name:"Name",email:"Email",role:"Role",status:"Status",actions:"Actions",groupName:"Group Name",ownerEmail:"Owner Email",validTill:"Valid Till",members:"Members",subscription:"Subscription",plan:"Plan",purchasedOn:"Purchased on",price:"Price",autoRenewsOn:"Auto renews on",periodStart:"Period start",periodEnd:"Period end",memberName:"Member Name",coaches:"Coaches",swimmers:"Swimmers",colorTheme:"Color Theme",createdBy:"Created By",noOfCoaches:"No. of coaches",noOfSwimmers:"No. of swimmers",brandTheme:"Brand Theme",subTotal:"SubTotal",totalDue:"Total Due Today",item:"Item",from:"From",to:"To",revenue:"Revenue",liability:"Liability",total:"Total",percentOfViews:"Percent Of Views",attributableRevenue:"Attributable Revenue",count:"Count",noData:"--",lastScheduled:"Last Scheduled",lastShared:"Last Shared",recentLogin:"Recent Login",createdAt:"Created At",ncaaShare:"NCAA Share",position:"Position",invitationLink:"Invitation Link",maximumEvaluations:"Max. Evaluations"}},k={create:{name:"Create",type:"create",formTitle:"CREATE"},edit:{name:"Edit",type:"edit",formTitle:"EDIT"},view:{name:"View",type:"view",formTitle:"VIEW"},add:{name:"Add",type:"add",formTitle:"ADD"},copyLink:{name:"Copy Link"},update:{name:"Update",type:"update",formTitle:"UPDATE"},nameTextField:{label:"Name",value:"full_name",req:"Name *"},eventNameTextField:{label:"Name",value:"name"},eventIdTextField:{value:"id",label:"ID number"},dobTextField:{label:"Birthday"},emailTextField:{label:"Email",value:"email"},confirmEmailTextField:{label:"Confirm Email",value:"confirmEmail"},passwordField:{label:"Password",value:"password"},confirmPasswordField:{label:"Confirm Password",value:"confirmpassword"},passwordConfirmationField:{value:"passwordConfirmation"},titleTextField:{label:"Title*",value:"name",name:"Title"},positionTextField:{label:"Position",value:"position",type:"number",helperText:"Where is this %s in relation to other %s? (0 - top of the list, %s - bottom of the list)"},revenueSplitTextField:{label:"Revenue Split",value:"split",type:"number",name:"Split",reverse:"Split Revenue"},subtitleTextField:{label:"Subtitle",value:"subtitle"}
1,thumbnailField:{label:"Thumbnail",value:"thumbnail_file_name"},descriptionField:{label:"Description*",value:"description",name:"Description"},groupNameTextField:{label:"Group Name *",value:"name"},groupAdminEmailField:{label:"Group Admin Email*",value:"email"},countTextField:{label:"%s Count*",value:"no_of_%s",type:"number"},upgradeCountTextField:{label:"New %s Count*",value:"upgraded_%s",type:"number"},priceTextField:{label:"Price*",value:"price",type:"number"},upgradePriceTextField:{label:"New Price*",value:"upgraded_price",type:"number"},groupStatusField:{label:"Group Status",value:"status"},campaignType:{label:"Campaign",value:"campaign"},campaignName:{label:"Campaign Name:"},commissionDetails:{label:"Commission Details:"},campaignId:{label:"Campaign ID:"},designateExpertiseField:{label:"Designate Expertise *",value:"video_level"},swimmerReference:{label:"Sales Ref",value:"video_level"},upgradeDesignateExpertiseField:{label:"New Designate Expertise",value:"upgraded_video_level"},parentEmailField:{label:"Parent/Guardian Email Address",value:"secondary_email"},planDuration:{label:"Plan Duration",value:"plan_duration"},publishCheckbox:{label:"Publish",value:"published"},bonusCheckbox:{label:"Bonus Content",value:"bonus"},ageCheckbox:{label:"User Age",value:"isAgeEligible"},termsAgreedCheckbox:{value:"terms_agreed"},emailUpdateCheckbox:{value:"promotion_enabled"},rememberCheckbox:{label:"Remember Me",value:"remember_me"},actions:{save:{name:"Save"},back:{name:"Back"},saveAndInvite:"Save & Invite",close:{name:"Close"},assign:{name:"Assign"},reset:{name:"Reset"},showMore:{name:"show more"}
1,showFew:{name:"show fewer"},submitForReview:"Submit for Review"},clone:{label:"Clone"},divider:{existing_plan:"Current Plan",upgrade_plan:"Edit Plan"},affiliateTraverse:{label:"Affiliate Program Traverse"},swimmerPlanPrice:"Swimmer Plan Price"},N={ICON_BTN:"Iconbutton",ICON:"icon",SCHEDULED_LESSONS_TITLE:"MY SCHEDULED LESSONS",SEE_FULL_SCHEDULE:"SEE FULL SCHEDULE",DASHBOARD:"Dashboard",JUST_ADDED:"Just Added",RECENTLY_WATCHED:"Recently Watched",YARDS_PER_DAY:"Yards per Day of the Week",YARDS_PER_WEEK:"Yards per Week",WORKOUTS:"Workouts",NO_WORKOUTS_MSG:"No Workouts found for this week"},A={categorySelectField:{label:"Select Category",value:""},finePointField:{label:"Select Fine Point",value:""}},Z={GOSWIM:"GoSwim",WEBSITE:"website",ADMIN:"Admin",ADMIN_USERS:"Admin | Users | GoSwim",ADMIN_COURSE:"Admin | Courses | GoSwim",ADMIN_GROUPS:"Admin | Groups | GoSwim",ADMIN_CREATE_GROUP:"Admin | Create Group | GoSwim",ADMIN_VIEW_GROUP:"Admin | View Group | GoSwim",ADMIN_EDIT_GROUP:"Admin | Edit Group | GoSwim",ADMIN_LESSON:"Admin | Lessons | GoSwim",ADMIN_VIDEOS:"Admin | Videos | GoSwim",ADMIN_WEEKLY_THEME:"Admin | Weekly Themes | GoSwim",ADMIN_EDIT_GROUPS:"Admin | Edit Groups | GoSwim",ADMIN_EDIT_LESSON:"Admin | Edit Lesson | GoSwim",ADMIN_EDIT_MEMBER:"Admin | Edit Member | GoSwim",ADMIN_VIEW_MEMBER:"Admin | View Member | GoSwim",ADMIN_EDIT_PRE_GROUPS:"Admin | Edit Premium Groups",ADMIN_VIEW_COURSE:"Admin | View Course | GoSwim",ADMIN_CREATE_COURSE:"Admin | Create Course | GoSwim",ADMIN_EDIT_COURSE:"Admin | Edit Course | GoSwim",ADMIN_VIEW_LESSON:"Admin | View Lesson | GoSwim",ADMIN_CREATE_LESSON:"Admin | Create Test Lesson | GoSwim",ADMIN_CREATE_PRE_GROUPS:"Admin | Create Premium Groups",ADMIN_PRE_GROUPS:"Admin | Premium Groups | GoSwim",ADMIN_STATISTCS:"Admin | Statistics | GoSwim",ADMIN_EVALUATION:"Admin | Evaluation | GoSwim",ADMIN_GROUPS_EDIT:"AdminGroupsEdit",GENERATED_BY:"Generated by create next app",ADMIN_GROUP_MEMBERS:"Admin | Group Members | GoSwim",ADMIN_PREMIUM_USERS:"Admin | NCAA Users | GoSwim",GOSWIM_PLAYS:"Plays | GoSwim",GOSWIM_PROFILE:"Profile | GoSwim",MEMBER_VIEW:"View Member | GoSwim",APP_ID:"533543026731451",BOOKINGS_GOSWIM:"Bookings | GoSwim",GOSWIM_COURSES:"Courses | GoSwim",GOSWIM_LESSONS:"Lessons | GoSwim",GOSWIM_BILLING:"Billing | GoSwim",GOSWIM_FAVORITES:"Favorites | GoSwim",GS_MORE_VIDEOS:"More Videos | GoSwim",GOSWIM_GALLERY:"Gallery | GoSwim",PURCHASED_VIDEOS:"Purchased Videos | GoSwim",GOSWIM_ANALYTICS:"Analytics | GoSwim",GOSWIM_PLANS:"Plans | GoSwim",GOSWIM_WEEKLY_THEME:"Weekly Theme | GoSwim",GOSWIM_SUBSCRIPTION_INFO:"Subscription Info | GoSwim",GOSWIM_RESET_PASSWORD:"Reset Password | GoSwim",GOSWIM_PARENT:"Parent | GoSwim",GOSWIM_COLLEGE:"College | GoSwim",GOSWIM_INVITE_GUIDE:"Invite Guide | GoSwim",GOSWIM_AFFILIATE:"Affiliate | GoSwim",GOSWIM_MEMBERS:"Members | GoSwim",GOSWIM_EVALUATION_EDIT:"Edit Evaluator | GoSwim",GOSWIM_EVALUATION_CREATE:"Create Evaluator | GoSwim",MEMBER_CREATE:"Create Member | GoSwim",MEMBER_EDIT:"Edit Member | GoSwim",DASHBOARD:"Dashboard | GoSwim",VIEW_GROUPS:"View Group | GoSwim",TODAYS_LESSON:"Today's Lesson | GoSwim",GROUPS:"Groups | GoSwim",TUTORIALS:"Tutorials | GoSwim",CHANGE_PASSWORD:"Change Password | GoSwim",SIGNIN:"Sign In | GoSwim",SIGNUP:"Sign Up | GoSwim",COMPANY_GS:"Company | GoSwim",GOSWIM_MARKETPLACE:"Marketplace | GoSwim",GOSWIM_CHAMPIONSHIP:"Championship | GoSwim",GS_COMPANY:"GoSwim Company",GOSWIM_COOKIE_POLICY:"Cookie Policy | GoSwim",GOSWIM_CALENDAR:"Calendar | GoSwim",FAQ_GS:"FAQ | GoSwim",GS_FAQ:"GoSwim Faq",PRIVACY_GS:"Privacy | GoSwim",GS_PRIVACY:"GoSwim Privacy",TERMS_SERVICE_GS:"Terms Of Service | GoSwim",GS_TERMS_SERVICE:"GoSwim Terms of service",TERMS_USE_GS:"Terms Of Use | GoSwim",GS_TERMS_USE:"GoSwim Terms of use",ADMIN_MEET_NAMES:"Admin | Meet Names | GoSwim",COMPANY_DESCRIPTION:"To create content that helps people of all ages and backgrounds to swim better and reach their full potential in the sport.",VIDEOS_DESCRIPTION:"Videos to inspire, educate and make you a better swimmer.",PRIVACY_DESCRIPTION:"This Privacy Policy applies to Go Swim Offer
1ings, which are provided to you via our website",WORKOUT_CREATE:"Workout | Create",WORKOUT_EDIT:"Workout | Edit",WORKOUT_CLONE:"Workout | Clone",WORKOUT_VIEW:"Workout | View",ERROR_404:"Error 404 | GoSwim",GOSWIM_LOGOUT:"Logout | GoSwim",MASTERS_TITLE:"Masters | GoSwim",ANDROID_DOWNLOAD_GS:"Download Android App | GoSwim",ANDROID_DOWNLOAD_DESCRIPTION:"Download the official GoSwim Android APK. Access thousands of swimming technique videos, coaching tools, and performance analytics on your Android device."},C={iosLink:"ios_link",macLink:"mac_link",androidLink:"android_link",logo:"Logo",promotion:"promotion"},I={COACH_OR_SWIMMING_EXPERT:"Coach/Swimming Expert",SWIMMER_OR_PARENT:"Swimmer/Parent",COACH:"Coach",EXPERT:"Expert",ATHLETE:"Athlete",PARENT:"Parent",SWIMMER:"Swimmer",EVALUATOR:"Evaluator",CONTRACT:"Contract",ADMIN:"Admin",UNKNOWN:"Unknown"}},25281:function(e,t,n){"use strict";n.d(t,{z:function(){return i}});var i={TITLE:"Gallery",CAPITALIZED_TITLE:"GALLERY",PURCHASED_VIDEOS:"Purchased Videos",NO_DATA:"Your gallery is empty",NO_DATA_DESCRIPTION:"Start capturing your swimmer or upload races you already have! Film their next race or practice session using our app, and it will appear here for easy access and sharing.",DESCRIPTION:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum",tableText:{breakoutSplit:"Breakout Split",breakoutDistance:"Breakout Distance",yard:"Yard",stroke:"Stroke",tempo:"Tempo",dpc:"DPC",yardOrCycle:"Yard/Cycle",meterOrCycle:"Meter/Cycle",mSplit:"15M Split",swimVelocity:"Swim Velocity",yardOrSec:"Yard/Sec",meterOrSec:"Meter/Sec",splits:"Splits",seconds:"Sec",turnOrFinishTime:"Turn/Finish Time",lap:"Lap",courseLength:"Course Length",selectEventLength:"Event Length",meter:"Meter",underwaterVelocity:"Underwater Velocity"},GALLERY_NAV_TOOLTIP:"View all your app-recorded videos in one place. Review every race!",SELECT_SWIMMER:"Select Swimmer"}},38530:function(e,t,n){"use strict";n.d(t,{dN:function(){return l},i8:function(){return r}});var i=n(30381),a=n.n(i),o=n(66432),r=function(e){return a()(e).format(o.t6.DATE_WITH_SPACE)};function l(e){var t=a().duration(e,"seconds"),n=Math.floor(t.asMinutes()),i=t.seconds(),o=t.milliseconds();return"".concat(String(n).padStart(2,"0"),":").concat(String(i).padStart(2,"0"),".").concat(String(o).padStart(3,"0"))}},93451:function(e,t,n){"use strict";n.d(t,{Z:function(){return F}});var i=n(14924),a=n(26042),o=n(69396),r=n(828),l=n(35944),s=n(30120),c=n(72389),d=n(73595),u=n(49837),p=n(91359),m=n(29630),h=n(73327),v=n(53337),g=n(67294),f=n(25617),E=n(20843),S=n(66432),y=n(2415),b=n(38530),x=n(11163),_=n(44731),w=n(9144),T=n(62904),k=n(9747),N=n(77703),A=n(86010),Z=(0,v.Z)(function(e){return{avatarText:{width:28,height:28,color:"#fff",border:"3px solid"},swimmerList:{background:e.palette.primary.main,borderColor:"light"===e.palette.mode?"#D3F1F9":e.palette.primary.light},moreSwimmers:{borderColor:"light"===e.palette.mode?e.palette.grey[300]:e.palette.grey[400]},customFont:(0,a.Z)({},(0,a.Z)({},N.Z.body4))}});function C(e){var t,n,i=Z(),a=null==e?void 0:e.swimmersNames.slice(0,4),o=null==e?void 0:e.swimmersNames.slice(4,null==e?void 0:e.swimmersNames.length),r=null==o?void 0:o.map(function(e,t){return"".concat(e).concat((null==o?void 0:o.length)===t+1?"":","," ")});return(0,l.BX)(w.Z,{direction:"row",mb:1,spacing:-.8,children:[a.map(function(e){return(0,l.tZ)(T.Z,{title:e,children:(0,l.tZ)(_.Z,{className:(0,A.Z)(i.avatarText,i.swimmerList),children:(0,l.tZ)(m.Z,{className:i.customFont,children:(0,k.Pw)(e||"").toUpperCase()})})})}),(null===(t=e.swimmersNames)||void 0===t?void 0:t.length)>4&&(0,l.tZ)(T.Z,{title:r,children:(0,l.tZ)(_.Z,{className:(0,A.Z)(i.avatarText,i.moreSwimmers),children:(0,l.tZ)(m.Z,{className:i.customFont,children:"+".concat((null===(n=e.swimmersNames)||void 0===n?void 0:n.length)-a.length)})})})]})}
1var I=n(4291),O=(0,v.Z)(function(e){var t;return(0,h.Z)({wrapper:(0,i.Z)({height:"100%"},e.breakpoints.between(1200,1400),{height:"300px"}),root:{width:"100%",backgroundColor:"".concat(e.palette.background.paper," !important"),margin:0,borderRadius:"8px !important",minHeight:"100%",backgroundImage:"none","&:hover .MuiCardMedia-root":{transform:"scale(0.94,0.9)",borderRadius:4},"&:hover $font":{zIndex:0}},cardMedia:(t={width:"100%",height:"100%",borderRadius:4},(0,i.Z)(t,e.breakpoints.down("sm"),{maxHeight:"inherit !important"}),(0,i.Z)(t,"&:hover",{transform:"scale(0.94,0.9)",borderRadius:4}),t),divRelative:{position:"relative",aspectRatio:"16/8"},divAbsolute:{position:"absolute",bottom:0,right:0,width:"30px !important",height:"30px !important",backgroundColor:e.palette.primary.main,color:e.palette.background.default,borderRadius:"5px 0 0 0",padding:"4px"},noSpace:{margin:0,padding:0},desc:{maxWidth:"100%",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:2,overflow:"hidden",textOverflow:"ellipsis",wordBreak:"break-word"},title:{maxWidth:"100%",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:1,overflow:"hidden",textOverflow:"ellipsis",textTransform:"capitalize"},cardImg:{width:"100%"},font:{position:"absolute",top:"10%",left:"5%",padding:"5px 10px",borderRadius:"5px",background:"#0000006a !important",color:e.palette.common.white,textAlign:"center",backgroundColor:e.palette.common.white,textTransform:"uppercase"},lessonCardLink:{textDecoration:"none !important",cursor:"pointer"},spanDot:{color:"#FFA500",textAlign:"center"},spanValue:(0,o.Z)((0,a.Z)({},e.typography.body2),{textAlign:"center"}),triangleBottomleft:{width:e.spacing(7),height:e.spacing(7),display:"flex",alignItems:"center",background:"dark"===e.palette.mode?"linear-gradient(to bottom left, #ffffff00 0%, #ffffff00 50%, ".concat(e.palette.primary.dark," 50%, ").concat(e.palette.primary.dark," 100%)"):"linear-gradient(to bottom left, #ffffff00 0%, #ffffff00 50%, ".concat(e.palette.primary.main," 50%, ").concat(e.palette.primary.main," 100%)")},lockImgBox:{position:"absolute",bottom:"20%",left:"10%",borderRadius:3}})}),F=function(e){var t,n,i,a,o,h,v,_,w,T,N,A,Z,F,D,R,L,M,B,P,G,U,V,W,z,X,H,Y,j,K,q=O(),Q=(0,x.useRouter)(),J=Q.asPath,$=(null===(F=Q.asPath.split("/"))||void 0===F?void 0:F.length)>2,ee=J.includes("/gallery"),et=Q.asPath.split("/").includes("purchased-videos"),en=Q.asPath.split("/").includes("home"),ei=(0,f.v9)(function(e){return e.account}),ea=ei.theme,eo=ei.user,er=(0,y.vQ)(y.xB),el=ea||er,es=!el&&!er||el===S.JV.LIGHT,ec=(0,r.Z)((0,g.useState)((null==e?void 0:null===(D=e.lesson)||void 0===D?void 0:D.thumbnailUrl)?e.lesson.thumbnailUrl:es?S.E8:S.U5),1)[0],ed=(0,f.v9)(function(e){var t,n;return null==e?void 0:null===(t=e.account)||void 0===t?void 0:null===(n=t.user)||void 0===n?void 0:n.isUsaSwimUser}),eu=(null==eo?void 0:eo.role)===S.Qm.SWIMMER,ep=(null==eo?void 0:eo.role)===S.Qm.COACH,em=(null==eo?void 0:eo.role)===S.Qm.ADMIN,eh=(null==eo?void 0:eo.isNCAAPlanUser)||(null==eo?void 0:eo.specialGroupActive),ev=null!=eo&&!!eo.subscription&&(null==eo?void 0:null===(R=eo.subscription)||void 0===R?void 0:R.product_id)!==(y.An||y.yR)&&((null==eo?void 0:null===(L=eo.subscription)||void 0===L?void 0:L.status)===S.yh.ACTIVE||(null==eo?void 0:null===(M=eo.subscription)||void 0===M?void 0:M.status)===S.yh.TRAILING),eg=null==eo?void 0:eo.specialGroupActiveExpertise,ef=null==eo?void 0:eo.specialGroupActive,eE=null==e?void 0:null===(B=e.lesson)||void 0===B?void 0:null===(P=B.race)||void 0===P?void 0:null===(G=P.summary)||void 0===G?void 0:G.swimmer,eS=Q.asPath.includes("annotationVideo"),ey=(null==eo?void 0:eo.isChinaUser)&&!(null==eo?void 0:eo.sales_rep_id)&&
1(null==eo?void 0:null===(U=eo.subscription)||void 0===U?void 0:U.product_name)==="Free",eb=function(){var t,n,i,a,o,r;if((null==e?void 0:null===(t=e.lesson)||void 0===t?void 0:null===(n=t.race)||void 0===n?void 0:null===(i=n.summary)||void 0===i?void 0:i.swimmer)&&(null==e?void 0:null===(a=e.lesson)||void 0===a?void 0:null===(o=a.race)||void 0===o?void 0:null===(r=o.summary)||void 0===r?void 0:r.swimmer.length)>0){var l,s,c,d=eS?0:e.activeSwimmerIndex,u=null==e?void 0:null===(l=e.lesson)||void 0===l?void 0:null===(s=l.race)||void 0===s?void 0:null===(c=s.summary)||void 0===c?void 0:c.swimmer[d];return null==u?void 0:u.full_name}return""},ex=function(){var t=null==e?void 0:null===(n=e.lesson)||void 0===n?void 0:n.race;if(t){var n,i,a=t.race_length,o=t.pool_length,r=t.event,s=t.event_type,c=null===(i=t.event_details)||void 0===i?void 0:i.event_name;return(0,l.BX)("span",{className:q.spanValue,children:[a&&a,(0,l.tZ)("span",{className:q.spanDot,children:" • "}),o&&o,(0,l.tZ)("span",{className:q.spanDot,children:" • "}),r&&r,(0,l.tZ)("span",{className:q.spanDot,children:" • "}),c||s]})}return null},e_=function(){var t,n,i,a,o,r,l,s,c,d,u,p,m=null===(t=e.lesson)||void 0===t?void 0:null===(n=t.race)||void 0===n?void 0:null===(i=n.pin_data)||void 0===i?void 0:i.versions,h=e.selectedSwimmerId;return m&&(null==m?void 0:m.length)>1&&h?o=null===(s=m.filter(function(e){return e.version_id===h}))||void 0===s?void 0:null===(c=s[0])||void 0===c?void 0:c.pins:m&&(null==m?void 0:m.length)===1&&(o=null===(d=m[0])||void 0===d?void 0:d.pins),r=(null==o?void 0:o[0].pin_time_s)||0,(l=(null==o?void 0:null===(a=o[o.length-1])||void 0===a?void 0:a.pin_time_s)||0)&&r?l-r:null===(u=e.lesson)||void 0===u?void 0:null===(p=u.race)||void 0===p?void 0:p.duration_s},ew=function(){var t,n,i,a=null==e?void 0:null===(t=e.lesson)||void 0===t?void 0:t.updated_at,o=$?e_():null==e?void 0:null===(n=e.lesson)||void 0===n?void 0:null===(i=n.race)||void 0===i?void 0:i.duration_s;return a&&o?(0,l.BX)(l.HY,{children:[(0,l.tZ)("span",{style:{opacity:.7},children:"Last Modified: "}),(0,b.i8)(a)," |",(0,l.tZ)("span",{style:{opacity:.7},children:" Duration in mins: "}),(0,k.Cx)(o)]}):null},eT=function(){var t,n,i,a;switch(!0){case em:case!!(null===(t=e.lesson)||void 0===t?void 0:t.isUsaSwimVideo):case!!(null===(n=e.lesson)||void 0===n?void 0:n.isMarketplaceVideo):case ev:case!!(null===(i=e.lesson)||void 0===i?void 0:i.freeVideo):return!1;case!(null===(a=e.lesson)||void 0===a?void 0:a.freeVideo)&&ey:case!ev&&!eh:case eu&&(!eh||ef&&!eg):case ep&&!eh:return!0;default:return!1}},ek=function(t){var n,i,a,o,r,l,s,c,d,u="",p={isFreeVideo:(null==e?void 0:null===(n=e.lesson)||void 0===n?void 0:n.freeVideo)?"free":"paid"},m=null!=e&&null!==(i=e.lesson)&&void 0!==i&&!!i.isPromoUnlockedVideo;(null==e?void 0:null===(a=e.lesson)||void 0===a?void 0:a.isTutorial)&&(null==e?void 0:null===(o=e.lesson)||void 0===o?void 0:o.team_id)?(u="/gallery/".concat(null==e?void 0:null===(r=e.lesson)||void 0===r?void 0:r.lv_guid,"?team_id=").concat(null==e?void 0:null===(l=e.lesson)||void 0===l?void 0:l.team_id),t&&(u+="&child_id=".concat(null==e?void 0:null===(s=e.lesson)||void 0===s?void 0:s.uploaded_by))):(u="/gallery/".concat(null==e?void 0:null===(c=e.lesson)||void 0===c?void 0:c.lv_guid),t&&(u+="?child_id=".concat(null==e?void 0:null===(d=e.lesson)||void 0===d?void 0:d.uploaded_by)),m&&(u+=t?"&promoVideo":"?promoVideo")),Q.push({pathname:u,query:p},u)};return(0,l.BX)(l.HY,{children:[!$&&e.lesson&&(ee||et||en)&&(0,l.tZ)(s.Z,{onClick:function(){var t,n,i=null!=eo&&!!eo.isFamilyPlanUser;eu&&ed&&(null==e?void 0:null===(t=e.lesson)||void 0===t?void 0:t.isUsaSwimVideo)&&!(null==e?void 0:null===(n=e.lesson)||void 0===n?void 0:n.isSwimEventPaidVideo)&&(null==e?void 0:e.handleUsaSwimmerModalOpen)?e.handleUsaSwimmerModalOpen(e.lesson):ek(i)},className:q.lessonCardLink,style:{position:"relative"},children:(0,l.BX)("div",{className:q.wrapper,children:[(null==e?void 0:null===(V=e.lesson)||void 0===V?void 0:V.isMarketplaceVideo)||(null==e?void 0:null===(W=e.lesson)||void 0===W?void 0:W.isTutorial)||eS?(0,l.tZ)(I.Z,{label:(null==e?void 0:null===(z=e.lesson)||void 0===z?void 0:z.isMarketplaceVideo)?"Marketplace":(null==e?void 0:null===(X=e.lesson)||void 0===X?void 0:X.isTutorial)?"Broadcast Content":eS?"Annotation Video":"",component:"
1card"}):(0,l.tZ)(l.HY,{}),(0,l.BX)(u.Z,{className:q.root,elevation:8,children:[(0,l.tZ)(s.Z,{children:(0,l.BX)("div",{className:q.divRelative,children:[(0,l.BX)("div",{className:q.cardMedia,style:{opacity:eT()?"0.5":"1"},children:[(0,l.tZ)(E.Z,{src:ec,alt:e.lesson.album_id||"item",width:"0",height:"0",sizes:"60%",style:{width:"100%",height:"100%",objectFit:"cover",opacity:ed&&(null==e?void 0:null===(H=e.lesson)||void 0===H?void 0:H.isUsaSwimVideo)?(null==e?void 0:null===(Y=e.lesson)||void 0===Y?void 0:Y.isSwimEventPaidVideo)?"1":"0.5":"1"},priority:!0}),ed&&(null==e?void 0:null===(j=e.lesson)||void 0===j?void 0:j.isUsaSwimVideo)&&!(null==e?void 0:null===(K=e.lesson)||void 0===K?void 0:K.isSwimEventPaidVideo)&&(0,l.tZ)(s.Z,{className:q.triangleBottomleft,style:{position:"absolute",bottom:0,left:0},children:(0,l.tZ)(E.Z,{src:"/static/images/gallery/lock.svg",alt:"lock-icon",width:"20",height:"20",priority:!0,className:q.lockImgBox})})]}),eT()&&(0,l.tZ)("div",{className:q.divAbsolute,children:(0,l.tZ)(d.Z,{className:q.divAbsolute,fontSize:"small"})})]})}),(0,l.tZ)(p.Z,{sx:{p:1.5,pb:"8px !important"},children:(0,l.BX)(l.HY,{children:[eE&&(null==eE?void 0:eE.length)===1?(0,l.tZ)(c.Z,{title:eb(),children:(0,l.tZ)(m.Z,{gutterBottom:!0,variant:"h4",component:"h2",className:q.title,mt:.8,children:eb()})}):(0,l.tZ)(C,{swimmersNames:(null==e?void 0:null===(t=e.lesson)||void 0===t?void 0:null===(n=t.race)||void 0===n?void 0:null===(i=n.summary)||void 0===i?void 0:i.swimmer)&&(null==e?void 0:null===(a=e.lesson)||void 0===a?void 0:null===(o=a.race)||void 0===o?void 0:null===(h=o.summary)||void 0===h?void 0:h.swimmer.length)>0?null==e?void 0:null===(v=e.lesson)||void 0===v?void 0:null===(_=v.race)||void 0===_?void 0:null===(w=_.summary)||void 0===w?void 0:w.swimmer.map(function(e){return e.full_name}):[]}),(0,l.tZ)(m.Z,{variant:"body2",color:"textSecondary",component:"p",className:q.desc,children:ex()}),(0,l.tZ)(m.Z,{variant:"body2",component:"p",className:q.desc,children:ew()})]})})]})]})}),$&&(0,l.BX)(p.Z,{sx:{p:1.5,pb:"8px !important"},children:[(0,l.tZ)(m.Z,{gutterBottom:!0,variant:"h4",component:"h2",className:q.title,children:eb()}),(0,l.tZ)(m.Z,{variant:"body2",color:"textSecondary",component:"p",className:q.desc,children:ex()}),(0,l.tZ)(m.Z,{variant:"body2",component:"p",className:q.desc,children:(Z=null==e?void 0:null===(T=e.lesson)||void 0===T?void 0:null===(N=T.video_summary)||void 0===N?void 0:null===(A=N.recorder)||void 0===A?void 0:A.created_datetime)?(0,l.BX)(l.HY,{children:[(0,l.tZ)("span",{style:{opacity:.7},children:"Date Created: "}),(0,b.i8)(Z)]}):null}),(0,l.tZ)(m.Z,{variant:"body2",component:"p",className:q.desc,children:ew()})]})]})}}},function(e){e.O(0,[5326,1123,4607,9072,3353,2096,5675,3289,3120,379,2389,1664,3073,8764,8210,1360,5553,1882,7845,5702,9933,5e3,9962,8446,8740,1329,5386,6965,6826,5199,8914,4923,6056,2809,7116,4049,9774,2888,179],function(){return e(e.s=45185)}),_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.