PageSourceSearch

https://sorareinside.com/assets/TeamProfileBuilderView-CieDuROG.js

js sorareinside.com collected 2026-10-02 01:59:55 UTC 9,944 bytes, 2 lines download raw bytes

1import{e as U,o as O,p as L,y as F,f as q,z as B,al as C,k as w,m as b,j as u,S,G as E,A as k,h as N,a as A,T as M,g as T,v as z,as as Q,d as R,ac as G,r as V}from"./index-B7swmYTL.js";import{L as J,S as K}from"./LineupQA-B39yw7wg.js";import{L as W}from"./Lineup-CTAH0CM6.js";import{e as $,g as Y,D,h as H,i as X,d as Z}from"./utils-wWZooEfw.js";import{I as x}from"./IconEye-DCyqSFNJ.js";import{I}from"./IconMessageExclamation-vPgs4HaW.js";import"./ProjectedScoreReliabilityTooltip-D8U7Et4u.js";import"./moment-hm5YbRet.js";import"./CompactLineupView-BsTdUfkU.js";import"./Field-DKNrkJRu.js";import"./LineupPosition-CjCqBXw_.js";import"./LazyNScoresPopoverDropdown-D362tX6A.js";import"./use-in-viewport-B7UyCjQI.js";import"./use-toggle-B6bl_c5G.js";import"./CartesianChart-DisticR2.js";import"./with-selector-D_dUv-BM.js";import"./NumberInput-gJHTPGPC.js";import"./clamp-BzB_x7IF.js";import"./IconTrash-DQmYBKfd.js";import"./IconClock-Dc-g_hL3.js";import"./IconUserPlus-D19kcddO.js";import"./Autocomplete-B9ErIGwa.js";import"./Select-CK9GqB-4.js";import"./utils-BQAzIq_e.js";import"./IconBandageFilled-BYnuGVLA.js";import"./IconInfoCircle-Dd9TSRTP.js";import"./IconSend-CJMO2BxM.js";import"./LoadingOverlay-BYjwjcxd.js";import"./Switch-CYo6oQoZ.js";import"./Textarea-B9t7BmdT.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};a.SENTRY_RELEASE={id:"2ca73fcccbc42b52d2e324a0d85c875e9ada24e2"};var e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="d11c317d-5dea-40f4-9083-9698d695d623",a._sentryDebugIdIdentifier="sentry-dbid-d11c317d-5dea-40f4-9083-9698d695d623")}catch{}})();const v=[10,10],y=$()(Y(a=>({id:void 0,team:null,userId:null,startingPlayers:Array(11).fill(null),alternatePlayers:Array(11).fill(null),startingPlayersConfidencePercentages:X,alternatePlayersConfidencePercentages:H,dnpPlayers:[],benchPlayers:[],formation:D,isPublished:!1,reliability:"MEDIUM",notes:null,setId:e=>a({id:e}),setTeam:e=>a({team:e}),setUserId:e=>a({userId:e}),setFormation:e=>a({formation:e}),setIsPublished:e=>a({isPublished:e}),setReliability:e=>a({reliability:e}),setNotes:e=>a({notes:e}),setPositionStartingPlayer:(e,r)=>a(t=>{const s=t.startingPlayers.slice();return s[e]=r,{...t,startingPlayers:s}}),setPositionStarterConfidencePercentage:(e,r)=>a(t=>{const s=t.startingPlayersConfidencePercentages.slice();return s[e]=r,{...t,startingPlayersConfidencePercentages:s}}),addPositionAlternatePlayer:(e,r)=>a(t=>{var P,m;const s=JSON.parse(JSON.stringify(t.alternatePlayers)),l=JSON.parse(JSON.stringify(t.alternatePlayersConfidencePercentages)),n=s[e]!==null?(P=t.alternatePlayersConfidencePercentages[e])==null?void 0:P[0]:0,c=Math.max(100-t.startingPlayersConfidencePercentages[e]-n,5);if(s[e]!==null){(m=s[e])==null||m.push(r);const d=s[e];d!==null&&(l[e][d.length-1]=c)}else s[e]=[r],l[e][0]=c;return{...t,alternatePlayers:s,alternatePlayersConfidencePercentages:l}}),removePositionAlternatePlayer:(e,r)=>a(t=>{var c,P,m;const s=t.alternatePlayers.slice();if(!s[e])return t;const l=t.alternatePlayersConfidencePercentages.slice();l[e]=l[e].slice();const n=(c=s[e])==null?void 0:c.findIndex(d=>(d==null?void 0:d.id)===r);if(n===void 0||n===-1)return t;if(s[e]=((P=s[e])==null?void 0:P.filter(d=>(d==null?void 0:d.id)!==r))||[],((m=s[e])==null?void 0:m.length)===0)s[e]=null,l[e]=v.slice();else{const d=Math.max(100-t.startingPlayersConfidencePercentages[e],5);l[e][0]=d,l[e][1]=10}return{...t,alternatePlayers:s,alternatePlayersConfidencePercentages:l}}),swapPositionStarterWithAlternate:(e,r)=>a(t=>{const s=t.startingPlayers[e],l=t.alternatePlayers[e],n=l==null?void 0:l[r];if(!s||!n)return t;const c=t.startingPlayers.slice();c[e]=n;const P=t.alternatePlayers.slice(),m=l.slice();return m[r]=s,P[e]=m,{...t,startingPlayers:c,alternatePlayers:P}}),swapLineupPositions:(e,r)=>a(t=>{if(e===r)return t;const s=t.startingPlayers.slice(),l=t.alternatePlayers.slice(),n=t.startingPlayersConfidencePercentages.slice(),c=t.alternatePlayersConfidencePercentages.slice();return[s[e],s[r]]=[s[r],s[e]],[l[e],l[r]]=[l[r],l[e]],[n[e],n[r]]=[n[r],n[e]],[c[e],c[r]]=[c[r],c[e]],{...t,startingPlayers:s,alternatePlayers:l,startingPlayersConfidencePercentages:n,alternatePlayersConfidencePercentages:c}}),removeAllPositionAlternatePlayers:e=>a(r=>{const t=r.alternatePlayers.slice();if(!t[e])return r;t[e]=null;const s=r.alternatePlayersConfidencePercentages.slice();return s[e]=v.slice(),{...r,alternatePlayers:t,alternatePlayersConfidencePercentages:s}}),setAlternatePositionConfidencePercentage:(e,r,t)=>a(s=>{var n,c;const l=s.alternatePlayersConfidencePercentages.slice();return!l[e]||!((n=l[e])!=null&&n[r])?s:((c=l[e])!=null&&c[r]&&(l[e]=l[e].slice(),l[e][r]=t),{...s,alternatePlayersConfidencePercentages:l})}),addBenchPlayer:e=>a(r=>{if(r.benchPlayers.some(s=>s.id===e.id))return r;const t=r.benchPlayers.slice();return t.push(e),{...r,benchPlayers:t}}),removeBenchPlayer:e=>a(r=>{const t=r.benchPlayers.filter(s=>(s==null?void 0:s.id)!==e);return{...r,benchPlayers:t}}),clearBenchedPlayers:()=>a({benchPlayers:[]}),addDnpPlayer:e=>a(r=>{if(r.dnpPlayers.some(s=>s.id===e.id))return r;const t=r.dnpPlayers.slice();return t.push(e),{...r,dnpPlayers:t}}),removeDnpPlayer:e=>a(r=>{const t=r.dnpPlayers.filter(s=>(s==null?void 0:s.id)!==e);return{...r,dnpPlayers:t}}),clearDnpPlayers:()=>a({dnpPlayers:[]})}),{name:"lineup-builder-storage"})),ee=a=>{const e=y(o=>o.setUserId),r=y(o=>o.setId),t=y(o=>o.setFormation),s=y(o=>o.setIsPublished),l=y(o=>o.setNotes),n=y(o=>o.setPositionStartingPlayer),c=y(o=>o.setPositionStarterConfidencePercentage),P=y(o=>o.addPositionAlternatePlayer),m=y(o=>
1o.removeAllPositionAlternatePlayers),d=y(o=>o.setAlternatePositionConfidencePercentage),_=y(o=>o.addDnpPlayer),g=y(o=>o.addBenchPlayer);U.useEffect(()=>{var o,h,p;r(void 0),t(D),e(null),s(!1),l(null),Array(11).fill(null).forEach((i,f)=>{n(f,i),c(f,Z),m(f)}),a&&(a.id&&r(a.id),a.user_id&&e(a.user_id),t(a.formation),s(a.is_published||!1),l(a.notes||null),a.lineup_players.starting_players.forEach(i=>{i!==null&&(n(i.lineup_position_index,{avatarPictureUrl:i.avatar_picture_url,birthDate:i.birth_date,displayName:i.display_name,id:i.id,matchName:i.match_name,playingStatus:i.playing_status,position:i.position,slug:i.slug}),c(i.lineup_position_index,i.confidence_percentage))}),(o=a.lineup_players.alternate_players)==null||o.forEach(i=>{i==null||i.forEach((f,j)=>{P(f.lineup_position_index,{avatarPictureUrl:f.avatar_picture_url,birthDate:f.birth_date,displayName:f.display_name,id:f.id,matchName:f.match_name,playingStatus:f.playing_status,position:f.position,slug:f.slug}),d(f.lineup_position_index,j,f.confidence_percentage)})}),(h=a.lineup_players.dnp_players)==null||h.forEach(i=>{i!==null&&_({avatarPictureUrl:i.avatar_picture_url,birthDate:i.birth_date,displayName:i.display_name,id:i.id,matchName:i.match_name,playingStatus:i.playing_status,position:i.position,slug:i.slug})}),(p=a.lineup_players.bench_players)==null||p.forEach(i=>{i!==null&&g({avatarPictureUrl:i.avatar_picture_url,birthDate:i.birth_date,displayName:i.display_name,id:i.id,matchName:i.match_name,playingStatus:i.playing_status,position:i.position,slug:i.slug})}))},[P,a,d,t,l,s,r,e,c,n,m,_,g])};R.extend(V);const re={draft_text:"Says draft",too_short:"Analysis too short",needs_detail:"Needs detail",outdated:"Outdated",other:"Other"},Ue=()=>{var d,_;const{lineupId:a}=O(),e=y(),r=L("(max-width: 50em)"),t=F(),s=async()=>await w().get(b.LINEUPS+"/"+a+"?view=working"),l=q({queryKey:["savedLineup",a,"working"],queryFn:()=>s().then(g=>{var h,p;const o=g.data.team;return e.setTeam({id:`Team:${o.id}`,name:o.name,pictureUrl:o.pictureUrl||"",slug:o.slug,country:{code:((h=o.country)==null?void 0:h.code)||"No country",flagUrl:((p=o.country)==null?void 0:p.flagUrl)||null}}),g}),enabled:a!==void 0,refetchOnMount:!0}),n=(d=l.data)==null?void 0:d.data,c=((_=n==null?void 0:n.latest_review_request)==null?void 0:_.status)==="open"?n.latest_review_request:null,P=!!(n!=null&&n.team&&!n.team.isNationalTeam),m=B({mutationFn:async()=>a?await w().post(b.LINEUP_REVIEW_REQUEST_RESOLVE(a)):null,onSuccess:()=>{C({message:"Review request marked as resolved",color:"green"}),t.invalidateQueries({queryKey:["savedLineup",a]}),t.invalidateQueries({queryKey:["notifications"]})},onError:g=>{C({message:g instanceof Error?g.message:"Could not mark review request as resolved",color:"red"})}});return ee(n),u.jsxs(S,{gap:"xs",children:[u.jsxs(E,{justify:"space-between",children:[u.jsxs(E,{wrap:"nowrap",gap:"xs",children:[u.jsx(k,{href:N.TEAM_PROFILES_BUILDER,style:{textDecoration:"none"},children:u.jsx(A,{size:"sm",children:"← Back"})}),u.jsx(M,{order:2,ff:"Urbanist",children:"Team Profile Builder"})]}),u.jsxs(T,{variant:"outline",size:"xs",component:"a",leftSection:u.jsx(x,{size:16}),href:`${N.SINGLE_LINEUP}?lineupId=${a}`,target:"_blank",children:["View ",r?"":"profile as user"]})]}),l.isFetching?u.jsx(z,{size:"xs"}):u.jsxs(S,{mt:"sm",children:[c?u.jsx(Q,{color:"orange",icon:u.jsx(I,{size:18}),title:"Changes requested",children:u.jsxs(S,{gap:4,children:[u.jsxs(E,{justify:"space-between",align:"center",gap:"xs",children:[u.jsxs(A,{size:"sm",children:[re[c.reason]," · requested"," ",R(c.requestedAt).fromNow()]}),u.jsx(T,{size:"xs",variant:"light",color:"green",loading:m.isPending,onClick:()=>m.mutate(),children:"Resolved"})]}),c.message?u.jsx(A,{size:"sm",c:"dimmed",children:c.message}):null]})}):null,u.jsxs(E,{wrap:r?"wrap-reverse":"nowrap",grow:!0,align:"flex-start",children:[u.jsx(J,{lineupId:a}),u.jsx(G,{p:"sm",shadow:"xs",children:u.jsx(K,{})})]}),u.jsx(W,{lineupStore:e,squadChangesEnabled:P,setPiecesTakersEnabled:!0,isPublished:n==null?void 0:n.is_published,firstPublishedAt:n==null?void 0:n.first_published_at,publicationWorkflow:n==null?void 0:n.publication_workflow},a)]})]})};export{Ue as default};
2//# sourceMappingURL=TeamProfileBuilderView-CieDuROG.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.