(self.webpackChunk=self.webpackChunk||[]).push([[1797],{71797:function(a,t,e){"use strict";e.r(t),e.d(t,{buildChapterCards:function(){return l}}),e(23938),e(98010);var n=e(28469),c=e(17146),r=e(78695),i=e(47518),d=e(53913),o=!i.Z.slow&&!i.Z.edge;function s(a,t,e,c,r,i,d){var o=r.width,s=r.coverImage,l=function(a,t,e,n,c){var r=a.Id,i=t.ImageTag;return i?c.getScaledImageUrl(r,{maxWidth:n,tag:i,type:"Chapter",index:e}):null}(a,e,c,o||400,t),v="cardContent cardContent-shadow cardImageContainer chapterCardImageContainer";s&&(v+=" coveredImage");var u=' data-action="play" data-isfolder="'.concat(a.IsFolder,'" data-id="').concat(a.Id,'" data-serverid="').concat(a.ServerId,'" data-type="').concat(a.Type,'" data-mediatype="').concat(a.MediaType,'" data-positionticks="').concat(e.StartPositionTicks,'"'),p=l?'<div class="'.concat(v,' lazy" data-src="').concat(l,'">'):'<div class="'.concat(v,'">');l||(p+='<span class="material-icons cardImageIcon local_movies"></span>');var h="";return h+='<div class="cardText">'.concat(e.Name,"</div>"),h+='<div class="cardText">'.concat(n.ZP.getDisplayRunningTime(e.StartPositionTicks),"</div>"),'<button type="button" class="'.concat(i,'"').concat(u,'><div class="').concat("cardBox",'"><div class="').concat("cardScalable",'"><div class="cardPadder-').concat(d,'"></div>').concat(p,'</div><div class="innerCardFooter">').concat(h,"</div></div></div></button>")}function l(a,t,e){if(e.parentContainer){if(!document.body.contains(e.parentContainer))return;if(!t.length)return void e.parentContainer.classList.add("hide");e.parentContainer.classList.remove("hide")}var n=function(a,t,e){var n="card itemAction chapterCard";r.Z.tv&&(n+=" show-focus",o&&(n+=" show-animation"));var c=(((a.MediaSources||[])[0]||{}).MediaStreams||[]).filter((function(a){return"Video"===a.Type}))[0]||{},i=e.backdropShape||"backdrop";c.Width&&c.Height&&c.Width/c.Height<=1.2&&(i=e.squareShape||"square"),n+=" ".concat(i,"Card"),(e.block||e.rows)&&(n+=" block");for(var l="",v=0,u=d.ZP.getApiClient(a.ServerId),p=0,h=t.length;p<h;p++)e.rows&&0===v&&(l+='<div class="cardColumn">'),l+=s(a,u,t[p],p,e,n,i),v++,e.rows&&v>=e.rows&&(v=0,l+="</div>");return l}(a,t,e);e.itemsContainer.innerHTML=n,c.default.lazyChildren(e.itemsContainer)}t.default={buildChapterCards:l}}}]);