@vkontakte/videoplayer 1.1.36-dev.55db5eff.0 → 1.1.36-dev.cdb7114a.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/es2018.cjs.js CHANGED
@@ -1,9 +1,9 @@
1
1
  /**
2
- * @vkontakte/videoplayer v1.1.36-dev.55db5eff.0
3
- * Fri, 31 May 2024 10:58:23 GMT
2
+ * @vkontakte/videoplayer v1.1.36-dev.cdb7114a.0
3
+ * Fri, 31 May 2024 07:45:19 GMT
4
4
  * https://st.mycdn.me/static/vkontakte-videoplayer/1-1-36/doc/
5
5
  */
6
- "use strict";var t0=Object.create;var Pl=Object.defineProperty;var i0=Object.getOwnPropertyDescriptor;var n0=Object.getOwnPropertyNames;var o0=Object.getPrototypeOf,l0=Object.prototype.hasOwnProperty;var r0=(t,e,i)=>e in t?Pl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var s0=(t,e,i,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of n0(e))!l0.call(t,l)&&l!==i&&Pl(t,l,{get:()=>e[l],enumerable:!(n=i0(e,l))||n.enumerable});return t};var Dr=(t,e,i)=>(i=t!=null?t0(o0(t)):{},s0(e||!t||!t.__esModule?Pl(i,"default",{value:t,enumerable:!0}):i,t));var Tl=(t,e,i)=>(r0(t,typeof e!="symbol"?e+"":e,i),i);var $e=require("@vkontakte/videoplayer-core/es2018.cjs.js"),ne=require("@vkontakte/videoplayer-shared/es2018.cjs.js"),yt=require("@vkontakte/videoplayer-statistics/es2018.cjs.js");require("@vkontakte/videoplayer-interactive/es2018.cjs.js");function K(){}function g1(t,e){for(const i in e)t[i]=e[i];return t}function b1(t){return t()}function zr(){return Object.create(null)}function nt(t){t.forEach(b1)}function In(t){return typeof t=="function"}function be(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let Go;function Fr(t,e){return Go||(Go=document.createElement("a")),Go.href=e,t===Go.href}function a0(t){return Object.keys(t).length===0}function Qt(t,...e){if(t==null){for(const n of e)n(void 0);return K}const i=t.subscribe(...e);return i.unsubscribe?()=>i.unsubscribe():i}function tt(t){let e;return Qt(t,i=>e=i)(),e}function D(t,e,i){t.$$.on_destroy.push(Qt(e,i))}function Hn(t,e,i,n){if(t){const l=_1(t,e,i,n);return t[0](l)}}function _1(t,e,i,n){return t[1]&&n?g1(i.ctx.slice(),t[1](n(e))):i.ctx}function Un(t,e,i,n){if(t[2]&&n){const l=t[2](n(i));if(e.dirty===void 0)return l;if(typeof l=="object"){const r=[],o=Math.max(e.dirty.length,l.length);for(let s=0;s<o;s+=1)r[s]=e.dirty[s]|l[s];return r}return e.dirty|l}return e.dirty}function qn(t,e,i,n,l,r){if(l){const o=_1(e,i,n,r);t.p(o,l)}}function jn(t){if(t.ctx.length>32){const e=[],i=t.ctx.length/32;for(let n=0;n<i;n++)e[n]=-1;return e}return-1}function u0(t){return t==null?"":t}const dl=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global;function p(t,e){t.appendChild(e)}function Ze(t,e,i){const n=c0(t);if(!n.getElementById(e)){const l=T("style");l.id=e,l.textContent=i,f0(n,l)}}function c0(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function f0(t,e){return p(t.head||t,e),e.sheet}function P(t,e,i){t.insertBefore(e,i||null)}function S(t){t.parentNode&&t.parentNode.removeChild(t)}function Ln(t,e){for(let i=0;i<t.length;i+=1)t[i]&&t[i].d(e)}function T(t){return document.createElement(t)}function N(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function ze(t){return document.createTextNode(t)}function O(){return ze(" ")}function mt(){return ze("")}function ve(t,e,i,n){return t.addEventListener(e,i,n),()=>t.removeEventListener(e,i,n)}function Jt(t){return function(e){return e.preventDefault(),t.call(this,e)}}function st(t){return function(e){return e.stopPropagation(),t.call(this,e)}}function u(t,e,i){i==null?t.removeAttribute(e):t.getAttribute(e)!==i&&t.setAttribute(e,i)}function d0(t){return Array.from(t.childNodes)}function et(t,e){e=""+e,t.data!==e&&(t.data=e)}function Ft(t,e,i,n){i==null?t.style.removeProperty(e):t.style.setProperty(e,i,n?"important":"")}let Yo;function m0(){if(Yo===void 0){Yo=!1;try{typeof window!="undefined"&&window.parent&&window.parent.document}catch(t){Yo=!0}}return Yo}function sr(t,e){getComputedStyle(t).position==="static"&&(t.style.position="relative");const n=T("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 l=m0();let r;return l?(n.src="data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\/script>",r=ve(window,"message",o=>{o.source===n.contentWindow&&e()})):(n.src="about:blank",n.onload=()=>{r=ve(n.contentWindow,"resize",e),e()}),p(t,n),()=>{(l||r&&n.contentWindow)&&r(),S(n)}}function B(t,e,i){t.classList.toggle(e,!!i)}function Nn(t,e){return new t(e)}let Io;function Ao(t){Io=t}function Vo(){if(!Io)throw new Error("Function called outside component initialization");return Io}function vn(t){Vo().$$.on_mount.push(t)}function ml(t){Vo().$$.on_destroy.push(t)}function xl(t,e){return Vo().$$.context.set(t,e),e}function ar(t){return Vo().$$.context.get(t)}function w1(){return Vo().$$.context}function ko(t,e){const i=t.$$.callbacks[e.type];i&&i.slice().forEach(n=>n.call(this,e))}const vo=[],Ce=[];let _o=[];const $l=[],k1=Promise.resolve();let er=!1;function y1(){er||(er=!0,k1.then(C1))}function Mo(){return y1(),k1}function yo(t){_o.push(t)}function je(t){$l.push(t)}const El=new Set;let uo=0;function C1(){if(uo!==0)return;const t=Io;do{try{for(;uo<vo.length;){const e=vo[uo];uo++,Ao(e),p0(e.$$)}}catch(e){throw vo.length=0,uo=0,e}for(Ao(null),vo.length=0,uo=0;Ce.length;)Ce.pop()();for(let e=0;e<_o.length;e+=1){const i=_o[e];El.has(i)||(El.add(i),i())}_o.length=0}while(vo.length);for(;$l.length;)$l.pop()();er=!1,El.clear(),Ao(t)}function p0(t){if(t.fragment!==null){t.update(),nt(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(yo)}}function h0(t){const e=[],i=[];_o.forEach(n=>t.indexOf(n)===-1?e.push(n):i.push(n)),i.forEach(n=>n()),_o=e}const rl=new Set;let io;function de(){io={r:0,c:[],p:io}}function me(){io.r||nt(io.c),io=io.p}function d(t,e){t&&t.i&&(rl.delete(t),t.i(e))}function v(t,e,i,n){if(t&&t.o){if(rl.has(t))return;rl.add(t),io.c.push(()=>{rl.delete(t),n&&(i&&t.d(1),n())}),t.o(e)}else n&&n()}function Zt(t){return(t==null?void 0:t.length)!==void 0?t:Array.from(t)}function v0(t,e){const i={},n={},l={$$scope:1};let r=t.length;for(;r--;){const o=t[r],s=e[r];if(s){for(const a in o)a in s||(n[a]=1);for(const a in s)l[a]||(i[a]=s[a],l[a]=1);t[r]=s}else for(const a in o)l[a]=1}for(const o in n)o in i||(i[o]=void 0);return i}function g0(t){return typeof t=="object"&&t!==null?t:{}}function We(t,e,i){const n=t.$$.props[e];n!==void 0&&(t.$$.bound[n]=i,i(t.$$.ctx[n]))}function q(t){t&&t.c()}function F(t,e,i){const{fragment:n,after_update:l}=t.$$;n&&n.m(e,i),yo(()=>{const r=t.$$.on_mount.map(b1).filter(In);t.$$.on_destroy?t.$$.on_destroy.push(...r):nt(r),t.$$.on_mount=[]}),l.forEach(yo)}function H(t,e){const i=t.$$;i.fragment!==null&&(h0(i.after_update),nt(i.on_destroy),i.fragment&&i.fragment.d(e),i.on_destroy=i.fragment=null,i.ctx=[])}function b0(t,e){t.$$.dirty[0]===-1&&(vo.push(t),y1(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function we(t,e,i,n,l,r,o,s=[-1]){const a=Io;Ao(t);const c=t.$$={fragment:null,ctx:[],props:r,update:K,not_equal:l,bound:zr(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(a?a.$$.context:[])),callbacks:zr(),dirty:s,skip_bound:!1,root:e.target||a.$$.root};o&&o(c.root);let f=!1;if(c.ctx=i?i(t,e.props||{},(m,h,..._)=>{const g=_.length?_[0]:h;return c.ctx&&l(c.ctx[m],c.ctx[m]=g)&&(!c.skip_bound&&c.bound[m]&&c.bound[m](g),f&&b0(t,m)),h}):[],c.update(),f=!0,nt(c.before_update),c.fragment=n?n(c.ctx):!1,e.target){if(e.hydrate){const m=d0(e.target);c.fragment&&c.fragment.l(m),m.forEach(S)}else c.fragment&&c.fragment.c();e.intro&&d(t.$$.fragment),F(t,e.target,e.anchor),C1()}Ao(a)}class ke{constructor(){Tl(this,"$$");Tl(this,"$$set")}$destroy(){H(this,1),this.$destroy=K}$on(e,i){if(!In(i))return K;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(i),()=>{const l=n.indexOf(i);l!==-1&&n.splice(l,1)}}$set(e){this.$$set&&!a0(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const _0="4";typeof window!="undefined"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(_0);var Co;(function(t){t.VK="vk",t.VK_VIDEO="vk_video"})(Co||(Co={}));const w0={isMobile:void 0,defaultLanguage:ne.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:Co.VK_VIDEO,addTimeToLogoLink:!0,volumeDefault:1,volumeMinRestore:.05,loaderDelay:500,minSubtitlesFontSize:13,autoSubtitlesTimeout:2e3,allowChangingFullscreenTarget:!0,trafficSavingLimit:ne.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,contextMenuButton:!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},interactive:{historyMaxLength:100,noInteractionEventTimeout:3e4}},k0=t=>ne.fillWithDefault(t,w0),y0=t=>xl("ui-config",t),gn=()=>ar("ui-config"),tr="vk_player_debug_panel_opened",S1=300,C0=100,S0="videoplayer",P0="videoplayer";var Ae;(function(t){t.ArrowLeft="ArrowLeft",t.ArrowUp="ArrowUp",t.ArrowRight="ArrowRight",t.ArrowDown="ArrowDown",t.Comma="Comma",t.Period="Period",t.Space="Space",t.KeyM="KeyM",t.KeyF="KeyF",t.KeyK="KeyK",t.KeyL="KeyL",t.KeyJ="KeyJ",t.KeyC="KeyC",t.KeyI="KeyI",t.Digit1="Digit1",t.Digit2="Digit2",t.Digit3="Digit3",t.Digit4="Digit4",t.Digit5="Digit5",t.Digit6="Digit6",t.Digit7="Digit7",t.Digit8="Digit8",t.Digit9="Digit9",t.Digit0="Digit0",t.Numpad1="Numpad1",t.Numpad2="Numpad2",t.Numpad3="Numpad3",t.Numpad4="Numpad4",t.Numpad5="Numpad5",t.Numpad6="Numpad6",t.Numpad7="Numpad7",t.Numpad8="Numpad8",t.Numpad9="Numpad9",t.Numpad0="Numpad0",t.ShiftLeft="ShiftLeft",t.ShiftRight="ShiftRight",t.Slash="Slash",t.Tab="Tab",t.Escape="Escape",t.Enter="Enter"})(Ae||(Ae={}));const Bo={[Ae.KeyF]:"f",[Ae.KeyK]:"k",[Ae.KeyC]:"c",[Ae.KeyM]:"m"},T0=new Set([Ae.ArrowLeft,Ae.ArrowRight,Ae.KeyL,Ae.KeyJ]),E0=new Set([Ae.Tab,Ae.Space,Ae.ArrowLeft,Ae.ArrowRight,Ae.ArrowUp,Ae.ArrowDown]),A0=new Set([Ae.ShiftRight,Ae.ShiftLeft]);var dt;(function(t){t.PLAY_BUTTON="PLAY_BUTTON",t.REPLAY_BUTTON="REPLAY_BUTTON",t.NEXT_BUTTON="NEXT_BUTTON",t.PREV_BUTTON="PREV_BUTTON",t.PICTURE_IN_PICTURE="PICTURE_IN_PICTURE",t.FULLSCREEN_BUTTON="FULLSCREEN_BUTTON",t.SETTINGS_BUTTON="SETTINGS_BUTTON",t.LIVE_BUTTON="LIVE_BUTTON",t.GRAPH_BUTTON="GRAPH_BUTTON",t.PLAY_PREV_CHAPTER_BUTTON="PLAY_PREV_CHAPTER_BUTTON",t.SEEK_TO_INTERACTIVE_BUTTON="SEEK_TO_INTERACTIVE_BUTTON",t.TIMELINE="TIMELINE",t.VOLUME_BAR="VOLUME_BAR",t.MUTE_BUTTON="MUTE_BUTTON",t.SUBTITLES_BUTTON="SUBTITLES_BUTTON",t.CHROMECAST_BUTTON="CHROMECAST_BUTTON",t.VK_BUTTON="VK_BUTTON",t.EPISODE_BUTTON="EPISODE_BUTTON",t.INCREMENT_PLAYBACK_RATE="INCREMENT_PLAYBACK_RATE",t.DECREMENT_PLAYBACK_RATE="DECREMENT_PLAYBACK_RATE"})(dt||(dt={}));const Hr=40,P1=260,I0=60,Qo=8,T1=[dt.TIMELINE],sl=[...T1,dt.GRAPH_BUTTON],Ur=[...T1,dt.PLAY_BUTTON],E1=[...sl,dt.PLAY_BUTTON];var go;(function(t){t[t.XS=320]="XS",t[t.S=509]="S",t[t.M=599]="M",t[t.L=699]="L"})(go||(go={}));exports.GridTypes=void 0;(function(t){t.XS="xs",t.S="s",t.M="m",t.L="l",t.XL="xl"})(exports.GridTypes||(exports.GridTypes={}));const So={[exports.GridTypes.XS]:0,[exports.GridTypes.S]:1,[exports.GridTypes.M]:2,[exports.GridTypes.L]:3,[exports.GridTypes.XL]:4},co=[];function Bn(t,e){return{subscribe:Ne(t,e).subscribe}}function Ne(t,e=K){let i;const n=new Set;function l(s){if(be(t,s)&&(t=s,i)){const a=!co.length;for(const c of n)c[1](),co.push(c,t);if(a){for(let c=0;c<co.length;c+=2)co[c][0](co[c+1]);co.length=0}}}function r(s){l(s(t))}function o(s,a=K){const c=[s,a];return n.add(c),n.size===1&&(i=e(l,r)||K),s(t),()=>{n.delete(c),n.size===0&&i&&(i(),i=null)}}return{set:l,update:r,subscribe:o}}function Ri(t,e,i){const n=!Array.isArray(t),l=n?[t]:t;if(!l.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const r=e.length<2;return Bn(i,(o,s)=>{let a=!1;const c=[];let f=0,m=K;const h=()=>{if(f)return;m();const g=e(n?c[0]:c,o,s);r?o(g):m=In(g)?g:K},_=l.map((g,w)=>Qt(g,b=>{c[w]=b,f&=~(1<<w),a&&h()},()=>{f|=1<<w}));return a=!0,h(),function(){nt(_),m(),a=!1}})}const L0="prod",pl="1.1.36-dev.55db5eff.0",A1=(t,e,i)=>{const n=document.createElement("a");n.href=t,n.download=`${e}.${i}`,n.style.display="none",n.click()},I1=Symbol("storeContext"),L1=Symbol("microStoresContext"),V0=(t,e)=>{xl(I1,t),xl(L1,e)},Ct=()=>{const t=ar(I1);return ne.assertNonNullable(t,"Store context is empty!"),t},No=()=>{const t=ar(L1);return ne.assertNonNullable(t,"MicroStores context is empty!"),t},kt=(t,e)=>V1(t,t.getValue(),e),V1=(t,e,i)=>Bn(e,n=>{const l=t.subscribe(r=>{n(r),i==null||i(r)});return()=>l.unsubscribe()}),M0=(t,e,i)=>{var n,l,r,o;const s=t.info,{width:a,height:c}=tt(i.ui.playerSize),f=(l=(n=s.throughputEstimation$.getValue())===null||n===void 0?void 0:n.toFixed(0))!==null&&l!==void 0?l:0,m=(o=(r=s.rttEstimation$.getValue())===null||r===void 0?void 0:r.toFixed(0))!==null&&o!==void 0?o:0,h=s.isAutoQualityEnabled$.getValue()?"auto":"manual",_=`${pl} (core: ${$e.VERSION}, stat: ${yt.VERSION}, shared: ${ne.VERSION})`,g=tt(i.state.errorLog$),w=g.length?`
6
+ "use strict";var t0=Object.create;var Pl=Object.defineProperty;var i0=Object.getOwnPropertyDescriptor;var n0=Object.getOwnPropertyNames;var o0=Object.getPrototypeOf,l0=Object.prototype.hasOwnProperty;var r0=(t,e,i)=>e in t?Pl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var s0=(t,e,i,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of n0(e))!l0.call(t,l)&&l!==i&&Pl(t,l,{get:()=>e[l],enumerable:!(n=i0(e,l))||n.enumerable});return t};var Dr=(t,e,i)=>(i=t!=null?t0(o0(t)):{},s0(e||!t||!t.__esModule?Pl(i,"default",{value:t,enumerable:!0}):i,t));var Tl=(t,e,i)=>(r0(t,typeof e!="symbol"?e+"":e,i),i);var $e=require("@vkontakte/videoplayer-core/es2018.cjs.js"),ne=require("@vkontakte/videoplayer-shared/es2018.cjs.js"),yt=require("@vkontakte/videoplayer-statistics/es2018.cjs.js");require("@vkontakte/videoplayer-interactive/es2018.cjs.js");function K(){}function g1(t,e){for(const i in e)t[i]=e[i];return t}function b1(t){return t()}function zr(){return Object.create(null)}function nt(t){t.forEach(b1)}function In(t){return typeof t=="function"}function be(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let Go;function Fr(t,e){return Go||(Go=document.createElement("a")),Go.href=e,t===Go.href}function a0(t){return Object.keys(t).length===0}function Qt(t,...e){if(t==null){for(const n of e)n(void 0);return K}const i=t.subscribe(...e);return i.unsubscribe?()=>i.unsubscribe():i}function tt(t){let e;return Qt(t,i=>e=i)(),e}function D(t,e,i){t.$$.on_destroy.push(Qt(e,i))}function Hn(t,e,i,n){if(t){const l=_1(t,e,i,n);return t[0](l)}}function _1(t,e,i,n){return t[1]&&n?g1(i.ctx.slice(),t[1](n(e))):i.ctx}function Un(t,e,i,n){if(t[2]&&n){const l=t[2](n(i));if(e.dirty===void 0)return l;if(typeof l=="object"){const r=[],o=Math.max(e.dirty.length,l.length);for(let s=0;s<o;s+=1)r[s]=e.dirty[s]|l[s];return r}return e.dirty|l}return e.dirty}function qn(t,e,i,n,l,r){if(l){const o=_1(e,i,n,r);t.p(o,l)}}function jn(t){if(t.ctx.length>32){const e=[],i=t.ctx.length/32;for(let n=0;n<i;n++)e[n]=-1;return e}return-1}function u0(t){return t==null?"":t}const dl=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global;function p(t,e){t.appendChild(e)}function Ze(t,e,i){const n=c0(t);if(!n.getElementById(e)){const l=T("style");l.id=e,l.textContent=i,f0(n,l)}}function c0(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function f0(t,e){return p(t.head||t,e),e.sheet}function P(t,e,i){t.insertBefore(e,i||null)}function S(t){t.parentNode&&t.parentNode.removeChild(t)}function Ln(t,e){for(let i=0;i<t.length;i+=1)t[i]&&t[i].d(e)}function T(t){return document.createElement(t)}function N(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function ze(t){return document.createTextNode(t)}function O(){return ze(" ")}function mt(){return ze("")}function ve(t,e,i,n){return t.addEventListener(e,i,n),()=>t.removeEventListener(e,i,n)}function Jt(t){return function(e){return e.preventDefault(),t.call(this,e)}}function st(t){return function(e){return e.stopPropagation(),t.call(this,e)}}function u(t,e,i){i==null?t.removeAttribute(e):t.getAttribute(e)!==i&&t.setAttribute(e,i)}function d0(t){return Array.from(t.childNodes)}function et(t,e){e=""+e,t.data!==e&&(t.data=e)}function Ft(t,e,i,n){i==null?t.style.removeProperty(e):t.style.setProperty(e,i,n?"important":"")}let Yo;function m0(){if(Yo===void 0){Yo=!1;try{typeof window!="undefined"&&window.parent&&window.parent.document}catch(t){Yo=!0}}return Yo}function sr(t,e){getComputedStyle(t).position==="static"&&(t.style.position="relative");const n=T("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 l=m0();let r;return l?(n.src="data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\/script>",r=ve(window,"message",o=>{o.source===n.contentWindow&&e()})):(n.src="about:blank",n.onload=()=>{r=ve(n.contentWindow,"resize",e),e()}),p(t,n),()=>{(l||r&&n.contentWindow)&&r(),S(n)}}function B(t,e,i){t.classList.toggle(e,!!i)}function Nn(t,e){return new t(e)}let Io;function Ao(t){Io=t}function Vo(){if(!Io)throw new Error("Function called outside component initialization");return Io}function vn(t){Vo().$$.on_mount.push(t)}function ml(t){Vo().$$.on_destroy.push(t)}function xl(t,e){return Vo().$$.context.set(t,e),e}function ar(t){return Vo().$$.context.get(t)}function w1(){return Vo().$$.context}function ko(t,e){const i=t.$$.callbacks[e.type];i&&i.slice().forEach(n=>n.call(this,e))}const vo=[],Ce=[];let _o=[];const $l=[],k1=Promise.resolve();let er=!1;function y1(){er||(er=!0,k1.then(C1))}function Mo(){return y1(),k1}function yo(t){_o.push(t)}function je(t){$l.push(t)}const El=new Set;let uo=0;function C1(){if(uo!==0)return;const t=Io;do{try{for(;uo<vo.length;){const e=vo[uo];uo++,Ao(e),p0(e.$$)}}catch(e){throw vo.length=0,uo=0,e}for(Ao(null),vo.length=0,uo=0;Ce.length;)Ce.pop()();for(let e=0;e<_o.length;e+=1){const i=_o[e];El.has(i)||(El.add(i),i())}_o.length=0}while(vo.length);for(;$l.length;)$l.pop()();er=!1,El.clear(),Ao(t)}function p0(t){if(t.fragment!==null){t.update(),nt(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(yo)}}function h0(t){const e=[],i=[];_o.forEach(n=>t.indexOf(n)===-1?e.push(n):i.push(n)),i.forEach(n=>n()),_o=e}const rl=new Set;let io;function de(){io={r:0,c:[],p:io}}function me(){io.r||nt(io.c),io=io.p}function d(t,e){t&&t.i&&(rl.delete(t),t.i(e))}function v(t,e,i,n){if(t&&t.o){if(rl.has(t))return;rl.add(t),io.c.push(()=>{rl.delete(t),n&&(i&&t.d(1),n())}),t.o(e)}else n&&n()}function Zt(t){return(t==null?void 0:t.length)!==void 0?t:Array.from(t)}function v0(t,e){const i={},n={},l={$$scope:1};let r=t.length;for(;r--;){const o=t[r],s=e[r];if(s){for(const a in o)a in s||(n[a]=1);for(const a in s)l[a]||(i[a]=s[a],l[a]=1);t[r]=s}else for(const a in o)l[a]=1}for(const o in n)o in i||(i[o]=void 0);return i}function g0(t){return typeof t=="object"&&t!==null?t:{}}function We(t,e,i){const n=t.$$.props[e];n!==void 0&&(t.$$.bound[n]=i,i(t.$$.ctx[n]))}function q(t){t&&t.c()}function F(t,e,i){const{fragment:n,after_update:l}=t.$$;n&&n.m(e,i),yo(()=>{const r=t.$$.on_mount.map(b1).filter(In);t.$$.on_destroy?t.$$.on_destroy.push(...r):nt(r),t.$$.on_mount=[]}),l.forEach(yo)}function H(t,e){const i=t.$$;i.fragment!==null&&(h0(i.after_update),nt(i.on_destroy),i.fragment&&i.fragment.d(e),i.on_destroy=i.fragment=null,i.ctx=[])}function b0(t,e){t.$$.dirty[0]===-1&&(vo.push(t),y1(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function we(t,e,i,n,l,r,o,s=[-1]){const a=Io;Ao(t);const c=t.$$={fragment:null,ctx:[],props:r,update:K,not_equal:l,bound:zr(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(a?a.$$.context:[])),callbacks:zr(),dirty:s,skip_bound:!1,root:e.target||a.$$.root};o&&o(c.root);let f=!1;if(c.ctx=i?i(t,e.props||{},(m,h,..._)=>{const g=_.length?_[0]:h;return c.ctx&&l(c.ctx[m],c.ctx[m]=g)&&(!c.skip_bound&&c.bound[m]&&c.bound[m](g),f&&b0(t,m)),h}):[],c.update(),f=!0,nt(c.before_update),c.fragment=n?n(c.ctx):!1,e.target){if(e.hydrate){const m=d0(e.target);c.fragment&&c.fragment.l(m),m.forEach(S)}else c.fragment&&c.fragment.c();e.intro&&d(t.$$.fragment),F(t,e.target,e.anchor),C1()}Ao(a)}class ke{constructor(){Tl(this,"$$");Tl(this,"$$set")}$destroy(){H(this,1),this.$destroy=K}$on(e,i){if(!In(i))return K;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(i),()=>{const l=n.indexOf(i);l!==-1&&n.splice(l,1)}}$set(e){this.$$set&&!a0(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const _0="4";typeof window!="undefined"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(_0);var Co;(function(t){t.VK="vk",t.VK_VIDEO="vk_video"})(Co||(Co={}));const w0={isMobile:void 0,defaultLanguage:ne.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:Co.VK_VIDEO,addTimeToLogoLink:!0,volumeDefault:1,volumeMinRestore:.05,loaderDelay:500,minSubtitlesFontSize:13,autoSubtitlesTimeout:2e3,allowChangingFullscreenTarget:!0,trafficSavingLimit:ne.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,contextMenuButton:!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},interactive:{historyMaxLength:100,noInteractionEventTimeout:3e4}},k0=t=>ne.fillWithDefault(t,w0),y0=t=>xl("ui-config",t),gn=()=>ar("ui-config"),tr="vk_player_debug_panel_opened",S1=300,C0=100,S0="videoplayer",P0="videoplayer";var Ae;(function(t){t.ArrowLeft="ArrowLeft",t.ArrowUp="ArrowUp",t.ArrowRight="ArrowRight",t.ArrowDown="ArrowDown",t.Comma="Comma",t.Period="Period",t.Space="Space",t.KeyM="KeyM",t.KeyF="KeyF",t.KeyK="KeyK",t.KeyL="KeyL",t.KeyJ="KeyJ",t.KeyC="KeyC",t.KeyI="KeyI",t.Digit1="Digit1",t.Digit2="Digit2",t.Digit3="Digit3",t.Digit4="Digit4",t.Digit5="Digit5",t.Digit6="Digit6",t.Digit7="Digit7",t.Digit8="Digit8",t.Digit9="Digit9",t.Digit0="Digit0",t.Numpad1="Numpad1",t.Numpad2="Numpad2",t.Numpad3="Numpad3",t.Numpad4="Numpad4",t.Numpad5="Numpad5",t.Numpad6="Numpad6",t.Numpad7="Numpad7",t.Numpad8="Numpad8",t.Numpad9="Numpad9",t.Numpad0="Numpad0",t.ShiftLeft="ShiftLeft",t.ShiftRight="ShiftRight",t.Slash="Slash",t.Tab="Tab",t.Escape="Escape",t.Enter="Enter"})(Ae||(Ae={}));const Bo={[Ae.KeyF]:"f",[Ae.KeyK]:"k",[Ae.KeyC]:"c",[Ae.KeyM]:"m"},T0=new Set([Ae.ArrowLeft,Ae.ArrowRight,Ae.KeyL,Ae.KeyJ]),E0=new Set([Ae.Tab,Ae.Space,Ae.ArrowLeft,Ae.ArrowRight,Ae.ArrowUp,Ae.ArrowDown]),A0=new Set([Ae.ShiftRight,Ae.ShiftLeft]);var dt;(function(t){t.PLAY_BUTTON="PLAY_BUTTON",t.REPLAY_BUTTON="REPLAY_BUTTON",t.NEXT_BUTTON="NEXT_BUTTON",t.PREV_BUTTON="PREV_BUTTON",t.PICTURE_IN_PICTURE="PICTURE_IN_PICTURE",t.FULLSCREEN_BUTTON="FULLSCREEN_BUTTON",t.SETTINGS_BUTTON="SETTINGS_BUTTON",t.LIVE_BUTTON="LIVE_BUTTON",t.GRAPH_BUTTON="GRAPH_BUTTON",t.PLAY_PREV_CHAPTER_BUTTON="PLAY_PREV_CHAPTER_BUTTON",t.SEEK_TO_INTERACTIVE_BUTTON="SEEK_TO_INTERACTIVE_BUTTON",t.TIMELINE="TIMELINE",t.VOLUME_BAR="VOLUME_BAR",t.MUTE_BUTTON="MUTE_BUTTON",t.SUBTITLES_BUTTON="SUBTITLES_BUTTON",t.CHROMECAST_BUTTON="CHROMECAST_BUTTON",t.VK_BUTTON="VK_BUTTON",t.EPISODE_BUTTON="EPISODE_BUTTON",t.INCREMENT_PLAYBACK_RATE="INCREMENT_PLAYBACK_RATE",t.DECREMENT_PLAYBACK_RATE="DECREMENT_PLAYBACK_RATE"})(dt||(dt={}));const Hr=40,P1=260,I0=60,Qo=8,T1=[dt.TIMELINE],sl=[...T1,dt.GRAPH_BUTTON],Ur=[...T1,dt.PLAY_BUTTON],E1=[...sl,dt.PLAY_BUTTON];var go;(function(t){t[t.XS=320]="XS",t[t.S=509]="S",t[t.M=599]="M",t[t.L=699]="L"})(go||(go={}));exports.GridTypes=void 0;(function(t){t.XS="xs",t.S="s",t.M="m",t.L="l",t.XL="xl"})(exports.GridTypes||(exports.GridTypes={}));const So={[exports.GridTypes.XS]:0,[exports.GridTypes.S]:1,[exports.GridTypes.M]:2,[exports.GridTypes.L]:3,[exports.GridTypes.XL]:4},co=[];function Bn(t,e){return{subscribe:Ne(t,e).subscribe}}function Ne(t,e=K){let i;const n=new Set;function l(s){if(be(t,s)&&(t=s,i)){const a=!co.length;for(const c of n)c[1](),co.push(c,t);if(a){for(let c=0;c<co.length;c+=2)co[c][0](co[c+1]);co.length=0}}}function r(s){l(s(t))}function o(s,a=K){const c=[s,a];return n.add(c),n.size===1&&(i=e(l,r)||K),s(t),()=>{n.delete(c),n.size===0&&i&&(i(),i=null)}}return{set:l,update:r,subscribe:o}}function Ri(t,e,i){const n=!Array.isArray(t),l=n?[t]:t;if(!l.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const r=e.length<2;return Bn(i,(o,s)=>{let a=!1;const c=[];let f=0,m=K;const h=()=>{if(f)return;m();const g=e(n?c[0]:c,o,s);r?o(g):m=In(g)?g:K},_=l.map((g,w)=>Qt(g,b=>{c[w]=b,f&=~(1<<w),a&&h()},()=>{f|=1<<w}));return a=!0,h(),function(){nt(_),m(),a=!1}})}const L0="prod",pl="1.1.36-dev.cdb7114a.0",A1=(t,e,i)=>{const n=document.createElement("a");n.href=t,n.download=`${e}.${i}`,n.style.display="none",n.click()},I1=Symbol("storeContext"),L1=Symbol("microStoresContext"),V0=(t,e)=>{xl(I1,t),xl(L1,e)},Ct=()=>{const t=ar(I1);return ne.assertNonNullable(t,"Store context is empty!"),t},No=()=>{const t=ar(L1);return ne.assertNonNullable(t,"MicroStores context is empty!"),t},kt=(t,e)=>V1(t,t.getValue(),e),V1=(t,e,i)=>Bn(e,n=>{const l=t.subscribe(r=>{n(r),i==null||i(r)});return()=>l.unsubscribe()}),M0=(t,e,i)=>{var n,l,r,o;const s=t.info,{width:a,height:c}=tt(i.ui.playerSize),f=(l=(n=s.throughputEstimation$.getValue())===null||n===void 0?void 0:n.toFixed(0))!==null&&l!==void 0?l:0,m=(o=(r=s.rttEstimation$.getValue())===null||r===void 0?void 0:r.toFixed(0))!==null&&o!==void 0?o:0,h=s.isAutoQualityEnabled$.getValue()?"auto":"manual",_=`${pl} (core: ${$e.VERSION}, stat: ${yt.VERSION}, shared: ${ne.VERSION})`,g=tt(i.state.errorLog$),w=g.length?`
7
7
  `+g.map((k,y)=>{var M;const j=`${y}) Type: ${k.id}
8
8
  `,I=`Message: ${k.message} (${k.thrown})
9
9
  `,z=`Trace: ${(M=k.thrown)===null||M===void 0?void 0:M.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:not(.interactiveContainer 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}.out-of-view{position:absolute !important;left:-1000vh !important}`)}function E_(t){let e,i,n;function l(o){t[56](o)}let r={store:t[0],uiConfig:t[35],title:t[1],thumbUrl:t[2],videoLogoUrl:t[3],interactiveContainer:t[4],live:t[5],autoplay:t[6],canRewindLive:t[7],showAds:t[8],adsSlotId:t[9],adsParams:t[10],adsPreviewParam:t[11],duration:t[12],logoClickable:t[13],logoHidden:t[14],showNextPrevButtons:t[16],nextButtonActive:t[17],prevButtonActive:t[18],endScreenVideoTitle:t[19],endScreenVideoThumb:t[20],isOneVideoPlaylist:t[21],supportLink:t[22],outerContainerRef:t[23],fullScreenTarget:t[24],showMiniTimer:t[25],playerStarted:t[34],playNextVideo:t[26],playPrevVideo:t[27],repeatPlaylist:t[28],seekToInteractive:t[29],toggleGraph:t[30],playPrevChapter:t[31],firstStart:t[36]};return t[33]!==void 0&&(r.videoContainer=t[33]),e=new p_({props:r}),Ce.push(()=>We(e,"videoContainer",l)),{c(){q(e.$$.fragment)},m(o,s){F(e,o,s),n=!0},p(o,s){const a={};s[0]&1&&(a.store=o[0]),s[0]&2&&(a.title=o[1]),s[0]&4&&(a.thumbUrl=o[2]),s[0]&8&&(a.videoLogoUrl=o[3]),s[0]&16&&(a.interactiveContainer=o[4]),s[0]&32&&(a.live=o[5]),s[0]&64&&(a.autoplay=o[6]),s[0]&128&&(a.canRewindLive=o[7]),s[0]&256&&(a.showAds=o[8]),s[0]&512&&(a.adsSlotId=o[9]),s[0]&1024&&(a.adsParams=o[10]),s[0]&2048&&(a.adsPreviewParam=o[11]),s[0]&4096&&(a.duration=o[12]),s[0]&8192&&(a.logoClickable=o[13]),s[0]&16384&&(a.logoHidden=o[14]),s[0]&65536&&(a.showNextPrevButtons=o[16]),s[0]&131072&&(a.nextButtonActive=o[17]),s[0]&262144&&(a.prevButtonActive=o[18]),s[0]&524288&&(a.endScreenVideoTitle=o[19]),s[0]&1048576&&(a.endScreenVideoThumb=o[20]),s[0]&2097152&&(a.isOneVideoPlaylist=o[21]),s[0]&4194304&&(a.supportLink=o[22]),s[0]&8388608&&(a.outerContainerRef=o[23]),s[0]&16777216&&(a.fullScreenTarget=o[24]),s[0]&33554432&&(a.showMiniTimer=o[25]),s[1]&8&&(a.playerStarted=o[34]),s[0]&67108864&&(a.playNextVideo=o[26]),s[0]&134217728&&(a.playPrevVideo=o[27]),s[0]&268435456&&(a.repeatPlaylist=o[28]),s[0]&536870912&&(a.seekToInteractive=o[29]),s[0]&1073741824&&(a.toggleGraph=o[30]),s[1]&1&&(a.playPrevChapter=o[31]),!i&&s[1]&4&&(i=!0,a.videoContainer=o[33],je(()=>i=!1)),e.$set(a)},i(o){n||(d(e.$$.fragment,o),n=!0)},o(o){v(e.$$.fragment,o),n=!1},d(o){H(e,o)}}}function A_(t){let e,i,n;function l(o){t[55](o)}let r={store:t[0],uiConfig:t[35],thumbUrl:t[2],videoLogoUrl:t[3],interactiveContainer:t[4],live:t[5],autoplay:t[6],canRewindLive:t[7],showAds:t[8],adsSlotId:t[9],adsParams:t[10],adsPreviewParam:t[11],duration:t[12],logoClickable:t[13],logoHidden:t[14],showNextPrevButtons:t[16],nextButtonActive:t[17],prevButtonActive:t[18],endScreenVideoTitle:t[19],endScreenVideoThumb:t[20],isOneVideoPlaylist:t[21],supportLink:t[22],outerContainerRef:t[23],fullScreenTarget:t[24],showMiniTimer:t[25],playerStarted:t[34],playNextVideo:t[26],playPrevVideo:t[27],repeatPlaylist:t[28],seekToInteractive:t[29],toggleGraph:t[30],playPrevChapter:t[31],firstStart:t[36],seekTime:t[32]};return t[33]!==void 0&&(r.videoContainer=t[33]),e=new P_({props:r}),Ce.push(()=>We(e,"videoContainer",l)),{c(){q(e.$$.fragment)},m(o,s){F(e,o,s),n=!0},p(o,s){const a={};s[0]&1&&(a.store=o[0]),s[0]&4&&(a.thumbUrl=o[2]),s[0]&8&&(a.videoLogoUrl=o[3]),s[0]&16&&(a.interactiveContainer=o[4]),s[0]&32&&(a.live=o[5]),s[0]&64&&(a.autoplay=o[6]),s[0]&128&&(a.canRewindLive=o[7]),s[0]&256&&(a.showAds=o[8]),s[0]&512&&(a.adsSlotId=o[9]),s[0]&1024&&(a.adsParams=o[10]),s[0]&2048&&(a.adsPreviewParam=o[11]),s[0]&4096&&(a.duration=o[12]),s[0]&8192&&(a.logoClickable=o[13]),s[0]&16384&&(a.logoHidden=o[14]),s[0]&65536&&(a.showNextPrevButtons=o[16]),s[0]&131072&&(a.nextButtonActive=o[17]),s[0]&262144&&(a.prevButtonActive=o[18]),s[0]&524288&&(a.endScreenVideoTitle=o[19]),s[0]&1048576&&(a.endScreenVideoThumb=o[20]),s[0]&2097152&&(a.isOneVideoPlaylist=o[21]),s[0]&4194304&&(a.supportLink=o[22]),s[0]&8388608&&(a.outerContainerRef=o[23]),s[0]&16777216&&(a.fullScreenTarget=o[24]),s[0]&33554432&&(a.showMiniTimer=o[25]),s[1]&8&&(a.playerStarted=o[34]),s[0]&67108864&&(a.playNextVideo=o[26]),s[0]&134217728&&(a.playPrevVideo=o[27]),s[0]&268435456&&(a.repeatPlaylist=o[28]),s[0]&536870912&&(a.seekToInteractive=o[29]),s[0]&1073741824&&(a.toggleGraph=o[30]),s[1]&1&&(a.playPrevChapter=o[31]),!i&&s[1]&4&&(i=!0,a.videoContainer=o[33],je(()=>i=!1)),e.$set(a)},i(o){n||(d(e.$$.fragment,o),n=!0)},o(o){v(e.$$.fragment,o),n=!1},d(o){H(e,o)}}}function I_(t){let e,i,n,l;const r=[A_,E_],o=[];function s(a,c){return a[15]?0:1}return i=s(t),n=o[i]=r[i](t),{c(){e=T("div"),n.c(),u(e,"class","root v-cghoty")},m(a,c){P(a,e,c),o[i].m(e,null),l=!0},p(a,c){let f=i;i=s(a),i===f?o[i].p(a,c):(de(),v(o[f],1,1,()=>{o[f]=null}),me(),n=o[i],n?n.p(a,c):(n=o[i]=r[i](a),n.c()),d(n,1),n.m(e,null))},i(a){l||(d(n),l=!0)},o(a){v(n),l=!1},d(a){a&&S(e),o[i].d()}}}function L_(t,e,i){let{sources:n}=e,{store:l}=e,{microStoresRoot:r}=e,{uiConfig:o}=e,{title:s}=e,{thumbUrl:a}=e,{videoLogoUrl:c}=e,{interactiveContainer:f}=e,{subtitles:m}=e,{live:h}=e,{preload:_}=e,{autoplay:g}=e,{volume:w=void 0}=e,{muted:b=void 0}=e,{fromTime:C}=e,{canRewindLive:k}=e,{showAds:y}=e,{adsSlotId:M=void 0}=e,{adsParams:j=void 0}=e,{adsPreviewParam:I=void 0}=e,{duration:z=void 0}=e,{logoClickable:ae}=e,{logoHidden:se}=e,{isMobile:R}=e,{showNextPrevButtons:te=!1}=e,{nextButtonActive:X=!1}=e,{prevButtonActive:G=!1}=e,{endScreenVideoTitle:A=void 0}=e,{endScreenVideoThumb:V=void 0}=e,{isOneVideoPlaylist:x=!1}=e,{supportLink:L}=e,{outerContainerRef:ie=void 0}=e,{fullScreenTarget:Ee=void 0}=e,{failoverHosts:ye=void 0}=e,{showMiniTimer:Le=!1}=e,{playNextVideo:Ve=ne.noop}=e,{playPrevVideo:_e=ne.noop}=e,{repeatPlaylist:Se=ne.noop}=e,{seekToInteractive:W=ne.noop}=e,{toggleGraph:$=ne.noop}=e,{playPrevChapter:fe=ne.noop}=e;const{subscribers:ue,stores:Fe}=r;y0(o);const Oe=gn(),Me=l.ui.debugPanelVisible,Ie=l.ui.playerSize;let ce,he=null,re=!1;l.getAdmanWrapper().init({switchFromAdsToVideo:l.actions.internal.switchFromAdsToVideo,switchFromVideoToAds:l.actions.internal.switchFromVideoToAds,setMuted:l.actions.external.setMuted},l.ads,{isMobile:l.ui.isMobile,mobileUnmuteButtonVisible:l.ui.mobileUnmuteButtonVisible,vsid:l.vsid}),V0(l,Fe);const Te=(oe=!1)=>{i(34,re=!0),oe?l.actions.external.firstStart(y):l.actions.internal.firstStart(y)};function pe(oe){var Je;const _t=n||oe;_t&&l.initVideo({container:ce,sources:_t,failoverHosts:ye,subtitles:m});const rt=ne.safeStorage.get(tr)==="true";Me.set(rt),C>0&&l.actions.external.seekTime(C);const Rt=R?Oe.volumeDefault:(Je=w!=null?w:O1())!=null?Je:Oe.volumeDefault,ut=b!=null?b:D0();if(l.actions.external.setVolume(Rt),l.actions.external.setMuted(ut),l.getAdmanWrapper().setInitialVolume(ut?0:Rt),Oe.features.trafficSaving){const Ue=F0();Ue&&l.actions.internal.setTrafficSavingEnabled(Ue)}const It=O0(l.videoId);It&&l.actions.internal.setQuality(It),l.ui.isAutoplay.set(g),g?Te():_&&Oe.features.preload&&l.actions.internal.preload()}const Pe=oe=>{if(window.ResizeObserver){let _t,rt;he=new ResizeObserver(ne.throttleFn(Rt=>{const ut=Rt[0];if(ut){if(ut.contentBoxSize){const It=Array.isArray(ut.contentBoxSize)?ut.contentBoxSize[0]:ut.contentBoxSize;_t=It.inlineSize,rt=It.blockSize}else ut.contentRect&&(_t=ut.contentRect.width,rt=ut.contentRect.height);Ie.set({width:_t,height:rt})}},S1)),he.observe(oe)}Ie.set({width:oe.clientWidth,height:oe.clientHeight})};vn(()=>{Pe(ce);const oe=ue.map(rt=>rt.init(l,Fe));if((h==null?void 0:h.status)==="upcoming"||(h==null?void 0:h.status)==="waiting"){l.actions.internal.setWaitingLive(!0);return}if(((h==null?void 0:h.status)==="finished"||(h==null?void 0:h.status)==="postlive")&&!Object.keys(n||[]).length){l.actions.internal.setWaitingRecord(!0);return}return pe(),()=>{he==null||he.disconnect(),oe.forEach(rt=>rt.unsubscribe()),l.destroy()}});function Ke(){re?l.actions.external.play():Te(!0)}function Re(){l.actions.external.pause()}function xe(oe){R||l.actions.external.setMuted(oe)}function Xe(oe){R||oe>=0&&oe<=1&&l.actions.external.setVolume(oe)}function ot(oe){l.actions.internal.seekTime(oe,yt.SeekAction.UNKNOWN)}function at(oe){l.actions.external.seekEpisodeStartTime(oe)}function At(){l.actions.external.returnFocusToEpisodes()}function pt(oe){l.actions.external.setPlaybackRate(oe)}function xt(oe){l.actions.external.setAutoQualityLimits(oe)}function gt(oe){ce=oe,i(33,ce)}function Mt(oe){ce=oe,i(33,ce)}return t.$$set=oe=>{"sources"in oe&&i(37,n=oe.sources),"store"in oe&&i(0,l=oe.store),"microStoresRoot"in oe&&i(38,r=oe.microStoresRoot),"uiConfig"in oe&&i(39,o=oe.uiConfig),"title"in oe&&i(1,s=oe.title),"thumbUrl"in oe&&i(2,a=oe.thumbUrl),"videoLogoUrl"in oe&&i(3,c=oe.videoLogoUrl),"interactiveContainer"in oe&&i(4,f=oe.interactiveContainer),"subtitles"in oe&&i(40,m=oe.subtitles),"live"in oe&&i(5,h=oe.live),"preload"in oe&&i(41,_=oe.preload),"autoplay"in oe&&i(6,g=oe.autoplay),"volume"in oe&&i(42,w=oe.volume),"muted"in oe&&i(43,b=oe.muted),"fromTime"in oe&&i(44,C=oe.fromTime),"canRewindLive"in oe&&i(7,k=oe.canRewindLive),"showAds"in oe&&i(8,y=oe.showAds),"adsSlotId"in oe&&i(9,M=oe.adsSlotId),"adsParams"in oe&&i(10,j=oe.adsParams),"adsPreviewParam"in oe&&i(11,I=oe.adsPreviewParam),"duration"in oe&&i(12,z=oe.duration),"logoClickable"in oe&&i(13,ae=oe.logoClickable),"logoHidden"in oe&&i(14,se=oe.logoHidden),"isMobile"in oe&&i(15,R=oe.isMobile),"showNextPrevButtons"in oe&&i(16,te=oe.showNextPrevButtons),"nextButtonActive"in oe&&i(17,X=oe.nextButtonActive),"prevButtonActive"in oe&&i(18,G=oe.prevButtonActive),"endScreenVideoTitle"in oe&&i(19,A=oe.endScreenVideoTitle),"endScreenVideoThumb"in oe&&i(20,V=oe.endScreenVideoThumb),"isOneVideoPlaylist"in oe&&i(21,x=oe.isOneVideoPlaylist),"supportLink"in oe&&i(22,L=oe.supportLink),"outerContainerRef"in oe&&i(23,ie=oe.outerContainerRef),"fullScreenTarget"in oe&&i(24,Ee=oe.fullScreenTarget),"failoverHosts"in oe&&i(45,ye=oe.failoverHosts),"showMiniTimer"in oe&&i(25,Le=oe.showMiniTimer),"playNextVideo"in oe&&i(26,Ve=oe.playNextVideo),"playPrevVideo"in oe&&i(27,_e=oe.playPrevVideo),"repeatPlaylist"in oe&&i(28,Se=oe.repeatPlaylist),"seekToInteractive"in oe&&i(29,W=oe.seekToInteractive),"toggleGraph"in oe&&i(30,$=oe.toggleGraph),"playPrevChapter"in oe&&i(31,fe=oe.playPrevChapter)},t.$$.update=()=>{t.$$.dirty[0]&32769&&l.ui.isMobile.set(R)},[l,s,a,c,f,h,g,k,y,M,j,I,z,ae,se,R,te,X,G,A,V,x,L,ie,Ee,Le,Ve,_e,Se,W,$,fe,ot,ce,re,Oe,Te,n,r,o,m,_,w,b,C,ye,pe,Ke,Re,xe,Xe,at,At,pt,xt,gt,Mt]}class V_ extends ke{constructor(e){super(),we(this,e,L_,I_,be,{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,returnFocusToEpisodes:52,setPlaybackRate:53,setAutoQualityLimits:54},T_,[-1,-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 returnFocusToEpisodes(){return this.$$.ctx[52]}get setPlaybackRate(){return this.$$.ctx[53]}get setAutoQualityLimits(){return this.$$.ctx[54]}}function M_(t){let e,i;return{c(){e=N("svg"),i=N("path"),u(i,"fill",t[0]),u(i,"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,l){P(n,e,l),p(e,i)},p(n,[l]){l&1&&u(i,"fill",n[0])},i:K,o:K,d(n){n&&S(e)}}}function B_(t,e,i){let{isWhite:n=!1}=e,l;return t.$$set=r=>{"isWhite"in r&&i(1,n=r.isWhite)},t.$$.update=()=>{t.$$.dirty&2&&i(0,l=n?"#fff":"#909499")},[l,n]}class N_ extends ke{constructor(e){super(),we(this,e,B_,M_,be,{isWhite:1})}}function R_(t){Ze(t,"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 p1(t){let e,i;return{c(){e=T("div"),i=ze(t[0]),u(e,"class","title v-1y9fytq")},m(n,l){P(n,e,l),p(e,i)},p(n,l){l&1&&et(i,n[0])},d(n){n&&S(e)}}}function h1(t){let e,i;return e=new N_({props:{isWhite:!!t[1]}}),{c(){q(e.$$.fragment)},m(n,l){F(e,n,l),i=!0},p(n,l){const r={};l&2&&(r.isWhite=!!n[1]),e.$set(r)},i(n){i||(d(e.$$.fragment,n),i=!0)},o(n){v(e.$$.fragment,n),i=!1},d(n){H(e,n)}}}function O_(t){let e,i,n,l,r=t[0]&&p1(t),o=(!t[0]||!t[1])&&h1(t);return{c(){e=T("div"),r&&r.c(),i=O(),o&&o.c(),u(e,"class","playerStub v-1y9fytq"),u(e,"style",n=t[1]?`background-image: url('${t[1]}')`:"")},m(s,a){P(s,e,a),r&&r.m(e,null),p(e,i),o&&o.m(e,null),l=!0},p(s,[a]){s[0]?r?r.p(s,a):(r=p1(s),r.c(),r.m(e,i)):r&&(r.d(1),r=null),!s[0]||!s[1]?o?(o.p(s,a),a&3&&d(o,1)):(o=h1(s),o.c(),d(o,1),o.m(e,null)):o&&(de(),v(o,1,1,()=>{o=null}),me()),(!l||a&2&&n!==(n=s[1]?`background-image: url('${s[1]}')`:""))&&u(e,"style",n)},i(s){l||(d(o),l=!0)},o(s){v(o),l=!1},d(s){s&&S(e),r&&r.d(),o&&o.d()}}}function D_(t,e,i){let{title:n}=e,{thumbUrl:l}=e;return t.$$set=r=>{"title"in r&&i(0,n=r.title),"thumbUrl"in r&&i(1,l=r.thumbUrl)},[n,l]}class z_ extends ke{constructor(e){super(),we(this,e,D_,O_,be,{title:0,thumbUrl:1},R_)}}class F_{isSupported(){return"mediaSession"in navigator}setMetaData({title:e,artist:i="",thumbUrl:n=""}){this.isSupported()&&(navigator.mediaSession.metadata=new MediaMetadata({title:e,artist:i,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",i=>null],["seekbackward",i=>null],["seekforward",i=>null]];this.setActionHandlers(e)}setActionHandlers(e){if(this.isSupported())for(const[i,n]of e)try{navigator.mediaSession.setActionHandler(i,n)}catch(l){throw new Error(`The media session action "${i}" is not supported yet.`)}}}function H_(t){let e,i,n,l;return{c(){e=N("svg"),i=N("g"),n=N("path"),l=N("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(l,"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(i,"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(r,o){P(r,e,o),p(e,i),p(i,n),p(i,l)},p:K,i:K,o:K,d(r){r&&S(e)}}}class U_ extends ke{constructor(e){super(),we(this,e,null,H_,be,{})}}function q_(t){Ze(t,"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 j_(t){let e,i,n,l,r,o,s;return n=new U_({}),{c(){e=T("div"),i=T("div"),q(n.$$.fragment),l=O(),r=T("span"),o=ze(t[0]),u(i,"class","dummy-image v-1pbsod4"),B(i,"desktop",!t[1]),u(r,"class","title v-1pbsod4"),u(e,"class","player-pip-dummy v-1pbsod4"),B(e,"is-pip-api",t[2])},m(a,c){P(a,e,c),p(e,i),F(n,i,null),p(e,l),p(e,r),p(r,o),s=!0},p(a,[c]){(!s||c&2)&&B(i,"desktop",!a[1]),(!s||c&1)&&et(o,a[0])},i(a){s||(d(n.$$.fragment,a),s=!0)},o(a){v(n.$$.fragment,a),s=!1},d(a){a&&S(e),H(n)}}}function W_(t,e,i){let n,l;const r=Ct(),o=!!r.webApi.pictureInPictureApi,s=r.interfaceLanguage$;D(t,s,f=>i(5,n=f));const a=r.ui.isMobile;D(t,a,f=>i(1,l=f));let c;return t.$$.update=()=>{t.$$.dirty&32&&i(0,c=n&&Y("pip_dummy_title"))},[c,l,o,s,a,n]}class Z_ extends ke{constructor(e){super(),we(this,e,W_,j_,be,{},q_)}}const K_=460,G_=280;class Tf{constructor(){this.info={isActive$:new ne.ValueSubject(!1),type:zn.DocumentPictureInPicture}}isSupported(){const e=ne.getCurrentBrowser().browser===ne.CurrentClientBrowser.Yandex,{isEmbed:i}=ne.detectEmbed();return"documentPictureInPicture"in window&&!e&&!i}isActive(){return this.isSupported()&&!!documentPictureInPicture.window}setPlayerDomElement(e,i){this.playerDomElement=e,this.playerParentShadowRoot=i}setContext(e){this.svelteContext=e}async request(){var e,i;if(!this.isSupported()||!this.playerDomElement||!this.playerParentShadowRoot)return;this.pipWindow=await documentPictureInPicture.requestWindow({width:K_,height:G_,copyStyleSheets:!0}),this.pipWindow.document.body.style.margin="0";const n=[...this.playerParentShadowRoot.styleSheets].map(s=>[...s.cssRules].map(a=>a.cssText).join(" ")).filter(Boolean).join(`
51
- `),l=document.createElement("style");l.textContent=n;const r=this.createStretchedContainer(),o=r.attachShadow({mode:"open"});o.append(l),o.append(this.playerDomElement),this.playerDummyElement=new Z_({target:this.playerParentShadowRoot,context:this.svelteContext}),(e=this.pipWindow)===null||e===void 0||e.document.body.append(r),this.info.isActive$.next(!0),(i=this.pipWindow)===null||i===void 0||i.addEventListener("unload",s=>{!this.playerDomElement||!this.playerParentShadowRoot||!this.playerDummyElement||(this.playerDummyElement.$destroy(),this.playerParentShadowRoot.append(this.playerDomElement),this.info.isActive$.next(!1))})}async remove(){return new Promise(e=>{var i;(i=documentPictureInPicture.window)===null||i===void 0||i.close(),e()})}async dispose(){await this.remove()}createStretchedContainer(){const e=document.createElement("div");return e.style.width="100%",e.style.height="100%",e}}function Y_(t){return t instanceof Tf}class Q_{static getLatestSupportedVersion(){const e=new hr,i=new Tf;if(i.isSupported())return i;if(e.isSupported())return e}}function v1(t,e){var i,n;const l=new Set([...Object.keys(t),...Object.keys(e)]),r={};for(const o of l)r[o]=(n=(i=e[o])!==null&&i!==void 0?i:t[o])!==null&&n!==void 0?n:void 0;return r}const X_="Inner error. Unexpectedly root annotation container null reference exception",J_="Annotation with such name already exists",x_="Annotation with such name does not exist";class Jl extends Error{constructor(e){super(e),this.name="AnnotationError"}}const $_="1",e6=100;class t6{constructor(e){this.annotations=new Map,this.subscriptions=new ne.Subscription,this.rootAnnotationsContainer=e;const i=ne.throttleFn(()=>{for(const n of this.annotations.values())this.isElementExceedsBoundaries(n,this.playerSize.width,this.playerSize.height)?n.style.visibility="hidden":n.style.visibility="visible"},e6);this.subscriptions.add(ne.observeElementSize(this.rootAnnotationsContainer).subscribe(({width:n,height:l})=>{this.playerSize={width:n,height:l},i()})),this.mutationObserver=new MutationObserver(i),this.mutationObserver.observe(this.rootAnnotationsContainer,{attributes:!0,childList:!0,subtree:!0,characterData:!0})}add(e,i){var n;if(!this.rootAnnotationsContainer)throw new Jl(X_);if(this.annotations.has(e))throw new Jl(J_);i.style.zIndex=(n=i.style.zIndex)!==null&&n!==void 0?n:$_,i.style.position="absolute",this.rootAnnotationsContainer.append(i),this.annotations.set(e,i)}get(e){const i=this.annotations.get(e);if(!i)throw new Jl(x_);return i}remove(e){const i=this.get(e);this.annotations.delete(e)&&i.remove()}clear(){for(const e in this.annotations.keys())this.remove(e)}destroy(){this.annotations.clear(),this.subscriptions.unsubscribe(),this.mutationObserver.disconnect(),this.rootAnnotationsContainer=null}isElementExceedsBoundaries(e,i,n){const l=e.offsetTop,r=e.offsetLeft,o=e.offsetWidth,s=e.offsetHeight;return l<0||r<0||r+o>i||l+s>n}registryRootContainer(e){}addLayer(e){return new HTMLElement}getLayer(e){}removeLayer(e){}clearLayer(e){}detach(){}reattach(){}}class Tr{init(e,i){return ne.assertNonNullable(e),ne.assertNonNullable(i),this.subscription=new ne.Subscription,this.subscription}}class i6 extends Tr{constructor(){super(...arguments),this.stateName="fakeIsPlaying$",this.state$={...Ne(null),toggle:()=>this.state$.update(e=>!e)}}init(e,i){const n=super.init(e,i),{isInteractiveExpectation$:l}=e.state;return n.add(l.subscribe(r=>{this.state$.set(r?!0:null)})),n}}class n6 extends Tr{constructor(){super(...arguments),this.stateName="interactiveControlsOpacity$",this.state$={...Ne(null),toggle:()=>this.state$.update(e=>!e)}}init(e,i){const n=super.init(e,i),{fakeIsPlaying$:l}=i,{isInteractiveExpectation$:r,isPlaying$:o}=e.state,{controlsVisible:s,isMobile:a}=e.ui,c=tt(a),f=()=>c&&tt(s);return n.add(s.subscribe(m=>{if(!c)return;const h=tt(l);tt(o)?this.state$.set(m):h!==null&&this.state$.set(!h||m)})),n.add(o.subscribe(m=>{this.state$.set(!m||f())})),n.add(l.subscribe(m=>{if(m===null)return;const h=tt(r);if(f()){this.state$.set(!0);return}h&&this.state$.set(!m)})),n}}class o6 extends Tr{constructor(){super(...arguments),this.stateName="seekToInteractiveDisabledTooltip$",this.state$=Ne("tooltip_chapter_without_interactive")}init(e,i){const n=super.init(e,i);return n.add(e.state.interactiveEpisodes$.subscribe(l=>{l.length&&(l.every(r=>r.completed)?this.state$.set("tooltip_interactive_of_chapter_completed"):this.state$.set("tooltip_disabled_when_interactive"))})),n}}const l6=()=>[i6,n6,o6].reduce(({subscribers:t,stores:e},i)=>{const n=new i;return{subscribers:[...t,n],stores:{...e,[n.stateName]:n.state$}}},{subscribers:[],stores:{}}),r6={preload:!0,autoplay:!1,repeat:!1,fromTime:0,canRewindLive:!0,showAds:!1,interfaceLanguage:ne.InterfaceLanguage.RU,logoClickable:!1,logoHidden:!1,isMobile:ne.isMobile(),isMediaSessionEnabled:!0,isPictureInPictureEnabled:!0,isAudioDisabled:!1,callbacks:{uiInfo:{}},tuningConfig:{configName:[]}};class s6 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.logger=new ne.Logger,this.log=this.logger.createComponentLog("VKVideoPlayer"),this.subscription=new ne.Subscription,this.graphMadePause=!1,!((e=window==null?void 0:window.videoPlayerConfig)===null||e===void 0)&&e.debugLogs&&this.subscription.add(this.logger.log$.subscribe(i=>{console.log("%c player web component ","background:#77dd77;",`${i.component}`,i.message)}))}connectedCallback(){var e,i;if(this.isInited)return;this.initPlayerRootContainers();const n=(e=this.getAttribute("stub-title"))!==null&&e!==void 0?e:void 0,l=(i=this.getAttribute("stub-thumb-url"))!==null&&i!==void 0?i:void 0;this.svelteStubComponent=new z_({target:this.playerContainer,props:{title:n,thumbUrl:l}})}disconnectedCallback(){var e,i,n,l,r;(e=this.annotationsApi)===null||e===void 0||e.destroy(),(i=this.svelteRootComponent)===null||i===void 0||i.$destroy(),(n=this.svelteStubComponent)===null||n===void 0||n.$destroy(),this.subscription.unsubscribe(),(l=this.unsubscribePlayerPhaseSubscription)===null||l===void 0||l.call(this),(r=this.interactiveController)===null||r===void 0||r.destroy()}initPlayerRootContainers(){this.rootContainer=document.createElement("div"),this.rootContainer.style.position="relative",this.rootContainer.className="root-container",this.rootContainer.style.width="100%",this.rootContainer.style.height="100%";const e=document.createElement("div");e.style.position="absolute",e.className="shadow-root-container",e.style.width="100%",e.style.height="100%",this._shadowRoot=e.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.rootContainer.append(e),this.append(this.rootContainer)}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 i;const n=(i=this.store)===null||i===void 0?void 0:i.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,i={},n){var l,r,o,s,a,c,f,m,h,_,g,w,b;if(!this.videoConfig)return;const{albumId:C,statPlace:k,statUserSalt:y,statAuthToken:M,statTrackCode:j,refreshStatAuthToken:I,preload:z,autoplay:ae,volume:se,muted:R,fromTime:te,canRewindLive:X,supportLink:G,showAds:A,adsSlotId:V,adsParams:x={},adsPreviewParam:L,interfaceLanguage:ie,logoClickable:Ee,logoHidden:ye,isMobile:Le,isAudioDisabled:Ve,isLiveCatchUpMode:_e,fullScreenTarget:Se,failoverHosts:W,canDownload:$,callbacks:fe,interactiveData:ue,showThumbTimer:Fe,additionalButtons:Oe=[],repeat:Me}=v1(this.videoConfig,i),{sources:Ie,title:ce,thumbUrl:he,videoLogoUrl:re,unitedVideoId:Te,isClip:pe=!1,duration:Pe,adsParams:Ke={},videoEpisodes:Re,previewThumbsData:xe,subtitles:Xe,live:ot}=e,at={...x,...Ke},At=this.getNextVideoInfo(),pt={sources:Ie,title:ce,thumbUrl:he,subtitles:Xe,unitedVideoId:Te,isClip:pe,live:ot,albumId:C,statPlace:k,autoplay:ae,muted:R,volume:se,fromTime:te,canRewindLive:X,showAds:A,adsSlotId:V,adsParams:at,adsPreviewParam:L,duration:Pe,logoClickable:Ee,logoHidden:ye,isMobile:Le,repeat:Me,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:At.nextVideoTitle,endScreenVideoThumb:At.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist()},xt={pictureInPictureApi:this.pictureInPictureApi,annotationsApi:this.annotationsApi};this.log({message:`create player, props: ${JSON.stringify(pt)}`});const gt=this.uiConfig.features.statistics&&!!Te,{pid:Mt}=((r=(l=this.videoConfig)===null||l===void 0?void 0:l.interactiveData)===null||r===void 0?void 0:r.projectInfo)||{};gt&&(this.statistics=new Z5({movieId:Te,albumId:C,place:k,trackCode:j,autoplay:(o=ae&&!this.interactiveController)!==null&&o!==void 0?o:!1,mobile:Le,clip:pe,...Mt&&!this.isInited&&{projectId:Number(Mt)}},{refreshAuthToken:I,userSalt:y,config:this.statisticsConfig,...this.interactiveController&&{useIsid:!0,isid:this.prevIsid}})),this.uiConfig.features.sentry&&this.uiConfig.sentry.dsn&&new lr(this.uiConfig.sentry,{version:pl,env:L0},{movieId:Te,albumId:C,place:k,autoplay:(s=ae&&!this.interactiveController)!==null&&s!==void 0?s:!1,mobile:Le,clip:pe}),this.interactiveController&&((a=this.prevIsid)!==null&&a!==void 0||(this.prevIsid=(c=this.statistics)===null||c===void 0?void 0:c.oneStat.isid$.getValue())),this.sentry={...this.sentry,...lr.getInstance()};const _t=!!ue,rt=[];let Rt="tooltip_interactive_go_back_disabled_first";if(_t&&this.interactiveController){const Je=this.interactiveController.state.isInitialChapter$.getValue(),Ue=this.interactiveController.getHistoryState();Je&&rt.push(dt.REPLAY_BUTTON),this.interactiveController.getIsSeekable().getValue()||rt.push(dt.SEEK_TO_INTERACTIVE_BUTTON),Ue.hasPrevChapter$.getValue()||(rt.push(dt.PLAY_PREV_CHAPTER_BUTTON),Je||(Ue.isGoBackLimited$.getValue()?Rt="tooltip_interactive_go_back_disabled_limit":Rt="tooltip_interactive_go_back_disabled"))}const ut=()=>{var Je;this.isInited=!1,this.prevIsid=void 0;const Ue=(n==null?void 0:n.info.isEnded$.getValue())&&((Je=this.interactiveController)===null||Je===void 0?void 0:Je.state.isEndChapter$.getValue());fe.onReplayInteractiveVideo&&!Ue?fe.onReplayInteractiveVideo():this.replayInteractiveVideo()};this.store=K5({player:n,interfaceLanguage:ie,videoId:Te,isClip:pe,isLiveCatchUpMode:_e,isAudioDisabled:Ve,statAuthToken:M,callbacks:fe,webApi:xt,videoEpisodes:Re,previewThumbsData:xe,canDownload:$,uiConfig:this.uiConfig,coreConfig:this.coreConfig,disabledControls:rt,isInteractive:_t,interactiveRanges$:(f=this.interactiveController)===null||f===void 0?void 0:f.state.interactiveRanges$,isInteractiveTime$:(m=this.interactiveController)===null||m===void 0?void 0:m.state.isInteractiveTime$,replayInteractive:ut,playPrevChapterDisabledTooltip:Rt,hasInteractiveBranches:!!(!((_=(h=this.interactiveController)===null||h===void 0?void 0:h.getChapterBranches())===null||_===void 0)&&_.length),additionalButtons:this.uiConfig.features.additionalButtons?Oe:[],looped:Me&&this.videoConfig.videos.length===1,statistics:this.statistics});const{stores:It}=this.microStoresRoot=l6();this.subscription.add(this.store.state.currentFormat$.subscribe(Je=>{var Ue;return(Ue=fe==null?void 0:fe.onCurrentFormatChanged)===null||Ue===void 0?void 0:Ue.call(fe,Je)})),this.subscription.add(It.interactiveControlsOpacity$.subscribe(Je=>{var Ue;Je!==null&&((Ue=this===null||this===void 0?void 0:this.interactiveController)===null||Ue===void 0||Ue.setDisabledControls(Je))})),this.subscription.add(this.store.state.throughputEstimation$.subscribe(Je=>{var Ue;return(Ue=fe==null?void 0:fe.onThroughputEstimationChanged)===null||Ue===void 0?void 0:Ue.call(fe,Je)})),this.subscription.add(this.store.state.trafficSavingEnabled$.subscribe(Je=>{var Ue;return(Ue=fe==null?void 0:fe.onTrafficSavingEnabledChanged)===null||Ue===void 0?void 0:Ue.call(fe,Je)})),this.subscription.add(this.store.state.currentPlaybackRate$.subscribe(Je=>{var Ue;return(Ue=fe==null?void 0:fe.onCurrentPlaybackRateChanged)===null||Ue===void 0?void 0:Ue.call(fe,Je)})),this.subscription.add(this.store.state.volume$.subscribe(Je=>{var Ue;return(Ue=fe==null?void 0:fe.onVolumeChange)===null||Ue===void 0?void 0:Ue.call(fe,Je)})),this.subscription.add(this.store.state.muted$.subscribe(Je=>{var Ue,St;return Je?(Ue=fe==null?void 0:fe.onMute)===null||Ue===void 0?void 0:Ue.call(fe):(St=fe==null?void 0:fe.onUnmute)===null||St===void 0?void 0:St.call(fe)})),this.subscription.add(this.store.state.videoBitrate$.subscribe(Je=>{var Ue;return(Ue=fe==null?void 0:fe.onVideoBitrateChanged)===null||Ue===void 0?void 0:Ue.call(fe,Je)})),this.subscription.add(this.store.state.isInteractiveTime$.subscribe(Je=>{var Ue;const St=(Ue=this.store)===null||Ue===void 0?void 0:Ue.ui.controls.disabledControls$;St&&(Je&&!St.includes(sl)&&St.add(sl),Je||St.remove(sl))})),this.initMediaSession(),this.interactiveController&&gt&&this.initInteractivesStatistics(),this.svelteRootComponent=new V_({target:this.playerContainer,props:{interactiveContainer:this.interactiveContainer,sources:Ie,store:this.store,microStoresRoot:this.microStoresRoot,uiConfig:this.uiConfig,title:ce,thumbUrl:he,videoLogoUrl:re,subtitles:Xe,live:ot,preload:z,autoplay:ae,muted:R,volume:se,fromTime:te,canRewindLive:X,supportLink:G,showAds:A,adsSlotId:V,adsParams:at,adsPreviewParam:L,duration:Pe,logoClickable:Ee,logoHidden:ye,isMobile:Le,failoverHosts:W,fullScreenTarget:Se,showMiniTimer:Fe,outerContainerRef:this.rootContainer,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:At.nextVideoTitle,endScreenVideoThumb:At.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,(b=(w=(g=this.videoConfig)===null||g===void 0?void 0:g.callbacks)===null||w===void 0?void 0:w.onInited)===null||b===void 0||b.call(w))}addPlayerInfoSubscriptions(){var e;const i=this.store;if(!i)return;const n=(e=this.videoConfig)===null||e===void 0?void 0:e.callbacks;n&&this.subscription.add(i.playerPhase.subscribe(r=>{var o;return(o=n.onPlayerPhaseChanged)===null||o===void 0?void 0:o.call(n,r)})).add(i.state.playbackState$.subscribe(r=>{var o;return(o=n.onPlaybackStateChanged)===null||o===void 0?void 0:o.call(n,r)})).add(i.state.isLive$.subscribe(r=>{var o;return(o=n.onIsLiveChanged)===null||o===void 0?void 0:o.call(n,r)})).add(i.state.isActiveLive$.subscribe(r=>{var o;return(o=n.onIsActiveLiveChanged)===null||o===void 0?void 0:o.call(n,r)})).add(i.state.isAudioAvailable$.subscribe(r=>{var o;return(o=n.onIsAudioAvailableChanged)===null||o===void 0?void 0:o.call(n,r)})).add(i.state.currentQuality$.subscribe(r=>{var o;return(o=n.onCurrentQualityChanged)===null||o===void 0?void 0:o.call(n,r)})).add(i.state.availableQualities$.subscribe(r=>{var o;return(o=n.onAvailableQualitiesChanged)===null||o===void 0?void 0:o.call(n,r.map(({value:s})=>s).filter(s=>s!==wo.AUTO))})).add(i.ui.isPictureInPictureActive$.subscribe(r=>{var o,s;return r?(o=n.onPiPEnter)===null||o===void 0?void 0:o.call(n):(s=n.onPiPExit)===null||s===void 0?void 0:s.call(n)}));const l=n==null?void 0:n.uiInfo;l&&this.subscription.add(i.ui.controlsVisible.subscribe(r=>{var o;return(o=l.onControlsVisibleChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.isMobile.subscribe(r=>{var o;return(o=l.onIsMobileChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.playerSize.subscribe(r=>{var o;return(o=l.onPlayerSizeChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.prevButton.subscribe(r=>{var o;return(o=l.onPrevButtonChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.playButton.subscribe(r=>{var o;return(o=l.onPlayButtonChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.replayButton.subscribe(r=>{var o;return(o=l.onReplayButtonChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.nextButton.subscribe(r=>{var o;return(o=l.onNextButtonChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.playPrevChapterButton.subscribe(r=>{var o;return(o=l.onPlayPrevChapterChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.seekToInteractiveButton.subscribe(r=>{var o;return(o=l.onSeekToInteractiveButtonChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.interactiveGraphButton.subscribe(r=>{var o;return(o=l.onGraphButtonChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.liveButton.subscribe(r=>{var o;return(o=l.onLiveButtonChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.time.subscribe(r=>{var o;return(o=l.onTimeUpdateChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.episodes.subscribe(r=>{var o;return(o=l.onEpisodesChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.subtitles.subscribe(r=>{var o;return(o=l.onSubtitlesChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.settings.subscribe(r=>{var o;return(o=l.onSettingsChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.fullscreen.subscribe(r=>{var o;return(o=l.onFullscreenChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.chromecast.subscribe(r=>{var o;return(o=l.onChromecastChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.pip.subscribe(r=>{var o;return(o=l.onPipChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.vkLogo.subscribe(r=>{var o;return(o=l.onVkLogoChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.interactiveTimeIcon.subscribe(r=>{var o;return(o=l.onInteractiveTimeIconChanged)===null||o===void 0?void 0:o.call(l,r)}))}playNextVideo(){var e;if(!this.videoConfig)return;let i=!0;if(!((e=this.videoConfig.callbacks)===null||e===void 0)&&e.onNextVideoClick)try{i=this.videoConfig.callbacks.onNextVideoClick()}catch(n){this.log({message:"onNextVideoClick callback failed to execute"})}i&&(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 i=!0;if(!((e=this.videoConfig.callbacks)===null||e===void 0)&&e.onPrevVideoClick)try{i=this.videoConfig.callbacks.onPrevVideoClick()}catch(n){this.log({message:"onPrevVideoClick callback failed to execute"})}i&&(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,i=!0){var n;if(!this.videoConfig)return;const l=this.videoConfig.videos[this.currentPlayingVideoIndex];if(!l){this.log({message:"no next video"});return}this.isInited&&ne.isNonNullable(l.unitedVideoId)&&this.store.actions.internal.nextMovie(l.unitedVideoId),(n=this.svelteRootComponent)===null||n===void 0||n.$destroy(),this.createPlayer(l,{autoplay:i,fromTime:0},e)}playPrevChapter(){var e;(e=this.interactiveController)===null||e===void 0||e.playPrevChapter()}seekToInteractive(){var e;const i=(e=this.interactiveController)===null||e===void 0?void 0:e.getNextInteractiveStartTime();typeof i=="number"&&this.seekTime(i/1e3)}toggleGraph(){var e,i;if(!this.isInited)return;const n=this.store,{isEnded$:l,playbackState$:r,graphIsOpened$:o}=n.state,{disabledControls$:s}=n.ui.controls,a=tt(l),c=tt(r);tt(o)?(o.set(!1),(e=this.interactiveController)===null||e===void 0||e.toggleGraphView(!1),s.remove(Ur),!a&&this.graphMadePause&&this.play()):(this.graphMadePause=c==="playing",o.set(!0),(i=this.interactiveController)===null||i===void 0||i.toggleGraphView(!0),s.add(Ur),!a&&this.graphMadePause&&this.pause())}async initInteractives(){var e,i,n,l;if(!((e=this.videoConfig)===null||e===void 0)&&e.interactiveData)try{const{Interactives:r,EVENT_NAMES:o,CustomError:s}=await import("@vkontakte/videoplayer-interactive/es2018.cjs.js");this.interactiveContainer=document.createElement("div"),this.interactiveContainer.classList.add("interactiveContainer");const a=(i=this.store)===null||i===void 0?void 0:i.interfaceLanguage$,c=a?tt(a):this.videoConfig.interfaceLanguage,{projectInfo:f,initChapterId:m,historyApi:h,videoLoader:_}=this.videoConfig.interactiveData;this.interactiveController=new r({parentElement:this.interactiveContainer,fullscreenTargetElement:this.playerContainer,lang:c,graph:this.uiConfig.features.interactiveGraph,projectInfo:f,initChapterId:m,historyApi:h,vkVideoLoader:_,lastFrame:this.uiConfig.features.interactiveLastFrame,permanentTextControls:this.uiConfig.features.interactiveTextPermanent,initSeamless:!0,config:this.uiConfig.interactive,coreConfig:this.coreConfig}),await this.interactiveController.setManifest(this.videoConfig.interactiveData.manifest);const{isInteractiveExpectation$:g}=this.interactiveController.state;this.uiConfig.features.seekToInteractive&&this.subscription.add(this.interactiveController.getIsSeekable().subscribe(b=>{if(!this.isInited)return;const C=this.store;b?C.ui.controls.disabledControls$.remove(dt.SEEK_TO_INTERACTIVE_BUTTON):C.ui.controls.disabledControls$.add(dt.SEEK_TO_INTERACTIVE_BUTTON)})),this.subscription.add(g.subscribe(b=>{this.store&&this.store.state.isInteractiveExpectation$.set(b)}));let w=!0;if(this.interactiveController.on(o.playerChanged,b=>{if(!this.videoConfig)return;this.videoConfig.videos[this.currentPlayingVideoIndex]={...b.config,title:(f==null?void 0:f.title)||b.config.title};const C=w?this.videoConfig.autoplay:!0;this.createPlayerWithCurrentVideo(b.player,C),w&&(w=!1)}),this.interactiveController.on(o.interactives,({type:b,actionType:C})=>{var k,y,M,j;if(!this.store)return;const I=g.getValue();if(b==="action-choice"&&C==="setRandomBranch"&&(this.store.state.graphIsOpened$.set(!1),this.store.ui.controls.disabledControls$.remove(E1)),b==="action-choice-canceled"){const z=tt(this.store.state.isPlaying$)||I;if(!((k=this.videoConfig)===null||k===void 0)&&k.isMobile&&z){this.store.ui.interactiveHideMobileControls.set(!0);return}(j=(y=this.videoConfig)===null||y===void 0?void 0:(M=y.callbacks).onDisabledInteractiveClick)===null||j===void 0||j.call(M)}}),!((l=(n=this.videoConfig)===null||n===void 0?void 0:n.callbacks)===null||l===void 0)&&l.onInteractiveHistoryChanged){const b=this.interactiveController.getHistoryState();this.subscription.add(b.history$.subscribe(C=>{var k,y,M;C.length&&((M=(y=(k=this.videoConfig)===null||k===void 0?void 0:k.callbacks)===null||y===void 0?void 0:y.onInteractiveHistoryChanged)===null||M===void 0||M.call(y,C))}))}this.interactiveController.events.noInteraction$.subscribe(()=>{var b,C,k;(k=(b=this.videoConfig)===null||b===void 0?void 0:(C=b.callbacks).onInteractiveTimeIconClick)===null||k===void 0||k.call(C)}),this.interactiveController.on(o.errors,b=>{this.log({message:b.toString()})})}catch(r){this.log({message:r.message})}}async initInteractivesStatistics(){var e,i;const{statSubscription:n,oneStat:l}=this.statistics;if(!(!n||!l||!this.interactiveController))try{const{INTERACTIVE_CLICK_ACTIONS:r}=await import("@vkontakte/videoplayer-interactive/es2018.cjs.js"),o={[r.GO_NEXT_BUTTON]:yt.InteractiveInterfaceClick.NEXT_BUTTON,[r.GO_NEXT_AREA]:yt.InteractiveInterfaceClick.NEXT_AREA,[r.WATCH_AGAIN]:yt.InteractiveInterfaceClick.WATCH_AGAIN,[r.OPEN_GRAPH]:yt.InteractiveInterfaceClick.GRAPH_SHOW,[r.CLOSE_GRAPH]:yt.InteractiveInterfaceClick.GRAPH_HIDE},{click$:s,nextMovie$:a}=this.interactiveController.getStatEvents(),c=new ne.Subject;s.subscribe(f=>{var m,h;f in o?c.next(o[f]):(l==null||l.logError({errorType:"InteractiveVideosAction",fatal:!1}),(h=(m=this.sentry).report)===null||h===void 0||h.call(m,new Error("InteractiveVideosAction"),{errorType:"InteractiveVideosAction",fatal:!1}))}),n.add(l.attachToInteractive({click$:c,nextMovie$:a}))}catch(r){l==null||l.logError({errorType:"InteractiveVideos",fatal:!1}),(i=(e=this.sentry).report)===null||i===void 0||i.call(e,r,{errorType:"InteractiveVideosAction",fatal:!1})}}initPlayer(e,i={}){var n,l,r,o,s,a,c,f,m,h,_,g,w,b,C,k,y,M,j;if(!Array.isArray(e.videos)||e.videos.length===0&&!e.interactiveData)throw new Error("empty videos");this.videoConfig=v1(r6,ne.cloneDeepWith(e,I=>I instanceof HTMLElement?I:void 0)),this.uiConfig=k0((n=i.ui)!==null&&n!==void 0?n:{}),this.coreConfig=(l=i.core)!==null&&l!==void 0?l:{configName:[]},this.statisticsConfig=(r=i.statistics)!==null&&r!==void 0?r:{},this.sentry={config:(o=this.uiConfig.sentry)!==null&&o!==void 0?o:{}},ne.isNonNullable(this.videoConfig.isMediaSessionEnabled)&&(this.uiConfig.features.mediaSession=(s=this.videoConfig.isMediaSessionEnabled)!==null&&s!==void 0?s:!0),ne.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=(m=(f=this.uiConfig.features.dpip)!==null&&f!==void 0?f:this.videoConfig.isPictureInPictureEnabled)!==null&&m!==void 0?m:!0),this.videoConfig.isMobile=(h=this.uiConfig.isMobile)!==null&&h!==void 0?h:this.videoConfig.isMobile,(M=this.videoConfig).autoplay&&(M.autoplay=this.uiConfig.features.autoplay),this.videoConfig.showAds=(_=this.uiConfig.ads.enable)!==null&&_!==void 0?_:this.videoConfig.showAds,this.videoConfig.adsSlotId=(g=this.uiConfig.ads.slot)!==null&&g!==void 0?g:this.videoConfig.adsSlotId,this.videoConfig.adsPreviewParam=(w=this.uiConfig.ads.preview)!==null&&w!==void 0?w:this.videoConfig.adsPreviewParam,this.videoConfig.logoHidden=!((b=this.uiConfig.showLogo)!==null&&b!==void 0?b:!this.videoConfig.logoHidden),(j=this.videoConfig).canRewindLive&&(j.canRewindLive=this.uiConfig.features.liveRewind),this.videoConfig.supportLink=(C=this.videoConfig.supportLink)!==null&&C!==void 0?C:this.uiConfig.supportLink,this.currentPlayingVideoIndex=0,this.needToRepeatPlaylist=this.videoConfig.repeat,this.uiConfig.features.pip&&(this.uiConfig.features.dpip?this.pictureInPictureApi=Q_.getLatestSupportedVersion():this.pictureInPictureApi=new hr),this.mediaSessionApi=this.uiConfig.features.mediaSession?new F_:void 0,this.annotationsApi=this.uiConfig.features.annotations?new t6(this.rootContainer):void 0,(k=this.svelteStubComponent)===null||k===void 0||k.$destroy(),(y=this.svelteRootComponent)===null||y===void 0||y.$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]),Y_(this.pictureInPictureApi)&&this.pictureInPictureApi.setPlayerDomElement(this.playerContainer,this._shadowRoot)}isOneVideoPlaylist(){return this.videoConfig?this.videoConfig.videos.length===1:!1}updateNextVideos(e){var i;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();(i=this.svelteRootComponent)===null||i===void 0||i.$set({showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:n.nextVideoTitle,endScreenVideoThumb:n.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist()})}initMediaSession(){var e,i;this.mediaSessionApi&&((e=this.unsubscribePlayerPhaseSubscription)===null||e===void 0||e.call(this),this.unsubscribePlayerPhaseSubscription=(i=this.store)===null||i===void 0?void 0:i.playerPhase.subscribe(n=>{n===De.Video?this.setupMediaSessionForVideo():n===De.Ads&&this.setupMediaSessionForAds()}))}setupMediaSessionForVideo(){if(!(!this.videoConfig||!this.mediaSessionApi))try{const{title:e,thumbUrl:i}={...this.videoConfig.videos[this.currentPlayingVideoIndex]},n=[["play",()=>this.play()],["pause",()=>this.pause()],["seekto",l=>this.seekTime(l.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:i}),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",i=[["play",()=>this.play()],["pause",()=>this.pause()]];this.mediaSessionApi.setMetaData({title:e}),this.mediaSessionApi.updateActionHandlers(i)}catch(e){this.log({message:e.message})}}play(){var e,i;this.isControlDisabled(dt.PLAY_BUTTON)||!((e=this.store)===null||e===void 0)&&e.playerPhase.is(De.WaitingLive)||(this.log({message:"play"}),(i=this.svelteRootComponent)===null||i===void 0||i.play())}pause(){var e;this.log({message:"pause"}),(e=this.svelteRootComponent)===null||e===void 0||e.pause()}stop(){var e,i;if(!this.videoConfig)return;this.log({message:"stop"}),(e=this.svelteStubComponent)===null||e===void 0||e.$destroy();const n=this.videoConfig.videos[0];n&&((i=this.svelteRootComponent)===null||i===void 0||i.$destroy(),this.createPlayer(n))}setMuted(e){var i;this.log({message:`set muted, muted: ${e}`}),(i=this.svelteRootComponent)===null||i===void 0||i.setMuted(e)}setVolume(e){var i;this.log({message:`set volume, volume: ${e}`}),(i=this.svelteRootComponent)===null||i===void 0||i.setVolume(e)}setRepeat(e){var i;this.log({message:`set repeat, repeat: ${e}`}),this.needToRepeatPlaylist=e,(i=this.svelteRootComponent)===null||i===void 0||i.$set({needToRepeatPlaylist:this.needToRepeatPlaylist,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive()})}seekTime(e){var i;this.isControlDisabled(dt.TIMELINE)||(this.log({message:`seek time, time: ${e}`}),(i=this.svelteRootComponent)===null||i===void 0||i.seekTime(e))}seekEpisodeStartTime(e){var i;this.log({message:`seek episode start time, time: ${e}`}),(i=this.svelteRootComponent)===null||i===void 0||i.seekEpisodeStartTime(e)}returnFocusToEpisodes(){var e;this.log({message:"return focus to episodes button"}),(e=this.svelteRootComponent)===null||e===void 0||e.returnFocusToEpisodes()}setPlaybackRate(e){var i;this.log({message:`set playback rate to: ${e}`}),(i=this.svelteRootComponent)===null||i===void 0||i.setPlaybackRate(e)}setAutoQualityLimits(e){var i,n,l;this.log({message:`set auto quality limitation. Max: ${(i=e.max)!==null&&i!==void 0?i:"none"}. Min: ${(n=e.min)!==null&&n!==void 0?n:"none"}`}),(l=this.svelteRootComponent)===null||l===void 0||l.setAutoQualityLimits(e)}addLanguage(e){var i;(i=this.store)===null||i===void 0||i.actions.internal.addLanguage(e)}async setLanguage(e){var i;await((i=this.store)===null||i===void 0?void 0:i.actions.internal.setLanguage(e))}setLiveStart(e){var i,n;this.log({message:"live started"}),(i=this.store)===null||i===void 0||i.actions.internal.setWaitingLive(!1),(n=this.svelteRootComponent)===null||n===void 0||n.initVideo(e),this.play()}setWaitRecord(){var e,i;this.log({message:"post live"}),(e=this.store)===null||e===void 0||e.actions.internal.setWaitingRecord(!0),(i=this.store)===null||i===void 0||i.destroy()}setLiveEnd(e){var i,n;this.log({message:"live ended"}),(i=this.store)===null||i===void 0||i.actions.internal.setWaitingRecord(!1),(n=this.svelteRootComponent)===null||n===void 0||n.$destroy(),this.createPlayer(e,{autoplay:!1})}getDeviceId(){var e,i;return(i=(e=this.statistics)===null||e===void 0?void 0:e.oneStat.getDeviceId())!==null&&i!==void 0?i:void 0}replayInteractiveVideo(){this.interactiveController&&this.interactiveController.setChapter()}}const a6=()=>{window.customElements.define("vk-video-player",s6)};Object.defineProperty(exports,"VideoFormat",{enumerable:!0,get:function(){return $e.VideoFormat}});Object.defineProperty(exports,"VideoQuality",{enumerable:!0,get:function(){return $e.VideoQuality}});Object.defineProperty(exports,"InterfaceLanguage",{enumerable:!0,get:function(){return ne.InterfaceLanguage}});Object.defineProperty(exports,"VKNumericLanguage",{enumerable:!0,get:function(){return ne.VKNumericLanguage}});Object.defineProperty(exports,"loadVKLangPack",{enumerable:!0,get:function(){return ne.loadVKLangPack}});exports.VERSION=pl;exports.registerPlayerWebComponent=a6;
51
+ `),l=document.createElement("style");l.textContent=n;const r=this.createStretchedContainer(),o=r.attachShadow({mode:"open"});o.append(l),o.append(this.playerDomElement),this.playerDummyElement=new Z_({target:this.playerParentShadowRoot,context:this.svelteContext}),(e=this.pipWindow)===null||e===void 0||e.document.body.append(r),this.info.isActive$.next(!0),(i=this.pipWindow)===null||i===void 0||i.addEventListener("unload",s=>{!this.playerDomElement||!this.playerParentShadowRoot||!this.playerDummyElement||(this.playerDummyElement.$destroy(),this.playerParentShadowRoot.append(this.playerDomElement),this.info.isActive$.next(!1))})}async remove(){return new Promise(e=>{var i;(i=documentPictureInPicture.window)===null||i===void 0||i.close(),e()})}async dispose(){await this.remove()}createStretchedContainer(){const e=document.createElement("div");return e.style.width="100%",e.style.height="100%",e}}function Y_(t){return t instanceof Tf}class Q_{static getLatestSupportedVersion(){const e=new hr,i=new Tf;if(i.isSupported())return i;if(e.isSupported())return e}}function v1(t,e){var i,n;const l=new Set([...Object.keys(t),...Object.keys(e)]),r={};for(const o of l)r[o]=(n=(i=e[o])!==null&&i!==void 0?i:t[o])!==null&&n!==void 0?n:void 0;return r}const X_="Inner error. Unexpectedly root annotation container null reference exception",J_="Annotation with such name already exists",x_="Annotation with such name does not exist";class Jl extends Error{constructor(e){super(e),this.name="AnnotationError"}}const $_="1",e6=100;class t6{constructor(e){this.annotations=new Map,this.subscriptions=new ne.Subscription,this.rootAnnotationsContainer=e;const i=ne.throttleFn(()=>{for(const n of this.annotations.values())this.isElementExceedsBoundaries(n,this.playerSize.width,this.playerSize.height)?n.style.visibility="hidden":n.style.visibility="visible"},e6);this.subscriptions.add(ne.observeElementSize(this.rootAnnotationsContainer).subscribe(({width:n,height:l})=>{this.playerSize={width:n,height:l},i()})),this.mutationObserver=new MutationObserver(i),this.mutationObserver.observe(this.rootAnnotationsContainer,{attributes:!0,childList:!0,subtree:!0,characterData:!0})}add(e,i){var n;if(!this.rootAnnotationsContainer)throw new Jl(X_);if(this.annotations.has(e))throw new Jl(J_);i.style.zIndex=(n=i.style.zIndex)!==null&&n!==void 0?n:$_,i.style.position="absolute",this.rootAnnotationsContainer.append(i),this.annotations.set(e,i)}get(e){const i=this.annotations.get(e);if(!i)throw new Jl(x_);return i}remove(e){const i=this.get(e);this.annotations.delete(e)&&i.remove()}clear(){for(const e in this.annotations.keys())this.remove(e)}destroy(){this.annotations.clear(),this.subscriptions.unsubscribe(),this.mutationObserver.disconnect(),this.rootAnnotationsContainer=null}isElementExceedsBoundaries(e,i,n){const l=e.offsetTop,r=e.offsetLeft,o=e.offsetWidth,s=e.offsetHeight;return l<0||r<0||r+o>i||l+s>n}registryRootContainer(e){}addLayer(e){return new HTMLElement}getLayer(e){}removeLayer(e){}clearLayer(e){}detach(){}reattach(){}}class Tr{init(e,i){return ne.assertNonNullable(e),ne.assertNonNullable(i),this.subscription=new ne.Subscription,this.subscription}}class i6 extends Tr{constructor(){super(...arguments),this.stateName="fakeIsPlaying$",this.state$={...Ne(null),toggle:()=>this.state$.update(e=>!e)}}init(e,i){const n=super.init(e,i),{isInteractiveExpectation$:l}=e.state;return n.add(l.subscribe(r=>{this.state$.set(r?!0:null)})),n}}class n6 extends Tr{constructor(){super(...arguments),this.stateName="interactiveControlsOpacity$",this.state$={...Ne(null),toggle:()=>this.state$.update(e=>!e)}}init(e,i){const n=super.init(e,i),{fakeIsPlaying$:l}=i,{isInteractiveExpectation$:r,isPlaying$:o}=e.state,{controlsVisible:s,isMobile:a}=e.ui,c=tt(a),f=()=>c&&tt(s);return n.add(s.subscribe(m=>{if(!c)return;const h=tt(l);tt(o)?this.state$.set(m):h!==null&&this.state$.set(!h||m)})),n.add(o.subscribe(m=>{this.state$.set(!m||f())})),n.add(l.subscribe(m=>{if(m===null)return;const h=tt(r);if(f()){this.state$.set(!0);return}h&&this.state$.set(!m)})),n}}class o6 extends Tr{constructor(){super(...arguments),this.stateName="seekToInteractiveDisabledTooltip$",this.state$=Ne("tooltip_chapter_without_interactive")}init(e,i){const n=super.init(e,i);return n.add(e.state.interactiveEpisodes$.subscribe(l=>{l.length&&(l.every(r=>r.completed)?this.state$.set("tooltip_interactive_of_chapter_completed"):this.state$.set("tooltip_disabled_when_interactive"))})),n}}const l6=()=>[i6,n6,o6].reduce(({subscribers:t,stores:e},i)=>{const n=new i;return{subscribers:[...t,n],stores:{...e,[n.stateName]:n.state$}}},{subscribers:[],stores:{}}),r6={preload:!0,autoplay:!1,repeat:!1,fromTime:0,canRewindLive:!0,showAds:!1,interfaceLanguage:ne.InterfaceLanguage.RU,logoClickable:!1,logoHidden:!1,isMobile:ne.isMobile(),isMediaSessionEnabled:!0,isPictureInPictureEnabled:!0,isAudioDisabled:!1,callbacks:{uiInfo:{}},tuningConfig:{configName:[]}};class s6 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.logger=new ne.Logger,this.log=this.logger.createComponentLog("VKVideoPlayer"),this.subscription=new ne.Subscription,this.graphMadePause=!1,!((e=window==null?void 0:window.videoPlayerConfig)===null||e===void 0)&&e.debugLogs&&this.subscription.add(this.logger.log$.subscribe(i=>{console.log("%c player web component ","background:#77dd77;",`${i.component}`,i.message)}))}connectedCallback(){var e,i;if(this.isInited)return;this.initPlayerRootContainers();const n=(e=this.getAttribute("stub-title"))!==null&&e!==void 0?e:void 0,l=(i=this.getAttribute("stub-thumb-url"))!==null&&i!==void 0?i:void 0;this.svelteStubComponent=new z_({target:this.playerContainer,props:{title:n,thumbUrl:l}})}disconnectedCallback(){var e,i,n,l,r;(e=this.annotationsApi)===null||e===void 0||e.destroy(),(i=this.svelteRootComponent)===null||i===void 0||i.$destroy(),(n=this.svelteStubComponent)===null||n===void 0||n.$destroy(),this.subscription.unsubscribe(),(l=this.unsubscribePlayerPhaseSubscription)===null||l===void 0||l.call(this),(r=this.interactiveController)===null||r===void 0||r.destroy()}initPlayerRootContainers(){this.rootContainer=document.createElement("div"),this.rootContainer.style.position="relative",this.rootContainer.className="root-container",this.rootContainer.style.width="100%",this.rootContainer.style.height="100%";const e=document.createElement("div");e.style.position="absolute",e.className="shadow-root-container",e.style.width="100%",e.style.height="100%",this._shadowRoot=e.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.rootContainer.append(e),this.append(this.rootContainer)}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 i;const n=(i=this.store)===null||i===void 0?void 0:i.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,i={},n){var l,r,o,s,a,c,f,m,h,_,g,w,b;if(!this.videoConfig)return;const{albumId:C,statPlace:k,statUserSalt:y,statAuthToken:M,statTrackCode:j,refreshStatAuthToken:I,preload:z,autoplay:ae,volume:se,muted:R,fromTime:te,canRewindLive:X,supportLink:G,showAds:A,adsSlotId:V,adsParams:x={},adsPreviewParam:L,interfaceLanguage:ie,logoClickable:Ee,logoHidden:ye,isMobile:Le,isAudioDisabled:Ve,isLiveCatchUpMode:_e,fullScreenTarget:Se,failoverHosts:W,canDownload:$,callbacks:fe,interactiveData:ue,showThumbTimer:Fe,additionalButtons:Oe=[],repeat:Me}=v1(this.videoConfig,i),{sources:Ie,title:ce,thumbUrl:he,videoLogoUrl:re,unitedVideoId:Te,isClip:pe=!1,duration:Pe,adsParams:Ke={},videoEpisodes:Re,previewThumbsData:xe,subtitles:Xe,live:ot}=e,at={...x,...Ke},At=this.getNextVideoInfo(),pt={sources:Ie,title:ce,thumbUrl:he,subtitles:Xe,unitedVideoId:Te,isClip:pe,live:ot,albumId:C,statPlace:k,autoplay:ae,muted:R,volume:se,fromTime:te,canRewindLive:X,showAds:A,adsSlotId:V,adsParams:at,adsPreviewParam:L,duration:Pe,logoClickable:Ee,logoHidden:ye,isMobile:Le,repeat:Me,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:At.nextVideoTitle,endScreenVideoThumb:At.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist()},xt={pictureInPictureApi:this.pictureInPictureApi,annotationsApi:this.annotationsApi};this.log({message:`create player, props: ${JSON.stringify(pt)}`});const gt=this.uiConfig.features.statistics&&!!Te,{pid:Mt}=((r=(l=this.videoConfig)===null||l===void 0?void 0:l.interactiveData)===null||r===void 0?void 0:r.projectInfo)||{};gt&&(this.statistics=new Z5({movieId:Te,albumId:C,place:k,trackCode:j,autoplay:(o=ae&&!this.interactiveController)!==null&&o!==void 0?o:!1,mobile:Le,clip:pe,refDomain:this.videoConfig.refDomain,...Mt&&!this.isInited&&{projectId:Number(Mt)}},{refreshAuthToken:I,userSalt:y,config:this.statisticsConfig,...this.interactiveController&&{useIsid:!0,isid:this.prevIsid}})),this.uiConfig.features.sentry&&this.uiConfig.sentry.dsn&&new lr(this.uiConfig.sentry,{version:pl,env:L0},{movieId:Te,albumId:C,place:k,autoplay:(s=ae&&!this.interactiveController)!==null&&s!==void 0?s:!1,mobile:Le,clip:pe}),this.interactiveController&&((a=this.prevIsid)!==null&&a!==void 0||(this.prevIsid=(c=this.statistics)===null||c===void 0?void 0:c.oneStat.isid$.getValue())),this.sentry={...this.sentry,...lr.getInstance()};const _t=!!ue,rt=[];let Rt="tooltip_interactive_go_back_disabled_first";if(_t&&this.interactiveController){const Je=this.interactiveController.state.isInitialChapter$.getValue(),Ue=this.interactiveController.getHistoryState();Je&&rt.push(dt.REPLAY_BUTTON),this.interactiveController.getIsSeekable().getValue()||rt.push(dt.SEEK_TO_INTERACTIVE_BUTTON),Ue.hasPrevChapter$.getValue()||(rt.push(dt.PLAY_PREV_CHAPTER_BUTTON),Je||(Ue.isGoBackLimited$.getValue()?Rt="tooltip_interactive_go_back_disabled_limit":Rt="tooltip_interactive_go_back_disabled"))}const ut=()=>{var Je;this.isInited=!1,this.prevIsid=void 0;const Ue=(n==null?void 0:n.info.isEnded$.getValue())&&((Je=this.interactiveController)===null||Je===void 0?void 0:Je.state.isEndChapter$.getValue());fe.onReplayInteractiveVideo&&!Ue?fe.onReplayInteractiveVideo():this.replayInteractiveVideo()};this.store=K5({player:n,interfaceLanguage:ie,videoId:Te,isClip:pe,isLiveCatchUpMode:_e,isAudioDisabled:Ve,statAuthToken:M,callbacks:fe,webApi:xt,videoEpisodes:Re,previewThumbsData:xe,canDownload:$,uiConfig:this.uiConfig,coreConfig:this.coreConfig,disabledControls:rt,isInteractive:_t,interactiveRanges$:(f=this.interactiveController)===null||f===void 0?void 0:f.state.interactiveRanges$,isInteractiveTime$:(m=this.interactiveController)===null||m===void 0?void 0:m.state.isInteractiveTime$,replayInteractive:ut,playPrevChapterDisabledTooltip:Rt,hasInteractiveBranches:!!(!((_=(h=this.interactiveController)===null||h===void 0?void 0:h.getChapterBranches())===null||_===void 0)&&_.length),additionalButtons:this.uiConfig.features.additionalButtons?Oe:[],looped:Me&&this.videoConfig.videos.length===1,statistics:this.statistics});const{stores:It}=this.microStoresRoot=l6();this.subscription.add(this.store.state.currentFormat$.subscribe(Je=>{var Ue;return(Ue=fe==null?void 0:fe.onCurrentFormatChanged)===null||Ue===void 0?void 0:Ue.call(fe,Je)})),this.subscription.add(It.interactiveControlsOpacity$.subscribe(Je=>{var Ue;Je!==null&&((Ue=this===null||this===void 0?void 0:this.interactiveController)===null||Ue===void 0||Ue.setDisabledControls(Je))})),this.subscription.add(this.store.state.throughputEstimation$.subscribe(Je=>{var Ue;return(Ue=fe==null?void 0:fe.onThroughputEstimationChanged)===null||Ue===void 0?void 0:Ue.call(fe,Je)})),this.subscription.add(this.store.state.trafficSavingEnabled$.subscribe(Je=>{var Ue;return(Ue=fe==null?void 0:fe.onTrafficSavingEnabledChanged)===null||Ue===void 0?void 0:Ue.call(fe,Je)})),this.subscription.add(this.store.state.currentPlaybackRate$.subscribe(Je=>{var Ue;return(Ue=fe==null?void 0:fe.onCurrentPlaybackRateChanged)===null||Ue===void 0?void 0:Ue.call(fe,Je)})),this.subscription.add(this.store.state.volume$.subscribe(Je=>{var Ue;return(Ue=fe==null?void 0:fe.onVolumeChange)===null||Ue===void 0?void 0:Ue.call(fe,Je)})),this.subscription.add(this.store.state.muted$.subscribe(Je=>{var Ue,St;return Je?(Ue=fe==null?void 0:fe.onMute)===null||Ue===void 0?void 0:Ue.call(fe):(St=fe==null?void 0:fe.onUnmute)===null||St===void 0?void 0:St.call(fe)})),this.subscription.add(this.store.state.videoBitrate$.subscribe(Je=>{var Ue;return(Ue=fe==null?void 0:fe.onVideoBitrateChanged)===null||Ue===void 0?void 0:Ue.call(fe,Je)})),this.subscription.add(this.store.state.isInteractiveTime$.subscribe(Je=>{var Ue;const St=(Ue=this.store)===null||Ue===void 0?void 0:Ue.ui.controls.disabledControls$;St&&(Je&&!St.includes(sl)&&St.add(sl),Je||St.remove(sl))})),this.initMediaSession(),this.interactiveController&&gt&&this.initInteractivesStatistics(),this.svelteRootComponent=new V_({target:this.playerContainer,props:{interactiveContainer:this.interactiveContainer,sources:Ie,store:this.store,microStoresRoot:this.microStoresRoot,uiConfig:this.uiConfig,title:ce,thumbUrl:he,videoLogoUrl:re,subtitles:Xe,live:ot,preload:z,autoplay:ae,muted:R,volume:se,fromTime:te,canRewindLive:X,supportLink:G,showAds:A,adsSlotId:V,adsParams:at,adsPreviewParam:L,duration:Pe,logoClickable:Ee,logoHidden:ye,isMobile:Le,failoverHosts:W,fullScreenTarget:Se,showMiniTimer:Fe,outerContainerRef:this.rootContainer,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:At.nextVideoTitle,endScreenVideoThumb:At.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,(b=(w=(g=this.videoConfig)===null||g===void 0?void 0:g.callbacks)===null||w===void 0?void 0:w.onInited)===null||b===void 0||b.call(w))}addPlayerInfoSubscriptions(){var e;const i=this.store;if(!i)return;const n=(e=this.videoConfig)===null||e===void 0?void 0:e.callbacks;n&&this.subscription.add(i.playerPhase.subscribe(r=>{var o;return(o=n.onPlayerPhaseChanged)===null||o===void 0?void 0:o.call(n,r)})).add(i.state.playbackState$.subscribe(r=>{var o;return(o=n.onPlaybackStateChanged)===null||o===void 0?void 0:o.call(n,r)})).add(i.state.isLive$.subscribe(r=>{var o;return(o=n.onIsLiveChanged)===null||o===void 0?void 0:o.call(n,r)})).add(i.state.isActiveLive$.subscribe(r=>{var o;return(o=n.onIsActiveLiveChanged)===null||o===void 0?void 0:o.call(n,r)})).add(i.state.isAudioAvailable$.subscribe(r=>{var o;return(o=n.onIsAudioAvailableChanged)===null||o===void 0?void 0:o.call(n,r)})).add(i.state.currentQuality$.subscribe(r=>{var o;return(o=n.onCurrentQualityChanged)===null||o===void 0?void 0:o.call(n,r)})).add(i.state.availableQualities$.subscribe(r=>{var o;return(o=n.onAvailableQualitiesChanged)===null||o===void 0?void 0:o.call(n,r.map(({value:s})=>s).filter(s=>s!==wo.AUTO))})).add(i.ui.isPictureInPictureActive$.subscribe(r=>{var o,s;return r?(o=n.onPiPEnter)===null||o===void 0?void 0:o.call(n):(s=n.onPiPExit)===null||s===void 0?void 0:s.call(n)}));const l=n==null?void 0:n.uiInfo;l&&this.subscription.add(i.ui.controlsVisible.subscribe(r=>{var o;return(o=l.onControlsVisibleChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.isMobile.subscribe(r=>{var o;return(o=l.onIsMobileChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.playerSize.subscribe(r=>{var o;return(o=l.onPlayerSizeChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.prevButton.subscribe(r=>{var o;return(o=l.onPrevButtonChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.playButton.subscribe(r=>{var o;return(o=l.onPlayButtonChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.replayButton.subscribe(r=>{var o;return(o=l.onReplayButtonChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.nextButton.subscribe(r=>{var o;return(o=l.onNextButtonChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.playPrevChapterButton.subscribe(r=>{var o;return(o=l.onPlayPrevChapterChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.seekToInteractiveButton.subscribe(r=>{var o;return(o=l.onSeekToInteractiveButtonChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.interactiveGraphButton.subscribe(r=>{var o;return(o=l.onGraphButtonChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.liveButton.subscribe(r=>{var o;return(o=l.onLiveButtonChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.time.subscribe(r=>{var o;return(o=l.onTimeUpdateChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.episodes.subscribe(r=>{var o;return(o=l.onEpisodesChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.subtitles.subscribe(r=>{var o;return(o=l.onSubtitlesChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.settings.subscribe(r=>{var o;return(o=l.onSettingsChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.fullscreen.subscribe(r=>{var o;return(o=l.onFullscreenChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.chromecast.subscribe(r=>{var o;return(o=l.onChromecastChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.pip.subscribe(r=>{var o;return(o=l.onPipChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.vkLogo.subscribe(r=>{var o;return(o=l.onVkLogoChanged)===null||o===void 0?void 0:o.call(l,r)})).add(i.ui.controls.interactiveTimeIcon.subscribe(r=>{var o;return(o=l.onInteractiveTimeIconChanged)===null||o===void 0?void 0:o.call(l,r)}))}playNextVideo(){var e;if(!this.videoConfig)return;let i=!0;if(!((e=this.videoConfig.callbacks)===null||e===void 0)&&e.onNextVideoClick)try{i=this.videoConfig.callbacks.onNextVideoClick()}catch(n){this.log({message:"onNextVideoClick callback failed to execute"})}i&&(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 i=!0;if(!((e=this.videoConfig.callbacks)===null||e===void 0)&&e.onPrevVideoClick)try{i=this.videoConfig.callbacks.onPrevVideoClick()}catch(n){this.log({message:"onPrevVideoClick callback failed to execute"})}i&&(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,i=!0){var n;if(!this.videoConfig)return;const l=this.videoConfig.videos[this.currentPlayingVideoIndex];if(!l){this.log({message:"no next video"});return}this.isInited&&ne.isNonNullable(l.unitedVideoId)&&this.store.actions.internal.nextMovie(l.unitedVideoId),(n=this.svelteRootComponent)===null||n===void 0||n.$destroy(),this.createPlayer(l,{autoplay:i,fromTime:0},e)}playPrevChapter(){var e;(e=this.interactiveController)===null||e===void 0||e.playPrevChapter()}seekToInteractive(){var e;const i=(e=this.interactiveController)===null||e===void 0?void 0:e.getNextInteractiveStartTime();typeof i=="number"&&this.seekTime(i/1e3)}toggleGraph(){var e,i;if(!this.isInited)return;const n=this.store,{isEnded$:l,playbackState$:r,graphIsOpened$:o}=n.state,{disabledControls$:s}=n.ui.controls,a=tt(l),c=tt(r);tt(o)?(o.set(!1),(e=this.interactiveController)===null||e===void 0||e.toggleGraphView(!1),s.remove(Ur),!a&&this.graphMadePause&&this.play()):(this.graphMadePause=c==="playing",o.set(!0),(i=this.interactiveController)===null||i===void 0||i.toggleGraphView(!0),s.add(Ur),!a&&this.graphMadePause&&this.pause())}async initInteractives(){var e,i,n,l;if(!((e=this.videoConfig)===null||e===void 0)&&e.interactiveData)try{const{Interactives:r,EVENT_NAMES:o,CustomError:s}=await import("@vkontakte/videoplayer-interactive/es2018.cjs.js");this.interactiveContainer=document.createElement("div"),this.interactiveContainer.classList.add("interactiveContainer");const a=(i=this.store)===null||i===void 0?void 0:i.interfaceLanguage$,c=a?tt(a):this.videoConfig.interfaceLanguage,{projectInfo:f,initChapterId:m,historyApi:h,videoLoader:_}=this.videoConfig.interactiveData;this.interactiveController=new r({parentElement:this.interactiveContainer,fullscreenTargetElement:this.playerContainer,lang:c,graph:this.uiConfig.features.interactiveGraph,projectInfo:f,initChapterId:m,historyApi:h,vkVideoLoader:_,lastFrame:this.uiConfig.features.interactiveLastFrame,permanentTextControls:this.uiConfig.features.interactiveTextPermanent,initSeamless:!0,config:this.uiConfig.interactive,coreConfig:this.coreConfig}),await this.interactiveController.setManifest(this.videoConfig.interactiveData.manifest);const{isInteractiveExpectation$:g}=this.interactiveController.state;this.uiConfig.features.seekToInteractive&&this.subscription.add(this.interactiveController.getIsSeekable().subscribe(b=>{if(!this.isInited)return;const C=this.store;b?C.ui.controls.disabledControls$.remove(dt.SEEK_TO_INTERACTIVE_BUTTON):C.ui.controls.disabledControls$.add(dt.SEEK_TO_INTERACTIVE_BUTTON)})),this.subscription.add(g.subscribe(b=>{this.store&&this.store.state.isInteractiveExpectation$.set(b)}));let w=!0;if(this.interactiveController.on(o.playerChanged,b=>{if(!this.videoConfig)return;this.videoConfig.videos[this.currentPlayingVideoIndex]={...b.config,title:(f==null?void 0:f.title)||b.config.title};const C=w?this.videoConfig.autoplay:!0;this.createPlayerWithCurrentVideo(b.player,C),w&&(w=!1)}),this.interactiveController.on(o.interactives,({type:b,actionType:C})=>{var k,y,M,j;if(!this.store)return;const I=g.getValue();if(b==="action-choice"&&C==="setRandomBranch"&&(this.store.state.graphIsOpened$.set(!1),this.store.ui.controls.disabledControls$.remove(E1)),b==="action-choice-canceled"){const z=tt(this.store.state.isPlaying$)||I;if(!((k=this.videoConfig)===null||k===void 0)&&k.isMobile&&z){this.store.ui.interactiveHideMobileControls.set(!0);return}(j=(y=this.videoConfig)===null||y===void 0?void 0:(M=y.callbacks).onDisabledInteractiveClick)===null||j===void 0||j.call(M)}}),!((l=(n=this.videoConfig)===null||n===void 0?void 0:n.callbacks)===null||l===void 0)&&l.onInteractiveHistoryChanged){const b=this.interactiveController.getHistoryState();this.subscription.add(b.history$.subscribe(C=>{var k,y,M;C.length&&((M=(y=(k=this.videoConfig)===null||k===void 0?void 0:k.callbacks)===null||y===void 0?void 0:y.onInteractiveHistoryChanged)===null||M===void 0||M.call(y,C))}))}this.interactiveController.events.noInteraction$.subscribe(()=>{var b,C,k;(k=(b=this.videoConfig)===null||b===void 0?void 0:(C=b.callbacks).onInteractiveTimeIconClick)===null||k===void 0||k.call(C)}),this.interactiveController.on(o.errors,b=>{this.log({message:b.toString()})})}catch(r){this.log({message:r.message})}}async initInteractivesStatistics(){var e,i;const{statSubscription:n,oneStat:l}=this.statistics;if(!(!n||!l||!this.interactiveController))try{const{INTERACTIVE_CLICK_ACTIONS:r}=await import("@vkontakte/videoplayer-interactive/es2018.cjs.js"),o={[r.GO_NEXT_BUTTON]:yt.InteractiveInterfaceClick.NEXT_BUTTON,[r.GO_NEXT_AREA]:yt.InteractiveInterfaceClick.NEXT_AREA,[r.WATCH_AGAIN]:yt.InteractiveInterfaceClick.WATCH_AGAIN,[r.OPEN_GRAPH]:yt.InteractiveInterfaceClick.GRAPH_SHOW,[r.CLOSE_GRAPH]:yt.InteractiveInterfaceClick.GRAPH_HIDE},{click$:s,nextMovie$:a}=this.interactiveController.getStatEvents(),c=new ne.Subject;s.subscribe(f=>{var m,h;f in o?c.next(o[f]):(l==null||l.logError({errorType:"InteractiveVideosAction",fatal:!1}),(h=(m=this.sentry).report)===null||h===void 0||h.call(m,new Error("InteractiveVideosAction"),{errorType:"InteractiveVideosAction",fatal:!1}))}),n.add(l.attachToInteractive({click$:c,nextMovie$:a}))}catch(r){l==null||l.logError({errorType:"InteractiveVideos",fatal:!1}),(i=(e=this.sentry).report)===null||i===void 0||i.call(e,r,{errorType:"InteractiveVideosAction",fatal:!1})}}initPlayer(e,i={}){var n,l,r,o,s,a,c,f,m,h,_,g,w,b,C,k,y,M,j;if(!Array.isArray(e.videos)||e.videos.length===0&&!e.interactiveData)throw new Error("empty videos");this.videoConfig=v1(r6,ne.cloneDeepWith(e,I=>I instanceof HTMLElement?I:void 0)),this.uiConfig=k0((n=i.ui)!==null&&n!==void 0?n:{}),this.coreConfig=(l=i.core)!==null&&l!==void 0?l:{configName:[]},this.statisticsConfig=(r=i.statistics)!==null&&r!==void 0?r:{},this.sentry={config:(o=this.uiConfig.sentry)!==null&&o!==void 0?o:{}},ne.isNonNullable(this.videoConfig.isMediaSessionEnabled)&&(this.uiConfig.features.mediaSession=(s=this.videoConfig.isMediaSessionEnabled)!==null&&s!==void 0?s:!0),ne.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=(m=(f=this.uiConfig.features.dpip)!==null&&f!==void 0?f:this.videoConfig.isPictureInPictureEnabled)!==null&&m!==void 0?m:!0),this.videoConfig.isMobile=(h=this.uiConfig.isMobile)!==null&&h!==void 0?h:this.videoConfig.isMobile,(M=this.videoConfig).autoplay&&(M.autoplay=this.uiConfig.features.autoplay),this.videoConfig.showAds=(_=this.uiConfig.ads.enable)!==null&&_!==void 0?_:this.videoConfig.showAds,this.videoConfig.adsSlotId=(g=this.uiConfig.ads.slot)!==null&&g!==void 0?g:this.videoConfig.adsSlotId,this.videoConfig.adsPreviewParam=(w=this.uiConfig.ads.preview)!==null&&w!==void 0?w:this.videoConfig.adsPreviewParam,this.videoConfig.logoHidden=!((b=this.uiConfig.showLogo)!==null&&b!==void 0?b:!this.videoConfig.logoHidden),(j=this.videoConfig).canRewindLive&&(j.canRewindLive=this.uiConfig.features.liveRewind),this.videoConfig.supportLink=(C=this.videoConfig.supportLink)!==null&&C!==void 0?C:this.uiConfig.supportLink,this.currentPlayingVideoIndex=0,this.needToRepeatPlaylist=this.videoConfig.repeat,this.uiConfig.features.pip&&(this.uiConfig.features.dpip?this.pictureInPictureApi=Q_.getLatestSupportedVersion():this.pictureInPictureApi=new hr),this.mediaSessionApi=this.uiConfig.features.mediaSession?new F_:void 0,this.annotationsApi=this.uiConfig.features.annotations?new t6(this.rootContainer):void 0,(k=this.svelteStubComponent)===null||k===void 0||k.$destroy(),(y=this.svelteRootComponent)===null||y===void 0||y.$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]),Y_(this.pictureInPictureApi)&&this.pictureInPictureApi.setPlayerDomElement(this.playerContainer,this._shadowRoot)}isOneVideoPlaylist(){return this.videoConfig?this.videoConfig.videos.length===1:!1}updateNextVideos(e){var i;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();(i=this.svelteRootComponent)===null||i===void 0||i.$set({showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:n.nextVideoTitle,endScreenVideoThumb:n.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist()})}initMediaSession(){var e,i;this.mediaSessionApi&&((e=this.unsubscribePlayerPhaseSubscription)===null||e===void 0||e.call(this),this.unsubscribePlayerPhaseSubscription=(i=this.store)===null||i===void 0?void 0:i.playerPhase.subscribe(n=>{n===De.Video?this.setupMediaSessionForVideo():n===De.Ads&&this.setupMediaSessionForAds()}))}setupMediaSessionForVideo(){if(!(!this.videoConfig||!this.mediaSessionApi))try{const{title:e,thumbUrl:i}={...this.videoConfig.videos[this.currentPlayingVideoIndex]},n=[["play",()=>this.play()],["pause",()=>this.pause()],["seekto",l=>this.seekTime(l.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:i}),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",i=[["play",()=>this.play()],["pause",()=>this.pause()]];this.mediaSessionApi.setMetaData({title:e}),this.mediaSessionApi.updateActionHandlers(i)}catch(e){this.log({message:e.message})}}play(){var e,i;this.isControlDisabled(dt.PLAY_BUTTON)||!((e=this.store)===null||e===void 0)&&e.playerPhase.is(De.WaitingLive)||(this.log({message:"play"}),(i=this.svelteRootComponent)===null||i===void 0||i.play())}pause(){var e;this.log({message:"pause"}),(e=this.svelteRootComponent)===null||e===void 0||e.pause()}stop(){var e,i;if(!this.videoConfig)return;this.log({message:"stop"}),(e=this.svelteStubComponent)===null||e===void 0||e.$destroy();const n=this.videoConfig.videos[0];n&&((i=this.svelteRootComponent)===null||i===void 0||i.$destroy(),this.createPlayer(n))}setMuted(e){var i;this.log({message:`set muted, muted: ${e}`}),(i=this.svelteRootComponent)===null||i===void 0||i.setMuted(e)}setVolume(e){var i;this.log({message:`set volume, volume: ${e}`}),(i=this.svelteRootComponent)===null||i===void 0||i.setVolume(e)}setRepeat(e){var i;this.log({message:`set repeat, repeat: ${e}`}),this.needToRepeatPlaylist=e,(i=this.svelteRootComponent)===null||i===void 0||i.$set({needToRepeatPlaylist:this.needToRepeatPlaylist,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive()})}seekTime(e){var i;this.isControlDisabled(dt.TIMELINE)||(this.log({message:`seek time, time: ${e}`}),(i=this.svelteRootComponent)===null||i===void 0||i.seekTime(e))}seekEpisodeStartTime(e){var i;this.log({message:`seek episode start time, time: ${e}`}),(i=this.svelteRootComponent)===null||i===void 0||i.seekEpisodeStartTime(e)}returnFocusToEpisodes(){var e;this.log({message:"return focus to episodes button"}),(e=this.svelteRootComponent)===null||e===void 0||e.returnFocusToEpisodes()}setPlaybackRate(e){var i;this.log({message:`set playback rate to: ${e}`}),(i=this.svelteRootComponent)===null||i===void 0||i.setPlaybackRate(e)}setAutoQualityLimits(e){var i,n,l;this.log({message:`set auto quality limitation. Max: ${(i=e.max)!==null&&i!==void 0?i:"none"}. Min: ${(n=e.min)!==null&&n!==void 0?n:"none"}`}),(l=this.svelteRootComponent)===null||l===void 0||l.setAutoQualityLimits(e)}addLanguage(e){var i;(i=this.store)===null||i===void 0||i.actions.internal.addLanguage(e)}async setLanguage(e){var i;await((i=this.store)===null||i===void 0?void 0:i.actions.internal.setLanguage(e))}setLiveStart(e){var i,n;this.log({message:"live started"}),(i=this.store)===null||i===void 0||i.actions.internal.setWaitingLive(!1),(n=this.svelteRootComponent)===null||n===void 0||n.initVideo(e),this.play()}setWaitRecord(){var e,i;this.log({message:"post live"}),(e=this.store)===null||e===void 0||e.actions.internal.setWaitingRecord(!0),(i=this.store)===null||i===void 0||i.destroy()}setLiveEnd(e){var i,n;this.log({message:"live ended"}),(i=this.store)===null||i===void 0||i.actions.internal.setWaitingRecord(!1),(n=this.svelteRootComponent)===null||n===void 0||n.$destroy(),this.createPlayer(e,{autoplay:!1})}getDeviceId(){var e,i;return(i=(e=this.statistics)===null||e===void 0?void 0:e.oneStat.getDeviceId())!==null&&i!==void 0?i:void 0}replayInteractiveVideo(){this.interactiveController&&this.interactiveController.setChapter()}}const a6=()=>{window.customElements.define("vk-video-player",s6)};Object.defineProperty(exports,"VideoFormat",{enumerable:!0,get:function(){return $e.VideoFormat}});Object.defineProperty(exports,"VideoQuality",{enumerable:!0,get:function(){return $e.VideoQuality}});Object.defineProperty(exports,"InterfaceLanguage",{enumerable:!0,get:function(){return ne.InterfaceLanguage}});Object.defineProperty(exports,"VKNumericLanguage",{enumerable:!0,get:function(){return ne.VKNumericLanguage}});Object.defineProperty(exports,"loadVKLangPack",{enumerable:!0,get:function(){return ne.loadVKLangPack}});exports.VERSION=pl;exports.registerPlayerWebComponent=a6;