@vkontakte/videoplayer 1.1.34 → 1.1.35-dev.b4e1f23a.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/es2015.cjs.js CHANGED
@@ -1,9 +1,9 @@
1
1
  /**
2
- * @vkontakte/videoplayer v1.1.34
3
- * Fri, 26 Apr 2024 14:19:06 GMT
4
- * https://st.mycdn.me/static/vkontakte-videoplayer/1-1-34/doc/
2
+ * @vkontakte/videoplayer v1.1.35-dev.b4e1f23a.0
3
+ * Fri, 03 May 2024 11:18:07 GMT
4
+ * https://st.mycdn.me/static/vkontakte-videoplayer/1-1-35/doc/
5
5
  */
6
- "use strict";var Oc=Object.create;var nl=Object.defineProperty,zc=Object.defineProperties,Dc=Object.getOwnPropertyDescriptor,Fc=Object.getOwnPropertyDescriptors,Hc=Object.getOwnPropertyNames,os=Object.getOwnPropertySymbols,Uc=Object.getPrototypeOf,ls=Object.prototype.hasOwnProperty,jc=Object.prototype.propertyIsEnumerable;var il=(i,e,t)=>e in i?nl(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Ki=(i,e)=>{for(var t in e||(e={}))ls.call(e,t)&&il(i,t,e[t]);if(os)for(var t of os(e))jc.call(e,t)&&il(i,t,e[t]);return i},Kn=(i,e)=>zc(i,Fc(e));var qc=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Hc(e))!ls.call(i,o)&&o!==t&&nl(i,o,{get:()=>e[o],enumerable:!(n=Dc(e,o))||n.enumerable});return i};var ss=(i,e,t)=>(t=i!=null?Oc(Uc(i)):{},qc(e||!i||!i.__esModule?nl(t,"default",{value:i,enumerable:!0}):t,i));var ol=(i,e,t)=>(il(i,typeof e!="symbol"?e+"":e,t),t);var Dn=(i,e,t)=>new Promise((n,o)=>{var l=a=>{try{r(t.next(a))}catch(c){o(c)}},s=a=>{try{r(t.throw(a))}catch(c){o(c)}},r=a=>a.done?n(a.value):Promise.resolve(a.value).then(l,s);r((t=t.apply(i,e)).next())});var nt=require("@vkontakte/videoplayer-core/es2015.cjs.js"),le=require("@vkontakte/videoplayer-shared/es2015.cjs.js"),wt=require("@vkontakte/videoplayer-statistics/es2015.cjs.js");function Yi(i,e,t,n){function o(l){return l instanceof t?l:new t(function(s){s(l)})}return new(t||(t=Promise))(function(l,s){function r(f){try{c(n.next(f))}catch(h){s(h)}}function a(f){try{c(n.throw(f))}catch(h){s(h)}}function c(f){f.done?l(f.value):o(f.value).then(r,a)}c((n=n.apply(i,e||[])).next())})}function K(){}function M1(i,e){for(const t in e)i[t]=e[t];return i}function N1(i){return i()}function rs(){return Object.create(null)}function ni(i){i.forEach(N1)}function Cn(i){return typeof i=="function"}function _e(i,e){return i!=i?e==e:i!==e||i&&typeof i=="object"||typeof i=="function"}let Lo;function as(i,e){return Lo||(Lo=document.createElement("a")),Lo.href=e,i===Lo.href}function Wc(i){return Object.keys(i).length===0}function Zo(i,...e){if(i==null){for(const n of e)n(void 0);return K}const t=i.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function it(i){let e;return Zo(i,t=>e=t)(),e}function q(i,e,t){i.$$.on_destroy.push(Zo(e,t))}function Tn(i,e,t,n){if(i){const o=R1(i,e,t,n);return i[0](o)}}function R1(i,e,t,n){return i[1]&&n?M1(t.ctx.slice(),i[1](n(e))):t.ctx}function En(i,e,t,n){if(i[2]&&n){const o=i[2](n(t));if(e.dirty===void 0)return o;if(typeof o=="object"){const l=[],s=Math.max(e.dirty.length,o.length);for(let r=0;r<s;r+=1)l[r]=e.dirty[r]|o[r];return l}return e.dirty|o}return e.dirty}function An(i,e,t,n,o,l){if(o){const s=R1(e,t,n,l);i.p(s,o)}}function Ln(i){if(i.ctx.length>32){const e=[],t=i.ctx.length/32;for(let n=0;n<t;n++)e[n]=-1;return e}return-1}function Zc(i){return i==null?"":i}const B1=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global;function d(i,e){i.appendChild(e)}function qe(i,e,t){const n=Gc(i);if(!n.getElementById(e)){const o=k("style");o.id=e,o.textContent=t,Kc(n,o)}}function Gc(i){if(!i)return document;const e=i.getRootNode?i.getRootNode():i.ownerDocument;return e&&e.host?e:i.ownerDocument}function Kc(i,e){return d(i.head||i,e),e.sheet}function S(i,e,t){i.insertBefore(e,t||null)}function y(i){i.parentNode&&i.parentNode.removeChild(i)}function an(i,e){for(let t=0;t<i.length;t+=1)i[t]&&i[t].d(e)}function k(i){return document.createElement(i)}function I(i){return document.createElementNS("http://www.w3.org/2000/svg",i)}function De(i){return document.createTextNode(i)}function R(){return De(" ")}function bt(){return De("")}function Ae(i,e,t,n){return i.addEventListener(e,t,n),()=>i.removeEventListener(e,t,n)}function wi(i){return function(e){return e.preventDefault(),i.call(this,e)}}function ft(i){return function(e){return e.stopPropagation(),i.call(this,e)}}function u(i,e,t){t==null?i.removeAttribute(e):i.getAttribute(e)!==t&&i.setAttribute(e,t)}function Yc(i){return Array.from(i.childNodes)}function ot(i,e){e=""+e,i.data!==e&&(i.data=e)}function Ft(i,e,t,n){t==null?i.style.removeProperty(e):i.style.setProperty(e,t,n?"important":"")}let Vo;function Qc(){if(Vo===void 0){Vo=!1;try{typeof window!="undefined"&&window.parent&&window.parent.document}catch(i){Vo=!0}}return Vo}function Go(i,e){getComputedStyle(i).position==="static"&&(i.style.position="relative");const n=k("iframe");n.setAttribute("style","display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;"),n.setAttribute("aria-hidden","true"),n.tabIndex=-1;const o=Qc();let l;return o?(n.src="data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\/script>",l=Ae(window,"message",s=>{s.source===n.contentWindow&&e()})):(n.src="about:blank",n.onload=()=>{l=Ae(n.contentWindow,"resize",e),e()}),d(i,n),()=>{(o||l&&n.contentWindow)&&l(),y(n)}}function V(i,e,t){i.classList.toggle(e,!!t)}function pn(i,e){return new i(e)}let _o;function bo(i){_o=i}function ko(){if(!_o)throw new Error("Function called outside component initialization");return _o}function Xi(i){ko().$$.on_mount.push(i)}function Ko(i){ko().$$.on_destroy.push(i)}function Vl(i,e){return ko().$$.context.set(i,e),e}function Fl(i){return ko().$$.context.get(i)}function O1(){return ko().$$.context}function lo(i,e){const t=i.$$.callbacks[e.type];t&&t.slice().forEach(n=>n.call(this,e))}const eo=[],We=[];let no=[];const Il=[],Xc=Promise.resolve();let Ml=!1;function Jc(){Ml||(Ml=!0,Xc.then(z1))}function Un(i){no.push(i)}function Ct(i){Il.push(i)}const ll=new Set;let Yn=0;function z1(){if(Yn!==0)return;const i=_o;do{try{for(;Yn<eo.length;){const e=eo[Yn];Yn++,bo(e),xc(e.$$)}}catch(e){throw eo.length=0,Yn=0,e}for(bo(null),eo.length=0,Yn=0;We.length;)We.pop()();for(let e=0;e<no.length;e+=1){const t=no[e];ll.has(t)||(ll.add(t),t())}no.length=0}while(eo.length);for(;Il.length;)Il.pop()();Ml=!1,ll.clear(),bo(i)}function xc(i){if(i.fragment!==null){i.update(),ni(i.before_update);const e=i.dirty;i.dirty=[-1],i.fragment&&i.fragment.p(i.ctx,e),i.after_update.forEach(Un)}}function $c(i){const e=[],t=[];no.forEach(n=>i.indexOf(n)===-1?e.push(n):t.push(n)),t.forEach(n=>n()),no=e}const Fo=new Set;let Fn;function he(){Fn={r:0,c:[],p:Fn}}function pe(){Fn.r||ni(Fn.c),Fn=Fn.p}function m(i,e){i&&i.i&&(Fo.delete(i),i.i(e))}function v(i,e,t,n){if(i&&i.o){if(Fo.has(i))return;Fo.add(i),Fn.c.push(()=>{Fo.delete(i),n&&(t&&i.d(1),n())}),i.o(e)}else n&&n()}function Zt(i){return(i==null?void 0:i.length)!==void 0?i:Array.from(i)}function e0(i,e){const t={},n={},o={$$scope:1};let l=i.length;for(;l--;){const s=i[l],r=e[l];if(r){for(const a in s)a in r||(n[a]=1);for(const a in r)o[a]||(t[a]=r[a],o[a]=1);i[l]=r}else for(const a in s)o[a]=1}for(const s in n)s in t||(t[s]=void 0);return t}function t0(i){return typeof i=="object"&&i!==null?i:{}}function Tt(i,e,t){const n=i.$$.props[e];n!==void 0&&(i.$$.bound[n]=t,t(i.$$.ctx[n]))}function F(i){i&&i.c()}function z(i,e,t){const{fragment:n,after_update:o}=i.$$;n&&n.m(e,t),Un(()=>{const l=i.$$.on_mount.map(N1).filter(Cn);i.$$.on_destroy?i.$$.on_destroy.push(...l):ni(l),i.$$.on_mount=[]}),o.forEach(Un)}function D(i,e){const t=i.$$;t.fragment!==null&&($c(t.after_update),ni(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function i0(i,e){i.$$.dirty[0]===-1&&(eo.push(i),Jc(),i.$$.dirty.fill(0)),i.$$.dirty[e/31|0]|=1<<e%31}function ye(i,e,t,n,o,l,s,r=[-1]){const a=_o;bo(i);const c=i.$$={fragment:null,ctx:[],props:l,update:K,not_equal:o,bound:rs(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(a?a.$$.context:[])),callbacks:rs(),dirty:r,skip_bound:!1,root:e.target||a.$$.root};s&&s(c.root);let f=!1;if(c.ctx=t?t(i,e.props||{},(h,p,...b)=>{const g=b.length?b[0]:p;return c.ctx&&o(c.ctx[h],c.ctx[h]=g)&&(!c.skip_bound&&c.bound[h]&&c.bound[h](g),f&&i0(i,h)),p}):[],c.update(),f=!0,ni(c.before_update),c.fragment=n?n(c.ctx):!1,e.target){if(e.hydrate){const h=Yc(e.target);c.fragment&&c.fragment.l(h),h.forEach(y)}else c.fragment&&c.fragment.c();e.intro&&m(i.$$.fragment),z(i,e.target,e.anchor),z1()}bo(a)}class Se{constructor(){ol(this,"$$");ol(this,"$$set")}$destroy(){D(this,1),this.$destroy=K}$on(e,t){if(!Cn(t))return K;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const o=n.indexOf(t);o!==-1&&n.splice(o,1)}}$set(e){this.$$set&&!Wc(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const n0="4";typeof window!="undefined"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(n0);var so;(function(i){i.VK="vk",i.VK_VIDEO="vk_video"})(so||(so={}));const o0={isMobile:void 0,defaultLanguage:le.InterfaceLanguage.RU,downloadVKLanguages:!0,updateBuiltinLanguages:!0,isSmoothVideoRotate:!0,showSupport:!0,supportLink:"https://vk.com/support?act=new&from=v",showLogo:void 0,logoLink:"https://vk.com/video",logoType:so.VK_VIDEO,addTimeToLogoLink:!0,volumeDefault:1,volumeMinRestore:.05,loaderDelay:500,minSubtitlesFontSize:13,autoSubtitlesTimeout:2e3,allowChangingFullscreenTarget:!0,trafficSavingLimit:le.VideoQuality.Q_480P,episodeMinWidthPc:8,hideThumbTimerAfterTouch:!0,sentry:{dsn:"https://e349fd23c68f405388980d0868d0ff27@sentry.mvk.com/126",sampleRate:.01,whiteErrorCategoryList:[],blackErrorCategoryList:[],whiteErrorIdList:[],blackErrorIdList:[]},features:{autoplay:!0,statistics:!0,sentry:!0,preload:!0,subtitles:!0,episodes:!0,fullscreen:!0,timelinePreview:!0,mediaSession:!0,annotations:!0,pip:!0,dpip:!0,download:!0,liveRewind:!0,playbackRate:!0,trafficSaving:!0,episodesClustering:!0,copyVideoLink:!0,videoRotate:!0,interactiveGraph:!1,seekToInteractive:!0,interactiveLastFrame:!1,interactiveTextPermanent:!0,interactiveHideTime:!0,interactivePlayPrevChapter:!0,thumbTimer:!0,hotKeyMapModal:!0,hotKeyHelpers:!0,saveDebugInfoToFile:!1,additionalButtons:!0},controls:{hideTimeout:500,hideTimeoutMobile:3e3,hideTimeoutInitial:200,hideTimeoutFullscreen:3e3,hideTimeoutCursor:3e3,hideTimeoutTooltips:1e3,collapseMobileUnmute:6e3,hide360IconTimeout:3e3,hideHotKeyHelpers:2e3,playbackRateMin:.25,playbackRateMax:2,playbackRateStep:.25,volumeStepKeyboard:.05,volumeStepWheel:.05,volumeBarTimeout:300,seekStepKeyboard:1e4,seekStepMobile:15e3,seekStepFrame:400},ads:{enable:void 0,initTimeout:2e3,loadTimeout:2e3,slot:void 0,preview:void 0}},l0=i=>le.fillWithDefault(i,o0),s0=i=>Vl("ui-config",i),Ji=()=>Fl("ui-config"),Nl="vk_player_debug_panel_opened",D1=300,r0="videoplayer",a0="videoplayer";var je;(function(i){i.ArrowLeft="ArrowLeft",i.ArrowUp="ArrowUp",i.ArrowRight="ArrowRight",i.ArrowDown="ArrowDown",i.Comma="Comma",i.Period="Period",i.Space="Space",i.KeyM="KeyM",i.KeyF="KeyF",i.KeyK="KeyK",i.KeyL="KeyL",i.KeyJ="KeyJ",i.KeyC="KeyC",i.KeyI="KeyI",i.Digit1="Digit1",i.Digit2="Digit2",i.Digit3="Digit3",i.Digit4="Digit4",i.Digit5="Digit5",i.Digit6="Digit6",i.Digit7="Digit7",i.Digit8="Digit8",i.Digit9="Digit9",i.Digit0="Digit0",i.Numpad1="Numpad1",i.Numpad2="Numpad2",i.Numpad3="Numpad3",i.Numpad4="Numpad4",i.Numpad5="Numpad5",i.Numpad6="Numpad6",i.Numpad7="Numpad7",i.Numpad8="Numpad8",i.Numpad9="Numpad9",i.Numpad0="Numpad0",i.ShiftLeft="ShiftLeft",i.ShiftRight="ShiftRight",i.Slash="Slash"})(je||(je={}));const Yo={[je.KeyF]:"f",[je.KeyK]:"k",[je.KeyC]:"c",[je.KeyM]:"m"},u0=new Set([je.ArrowLeft,je.ArrowRight,je.KeyL,je.KeyJ]);var vt;(function(i){i.PLAY_BUTTON="PLAY_BUTTON",i.REPLAY_BUTTON="REPLAY_BUTTON",i.NEXT_BUTTON="NEXT_BUTTON",i.PREV_BUTTON="PREV_BUTTON",i.PICTURE_IN_PICTURE="PICTURE_IN_PICTURE",i.FULLSCREEN_BUTTON="FULLSCREEN_BUTTON",i.SETTINGS_BUTTON="SETTINGS_BUTTON",i.LIVE_BUTTON="LIVE_BUTTON",i.GRAPH_BUTTON="GRAPH_BUTTON",i.PLAY_PREV_CHAPTER_BUTTON="PLAY_PREV_CHAPTER_BUTTON",i.SEEK_TO_INTERACTIVE_BUTTON="SEEK_TO_INTERACTIVE_BUTTON",i.TIMELINE="TIMELINE",i.VOLUME_BAR="VOLUME_BAR",i.MUTE_BUTTON="MUTE_BUTTON",i.SUBTITLES_BUTTON="SUBTITLES_BUTTON",i.CHROMECAST_BUTTON="CHROMECAST_BUTTON",i.VK_BUTTON="VK_BUTTON",i.EPISODE_BUTTON="EPISODE_BUTTON",i.INCREMENT_PLAYBACK_RATE="INCREMENT_PLAYBACK_RATE",i.DECREMENT_PLAYBACK_RATE="DECREMENT_PLAYBACK_RATE"})(vt||(vt={}));const us=40,c0=4,f0=60,vo=8,F1=[vt.TIMELINE],Ho=[...F1,vt.GRAPH_BUTTON],cs=[...F1,vt.PLAY_BUTTON],H1=[...Ho,vt.PLAY_BUTTON];var to;(function(i){i[i.XS=320]="XS",i[i.S=509]="S",i[i.M=599]="M",i[i.L=699]="L"})(to||(to={}));exports.GridTypes=void 0;(function(i){i.XS="xs",i.S="s",i.M="m",i.L="l",i.XL="xl"})(exports.GridTypes||(exports.GridTypes={}));const ro={[exports.GridTypes.XS]:0,[exports.GridTypes.S]:1,[exports.GridTypes.M]:2,[exports.GridTypes.L]:3,[exports.GridTypes.XL]:4},Qn=[];function hn(i,e){return{subscribe:Ue(i,e).subscribe}}function Ue(i,e=K){let t;const n=new Set;function o(r){if(_e(i,r)&&(i=r,t)){const a=!Qn.length;for(const c of n)c[1](),Qn.push(c,i);if(a){for(let c=0;c<Qn.length;c+=2)Qn[c][0](Qn[c+1]);Qn.length=0}}}function l(r){o(r(i))}function s(r,a=K){const c=[r,a];return n.add(c),n.size===1&&(t=e(o,l)||K),r(i),()=>{n.delete(c),n.size===0&&t&&(t(),t=null)}}return{set:o,update:l,subscribe:s}}function ii(i,e,t){const n=!Array.isArray(i),o=n?[i]:i;if(!o.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const l=e.length<2;return hn(t,(s,r)=>{let a=!1;const c=[];let f=0,h=K;const p=()=>{if(f)return;h();const g=e(n?c[0]:c,s,r);l?s(g):h=Cn(g)?g:K},b=o.map((g,_)=>Zo(g,L=>{c[_]=L,f&=~(1<<_),a&&p()},()=>{f|=1<<_}));return a=!0,p(),function(){ni(b),h(),a=!1}})}const d0="prod",Qo="1.1.34",U1=(i,e,t)=>{const n=document.createElement("a");n.href=i,n.download=`${e}.${t}`,n.style.display="none",n.click()},j1=Symbol("storeContext"),q1=Symbol("microStoresContext"),m0=(i,e)=>{Vl(j1,i),Vl(q1,e)},Et=()=>{const i=Fl(j1);return le.assertNonNullable(i,"Store context is empty!"),i},W1=()=>{const i=Fl(q1);return le.assertNonNullable(i,"MicroStores context is empty!"),i},St=(i,e)=>Z1(i,i.getValue(),e),Z1=(i,e,t)=>hn(e,n=>{const o=i.subscribe(l=>{n(l),t==null||t(l)});return()=>o.unsubscribe()}),h0=(i,e,t)=>{var n,o,l,s;const r=i.info,{width:a,height:c}=it(t.ui.playerSize),f=(o=(n=r.throughputEstimation$.getValue())===null||n===void 0?void 0:n.toFixed(0))!==null&&o!==void 0?o:0,h=(s=(l=r.rttEstimation$.getValue())===null||l===void 0?void 0:l.toFixed(0))!==null&&s!==void 0?s:0,p=r.isAutoQualityEnabled$.getValue()?"auto":"manual",b=`${Qo} (core: ${nt.VERSION}, stat: ${wt.VERSION}, shared: ${le.VERSION})`,g=it(t.state.errorLog$),_=g.length?`
6
+ "use strict";var Oc=Object.create;var nl=Object.defineProperty,zc=Object.defineProperties,Dc=Object.getOwnPropertyDescriptor,Fc=Object.getOwnPropertyDescriptors,Hc=Object.getOwnPropertyNames,os=Object.getOwnPropertySymbols,Uc=Object.getPrototypeOf,ls=Object.prototype.hasOwnProperty,jc=Object.prototype.propertyIsEnumerable;var il=(i,e,t)=>e in i?nl(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Ki=(i,e)=>{for(var t in e||(e={}))ls.call(e,t)&&il(i,t,e[t]);if(os)for(var t of os(e))jc.call(e,t)&&il(i,t,e[t]);return i},Kn=(i,e)=>zc(i,Fc(e));var qc=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Hc(e))!ls.call(i,o)&&o!==t&&nl(i,o,{get:()=>e[o],enumerable:!(n=Dc(e,o))||n.enumerable});return i};var ss=(i,e,t)=>(t=i!=null?Oc(Uc(i)):{},qc(e||!i||!i.__esModule?nl(t,"default",{value:i,enumerable:!0}):t,i));var ol=(i,e,t)=>(il(i,typeof e!="symbol"?e+"":e,t),t);var Dn=(i,e,t)=>new Promise((n,o)=>{var l=a=>{try{r(t.next(a))}catch(c){o(c)}},s=a=>{try{r(t.throw(a))}catch(c){o(c)}},r=a=>a.done?n(a.value):Promise.resolve(a.value).then(l,s);r((t=t.apply(i,e)).next())});var nt=require("@vkontakte/videoplayer-core/es2015.cjs.js"),le=require("@vkontakte/videoplayer-shared/es2015.cjs.js"),wt=require("@vkontakte/videoplayer-statistics/es2015.cjs.js");function Yi(i,e,t,n){function o(l){return l instanceof t?l:new t(function(s){s(l)})}return new(t||(t=Promise))(function(l,s){function r(f){try{c(n.next(f))}catch(h){s(h)}}function a(f){try{c(n.throw(f))}catch(h){s(h)}}function c(f){f.done?l(f.value):o(f.value).then(r,a)}c((n=n.apply(i,e||[])).next())})}function K(){}function M1(i,e){for(const t in e)i[t]=e[t];return i}function N1(i){return i()}function rs(){return Object.create(null)}function ni(i){i.forEach(N1)}function Cn(i){return typeof i=="function"}function _e(i,e){return i!=i?e==e:i!==e||i&&typeof i=="object"||typeof i=="function"}let Lo;function as(i,e){return Lo||(Lo=document.createElement("a")),Lo.href=e,i===Lo.href}function Wc(i){return Object.keys(i).length===0}function Zo(i,...e){if(i==null){for(const n of e)n(void 0);return K}const t=i.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function it(i){let e;return Zo(i,t=>e=t)(),e}function q(i,e,t){i.$$.on_destroy.push(Zo(e,t))}function Tn(i,e,t,n){if(i){const o=R1(i,e,t,n);return i[0](o)}}function R1(i,e,t,n){return i[1]&&n?M1(t.ctx.slice(),i[1](n(e))):t.ctx}function En(i,e,t,n){if(i[2]&&n){const o=i[2](n(t));if(e.dirty===void 0)return o;if(typeof o=="object"){const l=[],s=Math.max(e.dirty.length,o.length);for(let r=0;r<s;r+=1)l[r]=e.dirty[r]|o[r];return l}return e.dirty|o}return e.dirty}function An(i,e,t,n,o,l){if(o){const s=R1(e,t,n,l);i.p(s,o)}}function Ln(i){if(i.ctx.length>32){const e=[],t=i.ctx.length/32;for(let n=0;n<t;n++)e[n]=-1;return e}return-1}function Zc(i){return i==null?"":i}const B1=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global;function d(i,e){i.appendChild(e)}function qe(i,e,t){const n=Gc(i);if(!n.getElementById(e)){const o=k("style");o.id=e,o.textContent=t,Kc(n,o)}}function Gc(i){if(!i)return document;const e=i.getRootNode?i.getRootNode():i.ownerDocument;return e&&e.host?e:i.ownerDocument}function Kc(i,e){return d(i.head||i,e),e.sheet}function S(i,e,t){i.insertBefore(e,t||null)}function y(i){i.parentNode&&i.parentNode.removeChild(i)}function an(i,e){for(let t=0;t<i.length;t+=1)i[t]&&i[t].d(e)}function k(i){return document.createElement(i)}function I(i){return document.createElementNS("http://www.w3.org/2000/svg",i)}function De(i){return document.createTextNode(i)}function R(){return De(" ")}function bt(){return De("")}function Ae(i,e,t,n){return i.addEventListener(e,t,n),()=>i.removeEventListener(e,t,n)}function wi(i){return function(e){return e.preventDefault(),i.call(this,e)}}function ft(i){return function(e){return e.stopPropagation(),i.call(this,e)}}function u(i,e,t){t==null?i.removeAttribute(e):i.getAttribute(e)!==t&&i.setAttribute(e,t)}function Yc(i){return Array.from(i.childNodes)}function ot(i,e){e=""+e,i.data!==e&&(i.data=e)}function Ft(i,e,t,n){t==null?i.style.removeProperty(e):i.style.setProperty(e,t,n?"important":"")}let Vo;function Qc(){if(Vo===void 0){Vo=!1;try{typeof window!="undefined"&&window.parent&&window.parent.document}catch(i){Vo=!0}}return Vo}function Go(i,e){getComputedStyle(i).position==="static"&&(i.style.position="relative");const n=k("iframe");n.setAttribute("style","display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;"),n.setAttribute("aria-hidden","true"),n.tabIndex=-1;const o=Qc();let l;return o?(n.src="data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\/script>",l=Ae(window,"message",s=>{s.source===n.contentWindow&&e()})):(n.src="about:blank",n.onload=()=>{l=Ae(n.contentWindow,"resize",e),e()}),d(i,n),()=>{(o||l&&n.contentWindow)&&l(),y(n)}}function V(i,e,t){i.classList.toggle(e,!!t)}function pn(i,e){return new i(e)}let _o;function bo(i){_o=i}function ko(){if(!_o)throw new Error("Function called outside component initialization");return _o}function Xi(i){ko().$$.on_mount.push(i)}function Ko(i){ko().$$.on_destroy.push(i)}function Vl(i,e){return ko().$$.context.set(i,e),e}function Fl(i){return ko().$$.context.get(i)}function O1(){return ko().$$.context}function lo(i,e){const t=i.$$.callbacks[e.type];t&&t.slice().forEach(n=>n.call(this,e))}const eo=[],We=[];let no=[];const Il=[],Xc=Promise.resolve();let Ml=!1;function Jc(){Ml||(Ml=!0,Xc.then(z1))}function Un(i){no.push(i)}function Ct(i){Il.push(i)}const ll=new Set;let Yn=0;function z1(){if(Yn!==0)return;const i=_o;do{try{for(;Yn<eo.length;){const e=eo[Yn];Yn++,bo(e),xc(e.$$)}}catch(e){throw eo.length=0,Yn=0,e}for(bo(null),eo.length=0,Yn=0;We.length;)We.pop()();for(let e=0;e<no.length;e+=1){const t=no[e];ll.has(t)||(ll.add(t),t())}no.length=0}while(eo.length);for(;Il.length;)Il.pop()();Ml=!1,ll.clear(),bo(i)}function xc(i){if(i.fragment!==null){i.update(),ni(i.before_update);const e=i.dirty;i.dirty=[-1],i.fragment&&i.fragment.p(i.ctx,e),i.after_update.forEach(Un)}}function $c(i){const e=[],t=[];no.forEach(n=>i.indexOf(n)===-1?e.push(n):t.push(n)),t.forEach(n=>n()),no=e}const Fo=new Set;let Fn;function he(){Fn={r:0,c:[],p:Fn}}function pe(){Fn.r||ni(Fn.c),Fn=Fn.p}function m(i,e){i&&i.i&&(Fo.delete(i),i.i(e))}function v(i,e,t,n){if(i&&i.o){if(Fo.has(i))return;Fo.add(i),Fn.c.push(()=>{Fo.delete(i),n&&(t&&i.d(1),n())}),i.o(e)}else n&&n()}function Zt(i){return(i==null?void 0:i.length)!==void 0?i:Array.from(i)}function e0(i,e){const t={},n={},o={$$scope:1};let l=i.length;for(;l--;){const s=i[l],r=e[l];if(r){for(const a in s)a in r||(n[a]=1);for(const a in r)o[a]||(t[a]=r[a],o[a]=1);i[l]=r}else for(const a in s)o[a]=1}for(const s in n)s in t||(t[s]=void 0);return t}function t0(i){return typeof i=="object"&&i!==null?i:{}}function Tt(i,e,t){const n=i.$$.props[e];n!==void 0&&(i.$$.bound[n]=t,t(i.$$.ctx[n]))}function F(i){i&&i.c()}function z(i,e,t){const{fragment:n,after_update:o}=i.$$;n&&n.m(e,t),Un(()=>{const l=i.$$.on_mount.map(N1).filter(Cn);i.$$.on_destroy?i.$$.on_destroy.push(...l):ni(l),i.$$.on_mount=[]}),o.forEach(Un)}function D(i,e){const t=i.$$;t.fragment!==null&&($c(t.after_update),ni(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function i0(i,e){i.$$.dirty[0]===-1&&(eo.push(i),Jc(),i.$$.dirty.fill(0)),i.$$.dirty[e/31|0]|=1<<e%31}function ye(i,e,t,n,o,l,s,r=[-1]){const a=_o;bo(i);const c=i.$$={fragment:null,ctx:[],props:l,update:K,not_equal:o,bound:rs(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(a?a.$$.context:[])),callbacks:rs(),dirty:r,skip_bound:!1,root:e.target||a.$$.root};s&&s(c.root);let f=!1;if(c.ctx=t?t(i,e.props||{},(h,p,...b)=>{const g=b.length?b[0]:p;return c.ctx&&o(c.ctx[h],c.ctx[h]=g)&&(!c.skip_bound&&c.bound[h]&&c.bound[h](g),f&&i0(i,h)),p}):[],c.update(),f=!0,ni(c.before_update),c.fragment=n?n(c.ctx):!1,e.target){if(e.hydrate){const h=Yc(e.target);c.fragment&&c.fragment.l(h),h.forEach(y)}else c.fragment&&c.fragment.c();e.intro&&m(i.$$.fragment),z(i,e.target,e.anchor),z1()}bo(a)}class Se{constructor(){ol(this,"$$");ol(this,"$$set")}$destroy(){D(this,1),this.$destroy=K}$on(e,t){if(!Cn(t))return K;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const o=n.indexOf(t);o!==-1&&n.splice(o,1)}}$set(e){this.$$set&&!Wc(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const n0="4";typeof window!="undefined"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(n0);var so;(function(i){i.VK="vk",i.VK_VIDEO="vk_video"})(so||(so={}));const o0={isMobile:void 0,defaultLanguage:le.InterfaceLanguage.RU,downloadVKLanguages:!0,updateBuiltinLanguages:!0,isSmoothVideoRotate:!0,showSupport:!0,supportLink:"https://vk.com/support?act=new&from=v",showLogo:void 0,logoLink:"https://vk.com/video",logoType:so.VK_VIDEO,addTimeToLogoLink:!0,volumeDefault:1,volumeMinRestore:.05,loaderDelay:500,minSubtitlesFontSize:13,autoSubtitlesTimeout:2e3,allowChangingFullscreenTarget:!0,trafficSavingLimit:le.VideoQuality.Q_480P,episodeMinWidthPc:8,hideThumbTimerAfterTouch:!0,sentry:{dsn:"https://e349fd23c68f405388980d0868d0ff27@sentry.mvk.com/126",sampleRate:.01,whiteErrorCategoryList:[],blackErrorCategoryList:[],whiteErrorIdList:[],blackErrorIdList:[]},features:{autoplay:!0,statistics:!0,sentry:!0,preload:!0,subtitles:!0,episodes:!0,fullscreen:!0,timelinePreview:!0,mediaSession:!0,annotations:!0,pip:!0,dpip:!0,download:!0,liveRewind:!0,playbackRate:!0,trafficSaving:!0,episodesClustering:!0,copyVideoLink:!0,videoRotate:!0,interactiveGraph:!1,seekToInteractive:!0,interactiveLastFrame:!1,interactiveTextPermanent:!0,interactiveHideTime:!0,interactivePlayPrevChapter:!0,thumbTimer:!0,hotKeyMapModal:!0,hotKeyHelpers:!0,saveDebugInfoToFile:!1,additionalButtons:!0},controls:{hideTimeout:500,hideTimeoutMobile:3e3,hideTimeoutInitial:200,hideTimeoutFullscreen:3e3,hideTimeoutCursor:3e3,hideTimeoutTooltips:1e3,collapseMobileUnmute:6e3,hide360IconTimeout:3e3,hideHotKeyHelpers:2e3,playbackRateMin:.25,playbackRateMax:2,playbackRateStep:.25,volumeStepKeyboard:.05,volumeStepWheel:.05,volumeBarTimeout:300,seekStepKeyboard:1e4,seekStepMobile:15e3,seekStepFrame:400},ads:{enable:void 0,initTimeout:2e3,loadTimeout:2e3,slot:void 0,preview:void 0}},l0=i=>le.fillWithDefault(i,o0),s0=i=>Vl("ui-config",i),Ji=()=>Fl("ui-config"),Nl="vk_player_debug_panel_opened",D1=300,r0="videoplayer",a0="videoplayer";var je;(function(i){i.ArrowLeft="ArrowLeft",i.ArrowUp="ArrowUp",i.ArrowRight="ArrowRight",i.ArrowDown="ArrowDown",i.Comma="Comma",i.Period="Period",i.Space="Space",i.KeyM="KeyM",i.KeyF="KeyF",i.KeyK="KeyK",i.KeyL="KeyL",i.KeyJ="KeyJ",i.KeyC="KeyC",i.KeyI="KeyI",i.Digit1="Digit1",i.Digit2="Digit2",i.Digit3="Digit3",i.Digit4="Digit4",i.Digit5="Digit5",i.Digit6="Digit6",i.Digit7="Digit7",i.Digit8="Digit8",i.Digit9="Digit9",i.Digit0="Digit0",i.Numpad1="Numpad1",i.Numpad2="Numpad2",i.Numpad3="Numpad3",i.Numpad4="Numpad4",i.Numpad5="Numpad5",i.Numpad6="Numpad6",i.Numpad7="Numpad7",i.Numpad8="Numpad8",i.Numpad9="Numpad9",i.Numpad0="Numpad0",i.ShiftLeft="ShiftLeft",i.ShiftRight="ShiftRight",i.Slash="Slash"})(je||(je={}));const Yo={[je.KeyF]:"f",[je.KeyK]:"k",[je.KeyC]:"c",[je.KeyM]:"m"},u0=new Set([je.ArrowLeft,je.ArrowRight,je.KeyL,je.KeyJ]);var vt;(function(i){i.PLAY_BUTTON="PLAY_BUTTON",i.REPLAY_BUTTON="REPLAY_BUTTON",i.NEXT_BUTTON="NEXT_BUTTON",i.PREV_BUTTON="PREV_BUTTON",i.PICTURE_IN_PICTURE="PICTURE_IN_PICTURE",i.FULLSCREEN_BUTTON="FULLSCREEN_BUTTON",i.SETTINGS_BUTTON="SETTINGS_BUTTON",i.LIVE_BUTTON="LIVE_BUTTON",i.GRAPH_BUTTON="GRAPH_BUTTON",i.PLAY_PREV_CHAPTER_BUTTON="PLAY_PREV_CHAPTER_BUTTON",i.SEEK_TO_INTERACTIVE_BUTTON="SEEK_TO_INTERACTIVE_BUTTON",i.TIMELINE="TIMELINE",i.VOLUME_BAR="VOLUME_BAR",i.MUTE_BUTTON="MUTE_BUTTON",i.SUBTITLES_BUTTON="SUBTITLES_BUTTON",i.CHROMECAST_BUTTON="CHROMECAST_BUTTON",i.VK_BUTTON="VK_BUTTON",i.EPISODE_BUTTON="EPISODE_BUTTON",i.INCREMENT_PLAYBACK_RATE="INCREMENT_PLAYBACK_RATE",i.DECREMENT_PLAYBACK_RATE="DECREMENT_PLAYBACK_RATE"})(vt||(vt={}));const us=40,c0=4,f0=60,vo=8,F1=[vt.TIMELINE],Ho=[...F1,vt.GRAPH_BUTTON],cs=[...F1,vt.PLAY_BUTTON],H1=[...Ho,vt.PLAY_BUTTON];var to;(function(i){i[i.XS=320]="XS",i[i.S=509]="S",i[i.M=599]="M",i[i.L=699]="L"})(to||(to={}));exports.GridTypes=void 0;(function(i){i.XS="xs",i.S="s",i.M="m",i.L="l",i.XL="xl"})(exports.GridTypes||(exports.GridTypes={}));const ro={[exports.GridTypes.XS]:0,[exports.GridTypes.S]:1,[exports.GridTypes.M]:2,[exports.GridTypes.L]:3,[exports.GridTypes.XL]:4},Qn=[];function hn(i,e){return{subscribe:Ue(i,e).subscribe}}function Ue(i,e=K){let t;const n=new Set;function o(r){if(_e(i,r)&&(i=r,t)){const a=!Qn.length;for(const c of n)c[1](),Qn.push(c,i);if(a){for(let c=0;c<Qn.length;c+=2)Qn[c][0](Qn[c+1]);Qn.length=0}}}function l(r){o(r(i))}function s(r,a=K){const c=[r,a];return n.add(c),n.size===1&&(t=e(o,l)||K),r(i),()=>{n.delete(c),n.size===0&&t&&(t(),t=null)}}return{set:o,update:l,subscribe:s}}function ii(i,e,t){const n=!Array.isArray(i),o=n?[i]:i;if(!o.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const l=e.length<2;return hn(t,(s,r)=>{let a=!1;const c=[];let f=0,h=K;const p=()=>{if(f)return;h();const g=e(n?c[0]:c,s,r);l?s(g):h=Cn(g)?g:K},b=o.map((g,_)=>Zo(g,L=>{c[_]=L,f&=~(1<<_),a&&p()},()=>{f|=1<<_}));return a=!0,p(),function(){ni(b),h(),a=!1}})}const d0="prod",Qo="1.1.35-dev.b4e1f23a.0",U1=(i,e,t)=>{const n=document.createElement("a");n.href=i,n.download=`${e}.${t}`,n.style.display="none",n.click()},j1=Symbol("storeContext"),q1=Symbol("microStoresContext"),m0=(i,e)=>{Vl(j1,i),Vl(q1,e)},Et=()=>{const i=Fl(j1);return le.assertNonNullable(i,"Store context is empty!"),i},W1=()=>{const i=Fl(q1);return le.assertNonNullable(i,"MicroStores context is empty!"),i},St=(i,e)=>Z1(i,i.getValue(),e),Z1=(i,e,t)=>hn(e,n=>{const o=i.subscribe(l=>{n(l),t==null||t(l)});return()=>o.unsubscribe()}),h0=(i,e,t)=>{var n,o,l,s;const r=i.info,{width:a,height:c}=it(t.ui.playerSize),f=(o=(n=r.throughputEstimation$.getValue())===null||n===void 0?void 0:n.toFixed(0))!==null&&o!==void 0?o:0,h=(s=(l=r.rttEstimation$.getValue())===null||l===void 0?void 0:l.toFixed(0))!==null&&s!==void 0?s:0,p=r.isAutoQualityEnabled$.getValue()?"auto":"manual",b=`${Qo} (core: ${nt.VERSION}, stat: ${wt.VERSION}, shared: ${le.VERSION})`,g=it(t.state.errorLog$),_=g.length?`
7
7
  `+g.map((w,P)=>{var B;const N=`${P}) Type: ${w.id}
8
8
  `,U=`Message: ${w.message} (${w.thrown})
9
9
  `,Y=`Trace: ${(B=w.thrown)===null||B===void 0?void 0:B.stack}
@@ -48,4 +48,4 @@
48
48
  rgba(0, 0, 0, 0.99) 93.33%,
49
49
  #000 100%
50
50
  );--timeline-preview-shadow:rgba(0, 0, 0, 0.08);--timeline-preview-bg:rgba(34, 34, 34, 1);--mobile-settings-bg:#2C2D2E;--button-hover-transition:opacity 0.2s;--video-container-z-index:0;--rotate-transition-duration:0.25s;position:relative;width:100%;height:100%;color:var(--white);font-size:12px;line-height:normal;overflow:hidden;outline:0;user-select:none;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;background:var(--black)}button{border:none;margin:0;padding:0;width:auto;overflow:visible;background:transparent;color:inherit;font:inherit;line-height:normal;-webkit-font-smoothing:inherit;-moz-osx-font-smoothing:inherit;-webkit-appearance:none;cursor:pointer}svg{pointer-events:none}*:focus, *:focus-visible{outline:none}*:focus-visible{box-shadow:var(--focused-element-shadow)}.hidden{visibility:hidden;opacity:0}.overlay-container{pointer-events:none;top:0;left:0;height:100%;width:100%;position:fixed;z-index:10000}`)}function Dg(i){let e,t,n;function o(s){i[55](s)}let l={store:i[0],uiConfig:i[35],title:i[1],thumbUrl:i[2],videoLogoUrl:i[3],interactiveContainer:i[4],live:i[5],autoplay:i[6],canRewindLive:i[7],showAds:i[8],adsSlotId:i[9],adsParams:i[10],adsPreviewParam:i[11],duration:i[12],logoClickable:i[13],logoHidden:i[14],showNextPrevButtons:i[16],nextButtonActive:i[17],prevButtonActive:i[18],endScreenVideoTitle:i[19],endScreenVideoThumb:i[20],isOneVideoPlaylist:i[21],supportLink:i[22],outerContainerRef:i[23],fullScreenTarget:i[24],showMiniTimer:i[25],playerStarted:i[34],playNextVideo:i[26],playPrevVideo:i[27],repeatPlaylist:i[28],seekToInteractive:i[29],toggleGraph:i[30],playPrevChapter:i[31],firstStart:i[36]};return i[33]!==void 0&&(l.videoContainer=i[33]),e=new Cg({props:l}),We.push(()=>Tt(e,"videoContainer",o)),{c(){F(e.$$.fragment)},m(s,r){z(e,s,r),n=!0},p(s,r){const a={};r[0]&1&&(a.store=s[0]),r[0]&2&&(a.title=s[1]),r[0]&4&&(a.thumbUrl=s[2]),r[0]&8&&(a.videoLogoUrl=s[3]),r[0]&16&&(a.interactiveContainer=s[4]),r[0]&32&&(a.live=s[5]),r[0]&64&&(a.autoplay=s[6]),r[0]&128&&(a.canRewindLive=s[7]),r[0]&256&&(a.showAds=s[8]),r[0]&512&&(a.adsSlotId=s[9]),r[0]&1024&&(a.adsParams=s[10]),r[0]&2048&&(a.adsPreviewParam=s[11]),r[0]&4096&&(a.duration=s[12]),r[0]&8192&&(a.logoClickable=s[13]),r[0]&16384&&(a.logoHidden=s[14]),r[0]&65536&&(a.showNextPrevButtons=s[16]),r[0]&131072&&(a.nextButtonActive=s[17]),r[0]&262144&&(a.prevButtonActive=s[18]),r[0]&524288&&(a.endScreenVideoTitle=s[19]),r[0]&1048576&&(a.endScreenVideoThumb=s[20]),r[0]&2097152&&(a.isOneVideoPlaylist=s[21]),r[0]&4194304&&(a.supportLink=s[22]),r[0]&8388608&&(a.outerContainerRef=s[23]),r[0]&16777216&&(a.fullScreenTarget=s[24]),r[0]&33554432&&(a.showMiniTimer=s[25]),r[1]&8&&(a.playerStarted=s[34]),r[0]&67108864&&(a.playNextVideo=s[26]),r[0]&134217728&&(a.playPrevVideo=s[27]),r[0]&268435456&&(a.repeatPlaylist=s[28]),r[0]&536870912&&(a.seekToInteractive=s[29]),r[0]&1073741824&&(a.toggleGraph=s[30]),r[1]&1&&(a.playPrevChapter=s[31]),!t&&r[1]&4&&(t=!0,a.videoContainer=s[33],Ct(()=>t=!1)),e.$set(a)},i(s){n||(m(e.$$.fragment,s),n=!0)},o(s){v(e.$$.fragment,s),n=!1},d(s){D(e,s)}}}function Fg(i){let e,t,n;function o(s){i[54](s)}let l={store:i[0],uiConfig:i[35],thumbUrl:i[2],videoLogoUrl:i[3],interactiveContainer:i[4],live:i[5],autoplay:i[6],canRewindLive:i[7],showAds:i[8],adsSlotId:i[9],adsParams:i[10],adsPreviewParam:i[11],duration:i[12],logoClickable:i[13],logoHidden:i[14],showNextPrevButtons:i[16],nextButtonActive:i[17],prevButtonActive:i[18],endScreenVideoTitle:i[19],endScreenVideoThumb:i[20],isOneVideoPlaylist:i[21],supportLink:i[22],outerContainerRef:i[23],fullScreenTarget:i[24],showMiniTimer:i[25],playerStarted:i[34],playNextVideo:i[26],playPrevVideo:i[27],repeatPlaylist:i[28],seekToInteractive:i[29],toggleGraph:i[30],playPrevChapter:i[31],firstStart:i[36],seekTime:i[32]};return i[33]!==void 0&&(l.videoContainer=i[33]),e=new Og({props:l}),We.push(()=>Tt(e,"videoContainer",o)),{c(){F(e.$$.fragment)},m(s,r){z(e,s,r),n=!0},p(s,r){const a={};r[0]&1&&(a.store=s[0]),r[0]&4&&(a.thumbUrl=s[2]),r[0]&8&&(a.videoLogoUrl=s[3]),r[0]&16&&(a.interactiveContainer=s[4]),r[0]&32&&(a.live=s[5]),r[0]&64&&(a.autoplay=s[6]),r[0]&128&&(a.canRewindLive=s[7]),r[0]&256&&(a.showAds=s[8]),r[0]&512&&(a.adsSlotId=s[9]),r[0]&1024&&(a.adsParams=s[10]),r[0]&2048&&(a.adsPreviewParam=s[11]),r[0]&4096&&(a.duration=s[12]),r[0]&8192&&(a.logoClickable=s[13]),r[0]&16384&&(a.logoHidden=s[14]),r[0]&65536&&(a.showNextPrevButtons=s[16]),r[0]&131072&&(a.nextButtonActive=s[17]),r[0]&262144&&(a.prevButtonActive=s[18]),r[0]&524288&&(a.endScreenVideoTitle=s[19]),r[0]&1048576&&(a.endScreenVideoThumb=s[20]),r[0]&2097152&&(a.isOneVideoPlaylist=s[21]),r[0]&4194304&&(a.supportLink=s[22]),r[0]&8388608&&(a.outerContainerRef=s[23]),r[0]&16777216&&(a.fullScreenTarget=s[24]),r[0]&33554432&&(a.showMiniTimer=s[25]),r[1]&8&&(a.playerStarted=s[34]),r[0]&67108864&&(a.playNextVideo=s[26]),r[0]&134217728&&(a.playPrevVideo=s[27]),r[0]&268435456&&(a.repeatPlaylist=s[28]),r[0]&536870912&&(a.seekToInteractive=s[29]),r[0]&1073741824&&(a.toggleGraph=s[30]),r[1]&1&&(a.playPrevChapter=s[31]),!t&&r[1]&4&&(t=!0,a.videoContainer=s[33],Ct(()=>t=!1)),e.$set(a)},i(s){n||(m(e.$$.fragment,s),n=!0)},o(s){v(e.$$.fragment,s),n=!1},d(s){D(e,s)}}}function Hg(i){let e,t,n,o;const l=[Fg,Dg],s=[];function r(a,c){return a[15]?0:1}return t=r(i),n=s[t]=l[t](i),{c(){e=k("div"),n.c(),u(e,"class","root v-labq99")},m(a,c){S(a,e,c),s[t].m(e,null),o=!0},p(a,c){let f=t;t=r(a),t===f?s[t].p(a,c):(he(),v(s[f],1,1,()=>{s[f]=null}),pe(),n=s[t],n?n.p(a,c):(n=s[t]=l[t](a),n.c()),m(n,1),n.m(e,null))},i(a){o||(m(n),o=!0)},o(a){v(n),o=!1},d(a){a&&y(e),s[t].d()}}}function Ug(i,e,t){let{sources:n}=e,{store:o}=e,{microStoresRoot:l}=e,{uiConfig:s}=e,{title:r}=e,{thumbUrl:a}=e,{videoLogoUrl:c}=e,{interactiveContainer:f}=e,{subtitles:h}=e,{live:p}=e,{preload:b}=e,{autoplay:g}=e,{volume:_=void 0}=e,{muted:L=void 0}=e,{fromTime:E}=e,{canRewindLive:w}=e,{showAds:P}=e,{adsSlotId:B=void 0}=e,{adsParams:N=void 0}=e,{adsPreviewParam:U=void 0}=e,{duration:Y=void 0}=e,{logoClickable:W}=e,{logoHidden:ne}=e,{isMobile:X}=e,{showNextPrevButtons:ee=!1}=e,{nextButtonActive:T=!1}=e,{prevButtonActive:te=!1}=e,{endScreenVideoTitle:fe=void 0}=e,{endScreenVideoThumb:A=void 0}=e,{isOneVideoPlaylist:oe=!1}=e,{supportLink:ae}=e,{outerContainerRef:ke=void 0}=e,{fullScreenTarget:we=void 0}=e,{failoverHosts:Ee=void 0}=e,{showMiniTimer:Pe=!1}=e,{playNextVideo:H=le.noop}=e,{playPrevVideo:G=le.noop}=e,{repeatPlaylist:O=le.noop}=e,{seekToInteractive:ge=le.noop}=e,{toggleGraph:Q=le.noop}=e,{playPrevChapter:M=le.noop}=e;const{subscribers:J,stores:Me}=l;s0(s);const Te=Ji(),Le=o.ui.debugPanelVisible,x=o.ui.playerSize;let ue,ve=null,re=!1;o.getAdmanWrapper().init({switchFromAdsToVideo:o.actions.internal.switchFromAdsToVideo,switchFromVideoToAds:o.actions.internal.switchFromVideoToAds,setMuted:o.actions.external.setMuted},o.ads,{isMobile:o.ui.isMobile,mobileUnmuteButtonVisible:o.ui.mobileUnmuteButtonVisible,vsid:o.vsid}),m0(o,Me);const Fe=(ce=!1)=>{t(34,re=!0),ce?o.actions.external.firstStart(P):o.actions.internal.firstStart(P)};function He(ce){var xe;const Xe=n||ce;Xe&&o.initVideo({container:ue,sources:Xe,failoverHosts:Ee,subtitles:h});const $e=le.safeStorage.get(Nl)==="true";Le.set($e),E>0&&o.actions.external.seekTime(E);const Je=X?Te.volumeDefault:(xe=_!=null?_:X1())!=null?xe:Te.volumeDefault,Ze=L!=null?L:_0();if(o.actions.external.setVolume(Je),o.actions.external.setMuted(Ze),o.getAdmanWrapper().setInitialVolume(Ze?0:Je),Te.features.trafficSaving){const st=k0();st&&o.actions.internal.setTrafficSavingEnabled(st)}const dt=b0(o.videoId);dt&&o.actions.internal.setQuality(dt),o.ui.isAutoplay.set(g),g?Fe():b&&Te.features.preload&&o.actions.internal.preload()}const rt=ce=>{if(window.ResizeObserver){let Xe,$e;ve=new ResizeObserver(le.debounceFn(Je=>{const Ze=Je[0];if(Ze){if(Ze.contentBoxSize){const dt=Array.isArray(Ze.contentBoxSize)?Ze.contentBoxSize[0]:Ze.contentBoxSize;Xe=dt.inlineSize,$e=dt.blockSize}else Ze.contentRect&&(Xe=Ze.contentRect.width,$e=Ze.contentRect.height);x.set({width:Xe,height:$e})}},D1)),ve.observe(ce)}x.set({width:ce.clientWidth,height:ce.clientHeight})};Xi(()=>{rt(ue);const ce=J.map($e=>$e.init(o,Me));if((p==null?void 0:p.status)==="upcoming"||(p==null?void 0:p.status)==="waiting"){o.actions.internal.setWaitingLive(!0);return}if(((p==null?void 0:p.status)==="finished"||(p==null?void 0:p.status)==="postlive")&&!Object.keys(n||[]).length){o.actions.internal.setWaitingRecord(!0);return}return He(),()=>{ve==null||ve.disconnect(),ce.forEach($e=>$e.unsubscribe()),o.destroy()}});function lt(){re?o.actions.external.play():Fe(!0)}function ze(){o.actions.external.pause()}function mt(ce){X||o.actions.external.setMuted(ce)}function kt(ce){X||ce>=0&&ce<=1&&o.actions.external.setVolume(ce)}function Re(ce){o.actions.internal.seekTime(ce,wt.SeekAction.UNKNOWN)}function Ne(ce){o.actions.external.seekEpisodeStartTime(ce)}function Wt(ce){o.actions.external.setPlaybackRate(ce)}function At(ce){o.actions.external.setAutoQualityLimits(ce)}function ut(ce){ue=ce,t(33,ue)}function et(ce){ue=ce,t(33,ue)}return i.$$set=ce=>{"sources"in ce&&t(37,n=ce.sources),"store"in ce&&t(0,o=ce.store),"microStoresRoot"in ce&&t(38,l=ce.microStoresRoot),"uiConfig"in ce&&t(39,s=ce.uiConfig),"title"in ce&&t(1,r=ce.title),"thumbUrl"in ce&&t(2,a=ce.thumbUrl),"videoLogoUrl"in ce&&t(3,c=ce.videoLogoUrl),"interactiveContainer"in ce&&t(4,f=ce.interactiveContainer),"subtitles"in ce&&t(40,h=ce.subtitles),"live"in ce&&t(5,p=ce.live),"preload"in ce&&t(41,b=ce.preload),"autoplay"in ce&&t(6,g=ce.autoplay),"volume"in ce&&t(42,_=ce.volume),"muted"in ce&&t(43,L=ce.muted),"fromTime"in ce&&t(44,E=ce.fromTime),"canRewindLive"in ce&&t(7,w=ce.canRewindLive),"showAds"in ce&&t(8,P=ce.showAds),"adsSlotId"in ce&&t(9,B=ce.adsSlotId),"adsParams"in ce&&t(10,N=ce.adsParams),"adsPreviewParam"in ce&&t(11,U=ce.adsPreviewParam),"duration"in ce&&t(12,Y=ce.duration),"logoClickable"in ce&&t(13,W=ce.logoClickable),"logoHidden"in ce&&t(14,ne=ce.logoHidden),"isMobile"in ce&&t(15,X=ce.isMobile),"showNextPrevButtons"in ce&&t(16,ee=ce.showNextPrevButtons),"nextButtonActive"in ce&&t(17,T=ce.nextButtonActive),"prevButtonActive"in ce&&t(18,te=ce.prevButtonActive),"endScreenVideoTitle"in ce&&t(19,fe=ce.endScreenVideoTitle),"endScreenVideoThumb"in ce&&t(20,A=ce.endScreenVideoThumb),"isOneVideoPlaylist"in ce&&t(21,oe=ce.isOneVideoPlaylist),"supportLink"in ce&&t(22,ae=ce.supportLink),"outerContainerRef"in ce&&t(23,ke=ce.outerContainerRef),"fullScreenTarget"in ce&&t(24,we=ce.fullScreenTarget),"failoverHosts"in ce&&t(45,Ee=ce.failoverHosts),"showMiniTimer"in ce&&t(25,Pe=ce.showMiniTimer),"playNextVideo"in ce&&t(26,H=ce.playNextVideo),"playPrevVideo"in ce&&t(27,G=ce.playPrevVideo),"repeatPlaylist"in ce&&t(28,O=ce.repeatPlaylist),"seekToInteractive"in ce&&t(29,ge=ce.seekToInteractive),"toggleGraph"in ce&&t(30,Q=ce.toggleGraph),"playPrevChapter"in ce&&t(31,M=ce.playPrevChapter)},i.$$.update=()=>{i.$$.dirty[0]&32769&&o.ui.isMobile.set(X)},[o,r,a,c,f,p,g,w,P,B,N,U,Y,W,ne,X,ee,T,te,fe,A,oe,ae,ke,we,Pe,H,G,O,ge,Q,M,Re,ue,re,Te,Fe,n,l,s,h,b,_,L,E,Ee,He,lt,ze,mt,kt,Ne,Wt,At,ut,et]}class jg extends Se{constructor(e){super(),ye(this,e,Ug,Hg,_e,{sources:37,store:0,microStoresRoot:38,uiConfig:39,title:1,thumbUrl:2,videoLogoUrl:3,interactiveContainer:4,subtitles:40,live:5,preload:41,autoplay:6,volume:42,muted:43,fromTime:44,canRewindLive:7,showAds:8,adsSlotId:9,adsParams:10,adsPreviewParam:11,duration:12,logoClickable:13,logoHidden:14,isMobile:15,showNextPrevButtons:16,nextButtonActive:17,prevButtonActive:18,endScreenVideoTitle:19,endScreenVideoThumb:20,isOneVideoPlaylist:21,supportLink:22,outerContainerRef:23,fullScreenTarget:24,failoverHosts:45,showMiniTimer:25,playNextVideo:26,playPrevVideo:27,repeatPlaylist:28,seekToInteractive:29,toggleGraph:30,playPrevChapter:31,initVideo:46,play:47,pause:48,setMuted:49,setVolume:50,seekTime:32,seekEpisodeStartTime:51,setPlaybackRate:52,setAutoQualityLimits:53},zg,[-1,-1])}get initVideo(){return this.$$.ctx[46]}get play(){return this.$$.ctx[47]}get pause(){return this.$$.ctx[48]}get setMuted(){return this.$$.ctx[49]}get setVolume(){return this.$$.ctx[50]}get seekTime(){return this.$$.ctx[32]}get seekEpisodeStartTime(){return this.$$.ctx[51]}get setPlaybackRate(){return this.$$.ctx[52]}get setAutoQualityLimits(){return this.$$.ctx[53]}}function qg(i){let e,t;return{c(){e=I("svg"),t=I("path"),u(t,"fill",i[0]),u(t,"d","M38.245 6c3.566 0 4.859.371 6.162 1.069a7.27 7.27 0 0 1 3.025 3.024c.697 1.303 1.068 2.597 1.068 6.163v23.489c0 3.566-.371 4.859-1.069 6.162a7.27 7.27 0 0 1-3.024 3.025C43.104 49.629 41.811 50 38.245 50h-19.49c-3.565 0-4.859-.371-6.162-1.069a7.27 7.27 0 0 1-3.024-3.024C8.87 44.604 8.5 43.311 8.5 39.745v-23.49c0-3.565.371-4.859 1.069-6.162a7.27 7.27 0 0 1 3.024-3.024C13.896 6.37 15.19 6 18.756 6h19.489zm.314 3H18.756c-2.799 0-3.761.186-4.749.714a4.27 4.27 0 0 0-1.793 1.793c-.508.95-.7 1.876-.713 4.434L11.5 39.744c0 2.799.186 3.761.714 4.749a4.27 4.27 0 0 0 1.793 1.793c.988.528 1.95.714 4.749.714h19.489c2.798 0 3.76-.186 4.748-.714a4.27 4.27 0 0 0 1.793-1.793c.528-.988.714-1.95.714-4.748v-23.49c0-2.798-.186-3.76-.714-4.748a4.27 4.27 0 0 0-1.793-1.793c-.95-.508-1.876-.7-4.434-.713zM19.22 38c.445 0 .607.046.77.134a.91.91 0 0 1 .377.378c.088.163.134.324.134.77v1.436c0 .446-.046.607-.134.77a.908.908 0 0 1-.378.378c-.162.088-.324.134-.77.134h-1.436c-.446 0-.608-.046-.77-.134a.908.908 0 0 1-.378-.378c-.088-.163-.134-.324-.134-.77v-1.436c0-.446.046-.607.134-.77a.908.908 0 0 1 .378-.378c.162-.088.324-.134.77-.134h1.436zm20 0c.445 0 .606.046.77.134a.91.91 0 0 1 .377.378c.088.163.134.324.134.77v1.436c0 .446-.046.607-.134.77a.908.908 0 0 1-.378.378c-.163.088-.324.134-.77.134h-1.436c-.446 0-.607-.046-.77-.134a.908.908 0 0 1-.378-.378c-.088-.163-.134-.324-.134-.77v-1.436c0-.446.046-.607.134-.77a.908.908 0 0 1 .378-.378c.163-.088.324-.134.77-.134h1.436zm-20-8c.445 0 .607.046.77.134a.91.91 0 0 1 .377.378c.088.162.134.324.134.77v1.436c0 .446-.046.607-.134.77a.908.908 0 0 1-.378.378c-.162.088-.324.134-.77.134h-1.436c-.446 0-.608-.046-.77-.134a.908.908 0 0 1-.378-.378c-.088-.163-.134-.324-.134-.77v-1.436c0-.446.046-.608.134-.77a.908.908 0 0 1 .378-.378c.162-.088.324-.134.77-.134h1.436zm20 0c.445 0 .606.046.77.134a.91.91 0 0 1 .377.378c.088.162.134.324.134.77v1.436c0 .446-.046.607-.134.77a.908.908 0 0 1-.378.378c-.163.088-.324.134-.77.134h-1.436c-.446 0-.607-.046-.77-.134a.908.908 0 0 1-.378-.378c-.088-.163-.134-.324-.134-.77v-1.436c0-.446.046-.608.134-.77a.908.908 0 0 1 .378-.378c.163-.088.324-.134.77-.134h1.436zm-20-8c.445 0 .607.046.77.134a.91.91 0 0 1 .377.378c.088.162.134.324.134.77v1.436c0 .446-.046.608-.134.77a.908.908 0 0 1-.378.378c-.162.088-.324.134-.77.134h-1.436c-.446 0-.608-.046-.77-.134a.908.908 0 0 1-.378-.378c-.088-.162-.134-.324-.134-.77v-1.436c0-.446.046-.608.134-.77a.908.908 0 0 1 .378-.378c.162-.088.324-.134.77-.134h1.436zm20 0c.445 0 .606.046.77.134a.91.91 0 0 1 .377.378c.088.162.134.324.134.77v1.436c0 .446-.046.608-.134.77a.908.908 0 0 1-.378.378c-.163.088-.324.134-.77.134h-1.436c-.446 0-.607-.046-.77-.134a.908.908 0 0 1-.378-.378c-.088-.162-.134-.324-.134-.77v-1.436c0-.446.046-.608.134-.77a.908.908 0 0 1 .378-.378c.163-.088.324-.134.77-.134h1.436zm-20-8c.445 0 .607.046.77.134a.91.91 0 0 1 .377.378c.088.162.134.324.134.77v1.436c0 .446-.046.608-.134.77a.908.908 0 0 1-.378.378c-.162.088-.324.134-.77.134h-1.436c-.446 0-.608-.046-.77-.134a.908.908 0 0 1-.378-.378c-.088-.162-.134-.324-.134-.77v-1.436c0-.446.046-.607.134-.77a.908.908 0 0 1 .378-.378c.162-.088.324-.134.77-.134h1.436zm20 0c.445 0 .606.046.77.134a.91.91 0 0 1 .377.378c.088.162.134.324.134.77v1.436c0 .446-.046.608-.134.77a.908.908 0 0 1-.378.378c-.163.088-.324.134-.77.134h-1.436c-.446 0-.607-.046-.77-.134a.908.908 0 0 1-.378-.378c-.088-.162-.134-.324-.134-.77v-1.436c0-.446.046-.607.134-.77a.908.908 0 0 1 .378-.378c.163-.088.324-.134.77-.134h1.436z"),u(e,"width","57"),u(e,"height","60"),u(e,"fill","none"),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"aria-hidden","true"),u(e,"data-testid","stub-icon")},m(n,o){S(n,e,o),d(e,t)},p(n,[o]){o&1&&u(t,"fill",n[0])},i:K,o:K,d(n){n&&y(e)}}}function Wg(i,e,t){let{isWhite:n=!1}=e,o;return i.$$set=l=>{"isWhite"in l&&t(1,n=l.isWhite)},i.$$.update=()=>{i.$$.dirty&2&&t(0,o=n?"#fff":"#909499")},[o,n]}class Zg extends Se{constructor(e){super(),ye(this,e,Wg,qg,_e,{isWhite:1})}}function Gg(i){qe(i,"v-1y9fytq",".playerStub.v-1y9fytq{width:100%;height:100%;background-color:#222;display:flex;justify-content:center;align-items:center;position:relative;background-position:center;background-size:cover;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif}.title.v-1y9fytq{position:absolute;left:0;top:0;width:100%;font-size:15px;color:#fff;box-sizing:border-box;padding:18px 20px 10px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}")}function E1(i){let e,t;return{c(){e=k("div"),t=De(i[0]),u(e,"class","title v-1y9fytq")},m(n,o){S(n,e,o),d(e,t)},p(n,o){o&1&&ot(t,n[0])},d(n){n&&y(e)}}}function A1(i){let e,t;return e=new Zg({props:{isWhite:!!i[1]}}),{c(){F(e.$$.fragment)},m(n,o){z(e,n,o),t=!0},p(n,o){const l={};o&2&&(l.isWhite=!!n[1]),e.$set(l)},i(n){t||(m(e.$$.fragment,n),t=!0)},o(n){v(e.$$.fragment,n),t=!1},d(n){D(e,n)}}}function Kg(i){let e,t,n,o,l=i[0]&&E1(i),s=(!i[0]||!i[1])&&A1(i);return{c(){e=k("div"),l&&l.c(),t=R(),s&&s.c(),u(e,"class","playerStub v-1y9fytq"),u(e,"style",n=i[1]?`background-image: url('${i[1]}')`:"")},m(r,a){S(r,e,a),l&&l.m(e,null),d(e,t),s&&s.m(e,null),o=!0},p(r,[a]){r[0]?l?l.p(r,a):(l=E1(r),l.c(),l.m(e,t)):l&&(l.d(1),l=null),!r[0]||!r[1]?s?(s.p(r,a),a&3&&m(s,1)):(s=A1(r),s.c(),m(s,1),s.m(e,null)):s&&(he(),v(s,1,1,()=>{s=null}),pe()),(!o||a&2&&n!==(n=r[1]?`background-image: url('${r[1]}')`:""))&&u(e,"style",n)},i(r){o||(m(s),o=!0)},o(r){v(s),o=!1},d(r){r&&y(e),l&&l.d(),s&&s.d()}}}function Yg(i,e,t){let{title:n}=e,{thumbUrl:o}=e;return i.$$set=l=>{"title"in l&&t(0,n=l.title),"thumbUrl"in l&&t(1,o=l.thumbUrl)},[n,o]}class Qg extends Se{constructor(e){super(),ye(this,e,Yg,Kg,_e,{title:0,thumbUrl:1},Gg)}}class L1{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(e,t,n){e in this.listeners||(this.listeners[e]=[]),this.listeners[e].push({callback:t,options:n})}removeEventListener(e,t){if(!(e in this.listeners))return;const n=this.listeners[e];for(let o=0,l=n.length;o<l;o++)if(n[o].callback===t){n.splice(o,1);return}}dispatchEvent(e){if(!(e.type in this.listeners))return;const n=this.listeners[e.type].slice();for(let o=0,l=n.length;o<l;o++){const s=n[o];try{s.callback.call(this,e)}catch(r){Promise.resolve().then(()=>{throw r})}s.options&&s.options.once&&this.removeEventListener(e.type,s.callback)}return!e.defaultPrevented}}class Ec extends L1{constructor(){super(),this.listeners||L1.call(this),Object.defineProperty(this,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(this,"reason",{value:void 0,writable:!0,configurable:!0})}toString(){return"[object AbortSignal]"}dispatchEvent(e){e.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,e)),super.dispatchEvent(e)}}let Xg=class{constructor(){Object.defineProperty(this,"signal",{value:new Ec,writable:!0,configurable:!0})}abort(e){let t;try{t=new Event("abort")}catch(o){typeof document!="undefined"?document.createEvent?(t=document.createEvent("Event"),t.initEvent("abort",!1,!1)):(t=document.createEventObject(),t.type="abort"):t={type:"abort",bubbles:!1,cancelable:!1}}let n=e;if(n===void 0)if(typeof document=="undefined")n=new Error("This operation was aborted"),n.name="AbortError";else try{n=new DOMException("signal is aborted without reason")}catch(o){n=new Error("This operation was aborted"),n.name="AbortError"}this.signal.reason=n,this.signal.dispatchEvent(t)}toString(){return"[object AbortController]"}};typeof Symbol!="undefined"&&Symbol.toStringTag&&(Xg.prototype[Symbol.toStringTag]="AbortController",Ec.prototype[Symbol.toStringTag]="AbortSignal");function Ac(i){return i.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof i.Request=="function"&&!i.Request.prototype.hasOwnProperty("signal")||!i.AbortController}function Jg(i){typeof i=="function"&&(i={fetch:i});const{fetch:e,Request:t=e.Request,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o=!1}=i;if(!Ac({fetch:e,Request:t,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o}))return{fetch:e,Request:l};let l=t;(l&&!l.prototype.hasOwnProperty("signal")||o)&&(l=function(c,f){let h;f&&f.signal&&(h=f.signal,delete f.signal);const p=new t(c,f);return h&&Object.defineProperty(p,"signal",{writable:!1,enumerable:!1,configurable:!0,value:h}),p},l.prototype=t.prototype);const s=e;return{fetch:(a,c)=>{const f=l&&l.prototype.isPrototypeOf(a)?a.signal:c?c.signal:void 0;if(f){let h;try{h=new DOMException("Aborted","AbortError")}catch(b){h=new Error("Aborted"),h.name="AbortError"}if(f.aborted)return Promise.reject(h);const p=new Promise((b,g)=>{f.addEventListener("abort",()=>g(h),{once:!0})});return c&&c.signal&&delete c.signal,Promise.race([p,s(a,c)])}return s(a,c)},Request:l}}const $l=Ac({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),Lc=$l?Jg({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,xg=$l?Lc.fetch:window.fetch;$l?Lc.Request:window.Request;const $g=(i,e)=>i<400||e<225?5:i<640||e<360?0:i<960||e<540?1:i<1280||e<720?2:3,e6="//ad.mail.ru/static/admanhtml/rbadman-html5.min.js";class t6{constructor(e,t){this.adman=null,this.initialVolume=1,this.videoElement=null,this.currentAdSection=null,this.actions=null,this.adsState=null,this.playerState=null,this.events={slotRequested$:new le.Subject,started$:new le.Subject,paused$:new le.Subject,resumed$:new le.Subject,ended$:new le.Subject,skipped$:new le.Subject,clicked$:new le.Subject},this.loadAdman=n=>new Promise((o,l)=>{let s;const r=()=>{clearTimeout(s),delete window.admanAsyncInit,window.AdmanHTML?o():l()};le.addScript(e6,n,this.loadTimeout).then(()=>{window.AdmanHTML?o():(window.admanAsyncInit=r,s=window.setTimeout(r,this.initTimeout))}).catch(()=>{l()})}),this.onAdsReady=()=>{this.log({message:"ads ready"}),this.startPreroll()},this.onAdStarted=(n,o)=>{le.assertNonNullable(this.adsState),le.assertNonNullable(this.playerState),le.assertNonNullable(this.actions),this.log({message:`ad started, section: ${n}, banner: ${JSON.stringify(o)}`}),this.events.started$.next(n),o.muted&&(this.setVolume(0),this.actions.setMuted(!0),this.log({message:"ad muted start"}),it(this.playerState.isMobile)&&this.playerState.mobileUnmuteButtonVisible.set(!0)),this.adsState.duration.set(o.duration),this.adsState.playbackState.set(Qt.PLAYING),this.adsState.canSkip.set(o.allowClose),this.adsState.secondsToWatchBeforeSkip.set(o.allowCloseDelay)},this.onAdTimeRemained=({currentTime:n})=>{le.assertNonNullable(this.adsState),this.adsState.position.set(n)},this.onAdPaused=()=>{le.assertNonNullable(this.adsState),this.log({message:"ad paused"}),this.adsState.playbackState.set(Qt.PAUSED)},this.onAdPlayed=()=>{le.assertNonNullable(this.adsState),this.log({message:"ad played"}),this.adsState.playbackState.set(Qt.PLAYING)},this.onAdMidrollPoint=()=>{le.assertNonNullable(this.adman),le.assertNonNullable(this.actions),this.log({message:"midroll point"}),this.actions.switchFromVideoToAds(),this.currentAdSection=kn.Midroll,this.adman.start(kn.Midroll)},this.onAdSkipped=()=>{this.log({message:"ad skipped"}),this.switchToVideo()},this.onAdClosed=()=>{this.log({message:"ad closed"}),this.switchToVideo()},this.onAdCompleted=()=>{this.log({message:"ad completed"}),this.events.ended$.next(),this.switchToVideo()},this.onAdClicked=()=>{var n;this.log({message:"ad clicked"}),(n=this.videoElement)===null||n===void 0||n.pause(),this.events.clicked$.next()},this.onAdError=()=>{this.log({message:"ad error"}),this.switchToVideo(!0)},this.log=e.createComponentLog("AdmanWrapper"),this.loadTimeout=t.loadTimeout,this.initTimeout=t.initTimeout}init(e,t,n){this.actions=e,this.adsState=t,this.playerState=n}onAdmanLoadingError(){this.log({message:"adman loading error"}),this.switchToVideo(!0)}initAdman(e){const{width:t,height:n,isFullscreen:o,isAutoplay:l,adsContainer:s,adsVideoElement:r,slotId:a,params:c={},duration:f,previewParam:h}=e;let p;const b=this.playerState&&it(this.playerState.vsid);b&&(p=parseInt(b,36));const g=Object.assign(Object.assign(Object.assign({dl:encodeURIComponent(window.location.href),autoplay:l,player_width:t,player_height:n,puid10:$g(t,n),puid11:o?0:1,preview:h},p?{request_id:p}:{}),{duration:f}),c),_={slot:a,wrapper:s,videoEl:r,videoQuality:n,params:g,browser:{mobile:!1}},L=new window.AdmanHTML;L.setDebug(!1),L.onReady(this.onAdsReady),L.onStarted(this.onAdStarted),L.onPlayed(this.onAdPlayed),L.onPaused(this.onAdPaused),L.adMidrollPoint(this.onAdMidrollPoint),L.onClosed(this.onAdClosed),L.onSkipped(this.onAdSkipped),L.onClicked(this.onAdClicked),L.onTimeRemained(this.onAdTimeRemained),L.onCompleted(this.onAdCompleted),L.onError(this.onAdError),L.init(_),this.adman=L,this.videoElement=r,this.events.slotRequested$.next(),this.log({message:`adman init, config: ${JSON.stringify(_)}`})}switchToVideo(e=!1){if(this.currentAdSection===null&&!e){this.log({message:"switch to video, no currentAdSection. can't switch"});return}le.assertNonNullable(this.actions),le.assertNonNullable(this.adsState),le.assertNonNullable(this.playerState);const t=this.currentAdSection===kn.Postroll;this.adsState.playbackState.set(Qt.INACTIVE),this.currentAdSection=null,this.playerState.mobileUnmuteButtonVisible.set(!1),this.log({message:`switch to video, isPostroll: ${t}`}),t&&(this.adsState.postrollPassed.set(!0),this.log({message:"postroll passed"})),this.actions.switchFromAdsToVideo(!t)}togglePlay(){le.assertNonNullable(this.adsState),this.log({message:"toggle play"});const e=it(this.adsState.playbackState);e===Qt.PLAYING?this.pause():e===Qt.PAUSED&&this.play()}setInitialVolume(e){this.log({message:`set initial volume ${e}`}),this.initialVolume=e}setVolume(e){var t;this.log({message:`set volume ${e}`}),(t=this.adman)===null||t===void 0||t.setVolume(e),this.videoElement&&(this.videoElement.volume=e)}setFullscreen(e){var t;this.log({message:`set fullscreen ${e}`}),(t=this.adman)===null||t===void 0||t.setFullscreen(e)}startPreroll(){le.assertNonNullable(this.adman),this.log({message:"start preroll"}),this.setVolume(this.initialVolume),this.currentAdSection=kn.Preroll,this.adman.start(kn.Preroll)}startPostroll(){le.assertNonNullable(this.adman),le.assertNonNullable(this.actions),this.log({message:"start postroll"}),this.actions.switchFromVideoToAds(),this.currentAdSection=kn.Postroll,this.adman.start(kn.Postroll)}play(){le.assertNonNullable(this.adman),this.log({message:"ad play"}),this.adman.resume(),this.events.resumed$.next()}pause(){le.assertNonNullable(this.adman),this.log({message:"ad pause"}),this.adman.pause(),this.events.paused$.next()}skip(){le.assertNonNullable(this.adman),this.log({message:"ad skip"}),this.adman.skip(),this.events.skipped$.next()}setPosition(e,t){var n;(n=this.adman)===null||n===void 0||n.setPosition(Math.floor(e),Math.floor(t))}destroy(){var e;this.log({message:"destroy"}),(e=this.adman)===null||e===void 0||e.destroy()}}const i6=i=>{const e=Math.round(i);return isNaN(e)||e<40?"":e>=40&&e<55?50:e>=55&&e<90?60:e>=90&&e<180?120:e>=180?240:""};class n6{constructor(){this.oneLineRegExp=/\r\n|\n|\r/,this.twoLinesRegExp=/\r\n\r\n|\n\n|\r\r/}parse(e){const t=[],n=e.split(this.twoLinesRegExp);for(const o of n){const l={startTime:0,endTime:0,texts:[],lang:""},s=o.split(this.oneLineRegExp);for(const r of s)if(!l.startTime&&!l.endTime){const a=new Vc,{startTime:c,endTime:f}=a.parse(r);l.startTime=c,l.endTime=f}else if(r.trim()!==""){const a=new o6,{texts:c}=a.parse(r);l.texts=[...l.texts,...c]}(l.startTime||l.endTime)&&l.texts.length>0&&t.push(l)}return t}}class Vc{constructor(){this.timeRegExp=/(\d{2})?:?(\d{2}):(\d{2}).(\d{2,3})/,this.timingRegExp=new RegExp(`${this.timeRegExp.source}( ?--> ?)${this.timeRegExp.source}`)}parse(e){const t={startTime:0,endTime:0},n=this.timingRegExp.exec(e);return n&&(t.startTime=this.calcTime(n[1],n[2],n[3],n[4]),t.endTime=this.calcTime(n[6],n[7],n[8],n[9])),t}parseTime(e){const t=this.timeRegExp.exec(e);return t?this.calcTime(t[1],t[2],t[3],t[4]):0}isTime(e){return this.timeRegExp.test(e)}calcTime(e="0",t="0",n="0",o="0"){const l=Number(e)*60*60,s=Number(t)*60,r=Number(n),a=+`0.${o}`;return l+s+r+a}}class o6{constructor(){this.letterTagRegExp=/<[a-z]*>|<\/[a-z]*>/}parse(e){const t={texts:[]},o=e.replace(new RegExp(this.letterTagRegExp,"g"),"").split({[Symbol.split](s){let r=0;const a=[];for(;r<s.length;){const c=["<",">"].reduce((f,h)=>{const p=s.indexOf(h,r);return f===-1||f>p?p:f},-1);if(c===-1){a.push(s.substring(r));break}a.push(s.substring(r,c)),r=c+1}return a}}),l=new Vc;for(const s of o)l.isTime(s)?t.texts.push({type:"timestamp",value:l.parseTime(s)}):t.texts.push({type:"text",value:s});return t}}let Nn,Dt,Tl=0,El=!1;const l6=(i,e,t)=>{var n;const o=i>=Tl,l=i<Tl,s=(f,h=0,p=0)=>f<h&&f<p,r=(f,h=0,p=0)=>f>=h&&f<=p,a=(f,h=0,p=0)=>f>h&&f>p,c=(n=t.find(({lang:f})=>f===e.value))===null||n===void 0?void 0:n.subtitles;if(Tl=i,l&&(El=!1),le.isNonNullable(Nn)&&r(i,Nn.startTime,Nn.endTime)&&Nn.lang===e.value)return Nn;if(!le.isNonNullable(Dt)&&(c!=null&&c.length)&&!El){const f=c.find(({startTime:h,endTime:p})=>r(i,h,p)||o&&s(i,h,p));Dt=f&&Object.assign(Object.assign({},f),{lang:e.value}),Nn=void 0,!le.isNonNullable(Dt)&&c[c.length-1].endTime<i&&(El=!0);return}else{if(r(i,Dt==null?void 0:Dt.startTime,Dt==null?void 0:Dt.endTime))return Nn=Dt,Dt=void 0,Nn;(o&&a(i,Dt==null?void 0:Dt.startTime,Dt==null?void 0:Dt.endTime)||l&&s(i,Dt==null?void 0:Dt.startTime,Dt==null?void 0:Dt.endTime))&&(Dt=void 0)}},Al={ru:"\u0420\u0443\u0441\u0441\u043A\u0438\u0439",en:"English",uk:"\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430",be:"\u0411\u0435\u043B\u0430\u0440\u0443\u0441\u043A\u0430\u044F (\u0442\u0430\u0440\u0430\u0448\u043A\u0435\u0432i\u0446\u0430)",es:"Espa\xF1ol",fi:"Suomi",de:"Deutsch",it:"Italiano",bg:"\u0411\u044A\u043B\u0433\u0430\u0440\u0441\u043A\u0438",hr:"Hrvatski",hu:"Magyar",sr:"\u0421\u0440\u043F\u0441\u043A\u0438","pt-PT":"Portugu\xEAs",el:"\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AC",pl:"Polski",fr:"Fran\xE7ais",ko:"\uD55C\uAD6D\uC5B4","zh-CN":"\u6C49\u8BED",lt:"Lietuvi\u0173",ja:"\u65E5\u672C\u8A9E",cs:"\u010Ce\u0161tina",et:"Eesti",tt:"\u0422\u0430\u0442\u0430\u0440\u0447\u0430",ba:"\u0411\u0430\u0448\u04A1\u043E\u0440\u0442\u0441\u0430",cv:"\u0427\u0103\u0432\u0430\u0448\u043B\u0430",sk:"Sloven\u010Dina",ro:"Rom\xE2n\u0103",no:"Norsk",lv:"Latvie\u0161u",az:"Az\u0259rbaycan dili",hy:"\u0540\u0561\u0575\u0565\u0580\u0565\u0576",sv:"Svenska",nl:"Nederlands",tk:"T\xFCrkmen",ka:"\u10E5\u10D0\u10E0\u10D7\u10E3\u10DA\u10D8",da:"Dansk",uz:"O\u2018zbek",th:"\u0E20\u0E32\u0E29\u0E32\u0E44\u0E17\u0E22",id:"Bahasa Indonesia",tg:"\u0422\u043E\u04B7\u0438\u043A\u04E3",sl:"Sloven\u0161\u010Dina",bs:"Bosanski","pt-BR":"Portugu\xEAs brasileiro",fa:"\u0641\u0627\u0631\u0633\u06CC",vi:"Ti\u1EBFng Vi\u1EC7t",hi:"\u0939\u093F\u0928\u094D\u0926\u0940",si:"\u0DC3\u0DD2\u0D82\u0DC4\u0DBD",bn:"\u09AC\u09BE\u0982\u09B2\u09BE",tl:"Tagalog",mn:"\u041C\u043E\u043D\u0433\u043E\u043B",my:"\u1017\u1019\u102C\u1005\u102C",tr:"T\xFCrk\xE7e",ne:"\u0928\u0947\u092A\u093E\u0932\u0940",ur:"\u0627\u0631\u062F\u0648",ky:"\u041A\u044B\u0440\u0433\u044B\u0437 \u0442\u0438\u043B\u0438",pa:"\u067E\u0646\u062C\u0627\u0628\u06CC",os:"\u0418\u0440\u043E\u043D",kn:"\u0C95\u0CA8\u0CCD\u0CA8\u0CA1",sw:"Kiswahili",kk:"\u049A\u0430\u0437\u0430\u049B\u0448\u0430",ar:"\u0627\u0644\u0639\u0631\u0628\u064A\u0629",he:"\u05E2\u05D1\u05E8\u05D9\u05EA",ab:"\u0410\u04A7\u0441\u0448\u04D9\u0430",eu:"Euskara",eo:"Esperanto"};let Do=null;class go{constructor(e,t){if(!Do){const n=new wt.OneStat(e,t),o=new le.Subscription;Do=Object.freeze({oneStat:n,statSubscription:o,destroy:()=>{n==null||n.destroy(),o==null||o.unsubscribe(),Do=null}})}}static getInstance(){return Do}}const s6=({interfaceLanguage:i,videoId:e,isClip:t,isLiveCatchUpMode:n,statAuthToken:o,isAudioDisabled:l,canDownload:s,callbacks:r,webApi:a,videoEpisodes:c,previewThumbsData:f,uiConfig:h,coreConfig:p,player:b,disabledControls:g,isInteractive:_,interactiveRanges:L,replayInteractive:E,hasInteractiveBranches:w,playPrevChapterDisabledTooltip:P,additionalButtons:B,looped:N=!1})=>{var U,Y,W,ne;const X=Object.assign(Object.assign({},p),{configName:[...(U=p.configName)!==null&&U!==void 0?U:[],"ui"],isAudioDisabled:l,live:Object.assign(Object.assign({},(Y=p.live)!==null&&Y!==void 0?Y:{}),{isLiveCatchUpMode:!!n})}),ee=h,T=b||new nt.Player(X);T.setLooped(N);const te=new le.Logger,fe=new t6(te,{loadTimeout:ee.ads.loadTimeout,initTimeout:ee.ads.initTimeout}),A=go.getInstance(),oe=zl.getInstance(),ae=a==null?void 0:a.pictureInPictureApi,ke=a==null?void 0:a.annotationsApi,we=te.createComponentLog("Store");let Ee,Pe,H={};const G=le.getCurrentBrowser(),O=A?St(A.oneStat.vsid$):hn(void 0),ge=Ue(wo()),Q=(W=ae==null?void 0:ae.info.isActive$)!==null&&W!==void 0?W:new le.ValueSubject(!1),M=ae==null?void 0:ae.info.type,J=Ue(0),Me=Ue([]),Te=le.merge(T.events.fatalError$,T.events.managedError$).subscribe(C=>Me.update(ie=>[...ie,C])),Le=hn(!1,C=>{const ie=T.events.fatalError$.subscribe(()=>C(!0));return()=>ie.unsubscribe()}),x=C=>Yi(void 0,void 0,void 0,function*(){var ie;const be=Object.values(le.InterfaceLanguage).includes(C);if(ee.downloadVKLanguages&&(be&&ee.updateBuiltinLanguages||!zs(C))){let Ge;try{Ge=yield le.loadVKLangPack(C,r0,a0)}catch(pt){(ie=A==null?void 0:A.oneStat)===null||ie===void 0||ie.logError({errorType:"VKLangPack",fatal:!1}),oe==null||oe.report(pt,{errorType:"VKLangPack",fatal:!1})}Ge&&(Os({language:C,pack:Ge,fallback:ee.defaultLanguage}),ue.set(C))}zs(C)&&ue.set(C)}),ue=Ue(i);x(i);const ve=(C,ie)=>{const be=it(ue);return Mu(be,C,ie,ee.defaultLanguage)},re=Ue(Be.Thumb),Fe=(()=>{const C=ii([Le,re],([ie,be])=>ie?Be.Crashed:be);return Object.assign(Object.assign({},C),{is:ie=>it(C)===ie})})(),He=(()=>{const C=Ue(new Set(g));return Object.assign(Object.assign({},C),{add:ie=>{C.update(be=>new Set([...be].concat(ie)))},remove:ie=>{C.update(be=>{const Oe=[...be];return new Set(Array.isArray(ie)?Oe.filter(Ge=>!ie.includes(Ge)):Oe.filter(Ge=>Ge!==ie))})},includes:ie=>{const be=it(C);return Array.isArray(ie)?ie.every(Oe=>be.has(Oe)):be.has(ie)}})})();we({message:"create store"});const rt=C=>{we({message:`init video, config: ${JSON.stringify(C)}`}),_?C.container.append(T.experimental.element$.getValue()):T.initVideo(C),C.subtitles&&T.setExternalTextTracks(C.subtitles),Ee=C},lt=new le.Subject,ze=C=>lt.next(C),mt=new le.Subject,kt=new le.Subject,Re=new le.Subject,Ne={actionRewind$:mt,actionSeek$:kt,inPiP$:Q,inFullscreen$:new le.Observable(C=>ge.subscribe(ie=>C.next(ie))),actionSetSubtitle$:Re,nextMovie$:lt};if(A){const{oneStat:C,statSubscription:ie}=A;ie.add(C.attachTo(T)),ie.add(C.attachToUi(Ne)),ie.add(C.attachToAds(fe.events)),C.authorize(o).catch(be=>{we({message:`onestat auth error ${String(be)}`})})}if(oe){const C=new le.Subscription,ie=(be,Oe)=>C.add(be.subscribe(Oe));if(ie(T.events.managedError$,be=>{oe.logIError(be)}),ie(T.events.fatalError$,be=>{oe.logIError(be,!0)}),A){const{oneStat:be}=A;ie(be.experimental.error$,Oe=>{oe.logIError(Oe)})}oe.sentrySubscription.add(C)}const Wt=()=>{le.isIOS()&&Pe&&n4(Pe)},At=new le.Subscription().add(T.experimental.element$.subscribe(C=>{C&&(Pe=C,C.classList.add("player-media"),Wo(ae)&&(ae.updateVideoElement(),ae.registryEventHandlers()),_&&C.setAttribute("pip","false"))})).add(T.events.ended$.subscribe(()=>{var C;Wt(),(C=r==null?void 0:r.onEnded)===null||C===void 0||C.call(r)})).add(T.events.started$.subscribe(()=>Yi(void 0,void 0,void 0,function*(){var C,ie;Wo(ae)&&(yield ae==null?void 0:ae.revealPictureInPicture());const be=T.info.muted$.getValue();(C=r==null?void 0:r.onStarted)===null||C===void 0||C.call(r),(ie=H.onStarted)===null||ie===void 0||ie.call(H,be)}))).add(T.events.willSeek$.subscribe(({from:C,to:ie})=>{var be;(be=r==null?void 0:r.onSeek)===null||be===void 0||be.call(r,C,ie)})).add(T.info.position$.subscribe(C=>{var ie;const be=T.info.duration$.getValue();(ie=r==null?void 0:r.onTimeupdate)===null||ie===void 0||ie.call(r,be,C),fe.setPosition(C,be)})).add(T.events.fatalError$.subscribe(()=>{var C;(C=r==null?void 0:r.onCrashed)===null||C===void 0||C.call(r)})).add(T.info.is3DVideo$.subscribe(C=>{qt.ui.is3DVideo.set(C)})).add(T.info.isEnded$.subscribe(C=>{_&&(C?(it(tl)&&He.add(H1),He.add(vt.PLAY_BUTTON)):He.remove(vt.PLAY_BUTTON))})).add(T.info.liveTime$.subscribe(C=>{var ie;(ie=r==null?void 0:r.onLiveTime)===null||ie===void 0||ie.call(r,C)})),ut=new le.Subscription,et=()=>{ut.add(T.events.log$.subscribe(C=>{console.debug("%c sdk ","background:#9ddcf7;",`sdk component: ${C.component}`,C.message)})).add(te.log$.subscribe(C=>{console.debug("%c ui ","background:#f3da0b;",`ui component: ${C.component}.`,C.message)}))},ce=()=>{ut.unsubscribe()},Xe=(C,ie)=>{T.startCameraManualRotation(C,ie)},$e=(C=!1)=>{T.stopCameraManualRotation(C)},Je=(C,ie,be)=>{T.moveCameraFocusPX(C,ie,be)},Ze=()=>{T.holdCamera()},dt=()=>{T.releaseCamera()},xe=hn(T.info.position$.getValue(),C=>{let ie,be;const Oe=()=>{const Ge=T.info.playbackState$.getValue(),pt=T.info.isLive$.getValue(),Bt=T.info.duration$.getValue(),yt=T.info.position$.getValue();if([nt.PlaybackState.PLAYING,nt.PlaybackState.PAUSED].includes(Ge)){const Hi=pt?yt-Bt:T.getExactTime();Hi!==be&&C(Hi),be=Hi}ie=requestAnimationFrame(Oe)};return Oe(),()=>cancelAnimationFrame(ie)}),st=St(Q),Ke=St(T.info.playbackState$),tt=St(T.info.currentBuffer$),Xt=St(T.info.isEnded$),ht=St(T.info.isLive$),Ye=ee.features.playbackRate?St(T.info.canChangePlaybackSpeed$):hn(!1),Lt=St(T.info.liveBufferTime$),at=St(T.info.volume$),ci=St(T.info.muted$),me=Z1(T.info.autoQualityLimits$.pipe(le.map(({max:C})=>C!==void 0)),((ne=T.info.autoQualityLimits$.getValue())===null||ne===void 0?void 0:ne.max)!==void 0),Ce=St(T.info.autoQualityLimitingAvailable$),Ie=St(T.info.availableQualities$),It=St(T.info.availableQualitiesFps$),fi=St(T.info.chromecastState$),Mt=St(T.info.chromecastDeviceName$),Ci=St(T.info.currentFormat$),Vi=St(T.info.throughputEstimation$),Ii=St(T.info.videoBitrate$),Ve=St(T.info.intrinsicVideoSize$),Nt=St(T.info.duration$),di=St(T.info.isAudioAvailable$);let Ot=null;const Vt=T.info.isBuffering$,Mi=hn(Vt.getValue(),C=>{const ie=Vt.subscribe(be=>{be&&Ot===null?Ot=window.setTimeout(()=>{C(Vt.getValue()),Ot=null},ee.loaderDelay):C(be)});return()=>{ie.unsubscribe(),Ot&&clearTimeout(Ot)}}),Rt=()=>{Ot&&clearTimeout(Ot),Ot=null},oi=ii([Nt,ht],([C,ie])=>ie?-C:C),xi=ii([Ke],([C])=>C===nt.PlaybackState.PLAYING),Pt=St(T.info.atLiveEdge$),Ui=St(T.info.atLiveDurationEdge$),mi=St(T.info.position$),Ni=ii([mi,Nt],([C,ie])=>isFinite(C)&&isFinite(ie)&&!!ie),Ri=ii([fi],([C])=>C===nt.ChromecastState.CONNECTED),Ti=Ue(void 0),li=St(T.info.isAutoQualityEnabled$,C=>C&&Ti.set(void 0)),Ei=St(T.info.currentQuality$,()=>Ti.set(void 0)),yi=ii([Ti,Ei],([C,ie])=>C!=null?C:ie),hi=ii([Ie,It,li,yi,Ci],([C,ie,be,Oe,Ge])=>{const pt=[];Ge!==nt.VideoFormat.MPEG&&pt.push({value:oo.AUTO,displayValue:ve("auto_quality_option"),selected:be});const Bt=C.filter(yt=>yt!==le.VideoQuality.INVARIANT);for(const yt of Bt){const Hi=ie[yt],Ao=yt===le.VideoQuality.INVARIANT?ve("auto_quality_option"):yt;pt.push({value:yt,displayValue:`${Ao}${Hi?i6(Hi):""}`,selected:be?!1:yt===Oe})}return pt}),si=St(T.info.currentPlaybackRate$),pi=ii([si,Pt,Ui],([C,ie,be])=>{const Oe=be||_?1:ee.controls.playbackRateMin,Ge=ie?1:ee.controls.playbackRateMax,pt=ee.controls.playbackRateStep,Bt=[];for(let yt=Oe;yt<=Ge;yt+=pt)Bt.push({value:yt,displayValue:yt===1?ve("playback_rate_1"):ve("playback_rate",{multiplier:yt.toString(10)}),selected:C===yt});return Bt}),ji=ee.features.subtitles?St(T.info.availableTextTracks$):hn([]),qi=ii([ji],([C],ie)=>{const be=[],Oe=[];for(const Ge of C)Ge.url&&be.push(xg(Ge.url));Promise.allSettled(be).then(Ge=>{for(const[pt,Bt]of Ge.entries())Bt.status==="fulfilled"&&Bt.value.text().then(yt=>{const Hi=new n6,Ao=C[pt].language,Bc=!!C[pt].isAuto,ns=Hi.parse(yt);Ao&&ns&&Oe.push({lang:Ao,subtitles:ns,isAuto:Bc}),pt===Ge.length-1&&ie(Oe)})})}),Ht={displayValue:ve("subtitles_off"),value:"off"},Ut=Ue(Object.assign({},Ht)),Bi=ii([qi,Ut,qi],([C,ie])=>{if((C==null?void 0:C.length)>0){const be=[Object.assign(Object.assign({},Ht),{selected:(ie==null?void 0:ie.value)===Ht.value})];for(const{lang:Oe,isAuto:Ge}of C)Al[Oe]&&be.push({displayValue:Ge?ve("subtitles_auto",{language:Al[Oe]}):Al[Oe],value:Oe,selected:(ie==null?void 0:ie.value)===Oe,isAuto:Ge});return be}else return[]}),$i=ii([xe,Ut,qi],([C,ie,be])=>{if(ie&&ie.value!==Ht.value)return l6(C,ie,be)}),vi=ii([$i],([C])=>C!=null&&C.texts?C.texts:[]),Oi=Ue(!0),Ai=ii([tt,oi,mi,Lt],([C,ie,be,Oe])=>{var Ge;const pt=(Ge=C==null?void 0:C.end)!==null&&Ge!==void 0?Ge:0;if(!Oe)return pt/ie;const yt=-be+Oe-ie;return(pt-yt)/ie}),Si=St(T.info.availableSources$),zi=ii([Si],([C])=>Object.keys((C==null?void 0:C[nt.VideoFormat.MPEG])||{}).length>0),Li=()=>{var C,ie,be;const Oe=Object.keys(((ie=(C=T.info.availableSources$)===null||C===void 0?void 0:C.getValue())===null||ie===void 0?void 0:ie[nt.VideoFormat.MPEG])||{}),Ge=le.getHighestQuality(Oe)||le.VideoQuality.Q_144P;return(be=Ee.sources[nt.VideoFormat.MPEG])===null||be===void 0?void 0:be[Ge]},Jt=()=>{var C;const ie=Li();ie?v0(ie,((C=Ee==null?void 0:Ee.meta)===null||C===void 0?void 0:C.title)||"video"):we({message:"There is no URL for download video"})},xt=()=>{we({message:"toggle muted"});const C=T.info.muted$.getValue(),Oe=!(T.info.volume$.getValue()===0||C);Kt(Oe)},gi=(C,ie=C,be=!1)=>{var Oe,Ge,pt;const Bt=!be,yt=T.info.muted$.getValue();we({message:`set volume, volume: ${C}, preferredVolume: ${ie}, internalCall: ${Bt}`}),T.setVolume(C),fe.setVolume(C),Bt&&((Oe=r==null?void 0:r.onVolumeChange)===null||Oe===void 0||Oe.call(r,C)),fs(ie),yt?(T.setMuted(!1),Bt&&((Ge=r==null?void 0:r.onUnmute)===null||Ge===void 0||Ge.call(r)),sl(!1)):!yt&&C===0&&(T.setMuted(!0),Bt&&((pt=r==null?void 0:r.onMute)===null||pt===void 0||pt.call(r)),sl(!0))},Kt=(C,ie=!1)=>{var be,Oe,Ge,pt;const Bt=!ie,yt=T.info.volume$.getValue();if(we({message:`set muted, currentVolume: ${yt}, mute: ${C}, internalCall: ${Bt}`}),T.setMuted(C),fe.setVolume(C?0:yt),sl(C),Bt&&(C?(be=r==null?void 0:r.onMute)===null||be===void 0||be.call(r):(Oe=r==null?void 0:r.onUnmute)===null||Oe===void 0||Oe.call(r)),yt===0){let Hi=(Ge=X1())!==null&&Ge!==void 0?Ge:ee.volumeDefault;Hi===0&&(Hi=ee.volumeMinRestore,fs(Hi)),T.setVolume(Hi),fe.setVolume(Hi),Bt&&((pt=r==null?void 0:r.onVolumeChange)===null||pt===void 0||pt.call(r,Hi))}},$t=()=>{T.prepare()},ri=()=>{var C,ie;if(le.assertNonNullable(qt),!it(qt.ui.controls.disabledControls$).has(vt.PLAY_BUTTON)){if(we({message:"toggle play"}),it(qt.playerPhase)===Be.Ads){fe.togglePlay();return}if(T.info.playbackState$.getValue()!==nt.PlaybackState.PLAYING){if(T.info.isEnded$.getValue()){if(we({message:"toggle play, video ended, seek to 0"}),mt.next(),kt.next(wt.SeekAction.REWIND),_){E==null||E();return}T.seekTime(0)}we({message:"toggle play, call player.play"}),T.play(),(C=r==null?void 0:r.onPlay)===null||C===void 0||C.call(r)}else we({message:"toggle play, call player.pause"}),T.pause(),(ie=r==null?void 0:r.onPause)===null||ie===void 0||ie.call(r)}},bi=C=>{we({message:`set quality, quality: ${C}`}),T.setAutoQuality(C===oo.AUTO),C!==oo.AUTO?(g0(e,C),Ti.set(C),T.setQuality(C)):J1()},ei=C=>{we({message:`set trafficSavingEnabled, value: ${C}`}),T.setAutoQualityLimits({max:C?ee.trafficSavingLimit:void 0}),w0(C)},ai=C=>{T.setPlaybackRate(C)},Wi=()=>{const C=it(pi),ie=C.findIndex(({selected:Oe})=>Oe);if(ie===C.length-1)return;const be=C[ie+1];ai(be.value)},Di=()=>{const C=it(pi),ie=C.findIndex(({selected:Oe})=>Oe);if(ie===0)return;const be=C[ie-1];ai(be.value)},Pi=C=>{C&&C.value!==Ht.value&&Re.next(C.isAuto?C.value+"_auto":C.value),Ut.set(C)},Qi=()=>{const C=it(Bi),ie=it(Ut),be=it(ue);if((ie==null?void 0:ie.value)===Ht.value){const Oe=C.filter(Ge=>Ge.value!==Ht.value).find(Ge=>Ge.value===be)||C[1];Pi(Oe!=null?Oe:Object.assign({},Ht))}else Pi(Object.assign(Object.assign({},Ht),{selected:!1}))},ti=(C,ie,be=!0)=>{if(we({message:`seek to time, time: ${C}`}),kt.next(ie),T.info.isLive$.getValue()){const Oe=T.info.duration$.getValue(),Ge=Math.min(0,Oe+C);T.seekTime(Ge,be)}else{if(it(tl))return;T.seekTime(is(C),be)}},_i=C=>{we({message:`seek to episode start time: ${C}`}),ti(C,wt.SeekAction.EPISODE,!0)},Fi=(C,ie)=>{we({message:`seek to percent, percent: ${C}`});const be=Math.round(it(oi)*C);ti(be,ie,!1)},Zi=C=>{we({message:`seek external, time: ${C}`}),kt.next(wt.SeekAction.UNKNOWN),T.seekTime(T.info.isLive$.getValue()?-C:C)},zt=C=>{var ie,be;we({message:`set auto quality limitation. Max: ${(ie=C.max)!==null&&ie!==void 0?ie:"none"}. Min: ${(be=C.min)!==null&&be!==void 0?be:"none"}`}),T.setAutoQualityLimits(C)},Yt=C=>{we({message:`seek external to episode start time: ${C}`}),ti(C,wt.SeekAction.EPISODE,!0)},de=C=>{we({message:`set playback rate to: ${C}`}),T.setPlaybackRate(C)},Gi=Ue(void 0),un=Ue(!1),zn=C=>{we({message:`start scrubbing, progress: ${C}`}),un.set(!0),ui(C)},ui=C=>{Gi.set(C)};let vn,gn;const cn=()=>{Gi.set(void 0),un.set(!1)},bn=()=>{clearTimeout(gn),clearTimeout(vn),vn=window.setTimeout(()=>{cn()},500),Pe==null||Pe.removeEventListener("seeked",bn)},In=C=>{we({message:`complete scrubbing, progress: ${C}`}),Fi(C,wt.SeekAction.SLIDER),it(qt.ui.isMobile)&&it(qt.state.currentFormat$)===nt.VideoFormat.HLS?(Pe==null||Pe.addEventListener("seeked",bn),gn=window.setTimeout(()=>{bn()},300)):cn()},tn=ii([xe,oi,Gi],([C,ie,be],Oe)=>{Oe(le.isNonNullable(be)?be*ie:C)}),Mn=Ue({width:0,height:0}),$=ii([Mn],([{width:C}],ie)=>{const be=u3(C);ie(be)}),gt=Ue(!1),fn=ii([$,gt],([C,ie])=>ie?B.filter(be=>!be.hideOnMobile):B.filter(be=>{var Oe;return!(!((Oe=be.hideOnDesktopGridTypes)===null||Oe===void 0)&&Oe.includes(C))})),en=ii([gt,Le],([C,ie],be)=>{be(C&&ie)}),dn=()=>{kt.next(wt.SeekAction.LIVE),we({message:"switch to active live"}),T.seekTime(0),T.info.playbackState$.getValue()!==nt.PlaybackState.PLAYING&&qt.actions.internal.togglePlay()},nn=()=>fe.skip(),uo=(C=!0)=>{le.assertNonNullable(qt),we({message:`switch from ads to video, callPlay: ${C}`}),re.set(Be.Video),C&&T.play()},co=()=>{le.assertNonNullable(qt),we({message:"switch from video to ads"}),qt.actions.internal.pause(),Wt(),re.set(Be.Ads)},fo=C=>{le.assertNonNullable(qt);const ie=C?Be.WaitingLive:Be.Thumb;re.set(ie)},mo=C=>{le.assertNonNullable(qt);const ie=C?Be.WaitingRecord:Be.Thumb;re.set(ie)},ho=()=>(le.assertNonNullable(qt),h0(T,Ee,qt)),po=()=>(le.assertNonNullable(qt),p0(T,Ee,qt)),qn=()=>Pe,Wn=()=>{we({message:"toggle chromecast"}),T.toggleChromecast()},se=C=>{var ie;le.assertNonNullable(qt);const be=!C;if(it(qt.playerPhase)===Be.Ads){we({message:`pause ads, internalCall: ${be}`}),fe.pause();return}we({message:`pause video, internalCall: ${be}`}),be&&((ie=r==null?void 0:r.onPause)===null||ie===void 0||ie.call(r)),T.pause()},_n=C=>{var ie;le.assertNonNullable(qt);const be=!C;if(it(qt.playerPhase)===Be.Ads){we({message:`play ads, internalCall: ${be}`}),fe.play();return}we({message:`play video, internalCall: ${be}`}),be&&((ie=r==null?void 0:r.onPlay)===null||ie===void 0||ie.call(r)),T.play()},ct=(C,ie)=>{le.assertNonNullable(qt),we({message:`first start, show ads: ${C}, internalCall: ${!ie}`}),C?re.set(Be.Ads):(re.set(Be.Video),ie?T.play():qt.actions.internal.togglePlay())},jt=()=>(we({message:"getting time codes"}),c),on=()=>{const C=jt();if(!C||[0,1].includes(C.length))return;const ie=T.info.position$.getValue();return C.find(be=>be.time>ie)},wn=C=>{let ie=C;ie||(ie=on()),ie&&(we({message:"seek to next episode"}),ti(ie.time,wt.SeekAction.EPISODE,!0))},j=()=>{const C=jt();if(!C||[0,1].includes(C.length))return;const ie=T.info.position$.getValue(),be=C.findIndex(Ge=>Ge.time>ie),Oe=be===-1?C.length-2:be-2;if(!(Oe<0))return C[Oe]},_t=C=>{let ie=C;ie||(ie=j()),ie&&(we({message:"seek to prev episode"}),ti(ie.time,wt.SeekAction.EPISODE,!0))},mn=()=>(we({message:"getting preview thumbs data"}),f),ln=()=>Yi(void 0,void 0,void 0,function*(){ae!=null&&ae.isActive()?yield ae==null?void 0:ae.remove():yield ae==null?void 0:ae.request()}),Zn=(C=-90)=>{J.update(ie=>ie+C)},Gn=Ue(L),es=ii([Gn],([C=[]])=>{const ie=[];for(let be=0;be<C.length;be++){const{range:[Oe,Ge],subjects:pt}=C[be];be===0&&Oe!==0&&ie.push({time:0,text:""}),ie.push({time:Oe/1e3,text:"",interactive:!0,completed:!pt.length}),Ge!==1/0&&ie.push({time:Ge/1e3,text:"",interactive:!1,completed:!pt.length})}return ie}),Nc=C=>{const ie=it(Gn);Gn.set(ie.map(be=>Object.assign(Object.assign({},be),{subjects:be.subjects.filter(Oe=>Oe!==C)})))},ts=Ue(!1),tl=ii([mi,Gn,ts],([C,ie,be])=>{if(!_)return!1;if(be)return!0;const Oe=C*1e3,Ge=ie==null?void 0:ie.find(({range:[pt,Bt],subjects:yt})=>pt<Oe&&Oe<Bt&&yt.length);return Ge&&it(un)&&cn(),!!Ge}),is=C=>{if(!_)return C;const ie=it(es),be=it(oi),Ge=it(mi)/be,pt=ie.find(Bt=>Bt.interactive&&!Bt.completed&&Bt.time>Ge);return typeof(pt==null?void 0:pt.time)=="number"?Math.min(C,pt.time-.05):C},Rc=()=>{clearTimeout(gn),clearTimeout(vn),At.unsubscribe(),ut.unsubscribe(),T.destroy(),fe.destroy(),A==null||A.destroy(),oe==null||oe.destroy(),Te.unsubscribe()},qt={interfaceLanguage$:ue,initVideo:rt,videoId:e,isClip:t,playerPhase:Fe,vsid:O,state:{positionExact$:xe,positionWithScrubbing$:tn,duration$:oi,playbackState$:Ke,isPlaying$:xi,isLoaderVisible:Mi,bufferedProgress$:Ai,isLive$:ht,canChangePlaybackSpeed$:Ye,isActiveLive$:Pt,isOldestAvailableLive$:Ui,isRewindableLive$:Ni,isEnded$:Xt,muted$:ci,volume$:at,trafficSavingEnabled$:me,autoQualityLimitingAvailable$:Ce,currentQuality$:yi,isAutoQualityEnabled$:li,availableQualities$:hi,currentPlaybackRate$:si,availablePlaybackRates$:pi,currentSubtitle$:Ut,availableSubtitlesList$:Bi,currentSubtitleCaptions$:vi,isAutoSubtitleCaptionVisible$:Oi,chromecastState$:fi,chromecastDeviceName$:Mt,chromecastConnected$:Ri,currentFormat$:Ci,throughputEstimation$:Vi,videoBitrate$:Ii,videoSize$:Ve,errorLog$:Me,crashed$:Le,isAudioAvailable$:di,isAudioDisabled:!!l,canDownload:ee.features.download&&!!s,availableSources$:Si,hasMpegSources$:zi,isInteractive:_,isInteractiveGraphEnabled:ee.features.interactiveGraph,isSeekToInteractiveEnable:ee.features.seekToInteractive,isPlayPrevChapterEnabled:ee.features.interactivePlayPrevChapter,interactiveEpisodes$:es,isInteractiveTime$:tl,graphIsOpened$:Ue(!1),isInteractiveExpectation$:ts,hasInteractiveBranches:w,playPrevChapterDisabledTooltip:P},ui:{controlsVisible:Ue(!1),touched:Ue(!1),controls:{prevButton:Ue(void 0),playButton:Ue(void 0),replayButton:Ue(void 0),nextButton:Ue(void 0),playPrevChapterButton:Ue(void 0),seekToInteractiveButton:Ue(void 0),interactiveGraphButton:Ue(void 0),liveButton:Ue(void 0),time:Ue(void 0),episodes:Ue(void 0),volume:Ue(void 0),subtitles:Ue(void 0),settings:Ue(void 0),chromecast:Ue(void 0),fullscreen:Ue(void 0),vkLogo:Ue(void 0),additionalButtons:B.length?B.reduce(C=>[...C,Ue(void 0)],[]):[],disabledControls$:He},modals:{hotKeyMap:{show:Ue(!1),data:Ue({title:"",closeBtnText:"",groups:[]})}},isFullscreen:ge,rotateAlpha:J,isAutoplay:Ue(!1),contextMenuVisible:Ue(!1),debugPanelVisible:Ue(!1),playerSize:Mn,isMobile:gt,mobileNotReportControlHidden$:en,mobileUnmuteButtonExpanded:Ue(!1),mobileUnmuteButtonVisible:Ue(!1),icon3DVideoVisible:Ue(!1),settingsMenuVisible:Ue(!1),scrubbingInProgress:un,is3DVideo:Ue(!1),isPictureInPictureActive$:st,pictureInPictureType$:hn(M),clientInfo$:hn(G),currentGridType$:$,additionalButtons$:fn,interactiveHideMobileControls:Ue(!1),overlayContainer$:Ue(void 0)},ads:{position:Ue(0),duration:Ue(0),playbackState:Ue(Qt.INACTIVE),canSkip:Ue(!1),secondsToWatchBeforeSkip:Ue(0),postrollPassed:Ue(!1)},webApi:{pictureInPictureApi:ae,annotationsApi:ke},actions:{internal:{preload:$t,firstStart:C=>ct(C,!1),pause:()=>se(!1),togglePlay:ri,toggleMuted:xt,setVolume:gi,setQuality:bi,setTrafficSavingEnabled:C=>ei(C),setPlaybackRate:ai,incrementPlaybackRate:Wi,decrementPlaybackRate:Di,setSubtitle:Pi,toggleSubtitle:Qi,togglePictureInPicture:ln,startScrubbing:zn,progressScrubbing:ui,completeScrubbing:In,toggleChromecast:Wn,switchToActiveLive:dn,switchFromAdsToVideo:uo,switchFromVideoToAds:co,skipAd:nn,setWaitingLive:fo,setWaitingRecord:mo,getDebugTextData:ho,getDebugPanelData:po,getVideoElement:qn,seekTime:(C,ie,be)=>ti(C,ie,be),clearDelayedBufferingCheckTimeout:Rt,seekEpisodeStartTime:_i,seekToPercent:Fi,getNextEpisode:on,seekToNextEpisode:wn,getPrevEpisode:j,seekToPrevEpisode:_t,startLogging:et,stopLogging:ce,startCameraManualRotation:Xe,stopCameraManualRotation:$e,moveCameraFocusPX:Je,holdCamera:Ze,releaseCamera:dt,getVideoEpisodes:jt,getPreviewThumbsData:mn,downloadVideo:Jt,addLanguage:Os,setLanguage:x,nextMovie:ze,videoRotate:Zn,completeInteractiveRange:Nc,correctSeekTimeToInteractive:is,replayInteractive:E},external:{firstStart:C=>ct(C,!0),play:()=>_n(!0),pause:()=>se(!0),seekTime:C=>Zi(C),seekEpisodeStartTime:C=>Yt(C),setPlaybackRate:C=>de(C),setAutoQualityLimits:C=>zt(C),setMuted:C=>Kt(C,!0),setVolume:C=>gi(C,C,!0)}},callbacks:r,setUiCallbacks:C=>{H=Object.assign({},C)},getAdmanWrapper:()=>fe,getLogger:()=>te,destroy:Rc};return qt};class r6{isSupported(){return"mediaSession"in navigator}setMetaData({title:e,artist:t="",thumbUrl:n=""}){this.isSupported()&&(navigator.mediaSession.metadata=new MediaMetadata({title:e,artist:t,artwork:[{src:n,sizes:"96x96",type:"image/png"},{src:n,sizes:"128x128",type:"image/png"},{src:n,sizes:"192x192",type:"image/png"},{src:n,sizes:"256x256",type:"image/png"},{src:n,sizes:"384x384",type:"image/png"},{src:n,sizes:"512x512",type:"image/png"}]}))}updateActionHandlers(e){this.resetActionHandlers(),this.setActionHandlers(e)}resetActionHandlers(){const e=[["play",null],["pause",null],["stop",null],["nexttrack",null],["previoustrack",null],["seekto",t=>null],["seekbackward",t=>null],["seekforward",t=>null]];this.setActionHandlers(e)}setActionHandlers(e){if(this.isSupported())for(const[t,n]of e)try{navigator.mediaSession.setActionHandler(t,n)}catch(o){throw new Error(`The media session action "${t}" is not supported yet.`)}}}function a6(i){let e,t,n,o;return{c(){e=I("svg"),t=I("g"),n=I("path"),o=I("path"),u(n,"d","m30.744 4 .744.005c2.981.046 4.526.385 6.127 1.24a8.766 8.766 0 0 1 3.475 3.347l.174.312.15.292c.772 1.553 1.066 3.18 1.085 6.251v9.045a1.5 1.5 0 0 1-3 .016l-.008-9.651c-.04-2.032-.228-3.12-.627-4.035l-.126-.27-.13-.252A5.77 5.77 0 0 0 36.2 7.891c-1.187-.635-2.339-.873-5.115-.89L22.255 7c-2.737 0-4.003.2-5.071.698l-.133.064-.251.13a5.77 5.77 0 0 0-2.409 2.408c-.635 1.187-.873 2.339-.89 5.114l-.001 20.83c0 2.738.2 4.004.698 5.072l.064.133.13.251a5.769 5.769 0 0 0 2.408 2.409c1.1.588 2.134.825 4.438.88l.323.006 3.695.005H26a1.5 1.5 0 0 1 0 3h-.756l-3.718-.005c-2.989-.047-4.526-.377-6.14-1.24a8.766 8.766 0 0 1-3.476-3.347l-.174-.312-.15-.292c-.731-1.472-1.036-3.016-1.08-5.803l-.006-.756v-20.49l.005-.743c.046-2.981.385-4.526 1.24-6.127a8.765 8.765 0 0 1 3.347-3.475l.312-.174.292-.15c1.472-.731 3.016-1.036 5.803-1.08L22.256 4h8.488Z"),u(o,"d","M30.5 33.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C32.78 29 33.62 29 35.3 29h6.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311c.327.642.327 1.482.327 3.162v13.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C44.22 52 43.38 52 41.7 52h-6.4c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C30.5 49.72 30.5 48.88 30.5 47.2V33.8Z"),u(t,"fill","#fff"),u(e,"width","57"),u(e,"height","56"),u(e,"fill","none"),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"aria-label","dummy-image"),u(e,"data-testid","pip-dummy-icon")},m(l,s){S(l,e,s),d(e,t),d(t,n),d(t,o)},p:K,i:K,o:K,d(l){l&&y(e)}}}class u6 extends Se{constructor(e){super(),ye(this,e,null,a6,_e,{})}}function c6(i){qe(i,"v-1pbsod4",".player-pip-dummy.v-1pbsod4{width:100%;height:100%;background-color:#19191A;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif}.player-pip-dummy.is-pip-api.v-1pbsod4{position:relative}.dummy-image.v-1pbsod4 svg{transform:scale(1.07143)}.dummy-image.desktop.v-1pbsod4{transform:scale(1.07143) rotate(-90deg) rotateY(180deg)}.title.v-1pbsod4{font-size:16px;color:#fff;padding:18px 20px 10px;text-align:center}")}function f6(i){let e,t,n,o,l,s,r;return n=new u6({}),{c(){e=k("div"),t=k("div"),F(n.$$.fragment),o=R(),l=k("span"),s=De(i[0]),u(t,"class","dummy-image v-1pbsod4"),V(t,"desktop",!i[1]),u(l,"class","title v-1pbsod4"),u(e,"class","player-pip-dummy v-1pbsod4"),V(e,"is-pip-api",i[2])},m(a,c){S(a,e,c),d(e,t),z(n,t,null),d(e,o),d(e,l),d(l,s),r=!0},p(a,[c]){(!r||c&2)&&V(t,"desktop",!a[1]),(!r||c&1)&&ot(s,a[0])},i(a){r||(m(n.$$.fragment,a),r=!0)},o(a){v(n.$$.fragment,a),r=!1},d(a){a&&y(e),D(n)}}}function d6(i,e,t){let n,o;const l=Et(),s=!!l.webApi.pictureInPictureApi,r=l.interfaceLanguage$;q(i,r,f=>t(5,n=f));const a=l.ui.isMobile;q(i,a,f=>t(1,o=f));let c;return i.$$.update=()=>{i.$$.dirty&32&&t(0,c=n&&Z("pip_dummy_title"))},[c,o,s,r,a,n]}class m6 extends Se{constructor(e){super(),ye(this,e,d6,f6,_e,{},c6)}}const h6=460,p6=280;class Ic{constructor(){this.info={isActive$:new le.ValueSubject(!1),type:Sn.DocumentPictureInPicture}}isSupported(){const e=le.getCurrentBrowser().browser===le.CurrentClientBrowser.Yandex,{isEmbed:t}=le.detectEmbed();return"documentPictureInPicture"in window&&!e&&!t}isActive(){return this.isSupported()&&!!documentPictureInPicture.window}setPlayerDomElement(e,t){this.playerDomElement=e,this.playerParentShadowRoot=t}setContext(e){this.svelteContext=e}request(){var e,t;return Yi(this,void 0,void 0,function*(){if(!this.isSupported()||!this.playerDomElement||!this.playerParentShadowRoot)return;this.pipWindow=yield documentPictureInPicture.requestWindow({width:h6,height:p6,copyStyleSheets:!0}),this.pipWindow.document.body.style.margin="0";const n=[...this.playerParentShadowRoot.styleSheets].map(r=>[...r.cssRules].map(a=>a.cssText).join(" ")).filter(Boolean).join(`
51
- `),o=document.createElement("style");o.textContent=n;const l=this.createStretchedContainer(),s=l.attachShadow({mode:"open"});s.append(o),s.append(this.playerDomElement),this.playerDummyElement=new m6({target:this.playerParentShadowRoot,context:this.svelteContext}),(e=this.pipWindow)===null||e===void 0||e.document.body.append(l),this.info.isActive$.next(!0),(t=this.pipWindow)===null||t===void 0||t.addEventListener("unload",r=>{!this.playerDomElement||!this.playerParentShadowRoot||!this.playerDummyElement||(this.playerDummyElement.$destroy(),this.playerParentShadowRoot.append(this.playerDomElement),this.info.isActive$.next(!1))})})}remove(){return Yi(this,void 0,void 0,function*(){return new Promise(e=>{var t;(t=documentPictureInPicture.window)===null||t===void 0||t.close(),e()})})}dispose(){return Yi(this,void 0,void 0,function*(){yield this.remove()})}createStretchedContainer(){const e=document.createElement("div");return e.style.width="100%",e.style.height="100%",e}}function v6(i){return i instanceof Ic}class g6{static getLatestSupportedVersion(){const e=new Gl,t=new Ic;if(t.isSupported())return t;if(e.isSupported())return e}}function V1(i,e){var t,n;const o=new Set([...Object.keys(i),...Object.keys(e)]),l={};for(const s of o)l[s]=(n=(t=e[s])!==null&&t!==void 0?t:i[s])!==null&&n!==void 0?n:void 0;return l}const I1="Inner error. Unexpectedly root annotation container null reference exception",b6="Annotation layer with such name already exists";class Ll extends Error{constructor(e){super(e),this.name="AnnotationError"}}class _6{constructor(){this.layers=new Map}registryRootContainer(e){this.detach(),this.rootAnnotationsContainer=e}addLayer(e){if(!this.rootAnnotationsContainer)throw new Ll(I1);if(this.layers.has(e))throw new Ll(b6);const t=document.createElement("div");return t.className="annotations-layer",t.style.width="100%",t.style.height="100%",t.style.position="absolute",t.style.left="0",t.style.top="0",this.rootAnnotationsContainer.append(t),this.layers.set(e,t),t}getLayer(e){return this.layers.get(e)}removeLayer(e){const t=this.layers.get(e);t&&this.layers.delete(e)&&t.remove()}clearLayer(e){const t=this.layers.get(e);for(;t!=null&&t.lastChild;)t.lastChild.remove()}detach(){for(const e of this.layers.values())e.remove()}reattach(){if(!this.rootAnnotationsContainer)throw new Ll(I1);for(const e of this.layers.values())this.rootAnnotationsContainer.append(e)}destroy(){this.detach(),this.layers.clear(),this.rootAnnotationsContainer=void 0}}class Mc{init(e,t){return le.assertNonNullable(e),le.assertNonNullable(t),this.subscription=new le.Subscription,this.subscription}}class w6 extends Mc{constructor(){super(...arguments),this.stateName="fakeIsPlaying$",this.state$=Object.assign(Object.assign({},Ue(null)),{toggle:()=>this.state$.update(e=>!e)})}init(e,t){const n=super.init(e,t),{isInteractiveExpectation$:o}=e.state;return n.add(o.subscribe(l=>{this.state$.set(l?!0:null)})),n}}class k6 extends Mc{constructor(){super(...arguments),this.stateName="interactiveControlsOpacity$",this.state$=Object.assign(Object.assign({},Ue(null)),{toggle:()=>this.state$.update(e=>!e)})}init(e,t){const n=super.init(e,t),{fakeIsPlaying$:o}=t,{isInteractiveExpectation$:l,isPlaying$:s}=e.state,{controlsVisible:r,isMobile:a}=e.ui,c=it(a),f=()=>c&&it(r);return n.add(r.subscribe(h=>{if(!c)return;const p=it(o);it(s)?this.state$.set(h):p!==null&&this.state$.set(!p||h)})),n.add(s.subscribe(h=>{this.state$.set(!h||f())})),n.add(o.subscribe(h=>{if(h===null)return;const p=it(l);if(f()){this.state$.set(!0);return}p&&this.state$.set(!h)})),n}}const y6=()=>[w6,k6].reduce(({subscribers:i,stores:e},t)=>{const n=new t;return{subscribers:[...i,n],stores:Object.assign(Object.assign({},e),{[n.stateName]:n.state$})}},{subscribers:[],stores:{}}),S6={preload:!0,autoplay:!1,repeat:!1,fromTime:0,canRewindLive:!0,showAds:!1,interfaceLanguage:le.InterfaceLanguage.RU,logoClickable:!1,logoHidden:!1,isMobile:le.isMobile(),isMediaSessionEnabled:!0,isPictureInPictureEnabled:!0,isAudioDisabled:!1,callbacks:{uiInfo:{}},tuningConfig:{configName:[]}};class P6 extends HTMLElement{constructor(){var e;super(),this.currentPlayingVideoIndex=0,this.needToRepeatPlaylist=!1,this.videoConfig=void 0,this.pictureInPictureApi=void 0,this.mediaSessionApi=void 0,this.unsubscribePlayerPhaseSubscription=void 0,this.annotationsApi=void 0,this.prevIsid=void 0,this.isInited=!1,this._shadowRoot=this.attachShadow({mode:"open"}),this.playerContainer=document.createElement("div"),this.playerContainer.style.all="initial",this.playerContainer.style.display="block",this.playerContainer.style.contain="strict",this.playerContainer.style.width="100%",this.playerContainer.style.height="100%",this._shadowRoot.append(this.playerContainer),this.logger=new le.Logger,this.log=this.logger.createComponentLog("VKVideoPlayer"),this.subscription=new le.Subscription,this.graphMadePause=!1,!((e=window==null?void 0:window.videoPlayerConfig)===null||e===void 0)&&e.debugLogs&&this.subscription.add(this.logger.log$.subscribe(t=>{console.log("%c player web component ","background:#77dd77;",`${t.component}`,t.message)}))}connectedCallback(){var e,t;if(this.isInited)return;const n=(e=this.getAttribute("stub-title"))!==null&&e!==void 0?e:void 0,o=(t=this.getAttribute("stub-thumb-url"))!==null&&t!==void 0?t:void 0;this.svelteStubComponent=new Qg({target:this.playerContainer,props:{title:n,thumbUrl:o}})}disconnectedCallback(){var e,t,n,o,l;(e=this.annotationsApi)===null||e===void 0||e.destroy(),(t=this.svelteRootComponent)===null||t===void 0||t.$destroy(),(n=this.svelteStubComponent)===null||n===void 0||n.$destroy(),this.subscription.unsubscribe(),(o=this.unsubscribePlayerPhaseSubscription)===null||o===void 0||o.call(this),(l=this.interactiveController)===null||l===void 0||l.destroy()}needToShowNextPrevButtons(){return this.videoConfig?this.videoConfig.videos.length>1:!1}isNextButtonActive(){return this.videoConfig?this.needToShowNextPrevButtons()&&(this.currentPlayingVideoIndex<this.videoConfig.videos.length-1||this.needToRepeatPlaylist):!1}isPrevButtonActive(){return this.videoConfig?this.needToShowNextPrevButtons()&&(this.currentPlayingVideoIndex>0||this.needToRepeatPlaylist):!1}isControlDisabled(e){var t;const n=(t=this.store)===null||t===void 0?void 0:t.ui.controls.disabledControls$;return(n==null?void 0:n.includes(e))||!1}getNextVideoInfo(){if(!this.videoConfig)return{nextVideoTitle:void 0,nextVideoThumb:void 0};const e=this.videoConfig.videos[this.currentPlayingVideoIndex+1]||{};return{nextVideoTitle:e.title,nextVideoThumb:e.thumbUrl}}createPlayer(e,t={},n){var o,l,s,r,a,c,f,h,p,b,g,_;if(!this.videoConfig)return;const{albumId:L,statPlace:E,statUserSalt:w,statAuthToken:P,statTrackCode:B,refreshStatAuthToken:N,preload:U,autoplay:Y,volume:W,muted:ne,fromTime:X,canRewindLive:ee,supportLink:T,showAds:te,adsSlotId:fe,adsParams:A={},adsPreviewParam:oe,interfaceLanguage:ae,logoClickable:ke,logoHidden:we,isMobile:Ee,isAudioDisabled:Pe,isLiveCatchUpMode:H,fullScreenTarget:G,failoverHosts:O,canDownload:ge,callbacks:Q,interactiveData:M,showThumbTimer:J,additionalButtons:Me=[],repeat:Te}=V1(this.videoConfig,t),{sources:Le,title:x,thumbUrl:ue,videoLogoUrl:ve,unitedVideoId:re,isClip:Fe=!1,duration:He,adsParams:rt={},videoEpisodes:lt,previewThumbsData:ze,subtitles:mt,live:kt}=e,Re=Object.assign(Object.assign({},A),rt),Ne=this.getNextVideoInfo(),Wt={sources:Le,title:x,thumbUrl:ue,subtitles:mt,unitedVideoId:re,isClip:Fe,live:kt,albumId:L,statPlace:E,autoplay:Y,muted:ne,volume:W,fromTime:X,canRewindLive:ee,showAds:te,adsSlotId:fe,adsParams:Re,adsPreviewParam:oe,duration:He,logoClickable:ke,logoHidden:we,isMobile:Ee,repeat:Te,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:Ne.nextVideoTitle,endScreenVideoThumb:Ne.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist()},At={pictureInPictureApi:this.pictureInPictureApi,annotationsApi:this.annotationsApi};this.log({message:`create player, props: ${JSON.stringify(Wt)}`});const ut=this.uiConfig.features.statistics&&!!re,{pid:et}=((l=(o=this.videoConfig)===null||o===void 0?void 0:o.interactiveData)===null||l===void 0?void 0:l.projectInfo)||{};ut&&new go(Object.assign({movieId:re,albumId:L,place:E,trackCode:B,autoplay:(s=Y&&!this.interactiveController)!==null&&s!==void 0?s:!1,mobile:Ee,clip:Fe},et&&!this.isInited&&{projectId:Number(et)}),Object.assign({refreshAuthToken:N,userSalt:w,config:this.statistics.config},this.interactiveController&&{useIsid:!0,isid:this.prevIsid})),this.uiConfig.features.sentry&&this.uiConfig.sentry.dsn&&new zl(this.uiConfig.sentry,{version:Qo,env:d0},{movieId:re,albumId:L,place:E,autoplay:(r=Y&&!this.interactiveController)!==null&&r!==void 0?r:!1,mobile:Ee,clip:Fe}),this.interactiveController&&((a=this.prevIsid)!==null&&a!==void 0||(this.prevIsid=(c=go.getInstance())===null||c===void 0?void 0:c.oneStat.isid$.getValue())),this.statistics=Object.assign(Object.assign({},this.statistics),go.getInstance()),this.sentry=Object.assign(Object.assign({},this.sentry),zl.getInstance());const Xe=!!M,$e=(f=this.interactiveController)===null||f===void 0?void 0:f.getInteractiveRanges(),Je=[];let Ze;if(Xe&&this.interactiveController){const st=this.interactiveController.state,Ke=this.interactiveController.getHistoryState();st.isInitialChapter$.getValue()&&Je.push(vt.REPLAY_BUTTON),this.interactiveController.getIsSeekable().getValue()||Je.push(vt.SEEK_TO_INTERACTIVE_BUTTON),Ke.hasPrevChapter$.getValue()||(st.isInitialChapter$.getValue()?Ze="tooltip_interactive_go_back_disabled_first":st.lastChapterChangeWasInitiatedByInteractive$.getValue()?Ze="tooltip_interactive_go_back_disabled":Ze="tooltip_interactive_go_back_disabled_limit",Je.push(vt.PLAY_PREV_CHAPTER_BUTTON))}const dt=()=>{var st;this.isInited=!1,this.prevIsid=void 0;const Ke=(n==null?void 0:n.info.isEnded$.getValue())&&((st=this.interactiveController)===null||st===void 0?void 0:st.state.isEndChapter$.getValue());Q.onReplayInteractiveVideo&&!Ke?Q.onReplayInteractiveVideo():this.replayInteractiveVideo()};this.store=s6({player:n,interfaceLanguage:ae,videoId:re,isClip:Fe,isLiveCatchUpMode:H,isAudioDisabled:Pe,statAuthToken:P,callbacks:Q,webApi:At,videoEpisodes:lt,previewThumbsData:ze,canDownload:ge,uiConfig:this.uiConfig,coreConfig:this.coreConfig,disabledControls:Je,isInteractive:Xe,interactiveRanges:$e,replayInteractive:dt,playPrevChapterDisabledTooltip:Ze,hasInteractiveBranches:!!(!((p=(h=this.interactiveController)===null||h===void 0?void 0:h.getChapterBranches())===null||p===void 0)&&p.length),additionalButtons:this.uiConfig.features.additionalButtons?Me:[],looped:Te&&this.videoConfig.videos.length===1});const{stores:xe}=this.microStoresRoot=y6();this.subscription.add(this.store.state.currentFormat$.subscribe(st=>{var Ke;return(Ke=Q==null?void 0:Q.onCurrentFormatChanged)===null||Ke===void 0?void 0:Ke.call(Q,st)})),this.subscription.add(xe.interactiveControlsOpacity$.subscribe(st=>{var Ke;st!==null&&((Ke=this===null||this===void 0?void 0:this.interactiveController)===null||Ke===void 0||Ke.setDisabledControls(st))})),this.subscription.add(this.store.state.throughputEstimation$.subscribe(st=>{var Ke;return(Ke=Q==null?void 0:Q.onThroughputEstimationChanged)===null||Ke===void 0?void 0:Ke.call(Q,st)})),this.subscription.add(this.store.state.videoBitrate$.subscribe(st=>{var Ke;return(Ke=Q==null?void 0:Q.onVideoBitrateChanged)===null||Ke===void 0?void 0:Ke.call(Q,st)})),this.subscription.add(this.store.state.isInteractiveTime$.subscribe(st=>{var Ke;const tt=(Ke=this.store)===null||Ke===void 0?void 0:Ke.ui.controls.disabledControls$;tt&&(st&&!tt.includes(Ho)&&tt.add(Ho),st||tt.remove(Ho))})),this.initMediaSession(),this.interactiveController&&ut&&this.initInteractivesStatistics(),this.svelteRootComponent=new jg({target:this.playerContainer,props:{interactiveContainer:this.interactiveContainer,sources:Le,store:this.store,microStoresRoot:this.microStoresRoot,uiConfig:this.uiConfig,title:x,thumbUrl:ue,videoLogoUrl:ve,subtitles:mt,live:kt,preload:U,autoplay:Y,muted:ne,volume:W,fromTime:X,canRewindLive:ee,supportLink:T,showAds:te,adsSlotId:fe,adsParams:Re,adsPreviewParam:oe,duration:He,logoClickable:ke,logoHidden:we,isMobile:Ee,failoverHosts:O,fullScreenTarget:G,showMiniTimer:J,outerContainerRef:this.playerContainer,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:Ne.nextVideoTitle,endScreenVideoThumb:Ne.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist(),playNextVideo:()=>this.playNextVideo(),playPrevVideo:()=>this.playPrevVideo(),repeatPlaylist:()=>this.repeatPlaylist(),playPrevChapter:()=>this.playPrevChapter(),seekToInteractive:()=>this.seekToInteractive(),toggleGraph:()=>this.toggleGraph()}}),this.addPlayerInfoSubscriptions(),this.isInited||(this.isInited=!0,(_=(g=(b=this.videoConfig)===null||b===void 0?void 0:b.callbacks)===null||g===void 0?void 0:g.onInited)===null||_===void 0||_.call(g))}addPlayerInfoSubscriptions(){var e;if(this.isInited)return;const t=this.store,n=(e=this.videoConfig)===null||e===void 0?void 0:e.callbacks;n&&this.subscription.add(t.playerPhase.subscribe(l=>{var s;return(s=n.onPlayerPhaseChanged)===null||s===void 0?void 0:s.call(n,l)})).add(t.state.playbackState$.subscribe(l=>{var s;return(s=n.onPlaybackStateChanged)===null||s===void 0?void 0:s.call(n,l)})).add(t.state.isLive$.subscribe(l=>{var s;return(s=n.onIsLiveChanged)===null||s===void 0?void 0:s.call(n,l)})).add(t.state.isActiveLive$.subscribe(l=>{var s;return(s=n.onIsActiveLiveChanged)===null||s===void 0?void 0:s.call(n,l)})).add(t.state.isAudioAvailable$.subscribe(l=>{var s;return(s=n.onIsAudioAvailableChanged)===null||s===void 0?void 0:s.call(n,l)})).add(t.state.currentQuality$.subscribe(l=>{var s;return(s=n.onCurrentQualityChanged)===null||s===void 0?void 0:s.call(n,l)})).add(t.state.availableQualities$.subscribe(l=>{var s;return(s=n.onAvailableQualitiesChanged)===null||s===void 0?void 0:s.call(n,l.map(({value:r})=>r).filter(r=>r!==oo.AUTO))})).add(t.ui.isPictureInPictureActive$.subscribe(l=>{var s,r;return l?(s=n.onPiPEnter)===null||s===void 0?void 0:s.call(n):(r=n.onPiPExit)===null||r===void 0?void 0:r.call(n)}));const o=n==null?void 0:n.uiInfo;o&&this.subscription.add(t.ui.controlsVisible.subscribe(l=>{var s;return(s=o.onControlsVisibleChanged)===null||s===void 0?void 0:s.call(o,l)})).add(t.ui.isMobile.subscribe(l=>{var s;return(s=o.onIsMobileChanged)===null||s===void 0?void 0:s.call(o,l)})).add(t.ui.playerSize.subscribe(l=>{var s;return(s=o.onPlayerSizeChanged)===null||s===void 0?void 0:s.call(o,l)})).add(t.ui.controls.prevButton.subscribe(l=>{var s;return(s=o.onPrevButtonChanged)===null||s===void 0?void 0:s.call(o,l)})).add(t.ui.controls.playButton.subscribe(l=>{var s;return(s=o.onPlayButtonChanged)===null||s===void 0?void 0:s.call(o,l)})).add(t.ui.controls.replayButton.subscribe(l=>{var s;return(s=o.onReplayButtonChanged)===null||s===void 0?void 0:s.call(o,l)})).add(t.ui.controls.nextButton.subscribe(l=>{var s;return(s=o.onNextButtonChanged)===null||s===void 0?void 0:s.call(o,l)})).add(t.ui.controls.playPrevChapterButton.subscribe(l=>{var s;return(s=o.onPlayPrevChapterChanged)===null||s===void 0?void 0:s.call(o,l)})).add(t.ui.controls.seekToInteractiveButton.subscribe(l=>{var s;return(s=o.onSeekToInteractiveButtonChanged)===null||s===void 0?void 0:s.call(o,l)})).add(t.ui.controls.interactiveGraphButton.subscribe(l=>{var s;return(s=o.onGraphButtonChanged)===null||s===void 0?void 0:s.call(o,l)})).add(t.ui.controls.liveButton.subscribe(l=>{var s;return(s=o.onLiveButtonChanged)===null||s===void 0?void 0:s.call(o,l)})).add(t.ui.controls.time.subscribe(l=>{var s;return(s=o.onTimeUpdateChanged)===null||s===void 0?void 0:s.call(o,l)})).add(t.ui.controls.episodes.subscribe(l=>{var s;return(s=o.onEpisodesChanged)===null||s===void 0?void 0:s.call(o,l)})).add(t.ui.controls.volume.subscribe(l=>{var s;return(s=o.onVolumeChanged)===null||s===void 0?void 0:s.call(o,l)})).add(t.ui.controls.subtitles.subscribe(l=>{var s;return(s=o.onSubtitlesChanged)===null||s===void 0?void 0:s.call(o,l)})).add(t.ui.controls.settings.subscribe(l=>{var s;return(s=o.onSettingsChanged)===null||s===void 0?void 0:s.call(o,l)})).add(t.ui.controls.fullscreen.subscribe(l=>{var s;return(s=o.onFullscreenChanged)===null||s===void 0?void 0:s.call(o,l)})).add(t.ui.controls.chromecast.subscribe(l=>{var s;return(s=o.onChromecastChanged)===null||s===void 0?void 0:s.call(o,l)})).add(t.ui.controls.vkLogo.subscribe(l=>{var s;return(s=o.onVkLogoChanged)===null||s===void 0?void 0:s.call(o,l)}))}playNextVideo(){var e;if(!this.videoConfig)return;let t=!0;if(!((e=this.videoConfig.callbacks)===null||e===void 0)&&e.onNextVideoClick)try{t=this.videoConfig.callbacks.onNextVideoClick()}catch(n){this.log({message:"onNextVideoClick callback failed to execute"})}t&&(this.currentPlayingVideoIndex++,this.currentPlayingVideoIndex>=this.videoConfig.videos.length&&(this.currentPlayingVideoIndex=0),this.log({message:`play next video, index: ${this.currentPlayingVideoIndex}`}),this.createPlayerWithCurrentVideo())}playPrevVideo(){var e;if(!this.videoConfig)return;let t=!0;if(!((e=this.videoConfig.callbacks)===null||e===void 0)&&e.onPrevVideoClick)try{t=this.videoConfig.callbacks.onPrevVideoClick()}catch(n){this.log({message:"onPrevVideoClick callback failed to execute"})}t&&(this.currentPlayingVideoIndex--,this.currentPlayingVideoIndex<0&&(this.currentPlayingVideoIndex=this.videoConfig.videos.length-1),this.log({message:`play prev video, index: ${this.currentPlayingVideoIndex}`}),this.createPlayerWithCurrentVideo())}repeatPlaylist(){this.currentPlayingVideoIndex=0,this.log({message:"repeat playlist"}),this.createPlayerWithCurrentVideo()}createPlayerWithCurrentVideo(e,t=!0){var n;if(!this.videoConfig)return;const o=this.videoConfig.videos[this.currentPlayingVideoIndex];if(!o){this.log({message:"no next video"});return}this.isInited&&le.isNonNullable(o.unitedVideoId)&&this.store.actions.internal.nextMovie(o.unitedVideoId),(n=this.svelteRootComponent)===null||n===void 0||n.$destroy(),this.createPlayer(o,{autoplay:t,fromTime:0},e)}playPrevChapter(){var e;(e=this.interactiveController)===null||e===void 0||e.playPrevChapter()}seekToInteractive(){var e;const t=(e=this.interactiveController)===null||e===void 0?void 0:e.getNextInteractiveStartTime();typeof t=="number"&&this.seekTime(t/1e3)}toggleGraph(){var e,t;if(!this.isInited)return;const n=this.store,{isEnded$:o,playbackState$:l,graphIsOpened$:s}=n.state,{disabledControls$:r}=n.ui.controls,a=it(o),c=it(l);it(s)?(s.set(!1),(e=this.interactiveController)===null||e===void 0||e.toggleGraphView(!1),r.remove(cs),!a&&this.graphMadePause&&this.play()):(this.graphMadePause=c==="playing",s.set(!0),(t=this.interactiveController)===null||t===void 0||t.toggleGraphView(!0),r.add(cs),!a&&this.graphMadePause&&this.pause())}initInteractives(){var e,t,n,o;return Yi(this,void 0,void 0,function*(){if(!((e=this.videoConfig)===null||e===void 0)&&e.interactiveData)try{const{Interactives:l,EVENT_NAMES:s,CustomError:r}=yield import("@vkontakte/videoplayer-interactive/es2015.cjs.js");this.interactiveContainer=document.createElement("div"),this.interactiveContainer.classList.add("interactiveContainer");const a=(t=this.store)===null||t===void 0?void 0:t.interfaceLanguage$,c=a?it(a):this.videoConfig.interfaceLanguage,{projectInfo:f,historyApi:h,videoLoader:p}=this.videoConfig.interactiveData;this.interactiveController=new l({parentElement:this.interactiveContainer,fullscreenTargetElement:this.playerContainer,lang:c,graph:this.uiConfig.features.interactiveGraph,projectInfo:f,historyApi:h,vkVideoLoader:p,lastFrame:this.uiConfig.features.interactiveLastFrame,permanentTextControls:this.uiConfig.features.interactiveTextPermanent,initSeamless:!0}),yield this.interactiveController.setManifest(this.videoConfig.interactiveData.manifest);const{isInteractiveExpectation$:b}=this.interactiveController.state;this.uiConfig.features.seekToInteractive&&this.subscription.add(this.interactiveController.getIsSeekable().subscribe(_=>{if(!this.isInited)return;const L=this.store;_?L.ui.controls.disabledControls$.remove(vt.SEEK_TO_INTERACTIVE_BUTTON):L.ui.controls.disabledControls$.add(vt.SEEK_TO_INTERACTIVE_BUTTON)})),this.subscription.add(b.subscribe(_=>{this.store&&this.store.state.isInteractiveExpectation$.set(_)}));let g=!0;if(this.interactiveController.on(s.playerChanged,_=>{if(!this.videoConfig)return;this.videoConfig.videos[this.currentPlayingVideoIndex]=Object.assign(Object.assign({},_.config),{title:(f==null?void 0:f.title)||_.config.title});const L=g?this.videoConfig.autoplay:!0;this.createPlayerWithCurrentVideo(_.player,L),g&&(g=!1)}),this.interactiveController.on(s.interactives,({type:_,subjectId:L,actionType:E})=>{var w,P,B,N;if(!this.store)return;const U=b.getValue();if(_==="container-removed"&&this.store.actions.internal.completeInteractiveRange(L),_==="action-choice"&&E==="setRandomBranch"&&(this.store.state.graphIsOpened$.set(!1),this.store.ui.controls.disabledControls$.remove(H1)),_==="action-choice-canceled"){const Y=it(this.store.state.isPlaying$)||U;if(!((w=this.videoConfig)===null||w===void 0)&&w.isMobile&&Y){this.store.ui.interactiveHideMobileControls.set(!0);return}(N=(P=this.videoConfig)===null||P===void 0?void 0:(B=P.callbacks).onDisabledInteractiveClick)===null||N===void 0||N.call(B)}}),!((o=(n=this.videoConfig)===null||n===void 0?void 0:n.callbacks)===null||o===void 0)&&o.onInteractiveHistoryChanged){const _=this.interactiveController.getHistoryState();this.subscription.add(_.history$.subscribe(L=>{var E,w,P;L.length&&((P=(w=(E=this.videoConfig)===null||E===void 0?void 0:E.callbacks)===null||w===void 0?void 0:w.onInteractiveHistoryChanged)===null||P===void 0||P.call(w,L))}))}this.interactiveController.on(s.errors,_=>{this.log({message:_.toString()})})}catch(l){this.log({message:l.message})}})}initInteractivesStatistics(){var e,t;return Yi(this,void 0,void 0,function*(){const{statSubscription:n,oneStat:o}=this.statistics;if(!(!n||!o||!this.interactiveController))try{const{INTERACTIVE_CLICK_ACTIONS:l}=yield import("@vkontakte/videoplayer-interactive/es2015.cjs.js"),s={[l.GO_NEXT_BUTTON]:wt.InteractiveInterfaceClick.NEXT_BUTTON,[l.GO_NEXT_AREA]:wt.InteractiveInterfaceClick.NEXT_AREA,[l.WATCH_AGAIN]:wt.InteractiveInterfaceClick.WATCH_AGAIN,[l.OPEN_GRAPH]:wt.InteractiveInterfaceClick.GRAPH_SHOW,[l.CLOSE_GRAPH]:wt.InteractiveInterfaceClick.GRAPH_HIDE},{click$:r,nextMovie$:a}=this.interactiveController.getStatEvents(),c=new le.Subject;r.subscribe(f=>{var h,p;f in s?c.next(s[f]):(o==null||o.logError({errorType:"InteractiveVideosAction",fatal:!1}),(p=(h=this.sentry).report)===null||p===void 0||p.call(h,new Error("InteractiveVideosAction"),{errorType:"InteractiveVideosAction",fatal:!1}))}),n.add(o.attachToInteractive({click$:c,nextMovie$:a}))}catch(l){o==null||o.logError({errorType:"InteractiveVideos",fatal:!1}),(t=(e=this.sentry).report)===null||t===void 0||t.call(e,l,{errorType:"InteractiveVideosAction",fatal:!1})}})}initPlayer(e,t={}){var n,o,l,s,r,a,c,f,h,p,b,g,_,L,E,w,P,B,N;if(!Array.isArray(e.videos)||e.videos.length===0&&!e.interactiveData)throw new Error("empty videos");this.videoConfig=V1(S6,le.cloneDeepWith(e,U=>U instanceof HTMLElement?U:void 0)),this.uiConfig=l0((n=t.ui)!==null&&n!==void 0?n:{}),this.coreConfig=(o=t.core)!==null&&o!==void 0?o:{configName:[]},this.statistics={config:(l=t.statistics)!==null&&l!==void 0?l:{}},this.sentry={config:(s=this.uiConfig.sentry)!==null&&s!==void 0?s:{}},le.isNonNullable(this.videoConfig.isMediaSessionEnabled)&&(this.uiConfig.features.mediaSession=(r=this.videoConfig.isMediaSessionEnabled)!==null&&r!==void 0?r:!0),le.isNonNullable(this.videoConfig.isPictureInPictureEnabled)&&(this.uiConfig.features.pip=(c=(a=this.uiConfig.features.pip)!==null&&a!==void 0?a:this.videoConfig.isPictureInPictureEnabled)!==null&&c!==void 0?c:!0,this.uiConfig.features.dpip=(h=(f=this.uiConfig.features.dpip)!==null&&f!==void 0?f:this.videoConfig.isPictureInPictureEnabled)!==null&&h!==void 0?h:!0),this.videoConfig.isMobile=(p=this.uiConfig.isMobile)!==null&&p!==void 0?p:this.videoConfig.isMobile,(B=this.videoConfig).autoplay&&(B.autoplay=this.uiConfig.features.autoplay),this.videoConfig.showAds=(b=this.uiConfig.ads.enable)!==null&&b!==void 0?b:this.videoConfig.showAds,this.videoConfig.adsSlotId=(g=this.uiConfig.ads.slot)!==null&&g!==void 0?g:this.videoConfig.adsSlotId,this.videoConfig.adsPreviewParam=(_=this.uiConfig.ads.preview)!==null&&_!==void 0?_:this.videoConfig.adsPreviewParam,this.videoConfig.logoHidden=!((L=this.uiConfig.showLogo)!==null&&L!==void 0?L:!this.videoConfig.logoHidden),(N=this.videoConfig).canRewindLive&&(N.canRewindLive=this.uiConfig.features.liveRewind),this.videoConfig.supportLink=(E=this.videoConfig.supportLink)!==null&&E!==void 0?E:this.uiConfig.supportLink,this.currentPlayingVideoIndex=0,this.needToRepeatPlaylist=this.videoConfig.repeat,this.uiConfig.features.pip&&(this.uiConfig.features.dpip?this.pictureInPictureApi=g6.getLatestSupportedVersion():this.pictureInPictureApi=new Gl),this.mediaSessionApi=this.uiConfig.features.mediaSession?new r6:void 0,this.annotationsApi=this.uiConfig.features.annotations?new _6:void 0,(w=this.svelteStubComponent)===null||w===void 0||w.$destroy(),(P=this.svelteRootComponent)===null||P===void 0||P.$destroy(),this.isInited=!1,this.prevIsid=void 0,this.interactiveController&&(this.interactiveController.destroy(),this.interactiveController=void 0),e.interactiveData?this.initInteractives():this.createPlayer(e.videos[0]),v6(this.pictureInPictureApi)&&this.pictureInPictureApi.setPlayerDomElement(this.playerContainer,this._shadowRoot)}isOneVideoPlaylist(){return this.videoConfig?this.videoConfig.videos.length===1:!1}updateNextVideos(e){var t;if(!this.videoConfig)return;this.log({message:`update next videos, videos: ${JSON.stringify(e)}`}),this.videoConfig.videos.splice(this.currentPlayingVideoIndex+1),this.videoConfig.videos.push(...e);const n=this.getNextVideoInfo();(t=this.svelteRootComponent)===null||t===void 0||t.$set({showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:n.nextVideoTitle,endScreenVideoThumb:n.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist()})}initMediaSession(){var e,t;this.mediaSessionApi&&((e=this.unsubscribePlayerPhaseSubscription)===null||e===void 0||e.call(this),this.unsubscribePlayerPhaseSubscription=(t=this.store)===null||t===void 0?void 0:t.playerPhase.subscribe(n=>{n===Be.Video?this.setupMediaSessionForVideo():n===Be.Ads&&this.setupMediaSessionForAds()}))}setupMediaSessionForVideo(){if(!(!this.videoConfig||!this.mediaSessionApi))try{const{title:e,thumbUrl:t}=Object.assign({},this.videoConfig.videos[this.currentPlayingVideoIndex]),n=[["play",()=>this.play()],["pause",()=>this.pause()],["seekto",o=>this.seekTime(o.seekTime)]];this.videoConfig.videos.length>1&&(this.currentPlayingVideoIndex<this.videoConfig.videos.length-1&&n.push(["nexttrack",()=>this.playNextVideo()]),this.currentPlayingVideoIndex>0&&n.push(["previoustrack",()=>this.playPrevVideo()])),this.mediaSessionApi.setMetaData({title:e,thumbUrl:t}),this.mediaSessionApi.updateActionHandlers(n)}catch(e){this.log({message:e.message})}}setupMediaSessionForAds(){if(!(!this.videoConfig||!this.mediaSessionApi))try{const e="\u0420\u0435\u043A\u043B\u0430\u043C\u0430",t=[["play",()=>this.play()],["pause",()=>this.pause()]];this.mediaSessionApi.setMetaData({title:e}),this.mediaSessionApi.updateActionHandlers(t)}catch(e){this.log({message:e.message})}}play(){var e,t;this.isControlDisabled(vt.PLAY_BUTTON)||!((e=this.store)===null||e===void 0)&&e.playerPhase.is(Be.WaitingLive)||(this.log({message:"play"}),(t=this.svelteRootComponent)===null||t===void 0||t.play())}pause(){var e;this.log({message:"pause"}),(e=this.svelteRootComponent)===null||e===void 0||e.pause()}stop(){var e,t;if(!this.videoConfig)return;this.log({message:"stop"}),(e=this.svelteStubComponent)===null||e===void 0||e.$destroy();const n=this.videoConfig.videos[0];n&&((t=this.svelteRootComponent)===null||t===void 0||t.$destroy(),this.createPlayer(n))}setMuted(e){var t;this.log({message:`set muted, muted: ${e}`}),(t=this.svelteRootComponent)===null||t===void 0||t.setMuted(e)}setVolume(e){var t;this.log({message:`set volume, volume: ${e}`}),(t=this.svelteRootComponent)===null||t===void 0||t.setVolume(e)}setRepeat(e){var t;this.log({message:`set repeat, repeat: ${e}`}),this.needToRepeatPlaylist=e,(t=this.svelteRootComponent)===null||t===void 0||t.$set({needToRepeatPlaylist:this.needToRepeatPlaylist,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive()})}seekTime(e){var t;this.isControlDisabled(vt.TIMELINE)||(this.log({message:`seek time, time: ${e}`}),(t=this.svelteRootComponent)===null||t===void 0||t.seekTime(e))}seekEpisodeStartTime(e){var t;this.log({message:`seek episode start time, time: ${e}`}),(t=this.svelteRootComponent)===null||t===void 0||t.seekEpisodeStartTime(e)}setPlaybackRate(e){var t;this.log({message:`set playback rate to: ${e}`}),(t=this.svelteRootComponent)===null||t===void 0||t.setPlaybackRate(e)}setAutoQualityLimits(e){var t,n,o;this.log({message:`set auto quality limitation. Max: ${(t=e.max)!==null&&t!==void 0?t:"none"}. Min: ${(n=e.min)!==null&&n!==void 0?n:"none"}`}),(o=this.svelteRootComponent)===null||o===void 0||o.setAutoQualityLimits(e)}addLanguage(e){var t;(t=this.store)===null||t===void 0||t.actions.internal.addLanguage(e)}setLanguage(e){var t;return Yi(this,void 0,void 0,function*(){yield(t=this.store)===null||t===void 0?void 0:t.actions.internal.setLanguage(e)})}setLiveStart(e){var t,n;this.log({message:"live started"}),(t=this.store)===null||t===void 0||t.actions.internal.setWaitingLive(!1),(n=this.svelteRootComponent)===null||n===void 0||n.initVideo(e),this.play()}setWaitRecord(){var e,t;this.log({message:"post live"}),(e=this.store)===null||e===void 0||e.actions.internal.setWaitingRecord(!0),(t=this.store)===null||t===void 0||t.destroy()}setLiveEnd(e){var t,n;this.log({message:"live ended"}),(t=this.store)===null||t===void 0||t.actions.internal.setWaitingRecord(!1),(n=this.svelteRootComponent)===null||n===void 0||n.$destroy(),this.createPlayer(e,{autoplay:!1})}getDeviceId(){var e,t;return(t=(e=go.getInstance())===null||e===void 0?void 0:e.oneStat.getDeviceId())!==null&&t!==void 0?t:void 0}replayInteractiveVideo(){this.interactiveController&&this.interactiveController.setChapter()}}const C6=()=>{window.customElements.define("vk-video-player",P6)};Object.defineProperty(exports,"VideoFormat",{enumerable:!0,get:function(){return nt.VideoFormat}});Object.defineProperty(exports,"VideoQuality",{enumerable:!0,get:function(){return nt.VideoQuality}});Object.defineProperty(exports,"InterfaceLanguage",{enumerable:!0,get:function(){return le.InterfaceLanguage}});Object.defineProperty(exports,"VKNumericLanguage",{enumerable:!0,get:function(){return le.VKNumericLanguage}});Object.defineProperty(exports,"loadVKLangPack",{enumerable:!0,get:function(){return le.loadVKLangPack}});exports.VERSION=Qo;exports.registerPlayerWebComponent=C6;
51
+ `),o=document.createElement("style");o.textContent=n;const l=this.createStretchedContainer(),s=l.attachShadow({mode:"open"});s.append(o),s.append(this.playerDomElement),this.playerDummyElement=new m6({target:this.playerParentShadowRoot,context:this.svelteContext}),(e=this.pipWindow)===null||e===void 0||e.document.body.append(l),this.info.isActive$.next(!0),(t=this.pipWindow)===null||t===void 0||t.addEventListener("unload",r=>{!this.playerDomElement||!this.playerParentShadowRoot||!this.playerDummyElement||(this.playerDummyElement.$destroy(),this.playerParentShadowRoot.append(this.playerDomElement),this.info.isActive$.next(!1))})})}remove(){return Yi(this,void 0,void 0,function*(){return new Promise(e=>{var t;(t=documentPictureInPicture.window)===null||t===void 0||t.close(),e()})})}dispose(){return Yi(this,void 0,void 0,function*(){yield this.remove()})}createStretchedContainer(){const e=document.createElement("div");return e.style.width="100%",e.style.height="100%",e}}function v6(i){return i instanceof Ic}class g6{static getLatestSupportedVersion(){const e=new Gl,t=new Ic;if(t.isSupported())return t;if(e.isSupported())return e}}function V1(i,e){var t,n;const o=new Set([...Object.keys(i),...Object.keys(e)]),l={};for(const s of o)l[s]=(n=(t=e[s])!==null&&t!==void 0?t:i[s])!==null&&n!==void 0?n:void 0;return l}const I1="Inner error. Unexpectedly root annotation container null reference exception",b6="Annotation layer with such name already exists";class Ll extends Error{constructor(e){super(e),this.name="AnnotationError"}}class _6{constructor(){this.layers=new Map}registryRootContainer(e){this.detach(),this.rootAnnotationsContainer=e}addLayer(e){if(!this.rootAnnotationsContainer)throw new Ll(I1);if(this.layers.has(e))throw new Ll(b6);const t=document.createElement("div");return t.className="annotations-layer",t.style.width="100%",t.style.height="100%",t.style.position="absolute",t.style.left="0",t.style.top="0",this.rootAnnotationsContainer.append(t),this.layers.set(e,t),t}getLayer(e){return this.layers.get(e)}removeLayer(e){const t=this.layers.get(e);t&&this.layers.delete(e)&&t.remove()}clearLayer(e){const t=this.layers.get(e);for(;t!=null&&t.lastChild;)t.lastChild.remove()}detach(){for(const e of this.layers.values())e.remove()}reattach(){if(!this.rootAnnotationsContainer)throw new Ll(I1);for(const e of this.layers.values())this.rootAnnotationsContainer.append(e)}destroy(){this.detach(),this.layers.clear(),this.rootAnnotationsContainer=void 0}}class Mc{init(e,t){return le.assertNonNullable(e),le.assertNonNullable(t),this.subscription=new le.Subscription,this.subscription}}class w6 extends Mc{constructor(){super(...arguments),this.stateName="fakeIsPlaying$",this.state$=Object.assign(Object.assign({},Ue(null)),{toggle:()=>this.state$.update(e=>!e)})}init(e,t){const n=super.init(e,t),{isInteractiveExpectation$:o}=e.state;return n.add(o.subscribe(l=>{this.state$.set(l?!0:null)})),n}}class k6 extends Mc{constructor(){super(...arguments),this.stateName="interactiveControlsOpacity$",this.state$=Object.assign(Object.assign({},Ue(null)),{toggle:()=>this.state$.update(e=>!e)})}init(e,t){const n=super.init(e,t),{fakeIsPlaying$:o}=t,{isInteractiveExpectation$:l,isPlaying$:s}=e.state,{controlsVisible:r,isMobile:a}=e.ui,c=it(a),f=()=>c&&it(r);return n.add(r.subscribe(h=>{if(!c)return;const p=it(o);it(s)?this.state$.set(h):p!==null&&this.state$.set(!p||h)})),n.add(s.subscribe(h=>{this.state$.set(!h||f())})),n.add(o.subscribe(h=>{if(h===null)return;const p=it(l);if(f()){this.state$.set(!0);return}p&&this.state$.set(!h)})),n}}const y6=()=>[w6,k6].reduce(({subscribers:i,stores:e},t)=>{const n=new t;return{subscribers:[...i,n],stores:Object.assign(Object.assign({},e),{[n.stateName]:n.state$})}},{subscribers:[],stores:{}}),S6={preload:!0,autoplay:!1,repeat:!1,fromTime:0,canRewindLive:!0,showAds:!1,interfaceLanguage:le.InterfaceLanguage.RU,logoClickable:!1,logoHidden:!1,isMobile:le.isMobile(),isMediaSessionEnabled:!0,isPictureInPictureEnabled:!0,isAudioDisabled:!1,callbacks:{uiInfo:{}},tuningConfig:{configName:[]}};class P6 extends HTMLElement{constructor(){var e;super(),this.currentPlayingVideoIndex=0,this.needToRepeatPlaylist=!1,this.videoConfig=void 0,this.pictureInPictureApi=void 0,this.mediaSessionApi=void 0,this.unsubscribePlayerPhaseSubscription=void 0,this.annotationsApi=void 0,this.prevIsid=void 0,this.isInited=!1,this._shadowRoot=this.attachShadow({mode:"open"}),this.playerContainer=document.createElement("div"),this.playerContainer.style.all="initial",this.playerContainer.style.display="block",this.playerContainer.style.contain="strict",this.playerContainer.style.width="100%",this.playerContainer.style.height="100%",this._shadowRoot.append(this.playerContainer),this.logger=new le.Logger,this.log=this.logger.createComponentLog("VKVideoPlayer"),this.subscription=new le.Subscription,this.graphMadePause=!1,!((e=window==null?void 0:window.videoPlayerConfig)===null||e===void 0)&&e.debugLogs&&this.subscription.add(this.logger.log$.subscribe(t=>{console.log("%c player web component ","background:#77dd77;",`${t.component}`,t.message)}))}connectedCallback(){var e,t;if(this.isInited)return;const n=(e=this.getAttribute("stub-title"))!==null&&e!==void 0?e:void 0,o=(t=this.getAttribute("stub-thumb-url"))!==null&&t!==void 0?t:void 0;this.svelteStubComponent=new Qg({target:this.playerContainer,props:{title:n,thumbUrl:o}})}disconnectedCallback(){var e,t,n,o,l;(e=this.annotationsApi)===null||e===void 0||e.destroy(),(t=this.svelteRootComponent)===null||t===void 0||t.$destroy(),(n=this.svelteStubComponent)===null||n===void 0||n.$destroy(),this.subscription.unsubscribe(),(o=this.unsubscribePlayerPhaseSubscription)===null||o===void 0||o.call(this),(l=this.interactiveController)===null||l===void 0||l.destroy()}needToShowNextPrevButtons(){return this.videoConfig?this.videoConfig.videos.length>1:!1}isNextButtonActive(){return this.videoConfig?this.needToShowNextPrevButtons()&&(this.currentPlayingVideoIndex<this.videoConfig.videos.length-1||this.needToRepeatPlaylist):!1}isPrevButtonActive(){return this.videoConfig?this.needToShowNextPrevButtons()&&(this.currentPlayingVideoIndex>0||this.needToRepeatPlaylist):!1}isControlDisabled(e){var t;const n=(t=this.store)===null||t===void 0?void 0:t.ui.controls.disabledControls$;return(n==null?void 0:n.includes(e))||!1}getNextVideoInfo(){if(!this.videoConfig)return{nextVideoTitle:void 0,nextVideoThumb:void 0};const e=this.videoConfig.videos[this.currentPlayingVideoIndex+1]||{};return{nextVideoTitle:e.title,nextVideoThumb:e.thumbUrl}}createPlayer(e,t={},n){var o,l,s,r,a,c,f,h,p,b,g,_;if(!this.videoConfig)return;const{albumId:L,statPlace:E,statUserSalt:w,statAuthToken:P,statTrackCode:B,refreshStatAuthToken:N,preload:U,autoplay:Y,volume:W,muted:ne,fromTime:X,canRewindLive:ee,supportLink:T,showAds:te,adsSlotId:fe,adsParams:A={},adsPreviewParam:oe,interfaceLanguage:ae,logoClickable:ke,logoHidden:we,isMobile:Ee,isAudioDisabled:Pe,isLiveCatchUpMode:H,fullScreenTarget:G,failoverHosts:O,canDownload:ge,callbacks:Q,interactiveData:M,showThumbTimer:J,additionalButtons:Me=[],repeat:Te}=V1(this.videoConfig,t),{sources:Le,title:x,thumbUrl:ue,videoLogoUrl:ve,unitedVideoId:re,isClip:Fe=!1,duration:He,adsParams:rt={},videoEpisodes:lt,previewThumbsData:ze,subtitles:mt,live:kt}=e,Re=Object.assign(Object.assign({},A),rt),Ne=this.getNextVideoInfo(),Wt={sources:Le,title:x,thumbUrl:ue,subtitles:mt,unitedVideoId:re,isClip:Fe,live:kt,albumId:L,statPlace:E,autoplay:Y,muted:ne,volume:W,fromTime:X,canRewindLive:ee,showAds:te,adsSlotId:fe,adsParams:Re,adsPreviewParam:oe,duration:He,logoClickable:ke,logoHidden:we,isMobile:Ee,repeat:Te,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:Ne.nextVideoTitle,endScreenVideoThumb:Ne.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist()},At={pictureInPictureApi:this.pictureInPictureApi,annotationsApi:this.annotationsApi};this.log({message:`create player, props: ${JSON.stringify(Wt)}`});const ut=this.uiConfig.features.statistics&&!!re,{pid:et}=((l=(o=this.videoConfig)===null||o===void 0?void 0:o.interactiveData)===null||l===void 0?void 0:l.projectInfo)||{};ut&&new go(Object.assign({movieId:re,albumId:L,place:E,trackCode:B,autoplay:(s=Y&&!this.interactiveController)!==null&&s!==void 0?s:!1,mobile:Ee,clip:Fe},et&&!this.isInited&&{projectId:Number(et)}),Object.assign({refreshAuthToken:N,userSalt:w,config:this.statistics.config},this.interactiveController&&{useIsid:!0,isid:this.prevIsid})),this.uiConfig.features.sentry&&this.uiConfig.sentry.dsn&&new zl(this.uiConfig.sentry,{version:Qo,env:d0},{movieId:re,albumId:L,place:E,autoplay:(r=Y&&!this.interactiveController)!==null&&r!==void 0?r:!1,mobile:Ee,clip:Fe}),this.interactiveController&&((a=this.prevIsid)!==null&&a!==void 0||(this.prevIsid=(c=go.getInstance())===null||c===void 0?void 0:c.oneStat.isid$.getValue())),this.statistics=Object.assign(Object.assign({},this.statistics),go.getInstance()),this.sentry=Object.assign(Object.assign({},this.sentry),zl.getInstance());const Xe=!!M,$e=(f=this.interactiveController)===null||f===void 0?void 0:f.getInteractiveRanges(),Je=[];let Ze;if(Xe&&this.interactiveController){const st=this.interactiveController.state,Ke=this.interactiveController.getHistoryState();st.isInitialChapter$.getValue()&&Je.push(vt.REPLAY_BUTTON),this.interactiveController.getIsSeekable().getValue()||Je.push(vt.SEEK_TO_INTERACTIVE_BUTTON),Ke.hasPrevChapter$.getValue()||(st.isInitialChapter$.getValue()?Ze="tooltip_interactive_go_back_disabled_first":st.lastChapterChangeWasInitiatedByInteractive$.getValue()?Ze="tooltip_interactive_go_back_disabled":Ze="tooltip_interactive_go_back_disabled_limit",Je.push(vt.PLAY_PREV_CHAPTER_BUTTON))}const dt=()=>{var st;this.isInited=!1,this.prevIsid=void 0;const Ke=(n==null?void 0:n.info.isEnded$.getValue())&&((st=this.interactiveController)===null||st===void 0?void 0:st.state.isEndChapter$.getValue());Q.onReplayInteractiveVideo&&!Ke?Q.onReplayInteractiveVideo():this.replayInteractiveVideo()};this.store=s6({player:n,interfaceLanguage:ae,videoId:re,isClip:Fe,isLiveCatchUpMode:H,isAudioDisabled:Pe,statAuthToken:P,callbacks:Q,webApi:At,videoEpisodes:lt,previewThumbsData:ze,canDownload:ge,uiConfig:this.uiConfig,coreConfig:this.coreConfig,disabledControls:Je,isInteractive:Xe,interactiveRanges:$e,replayInteractive:dt,playPrevChapterDisabledTooltip:Ze,hasInteractiveBranches:!!(!((p=(h=this.interactiveController)===null||h===void 0?void 0:h.getChapterBranches())===null||p===void 0)&&p.length),additionalButtons:this.uiConfig.features.additionalButtons?Me:[],looped:Te&&this.videoConfig.videos.length===1});const{stores:xe}=this.microStoresRoot=y6();this.subscription.add(this.store.state.currentFormat$.subscribe(st=>{var Ke;return(Ke=Q==null?void 0:Q.onCurrentFormatChanged)===null||Ke===void 0?void 0:Ke.call(Q,st)})),this.subscription.add(xe.interactiveControlsOpacity$.subscribe(st=>{var Ke;st!==null&&((Ke=this===null||this===void 0?void 0:this.interactiveController)===null||Ke===void 0||Ke.setDisabledControls(st))})),this.subscription.add(this.store.state.throughputEstimation$.subscribe(st=>{var Ke;return(Ke=Q==null?void 0:Q.onThroughputEstimationChanged)===null||Ke===void 0?void 0:Ke.call(Q,st)})),this.subscription.add(this.store.state.videoBitrate$.subscribe(st=>{var Ke;return(Ke=Q==null?void 0:Q.onVideoBitrateChanged)===null||Ke===void 0?void 0:Ke.call(Q,st)})),this.subscription.add(this.store.state.isInteractiveTime$.subscribe(st=>{var Ke;const tt=(Ke=this.store)===null||Ke===void 0?void 0:Ke.ui.controls.disabledControls$;tt&&(st&&!tt.includes(Ho)&&tt.add(Ho),st||tt.remove(Ho))})),this.initMediaSession(),this.interactiveController&&ut&&this.initInteractivesStatistics(),this.svelteRootComponent=new jg({target:this.playerContainer,props:{interactiveContainer:this.interactiveContainer,sources:Le,store:this.store,microStoresRoot:this.microStoresRoot,uiConfig:this.uiConfig,title:x,thumbUrl:ue,videoLogoUrl:ve,subtitles:mt,live:kt,preload:U,autoplay:Y,muted:ne,volume:W,fromTime:X,canRewindLive:ee,supportLink:T,showAds:te,adsSlotId:fe,adsParams:Re,adsPreviewParam:oe,duration:He,logoClickable:ke,logoHidden:we,isMobile:Ee,failoverHosts:O,fullScreenTarget:G,showMiniTimer:J,outerContainerRef:this.playerContainer,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:Ne.nextVideoTitle,endScreenVideoThumb:Ne.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist(),playNextVideo:()=>this.playNextVideo(),playPrevVideo:()=>this.playPrevVideo(),repeatPlaylist:()=>this.repeatPlaylist(),playPrevChapter:()=>this.playPrevChapter(),seekToInteractive:()=>this.seekToInteractive(),toggleGraph:()=>this.toggleGraph()}}),this.addPlayerInfoSubscriptions(),this.isInited||(this.isInited=!0,(_=(g=(b=this.videoConfig)===null||b===void 0?void 0:b.callbacks)===null||g===void 0?void 0:g.onInited)===null||_===void 0||_.call(g))}addPlayerInfoSubscriptions(){var e;if(this.isInited)return;const t=this.store,n=(e=this.videoConfig)===null||e===void 0?void 0:e.callbacks;n&&this.subscription.add(t.playerPhase.subscribe(l=>{var s;return(s=n.onPlayerPhaseChanged)===null||s===void 0?void 0:s.call(n,l)})).add(t.state.playbackState$.subscribe(l=>{var s;return(s=n.onPlaybackStateChanged)===null||s===void 0?void 0:s.call(n,l)})).add(t.state.isLive$.subscribe(l=>{var s;return(s=n.onIsLiveChanged)===null||s===void 0?void 0:s.call(n,l)})).add(t.state.isActiveLive$.subscribe(l=>{var s;return(s=n.onIsActiveLiveChanged)===null||s===void 0?void 0:s.call(n,l)})).add(t.state.isAudioAvailable$.subscribe(l=>{var s;return(s=n.onIsAudioAvailableChanged)===null||s===void 0?void 0:s.call(n,l)})).add(t.state.currentQuality$.subscribe(l=>{var s;return(s=n.onCurrentQualityChanged)===null||s===void 0?void 0:s.call(n,l)})).add(t.state.availableQualities$.subscribe(l=>{var s;return(s=n.onAvailableQualitiesChanged)===null||s===void 0?void 0:s.call(n,l.map(({value:r})=>r).filter(r=>r!==oo.AUTO))})).add(t.ui.isPictureInPictureActive$.subscribe(l=>{var s,r;return l?(s=n.onPiPEnter)===null||s===void 0?void 0:s.call(n):(r=n.onPiPExit)===null||r===void 0?void 0:r.call(n)}));const o=n==null?void 0:n.uiInfo;o&&this.subscription.add(t.ui.controlsVisible.subscribe(l=>{var s;return(s=o.onControlsVisibleChanged)===null||s===void 0?void 0:s.call(o,l)})).add(t.ui.isMobile.subscribe(l=>{var s;return(s=o.onIsMobileChanged)===null||s===void 0?void 0:s.call(o,l)})).add(t.ui.playerSize.subscribe(l=>{var s;return(s=o.onPlayerSizeChanged)===null||s===void 0?void 0:s.call(o,l)})).add(t.ui.controls.prevButton.subscribe(l=>{var s;return(s=o.onPrevButtonChanged)===null||s===void 0?void 0:s.call(o,l)})).add(t.ui.controls.playButton.subscribe(l=>{var s;return(s=o.onPlayButtonChanged)===null||s===void 0?void 0:s.call(o,l)})).add(t.ui.controls.replayButton.subscribe(l=>{var s;return(s=o.onReplayButtonChanged)===null||s===void 0?void 0:s.call(o,l)})).add(t.ui.controls.nextButton.subscribe(l=>{var s;return(s=o.onNextButtonChanged)===null||s===void 0?void 0:s.call(o,l)})).add(t.ui.controls.playPrevChapterButton.subscribe(l=>{var s;return(s=o.onPlayPrevChapterChanged)===null||s===void 0?void 0:s.call(o,l)})).add(t.ui.controls.seekToInteractiveButton.subscribe(l=>{var s;return(s=o.onSeekToInteractiveButtonChanged)===null||s===void 0?void 0:s.call(o,l)})).add(t.ui.controls.interactiveGraphButton.subscribe(l=>{var s;return(s=o.onGraphButtonChanged)===null||s===void 0?void 0:s.call(o,l)})).add(t.ui.controls.liveButton.subscribe(l=>{var s;return(s=o.onLiveButtonChanged)===null||s===void 0?void 0:s.call(o,l)})).add(t.ui.controls.time.subscribe(l=>{var s;return(s=o.onTimeUpdateChanged)===null||s===void 0?void 0:s.call(o,l)})).add(t.ui.controls.episodes.subscribe(l=>{var s;return(s=o.onEpisodesChanged)===null||s===void 0?void 0:s.call(o,l)})).add(t.ui.controls.volume.subscribe(l=>{var s;return(s=o.onVolumeChanged)===null||s===void 0?void 0:s.call(o,l)})).add(t.ui.controls.subtitles.subscribe(l=>{var s;return(s=o.onSubtitlesChanged)===null||s===void 0?void 0:s.call(o,l)})).add(t.ui.controls.settings.subscribe(l=>{var s;return(s=o.onSettingsChanged)===null||s===void 0?void 0:s.call(o,l)})).add(t.ui.controls.fullscreen.subscribe(l=>{var s;return(s=o.onFullscreenChanged)===null||s===void 0?void 0:s.call(o,l)})).add(t.ui.controls.chromecast.subscribe(l=>{var s;return(s=o.onChromecastChanged)===null||s===void 0?void 0:s.call(o,l)})).add(t.ui.controls.vkLogo.subscribe(l=>{var s;return(s=o.onVkLogoChanged)===null||s===void 0?void 0:s.call(o,l)}))}playNextVideo(){var e;if(!this.videoConfig)return;let t=!0;if(!((e=this.videoConfig.callbacks)===null||e===void 0)&&e.onNextVideoClick)try{t=this.videoConfig.callbacks.onNextVideoClick()}catch(n){this.log({message:"onNextVideoClick callback failed to execute"})}t&&(this.currentPlayingVideoIndex++,this.currentPlayingVideoIndex>=this.videoConfig.videos.length&&(this.currentPlayingVideoIndex=0),this.log({message:`play next video, index: ${this.currentPlayingVideoIndex}`}),this.createPlayerWithCurrentVideo())}playPrevVideo(){var e;if(!this.videoConfig)return;let t=!0;if(!((e=this.videoConfig.callbacks)===null||e===void 0)&&e.onPrevVideoClick)try{t=this.videoConfig.callbacks.onPrevVideoClick()}catch(n){this.log({message:"onPrevVideoClick callback failed to execute"})}t&&(this.currentPlayingVideoIndex--,this.currentPlayingVideoIndex<0&&(this.currentPlayingVideoIndex=this.videoConfig.videos.length-1),this.log({message:`play prev video, index: ${this.currentPlayingVideoIndex}`}),this.createPlayerWithCurrentVideo())}repeatPlaylist(){this.currentPlayingVideoIndex=0,this.log({message:"repeat playlist"}),this.createPlayerWithCurrentVideo()}createPlayerWithCurrentVideo(e,t=!0){var n;if(!this.videoConfig)return;const o=this.videoConfig.videos[this.currentPlayingVideoIndex];if(!o){this.log({message:"no next video"});return}this.isInited&&le.isNonNullable(o.unitedVideoId)&&this.store.actions.internal.nextMovie(o.unitedVideoId),(n=this.svelteRootComponent)===null||n===void 0||n.$destroy(),this.createPlayer(o,{autoplay:t,fromTime:0},e)}playPrevChapter(){var e;(e=this.interactiveController)===null||e===void 0||e.playPrevChapter()}seekToInteractive(){var e;const t=(e=this.interactiveController)===null||e===void 0?void 0:e.getNextInteractiveStartTime();typeof t=="number"&&this.seekTime(t/1e3)}toggleGraph(){var e,t;if(!this.isInited)return;const n=this.store,{isEnded$:o,playbackState$:l,graphIsOpened$:s}=n.state,{disabledControls$:r}=n.ui.controls,a=it(o),c=it(l);it(s)?(s.set(!1),(e=this.interactiveController)===null||e===void 0||e.toggleGraphView(!1),r.remove(cs),!a&&this.graphMadePause&&this.play()):(this.graphMadePause=c==="playing",s.set(!0),(t=this.interactiveController)===null||t===void 0||t.toggleGraphView(!0),r.add(cs),!a&&this.graphMadePause&&this.pause())}initInteractives(){var e,t,n,o;return Yi(this,void 0,void 0,function*(){if(!((e=this.videoConfig)===null||e===void 0)&&e.interactiveData)try{const{Interactives:l,EVENT_NAMES:s,CustomError:r}=yield import("@vkontakte/videoplayer-interactive/es2015.cjs.js");this.interactiveContainer=document.createElement("div"),this.interactiveContainer.classList.add("interactiveContainer");const a=(t=this.store)===null||t===void 0?void 0:t.interfaceLanguage$,c=a?it(a):this.videoConfig.interfaceLanguage,{projectInfo:f,historyApi:h,videoLoader:p}=this.videoConfig.interactiveData;this.interactiveController=new l({parentElement:this.interactiveContainer,fullscreenTargetElement:this.playerContainer,lang:c,graph:this.uiConfig.features.interactiveGraph,projectInfo:f,historyApi:h,vkVideoLoader:p,lastFrame:this.uiConfig.features.interactiveLastFrame,permanentTextControls:this.uiConfig.features.interactiveTextPermanent,initSeamless:!0,coreConfig:this.coreConfig}),yield this.interactiveController.setManifest(this.videoConfig.interactiveData.manifest);const{isInteractiveExpectation$:b}=this.interactiveController.state;this.uiConfig.features.seekToInteractive&&this.subscription.add(this.interactiveController.getIsSeekable().subscribe(_=>{if(!this.isInited)return;const L=this.store;_?L.ui.controls.disabledControls$.remove(vt.SEEK_TO_INTERACTIVE_BUTTON):L.ui.controls.disabledControls$.add(vt.SEEK_TO_INTERACTIVE_BUTTON)})),this.subscription.add(b.subscribe(_=>{this.store&&this.store.state.isInteractiveExpectation$.set(_)}));let g=!0;if(this.interactiveController.on(s.playerChanged,_=>{if(!this.videoConfig)return;this.videoConfig.videos[this.currentPlayingVideoIndex]=Object.assign(Object.assign({},_.config),{title:(f==null?void 0:f.title)||_.config.title});const L=g?this.videoConfig.autoplay:!0;this.createPlayerWithCurrentVideo(_.player,L),g&&(g=!1)}),this.interactiveController.on(s.interactives,({type:_,subjectId:L,actionType:E})=>{var w,P,B,N;if(!this.store)return;const U=b.getValue();if(_==="container-removed"&&this.store.actions.internal.completeInteractiveRange(L),_==="action-choice"&&E==="setRandomBranch"&&(this.store.state.graphIsOpened$.set(!1),this.store.ui.controls.disabledControls$.remove(H1)),_==="action-choice-canceled"){const Y=it(this.store.state.isPlaying$)||U;if(!((w=this.videoConfig)===null||w===void 0)&&w.isMobile&&Y){this.store.ui.interactiveHideMobileControls.set(!0);return}(N=(P=this.videoConfig)===null||P===void 0?void 0:(B=P.callbacks).onDisabledInteractiveClick)===null||N===void 0||N.call(B)}}),!((o=(n=this.videoConfig)===null||n===void 0?void 0:n.callbacks)===null||o===void 0)&&o.onInteractiveHistoryChanged){const _=this.interactiveController.getHistoryState();this.subscription.add(_.history$.subscribe(L=>{var E,w,P;L.length&&((P=(w=(E=this.videoConfig)===null||E===void 0?void 0:E.callbacks)===null||w===void 0?void 0:w.onInteractiveHistoryChanged)===null||P===void 0||P.call(w,L))}))}this.interactiveController.on(s.errors,_=>{this.log({message:_.toString()})})}catch(l){this.log({message:l.message})}})}initInteractivesStatistics(){var e,t;return Yi(this,void 0,void 0,function*(){const{statSubscription:n,oneStat:o}=this.statistics;if(!(!n||!o||!this.interactiveController))try{const{INTERACTIVE_CLICK_ACTIONS:l}=yield import("@vkontakte/videoplayer-interactive/es2015.cjs.js"),s={[l.GO_NEXT_BUTTON]:wt.InteractiveInterfaceClick.NEXT_BUTTON,[l.GO_NEXT_AREA]:wt.InteractiveInterfaceClick.NEXT_AREA,[l.WATCH_AGAIN]:wt.InteractiveInterfaceClick.WATCH_AGAIN,[l.OPEN_GRAPH]:wt.InteractiveInterfaceClick.GRAPH_SHOW,[l.CLOSE_GRAPH]:wt.InteractiveInterfaceClick.GRAPH_HIDE},{click$:r,nextMovie$:a}=this.interactiveController.getStatEvents(),c=new le.Subject;r.subscribe(f=>{var h,p;f in s?c.next(s[f]):(o==null||o.logError({errorType:"InteractiveVideosAction",fatal:!1}),(p=(h=this.sentry).report)===null||p===void 0||p.call(h,new Error("InteractiveVideosAction"),{errorType:"InteractiveVideosAction",fatal:!1}))}),n.add(o.attachToInteractive({click$:c,nextMovie$:a}))}catch(l){o==null||o.logError({errorType:"InteractiveVideos",fatal:!1}),(t=(e=this.sentry).report)===null||t===void 0||t.call(e,l,{errorType:"InteractiveVideosAction",fatal:!1})}})}initPlayer(e,t={}){var n,o,l,s,r,a,c,f,h,p,b,g,_,L,E,w,P,B,N;if(!Array.isArray(e.videos)||e.videos.length===0&&!e.interactiveData)throw new Error("empty videos");this.videoConfig=V1(S6,le.cloneDeepWith(e,U=>U instanceof HTMLElement?U:void 0)),this.uiConfig=l0((n=t.ui)!==null&&n!==void 0?n:{}),this.coreConfig=(o=t.core)!==null&&o!==void 0?o:{configName:[]},this.statistics={config:(l=t.statistics)!==null&&l!==void 0?l:{}},this.sentry={config:(s=this.uiConfig.sentry)!==null&&s!==void 0?s:{}},le.isNonNullable(this.videoConfig.isMediaSessionEnabled)&&(this.uiConfig.features.mediaSession=(r=this.videoConfig.isMediaSessionEnabled)!==null&&r!==void 0?r:!0),le.isNonNullable(this.videoConfig.isPictureInPictureEnabled)&&(this.uiConfig.features.pip=(c=(a=this.uiConfig.features.pip)!==null&&a!==void 0?a:this.videoConfig.isPictureInPictureEnabled)!==null&&c!==void 0?c:!0,this.uiConfig.features.dpip=(h=(f=this.uiConfig.features.dpip)!==null&&f!==void 0?f:this.videoConfig.isPictureInPictureEnabled)!==null&&h!==void 0?h:!0),this.videoConfig.isMobile=(p=this.uiConfig.isMobile)!==null&&p!==void 0?p:this.videoConfig.isMobile,(B=this.videoConfig).autoplay&&(B.autoplay=this.uiConfig.features.autoplay),this.videoConfig.showAds=(b=this.uiConfig.ads.enable)!==null&&b!==void 0?b:this.videoConfig.showAds,this.videoConfig.adsSlotId=(g=this.uiConfig.ads.slot)!==null&&g!==void 0?g:this.videoConfig.adsSlotId,this.videoConfig.adsPreviewParam=(_=this.uiConfig.ads.preview)!==null&&_!==void 0?_:this.videoConfig.adsPreviewParam,this.videoConfig.logoHidden=!((L=this.uiConfig.showLogo)!==null&&L!==void 0?L:!this.videoConfig.logoHidden),(N=this.videoConfig).canRewindLive&&(N.canRewindLive=this.uiConfig.features.liveRewind),this.videoConfig.supportLink=(E=this.videoConfig.supportLink)!==null&&E!==void 0?E:this.uiConfig.supportLink,this.currentPlayingVideoIndex=0,this.needToRepeatPlaylist=this.videoConfig.repeat,this.uiConfig.features.pip&&(this.uiConfig.features.dpip?this.pictureInPictureApi=g6.getLatestSupportedVersion():this.pictureInPictureApi=new Gl),this.mediaSessionApi=this.uiConfig.features.mediaSession?new r6:void 0,this.annotationsApi=this.uiConfig.features.annotations?new _6:void 0,(w=this.svelteStubComponent)===null||w===void 0||w.$destroy(),(P=this.svelteRootComponent)===null||P===void 0||P.$destroy(),this.isInited=!1,this.prevIsid=void 0,this.interactiveController&&(this.interactiveController.destroy(),this.interactiveController=void 0),e.interactiveData?this.initInteractives():this.createPlayer(e.videos[0]),v6(this.pictureInPictureApi)&&this.pictureInPictureApi.setPlayerDomElement(this.playerContainer,this._shadowRoot)}isOneVideoPlaylist(){return this.videoConfig?this.videoConfig.videos.length===1:!1}updateNextVideos(e){var t;if(!this.videoConfig)return;this.log({message:`update next videos, videos: ${JSON.stringify(e)}`}),this.videoConfig.videos.splice(this.currentPlayingVideoIndex+1),this.videoConfig.videos.push(...e);const n=this.getNextVideoInfo();(t=this.svelteRootComponent)===null||t===void 0||t.$set({showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:n.nextVideoTitle,endScreenVideoThumb:n.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist()})}initMediaSession(){var e,t;this.mediaSessionApi&&((e=this.unsubscribePlayerPhaseSubscription)===null||e===void 0||e.call(this),this.unsubscribePlayerPhaseSubscription=(t=this.store)===null||t===void 0?void 0:t.playerPhase.subscribe(n=>{n===Be.Video?this.setupMediaSessionForVideo():n===Be.Ads&&this.setupMediaSessionForAds()}))}setupMediaSessionForVideo(){if(!(!this.videoConfig||!this.mediaSessionApi))try{const{title:e,thumbUrl:t}=Object.assign({},this.videoConfig.videos[this.currentPlayingVideoIndex]),n=[["play",()=>this.play()],["pause",()=>this.pause()],["seekto",o=>this.seekTime(o.seekTime)]];this.videoConfig.videos.length>1&&(this.currentPlayingVideoIndex<this.videoConfig.videos.length-1&&n.push(["nexttrack",()=>this.playNextVideo()]),this.currentPlayingVideoIndex>0&&n.push(["previoustrack",()=>this.playPrevVideo()])),this.mediaSessionApi.setMetaData({title:e,thumbUrl:t}),this.mediaSessionApi.updateActionHandlers(n)}catch(e){this.log({message:e.message})}}setupMediaSessionForAds(){if(!(!this.videoConfig||!this.mediaSessionApi))try{const e="\u0420\u0435\u043A\u043B\u0430\u043C\u0430",t=[["play",()=>this.play()],["pause",()=>this.pause()]];this.mediaSessionApi.setMetaData({title:e}),this.mediaSessionApi.updateActionHandlers(t)}catch(e){this.log({message:e.message})}}play(){var e,t;this.isControlDisabled(vt.PLAY_BUTTON)||!((e=this.store)===null||e===void 0)&&e.playerPhase.is(Be.WaitingLive)||(this.log({message:"play"}),(t=this.svelteRootComponent)===null||t===void 0||t.play())}pause(){var e;this.log({message:"pause"}),(e=this.svelteRootComponent)===null||e===void 0||e.pause()}stop(){var e,t;if(!this.videoConfig)return;this.log({message:"stop"}),(e=this.svelteStubComponent)===null||e===void 0||e.$destroy();const n=this.videoConfig.videos[0];n&&((t=this.svelteRootComponent)===null||t===void 0||t.$destroy(),this.createPlayer(n))}setMuted(e){var t;this.log({message:`set muted, muted: ${e}`}),(t=this.svelteRootComponent)===null||t===void 0||t.setMuted(e)}setVolume(e){var t;this.log({message:`set volume, volume: ${e}`}),(t=this.svelteRootComponent)===null||t===void 0||t.setVolume(e)}setRepeat(e){var t;this.log({message:`set repeat, repeat: ${e}`}),this.needToRepeatPlaylist=e,(t=this.svelteRootComponent)===null||t===void 0||t.$set({needToRepeatPlaylist:this.needToRepeatPlaylist,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive()})}seekTime(e){var t;this.isControlDisabled(vt.TIMELINE)||(this.log({message:`seek time, time: ${e}`}),(t=this.svelteRootComponent)===null||t===void 0||t.seekTime(e))}seekEpisodeStartTime(e){var t;this.log({message:`seek episode start time, time: ${e}`}),(t=this.svelteRootComponent)===null||t===void 0||t.seekEpisodeStartTime(e)}setPlaybackRate(e){var t;this.log({message:`set playback rate to: ${e}`}),(t=this.svelteRootComponent)===null||t===void 0||t.setPlaybackRate(e)}setAutoQualityLimits(e){var t,n,o;this.log({message:`set auto quality limitation. Max: ${(t=e.max)!==null&&t!==void 0?t:"none"}. Min: ${(n=e.min)!==null&&n!==void 0?n:"none"}`}),(o=this.svelteRootComponent)===null||o===void 0||o.setAutoQualityLimits(e)}addLanguage(e){var t;(t=this.store)===null||t===void 0||t.actions.internal.addLanguage(e)}setLanguage(e){var t;return Yi(this,void 0,void 0,function*(){yield(t=this.store)===null||t===void 0?void 0:t.actions.internal.setLanguage(e)})}setLiveStart(e){var t,n;this.log({message:"live started"}),(t=this.store)===null||t===void 0||t.actions.internal.setWaitingLive(!1),(n=this.svelteRootComponent)===null||n===void 0||n.initVideo(e),this.play()}setWaitRecord(){var e,t;this.log({message:"post live"}),(e=this.store)===null||e===void 0||e.actions.internal.setWaitingRecord(!0),(t=this.store)===null||t===void 0||t.destroy()}setLiveEnd(e){var t,n;this.log({message:"live ended"}),(t=this.store)===null||t===void 0||t.actions.internal.setWaitingRecord(!1),(n=this.svelteRootComponent)===null||n===void 0||n.$destroy(),this.createPlayer(e,{autoplay:!1})}getDeviceId(){var e,t;return(t=(e=go.getInstance())===null||e===void 0?void 0:e.oneStat.getDeviceId())!==null&&t!==void 0?t:void 0}replayInteractiveVideo(){this.interactiveController&&this.interactiveController.setChapter()}}const C6=()=>{window.customElements.define("vk-video-player",P6)};Object.defineProperty(exports,"VideoFormat",{enumerable:!0,get:function(){return nt.VideoFormat}});Object.defineProperty(exports,"VideoQuality",{enumerable:!0,get:function(){return nt.VideoQuality}});Object.defineProperty(exports,"InterfaceLanguage",{enumerable:!0,get:function(){return le.InterfaceLanguage}});Object.defineProperty(exports,"VKNumericLanguage",{enumerable:!0,get:function(){return le.VKNumericLanguage}});Object.defineProperty(exports,"loadVKLangPack",{enumerable:!0,get:function(){return le.loadVKLangPack}});exports.VERSION=Qo;exports.registerPlayerWebComponent=C6;