@vkontakte/videoplayer 1.1.61-dev.4affc441.0 → 1.1.61-dev.e1cb6686.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es2015.cjs.js +4 -4
- package/es2015.esm.js +4 -4
- package/es2018.cjs.js +4 -4
- package/es2018.esm.js +4 -4
- package/es2024.cjs.js +4 -4
- package/es2024.esm.js +4 -4
- package/esnext.cjs.js +4 -4
- package/esnext.esm.js +4 -4
- package/evergreen.esm.js +4 -4
- package/package.json +5 -5
- package/types/VKVideoPlayer/index.svelte.d.ts +2 -1
package/es2015.cjs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/videoplayer v1.1.61-dev.
|
|
3
|
-
* Tue, 15 Apr 2025
|
|
2
|
+
* @vkontakte/videoplayer v1.1.61-dev.e1cb6686.0
|
|
3
|
+
* Tue, 15 Apr 2025 01:45:49 GMT
|
|
4
4
|
* https://st.mycdn.me/static/vkontakte-videoplayer/1-1-61/doc/
|
|
5
5
|
*/
|
|
6
6
|
"use strict";var u0=Object.create;var Tl=Object.defineProperty,p0=Object.defineProperties,f0=Object.getOwnPropertyDescriptor,m0=Object.getOwnPropertyDescriptors,v0=Object.getOwnPropertyNames,pv=Object.getOwnPropertySymbols,g0=Object.getPrototypeOf,fv=Object.prototype.hasOwnProperty,h0=Object.prototype.propertyIsEnumerable;var mv=t=>{throw TypeError(t)};var Nu=(t,e,i)=>e in t?Tl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,q=(t,e)=>{for(var i in e||(e={}))fv.call(e,i)&&Nu(t,i,e[i]);if(pv)for(var i of pv(e))h0.call(e,i)&&Nu(t,i,e[i]);return t},Lt=(t,e)=>p0(t,m0(e));var _0=(t,e)=>{for(var i in e)Tl(t,i,{get:e[i],enumerable:!0})},vv=(t,e,i,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of v0(e))!fv.call(t,n)&&n!==i&&Tl(t,n,{get:()=>e[n],enumerable:!(o=f0(e,n))||o.enumerable});return t};var gv=(t,e,i)=>(i=t!=null?u0(g0(t)):{},vv(e||!t||!t.__esModule?Tl(i,"default",{value:t,enumerable:!0}):i,t)),b0=t=>vv(Tl({},"__esModule",{value:!0}),t);var Kn=(t,e,i)=>Nu(t,typeof e!="symbol"?e+"":e,i),Du=(t,e,i)=>e.has(t)||mv("Cannot "+i);var ki=(t,e,i)=>(Du(t,e,"read from private field"),i?i.call(t):e.get(t)),ms=(t,e,i)=>e.has(t)?mv("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),Ta=(t,e,i,o)=>(Du(t,e,"write to private field"),o?o.call(t,i):e.set(t,i),i),hv=(t,e,i)=>(Du(t,e,"access private method"),i);var Tt=(t,e,i)=>new Promise((o,n)=>{var a=l=>{try{d(i.next(l))}catch(u){n(u)}},s=l=>{try{d(i.throw(l))}catch(u){n(u)}},d=l=>l.done?o(l.value):Promise.resolve(l.value).then(a,s);d((i=i.apply(t,e)).next())});var yx={};_0(yx,{ControlButtonType:()=>Td,GridTypes:()=>Ar,InterfaceLanguage:()=>hl.InterfaceLanguage,MenuItemType:()=>il,PlayerPhase:()=>xs,VERSION:()=>Js,VKNumericLanguage:()=>hl.VKNumericLanguage,VideoFormat:()=>Au.VideoFormat,VideoQuality:()=>Au.VideoQuality,loadVKLangPack:()=>hl.loadVKLangPack,registerPlayerWebComponent:()=>$x});module.exports=b0(yx);var vs="[",Ns="[!",Ds="]",jr={};var Ei=Symbol(),gi=Symbol("filename"),_v=Symbol("hmr"),bv="http://www.w3.org/1999/xhtml",Ou="http://www.w3.org/2000/svg";var ac=!0;var $v,yv,Hu=(yv=($v=globalThis.process)==null?void 0:$v.env)==null?void 0:yv.NODE_ENV;Hu||console.warn("If bundling, conditions should include development or production. If not bundling, conditions or NODE_ENV should include development or production. See https://www.npmjs.com/package/esm-env for tips on setting conditions in popular bundlers and runtimes.");var Ie=Hu&&!Hu.toLowerCase().includes("prod");var Wo=Symbol("$state"),Zr=Symbol("$state metadata"),Il=Symbol("legacy props"),xv=Symbol("");var Sr=Array.isArray,wv=Array.prototype.indexOf,kl=Array.from,Fu=Object.keys,ro=Object.defineProperty,Wn=Object.getOwnPropertyDescriptor,lc=Object.getOwnPropertyDescriptors,Uu=Object.prototype,Sv=Array.prototype,Xr=Object.getPrototypeOf;function gs(t){return typeof t=="function"}var oe=()=>{};function Cv(t){return t()}function hs(t){for(var e=0;e<t.length;e++)t[e]()}var El=[],zu=[];function Tv(){var t=El;El=[],hs(t)}function $0(){var t=zu;zu=[],hs(t)}function rn(t){El.length===0&&queueMicrotask(Tv),El.push(t)}function qu(){El.length>0&&Tv(),zu.length>0&&$0()}function dc(t){return t===this.v}function Ia(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function Iv(t,e){return t!==e}function ka(t){return!Ia(t,this.v)}function kv(){if(Ie){let t=new Error(`derived_references_self
|
|
@@ -45,7 +45,7 @@ ${l}in ${p}`).join("")}
|
|
|
45
45
|
`)){let n=(i=A0.exec(o))!=null?i:M0.exec(o);n&&e.push({file:n[1],line:+n[2],column:+n[3]})}return e}function mg(){var e;let t=(e=L0())==null?void 0:e.slice(4);if(!t)return null;for(let i=0;i<t.length;i++){let o=t[i],n=P0[o.file];if(!n){if(i===0)return null;continue}for(let a of n){if(a.end==null)return null;if(a.start.line<o.line&&a.end.line>o.line)return a.component}}return null}var Sc=Symbol("ADD_OWNER");function dp(t,e,i=!1,o=!1){if(t&&!i){let n=un,a=t[Zr];if(a&&!cp(a,n)){let s=up(a);e&&e[gi]!==n[gi]&&!o&&jv(n[gi],e[gi],s[gi])}}Cc(t,e,new Set)}function Ju(t,e){if(e.owners!==null)for(;t;){if(t.owners===null){e.owners=null;break}for(let i of t.owners)e.owners.add(i);t=t.parent}}function Cc(t,e,i){var a;let o=t==null?void 0:t[Zr];if(o)"owners"in o&&o.owners!=null&&(e?o.owners.add(e):o.owners=null);else if(t&&typeof t=="object"){if(i.has(t))return;if(i.add(t),Sc in t&&t[Sc])So(()=>{t[Sc](e)});else{var n=Xr(t);if(n===Object.prototype)for(let s in t)if((a=Object.getOwnPropertyDescriptor(t,s))!=null&&a.get){let d=Ei;So(()=>{let l=t[s];d!==l&&(d=l,Cc(l,e,i))})}else Cc(t[s],e,i);else if(n===Array.prototype)for(let s=0;s<t.length;s+=1)Cc(t[s],e,i)}}}function cp(t,e){return t.owners===null?!0:t.owners.has(e)||gi in e&&[...t.owners].some(i=>i[gi]===e[gi])||t.parent!==null&&cp(t.parent,e)}function up(t){var e,i;return(i=(e=t==null?void 0:t.owners)==null?void 0:e.values().next().value)!=null?i:up(t.parent)}var V0=!1;function Xv(t){if(V0)return;let e=mg();if(e&&!cp(t,e)){let i=up(t);i[gi]!==e[gi]?Xu(e[gi],i[gi]):Xu()}}function Da(t){if(Ie){let e=new Error(`lifecycle_outside_component
|
|
46
46
|
\`${t}(...)\` can only be used during component initialisation
|
|
47
47
|
https://svelte.dev/e/lifecycle_outside_component`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/lifecycle_outside_component")}var kt=null;function Ol(t){kt=t}var un=null;function Hl(t){un=t}function Oa(t){return pp("getContext").get(t)}function Ha(t,e){let i=pp("setContext");return Ie&&$t(()=>dp(e,null,!0)),i.set(t,e),e}function Ul(){return pp("getAllContexts")}function K(t,e=!1,i){var o=kt={p:kt,c:null,d:!1,e:null,m:!1,s:t,x:null,l:null};Fr&&!e&&(kt.l={s:null,u:null,r1:[],r2:Hi(!1)}),pn(()=>{o.d=!0}),Ie&&(kt.function=i,un=i)}function W(t){var s,d;let e=kt;if(e!==null){t!==void 0&&(e.x=t);let l=e.e;if(l!==null){var i=xt,o=Nt;e.e=null;try{for(var n=0;n<l.length;n++){var a=l[n];so(a.effect),xo(a.reaction),Cn(a.fn)}}finally{so(i),xo(o)}}kt=e.p,Ie&&(un=(d=(s=e.p)==null?void 0:s.function)!=null?d:null),e.m=!0}return t||{}}function zr(){return!Fr||kt!==null&&kt.l===null}function pp(t){var e;return kt===null&&Da(t),(e=kt.c)!=null?e:kt.c=new Map(B0(kt)||void 0)}function B0(t){let e=t.p;for(;e!==null;){let i=e.c;if(i!==null)return i;e=e.p}return null}var N0=/\r/g;function vg(t){t=t.replace(N0,"");let e=5381,i=t.length;for(;i--;)e=(e<<5)-e^t.charCodeAt(i);return(e>>>0).toString(36)}function gg(t){return t.endsWith("capture")&&t!=="gotpointercapture"&&t!=="lostpointercapture"}var D0=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function hg(t){return D0.includes(t)}var O0=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected","webkitdirectory","defer","disablepictureinpicture","disableremoteplayback"];var H0={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};function _g(t){var e;return t=t.toLowerCase(),(e=H0[t])!=null?e:t}var xw=[...O0,"formNoValidate","isMap","noModule","playsInline","readOnly","value","volume","defaultValue","defaultChecked","srcObject","noValidate","allowFullscreen","disablePictureInPicture","disableRemotePlayback"];var F0=["touchstart","touchmove"];function bg(t){return F0.includes(t)}var U0=["textarea","script","style","title"];function $g(t){return U0.includes(t)}function fp(t){return t==null?void 0:t.replace(/\//g,"/\u200B")}var yg=new Map;function xg(t,e){var i=yg.get(t);i||(i=new Set,yg.set(t,i)),i.add(e)}function mp(t,e){if(e){let i=document.body;t.autofocus=!0,rn(()=>{document.activeElement===i&&t.focus()})}}function zl(t){var e=Nt,i=xt;xo(null),so(null);try{return t()}finally{xo(e),so(i)}}var vp=new Set,Tc=new Set;function Gs(t){if(!je)return;t.onload&&t.removeAttribute("onload"),t.onerror&&t.removeAttribute("onerror");let e=t.__e;e!==void 0&&(t.__e=void 0,queueMicrotask(()=>{t.isConnected&&t.dispatchEvent(e)}))}function gp(t,e,i,o={}){function n(a){if(o.capture||Fa.call(e,a),!a.cancelBubble)return zl(()=>i==null?void 0:i.call(this,a))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?rn(()=>{e.addEventListener(t,n,o)}):e.addEventListener(t,n,o),n}function Pt(t,e,i,o,n){var a={capture:o,passive:n},s=gp(t,e,i,a);(e===document.body||e===window||e===document)&&pn(()=>{e.removeEventListener(t,s,a)})}function lt(t){for(var e=0;e<t.length;e++)vp.add(t[e]);for(var i of Tc)i(t)}function Fa(t){var P;var e=this,i=e.ownerDocument,o=t.type,n=((P=t.composedPath)==null?void 0:P.call(t))||[],a=n[0]||t.target,s=0,d=t.__root;if(d){var l=n.indexOf(d);if(l!==-1&&(e===document||e===window)){t.__root=e;return}var u=n.indexOf(e);if(u===-1)return;l<=u&&(s=l)}if(a=n[s]||t.target,a!==e){ro(t,"currentTarget",{configurable:!0,get(){return a||i}});var f=Nt,_=xt;xo(null),so(null);try{for(var p,$=[];a!==null;){var w=a.assignedSlot||a.parentNode||a.host||null;try{var y=a["__"+o];if(y!=null&&(!a.disabled||t.target===a))if(Sr(y)){var[S,...I]=y;S.apply(a,[t,...I])}else y.call(a,t)}catch(A){p?$.push(A):p=A}if(t.cancelBubble||w===e||w===null)break;a=w}if(p){for(let A of $)queueMicrotask(()=>{throw A});throw p}}finally{t.__root=e,delete t.currentTarget,xo(f),so(_)}}}var q0;function wg(){q0=void 0}function Ua(t){var e=document.createElement("template");return e.innerHTML=t,e.content}function Co(t,e){var i=xt;i.nodes_start===null&&(i.nodes_start=t,i.nodes_end=e)}function L(t,e){var i=(e&1)!==0,o=(e&2)!==0,n,a=!t.startsWith("<!>");return()=>{if(je)return Co(ft,null),ft;n===void 0&&(n=Ua(a?t:"<!>"+t),i||(n=_i(n)));var s=o||Ll?document.importNode(n,!0):n.cloneNode(!0);if(i){var d=_i(s),l=s.lastChild;Co(d,l)}else Co(s,s);return s}}function $e(t,e,i="svg"){var o=!t.startsWith("<!>"),n=(e&1)!==0,a=`<${i}>${o?t:"<!>"+t}</${i}>`,s;return()=>{if(je)return Co(ft,null),ft;if(!s){var d=Ua(a),l=_i(d);if(n)for(s=document.createDocumentFragment();_i(l);)s.appendChild(_i(l));else s=_i(l)}var u=s.cloneNode(!0);if(n){var f=_i(u),_=u.lastChild;Co(f,_)}else Co(u,u);return u}}function sr(t=""){if(!je){var e=dn(t+"");return Co(e,e),e}var i=ft;return i.nodeType!==3&&(i.before(i=dn()),hi(i)),Co(i,i),i}function qe(){if(je)return Co(ft,null),ft;var t=document.createDocumentFragment(),e=document.createComment(""),i=dn();return t.append(e,i),Co(e,i),t}function b(t,e){if(je){xt.nodes_end=ft,Ri();return}t!==null&&t.before(e)}var ql=!0;function Ic(t){ql=t}function me(t,e){var o;var i=e==null?"":typeof e=="object"?e+"":e;i!==((o=t.__t)!=null?o:t.__t=t.nodeValue)&&(t.__t=i,t.nodeValue=i+"")}function ns(t,e){return Cg(t,e)}function _p(t,e){var s;mc(),e.intro=(s=e.intro)!=null?s:!1;let i=e.target,o=je,n=ft;try{for(var a=_i(i);a&&(a.nodeType!==8||a.data!==vs);)a=Bo(a);if(!a)throw jr;lo(!0),hi(a),Ri();let d=Cg(t,Lt(q({},e),{anchor:a}));if(ft===null||ft.nodeType!==8||ft.data!==Ds)throw qs(),jr;return lo(!1),d}catch(d){if(d===jr)return e.recover===!1&&Lv(),mc(),Vl(i),lo(!1),ns(t,e);throw d}finally{lo(o),hi(n),wg()}}var za=new Map;function Cg(t,{target:e,anchor:i,props:o={},events:n,context:a,intro:s=!0}){mc();var d=new Set,l=_=>{for(var p=0;p<_.length;p++){var $=_[p];if(!d.has($)){d.add($);var w=bg($);e.addEventListener($,Fa,{passive:w});var y=za.get($);y===void 0?(document.addEventListener($,Fa,{passive:w}),za.set($,1)):za.set($,y+1)}}};l(kl(vp)),Tc.add(l);var u=void 0,f=pg(()=>{var _=i!=null?i:e.appendChild(dn());return Fi(()=>{if(a){K({});var p=kt;p.c=a}n&&(o.$$events=n),je&&Co(_,null),ql=s,u=t(_,o)||{},ql=!0,je&&(xt.nodes_end=ft),a&&W()}),()=>{var w;for(var p of d){e.removeEventListener(p,Fa);var $=za.get(p);--$===0?(document.removeEventListener(p,Fa),za.delete(p)):za.set(p,$)}Tc.delete(l),_!==i&&((w=_.parentNode)==null||w.removeChild(_))}});return hp.set(u,f),u}var hp=new WeakMap;function Ys(t,e){let i=hp.get(t);return i?(hp.delete(t),i(e)):(Ie&&Yv(),Promise.resolve())}function B(t,e,[i,o]=[0,0]){je&&i===0&&Ri();var n=t,a=null,s=null,d=Ei,l=i>0?65536:0,u=!1;let f=(p,$=!0)=>{u=!0,_($,p)},_=(p,$)=>{if(d===(d=p))return;let w=!1;if(je&&o!==-1){if(i===0){let S=n.data;S===vs?o=0:S===Ns?o=1/0:(o=parseInt(S.substring(1)),o!==o&&(o=d?1/0:-1))}let y=o>i;!!d===y&&(n=La(),hi(n),lo(!1),w=!0,o=-1)}d?(a?os(a):$&&(a=Fi(()=>$(n))),s&&Tn(s,()=>{s=null})):(s?os(s):$&&(s=Fi(()=>$(n,[i+1,o]))),a&&Tn(a,()=>{a=null})),w&&lo(!0)};co(()=>{u=!1,e(f),u||_(null,null)},l),je&&(n=ft)}function Kl(t,e,i){je&&Ri();var o=t,n=Ei,a,s=zr()?Iv:Ia;co(()=>{s(n,n=e())&&(a&&Tn(a),a=Fi(()=>i(o)))}),je&&(o=ft)}var $s=null;function yp(t){$s=t}function Wl(t,e){return e}function G0(t,e,i,o){for(var n=[],a=e.length,s=0;s<a;s++)wc(e[s].e,n,!0);var d=a>0&&n.length===0&&i!==null;if(d){var l=i.parentNode;Vl(l),l.append(i),o.clear(),bs(t,e[0].prev,e[a-1].next)}lp(n,()=>{for(var u=0;u<a;u++){var f=e[u];d||(o.delete(f.k),bs(t,f.prev,f.next)),ao(f.e,!d)}})}function xi(t,e,i,o,n,a=null){var s=t,d={flags:e,items:new Map,first:null},l=(e&4)!==0;if(l){var u=t;s=je?hi(_i(u)):u.appendChild(dn())}je&&Ri();var f=null,_=!1,p=Ir(()=>{var $=i();return Sr($)?$:$==null?[]:kl($)});co(()=>{var $=r(p),w=$.length;if(_&&w===0)return;_=w===0;let y=!1;if(je){var S=s.data===Ns;S!==(w===0)&&(s=La(),hi(s),lo(!1),y=!0)}if(je){for(var I=null,P,A=0;A<w;A++){if(ft.nodeType===8&&ft.data===Ds){s=ft,y=!0,lo(!1);break}var E=$[A],T=o(E,A);P=kg(ft,d,I,null,E,T,A,n,e,i),d.items.set(T,P),I=P}w>0&&hi(La())}je||Y0($,d,s,n,e,o,i),a!==null&&(w===0?f?os(f):f=Fi(()=>a(s)):f!==null&&Tn(f,()=>{f=null})),y&&lo(!0),r(p)}),je&&(s=ft)}function Y0(t,e,i,o,n,a,s){var de,Ve,Be,J;var d=(n&8)!==0,l=(n&3)!==0,u=t.length,f=e.items,_=e.first,p=_,$,w=null,y,S=[],I=[],P,A,E,T;if(d)for(T=0;T<u;T+=1)P=t[T],A=a(P,T),E=f.get(A),E!==void 0&&((de=E.a)==null||de.measure(),(y!=null?y:y=new Set).add(E));for(T=0;T<u;T+=1){if(P=t[T],A=a(P,T),E=f.get(A),E===void 0){var R=p?p.e.nodes_start:i;w=kg(R,e,w,w===null?e.first:w.next,P,A,T,o,n,s),f.set(A,w),S=[],I=[],p=w.next;continue}if(l&&j0(E,P,T,n),(E.e.f&8192)!==0&&(os(E.e),d&&((Ve=E.a)==null||Ve.unfix(),(y!=null?y:y=new Set).delete(E))),E!==p){if($!==void 0&&$.has(E)){if(S.length<I.length){var z=I[0],j;w=z.prev;var U=S[0],X=S[S.length-1];for(j=0;j<S.length;j+=1)Tg(S[j],z,i);for(j=0;j<I.length;j+=1)$.delete(I[j]);bs(e,U.prev,X.next),bs(e,w,U),bs(e,X,z),p=z,w=X,T-=1,S=[],I=[]}else $.delete(E),Tg(E,p,i),bs(e,E.prev,E.next),bs(e,E,w===null?e.first:w.next),bs(e,w,E),w=E;continue}for(S=[],I=[];p!==null&&p.k!==A;)(p.e.f&8192)===0&&($!=null?$:$=new Set).add(p),I.push(p),p=p.next;if(p===null)continue;E=p}S.push(E),w=E,p=E.next}if(p!==null||$!==void 0){for(var ee=$===void 0?[]:kl($);p!==null;)(p.e.f&8192)===0&&ee.push(p),p=p.next;var ne=ee.length;if(ne>0){var ue=(n&4)!==0&&u===0?i:null;if(d){for(T=0;T<ne;T+=1)(Be=ee[T].a)==null||Be.measure();for(T=0;T<ne;T+=1)(J=ee[T].a)==null||J.fix()}G0(e,ee,ue,f)}}d&&rn(()=>{var Le;if(y!==void 0)for(E of y)(Le=E.a)==null||Le.apply()}),xt.first=e.first&&e.first.e,xt.last=w&&w.e}function j0(t,e,i,o){(o&1)!==0&&Pa(t.v,e),(o&2)!==0?Pa(t.i,i):t.i=i}function kg(t,e,i,o,n,a,s,d,l,u){var f=$s,_=(l&1)!==0,p=(l&16)===0,$=_?p?ts(n):Hi(n):n,w=(l&2)===0?s:Hi(s);Ie&&_&&($.debug=()=>{var S=typeof w=="number"?s:w.v;u()[S]});var y={i:w,v:$,k:a,a:null,e:null,prev:i,next:o};$s=y;try{return y.e=Fi(()=>d(t,$,w,u),je),y.e.prev=i&&i.e,y.e.next=o&&o.e,i===null?e.first=y:(i.next=y,i.e.next=y.e),o!==null&&(o.prev=y,o.e.prev=y.e),y}finally{$s=f}}function Tg(t,e,i){for(var o=t.next?t.next.e.nodes_start:i,n=e?e.e.nodes_start:i,a=t.e.nodes_start;a!==o;){var s=Bo(a);n.before(a),a=s}}function bs(t,e,i){e===null?t.first=i:(e.next=i,e.e.next=i&&i.e),i!==null&&(i.prev=e,i.e.prev=e&&e.e)}function Z0(t,e,i){var a,s;if(!e||e===vg(String(i!=null?i:"")))return;let o,n=(a=t.__svelte_meta)==null?void 0:a.loc;n?o=`near ${n.file}:${n.line}:${n.column}`:(s=un)!=null&&s[gi]&&(o=`in ${un[gi]}`),Gv(fp(o))}function Ql(t,e,i,o,n){var a=t,s="",d;co(()=>{var l;if(s===(s=(l=e())!=null?l:"")){je&&Ri();return}d!==void 0&&(ao(d),d=void 0),s!==""&&(d=Fi(()=>{if(je){for(var u=ft.data,f=Ri(),_=f;f!==null&&(f.nodeType!==8||f.data!=="");)_=f,f=Bo(f);if(f===null)throw qs(),jr;Ie&&!n&&Z0(f.parentNode,u,s),Co(ft,_),a=hi(f);return}var p=s+"";i?p=`<svg>${p}</svg>`:o&&(p=`<math>${p}</math>`);var $=Ua(p);if((i||o)&&($=_i($)),Co(_i($),$.lastChild),i||o)for(;_i($);)a.before(_i($));else a.before($)}))})}function ve(t,e,...i){var o=t,n=oe,a;co(()=>{n!==(n=e())&&(a&&(ao(a),a=null),Ie&&n==null&&Vv(),a=Fi(()=>n(o,...i)))},65536),je&&(o=ft)}function Bi(t,e,i){je&&Ri();var o=t,n,a;co(()=>{n!==(n=e())&&(a&&(Tn(a),a=null),n&&(a=Fi(()=>i(o,n))))},65536),je&&(o=ft)}function Gl(t,e,i,o,n,a){var w;let s=je;je&&Ri();var d=Ie&&a&&((w=kt)==null?void 0:w.function[gi]),l,u,f=null;je&&ft.nodeType===1&&(f=ft,Ri());var _=je?ft:t,p,$=$s;co(()=>{let y=e()||null;var S=n?n():i||y==="svg"?Ou:null;if(y!==l){var I=$s;yp($),p&&(y===null?Tn(p,()=>{p=null,u=null}):y===u?os(p):(ao(p),Ic(!1))),y&&y!==u&&(p=Fi(()=>{if(f=je?f:S?document.createElementNS(S,y):document.createElement(y),Ie&&a&&(f.__svelte_meta={loc:{file:d,line:a[0],column:a[1]}}),Co(f,f),o){je&&$g(y)&&f.append(document.createComment(""));var P=je?_i(f):f.appendChild(dn());je&&(P===null?lo(!1):hi(P)),o(f,P)}xt.nodes_end=f,_.before(f)})),l=y,l&&(u=l),Ic(!0),yp(I)}},65536),s&&(lo(!0),hi(_))}var wp;function Eg(t){return wp=t.target,new xp(t)}var rs,ar,xp=class{constructor(e){ms(this,rs);ms(this,ar);var a,s;var i=new Map,o=(d,l)=>{var u=ts(l);return i.set(d,u),u};let n=new Proxy(Lt(q({},e.props||{}),{$$events:{}}),{get(d,l){var u;return r((u=i.get(l))!=null?u:o(l,Reflect.get(d,l)))},has(d,l){var u;return l===Il?!0:(r((u=i.get(l))!=null?u:o(l,Reflect.get(d,l))),Reflect.has(d,l))},set(d,l,u){var f;return O((f=i.get(l))!=null?f:o(l,u),u),Reflect.set(d,l,u)}});Ta(this,ar,(e.hydrate?_p:ns)(e.component,{target:e.target,anchor:e.anchor,props:n,context:e.context,intro:(a=e.intro)!=null?a:!1,recover:e.recover})),(!((s=e==null?void 0:e.props)!=null&&s.$$host)||e.sync===!1)&&Ba(),Ta(this,rs,n.$$events);for(let d of Object.keys(ki(this,ar)))d==="$set"||d==="$destroy"||d==="$on"||ro(this,d,{get(){return ki(this,ar)[d]},set(l){ki(this,ar)[d]=l},enumerable:!0});ki(this,ar).$set=d=>{Object.assign(n,d)},ki(this,ar).$destroy=()=>{Ys(ki(this,ar))}}$set(e){ki(this,ar).$set(e)}$on(e,i){ki(this,rs)[e]=ki(this,rs)[e]||[];let o=(...n)=>i.call(this,...n);return ki(this,rs)[e].push(o),()=>{ki(this,rs)[e]=ki(this,rs)[e].filter(n=>n!==o)}}$destroy(){ki(this,ar).$destroy()}};rs=new WeakMap,ar=new WeakMap;function G(t,e){rn(()=>{var n,a,s;var i=t.getRootNode(),o=i.host?i:(s=(n=i.head)!=null?n:i.ownerDocument.head)!=null?s:(a=wp)==null?void 0:a.parentNode;if(!(o!=null&&o.querySelector("#"+e.hash))){let d=document.createElement("style");d.id=e.hash,d.textContent=e.code,o.appendChild(d),Ie&&xg(e.hash,d)}})}function Pg(t){var e,i,o="";if(typeof t=="string"||typeof t=="number")o+=t;else if(typeof t=="object")if(Array.isArray(t)){var n=t.length;for(e=0;e<n;e++)t[e]&&(i=Pg(t[e]))&&(o&&(o+=" "),o+=i)}else for(i in t)t[i]&&(o&&(o+=" "),o+=i);return o}function Ag(){for(var t,e,i=0,o="",n=arguments.length;i<n;i++)(t=arguments[i])&&(e=Pg(t))&&(o&&(o+=" "),o+=e);return o}function Yl(t){return typeof t=="object"?Ag(t):t!=null?t:""}var Mg=[...`
|
|
48
|
-
\r\f\xA0\v\uFEFF`];function Vg(t,e,i){var o=t==null?"":""+t;if(e&&(o=o?o+" "+e:e),i){for(var n in i)if(i[n])o=o?o+" "+n:n;else if(o.length)for(var a=n.length,s=0;(s=o.indexOf(n,s))>=0;){var d=s+a;(s===0||Mg.includes(o[s-1]))&&(d===o.length||Mg.includes(o[d]))?o=(s===0?"":o.substring(0,s))+o.substring(d+1):s=d}}return o===""?null:o}function Lg(t,e=!1){var i=e?" !important;":";",o="";for(var n in t){var a=t[n];a!=null&&a!==""&&(o+=" "+n+": "+a+i)}return o}function Sp(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function Rg(t,e){if(e){var i="",o,n;if(Array.isArray(e)?(o=e[0],n=e[1]):o=e,t){t=String(t).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var a=!1,s=0,d=!1,l=[];o&&l.push(...Object.keys(o).map(Sp)),n&&l.push(...Object.keys(n).map(Sp));var u=0,f=-1;let y=t.length;for(var _=0;_<y;_++){var p=t[_];if(d?p==="/"&&t[_-1]==="*"&&(d=!1):a?a===p&&(a=!1):p==="/"&&t[_+1]==="*"?d=!0:p==='"'||p==="'"?a=p:p==="("?s++:p===")"&&s--,!d&&a===!1&&s===0){if(p===":"&&f===-1)f=_;else if(p===";"||_===y-1){if(f!==-1){var $=Sp(t.substring(u,f).trim());if(!l.includes($)){p!==";"&&_++;var w=t.substring(u,_).trim();i+=" "+w+";"}}u=_+1,f=-1}}}}return o&&(i+=Lg(o)),n&&(i+=Lg(n,!0)),i=i.trim(),i===""?null:i}return t==null?null:String(t)}function ie(t,e,i,o,n,a){var s=t.__className;if(je||s!==i){var d=Vg(i,o,a);(!je||d!==t.getAttribute("class"))&&(d==null?t.removeAttribute("class"):e?t.className=d:t.setAttribute("class",d)),t.__className=i}else if(a&&n!==a)for(var l in a){var u=!!a[l];(n==null||u!==!!n[l])&&t.classList.toggle(l,u)}return a}function Cp(t,e={},i,o){for(var n in i){var a=i[n];e[n]!==a&&(i[n]==null?t.style.removeProperty(n):t.style.setProperty(n,a,o))}}function rt(t,e,i,o){var n=t.__style;if(je||n!==e){var a=Rg(e,o);(!je||a!==t.getAttribute("style"))&&(a==null?t.removeAttribute("style"):t.style.cssText=a),t.__style=e}else o&&(Array.isArray(o)?(Cp(t,i==null?void 0:i[0],o[0]),Cp(t,i==null?void 0:i[1],o[1],"important")):Cp(t,i,o));return o}var qa=Symbol("class"),Ka=Symbol("style"),Dg=Symbol("is custom element"),Og=Symbol("is html");function Hg(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function Oe(t,e,i,o){var n=Fg(t);if(je&&(n[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName==="LINK")){o||n_(t,e,i!=null?i:"");return}n[e]!==(n[e]=i)&&(e==="loading"&&(t[xv]=i),i==null?t.removeAttribute(e):typeof i!="string"&&Ug(t).includes(e)?t[e]=i:t.setAttribute(e,i))}function Ce(t,e,i,o,n=!1){var E;var a=Fg(t),s=a[Dg],d=!a[Og];let l=je&&s;l&&lo(!1);var u=e||{},f=t.tagName==="OPTION";for(var _ in e)_ in i||(i[_]=null);i.class?i.class=Yl(i.class):(o||i[qa])&&(i.class=null),i[Ka]&&((E=i.style)!=null||(i.style=null));var p=Ug(t);for(let T in i){let R=i[T];if(f&&T==="value"&&R==null){t.value=t.__value="",u[T]=R;continue}if(T==="class"){var $=t.namespaceURI==="http://www.w3.org/1999/xhtml";ie(t,$,R,o,e==null?void 0:e[qa],i[qa]),u[T]=R,u[qa]=i[qa];continue}if(T==="style"){rt(t,R,e==null?void 0:e[Ka],i[Ka]),u[T]=R,u[Ka]=i[Ka];continue}var w=u[T];if(R!==w){u[T]=R;var y=T[0]+T[1];if(y!=="$$")if(y==="on"){let z={},j="$$"+T,U=T.slice(2);var S=hg(U);if(gg(U)&&(U=U.slice(0,-7),z.capture=!0),!S&&w){if(R!=null)continue;t.removeEventListener(U,u[j],z),u[j]=null}if(R!=null)if(S)t[`__${U}`]=R,lt([U]);else{let X=function(ee){u[T].call(this,ee)};var A=X;u[j]=gp(U,t,X,z)}else S&&(t[`__${U}`]=void 0)}else if(T==="style")Oe(t,T,R);else if(T==="autofocus")mp(t,!!R);else if(!s&&(T==="__value"||T==="value"&&R!=null))t.value=t.__value=R;else if(T==="selected"&&f)Hg(t,R);else{var I=T;d||(I=_g(I));var P=I==="defaultValue"||I==="defaultChecked";if(R==null&&!s&&!P)if(a[T]=null,I==="value"||I==="checked"){let z=t,j=e===void 0;if(I==="value"){let U=z.defaultValue;z.removeAttribute(I),z.defaultValue=U,z.value=z.__value=j?U:null}else{let U=z.defaultChecked;z.removeAttribute(I),z.defaultChecked=U,z.checked=j?U:!1}}else t.removeAttribute(T);else P||p.includes(I)&&(s||typeof R!="string")?t[I]=R:typeof R!="function"&&Oe(t,I,R,n)}}}return l&&lo(!0),u}function Fg(t){var e;return(e=t.__attributes)!=null?e:t.__attributes={[Dg]:t.nodeName.includes("-"),[Og]:t.namespaceURI===bv}}var Bg=new Map;function Ug(t){var e=Bg.get(t.nodeName);if(e)return e;Bg.set(t.nodeName,e=[]);for(var i,o=t,n=Element.prototype;n!==o;){i=lc(o);for(var a in i)i[a].set&&e.push(a);o=Xr(o)}return e}function n_(t,e,i){var o;Ie&&(e==="srcset"&&r_(t,i)||Tp((o=t.getAttribute(e))!=null?o:"",i)||Qv(e,t.outerHTML.replace(t.innerHTML,t.innerHTML&&"..."),String(i)))}function Tp(t,e){return t===e?!0:new URL(t,document.baseURI).href===new URL(e,document.baseURI).href}function Ng(t){return t.split(",").map(e=>e.trim().split(" ").filter(Boolean))}function r_(t,e){var i=Ng(t.srcset),o=Ng(e);return o.length===i.length&&o.every(([n,a],s)=>a===i[s][1]&&(Tp(i[s][0],n)||Tp(n,i[s][0])))}var s_=ac?()=>performance.now():()=>Date.now(),Er={tick:t=>(ac?requestAnimationFrame:oe)(t),now:()=>s_(),tasks:new Set};function zg(){let t=Er.now();Er.tasks.forEach(e=>{e.c(t)||(Er.tasks.delete(e),e.f())}),Er.tasks.size!==0&&Er.tick(zg)}function qg(t){let e;return Er.tasks.size===0&&Er.tick(zg),{promise:new Promise(i=>{Er.tasks.add(e={c:t,f:i})}),abort(){Er.tasks.delete(e)}}}function kc(t,e){zl(()=>{t.dispatchEvent(new CustomEvent(e))})}function c_(t){if(t==="float")return"cssFloat";if(t==="offset")return"cssOffset";if(t.startsWith("--"))return t;let e=t.split("-");return e.length===1?e[0]:e[0]+e.slice(1).map(i=>i[0].toUpperCase()+i.slice(1)).join("")}function Kg(t){let e={},i=t.split(";");for(let o of i){let[n,a]=o.split(":");if(!n||a===void 0)break;let s=c_(n.trim());e[s]=a.trim()}return e}var u_=t=>t;function kp(t,e,i,o){var A;var n=(t&1)!==0,a=(t&2)!==0,s=n&&a,d=(t&4)!==0,l=s?"both":n?"in":"out",u,f=e.inert,_=e.style.overflow,p,$;function w(){var R;var E=Nt,T=xt;xo(null),so(null);try{return u!=null?u:u=i()(e,(R=o==null?void 0:o())!=null?R:{},{direction:l})}finally{xo(E),so(T)}}var y={is_global:d,in(){var E;if(e.inert=f,!n){$==null||$.abort(),(E=$==null?void 0:$.reset)==null||E.call($);return}a||p==null||p.abort(),kc(e,"introstart"),p=Ip(e,w(),$,1,()=>{kc(e,"introend"),p==null||p.abort(),p=u=void 0,e.style.overflow=_})},out(E){if(!a){E==null||E(),u=void 0;return}e.inert=!0,kc(e,"outrostart"),$=Ip(e,w(),p,0,()=>{kc(e,"outroend"),E==null||E()})},stop:()=>{p==null||p.abort(),$==null||$.abort()}},S=xt;if(((A=S.transitions)!=null?A:S.transitions=[]).push(y),n&&ql){var I=d;if(!I){for(var P=S.parent;P&&(P.f&65536)!==0;)for(;(P=P.parent)&&(P.f&16)===0;);I=!P||(P.f&32768)!==0}I&&Cn(()=>{$t(()=>y.in())})}}function Ip(t,e,i,o,n){var a=o===1;if(gs(e)){var s,d=!1;return rn(()=>{if(!d){var S=e({direction:a?"in":"out"});s=Ip(t,S,i,o,n)}}),{abort:()=>{d=!0,s==null||s.abort()},deactivate:()=>s.deactivate(),reset:()=>s.reset(),t:()=>s.t()}}if(i==null||i.deactivate(),!(e!=null&&e.duration))return n(),{abort:oe,deactivate:oe,reset:oe,t:()=>o};let{delay:l=0,css:u,tick:f,easing:_=u_}=e;var p=[];if(a&&i===void 0&&(f&&f(0,1),u)){var $=Kg(u(0,1));p.push($,$)}var w=()=>1-o,y=t.animate(p,{duration:l});return y.onfinish=()=>{var U;var S=(U=i==null?void 0:i.t())!=null?U:1-o;i==null||i.abort();var I=o-S,P=e.duration*Math.abs(I),A=[];if(P>0){var E=!1;if(u)for(var T=Math.ceil(P/16.666666666666668),R=0;R<=T;R+=1){var z=S+I*_(R/T),j=Kg(u(z,1-z));A.push(j),E||(E=j.overflow==="hidden")}E&&(t.style.overflow="hidden"),w=()=>{var X=y.currentTime;return S+I*_(X/P)},f&&qg(()=>{if(y.playState!=="running")return!1;var X=w();return f(X,1-X),!0})}y=t.animate(A,{duration:P,fill:"forwards"}),y.onfinish=()=>{w=()=>o,f==null||f(o,1-o),n()}},{abort:()=>{y&&(y.cancel(),y.effect=null,y.onfinish=oe)},deactivate:()=>{n=oe},reset:()=>{o===0&&(f==null||f(1,0))},t:()=>w()}}var ys,Wa,jl,Pc,Wg,Ac=class Ac{constructor(e){ms(this,Pc);ms(this,ys,new WeakMap);ms(this,Wa);ms(this,jl);Ta(this,jl,e)}observe(e,i){var o=ki(this,ys).get(e)||new Set;return o.add(i),ki(this,ys).set(e,o),hv(this,Pc,Wg).call(this).observe(e,ki(this,jl)),()=>{var n=ki(this,ys).get(e);n.delete(i),n.size===0&&(ki(this,ys).delete(e),ki(this,Wa).unobserve(e))}}};ys=new WeakMap,Wa=new WeakMap,jl=new WeakMap,Pc=new WeakSet,Wg=function(){var e;return(e=ki(this,Wa))!=null?e:Ta(this,Wa,new ResizeObserver(i=>{for(var o of i){Ac.entries.set(o.target,o);for(var n of ki(this,ys).get(o.target)||[])n(o)}}))},Kn(Ac,"entries",new WeakMap);var Ep=Ac;var m_=new Ep({box:"border-box"});function qr(t,e,i){var o=m_.observe(t,()=>i(t[e]));Cn(()=>($t(()=>i(t[e])),o))}function Qg(t,e){return t===e||(t==null?void 0:t[Wo])===e}function ct(t={},e,i,o){return Cn(()=>{var n,a;return So(()=>{n=a,a=(o==null?void 0:o())||[],$t(()=>{t!==i(...a)&&(e(t,...a),n&&Qg(i(...n),t)&&e(null,...n))})}),()=>{rn(()=>{a&&Qg(i(...a),t)&&e(null,...a)})}}),t}function Pr(t=!1){let e=kt,i=e.l.u;if(!i)return;let o=()=>$c(e.s);if(t){let n=0,a={},s=m(()=>{let d=!1,l=e.s;for(let u in l)l[u]!==a[u]&&(a[u]=l[u],d=!0);return d&&n++,n});o=()=>r(s)}i.b.length&&Na(()=>{Gg(e,o),hs(i.b)}),Xe(()=>{let n=$t(()=>i.m.map(Cv));return()=>{for(let a of n)typeof a=="function"&&a()}}),i.a.length&&Xe(()=>{Gg(e,o),hs(i.a)})}function Gg(t,e){if(t.l.s)for(let i of t.l.s)r(i);e()}if(Ie){let t=function(e){if(!(e in globalThis)){let i;Object.defineProperty(globalThis,e,{configurable:!0,get:()=>{if(i!==void 0)return i;Nv(e)},set:o=>{i=o}})}};g_=t,t("$state"),t("$effect"),t("$derived"),t("$inspect"),t("$props"),t("$bindable")}var g_;function Ut(t){kt===null&&Da("onMount"),Fr&&kt.l!==null?v_(kt).m.push(t):Xe(()=>{let e=$t(t);if(typeof e=="function")return e})}function In(t){kt===null&&Da("onDestroy"),Ut(()=>()=>$t(t))}function v_(t){var i;var e=t.l;return(i=e.u)!=null?i:e.u={a:[],b:[],m:[]}}function Zl(t,e,i){if(t==null)return e(void 0),i&&i(void 0),oe;let o=$t(()=>t.subscribe(e,i));return o.unsubscribe?()=>o.unsubscribe():o}var Qa=[];function lr(t,e){return{subscribe:le(t,e).subscribe}}function le(t,e=oe){let i=null,o=new Set;function n(d){if(Ia(t,d)&&(t=d,i)){let l=!Qa.length;for(let u of o)u[1](),Qa.push(u,t);if(l){for(let u=0;u<Qa.length;u+=2)Qa[u][0](Qa[u+1]);Qa.length=0}}}function a(d){n(d(t))}function s(d,l=oe){let u=[d,l];return o.add(u),o.size===1&&(i=e(n,a)||oe),d(t),()=>{o.delete(u),o.size===0&&i&&(i(),i=null)}}return{set:n,update:a,subscribe:s}}function bi(t,e,i){let o=!Array.isArray(t),n=o?[t]:t;if(!n.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");let a=e.length<2;return lr(i,(s,d)=>{let l=!1,u=[],f=0,_=oe,p=()=>{if(f)return;_();let w=e(o?u[0]:u,s,d);a?s(w):_=typeof w=="function"?w:oe},$=n.map((w,y)=>Zl(w,S=>{u[y]=S,f&=~(1<<y),l&&p()},()=>{f|=1<<y}));return l=!0,p(),function(){hs($),_(),l=!1}})}function Se(t){let e;return Zl(t,i=>e=i)(),e}var Mc=!1,Pp=Symbol();function C(t,e,i){var a;let o=(a=i[e])!=null?a:i[e]={store:null,source:ts(void 0),unsubscribe:oe};if(o.store!==t&&!(Pp in i))if(o.unsubscribe(),o.store=t!=null?t:null,t==null)o.source.v=void 0,o.unsubscribe=oe;else{var n=!0;o.unsubscribe=Zl(t,s=>{n?o.source.v=s:O(o.source,s)}),n=!1}return t&&Pp in i?Se(t):r(o.source)}function Ue(){let t={};function e(){pn(()=>{for(var i in t)t[i].unsubscribe();ro(t,Pp,{enumerable:!1,value:!0})})}return[t,e]}function Ap(t){var e=Mc;try{return Mc=!1,[t(),Mc]}finally{Mc=e}}var w_={get(t,e){if(!t.exclude.includes(e))return t.props[e]},set(t,e){return Ie&&Bv(`${t.name}.${String(e)}`),!1},getOwnPropertyDescriptor(t,e){if(!t.exclude.includes(e)&&e in t.props)return{enumerable:!0,configurable:!0,value:t.props[e]}},has(t,e){return t.exclude.includes(e)?!1:e in t.props},ownKeys(t){return Reflect.ownKeys(t.props).filter(e=>!t.exclude.includes(e))}};function Ee(t,e,i){return new Proxy(Ie?{props:t,exclude:e,name:i,other:{},to_proxy:[]}:{props:t,exclude:e},w_)}var S_={get(t,e){let i=t.props.length;for(;i--;){let o=t.props[i];if(gs(o)&&(o=o()),typeof o=="object"&&o!==null&&e in o)return o[e]}},set(t,e,i){let o=t.props.length;for(;o--;){let n=t.props[o];gs(n)&&(n=n());let a=Wn(n,e);if(a&&a.set)return a.set(i),!0}return!1},getOwnPropertyDescriptor(t,e){let i=t.props.length;for(;i--;){let o=t.props[i];if(gs(o)&&(o=o()),typeof o=="object"&&o!==null&&e in o){let n=Wn(o,e);return n&&!n.configurable&&(n.configurable=!0),n}}},has(t,e){if(e===Wo||e===Il)return!1;for(let i of t.props)if(gs(i)&&(i=i()),i!=null&&e in i)return!0;return!1},ownKeys(t){let e=[];for(let i of t.props){gs(i)&&(i=i());for(let o in i)e.includes(o)||e.push(o)}return e}};function ss(...t){return new Proxy({props:t},S_)}function Yg(t){var e,i;return(i=(e=t.ctx)==null?void 0:e.d)!=null?i:!1}function v(t,e,i,o){var z,j;var n=(i&1)!==0,a=!Fr||(i&2)!==0,s=(i&8)!==0,d=(i&16)!==0,l=!1,u;s?[u,l]=Ap(()=>t[e]):u=t[e];var f=Wo in t||Il in t,_=s&&((j=(z=Wn(t,e))==null?void 0:z.set)!=null?j:f&&e in t&&(U=>t[e]=U))||void 0,p=o,$=!0,w=!1,y=()=>(w=!0,$&&($=!1,d?p=$t(o):p=o),p);u===void 0&&o!==void 0&&(_&&a&&Rv(e),u=y(),_&&_(u));var S;if(a)S=()=>{var U=t[e];return U===void 0?y():($=!0,w=!1,U)};else{var I=(n?m:Ir)(()=>t[e]);I.f|=131072,S=()=>{var U=r(I);return U!==void 0&&(p=void 0),U===void 0?p:U}}if((i&4)===0)return S;if(_){var P=t.$$legacy;return function(U,X){return arguments.length>0?((!a||!X||P||l)&&_(X?S():U),U):S()}}var A=!1,E=!1,T=ts(u),R=m(()=>{var U=S(),X=r(T);return A?(A=!1,E=!0,X):(E=!1,T.v=U)});return s&&r(R),n||(R.equals=ka),function(U,X){if(Al!==null&&(A=E,S(),r(T)),arguments.length>0){let ee=X?r(R):a&&s?_e(U):U;if(!R.equals(ee)){if(A=!0,O(T,ee),w&&p!==void 0&&(p=ee),Yg(R))return U;$t(()=>r(R))}return U}return Yg(R)?R.v:r(R)}}var C_;typeof HTMLElement=="function"&&(C_=class extends HTMLElement{constructor(e,i,o){super();Kn(this,"$$ctor");Kn(this,"$$s");Kn(this,"$$c");Kn(this,"$$cn",!1);Kn(this,"$$d",{});Kn(this,"$$r",!1);Kn(this,"$$p_d",{});Kn(this,"$$l",{});Kn(this,"$$l_u",new Map);Kn(this,"$$me");this.$$ctor=e,this.$$s=i,o&&this.attachShadow({mode:"open"})}addEventListener(e,i,o){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(i),this.$$c){let n=this.$$c.$on(e,i);this.$$l_u.set(i,n)}super.addEventListener(e,i,o)}removeEventListener(e,i,o){if(super.removeEventListener(e,i,o),this.$$c){let n=this.$$l_u.get(i);n&&(n(),this.$$l_u.delete(i))}}connectedCallback(){return Tt(this,null,function*(){if(this.$$cn=!0,!this.$$c){let i=function(a){return s=>{let d=document.createElement("slot");a!=="default"&&(d.name=a),b(s,d)}};var e=i;if(yield Promise.resolve(),!this.$$cn||this.$$c)return;let o={},n=T_(this);for(let a of this.$$s)a in n&&(a==="default"&&!this.$$d.children?(this.$$d.children=i(a),o.default=!0):o[a]=i(a));for(let a of this.attributes){let s=this.$$g_p(a.name);s in this.$$d||(this.$$d[s]=Mp(s,a.value,this.$$p_d,"toProp"))}for(let a in this.$$p_d)!(a in this.$$d)&&this[a]!==void 0&&(this.$$d[a]=this[a],delete this[a]);this.$$c=Eg({component:this.$$ctor,target:this.shadowRoot||this,props:Lt(q({},this.$$d),{$$slots:o,$$host:this})}),this.$$me=xc(()=>{So(()=>{var a;this.$$r=!0;for(let s of Fu(this.$$c)){if(!((a=this.$$p_d[s])!=null&&a.reflect))continue;this.$$d[s]=this.$$c[s];let d=Mp(s,this.$$d[s],this.$$p_d,"toAttribute");d==null?this.removeAttribute(this.$$p_d[s].attribute||s):this.setAttribute(this.$$p_d[s].attribute||s,d)}this.$$r=!1})});for(let a in this.$$l)for(let s of this.$$l[a]){let d=this.$$c.$on(a,s);this.$$l_u.set(s,d)}this.$$l={}}})}attributeChangedCallback(e,i,o){var n;this.$$r||(e=this.$$g_p(e),this.$$d[e]=Mp(e,o,this.$$p_d,"toProp"),(n=this.$$c)==null||n.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(e){return Fu(this.$$p_d).find(i=>this.$$p_d[i].attribute===e||!this.$$p_d[i].attribute&&i.toLowerCase()===e)||e}});function Mp(t,e,i,o){var a;let n=(a=i[t])==null?void 0:a.type;if(e=n==="Boolean"&&typeof e!="boolean"?e!=null:e,!o||!i[t])return e;if(o==="toAttribute")switch(n){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e==null?null:e;default:return e}else switch(n){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}function T_(t){let e={};return t.childNodes.forEach(i=>{e[i.slot||"default"]=!0}),e}var jg="5";var Zg,Xg,Jg;typeof window!="undefined"&&((Jg=(Xg=(Zg=window.__svelte)!=null?Zg:window.__svelte={}).v)!=null?Jg:Xg.v=new Set).add(jg);var j1=require("@vkontakte/videoplayer-core/es2015"),gG=require("@vkontakte/videoplayer-core/es2015"),ya=require("@vkontakte/videoplayer-shared/es2015"),Z1=require("@vkontakte/videoplayer-statistics/es2015");var js=require("@vkontakte/videoplayer-shared/es2015");var k_={isMobile:void 0,debugLog:!1,devNullLog:!1,defaultLanguage:js.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:"vk_video",volumeDefault:1,volumeMinRestore:.05,loaderDelay:500,minSubtitlesFontSize:13,autoSubtitlesTimeout:2e3,allowChangingFullscreenTarget:!0,trafficSavingLimit:js.VideoQuality.Q_480P,highQualityLimit:js.VideoQuality.Q_720P,episodeMinWidthPc:8,hideThumbTimerAfterTouch:!0,preventPauseOnVideoClick:!1,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,slots:!0,annotationsInside:!1,pip:!0,dpip:!0,download:!0,liveRewind:!0,playbackRate:!0,trafficSaving:!0,episodesClustering:!0,copyVideoLink:!0,videoRotate:!0,interactiveGraph:!1,interactiveResponsiveUi:!1,seekToInteractive:!0,interactiveLastFrame:!1,interactiveTextPermanent:!0,interactiveHideTime:!0,interactivePlayPrevChapter:!0,interactiveTimeIndicator:!0,interactiveTimeOpenUri:!1,interactiveAreaControlShadow:!1,interactiveControlsExpectTimeBlinkAnimation:!1,thumbTimer:!0,hotKeyMapModal:!0,hotKeyHelpers:!0,saveDebugInfoToFile:!1,saveTraceInfoToFile:!1,additionalButtons:!0,additionalButtonsDesktopControlPanelRight:!0,additionalSettingsMenuItems:!0,additionalContextMenuItems:!0,contextMenuButton:!0,audioLanguages:!1,saveRate:!1,fullscreenInternalTargetPlayerContainer:!1,endScreen:!0,autoplayNext:!0,nextPrevButtons:!0,previewNoEmptySpace:!1,exposeInternalsToGlobal:!1,skipInitialPlaybackRateValue:!1,qualityDetailsSubMenuEnabled:!1,showSlowVideoNotification:!1,forceAutoQualityWhenSevereStallHappens:!1,timeoutShowSlowVideoNotification:0,maxCountShowSlowVideoNotification:1,forcePlayerDisplayBlock:!1},controls:{showOnStartupAtAutoplay:!0,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,runtimeTimeout:5e3,slot:void 0,preview:void 0,isMobileGoToSiteButton:!0,useAdmanFromNPM:!1,volumeMultiplier:1,isVsidOriginal:!1},interactive:{historyMaxLength:100,noInteractionEventTimeout:3e4},view:{timelineSliderColor:null,timelineSliderHandleColor:null,timelineSliderFilledColor:null,timelineSliderLoadedColor:null,volumeSliderColor:null,volumeSliderHandleColor:null,volumeSliderFilledColor:null,controlsTimeColor:null,timelineSliderFilledActiveLiveColor:null,timelineSliderHandleActiveLiveColor:null,buttonColor:null,buttonToggleOnColor:null,focusedColor:null}},eh=t=>(0,js.fillWithDefault)(t,k_),th=t=>Ha("ui-config",t),Gt=()=>Oa("ui-config");var Xl="vk_player_debug_panel_opened";var ih="videoplayer",oh="videoplayer";var Kr={KeyF:"f",KeyK:"k",KeyC:"c",KeyM:"m"},nh=new Set(["ArrowLeft","ArrowRight","KeyL","KeyJ"]),rh=new Set(["Tab","Space","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"]),sh=new Set(["ShiftRight","ShiftLeft"]);var ah=["TIMELINE"],Jl=[...ah,"GRAPH_BUTTON"],Lp=[...ah,"PLAY_BUTTON"],ed=[...Jl,"PLAY_BUTTON"];var Ar=(a=>(a.XS="xs",a.S="s",a.M="m",a.L="l",a.XL="xl",a))(Ar||{}),Xs={xs:0,s:1,m:2,l:3,xl:4};var td=require("@vkontakte/videoplayer-shared/es2015"),lh=require("@vkontakte/videoplayer-core/es2015"),dh=require("@vkontakte/videoplayer-statistics/es2015");var Lc="prod",Js="1.1.61-dev.4affc441.0";var ea=(t,e,i)=>{let o=document.createElement("a");o.href=t,o.download=`${e}.${i}`,o.style.display="none",o.click()};var ch=Symbol("storeContext"),uh=Symbol("microStoresContext"),ph=(t,e)=>{Ha(ch,t),Ha(uh,e),Lc==="dev"&&(window.app={store:t,microStores:e})},ke=()=>{let t=Oa(ch);return(0,td.assertNonNullable)(t,"Store context is empty!"),t},uo=()=>{let t=Oa(uh);return(0,td.assertNonNullable)(t,"MicroStores context is empty!"),t},Yt=(t,e)=>Rc(t,t.getValue(),e),Rc=(t,e,i)=>lr(e,o=>{let n=t.subscribe(a=>{o(a),i==null||i(a)});return()=>n.unsubscribe()}),fh=(t,e,i)=>{var I,P,A,E,T,R;let o=t.info,{width:n,height:a}=Se(i.ui.playerSize),s=(P=(I=o.throughputEstimation$.getValue())==null?void 0:I.toFixed(0))!=null?P:0,d=(E=(A=o.rttEstimation$.getValue())==null?void 0:A.toFixed(0))!=null?E:0,l=o.isAutoQualityEnabled$.getValue()?"auto":"manual",u=`${Js} (core: ${lh.VERSION}, stat: ${dh.VERSION}, shared: ${td.VERSION})`,f=Se(i.state.errorLog$),_=f.length?`
|
|
48
|
+
\r\f\xA0\v\uFEFF`];function Vg(t,e,i){var o=t==null?"":""+t;if(e&&(o=o?o+" "+e:e),i){for(var n in i)if(i[n])o=o?o+" "+n:n;else if(o.length)for(var a=n.length,s=0;(s=o.indexOf(n,s))>=0;){var d=s+a;(s===0||Mg.includes(o[s-1]))&&(d===o.length||Mg.includes(o[d]))?o=(s===0?"":o.substring(0,s))+o.substring(d+1):s=d}}return o===""?null:o}function Lg(t,e=!1){var i=e?" !important;":";",o="";for(var n in t){var a=t[n];a!=null&&a!==""&&(o+=" "+n+": "+a+i)}return o}function Sp(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function Rg(t,e){if(e){var i="",o,n;if(Array.isArray(e)?(o=e[0],n=e[1]):o=e,t){t=String(t).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var a=!1,s=0,d=!1,l=[];o&&l.push(...Object.keys(o).map(Sp)),n&&l.push(...Object.keys(n).map(Sp));var u=0,f=-1;let y=t.length;for(var _=0;_<y;_++){var p=t[_];if(d?p==="/"&&t[_-1]==="*"&&(d=!1):a?a===p&&(a=!1):p==="/"&&t[_+1]==="*"?d=!0:p==='"'||p==="'"?a=p:p==="("?s++:p===")"&&s--,!d&&a===!1&&s===0){if(p===":"&&f===-1)f=_;else if(p===";"||_===y-1){if(f!==-1){var $=Sp(t.substring(u,f).trim());if(!l.includes($)){p!==";"&&_++;var w=t.substring(u,_).trim();i+=" "+w+";"}}u=_+1,f=-1}}}}return o&&(i+=Lg(o)),n&&(i+=Lg(n,!0)),i=i.trim(),i===""?null:i}return t==null?null:String(t)}function ie(t,e,i,o,n,a){var s=t.__className;if(je||s!==i){var d=Vg(i,o,a);(!je||d!==t.getAttribute("class"))&&(d==null?t.removeAttribute("class"):e?t.className=d:t.setAttribute("class",d)),t.__className=i}else if(a&&n!==a)for(var l in a){var u=!!a[l];(n==null||u!==!!n[l])&&t.classList.toggle(l,u)}return a}function Cp(t,e={},i,o){for(var n in i){var a=i[n];e[n]!==a&&(i[n]==null?t.style.removeProperty(n):t.style.setProperty(n,a,o))}}function rt(t,e,i,o){var n=t.__style;if(je||n!==e){var a=Rg(e,o);(!je||a!==t.getAttribute("style"))&&(a==null?t.removeAttribute("style"):t.style.cssText=a),t.__style=e}else o&&(Array.isArray(o)?(Cp(t,i==null?void 0:i[0],o[0]),Cp(t,i==null?void 0:i[1],o[1],"important")):Cp(t,i,o));return o}var qa=Symbol("class"),Ka=Symbol("style"),Dg=Symbol("is custom element"),Og=Symbol("is html");function Hg(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function Oe(t,e,i,o){var n=Fg(t);if(je&&(n[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName==="LINK")){o||n_(t,e,i!=null?i:"");return}n[e]!==(n[e]=i)&&(e==="loading"&&(t[xv]=i),i==null?t.removeAttribute(e):typeof i!="string"&&Ug(t).includes(e)?t[e]=i:t.setAttribute(e,i))}function Ce(t,e,i,o,n=!1){var E;var a=Fg(t),s=a[Dg],d=!a[Og];let l=je&&s;l&&lo(!1);var u=e||{},f=t.tagName==="OPTION";for(var _ in e)_ in i||(i[_]=null);i.class?i.class=Yl(i.class):(o||i[qa])&&(i.class=null),i[Ka]&&((E=i.style)!=null||(i.style=null));var p=Ug(t);for(let T in i){let R=i[T];if(f&&T==="value"&&R==null){t.value=t.__value="",u[T]=R;continue}if(T==="class"){var $=t.namespaceURI==="http://www.w3.org/1999/xhtml";ie(t,$,R,o,e==null?void 0:e[qa],i[qa]),u[T]=R,u[qa]=i[qa];continue}if(T==="style"){rt(t,R,e==null?void 0:e[Ka],i[Ka]),u[T]=R,u[Ka]=i[Ka];continue}var w=u[T];if(R!==w){u[T]=R;var y=T[0]+T[1];if(y!=="$$")if(y==="on"){let z={},j="$$"+T,U=T.slice(2);var S=hg(U);if(gg(U)&&(U=U.slice(0,-7),z.capture=!0),!S&&w){if(R!=null)continue;t.removeEventListener(U,u[j],z),u[j]=null}if(R!=null)if(S)t[`__${U}`]=R,lt([U]);else{let X=function(ee){u[T].call(this,ee)};var A=X;u[j]=gp(U,t,X,z)}else S&&(t[`__${U}`]=void 0)}else if(T==="style")Oe(t,T,R);else if(T==="autofocus")mp(t,!!R);else if(!s&&(T==="__value"||T==="value"&&R!=null))t.value=t.__value=R;else if(T==="selected"&&f)Hg(t,R);else{var I=T;d||(I=_g(I));var P=I==="defaultValue"||I==="defaultChecked";if(R==null&&!s&&!P)if(a[T]=null,I==="value"||I==="checked"){let z=t,j=e===void 0;if(I==="value"){let U=z.defaultValue;z.removeAttribute(I),z.defaultValue=U,z.value=z.__value=j?U:null}else{let U=z.defaultChecked;z.removeAttribute(I),z.defaultChecked=U,z.checked=j?U:!1}}else t.removeAttribute(T);else P||p.includes(I)&&(s||typeof R!="string")?t[I]=R:typeof R!="function"&&Oe(t,I,R,n)}}}return l&&lo(!0),u}function Fg(t){var e;return(e=t.__attributes)!=null?e:t.__attributes={[Dg]:t.nodeName.includes("-"),[Og]:t.namespaceURI===bv}}var Bg=new Map;function Ug(t){var e=Bg.get(t.nodeName);if(e)return e;Bg.set(t.nodeName,e=[]);for(var i,o=t,n=Element.prototype;n!==o;){i=lc(o);for(var a in i)i[a].set&&e.push(a);o=Xr(o)}return e}function n_(t,e,i){var o;Ie&&(e==="srcset"&&r_(t,i)||Tp((o=t.getAttribute(e))!=null?o:"",i)||Qv(e,t.outerHTML.replace(t.innerHTML,t.innerHTML&&"..."),String(i)))}function Tp(t,e){return t===e?!0:new URL(t,document.baseURI).href===new URL(e,document.baseURI).href}function Ng(t){return t.split(",").map(e=>e.trim().split(" ").filter(Boolean))}function r_(t,e){var i=Ng(t.srcset),o=Ng(e);return o.length===i.length&&o.every(([n,a],s)=>a===i[s][1]&&(Tp(i[s][0],n)||Tp(n,i[s][0])))}var s_=ac?()=>performance.now():()=>Date.now(),Er={tick:t=>(ac?requestAnimationFrame:oe)(t),now:()=>s_(),tasks:new Set};function zg(){let t=Er.now();Er.tasks.forEach(e=>{e.c(t)||(Er.tasks.delete(e),e.f())}),Er.tasks.size!==0&&Er.tick(zg)}function qg(t){let e;return Er.tasks.size===0&&Er.tick(zg),{promise:new Promise(i=>{Er.tasks.add(e={c:t,f:i})}),abort(){Er.tasks.delete(e)}}}function kc(t,e){zl(()=>{t.dispatchEvent(new CustomEvent(e))})}function c_(t){if(t==="float")return"cssFloat";if(t==="offset")return"cssOffset";if(t.startsWith("--"))return t;let e=t.split("-");return e.length===1?e[0]:e[0]+e.slice(1).map(i=>i[0].toUpperCase()+i.slice(1)).join("")}function Kg(t){let e={},i=t.split(";");for(let o of i){let[n,a]=o.split(":");if(!n||a===void 0)break;let s=c_(n.trim());e[s]=a.trim()}return e}var u_=t=>t;function kp(t,e,i,o){var A;var n=(t&1)!==0,a=(t&2)!==0,s=n&&a,d=(t&4)!==0,l=s?"both":n?"in":"out",u,f=e.inert,_=e.style.overflow,p,$;function w(){var R;var E=Nt,T=xt;xo(null),so(null);try{return u!=null?u:u=i()(e,(R=o==null?void 0:o())!=null?R:{},{direction:l})}finally{xo(E),so(T)}}var y={is_global:d,in(){var E;if(e.inert=f,!n){$==null||$.abort(),(E=$==null?void 0:$.reset)==null||E.call($);return}a||p==null||p.abort(),kc(e,"introstart"),p=Ip(e,w(),$,1,()=>{kc(e,"introend"),p==null||p.abort(),p=u=void 0,e.style.overflow=_})},out(E){if(!a){E==null||E(),u=void 0;return}e.inert=!0,kc(e,"outrostart"),$=Ip(e,w(),p,0,()=>{kc(e,"outroend"),E==null||E()})},stop:()=>{p==null||p.abort(),$==null||$.abort()}},S=xt;if(((A=S.transitions)!=null?A:S.transitions=[]).push(y),n&&ql){var I=d;if(!I){for(var P=S.parent;P&&(P.f&65536)!==0;)for(;(P=P.parent)&&(P.f&16)===0;);I=!P||(P.f&32768)!==0}I&&Cn(()=>{$t(()=>y.in())})}}function Ip(t,e,i,o,n){var a=o===1;if(gs(e)){var s,d=!1;return rn(()=>{if(!d){var S=e({direction:a?"in":"out"});s=Ip(t,S,i,o,n)}}),{abort:()=>{d=!0,s==null||s.abort()},deactivate:()=>s.deactivate(),reset:()=>s.reset(),t:()=>s.t()}}if(i==null||i.deactivate(),!(e!=null&&e.duration))return n(),{abort:oe,deactivate:oe,reset:oe,t:()=>o};let{delay:l=0,css:u,tick:f,easing:_=u_}=e;var p=[];if(a&&i===void 0&&(f&&f(0,1),u)){var $=Kg(u(0,1));p.push($,$)}var w=()=>1-o,y=t.animate(p,{duration:l});return y.onfinish=()=>{var U;var S=(U=i==null?void 0:i.t())!=null?U:1-o;i==null||i.abort();var I=o-S,P=e.duration*Math.abs(I),A=[];if(P>0){var E=!1;if(u)for(var T=Math.ceil(P/16.666666666666668),R=0;R<=T;R+=1){var z=S+I*_(R/T),j=Kg(u(z,1-z));A.push(j),E||(E=j.overflow==="hidden")}E&&(t.style.overflow="hidden"),w=()=>{var X=y.currentTime;return S+I*_(X/P)},f&&qg(()=>{if(y.playState!=="running")return!1;var X=w();return f(X,1-X),!0})}y=t.animate(A,{duration:P,fill:"forwards"}),y.onfinish=()=>{w=()=>o,f==null||f(o,1-o),n()}},{abort:()=>{y&&(y.cancel(),y.effect=null,y.onfinish=oe)},deactivate:()=>{n=oe},reset:()=>{o===0&&(f==null||f(1,0))},t:()=>w()}}var ys,Wa,jl,Pc,Wg,Ac=class Ac{constructor(e){ms(this,Pc);ms(this,ys,new WeakMap);ms(this,Wa);ms(this,jl);Ta(this,jl,e)}observe(e,i){var o=ki(this,ys).get(e)||new Set;return o.add(i),ki(this,ys).set(e,o),hv(this,Pc,Wg).call(this).observe(e,ki(this,jl)),()=>{var n=ki(this,ys).get(e);n.delete(i),n.size===0&&(ki(this,ys).delete(e),ki(this,Wa).unobserve(e))}}};ys=new WeakMap,Wa=new WeakMap,jl=new WeakMap,Pc=new WeakSet,Wg=function(){var e;return(e=ki(this,Wa))!=null?e:Ta(this,Wa,new ResizeObserver(i=>{for(var o of i){Ac.entries.set(o.target,o);for(var n of ki(this,ys).get(o.target)||[])n(o)}}))},Kn(Ac,"entries",new WeakMap);var Ep=Ac;var m_=new Ep({box:"border-box"});function qr(t,e,i){var o=m_.observe(t,()=>i(t[e]));Cn(()=>($t(()=>i(t[e])),o))}function Qg(t,e){return t===e||(t==null?void 0:t[Wo])===e}function ct(t={},e,i,o){return Cn(()=>{var n,a;return So(()=>{n=a,a=(o==null?void 0:o())||[],$t(()=>{t!==i(...a)&&(e(t,...a),n&&Qg(i(...n),t)&&e(null,...n))})}),()=>{rn(()=>{a&&Qg(i(...a),t)&&e(null,...a)})}}),t}function Pr(t=!1){let e=kt,i=e.l.u;if(!i)return;let o=()=>$c(e.s);if(t){let n=0,a={},s=m(()=>{let d=!1,l=e.s;for(let u in l)l[u]!==a[u]&&(a[u]=l[u],d=!0);return d&&n++,n});o=()=>r(s)}i.b.length&&Na(()=>{Gg(e,o),hs(i.b)}),Xe(()=>{let n=$t(()=>i.m.map(Cv));return()=>{for(let a of n)typeof a=="function"&&a()}}),i.a.length&&Xe(()=>{Gg(e,o),hs(i.a)})}function Gg(t,e){if(t.l.s)for(let i of t.l.s)r(i);e()}if(Ie){let t=function(e){if(!(e in globalThis)){let i;Object.defineProperty(globalThis,e,{configurable:!0,get:()=>{if(i!==void 0)return i;Nv(e)},set:o=>{i=o}})}};g_=t,t("$state"),t("$effect"),t("$derived"),t("$inspect"),t("$props"),t("$bindable")}var g_;function Ut(t){kt===null&&Da("onMount"),Fr&&kt.l!==null?v_(kt).m.push(t):Xe(()=>{let e=$t(t);if(typeof e=="function")return e})}function In(t){kt===null&&Da("onDestroy"),Ut(()=>()=>$t(t))}function v_(t){var i;var e=t.l;return(i=e.u)!=null?i:e.u={a:[],b:[],m:[]}}function Zl(t,e,i){if(t==null)return e(void 0),i&&i(void 0),oe;let o=$t(()=>t.subscribe(e,i));return o.unsubscribe?()=>o.unsubscribe():o}var Qa=[];function lr(t,e){return{subscribe:le(t,e).subscribe}}function le(t,e=oe){let i=null,o=new Set;function n(d){if(Ia(t,d)&&(t=d,i)){let l=!Qa.length;for(let u of o)u[1](),Qa.push(u,t);if(l){for(let u=0;u<Qa.length;u+=2)Qa[u][0](Qa[u+1]);Qa.length=0}}}function a(d){n(d(t))}function s(d,l=oe){let u=[d,l];return o.add(u),o.size===1&&(i=e(n,a)||oe),d(t),()=>{o.delete(u),o.size===0&&i&&(i(),i=null)}}return{set:n,update:a,subscribe:s}}function bi(t,e,i){let o=!Array.isArray(t),n=o?[t]:t;if(!n.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");let a=e.length<2;return lr(i,(s,d)=>{let l=!1,u=[],f=0,_=oe,p=()=>{if(f)return;_();let w=e(o?u[0]:u,s,d);a?s(w):_=typeof w=="function"?w:oe},$=n.map((w,y)=>Zl(w,S=>{u[y]=S,f&=~(1<<y),l&&p()},()=>{f|=1<<y}));return l=!0,p(),function(){hs($),_(),l=!1}})}function Se(t){let e;return Zl(t,i=>e=i)(),e}var Mc=!1,Pp=Symbol();function C(t,e,i){var a;let o=(a=i[e])!=null?a:i[e]={store:null,source:ts(void 0),unsubscribe:oe};if(o.store!==t&&!(Pp in i))if(o.unsubscribe(),o.store=t!=null?t:null,t==null)o.source.v=void 0,o.unsubscribe=oe;else{var n=!0;o.unsubscribe=Zl(t,s=>{n?o.source.v=s:O(o.source,s)}),n=!1}return t&&Pp in i?Se(t):r(o.source)}function Ue(){let t={};function e(){pn(()=>{for(var i in t)t[i].unsubscribe();ro(t,Pp,{enumerable:!1,value:!0})})}return[t,e]}function Ap(t){var e=Mc;try{return Mc=!1,[t(),Mc]}finally{Mc=e}}var w_={get(t,e){if(!t.exclude.includes(e))return t.props[e]},set(t,e){return Ie&&Bv(`${t.name}.${String(e)}`),!1},getOwnPropertyDescriptor(t,e){if(!t.exclude.includes(e)&&e in t.props)return{enumerable:!0,configurable:!0,value:t.props[e]}},has(t,e){return t.exclude.includes(e)?!1:e in t.props},ownKeys(t){return Reflect.ownKeys(t.props).filter(e=>!t.exclude.includes(e))}};function Ee(t,e,i){return new Proxy(Ie?{props:t,exclude:e,name:i,other:{},to_proxy:[]}:{props:t,exclude:e},w_)}var S_={get(t,e){let i=t.props.length;for(;i--;){let o=t.props[i];if(gs(o)&&(o=o()),typeof o=="object"&&o!==null&&e in o)return o[e]}},set(t,e,i){let o=t.props.length;for(;o--;){let n=t.props[o];gs(n)&&(n=n());let a=Wn(n,e);if(a&&a.set)return a.set(i),!0}return!1},getOwnPropertyDescriptor(t,e){let i=t.props.length;for(;i--;){let o=t.props[i];if(gs(o)&&(o=o()),typeof o=="object"&&o!==null&&e in o){let n=Wn(o,e);return n&&!n.configurable&&(n.configurable=!0),n}}},has(t,e){if(e===Wo||e===Il)return!1;for(let i of t.props)if(gs(i)&&(i=i()),i!=null&&e in i)return!0;return!1},ownKeys(t){let e=[];for(let i of t.props){gs(i)&&(i=i());for(let o in i)e.includes(o)||e.push(o)}return e}};function ss(...t){return new Proxy({props:t},S_)}function Yg(t){var e,i;return(i=(e=t.ctx)==null?void 0:e.d)!=null?i:!1}function v(t,e,i,o){var z,j;var n=(i&1)!==0,a=!Fr||(i&2)!==0,s=(i&8)!==0,d=(i&16)!==0,l=!1,u;s?[u,l]=Ap(()=>t[e]):u=t[e];var f=Wo in t||Il in t,_=s&&((j=(z=Wn(t,e))==null?void 0:z.set)!=null?j:f&&e in t&&(U=>t[e]=U))||void 0,p=o,$=!0,w=!1,y=()=>(w=!0,$&&($=!1,d?p=$t(o):p=o),p);u===void 0&&o!==void 0&&(_&&a&&Rv(e),u=y(),_&&_(u));var S;if(a)S=()=>{var U=t[e];return U===void 0?y():($=!0,w=!1,U)};else{var I=(n?m:Ir)(()=>t[e]);I.f|=131072,S=()=>{var U=r(I);return U!==void 0&&(p=void 0),U===void 0?p:U}}if((i&4)===0)return S;if(_){var P=t.$$legacy;return function(U,X){return arguments.length>0?((!a||!X||P||l)&&_(X?S():U),U):S()}}var A=!1,E=!1,T=ts(u),R=m(()=>{var U=S(),X=r(T);return A?(A=!1,E=!0,X):(E=!1,T.v=U)});return s&&r(R),n||(R.equals=ka),function(U,X){if(Al!==null&&(A=E,S(),r(T)),arguments.length>0){let ee=X?r(R):a&&s?_e(U):U;if(!R.equals(ee)){if(A=!0,O(T,ee),w&&p!==void 0&&(p=ee),Yg(R))return U;$t(()=>r(R))}return U}return Yg(R)?R.v:r(R)}}var C_;typeof HTMLElement=="function"&&(C_=class extends HTMLElement{constructor(e,i,o){super();Kn(this,"$$ctor");Kn(this,"$$s");Kn(this,"$$c");Kn(this,"$$cn",!1);Kn(this,"$$d",{});Kn(this,"$$r",!1);Kn(this,"$$p_d",{});Kn(this,"$$l",{});Kn(this,"$$l_u",new Map);Kn(this,"$$me");this.$$ctor=e,this.$$s=i,o&&this.attachShadow({mode:"open"})}addEventListener(e,i,o){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(i),this.$$c){let n=this.$$c.$on(e,i);this.$$l_u.set(i,n)}super.addEventListener(e,i,o)}removeEventListener(e,i,o){if(super.removeEventListener(e,i,o),this.$$c){let n=this.$$l_u.get(i);n&&(n(),this.$$l_u.delete(i))}}connectedCallback(){return Tt(this,null,function*(){if(this.$$cn=!0,!this.$$c){let i=function(a){return s=>{let d=document.createElement("slot");a!=="default"&&(d.name=a),b(s,d)}};var e=i;if(yield Promise.resolve(),!this.$$cn||this.$$c)return;let o={},n=T_(this);for(let a of this.$$s)a in n&&(a==="default"&&!this.$$d.children?(this.$$d.children=i(a),o.default=!0):o[a]=i(a));for(let a of this.attributes){let s=this.$$g_p(a.name);s in this.$$d||(this.$$d[s]=Mp(s,a.value,this.$$p_d,"toProp"))}for(let a in this.$$p_d)!(a in this.$$d)&&this[a]!==void 0&&(this.$$d[a]=this[a],delete this[a]);this.$$c=Eg({component:this.$$ctor,target:this.shadowRoot||this,props:Lt(q({},this.$$d),{$$slots:o,$$host:this})}),this.$$me=xc(()=>{So(()=>{var a;this.$$r=!0;for(let s of Fu(this.$$c)){if(!((a=this.$$p_d[s])!=null&&a.reflect))continue;this.$$d[s]=this.$$c[s];let d=Mp(s,this.$$d[s],this.$$p_d,"toAttribute");d==null?this.removeAttribute(this.$$p_d[s].attribute||s):this.setAttribute(this.$$p_d[s].attribute||s,d)}this.$$r=!1})});for(let a in this.$$l)for(let s of this.$$l[a]){let d=this.$$c.$on(a,s);this.$$l_u.set(s,d)}this.$$l={}}})}attributeChangedCallback(e,i,o){var n;this.$$r||(e=this.$$g_p(e),this.$$d[e]=Mp(e,o,this.$$p_d,"toProp"),(n=this.$$c)==null||n.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(e){return Fu(this.$$p_d).find(i=>this.$$p_d[i].attribute===e||!this.$$p_d[i].attribute&&i.toLowerCase()===e)||e}});function Mp(t,e,i,o){var a;let n=(a=i[t])==null?void 0:a.type;if(e=n==="Boolean"&&typeof e!="boolean"?e!=null:e,!o||!i[t])return e;if(o==="toAttribute")switch(n){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e==null?null:e;default:return e}else switch(n){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}function T_(t){let e={};return t.childNodes.forEach(i=>{e[i.slot||"default"]=!0}),e}var jg="5";var Zg,Xg,Jg;typeof window!="undefined"&&((Jg=(Xg=(Zg=window.__svelte)!=null?Zg:window.__svelte={}).v)!=null?Jg:Xg.v=new Set).add(jg);var j1=require("@vkontakte/videoplayer-core/es2015"),gG=require("@vkontakte/videoplayer-core/es2015"),ya=require("@vkontakte/videoplayer-shared/es2015"),Z1=require("@vkontakte/videoplayer-statistics/es2015");var js=require("@vkontakte/videoplayer-shared/es2015");var k_={isMobile:void 0,debugLog:!1,devNullLog:!1,defaultLanguage:js.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:"vk_video",volumeDefault:1,volumeMinRestore:.05,loaderDelay:500,minSubtitlesFontSize:13,autoSubtitlesTimeout:2e3,allowChangingFullscreenTarget:!0,trafficSavingLimit:js.VideoQuality.Q_480P,highQualityLimit:js.VideoQuality.Q_720P,episodeMinWidthPc:8,hideThumbTimerAfterTouch:!0,preventPauseOnVideoClick:!1,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,slots:!0,annotationsInside:!1,pip:!0,dpip:!0,download:!0,liveRewind:!0,playbackRate:!0,trafficSaving:!0,episodesClustering:!0,copyVideoLink:!0,videoRotate:!0,interactiveGraph:!1,interactiveResponsiveUi:!1,seekToInteractive:!0,interactiveLastFrame:!1,interactiveTextPermanent:!0,interactiveHideTime:!0,interactivePlayPrevChapter:!0,interactiveTimeIndicator:!0,interactiveTimeOpenUri:!1,interactiveAreaControlShadow:!1,interactiveControlsExpectTimeBlinkAnimation:!1,thumbTimer:!0,hotKeyMapModal:!0,hotKeyHelpers:!0,saveDebugInfoToFile:!1,saveTraceInfoToFile:!1,additionalButtons:!0,additionalButtonsDesktopControlPanelRight:!0,additionalSettingsMenuItems:!0,additionalContextMenuItems:!0,contextMenuButton:!0,audioLanguages:!1,saveRate:!1,fullscreenInternalTargetPlayerContainer:!1,endScreen:!0,autoplayNext:!0,nextPrevButtons:!0,previewNoEmptySpace:!1,exposeInternalsToGlobal:!1,skipInitialPlaybackRateValue:!1,qualityDetailsSubMenuEnabled:!1,showSlowVideoNotification:!1,forceAutoQualityWhenSevereStallHappens:!1,timeoutShowSlowVideoNotification:0,maxCountShowSlowVideoNotification:1,forcePlayerDisplayBlock:!1},controls:{showOnStartupAtAutoplay:!0,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,runtimeTimeout:5e3,slot:void 0,preview:void 0,isMobileGoToSiteButton:!0,useAdmanFromNPM:!1,volumeMultiplier:1,isVsidOriginal:!1},interactive:{historyMaxLength:100,noInteractionEventTimeout:3e4},view:{timelineSliderColor:null,timelineSliderHandleColor:null,timelineSliderFilledColor:null,timelineSliderLoadedColor:null,volumeSliderColor:null,volumeSliderHandleColor:null,volumeSliderFilledColor:null,controlsTimeColor:null,timelineSliderFilledActiveLiveColor:null,timelineSliderHandleActiveLiveColor:null,buttonColor:null,buttonToggleOnColor:null,focusedColor:null}},eh=t=>(0,js.fillWithDefault)(t,k_),th=t=>Ha("ui-config",t),Gt=()=>Oa("ui-config");var Xl="vk_player_debug_panel_opened";var ih="videoplayer",oh="videoplayer";var Kr={KeyF:"f",KeyK:"k",KeyC:"c",KeyM:"m"},nh=new Set(["ArrowLeft","ArrowRight","KeyL","KeyJ"]),rh=new Set(["Tab","Space","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"]),sh=new Set(["ShiftRight","ShiftLeft"]);var ah=["TIMELINE"],Jl=[...ah,"GRAPH_BUTTON"],Lp=[...ah,"PLAY_BUTTON"],ed=[...Jl,"PLAY_BUTTON"];var Ar=(a=>(a.XS="xs",a.S="s",a.M="m",a.L="l",a.XL="xl",a))(Ar||{}),Xs={xs:0,s:1,m:2,l:3,xl:4};var td=require("@vkontakte/videoplayer-shared/es2015"),lh=require("@vkontakte/videoplayer-core/es2015"),dh=require("@vkontakte/videoplayer-statistics/es2015");var Lc="prod",Js="1.1.61-dev.e1cb6686.0";var ea=(t,e,i)=>{let o=document.createElement("a");o.href=t,o.download=`${e}.${i}`,o.style.display="none",o.click()};var ch=Symbol("storeContext"),uh=Symbol("microStoresContext"),ph=(t,e)=>{Ha(ch,t),Ha(uh,e),Lc==="dev"&&(window.app={store:t,microStores:e})},ke=()=>{let t=Oa(ch);return(0,td.assertNonNullable)(t,"Store context is empty!"),t},uo=()=>{let t=Oa(uh);return(0,td.assertNonNullable)(t,"MicroStores context is empty!"),t},Yt=(t,e)=>Rc(t,t.getValue(),e),Rc=(t,e,i)=>lr(e,o=>{let n=t.subscribe(a=>{o(a),i==null||i(a)});return()=>n.unsubscribe()}),fh=(t,e,i)=>{var I,P,A,E,T,R;let o=t.info,{width:n,height:a}=Se(i.ui.playerSize),s=(P=(I=o.throughputEstimation$.getValue())==null?void 0:I.toFixed(0))!=null?P:0,d=(E=(A=o.rttEstimation$.getValue())==null?void 0:A.toFixed(0))!=null?E:0,l=o.isAutoQualityEnabled$.getValue()?"auto":"manual",u=`${Js} (core: ${lh.VERSION}, stat: ${dh.VERSION}, shared: ${td.VERSION})`,f=Se(i.state.errorLog$),_=f.length?`
|
|
49
49
|
`+f.map((z,j)=>{var ne;let U=`${j}) Type: ${z.id}
|
|
50
50
|
`,X=`Message: ${z.message} (${z.thrown})
|
|
51
51
|
`,ee=`Trace: ${(ne=z.thrown)==null?void 0:ne.stack}
|
|
@@ -361,4 +361,4 @@ Try switching the\xA0quality to\xA0Auto.`},Rh=M_;var as=new Map;as.set(Ga.Interf
|
|
|
361
361
|
/* css reset end */.hidden {visibility:hidden;opacity:0;}.overlay-container {pointer-events:none;top:0;left:0;height:100%;width:100%;position:fixed;z-index:var(--overlay-container-z-index);}
|
|
362
362
|
|
|
363
363
|
/* \u041A\u043B\u0430\u0441\u0441 \u0434\u043B\u044F \u0441\u043E\u043A\u0440\u044B\u0442\u0438\u0435 \u043A\u043E\u043D\u0442\u0435\u043D\u0442\u0430 \u0432\u0438\u0437\u0443\u0430\u043B\u044C\u043D\u043E \u043D\u043E \u043D\u0435 \u0434\u043B\u044F \u043E\u0431\u0445\u043E\u0434\u0430 \u043F\u043E \u0442\u0430\u0431 \u0438 \u0441\u043A\u0440\u0438\u043D \u0440\u0438\u0434\u0435\u0440\u0430 */.out-of-view {position:absolute !important;left:-1000vh !important;}.icon.icon-error-stub {display:flex;justify-content:center;align-items:center;}`};function Jm(t,e){K(e,!0),G(t,Z3);let[i,o]=Ue(),n=()=>C(Kt,"$isLive$",i),a=v(e,"sources",7),s=v(e,"store",7),d=v(e,"microStoresRoot",7),l=v(e,"videoConfig",7),u=v(e,"uiConfig",7),f=v(e,"title",7),_=v(e,"thumbUrl",7),p=v(e,"interactiveContainer",7),$=v(e,"interactiveController",7),w=v(e,"subtitles",7),y=v(e,"live",7),S=v(e,"preload",7),I=v(e,"autoplay",7),P=v(e,"volume",7,void 0),A=v(e,"muted",7,void 0),E=v(e,"fromTime",7),T=v(e,"canRewindLive",7),R=v(e,"showAds",7),z=v(e,"adsSlotId",7,void 0),j=v(e,"adsParams",7,void 0),U=v(e,"adsPreviewParam",7,void 0),X=v(e,"adsAutoplayParam",7,void 0),ee=v(e,"duration",7,void 0),ne=v(e,"logoClickable",7),ue=v(e,"logoHidden",7),de=v(e,"isMobile",7),Ve=v(e,"showNextPrevButtons",7,!1),Be=v(e,"nextButtonActive",7,!1),J=v(e,"prevButtonActive",7,!1),Le=v(e,"endScreenVideoTitle",7,void 0),Z=v(e,"endScreenVideoThumb",7,void 0),N=v(e,"isOneVideoPlaylist",7,!1),Re=v(e,"supportLink",7),we=v(e,"shadowRootContainer",7,void 0),se=v(e,"outerContainerRef",7,void 0),Ne=v(e,"fullScreenTarget",7,void 0),pe=v(e,"failoverHosts",7,void 0),D=v(e,"showMiniTimer",7,!1),ce=v(e,"saveRate",7),Pe=v(e,"seekToInteractive",7,ya.noop),Ye=v(e,"playPrevChapter",7,ya.noop),dt=v(e,"volumeMultiplier",7),Ae=v(e,"showAutoplayNext",7),xe=v(e,"showEndScreen",7,!0),Me=v(e,"keyboardControls",15,void 0),{subscribers:st,stores:mt}=d();th(u());let ot=Gt(),Dt=u().logoLink,at=s().ui.debugPanelVisible,vt=s().ui.playerSize,Kt=s().state.isLive$,De=s().state.isInteractive&&j1.clientChecker.device.isAndroid,re=te(void 0),Q=null,ae=te(!1);s().getAdmanWrapper().init({switchFromAdsToVideo:s().actions.internal.switchFromAdsToVideo,switchFromVideoToAds:s().actions.internal.switchFromVideoToAds,setMuted:s().actions.external.setMuted},s().ads,{isMobile:s().ui.isMobile,mobileUnmuteButtonVisible:s().ui.mobileUnmuteButtonVisible,vsid:s().vsid}),ph(s(),mt),Xe(()=>{s().ui.isMobile.set(de())});let fe=(H=!1)=>{O(ae,!0),H?s().actions.external.firstStart(R()):s().actions.internal.firstStart(R())},Te=()=>{if(ot.features.qualityDetailsSubMenuEnabled){let H=Mh(s().videoId);if(H)switch(H.type){case"high_quality":s().actions.internal.setHighQualityEnabled(!0,H.appliesTo);break;case"traffic_saving":s().actions.internal.setTrafficSavingEnabled(!0,H.appliesTo);break;case"exact_quality":s().actions.internal.setQuality(H.quality);break}}else{Lh(s().videoId),zp()&&s().actions.internal.setTrafficSavingEnabled(!0);let Qe=Op(s().videoId);Qe&&s().actions.internal.setQuality(Qe)}};function He(H){var vi,po,fo;let Qe=a()||H;Qe&&s().initVideo({container:r(re),sources:Qe,failoverHosts:pe(),subtitles:w(),volumeMultiplier:dt()});let ai=ya.safeStorage.get(Xl)==="true";at.set(ai),E()>0&&s().actions.external.seekTime(E());let Wi=de()?ot.volumeDefault:(po=(vi=P())!=null?vi:Bc())!=null?po:ot.volumeDefault,ii=(fo=A())!=null?fo:Th();if(s().actions.external.setVolume(Wi),s().actions.external.setMuted(ii),s().getAdmanWrapper().setInitialVolume(ii?0:Wi),Te(),ot.features.saveRate&&ce()){let mo=Eh();mo&&!n()&&s().actions.internal.setPlaybackRate(mo)}if(Ae()){let mo=Ah();mo&&s().actions.internal.setAutoplayNextEnabled(mo)}s().ui.isAutoplay.set(I()),I()?fe():S()&&ot.features.preload&&s().actions.internal.preload()}let ut=H=>{if(window.ResizeObserver){let Qe,ai;Q=new ResizeObserver((0,ya.throttleFn)(Wi=>{let ii=Wi[0];if(ii.contentBoxSize){let vi=Array.isArray(ii.contentBoxSize)?ii.contentBoxSize[0]:ii.contentBoxSize;Qe=vi.inlineSize,ai=vi.blockSize}else ii.contentRect&&(Qe=ii.contentRect.width,ai=ii.contentRect.height);vt.set({width:Qe,height:ai})},300)),Q.observe(H)}vt.set({width:H.clientWidth,height:H.clientHeight})},Ot=()=>{document.hidden&&s().actions.external.stop()};Ut(()=>{var ai,Wi,ii,vi;De&&document.addEventListener("visibilitychange",Ot),ot.debugLog&&s().actions.internal.startLogging(),ut(r(re));let H=st.map(po=>po.init({store:s(),microStores:mt,config:l(),interactiveController:$(),uiConfig:u()})),Qe=()=>{De&&document.removeEventListener("visibilitychange",Ot),Q==null||Q.disconnect(),H.forEach(po=>po.unsubscribe()),s().destroy()};return((ai=y())==null?void 0:ai.status)==="upcoming"?(s().actions.internal.setLiveWaitingStart(!0),Qe):((Wi=y())==null?void 0:Wi.status)==="waiting"?(s().actions.internal.setLiveWaitingRecover(!0),Qe):(((ii=y())==null?void 0:ii.status)==="finished"||((vi=y())==null?void 0:vi.status)==="postlive")&&!Object.keys(a()||[]).length?(s().actions.internal.setLiveWaitingRecord(!0),Qe):(He(),Qe)});function We(){r(ae)?s().actions.external.play():fe(!0)}function _t(){s().actions.external.pause()}function et(H){s().actions.external.setMuted(H)}function wt(H){de()||H>=0&&H<=1&&s().actions.external.setVolume(H)}function jt(H){s().actions.internal.seekTime(H,Z1.SeekAction.UNKNOWN)}function Ze(H){s().actions.external.seekEpisodeStartTime(H)}function It(){s().actions.external.returnFocusToEpisodes()}function pi(H){s().actions.external.setPlaybackRate(H)}function si(H){s().actions.external.setAutoQualityLimits(H)}let Ai=bu(ot.view);var Ki=j3();rt(Ki,Ai);var Do=h(Ki);{var To=H=>{Xm(H,{get store(){return s()},uiConfig:ot,get thumbUrl(){return _()},get interactiveContainer(){return p()},get live(){return y()},get autoplay(){return I()},get canRewindLive(){return T()},get showAds(){return R()},get adsSlotId(){return z()},get adsParams(){return j()},get adsPreviewParam(){return U()},get adsAutoplayParam(){return X()},get duration(){return ee()},get logoClickable(){return ne()},get logoHidden(){return ue()},logoTargetUrl:Dt,get nextButtonActive(){return Be()},get prevButtonActive(){return J()},get endScreenVideoTitle(){return Le()},get endScreenVideoThumb(){return Z()},get isOneVideoPlaylist(){return N()},get supportLink(){return Re()},get shadowRootContainer(){return we()},get outerContainerRef(){return se()},get fullScreenTarget(){return Ne()},get showMiniTimer(){return D()},get playerStarted(){return r(ae)},get seekToInteractive(){return Pe()},get playPrevChapter(){return Ye()},firstStart:fe,seekTime:jt,get showEndScreen(){return xe()},get showAutoplayNext(){return Ae()},get showNextPrevButtons(){return Ve()},get videoContainer(){return r(re)},set videoContainer(Qe){O(re,_e(Qe))}})},Io=H=>{jm(H,{get store(){return s()},uiConfig:ot,get title(){return f()},get thumbUrl(){return _()},get interactiveContainer(){return p()},get live(){return y()},get autoplay(){return I()},get canRewindLive(){return T()},get showAds(){return R()},get adsSlotId(){return z()},get adsParams(){return j()},get adsPreviewParam(){return U()},get adsAutoplayParam(){return X()},get duration(){return ee()},get logoClickable(){return ne()},get logoHidden(){return ue()},logoTargetUrl:Dt,get nextButtonActive(){return Be()},get prevButtonActive(){return J()},get endScreenVideoTitle(){return Le()},get endScreenVideoThumb(){return Z()},get isOneVideoPlaylist(){return N()},get supportLink(){return Re()},get shadowRootContainer(){return we()},get outerContainerRef(){return se()},get fullScreenTarget(){return Ne()},get showMiniTimer(){return D()},get playerStarted(){return r(ae)},get seekToInteractive(){return Pe()},get playPrevChapter(){return Ye()},firstStart:fe,get showEndScreen(){return xe()},get showAutoplayNext(){return Ae()},get showNextPrevButtons(){return Ve()},get videoContainer(){return r(re)},set videoContainer(Qe){O(re,_e(Qe))},get keyboardControls(){return Me()},set keyboardControls(Qe){Me(Qe)}})};B(Do,H=>{de()?H(To):H(Io,!1)})}g(Ki),b(t,Ki);var Oo=W({initVideo:He,play:We,pause:_t,setMuted:et,setVolume:wt,seekTime:jt,seekEpisodeStartTime:Ze,returnFocusToEpisodes:It,setPlaybackRate:pi,setAutoQualityLimits:si,get sources(){return a()},set sources(H){a(H)},get store(){return s()},set store(H){s(H)},get microStoresRoot(){return d()},set microStoresRoot(H){d(H)},get videoConfig(){return l()},set videoConfig(H){l(H)},get uiConfig(){return u()},set uiConfig(H){u(H)},get title(){return f()},set title(H){f(H)},get thumbUrl(){return _()},set thumbUrl(H){_(H)},get interactiveContainer(){return p()},set interactiveContainer(H){p(H)},get interactiveController(){return $()},set interactiveController(H){$(H)},get subtitles(){return w()},set subtitles(H){w(H)},get live(){return y()},set live(H){y(H)},get preload(){return S()},set preload(H){S(H)},get autoplay(){return I()},set autoplay(H){I(H)},get volume(){return P()},set volume(H){P(H)},get muted(){return A()},set muted(H){A(H)},get fromTime(){return E()},set fromTime(H){E(H)},get canRewindLive(){return T()},set canRewindLive(H){T(H)},get showAds(){return R()},set showAds(H){R(H)},get adsSlotId(){return z()},set adsSlotId(H){z(H)},get adsParams(){return j()},set adsParams(H){j(H)},get adsPreviewParam(){return U()},set adsPreviewParam(H){U(H)},get adsAutoplayParam(){return X()},set adsAutoplayParam(H){X(H)},get duration(){return ee()},set duration(H){ee(H)},get logoClickable(){return ne()},set logoClickable(H){ne(H)},get logoHidden(){return ue()},set logoHidden(H){ue(H)},get isMobile(){return de()},set isMobile(H){de(H)},get showNextPrevButtons(){return Ve()},set showNextPrevButtons(H){Ve(H)},get nextButtonActive(){return Be()},set nextButtonActive(H){Be(H)},get prevButtonActive(){return J()},set prevButtonActive(H){J(H)},get endScreenVideoTitle(){return Le()},set endScreenVideoTitle(H){Le(H)},get endScreenVideoThumb(){return Z()},set endScreenVideoThumb(H){Z(H)},get isOneVideoPlaylist(){return N()},set isOneVideoPlaylist(H){N(H)},get supportLink(){return Re()},set supportLink(H){Re(H)},get shadowRootContainer(){return we()},set shadowRootContainer(H){we(H)},get outerContainerRef(){return se()},set outerContainerRef(H){se(H)},get fullScreenTarget(){return Ne()},set fullScreenTarget(H){Ne(H)},get failoverHosts(){return pe()},set failoverHosts(H){pe(H)},get showMiniTimer(){return D()},set showMiniTimer(H){D(H)},get saveRate(){return ce()},set saveRate(H){ce(H)},get showAutoplayNext(){return Ae()},set showAutoplayNext(H){Ae(H)},get seekToInteractive(){return Pe()},set seekToInteractive(H){Pe(H)},get playPrevChapter(){return Ye()},set playPrevChapter(H){Ye(H)},get volumeMultiplier(){return dt()},set volumeMultiplier(H){dt(H)},get showEndScreen(){return xe()},set showEndScreen(H){xe(H)},get keyboardControls(){return Me()},set keyboardControls(H){Me(H)}});return o(),Oo}var X3=$e('<svg><!><path fill="currentColor" 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 6zm.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.9.9 0 0 1 .377.378c.088.163.134.324.134.77v1.436c0 .446-.046.607-.134.77a.9.9 0 0 1-.378.378c-.162.088-.324.134-.77.134h-1.436c-.446 0-.608-.046-.77-.134a.9.9 0 0 1-.378-.378c-.088-.163-.134-.324-.134-.77v-1.436c0-.446.046-.607.134-.77a.9.9 0 0 1 .378-.378c.162-.088.324-.134.77-.134h1.436zm20 0c.445 0 .606.046.77.134a.9.9 0 0 1 .377.378c.088.163.134.324.134.77v1.436c0 .446-.046.607-.134.77a.9.9 0 0 1-.378.378c-.163.088-.324.134-.77.134h-1.436c-.446 0-.607-.046-.77-.134a.9.9 0 0 1-.378-.378c-.088-.163-.134-.324-.134-.77v-1.436c0-.446.046-.607.134-.77a.9.9 0 0 1 .378-.378c.163-.088.324-.134.77-.134zm-20-8c.445 0 .607.046.77.134a.9.9 0 0 1 .377.378c.088.162.134.324.134.77v1.436c0 .446-.046.607-.134.77a.9.9 0 0 1-.378.378c-.162.088-.324.134-.77.134h-1.436c-.446 0-.608-.046-.77-.134a.9.9 0 0 1-.378-.378c-.088-.163-.134-.324-.134-.77v-1.436c0-.446.046-.608.134-.77a.9.9 0 0 1 .378-.378c.162-.088.324-.134.77-.134h1.436zm20 0c.445 0 .606.046.77.134a.9.9 0 0 1 .377.378c.088.162.134.324.134.77v1.436c0 .446-.046.607-.134.77a.9.9 0 0 1-.378.378c-.163.088-.324.134-.77.134h-1.436c-.446 0-.607-.046-.77-.134a.9.9 0 0 1-.378-.378c-.088-.163-.134-.324-.134-.77v-1.436c0-.446.046-.608.134-.77a.9.9 0 0 1 .378-.378c.163-.088.324-.134.77-.134zm-20-8c.445 0 .607.046.77.134a.9.9 0 0 1 .377.378c.088.162.134.324.134.77v1.436c0 .446-.046.608-.134.77a.9.9 0 0 1-.378.378c-.162.088-.324.134-.77.134h-1.436c-.446 0-.608-.046-.77-.134a.9.9 0 0 1-.378-.378c-.088-.162-.134-.324-.134-.77v-1.436c0-.446.046-.608.134-.77a.9.9 0 0 1 .378-.378c.162-.088.324-.134.77-.134h1.436zm20 0c.445 0 .606.046.77.134a.9.9 0 0 1 .377.378c.088.162.134.324.134.77v1.436c0 .446-.046.608-.134.77a.9.9 0 0 1-.378.378c-.163.088-.324.134-.77.134h-1.436c-.446 0-.607-.046-.77-.134a.9.9 0 0 1-.378-.378c-.088-.162-.134-.324-.134-.77v-1.436c0-.446.046-.608.134-.77a.9.9 0 0 1 .378-.378c.163-.088.324-.134.77-.134zm-20-8c.445 0 .607.046.77.134a.9.9 0 0 1 .377.378c.088.162.134.324.134.77v1.436c0 .446-.046.608-.134.77a.9.9 0 0 1-.378.378c-.162.088-.324.134-.77.134h-1.436c-.446 0-.608-.046-.77-.134a.9.9 0 0 1-.378-.378c-.088-.162-.134-.324-.134-.77v-1.436c0-.446.046-.607.134-.77a.9.9 0 0 1 .378-.378c.162-.088.324-.134.77-.134h1.436zm20 0c.445 0 .606.046.77.134a.9.9 0 0 1 .377.378c.088.162.134.324.134.77v1.436c0 .446-.046.608-.134.77a.9.9 0 0 1-.378.378c-.163.088-.324.134-.77.134h-1.436c-.446 0-.607-.046-.77-.134a.9.9 0 0 1-.378-.378c-.088-.162-.134-.324-.134-.77v-1.436c0-.446.046-.607.134-.77a.9.9 0 0 1 .378-.378c.163-.088.324-.134.77-.134z"></path></svg>');function ev(t,e){let i=Ee(e,["$$slots","$$events","$$legacy","children"]);var o=X3();let n;var a=h(o);ve(a,()=>{var s;return(s=e.children)!=null?s:oe}),be(),g(o),k(()=>n=Ce(o,n,q({xmlns:"http://www.w3.org/2000/svg",width:"57",height:"60",fill:"none","aria-hidden":"true","data-testid":"stub-icon",role:"img"},i))),b(t,o)}function tv(t,e){let i=v(e,"isWhite",3,!1),o=m(()=>i()?"color: #fff;":"color: #909499;");ev(t,{get style(){return r(o)}})}var J3=L('<div class="title svelte-1y9fytq"> </div>'),ex=L('<div class="playerStub svelte-1y9fytq"><!> <!></div>'),tx={hash:"svelte-1y9fytq",code:".playerStub.svelte-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.svelte-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 iv(t,e){G(t,tx);var i=ex(),o=h(i);{var n=d=>{var l=J3(),u=h(l,!0);g(l),k(()=>me(u,e.title)),b(d,l)};B(o,d=>{e.title&&d(n)})}var a=M(o,2);{var s=d=>{let l=m(()=>!!e.thumbUrl);tv(d,{get isWhite(){return r(l)}})};B(a,d=>{(!e.title||!e.thumbUrl)&&d(s)})}g(i),k(()=>rt(i,e.thumbUrl?`background-image: url('${e.thumbUrl}')`:"")),b(t,i)}var s0=require("@vkontakte/videoplayer-shared/es2015"),qi=require("@vkontakte/videoplayer-shared/es2015"),oc=require("@vkontakte/videoplayer-core/es2015"),Pu=require("@vkontakte/videoplayer-statistics/es2015");var yu=require("@vkontakte/videoplayer-shared/es2015"),$u=class{constructor(){this.subscription=new yu.Subscription,this.logger=new yu.Logger,this.log=this.logger.createComponentLog("MediaSessionApi")}isSupported(){return"mediaSession"in navigator}setMetaData({title:e,artist:i="",thumbUrl:o=""}){this.isSupported()&&(navigator.mediaSession.metadata=new MediaMetadata({title:e,artist:i,artwork:[{src:o,sizes:"96x96",type:"image/png"},{src:o,sizes:"128x128",type:"image/png"},{src:o,sizes:"192x192",type:"image/png"},{src:o,sizes:"256x256",type:"image/png"},{src:o,sizes:"384x384",type:"image/png"},{src:o,sizes:"512x512",type:"image/png"}]}))}updateActionHandlers(e){this.resetActionHandlers(),this.setActionHandlers(e)}resetActionHandlers(){let e=[["play",null],["pause",null],["stop",null],["nexttrack",null],["previoustrack",null],["seekto",null],["seekbackward",null],["seekforward",null]];this.setActionHandlers(e)}setActionHandlers(e){var i,o;if(this.isSupported())for(let[n,a]of e)try{(o=(i=navigator.mediaSession).setActionHandler)==null||o.call(i,n,a)}catch(s){throw new Error(`The media session action "${n}" is not supported yet.`)}}attachToStore(e){!this.isSupported()||!e||(this.clearSubscriptions(),this.subscription.add(e.state.positionExact$.subscribe(i=>{var a,s;let o=Se(e.state.currentPlaybackRate$),n=Se(e.state.duration$);if(!(!isFinite(i)||!isFinite(n)))try{(s=(a=navigator.mediaSession).setPositionState)==null||s.call(a,{position:i,playbackRate:o,duration:n})}catch(d){this.log({message:`MediaSession setPositionState can't call with position: ${i} and duration: ${n}`})}})))}clearSubscriptions(){this.subscription.unsubscribe()}destroy(){this.resetActionHandlers(),this.clearSubscriptions()}};var fl=require("@vkontakte/videoplayer-shared/es2015");var ix=$e('<svg><!><g fill="var(--btn-color, #fff)"><path d="m30.744 4 .744.005c2.981.046 4.526.385 6.127 1.24a8.77 8.77 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.77 5.77 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.77 8.77 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.77 8.77 0 0 1 3.347-3.475l.312-.174.292-.15c1.472-.731 3.016-1.036 5.803-1.08L22.256 4z"></path><path 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.2z"></path></g></svg>');function ov(t,e){let i=Ee(e,["$$slots","$$events","$$legacy","children"]);var o=ix();let n;var a=h(o);ve(a,()=>{var s;return(s=e.children)!=null?s:oe}),be(),g(o),k(()=>n=Ce(o,n,q({xmlns:"http://www.w3.org/2000/svg",width:"57",height:"56",fill:"none","aria-label":"dummy-image","data-testid":"pip-dummy-icon",role:"img"},i))),b(t,o)}var ox=L('<div><div><!></div> <span class="title svelte-1pbsod4"> </span></div>'),nx={hash:"svelte-1pbsod4",code:".player-pip-dummy.svelte-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.svelte-1pbsod4 {position:relative;}.dummy-image.svelte-1pbsod4 svg {transform:scale(1.07143);}.dummy-image.desktop.svelte-1pbsod4 {transform:scale(1.07143) rotate(-90deg) rotateY(180deg);}.title.svelte-1pbsod4 {font-size:16px;color:#fff;padding:18px 20px 10px;text-align:center;}"};function nv(t,e){K(e,!0),G(t,nx);let[i,o]=Ue(),n=()=>C(u,"$interfaceLanguage$",i),a=()=>C(f,"$isMobile$",i),s=ke(),d=Gt(),l=!!s.webApi.pictureInPictureApi,u=s.interfaceLanguage$,f=s.ui.isMobile,_=s.ui.t,p=m(()=>n()&&_("pip_dummy_title")),$=bu(d.view);var w=ox();ie(w,1,"player-pip-dummy svelte-1pbsod4",null,{},{"is-pip-api":l}),rt(w,$);var y=h(w);let S;var I=h(y);ov(I,{}),g(y);var P=M(y,2),A=h(P,!0);g(P),g(w),k(E=>{S=ie(y,1,"dummy-image svelte-1pbsod4",null,S,E),me(A,r(p))},[()=>({desktop:!a()})]),b(t,w),W(),o()}var rx=Object.defineProperty,sx=(t,e,i)=>e in t?rx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,pl=(t,e,i)=>sx(t,typeof e!="symbol"?e+"":e,i),rv=(t,e,i)=>new Promise((o,n)=>{var a=l=>{try{d(i.next(l))}catch(u){n(u)}},s=l=>{try{d(i.throw(l))}catch(u){n(u)}},d=l=>l.done?o(l.value):Promise.resolve(l.value).then(a,s);d((i=i.apply(t,e)).next())}),ax=460,lx=280,Gd=class{constructor({enabled:e=!0}={enabled:!0}){pl(this,"playerDomElement"),pl(this,"playerParentShadowRoot"),pl(this,"playerDummyElement"),pl(this,"svelteContext"),pl(this,"pipWindow"),pl(this,"info",{isActive$:new fl.ValueSubject(!1),isEnabled$:new fl.ValueSubject(!1),type:1}),this.info.isEnabled$=new fl.ValueSubject(e)}isSupported(){let{isEmbed:e}=(0,fl.detectEmbed)();return"documentPictureInPicture"in window&&!e}isActive(){return this.isSupported()&&!!documentPictureInPicture.window}setPlayerDomElement(e,i){this.playerDomElement=e,this.playerParentShadowRoot=i}setContext(e){this.svelteContext=e}request(){return rv(this,null,function*(){var e,i;if(!this.isSupported()||!this.playerDomElement||!this.playerParentShadowRoot)return;this.pipWindow=yield documentPictureInPicture.requestWindow({width:ax,height:lx,copyStyleSheets:!0}),this.pipWindow.document.body.style.margin="0";let o=[...this.playerParentShadowRoot.styleSheets].map(l=>[...l.cssRules].map(u=>u.cssText).join(" ")).filter(Boolean).join(`
|
|
364
|
-
`),n=document.createElement("style");n.textContent=o;let a=this.createStretchedContainer(),s=a.attachShadow({mode:"open"});s.append(n),s.append(this.playerDomElement);let d={target:this.playerParentShadowRoot,context:this.svelteContext};this.playerDummyElement=ns(nv,d),(e=this.pipWindow)==null||e.document.body.append(a),this.info.isActive$.next(!0),(i=this.pipWindow)==null||i.addEventListener("unload",l=>{!this.playerDomElement||!this.playerParentShadowRoot||!this.playerDummyElement||(Ys(this.playerDummyElement),this.playerParentShadowRoot.append(this.playerDomElement),this.info.isActive$.next(!1))})})}remove(){return rv(this,null,function*(){return new Promise(e=>{var i;(i=documentPictureInPicture.window)==null||i.close(),e()})})}dispose(){return rv(this,null,function*(){yield this.remove()})}setEnabled(e){this.info.isEnabled$.next(e)}createStretchedContainer(){let e=document.createElement("div");return e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.width="100%",e.style.height="100%",e}};function X1(t){return t instanceof Gd}var xu=class{static getLatestSupportedVersion(e){let i=new oa,o=new Gd(e);if(o.isSupported())return o;if(i.isSupported())return i}};function Yd(t,e){var n,a;let i=new Set([...Object.keys(t),...Object.keys(e)]),o={};for(let s of i)o[s]=(a=(n=e[s])!=null?n:t[s])!=null?a:void 0;return o}var J1="Inner error. Unexpectedly root annotation container null reference exception",e0="Annotation with such name already exists",t0="Annotation with such name does not exist";var ml=class extends Error{constructor(e){super(e),this.name="AnnotationError"}};var vl=require("@vkontakte/videoplayer-shared/es2015"),dx="1",cx=100,wu=class{constructor(e){this.annotationsInside=e;this.annotations=new Map;this.subscriptions=new vl.Subscription}init(e){if(this.rootAnnotationsContainer=e,this.annotationsInside)return;let i=(0,vl.throttleFn)(()=>{for(let o of this.annotations.values())this.isElementExceedsBoundaries(o,this.playerSize.width,this.playerSize.height)?o.style.visibility="hidden":o.style.visibility="visible"},cx);this.subscriptions.add((0,vl.observeElementSize)(this.rootAnnotationsContainer).subscribe(({width:o,height:n})=>{this.playerSize={width:o,height:n},i()})),this.mutationObserver=new MutationObserver(i),this.mutationObserver.observe(this.rootAnnotationsContainer,{attributes:!0,childList:!0,subtree:!0,characterData:!0})}add(e,i){var o;if(!this.rootAnnotationsContainer)throw new ml(J1);if(this.annotations.has(e))throw new ml(e0);i.style.zIndex=(o=i.style.zIndex)!=null?o:dx,i.style.position="absolute",this.rootAnnotationsContainer.append(i),this.annotations.set(e,i)}get(e){let i=this.annotations.get(e);if(!i)throw new ml(t0);return i}remove(e){let i=this.get(e);this.annotations.delete(e)&&i.remove()}clear(){for(let e in this.annotations.keys())this.remove(e)}destroy(){var e;this.annotations.clear(),this.subscriptions.unsubscribe(),(e=this.mutationObserver)==null||e.disconnect(),this.rootAnnotationsContainer=null}isElementExceedsBoundaries(e,i,o){let n=e.offsetTop,a=e.offsetLeft,s=e.offsetWidth,d=e.offsetHeight;return n<0||a<0||a+s>i||n+d>o}registryRootContainer(e){}addLayer(e){return document.createElement("div")}getLayer(e){}removeLayer(e){}clearLayer(e){}detach(){}reattach(){}};var xa=require("@vkontakte/videoplayer-shared/es2015"),Qo=class{init({store:e,microStores:i,interactiveController:o,config:n}){return(0,xa.assertNonNullable)(e),(0,xa.assertNonNullable)(i),(0,xa.assertNonNullable)(n),n.interactiveData&&(0,xa.assertNonNullable)(o),this.subscription=new xa.Subscription,this.subscription}};var jd=class extends Qo{constructor(){super(...arguments);this.stateName="fakeIsPlaying$";this.state$=Lt(q({},le(null)),{toggle:()=>this.state$.update(i=>!i)})}init(i){let o=super.init(i),{isInteractiveExpectation$:n}=i.store.state;return o.add(n.subscribe(a=>{this.state$.set(a?!0:null)})),o}};var Zd=class extends Qo{constructor(){super(...arguments);this.stateName="interactiveControlsOpacity$";this.state$=Lt(q({},le(null)),{toggle:()=>this.state$.update(i=>!i)})}init(i){let o=super.init(i),{microStores:n,store:a}=i,{fakeIsPlaying$:s}=n,{isInteractiveExpectation$:d,isPlaying$:l}=a.state,{controlsVisible:u,isMobile:f}=a.ui,_=Se(f),p=()=>_&&Se(u);return o.add(u.subscribe($=>{if(!_)return;let w=Se(s);Se(l)?this.state$.set($):w!==null&&this.state$.set(!w||$)})),o.add(l.subscribe($=>{this.state$.set(!$||p())})),o.add(s.subscribe($=>{if($===null)return;let w=Se(d);if(p()){this.state$.set(!0);return}w&&this.state$.set(!$)})),o}};var Xd=class extends Qo{constructor(){super(...arguments);this.stateName="seekToInteractiveDisabledTooltip$";this.state$=le("tooltip_chapter_without_interactive")}init(i){let o=super.init(i),{store:n}=i;return o.add(n.state.interactiveEpisodes$.subscribe(a=>{a.length&&(a.every(s=>s.completed)?this.state$.set("tooltip_interactive_of_chapter_completed"):this.state$.set("tooltip_disabled_when_interactive"))})),o}};var i0=require("@vkontakte/videoplayer-shared/es2015");var sv=le(!1),Su=null,Jd=class extends Qo{constructor(){super(...arguments);this.stateName="showInteractiveTimeIndicatorTooltip$";this.state$=Lt(q({},sv),{set:(i,o=!1)=>{i!==Se(sv)&&(this.clearTimeout(),sv.set(i),!i&&Su&&(Su=!1),i&&o&&(this.timeout=setTimeout(()=>{this.state$.set(!1)},3e3)))},clearTimeout:()=>this.clearTimeout()})}init(i){let o=super.init(i),{store:n,config:a}=i,{isInteractiveTime$:s,isPlaying$:d}=n.state,l=n.ui.controlsVisible,{interactiveTimeIndicator:u}=n.ui.controls;o.add(l.subscribe(_=>{Se(s)&&_&&this.state$.set(!1)}));let f=(a==null?void 0:a.interactiveData)||{tooltipHelpHintActive:!1};return o.add((0,i0.combine)({isPlaying$:d,isInteractiveTime$:s,interactiveTimeIndicator:u}).subscribe(({isPlaying$:_,isInteractiveTime$:p,interactiveTimeIndicator:$})=>{var w,y;if(!(!_||!($!=null&&$.isDisplayed))){if(!p)return this.state$.set(!1);f.tooltipHelpHintActive&&Su===null&&(Su=!0,f.tooltipHelpHintActive=!1,this.state$.set(!0),(y=(w=n.callbacks)==null?void 0:w.onInteractiveTimeIndicatorHintDeactivated)==null||y.call(w))}})),o}clearTimeout(){window.clearTimeout(this.timeout)}};var Cu=require("@vkontakte/videoplayer-shared/es2015");var ec=class extends Qo{constructor(){super(...arguments);this.stateName="graphIsOpened$";this.graphMadePause=!1;this.state$=Lt(q({},le(null)),{toggle:Cu.noop});this.checkIfShouldHide=i=>Ps(i,"s")}init(i){let o=super.init(i),{store:n,interactiveController:a}=i,s=n.ui.currentGridType$,d=n.getLogger().createComponentLog("GraphIsOpened microStore");return this.state$.toggle=()=>Tt(this,null,function*(){if(this.checkIfShouldHide(Se(s)))return;let l=Se(this.state$),{isEnded$:u,playbackState$:f}=n.state,{disabledControls$:_}=n.ui.controls,p=Se(u),$=Se(f);if(l)try{yield a==null?void 0:a.toggleGraphView(!1),this.state$.set(!1),_.remove(Lp),!p&&this.graphMadePause&&n.actions.internal.play()}catch(w){d({message:"Cant hide graph"})}else{this.graphMadePause=$==="playing";try{yield a==null?void 0:a.toggleGraphView(!0),this.state$.set(!0),_.add(Lp),!p&&this.graphMadePause&&n.actions.internal.pause()}catch(w){d({message:"Cant show graph"})}}}),o.add((0,Cu.combine)({graphIsOpened:this.state$,currentGridType:s}).subscribe(f=>Tt(this,[f],function*({graphIsOpened:l,currentGridType:u}){if(this.checkIfShouldHide(u)&&l)try{yield a==null?void 0:a.toggleGraphView(!1),this.state$.set(!1)}catch(p){d({message:"Cant hide graph"})}}))),o}};var av=require("@vkontakte/videoplayer-shared/es2015"),tc=class extends Qo{constructor(){super(...arguments);this.stateName="pictureInPicture$";this.state$={isActive$:le(!1),isEnabled$:le(!1),type$:le(void 0)}}init(i){let o=super.init(i),{store:n}=i,{info:{isActive$:a,isEnabled$:s,type:d}}=n.webApi.pictureInPictureApi||{info:{isActive$:new av.ValueSubject(!1),isEnabled$:new av.ValueSubject(!1)}};return o.add(a.subscribe(l=>{this.state$.isActive$.set(l)})),o.add(s.subscribe(l=>{this.state$.isEnabled$.set(l)})),this.state$.type$.set(d),o}};var Iu=require("@vkontakte/videoplayer-shared/es2015");var Tu=require("@vkontakte/videoplayer-shared/es2015");var o0=({maxShowCount:t,timeout:e})=>{let i=[t!==0?ux({maxCount:t}):void 0,e!==0?px({timeout:e}):void 0].filter(o=>!!o);return{notificationShowed:o=>i.forEach(n=>n.notificationShowed(o)),canShowNotification:o=>i.every(n=>n.canShowNotification(o))}},ux=({maxCount:t})=>{let e={};return{notificationShowed:i=>{var o,n;e[i]=((o=e[i])!=null?o:0)+1,Tu.safeStorage.set("videoplayer_notifications_manager_count",JSON.stringify((n=e[i])!=null?n:0))},canShowNotification:i=>{var o;return((o=e[i])!=null?o:0)<t}}},px=({timeout:t})=>{let e="videoplayer_notifications_manager",i=()=>{try{return JSON.parse(Tu.safeStorage.get(e)||"{}")}catch(a){return{}}},o=a=>Tu.safeStorage.set(e,JSON.stringify(a)),n=a=>{let s=i();delete s[a],o(s)};return{notificationShowed:a=>{o(Lt(q({},i()),{[a]:{timeout:t,launchTime:Date.now()}}))},canShowNotification:a=>{let s=i()[a];if(s){let d=Date.now()-s.launchTime>t;return d&&n(a),d}else return!0}}};var ic=class extends Qo{constructor(){super(...arguments);this.stateName="notifications$";this.state$={notificationsToShow$:le({}),showNotification:i=>{this.state$.notificationsToShow$.update(o=>(o[i]=!0,o)),this.notificationManager.notificationShowed(i)},closeNotification:i=>{this.state$.notificationsToShow$.update(o=>(delete o[i],o))}}}init(i){let o=super.init(i),{store:n,uiConfig:{features:{maxCountShowSlowVideoNotification:a,timeoutShowSlowVideoNotification:s,showSlowVideoNotification:d,forceAutoQualityWhenSevereStallHappens:l}}}=i;this.notificationManager=o0({maxShowCount:a,timeout:s});let u=n.getPlayer();return o.add(u.events.severeStallOccured$.pipe((0,Iu.filterChanged)(),(0,Iu.filter)(f=>f)).subscribe(()=>{d&&!u.info.isAutoQualityEnabled$.getValue()&&this.notificationManager.canShowNotification("slow_video")&&(l&&n.actions.internal.setQuality("auto"),this.state$.showNotification("slow_video"))})),o}};var n0=()=>[jd,Zd,Xd,Jd,ec,tc,ic].reduce(({subscribers:t,stores:e},i)=>{let o=new i;return{subscribers:[...t,o],stores:Lt(q({},e),{[o.stateName]:o.state$})}},{subscribers:[],stores:{}});var gl=require("@vkontakte/videoplayer-shared/es2015");var fx=Object.defineProperty,mx=Object.defineProperties,vx=Object.getOwnPropertyDescriptors,r0=Object.getOwnPropertySymbols,gx=Object.prototype.hasOwnProperty,hx=Object.prototype.propertyIsEnumerable,lv=(t,e,i)=>e in t?fx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Ls=(t,e)=>{for(var i in e||(e={}))gx.call(e,i)&&lv(t,i,e[i]);if(r0)for(var i of r0(e))hx.call(e,i)&&lv(t,i,e[i]);return t},_x=(t,e)=>mx(t,vx(e)),ei=(t,e,i)=>lv(t,typeof e!="symbol"?e+"":e,i),ku=(t,e,i)=>new Promise((o,n)=>{var a=l=>{try{d(i.next(l))}catch(u){n(u)}},s=l=>{try{d(i.throw(l))}catch(u){n(u)}},d=l=>l.done?o(l.value):Promise.resolve(l.value).then(a,s);d((i=i.apply(t,e)).next())}),bx={preload:!0,autoplay:!1,repeat:!1,fromTime:0,canRewindLive:!0,showAds:!1,interfaceLanguage:qi.InterfaceLanguage.RU,isCyrillicRelatedInterface:!0,logoClickable:!1,logoHidden:!1,isTouch:(0,oc.isMobile)(),isMediaSessionEnabled:!0,isPictureInPictureEnabled:!0,isAudioDisabled:!1,callbacks:{uiInfo:{}},tuningConfig:{configName:[]},saveRate:!0,volumeMultiplier:1,showEndScreen:!0,showAutoplayNext:!0,showNextPrevButtons:!0},kn=te(void 0),Eu=class extends HTMLElement{constructor(){super(),ei(this,"svelteStubComponent"),ei(this,"svelteRootComponent"),ei(this,"store"),ei(this,"microStoresRoot"),ei(this,"statistics"),ei(this,"sentry"),ei(this,"_shadowRoot"),ei(this,"playerContainer"),ei(this,"rootContainer"),ei(this,"shadowRootContainer"),ei(this,"uiConfig"),ei(this,"coreConfig"),ei(this,"statisticsConfig"),ei(this,"interactiveController"),ei(this,"interactiveContainer"),ei(this,"graphMadePause"),ei(this,"currentPlayingVideoIndex",0),ei(this,"needToRepeatPlaylist",!1),ei(this,"videoConfig"),ei(this,"pictureInPictureApi"),ei(this,"mediaSessionApi"),ei(this,"unsubscribePlayerPhaseSubscription"),ei(this,"logger"),ei(this,"log"),ei(this,"subscription"),ei(this,"interactiveSubscription"),ei(this,"annotationsApi"),ei(this,"slotsApi"),ei(this,"prevIsid"),ei(this,"isInited",!1),ei(this,"internalsExposure",null),ei(this,"createOneStat",(e,i={})=>{var o,n,a,s;let{albumId:d,statPlace:l,statUserSalt:u,statTrackCode:f,statVKAppId:_,refreshStatAuthToken:p,autoplay:$,isMobile:w,isTouch:y,refDomain:S,deviceId:I,interactiveData:P}=Yd(this.videoConfig,i),A=(o=P==null?void 0:P.projectInfo)==null?void 0:o.pid,E=(a=(n=this.interactiveController)==null?void 0:n.state.isReplay$.getValue())!=null?a:!1;E&&(this.prevIsid=void 0);let{unitedVideoId:T,isClip:R=!1}=e;if(this.uiConfig.features.statistics&&T)return new Pu.OneStat(Ls({movieId:T,albumId:d,place:l,trackCode:f,vkAppId:_,autoplay:(s=$&&!this.interactiveController)!=null?s:!1,mobile:y!=null?y:w,clip:R,refDomain:S,deviceId:I},A&&(!this.isInited||E)&&{projectId:Number(A)}),Ls({refreshAuthToken:p,userSalt:u,config:this.statisticsConfig},this.interactiveController&&{useIsid:!0,isid:this.prevIsid}))}),gl.devNull.create("ui"),this.logger=new qi.Logger,this.log=this.logger.createComponentLog("VKVideoPlayer"),this.subscription=new qi.Subscription,this.interactiveSubscription=new qi.Subscription,this.graphMadePause=!1}connectedCallback(){var e,i;if(this.isInited)return;this.initPlayerRootContainers();let o=(e=this.getAttribute("stub-title"))!=null?e:void 0,n=(i=this.getAttribute("stub-thumb-url"))!=null?i:void 0,a=_e({title:o,thumbUrl:n}),s={target:this.playerContainer,props:a};this.svelteStubComponent=ns(iv,s)}disconnectedCallback(){var e,i,o,n,a;(e=this.annotationsApi)==null||e.destroy(),(i=this.mediaSessionApi)==null||i.destroy(),this.unmountComponent(this.svelteRootComponent),this.unmountComponent(this.svelteStubComponent),this.subscription.unsubscribe(),(o=this.unsubscribePlayerPhaseSubscription)==null||o.call(this),(n=this.interactiveController)==null||n.destroy(),this.interactiveSubscription.unsubscribe(),(a=this.internalsExposure)==null||a.destroy(),gl.devNull.destroy("ui")}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%",this.rootContainer.style.minHeight="206px",this.shadowRootContainer=document.createElement("div"),this.shadowRootContainer.style.position="absolute",this.shadowRootContainer.className="shadow-root-container",this.shadowRootContainer.style.width="100%",this.shadowRootContainer.style.height="100%",this._shadowRoot=this.shadowRootContainer.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(this.shadowRootContainer),this.append(this.rootContainer)}needToShowNextPrevButtons(){return this.videoConfig?this.videoConfig.videos.length>1&&this.videoConfig.showNextPrevButtons:!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;let o=(i=this.store)==null?void 0:i.ui.controls.disabledControls$;return(o==null?void 0:o.includes(e))||!1}getNextVideoInfo(){if(!this.videoConfig)return{nextVideoTitle:void 0,nextVideoThumb:void 0};let e=this.videoConfig.videos[this.currentPlayingVideoIndex+1]||{};return{nextVideoTitle:e.title,nextVideoThumb:e.thumbUrl}}createThinOneStat(e,i={}){let{deviceId:o,preload:n,refreshStatAuthToken:a}=Yd(this.videoConfig,i),{unitedVideoId:s}=e;return new Pu.ThinOneStat.ThinOneStat({deviceId:o,movieId:s,preload:n},{config:this.statisticsConfig,refreshAuthToken:a})}createPlayer(e,i={},o){var n,a,s,d,l,u,f,_,p;if(!this.videoConfig)return;let{albumId:$,statPlace:w,statAuthToken:y,preload:S,autoplay:I,volume:P,muted:A,fromTime:E,canRewindLive:T,supportLink:R,showAds:z,adsSlotId:j,adsParams:U={},adsPreviewParam:X,adsAutoplayParam:ee,interfaceLanguage:ne,isCyrillicRelatedInterface:ue,logoClickable:de,logoHidden:Ve,isMobile:Be,isTouch:J,isAudioDisabled:Le,isLiveCatchUpMode:Z,fullScreenTarget:N,failoverHosts:Re,canDownload:we,callbacks:se,interactiveData:Ne,showThumbTimer:pe,additionalButtons:D=[],additionalSettingsMenuItems:ce=[],additionalContextMenuItems:Pe=[],repeat:Ye,saveRate:dt,volumeMultiplier:Ae,showEndScreen:xe,showAutoplayNext:Me}=Yd(this.videoConfig,i),{sources:st,title:mt,thumbUrl:ot,unitedVideoId:Dt,isClip:at=!1,duration:vt,adsParams:Kt={},videoEpisodes:Qt,previewThumbsData:De,subtitles:re,live:Q}=e,ae=Ls(Ls({},U),Kt),fe=this.getNextVideoInfo(),Te={sources:st,title:mt,thumbUrl:ot,subtitles:re,unitedVideoId:Dt,isClip:at,live:Q,albumId:$,statPlace:w,autoplay:I,muted:A,volume:P,fromTime:E,canRewindLive:T,showAds:z,adsSlotId:j,adsParams:ae,adsPreviewParam:X,adsAutoplayParam:ee,duration:vt,logoClickable:de,logoHidden:Ve,isTouch:J!=null?J:Be,repeat:Ye,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:fe.nextVideoTitle,endScreenVideoThumb:fe.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist()},He={pictureInPictureApi:this.pictureInPictureApi,annotationsApi:this.annotationsApi};this.log({message:`create player, props: ${JSON.stringify(Te)}`});let ut=(n=this.interactiveController)==null?void 0:n.state.statistics$.getValue(),Ot,We=this.createThinOneStat(e,i);(Ot||We)&&(this.statistics=new su(Ot,We,ut==null?void 0:ut.statSubscription)),this.uiConfig.features.sentry&&this.uiConfig.sentry.dsn&&new ia(this.uiConfig.sentry,{version:Js,env:Lc},{movieId:Dt,albumId:$,place:w,autoplay:(a=I&&!this.interactiveController)!=null?a:!1,mobile:J!=null?J:Be,clip:at}),this.interactiveController&&((l=this.prevIsid)!=null||(this.prevIsid=(d=(s=this.statistics)==null?void 0:s.oneStat)==null?void 0:d.isid$.getValue())),this.sentry=Ls(Ls({},this.sentry),ia.getInstance());let et=!!Ne,wt=[],jt="tooltip_interactive_go_back_disabled_first";if(et&&this.interactiveController){let si=this.interactiveController.state.isInitialChapter$.getValue(),Ai=this.interactiveController.getHistoryState();si&&wt.push("REPLAY_BUTTON"),this.interactiveController.getIsSeekable().getValue()||wt.push("SEEK_TO_INTERACTIVE_BUTTON"),Ai.hasPrevChapter$.getValue()||(wt.push("PLAY_PREV_CHAPTER_BUTTON"),si||(Ai.isGoBackLimited$.getValue()?jt="tooltip_interactive_go_back_disabled_limit":jt="tooltip_interactive_go_back_disabled"))}let Ze=()=>{var si;this.isInited=!1,this.prevIsid=void 0;let Ai=(o==null?void 0:o.info.isEnded$.getValue())&&((si=this.interactiveController)==null?void 0:si.state.isEndChapter$.getValue());se.onReplayInteractiveVideo&&!Ai?se.onReplayInteractiveVideo():this.replayInteractiveVideo()};this.store=$1({player:o,interfaceLanguage:ne,isCyrillicRelatedInterface:ue,videoId:Dt,isClip:at,isLiveCatchUpMode:Z,isAudioDisabled:Le,statAuthToken:y,callbacks:se,webApi:He,videoEpisodes:Qt,previewThumbsData:De,canDownload:we,uiConfig:this.uiConfig,coreConfig:this.coreConfig,disabledControls:wt,isInteractive:et,saveRate:dt,interactiveRanges$:(u=this.interactiveController)==null?void 0:u.state.interactiveRanges$,isInteractiveTime$:(f=this.interactiveController)==null?void 0:f.state.isInteractiveTime$,stopPlayer:()=>this.stop(),replayInteractive:Ze,playPrevChapterDisabledTooltip:jt,hasInteractiveBranches:!!((p=(_=this.interactiveController)==null?void 0:_.getChapterBranches())!=null&&p.length),additionalButtons:this.uiConfig.features.additionalButtons?D:[],additionalSettingsMenuItems:ce!=null?ce:[],additionalContextMenuItems:Pe!=null?Pe:[],playPrevVideo:()=>this.playPrevVideo(),playNextVideo:()=>this.playNextVideo(),looped:Ye&&this.videoConfig.videos.length===1,statistics:this.statistics,internalsExposure:this.internalsExposure});let{stores:It}=this.microStoresRoot=n0(),pi=()=>{var si,Ai,Ki,Do,To,Io;if(!this.store||!this.microStoresRoot||!this.videoConfig)return;this.subscription.add(this.store.state.currentFormat$.subscribe(H=>{var Qe;return(Qe=se==null?void 0:se.onCurrentFormatChanged)==null?void 0:Qe.call(se,H)})),this.subscription.add(It.interactiveControlsOpacity$.subscribe(H=>{var Qe;H!==null&&((Qe=this==null?void 0:this.interactiveController)==null||Qe.setDisabledControls(H))})),this.subscription.add(this.store.state.throughputEstimation$.subscribe(H=>{var Qe;return(Qe=se==null?void 0:se.onThroughputEstimationChanged)==null?void 0:Qe.call(se,H)})),this.subscription.add(this.store.state.trafficSavingEnabled$.subscribe(H=>{var Qe;return(Qe=se==null?void 0:se.onTrafficSavingEnabledChanged)==null?void 0:Qe.call(se,H)})),this.subscription.add(new qi.Observable(H=>{this.store&&this.subscription.add(this.store.state.currentPlaybackRate$.subscribe(Qe=>H.next(Qe)))}).pipe(this.uiConfig.features.skipInitialPlaybackRateValue?(0,qi.skip)(1):H=>H).subscribe(H=>{var Qe;return(Qe=se==null?void 0:se.onCurrentPlaybackRateChanged)==null?void 0:Qe.call(se,H)})),this.subscription.add(this.store.state.volume$.subscribe(H=>{var Qe;return(Qe=se==null?void 0:se.onVolumeChange)==null?void 0:Qe.call(se,H)})),this.subscription.add(this.store.state.muted$.subscribe(H=>{var Qe,ai;return H?(Qe=se==null?void 0:se.onMute)==null?void 0:Qe.call(se):(ai=se==null?void 0:se.onUnmute)==null?void 0:ai.call(se)})),this.subscription.add(this.store.state.videoBitrate$.subscribe(H=>{var Qe;return(Qe=se==null?void 0:se.onVideoBitrateChanged)==null?void 0:Qe.call(se,H)})),this.subscription.add(this.store.state.isInteractiveTime$.subscribe(H=>{var Qe;let ai=(Qe=this.store)==null?void 0:Qe.ui.controls.disabledControls$;ai&&(H&&!ai.includes(Jl)&&ai.add(Jl),H||ai.remove(Jl))})),this.subscription.add(this.store.ui.isFullscreen.subscribe(H=>ku(this,null,function*(){var Qe;if(!oc.clientChecker.browser.isSamsungBrowser||!H||!this.interactiveController)return;document.fullscreenElement===this.shadowRootContainer&&(yield this.replayInteractiveChapter((Qe=this.videoConfig)==null?void 0:Qe.callbacks.onExternalFullscreenExit))}))),this.statistics&&this.statistics.oneStat&&this.subscription.add(this.statistics.oneStat.vsid$.subscribe(H=>{var Qe;return(Qe=se==null?void 0:se.onVSIDChanged)==null?void 0:Qe.call(se,H)})),this.initMediaSession(),O(kn,_e({interactiveController:this.interactiveController,interactiveContainer:this.interactiveContainer,sources:st,store:this.store,microStoresRoot:this.microStoresRoot,videoConfig:this.videoConfig,uiConfig:this.uiConfig,title:mt,thumbUrl:ot,subtitles:re,live:Q,preload:S,autoplay:I,muted:A,volume:P,fromTime:E,canRewindLive:T,supportLink:R,showAds:z,adsSlotId:j,adsParams:ae,adsPreviewParam:X,adsAutoplayParam:ee,duration:vt,logoClickable:de,logoHidden:Ve,isMobile:J!=null?J:Be,failoverHosts:Re,fullScreenTarget:N,saveRate:dt,shadowRootContainer:this.shadowRootContainer,showMiniTimer:pe,outerContainerRef:this.rootContainer,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:fe.nextVideoTitle,endScreenVideoThumb:fe.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist(),playPrevChapter:()=>this.playPrevChapter(),seekToInteractive:()=>this.seekToInteractive(),volumeMultiplier:Ae,showEndScreen:xe,showAutoplayNext:Me}));let Oo={target:this.playerContainer,props:r(kn)};this.svelteRootComponent=ns(Jm,Oo),this.addPlayerInfoSubscriptions(),this.isInited||(this.isInited=!0,(Ki=(Ai=(si=this.videoConfig)==null?void 0:si.callbacks)==null?void 0:Ai.onInited)==null||Ki.call(Ai)),(Do=this.internalsExposure)==null||Do.expose({player:this,videoConfig:this.videoConfig,coreConfig:this.coreConfig,uiConfig:this.uiConfig,statisticsConfig:this.statisticsConfig,logger:this.logger,log:this.log}),this.uiConfig.devNullLog&&((Io=(To=this.videoConfig)==null?void 0:To.callbacks)!=null&&Io.onDevNullLog)?gl.devNull.subscribe("ui",this.videoConfig.callbacks.onDevNullLog):gl.devNull.destroy("ui")};this.coreConfig.asyncResolveClientChecker?oc.clientChecker.isInited$.subscribe(si=>{si&&(console.log("UI SDK async start"),pi())}):pi()}addPlayerInfoSubscriptions(){var e,i;let o=this.store,n=(e=this.microStoresRoot)==null?void 0:e.stores;if(!o||!n)return;let a=(i=this.videoConfig)==null?void 0:i.callbacks;a&&this.subscription.add(o.playerPhase.subscribe(d=>{var l;return(l=a.onPlayerPhaseChanged)==null?void 0:l.call(a,d)})).add(o.state.playbackState$.subscribe(d=>{var l;return d&&((l=a.onPlaybackStateChanged)==null?void 0:l.call(a,d))})).add(o.state.isLive$.subscribe(d=>{var l;return(l=a.onIsLiveChanged)==null?void 0:l.call(a,d)})).add(o.state.isActiveLive$.subscribe(d=>{var l;return(l=a.onIsActiveLiveChanged)==null?void 0:l.call(a,d)})).add(o.state.isAudioAvailable$.subscribe(d=>{var l;return(l=a.onIsAudioAvailableChanged)==null?void 0:l.call(a,d)})).add(o.state.currentQuality$.subscribe(d=>{var l;return(l=a.onCurrentQualityChanged)==null?void 0:l.call(a,d)})).add(o.state.availableQualities$.subscribe(d=>{var l;return(l=a.onAvailableQualitiesChanged)==null?void 0:l.call(a,d.map(({value:u})=>u).filter(u=>u!=="auto"))})).add(o.state.availableAudioStreams$.subscribe(d=>{d.length>1&&a.onAudioLanguagesAvailable&&a.onAudioLanguagesAvailable()})).add(n.pictureInPicture$.isActive$.subscribe(d=>{var l,u;return d?(l=a.onPiPEnter)==null?void 0:l.call(a):(u=a.onPiPExit)==null?void 0:u.call(a)}));let s=a==null?void 0:a.uiInfo;s&&this.subscription.add(o.ui.controlsVisible.subscribe(d=>{var l;return(l=s.onControlsVisibleChanged)==null?void 0:l.call(s,d)})).add(o.ui.isMobile.subscribe(d=>{var l;return(l=s.onIsMobileChanged)==null?void 0:l.call(s,d)})).add(o.ui.playerSize.subscribe(d=>{var l;return(l=s.onPlayerSizeChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.prevButton.subscribe(d=>{var l;return(l=s.onPrevButtonChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.playButton.subscribe(d=>{var l;return(l=s.onPlayButtonChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.replayButton.subscribe(d=>{var l;return(l=s.onReplayButtonChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.nextButton.subscribe(d=>{var l;return(l=s.onNextButtonChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.playPrevChapterButton.subscribe(d=>{var l;return(l=s.onPlayPrevChapterChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.seekToInteractiveButton.subscribe(d=>{var l;return(l=s.onSeekToInteractiveButtonChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.interactiveGraphButton.subscribe(d=>{var l;return(l=s.onGraphButtonChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.liveButton.subscribe(d=>{var l;return(l=s.onLiveButtonChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.time.subscribe(d=>{var l;return(l=s.onTimeUpdateChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.episodes.subscribe(d=>{var l;return(l=s.onEpisodesChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.subtitles.subscribe(d=>{var l;return(l=s.onSubtitlesChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.settings.subscribe(d=>{var l;return(l=s.onSettingsChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.fullscreen.subscribe(d=>{var l;return(l=s.onFullscreenChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.chromecast.subscribe(d=>{var l;return(l=s.onChromecastChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.pip.subscribe(d=>{var l;return(l=s.onPipChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.vkLogo.subscribe(d=>{var l;return(l=s.onVkLogoChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.interactiveTimeIndicator.subscribe(d=>{var l;return(l=s.onInteractiveTimeIndicatorChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.timeline.subscribe(d=>{var l;return(l=s.onTimelineChanged)==null?void 0:l.call(s,d)}))}playNextVideo(){this.videoConfig&&(this.currentPlayingVideoIndex++,this.currentPlayingVideoIndex>=this.videoConfig.videos.length&&(this.currentPlayingVideoIndex=0),this.log({message:`play next video, index: ${this.currentPlayingVideoIndex}`}),this.createPlayerWithCurrentVideo())}playPrevVideo(){this.videoConfig&&(this.currentPlayingVideoIndex--,this.currentPlayingVideoIndex<0&&(this.currentPlayingVideoIndex=this.videoConfig.videos.length-1),this.log({message:`play prev video, index: ${this.currentPlayingVideoIndex}`}),this.createPlayerWithCurrentVideo())}createPlayerWithCurrentVideo(e,i=!0){if(!this.videoConfig)return;let o=this.videoConfig.videos[this.currentPlayingVideoIndex];if(!o){this.log({message:"no next video"});return}this.isInited&&(0,qi.isNonNullable)(o.unitedVideoId)&&this.store.actions.internal.nextMovie(o.unitedVideoId),this.unmountComponent(this.svelteRootComponent),this.createPlayer(o,{autoplay:i,fromTime:0},e)}playPrevChapter(){var e;(e=this.interactiveController)==null||e.playPrevChapter()}seekToInteractive(){var e;let i=(e=this.interactiveController)==null?void 0:e.getNextInteractiveStartTime();typeof i=="number"&&this.seekTime(i/1e3)}initInteractives(){return ku(this,null,function*(){var e,i,o,n;if((e=this.videoConfig)!=null&&e.interactiveData)try{let{Interactives:a}=yield import("@vkontakte/videoplayer-interactive/es2015");this.interactiveContainer=document.createElement("div"),this.interactiveContainer.classList.add("interactive-root");let s=(i=this.store)==null?void 0:i.interfaceLanguage$,d=s?Se(s):this.videoConfig.interfaceLanguage,{projectInfo:l,initChapterId:u,historyApi:f,videoLoader:_}=this.videoConfig.interactiveData;this.interactiveController=new a({parentElement:this.interactiveContainer,fullscreenTargetElement:this.playerContainer,lang:d,graph:this.uiConfig.features.interactiveGraph,projectInfo:l,initChapterId:u,historyApi:f,vkVideoLoader:_,lastFrame:this.uiConfig.features.interactiveLastFrame,permanentTextControls:this.uiConfig.features.interactiveTextPermanent,interactiveTimeOpenUri:this.uiConfig.features.interactiveTimeOpenUri,initSeamless:!0,config:this.uiConfig.interactive,coreConfig:this.coreConfig,createOneStat:this.createOneStat,animationsFeatureToggles:{areaControlShadow:this.uiConfig.features.interactiveAreaControlShadow,controlsExpectTimeBlinkAnimation:this.uiConfig.features.interactiveControlsExpectTimeBlinkAnimation}});let{isInteractiveExpectation$:p,isSeekable$:$}=this.interactiveController.state;this.uiConfig.features.seekToInteractive&&this.subscription.add($.subscribe(y=>{if(!this.isInited)return;let S=this.store;y?S.ui.controls.disabledControls$.remove("SEEK_TO_INTERACTIVE_BUTTON"):S.ui.controls.disabledControls$.add("SEEK_TO_INTERACTIVE_BUTTON")})),this.subscription.add(p.subscribe(y=>{this.store&&this.store.state.isInteractiveExpectation$.set(y)}));let w=!0;if(this.subscription.add(this.interactiveController.events.playerChanged$.subscribe(y=>{if(!this.videoConfig)return;this.videoConfig.videos[this.currentPlayingVideoIndex]=_x(Ls({},y.config),{title:(l==null?void 0:l.title)||y.config.title});let S=w?this.videoConfig.autoplay:!0;this.createPlayerWithCurrentVideo(y.player,S),w&&(w=!1)})),this.interactiveSubscription.add(this.interactiveController.events.interactiveActionChoice$.subscribe(({type:y,actionType:S})=>{var I,P,A,E,T,R;if(!this.store||!this.microStoresRoot)return;let z=p.getValue();if(y==="action-choice"&&S==="setRandomBranch"&&(this.microStoresRoot.stores.graphIsOpened$.set(!1),this.store.ui.controls.disabledControls$.remove(ed)),y==="action-choice-canceled"){let j=Se(this.store.state.isPlaying$)||z;if(((A=(I=this.videoConfig)==null?void 0:I.isTouch)!=null?A:(P=this.videoConfig)!=null&&P.isMobile)&&j){this.store.ui.interactiveHideMobileControls.set(!0);return}(R=(E=this.videoConfig)==null?void 0:(T=E.callbacks).onDisabledInteractiveClick)==null||R.call(T)}})),this.interactiveSubscription.add(this.interactiveController.events.interactiveContainerFakeRemoved$.subscribe(({type:y,removeAllOpenURI:S})=>{this.store&&y==="container-fake-removed"&&S&&this.store.ui.controls.disabledControls$.remove(ed)})),yield this.interactiveController.setManifest(this.videoConfig.interactiveData.manifest),(n=(o=this.videoConfig)==null?void 0:o.callbacks)!=null&&n.onInteractiveHistoryChanged){let y=this.interactiveController.getHistoryState();this.subscription.add(y.history$.subscribe(S=>{var I,P,A;S.length&&((A=(P=(I=this.videoConfig)==null?void 0:I.callbacks)==null?void 0:P.onInteractiveHistoryChanged)==null||A.call(P,S))}))}this.uiConfig.features.interactiveTimeIndicator&&this.subscription.add(this.interactiveController.events.noInteraction$.subscribe(()=>{var y,S,I,P;(y=this.microStoresRoot)==null||y.stores.showInteractiveTimeIndicatorTooltip$.set(!0,!0),(P=(S=this.videoConfig)==null?void 0:(I=S.callbacks).onInteractiveTimeIndicatorClick)==null||P.call(I)})),this.interactiveSubscription.add(this.interactiveController.events.error$.subscribe(y=>{this.log({message:y.toString()})}))}catch(a){this.log({message:a.message})}})}initPlayer(e,i={}){var o,n,a,s,d,l,u,f,_,p,$,w,y,S,I,P,A,E,T,R,z,j,U,X,ee,ne;if(!Array.isArray(e.videos)||e.videos.length===0&&!e.interactiveData)throw new Error("empty videos");if(this.videoConfig=Yd(bx,(0,qi.cloneDeepWith)(e,ue=>ue instanceof HTMLElement?ue:void 0)),this.uiConfig=eh((o=i.ui)!=null?o:{}),this.coreConfig=(n=i.core)!=null?n:{configName:[]},this.statisticsConfig=(a=i.statistics)!=null?a:{},this.uiConfig.features.forcePlayerDisplayBlock&&(this.rootContainer.style.minHeight="unset",this.style.display="block",this.style.width="100%",this.style.height="100%"),this.sentry={config:(s=this.uiConfig.sentry)!=null?s:{}},this.uiConfig.features.exposeInternalsToGlobal&&((d=this.internalsExposure)!=null||(this.internalsExposure=new qi.InternalsExposure("UI"))),gl.devNull.push("ui",{key:"videoplayer_embed",strings:["new","player_init_player","ads.enable: "+this.uiConfig.ads.enable,"showAds: "+((l=this.videoConfig)==null?void 0:l.showAds)],numbers:[(0,s0.now)()]}),(0,qi.isNonNullable)(this.videoConfig.isMediaSessionEnabled)&&(this.uiConfig.features.mediaSession=(f=(u=this.uiConfig.features.mediaSession)!=null?u:this.videoConfig.isMediaSessionEnabled)!=null?f:!0),(0,qi.isNonNullable)(this.videoConfig.isPictureInPictureEnabled)&&(this.uiConfig.features.pip=(p=(_=this.uiConfig.features.pip)!=null?_:this.videoConfig.isPictureInPictureEnabled)!=null?p:!0,this.uiConfig.features.dpip=(w=($=this.uiConfig.features.dpip)!=null?$:this.videoConfig.isPictureInPictureEnabled)!=null?w:!0),this.videoConfig.isTouch=(S=(y=this.uiConfig.isMobile)!=null?y:this.videoConfig.isTouch)!=null?S:this.videoConfig.isMobile,(I=this.videoConfig).autoplay&&(I.autoplay=this.uiConfig.features.autoplay),this.videoConfig.showAds=(P=this.uiConfig.ads.enable)!=null?P:this.videoConfig.showAds,this.videoConfig.adsSlotId=(A=this.uiConfig.ads.slot)!=null?A:this.videoConfig.adsSlotId,this.videoConfig.adsPreviewParam=(E=this.uiConfig.ads.preview)!=null?E:this.videoConfig.adsPreviewParam,this.videoConfig.logoHidden=!((T=this.uiConfig.showLogo)!=null?T:!this.videoConfig.logoHidden),(R=this.videoConfig).canRewindLive&&(R.canRewindLive=this.uiConfig.features.liveRewind),this.videoConfig.supportLink=(z=this.videoConfig.supportLink)!=null?z:this.uiConfig.supportLink,this.videoConfig.showEndScreen=(j=this.uiConfig.features.endScreen)!=null?j:this.videoConfig.showEndScreen,this.videoConfig.showAutoplayNext=(U=this.uiConfig.features.autoplayNext)!=null?U:this.videoConfig.showAutoplayNext,this.videoConfig.showNextPrevButtons=(X=this.uiConfig.features.nextPrevButtons)!=null?X:this.videoConfig.showNextPrevButtons,this.currentPlayingVideoIndex=this.videoConfig.videoIndex&&((ee=this.videoConfig.videos)!=null&&ee[this.videoConfig.videoIndex])?this.videoConfig.videoIndex:0,this.needToRepeatPlaylist=this.videoConfig.repeat,this.uiConfig.features.pip){let ue={enabled:this.videoConfig.pipEnabled};this.uiConfig.features.dpip?this.pictureInPictureApi=xu.getLatestSupportedVersion(ue):this.pictureInPictureApi=new oa(ue)}this.mediaSessionApi=this.uiConfig.features.mediaSession?new $u:void 0,this.slotsApi=this.uiConfig.features.slots?new gu:void 0,this.annotationsApi=this.uiConfig.features.annotations?new wu(this.uiConfig.features.annotationsInside):void 0,this.annotationsApi&&!this.uiConfig.features.annotationsInside&&this.annotationsApi.init(this.rootContainer),(ne=this.slotsApi)==null||ne.init(this.shadowRootContainer),this.unmountComponent(this.svelteStubComponent),this.unmountComponent(this.svelteRootComponent),this.isInited=!1,this.prevIsid=void 0,this.interactiveController&&(this.interactiveController.destroy(),this.interactiveController=void 0,this.interactiveSubscription.unsubscribe()),this.videoConfig.interactiveData?this.initInteractives():this.createPlayer(this.videoConfig.videos[this.currentPlayingVideoIndex]),X1(this.pictureInPictureApi)&&this.pictureInPictureApi.setPlayerDomElement(this.playerContainer,this._shadowRoot)}isOneVideoPlaylist(){return this.videoConfig?this.videoConfig.videos.length===1:!1}updateVideos(e,i){if(!this.videoConfig)return;this.log({message:`update ${i} videos, videos: ${JSON.stringify(e)}`}),i==="prev"?(this.videoConfig.videos.splice(0,this.currentPlayingVideoIndex),this.videoConfig.videos.unshift(...e),this.currentPlayingVideoIndex=e.length):i==="next"&&(this.videoConfig.videos.splice(this.currentPlayingVideoIndex+1),this.videoConfig.videos.push(...e));let o=this.getNextVideoInfo();r(kn)&&(r(kn).showNextPrevButtons=this.needToShowNextPrevButtons(),r(kn).nextButtonActive=this.isNextButtonActive(),r(kn).prevButtonActive=this.isPrevButtonActive(),r(kn).endScreenVideoTitle=o.nextVideoTitle,r(kn).endScreenVideoThumb=o.nextVideoThumb,r(kn).isOneVideoPlaylist=this.isOneVideoPlaylist())}updatePrevVideos(e){this.updateVideos(e,"prev")}updateNextVideos(e){this.updateVideos(e,"next")}initMediaSession(){var e,i;this.mediaSessionApi&&((e=this.unsubscribePlayerPhaseSubscription)==null||e.call(this),this.mediaSessionApi.clearSubscriptions(),this.unsubscribePlayerPhaseSubscription=(i=this.store)==null?void 0:i.playerPhase.subscribe(o=>{o==="video"?this.setupMediaSessionForVideo():o==="ads"&&this.setupMediaSessionForAds()}))}setupMediaSessionForVideo(){if(!(!this.videoConfig||!this.mediaSessionApi))try{let{title:e,thumbUrl:i}=Ls({},this.videoConfig.videos[this.currentPlayingVideoIndex]),o=[["play",()=>this.play()],["pause",()=>this.pause()],["seekto",n=>this.seekTime(n.seekTime)]];this.videoConfig.videos.length>1&&(this.currentPlayingVideoIndex<this.videoConfig.videos.length-1&&o.push(["nexttrack",()=>this.playNextVideo()]),this.currentPlayingVideoIndex>0&&o.push(["previoustrack",()=>this.playPrevVideo()])),this.mediaSessionApi.setMetaData({title:e,thumbUrl:i}),this.mediaSessionApi.updateActionHandlers(o),this.mediaSessionApi.attachToStore(this.store)}catch(e){this.log({message:e.message})}}setupMediaSessionForAds(){if(!(!this.videoConfig||!this.mediaSessionApi))try{let e="\u0420\u0435\u043A\u043B\u0430\u043C\u0430",i=[["play",()=>this.play()],["pause",()=>this.pause()]];this.mediaSessionApi.setMetaData({title:e}),this.mediaSessionApi.updateActionHandlers(i),this.mediaSessionApi.attachToStore(this.store)}catch(e){this.log({message:e.message})}}play(){var e,i,o,n;this.isControlDisabled("PLAY_BUTTON")||(e=this.store)!=null&&e.playerPhase.is("LiveWaitingStart")||(i=this.store)!=null&&i.playerPhase.is("LiveWaitingRecover")||(o=this.store)!=null&&o.playerPhase.is("LiveWaitingRecord")||(this.log({message:"play"}),(n=this.svelteRootComponent)==null||n.play())}pause(){var e;this.log({message:"pause"}),(e=this.svelteRootComponent)==null||e.pause()}stop(){var e;if(!this.videoConfig)return;this.log({message:"stop"});let i=!!this.interactiveController;i&&(this.interactiveController.destroy(),this.interactiveController=void 0,this.interactiveContainer=void 0,this.interactiveSubscription.unsubscribe()),this.unmountComponent(this.svelteStubComponent),(e=this.mediaSessionApi)==null||e.destroy();let o=this.videoConfig.videos[0];o&&(this.unmountComponent(this.svelteRootComponent),i?(this.videoConfig.autoplay=!1,this.initInteractives()):this.createPlayer(o))}setMuted(e){var i;this.log({message:`set muted, muted: ${e}`}),(i=this.svelteRootComponent)==null||i.setMuted(e)}setPiPEnabled(e){var i,o;(o=(i=this.store)==null?void 0:i.webApi.pictureInPictureApi)==null||o.setEnabled(e)}setVolume(e){var i;this.log({message:`set volume, volume: ${e}`}),(i=this.svelteRootComponent)==null||i.setVolume(e)}setRepeat(e){this.log({message:`set repeat, repeat: ${e}`}),this.needToRepeatPlaylist=e,r(kn)&&(r(kn).needToRepeatPlaylist=this.needToRepeatPlaylist,r(kn).showNextPrevButtons=this.needToShowNextPrevButtons(),r(kn).nextButtonActive=this.isNextButtonActive(),r(kn).prevButtonActive=this.isPrevButtonActive())}seekTime(e){var i;this.isControlDisabled("TIMELINE")||(this.log({message:`seek time, time: ${e}`}),(i=this.svelteRootComponent)==null||i.seekTime(e))}seekEpisodeStartTime(e){var i;this.log({message:`seek episode start time, time: ${e}`}),(i=this.svelteRootComponent)==null||i.seekEpisodeStartTime(e)}returnFocusToEpisodes(){var e;this.log({message:"return focus to episodes button"}),(e=this.svelteRootComponent)==null||e.returnFocusToEpisodes()}setPlaybackRate(e){var i;this.log({message:`set playback rate to: ${e}`}),(i=this.svelteRootComponent)==null||i.setPlaybackRate(e)}setAutoQualityLimits(e){var i,o,n;this.log({message:`set auto quality limitation. Max: ${(i=e.max)!=null?i:"none"}. Min: ${(o=e.min)!=null?o:"none"}`}),(n=this.svelteRootComponent)==null||n.setAutoQualityLimits(e)}addLanguage(e){var i;(i=this.store)==null||i.actions.internal.addLanguage(e)}setLanguage(e){return ku(this,null,function*(){var i;yield(i=this.store)==null?void 0:i.actions.internal.setLanguage(e)})}setLiveStart(e){var i,o;this.log({message:"live started"}),(i=this.store)==null||i.actions.internal.setLiveWaitingRecover(!1),(o=this.store)==null||o.actions.internal.setLiveWaitingStart(!1),this.unmountComponent(this.svelteRootComponent),this.createPlayer(e,{autoplay:!0})}setLiveWaitingRecover(){var e;this.log({message:"live waiting"}),(e=this.store)!=null&&e.callbacks&&(this.store.callbacks.onLiveEnded=()=>{var i,o;(i=this.store)==null||i.actions.internal.setLiveWaitingRecover(!0),(o=this.store)==null||o.destroy()})}setLiveWaitingRecord(){var e;this.log({message:"post live"}),(e=this.store)!=null&&e.callbacks&&(this.store.callbacks.onLiveEnded=()=>{var i,o;(i=this.store)==null||i.actions.internal.setLiveWaitingRecord(!0),(o=this.store)==null||o.destroy()})}setLiveEnd(e){var i;this.log({message:"live ended"}),(i=this.store)!=null&&i.callbacks&&(this.store.callbacks.onLiveEnded=()=>{var o,n;(o=this.store)==null||o.actions.internal.setLiveWaitingRecover(!1),(n=this.store)==null||n.actions.internal.setLiveWaitingRecord(!1),this.unmountComponent(this.svelteRootComponent),this.createPlayer(e,{autoplay:!1})})}setLiveLowLatency(e){var i;this.log({message:"live switch to low latency "+e}),(i=this.store)==null||i.actions.external.setLiveLowLatency(e)}getDeviceId(){var e,i,o;return(o=(i=(e=this.statistics)==null?void 0:e.oneStat)==null?void 0:i.getDeviceId())!=null?o:void 0}replayInteractiveVideo(){this.interactiveController&&this.interactiveController.setChapter()}replayInteractiveChapter(e){return ku(this,null,function*(){var i,o;if(this.interactiveController&&((i=this.store)!=null&&i.state.positionExact$)){let n=Se(this.store.state.positionExact$),s=Se(this.store.state.interactiveEpisodes$).find(l=>!l.completed);this.interactiveController.events.playerChanged$.pipe((0,qi.once)()).subscribe(()=>{s&&n>=s.time?this.seekTime(s.time):this.seekTime(n),e==null||e()});let d=this.interactiveController.getCurrentChapter();yield this.interactiveController.setChapter({chapterId:(o=d==null?void 0:d.chapter)==null?void 0:o.id,pushToHistory:!1})}})}showInteractiveIndicatorTooltip(e,i=!1){var o;(o=this.microStoresRoot)==null||o.stores.showInteractiveTimeIndicatorTooltip$.set(e,i)}switchToActiveLive(){var e;(e=this.store)==null||e.actions.internal.switchToActiveLive()}updateAdditionalSettingsItem(e,i){var o;(o=this.store)==null||o.actions.external.updateAdditionalSettingsItem(e,i)}addAdditionalSettingsItem(e){var i;(i=this.store)==null||i.actions.external.addAdditionalSettingsItem(e)}removeAdditionalSettingsItem(e){var i;(i=this.store)==null||i.actions.external.removeAdditionalSettingsItem(e)}updateAdditionalContextItem(e,i){var o;(o=this.store)==null||o.actions.external.updateAdditionalContextItem(e,i)}addAdditionalContextItem(e){var i;(i=this.store)==null||i.actions.external.addAdditionalContextItem(e)}removeAdditionalContextItem(e){var i;(i=this.store)==null||i.actions.external.removeAdditionalContextItem(e)}updateAdditionalButton(e,i){var o;(o=this.store)==null||o.actions.external.updateAdditionalButton(e,i)}addAdditionalButton(e){var i;(i=this.store)==null||i.actions.external.addAdditionalButton(e)}removeAdditionalButton(e){var i;(i=this.store)==null||i.actions.external.removeAdditionalButton(e)}updateStatContext(e){this.statistics&&this.statistics.oneStat&&this.statistics.oneStat.updateContext(e)}handleTimerNextVideo(e){var i;(i=this.store)==null||i.actions.internal.setTimerNextVideoRunning(e)}focus(){var e,i,o;(o=(i=(e=this.svelteRootComponent)==null?void 0:e.keyboardControls)==null?void 0:i.focus)==null||o.call(i)}unmountComponent(e){e&&Ys(e)}};var hl=require("@vkontakte/videoplayer-shared/es2015"),Au=require("@vkontakte/videoplayer-core/es2015"),$x=()=>{window.customElements.define("vk-video-player",Eu)};
|
|
364
|
+
`),n=document.createElement("style");n.textContent=o;let a=this.createStretchedContainer(),s=a.attachShadow({mode:"open"});s.append(n),s.append(this.playerDomElement);let d={target:this.playerParentShadowRoot,context:this.svelteContext};this.playerDummyElement=ns(nv,d),(e=this.pipWindow)==null||e.document.body.append(a),this.info.isActive$.next(!0),(i=this.pipWindow)==null||i.addEventListener("unload",l=>{!this.playerDomElement||!this.playerParentShadowRoot||!this.playerDummyElement||(Ys(this.playerDummyElement),this.playerParentShadowRoot.append(this.playerDomElement),this.info.isActive$.next(!1))})})}remove(){return rv(this,null,function*(){return new Promise(e=>{var i;(i=documentPictureInPicture.window)==null||i.close(),e()})})}dispose(){return rv(this,null,function*(){yield this.remove()})}setEnabled(e){this.info.isEnabled$.next(e)}createStretchedContainer(){let e=document.createElement("div");return e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.width="100%",e.style.height="100%",e}};function X1(t){return t instanceof Gd}var xu=class{static getLatestSupportedVersion(e){let i=new oa,o=new Gd(e);if(o.isSupported())return o;if(i.isSupported())return i}};function Yd(t,e){var n,a;let i=new Set([...Object.keys(t),...Object.keys(e)]),o={};for(let s of i)o[s]=(a=(n=e[s])!=null?n:t[s])!=null?a:void 0;return o}var J1="Inner error. Unexpectedly root annotation container null reference exception",e0="Annotation with such name already exists",t0="Annotation with such name does not exist";var ml=class extends Error{constructor(e){super(e),this.name="AnnotationError"}};var vl=require("@vkontakte/videoplayer-shared/es2015"),dx="1",cx=100,wu=class{constructor(e){this.annotationsInside=e;this.annotations=new Map;this.subscriptions=new vl.Subscription}init(e){if(this.rootAnnotationsContainer=e,this.annotationsInside)return;let i=(0,vl.throttleFn)(()=>{for(let o of this.annotations.values())this.isElementExceedsBoundaries(o,this.playerSize.width,this.playerSize.height)?o.style.visibility="hidden":o.style.visibility="visible"},cx);this.subscriptions.add((0,vl.observeElementSize)(this.rootAnnotationsContainer).subscribe(({width:o,height:n})=>{this.playerSize={width:o,height:n},i()})),this.mutationObserver=new MutationObserver(i),this.mutationObserver.observe(this.rootAnnotationsContainer,{attributes:!0,childList:!0,subtree:!0,characterData:!0})}add(e,i){var o;if(!this.rootAnnotationsContainer)throw new ml(J1);if(this.annotations.has(e))throw new ml(e0);i.style.zIndex=(o=i.style.zIndex)!=null?o:dx,i.style.position="absolute",this.rootAnnotationsContainer.append(i),this.annotations.set(e,i)}get(e){let i=this.annotations.get(e);if(!i)throw new ml(t0);return i}remove(e){let i=this.get(e);this.annotations.delete(e)&&i.remove()}clear(){for(let e in this.annotations.keys())this.remove(e)}destroy(){var e;this.annotations.clear(),this.subscriptions.unsubscribe(),(e=this.mutationObserver)==null||e.disconnect(),this.rootAnnotationsContainer=null}isElementExceedsBoundaries(e,i,o){let n=e.offsetTop,a=e.offsetLeft,s=e.offsetWidth,d=e.offsetHeight;return n<0||a<0||a+s>i||n+d>o}registryRootContainer(e){}addLayer(e){return document.createElement("div")}getLayer(e){}removeLayer(e){}clearLayer(e){}detach(){}reattach(){}};var xa=require("@vkontakte/videoplayer-shared/es2015"),Qo=class{init({store:e,microStores:i,interactiveController:o,config:n}){return(0,xa.assertNonNullable)(e),(0,xa.assertNonNullable)(i),(0,xa.assertNonNullable)(n),n.interactiveData&&(0,xa.assertNonNullable)(o),this.subscription=new xa.Subscription,this.subscription}};var jd=class extends Qo{constructor(){super(...arguments);this.stateName="fakeIsPlaying$";this.state$=Lt(q({},le(null)),{toggle:()=>this.state$.update(i=>!i)})}init(i){let o=super.init(i),{isInteractiveExpectation$:n}=i.store.state;return o.add(n.subscribe(a=>{this.state$.set(a?!0:null)})),o}};var Zd=class extends Qo{constructor(){super(...arguments);this.stateName="interactiveControlsOpacity$";this.state$=Lt(q({},le(null)),{toggle:()=>this.state$.update(i=>!i)})}init(i){let o=super.init(i),{microStores:n,store:a}=i,{fakeIsPlaying$:s}=n,{isInteractiveExpectation$:d,isPlaying$:l}=a.state,{controlsVisible:u,isMobile:f}=a.ui,_=Se(f),p=()=>_&&Se(u);return o.add(u.subscribe($=>{if(!_)return;let w=Se(s);Se(l)?this.state$.set($):w!==null&&this.state$.set(!w||$)})),o.add(l.subscribe($=>{this.state$.set(!$||p())})),o.add(s.subscribe($=>{if($===null)return;let w=Se(d);if(p()){this.state$.set(!0);return}w&&this.state$.set(!$)})),o}};var Xd=class extends Qo{constructor(){super(...arguments);this.stateName="seekToInteractiveDisabledTooltip$";this.state$=le("tooltip_chapter_without_interactive")}init(i){let o=super.init(i),{store:n}=i;return o.add(n.state.interactiveEpisodes$.subscribe(a=>{a.length&&(a.every(s=>s.completed)?this.state$.set("tooltip_interactive_of_chapter_completed"):this.state$.set("tooltip_disabled_when_interactive"))})),o}};var i0=require("@vkontakte/videoplayer-shared/es2015");var sv=le(!1),Su=null,Jd=class extends Qo{constructor(){super(...arguments);this.stateName="showInteractiveTimeIndicatorTooltip$";this.state$=Lt(q({},sv),{set:(i,o=!1)=>{i!==Se(sv)&&(this.clearTimeout(),sv.set(i),!i&&Su&&(Su=!1),i&&o&&(this.timeout=setTimeout(()=>{this.state$.set(!1)},3e3)))},clearTimeout:()=>this.clearTimeout()})}init(i){let o=super.init(i),{store:n,config:a}=i,{isInteractiveTime$:s,isPlaying$:d}=n.state,l=n.ui.controlsVisible,{interactiveTimeIndicator:u}=n.ui.controls;o.add(l.subscribe(_=>{Se(s)&&_&&this.state$.set(!1)}));let f=(a==null?void 0:a.interactiveData)||{tooltipHelpHintActive:!1};return o.add((0,i0.combine)({isPlaying$:d,isInteractiveTime$:s,interactiveTimeIndicator:u}).subscribe(({isPlaying$:_,isInteractiveTime$:p,interactiveTimeIndicator:$})=>{var w,y;if(!(!_||!($!=null&&$.isDisplayed))){if(!p)return this.state$.set(!1);f.tooltipHelpHintActive&&Su===null&&(Su=!0,f.tooltipHelpHintActive=!1,this.state$.set(!0),(y=(w=n.callbacks)==null?void 0:w.onInteractiveTimeIndicatorHintDeactivated)==null||y.call(w))}})),o}clearTimeout(){window.clearTimeout(this.timeout)}};var Cu=require("@vkontakte/videoplayer-shared/es2015");var ec=class extends Qo{constructor(){super(...arguments);this.stateName="graphIsOpened$";this.graphMadePause=!1;this.state$=Lt(q({},le(null)),{toggle:Cu.noop});this.checkIfShouldHide=i=>Ps(i,"s")}init(i){let o=super.init(i),{store:n,interactiveController:a}=i,s=n.ui.currentGridType$,d=n.getLogger().createComponentLog("GraphIsOpened microStore");return this.state$.toggle=()=>Tt(this,null,function*(){if(this.checkIfShouldHide(Se(s)))return;let l=Se(this.state$),{isEnded$:u,playbackState$:f}=n.state,{disabledControls$:_}=n.ui.controls,p=Se(u),$=Se(f);if(l)try{yield a==null?void 0:a.toggleGraphView(!1),this.state$.set(!1),_.remove(Lp),!p&&this.graphMadePause&&n.actions.internal.play()}catch(w){d({message:"Cant hide graph"})}else{this.graphMadePause=$==="playing";try{yield a==null?void 0:a.toggleGraphView(!0),this.state$.set(!0),_.add(Lp),!p&&this.graphMadePause&&n.actions.internal.pause()}catch(w){d({message:"Cant show graph"})}}}),o.add((0,Cu.combine)({graphIsOpened:this.state$,currentGridType:s}).subscribe(f=>Tt(this,[f],function*({graphIsOpened:l,currentGridType:u}){if(this.checkIfShouldHide(u)&&l)try{yield a==null?void 0:a.toggleGraphView(!1),this.state$.set(!1)}catch(p){d({message:"Cant hide graph"})}}))),o}};var av=require("@vkontakte/videoplayer-shared/es2015"),tc=class extends Qo{constructor(){super(...arguments);this.stateName="pictureInPicture$";this.state$={isActive$:le(!1),isEnabled$:le(!1),type$:le(void 0)}}init(i){let o=super.init(i),{store:n}=i,{info:{isActive$:a,isEnabled$:s,type:d}}=n.webApi.pictureInPictureApi||{info:{isActive$:new av.ValueSubject(!1),isEnabled$:new av.ValueSubject(!1)}};return o.add(a.subscribe(l=>{this.state$.isActive$.set(l)})),o.add(s.subscribe(l=>{this.state$.isEnabled$.set(l)})),this.state$.type$.set(d),o}};var Iu=require("@vkontakte/videoplayer-shared/es2015");var Tu=require("@vkontakte/videoplayer-shared/es2015");var o0=({maxShowCount:t,timeout:e})=>{let i=[t!==0?ux({maxCount:t}):void 0,e!==0?px({timeout:e}):void 0].filter(o=>!!o);return{notificationShowed:o=>i.forEach(n=>n.notificationShowed(o)),canShowNotification:o=>i.every(n=>n.canShowNotification(o))}},ux=({maxCount:t})=>{let e={};return{notificationShowed:i=>{var o,n;e[i]=((o=e[i])!=null?o:0)+1,Tu.safeStorage.set("videoplayer_notifications_manager_count",JSON.stringify((n=e[i])!=null?n:0))},canShowNotification:i=>{var o;return((o=e[i])!=null?o:0)<t}}},px=({timeout:t})=>{let e="videoplayer_notifications_manager",i=()=>{try{return JSON.parse(Tu.safeStorage.get(e)||"{}")}catch(a){return{}}},o=a=>Tu.safeStorage.set(e,JSON.stringify(a)),n=a=>{let s=i();delete s[a],o(s)};return{notificationShowed:a=>{o(Lt(q({},i()),{[a]:{timeout:t,launchTime:Date.now()}}))},canShowNotification:a=>{let s=i()[a];if(s){let d=Date.now()-s.launchTime>t;return d&&n(a),d}else return!0}}};var ic=class extends Qo{constructor(){super(...arguments);this.stateName="notifications$";this.state$={notificationsToShow$:le({}),showNotification:i=>{this.state$.notificationsToShow$.update(o=>(o[i]=!0,o)),this.notificationManager.notificationShowed(i)},closeNotification:i=>{this.state$.notificationsToShow$.update(o=>(delete o[i],o))}}}init(i){let o=super.init(i),{store:n,uiConfig:{features:{maxCountShowSlowVideoNotification:a,timeoutShowSlowVideoNotification:s,showSlowVideoNotification:d,forceAutoQualityWhenSevereStallHappens:l}}}=i;this.notificationManager=o0({maxShowCount:a,timeout:s});let u=n.getPlayer();return o.add(u.events.severeStallOccured$.pipe((0,Iu.filterChanged)(),(0,Iu.filter)(f=>f)).subscribe(()=>{d&&!u.info.isAutoQualityEnabled$.getValue()&&this.notificationManager.canShowNotification("slow_video")&&(l&&n.actions.internal.setQuality("auto"),this.state$.showNotification("slow_video"))})),o}};var n0=()=>[jd,Zd,Xd,Jd,ec,tc,ic].reduce(({subscribers:t,stores:e},i)=>{let o=new i;return{subscribers:[...t,o],stores:Lt(q({},e),{[o.stateName]:o.state$})}},{subscribers:[],stores:{}});var gl=require("@vkontakte/videoplayer-shared/es2015");var fx=Object.defineProperty,mx=Object.defineProperties,vx=Object.getOwnPropertyDescriptors,r0=Object.getOwnPropertySymbols,gx=Object.prototype.hasOwnProperty,hx=Object.prototype.propertyIsEnumerable,lv=(t,e,i)=>e in t?fx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Ls=(t,e)=>{for(var i in e||(e={}))gx.call(e,i)&&lv(t,i,e[i]);if(r0)for(var i of r0(e))hx.call(e,i)&&lv(t,i,e[i]);return t},_x=(t,e)=>mx(t,vx(e)),ei=(t,e,i)=>lv(t,typeof e!="symbol"?e+"":e,i),ku=(t,e,i)=>new Promise((o,n)=>{var a=l=>{try{d(i.next(l))}catch(u){n(u)}},s=l=>{try{d(i.throw(l))}catch(u){n(u)}},d=l=>l.done?o(l.value):Promise.resolve(l.value).then(a,s);d((i=i.apply(t,e)).next())}),bx={preload:!0,autoplay:!1,repeat:!1,fromTime:0,canRewindLive:!0,showAds:!1,interfaceLanguage:qi.InterfaceLanguage.RU,isCyrillicRelatedInterface:!0,logoClickable:!1,logoHidden:!1,isTouch:(0,oc.isMobile)(),isMediaSessionEnabled:!0,isPictureInPictureEnabled:!0,isAudioDisabled:!1,callbacks:{uiInfo:{}},tuningConfig:{configName:[]},saveRate:!0,volumeMultiplier:1,showEndScreen:!0,showAutoplayNext:!0,showNextPrevButtons:!0},kn=te(void 0),Eu=class extends HTMLElement{constructor(){super(),ei(this,"svelteStubComponent"),ei(this,"svelteRootComponent"),ei(this,"store"),ei(this,"microStoresRoot"),ei(this,"statistics"),ei(this,"sentry"),ei(this,"_shadowRoot"),ei(this,"playerContainer"),ei(this,"rootContainer"),ei(this,"shadowRootContainer"),ei(this,"uiConfig"),ei(this,"coreConfig"),ei(this,"statisticsConfig"),ei(this,"interactiveController"),ei(this,"interactiveContainer"),ei(this,"graphMadePause"),ei(this,"currentPlayingVideoIndex",0),ei(this,"needToRepeatPlaylist",!1),ei(this,"videoConfig"),ei(this,"pictureInPictureApi"),ei(this,"mediaSessionApi"),ei(this,"unsubscribePlayerPhaseSubscription"),ei(this,"logger"),ei(this,"log"),ei(this,"subscription"),ei(this,"interactiveSubscription"),ei(this,"annotationsApi"),ei(this,"slotsApi"),ei(this,"prevIsid"),ei(this,"isInited",!1),ei(this,"internalsExposure",null),ei(this,"createOneStat",(e,i={})=>{var o,n,a,s;let{albumId:d,statPlace:l,statUserSalt:u,statTrackCode:f,statVKAppId:_,refreshStatAuthToken:p,autoplay:$,isMobile:w,isTouch:y,refDomain:S,deviceId:I,interactiveData:P}=Yd(this.videoConfig,i),A=(o=P==null?void 0:P.projectInfo)==null?void 0:o.pid,E=(a=(n=this.interactiveController)==null?void 0:n.state.isReplay$.getValue())!=null?a:!1;E&&(this.prevIsid=void 0);let{unitedVideoId:T,isClip:R=!1}=e;if(this.uiConfig.features.statistics&&T)return new Pu.OneStat(Ls({movieId:T,albumId:d,place:l,trackCode:f,vkAppId:_,autoplay:(s=$&&!this.interactiveController)!=null?s:!1,mobile:y!=null?y:w,clip:R,refDomain:S,deviceId:I},A&&(!this.isInited||E)&&{projectId:Number(A)}),Ls({refreshAuthToken:p,userSalt:u,config:this.statisticsConfig},this.interactiveController&&{useIsid:!0,isid:this.prevIsid}))}),gl.devNull.create("ui"),this.logger=new qi.Logger,this.log=this.logger.createComponentLog("VKVideoPlayer"),this.subscription=new qi.Subscription,this.interactiveSubscription=new qi.Subscription,this.graphMadePause=!1}connectedCallback(){var e,i;if(this.isInited)return;this.initPlayerRootContainers();let o=(e=this.getAttribute("stub-title"))!=null?e:void 0,n=(i=this.getAttribute("stub-thumb-url"))!=null?i:void 0,a=_e({title:o,thumbUrl:n}),s={target:this.playerContainer,props:a};this.svelteStubComponent=ns(iv,s)}disconnectedCallback(){var e,i,o,n,a;(e=this.annotationsApi)==null||e.destroy(),(i=this.mediaSessionApi)==null||i.destroy(),this.unmountComponent(this.svelteRootComponent),this.unmountComponent(this.svelteStubComponent),this.subscription.unsubscribe(),(o=this.unsubscribePlayerPhaseSubscription)==null||o.call(this),(n=this.interactiveController)==null||n.destroy(),this.interactiveSubscription.unsubscribe(),(a=this.internalsExposure)==null||a.destroy(),gl.devNull.destroy("ui")}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%",this.rootContainer.style.minHeight="206px",this.shadowRootContainer=document.createElement("div"),this.shadowRootContainer.style.position="absolute",this.shadowRootContainer.className="shadow-root-container",this.shadowRootContainer.style.width="100%",this.shadowRootContainer.style.height="100%",this._shadowRoot=this.shadowRootContainer.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(this.shadowRootContainer),this.append(this.rootContainer)}needToShowNextPrevButtons(){return this.videoConfig?this.videoConfig.videos.length>1&&this.videoConfig.showNextPrevButtons:!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;let o=(i=this.store)==null?void 0:i.ui.controls.disabledControls$;return(o==null?void 0:o.includes(e))||!1}getNextVideoInfo(){if(!this.videoConfig)return{nextVideoTitle:void 0,nextVideoThumb:void 0};let e=this.videoConfig.videos[this.currentPlayingVideoIndex+1]||{};return{nextVideoTitle:e.title,nextVideoThumb:e.thumbUrl}}createThinOneStat(e,i={}){let{deviceId:o,preload:n,refreshStatAuthToken:a}=Yd(this.videoConfig,i),{unitedVideoId:s}=e;return new Pu.ThinOneStat.ThinOneStat({deviceId:o,movieId:s,preload:n},{config:this.statisticsConfig,refreshAuthToken:a})}createPlayer(e,i={},o){var n,a,s,d,l,u,f,_,p;if(!this.videoConfig)return;let{albumId:$,statPlace:w,statAuthToken:y,preload:S,autoplay:I,volume:P,muted:A,fromTime:E,canRewindLive:T,supportLink:R,showAds:z,adsSlotId:j,adsParams:U={},adsPreviewParam:X,adsAutoplayParam:ee,interfaceLanguage:ne,isCyrillicRelatedInterface:ue,logoClickable:de,logoHidden:Ve,isMobile:Be,isTouch:J,isAudioDisabled:Le,isLiveCatchUpMode:Z,fullScreenTarget:N,failoverHosts:Re,canDownload:we,callbacks:se,interactiveData:Ne,showThumbTimer:pe,additionalButtons:D=[],additionalSettingsMenuItems:ce=[],additionalContextMenuItems:Pe=[],repeat:Ye,saveRate:dt,volumeMultiplier:Ae,showEndScreen:xe,showAutoplayNext:Me}=Yd(this.videoConfig,i),{sources:st,title:mt,thumbUrl:ot,unitedVideoId:Dt,isClip:at=!1,duration:vt,adsParams:Kt={},videoEpisodes:Qt,previewThumbsData:De,subtitles:re,live:Q}=e,ae=Ls(Ls({},U),Kt),fe=this.getNextVideoInfo(),Te={sources:st,title:mt,thumbUrl:ot,subtitles:re,unitedVideoId:Dt,isClip:at,live:Q,albumId:$,statPlace:w,autoplay:I,muted:A,volume:P,fromTime:E,canRewindLive:T,showAds:z,adsSlotId:j,adsParams:ae,adsPreviewParam:X,adsAutoplayParam:ee,duration:vt,logoClickable:de,logoHidden:Ve,isTouch:J!=null?J:Be,repeat:Ye,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:fe.nextVideoTitle,endScreenVideoThumb:fe.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist()},He={pictureInPictureApi:this.pictureInPictureApi,annotationsApi:this.annotationsApi};this.log({message:`create player, props: ${JSON.stringify(Te)}`});let ut=(n=this.interactiveController)==null?void 0:n.state.statistics$.getValue(),Ot,We=this.createThinOneStat(e,i);(Ot||We)&&(this.statistics=new su(Ot,We,ut==null?void 0:ut.statSubscription)),this.uiConfig.features.sentry&&this.uiConfig.sentry.dsn&&new ia(this.uiConfig.sentry,{version:Js,env:Lc},{movieId:Dt,albumId:$,place:w,autoplay:(a=I&&!this.interactiveController)!=null?a:!1,mobile:J!=null?J:Be,clip:at}),this.interactiveController&&((l=this.prevIsid)!=null||(this.prevIsid=(d=(s=this.statistics)==null?void 0:s.oneStat)==null?void 0:d.isid$.getValue())),this.sentry=Ls(Ls({},this.sentry),ia.getInstance());let et=!!Ne,wt=[],jt="tooltip_interactive_go_back_disabled_first";if(et&&this.interactiveController){let si=this.interactiveController.state.isInitialChapter$.getValue(),Ai=this.interactiveController.getHistoryState();si&&wt.push("REPLAY_BUTTON"),this.interactiveController.getIsSeekable().getValue()||wt.push("SEEK_TO_INTERACTIVE_BUTTON"),Ai.hasPrevChapter$.getValue()||(wt.push("PLAY_PREV_CHAPTER_BUTTON"),si||(Ai.isGoBackLimited$.getValue()?jt="tooltip_interactive_go_back_disabled_limit":jt="tooltip_interactive_go_back_disabled"))}let Ze=()=>{var si;this.isInited=!1,this.prevIsid=void 0;let Ai=(o==null?void 0:o.info.isEnded$.getValue())&&((si=this.interactiveController)==null?void 0:si.state.isEndChapter$.getValue());se.onReplayInteractiveVideo&&!Ai?se.onReplayInteractiveVideo():this.replayInteractiveVideo()};this.store=$1({player:o,interfaceLanguage:ne,isCyrillicRelatedInterface:ue,videoId:Dt,isClip:at,isLiveCatchUpMode:Z,isAudioDisabled:Le,statAuthToken:y,callbacks:se,webApi:He,videoEpisodes:Qt,previewThumbsData:De,canDownload:we,uiConfig:this.uiConfig,coreConfig:this.coreConfig,disabledControls:wt,isInteractive:et,saveRate:dt,interactiveRanges$:(u=this.interactiveController)==null?void 0:u.state.interactiveRanges$,isInteractiveTime$:(f=this.interactiveController)==null?void 0:f.state.isInteractiveTime$,stopPlayer:()=>this.stop(),replayInteractive:Ze,playPrevChapterDisabledTooltip:jt,hasInteractiveBranches:!!((p=(_=this.interactiveController)==null?void 0:_.getChapterBranches())!=null&&p.length),additionalButtons:this.uiConfig.features.additionalButtons?D:[],additionalSettingsMenuItems:ce!=null?ce:[],additionalContextMenuItems:Pe!=null?Pe:[],playPrevVideo:()=>this.playPrevVideo(),playNextVideo:()=>this.playNextVideo(),looped:Ye&&this.videoConfig.videos.length===1,statistics:this.statistics,internalsExposure:this.internalsExposure});let{stores:It}=this.microStoresRoot=n0(),pi=()=>{var si,Ai,Ki,Do,To,Io;if(!this.store||!this.microStoresRoot||!this.videoConfig)return;this.subscription.add(this.store.state.currentFormat$.subscribe(H=>{var Qe;return(Qe=se==null?void 0:se.onCurrentFormatChanged)==null?void 0:Qe.call(se,H)})),this.subscription.add(It.interactiveControlsOpacity$.subscribe(H=>{var Qe;H!==null&&((Qe=this==null?void 0:this.interactiveController)==null||Qe.setDisabledControls(H))})),this.subscription.add(this.store.state.throughputEstimation$.subscribe(H=>{var Qe;return(Qe=se==null?void 0:se.onThroughputEstimationChanged)==null?void 0:Qe.call(se,H)})),this.subscription.add(this.store.state.trafficSavingEnabled$.subscribe(H=>{var Qe;return(Qe=se==null?void 0:se.onTrafficSavingEnabledChanged)==null?void 0:Qe.call(se,H)})),this.subscription.add(new qi.Observable(H=>{this.store&&this.subscription.add(this.store.state.currentPlaybackRate$.subscribe(Qe=>H.next(Qe)))}).pipe(this.uiConfig.features.skipInitialPlaybackRateValue?(0,qi.skip)(1):H=>H).subscribe(H=>{var Qe;return(Qe=se==null?void 0:se.onCurrentPlaybackRateChanged)==null?void 0:Qe.call(se,H)})),this.subscription.add(this.store.state.volume$.subscribe(H=>{var Qe;return(Qe=se==null?void 0:se.onVolumeChange)==null?void 0:Qe.call(se,H)})),this.subscription.add(this.store.state.muted$.subscribe(H=>{var Qe,ai;return H?(Qe=se==null?void 0:se.onMute)==null?void 0:Qe.call(se):(ai=se==null?void 0:se.onUnmute)==null?void 0:ai.call(se)})),this.subscription.add(this.store.state.videoBitrate$.subscribe(H=>{var Qe;return(Qe=se==null?void 0:se.onVideoBitrateChanged)==null?void 0:Qe.call(se,H)})),this.subscription.add(this.store.state.isInteractiveTime$.subscribe(H=>{var Qe;let ai=(Qe=this.store)==null?void 0:Qe.ui.controls.disabledControls$;ai&&(H&&!ai.includes(Jl)&&ai.add(Jl),H||ai.remove(Jl))})),this.subscription.add(this.store.ui.isFullscreen.subscribe(H=>ku(this,null,function*(){var Qe;if(!oc.clientChecker.browser.isSamsungBrowser||!H||!this.interactiveController)return;document.fullscreenElement===this.shadowRootContainer&&(yield this.replayInteractiveChapter((Qe=this.videoConfig)==null?void 0:Qe.callbacks.onExternalFullscreenExit))}))),this.statistics&&this.statistics.oneStat&&this.subscription.add(this.statistics.oneStat.vsid$.subscribe(H=>{var Qe;return(Qe=se==null?void 0:se.onVSIDChanged)==null?void 0:Qe.call(se,H)})),this.initMediaSession(),O(kn,_e({interactiveController:this.interactiveController,interactiveContainer:this.interactiveContainer,sources:st,store:this.store,microStoresRoot:this.microStoresRoot,videoConfig:this.videoConfig,uiConfig:this.uiConfig,title:mt,thumbUrl:ot,subtitles:re,live:Q,preload:S,autoplay:I,muted:A,volume:P,fromTime:E,canRewindLive:T,supportLink:R,showAds:z,adsSlotId:j,adsParams:ae,adsPreviewParam:X,adsAutoplayParam:ee,duration:vt,logoClickable:de,logoHidden:Ve,isMobile:J!=null?J:Be,failoverHosts:Re,fullScreenTarget:N,saveRate:dt,shadowRootContainer:this.shadowRootContainer,showMiniTimer:pe,outerContainerRef:this.rootContainer,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:fe.nextVideoTitle,endScreenVideoThumb:fe.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist(),playPrevChapter:()=>this.playPrevChapter(),seekToInteractive:()=>this.seekToInteractive(),volumeMultiplier:Ae,showEndScreen:xe,showAutoplayNext:Me}));let Oo={target:this.playerContainer,props:r(kn)};this.svelteRootComponent=ns(Jm,Oo),this.addPlayerInfoSubscriptions(),this.isInited||(this.isInited=!0,(Ki=(Ai=(si=this.videoConfig)==null?void 0:si.callbacks)==null?void 0:Ai.onInited)==null||Ki.call(Ai)),(Do=this.internalsExposure)==null||Do.expose({player:this,videoConfig:this.videoConfig,coreConfig:this.coreConfig,uiConfig:this.uiConfig,statisticsConfig:this.statisticsConfig,logger:this.logger,log:this.log}),this.uiConfig.devNullLog&&((Io=(To=this.videoConfig)==null?void 0:To.callbacks)!=null&&Io.onDevNullLog)?gl.devNull.subscribe("ui",this.videoConfig.callbacks.onDevNullLog):gl.devNull.destroy("ui")};this.coreConfig.asyncResolveClientChecker?oc.clientChecker.isInited$.subscribe(si=>{si&&(console.log("UI SDK async start"),pi())}):pi()}addPlayerInfoSubscriptions(){var e,i;let o=this.store,n=(e=this.microStoresRoot)==null?void 0:e.stores;if(!o||!n)return;let a=(i=this.videoConfig)==null?void 0:i.callbacks;a&&this.subscription.add(o.playerPhase.subscribe(d=>{var l;return(l=a.onPlayerPhaseChanged)==null?void 0:l.call(a,d)})).add(o.state.playbackState$.subscribe(d=>{var l;return d&&((l=a.onPlaybackStateChanged)==null?void 0:l.call(a,d))})).add(o.state.isLive$.subscribe(d=>{var l;return(l=a.onIsLiveChanged)==null?void 0:l.call(a,d)})).add(o.state.isActiveLive$.subscribe(d=>{var l;return(l=a.onIsActiveLiveChanged)==null?void 0:l.call(a,d)})).add(o.state.isAudioAvailable$.subscribe(d=>{var l;return(l=a.onIsAudioAvailableChanged)==null?void 0:l.call(a,d)})).add(o.state.currentQuality$.subscribe(d=>{var l;return(l=a.onCurrentQualityChanged)==null?void 0:l.call(a,d)})).add(o.state.availableQualities$.subscribe(d=>{var l;return(l=a.onAvailableQualitiesChanged)==null?void 0:l.call(a,d.map(({value:u})=>u).filter(u=>u!=="auto"))})).add(o.state.availableAudioStreams$.subscribe(d=>{d.length>1&&a.onAudioLanguagesAvailable&&a.onAudioLanguagesAvailable()})).add(n.pictureInPicture$.isActive$.subscribe(d=>{var l,u;return d?(l=a.onPiPEnter)==null?void 0:l.call(a):(u=a.onPiPExit)==null?void 0:u.call(a)}));let s=a==null?void 0:a.uiInfo;s&&this.subscription.add(o.ui.controlsVisible.subscribe(d=>{var l;return(l=s.onControlsVisibleChanged)==null?void 0:l.call(s,d)})).add(o.ui.isMobile.subscribe(d=>{var l;return(l=s.onIsMobileChanged)==null?void 0:l.call(s,d)})).add(o.ui.playerSize.subscribe(d=>{var l;return(l=s.onPlayerSizeChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.prevButton.subscribe(d=>{var l;return(l=s.onPrevButtonChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.playButton.subscribe(d=>{var l;return(l=s.onPlayButtonChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.replayButton.subscribe(d=>{var l;return(l=s.onReplayButtonChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.nextButton.subscribe(d=>{var l;return(l=s.onNextButtonChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.playPrevChapterButton.subscribe(d=>{var l;return(l=s.onPlayPrevChapterChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.seekToInteractiveButton.subscribe(d=>{var l;return(l=s.onSeekToInteractiveButtonChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.interactiveGraphButton.subscribe(d=>{var l;return(l=s.onGraphButtonChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.liveButton.subscribe(d=>{var l;return(l=s.onLiveButtonChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.time.subscribe(d=>{var l;return(l=s.onTimeUpdateChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.episodes.subscribe(d=>{var l;return(l=s.onEpisodesChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.subtitles.subscribe(d=>{var l;return(l=s.onSubtitlesChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.settings.subscribe(d=>{var l;return(l=s.onSettingsChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.fullscreen.subscribe(d=>{var l;return(l=s.onFullscreenChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.chromecast.subscribe(d=>{var l;return(l=s.onChromecastChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.pip.subscribe(d=>{var l;return(l=s.onPipChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.vkLogo.subscribe(d=>{var l;return(l=s.onVkLogoChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.interactiveTimeIndicator.subscribe(d=>{var l;return(l=s.onInteractiveTimeIndicatorChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.timeline.subscribe(d=>{var l;return(l=s.onTimelineChanged)==null?void 0:l.call(s,d)}))}playNextVideo(){this.videoConfig&&(this.currentPlayingVideoIndex++,this.currentPlayingVideoIndex>=this.videoConfig.videos.length&&(this.currentPlayingVideoIndex=0),this.log({message:`play next video, index: ${this.currentPlayingVideoIndex}`}),this.createPlayerWithCurrentVideo())}playPrevVideo(){this.videoConfig&&(this.currentPlayingVideoIndex--,this.currentPlayingVideoIndex<0&&(this.currentPlayingVideoIndex=this.videoConfig.videos.length-1),this.log({message:`play prev video, index: ${this.currentPlayingVideoIndex}`}),this.createPlayerWithCurrentVideo())}createPlayerWithCurrentVideo(e,i=!0){if(!this.videoConfig)return;let o=this.videoConfig.videos[this.currentPlayingVideoIndex];if(!o){this.log({message:"no next video"});return}this.isInited&&(0,qi.isNonNullable)(o.unitedVideoId)&&this.store.actions.internal.nextMovie(o.unitedVideoId),this.unmountComponent(this.svelteRootComponent),this.createPlayer(o,{autoplay:i,fromTime:0},e)}playPrevChapter(){var e;(e=this.interactiveController)==null||e.playPrevChapter()}seekToInteractive(){var e;let i=(e=this.interactiveController)==null?void 0:e.getNextInteractiveStartTime();typeof i=="number"&&this.seekTime(i/1e3)}initInteractives(){return ku(this,null,function*(){var e,i,o,n;if((e=this.videoConfig)!=null&&e.interactiveData)try{let{Interactives:a}=yield import("@vkontakte/videoplayer-interactive/es2015");this.interactiveContainer=document.createElement("div"),this.interactiveContainer.classList.add("interactive-root");let s=(i=this.store)==null?void 0:i.interfaceLanguage$,d=s?Se(s):this.videoConfig.interfaceLanguage,{projectInfo:l,initChapterId:u,historyApi:f,videoLoader:_}=this.videoConfig.interactiveData;this.interactiveController=new a({parentElement:this.interactiveContainer,fullscreenTargetElement:this.playerContainer,lang:d,graph:this.uiConfig.features.interactiveGraph,projectInfo:l,initChapterId:u,historyApi:f,vkVideoLoader:_,lastFrame:this.uiConfig.features.interactiveLastFrame,permanentTextControls:this.uiConfig.features.interactiveTextPermanent,interactiveTimeOpenUri:this.uiConfig.features.interactiveTimeOpenUri,initSeamless:!0,config:this.uiConfig.interactive,coreConfig:this.coreConfig,createOneStat:this.createOneStat,animationsFeatureToggles:{areaControlShadow:this.uiConfig.features.interactiveAreaControlShadow,controlsExpectTimeBlinkAnimation:this.uiConfig.features.interactiveControlsExpectTimeBlinkAnimation}});let{isInteractiveExpectation$:p,isSeekable$:$}=this.interactiveController.state;this.uiConfig.features.seekToInteractive&&this.subscription.add($.subscribe(y=>{if(!this.isInited)return;let S=this.store;y?S.ui.controls.disabledControls$.remove("SEEK_TO_INTERACTIVE_BUTTON"):S.ui.controls.disabledControls$.add("SEEK_TO_INTERACTIVE_BUTTON")})),this.subscription.add(p.subscribe(y=>{this.store&&this.store.state.isInteractiveExpectation$.set(y)}));let w=!0;if(this.subscription.add(this.interactiveController.events.playerChanged$.subscribe(y=>{if(!this.videoConfig)return;this.videoConfig.videos[this.currentPlayingVideoIndex]=_x(Ls({},y.config),{title:(l==null?void 0:l.title)||y.config.title});let S=w?this.videoConfig.autoplay:!0;this.createPlayerWithCurrentVideo(y.player,S),w&&(w=!1)})),this.interactiveSubscription.add(this.interactiveController.events.interactiveActionChoice$.subscribe(({type:y,actionType:S})=>{var I,P,A,E,T,R;if(!this.store||!this.microStoresRoot)return;let z=p.getValue();if(y==="action-choice"&&S==="setRandomBranch"&&(this.microStoresRoot.stores.graphIsOpened$.set(!1),this.store.ui.controls.disabledControls$.remove(ed)),y==="action-choice-canceled"){let j=Se(this.store.state.isPlaying$)||z;if(((A=(I=this.videoConfig)==null?void 0:I.isTouch)!=null?A:(P=this.videoConfig)!=null&&P.isMobile)&&j){this.store.ui.interactiveHideMobileControls.set(!0);return}(R=(E=this.videoConfig)==null?void 0:(T=E.callbacks).onDisabledInteractiveClick)==null||R.call(T)}})),this.interactiveSubscription.add(this.interactiveController.events.interactiveContainerFakeRemoved$.subscribe(({type:y,removeAllOpenURI:S})=>{this.store&&y==="container-fake-removed"&&S&&this.store.ui.controls.disabledControls$.remove(ed)})),yield this.interactiveController.setManifest(this.videoConfig.interactiveData.manifest),(n=(o=this.videoConfig)==null?void 0:o.callbacks)!=null&&n.onInteractiveHistoryChanged){let y=this.interactiveController.getHistoryState();this.subscription.add(y.history$.subscribe(S=>{var I,P,A;S.length&&((A=(P=(I=this.videoConfig)==null?void 0:I.callbacks)==null?void 0:P.onInteractiveHistoryChanged)==null||A.call(P,S))}))}this.uiConfig.features.interactiveTimeIndicator&&this.subscription.add(this.interactiveController.events.noInteraction$.subscribe(()=>{var y,S,I,P;(y=this.microStoresRoot)==null||y.stores.showInteractiveTimeIndicatorTooltip$.set(!0,!0),(P=(S=this.videoConfig)==null?void 0:(I=S.callbacks).onInteractiveTimeIndicatorClick)==null||P.call(I)})),this.interactiveSubscription.add(this.interactiveController.events.error$.subscribe(y=>{this.log({message:y.toString()})}))}catch(a){this.log({message:a.message})}})}initPlayer(e,i={}){var o,n,a,s,d,l,u,f,_,p,$,w,y,S,I,P,A,E,T,R,z,j,U,X,ee,ne;if(!Array.isArray(e.videos)||e.videos.length===0&&!e.interactiveData)throw new Error("empty videos");if(this.videoConfig=Yd(bx,(0,qi.cloneDeepWith)(e,ue=>ue instanceof HTMLElement?ue:void 0)),this.uiConfig=eh((o=i.ui)!=null?o:{}),this.coreConfig=(n=i.core)!=null?n:{configName:[]},this.statisticsConfig=(a=i.statistics)!=null?a:{},this.uiConfig.features.forcePlayerDisplayBlock&&(this.rootContainer.style.minHeight="unset",this.style.display="block",this.style.width="100%",this.style.height="100%"),this.sentry={config:(s=this.uiConfig.sentry)!=null?s:{}},this.uiConfig.features.exposeInternalsToGlobal&&((d=this.internalsExposure)!=null||(this.internalsExposure=new qi.InternalsExposure("UI"))),gl.devNull.push("ui",{key:"videoplayer_embed",strings:["new","player_init_player","ads.enable: "+this.uiConfig.ads.enable,"showAds: "+((l=this.videoConfig)==null?void 0:l.showAds)],numbers:[(0,s0.now)()]}),(0,qi.isNonNullable)(this.videoConfig.isMediaSessionEnabled)&&(this.uiConfig.features.mediaSession=(f=(u=this.uiConfig.features.mediaSession)!=null?u:this.videoConfig.isMediaSessionEnabled)!=null?f:!0),(0,qi.isNonNullable)(this.videoConfig.isPictureInPictureEnabled)&&(this.uiConfig.features.pip=(p=(_=this.uiConfig.features.pip)!=null?_:this.videoConfig.isPictureInPictureEnabled)!=null?p:!0,this.uiConfig.features.dpip=(w=($=this.uiConfig.features.dpip)!=null?$:this.videoConfig.isPictureInPictureEnabled)!=null?w:!0),this.videoConfig.isTouch=(S=(y=this.uiConfig.isMobile)!=null?y:this.videoConfig.isTouch)!=null?S:this.videoConfig.isMobile,(I=this.videoConfig).autoplay&&(I.autoplay=this.uiConfig.features.autoplay),this.videoConfig.showAds=(P=this.uiConfig.ads.enable)!=null?P:this.videoConfig.showAds,this.videoConfig.adsSlotId=(A=this.uiConfig.ads.slot)!=null?A:this.videoConfig.adsSlotId,this.videoConfig.adsPreviewParam=(E=this.uiConfig.ads.preview)!=null?E:this.videoConfig.adsPreviewParam,this.videoConfig.logoHidden=!((T=this.uiConfig.showLogo)!=null?T:!this.videoConfig.logoHidden),(R=this.videoConfig).canRewindLive&&(R.canRewindLive=this.uiConfig.features.liveRewind),this.videoConfig.supportLink=(z=this.videoConfig.supportLink)!=null?z:this.uiConfig.supportLink,this.videoConfig.showEndScreen=(j=this.uiConfig.features.endScreen)!=null?j:this.videoConfig.showEndScreen,this.videoConfig.showAutoplayNext=(U=this.uiConfig.features.autoplayNext)!=null?U:this.videoConfig.showAutoplayNext,this.videoConfig.showNextPrevButtons=(X=this.uiConfig.features.nextPrevButtons)!=null?X:this.videoConfig.showNextPrevButtons,this.currentPlayingVideoIndex=this.videoConfig.videoIndex&&((ee=this.videoConfig.videos)!=null&&ee[this.videoConfig.videoIndex])?this.videoConfig.videoIndex:0,this.needToRepeatPlaylist=this.videoConfig.repeat,this.uiConfig.features.pip){let ue={enabled:this.videoConfig.pipEnabled};this.uiConfig.features.dpip?this.pictureInPictureApi=xu.getLatestSupportedVersion(ue):this.pictureInPictureApi=new oa(ue)}this.mediaSessionApi=this.uiConfig.features.mediaSession?new $u:void 0,this.slotsApi=this.uiConfig.features.slots?new gu:void 0,this.annotationsApi=this.uiConfig.features.annotations?new wu(this.uiConfig.features.annotationsInside):void 0,this.annotationsApi&&!this.uiConfig.features.annotationsInside&&this.annotationsApi.init(this.rootContainer),(ne=this.slotsApi)==null||ne.init(this.shadowRootContainer),this.unmountComponent(this.svelteStubComponent),this.unmountComponent(this.svelteRootComponent),this.isInited=!1,this.prevIsid=void 0,this.interactiveController&&(this.interactiveController.destroy(),this.interactiveController=void 0,this.interactiveSubscription.unsubscribe()),this.videoConfig.interactiveData?this.initInteractives():this.createPlayer(this.videoConfig.videos[this.currentPlayingVideoIndex]),X1(this.pictureInPictureApi)&&this.pictureInPictureApi.setPlayerDomElement(this.playerContainer,this._shadowRoot)}isOneVideoPlaylist(){return this.videoConfig?this.videoConfig.videos.length===1:!1}updateVideos(e,i){if(!this.videoConfig)return;this.log({message:`update ${i} videos, videos: ${JSON.stringify(e)}`}),i==="prev"?(this.videoConfig.videos.splice(0,this.currentPlayingVideoIndex),this.videoConfig.videos.unshift(...e),this.currentPlayingVideoIndex=e.length):i==="next"&&(this.videoConfig.videos.splice(this.currentPlayingVideoIndex+1),this.videoConfig.videos.push(...e));let o=this.getNextVideoInfo();r(kn)&&(r(kn).showNextPrevButtons=this.needToShowNextPrevButtons(),r(kn).nextButtonActive=this.isNextButtonActive(),r(kn).prevButtonActive=this.isPrevButtonActive(),r(kn).endScreenVideoTitle=o.nextVideoTitle,r(kn).endScreenVideoThumb=o.nextVideoThumb,r(kn).isOneVideoPlaylist=this.isOneVideoPlaylist())}updatePrevVideos(e){this.updateVideos(e,"prev")}updateNextVideos(e){this.updateVideos(e,"next")}initMediaSession(){var e,i;this.mediaSessionApi&&((e=this.unsubscribePlayerPhaseSubscription)==null||e.call(this),this.mediaSessionApi.clearSubscriptions(),this.unsubscribePlayerPhaseSubscription=(i=this.store)==null?void 0:i.playerPhase.subscribe(o=>{o==="video"?this.setupMediaSessionForVideo():o==="ads"&&this.setupMediaSessionForAds()}))}setupMediaSessionForVideo(){if(!(!this.videoConfig||!this.mediaSessionApi))try{let{title:e,thumbUrl:i}=Ls({},this.videoConfig.videos[this.currentPlayingVideoIndex]),o=[["play",()=>this.play()],["pause",()=>this.pause()],["seekto",n=>this.seekTime(n.seekTime)]];this.videoConfig.videos.length>1&&(this.currentPlayingVideoIndex<this.videoConfig.videos.length-1&&o.push(["nexttrack",()=>this.playNextVideo()]),this.currentPlayingVideoIndex>0&&o.push(["previoustrack",()=>this.playPrevVideo()])),this.mediaSessionApi.setMetaData({title:e,thumbUrl:i}),this.mediaSessionApi.updateActionHandlers(o),this.mediaSessionApi.attachToStore(this.store)}catch(e){this.log({message:e.message})}}setupMediaSessionForAds(){if(!(!this.videoConfig||!this.mediaSessionApi))try{let e="\u0420\u0435\u043A\u043B\u0430\u043C\u0430",i=[["play",()=>this.play()],["pause",()=>this.pause()]];this.mediaSessionApi.setMetaData({title:e}),this.mediaSessionApi.updateActionHandlers(i),this.mediaSessionApi.attachToStore(this.store)}catch(e){this.log({message:e.message})}}play(){var e,i,o,n;this.isControlDisabled("PLAY_BUTTON")||(e=this.store)!=null&&e.playerPhase.is("LiveWaitingStart")||(i=this.store)!=null&&i.playerPhase.is("LiveWaitingRecover")||(o=this.store)!=null&&o.playerPhase.is("LiveWaitingRecord")||(this.log({message:"play"}),(n=this.svelteRootComponent)==null||n.play())}pause(){var e;this.log({message:"pause"}),(e=this.svelteRootComponent)==null||e.pause()}stop(){var e;if(!this.videoConfig)return;this.log({message:"stop"});let i=!!this.interactiveController;i&&(this.interactiveController.destroy(),this.interactiveController=void 0,this.interactiveContainer=void 0,this.interactiveSubscription.unsubscribe()),this.unmountComponent(this.svelteStubComponent),(e=this.mediaSessionApi)==null||e.destroy();let o=this.videoConfig.videos[0];o&&(this.unmountComponent(this.svelteRootComponent),i?(this.videoConfig.autoplay=!1,this.initInteractives()):this.createPlayer(o))}setMuted(e){var i;this.log({message:`set muted, muted: ${e}`}),(i=this.svelteRootComponent)==null||i.setMuted(e)}setPiPEnabled(e){var i,o;(o=(i=this.store)==null?void 0:i.webApi.pictureInPictureApi)==null||o.setEnabled(e)}setVolume(e){var i;this.log({message:`set volume, volume: ${e}`}),(i=this.svelteRootComponent)==null||i.setVolume(e)}setRepeat(e){this.log({message:`set repeat, repeat: ${e}`}),this.needToRepeatPlaylist=e,r(kn)&&(r(kn).needToRepeatPlaylist=this.needToRepeatPlaylist,r(kn).showNextPrevButtons=this.needToShowNextPrevButtons(),r(kn).nextButtonActive=this.isNextButtonActive(),r(kn).prevButtonActive=this.isPrevButtonActive())}seekTime(e){var i;this.isControlDisabled("TIMELINE")||(this.log({message:`seek time, time: ${e}`}),(i=this.svelteRootComponent)==null||i.seekTime(e))}seekEpisodeStartTime(e){var i;this.log({message:`seek episode start time, time: ${e}`}),(i=this.svelteRootComponent)==null||i.seekEpisodeStartTime(e)}returnFocusToEpisodes(){var e;this.log({message:"return focus to episodes button"}),(e=this.svelteRootComponent)==null||e.returnFocusToEpisodes()}setPlaybackRate(e){var i;this.log({message:`set playback rate to: ${e}`}),(i=this.svelteRootComponent)==null||i.setPlaybackRate(e)}setAutoQualityLimits(e){var i,o,n;this.log({message:`set auto quality limitation. Max: ${(i=e.max)!=null?i:"none"}. Min: ${(o=e.min)!=null?o:"none"}`}),(n=this.svelteRootComponent)==null||n.setAutoQualityLimits(e)}addLanguage(e){var i;(i=this.store)==null||i.actions.internal.addLanguage(e)}setLanguage(e){return ku(this,null,function*(){var i;yield(i=this.store)==null?void 0:i.actions.internal.setLanguage(e)})}setLiveStart(e){var i,o;this.log({message:"live started"}),(i=this.store)==null||i.actions.internal.setLiveWaitingRecover(!1),(o=this.store)==null||o.actions.internal.setLiveWaitingStart(!1),this.unmountComponent(this.svelteRootComponent),this.createPlayer(e,{autoplay:!0})}setLiveWaitingRecover(){var e;this.log({message:"live waiting"}),(e=this.store)!=null&&e.callbacks&&(this.store.callbacks.onLiveEnded=()=>{var i,o;(i=this.store)==null||i.actions.internal.setLiveWaitingRecover(!0),(o=this.store)==null||o.destroy()})}setLiveWaitingRecord(){var e;this.log({message:"post live"}),(e=this.store)!=null&&e.callbacks&&(this.store.callbacks.onLiveEnded=()=>{var i,o;(i=this.store)==null||i.actions.internal.setLiveWaitingRecord(!0),(o=this.store)==null||o.destroy()})}setLiveEnd(e){var i;this.log({message:"live ended"}),(i=this.store)!=null&&i.callbacks&&(this.store.callbacks.onLiveEnded=()=>{var o,n;(o=this.store)==null||o.actions.internal.setLiveWaitingRecover(!1),(n=this.store)==null||n.actions.internal.setLiveWaitingRecord(!1),this.unmountComponent(this.svelteRootComponent),this.createPlayer(e,{autoplay:!1})})}setLiveLowLatency(e){var i;this.log({message:"live switch to low latency "+e}),(i=this.store)==null||i.actions.external.setLiveLowLatency(e)}getDeviceId(){var e,i,o;return(o=(i=(e=this.statistics)==null?void 0:e.oneStat)==null?void 0:i.getDeviceId())!=null?o:void 0}replayInteractiveVideo(){this.interactiveController&&this.interactiveController.setChapter()}replayInteractiveChapter(e){return ku(this,null,function*(){var i,o;if(this.interactiveController&&((i=this.store)!=null&&i.state.positionExact$)){let n=Se(this.store.state.positionExact$),s=Se(this.store.state.interactiveEpisodes$).find(l=>!l.completed);this.interactiveController.events.playerChanged$.pipe((0,qi.once)()).subscribe(()=>{s&&n>=s.time?this.seekTime(s.time):this.seekTime(n),e==null||e()});let d=this.interactiveController.getCurrentChapter();yield this.interactiveController.setChapter({chapterId:(o=d==null?void 0:d.chapter)==null?void 0:o.id,pushToHistory:!1})}})}showInteractiveIndicatorTooltip(e,i=!1){var o;(o=this.microStoresRoot)==null||o.stores.showInteractiveTimeIndicatorTooltip$.set(e,i)}switchToActiveLive(){var e;(e=this.store)==null||e.actions.internal.switchToActiveLive()}updateAdditionalSettingsItem(e,i){var o;(o=this.store)==null||o.actions.external.updateAdditionalSettingsItem(e,i)}addAdditionalSettingsItem(e){var i;(i=this.store)==null||i.actions.external.addAdditionalSettingsItem(e)}removeAdditionalSettingsItem(e){var i;(i=this.store)==null||i.actions.external.removeAdditionalSettingsItem(e)}updateAdditionalContextItem(e,i){var o;(o=this.store)==null||o.actions.external.updateAdditionalContextItem(e,i)}addAdditionalContextItem(e){var i;(i=this.store)==null||i.actions.external.addAdditionalContextItem(e)}removeAdditionalContextItem(e){var i;(i=this.store)==null||i.actions.external.removeAdditionalContextItem(e)}updateAdditionalButton(e,i){var o;(o=this.store)==null||o.actions.external.updateAdditionalButton(e,i)}addAdditionalButton(e){var i;(i=this.store)==null||i.actions.external.addAdditionalButton(e)}removeAdditionalButton(e){var i;(i=this.store)==null||i.actions.external.removeAdditionalButton(e)}updateStatContext(e){this.statistics&&(this.statistics.oneStat&&this.statistics.oneStat.updateContext(e),this.statistics.thinOneStat&&this.statistics.thinOneStat.updateContext(e))}handleTimerNextVideo(e){var i;(i=this.store)==null||i.actions.internal.setTimerNextVideoRunning(e)}focus(){var e,i,o;(o=(i=(e=this.svelteRootComponent)==null?void 0:e.keyboardControls)==null?void 0:i.focus)==null||o.call(i)}unmountComponent(e){e&&Ys(e)}};var hl=require("@vkontakte/videoplayer-shared/es2015"),Au=require("@vkontakte/videoplayer-core/es2015"),$x=()=>{window.customElements.define("vk-video-player",Eu)};
|