"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5577],{25172:function(e,t,i){var r=i(52322),a=i(30382),n=i.n(a);i(2784);var o=i(19596),s=i(45103),d=i(91842),l=i(33274),c=i(72814),g=i(87961),p=i(46262);let m={PRINCIPAL_CONTAINER:"p_ct",DIRECTOR:"p_ct_dr",CREATOR:"p_ct_cr",CAST:"p_ct_cst"},f=n()` fragment TitleSummaryPromptCreditCategories on Title { principalCast: principalCredits(filter: { categories: ["cast"] }) { ...TitleSummaryPromptCredits } principalCreators: principalCredits( filter: { categories: ["creator"] } ) { ...TitleSummaryPromptCredits } principalDirectors: principalCredits( filter: { categories: ["director"] } ) { ...TitleSummaryPromptCredits } } fragment TitleSummaryPromptCredits on PrincipalCreditsForCategory { category { text } credits(limit: 3) { name { id nameText { text } } } } `,u=n()` query Title_Summary_Prompt_From_Base( $id: ID! $location: WatchOptionsLocation $isProPage: Boolean! ) { title(id: $id) { ...TitleSummaryPromptCreditCategories ...BaseTitlePromptShared } } ${p.qo} ${f} `,h=e=>{let{title:t,onClose:i,isOpen:a}=e;return(0,r.jsx)(p.Pz,{isOpen:a,onClose:i,title:t,queryOverride:{query:u},contentOverride:e=>{let t=e?.title,i=t?.principalCreators&&t.principalCreators[0],a=t?.principalDirectors&&t.principalDirectors[0],n=t?.principalCast&&t.principalCast[0];if(t&&(i||a||n))return(0,r.jsxs)(I,{"data-testid":m.PRINCIPAL_CONTAINER,children:[i&&(0,r.jsx)(x,{testId:m.CREATOR,creditCategory:i,refToken:c.Cd.PRINCIPAL_CREATOR}),a&&(0,r.jsx)(x,{testId:m.DIRECTOR,creditCategory:a,refToken:c.Cd.PRINCIPAL_DIRECTOR}),n&&(0,r.jsx)(x,{testId:m.CAST,creditCategory:n,refToken:c.Cd.PRINCIPAL_CAST})]})}})},x=e=>{let{creditCategory:t,refToken:i,testId:a}=e,n=t.credits,o=t.category?.text,{nameMainLinkBuilder:d}=(0,l.WO)();return n&&o&&n.length>0?(0,r.jsxs)(T,{"data-testid":a,children:[(0,r.jsxs)(C,{children:[" ",o," "]}),(0,r.jsx)(s.InlineList,{showDividers:!0,inline:!0,children:n.map(e=>{if(e&&e.name.id&&e.name.nameText?.text)return(0,r.jsx)(s.InlineListItem,{children:(0,r.jsx)(y,{href:d({nconst:e.name.id,refSuffix:i}),text:e.name.nameText.text},`name-link-${e.name.id}`)},e.name.id)})})]},o):null};t.ZP=e=>(0,r.jsx)(c.xm,{value:c.Cd.TITLE_SUMMARY_PROMPT,children:(0,r.jsx)(h,{...e})});let y=(0,o.default)(s.TextLink).withConfig({componentId:"sc-60d2a950-0"})(["font-size:",";",";display:inline;"],(0,d.setTypographyType)("bodySmall"),(0,d.setPropertyToColorVar)("color","ipt-on-baseAlt-textSecondary-color")),C=o.default.span.withConfig({componentId:"sc-60d2a950-1"})(["font-size:",";",";margin-right:",";"],(0,d.setTypographyType)("subtitle2"),(0,d.setPropertyToColorVar)("color","ipt-on-baseAlt-textSecondary-color"),d.spacing.xs),T=o.default.div.withConfig({componentId:"sc-60d2a950-2"})(["",";margin-bottom:",";"],(0,g.S)(1),d.spacing.xs),I=o.default.div.withConfig({componentId:"sc-60d2a950-3"})(["margin:",";","{margin-left:0;margin-right:0;}"],d.spacing.s,d.mediaQueries.breakpoints.above.m)},11870:function(e,t,i){i.d(t,{t:function(){return u}});var r=i(52322),a=i(2784),n=i(45455),o=i.n(n),s=i(45103),d=i(58471),l=i(58605),c=i(7159),g=i(50089),p=i(72814),m=i(66670),f=i(55230);let u=e=>{let{titles:t,cardOverride:i,promptOverride:n,shovelerClassName:u,...h}=e,{pageType:x,subPageType:y,pageConst:C}=(0,l.y)(),T=(0,p.Lz)().value,{createButton:I,createPrompt:b}=(0,g.V1)({type:x,subType:y,id:C},T),[S,P]=(0,a.useState)(t),E=t.map(e=>e.id),_=(0,c.mg)(E);(0,a.useEffect)(()=>{if(!_?.data?.titles)return;let e={};_.data.titles.forEach(t=>{t?.id&&(e[t?.id]=t)}),P(S.map(t=>({...t,primaryWatchOption:e[t.id]?.primaryWatchOption,userRating:e[t.id]?.userRating})))},[_?.data]);let j=S.map((e,t)=>{let i=I(e,t,_.fetching);return{data:e,index:t+1,alternateButton:i?{...i,fetching:_.fetching}:void 0}}),v=i?i(j):j.map((e,t)=>(0,a.createElement)(f.c,{...e,key:`title-card-shoveler-item-${T}-${e.data.id}`,index:t+1}));if(o()(v))return null;let N=b(T);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.Shoveler,{className:u,onPageChange:e=>{(0,m.B)(e,T,x,y,C)},...(0,d.filterDataAttributes)(h),children:v}),n&&n(N)||N]})}},91166:function(e,t,i){i.d(t,{i:function(){return e2}});var r=i(52322),a=i(30382),n=i.n(a),o=i(2784),s=i(77750),d=i(79459),l=i(14865),c=i(5632),g=i(79855),p=i(19596),m=i(45103),f=i(91842),u=i(76168),h=i(36214),x=i(11870),y=i(96446),C=i(72814),T=i(78270),I=i(25673);let b={PARENT:"ymktf-parent",SHOVELER:"ymktf-shoveler"};var S=i(28072);let P=n()` query YouMayKnowThemFrom($nameId: ID!, $includeUserRating: Boolean!) { name(id: $nameId) { nameText { text } primaryImage { caption { plainText } url height width } } ratedTitlesWithName: advancedTitleSearch( first: 25 constraints: { creditedNameConstraint: { allNameIds: [$nameId] } myRatingConstraint: { filterType: INCLUDE } } ) @include(if: $includeUserRating) { edges { node { title { ...BaseTitleCard ...PersonalizedTitleCardUserRating } } } } chartMovies: chartTitles( first: 100 chart: { chartType: MOST_POPULAR_MOVIES } filter: { creditedNameConstraint: { allNameIds: [$nameId] } } ) { edges { node { ...BaseTitleCard } } } chartTV: chartTitles( first: 100 chart: { chartType: MOST_POPULAR_TV_SHOWS } filter: { creditedNameConstraint: { allNameIds: [$nameId] } } ) { edges { node { ...BaseTitleCard } } } } ${S.sq} ${S.uN} `,E=e=>{let{nameId:t}=e,i=(0,g.Z)(),a=(0,y.nu)(),[n,s]=(0,o.useState)([]),d=(0,I.hg)({weblabID:T.lh.IMDB_YOU_MAY_KNOW_THEM_FROM_919392,treatments:{T1:!0}}),[{data:c,error:p,fetching:f}]=(0,y.E8)({query:P,context:{personalized:a,serverSideCacheable:!a},variables:{nameId:t,includeUserRating:a},pause:!(0,l.getIsBrowser)()||!d});return((0,o.useEffect)(()=>{if(c){let e=new Set,t=[];(c?.ratedTitlesWithName?.edges??[]).forEach(i=>{let r=i?.node?.title,a=r?.id;a&&!e.has(a)&&(e.add(a),t.push(r))}),(c?.chartMovies?.edges??[]).forEach(i=>{let r=i?.node,a=r?.id;a&&!e.has(a)&&(e.add(a),t.push(r))}),(c?.chartTV?.edges??[]).forEach(i=>{let r=i?.node,a=r?.id;a&&!e.has(a)&&(e.add(a),t.push(r))}),s(t)}},[c,p]),f||n.length)?(0,r.jsxs)(m.PageSection,{className:b.PARENT,children:[(0,r.jsx)(u.O,{title:i.formatMessage({id:"feature_you_may_know_them_from_title",defaultMessage:"You may know them from"})}),f&&(0,r.jsx)(h.ZP,{height:"feature"}),!f&&n.length>0&&(0,r.jsx)(x.t,{shovelerClassName:b.SHOVELER,titles:n})]}):null};var _=e=>(0,r.jsx)(C.xm,{value:C.Cd.YOU_MAY_KNOW_THEM_FROM,children:(0,r.jsx)(E,{...e})}),j=i(99493),v=i(85767),N=i(52817),M=i(60220),$=i(9277),L=i(146),O=i(43287),D=i(40820),R=i(901);let A=(e,t,i,r,a,o,l)=>n()` query ${l?"NameMainFilmographyPaginatedCredits":"NameMainFilmographyFilteredCredits"}( $id: ID! ${l?"$after: ID":""}, $includeUserRating: Boolean! ) { name(id: $id) { id nameText { text } primaryImage { caption { plainText } height width url } ${r&&!l?w(e,t,i,a,o):e.map(e=>i?k(e,a,o,l):t.map(t=>k(e,a,o,l,t)))} } } ${s.p} ${d.w} `,w=(e,t,i,r,a)=>i?` unreleasedCredits: creditCategories( filter: { projectStatus: ["UPCOMING"], ${r.length>0?`genres: [${r.map(e=>`"${e}"`).join(",")}]`:""} ${a.length>0?`excludeGenres: [${a.map(e=>`"${e}"`).join(",")}]`:""} } sort: { by: RELEASE_DATE, order: ASC } ) { category { id text } credits(first: 30) { total edges { node { ...CreditMetaData title { ...CreditCard } } } pageInfo { hasNextPage hasPreviousPage endCursor } } } releasedCredits: creditCategories( filter: { projectStatus: ["PREVIOUS"], ${r.length>0?`genres: [${r.map(e=>`"${e}"`).join(",")}]`:""} ${a.length>0?`excludeGenres: [${a.map(e=>`"${e}"`).join(",")}]`:""} } ) { category { id text } credits(first: 30) { total edges { node { ...CreditMetaData title { ...CreditCard } } } pageInfo { hasNextPage hasPreviousPage endCursor } } } `:`${e.map(e=>t.map(t=>k(e,r,a,void 0,t)))}`,k=(e,t,i,r,a)=>{let n=r?.fetchAll?R.c1:R.Uk;if(a)return` ${e}_${a}_credits: credits( first: ${n} ${r&&!r?.isUnreleased?"after: $after":""} filter: { categories: ["${e}"] titleTypeCategory: [${a}] ${t.length>0?`genres: [${t.map(e=>`"${e}"`).join(",")}]`:""} ${i.length>0?`excludeGenres: [${i.map(e=>`"${e}"`).join(",")}]`:""} } ) { total edges { node { ...CreditMetaData title { ...CreditCard } } } pageInfo { hasNextPage hasPreviousPage endCursor } } `;{let a="";return(!r||r?.isUnreleased)&&(a+=` ${e}_unreleasedCredits: credits( first: ${n} ${r?"after: $after":""} filter: { categories: ["${e}"] projectStatus: ["UPCOMING"] ${t.length>0?`genres: [${t.map(e=>`"${e}"`).join(",")}]`:""} ${i.length>0?`excludeGenres: [${i.map(e=>`"${e}"`).join(",")}]`:""} } sort: { by: RELEASE_DATE, order: ASC } ) { total edges { node { ...CreditMetaData title { ...CreditCard } } } pageInfo { hasNextPage hasPreviousPage endCursor } } `),r&&r?.isUnreleased||(a+=` ${e}_credits: credits( first: ${n} ${r?"after: $after":""} filter: { categories: ["${e}"] projectStatus: ["PREVIOUS"] ${t.length>0?`genres: [${t.map(e=>`"${e}"`).join(",")}]`:""} ${i.length>0?`excludeGenres: [${i.map(e=>`"${e}"`).join(",")}]`:""} } ) { total edges { node { ...CreditMetaData title { ...CreditCard } } } pageInfo { hasNextPage hasPreviousPage endCursor } } `),a}};var Y=i(72779),F=i.n(Y),U=i(8619),B=i.n(U),V=i(26524),G=i(58605),W=i(932),q=i(98258),Q=i(33274);let z="Short",K="Documentary",J=e=>{let{genres:t,excludedGenres:i,includedGenres:a,nameText:n,onExcludeGenre:o,onIncludeGenre:s,onSortSelect:d,sortByDate:l,sortMenuRef:c}=e,{value:p}=(0,C.Lz)(),{searchTitleLinkBuilder:f}=(0,Q.WO)(),u=(0,g.Z)(),h=(0,V.ik)(),{pageConst:x}=(0,G.y)(),y=u.formatMessage(R.TY.SORT_BY),b=u.formatMessage(R.TY.BY_DATE),S=u.formatMessage(R.TY.BY_TYPE),P=u.formatMessage(R.TY.SEE_ALSO),E=u.formatMessage(R.TY.BY_GENRE),_=u.formatMessage(R.TY.BY_RATING),j=u.formatMessage(R.TY.BY_VOTES),v=u.formatMessage(R.TY.BY_YEAR),N=u.formatMessage(R.TY.BY_KEYWORD),M=u.formatMessage(R.TY.BY_CREDIT_CATEGORY),$=u.formatMessage(R.TY.INCLUDED_GENRES),L=u.formatMessage(R.TY.EXCLUDE),O=t.some(e=>e===K),D=t.some(e=>e===z),A=i.some(e=>e===K),w=i.some(e=>e===z),k=t;k=w?k.filter(e=>e!==z):k,k=A?k.filter(e=>e!==K):k;let Y=u.formatMessage({id:"name_main_filmography_Documentary",defaultMessage:"Documentary"}),F=u.formatMessage({id:"name_main_filmography_Short",defaultMessage:"Short"}),U=(0,I.ez)(T.lh.IMDB_NEXT_FILMOGRAPHY_FILTER_ICON_1193699),B=(0,W.DF)(U);return(0,r.jsx)(m.ChipDropdown,{ariaLabel:y,chipRef:c,className:R.z7.SortMenu,"data-testid":R.z7.SortMenu,breakpointConfig:{m:q.PROMPT_TYPES.bottomsheet},filled:!0,onColor:"accent2",onSelect:()=>((0,W.Yh)(B),x&&(0,W.ix)(x,"fp-open",p)),postIconProps:{name:B},children:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(et,{className:"filmography-sort-type-container",children:[(0,r.jsx)(ei,{children:y}),(0,r.jsxs)(ea,{wrap:!0,children:[(0,r.jsx)(m.Chip,{className:"nm-flmg-srt-d","data-testid":R.z7.SortMenu_Date,active:l,label:b,onSelect:()=>d(R.ER.Date)}),(0,r.jsxs)(en,{children:[(0,r.jsx)(m.Chip,{"data-testid":R.z7.SortMenu_Type,active:!l,label:S,onSelect:()=>d(R.ER.TitleType)}),(0,r.jsx)(eo,{children:u.formatMessage(R.TY.BY_TYPE_SUBTITLE)})]})]}),(O||D)&&(0,r.jsxs)(er,{children:[(0,r.jsx)("span",{children:L}),D&&(0,r.jsx)(m.CheckBox,{ariaLabel:F,checked:w,className:"exclude-genre-checkbox",iconActiveColor:"accent1",id:"exclude-short-checkbox",label:F,name:F,onChange:e=>{o(z,!e),a.some(e=>e===z)&&s(z,!0)}}),O&&(0,r.jsx)(m.CheckBox,{ariaLabel:Y,checked:A,className:"exclude-genre-checkbox",iconActiveColor:"accent1",id:"exclude-documentary-checkbox",label:Y,name:Y,onChange:e=>{o(K,!e),a.some(e=>e===K)&&s(K,!0)}})]})]}),k.length>1&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(m.PageSectionDivider,{}),(0,r.jsxs)(et,{className:"filmography-genre-filter-container",children:[(0,r.jsx)(ei,{children:$}),(0,r.jsx)(m.ChipList,{wrap:!0,children:k.map(e=>{let t=-1!==a.indexOf(e);return(0,r.jsx)(m.Chip,{active:t,"data-testid":`filmo-ig-${e}`,label:u.formatMessage({id:`name_main_filmography_${e}`,defaultMessage:e}),onSelect:()=>s(e,t),postIconProps:t?{name:"clear"}:void 0},`filmo-ig-${e}`)})})]})]}),x&&!h&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(m.PageSectionDivider,{}),(0,r.jsxs)(et,{className:"filmography-ql-filter-container",children:[(0,r.jsx)(Z,{children:P}),(0,r.jsx)(es,{children:u.formatMessage(R.TY.SEE_ALSO_SUBTITLE,{nameText:n})}),(0,r.jsxs)(X,{showDividers:!1,children:[(0,r.jsx)(ee,{children:(0,r.jsx)(H,{className:"filmography-by-year-ql",href:f({query:{explore:"year",role:x,sort:"release_date,desc"},refSuffix:[C.Cd.SHOWCASE,C.Cd.YEAR,C.Cd.QUICK_LINKS]}),postIcon:"arrow-right",text:v})}),(0,r.jsx)(ee,{children:(0,r.jsx)(H,{className:"filmography-by-rating-ql",href:f({query:{role:x,sort:"user_rating,desc"},refSuffix:[C.Cd.SHOWCASE,C.Cd.RATING,C.Cd.QUICK_LINKS]}),postIcon:"arrow-right",text:_})}),(0,r.jsx)(ee,{children:(0,r.jsx)(H,{className:"filmography-by-votes-ql",href:f({query:{role:x,sort:"num_votes,desc"},refSuffix:[C.Cd.SHOWCASE,C.Cd.POPULAR,C.Cd.QUICK_LINKS]}),postIcon:"arrow-right",text:j})}),(0,r.jsx)(ee,{children:(0,r.jsx)(H,{className:"filmography-by-genre-ql",href:f({query:{explore:"genres",role:x},refSuffix:[C.Cd.SHOWCASE,C.Cd.GENRE,C.Cd.QUICK_LINKS]}),postIcon:"arrow-right",text:E})}),(0,r.jsx)(ee,{children:(0,r.jsx)(H,{className:"filmography-by-keyword-ql",href:f({query:{explore:"keywords",role:x},refSuffix:[C.Cd.SHOWCASE,C.Cd.KEYWORDS,C.Cd.QUICK_LINKS]}),postIcon:"arrow-right",text:N})}),(0,r.jsx)(ee,{children:(0,r.jsx)(H,{className:"filmography-by-credit-type-ql",href:f({query:{explore:"credits",role:x},refSuffix:[C.Cd.SHOWCASE,C.Cd.CREDIT,C.Cd.QUICK_LINKS]}),postIcon:"arrow-right",text:M})})]})]})]})]})})},H=(0,p.default)(m.TextLink).withConfig({componentId:"sc-91a22f-0"})(["&&{color:"," !important;}"],(0,f.getColorVar)("ipt-on-baseAlt-textPrimary-color")),Z=p.default.div.withConfig({componentId:"sc-91a22f-1"})([""," "," margin-bottom:",";"],(0,f.setTypographyType)("overline"),(0,f.setPropertyToColorVar)("color","ipt-on-baseAlt-accent1-color"),f.spacing.xs),X=(0,p.default)(m.InlineList).withConfig({componentId:"sc-91a22f-2"})([""," margin-top:",";"],(0,f.setTypographyType)("bodySmall"),f.spacing.s),ee=(0,p.default)(m.InlineListItem).withConfig({componentId:"sc-91a22f-3"})(["margin:0 "," "," 0;"],f.spacing.xs,f.spacing.xs),et=p.default.div.withConfig({componentId:"sc-91a22f-4"})([""," "," .nm-flmg-srt-d{margin-top:-0.75rem;}"],(0,f.setPropertyToSpacingVar)("margin-left","ipt-pageMargin"),(0,f.setPropertyToSpacingVar)("margin-right","ipt-pageMargin")),ei=p.default.div.withConfig({componentId:"sc-91a22f-5"})([""," "," margin-bottom:",";"],(0,f.setTypographyType)("overline"),(0,f.setPropertyToColorVar)("color","ipt-on-baseAlt-accent1-color"),f.spacing.s),er=p.default.div.withConfig({componentId:"sc-91a22f-6"})([""," "," align-items:center;display:inline-flex;width:100%;.exclude-genre-checkbox{margin-left:",";}"],(0,f.setTypographyType)("body"),(0,f.setPropertyToColorVar)("color","ipt-on-baseAlt-textPrimary-color"),f.spacing.xs),ea=(0,p.default)(m.ChipList).withConfig({componentId:"sc-91a22f-7"})(["display:inline-flex;align-items:baseline;width:100%;"]),en=p.default.div.withConfig({componentId:"sc-91a22f-8"})(["display:flex;flex-direction:column;align-items:center;"]),eo=p.default.span.withConfig({componentId:"sc-91a22f-9"})([""," margin-right:0.5rem;"],(0,f.setTypographyType)("copyright")),es=p.default.div.withConfig({componentId:"sc-91a22f-10"})(["",""],(0,f.setTypographyType)("copyright")),ed=e=>{let t=(0,g.Z)(),{pageConst:i}=(0,G.y)(),{makeRefMarker:a}=(0,C.Lz)(),n=(0,V.ik)(),{jobData:o,onJobSelect:s,selectedJobs:d,...l}=e,c=o.filter(e=>!d.some(t=>t.id===e.id));return(0,r.jsxs)(el,{className:F()(R.z7.ChipFilters,e.className),onNextPage:()=>(0,W.ix)(String(i),"next-button-click",a([C.Cd.FILTER,C.Cd.NAVIGATION])),onPreviousPage:()=>(0,W.ix)(String(i),"prev-button-click",a([C.Cd.FILTER,C.Cd.NAVIGATION])),wrap:!1,children:[(0,r.jsx)(J,{...l}),d.map(e=>(0,r.jsx)(m.Chip,{className:"filmography-selected-chip-filter",active:!0,id:`name-filmography-filter-${e.id}`,label:e.label,onClick:()=>s(e,!1),onColor:"accent2",postIconProps:{name:"clear"},secondaryText:String(e.count)},`name-filmography-filter-${e.id}`)),1===c.length?(0,r.jsx)(m.Chip,{className:"filmography-unselected-chip-filter",id:`name-filmography-filter-${c[0].id}`,label:c[0].label,onColor:"accent2",onClick:()=>s(c[0],!0),secondaryText:String(c[0].count)},`name-filmography-filter-${c[0].id}`):(0,r.jsx)(B(),{chips:c.map(e=>({id:`name-filmography-filter-${e.id}`,key:`name-filmography-filter-${e.id}`,label:e.label,onClick:()=>s(e,!0),secondaryText:String(e.count)})),className:"filmography-chip-group",onColor:"accent2"}),!n&&(0,r.jsx)(m.Chip,{filled:!0,id:"name-filmography-pro-chip",href:`https://pro.imdb.com/name/${i}/?ref_=cons_nm_filmo&rf=cons_nm_filmo`,label:t.formatMessage({id:"name_main_pro_filmo_in_dev",defaultMessage:"IMDbPro"}),onColor:"accent2",postIconProps:{name:"launch"}})]})},el=(0,p.default)(m.ChipList).withConfig({componentId:"sc-366e00a4-0"})(["",";",";display:block;margin-bottom:0;","{","{margin-right:0;}}"],(0,f.setPropertyToSpacingVar)("margin-left","ipt-pageMargin"),(0,f.setPropertyToSpacingVar)("margin-right","ipt-pageMargin"),f.mediaQueries.devices.onTouchScreens,f.mediaQueries.breakpoints.below.l),ec=(e,t,i,r,a,n,o,s)=>{let d=[...i],l={};if(t)d.unshift(e),(0,W.ix)(a,`job-fltr-incl-${R.TN[e.id]}`,s);else{let t=d.findIndex(t=>t.id===e.id);d.splice(t,1),(0,W.ix)(a,`job-fltr-excl-${R.TN[e.id]}`,s)}return r?d.forEach(i=>{let r=(0,W.DW)(i.id,!0),a=(0,W.DW)(i.id,!1);e.id===i.id?t&&(l[r]=!0,l[a]=!0):(l[r]=!!o[r],l[a]=!!o[a])}):d.forEach(i=>{n.forEach(r=>{let a=(0,W.DW)(i.id,!1,r.id);e.id===i.id?t&&(l[a]=!0):l[a]=!!o[a]})}),{newAccordionState:l,newJobs:d}},eg=(e,t,i,r,a)=>{let n=[...i];if(t){let t=n.indexOf(e);n.splice(t,1),(0,W.ix)(r,`rmv-incl-gen-${e.substring(0,3).toLowerCase()}`,a)}else n.push(e),(0,W.ix)(r,`incl-gen-${e.substring(0,3).toLowerCase()}`,a);return n},ep=(e,t,i,r,a)=>{let n=[...i];if(t){let t=n.indexOf(e);n.splice(t,1),(0,W.ix)(r,`rmv-excl-gen-${e.substring(0,3).toLowerCase()}`,a)}else n.push(e),(0,W.ix)(r,`excl-gen-${e.substring(0,3).toLowerCase()}`,a);return n},em=(e,t,i,r)=>{let a=!t&&e===R.ER.Date||t&&e===R.ER.TitleType;if(a){let t=e===R.ER.Date;(0,W.ix)(i,`sort-${t?"date":"ttc"}`,r)}return a};var ef=i(14856),eu=i(4556),eh=i(59459),ex=i(73354),ey=i(78187),eC=i(64101),eT=i(7531),eI=i(83904),eb=i(61142);let eS=e=>{let{className:t,credit:i,nameId:a,nameText:n,index:o}=e,s=(0,g.Z)(),d=(0,v.B)().context,{titleMainLinkBuilder:l}=(0,Q.WO)(),{makeRefMarker:c}=(0,C.Lz)(),p=(0,V.ik)(),m=i.node.title,{characters:f,creditCategoryId:u,crewJobs:h,endYear:x,episodeCreditsCount:y,releaseYear:T,seasonOrYearEpisodeData:I}=(0,W.El)(i),b=(0,ex.AP)((i.node.attributes??[]).map(e=>e.text),h),S=b.join(", "),P=f.join(", "),E=h.map(e=>e.label).join(", "),_=m?.titleType?.displayableProperty?.value?.plainText,{setTitlePromptVisible:j,setEpisodicSheetVisible:N,postElementComponent:M,promptComponent:$}=(0,eb.$)({nameId:a,props:{credit:i?.node,index:o,titleNode:m,nameId:a,nameText:n,characters:f,crewJobs:h,attributes:b,episodeCreditsCount:y,releaseYear:T,endYear:x,creditCategoryId:u,seasonOrYearEpisodeData:I,className:R.kA.PromptTrigger,releaseFilter:"UPCOMING"}}),L=[{subText:S?` (${S})`:"",text:P.length?P:E}],O=[],D=[],A=[],w=s.formatMessage(R.TY.EPISODES_COUNT,{totalEpisodes:y});y&&O.push({ariaLabel:s.formatMessage(ef.F.EXPAND,{target:w}),onClick:()=>{j(!1),N(!0)},text:w});let k=(0,eT.Z)(i);k&&D.push({text:String((0,ey.y)(k,!1))}),m?.productionStatus?.currentProductionStage?.text&&A.push({href:`https://pro.imdb.com/title/${m.id}?rf=cons_nm_filmo&ref_=cons_nm_filmo`,text:m?.productionStatus?.currentProductionStage?.text}),_&&A.push({text:_});let Y={pageType:d.pageType,subPageType:d.subPageType,refTag:c(C.Cd.WATCHLIST)},F=l({tconst:m.id,refSuffix:{t:C.Cd.CARD,n:o}}),U=l({tconst:m.id,refSuffix:{t:C.Cd.TEXT,n:o}}),B=`unrel_cred_${u}_${o}`;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(eP,{className:t??"unreleased-credit",cornerBottomList:O,cornerTopList:D,"data-testid":B,href:F,postElement:M,preElement:p?(0,r.jsx)(eI.l,{credit:i,index:o}):(0,r.jsx)(eh.WatchlistConsumer,{id:m.id,metricsContext:Y,render:e=>(0,r.jsx)(eE,{...e,onImage:!1,size:"m"})}),subTextList:A,textList:L,title:(0,eC.L)(d,m.originalTitleText,m.titleText)??"",titleLink:U},`filmography-${m.id}-credit`),$]})},eP=(0,p.default)(m.MetaDataListSummaryItem).withConfig({componentId:"sc-ee772624-0"})(["",";"],(0,f.setPropertyToColorVar)("border-color","ipt-base-border-color")),eE=(0,p.default)(m.WatchlistRibbon).withConfig({componentId:"sc-ee772624-1"})(["margin-right:",";margin-top:",";align-self:flex-start;"],f.spacing.xs,f.spacing.xxs);var e_=e=>(0,r.jsx)(C.xm,{value:C.Cd.UNRELEASED,children:(0,r.jsx)(eS,{...e})});let ej=e=>{let{pageInfo:t,nameId:i,jobId:a,titleTypeId:n,isUnreleased:o,showCloseButton:s,seeMoreLoadingState:d,onSeeMoreClick:l,accordionKey:c,accordionStateData:p}=e,f=(0,g.Z)(),{value:u}=(0,C.Lz)(),{accordionState:h,setAccordionState:x}=p,{endCursor:y,hasNextPage:T}=t||{},I={endCursor:y,isUnreleased:o,job:a,titleType:n};return(0,r.jsxs)(r.Fragment,{children:[d===R.Pf.Error&&(0,r.jsx)(ev,{className:"filmography-paginated-error",children:f.formatMessage(R.TY.PAGINATED_ERROR_MESSAGE)}),(0,r.jsxs)(eN,{className:T||s?"has-content":"",children:[T&&(0,r.jsx)(eM,{className:"filmography-see-all-button",isLoading:d===R.Pf.All,onClick:()=>{(0,W.ix)(i,`see-all-job-${R.TN[a]}`,u),document.activeElement&&(0,W.$x)(document.activeElement),l({...I,fetchAll:!0})},"data-testid":`nm-flmg-paginated-all-${a}`,text:f.formatMessage(R.TY.ALL)}),s&&(0,r.jsx)(m.TextButton,{className:"filmography-credits-close-button","data-testid":`nm-flmg-paginated-close-${a}`,onClick:()=>{(0,W.ix)(i,`close-job-${R.TN[a]}`,u),x({...h,[c]:!1});let e=document.getElementsByClassName(R.z7.ChipFilters)?.[0];e&&e.scrollIntoView({behavior:"smooth"})},postIcon:"clear",children:f.formatMessage(R.TY.CLOSE)})]})]})},ev=p.default.div.withConfig({componentId:"sc-e0ca0cd0-0"})([""," margin:"," 0;text-align:center;width:100%;"],(0,f.setTypographyType)("body"),f.spacing.m),eN=p.default.div.withConfig({componentId:"sc-e0ca0cd0-1"})(["align-items:center;width:100%;&.has-content{border-top:1px solid transparent;","}.filmography-see-all-button{float:left;}.filmography-credits-close-button{float:right;margin-right:",";margin-bottom:",";margin-top:",";}","{min-height:",";}"],(0,f.setPropertyToColorVar)("border-color","ipt-base-border-color"),f.spacing.m,f.spacing.s,f.spacing.xs,f.mediaQueries.breakpoints.above.l,f.spacing.m),eM=(0,p.default)(m.SeeMoreButton).withConfig({componentId:"sc-e0ca0cd0-2"})(["display:block;",";margin-bottom:",";margin-top:",";"],(0,f.setPropertyToSpacingVar)("margin-left","ipt-pageMargin"),f.spacing.s,f.spacing.xs),e$=e=>{let{accordionStateData:t,creditData:i,job:a,nameId:n,nameText:o,onSeeMoreClick:s,seeMoreLoadingState:d,titleType:l}=e,c=(0,g.Z)(),{value:p}=(0,C.Lz)(),{accordionState:f,setAccordionState:u}=t,h=(0,W.DW)(a.id,!1,l.id),x=i?.[h]?.credits,y=x?.total??0,T=(0,eT.D)(x?.edges??[]),I=T&&T.length>0,{hasPreviousPage:b}=x?.pageInfo||{},S=`${a.id}-${l.id}-credits`,P=f[h];if(!I)return null;let E=[],_=[];return T.forEach(e=>{e?.node?.title?.productionStatus?.currentProductionStage?.id==="released"?_.push(e):E.push(e)}),(0,r.jsx)(eD,{activeItemId:P?S:"none",className:"title-type-credits-accordion",dividers:"none",items:[{onToggleOff:()=>{(0,W.ix)(n,`hide-cbtt-${R.TN[a.id]}`,p),u({...f,[h]:!1})},onStateChange:()=>{(0,W.ix)(n,`show-cbtt-${R.TN[a.id]}`,p),u({...f,[h]:!0}),x?.pageInfo?.hasNextPage&&s({endCursor:x?.pageInfo?.endCursor,isUnreleased:!1,job:a.id,titleType:l.id,fetchAll:!0})},id:S,className:"accordion-item",collapseAriaLabel:c.formatMessage(ef.F.COLLAPSE,{target:l.text}),contentClassName:R.bV,expandAriaLabel:c.formatMessage(ef.F.COLLAPSE,{target:l.text}),indentLevel:"pageMargin",labelClassName:"accordion-label",title:(0,r.jsxs)(m.InlineList,{showDividers:!0,children:[(0,r.jsx)(m.InlineListItem,{children:l.text}),(0,r.jsx)(m.InlineListItem,{className:"credits-total",children:y})]}),children:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(m.MetaDataList,{dividers:"between",children:[E.map((e,t)=>(0,r.jsx)(e_,{className:"titleType-unreleased-credit",credit:e,index:t+1,nameId:n,nameText:o},`nm-flmg-unrel-credit-${a.id}-${t}`)),_.map((e,t)=>(0,r.jsx)(eu.Z,{className:"titleType-released-credit",categoryTitle:a.label,credit:e,index:t,nameId:n,nameText:o},`nm-flmg-credit-${a.id}-${t}`))]}),(0,r.jsx)(ej,{pageInfo:x?.pageInfo,nameId:n,jobId:a.id,titleTypeId:l.id,isUnreleased:!1,showCloseButton:b||T.length>R.Uk,seeMoreLoadingState:d,onSeeMoreClick:s,accordionKey:h,accordionStateData:t})]})}],stickyHeaders:!0},`${a.id}-${l.id}-credits-accordion`)},eL=e=>{let{creditData:t,nameId:i,nameText:a,job:n,onSeeMoreClick:o,seeMoreLoadingState:s,accordionStateData:d}=e,l=(0,g.Z)(),{value:c}=(0,C.Lz)(),{accordionState:p,setAccordionState:f}=d,u=(0,W.DW)(n.id,!1),h=t?.[u]?.credits,x=p[u],y=h?.total??0,{hasPreviousPage:T}=h?.pageInfo||{},I=(0,eT.D)(h?.edges??[]),b=I&&I.length>0,S=`${n.id}-previous-projects`;return b?(0,r.jsx)(eD,{activeItemId:x?S:"none",className:"date-credits-accordion",dividers:"none",items:[{onToggleOff:()=>{(0,W.ix)(i,`hide-cbd-${R.TN[n.id]}`,c),f({...p,[u]:!1})},onStateChange:()=>{(0,W.ix)(i,`show-cbd-${R.TN[n.id]}`,c),f({...p,[u]:!0}),h?.pageInfo?.hasNextPage&&o({endCursor:h?.pageInfo?.endCursor,isUnreleased:!1,job:n.id,titleType:void 0,fetchAll:!0})},id:S,className:"accordion-item",indentLevel:"pageMargin",collapseAriaLabel:l.formatMessage(ef.F.COLLAPSE,{target:l.formatMessage(R.TY.PREVIOUS_PROJECTS)}),contentClassName:R.bV,expandAriaLabel:l.formatMessage(ef.F.EXPAND,{target:l.formatMessage(R.TY.PREVIOUS_PROJECTS)}),labelClassName:"accordion-label",title:(0,r.jsxs)(m.InlineList,{showDividers:!0,children:[(0,r.jsx)(m.InlineListItem,{children:l.formatMessage(R.TY.PREVIOUS_PROJECTS)}),(0,r.jsx)(m.InlineListItem,{className:"credits-total",children:y})]}),children:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(m.MetaDataList,{dividers:"between",children:I.map((e,t)=>(0,r.jsx)(eu.Z,{categoryTitle:n.label,credit:e,index:t,nameId:i,nameText:a},`nm-flmg-credit-${n.id}-${t}`))}),(0,r.jsx)(ej,{pageInfo:h?.pageInfo,nameId:i,jobId:n.id,titleTypeId:void 0,isUnreleased:!1,showCloseButton:T||I.length>R.Uk,seeMoreLoadingState:s,onSeeMoreClick:o,accordionKey:u,accordionStateData:d})]})}],stickyHeaders:!0}):null},eO=e=>{let{accordionStateData:t,creditData:i,job:a,nameId:n,nameText:o,onSeeMoreClick:s,seeMoreLoadingState:d}=e,l=(0,g.Z)(),{value:c}=(0,C.Lz)(),{accordionState:p,setAccordionState:f}=t,u=(0,W.DW)(a.id,!0),h=i?.[u]?.credits,x=p[u],y=h?.total??0,T=(0,eT.D)(h?.edges??[]),I=T&&T.length>0,{hasPreviousPage:b}=h?.pageInfo||{},S=`${a.id}-upcoming-projects`;return I?(0,r.jsx)(eD,{activeItemId:x?S:"none",className:"date-unrel-credits-accordion",dividers:"none",items:[{onToggleOff:()=>{(0,W.ix)(n,`hide-ubcd-${R.TN[a.id]}`,c),f({...p,[u]:!1})},onStateChange:()=>{(0,W.ix)(n,`show-ubcd-${R.TN[a.id]}`,c),f({...p,[u]:!0}),h?.pageInfo?.hasNextPage&&s({endCursor:h?.pageInfo?.endCursor,isUnreleased:!0,job:a.id,titleType:void 0,fetchAll:!0})},id:S,className:"accordion-item",collapseAriaLabel:l.formatMessage(ef.F.COLLAPSE,{target:l.formatMessage(R.TY.UPCOMING_PROJECTS)}),contentClassName:R.bV,expandAriaLabel:l.formatMessage(ef.F.EXPAND,{target:l.formatMessage(R.TY.UPCOMING_PROJECTS)}),indentLevel:"pageMargin",labelClassName:"accordion-label",title:(0,r.jsxs)(m.InlineList,{showDividers:!0,children:[(0,r.jsx)(m.InlineListItem,{children:l.formatMessage(R.TY.UPCOMING_PROJECTS)}),(0,r.jsx)(m.InlineListItem,{className:"credits-total",children:y})]}),children:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(m.MetaDataList,{dividers:"between",className:"date-unrel-credits-list",children:T.map((e,t)=>(0,r.jsx)(e_,{credit:e,nameId:n,nameText:o,index:t+1},`nm-flmg-unrel-credit-${a.id}-${t}`))}),(0,r.jsx)(ej,{pageInfo:h?.pageInfo,nameId:n,jobId:a.id,titleTypeId:void 0,isUnreleased:!0,showCloseButton:b||T.length>R.Uk,seeMoreLoadingState:d,onSeeMoreClick:s,accordionKey:u,accordionStateData:t})]})}],stickyHeaders:!0}):null},eD=(0,p.default)(m.Accordion).withConfig({componentId:"sc-86308bda-0"})(["background:inherit;.credits-total{","}.titleType-unreleased-credit{border-bottom-style:solid;border-bottom-width:1px;border-top-style:solid;border-top-width:1px;}.titleType-unreleased-credit,.unreleased-credit:first-of-type{border-top:none;}.unreleased-credit:last-of-type{border-bottom:none;}.accordion-item{position:relative;&::after{content:'';"," "," "," display:block;box-sizing:border-box;width:calc(100% - ("," * 2));height:1px;position:relative;top:100%;z-index:10;left:0;","{margin-left:0;margin-right:0;width:100%;}}}.accordion-content{"," ","}.accordion-label{"," font-weight:500;}"],(0,f.setPropertyToColorVar)("color","ipt-on-base-textSecondary-color"),(0,f.setPropertyToColorVar)("background","ipt-base-border-color"),(0,f.setPropertyToSpacingVar)("margin-left","ipt-pageMargin"),(0,f.setPropertyToSpacingVar)("margin-right","ipt-pageMargin"),(0,f.getSpacingVar)("ipt-pageMargin"),f.mediaQueries.breakpoints.above.l,(0,f.setPropertyToSpacingVar)("padding-left","ipt-pageMargin"),(0,f.setPropertyToSpacingVar)("padding-right","ipt-pageMargin"),(0,f.setTypographyType)("body")),eR=e=>{let{job:t,sortMenuRef:i}=e,a=(0,g.Z)();return(t?.count??0)===0?null:(0,r.jsxs)(eA,{children:[(0,r.jsx)(r.Fragment,{children:a.formatMessage(R.TY.CREDITS_EXCLUDED)}),(0,r.jsx)(m.TextLink,{className:"filmography-excluded-credits",onClick:()=>i?.current?.click(),text:a.formatMessage(R.TY.UPDATE_FILTER_SELECTIONS)})]})},eA=p.default.div.withConfig({componentId:"sc-458ce7f8-0"})(["display:block;"," "," padding:"," 0px;.filmography-excluded-credits{cursor:pointer;}"],(0,f.setPropertyToSpacingVar)("margin-left","ipt-pageMargin"),(0,f.setPropertyToSpacingVar)("margin-right","ipt-pageMargin"),f.spacing.m);var ew=i(72331);let ek="filmographyData",eY=["accordionState","allJobsSelected","creditData","excludedGenres","includedGenres","selectedJobs","showExpandAllAccordions","sortByDate","sortedPossibleTitleTypes"],eF=()=>{let e;return eY.forEach(t=>{let i=(0,ew.PK)(`${ek}.${t}`);i&&(e||(e={}),e.nConst&&i.nConst!==e.nConst||(e={...e,...i}))}),e},eU=e=>{Object.keys(e).forEach(t=>{"nConst"!==t&&(0,ew.Ps)(`${ek}.${t}`,{nConst:e.nConst,[t]:e[t]})})},eB=()=>"back_forward"===String(performance?.getEntriesByType("navigation")?.[0]?.type),eV=(e,t,i)=>{if(!(0,l.getIsBrowser)())return;let r=eF();if(r){if(r?.nConst===e&&eB()){let{accordionState:a,allJobsSelected:n,creditData:o,excludedGenres:s,includedGenres:d,selectedJobs:l,showExpandAllAccordions:c,sortByDate:g,sortedPossibleTitleTypes:p}=r,{setAccordionState:m,setAllJobsSelected:f,setCreditDataAndTitleTypes:u,setExcludedGenres:h,setIncludedGenres:x,setSelectedJobs:y,setShowExpandAllAccordions:C,setSortByDate:T}=t;eG(a)&&m(a,!1),eG(n)&&f(n,!1),eG(o)&&eG(p)&&u(o,p,!1),eG(s)&&h(s,!1),eG(d)&&x(d,!1),eG(l)&&y(l,!1),eG(c)&&C(c,!1),eG(g)&&T(g,!1),(0,W.ix)(e,"use-session-store",i)}else eY.forEach(e=>{(0,ew.VV)(`${ek}.${e}`)})}},eG=e=>void 0!==e,eW=(e,t)=>{let i=e.count??0,r=t.count??0;return i{let t=[...e].sort(eW),i=t.findIndex(e=>"self"===e.id);i>-1&&t.push(t.splice(i,1)[0]);let r=t.findIndex(e=>"thanks"===e.id);r>-1&&t.push(t.splice(r,1)[0]);let a=t.findIndex(e=>"archive_footage"===e.id);return a>-1&&t.push(t.splice(a,1)[0]),t},eQ=e=>{let t=(0,g.Z)(),i=(0,N.n)(),a=(0,c.useRouter)(),n=(0,v.B)().context,{makeRefMarker:s,value:d}=(0,C.Lz)(),p=(0,I.hg)({weblabID:T.lh.IMDB_YOU_MAY_KNOW_THEM_FROM_919392,treatments:{T1:!0}}),f=(0,I.hg)({weblabID:T.lh.IMDB_WEB_PACE_SPECIFIC_PROFESSIONS_DISPLAY_1112523,treatments:{T1:!0}}),h=!!("true"===a.query[D.m8.ShowAllCredits]&&!eB());(0,o.useEffect)(()=>{(0,l.getIsBrowser)()&&h&&("complete"===document.readyState?document.getElementById(R.CG)?.scrollIntoView({behavior:"smooth"}):window.addEventListener("load",()=>{document.getElementById(R.CG)?.scrollIntoView({behavior:"smooth"})}))},[]);let[x,y]=(0,o.useState)((0,W.Jc)(e.data,i)),b=e=>y([...x,...e]),S=(0,$.b)(x.slice(0,250));(0,o.useEffect)(()=>{S?.data&&y(x.slice(250))},[S?.data]);let{nameId:P="",nameText:E="",creditData:w={},initialAccordionState:k={},initialSelectedJobs:Y=[],jobData:F=[],possibleGenres:U=[],possibleTitleTypes:B=[],totalCredits:V=0,requiresCreditLoadOnMount:G=!1,showInDevProUpsell:q}=(0,W.s7)(e.data,h,f)||{},Q=1===F.length||V<=20&&Y.length===F.length,[z,K]=(0,o.useState)(!0),J=function(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];K(e),t&&eU({nConst:P,sortByDate:e})},[H,Z]=(0,o.useState)(0===Y.length||Y===F),X=function(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];Z(e),t&&eU({nConst:P,allJobsSelected:e})},[ee,et]=(0,o.useState)(Y),ei=function(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];et(e),t&&eU({nConst:P,selectedJobs:e})},[er,ea]=(0,o.useState)([]),en=function(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];ea(e),t&&eU({nConst:P,includedGenres:e})},[eo,es]=(0,o.useState)([]),el=function(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];es(e),t&&eU({nConst:P,excludedGenres:e})},[ef,eu]=(0,o.useState)({creditData:w,hasGenreSelectionsChanged:!1,paginatedQueryInfo:void 0,pendingJobsToFetch:[],shouldIssueRequest:G,sortedPossibleTitleTypes:{}}),eh=function(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];eu(e),t&&eU({nConst:P,creditData:e.creditData,sortedPossibleTitleTypes:e.sortedPossibleTitleTypes})},[ex,ey]=(0,o.useState)(k),eC=function(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];ey(e),t&&eU({nConst:P,accordionState:e})},[eT,eI]=(0,o.useState)(Object.values(k).some(e=>!e)),eb=function(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];eI(e),t&&eU({nConst:P,showExpandAllAccordions:e})},eS=(e,t)=>{let i=H?F:ee;(0,W.kg)(e,eC,eT,eb,t??i,z,B)},eP=(0,o.useRef)(null),[{data:eE,error:e_,fetching:ej}]=(0,M.E)({query:A((0,W.vK)(ee,ef.creditData,z,B,H,F,ef.pendingJobsToFetch,ef.hasGenreSelectionsChanged),B.map(e=>e.id),z,H,er,eo,ef.paginatedQueryInfo),variables:{id:P,includeUserRating:!1},context:{personalized:!1,serverSideCacheable:!0},pause:!ef.shouldIssueRequest});(0,o.useEffect)(()=>{if(eE){let e=H?F:ee,t=(0,W.GT)(eE,ef.creditData,e,B.map(e=>e.id),z,H,ef.pendingJobsToFetch,b),i={...ef,creditData:t,hasGenreSelectionsChanged:!1,shouldIssueRequest:!1};if(!z){let e={...ef.sortedPossibleTitleTypes};(0,W.vK)(ee,ef.creditData,z,B,H,F,ef.pendingJobsToFetch,ef.hasGenreSelectionsChanged).forEach(i=>{if(e[i])return;let r=[];B.forEach(e=>{let a=(0,W.DW)(i,!1,e.id),n=t?.[a]?.credits,o=n?.total??0;r.length?r.every((t,i)=>(t.count??0){if(ev){let e;let{newCreditData:t,pageInfo:i}=(0,W.DZ)(ev,ef.paginatedQueryInfo,ef.creditData,b);if(ef.paginatedQueryInfo?.fetchAll&&i?.hasNextPage&&i?.endCursor)e={...ef.paginatedQueryInfo,endCursor:i.endCursor};else{let i=(0,W.D5)(t,H?F:ee,z,ef.sortedPossibleTitleTypes,ex);i&&(e=i)}eh({...ef,creditData:t,hasGenreSelectionsChanged:!1,paginatedQueryInfo:e})}else eN&&eh({...ef,paginatedQueryInfo:void 0})},[ev,eN]);let eM=e=>{eh({...ef,paginatedQueryInfo:e})};if((0,o.useEffect)(()=>{eV(P,{setSortByDate:J,setAllJobsSelected:X,setSelectedJobs:ei,setIncludedGenres:en,setExcludedGenres:el,setCreditDataAndTitleTypes:(e,t,i)=>{eh({...ef,creditData:e,sortedPossibleTitleTypes:t},i);let r=(0,W.KU)(e);r.length&&b(r)},setAccordionState:eC,setShowExpandAllAccordions:eb},d)},[]),(0,o.useEffect)(()=>{if("true"===a.query[D.m8.ShowAllCredits]&&!eB()){let e;let t=(0,W.k$)(z,F,B);(0,W.vK)(ee,w,z,B,!0,F,ef.pendingJobsToFetch).length||(e=(0,W.D5)(ef.creditData,ee,z,ef.sortedPossibleTitleTypes,t)),eC(t),eb(!1),X(!0),ei([]),eh({...ef,paginatedQueryInfo:e??ef.paginatedQueryInfo,pendingJobsToFetch:z?[]:[...F],shouldIssueRequest:!0})}},[a.asPath]),(!w||!Object.keys(w).length)&&!G)return null;let eD=`https://contribute.imdb.com/updates?edit=${P}/filmography&ref_=${s(C.Cd.EDIT)}`,eA=0===ee.length&&!H;return(0,r.jsx)(O.wW,{componentId:L.NG.Filmography,children:(0,r.jsxs)("div",{"data-testid":L.NG.Filmography,children:[p&&(0,r.jsx)(_,{nameId:P}),(0,r.jsxs)(m.PageSection,{children:[(0,r.jsx)(u.O,{editHref:eD,"data-testid":R.z7.FilmographySection,id:R.CG,shouldSupportDeepLink:!0,title:R.TY.FEATURE_TITLE}),(0,r.jsx)(C.xm,{value:C.Cd.CHIP_FILTERS,children:(0,r.jsx)(ed,{allJobsSelected:H,excludedGenres:eo,includedGenres:er,genres:U,jobData:Q?[]:eq(F),nameText:E,onExcludeGenre:(e,t)=>{el(ep(e,t,eo,P,d)),eh({...ef,hasGenreSelectionsChanged:!0,pendingJobsToFetch:H&&!z?[...F]:[],shouldIssueRequest:ej||0!==ee.length||H})},onIncludeGenre:(e,t)=>{en(eg(e,t,er,P,d)),eh({...ef,hasGenreSelectionsChanged:!0,pendingJobsToFetch:H&&!z?[...F]:[],shouldIssueRequest:ej||0!==ee.length||H})},onJobSelect:(e,t)=>{let i;let{newAccordionState:r,newJobs:a}=ec(e,t,ee,z,P,B,ex,d),n=0===a.length,o=a.length===F.length,s=n||o,l=!!(0,W.vK)(a,ef.creditData,z,B,s,F,ef.pendingJobsToFetch).length,c=n&&!z?[...F]:ef.pendingJobsToFetch;!t||l||eT||(i=(0,W.D5)(ef.creditData,[e],z,ef.sortedPossibleTitleTypes,r)),X(s),ei(a),eS(n?(0,W.k$)(z,F,B):r,a),eh({...ef,paginatedQueryInfo:i??ef.paginatedQueryInfo,pendingJobsToFetch:c,shouldIssueRequest:!!(ej||l||c.length>0)})},onSortSelect:e=>{if(em(e,z,P,d)){let t=e===R.ER.Date;J(t),eS({}),eh({...ef,creditData:{},pendingJobsToFetch:!t&&H?[...F]:[],shouldIssueRequest:!eA||ej})}},selectedJobs:Q?[]:ee,sortByDate:z,sortMenuRef:eP})}),!Q&&(0,r.jsxs)(eK,{children:[(0,r.jsx)(m.TextLink,{"data-testid":"nm-flmg-all-accordion-expander",onClick:()=>{let e=H?F:ee,t=eT?(0,W.k$)(z,e,B):{};(0,W.ix)(P,eT?"show-all":"hide-all",s(C.Cd.EMPTY)),eC(t),eb(!eT);let i=eT&&(0,W.D5)(ef.creditData,ee,z,ef.sortedPossibleTitleTypes,t);i&&eh({...ef,paginatedQueryInfo:i})},text:t.formatMessage(eT?R.TY.EXPAND_ALL:R.TY.COLLAPSE_ALL)}),!H&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ez,{}),(0,r.jsx)(m.TextLink,{"data-testid":"nm-flmg-all-credits",onClick:()=>{let e;let t=(0,W.k$)(z,F,B);(0,W.vK)(ee,w,z,B,!0,F,ef.pendingJobsToFetch).length||(e=(0,W.D5)(ef.creditData,ee,z,ef.sortedPossibleTitleTypes,t)),(0,W.ix)(P,"see-all",s(C.Cd.EMPTY)),eC(t),eb(!1),X(!0),ei([]),eh({...ef,paginatedQueryInfo:e??ef.paginatedQueryInfo,pendingJobsToFetch:z?[]:[...F],shouldIssueRequest:!0})},text:t.formatMessage({id:"common_all_credits",defaultMessage:"All credits"})})]})]}),ej&&(0,r.jsx)(eH,{children:(0,r.jsx)(m.Loader,{className:"filmography-loader"})}),e_&&!eE&&!ej&&(0,r.jsx)(j.ZP,{error:e_,errorMessage:t.formatMessage(R.TY.ERROR_MESSAGE),name:"Filmography",canRetry:!0,onClickRetry:()=>eh({...ef,shouldIssueRequest:!0,hasGenreSelectionsChanged:!0})}),Object.keys(ef.creditData).length>0&&!eA&&!ej&&(!e_||e_&&eE)&&(H?F:ee).map((e,t)=>{let i=(0,W.SA)(z,e.id,ef.creditData,B);return(0,r.jsxs)(o.Fragment,{children:[(0,r.jsx)(e0,{className:`filmo-section-${e.id}`,children:e.label}),z&&(0,r.jsx)(eX,{className:i?"hasExcludedCredits":"",children:(0,r.jsxs)(C.xm,{value:{t:C.Cd.JOB,n:t+1},children:[(0,r.jsx)(eO,{accordionStateData:{accordionState:ex,setAccordionState:eS},creditData:ef.creditData,job:e,nameId:P,nameText:E,onSeeMoreClick:eM,seeMoreLoadingState:(0,W.vi)(ef.paginatedQueryInfo,!!(eN&&!ev&&ef.creditData[W.DW(e.id,!0)]?.credits?.pageInfo?.hasNextPage),e.id,!0)}),(0,r.jsx)(eL,{accordionStateData:{accordionState:ex,setAccordionState:eS},creditData:ef.creditData,nameId:P,nameText:E,job:e,onSeeMoreClick:eM,seeMoreLoadingState:(0,W.vi)(ef.paginatedQueryInfo,!!(eN&&!ev&&ef.creditData[W.DW(e.id,!1)]?.credits?.pageInfo?.hasNextPage),e.id,!1)}),i&&(0,r.jsx)(eR,{job:e,sortMenuRef:eP})]})}),!z&&(0,r.jsxs)(eX,{className:i?"hasExcludedCredits":"",children:[(ef.sortedPossibleTitleTypes[e.id]??[]).map((i,a)=>(0,r.jsx)(C.xm,{value:[{t:C.Cd.JOB,n:t+1},{t:C.Cd.TYPE,n:a+1}],children:(0,r.jsx)(e$,{accordionStateData:{accordionState:ex,setAccordionState:eS},creditData:ef.creditData,job:e,nameId:P,nameText:E,titleType:i,onSeeMoreClick:eM,seeMoreLoadingState:(0,W.vi)(ef.paginatedQueryInfo,!!(eN&&!ev&&ef.creditData[W.DW(e.id,!1,i.id)]?.credits?.pageInfo?.hasNextPage),e.id,!1,i.id)},`nm-flmg-${e.id}-${i.id}-credits`)},`job_${t+1}_type_${a+1}`)),i&&(0,r.jsx)(eR,{job:e,sortMenuRef:eP})]})]},`filmo-${e}-${t}`)}),q&&(0,r.jsx)(eJ,{children:(0,r.jsx)(m.MetaDataListItem,{"data-testid":"nm_flmg_in_dev_pro_upsell",labelLink:`https://pro.imdb.com/name/${n.pageConst}/?ref_=cons_nm_indevp&rf=cons_nm_indevp`,labelTitle:t.formatMessage({id:"name_main_pro_filmo_filter",defaultMessage:"In-development projects at IMDbPro"}),labelLinkType:"internal"})})]})]})})},ez=p.default.div.withConfig({componentId:"sc-5b53e0d6-0"})(["&::before{background-color:currentcolor;content:'';display:inline-block;padding:1px;vertical-align:middle;}"]),eK=p.default.div.withConfig({componentId:"sc-5b53e0d6-1"})(["display:flex;gap:",";margin-bottom:0;margin-top:1.25rem;",";",";width:100%;"],f.spacing.s,(0,f.setPropertyToSpacingVar)("margin-left","ipt-pageMargin"),(0,f.setPropertyToSpacingVar)("margin-right","ipt-pageMargin")),eJ=(0,p.default)(m.MetaDataList).withConfig({componentId:"sc-5b53e0d6-2"})(["margin-top:",";",";",";"],f.spacing.m,(0,f.setPropertyToSpacingVar)("margin-left","ipt-pageMargin"),(0,f.setPropertyToSpacingVar)("margin-right","ipt-pageMargin")),eH=p.default.div.withConfig({componentId:"sc-5b53e0d6-3"})(["",";min-height:20rem;text-align:center;.filmography-loader{height:20rem;position:relative;}"],(0,f.setPropertyToSpacingVar)("margin-left","ipt-pageMargin")),eZ=(0,p.css)(["content:'';"," "," "," display:block;box-sizing:border-box;width:calc(100% - ("," * 2));height:1px;position:absolute;z-index:10;left:0;"],(0,f.setPropertyToColorVar)("background","ipt-base-border-color"),(0,f.setPropertyToSpacingVar)("margin-left","ipt-pageMargin"),(0,f.setPropertyToSpacingVar)("margin-right","ipt-pageMargin"),(0,f.getSpacingVar)("ipt-pageMargin")),eX=p.default.div.withConfig({componentId:"sc-5b53e0d6-4"})(["position:relative;&::before{"," top:0;}","{&.hasExcludedCredits::after{"," bottom:0;}}","{border:1px solid ",";"," ",";",";&::before,&::after{content:none;}}.","{margin-right:-",";}"],eZ,f.mediaQueries.breakpoints.below.l,eZ,f.mediaQueries.breakpoints.above.l,(0,f.getColorVar)("ipt-base-border-color"),(0,f.setPropertyToShapeVar)("border-radius","ipt-cornerRadius"),(0,f.setPropertyToSpacingVar)("margin-left","ipt-pageMargin"),(0,f.setPropertyToSpacingVar)("margin-right","ipt-pageMargin"),R.kA.PromptTrigger,f.spacing.s),e0=(0,p.default)(m.Title).withConfig({componentId:"sc-5b53e0d6-5"})(["margin-top:",";margin-bottom:",";"],f.spacing.m,f.spacing.xs);var e1=e=>(0,r.jsx)(C.xm,{value:C.Cd.FILMOGRAPHY,children:(0,r.jsx)(eQ,{...e})});let e2={component:function(e){return(0,r.jsx)(e1,{...e})},fragment:{name:"NameMainFilmography",gql:n()` fragment NameMainFilmography on Name { id nameText { text } primaryImage { caption { plainText } height width url } # pulled to organize filmo primaryProfessions { category { text id } } # IMDB_WEB_PACE_SPECIFIC_PROFESSIONS_DISPLAY_1112523 professions { professionCategory { linkedCreditCategory { id } } } releasedPrimaryCredits: creditCategories( filter: { professions: PRIMARY_PROFESSIONS_ONLY projectStatus: ["PREVIOUS"] } ) { category { id text } credits(first: 15) { total edges { node { ...CreditMetaData title { ...CreditCard } } } pageInfo { hasNextPage hasPreviousPage endCursor } } } unreleasedPrimaryCredits: creditCategories( filter: { professions: PRIMARY_PROFESSIONS_ONLY projectStatus: ["UPCOMING"] } sort: { by: RELEASE_DATE, order: ASC } ) { category { id text } credits(first: 10) { total edges { node { ...CreditMetaData title { ...CreditCard } } } pageInfo { hasNextPage hasPreviousPage endCursor } } } jobs: creditCategories { category { id text } credits(first: 0) { total } } creditSummary { totalCredits { total restriction { unrestrictedTotal explanations { text reason } } } titleTypeCategories { total titleTypeCategory { id text } } genres { total genre { id displayableProperty { value { plainText } } } } } } ${s.p} ${d.w} `}}},932:function(e,t,i){i.d(t,{$x:function(){return _},D5:function(){return S},DF:function(){return I},DW:function(){return c},DZ:function(){return h},El:function(){return x},GT:function(){return f},Jc:function(){return g},KU:function(){return p},SA:function(){return j},Yh:function(){return T},hH:function(){return v},ix:function(){return C},k$:function(){return P},kg:function(){return E},oG:function(){return y},s7:function(){return m},vK:function(){return u},vi:function(){return b}});var r=i(53703),a=i(25436),n=i(34052),o=i(64180),s=i(27261),d=i(98046),l=i(901);let c=(e,t,i)=>`${e}_${i?`${i}_`:""}${t?"unreleasedCredits":"credits"}`,g=(e,t)=>{if(!t||!e)return[];{let t=new Set;return(e.releasedPrimaryCredits??[]).forEach(e=>{(e?.credits?.edges??[]).forEach(e=>e?.node?.title?.id&&t.add(e?.node?.title?.id))}),(e.unreleasedPrimaryCredits??[]).forEach(e=>{(e?.credits?.edges??[]).forEach(e=>e?.node?.title?.id&&t.add(e?.node?.title?.id))}),Array.from(t).map(e=>({id:e}))}},p=e=>{let t=new Set;return Object.values(e).forEach(e=>{e.credits.edges.map(e=>e.node.title.id).filter(Boolean).forEach(t.add,t)}),Array.from(t).map(e=>({id:e}))},m=(e,t,i)=>{let r;if(!e)return;let a=String(e?.id),n=String(e.nameText?.text),o=e.primaryImage?{caption:e.primaryImage?.caption?.plainText??"",maxHeight:e.primaryImage?.height??0,maxWidth:e.primaryImage?.width??0,url:e.primaryImage?.url??""}:void 0,s=e?.creditSummary?.totalCredits?.total??0,d=e?.creditSummary?.totalCredits?.restriction?.unrestrictedTotal??0,l=(e?.jobs??[]).reduce((e,t)=>(Number(t?.credits?.total)>0&&e.push({count:Number(t?.credits?.total),id:String(t?.category?.id),label:String(t?.category?.text)}),e),[]),g=l.reduce((e,t)=>e.add(t.id),new Set),{newCreditCategoryIdToOldCategoryIdObject:p,professions:m,primaryProfessions:f,releasedPrimaryCredits:u,unreleasedPrimaryCredits:h}=e,x=e=>p?.[e??""]??"";if(i){let e=m?.find(e=>{let t=x(e?.professionCategory.linkedCreditCategory?.id);return g.has(t)});r=x(e?.professionCategory.linkedCreditCategory?.id)}else r=f?.find(e=>g.has(e.category?.id))?.category?.id??"";let y=[],C={},T=s<=10;l.forEach(e=>{C[c(e.id,!0)]=T||t,C[c(e.id,!1)]=t||T||r===e.id});let I={};i?m?.forEach(e=>{let t=x(e?.professionCategory.linkedCreditCategory?.id),i=l.find(e=>t===e.id);i&&y.push(i),h?.forEach(e=>{if(e.category.id===t){let t=c(e.category.id,!0);e?.credits&&e?.credits?.edges?.length&&(I[t]={creditCategory:String(e?.category?.text),credits:e?.credits})}}),u?.forEach(e=>{if(e.category.id===t){let t=c(e.category.id,!1);e?.credits&&e?.credits?.edges?.length&&(I[t]={creditCategory:String(e?.category?.text),credits:e?.credits})}})}):f?.forEach(e=>{let t=l.find(t=>e?.category?.id===t.id);t&&y.push(t),h?.forEach(t=>{if(t.category.id===e.category.id){let e=c(t.category.id,!0);t?.credits&&t?.credits?.edges?.length&&(I[e]={creditCategory:String(t?.category?.text),credits:t?.credits})}}),u?.forEach(t=>{if(t.category.id===e.category.id){let e=c(t.category.id,!1);t?.credits&&t?.credits?.edges?.length&&(I[e]={creditCategory:String(t?.category?.text),credits:t?.credits})}})});let b=0===Object.keys(I).length&&s>0,S=[];t||(S=b?l:y);let P=(e?.creditSummary?.genres??[]).map(e=>e?.genre?.displayableProperty?.value?.plainText??"").filter(e=>!!e),E=(e?.creditSummary?.titleTypeCategories??[]).map(e=>({id:e?.titleTypeCategory?.id,text:e?.titleTypeCategory?.text}));return b||t||Object.keys(C).forEach(e=>{C[e]&&(I[e]||(C[c(S[0].id,!0)]=!0))}),{creditData:I,initialAccordionState:C,initialSelectedJobs:S,jobData:l,nameId:a,nameImage:o,nameText:n,possibleGenres:P,possibleTitleTypes:E,totalCredits:s,requiresCreditLoadOnMount:b||t&&s>0,showInDevProUpsell:d-s>0}},f=(e,t,i,r,a,n,o,s)=>{let d={...t},l=new Set;if(n){if(a){let t=e?.name?.unreleasedCredits,i=e?.name?.releasedCredits;t?.forEach(e=>{let t=c(e?.category?.id,!0);e?.credits&&e?.credits?.edges?.length&&(d[t]={creditCategory:String(e?.category?.text),credits:e?.credits},e.credits.edges.map(e=>e.node.title.id).filter(Boolean).forEach(l.add,l))}),i?.forEach(e=>{let t=c(e?.category?.id,!1);e?.credits&&e?.credits?.edges?.length&&(d[t]={creditCategory:String(e?.category?.text),credits:e?.credits},e.credits.edges.map(e=>e.node.title.id).filter(Boolean).forEach(l.add,l))})}else[...o].splice(0,2).forEach(t=>{r.forEach(i=>{let r=c(t.id,!1,i),a=e?.name?.[r];a&&(d[r]={creditCategory:String(t.id),credits:a},a.edges.map(e=>e.node.title.id).filter(Boolean).forEach(l.add,l))})})}else i.forEach(t=>{if(a){let i=c(t.id,!0),r=e?.name?.[i];r&&(d[i]={creditCategory:String(t.id),credits:r},r.edges.map(e=>e.node.title.id).filter(Boolean).forEach(l.add,l));let a=c(t.id,!1),n=e?.name?.[a];n&&(d[a]={creditCategory:String(t.id),credits:n},n.edges.map(e=>e.node.title.id).filter(Boolean).forEach(l.add,l))}else r.map(i=>{let r=c(t.id,!1,i),a=e?.name?.[r];a&&(d[r]={creditCategory:String(t.id),credits:a},a.edges.map(e=>e.node.title.id).filter(Boolean).forEach(l.add,l))})});return l.size&&s(Array.from(l).map(e=>({id:e}))),d},u=(e,t,i,r,a,n,o,s)=>{if(s)return e.map(e=>e.id);let d=[];return a&&!i?[...o].splice(0,3).forEach(e=>d.push(e.id)):(a?n:e).forEach(e=>{if(i){let i=c(e.id,!0),r=t[i]?.credits?.edges?.length,a=c(e.id,!1),n=t[a]?.credits?.edges?.length;r||n||d.push(e.id)}else r.some(i=>{let r=c(e.id,!1,i.id);return!!t[r]?.credits?.edges?.length})||d.push(e.id)}),d},h=(e,t,i,r)=>{let a;if(!t)return{newCreditData:i,pageInfo:void 0};let n=new Set,o={...i},{isUnreleased:s,job:d,titleType:l}=t,g=c(d,!!s,l),p=e?.name?.[g];return o[g]?.credits&&p&&(o[g].credits.pageInfo={endCursor:p?.pageInfo?.endCursor,hasNextPage:p?.pageInfo?.hasNextPage,hasPreviousPage:p?.pageInfo?.hasNextPage},a=o[g].credits.pageInfo,o[g].credits.edges=[...o[g].credits.edges??[],...p?.edges??[]],p.edges.map(e=>e.node.title.id).filter(Boolean).forEach(n.add,n)),n.size&&r(Array.from(n).map(e=>({id:e}))),{newCreditData:o,pageInfo:a}},x=e=>{let t=e?.node?.title,i=t?.releaseYear?.year,a=null,o=0,s=e?.node?.category,d=s?.text,l=s?.id,c=(e?.node?.characters??[]).map(e=>e.name),g=n.k.some(e=>e===s?.id),p=[];if(!g){let t=(e?.node?.jobs??[]).map(e=>({id:e?.id,label:e?.text}));t.length||t.push({id:s?.id,label:String(s?.text)}),p=t}let m=(0,r.f)(e.node);return t?.titleType?.canHaveEpisodes&&(i=e?.node?.episodeCredits?.yearRange?.year??i,a=e?.node?.episodeCredits?.yearRange?.endYear??a,o=e?.node?.episodeCredits?.total),{creditCategory:d,creditCategoryId:l,characters:c,crewJobs:p,endYear:a,episodeCreditsCount:o,releaseYear:i,seasonOrYearEpisodeData:m}},y=(e,t)=>{let i=l.TN[t??""];return`${e}${i?`_${i}`:""}`},C=(e,t,i,r)=>{let n={type:a.PageType.NAME,subType:a.SubPageType.MAIN,id:e},o=i??t.replace(/-/g,"_"),l=r??d.qB.ACTION_ONLY;(0,s.ar)(n,t,l,o)},T=e=>{let t;switch(e){case l.i3:t=a.NextClientMetrics.FILMOGRAPHY_FILTER_ICON_FILTER_ALT_COUNT;break;case l.dQ:t=a.NextClientMetrics.FILMOGRAPHY_FILTER_ICON_TUNE_COUNT;break;case l.nt:default:t=a.NextClientMetrics.FILMOGRAPHY_FILTER_ICON_FILTER_LIST_COUNT}(0,o.cY)({metricName:t,unit:a.Unit.COUNT,value:1,pageType:a.PageType.NAME,subPageType:a.SubPageType.MAIN,time:new Date().getTime()})},I=e=>e?.T2?l.dQ:e?.T1?l.i3:l.nt,b=(e,t,i,r,a)=>{if(t)return l.Pf.Error;let{job:n,titleType:o,isUnreleased:s}=e||{};return n!==i||s!==r||(o||a)&&o!==a?l.Pf.None:l.Pf.All},S=(e,t,i,r,a)=>{let n;return t.every(t=>{if(i){let i=c(t.id,!0);if(a[i]){let r=e[i]?.credits;if(r&&r.pageInfo?.hasNextPage)return n={endCursor:r.pageInfo.endCursor??"",fetchAll:!0,isUnreleased:!0,job:t.id,titleType:void 0},!1}let r=c(t.id,!1);if(a[r]){let i=e[r]?.credits;if(i&&i.pageInfo?.hasNextPage)return n={endCursor:i.pageInfo.endCursor??"",fetchAll:!0,isUnreleased:!1,job:t.id,titleType:void 0},!1}}else(r[t.id]??[]).every(i=>{let r=c(t.id,!1,i.id);if(a[r]){let a=e[r]?.credits;if(a&&a.pageInfo?.hasNextPage)return n={endCursor:a.pageInfo.endCursor??"",fetchAll:!0,isUnreleased:!1,job:t.id,titleType:i.id},!1}return!0});return!0}),n},P=(e,t,i)=>{let r={};return e?t.forEach(e=>{let t=c(e.id,!1),i=c(e.id,!0);r[t]=!0,r[i]=!0}):t.forEach(e=>{i.forEach(t=>{r[c(e.id,!1,t.id)]=!0})}),r},E=(e,t,i,r,a,n,o)=>{t(e),i||Object.values(e).some(e=>e)?i&&Object.keys(P(n,a,o)).every(t=>e[t])&&r(!1):r(!0)},_=e=>{let t,i=e;for(;!t&&i;)i.parentElement?.classList?.contains(l.bV)?t=i.parentElement:i=i.parentElement??void 0;if(t){let e=t.children[0].getElementsByTagName("a"),i=e[e.length-1];i?.focus()}},j=(e,t,i,r)=>{let a;if(e){let e=c(t,!1),r=i?.[e]?.credits?.edges,n=r&&r.length>0,o=c(t,!0),s=i?.[o]?.credits?.edges,d=s&&s.length>0;a=!n&&!d}else{let e=!1;r.every(r=>{let a=c(t,!1,r.id),n=i?.[a]?.credits?.edges;return!n||!(n.length>0)||(e=!0,!1)}),a=!e}return a},v=(e,t)=>e.creditSummary?.totalCredits&&e.creditSummary.totalCredits.total>0?{text:t.formatMessage(l.TY.FEATURE_TITLE),anchor:l.CG}:void 0},4556:function(e,t,i){var r=i(52322);i(2784);var a=i(79855),n=i(19596),o=i(45103),s=i(91842),d=i(51817),l=i(14856),c=i(44667),g=i(85767),p=i(73354),m=i(78187),f=i(33274),u=i(72814),h=i(64101),x=i(901),y=i(932),C=i(7531),T=i(83904),I=i(61142);let b=e=>{let t,{categoryTitle:i,className:n,credit:s,index:b,nameId:_,nameText:j,releaseFilter:v}=e,N=(0,a.Z)(),M=(0,g.B)().context,{titleMainLinkBuilder:$}=(0,f.WO)(),{makeRefMarker:L}=(0,u.Lz)(),O=s.node.title,D=(0,h.L)(M,O?.originalTitleText?.text,O?.titleText?.text)??"",R=O.id??"",A=(0,c.P)(O.ratingsSummary?.aggregateRating,"imdb"),w=o.useRatingsContext(R)?.rating,k=(0,c.P)(w,"user"),Y=N.formatMessage({id:"common_ariaLabels_ratingButtonRated",defaultMessage:"Your rating: {rating}"},{rating:k}),F=N.formatMessage({id:"common_ariaLabels_ratingButtonUnrated",defaultMessage:"Rate {titleName}"},{titleName:D}),{characters:U,creditCategoryId:B,crewJobs:V,endYear:G,episodeCreditsCount:W,releaseYear:q,seasonOrYearEpisodeData:Q}=(0,y.El)(s),z=b+1,K=$({tconst:R,refSuffix:{t:u.Cd.CARD,n:z}}),J=$({tconst:R,refSuffix:{t:u.Cd.TEXT,n:z}}),H=(0,p.AP)((s?.node?.attributes??[]).map(e=>e.text),V),Z=(0,p.Kb)(U,3),X=(0,p.Kb)(V.map(e=>e.label),3),ee=!1;U&&U.length&&Z?(t=Z,ee=U.length>Z.length):X&&(t=X,ee=V.length>X.length),t=(0,p.D1)(t,ee,H);let et=O?.titleType?.displayableProperty?.value?.plainText,ei=et?[{text:et}]:void 0,er=(0,C.Z)(s),ea=er?(0,m.y)(er,!1):void 0,{postElementComponent:en,promptComponent:eo,setTitlePromptVisible:es,setEpisodicSheetVisible:ed}=(0,I.$)({nameId:_,props:{credit:s?.node,index:b,titleNode:O,nameId:_,nameText:j,characters:U,crewJobs:V,attributes:H,episodeCreditsCount:W,releaseYear:q,endYear:G,creditCategoryId:B,seasonOrYearEpisodeData:Q,className:x.kA.PromptTrigger,releaseFilter:v}}),el=O?.titleType&&!!O?.titleType?.canHaveEpisodes,ec=N.formatMessage(x.TY.EPISODES_COUNT,{totalEpisodes:W}),eg=el&&W>0?[{ariaLabel:N.formatMessage(l.F.EXPAND,{target:ec}),onClick:()=>{es(!1),ed(!0)},text:ec}]:void 0,ep=`cred_${i.toLowerCase()}_${b}`;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(E,{ariaLabel:D,className:n,cornerBottomList:eg,cornerTopList:ea?[{text:ea}]:void 0,"data-testid":ep,href:K,postElement:en,preElement:(0,r.jsx)(T.l,{credit:s,index:b}),title:D,titleLink:J,children:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(S,{children:[(A||k)&&(0,r.jsx)("span",{onSelect:()=>(0,y.ix)(_,"filmography-row-click",L(u.Cd.RATING)),children:(0,r.jsx)(P,{ariaLabelRated:Y,ariaLabelUnrated:F,className:"credit-rating-group",formattedImdbRating:A,formattedUserRating:k})}),(ei?.length??0)>0&&ei?.map((e,t)=>r.jsx("span",{children:e.text},`credit-${i.toLowerCase()}_${b}-subtext-${t}`))]}),t.length>0&&(0,r.jsx)(o.InlineList,{className:"credit-text-list",showDividers:!0,children:t.map((e,t)=>(0,r.jsx)(o.InlineListItem,{children:(0,r.jsx)(d.TextOrLink,{...e})},`credit-${i.toLowerCase()}_${b}-text-${t}`))})]})},`${i}-${b}`),eo]})},S=n.default.div.withConfig({componentId:"sc-d5824c4f-0"})(["align-items:center;display:flex;flex-direction:row;"]),P=(0,n.default)(o.PosterCardRatingStarGroup).withConfig({componentId:"sc-d5824c4f-1"})(["margin-bottom:0;margin-left:-2px;margin-right:",";width:fit-content;"],s.spacing.xxs),E=(0,n.default)(o.MetaDataListSummaryItem).withConfig({componentId:"sc-d5824c4f-2"})(["overflow:visible;.episode-click{font-weight:bold;}"]);t.Z=e=>(0,r.jsx)(u.xm,{value:u.Cd.CREDIT,children:(0,r.jsx)(b,{...e})})},83904:function(e,t,i){i.d(t,{l:function(){return g}});var r=i(52322);i(2784);var a=i(19596),n=i(46163),o=i(91842),s=i(33274),d=i(72814),l=i(64101),c=i(50926);let g=e=>{let{credit:t,index:i}=e,a=t.node.title,{titleMainLinkBuilder:o}=(0,s.WO)(),g=(0,l.K)({titleText:a.titleText.text,originalTitleText:a.originalTitleText?.text});if(!g)return null;let m=o({tconst:a.id,refSuffix:{t:d.Cd.IMAGE,n:i}}),f=(0,c.K0)(a.primaryImage,g);return(0,r.jsx)(p,{children:(0,r.jsx)(n.Poster,{imageProps:{imageModel:f,size:"s",imageType:a.titleType?.id},href:m,ariaLabel:g,dynamicWidth:!0})})},p=a.default.div.withConfig({componentId:"sc-91097993-0"})(["width:52px;margin-right:0.5rem;flex-shrink:0;display:flex;","{width:40px;}"],o.mediaQueries.breakpoints.above.s)},61142:function(e,t,i){i.d(t,{$:function(){return E}});var r=i(52322),a=i(2784),n=i(9277),o=i(72814),s=i(98046),d=i(932),l=i(72779),c=i.n(l),g=i(79855),p=i(45103),m=i(58605),f=i(901),u=e=>{let{className:t,credit:i,index:a,titleNode:n,setTitlePromptVisible:l}=e,u=(0,g.Z)(),{makeRefMarker:h}=(0,o.Lz)(),{pageConst:x}=(0,m.y)();return i&&n?(0,r.jsx)(p.IconButton,{name:"info",onColor:"accent2",id:`${i.category?.id}_${n.id}`,label:u.formatMessage(f.TY.SEE_MORE),className:c()("credit-card-details-button",t),onSelect:()=>{(0,d.ix)(String(x),"tp-prmpt-open",h({t:o.Cd.EMPTY,n:a+1}),s.qB.POP_UP),l(!0)}}):null},h=i(22707),x=i(47761),y=i(85767),C=i(78187),T=i(33274),I=i(27261),b=i(64101),S=i(50926),P=e=>{let{index:t,credit:i,titleNode:a,nameId:n,nameText:s,characters:l,crewJobs:c,attributes:p,episodeCreditsCount:m,releaseYear:u,endYear:P,creditCategoryId:E,titlePromptVisible:_,setTitlePromptVisible:j,episodicSheetVisible:v,setEpisodicSheetVisible:N,seasonOrYearEpisodeData:M,releaseFilter:$}=e,{context:L}=(0,y.B)(),O=(0,g.Z)(),D=(0,I.iI)(),{titleMainLinkBuilder:R}=(0,T.WO)(),{makeRefMarker:A,value:w}=(0,o.Lz)();if(!i||!a)return null;let k=(0,b.L)(L,a.originalTitleText?.text,a.titleText?.text)??"",Y=a.titleType?.id,F=a.primaryImage?.caption?.plainText||k,U=(0,S.Gs)({...a.primaryImage},F),B=a.releaseYear?(0,C.y)({year:u,endYear:P},!1):void 0,V={id:E,label:i.category?.text??""},G={href:R({tconst:a.id,refSuffix:(0,o.Qk)({refStr:(0,d.oG)(t+1,E),explanation:` TODO: This one shouldn't be too difficult to root out but punting it to a follow up CR.`})}),imageModel:U,isOpen:!0,title:k,titleType:Y,type:"poster"},W=()=>{j(!1),N(!0)};return(0,r.jsxs)(r.Fragment,{children:[_&&(0,r.jsx)(h.ZP,{contentOverride:()=>{let e=[];return m&&e.push({text:O.formatMessage(f.TY.SEE_EPISODES_COUNT,{totalEpisodes:m})}),B&&e.push({text:B}),(0,r.jsx)(h._0,{titleData:{attributes:p,certificate:a.certificate?.rating,canRate:!!a.canRate?.isRatable,creditSummary:l?.length?l:c.map(e=>e.label),endYear:P,episodeCount:m,genres:a.titleGenres?.genres?.map(e=>e.genre.text),id:a.id,jobCategory:V,primaryImage:{...(0,S.Gs)(a.primaryImage,F)},rating:a.ratingsSummary?.aggregateRating??void 0,refMarkerN:t,releaseYear:u,runtime:a.runtime?.seconds,titleText:k,titleType:a.titleType?{canHaveEpisodes:a.titleType.canHaveEpisodes,id:a.titleType.id,text:a.titleType.text}:void 0,trailerId:a.latestTrailer?.id??void 0},titleMetadata:e,nameText:s,onEpisodicCreditClick:()=>{D(A([o.Cd.TOP,o.Cd.EPISODE]),"cc-series-creds"),W()}})},isOpen:_,onClose:()=>j(!1),refMarker:{prefix:w},title:{...a}}),v&&(0,r.jsx)(x.ZP,{headerProps:{ariaLabel:G.title,imageModel:G.imageModel,title:G.title,type:G.type,imageType:a.titleType?.id},titleId:a.id,isOpen:v,episodeCount:m??0,jobCategory:V,nameId:n,onCloseSelected:()=>N(!1),seasonOrYearEpisodeData:M,tenureText:B,releaseFilter:$})]})};function E(e){let{nameId:t,props:i}=e,[l,c]=(0,a.useState)(!1),[g,p]=(0,a.useState)(!1),{makeRefMarker:m}=(0,o.Lz)(),f=i?.titleNode?.id||"",h=i?.titleNode?.userRating?.value;(0,n.h)(f,h);let x=null,y=null;return void 0!==i&&(x=(0,r.jsx)(u,{className:i.className,titleNode:i.titleNode,credit:i.credit,index:i.index,setTitlePromptVisible:c}),y=(0,r.jsx)(P,{...i,titlePromptVisible:l,setTitlePromptVisible:c,episodicSheetVisible:g,setEpisodicSheetVisible:p})),{postElementComponent:x,promptComponent:y,setTitlePromptVisible:e=>{e&&(0,d.ix)(t,"cc-more-btn",m(o.Cd.TOP),s.qB.POP_UP),c(e)},setEpisodicSheetVisible:e=>{e&&(0,d.ix)(t,"cc-series-creds",m(o.Cd.EPISODE),s.qB.POP_UP),p(e)}}}},7531:function(e,t,i){function r(e){return e.filter(e=>!!e.node&&!!e.node.title&&!!e.node.title.id&&!!e.node.title.titleText&&!!e.node.title.titleText.text)}i.d(t,{D:function(){return r},Z:function(){return a}});let a=e=>e.node?.episodeCredits?.yearRange??e.node.title?.releaseYear},50089:function(e,t,i){i.d(t,{V1:function(){return m},sG:function(){return f}});var r=i(52322),a=i(30382),n=i.n(a),o=i(2784),s=i(59459),d=i(25172),l=i(28827),c=i(27261),g=i(98046);let p="_wo_",m=(e,t)=>{let[i,a]=(0,o.useState)(),[n,m]=(0,o.useState)(),f=(0,l.N)({id:"common_buttons_watchOptions",defaultMessage:"Watch options"});return{createButton:(i,r,n)=>{let{primaryWatchOption:o}=i;return n||o?{props:{onSelect:()=>{a(i),m(void 0!==r?r+1:void 0),e&&(0,c.K8)(t+p+`${void 0!==r?r+1:""}`,e,`watcho-open-${i.id}`,g.qB.POP_UP)}},text:f}:void 0},createPrompt:o=>{let l="_wo_wl_rbn",f=e&&t?{pageType:e.type,subPageType:e.subType,refTag:n?t+l+"_"+n:t+l}:void 0;return(0,r.jsx)(s.WatchlistConsumer,{id:i?i.id:"",metricsContext:f,render:()=>(0,r.jsx)(d.ZP,{title:i,isOpen:!!i,onClose:()=>{a(void 0),m(void 0),e&&(0,c.K8)(o+p+n,e,`watcho-close-${i?.id}`,g.qB.POP_UP)}})})}}},f={titleWatchOption:n()` fragment TitleWatchOption on Title { primaryWatchOption { additionalWatchOptionsCount } } `};n()` query TitleListWatchOption( $titleIds: [ID!]! $location: WatchOptionsLocation ) { titles(ids: $titleIds) { id primaryWatchOption(location: $location) { additionalWatchOptionsCount } } } `}}]);