"use strict";(globalThis.webpackChunk_plex_client_qt=globalThis.webpackChunk_plex_client_qt||[]).push([["packages_app_screens_profile_RatingsHubGridScreen_tsx"],{33104:(e,t,i)=>{i.r(t),i.d(t,{default:()=>b});var a=i(80038),n=i(36725),s=i(62401),r=i(43933),o=i(82357),l=i(10213),u=i(86794),d=i(6389);class c extends u.Z{constructor(e){super(),this.metricsPage=o.GJ.RatingsDetails,this.getDisplayFields=()=>[{fields:[s.PD.Title,s.PD.Year,s.PD.UserRating],type:s.pG.Movie},{fields:[s.PD.GrandparentTitle,s.PD.EpisodeIdentifier,s.PD.UserRating],type:s.pG.Episode},{fields:[s.PD.Title,s.PD.ChildCount,s.PD.UserRating],type:s.pG.Show},{fields:[s.PD.ParentTitle,s.PD.Title,s.PD.UserRating],type:s.pG.Season}],this._fetchItems=async(e,t)=>{var i,n;const{data:s}=await(0,a.JT)(a.J8,{first:e,after:t,uuid:this._uuid,skipUserState:!0},"cache-and-network");return{hasNextPage:!(null==s||!s.user.ratingsV2.pageInfo.hasNextPage),cursor:null!==(i=null==s?void 0:s.user.ratingsV2.pageInfo.endCursor)&&void 0!==i?i:"",items:null!==(n=null==s?void 0:s.user.ratingsV2.nodes.map((e=>({...(0,l.Z)(e.metadataItem,r.providerIdentifiers.discoverIdentifier),activity:{id:e.id,rating:e.rating,type:e.__typename,userV2:{...e.userV2,id:this._uuid}}}))))&&void 0!==n?n:[]}},this._uuid=e,this.hubViewModel=new d.Z(s.cA.ProfileRatings,"",e,this._fetchItems,void 0,void 0,void 0,{allowViewAllItem:!1})}}var h=i(95206),p=i(88271),g=i(21614),f=i(62930),v=i(95794),y=function(e,t,i,a){var n,s=arguments.length,r=s<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,a);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(r=(s<3?n(r):s>3?n(t,i,r):n(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},P=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};class _ extends f.Z{_attach(){var e;const t=null===(e=this._userManager.current)||void 0===e?void 0:e.hasFeature(g.s.CommunityP3R1reviewsCreation);this.icon.icon=p.eG.Star,this.title.content=t?(0,n.ZP)("Seen it? Loved it? Rate & Review it!"):(0,n.ZP)("Seen it? Loved it? Rate it!"),this.body.content=(0,n.ZP)("Good, bad, or ugly – let your friends know how you feel about what you’re watching."),this.button.label=t?(0,n.ZP)("Add your first review"):(0,n.ZP)("Add a Rating Now"),this.button.onPress=()=>{this._navigation.navigate("WatchHistoryScreen")}}}y([(0,v.Z)("navigation"),P("design:type",Object)],_.prototype,"_navigation",void 0),y([(0,v.Z)("userManager"),P("design:type",Object)],_.prototype,"_userManager",void 0);class b extends h.Z{async _init(){this.initialData&&(this.model=new c(this.initialData.uuid),super._init(),this.patch({Screen:{ZeroState:{type:_,visible:!1}}}))}async setTitle(){var e;if(!this.initialData)return;const{data:t}=await(0,a.JT)(a.bS,{uuid:this.initialData.uuid});t&&t.user.username!==(null===(e=this._userManager.current)||void 0===e?void 0:e.username)?this._title.content=(0,n.ZP)("{name}'s Ratings",{name:t.user.displayName||t.user.username}):this._title.content=(0,n.ZP)("My Ratings")}}}}]);