"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[1797],{71797:function(a,t,e){e.r(t),e.d(t,{buildChapterCards:function(){return u}}),e(98010),e(63238),e(23938);var n=e(65009),c=e.n(n),r=e(28469),i=e(21361),d=e(78695),o=e(47518),s=e(53913),l=!o.Z.slow&&!o.Z.edge;function v(a,t,e,n,i,d,o){var s=i.width,l=i.coverImage,v=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,n,s||400,t),u="cardContent cardContent-shadow cardImageContainer chapterCardImageContainer";l&&(u+=" coveredImage");var p=' 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,'"'),h=v?'<div class="'.concat(u,' lazy" data-src="').concat(v,'">'):'<div class="'.concat(u,'">');v||(h+='<span class="material-icons cardImageIcon local_movies" aria-hidden="true"></span>');var C="";return C+='<div class="cardText">'.concat(c()(e.Name),"</div>"),C+='<div class="cardText">'.concat(r.ZP.getDisplayRunningTime(e.StartPositionTicks),"</div>"),'<button type="button" class="'.concat(d,'"').concat(p,'><div class="').concat("cardBox",'"><div class="').concat("cardScalable",'"><div class="cardPadder-').concat(o,'"></div>').concat(h,'</div><div class="innerCardFooter">').concat(C,"</div></div></div></button>")}function u(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";d.Z.tv&&(n+=" show-focus",l&&(n+=" show-animation"));var c=(((a.MediaSources||[])[0]||{}).MediaStreams||[]).filter((function(a){return"Video"===a.Type}))[0]||{},r=e.backdropShape||"backdrop";c.Width&&c.Height&&c.Width/c.Height<=1.2&&(r=e.squareShape||"square"),n+=" ".concat(r,"Card"),(e.block||e.rows)&&(n+=" block");for(var i="",o=0,u=s.Z.getApiClient(a.ServerId),p=0,h=t.length;p<h;p++)e.rows&&0===o&&(i+='<div class="cardColumn">'),i+=v(a,u,t[p],p,e,n,r),o++,e.rows&&o>=e.rows&&(o=0,i+="</div>");return i}(a,t,e);e.itemsContainer.innerHTML=n,i.default.lazyChildren(e.itemsContainer)}t.default={buildChapterCards:u}}}]);