"use strict";(self.webpackChunkplex_web_client=self.webpackChunkplex_web_client||[]).push([[460],{20460:(e,n,r)=>{r.r(n),r.d(n,{default:()=>q});var t=r(11504),a=r(18168),l=r(6084),s=r(18730),o=r(95e3),c=r(27876),i=r(57864),d=r(29e3),m=r(85328),u=r(84080),v=r(75560),p=r(28016),E=r(3008),N=r(84512),D=r(57639),g=r(59396),f=r(98772),w=r(76988),y=r(1292),O=r(71500),I=r(46788),S=r(24808),k=r(87808),U=r(41520),b=r(53728),L=r(32116),P=r(49872),R=r(56960),h=r(82468),x=r(79264),C=r(44064),M=r(35456);const V="ReleaseNotesModal-version-OtNvrC",A="ReleaseNotesModal-listTitle-SQlt8b";function T(e,n){const r=n?n.split("\n"):[];return r.length>0?t.createElement(t.Fragment,null,t.createElement("div",{className:A},e),t.createElement("ul",null,r.map(((e,n)=>t.createElement("li",{key:n},e))))):null}const z=function(e){const{version:n,added:r,fixed:a,isOpen:l,onClose:s}=e;return t.createElement(C.c,{isOpen:l,metricsPage:R.mU,onModalClose:s},t.createElement(M.c,{onModalClose:s},t.createElement(x.c,null,(0,g.c)("{product} Release Notes",{product:"Plex Media Server"})),t.createElement(h.c,null,t.createElement("div",{className:V},(0,g.c)("Version {version}",{version:n})),T((0,g.c)("New"),r),T((0,g.c)("Fixes"),a))))},B=function({progress:e}){return t.createElement("div",{className:"ServerDownloadProgressBar-progress-eaqGoq"},t.createElement("div",{className:"ServerDownloadProgressBar-emptyBar-tqRFTg"}),t.createElement("div",{className:"ServerDownloadProgressBar-bar-LSLH7G",style:{transform:`translate3d(-${100-e}%, 0, 0)`}}))};var F=r(42466);const G="ServerUpdatePage-actionContainer-d6gTRB EmptyPageDescription-description-X4KZlh",_=(0,c.Ul)((function(){return(0,i.M3)(m.c,(0,d.c)(),((e,n)=>{const r=n.update;return{serverEntityID:e.entityID,friendlyName:e.friendlyName,state:r.state,error:r.error,progress:r.progress,availableVersion:(0,u.c)(r.version),currentVersion:(0,u.c)(e.version),downloadURL:r.downloadURL,added:r.added,fixed:r.fixed}}))}),(function(e,n){const{serverEntityID:r}=n;return{onDismissServerUpdate(n){e((0,p.us)({serverEntityID:r,version:n}))},onInstallServerUpdate(){e((0,p.cN)({serverEntityID:r}))},onDownloadServerUpdate(){e((0,p.Iz)({serverEntityID:r}))},onRedirectToHome(){e((0,v.C8)({route:"home"}))}}}))((function(e){const{serverEntityID:n,friendlyName:r,state:a,error:l,progress:s,availableVersion:o,currentVersion:c,downloadURL:i,added:d,fixed:m,onDismissServerUpdate:u,onInstallServerUpdate:v,onDownloadServerUpdate:p,onRedirectToHome:R}=e,h=a===D.NONE||a===D.DONE,x=(0,F.c)(),C=(0,t.useCallback)((()=>{u(o)}),[o,u]);if((0,I.c)((()=>{R()}),h),h)return null;if(a===D.INSTALLING)return t.createElement(P.c,{serverEntityID:n});const M=(0,g.c)("Update available for {product}",{product:"Plex Media Server"});let V=(0,g.c)('You are currently running version {currentVersion} on the server "{friendlyName}". Version {availableVersion} is now available.',{availableVersion:o,currentVersion:c,friendlyName:r});const A="number"==typeof s&&s>=0&&s<=100;return a===D.NOTIFY&&(V=V+" "+(0,g.c)("This update will need to be installed manually after download.")),a===D.ERROR?t.createElement(b.c,{description:l||(0,g.c)("Something went wrong, please try again later."),iconSrc:N,title:M}):t.createElement(b.c,{description:d||m?t.createElement(f.c,{message:V+" "+(0,g.c)("{openLink}Show release notes{closeLink}."),tags:[{open:"openLink",close:"closeLink",component:O.c,onPress:x.onOpen,kind:S.ac}]}):V,iconSrc:N,title:(0,g.c)("Update available for {product}",{product:"Plex Media Server"})},a===D.AVAILABLE?t.createElement("div",{className:G},t.createElement(y.c,{kind:S.ac,size:k.OM,onPress:p},(0,g.c)("Download now"))):null,a===D.DOWNLOADING?t.createElement("div",{className:G},t.createElement("div",null,A?(0,g.c)("Downloading Update ({progress}%)",{progress:s}):(0,g.c)("Downloading Update")),t.createElement(E.YR,{align:"center",verticalAlign:"center",width:"100%"},A?t.createElement(B,{progress:s}):t.createElement(w.c,{size:"small"}))):null,a===D.DOWNLOADED?t.createElement("div",{className:G},t.createElement(y.c,{kind:S.ac,size:k.OM,onPress:v},(0,g.c)("Install now"))):null,a===D.NOTIFY?t.createElement("div",{className:G},t.createElement(y.c,{kind:S.ac,size:k.OM,target:"_blank",to:i||(0,U.c)(),onPress:C},(0,g.c)("Download now"))):null,a!==D.DOWNLOADING&&a!==D.DOWNLOADED?t.createElement(L.c,null,t.createElement(O.c,{className:"ServerUpdatePage-link-OvaQUF",kind:S.ac,size:k.wH,to:"#",onPress:C},(0,g.c)("Skip this version"))):null,t.createElement(z,{added:d,fixed:m,isOpen:x.isOpen,version:o,onClose:x.onClose}))}));function q(){const{machineIdentifier:e}=(0,s.c)(),n=(0,a.c)(l.qe,e);return t.createElement(o.c,{serverEntityID:n},t.createElement(_,{serverEntityID:n}))}}}]);