1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3727],{6108:(t,e,i)=>{"use strict";i.d(e,{A:()=>R});var o=i(74848),s=i(46942),a=i.n(s),r=i(29965),l=i.n(r),n=i(86715),d=i.n(n),c=i(96540),h=i(40094),g=i(74368),_=i(48398),u=i(80364),p=i(47819),m=i(27116),v=i(35296),w=i(69500),C=i(96276),b=i(72202),f=i(67265),L=i(98126),M=i(98047),x=i(91106),k=i.n(x),I=i(60963),y=i(97461),N=i(31981),j=i(96927),D=i(18011),S=i.n(D),T=i(5843);let A={clickHouseShoot:L.Y3,initPlayer:L.kI,getPlayerData:C.o2,changeCardsCount:w.PO,setNewCatalogConfig:w.Yr,setCatalogConfig:w.uM},E={DESKTOP:"desktop_web",TABLET:"tablet_web",MOBILE:"mobile_web"},P={[E.DESKTOP]:{width:253,height:142},[E.TABLET]:{width:163,height:248},[E.MOBILE]:{width:154,height:234}},O=t=>{var e,i;let{item:s,noJs:r,isLoading:n,isCatalog:d,isMobile:h,hasWatched:m,onLoad:w,isFavoritesPage:C,onRemoveFromFavorites:L,estBadge:x,estBadgePurchased:k,estAvailable:y}=t,N=(0,g.wA)(),{windowInnerWidth:D,renderMobile:A}=(0,g.d4)(t=>t.systemInformation),O=(0,g.d4)(t=>t.systemInformation.config),V=(0,g.d4)(t=>t.profile.favoritesIds),z=(0,g.d4)(t=>t.systemInformation.locale||"ru"),R=(0,g.d4)(t=>t.registration.authData),H=(0,g.d4)(t=>{var e;return null===(e=t.profile.currentProfile)||void 0===e?void 0:e._id}),B=V.includes(s.id||s.uid),[F,Y]=(0,c.useState)(!1),G=(null==O?void 0:null===(e=O.dobromer_rating)||void 0===e?void 0:e.is_active)===!0;Array.isArray(null==O?void 0:null===(i=O.dobromer_rating)||void 0===i?void 0:i.items)&&O.dobromer_rating.items;let U=(0,u.A)(),W=(0,_.A)(),K=D?D>1024?"desktop_web":D<768?"mobile_web":"tablet_web":A?"mobile_web":"desktop_web",Z=K?P[K].width:P[E.DESKTOP].width,J=K?P[K].height:P[E.DESKTOP].height,Q=2*Z,X=2*J,q=(0,c.useRef)(null),$=(0,c.useRef)(!1),tt=async()=>{let t="".concat(U).concat(p.PI.favorites).concat(H).concat(W,"&locale=").concat(z,"&content_lang=").concat(z,"&device_type=web"),e=await fetch(t,{credentials:"include"}),i=await e.json();e.ok&&i&&N((0,b.gH)(i))},te=async t=>{let e="".concat(U).concat(p.PI.favorites).concat(H).concat(W,"&locale=").concat(z,"&content_lang=").concat(z,"&device_type=web");(await fetch(e,{credentials:"include",method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({product_id:t})})).ok&&("function"==typeof L?L():await tt())},ti=async t=>{if(t.preventDefault(),t.stopPropagation(),!R||R.virtual)return;let e=s.id||s.uid;if(C&&$.current){clearTimeout(q.current),$.current=!1,q.current=null,Y(!1),N((0,f.nD)({text:"<span>Ðобавили в \xabÐоÑ\xbb</span>",closeIn:1e3,withProgressBar:!0,variant:"addedToFavorites"}));return}if(C&&B){$.current=!0,Y(!0),N((0,f.nD)({text:"<span>УбÑали из Ñаздела \xabÐоÑ\xbb</span>",closeIn:1e3,withProgressBar:!0,variant:"addedToFavorites"})),q.current=setTimeout(async()=>{await te(e),$.current=!1,q.current=null,Y(!1)},2e3);return}let i="".concat(U).concat(p.PI.favorites).concat(H).concat(W);(await fetch(i,{credentials:"include",method:B?"DELETE":"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({product_id:e})})).ok&&(N((0,f.nD)({text:B?"<span>УбÑали из Ñаздела \xabÐоÑ\xbb</span>":"<span>Ðобавили в \xabÐоÑ\xbb</span>",closeIn:1e3,withProgressBar:!0,variant:"addedToFavorites"})),await tt())},to=(t,e)=>{t.preventDefault(),t.stopPropagation(),N((0,M.sZ)({visibility:!0,clientX:t.target.closest("[data-favorites-card]").getBoundingClientRect(),clientXMore:t.target.closest("[data-favorites-card-more]").getBoundingClientRect(),_cls:e._cls||e.__cls,product_id:e.product_id,profile_id:null==R?void 0:R.profile_id,alias:e.alias,uid:s.id||s.uid,id:e._id||e.id,title:e.season_title||e.title,number:e.number}))};return(0,o.jsxs)("div",{"data-favorites-card":!0,className:a()(S()["videoCatalog-item-image"]),children:[n&&(0,o.jsx)(j.A,{className:S()["videoCatalog-item-image-skeleton"],style:{position:"absolute"}}),(0,o.jsx)(l(),{ref:t=>{(0,v.$R)(t,!n,()=>w())},id:s._id||s.id||s.uid,loader:v.R2,src:(()=>{var t,e,i;if(r)return"".concat(U).concat(null!==(e=s.horizontal.image_15x)&&void 0!==e?e:s.horizontal);let o="",a="";if(d&&K!==E.TABLET&&(K===E.DESKTOP||!h)){if(s.horizontal&&s.horizontal.image_15x){let t=window.innerWidth/1440;o="".concat(t>1?Math.floor(Q*t):Q,"x").concat(t>1?Math.floor(X*t):X),a=U+s.horizontal.image_15x}(null==s?void 0:null===(i=s.horizontal)||void 0===i?void 0:i.image_15x)||(a="/static/images/V2/preview-no-poster-horizontal.webp")}else if(s.vertical&&(s.vertical.image_15x||s.vertical)){switch(K){case E.TABLET:case E.MOBILE:o="".concat(Q,"x").concat(X);break;default:o=C?"630x946":"223x320"}a=U+(s.vertical.image_15x||s.vertical)}else a=(null==s?void 0:null===(t=s.logotype)||void 0===t?void 0:t.image_15x)?U+s.logotype.image_15x:"/static/images/V2/preview-no-poster-vertical.webp";return(0,v.bZ)(a,o)})(s,r),width:Z,height:J,alt:"".concat(s.title," ÑмоÑÑеÑÑ ").concat("Product.Movie"===s._cls?"ÑилÑм":"ÑеÑиал"),...C?{placeholder:"blur",blurDataURL:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNjAwIiBoZWlnaHQ9IjkwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczpzdmc9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KIDxnIGNsYXNzPSJsYXllciI+CiAgPHRpdGxlPkxheWVyIDE8L3RpdGxlPgogIDxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIgaWQ9InN2Z18xIj4KICAgPHBhdGggZD0ibTAsMGw2MDEsMGwwLDkwMGwtNjAxLDBsMCwtOTAweiIgZmlsbD0iIzI4MkMzMyIgaWQ9InN2Z18yIi8+CiAgIDxwYXRoIGQ9Im0xNzUuNzIsMzEwbDI0OC41NiwwYzIzLjA0LDAgNDEuNzIsMTguNzYg
1NDEuNzIsNDEuOTFsMCwxOTYuMThjMCwyMy4xNSAtMTguNjgsNDEuOTEgLTQxLjcyLDQxLjkxbC0yNDguNTYsMGMtMjMuMDQsMCAtNDEuNzIsLTE4Ljc2IC00MS43MiwtNDEuOTFsMCwtMTk2LjE4YzAsLTIzLjE1IDE4LjY4LC00MS45MSA0MS43MiwtNDEuOTF6bTAsMTIuNDhhMjkuMzYsMjkuMzYgMCAwIDAgLTI5LjMsMjkuNDNsMCwxOTYuMTlhMjkuMzYsMjkuMzYgMCAwIDAgMjkuMywyOS40M2wyNDguNTYsMGEyOS4zNiwyOS4zNiAwIDAgMCAyOS4zLC0yOS40M2wwLC0xOTYuMmEyOS4zNiwyOS4zNiAwIDAgMCAtMjkuMywtMjkuNDNsLTI0OC41NiwwbDAsMC4wMXptNDAuODQsOTkuODhjLTE2LjE4LDAgLTI5LjMsLTEzLjE4IC0yOS4zLC0yOS40M3MxMy4xMiwtMjkuNDMgMjkuMywtMjkuNDNzMjkuMjksMTMuMTggMjkuMjksMjkuNDNzLTEzLjEyLDI5LjQzIC0yOS4zLDI5LjQzbDAuMDEsMHptMCwtMTIuNDlhMTYuOSwxNi45IDAgMCAwIDE2Ljg2LC0xNi45NGExNi45LDE2LjkgMCAwIDAgLTE2Ljg2LC0xNi45NGExNi45LDE2LjkgMCAwIDAgLTE2Ljg3LDE2Ljk0YTE2LjksMTYuOSAwIDAgMCAxNi44NywxNi45NHptLTM2LjksMTA0LjI3YTYuMiw2LjIgMCAwIDEgLTguNzgsMGE2LjI2LDYuMjYgMCAwIDEgMCwtOC44M2w0OC42NywtNDguOWEyMy45LDIzLjkgMCAwIDEgMzMuOSwwbDI3Ljc0LDI3Ljg3YTYuMjYsNi4yNiAwIDAgMSAwLDguODNhNi4yLDYuMiAwIDAgMSAtOC43OSwwbC0yNy43NCwtMjcuODdhMTEuNSwxMS41IDAgMCAwIC0xNi4zMiwwbC00OC42OCw0OC45em05Mi43OCwyMC45NGE2LjIsNi4yIDAgMCAxIC04LjgsMGE2LjI2LDYuMjYgMCAwIDEgMCwtOC44MmwxMTAuMzcsLTExMC44N2EyMy45LDIzLjkgMCAwIDEgMzMuOSwwbDI3Ljc0LDI3Ljg3YTYuMjYsNi4yNiAwIDAgMSAwLDguODNhNi4yLDYuMiAwIDAgMSAtOC43OSwwbC0yNy43NCwtMjcuODdhMTEuNSwxMS41IDAgMCAwIC0xNi4zMiwwbC0xMTAuMzYsMTEwLjg2eiIgZmlsbD0iIzQ3NEY1RCIgZmlsbC1ydWxlPSJub256ZXJvIiBpZD0ic3ZnXzMiIG9wYWNpdHk9IjAuNSIgc3Ryb2tlPSIjMjgyQzMzIiBzdHJva2Utd2lkdGg9IjIiLz4KICA8L2c+CiA8L2c+Cjwvc3ZnPg=="}:{}}),!n&&m?(0,o.jsxs)("div",{className:S().watched,children:[(0,o.jsxs)("div",{className:S()["watched-line"],children:[(0,o.jsx)("div",{className:S()["red-line"]}),(0,o.jsx)("div",{className:S()["white-line"]})]}),(0,o.jsx)("div",{className:S()["watched-title"],children:"ÐÑоÑмоÑÑено"})]}):null,n||null==s||!s.rating_start||(null==s?void 0:s.is_preview)?null:G&&(null==s?void 0:s.for_kids)?(0,o.jsx)("div",{className:a()(S()["videoCatalog-item-image-kind_rating"]),children:(0,o.jsx)(T.A,{rating:s.rating_start,adaptiveActite:C})}):(0,o.jsx)("div",{className:a()({[S()["videoCatalog-item-image-rating-high"]]:s.rating_start>=7,[S()["videoCatalog-item-image-rating"]]:!0,[S()["videoCatalog-item-image-rating-fire"]]:C}),children:(0,v.bH)(s.rating_start)}),C&&K===E.DESKTOP?(0,o.jsx)("div",{className:a()(S().more,S().favorite),onClick:t=>{ti(t)},children:(0,o.jsx)("img",{className:S().icon,src:"/static/images/startPlayer/bookmark-".concat(B&&!F?"off_":"on",".svg"),alt:"favorites",width:24,height:24})}):null,C&&K===E.DESKTOP?(0,o.jsx)("div",{"data-favorites-card-more":!0,className:a()(S().more,S().bookmark),onClick:t=>{to(t,s)}}):null,y&&x&&!k?(0,o.jsx)(I.Ex,{className:S().estBadge,size:x.size,text:x.text,textColor:x.text_color,bgColor:x.background_color}):null]})},V=t=>{var e,i;let{item:s,index:r,noJs:l,isCatalog:n,isFavorites:d,isMobile:h,videoItemRefs:_,onCardClick:u,isFavoritesPage:p,onRemoveFromFavorites:m}=t,{init:w}=(0,g.d4)(t=>t.systemInformation.player),{childProfile:C,profileHistory:b}=(0,g.d4)(t=>t.profile),f=(0,g.d4)(t=>t.registration.subscriptionType),L=(0,g.d4)(t=>t.est.access),M=(0,g.d4)(t=>t.registration.authData),[x,y]=(0,c.useState)(!0),N=!d&&x&&n,D=s.badges.filter(t=>"badge"===t.type&&"single"===t.structure&&!t.under_logo_position),T=s.badges.filter(t=>"badge"===t.type&&"double"===t.structure&&!t.under_logo_position),A=!(null==M?void 0:M.profile_for_child)&&(null==M?void 0:M.current_country_code)==="RU"&&(null===(e=s.badges)||void 0===e?void 0:e.find(t=>"est"===t.type)),E=!!(null==L?void 0:null===(i=L.items)||void 0===i?void 0:i.find(t=>t.content_id===s.id||t.product_id===s.id)),P=(0,v.RE)(s,L).getCheckEstAvailable(),V=(null==b?void 0:b.length)?b.filter(t=>t.progress>=95):[],z=V.some(t=>t.content_uid===s.uid),R=(0,v.xM)(s.subscriptions,f),H=()=>{u(r,s)},B=s.genres?s.genres.slice(0,p?2:s.genres.length):[];return(0,o.jsx)(k(),{ref:t=>_[s.uid||s._id||s.id]=t,className:S().video_unit_content_cell,title:"".concat(s.title," ÑмоÑÑеÑÑ Ð¾Ð½Ð»Ð°Ð¹Ð½"),onClick:H,prefetch:!1,href:w?"/":"/watch/".concat(s.alias),children:(0,o.jsxs)("div",{id:0===r?"first-item":r,className:S()["videoCatalog-item"],children:[(0,o.jsx)(O,{item:s,hasWatched:z,noJs:l,isLoading:N,isMobile:h,isCatalog:n,profileHistoryArray:V,onLoad:()=>{y(!1)},isFavoritesPage:p,onRemoveFromFavorites:m,estBadge:A,estBadgePurchased:E,estAvailable:P}),(0,o.jsx)("noscript",{children:(0,o.jsx)("div",{className:S()["videoCatalog-title"],children:(0,o.jsx)("span",{className:S()["videoCatalog-title-alias"],children:s.title})})}),(0,o.jsx)("div",{className:a()(S()["videoCatalog-title"],"no-js-hide"),onClick:H,children:N?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(j.A,{className:S()["videoCatalog-title-skeleton-first"]}),(0,o.jsx)(j.A,{className:S()["videoCatalog-title-skeleton-second"]})]}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{className:S()["videoCatalog-title-alias"],children:s.title}),!R&&(0,o.jsx)(I.JI,{className:S()["videoCatalog-premium-badge"]}),R&&(0,o.jsx)(o.Fragment,{children:T.length&&!p?(0,o.jsx)(I.L$,{className:S()["videoCatalog-double-badge"],size:T[0].size,text:T[0].text,textColor:T[0].text_color,bgColor:T[0].background_color,textRight:T[0].text_right,textColorRight:T[0].text_color_right,bgColorRight:T[0].background_color_right}):D.length&&!p?(0,o.jsx)(I.Ex,{className:S()["videoCatalog-single-badge"],size:D[0].size,text:D[0].text,textColor:D[0].text_color,bgColor:D[0].background_color}):!C&&(0,o.jsx)("div",{className:S()["videoCatalog-title-genres"],children:B.map(t=>t.title).join(", ")})})]})})]})})};class z extends c.Component{componentWillUnmount(){clearTimeout(this.scrollTimeout),clearTimeout(this.favoritesScrollDebounce),clearTimeout(this.favoritesDebounceTimeout),d().events.off("beforeHistoryChange",this.setCatalogConfig),window.removeEventListener("scroll",this.handleScroll);let t=this.containerRef.current;t&&(t.removeEventListener("scroll",this.handleScroll),t.removeEventListener("scroll",this.updateCanScrollPrev))}clickHouseShootHandler(){var t;let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"click",i=arguments.length>1?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4?arguments[4]:void 0,r=arguments.length>5?arguments[5]:void 0,{clickHouseData:l}=this.props.systemInformation,{isFavoritesSlider:n,blockIndex:d}=this.props,c={...l,action_id:"click",element_type:r,element_attributes_id:i,element_attributes_index:a+1,element_attributes_text:o,content_id:this.props.isHashTags?s.uid:s.id,product_id:this.props.isHashTags?s.id:"",content_type:s.cls,event_time:Date.now()}
1,h={screen_type:"hashtags",action_id:"click",screen_attributes_id:this.props.lineAlias,block_type:"collection",block_attributes_id:"hashtag_".concat(this.props.lineAlias),block_attributes_index:1,element_type:r,element_attributes_id:i,element_attributes_index:a+1,action_attributes_str:this.props.currentHashTagId,action_attributes_num:1,action_result:a+1,content_id:s.id,content_type:(null===(t=s.url)||void 0===t?void 0:t.includes("series"))?"Product.Series":"Product.Movie",product_id:s.id};this.props.isHashTags&&(c={...c,screen_attributes_id:this.props.lineAlias,block_type:"collection",content_id:s.id,block_attributes_id:this.props.lineAlias?"hashtag_"+this.props.lineAlias:"",..."click"===e&&{...h},event_time:Date.now()}),this.props.isFavoritesPage&&(c={...c,..."click"===e&&{...h},screen_type:"favorites",screen_attributes_id:"favorites",block_type:"collection",content_id:s.id||s.uid,product_id:s.id||s.uid,block_attributes_id:n?"recommend":"favorites",block_attributes_index:d,action_attributes_num:null,action_result:null,event_time:Date.now()}),this.props.clickHouseShoot(this.apiUrl,this.apiKey,c)}render(){let{data:t,hasLink:e,catalogName:i,numberOfItems:s,endPage:r,isCatalog:l,noJs:n,isMobile:d,isParentFetching:g,isFavorites:_,isFavoritesPage:u,isFavoritesSlider:p,isFavoritesWatchList:m,type:v}=this.props,{deviceData:w,windowInnerWidth:C}=this.props.systemInformation,{currentLine:b,cardsInLine:f,updatedData:L,canScrollPrev:M,canScrollNext:x}=this.state,I=s<=f*b,j=L.length?L:t,D=j;if(u&&!p&&!m&&"desktop_web"===w){let t=this.state.favoritesVisibleCount;D=j.slice(0,t)}let T=D.map((t,e)=>(0,o.jsx)(V,{item:t,index:e,noJs:n,isMobile:d,isCatalog:l,isFavorites:_,videoItemRefs:this.videoItemRefs,onCardClick:this.cardClickHandler,isFavoritesPage:u,onRemoveFromFavorites:this.props.onRemoveFromFavorites},"".concat(_?"favorites_":"").concat(l?"catalog_":"").concat(d?"mobile_":"").concat(t._id||t.id||t.uid))),A=this.handleLeftGap(C),E=this.handleRightGap(C),P=C>1024,O=p?{paddingRight:"".concat(E,"px"),paddingLeft:"".concat(A,"px"),height:"100%"}:null;return(0,o.jsxs)(c.Fragment,{children:[i?e?(0,o.jsx)(k(),{onClick:()=>this.handleShoot("link","collections","".concat(this.props.catalogName)),prefetch:!1,href:"".concat(e),children:(0,o.jsx)("h2",{className:"".concat(S().videoCatalog__linked),children:(0,o.jsx)("span",{children:i})})}):(0,o.jsx)("h2",{children:i}):null,(0,o.jsxs)("div",{className:a()(S()["videoCatalog-wrapper"],{[S().webapp]:"movies"===v||"animation"===v||"series"===v||"new"===v||"cartoons"===v,[S().favoritePageGrid]:u&&!p&&!m,[S().favoritePage]:u&&p,[S().favoritePageWatchList]:u&&m}),children:[u&&p&&P&&M&&(0,o.jsx)("div",{className:"".concat(S().slider__arrow," ").concat(S().slider__arrow__prev),onClick:this.setPrevArrow}),(0,o.jsx)("div",{ref:this.containerRef,style:O,className:a()(S()["videoCatalog-item-wrapper"],{[S()["videoCatalog-item-wrapper-catalog"]]:l&&("desktop_web"===w||!d)}),children:(0,o.jsxs)(o.Fragment,{children:[p&&(0,o.jsxs)("div",{className:S().videoCatalog__text,children:[(0,o.jsx)("p",{className:S().videoCatalog__title,children:"ÐоÑ
ожие на\xa0моÑ"}),(0,o.jsx)("p",{className:S().videoCatalog__description,children:"ÐодобÑали ÑекомендаÑии ÑилÑмов и ÑеÑиалов, оÑнованнÑе на ваÑиÑ
пÑоÑмоÑÑаÑ
, оÑенкаÑ
и\xa0ÑоÑ
ÑанениÑÑ
в \xabÐÑÐ´Ñ ÑмоÑÑеÑÑ\xbb"})]}),u&&!m?(0,o.jsx)("div",{className:S().videoCatalog__slider,children:T}):T,!u&&(0,o.jsx)(h.pL,{rootMargin:"0px 0px 35% 0px",skip:!l||g,onChange:this.handleEndOfList,children:t=>{let{ref:e}=t;return(0,o.jsx)("div",{ref:e})}},null==j?void 0:j.length)]})}),u&&p&&P&&x&&(0,o.jsx)("div",{className:"".concat(S().slider__arrow," ").concat(S().slider__arrow__next),onClick:this.setNextArrow}),l&&_&&s>f?(0,o.jsx)(N.A,{testId:I?"show_less_button":"show_more_button",onNextClick:this.showMore,onHideClick:this.showMore,isEnd:I,hideText:"СвеÑнÑÑÑ",showText:"ÐоказаÑÑ ÐµÑÑ"}):null,(s>f&&!this.showMoreClicked||s>=f&&this.showMoreClicked)&&!r&&!l?(0,o.jsx)(N.A,{testId:I?"show_less_button":"show_more_button",onNextClick:this.showMore,onHideClick:this.showMore,isEnd:I,hideText:"СвеÑнÑÑÑ",showText:"ÐоказаÑÑ ÐµÑÑ"}):null]}),u&&!p&&!m&&j&&"desktop_web"===w&&j.length>6&&(0,o.jsx)(y.$n,{className:S()["videoCatalog-button"],variant:y.Vt.MONO,size:y.GO.SMALL,title:this.state.favoritesVisibleCount>=j.length?"СвеÑнÑÑÑ":"ÐоказаÑÑ ÐµÑе",onClick:this.toggleFavoritesExpanded})]})}constructor(...t){super(...t),this.state={cardsInLine:20,currentLine:1,updatedData:[],visibleElement:!1,favoritesVisibleCount:6,canScrollPrev:!1,canScrollNext:!1},this.apiUrl=this.props.systemInformation.API_URL||m.H$,this.apiKey=this.props.systemInformation.API_KEY||m.Lq,this.firstLoad=!1,this.showMoreClicked=!1,this.videoItemRefs={},this.scrollTimeout=null,this.alreadyVisibleItemIds=new Set,this.isFetchingMore=!1,this.containerRef
1=c.createRef(),this.lastSentVisibleIds=[],this.favoritesScrollDebounce=null,this.favoritesDebounceTimeout=null,this.handleLeftGap=t=>{let{isFavoritesSlider:e}=this.props;if(!t&&!e)return;let i=t>1024,o=t>1440,s=t<=1024&&t>767;return e?i?o?(0,v.$J)(548,t):548:s?415:0:0},this.handleRightGap=t=>{let{isFavoritesSlider:e}=this.props;if(!t&&!e)return;let i=t>1024,o=t>1440,s=t<=1024&&t>767;return e?i?o?(0,v.$J)(40,t):40:s?24:40:40},this.getOneCardMovement=()=>{let t=this.containerRef.current;if(!t)return 250;let e=t.querySelector(".".concat(S().video_unit_content_cell))||t.querySelector(".".concat(S()["videoCatalog-item"]));if(!e)return 250;let i=e.getBoundingClientRect(),o=parseFloat(window.getComputedStyle(e).marginRight||0);return Math.round(i.width+(isNaN(o)?0:o))},this.getCountCards=()=>{let t=this.getOneCardMovement(),e=this.handleLeftGap(window.innerWidth)||0;return Math.max(1,Math.floor((window.innerWidth-e)/t))},this.setNextArrow=()=>{let t=this.containerRef.current;if(!t)return;let e=this.getOneCardMovement(),i=this.getCountCards(),o=t.scrollLeft||0,s=Math.min(t.scrollWidth-t.clientWidth,o+e*i);t.scroll({left:s,behavior:"smooth"}),setTimeout(this.updateScrollArrows,100)},this.setPrevArrow=()=>{let t=this.containerRef.current;if(!t)return;let e=this.getOneCardMovement(),i=this.getCountCards(),o=Math.max(0,(t.scrollLeft||0)-e*i);t.scroll({left:o,behavior:"smooth"}),setTimeout(this.updateScrollArrows,100)},this.updateScrollArrows=()=>{let t=this.containerRef.current;if(!t)return;let e=Math.round(t.scrollLeft),i=t.scrollWidth-t.clientWidth,o=e>0,s=e<i-1;(this.state.canScrollPrev!==o||this.state.canScrollNext!==s)&&this.setState({canScrollPrev:o,canScrollNext:s})},this.handleShoot=(t,e,i)=>{let{clickHouseData:o}=this.props.systemInformation,s={...o,action_id:"click",block_type:"collection",block_attributes_id:"collections",element_type:t,element_attributes_id:e,element_attributes_text:i,event_time:new Date().getTime()};this.props.clickHouseShoot(this.apiUrl,this.apiKey,s)},this.toggleFavoritesExpanded=()=>{let{data:t}=this.props,{updatedData:e,favoritesVisibleCount:i}=this.state,o=e.length?e:t,s=i>=o.length,a=s?6:Math.min(i+6,o.length);this.setState({favoritesVisibleCount:a},()=>{if(!s||!this.containerRef.current)return;let t=document.getElementById("main_header"),e=(null==t?void 0:t.offsetHeight)||0,i=this.containerRef.current.getBoundingClientRect().top+window.pageYOffset-2*e;window.scrollTo({top:i,behavior:"smooth"})})},this.componentDidMount=()=>{this.handleScroll(),window.addEventListener("scroll",this.handleScroll);let{data:t}=this.props,e=20,i=window.innerWidth;i<768&&(e=8),i>767&&i<1025&&(e=16),i>1024&&i<1280&&(e=this.props.isHashTags?30:20),i>1279&&(e=this.props.isCatalog?this.props.isHashTags?30:20:24),this.props.isFavoritesPage&&(e=t.length);let o=this.props.isFavoritesPage?this.props.data:this.props.data.slice(0,e);this.setState({currentLine:1,cardsInLine:e,updatedData:o}),this.props.changeCardsCount(e),d().events.on("beforeHistoryChange",this.setCatalogConfig);let s=this.containerRef.current;s&&(s.addEventListener("scroll",this.handleScroll,{passive:!0}),s.addEventListener("scroll",this.updateScrollArrows,{passive:!0}),this.updateScrollArrows())},this.setCatalogConfig=t=>{let e=new RegExp("/".concat(this.props.type));switch(!0){case"new"===this.props.type&&"/new"!==t:this.props.setNewCatalogConfig({data:this.state.updatedData.length?this.state.updatedData:this.props.data,currentLine:this.state.currentLine,scrollPosition:window.scrollY,items_total:this.props.numberOfItems});break;case this.props.type&&"new"!==this.props.type&&!e.test(t)&&d().pathname.includes("/category"):this.props.setCatalogConfig({data:this.state.updatedData.length?this.state.updatedData:this.props.data,currentLine:this.state.currentLine,scrollPosition:window.scrollY,sortFlag:this.props.catalog.sortFlag,path:d().asPath,type:this.props.type,items_total:this.props.numberOfItems,filters:this.props.filtersForConfig})}},this.componentDidUpdate=(t,e)=>{let{genre:i,year:o,data:s}=t,{genre:a,year:r,getContentUrl:l,data:n,selfSortFlag:d,type:c,isFavoritesPage:h}=this.props,{sortFlag:g,newCatalogConfig:_,isNewCatalogPopStated:u,catalogConfig:p,isCatalogPopStated:v}=this.props.catalog,{sortFlag:w}=t.catalog,{cardsInLine:C}=e,{cardsInLine:b,updatedData:f,visibleElement:L}=this.state,{windowInnerWidth:M}=t.systemInformation,{windowInnerWidth:x}=this.props.systemInformation;if(x&&M&&x!==M&&this.resizeHandler(),i!==a||o!==r||w!==g||s!==n){let t=this.props.isFavoritesPage?n:n.slice(0,b),e=this.props.isFavoritesPage?Math.min(6,(null==n?void 0:n.length)||6):6;this.setState({updatedData:t,currentLine:1,...this.props.isFavoritesPage&&{favoritesVisibleCount:e}}),this.handleScroll()}if(!this.firstLoad&&!l)switch(this.firstLoad=!0,!0){case this.props.shouldUsingNewConfig:this.setState({updatedData:this.props.data,currentLine:_.currentLine}),this.forceScroll=!0;break;case this.props.shouldUsingConfig:this.setState({updatedData:this.props.data,currentLine:p.currentLine}),this.forceScroll=!0;break;default:this.setState({updatedData:n.slice(0,b)})}if(l&&!this.firstLoad)switch(this.firstLoad=!0,!0){case this.props.shouldUsingNewConfig:this.setState({updatedData:this.props.data,currentLine:_.currentLine}),this.forceScroll=!0;break;case this.props.shouldUsingConfig:this.setState({updatedData:this.props.data,currentLine:p.currentLine}),this.forceScroll=!0;break;default:if(b!==C&&24!==C&&b>20&&n&&n.length<24){let t="".concat(l,"&skip=20&limit=4");-1===t.indexOf("&sort=")&&(t="".concat(t,"&sort=").concat(d||"-popularity")),fetch(t).then(async t=>t.status<400?(await t.json()).items:[]).catch(t=>console.error(t)).then(t=>{let e=f.length?f.concat(t):n.slice(0,b).concat(t);"start_release_date"===g&&e.sort(m.bH),this.setState({updatedData:(0,m.uC)(e)})})}}if(this.forceScroll&&(this.forceScroll=!1,this.props.shouldUsingNewConfig?setTimeout(()=>window.scrollTo({top:_.scrollPosition}),0):this.props.shouldUsingConfig&&setTimeout(()=>window.scrollTo({top:p.scrollPosition}),0)),L&&e.visibleElement!==L&&setTimeout(()=>
1{(0,m.RZ)("catalog_scroll")},5e3),s!==n&&h){let t=Math.min(6,(null==n?void 0:n.length)||6);this.setState({updatedData:n,currentLine:1,favoritesVisibleCount:t})}},this.resizeHandler=()=>{let t=window.innerWidth,e=20;t<768&&(e=8),t>767&&t<1025&&(e=16),t>1024&&t<1280&&(e=20),t>1279&&(e=this.props.isCatalog?this.props.getContentUrl?20:30:24),this.setState({cardsInLine:e}),this.props.changeCardsCount(e)},this.cardClickHandler=(t,e)=>{let{player:i}=this.props.systemInformation,{pip:o}=this.props.player;i&&i.init&&!o||this.clickHouseShootHandler("click",e.alias,"",e,t,"product")},this.showMore=()=>{let{numberOfItems:t,getContentUrl:e,data:i,sortHandler:o,selfSortFlag:s}=this.props,{sortFlag:a}=this.props.catalog,{currentLine:r,cardsInLine:l,updatedData:n}=this.state;if(this.showMoreClicked=!0,this.props.isHashTags){let{clickHouseData:e}=this.props.systemInformation,i={...e,action_id:"click",block_type:"collections",block_attributes_id:this.props.lineAlias?"hashtag_"+this.props.lineAlias:"",element_type:"button",element_attributes_id:t>r*l?"show_more":"show_less",event_time:new Date().getTime(),screen_attributes_id:this.props.lineAlias||"",element_attributes_text:t>r*l?"ÐоказаÑÑ ÐµÑÑ":"СвеÑнÑÑÑ"};this.props.clickHouseShoot(this.apiUrl,this.apiKey,i)}if(!e&&t>r*l)this.setState({updatedData:this.props.data.slice(0,(r+1)*l),currentLine:r+1}),this.isFetchingMore=!1;else if(t>r*l&&e){let d=new URL(e);d.searchParams.set("limit",t-r*l>l?l:t-r*l),d.searchParams.set("skip",(null==n?void 0:n.length)>l?n.length:l),d.searchParams.set("sort",s||"-".concat(a)),this.setState({currentLine:r+1},()=>{fetch(d).then(async t=>t.ok?(await t.json()).items:(this.setState({currentLine:r-1}),[])).catch(t=>console.error(t)).then(t=>{let e=n.length?n.concat(t):i.slice(0,l).concat(t);o&&e.sort(o),this.setState({updatedData:(0,m.uC)(e)},()=>{this.isFetchingMore=!1})}).then(()=>{this.props.isHashTags||(this.handleShoot("button","show_more","ÐоказаÑÑ ÐµÑÑ"),this.clickHouseShootHandler("show_more","show_more","ÐоказаÑÑ ÐµÑÑ"))})})}else this.setState({currentLine:1,updatedData:e?(0,m.uC)(n.slice(0,l)):i.slice(0,l)},()=>{let t=document.getElementById("first-item");t&&t.scrollIntoView({block:"center",behavior:"smooth"})}),this.props.isHashTags||(this.handleShoot("button","show_more","СвеÑнÑÑÑ"),this.clickHouseShootHandler("show_more","show_more","СвеÑнÑÑÑ")),this.isFetchingMore=!1},this.handleScroll=()=>{let{isFavoritesPage:t}=this.props;if(t){clearTimeout(this.favoritesDebounceTimeout),this.favoritesDebounceTimeout=setTimeout(()=>{this.sendFavoritesCollectionViewEvent()},2e3);return}clearTimeout(this.scrollTimeout),this.checkVisibilityElement(),this.scrollTimeout=setTimeout(()=>{let t=[],e=[],{clickHouseData:i}=this.props.systemInformation,{type:o,lineAlias:s,data:a,purchases:r,selectedChip:l}=this.props,n=this.state.updatedData.length?this.state.updatedData:a,c=document.getElementById("main_header"),h=(null==c?void 0:c.getBoundingClientRect().height)||0,g=window.innerHeight,_=(null==l?void 0:l.length)?l.map(t=>"Movie"===t?"store_purchases_movies":"store_purchases_series").join(","):r?"store_purchases":o||"hashtag_".concat(s),u=d().asPath.split("/").slice(2),p=_;if((null==u?void 0:u.length)>0){let t=u.join("/");p+="/".concat(t)}for(let[i,o]of n.entries()){let s=o._id||o.id,a=this.videoItemRefs[s];if(!a)continue;let r=(Math.min(a.getBoundingClientRect().bottom,g)-Math.max(a.getBoundingClientRect().top,h))/a.getBoundingClientRect().height;r>.9&&(this.alreadyVisibleItemIds.has(s)||(t.push(s),e.push(i+1)),this.alreadyVisibleItemIds.add(s)),r<.1&&this.alreadyVisibleItemIds.delete(s)}if(0!==t.length){let o={...i,action_id:"collection_view",action_result:e,action_attributes_num:1,action_attributes_str:t,action_parameter:this.props.currentHashTagId,screen_type:this.props.isCatalog?"category":"hashtags",screen_attributes_id:this.props.lineAlias||p,block_type:"collection",block_attributes_id:_,block_attributes_index:1,event_time:new Date().getTime()};this.props.clickHouseShoot(this.apiUrl,this.apiKey,o)}},2e3)},this.sendFavoritesCollectionViewEvent=()=>{var t;let e=this.containerRef.current;if(!e||!(null===(t=this.props.data)||void 0===t?void 0:t.length))return;let i=this.state.updatedData.length?this.state.updatedData:this.props.data,{clickHouseData:o}=this.props.systemInformation,{isFavoritesSlider:s,blockIndex:a,purchases:r,selectedChip:l}=this.props,n=e.getBoundingClientRect(),d=document.getElementById("main_header"),c=(null==d?void 0:d.getBoundingClientRect().height)||0,h=window.innerHeight,g=[],_=[];for(let[t,e]of i.entries()){let i=e.uid||e.id||e._id,o=this.videoItemRefs[i];if(!o)continue;let s=o.getBoundingClientRect(),a=s.left>=n.left&&s.right<=n.right,r=s.top>=c&&s.bottom<=h;a&&r&&s.height>0&&(g.push(i),_.push(t+1))}if(0===g.length)return;let u=this.lastSentVisibleIds;if(!(g.length!==u.length||g.some((t,e)=>t!==u[e])))return;this.lastSentVisibleIds=[...g];let p=(null==l?void 0:l.length)?l.map(t=>"Movie"===t?"store_purchases_movies":"store_purchases_series").join(","):r?"store_purchases":s?"recommend":"favorites",m={...o,action_id:"collection_view",action_result:_,action_attributes_num:a,action_attributes_str:g,screen_type:"favorites",screen_attributes_id:"favorites",block_type:"collection",block_attributes_id:p,block_attributes_index:a,event_time:Date.now()};this.props.clickHouseShoot(this.apiUrl,this.apiKey,m)},this.checkVisibilityElement=()=>{var t;let e=null===(t=this.containerRef.current)||void 0===t?void 0:t.children[5];e&&e.getBoundingClientRect().bottom<104&&this.setState({visibleElement:!0})},this.handleEndOfList=t=>{let{currentLine:e,cardsInLine:i,updatedData:o}=this.state,{numberOfItems:s,data:a,getContentUrl:r,sortHandler:l,selfSortFlag:n}=this.props,{sortFlag:d}=this.props.catalog;if(t&&o.length<s&&r){let t=s-e*i>i?i:s-e*i,c=(null==o?void 0:o.length)>i?o.length:i,h=new URL(r);h.searchParams.set("limit",t),h.searchParams.set("skip",c),h.searchParams.set("sort",n||"-".concat(d)),fetch(h).then(async t=>{if(t.ok)return(await t.json()).items;throw Error("".concat(t.status,": ").concat(t.statusText))}).then(t=>{let s=o.length?o.concat(t):a.slice(0,i).concat(t);l&&s.sort(l),this.setState({currentLine:e+1,updatedData:(0,m.uC)(s)})}).catch(t=>console.error(t))}}}}z.defaultProps={isFavoritesPage:!1,isFavoritesSlider:!1,isFavoritesWatchList:!1,blockIndex:0};let R=(0,n.withRouter)((0,g.Ng)(t=>({registration:t.registration,systemInformation:t.systemInformation,profile:t.profile,player:t.player,catalog:t.catalog}),A)(z))},5843:(t,e,i)=>{"use strict";i.d(e,{A:()=>r});var o=i(74848);i(96540);var s=i(22721),a=i.n(s);let r=t=>{let{rating:e,adaptiveActite:i=!0}=t;return Number.isFinite(e)?(0,o.jsx)("div",{"data-rating-green":e>=7,"data-adaptive-active":i,className:a().kind_rating,children:null==e?void 0:e.toFixed(1)}):null}},60963:(t,e,i)=>{"use strict";i.d(e,{Ay:()=>h,Ex:()=>d,JI:()=>c,L$:()=>n});var o=i(74848),s=i(46942),a=i.n(s),r=i(2327),l=i.n(r);let n=t=>{let{className:e,size:i,text:s,textRight:r,textColor:n,textColorRight:c,bgColor:h,bgColorRight:g}=t;return(0,o.jsxs)("div",{className:a()(l()["badge-double"],e),children:[(0,o.jsx)(d,{className:l()["badge-double__left"],textColor:n,bgColor:h,text:s}),(0,o.jsx)(d,{className:l()["badge-double__right"],textColor:c,bgColor:g,text:r})]})},d=t=>{let{className:e,size:i,textColor:s,bgColor:r,text:n}=t;return(0,o.jsx)("div",{className:a()(l().badge,e),style:{color:s,backgroundColor:r},children:n})},c=t=>{let{className:e}=t;return(0,o.jsx)(d,{className:a()(l().premiumBadge,e),text:"PREMIUM"})},h=d}
1,31981:(t,e,i)=>{"use strict";i.d(e,{A:()=>d});var o=i(74848),s=i(46942),a=i.n(s),r=i(97461),l=i(45969),n=i.n(l);let d=t=>{let{onNextClick:e=()=>{},onHideClick:i=()=>{},isEnd:s=!0,hideText:l="СвеÑнÑÑÑ",showText:d="ÐоказаÑÑ ÐµÑÑ",testId:c=""}=t;return(0,o.jsx)("div",{className:n().content,"data-testid":c,children:(0,o.jsx)(r.$n,{className:n().btn,variant:r.Vt.OUTLINE,size:r.GO.MEDIUM,title:s?l:d,onClick:()=>{s?i():e()},iconRight:(0,o.jsx)("img",{className:a()(n().btn__image,{[n()["btn__image--down"]]:s}),src:"/static/images/product/arrow-down.svg",alt:"arrow"})})})}},18011:t=>{t.exports={"storybook-root":"VideoList_storybook-root__YBTSe",videoCatalog__linked:"VideoList_videoCatalog__linked__qm9eO","videoCatalog-wrapper":"VideoList_videoCatalog-wrapper__Zi3Ly",favoritePage:"VideoList_favoritePage__b3HDx","videoCatalog-item-image":"VideoList_videoCatalog-item-image__x4pEK",favoritePageGrid:"VideoList_favoritePageGrid__8ac5B",favoritePageWatchList:"VideoList_favoritePageWatchList__uNbla",more:"VideoList_more__5iH1x",videoCatalog__slider:"VideoList_videoCatalog__slider__bLoqR","videoCatalog-title":"VideoList_videoCatalog-title__TQ8yq","videoCatalog-title-alias":"VideoList_videoCatalog-title-alias__KWugQ","videoCatalog-title-genres":"VideoList_videoCatalog-title-genres__rKg37","videoCatalog-button":"VideoList_videoCatalog-button__5igD7","videoCatalog-item-wrapper":"VideoList_videoCatalog-item-wrapper__MXO94","videoCatalog-item":"VideoList_videoCatalog-item__3hrty",videoCatalog__text:"VideoList_videoCatalog__text__fZA5w",videoCatalog__title:"VideoList_videoCatalog__title__cgpb6",videoCatalog__description:"VideoList_videoCatalog__description__Lv_er",slider__arrow:"VideoList_slider__arrow___h0uR",favorite:"VideoList_favorite__44Hrw",bookmark:"VideoList_bookmark__hnipQ",slider__arrow__prev:"VideoList_slider__arrow__prev__26X8_",slider__arrow__next:"VideoList_slider__arrow__next__6q6zM","videoCatalog-item-wrapper-catalog":"VideoList_videoCatalog-item-wrapper-catalog__Kgg4T","videoCatalog-item-skeleton":"VideoList_videoCatalog-item-skeleton___L38H","videoCatalog-item-image-skeleton":"VideoList_videoCatalog-item-image-skeleton__77Kzr",watched:"VideoList_watched__de05d","watched-line":"VideoList_watched-line__N30oX","red-line":"VideoList_red-line__gyqJC","white-line":"VideoList_white-line__g_rm6","watched-title":"VideoList_watched-title__sj5xj","videoCatalog-item-image-kind_rating":"VideoList_videoCatalog-item-image-kind_rating__tW3DH","videoCatalog-item-image-rating":"VideoList_videoCatalog-item-image-rating__2LePB","videoCatalog-item-image-rating-high":"VideoList_videoCatalog-item-image-rating-high__l_389","videoCatalog-item-image-rating-fire":"VideoList_videoCatalog-item-image-rating-fire__YAUlE","videoCatalog-title-skeleton-first":"VideoList_videoCatalog-title-skeleton-first__wa_5g","videoCatalog-title-skeleton-second":"VideoList_videoCatalog-title-skeleton-second__Shk9j","videoCatalog-show-more":"VideoList_videoCatalog-show-more__pUrwH","videoCatalog-show-more-image":"VideoList_videoCatalog-show-more-image__iKvI_",down:"VideoList_down__Et0xm","videoCatalog-title-name":"VideoList_videoCatalog-title-name__XHqrE",popup__wrapper:"VideoList_popup__wrapper__9g9Ew",popup__line:"VideoList_popup__line__P8y3_",popup__line__header:"VideoList_popup__line__header__RzCnq","videoCatalog-single-badge":"VideoList_videoCatalog-single-badge__0MGRj","videoCatalog-double-badge":"VideoList_videoCatalog-double-badge__fwtl_","videoCatalog-premium-badge":"VideoList_videoCatalog-premium-badge__bH_W0",estBadge:"VideoList_estBadge__s2WYU",webapp:"VideoList_webapp__KH_CU","videoCatalog-badge-small":"VideoList_videoCatalog-badge-small__RyqFr"}},22721:t=>{t.exports={"storybook-root":"KindPosterRating_storybook-root__JHkZ4",kind_rating:"KindPosterRating_kind_rating__Bwg_e"}},2327:t=>{t.exports={"storybook-root":"Badge_storybook-root__BDw8n",badge:"Badge_badge__GrobN","badge-double":"Badge_badge-double__7cJIO","badge-double__left":"Badge_badge-double__left__Xm0CL","badge-double__right":"Badge_badge-double__right__I_ofx",premiumBadge:"Badge_premiumBadge__SSAC_"}},45969:t=>{t.exports={"storybook-root":"ShowMore_storybook-root__V5LUk",content:"ShowMore_content__Uu3Cs",btn:"ShowMore_btn__SkLlK",btn__image:"ShowMore_btn__image__kLqoi","btn__image--down":"ShowMore_btn__image--down__Hu9b4"}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.