1import{r as B,j as m}from"./playbook-DzR_ry6Q.js";import{C as $}from"./CommitmentSnippet-KMHGSYBq.js";import{P as j}from"./PageTitle-DSuujEOz.js";import{S as G}from"./SignUpPromo-Dxw2VLsQ.js";import{T as R}from"./TeamDetailsDisplay-BmuD31IK.js";import{u as A}from"./useURLParams-CIlhPcPz.js";import{h as u,I as b,k as F}from"./AppUpdateMonitor-Bn2pSfA6.js";import{m as N,C as z,a as O,b as _}from"./makeCommitmentDetailShareService-g_I5SIFe.js";import{F as d,k as V,C as H}from"./app-public-BF3VXhlA.js";import{u as Q}from"./urlBuilder-BDOOCRBm.js";import{u as J}from"./urlBuilder-BROSAaNt.js";import{u as c}from"./useQuery-yAE_5L0B.js";import{a as K}from"./useCanonical-Cd4wv_wu.js";import{c as M}from"./crossAppUrlBuilder-BhofUUh6.js";import{G as W}from"./profilePrivacyPreferencesApi-CeokeonZ.js";import"./useAnalytics-S-JP8F9Q.js";import"./googleAnalytics-ube9QF46.js";import"./masquerading-CBSqNbPk.js";import"./TeamLogo-BcNhaL61.js";import"./imageSrcManager-B_vswghy.js";import"./PrimeBadgeIcon-o8Ye35qf.js";import"./athleticAssociationUtils-8LDySNgt.js";import"./dataTypes-DjeN0w5k.js";import"./EmptyPageLoadingError-Jf8PX_aW.js";import"./Responsive-BFVHKv7y.js";import"./ShareControl-DZTPT6ds.js";import"./CopyLink-BZb7ciry.js";import"./clipboard-BEioycmS.js";import"./TwitterMajor-Df5iUS11.js";import"./LinkIcon-D4XTdOhE.js";import"./dateUtils-DoT-fxLW.js";import"./useValidatedForm-Des8iXVn.js";import"./grammar-dP6wXds3.js";import"./AthleteDetailsDisplay-BnOeGV7q.js";import"./AthleteHeadshot-CCVkz9AN.js";import"./LinkedinMajor-jXmX5JLG.js";import"./useBaseQuery-CV-kdyom.js";import"./utils-C3Uzq3hM.js";import"./makeCrossAppUrlBuilder-D4l0bYsQ.js";const q="/api/socialgraph",X=({path:t=typeof window>"u"?void 0:window.location.pathname})=>u.get(`${q}/get`,{path:t}),Y=({params:{path:t}={},options:o}={})=>{const{pathname:i}=b(),a=t??i;return c(["GLOBAL_useFetchSocialGraph",{path:a}],()=>X({path:a}),o)},Z="/api/commitmentstory",ee=({username:t,sport:o,id:i})=>u.get(`${Z}/getById`,{username:t,sport:o,commitmentHistoryId:i}),te=({username:t,sport:o,id:i})=>[`${d.commitmentsDetail}_fetchCommitmentStory`,{username:`${t}`,sport:`${o}`,id:`${i}`}],oe=({params:{username:t,sport:o,id:i}={},options:a}={})=>c(te({username:t,sport:o,id:i}),()=>ee({username:t,sport:o,id:i}),a),re=({params:{athleteProfileId:t},options:o}={})=>c([`${d.commitmentsDetail}_fetchPrivacyInfo`,{athleteProfileId:`${t}`}],()=>W({profileId:t}),o),Ve=()=>{K();const{path:{username:t,sport:o,id:i}}=A(),a=J(),h=V(),f=Q(),P=F(),{data:e,isLoading:g}=oe({params:{username:t,sport:o,id:i},options:{useErrorBoundary:!0}}),l=!!e,{data:y,isLoading:L}=re({params:{athleteProfileId:e?.Athlete.ProfileId},options:{enabled:l,useErrorBoundary:!0}}),{data:s,isLoading:S}=Y({options:{useErrorBoundary:!0}}),C=g||L&&l||S,I=B.useMemo(()=>!e||!e.Athlete||!s?null:N({commitmentStoryData:e,socialGraphData:s,isAuthenticated:!1}),[e,s]),T=()=>{P.showSuccess({message:"Commitment story link copied"})},p=r=>r.TeamId===0||!r.IsVerified?null:f.organizationTeamOverviewPage({pathParams:{shortName:r.ShortName,sportEnum:r.SportEnum.Value.toLowerCase()}}).wiredLinkProps,k=e&&m.jsx($,{team:e.RecruiterTeam,commitmentLevel:e.CommitmentLevelEnum,teamProfileLinkProps:p(e.RecruiterTeam)}),v=e&&m.jsx(_,{commitment:e,linkPropsGenerators:{athleteProfile:({athlete:r,sportEnum:n})=>a.profileDetail({pathParams:{id:r.Username,sportEnum:n}}).wiredLinkProps,commitmentsList:()=>h.commitmentsList().wiredLinkProps,teamPage:p},viewer:{}}),E=e&&m.jsx(z,{athlete:e?.Athlete,promoterTeams:e?.PromoterTeams,athleteProfileLinkProps:a.profileDetail({pathParams:{id:e?.Athlete.Username,sportEnum:e?.RecruiterTeam.SportEnum.Value.toLowerCase()}}).wiredLinkProps,renderTeamDetails:({team:r})=>m.jsx(R,{team:r,options:{teamProfileLinkProps:p(r),mode:"short"}})}),x=m.jsx(G,{heading:"Looking for opportunities at the next level?",text:"FieldLevel is free for coaches, athletes, and families. Join today.",analyticsCategory:"Commitment Story Interaction"}),D=M.publicSignUpPage().wiredLinkProps,U=e&&(()=>{const r=e.Athlete,n=e.RecruiterTeam,w=e.CommitmentLevelEnum.Id===3||e.CommitmentLevelEnum.Id===4||e.CommitmentLevelEnum.Id===1&&(!n.SportEnum||n.SportEnum.Id===0);return`${r.DisplayName}
1 Announces Commitment to ${w?"":`Play ${n.SportEnum.Label} at `}${n.OrganizationName}`})();return m.jsxs(m.Fragment,{children:[m.jsx(j,{title:U}),m.jsx(H,{children:m.jsx(O,{isLoading:C,commitmentStoryData:e,privacyPreferencesData:y,shareService:I,commitmentSnippetRendering:k,commitmentStoryRendering:v,commitmentTeamsRendering:E,signUpPromoRendering:x,joinPageLinkProps:D,onShareCopy:T})})]})};export{Ve as default}; 2//# sourceMappingURL=CommitmentsDetail-C5mWJmfk.js.map
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.