@vkontakte/videoplayer 1.1.72-dev.c0dc5218.0 → 1.1.72
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 +19 -19
- package/es2015.esm.js +19 -19
- 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/es2018.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/videoplayer v1.1.72
|
|
3
|
-
*
|
|
2
|
+
* @vkontakte/videoplayer v1.1.72
|
|
3
|
+
* Tue, 23 Sep 2025 10:50:27 GMT
|
|
4
4
|
* https://st.mycdn.me/static/vkontakte-videoplayer/1-1-72/doc/
|
|
5
5
|
*/
|
|
6
6
|
var h0=Object.defineProperty;var gv=t=>{throw TypeError(t)};var _0=(t,e,i)=>e in t?h0(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var Gn=(t,e,i)=>_0(t,typeof e!="symbol"?e+"":e,i),Wu=(t,e,i)=>e.has(t)||gv("Cannot "+i);var ki=(t,e,i)=>(Wu(t,e,"read from private field"),i?i.call(t):e.get(t)),Cs=(t,e,i)=>e.has(t)?gv("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),La=(t,e,i,o)=>(Wu(t,e,"write to private field"),o?o.call(t,i):e.set(t,i),i),hv=(t,e,i)=>(Wu(t,e,"access private method"),i);var Ts="[",Es="[!",Ks="]",Yr={};var Yi=Symbol(),Pn=Symbol("filename"),_v=Symbol("hmr"),bv="http://www.w3.org/1999/xhtml",sc="http://www.w3.org/2000/svg";var Ku="@attach";var ac=!0;var yv,xv,$v=(xv=(yv=globalThis.process)==null?void 0:yv.env)==null?void 0:xv.NODE_ENV,Me=$v&&!$v.toLowerCase().startsWith("prod");var jn=Array.isArray,wv=Array.prototype.indexOf,$l=Array.from,qu=Object.keys,ro=Object.defineProperty,Yo=Object.getOwnPropertyDescriptor,lc=Object.getOwnPropertyDescriptors,Qu=Object.prototype,Sv=Array.prototype,qs=Object.getPrototypeOf,Gu=Object.isExtensible;function Is(t){return typeof t=="function"}var de=()=>{};function Cv(t){return t()}function ks(t){for(var e=0;e<t.length;e++)t[e]()}var Bo=Symbol("$state"),Va=Symbol("legacy props"),Tv=Symbol(""),dc=Symbol("proxy path"),cc=1,Ra=3,Yn=8;function uc(t){return t===this.v}function Na(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function Ev(t,e){return t!==e}function Oa(t){return!Na(t,this.v)}function Iv(){if(Me){let t=new Error(`derived_references_self
|
|
@@ -41,7 +41,7 @@ ${n}
|
|
|
41
41
|
`}),t.stack&&ro(t,"stack",{value:t.stack.split(`
|
|
42
42
|
`).filter(a=>!a.includes("svelte/src/internal")).join(`
|
|
43
43
|
`)})}}var ea=!1,Qa=null,ta=!1,ds=!1;function rp(t){ds=t}var Nl=[],Ol=[],Ct=null,er=!1;function Bi(t){Ct=t}var gt=null;function so(t){gt=t}var Fo=null;function vc(t){Ct!==null&&Ct.f&2097152&&(Fo===null?Fo=[Ct,[t]]:Fo[1].push(t))}var hn=null,tr=0,Jn=null;function Wv(t){Jn=t}var dg=1,Sc=0,cs=!1,Cc=null;function Cl(){return++dg}function Ys(t){var v,u;var e=t.f;if((e&2048)!==0)return!0;if((e&4096)!==0){var i=t.deps,o=(e&256)!==0;if(i!==null){var n,s,l=(e&512)!==0,d=o&>!==null&&!cs,a=i.length;if(l||d){var p=t,f=p.parent;for(n=0;n<a;n++)s=i[n],(l||!((v=s==null?void 0:s.reactions)!=null&&v.includes(p)))&&((u=s.reactions)!=null?u:s.reactions=[]).push(p);l&&(p.f^=512),d&&f!==null&&(f.f&256)===0&&(p.f^=256)}for(n=0;n<a;n++)if(s=i[n],Ys(s)&&np(s),s.wv>t.wv)return!0}(!o||gt!==null&&!cs)&&mn(t,1024)}return!1}function cg(t,e,i=!0){var o=t.reactions;if(o!==null)for(var n=0;n<o.length;n++){var s=o[n];Fo!=null&&Fo[1].includes(t)&&Fo[0]===Ct||((s.f&2)!==0?cg(s,e,!1):e===s&&(i?mn(s,2048):(s.f&1024)!==0&&mn(s,4096),El(s)))}}function mc(t){var y,w;var e=hn,i=tr,o=Jn,n=Ct,s=cs,l=Fo,d=Vt,a=er,p=t.f;hn=null,tr=0,Jn=null,cs=(p&256)!==0&&(er||!ta||Ct===null),Ct=(p&96)===0?t:null,Fo=null,xl(t.ctx),er=!1,Sc++,t.f|=2097152;try{var f=(0,t.fn)(),v=t.deps;if(hn!==null){var u;if(Ll(t,tr),v!==null&&tr>0)for(v.length=tr+hn.length,u=0;u<hn.length;u++)v[tr+u]=hn[u];else t.deps=v=hn;if(!cs||(p&2)!==0&&t.reactions!==null)for(u=tr;u<v.length;u++)((w=(y=v[u]).reactions)!=null?w:y.reactions=[]).push(t)}else v!==null&&tr<v.length&&(Ll(t,tr),v.length=tr);if(Jr()&&Jn!==null&&!er&&v!==null&&(t.f&6146)===0)for(u=0;u<Jn.length;u++)cg(Jn[u],t);return n!==null&&n!==t&&(Sc++,Jn!==null&&(o===null?o=Jn:o.push(...Jn))),f}catch(x){sg(x)}finally{hn=e,tr=i,Jn=o,Ct=n,cs=s,Fo=l,xl(d),er=a,t.f^=2097152}}function T0(t,e){let i=e.reactions;if(i!==null){var o=wv.call(i,t);if(o!==-1){var n=i.length-1;n===0?i=e.reactions=null:(i[o]=i[n],i.pop())}}i===null&&(e.f&2)!==0&&(hn===null||!hn.includes(e))&&(mn(e,4096),(e.f&768)===0&&(e.f^=512),fc(e),Ll(e,0))}function Ll(t,e){var i=t.deps;if(i!==null)for(var o=e;o<i.length;o++)T0(t,i[o])}function Wa(t){var e=t.f;if((e&16384)===0){mn(t,1024);var i=gt,o=ta;if(gt=t,ta=!0,Me){var n=Zn;wl(t.component_function)}try{(e&16)!==0?tg(t):dp(t),lp(t);var s=mc(t);if(t.teardown=typeof s=="function"?s:null,t.wv=dg,Me&&Xr&&(t.f&2048)!==0&&t.deps!==null)for(var l of t.deps)l.set_during_effect&&(l.wv=Cl(),l.set_during_effect=!1);Me&&Ol.push(t)}finally{ta=o,gt=i,Me&&wl(n)}}}function ag(){console.error("Last ten effects were: ",Ol.slice(-10).map(t=>t.fn)),Ol=[]}function E0(){try{Mv()}catch(t){if(Me&&ro(t,"stack",{value:""}),Qa!==null)if(Me)try{Rl(t,Qa)}catch(e){throw ag(),e}else Rl(t,Qa);else throw Me&&ag(),t}}function vp(){var t=ta;try{var e=0;for(ta=!0;Nl.length>0;){e++>1e3&&E0();var i=Nl,o=i.length;Nl=[];for(var n=0;n<o;n++){var s=k0(i[n]);I0(s)}Ua.clear()}}finally{ea=!1,ta=t,Qa=null,Me&&(Ol=[])}}function I0(t){var e=t.length;if(e!==0)for(var i=0;i<e;i++){var o=t[i];(o.f&24576)===0&&Ys(o)&&(Wa(o),o.deps===null&&o.first===null&&o.nodes_start===null&&(o.teardown===null?up(o):o.fn=null))}}function El(t){ea||(ea=!0,queueMicrotask(vp));for(var e=Qa=t;e.parent!==null;){e=e.parent;var i=e.f;if((i&96)!==0){if((i&1024)===0)return;e.f^=1024}}Nl.push(e)}function k0(t){for(var e=[],i=t;i!==null;){var o=i.f,n=(o&96)!==0,s=n&&(o&1024)!==0;if(!s&&(o&8192)===0){(o&4)!==0?e.push(i):n?i.f^=1024:Ys(i)&&Wa(i);var l=i.first;if(l!==null){i=l;continue}}var d=i.parent;for(i=i.next;i===null&&d!==null;)i=d.next,d=d.parent}return e}function Ga(t){var e;for(t&&(ea=!0,vp(),ea=!0,e=t());;){if(ng(),Nl.length===0)return ea=!1,Qa=null,Me&&(Ol=[]),e;ea=!0,vp()}}async function Co(){await Promise.resolve(),Ga()}function r(t){var e=t.f,i=(e&2)!==0;if(Cc!==null&&Cc.add(t),Ct!==null&&!er){if(!(Fo!=null&&Fo[1].includes(t))||Fo[0]!==Ct){var o=Ct.deps;t.rv<Sc&&(t.rv=Sc,hn===null&&o!==null&&o[tr]===t?tr++:hn===null?hn=[t]:(!cs||!hn.includes(t))&&hn.push(t))}}else if(i&&t.deps===null&&t.effects===null){var n=t,s=n.parent;s!==null&&(s.f&256)===0&&(n.f^=256)}if(i&&(n=t,Ys(n)&&np(n)),Me&&Xr&&!er&&yl!==null&&Ct!==null&&yl.reaction===Ct)if(t.trace)t.trace();else{var l=ls("TracedAt");if(l){var d=yl.entries.get(t);d===void 0&&(d={traces:[]},yl.entries.set(t,d));var a=d.traces[d.traces.length-1];l.stack!==(a==null?void 0:a.stack)&&d.traces.push(l)}}return ds&&Ua.has(t)?Ua.get(t):t.v}function yt(t){var e=er;try{return er=!0,t()}finally{er=e}}var P0=-7169;function mn(t,e){t.f=t.f&P0|e}function Ec(t){if(!(typeof t!="object"||!t||t instanceof EventTarget)){if(Bo in t)Tc(t);else if(!Array.isArray(t))for(let e in t){let i=t[e];typeof i=="object"&&i&&Bo in i&&Tc(i)}}}function Tc(t,e=new Set){if(typeof t=="object"&&t!==null&&!(t instanceof EventTarget)&&!e.has(t)){e.add(t),t instanceof Date&&t.getTime();for(let o in t)try{Tc(t[o],e)}catch(n){}let i=qs(t);if(i!==Object.prototype&&i!==Array.prototype&&i!==Map.prototype&&i!==Set.prototype&&i!==Date.prototype){let o=lc(i);for(let n in o){let s=o[n].get;if(s)try{s.call(t)}catch(l){}}}}}function gp(t,e){if(e){let i=document.body;t.autofocus=!0,gn(()=>{document.activeElement===i&&t.focus()})}}function Bl(t){var e=Ct,i=gt;Bi(null),so(null);try{return t()}finally{Bi(e),so(i)}}var hp=new Set,Ic=new Set;function ia(t){if(!Xe)return;t.removeAttribute("onload"),t.removeAttribute("onerror");let e=t.__e;e!==void 0&&(t.__e=void 0,queueMicrotask(()=>{t.isConnected&&t.dispatchEvent(e)}))}function _p(t,e,i,o={}){function n(s){if(o.capture||ja.call(e,s),!s.cancelBubble)return Bl(()=>i==null?void 0:i.call(this,s))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?gn(()=>{e.addEventListener(t,n,o)}):e.addEventListener(t,n,o),n}function xt(t,e,i,o,n){var s={capture:o,passive:n},l=_p(t,e,i,s);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&Do(()=>{e.removeEventListener(t,l,s)})}function lt(t){for(var e=0;e<t.length;e++)hp.add(t[e]);for(var i of Ic)i(t)}function ja(t){var E;var e=this,i=e.ownerDocument,o=t.type,n=((E=t.composedPath)==null?void 0:E.call(t))||[],s=n[0]||t.target,l=0,d=t.__root;if(d){var a=n.indexOf(d);if(a!==-1&&(e===document||e===window)){t.__root=e;return}var p=n.indexOf(e);if(p===-1)return;a<=p&&(l=a)}if(s=n[l]||t.target,s!==e){ro(t,"currentTarget",{configurable:!0,get(){return s||i}});var f=Ct,v=gt;Bi(null),so(null);try{for(var u,y=[];s!==null;){var w=s.assignedSlot||s.parentNode||s.host||null;try{var x=s["__"+o];if(x!=null&&(!s.disabled||t.target===s))if(jn(x)){var[S,...T]=x;S.apply(s,[t,...T])}else x.call(s,t)}catch(V){u?y.push(V):u=V}if(t.cancelBubble||w===e||w===null)break;s=w}if(u){for(let V of y)queueMicrotask(()=>{throw V});throw u}}finally{t.__root=e,delete t.currentTarget,Bi(f),so(v)}}}var M0;function ug(){M0=void 0}function Ya(t){var e=document.createElement("template");return e.innerHTML=t.replaceAll("<!>","<!---->"),e.content}function To(t,e){var i=gt;i.nodes_start===null&&(i.nodes_start=t,i.nodes_end=e)}function M(t,e){var i=(e&1)!==0,o=(e&2)!==0,n,s=!t.startsWith("<!>");return()=>{if(Xe)return To(ht,null),ht;n===void 0&&(n=Ya(s?t:"<!>"+t),i||(n=yi(n)));var l=o||Il?document.importNode(n,!0):n.cloneNode(!0);if(i){var d=yi(l),a=l.lastChild;To(d,a)}else To(l,l);return l}}function R0(t,e,i="svg"){var o=!t.startsWith("<!>"),n=(e&1)!==0,s=`<${i}>${o?t:"<!>"+t}</${i}>`,l;return()=>{if(Xe)return To(ht,null),ht;if(!l){var d=Ya(s),a=yi(d);if(n)for(l=document.createDocumentFragment();yi(a);)l.appendChild(yi(a));else l=yi(a)}var p=l.cloneNode(!0);if(n){var f=yi(p),v=p.lastChild;To(f,v)}else To(p,p);return p}}function Te(t,e){return R0(t,e,"svg")}function ts(t=""){if(!Xe){var e=vn(t+"");return To(e,e),e}var i=ht;return i.nodeType!==Ra&&(i.before(i=vn()),bi(i)),To(i,i),i}function We(){if(Xe)return To(ht,null),ht;var t=document.createDocumentFragment(),e=document.createComment(""),i=vn();return t.append(e,i),To(e,i),t}function $(t,e){if(Xe){gt.nodes_end=ht,Hi();return}t!==null&&t.before(e)}var N0=/\r/g;function fg(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 mg(t){return t.endsWith("capture")&&t!=="gotpointercapture"&&t!=="lostpointercapture"}var O0=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function vg(t){return O0.includes(t)}var B0=["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 D0={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 gg(t){var e;return t=t.toLowerCase(),(e=D0[t])!=null?e:t}var JS=[...B0,"formNoValidate","isMap","noModule","playsInline","readOnly","value","volume","defaultValue","defaultChecked","srcObject","noValidate","allowFullscreen","disablePictureInPicture","disableRemotePlayback"];var H0=["touchstart","touchmove"];function hg(t){return H0.includes(t)}var F0=["$state","$state.raw","$derived","$derived.by"],e9=[...F0,"$state.snapshot","$props","$props.id","$bindable","$effect","$effect.pre","$effect.tracking","$effect.root","$inspect","$inspect().with","$inspect.trace","$host"];var U0=["textarea","script","style","title"];function _g(t){return U0.includes(t)}function kc(t){return t==null?void 0:t.replace(/\//g,"/\u200B")}var Dl=!0;function Pc(t){Dl=t}function be(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 is(t,e){return bg(t,e)}function $p(t,e){var l;_c(),e.intro=(l=e.intro)!=null?l:!1;let i=e.target,o=Xe,n=ht;try{for(var s=yi(i);s&&(s.nodeType!==Yn||s.data!==Ts);)s=Uo(s);if(!s)throw Yr;ao(!0),bi(s),Hi();let d=bg(t,{...e,anchor:s});if(ht===null||ht.nodeType!==Yn||ht.data!==Ks)throw Ps(),Yr;return ao(!1),d}catch(d){if(d===Yr)return e.recover===!1&&Lv(),_c(),kl(i),ao(!1),is(t,e);throw d}finally{ao(o),bi(n),ug()}}var Za=new Map;function bg(t,{target:e,anchor:i,props:o={},events:n,context:s,intro:l=!0}){_c();var d=new Set,a=v=>{for(var u=0;u<v.length;u++){var y=v[u];if(!d.has(y)){d.add(y);var w=hg(y);e.addEventListener(y,ja,{passive:w});var x=Za.get(y);x===void 0?(document.addEventListener(y,ja,{passive:w}),Za.set(y,1)):Za.set(y,x+1)}}};a($l(hp)),Ic.add(a);var p=void 0,f=eg(()=>{var v=i!=null?i:e.appendChild(vn());return Pi(()=>{if(s){U({});var u=Vt;u.c=s}n&&(o.$$events=n),Xe&&To(v,null),Dl=l,p=t(v,o)||{},Dl=!0,Xe&&(gt.nodes_end=ht),s&&z()}),()=>{var w;for(var u of d){e.removeEventListener(u,ja);var y=Za.get(u);--y===0?(document.removeEventListener(u,ja),Za.delete(u)):Za.set(u,y)}Ic.delete(a),v!==i&&((w=v.parentNode)==null||w.removeChild(v))}});return bp.set(p,f),p}var bp=new WeakMap;function oa(t,e){let i=bp.get(t);return i?(bp.delete(t),i(e)):(Me&&Qv(),Promise.resolve())}function ye(t,e,...i){var o=t,n=de,s;Fi(()=>{n!==(n=e())&&(s&&(Di(s),s=null),Me&&n==null&&Vv(),s=Pi(()=>n(o,...i)))},65536),Xe&&(o=ht)}if(Me){let t=function(e){if(!(e in globalThis)){let i;Object.defineProperty(globalThis,e,{configurable:!0,get:()=>{if(i!==void 0)return i;Ov(e)},set:o=>{i=o}})}};q0=t,t("$state"),t("$effect"),t("$derived"),t("$inspect"),t("$props"),t("$bindable")}var q0;function Pt(t){Vt===null&&Ba("onMount"),Zr&&Vt.l!==null?K0(Vt).m.push(t):Ke(()=>{let e=yt(t);if(typeof e=="function")return e})}function Jo(t){Vt===null&&Ba("onDestroy"),Pt(()=>()=>yt(t))}function K0(t){var i;var e=t.l;return(i=e.u)!=null?i:e.u={a:[],b:[],m:[]}}var $g=new Map;function yg(t,e){var i=$g.get(t);i||(i=new Set,$g.set(t,i)),i.add(e)}function L(t,e,[i,o]=[0,0]){Xe&&i===0&&Hi();var n=t,s=null,l=null,d=Yi,a=i>0?65536:0,p=!1;let f=(u,y=!0)=>{p=!0,v(y,u)},v=(u,y)=>{if(d===(d=u))return;let w=!1;if(Xe&&o!==-1){if(i===0){let S=hc(n);S===Ts?o=0:S===Es?o=1/0:(o=parseInt(S.substring(1)),o!==o&&(o=d?1/0:-1))}let x=o>i;!!d===x&&(n=Zs(),bi(n),ao(!1),w=!0,o=-1)}d?(s?ps(s):y&&(s=Pi(()=>y(n))),l&&Vn(l,()=>{l=null})):(l?ps(l):y&&(l=Pi(()=>y(n,[i+1,o]))),s&&Vn(s,()=>{s=null})),w&&ao(!0)};Fi(()=>{p=!1,e(f),p||v(null,null)},a),Xe&&(n=ht)}function na(t,e,i){Xe&&Hi();var o=t,n=Yi,s,l=Jr()?Ev:Na;Fi(()=>{l(n,n=e())&&(s&&Vn(s),s=Pi(()=>i(o)))}),Xe&&(o=ht)}var Ms=null;function wp(t){Ms=t}function Hl(t,e){return e}function j0(t,e,i,o){for(var n=[],s=e.length,l=0;l<s;l++)xc(e[l].e,n,!0);var d=s>0&&n.length===0&&i!==null;if(d){var a=i.parentNode;kl(a),a.append(i),o.clear(),As(t,e[0].prev,e[s-1].next)}pp(n,()=>{for(var p=0;p<s;p++){var f=e[p];d||(o.delete(f.k),As(t,f.prev,f.next)),Di(f.e,!d)}})}function Si(t,e,i,o,n,s=null){var l=t,d={flags:e,items:new Map,first:null},a=(e&4)!==0;if(a){var p=t;l=Xe?bi(yi(p)):p.appendChild(vn())}Xe&&Hi();var f=null,v=!1,u=Vr(()=>{var y=i();return jn(y)?y:y==null?[]:$l(y)});Fi(()=>{var y=r(u),w=y.length;if(v&&w===0)return;v=w===0;let x=!1;if(Xe){var S=hc(l)===Es;S!==(w===0)&&(l=Zs(),bi(l),ao(!1),x=!0)}if(Xe){for(var T=null,E,V=0;V<w;V++){if(ht.nodeType===Yn&&ht.data===Ks){l=ht,x=!0,ao(!1);break}var k=y[V],I=o(k,V);E=Sg(ht,d,T,null,k,I,V,n,e,i),d.items.set(I,E),T=E}w>0&&bi(Zs())}Xe||Y0(y,d,l,n,e,o,i),s!==null&&(w===0?f?ps(f):f=Pi(()=>s(l)):f!==null&&Vn(f,()=>{f=null})),x&&ao(!0),r(u)}),Xe&&(l=ht)}function Y0(t,e,i,o,n,s,l){var ie,ue,$e,fe;var d=(n&8)!==0,a=(n&3)!==0,p=t.length,f=e.items,v=e.first,u=v,y,w=null,x,S=[],T=[],E,V,k,I;if(d)for(I=0;I<p;I+=1)E=t[I],V=s(E,I),k=f.get(V),k!==void 0&&((ie=k.a)==null||ie.measure(),(x!=null?x:x=new Set).add(k));for(I=0;I<p;I+=1){if(E=t[I],V=s(E,I),k=f.get(V),k===void 0){var R=u?u.e.nodes_start:i;w=Sg(R,e,w,w===null?e.first:w.next,E,V,I,o,n,l),f.set(V,w),S=[],T=[],u=w.next;continue}if(a&&Z0(k,E,I,n),(k.e.f&8192)!==0&&(ps(k.e),d&&((ue=k.a)==null||ue.unfix(),(x!=null?x:x=new Set).delete(k))),k!==u){if(y!==void 0&&y.has(k)){if(S.length<T.length){var Y=T[0],H;w=Y.prev;var F=S[0],W=S[S.length-1];for(H=0;H<S.length;H+=1)xg(S[H],Y,i);for(H=0;H<T.length;H+=1)y.delete(T[H]);As(e,F.prev,W.next),As(e,w,F),As(e,W,Y),u=Y,w=W,I-=1,S=[],T=[]}else y.delete(k),xg(k,u,i),As(e,k.prev,k.next),As(e,k,w===null?e.first:w.next),As(e,w,k),w=k;continue}for(S=[],T=[];u!==null&&u.k!==V;)(u.e.f&8192)===0&&(y!=null?y:y=new Set).add(u),T.push(u),u=u.next;if(u===null)continue;k=u}S.push(k),w=k,u=k.next}if(u!==null||y!==void 0){for(var J=y===void 0?[]:$l(y);u!==null;)(u.e.f&8192)===0&&J.push(u),u=u.next;var G=J.length;if(G>0){var ce=(n&4)!==0&&p===0?i:null;if(d){for(I=0;I<G;I+=1)($e=J[I].a)==null||$e.measure();for(I=0;I<G;I+=1)(fe=J[I].a)==null||fe.fix()}j0(e,J,ce,f)}}d&&gn(()=>{var ke;if(x!==void 0)for(k of x)(ke=k.a)==null||ke.apply()}),gt.first=e.first&&e.first.e,gt.last=w&&w.e}function Z0(t,e,i,o){(o&1)!==0&&za(t.v,e),(o&2)!==0?za(t.i,i):t.i=i}function Sg(t,e,i,o,n,s,l,d,a,p){var f=Ms,v=(a&1)!==0,u=(a&16)===0,y=v?u?es(n,!1,!1):vr(n):n,w=(a&2)===0?l:vr(l);Me&&v&&(y.trace=()=>{var S=typeof w=="number"?l:w.v;p()[S]});var x={i:w,v:y,k:s,a:null,e:null,prev:i,next:o};Ms=x;try{return x.e=Pi(()=>d(t,y,w,p),Xe),x.e.prev=i&&i.e,x.e.next=o&&o.e,i===null?e.first=x:(i.next=x,i.e.next=x.e),o!==null&&(o.prev=x,o.e.prev=x.e),x}finally{Ms=f}}function xg(t,e,i){for(var o=t.next?t.next.e.nodes_start:i,n=e?e.e.nodes_start:i,s=t.e.nodes_start;s!==o;){var l=Uo(s);n.before(s),s=l}}function As(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 X0(t,e,i){var s,l;if(!e||e===fg(String(i!=null?i:"")))return;let o,n=(s=t.__svelte_meta)==null?void 0:s.loc;n?o=`near ${n.file}:${n.line}:${n.column}`:(l=Zn)!=null&&l[Pn]&&(o=`in ${Zn[Pn]}`),qv(kc(o))}function Fl(t,e,i=!1,o=!1,n=!1){var s=t,l="";B(()=>{var y;var d=gt;if(l===(l=(y=e())!=null?y:"")){Xe&&Hi();return}if(d.nodes_start!==null&&(cp(d.nodes_start,d.nodes_end),d.nodes_start=d.nodes_end=null),l!==""){if(Xe){for(var a=ht.data,p=Hi(),f=p;p!==null&&(p.nodeType!==Yn||p.data!=="");)f=p,p=Uo(p);if(p===null)throw Ps(),Yr;Me&&!n&&X0(p.parentNode,a,l),To(ht,f),s=bi(p);return}var v=l+"";i?v=`<svg>${v}</svg>`:o&&(v=`<math>${v}</math>`);var u=Ya(v);if((i||o)&&(u=yi(u)),To(yi(u),u.lastChild),i||o)for(;yi(u);)s.before(yi(u));else s.before(u)}})}function Ci(t,e,i){Xe&&Hi();var o=t,n,s;Fi(()=>{n!==(n=e())&&(s&&(Vn(s),s=null),n&&(s=Pi(()=>i(o,n))))},65536),Xe&&(o=ht)}function ra(t,e,i,o,n,s){var w;let l=Xe;Xe&&Hi();var d=Me&&s&&((w=Vt)==null?void 0:w.function[Pn]),a,p,f=null;Xe&&ht.nodeType===cc&&(f=ht,Hi());var v=Xe?ht:t,u,y=Ms;Fi(()=>{let x=e()||null;var S=n?n():i||x==="svg"?sc:null;if(x!==a){var T=Ms;wp(y),u&&(x===null?Vn(u,()=>{u=null,p=null}):x===p?ps(u):(Di(u),Pc(!1))),x&&x!==p&&(u=Pi(()=>{if(f=Xe?f:S?document.createElementNS(S,x):document.createElement(x),Me&&s&&(f.__svelte_meta={loc:{file:d,line:s[0],column:s[1]}}),To(f,f),o){Xe&&_g(x)&&f.append(document.createComment(""));var E=Xe?yi(f):f.appendChild(vn());Xe&&(E===null?ao(!1):bi(E)),o(f,E)}gt.nodes_end=f,v.before(f)})),a=x,a&&(p=a),Pc(!0),wp(T)}},65536),l&&(ao(!0),bi(v))}var Cp;function Cg(t){return Cp=t.target,new Sp(t)}var fs,gr,Sp=class{constructor(e){Cs(this,fs);Cs(this,gr);var s,l;var i=new Map,o=(d,a)=>{var p=es(a,!1,!1);return i.set(d,p),p};let n=new Proxy({...e.props||{},$$events:{}},{get(d,a){var p;return r((p=i.get(a))!=null?p:o(a,Reflect.get(d,a)))},has(d,a){var p;return a===Va?!0:(r((p=i.get(a))!=null?p:o(a,Reflect.get(d,a))),Reflect.has(d,a))},set(d,a,p){var f;return O((f=i.get(a))!=null?f:o(a,p),p),Reflect.set(d,a,p)}});La(this,gr,(e.hydrate?$p:is)(e.component,{target:e.target,anchor:e.anchor,props:n,context:e.context,intro:(s=e.intro)!=null?s:!1,recover:e.recover})),(!((l=e==null?void 0:e.props)!=null&&l.$$host)||e.sync===!1)&&Ga(),La(this,fs,n.$$events);for(let d of Object.keys(ki(this,gr)))d==="$set"||d==="$destroy"||d==="$on"||ro(this,d,{get(){return ki(this,gr)[d]},set(a){ki(this,gr)[d]=a},enumerable:!0});ki(this,gr).$set=d=>{Object.assign(n,d)},ki(this,gr).$destroy=()=>{oa(ki(this,gr))}}$set(e){ki(this,gr).$set(e)}$on(e,i){ki(this,fs)[e]=ki(this,fs)[e]||[];let o=(...n)=>i.call(this,...n);return ki(this,fs)[e].push(o),()=>{ki(this,fs)[e]=ki(this,fs)[e].filter(n=>n!==o)}}$destroy(){ki(this,gr).$destroy()}};fs=new WeakMap,gr=new WeakMap;function q(t,e){gn(()=>{var n,s,l;var i=t.getRootNode(),o=i.host?i:(l=(n=i.head)!=null?n:i.ownerDocument.head)!=null?l:(s=Cp)==null?void 0:s.parentNode;if(!(o!=null&&o.querySelector("#"+e.hash))){let d=document.createElement("style");d.id=e.hash,d.textContent=e.code,o.appendChild(d),Me&&yg(e.hash,d)}})}function ms(t,e){var i=void 0,o;Fi(()=>{i!==(i=e())&&(o&&(Di(o),o=null),i&&(o=Pi(()=>{So(()=>i(t))})))})}function Tg(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=Tg(t[e]))&&(o&&(o+=" "),o+=i)}else for(i in t)t[i]&&(o&&(o+=" "),o+=i);return o}function Eg(){for(var t,e,i=0,o="",n=arguments.length;i<n;i++)(t=arguments[i])&&(e=Tg(t))&&(o&&(o+=" "),o+=e);return o}function Ul(t){return typeof t=="object"?Eg(t):t!=null?t:""}var Ig=[...`
|
|
44
|
-
\r\f\xA0\v\uFEFF`];function Pg(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 s=n.length,l=0;(l=o.indexOf(n,l))>=0;){var d=l+s;(l===0||Ig.includes(o[l-1]))&&(d===o.length||Ig.includes(o[d]))?o=(l===0?"":o.substring(0,l))+o.substring(d+1):l=d}}return o===""?null:o}function kg(t,e=!1){var i=e?" !important;":";",o="";for(var n in t){var s=t[n];s!=null&&s!==""&&(o+=" "+n+": "+s+i)}return o}function Tp(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function Ag(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 s=!1,l=0,d=!1,a=[];o&&a.push(...Object.keys(o).map(Tp)),n&&a.push(...Object.keys(n).map(Tp));var p=0,f=-1;let x=t.length;for(var v=0;v<x;v++){var u=t[v];if(d?u==="/"&&t[v-1]==="*"&&(d=!1):s?s===u&&(s=!1):u==="/"&&t[v+1]==="*"?d=!0:u==='"'||u==="'"?s=u:u==="("?l++:u===")"&&l--,!d&&s===!1&&l===0){if(u===":"&&f===-1)f=v;else if(u===";"||v===x-1){if(f!==-1){var y=Tp(t.substring(p,f).trim());if(!a.includes(y)){u!==";"&&v++;var w=t.substring(p,v).trim();i+=" "+w+";"}}p=v+1,f=-1}}}}return o&&(i+=kg(o)),n&&(i+=kg(n,!0)),i=i.trim(),i===""?null:i}return t==null?null:String(t)}function ee(t,e,i,o,n,s){var l=t.__className;if(Xe||l!==i||l===void 0){var d=Pg(i,o,s);(!Xe||d!==t.getAttribute("class"))&&(d==null?t.removeAttribute("class"):e?t.className=d:t.setAttribute("class",d)),t.__className=i}else if(s&&n!==s)for(var a in s){var p=!!s[a];(n==null||p!==!!n[a])&&t.classList.toggle(a,p)}return s}function Ep(t,e={},i,o){for(var n in i){var s=i[n];e[n]!==s&&(i[n]==null?t.style.removeProperty(n):t.style.setProperty(n,s,o))}}function rt(t,e,i,o){var n=t.__style;if(Xe||n!==e){var s=Ag(e,o);(!Xe||s!==t.getAttribute("style"))&&(s==null?t.removeAttribute("style"):t.style.cssText=s),t.__style=e}else o&&(Array.isArray(o)?(Ep(t,i==null?void 0:i[0],o[0]),Ep(t,i==null?void 0:i[1],o[1],"important")):Ep(t,i,o));return o}function zl(t,e,i){if(t.multiple){if(e==null)return;if(!jn(e))return Gv();for(var o of t.options)o.selected=e.includes(Mg(o));return}for(o of t.options){var n=Mg(o);if(Ju(n,e)){o.selected=!0;return}}(!i||e!==void 0)&&(t.selectedIndex=-1)}function Ip(t){var e=new MutationObserver(()=>{zl(t,t.__value)});e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),Do(()=>{e.disconnect()})}function Mg(t){return"__value"in t?t.__value:t.value}var Xa=Symbol("class"),Ja=Symbol("style"),Rg=Symbol("is custom element"),Ng=Symbol("is html");function Og(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function Fe(t,e,i,o){var n=Dg(t);if(Xe&&(n[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName==="LINK")){o||s_(t,e,i!=null?i:"");return}n[e]!==(n[e]=i)&&(e==="loading"&&(t[Tv]=i),i==null?t.removeAttribute(e):typeof i!="string"&&Hg(t).includes(e)?t[e]=i:t.setAttribute(e,i))}function Bg(t,e,i,o,n=!1){var k;var s=Dg(t),l=s[Rg],d=!s[Ng];let a=Xe&&l;a&&ao(!1);var p=e||{},f=t.tagName==="OPTION";for(var v in e)v in i||(i[v]=null);i.class?i.class=Ul(i.class):(o||i[Xa])&&(i.class=null),i[Ja]&&((k=i.style)!=null||(i.style=null));var u=Hg(t);for(let I in i){let R=i[I];if(f&&I==="value"&&R==null){t.value=t.__value="",p[I]=R;continue}if(I==="class"){var y=t.namespaceURI==="http://www.w3.org/1999/xhtml";ee(t,y,R,o,e==null?void 0:e[Xa],i[Xa]),p[I]=R,p[Xa]=i[Xa];continue}if(I==="style"){rt(t,R,e==null?void 0:e[Ja],i[Ja]),p[I]=R,p[Ja]=i[Ja];continue}var w=p[I];if(!(R===w&&!(R===void 0&&t.hasAttribute(I)))){p[I]=R;var x=I[0]+I[1];if(x!=="$$")if(x==="on"){let Y={},H="$$"+I,F=I.slice(2);var S=vg(F);if(mg(F)&&(F=F.slice(0,-7),Y.capture=!0),!S&&w){if(R!=null)continue;t.removeEventListener(F,p[H],Y),p[H]=null}if(R!=null)if(S)t[`__${F}`]=R,lt([F]);else{let W=function(J){p[I].call(this,J)};var V=W;p[H]=_p(F,t,W,Y)}else S&&(t[`__${F}`]=void 0)}else if(I==="style")Fe(t,I,R);else if(I==="autofocus")gp(t,!!R);else if(!l&&(I==="__value"||I==="value"&&R!=null))t.value=t.__value=R;else if(I==="selected"&&f)Og(t,R);else{var T=I;d||(T=gg(T));var E=T==="defaultValue"||T==="defaultChecked";if(R==null&&!l&&!E)if(s[I]=null,T==="value"||T==="checked"){let Y=t,H=e===void 0;if(T==="value"){let F=Y.defaultValue;Y.removeAttribute(T),Y.defaultValue=F,Y.value=Y.__value=H?F:null}else{let F=Y.defaultChecked;Y.removeAttribute(T),Y.defaultChecked=F,Y.checked=H?F:!1}}else t.removeAttribute(I);else E||u.includes(T)&&(l||typeof R!="string")?t[T]=R:typeof R!="function"&&Fe(t,T,R,n)}}}return a&&ao(!0),p}function Pe(t,e,i=[],o,n=!1,s=Lr){let l=i.map(s);var d=void 0,a={},p=t.nodeName==="SELECT",f=!1;if(Fi(()=>{var u=e(...l.map(r)),y=Bg(t,d,u,o,n);f&&p&&"value"in u&&zl(t,u.value,!1);for(let x of Object.getOwnPropertySymbols(a))u[x]||Di(a[x]);for(let x of Object.getOwnPropertySymbols(u)){var w=u[x];x.description===Ku&&(!d||w!==d[x])&&(a[x]&&Di(a[x]),a[x]=Pi(()=>ms(t,()=>w))),y[x]=w}d=y}),p){var v=t;So(()=>{zl(v,d.value),Ip(v)})}f=!0}function Dg(t){var e;return(e=t.__attributes)!=null?e:t.__attributes={[Rg]:t.nodeName.includes("-"),[Ng]:t.namespaceURI===bv}}var Lg=new Map;function Hg(t){var e=Lg.get(t.nodeName);if(e)return e;Lg.set(t.nodeName,e=[]);for(var i,o=t,n=Element.prototype;n!==o;){i=lc(o);for(var s in i)i[s].set&&e.push(s);o=qs(o)}return e}function s_(t,e,i){var o;Me&&(e==="srcset"&&a_(t,i)||kp((o=t.getAttribute(e))!=null?o:"",i)||Kv(e,t.outerHTML.replace(t.innerHTML,t.innerHTML&&"..."),String(i)))}function kp(t,e){return t===e?!0:new URL(t,document.baseURI).href===new URL(e,document.baseURI).href}function Vg(t){return t.split(",").map(e=>e.trim().split(" ").filter(Boolean))}function a_(t,e){var i=Vg(t.srcset),o=Vg(e);return o.length===i.length&&o.every(([n,s],l)=>s===i[l][1]&&(kp(i[l][0],n)||kp(n,i[l][0])))}var l_=ac?()=>performance.now():()=>Date.now(),Or={tick:t=>(ac?requestAnimationFrame:de)(t),now:()=>l_(),tasks:new Set};function Fg(){let t=Or.now();Or.tasks.forEach(e=>{e.c(t)||(Or.tasks.delete(e),e.f())}),Or.tasks.size!==0&&Or.tick(Fg)}function Ug(t){let e;return Or.tasks.size===0&&Or.tick(Fg),{promise:new Promise(i=>{Or.tasks.add(e={c:t,f:i})}),abort(){Or.tasks.delete(e)}}}function Ac(t,e){Bl(()=>{t.dispatchEvent(new CustomEvent(e))})}function p_(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 zg(t){let e={},i=t.split(";");for(let o of i){let[n,s]=o.split(":");if(!n||s===void 0)break;let l=p_(n.trim());e[l]=s.trim()}return e}var f_=t=>t;function Ap(t,e,i,o){var V;var n=(t&1)!==0,s=(t&2)!==0,l=n&&s,d=(t&4)!==0,a=l?"both":n?"in":"out",p,f=e.inert,v=e.style.overflow,u,y;function w(){var R;var k=Ct,I=gt;Bi(null),so(null);try{return p!=null?p:p=i()(e,(R=o==null?void 0:o())!=null?R:{},{direction:a})}finally{Bi(k),so(I)}}var x={is_global:d,in(){var k;if(e.inert=f,!n){y==null||y.abort(),(k=y==null?void 0:y.reset)==null||k.call(y);return}s||u==null||u.abort(),Ac(e,"introstart"),u=Pp(e,w(),y,1,()=>{Ac(e,"introend"),u==null||u.abort(),u=p=void 0,e.style.overflow=v})},out(k){if(!s){k==null||k(),p=void 0;return}e.inert=!0,Ac(e,"outrostart"),y=Pp(e,w(),u,0,()=>{Ac(e,"outroend"),k==null||k()})},stop:()=>{u==null||u.abort(),y==null||y.abort()}},S=gt;if(((V=S.transitions)!=null?V:S.transitions=[]).push(x),n&&Dl){var T=d;if(!T){for(var E=S.parent;E&&(E.f&65536)!==0;)for(;(E=E.parent)&&(E.f&16)===0;);T=!E||(E.f&32768)!==0}T&&So(()=>{yt(()=>x.in())})}}function Pp(t,e,i,o,n){var s=o===1;if(Is(e)){var l,d=!1;return gn(()=>{if(!d){var S=e({direction:s?"in":"out"});l=Pp(t,S,i,o,n)}}),{abort:()=>{d=!0,l==null||l.abort()},deactivate:()=>l.deactivate(),reset:()=>l.reset(),t:()=>l.t()}}if(i==null||i.deactivate(),!(e!=null&&e.duration))return n(),{abort:de,deactivate:de,reset:de,t:()=>o};let{delay:a=0,css:p,tick:f,easing:v=f_}=e;var u=[];if(s&&i===void 0&&(f&&f(0,1),p)){var y=zg(p(0,1));u.push(y,y)}var w=()=>1-o,x=t.animate(u,{duration:a,fill:"forwards"});return x.onfinish=()=>{var F;x.cancel();var S=(F=i==null?void 0:i.t())!=null?F:1-o;i==null||i.abort();var T=o-S,E=e.duration*Math.abs(T),V=[];if(E>0){var k=!1;if(p)for(var I=Math.ceil(E/16.666666666666668),R=0;R<=I;R+=1){var Y=S+T*v(R/I),H=zg(p(Y,1-Y));V.push(H),k||(k=H.overflow==="hidden")}k&&(t.style.overflow="hidden"),w=()=>{var W=x.currentTime;return S+T*v(W/E)},f&&Ug(()=>{if(x.playState!=="running")return!1;var W=w();return f(W,1-W),!0})}x=t.animate(V,{duration:E,fill:"forwards"}),x.onfinish=()=>{w=()=>o,f==null||f(o,1-o),n()}},{abort:()=>{x&&(x.cancel(),x.effect=null,x.onfinish=de)},deactivate:()=>{n=de},reset:()=>{o===0&&(f==null||f(1,0))},t:()=>w()}}var Ls,el,Wl,Lc,Wg,Vc=class Vc{constructor(e){Cs(this,Lc);Cs(this,Ls,new WeakMap);Cs(this,el);Cs(this,Wl);La(this,Wl,e)}observe(e,i){var o=ki(this,Ls).get(e)||new Set;return o.add(i),ki(this,Ls).set(e,o),hv(this,Lc,Wg).call(this).observe(e,ki(this,Wl)),()=>{var n=ki(this,Ls).get(e);n.delete(i),n.size===0&&(ki(this,Ls).delete(e),ki(this,el).unobserve(e))}}};Ls=new WeakMap,el=new WeakMap,Wl=new WeakMap,Lc=new WeakSet,Wg=function(){var e;return(e=ki(this,el))!=null?e:La(this,el,new ResizeObserver(i=>{for(var o of i){Vc.entries.set(o.target,o);for(var n of ki(this,Ls).get(o.target)||[])n(o)}}))},Gn(Vc,"entries",new WeakMap);var Mp=Vc;var m_=new Mp({box:"border-box"});function ir(t,e,i){var o=m_.observe(t,()=>i(t[e]));So(()=>(yt(()=>i(t[e])),o))}function Kg(t,e){return t===e||(t==null?void 0:t[Bo])===e}function it(t={},e,i,o){return So(()=>{var n,s;return zo(()=>{n=s,s=(o==null?void 0:o())||[],yt(()=>{t!==i(...s)&&(e(t,...s),n&&Kg(i(...n),t)&&e(null,...n))})}),()=>{gn(()=>{s&&Kg(i(...s),t)&&e(null,...s)})}}),t}function Br(t=!1){let e=Vt,i=e.l.u;if(!i)return;let o=()=>Ec(e.s);if(t){let n=0,s={},l=Lr(()=>{let d=!1,a=e.s;for(let p in a)a[p]!==s[p]&&(s[p]=a[p],d=!0);return d&&n++,n});o=()=>r(l)}i.b.length&&Ml(()=>{qg(e,o),ks(i.b)}),Ke(()=>{let n=yt(()=>i.m.map(Cv));return()=>{for(let s of n)typeof s=="function"&&s()}}),i.a.length&&Ke(()=>{qg(e,o),ks(i.a)})}function qg(t,e){if(t.l.s)for(let i of t.l.s)r(i);e()}function Kl(t,e,i){if(t==null)return e(void 0),i&&i(void 0),de;let o=yt(()=>t.subscribe(e,i));return o.unsubscribe?()=>o.unsubscribe():o}var tl=[];function hr(t,e){return{subscribe:se(t,e).subscribe}}function se(t,e=de){let i=null,o=new Set;function n(d){if(Na(t,d)&&(t=d,i)){let a=!tl.length;for(let p of o)p[1](),tl.push(p,t);if(a){for(let p=0;p<tl.length;p+=2)tl[p][0](tl[p+1]);tl.length=0}}}function s(d){n(d(t))}function l(d,a=de){let p=[d,a];return o.add(p),o.size===1&&(i=e(n,s)||de),d(t),()=>{o.delete(p),o.size===0&&i&&(i(),i=null)}}return{set:n,update:s,subscribe:l}}function xi(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 s=e.length<2;return hr(i,(l,d)=>{let a=!1,p=[],f=0,v=de,u=()=>{if(f)return;v();let w=e(o?p[0]:p,l,d);s?l(w):v=typeof w=="function"?w:de},y=n.map((w,x)=>Kl(w,S=>{p[x]=S,f&=~(1<<x),a&&u()},()=>{f|=1<<x}));return a=!0,u(),function(){ks(y),v(),a=!1}})}function xe(t){let e;return Kl(t,i=>e=i)(),e}var Rc=!1,Lp=Symbol();function C(t,e,i){var s;let o=(s=i[e])!=null?s:i[e]={store:null,source:es(void 0),unsubscribe:de};if(o.store!==t&&!(Lp in i))if(o.unsubscribe(),o.store=t!=null?t:null,t==null)o.source.v=void 0,o.unsubscribe=de;else{var n=!0;o.unsubscribe=Kl(t,l=>{n?o.source.v=l:O(o.source,l)}),n=!1}return t&&Lp in i?xe(t):r(o.source)}function He(){let t={};function e(){Do(()=>{for(var i in t)t[i].unsubscribe();ro(t,Lp,{enumerable:!1,value:!0})})}return[t,e]}function Vp(t){var e=Rc;try{return Rc=!1,[t(),Rc]}finally{Rc=e}}var y_={get(t,e){if(!t.exclude.includes(e))return t.props[e]},set(t,e){return Me&&Nv(`${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 Ne(t,e,i){return new Proxy(Me?{props:t,exclude:e,name:i,other:{},to_proxy:[]}:{props:t,exclude:e},y_)}var x_={get(t,e){let i=t.props.length;for(;i--;){let o=t.props[i];if(Is(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];Is(n)&&(n=n());let s=Yo(n,e);if(s&&s.set)return s.set(i),!0}return!1},getOwnPropertyDescriptor(t,e){let i=t.props.length;for(;i--;){let o=t.props[i];if(Is(o)&&(o=o()),typeof o=="object"&&o!==null&&e in o){let n=Yo(o,e);return n&&!n.configurable&&(n.configurable=!0),n}}},has(t,e){if(e===Bo||e===Va)return!1;for(let i of t.props)if(Is(i)&&(i=i()),i!=null&&e in i)return!0;return!1},ownKeys(t){let e=[];for(let i of t.props)if(Is(i)&&(i=i()),!!i){for(let o in i)e.includes(o)||e.push(o);for(let o of Object.getOwnPropertySymbols(i))e.includes(o)||e.push(o)}return e}};function vs(...t){return new Proxy({props:t},x_)}function Qg(t){var e,i;return(i=(e=t.ctx)==null?void 0:e.d)!=null?i:!1}function m(t,e,i,o){var Y,H;var n=(i&1)!==0,s=!Zr||(i&2)!==0,l=(i&8)!==0,d=(i&16)!==0,a=!1,p;l?[p,a]=Vp(()=>t[e]):p=t[e];var f=Bo in t||Va in t,v=l&&((H=(Y=Yo(t,e))==null?void 0:Y.set)!=null?H:f&&e in t&&(F=>t[e]=F))||void 0,u=o,y=!0,w=!1,x=()=>(w=!0,y&&(y=!1,d?u=yt(o):u=o),u);p===void 0&&o!==void 0&&(v&&s&&Rv(e),p=x(),v&&v(p));var S;if(s)S=()=>{var F=t[e];return F===void 0?x():(y=!0,w=!1,F)};else{var T=(n?Lr:Vr)(()=>t[e]);T.f|=131072,S=()=>{var F=r(T);return F!==void 0&&(u=void 0),F===void 0?u:F}}if((i&4)===0&&s)return S;if(v){var E=t.$$legacy;return function(F,W){return arguments.length>0?((!s||!W||E||a)&&v(W?S():F),F):S()}}var V=!1,k=!1,I=es(p),R=Lr(()=>{var F=S(),W=r(I);return V?(V=!1,k=!0,W):(k=!1,I.v=F)});return l&&r(R),n||(R.equals=Oa),function(F,W){if(Cc!==null&&(V=k,S(),r(I)),arguments.length>0){let J=W?r(R):s&&l?ni(F):F;if(!R.equals(J)){if(V=!0,O(I,J),w&&u!==void 0&&(u=J),Qg(R))return F;yt(()=>r(R))}return F}return Qg(R)?R.v:r(R)}}var w_;typeof HTMLElement=="function"&&(w_=class extends HTMLElement{constructor(e,i,o){super();Gn(this,"$$ctor");Gn(this,"$$s");Gn(this,"$$c");Gn(this,"$$cn",!1);Gn(this,"$$d",{});Gn(this,"$$r",!1);Gn(this,"$$p_d",{});Gn(this,"$$l",{});Gn(this,"$$l_u",new Map);Gn(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))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let i=function(s){return l=>{let d=document.createElement("slot");s!=="default"&&(d.name=s),$(l,d)}};var e=i;if(await Promise.resolve(),!this.$$cn||this.$$c)return;let o={},n=S_(this);for(let s of this.$$s)s in n&&(s==="default"&&!this.$$d.children?(this.$$d.children=i(s),o.default=!0):o[s]=i(s));for(let s of this.attributes){let l=this.$$g_p(s.name);l in this.$$d||(this.$$d[l]=Rp(l,s.value,this.$$p_d,"toProp"))}for(let s in this.$$p_d)!(s in this.$$d)&&this[s]!==void 0&&(this.$$d[s]=this[s],delete this[s]);this.$$c=Cg({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:o,$$host:this}}),this.$$me=yc(()=>{zo(()=>{var s;this.$$r=!0;for(let l of qu(this.$$c)){if(!((s=this.$$p_d[l])!=null&&s.reflect))continue;this.$$d[l]=this.$$c[l];let d=Rp(l,this.$$d[l],this.$$p_d,"toAttribute");d==null?this.removeAttribute(this.$$p_d[l].attribute||l):this.setAttribute(this.$$p_d[l].attribute||l,d)}this.$$r=!1})});for(let s in this.$$l)for(let l of this.$$l[s]){let d=this.$$c.$on(s,l);this.$$l_u.set(l,d)}this.$$l={}}}attributeChangedCallback(e,i,o){var n;this.$$r||(e=this.$$g_p(e),this.$$d[e]=Rp(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 qu(this.$$p_d).find(i=>this.$$p_d[i].attribute===e||!this.$$p_d[i].attribute&&i.toLowerCase()===e)||e}});function Rp(t,e,i,o){var s;let n=(s=i[t])==null?void 0:s.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 S_(t){let e={};return t.childNodes.forEach(i=>{e[i.slot||"default"]=!0}),e}var Gg="5";var jg,Yg,Zg;typeof window!="undefined"&&((Zg=(Yg=(jg=window.__svelte)!=null?jg:window.__svelte={}).v)!=null?Zg:Yg.v=new Set).add(Gg);import{areValidLiveRecordSources as m5,clientChecker as ev}from"@vkontakte/videoplayer-core/es2018";import"@vkontakte/videoplayer-core/es2018";import{noop as J1,safeStorage as v5,throttleFn as g5}from"@vkontakte/videoplayer-shared/es2018";import{SeekAction as h5}from"@vkontakte/videoplayer-statistics/es2018";import{InterfaceLanguage as C_,fillWithDefault as T_,VideoQuality as Xg}from"@vkontakte/videoplayer-shared/es2018";var E_={isMobile:void 0,disableInvisibleComponentsTimeout:500,debugLog:!1,devNullLog:!1,defaultLanguage:C_.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:Xg.Q_480P,highQualityLimit:Xg.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,thinStatistics:!1,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,tracer:!1,interactiveGraph:!1,interactiveResponsiveUi:!1,seekToInteractive:!0,interactiveLastFrame:!1,interactiveTextPermanent:!0,interactiveHideTime:!0,interactivePlayPrevChapter:!0,interactiveTimeIndicator:!0,interactiveTimeOpenUri:!1,interactiveAreaControlShadow:!1,interactiveControlsExpectTimeBlinkAnimation:!1,interactiveControlsTapPlace:!1,interactiveControlsFillAnimation:!1,interactiveControlsHideAnimation:!1,interactiveHistoryEndChapterFix:!0,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,qualityDetailsSubMenuEnabled:!1,showSlowVideoNotification:!1,forceAutoQualityWhenSevereStallHappens:!1,timeoutShowSlowVideoNotification:0,maxCountShowSlowVideoNotification:1,forcePlayerDisplayBlock:!1,playbackStatusAnimationDuration:1e3,playbackStatusShow:!1,playbackStatusNextVideoShow:!1,playbackStatusNextVideoAnimationDuration:1e3,initSubtitles:!0,useCallbackForMediaSessionNextPrevClick:!1,usePerformanceFix:!1,userVideoPrefs:!1,savePreferredStatesOnUserActionOnly:!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,usePuid:!0},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,font:null,focusedOutlineWidth:null,focusedOutlineRadius:null,controlsDesktopPaddingHorizontal:null,timelinePaddingHorizontal:null,settingsBackgroundColor:null,controlsGradientHeight:null,controlsGradient:null},userSalt:"0"},Jg=t=>T_(t,E_),eh=t=>Ha("ui-config",t),Et=()=>Da("ui-config");var ql="vk_player_debug_panel_opened";var th="videoplayer",ih="videoplayer";var os={KeyF:"f",KeyK:"k",KeyC:"c",KeyM:"m"},oh=new Set(["ArrowLeft","ArrowRight","KeyL","KeyJ"]),nh=new Set(["Tab","Space","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"]),rh=new Set(["ShiftRight","ShiftLeft"]);var sh=["TIMELINE"],Ql=[...sh,"GRAPH_BUTTON"],Np=[...sh,"PLAY_BUTTON"],Gl=[...Ql,"PLAY_BUTTON"];var ns=(s=>(s.XS="xs",s.S="s",s.M="m",s.L="l",s.XL="xl",s))(ns||{}),aa={xs:0,s:1,m:2,l:3,xl:4};import{assertNonNullable as ah,VERSION as I_}from"@vkontakte/videoplayer-shared/es2018";import{VERSION as k_}from"@vkontakte/videoplayer-core/es2018";import{VERSION as P_}from"@vkontakte/videoplayer-statistics/es2018";var Nc="prod",il="1.1.72-dev.c0dc5218.0";var la=(t,e,i)=>{let o=document.createElement("a");o.href=t,o.download=`${e}.${i}`,o.style.display="none",o.click()};var lh=Symbol("storeContext"),dh=Symbol("microStoresContext"),ch=(t,e)=>{Ha(lh,t),Ha(dh,e),Nc==="dev"&&(window.app={store:t,microStores:e})},Ee=()=>{let t=Da(lh);return ah(t,"Store context is empty!"),t},mo=()=>{let t=Da(dh);return ah(t,"MicroStores context is empty!"),t},ti=(t,e)=>Bc(t,t.getValue(),e),Bc=(t,e,i)=>hr(e,o=>{let n=t.subscribe(s=>{o(s),i==null||i(s)});return()=>n.unsubscribe()}),uh=(t,e,i,o)=>{var R,Y,H,F,W,J,G,ce;let n=t.info,{width:s,height:l}=xe(i.ui.playerSize),d=(Y=(R=n.throughputEstimation$.getValue())==null?void 0:R.toFixed(0))!=null?Y:0,a=(F=(H=n.rttEstimation$.getValue())==null?void 0:H.toFixed(0))!=null?F:0,p=n.isAutoQualityEnabled$.getValue()?"auto":"manual",f=`${il} (core: ${k_}, stat: ${P_}, shared: ${I_})`,v=xe(i.state.errorLog$),u=v.length?`
|
|
44
|
+
\r\f\xA0\v\uFEFF`];function Pg(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 s=n.length,l=0;(l=o.indexOf(n,l))>=0;){var d=l+s;(l===0||Ig.includes(o[l-1]))&&(d===o.length||Ig.includes(o[d]))?o=(l===0?"":o.substring(0,l))+o.substring(d+1):l=d}}return o===""?null:o}function kg(t,e=!1){var i=e?" !important;":";",o="";for(var n in t){var s=t[n];s!=null&&s!==""&&(o+=" "+n+": "+s+i)}return o}function Tp(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function Ag(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 s=!1,l=0,d=!1,a=[];o&&a.push(...Object.keys(o).map(Tp)),n&&a.push(...Object.keys(n).map(Tp));var p=0,f=-1;let x=t.length;for(var v=0;v<x;v++){var u=t[v];if(d?u==="/"&&t[v-1]==="*"&&(d=!1):s?s===u&&(s=!1):u==="/"&&t[v+1]==="*"?d=!0:u==='"'||u==="'"?s=u:u==="("?l++:u===")"&&l--,!d&&s===!1&&l===0){if(u===":"&&f===-1)f=v;else if(u===";"||v===x-1){if(f!==-1){var y=Tp(t.substring(p,f).trim());if(!a.includes(y)){u!==";"&&v++;var w=t.substring(p,v).trim();i+=" "+w+";"}}p=v+1,f=-1}}}}return o&&(i+=kg(o)),n&&(i+=kg(n,!0)),i=i.trim(),i===""?null:i}return t==null?null:String(t)}function ee(t,e,i,o,n,s){var l=t.__className;if(Xe||l!==i||l===void 0){var d=Pg(i,o,s);(!Xe||d!==t.getAttribute("class"))&&(d==null?t.removeAttribute("class"):e?t.className=d:t.setAttribute("class",d)),t.__className=i}else if(s&&n!==s)for(var a in s){var p=!!s[a];(n==null||p!==!!n[a])&&t.classList.toggle(a,p)}return s}function Ep(t,e={},i,o){for(var n in i){var s=i[n];e[n]!==s&&(i[n]==null?t.style.removeProperty(n):t.style.setProperty(n,s,o))}}function rt(t,e,i,o){var n=t.__style;if(Xe||n!==e){var s=Ag(e,o);(!Xe||s!==t.getAttribute("style"))&&(s==null?t.removeAttribute("style"):t.style.cssText=s),t.__style=e}else o&&(Array.isArray(o)?(Ep(t,i==null?void 0:i[0],o[0]),Ep(t,i==null?void 0:i[1],o[1],"important")):Ep(t,i,o));return o}function zl(t,e,i){if(t.multiple){if(e==null)return;if(!jn(e))return Gv();for(var o of t.options)o.selected=e.includes(Mg(o));return}for(o of t.options){var n=Mg(o);if(Ju(n,e)){o.selected=!0;return}}(!i||e!==void 0)&&(t.selectedIndex=-1)}function Ip(t){var e=new MutationObserver(()=>{zl(t,t.__value)});e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),Do(()=>{e.disconnect()})}function Mg(t){return"__value"in t?t.__value:t.value}var Xa=Symbol("class"),Ja=Symbol("style"),Rg=Symbol("is custom element"),Ng=Symbol("is html");function Og(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function Fe(t,e,i,o){var n=Dg(t);if(Xe&&(n[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName==="LINK")){o||s_(t,e,i!=null?i:"");return}n[e]!==(n[e]=i)&&(e==="loading"&&(t[Tv]=i),i==null?t.removeAttribute(e):typeof i!="string"&&Hg(t).includes(e)?t[e]=i:t.setAttribute(e,i))}function Bg(t,e,i,o,n=!1){var k;var s=Dg(t),l=s[Rg],d=!s[Ng];let a=Xe&&l;a&&ao(!1);var p=e||{},f=t.tagName==="OPTION";for(var v in e)v in i||(i[v]=null);i.class?i.class=Ul(i.class):(o||i[Xa])&&(i.class=null),i[Ja]&&((k=i.style)!=null||(i.style=null));var u=Hg(t);for(let I in i){let R=i[I];if(f&&I==="value"&&R==null){t.value=t.__value="",p[I]=R;continue}if(I==="class"){var y=t.namespaceURI==="http://www.w3.org/1999/xhtml";ee(t,y,R,o,e==null?void 0:e[Xa],i[Xa]),p[I]=R,p[Xa]=i[Xa];continue}if(I==="style"){rt(t,R,e==null?void 0:e[Ja],i[Ja]),p[I]=R,p[Ja]=i[Ja];continue}var w=p[I];if(!(R===w&&!(R===void 0&&t.hasAttribute(I)))){p[I]=R;var x=I[0]+I[1];if(x!=="$$")if(x==="on"){let Y={},H="$$"+I,F=I.slice(2);var S=vg(F);if(mg(F)&&(F=F.slice(0,-7),Y.capture=!0),!S&&w){if(R!=null)continue;t.removeEventListener(F,p[H],Y),p[H]=null}if(R!=null)if(S)t[`__${F}`]=R,lt([F]);else{let W=function(J){p[I].call(this,J)};var V=W;p[H]=_p(F,t,W,Y)}else S&&(t[`__${F}`]=void 0)}else if(I==="style")Fe(t,I,R);else if(I==="autofocus")gp(t,!!R);else if(!l&&(I==="__value"||I==="value"&&R!=null))t.value=t.__value=R;else if(I==="selected"&&f)Og(t,R);else{var T=I;d||(T=gg(T));var E=T==="defaultValue"||T==="defaultChecked";if(R==null&&!l&&!E)if(s[I]=null,T==="value"||T==="checked"){let Y=t,H=e===void 0;if(T==="value"){let F=Y.defaultValue;Y.removeAttribute(T),Y.defaultValue=F,Y.value=Y.__value=H?F:null}else{let F=Y.defaultChecked;Y.removeAttribute(T),Y.defaultChecked=F,Y.checked=H?F:!1}}else t.removeAttribute(I);else E||u.includes(T)&&(l||typeof R!="string")?t[T]=R:typeof R!="function"&&Fe(t,T,R,n)}}}return a&&ao(!0),p}function Pe(t,e,i=[],o,n=!1,s=Lr){let l=i.map(s);var d=void 0,a={},p=t.nodeName==="SELECT",f=!1;if(Fi(()=>{var u=e(...l.map(r)),y=Bg(t,d,u,o,n);f&&p&&"value"in u&&zl(t,u.value,!1);for(let x of Object.getOwnPropertySymbols(a))u[x]||Di(a[x]);for(let x of Object.getOwnPropertySymbols(u)){var w=u[x];x.description===Ku&&(!d||w!==d[x])&&(a[x]&&Di(a[x]),a[x]=Pi(()=>ms(t,()=>w))),y[x]=w}d=y}),p){var v=t;So(()=>{zl(v,d.value),Ip(v)})}f=!0}function Dg(t){var e;return(e=t.__attributes)!=null?e:t.__attributes={[Rg]:t.nodeName.includes("-"),[Ng]:t.namespaceURI===bv}}var Lg=new Map;function Hg(t){var e=Lg.get(t.nodeName);if(e)return e;Lg.set(t.nodeName,e=[]);for(var i,o=t,n=Element.prototype;n!==o;){i=lc(o);for(var s in i)i[s].set&&e.push(s);o=qs(o)}return e}function s_(t,e,i){var o;Me&&(e==="srcset"&&a_(t,i)||kp((o=t.getAttribute(e))!=null?o:"",i)||Kv(e,t.outerHTML.replace(t.innerHTML,t.innerHTML&&"..."),String(i)))}function kp(t,e){return t===e?!0:new URL(t,document.baseURI).href===new URL(e,document.baseURI).href}function Vg(t){return t.split(",").map(e=>e.trim().split(" ").filter(Boolean))}function a_(t,e){var i=Vg(t.srcset),o=Vg(e);return o.length===i.length&&o.every(([n,s],l)=>s===i[l][1]&&(kp(i[l][0],n)||kp(n,i[l][0])))}var l_=ac?()=>performance.now():()=>Date.now(),Or={tick:t=>(ac?requestAnimationFrame:de)(t),now:()=>l_(),tasks:new Set};function Fg(){let t=Or.now();Or.tasks.forEach(e=>{e.c(t)||(Or.tasks.delete(e),e.f())}),Or.tasks.size!==0&&Or.tick(Fg)}function Ug(t){let e;return Or.tasks.size===0&&Or.tick(Fg),{promise:new Promise(i=>{Or.tasks.add(e={c:t,f:i})}),abort(){Or.tasks.delete(e)}}}function Ac(t,e){Bl(()=>{t.dispatchEvent(new CustomEvent(e))})}function p_(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 zg(t){let e={},i=t.split(";");for(let o of i){let[n,s]=o.split(":");if(!n||s===void 0)break;let l=p_(n.trim());e[l]=s.trim()}return e}var f_=t=>t;function Ap(t,e,i,o){var V;var n=(t&1)!==0,s=(t&2)!==0,l=n&&s,d=(t&4)!==0,a=l?"both":n?"in":"out",p,f=e.inert,v=e.style.overflow,u,y;function w(){var R;var k=Ct,I=gt;Bi(null),so(null);try{return p!=null?p:p=i()(e,(R=o==null?void 0:o())!=null?R:{},{direction:a})}finally{Bi(k),so(I)}}var x={is_global:d,in(){var k;if(e.inert=f,!n){y==null||y.abort(),(k=y==null?void 0:y.reset)==null||k.call(y);return}s||u==null||u.abort(),Ac(e,"introstart"),u=Pp(e,w(),y,1,()=>{Ac(e,"introend"),u==null||u.abort(),u=p=void 0,e.style.overflow=v})},out(k){if(!s){k==null||k(),p=void 0;return}e.inert=!0,Ac(e,"outrostart"),y=Pp(e,w(),u,0,()=>{Ac(e,"outroend"),k==null||k()})},stop:()=>{u==null||u.abort(),y==null||y.abort()}},S=gt;if(((V=S.transitions)!=null?V:S.transitions=[]).push(x),n&&Dl){var T=d;if(!T){for(var E=S.parent;E&&(E.f&65536)!==0;)for(;(E=E.parent)&&(E.f&16)===0;);T=!E||(E.f&32768)!==0}T&&So(()=>{yt(()=>x.in())})}}function Pp(t,e,i,o,n){var s=o===1;if(Is(e)){var l,d=!1;return gn(()=>{if(!d){var S=e({direction:s?"in":"out"});l=Pp(t,S,i,o,n)}}),{abort:()=>{d=!0,l==null||l.abort()},deactivate:()=>l.deactivate(),reset:()=>l.reset(),t:()=>l.t()}}if(i==null||i.deactivate(),!(e!=null&&e.duration))return n(),{abort:de,deactivate:de,reset:de,t:()=>o};let{delay:a=0,css:p,tick:f,easing:v=f_}=e;var u=[];if(s&&i===void 0&&(f&&f(0,1),p)){var y=zg(p(0,1));u.push(y,y)}var w=()=>1-o,x=t.animate(u,{duration:a,fill:"forwards"});return x.onfinish=()=>{var F;x.cancel();var S=(F=i==null?void 0:i.t())!=null?F:1-o;i==null||i.abort();var T=o-S,E=e.duration*Math.abs(T),V=[];if(E>0){var k=!1;if(p)for(var I=Math.ceil(E/16.666666666666668),R=0;R<=I;R+=1){var Y=S+T*v(R/I),H=zg(p(Y,1-Y));V.push(H),k||(k=H.overflow==="hidden")}k&&(t.style.overflow="hidden"),w=()=>{var W=x.currentTime;return S+T*v(W/E)},f&&Ug(()=>{if(x.playState!=="running")return!1;var W=w();return f(W,1-W),!0})}x=t.animate(V,{duration:E,fill:"forwards"}),x.onfinish=()=>{w=()=>o,f==null||f(o,1-o),n()}},{abort:()=>{x&&(x.cancel(),x.effect=null,x.onfinish=de)},deactivate:()=>{n=de},reset:()=>{o===0&&(f==null||f(1,0))},t:()=>w()}}var Ls,el,Wl,Lc,Wg,Vc=class Vc{constructor(e){Cs(this,Lc);Cs(this,Ls,new WeakMap);Cs(this,el);Cs(this,Wl);La(this,Wl,e)}observe(e,i){var o=ki(this,Ls).get(e)||new Set;return o.add(i),ki(this,Ls).set(e,o),hv(this,Lc,Wg).call(this).observe(e,ki(this,Wl)),()=>{var n=ki(this,Ls).get(e);n.delete(i),n.size===0&&(ki(this,Ls).delete(e),ki(this,el).unobserve(e))}}};Ls=new WeakMap,el=new WeakMap,Wl=new WeakMap,Lc=new WeakSet,Wg=function(){var e;return(e=ki(this,el))!=null?e:La(this,el,new ResizeObserver(i=>{for(var o of i){Vc.entries.set(o.target,o);for(var n of ki(this,Ls).get(o.target)||[])n(o)}}))},Gn(Vc,"entries",new WeakMap);var Mp=Vc;var m_=new Mp({box:"border-box"});function ir(t,e,i){var o=m_.observe(t,()=>i(t[e]));So(()=>(yt(()=>i(t[e])),o))}function Kg(t,e){return t===e||(t==null?void 0:t[Bo])===e}function it(t={},e,i,o){return So(()=>{var n,s;return zo(()=>{n=s,s=(o==null?void 0:o())||[],yt(()=>{t!==i(...s)&&(e(t,...s),n&&Kg(i(...n),t)&&e(null,...n))})}),()=>{gn(()=>{s&&Kg(i(...s),t)&&e(null,...s)})}}),t}function Br(t=!1){let e=Vt,i=e.l.u;if(!i)return;let o=()=>Ec(e.s);if(t){let n=0,s={},l=Lr(()=>{let d=!1,a=e.s;for(let p in a)a[p]!==s[p]&&(s[p]=a[p],d=!0);return d&&n++,n});o=()=>r(l)}i.b.length&&Ml(()=>{qg(e,o),ks(i.b)}),Ke(()=>{let n=yt(()=>i.m.map(Cv));return()=>{for(let s of n)typeof s=="function"&&s()}}),i.a.length&&Ke(()=>{qg(e,o),ks(i.a)})}function qg(t,e){if(t.l.s)for(let i of t.l.s)r(i);e()}function Kl(t,e,i){if(t==null)return e(void 0),i&&i(void 0),de;let o=yt(()=>t.subscribe(e,i));return o.unsubscribe?()=>o.unsubscribe():o}var tl=[];function hr(t,e){return{subscribe:se(t,e).subscribe}}function se(t,e=de){let i=null,o=new Set;function n(d){if(Na(t,d)&&(t=d,i)){let a=!tl.length;for(let p of o)p[1](),tl.push(p,t);if(a){for(let p=0;p<tl.length;p+=2)tl[p][0](tl[p+1]);tl.length=0}}}function s(d){n(d(t))}function l(d,a=de){let p=[d,a];return o.add(p),o.size===1&&(i=e(n,s)||de),d(t),()=>{o.delete(p),o.size===0&&i&&(i(),i=null)}}return{set:n,update:s,subscribe:l}}function xi(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 s=e.length<2;return hr(i,(l,d)=>{let a=!1,p=[],f=0,v=de,u=()=>{if(f)return;v();let w=e(o?p[0]:p,l,d);s?l(w):v=typeof w=="function"?w:de},y=n.map((w,x)=>Kl(w,S=>{p[x]=S,f&=~(1<<x),a&&u()},()=>{f|=1<<x}));return a=!0,u(),function(){ks(y),v(),a=!1}})}function xe(t){let e;return Kl(t,i=>e=i)(),e}var Rc=!1,Lp=Symbol();function C(t,e,i){var s;let o=(s=i[e])!=null?s:i[e]={store:null,source:es(void 0),unsubscribe:de};if(o.store!==t&&!(Lp in i))if(o.unsubscribe(),o.store=t!=null?t:null,t==null)o.source.v=void 0,o.unsubscribe=de;else{var n=!0;o.unsubscribe=Kl(t,l=>{n?o.source.v=l:O(o.source,l)}),n=!1}return t&&Lp in i?xe(t):r(o.source)}function He(){let t={};function e(){Do(()=>{for(var i in t)t[i].unsubscribe();ro(t,Lp,{enumerable:!1,value:!0})})}return[t,e]}function Vp(t){var e=Rc;try{return Rc=!1,[t(),Rc]}finally{Rc=e}}var y_={get(t,e){if(!t.exclude.includes(e))return t.props[e]},set(t,e){return Me&&Nv(`${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 Ne(t,e,i){return new Proxy(Me?{props:t,exclude:e,name:i,other:{},to_proxy:[]}:{props:t,exclude:e},y_)}var x_={get(t,e){let i=t.props.length;for(;i--;){let o=t.props[i];if(Is(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];Is(n)&&(n=n());let s=Yo(n,e);if(s&&s.set)return s.set(i),!0}return!1},getOwnPropertyDescriptor(t,e){let i=t.props.length;for(;i--;){let o=t.props[i];if(Is(o)&&(o=o()),typeof o=="object"&&o!==null&&e in o){let n=Yo(o,e);return n&&!n.configurable&&(n.configurable=!0),n}}},has(t,e){if(e===Bo||e===Va)return!1;for(let i of t.props)if(Is(i)&&(i=i()),i!=null&&e in i)return!0;return!1},ownKeys(t){let e=[];for(let i of t.props)if(Is(i)&&(i=i()),!!i){for(let o in i)e.includes(o)||e.push(o);for(let o of Object.getOwnPropertySymbols(i))e.includes(o)||e.push(o)}return e}};function vs(...t){return new Proxy({props:t},x_)}function Qg(t){var e,i;return(i=(e=t.ctx)==null?void 0:e.d)!=null?i:!1}function m(t,e,i,o){var Y,H;var n=(i&1)!==0,s=!Zr||(i&2)!==0,l=(i&8)!==0,d=(i&16)!==0,a=!1,p;l?[p,a]=Vp(()=>t[e]):p=t[e];var f=Bo in t||Va in t,v=l&&((H=(Y=Yo(t,e))==null?void 0:Y.set)!=null?H:f&&e in t&&(F=>t[e]=F))||void 0,u=o,y=!0,w=!1,x=()=>(w=!0,y&&(y=!1,d?u=yt(o):u=o),u);p===void 0&&o!==void 0&&(v&&s&&Rv(e),p=x(),v&&v(p));var S;if(s)S=()=>{var F=t[e];return F===void 0?x():(y=!0,w=!1,F)};else{var T=(n?Lr:Vr)(()=>t[e]);T.f|=131072,S=()=>{var F=r(T);return F!==void 0&&(u=void 0),F===void 0?u:F}}if((i&4)===0&&s)return S;if(v){var E=t.$$legacy;return function(F,W){return arguments.length>0?((!s||!W||E||a)&&v(W?S():F),F):S()}}var V=!1,k=!1,I=es(p),R=Lr(()=>{var F=S(),W=r(I);return V?(V=!1,k=!0,W):(k=!1,I.v=F)});return l&&r(R),n||(R.equals=Oa),function(F,W){if(Cc!==null&&(V=k,S(),r(I)),arguments.length>0){let J=W?r(R):s&&l?ni(F):F;if(!R.equals(J)){if(V=!0,O(I,J),w&&u!==void 0&&(u=J),Qg(R))return F;yt(()=>r(R))}return F}return Qg(R)?R.v:r(R)}}var w_;typeof HTMLElement=="function"&&(w_=class extends HTMLElement{constructor(e,i,o){super();Gn(this,"$$ctor");Gn(this,"$$s");Gn(this,"$$c");Gn(this,"$$cn",!1);Gn(this,"$$d",{});Gn(this,"$$r",!1);Gn(this,"$$p_d",{});Gn(this,"$$l",{});Gn(this,"$$l_u",new Map);Gn(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))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let i=function(s){return l=>{let d=document.createElement("slot");s!=="default"&&(d.name=s),$(l,d)}};var e=i;if(await Promise.resolve(),!this.$$cn||this.$$c)return;let o={},n=S_(this);for(let s of this.$$s)s in n&&(s==="default"&&!this.$$d.children?(this.$$d.children=i(s),o.default=!0):o[s]=i(s));for(let s of this.attributes){let l=this.$$g_p(s.name);l in this.$$d||(this.$$d[l]=Rp(l,s.value,this.$$p_d,"toProp"))}for(let s in this.$$p_d)!(s in this.$$d)&&this[s]!==void 0&&(this.$$d[s]=this[s],delete this[s]);this.$$c=Cg({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:o,$$host:this}}),this.$$me=yc(()=>{zo(()=>{var s;this.$$r=!0;for(let l of qu(this.$$c)){if(!((s=this.$$p_d[l])!=null&&s.reflect))continue;this.$$d[l]=this.$$c[l];let d=Rp(l,this.$$d[l],this.$$p_d,"toAttribute");d==null?this.removeAttribute(this.$$p_d[l].attribute||l):this.setAttribute(this.$$p_d[l].attribute||l,d)}this.$$r=!1})});for(let s in this.$$l)for(let l of this.$$l[s]){let d=this.$$c.$on(s,l);this.$$l_u.set(l,d)}this.$$l={}}}attributeChangedCallback(e,i,o){var n;this.$$r||(e=this.$$g_p(e),this.$$d[e]=Rp(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 qu(this.$$p_d).find(i=>this.$$p_d[i].attribute===e||!this.$$p_d[i].attribute&&i.toLowerCase()===e)||e}});function Rp(t,e,i,o){var s;let n=(s=i[t])==null?void 0:s.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 S_(t){let e={};return t.childNodes.forEach(i=>{e[i.slot||"default"]=!0}),e}var Gg="5";var jg,Yg,Zg;typeof window!="undefined"&&((Zg=(Yg=(jg=window.__svelte)!=null?jg:window.__svelte={}).v)!=null?Zg:Yg.v=new Set).add(Gg);import{areValidLiveRecordSources as m5,clientChecker as ev}from"@vkontakte/videoplayer-core/es2018";import"@vkontakte/videoplayer-core/es2018";import{noop as J1,safeStorage as v5,throttleFn as g5}from"@vkontakte/videoplayer-shared/es2018";import{SeekAction as h5}from"@vkontakte/videoplayer-statistics/es2018";import{InterfaceLanguage as C_,fillWithDefault as T_,VideoQuality as Xg}from"@vkontakte/videoplayer-shared/es2018";var E_={isMobile:void 0,disableInvisibleComponentsTimeout:500,debugLog:!1,devNullLog:!1,defaultLanguage:C_.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:Xg.Q_480P,highQualityLimit:Xg.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,thinStatistics:!1,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,tracer:!1,interactiveGraph:!1,interactiveResponsiveUi:!1,seekToInteractive:!0,interactiveLastFrame:!1,interactiveTextPermanent:!0,interactiveHideTime:!0,interactivePlayPrevChapter:!0,interactiveTimeIndicator:!0,interactiveTimeOpenUri:!1,interactiveAreaControlShadow:!1,interactiveControlsExpectTimeBlinkAnimation:!1,interactiveControlsTapPlace:!1,interactiveControlsFillAnimation:!1,interactiveControlsHideAnimation:!1,interactiveHistoryEndChapterFix:!0,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,qualityDetailsSubMenuEnabled:!1,showSlowVideoNotification:!1,forceAutoQualityWhenSevereStallHappens:!1,timeoutShowSlowVideoNotification:0,maxCountShowSlowVideoNotification:1,forcePlayerDisplayBlock:!1,playbackStatusAnimationDuration:1e3,playbackStatusShow:!1,playbackStatusNextVideoShow:!1,playbackStatusNextVideoAnimationDuration:1e3,initSubtitles:!0,useCallbackForMediaSessionNextPrevClick:!1,usePerformanceFix:!1,userVideoPrefs:!1,savePreferredStatesOnUserActionOnly:!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,usePuid:!0},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,font:null,focusedOutlineWidth:null,focusedOutlineRadius:null,controlsDesktopPaddingHorizontal:null,timelinePaddingHorizontal:null,settingsBackgroundColor:null,controlsGradientHeight:null,controlsGradient:null},userSalt:"0"},Jg=t=>T_(t,E_),eh=t=>Ha("ui-config",t),Et=()=>Da("ui-config");var ql="vk_player_debug_panel_opened";var th="videoplayer",ih="videoplayer";var os={KeyF:"f",KeyK:"k",KeyC:"c",KeyM:"m"},oh=new Set(["ArrowLeft","ArrowRight","KeyL","KeyJ"]),nh=new Set(["Tab","Space","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"]),rh=new Set(["ShiftRight","ShiftLeft"]);var sh=["TIMELINE"],Ql=[...sh,"GRAPH_BUTTON"],Np=[...sh,"PLAY_BUTTON"],Gl=[...Ql,"PLAY_BUTTON"];var ns=(s=>(s.XS="xs",s.S="s",s.M="m",s.L="l",s.XL="xl",s))(ns||{}),aa={xs:0,s:1,m:2,l:3,xl:4};import{assertNonNullable as ah,VERSION as I_}from"@vkontakte/videoplayer-shared/es2018";import{VERSION as k_}from"@vkontakte/videoplayer-core/es2018";import{VERSION as P_}from"@vkontakte/videoplayer-statistics/es2018";var Nc="prod",il="1.1.72";var la=(t,e,i)=>{let o=document.createElement("a");o.href=t,o.download=`${e}.${i}`,o.style.display="none",o.click()};var lh=Symbol("storeContext"),dh=Symbol("microStoresContext"),ch=(t,e)=>{Ha(lh,t),Ha(dh,e),Nc==="dev"&&(window.app={store:t,microStores:e})},Ee=()=>{let t=Da(lh);return ah(t,"Store context is empty!"),t},mo=()=>{let t=Da(dh);return ah(t,"MicroStores context is empty!"),t},ti=(t,e)=>Bc(t,t.getValue(),e),Bc=(t,e,i)=>hr(e,o=>{let n=t.subscribe(s=>{o(s),i==null||i(s)});return()=>n.unsubscribe()}),uh=(t,e,i,o)=>{var R,Y,H,F,W,J,G,ce;let n=t.info,{width:s,height:l}=xe(i.ui.playerSize),d=(Y=(R=n.throughputEstimation$.getValue())==null?void 0:R.toFixed(0))!=null?Y:0,a=(F=(H=n.rttEstimation$.getValue())==null?void 0:H.toFixed(0))!=null?F:0,p=n.isAutoQualityEnabled$.getValue()?"auto":"manual",f=`${il} (core: ${k_}, stat: ${P_}, shared: ${I_})`,v=xe(i.state.errorLog$),u=v.length?`
|
|
45
45
|
`+v.map((ie,ue)=>{var ne;let $e=`${ue}) Type: ${ie.id}
|
|
46
46
|
`,fe=`Message: ${ie.message} (${ie.thrown})
|
|
47
47
|
`,ke=`Trace: ${(ne=ie.thrown)==null?void 0:ne.stack}
|
|
@@ -386,4 +386,4 @@ Try switching the\xA0quality to\xA0Auto.`},Rh=B_;var gs=new Map;gs.set(Oh.EN,Rh)
|
|
|
386
386
|
/* css reset end */.hidden {visibility:hidden;opacity:0;}.out-of-flow {content-visibility:hidden !important;}.overlay-container {pointer-events:none;top:0;left:0;height:100%;width:100%;position:fixed;z-index:var(--overlay-container-z-index);}
|
|
387
387
|
|
|
388
388
|
/* \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 tv(t,e){U(e,!0),q(t,b5);let[i,o]=He(),n=()=>C(Xt,"$isLive$",i),s=()=>C(ct,"$availableSubtitlesList$",i),l=m(e,"sources",7),d=m(e,"store",7),a=m(e,"microStoresRoot",7),p=m(e,"videoConfig",7),f=m(e,"uiConfig",7),v=m(e,"title",7),u=m(e,"thumbUrl",7),y=m(e,"interactiveContainer",7),w=m(e,"interactiveController",7),x=m(e,"subtitles",7),S=m(e,"live",7),T=m(e,"preload",7),E=m(e,"autoplay",7),V=m(e,"volume",7,void 0),k=m(e,"muted",7,void 0),I=m(e,"fromTime",7),R=m(e,"canRewindLive",7),Y=m(e,"showAds",7),H=m(e,"adsSlotId",7,void 0),F=m(e,"adsParams",7,void 0),W=m(e,"adsPreviewParam",7,void 0),J=m(e,"adsAutoplayParam",7,void 0),G=m(e,"duration",7,void 0),ce=m(e,"logoClickable",7),ie=m(e,"logoHidden",7),ue=m(e,"isMobile",7),$e=m(e,"showNextPrevButtons",7,!1),fe=m(e,"nextButtonActive",7,!1),ke=m(e,"prevButtonActive",7,!1),ne=m(e,"endScreenVideoTitle",7,void 0),Ve=m(e,"endScreenVideoThumb",7,void 0),re=m(e,"isOneVideoPlaylist",7,!1),N=m(e,"supportLink",7),Be=m(e,"shadowRootContainer",7),le=m(e,"outerContainerRef",7),ve=m(e,"fullScreenTarget",7,void 0),te=m(e,"failoverHosts",7,void 0),me=m(e,"showMiniTimer",7,!1),De=m(e,"saveRate",7),pe=m(e,"seekToInteractive",7,J1),st=m(e,"playPrevChapter",7,J1),Z=m(e,"volumeMultiplier",7),Ae=m(e,"showAutoplayNext",7),Ie=m(e,"showEndScreen",7,!0),ze=m(e,"keyboardControls",15,void 0),{subscribers:at,stores:ft}=a();eh(f());let mt=Et(),wt=f().logoLink,Ge=d().ui.debugPanelVisible,Bt=d().ui.playerSize,Xt=d().state.isLive$,Ut=d().state.isInteractive&&ev.device.isAndroid,oe=j(void 0),Dt=null,he=j(!1);d().getAdmanWrapper().init({switchFromAdsToVideo:d().actions.internal.switchFromAdsToVideo,switchFromVideoToAds:d().actions.internal.switchFromVideoToAds,setMuted:d().actions.external.setMuted},d().ads,{vsid:d().vsid}),ch(d(),ft),Ke(()=>{var D,Ue;d().ui.isMobile.set(ue()),(Ue=(D=p().callbacks)==null?void 0:D.onDomReady)==null||Ue.call(D)});let we=(D=!1)=>{O(he,!0),D?d().actions.external.firstStart(Y()):d().actions.internal.firstStart(Y())},ae=()=>{if(mt.features.qualityDetailsSubMenuEnabled){let D=Ah(d().videoId);if(D)switch(D.type){case"high_quality":d().actions.internal.setHighQualityEnabled(!0,D.appliesTo);break;case"traffic_saving":d().actions.internal.setTrafficSavingEnabled(!0,D.appliesTo);break;case"exact_quality":d().actions.internal.setQuality(D.quality);break}}else{Mh(d().videoId),Gp()&&d().actions.internal.setTrafficSavingEnabled(!0);let Ue=Wp(d().videoId);Ue&&d().actions.internal.setQuality(Ue)}};function Re(D){var ai,li,go;let Ue=l()||D;Ue&&d().initVideo({container:r(oe),sources:Ue,failoverHosts:te(),subtitles:x(),volumeMultiplier:Z()});let ut=v5.get(ql)==="true";Ge.set(ut),I()>0&&d().actions.external.seekTime(I());let Ht=ue()?mt.volumeDefault:(li=(ai=V())!=null?ai:Dc())!=null?li:mt.volumeDefault,dt=(go=k())!=null?go:Ch();if(d().actions.external.setVolume(Ht),d().actions.external.setMuted(dt),d().getAdmanWrapper().setInitialVolume(dt?0:Ht),ae(),mt.features.saveRate&&De()){let di=Ih();di&&!n()&&d().actions.internal.setPlaybackRate(di)}if(Ae()){let di=Ph();di&&d().actions.internal.setAutoplayNextEnabled(di)}d().ui.isAutoplay.set(E()),E()&&we(),T()&&mt.features.preload&&d().actions.internal.preload()}let qe=D=>{if(window.ResizeObserver){let Ue,ut;Dt=new ResizeObserver(g5(Ht=>{let dt=Ht[0];if(dt.contentBoxSize){let ai=Array.isArray(dt.contentBoxSize)?dt.contentBoxSize[0]:dt.contentBoxSize;Ue=ai.inlineSize,ut=ai.blockSize}else dt.contentRect&&(Ue=dt.contentRect.width,ut=dt.contentRect.height);Bt.set({width:Ue,height:ut})},300)),Dt.observe(D)}Bt.set({width:D.clientWidth,height:D.clientHeight})},Le=()=>{document.hidden&&d().actions.external.stop()};Pt(()=>{var ut,Ht,dt,ai;Ut&&document.addEventListener("visibilitychange",Le),mt.debugLog&&d().actions.internal.startLogging(),qe(r(oe));let D=at.map(li=>li.init({store:d(),microStores:ft,config:p(),interactiveController:w(),uiConfig:f()})),Ue=()=>{Ut&&document.removeEventListener("visibilitychange",Le),Dt==null||Dt.disconnect(),D.forEach(li=>li.unsubscribe()),d().destroy()};return((ut=S())==null?void 0:ut.status)==="upcoming"?(d().actions.internal.setLiveWaitingStart(!0),Ue):((Ht=S())==null?void 0:Ht.status)==="waiting"?(d().actions.internal.setLiveWaitingRecover(!0),Ue):(((dt=S())==null?void 0:dt.status)==="finished"||((ai=S())==null?void 0:ai.status)==="postlive")&&!(l()&&m5(l()))?(d().actions.internal.setLiveWaitingRecord(!0),Ue):(Re(),Ue)});function je(){r(he)?d().actions.external.play():we(!0)}function Oe(){d().actions.external.pause()}function Je(D){d().actions.external.setMuted(D)}function At(){d().actions.external.toggleSubtitle()}function zt(D,Ue){d().actions.external.changeSubtitle(D,Ue)}function et(){var D;(D=d().webApi.slotsApi)!=null&&D.haveSlots()&&d().actions.external.hideControls()}function $i(){var D;(D=d().webApi.slotsApi)!=null&&D.haveSlots()&&d().actions.external.showControls()}function vi(D){ue()||D>=0&&D<=1&&d().actions.external.setVolume(D)}function tt(D){d().actions.internal.seekTime(D,h5.UNKNOWN)}function ii(D){d().actions.external.seekEpisodeStartTime(D)}function Qt(){d().actions.external.returnFocusToEpisodes()}function gi(D){d().actions.external.setPlaybackRate(D)}function Io(D){d().actions.external.setAutoQualityLimits(D)}function vo(){d().actions.external.setQuality("auto")}function Ot(D){d().actions.external.setTrafficSavingEnabled(D)}function ri(D){d().actions.external.setHighQualityEnabled(D)}let on=Iu(mt.view),It=p().playerView==="preview",ct=d().state.availableSubtitlesList$;if(mt.features.initSubtitles){let D=!1;Ke(()=>{if(!D&&s().length){D=!0;let Ue;if(mt.features.userVideoPrefs&&d().videoId){let Ht=zc(mt.userSalt,String(d().videoId));Ht!=null&&Ht.subtitleTrackId&&(Ue=s().find(dt=>dt.value===Ht.subtitleTrackId))}let ut=Yp();ut&&(Ue!=null||(Ue=s().find(Ht=>Ht.language===ut))),d().actions.internal.setSubtitle(Ue)}})}var hi=_5();let ko;var Ui=_(hi);{var oi=D=>{Xm(D,{get store(){return d()},get uiConfig(){return mt},get thumbUrl(){return u()},get interactiveContainer(){return y()},get live(){return S()},get autoplay(){return E()},get canRewindLive(){return R()},get showAds(){return Y()},get adsSlotId(){return H()},get adsParams(){return F()},get adsPreviewParam(){return W()},get adsAutoplayParam(){return J()},get duration(){return G()},get logoClickable(){return ce()},get logoHidden(){return ie()},get logoTargetUrl(){return wt},get nextButtonActive(){return fe()},get prevButtonActive(){return ke()},get endScreenVideoTitle(){return ne()},get endScreenVideoThumb(){return Ve()},get isOneVideoPlaylist(){return re()},get supportLink(){return N()},get shadowRootContainer(){return Be()},get outerContainerRef(){return le()},get fullScreenTarget(){return ve()},get showMiniTimer(){return me()},get playerStarted(){return r(he)},get seekToInteractive(){return pe()},get playPrevChapter(){return st()},firstStart:we,seekTime:tt,get showEndScreen(){return Ie()},get showAutoplayNext(){return Ae()},get showNextPrevButtons(){return $e()},get videoContainer(){return r(oe)},set videoContainer(Ue){O(oe,Ue,!0)}})},Wo=D=>{var Ue=We(),ut=ge(Ue);{var Ht=ai=>{Jm(ai,{get thumbUrl(){return u()},get outsideDuration(){return G()},get canRewindLive(){return R()},get videoContainer(){return r(oe)},set videoContainer(li){O(oe,li,!0)}})},dt=ai=>{Ym(ai,{get store(){return d()},get uiConfig(){return mt},get title(){return v()},get thumbUrl(){return u()},get interactiveContainer(){return y()},get live(){return S()},get autoplay(){return E()},get canRewindLive(){return R()},get showAds(){return Y()},get adsSlotId(){return H()},get adsParams(){return F()},get adsPreviewParam(){return W()},get adsAutoplayParam(){return J()},get duration(){return G()},get logoClickable(){return ce()},get logoHidden(){return ie()},get logoTargetUrl(){return wt},get nextButtonActive(){return fe()},get prevButtonActive(){return ke()},get endScreenVideoTitle(){return ne()},get endScreenVideoThumb(){return Ve()},get isOneVideoPlaylist(){return re()},get supportLink(){return N()},get shadowRootContainer(){return Be()},get outerContainerRef(){return le()},get fullScreenTarget(){return ve()},get showMiniTimer(){return me()},get playerStarted(){return r(he)},get seekToInteractive(){return pe()},get playPrevChapter(){return st()},firstStart:we,get showEndScreen(){return Ie()},get showAutoplayNext(){return Ae()},get showNextPrevButtons(){return $e()},get videoContainer(){return r(oe)},set videoContainer(li){O(oe,li,!0)},get keyboardControls(){return ze()},set keyboardControls(li){ze(li)}})};L(ut,ai=>{It?ai(Ht):ai(dt,!1)})}$(D,Ue)};L(Ui,D=>{ue()?D(oi):D(Wo,!1)})}h(hi),B(D=>{ko=ee(hi,1,"root svelte-16kg8zb",null,ko,D),rt(hi,on)},[()=>({"root--miui-browser":ev.device.isMobile&&ev.browser.isMiuiBrowser,"visible-outside":It})]),$(t,hi);var Dn=z({initVideo:Re,play:je,pause:Oe,setMuted:Je,toggleSubtitle:At,changeSubtitle:zt,hideControls:et,showControls:$i,setVolume:vi,seekTime:tt,seekEpisodeStartTime:ii,returnFocusToEpisodes:Qt,setPlaybackRate:gi,setAutoQualityLimits:Io,setAutoQuality:vo,toggleTrafficSaving:Ot,toggleHighQuality:ri,get sources(){return l()},set sources(D){l(D)},get store(){return d()},set store(D){d(D)},get microStoresRoot(){return a()},set microStoresRoot(D){a(D)},get videoConfig(){return p()},set videoConfig(D){p(D)},get uiConfig(){return f()},set uiConfig(D){f(D)},get title(){return v()},set title(D){v(D)},get thumbUrl(){return u()},set thumbUrl(D){u(D)},get interactiveContainer(){return y()},set interactiveContainer(D){y(D)},get interactiveController(){return w()},set interactiveController(D){w(D)},get subtitles(){return x()},set subtitles(D){x(D)},get live(){return S()},set live(D){S(D)},get preload(){return T()},set preload(D){T(D)},get autoplay(){return E()},set autoplay(D){E(D)},get volume(){return V()},set volume(D){V(D)},get muted(){return k()},set muted(D){k(D)},get fromTime(){return I()},set fromTime(D){I(D)},get canRewindLive(){return R()},set canRewindLive(D){R(D)},get showAds(){return Y()},set showAds(D){Y(D)},get adsSlotId(){return H()},set adsSlotId(D){H(D)},get adsParams(){return F()},set adsParams(D){F(D)},get adsPreviewParam(){return W()},set adsPreviewParam(D){W(D)},get adsAutoplayParam(){return J()},set adsAutoplayParam(D){J(D)},get duration(){return G()},set duration(D){G(D)},get logoClickable(){return ce()},set logoClickable(D){ce(D)},get logoHidden(){return ie()},set logoHidden(D){ie(D)},get isMobile(){return ue()},set isMobile(D){ue(D)},get showNextPrevButtons(){return $e()},set showNextPrevButtons(D){$e(D)},get nextButtonActive(){return fe()},set nextButtonActive(D){fe(D)},get prevButtonActive(){return ke()},set prevButtonActive(D){ke(D)},get endScreenVideoTitle(){return ne()},set endScreenVideoTitle(D){ne(D)},get endScreenVideoThumb(){return Ve()},set endScreenVideoThumb(D){Ve(D)},get isOneVideoPlaylist(){return re()},set isOneVideoPlaylist(D){re(D)},get supportLink(){return N()},set supportLink(D){N(D)},get shadowRootContainer(){return Be()},set shadowRootContainer(D){Be(D)},get outerContainerRef(){return le()},set outerContainerRef(D){le(D)},get fullScreenTarget(){return ve()},set fullScreenTarget(D){ve(D)},get failoverHosts(){return te()},set failoverHosts(D){te(D)},get showMiniTimer(){return me()},set showMiniTimer(D){me(D)},get saveRate(){return De()},set saveRate(D){De(D)},get showAutoplayNext(){return Ae()},set showAutoplayNext(D){Ae(D)},get seekToInteractive(){return pe()},set seekToInteractive(D){pe(D)},get playPrevChapter(){return st()},set playPrevChapter(D){st(D)},get volumeMultiplier(){return Z()},set volumeMultiplier(D){Z(D)},get showEndScreen(){return Ie()},set showEndScreen(D){Ie(D)},get keyboardControls(){return ze()},set keyboardControls(D){ze(D)}});return o(),Dn}var $5=Te('<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 iv(t,e){let i=Ne(e,["$$slots","$$events","$$legacy","children"]);var o=$5();Pe(o,()=>({xmlns:"http://www.w3.org/2000/svg",width:"57",height:"60",fill:"none","aria-hidden":"true","data-testid":"stub-icon",role:"img",...i}));var n=_(o);ye(n,()=>{var s;return(s=e.children)!=null?s:de}),Ce(),h(o),$(t,o)}function ov(t,e){let i=m(e,"isWhite",3,!1),o=g(()=>i()?"color: #fff;":"color: #909499;");iv(t,{get style(){return r(o)}})}var y5=M('<div class="title svelte-1y9fytq"> </div>'),x5=M('<div class="playerStub svelte-1y9fytq"><!> <!></div>'),w5={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 nv(t,e){q(t,w5);var i=x5(),o=_(i);{var n=d=>{var a=y5(),p=_(a,!0);h(a),B(()=>be(p,e.title)),$(d,a)};L(o,d=>{e.title&&d(n)})}var s=P(o,2);{var l=d=>{let a=g(()=>!!e.thumbUrl);ov(d,{get isWhite(){return r(a)}})};L(s,d=>{(!e.title||!e.thumbUrl)&&d(l)})}h(i),B(()=>rt(i,e.thumbUrl?`background-image: url('${e.thumbUrl}')`:"")),$(t,i)}var S5=M('<div class="playerError svelte-m5iv29"><!></div>'),C5={hash:"svelte-m5iv29",code:".playerError.svelte-m5iv29 {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;}"};function rv(t){q(t,C5);var e=S5(),i=_(e);Ca(i,{}),h(e),$(t,e)}import{now as Z5,ValueSubject as X5}from"@vkontakte/videoplayer-shared/es2018";import{cloneDeepWith as J5,InterfaceLanguage as ew,isNonNullable as uv,Logger as tw,Observable as iw,Subscription as a0,once as ow,InternalsExposure as nw,skip as rw,getPlayerId as sw}from"@vkontakte/videoplayer-shared/es2018";import{clientChecker as l0,isMobile as aw}from"@vkontakte/videoplayer-core/es2018";import{OneStat as lw,ThinOneStat as dw,MediascopePixel as cw}from"@vkontakte/videoplayer-statistics/es2018";import{Logger as T5,Subscription as E5}from"@vkontakte/videoplayer-shared/es2018";var ku=class{constructor(){this.subscription=new E5,this.logger=new T5,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,s]of e)try{(o=(i=navigator.mediaSession).setActionHandler)==null||o.call(i,n,s)}catch(l){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 s,l;let o=xe(e.state.currentPlaybackRate$),n=xe(e.state.duration$);if(!(!isFinite(i)||!isFinite(n)))try{(l=(s=navigator.mediaSession).setPositionState)==null||l.call(s,{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()}};import{ValueSubject as lv,detectEmbed as L5}from"@vkontakte/videoplayer-shared/es2018";var I5=Te('<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 sv(t,e){let i=Ne(e,["$$slots","$$events","$$legacy","children"]);var o=I5();Pe(o,()=>({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}));var n=_(o);ye(n,()=>{var s;return(s=e.children)!=null?s:de}),Ce(),h(o),$(t,o)}var k5=M('<div><div><!></div> <span class="title svelte-1pbsod4"> </span></div>'),P5={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 av(t,e){U(e,!0),q(t,P5);let[i,o]=He(),n=()=>C(p,"$interfaceLanguage$",i),s=()=>C(f,"$isMobile$",i),l=Ee(),d=Et(),a=!!l.webApi.pictureInPictureApi,p=l.interfaceLanguage$,f=l.ui.isMobile,v=l.ui.t,u=g(()=>n()&&v("pip_dummy_title")),y=Iu(d.view);var w=k5();let x;var S=_(w);let T;var E=_(S);sv(E,{}),h(S);var V=P(S,2),k=_(V,!0);h(V),h(w),B((I,R)=>{x=ee(w,1,"player-pip-dummy svelte-1pbsod4",null,x,I),rt(w,y),T=ee(S,1,"dummy-image svelte-1pbsod4",null,T,R),be(k,r(u))},[()=>({"is-pip-api":a}),()=>({desktop:!s()})]),$(t,w),z(),o()}var A5=Object.defineProperty,M5=(t,e,i)=>e in t?A5(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,hl=(t,e,i)=>M5(t,typeof e!="symbol"?e+"":e,i),V5=460,R5=280,Hd=class{constructor({enabled:e=!0}={enabled:!0}){hl(this,"playerDomElement"),hl(this,"playerParentShadowRoot"),hl(this,"playerDummyElement"),hl(this,"svelteContext"),hl(this,"pipWindow"),hl(this,"info",{isActive$:new lv(!1),isEnabled$:new lv(!1),type:1}),this.info.isEnabled$=new lv(e)}isSupported(){let{isEmbed:e}=L5();return"documentPictureInPicture"in window&&!e}isActive(){return this.info.isActive$.getValue()}setPlayerDomElement(e,i){this.playerDomElement=e,this.playerParentShadowRoot=i}setContext(e){this.svelteContext=e}async request(){var e,i;if(!this.isSupported()||!this.playerDomElement||!this.playerParentShadowRoot)return;this.pipWindow=await documentPictureInPicture.requestWindow({width:V5,height:R5,copyStyleSheets:!0}),this.pipWindow.document.body.style.margin="0";let o=[...this.playerParentShadowRoot.styleSheets].map(a=>[...a.cssRules].map(p=>p.cssText).join(" ")).filter(Boolean).join(`
|
|
389
|
-
`),n=document.createElement("style");n.textContent=o;let s=this.createStretchedContainer(),l=s.attachShadow({mode:"open"});l.append(n),l.append(this.playerDomElement);let d={target:this.playerParentShadowRoot,context:this.svelteContext};this.playerDummyElement=is(av,d),(e=this.pipWindow)==null||e.document.body.append(s),this.info.isActive$.next(!0),(i=this.pipWindow)==null||i.addEventListener("unload",a=>{!this.playerDomElement||!this.playerParentShadowRoot||!this.playerDummyElement||(oa(this.playerDummyElement),this.playerParentShadowRoot.append(this.playerDomElement),this.info.isActive$.next(!1),this.pipWindow=void 0)})}async exit(){return new Promise(e=>{var i;this.pipWindow&&((i=documentPictureInPicture.window)==null||i.close()),e()})}async dispose(){await this.exit()}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 e0(t){return t instanceof Hd}var Pu=class{static getLatestSupportedVersion(e){let i=new ca(e),o=new Hd(e);if(o.isSupported())return o;if(i.isSupported())return i}};function Fd(t,e){var n,s;let i=new Set([...Object.keys(t),...Object.keys(e)]),o={};for(let l of i)o[l]=(s=(n=e[l])!=null?n:t[l])!=null?s:void 0;return o}var t0="Inner error. Unexpectedly root annotation container null reference exception",i0="Annotation with such name already exists",o0="Annotation with such name does not exist";var _l=class extends Error{constructor(e){super(e),this.name="AnnotationError"}};import{observeElementSize as N5,Subscription as O5,throttleFn as B5}from"@vkontakte/videoplayer-shared/es2018";var D5="1",H5=100,Au=class{constructor(e){this.annotationsInside=e;this.annotations=new Map;this.subscriptions=new O5}init(e){if(this.rootAnnotationsContainer=e,this.annotationsInside)return;let i=B5(()=>{for(let o of this.annotations.values())this.isElementExceedsBoundaries(o,this.playerSize.width,this.playerSize.height)?o.style.visibility="hidden":o.style.visibility="visible"},H5);this.subscriptions.add(N5(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 _l(t0);if(this.annotations.has(e))throw new _l(i0);i.style.zIndex=(o=i.style.zIndex)!=null?o:D5,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 _l(o0);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,s=e.offsetLeft,l=e.offsetWidth,d=e.offsetHeight;return n<0||s<0||s+l>i||n+d>o}registryRootContainer(e){}addLayer(e){return document.createElement("div")}getLayer(e){}removeLayer(e){}clearLayer(e){}detach(){}reattach(){}};import{assertNonNullable as Mu,Subscription as F5}from"@vkontakte/videoplayer-shared/es2018";var tn=class{init({store:e,microStores:i,interactiveController:o,config:n}){return Mu(e),Mu(i),Mu(n),n.interactiveData&&Mu(o),this.subscription=new F5,this.subscription}};var Ud=class extends tn{constructor(){super(...arguments);this.stateName="fakeIsPlaying$";this.state$={...se(null),toggle:()=>this.state$.update(i=>!i)}}init(i){let o=super.init(i),{isInteractiveExpectation$:n}=i.store.state;return o.add(n.subscribe(s=>{this.state$.set(s?!0:null)})),o}};var zd=class extends tn{constructor(){super(...arguments);this.stateName="interactiveControlsOpacity$";this.state$={...se(null),toggle:()=>this.state$.update(i=>!i)}}init(i){let o=super.init(i),{microStores:n,store:s}=i,{fakeIsPlaying$:l}=n,{isInteractiveExpectation$:d,isPlaying$:a}=s.state,{controlsVisible:p,isMobile:f}=s.ui,v=xe(f),u=()=>v&&xe(p);return o.add(p.subscribe(y=>{if(!v)return;let w=xe(l);xe(a)?this.state$.set(y):w!==null&&this.state$.set(!w||y)})),o.add(a.subscribe(y=>{this.state$.set(!y||u())})),o.add(l.subscribe(y=>{if(y===null)return;let w=xe(d);if(u()){this.state$.set(!0);return}w&&this.state$.set(!y)})),o}};var Wd=class extends tn{constructor(){super(...arguments);this.stateName="seekToInteractiveDisabledTooltip$";this.state$=se("tooltip_chapter_without_interactive")}init(i){let o=super.init(i),{store:n}=i;return o.add(n.state.interactiveEpisodes$.subscribe(s=>{s.length&&(s.every(l=>l.completed)?this.state$.set("tooltip_interactive_of_chapter_completed"):this.state$.set("tooltip_disabled_when_interactive"))})),o}};import{combine as U5}from"@vkontakte/videoplayer-shared/es2018";var dv=se(!1),Lu=null,Kd=class extends tn{constructor(){super(...arguments);this.stateName="showInteractiveTimeIndicatorTooltip$";this.state$={...dv,set:(i,o=!1)=>{i!==xe(dv)&&(this.clearTimeout(),dv.set(i),!i&&Lu&&(Lu=!1),i&&o&&(this.timeout=setTimeout(()=>{this.state$.set(!1)},3e3)))},clearTimeout:()=>this.clearTimeout()}}init(i){let o=super.init(i),{store:n,config:s}=i,{isInteractiveTime$:l,isPlaying$:d}=n.state,a=n.ui.controlsVisible,{interactiveTimeIndicator:p}=n.ui.controls;o.add(a.subscribe(v=>{xe(l)&&v&&this.state$.set(!1)}));let f=(s==null?void 0:s.interactiveData)||{tooltipHelpHintActive:!1};return o.add(U5({isPlaying$:d,isInteractiveTime$:l,interactiveTimeIndicator:p}).subscribe(({isPlaying$:v,isInteractiveTime$:u,interactiveTimeIndicator:y})=>{var w,x;if(!(!v||!(y!=null&&y.isDisplayed))){if(!u)return this.state$.set(!1);f.tooltipHelpHintActive&&Lu===null&&(Lu=!0,f.tooltipHelpHintActive=!1,this.state$.set(!0),(x=(w=n.callbacks)==null?void 0:w.onInteractiveTimeIndicatorHintDeactivated)==null||x.call(w))}})),o}clearTimeout(){window.clearTimeout(this.timeout)}};import{combine as z5,noop as W5}from"@vkontakte/videoplayer-shared/es2018";var qd=class extends tn{constructor(){super(...arguments);this.stateName="graphIsOpened$";this.graphMadePause=!1;this.state$={...se(null),toggle:W5};this.checkIfShouldHide=i=>Hs(i,"s")}init(i){let o=super.init(i),{store:n,interactiveController:s}=i,l=n.ui.currentGridType$,d=n.getLogger().createComponentLog("GraphIsOpened microStore");return this.state$.toggle=async()=>{if(this.checkIfShouldHide(xe(l)))return;let a=xe(this.state$),{isEnded$:p,playbackState$:f}=n.state,{disabledControls$:v}=n.ui.controls,u=xe(p),y=xe(f);if(a)try{await(s==null?void 0:s.toggleGraphView(!1)),this.state$.set(!1),v.remove(Np),!u&&this.graphMadePause&&n.actions.internal.play()}catch(w){d({message:"Cant hide graph"})}else{this.graphMadePause=y==="playing";try{await(s==null?void 0:s.toggleGraphView(!0)),this.state$.set(!0),v.add(Np),!u&&this.graphMadePause&&n.actions.internal.pause()}catch(w){d({message:"Cant show graph"})}}},o.add(z5({graphIsOpened:this.state$,currentGridType:l}).subscribe(async({graphIsOpened:a,currentGridType:p})=>{if(this.checkIfShouldHide(p)&&a)try{await(s==null?void 0:s.toggleGraphView(!1)),this.state$.set(!1)}catch(v){d({message:"Cant hide graph"})}})),o}};import{ValueSubject as n0}from"@vkontakte/videoplayer-shared/es2018";var Qd=class extends tn{constructor(){super(...arguments);this.stateName="pictureInPicture$";this.state$={isActive$:se(!1),isEnabled$:se(!1),type$:se(void 0)}}init(i){let o=super.init(i),{store:n}=i,{info:{isActive$:s,isEnabled$:l,type:d}}=n.webApi.pictureInPictureApi||{info:{isActive$:new n0(!1),isEnabled$:new n0(!1)}};return o.add(s.subscribe(a=>{this.state$.isActive$.set(a)})),o.add(l.subscribe(a=>{this.state$.isEnabled$.set(a)})),this.state$.type$.set(d),o}};import{filter as Q5,filterChanged as G5}from"@vkontakte/videoplayer-shared/es2018";import{safeStorage as cv}from"@vkontakte/videoplayer-shared/es2018";var r0=({maxShowCount:t,timeout:e})=>{let i=[t!==0?K5({maxCount:t}):void 0,e!==0?q5({timeout:e}):void 0].filter(o=>!!o);return{notificationShowed:o=>i.forEach(n=>n.notificationShowed(o)),canShowNotification:o=>i.every(n=>n.canShowNotification(o))}},K5=({maxCount:t})=>{let e={};return{notificationShowed:i=>{var o,n;e[i]=((o=e[i])!=null?o:0)+1,cv.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}}},q5=({timeout:t})=>{let e="videoplayer_notifications_manager",i=()=>{try{return JSON.parse(cv.get(e)||"{}")}catch(s){return{}}},o=s=>cv.set(e,JSON.stringify(s)),n=s=>{let l=i();delete l[s],o(l)};return{notificationShowed:s=>{o({...i(),[s]:{timeout:t,launchTime:Date.now()}})},canShowNotification:s=>{let l=i()[s];if(l){let d=Date.now()-l.launchTime>t;return d&&n(s),d}else return!0}}};var Gd=class extends tn{constructor(){super(...arguments);this.stateName="notifications$";this.state$={notificationsToShow$:se({}),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:s,timeoutShowSlowVideoNotification:l,showSlowVideoNotification:d,forceAutoQualityWhenSevereStallHappens:a}}}=i;this.notificationManager=r0({maxShowCount:s,timeout:l});let p=n.getPlayer();return o.add(p.events.severeStallOccured$.pipe(G5(),Q5(f=>f)).subscribe(()=>{d&&!p.info.isAutoQualityEnabled$.getValue()&&this.notificationManager.canShowNotification("slow_video")&&(a&&n.actions.internal.setQuality("auto"),this.state$.showNotification("slow_video"))})),o}};var s0=()=>[Ud,zd,Wd,Kd,qd,Qd,Gd].reduce(({subscribers:t,stores:e},i)=>{let o=new i;return{subscribers:[...t,o],stores:{...e,[o.stateName]:o.state$}}},{subscribers:[],stores:{}});import{devNull as jd}from"@vkontakte/videoplayer-shared/es2018";var Vu=class{constructor(e){this.shadowRoot=e;this.lastFocusedNode=null;this.init=()=>{this.shadowRoot.addEventListener("focusin",this.handleFocusChange)};this.handleFocusChange=()=>{this.lastFocusedNode=this.shadowRoot.activeElement};this.restoreFocus=()=>{var e;(e=this.lastFocusedNode)==null||e.focus()};this.init()}destroy(){this.shadowRoot.removeEventListener("focusin",this.handleFocusChange)}};var j5=Object.defineProperty,Y5=(t,e,i)=>e in t?j5(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Kt=(t,e,i)=>Y5(t,typeof e!="symbol"?e+"":e,i),uw={preload:!0,autoplay:!1,repeat:!1,fromTime:0,canRewindLive:!0,showAds:!1,interfaceLanguage:ew.RU,isCyrillicRelatedInterface:!0,logoClickable:!1,logoHidden:!1,isTouch:aw(),isMediaSessionEnabled:!0,isPictureInPictureEnabled:!0,isAudioDisabled:!1,callbacks:{uiInfo:{}},tuningConfig:{configName:[]},saveRate:!0,volumeMultiplier:1,showEndScreen:!0,showAutoplayNext:!0,showNextPrevButtons:!0},Bn=j(void 0),Ru=class extends HTMLElement{constructor(){super(),Kt(this,"svelteStubComponent"),Kt(this,"svelteRootComponent"),Kt(this,"svelteErrorComponent"),Kt(this,"store"),Kt(this,"microStoresRoot"),Kt(this,"statistics"),Kt(this,"sentry"),Kt(this,"_shadowRoot"),Kt(this,"playerContainer"),Kt(this,"rootContainer"),Kt(this,"shadowRootContainer"),Kt(this,"playerId"),Kt(this,"uiConfig"),Kt(this,"coreConfig"),Kt(this,"statisticsConfig"),Kt(this,"interactiveController"),Kt(this,"interactiveContainer"),Kt(this,"graphMadePause"),Kt(this,"currentPlayingVideoIndex",0),Kt(this,"needToRepeatPlaylist",!1),Kt(this,"videoConfig"),Kt(this,"pictureInPictureApi"),Kt(this,"mediaSessionApi"),Kt(this,"unsubscribePlayerPhaseSubscription"),Kt(this,"logger"),Kt(this,"log"),Kt(this,"subscription"),Kt(this,"interactiveSubscription"),Kt(this,"annotationsApi"),Kt(this,"slotsApi"),Kt(this,"focusManager"),Kt(this,"prevIsid"),Kt(this,"isInited",!1),Kt(this,"internalsExposure",null),Kt(this,"shadowDOMCallbacksDisabled",!1),Kt(this,"fatalError$",new X5(null)),Kt(this,"createOneStat",(e,i={})=>{var o,n,s,l;if(!this.videoConfig)return;let{albumId:d,statPlace:a,statUserSalt:p,statTrackCode:f,statVKAppId:v,refreshStatAuthToken:u,autoplay:y,isMobile:w,isTouch:x,refDomain:S,deviceId:T,interactiveData:E}=Fd(this.videoConfig,i),V=(o=E==null?void 0:E.projectInfo)==null?void 0:o.pid,k=(s=(n=this.interactiveController)==null?void 0:n.state.isReplay$.getValue())!=null?s:!1;k&&(this.prevIsid=void 0);let{unitedVideoId:I,isClip:R=!1}=e;if(this.uiConfig.features.statistics&&I)try{return new lw({movieId:I,albumId:d,place:a,trackCode:f,vkAppId:v,autoplay:(l=y&&!this.interactiveController)!=null?l:!1,mobile:x!=null?x:w,clip:R,refDomain:S,deviceId:T,isPreviewPlayerView:this.videoConfig.playerView==="preview",...V&&(!this.isInited||k)&&{projectId:Number(V)}},{refreshAuthToken:u,userSalt:p,config:this.statisticsConfig,...this.interactiveController&&{useIsid:!0,isid:this.prevIsid}})}catch(H){console.error(H),this.log({message:H.message})}}),jd.create("ui"),this.logger=new tw,this.log=this.logger.createComponentLog("VKVideoPlayer"),this.subscription=new a0,this.interactiveSubscription=new a0,this.graphMadePause=!1,this.fatalError$.subscribe(e=>{this.unmountComponent(this.svelteErrorComponent),e&&(this.unmountComponent(this.svelteStubComponent),this.unmountComponent(this.svelteRootComponent),this.svelteErrorComponent=is(rv,{target:this.playerContainer}))})}connectedCallback(){var e,i;if(this.rootContainer)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,s=ni({title:o,thumbUrl:n}),l={target:this.playerContainer,props:s};this.svelteStubComponent=is(nv,l)}disconnectedCallback(){var e,i,o,n,s,l,d;this.shadowDOMCallbacksDisabled||((e=this.annotationsApi)==null||e.destroy(),(i=this.slotsApi)==null||i.destroy(),(o=this.focusManager)==null||o.destroy(),(n=this.mediaSessionApi)==null||n.destroy(),this.unmountComponent(this.svelteRootComponent),this.unmountComponent(this.svelteStubComponent),this.unmountComponent(this.svelteErrorComponent),this.subscription.unsubscribe(),(s=this.unsubscribePlayerPhaseSubscription)==null||s.call(this),(l=this.interactiveController)==null||l.destroy(),this.interactiveSubscription.unsubscribe(),(d=this.internalsExposure)==null||d.destroy(),jd.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={}){if(!this.videoConfig)return;let{deviceId:o,preload:n,refreshStatAuthToken:s}=Fd(this.videoConfig,i),{unitedVideoId:l}=e;if(this.uiConfig.features.thinStatistics&&l)return new dw.ThinOneStat({deviceId:o,movieId:l,preload:n,isPreviewPlayerView:this.videoConfig.playerView==="preview"},{config:this.statisticsConfig,refreshAuthToken:s})}createPlayer(e,i={},o){var n,s,l,d,a,p,f,v,u,y;if(!this.videoConfig)return;let{albumId:w,statPlace:x,statAuthToken:S,preload:T,autoplay:E,volume:V,muted:k,fromTime:I,canRewindLive:R,supportLink:Y,showAds:H,adsSlotId:F,adsParams:W={},adsPreviewParam:J,adsAutoplayParam:G,interfaceLanguage:ce,isCyrillicRelatedInterface:ie,logoClickable:ue,logoHidden:$e,isMobile:fe,isTouch:ke,isAudioDisabled:ne,isLiveCatchUpMode:Ve,fullScreenTarget:re,failoverHosts:N,canDownload:Be,callbacks:le,interactiveData:ve,showThumbTimer:te,additionalButtons:me=[],additionalSettingsMenuItems:De=[],additionalContextMenuItems:pe=[],repeat:st,saveRate:Z,volumeMultiplier:Ae,showEndScreen:Ie,showAutoplayNext:ze,mediascopePixels:at}=Fd(this.videoConfig,i),{sources:ft,title:mt,thumbUrl:wt,unitedVideoId:Ge,isClip:Bt=!1,duration:Xt,adsParams:qt={},videoEpisodes:Ut,previewThumbsData:oe,subtitles:Dt,live:he}=e;if(!ft&&!he){let Qt=new Error("empty sources and live");this.fatalError$.next(Qt),(n=le.onCrashed)==null||n.call(le,Qt.message);return}let we={...W,...qt},ae=this.getNextVideoInfo(),Re={sources:ft,title:mt,thumbUrl:wt,subtitles:Dt,unitedVideoId:Ge,isClip:Bt,live:he,albumId:w,statPlace:x,autoplay:E,muted:k,volume:V,fromTime:I,canRewindLive:R,showAds:H,adsSlotId:F,adsParams:we,adsPreviewParam:J,adsAutoplayParam:G,duration:Xt,logoClickable:ue,logoHidden:$e,isTouch:ke!=null?ke:fe,repeat:st,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:ae.nextVideoTitle,endScreenVideoThumb:ae.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist()},qe={pictureInPictureApi:this.pictureInPictureApi,annotationsApi:this.annotationsApi,slotsApi:this.slotsApi};this.log({message:`create player, props: ${JSON.stringify(Re)}`});let Le=(s=this.interactiveController)==null?void 0:s.state.statistics$.getValue(),je=(Le==null?void 0:Le.oneStat)||this.createOneStat(e,i),Oe=this.createThinOneStat(e,i),Je;at&&(Je=new cw({pixels:at})),(je||Oe)&&(this.statistics=new pu(je,Oe,Je,Le==null?void 0:Le.statSubscription)),this.uiConfig.features.sentry&&this.uiConfig.sentry.dsn&&new da(this.uiConfig.sentry,{version:il,env:Nc},{movieId:Ge,albumId:w,place:x,autoplay:(l=E&&!this.interactiveController)!=null?l:!1,mobile:ke!=null?ke:fe,clip:Bt}),this.interactiveController&&((p=this.prevIsid)!=null||(this.prevIsid=(a=(d=this.statistics)==null?void 0:d.oneStat)==null?void 0:a.isid$.getValue())),this.sentry={...this.sentry,...da.getInstance()};let zt=!!ve,et=[],$i="tooltip_interactive_go_back_disabled_first";if(zt&&this.interactiveController){let Qt=this.interactiveController.state.isInitialChapter$.getValue(),gi=this.interactiveController.getHistoryState();Qt&&et.push("REPLAY_BUTTON"),this.interactiveController.getIsSeekable().getValue()||et.push("SEEK_TO_INTERACTIVE_BUTTON"),gi.hasPrevChapter$.getValue()||(et.push("PLAY_PREV_CHAPTER_BUTTON"),Qt||(gi.isGoBackLimited$.getValue()?$i="tooltip_interactive_go_back_disabled_limit":$i="tooltip_interactive_go_back_disabled"))}let vi=()=>{var Qt;this.isInited=!1,this.prevIsid=void 0;let gi=(o==null?void 0:o.info.isEnded$.getValue())&&((Qt=this.interactiveController)==null?void 0:Qt.state.isEndChapter$.getValue());le.onReplayInteractiveVideo&&!gi?le.onReplayInteractiveVideo():this.replayInteractiveVideo()};this.store=y1({player:o,interfaceLanguage:ce,isCyrillicRelatedInterface:ie,videoId:Ge,isClip:Bt,isLiveCatchUpMode:Ve,isAudioDisabled:ne,statAuthToken:S,callbacks:le,webApi:qe,videoEpisodes:Ut,previewThumbsData:oe,canDownload:Be,uiConfig:this.uiConfig,coreConfig:this.coreConfig,disabledControls:et,isInteractive:zt,saveRate:Z,interactiveRanges$:(f=this.interactiveController)==null?void 0:f.state.interactiveRanges$,isInteractiveTime$:(v=this.interactiveController)==null?void 0:v.state.isInteractiveTime$,stopPlayer:()=>this.stop(),replayInteractive:vi,playPrevChapterDisabledTooltip:$i,hasInteractiveBranches:!!((y=(u=this.interactiveController)==null?void 0:u.getChapterBranches())!=null&&y.length),additionalButtons:this.uiConfig.features.additionalButtons?me:[],additionalSettingsMenuItems:De!=null?De:[],additionalContextMenuItems:pe!=null?pe:[],playPrevVideo:()=>this.playPrevVideo(),playNextVideo:()=>this.playNextVideo(),looped:st&&this.videoConfig.videos.length===1,statistics:this.statistics,internalsExposure:this.internalsExposure,playerView:this.videoConfig.playerView,playerId:this.playerId});let{stores:tt}=this.microStoresRoot=s0(),ii=()=>{var Qt,gi,Io,vo,Ot,ri;if(!this.store||!this.microStoresRoot||!this.videoConfig)return;this.subscription.add(this.store.state.currentFormat$.subscribe(It=>{var ct;return(ct=le==null?void 0:le.onCurrentFormatChanged)==null?void 0:ct.call(le,It)})),this.subscription.add(tt.interactiveControlsOpacity$.subscribe(It=>{var ct;It!==null&&((ct=this==null?void 0:this.interactiveController)==null||ct.setDisabledControls(It))})),this.subscription.add(this.store.state.throughputEstimation$.subscribe(It=>{var ct;return(ct=le==null?void 0:le.onThroughputEstimationChanged)==null?void 0:ct.call(le,It)})),this.subscription.add(this.store.state.trafficSavingEnabled$.subscribe(It=>{var ct;return(ct=le==null?void 0:le.onTrafficSavingEnabledChanged)==null?void 0:ct.call(le,It)})),this.subscription.add(this.store.state.highQualityEnabled$.subscribe(It=>{var ct;return(ct=le==null?void 0:le.onHighQualityEnabledChanged)==null?void 0:ct.call(le,It)})),this.subscription.add(this.store.state.isAutoQualityEnabled$.subscribe(It=>{var ct;return(ct=le==null?void 0:le.onAutoQualityEnabledChanged)==null?void 0:ct.call(le,!!It)})),this.subscription.add(new iw(It=>{this.store&&this.subscription.add(this.store.state.currentPlaybackRate$.subscribe(ct=>It.next(ct)))}).pipe(rw(1)).subscribe(It=>{var ct;return(ct=le==null?void 0:le.onCurrentPlaybackRateChanged)==null?void 0:ct.call(le,It)})),this.subscription.add(this.store.state.volume$.subscribe(It=>{var ct;return(ct=le==null?void 0:le.onVolumeChange)==null?void 0:ct.call(le,It)})),this.subscription.add(this.store.state.muted$.subscribe(It=>{var ct,hi,ko,Ui;if(It)(ct=le==null?void 0:le.onMute)==null||ct.call(le);else{let oi=(ko=((hi=this.store)==null?void 0:hi.state.volume$)&&xe(this.store.state.volume$))!=null?ko:0;(Ui=le==null?void 0:le.onUnmute)==null||Ui.call(le,oi)}})),this.subscription.add(this.store.state.videoBitrate$.subscribe(It=>{var ct;return(ct=le==null?void 0:le.onVideoBitrateChanged)==null?void 0:ct.call(le,It)})),this.subscription.add(this.store.state.isInteractiveTime$.subscribe(It=>{var ct;let hi=(ct=this.store)==null?void 0:ct.ui.controls.disabledControls$;hi&&(It&&!hi.includes(Ql)&&hi.add(Ql),It||hi.remove(Ql))})),this.subscription.add(this.store.ui.isFullscreen.subscribe(async It=>{var ct;if(!l0.browser.isSamsungBrowser||!It||!this.interactiveController)return;document.fullscreenElement===this.shadowRootContainer&&await this.replayInteractiveChapter((ct=this.videoConfig)==null?void 0:ct.callbacks.onExternalFullscreenExit)})),this.statistics&&this.statistics.oneStat&&this.subscription.add(this.statistics.oneStat.vsid$.subscribe(It=>{var ct;return(ct=le==null?void 0:le.onVSIDChanged)==null?void 0:ct.call(le,It)})),this.initMediaSession(),O(Bn,{interactiveController:this.interactiveController,interactiveContainer:this.interactiveContainer,sources:ft,store:this.store,microStoresRoot:this.microStoresRoot,videoConfig:this.videoConfig,uiConfig:this.uiConfig,title:mt,thumbUrl:wt,subtitles:Dt,live:he,preload:T,autoplay:E,muted:k,volume:V,fromTime:I,canRewindLive:R,supportLink:Y,showAds:H,adsSlotId:F,adsParams:we,adsPreviewParam:J,adsAutoplayParam:G,duration:Xt,logoClickable:ue,logoHidden:$e,isMobile:ke!=null?ke:fe,failoverHosts:N,fullScreenTarget:re,saveRate:Z,shadowRootContainer:this.shadowRootContainer,showMiniTimer:te,outerContainerRef:this.rootContainer,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:ae.nextVideoTitle,endScreenVideoThumb:ae.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist(),playPrevChapter:()=>this.playPrevChapter(),seekToInteractive:()=>this.seekToInteractive(),volumeMultiplier:Ae,showEndScreen:Ie,showAutoplayNext:ze},!0);let on={target:this.playerContainer,props:r(Bn)};this.svelteRootComponent=is(tv,on),this.addPlayerInfoSubscriptions(),this.isInited||(this.isInited=!0,(Io=(gi=(Qt=this.videoConfig)==null?void 0:Qt.callbacks)==null?void 0:gi.onInited)==null||Io.call(gi)),(vo=this.internalsExposure)==null||vo.expose({player:this,videoConfig:this.videoConfig,coreConfig:this.coreConfig,uiConfig:this.uiConfig,statisticsConfig:this.statisticsConfig,logger:this.logger,log:this.log}),this.uiConfig.devNullLog&&((ri=(Ot=this.videoConfig)==null?void 0:Ot.callbacks)!=null&&ri.onDevNullLog)?jd.subscribe("ui",this.videoConfig.callbacks.onDevNullLog):jd.destroy("ui")};this.coreConfig.asyncResolveClientChecker?l0.isInited$.subscribe(Qt=>{Qt&&(console.log("UI SDK async start"),ii())}):ii()}addPlayerInfoSubscriptions(){var e,i;let o=this.store,n=(e=this.microStoresRoot)==null?void 0:e.stores;if(!o||!n)return;let s=(i=this.videoConfig)==null?void 0:i.callbacks;s&&this.subscription.add(o.playerPhase.subscribe(d=>{var a;return(a=s.onPlayerPhaseChanged)==null?void 0:a.call(s,d)})).add(o.state.playbackState$.subscribe(d=>{var a;return d&&((a=s.onPlaybackStateChanged)==null?void 0:a.call(s,d))})).add(o.state.isLive$.subscribe(d=>{var a;return(a=s.onIsLiveChanged)==null?void 0:a.call(s,d)})).add(o.state.isActiveLive$.subscribe(d=>{var a;return(a=s.onIsActiveLiveChanged)==null?void 0:a.call(s,d)})).add(o.state.isAudioAvailable$.subscribe(d=>{var a;return(a=s.onIsAudioAvailableChanged)==null?void 0:a.call(s,d)})).add(o.state.currentQuality$.subscribe(d=>{var a;return(a=s.onCurrentQualityChanged)==null?void 0:a.call(s,d)})).add(o.state.availableQualities$.subscribe(d=>{var a;return(a=s.onAvailableQualitiesChanged)==null?void 0:a.call(s,d.map(({value:p})=>p).filter(p=>p!=="auto"))})).add(o.state.availableAudioStreams$.subscribe(d=>{d.length>1&&s.onAudioLanguagesAvailable&&s.onAudioLanguagesAvailable()})).add(n.pictureInPicture$.isActive$.subscribe(d=>{var a,p;return d?(a=s.onPiPEnter)==null?void 0:a.call(s):(p=s.onPiPExit)==null?void 0:p.call(s)}));let l=s==null?void 0:s.uiInfo;l&&this.subscription.add(o.ui.controlsVisible.subscribe(d=>{var a;return(a=l.onControlsVisibleChanged)==null?void 0:a.call(l,d)})).add(o.ui.isMobile.subscribe(d=>{var a;return(a=l.onIsMobileChanged)==null?void 0:a.call(l,d)})).add(o.ui.playerSize.subscribe(d=>{var a;return(a=l.onPlayerSizeChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.prevButton.subscribe(d=>{var a;return(a=l.onPrevButtonChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.playButton.subscribe(d=>{var a;return(a=l.onPlayButtonChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.replayButton.subscribe(d=>{var a;return(a=l.onReplayButtonChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.nextButton.subscribe(d=>{var a;return(a=l.onNextButtonChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.playPrevChapterButton.subscribe(d=>{var a;return(a=l.onPlayPrevChapterChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.seekToInteractiveButton.subscribe(d=>{var a;return(a=l.onSeekToInteractiveButtonChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.interactiveGraphButton.subscribe(d=>{var a;return(a=l.onGraphButtonChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.liveButton.subscribe(d=>{var a;return(a=l.onLiveButtonChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.time.subscribe(d=>{var a;return(a=l.onTimeUpdateChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.episodes.subscribe(d=>{var a;return(a=l.onEpisodesChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.subtitles.subscribe(d=>{var a;return(a=l.onSubtitlesChanged)==null?void 0:a.call(l,d)})).add(o.ui.controlBlocks.topLeft.subscribe(d=>{var a;return(a=l.onTopLeftControlBlockChanged)==null?void 0:a.call(l,d)})).add(o.ui.controlBlocks.topRight.subscribe(d=>{var a;return(a=l.onTopRightControlBlockChanged)==null?void 0:a.call(l,d)})).add(o.ui.controlBlocks.bottomLeft.subscribe(d=>{var a;return(a=l.onBottomLeftControlBlockChanged)==null?void 0:a.call(l,d)})).add(o.ui.controlBlocks.bottomRight.subscribe(d=>{var a;return(a=l.onBottomRightControlBlockChanged)==null?void 0:a.call(l,d)})).add(o.ui.controlBlocks.middle.subscribe(d=>{var a;return(a=l.onMiddleControlBlockChanged)==null?void 0:a.call(l,d)})).add(o.ui.controlBlocks.bottom.subscribe(d=>{var a;return(a=l.onBottomControlBlockChanged)==null?void 0:a.call(l,d)})).add(o.ui.videoTitleInfo.subscribe(d=>{var a;return(a=l.onTitleChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.settings.subscribe(d=>{var a;return(a=l.onSettingsChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.fullscreen.subscribe(d=>{var a;return(a=l.onFullscreenChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.chromecast.subscribe(d=>{var a;return(a=l.onChromecastChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.pip.subscribe(d=>{var a;return(a=l.onPipChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.vkLogo.subscribe(d=>{var a;return(a=l.onVkLogoChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.interactiveTimeIndicator.subscribe(d=>{var a;return(a=l.onInteractiveTimeIndicatorChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.timeline.subscribe(d=>{var a;return(a=l.onTimelineChanged)==null?void 0:a.call(l,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){var o;if(!this.videoConfig)return;let n=this.videoConfig.videos[this.currentPlayingVideoIndex];if(!n){this.log({message:"no next video"});return}this.isInited&&uv(n.unitedVideoId)&&((o=this.store)==null||o.actions.internal.nextMovie(n.unitedVideoId)),this.unmountComponent(this.svelteRootComponent),this.createPlayer(n,{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)}async initInteractives(){var e,i,o,n,s,l;if((e=this.videoConfig)!=null&&e.interactiveData)try{let{Interactives:d}=await import("@vkontakte/videoplayer-interactive/es2018");this.interactiveContainer=document.createElement("div"),this.interactiveContainer.classList.add("interactive-root");let a=(i=this.store)==null?void 0:i.interfaceLanguage$,p=a?xe(a):this.videoConfig.interfaceLanguage,{projectInfo:f,initChapterId:v,historyApi:u,videoLoader:y}=this.videoConfig.interactiveData;this.interactiveController=new d({parentElement:this.interactiveContainer,fullscreenTargetElement:this.playerContainer,lang:p,graph:this.uiConfig.features.interactiveGraph,projectInfo:f,initChapterId:v,historyApi:u,vkVideoLoader:y,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,isTouch:this.videoConfig.isTouch,animationsFeatureToggles:{areaControlShadow:this.uiConfig.features.interactiveAreaControlShadow,controlsExpectTimeBlinkAnimation:this.uiConfig.features.interactiveControlsExpectTimeBlinkAnimation,controlsTapPlace:this.uiConfig.features.interactiveControlsTapPlace,controlsFillAnimation:this.uiConfig.features.interactiveControlsFillAnimation,controlsHideAnimation:this.uiConfig.features.interactiveControlsHideAnimation},endChapterHistoryFix:this.uiConfig.features.interactiveHistoryEndChapterFix});let{isInteractiveExpectation$:w,isSeekable$:x}=this.interactiveController.state;this.uiConfig.features.seekToInteractive&&this.subscription.add(x.subscribe(T=>{if(!this.isInited)return;let E=this.store;T?E.ui.controls.disabledControls$.remove("SEEK_TO_INTERACTIVE_BUTTON"):E.ui.controls.disabledControls$.add("SEEK_TO_INTERACTIVE_BUTTON")})),this.subscription.add(w.subscribe(T=>{this.store&&this.store.state.isInteractiveExpectation$.set(T)}));let S=!0;if(this.subscription.add(this.interactiveController.events.playerChanged$.subscribe(T=>{if(!this.videoConfig)return;this.videoConfig.videos[this.currentPlayingVideoIndex]={...T.config,title:(f==null?void 0:f.title)||T.config.title};let E=S?this.videoConfig.autoplay:!0;this.createPlayerWithCurrentVideo(T.player,E),S&&(S=!1)})),this.interactiveSubscription.add(this.interactiveController.events.interactiveActionChoice$.subscribe(({type:T,actionType:E})=>{var V,k,I,R,Y,H;if(!this.store||!this.microStoresRoot)return;let F=w.getValue();if(T==="action-choice"&&E==="setRandomBranch"&&(this.microStoresRoot.stores.graphIsOpened$.set(!1),this.store.ui.controls.disabledControls$.remove(Gl)),T==="action-choice-canceled"){let W=xe(this.store.state.isPlaying$)||F;if(((I=(V=this.videoConfig)==null?void 0:V.isTouch)!=null?I:(k=this.videoConfig)!=null&&k.isMobile)&&W){this.store.ui.interactiveHideMobileControls.set(!0);return}(H=(R=this.videoConfig)==null?void 0:(Y=R.callbacks).onDisabledInteractiveClick)==null||H.call(Y)}})),this.interactiveSubscription.add(this.interactiveController.events.interactiveContainerFakeRemoved$.subscribe(({type:T,removeAllOpenURI:E})=>{this.store&&T==="container-fake-removed"&&E&&this.store.ui.controls.disabledControls$.remove(Gl)})),await this.interactiveController.setManifest(this.videoConfig.interactiveData.manifest),(n=(o=this.videoConfig)==null?void 0:o.callbacks)!=null&&n.onInteractiveHistoryChanged){let T=this.interactiveController.getHistoryState();this.subscription.add(T.history$.subscribe(E=>{var V,k,I;E.length&&((I=(k=(V=this.videoConfig)==null?void 0:V.callbacks)==null?void 0:k.onInteractiveHistoryChanged)==null||I.call(k,E))}))}(l=(s=this.videoConfig)==null?void 0:s.callbacks)!=null&&l.onInteractiveChapterChanged&&this.subscription.add(this.interactiveController.events.chapterChanged$.subscribe(T=>{var E,V,k;(k=(E=this.videoConfig)==null?void 0:(V=E.callbacks).onInteractiveChapterChanged)==null||k.call(V,T.chapter,T.manifestVideo)})),this.uiConfig.features.interactiveTimeIndicator&&this.subscription.add(this.interactiveController.events.noInteraction$.subscribe(()=>{var T,E,V,k;(T=this.microStoresRoot)==null||T.stores.showInteractiveTimeIndicatorTooltip$.set(!0,!0),(k=(E=this.videoConfig)==null?void 0:(V=E.callbacks).onInteractiveTimeIndicatorClick)==null||k.call(V)})),this.interactiveSubscription.add(this.interactiveController.events.error$.subscribe(T=>{this.log({message:T.toString()})}))}catch(d){this.log({message:d.message})}}initPlayer(e,i={}){var o,n,s,l,d,a,p,f,v,u,y,w,x,S,T,E,V,k,I,R,Y,H,F,W,J,G,ce,ie;if(!Array.isArray(e.videos)||e.videos.length===0&&!e.interactiveData){let ue=new Error("empty videos");this.fatalError$.next(ue),(n=(o=e.callbacks)==null?void 0:o.onCrashed)==null||n.call(o,ue.message);return}else this.fatalError$.next(null);if(this.videoConfig=Fd(uw,J5(e,ue=>ue instanceof HTMLElement?ue:void 0)),this.playerId=sw(e.playerId),this.uiConfig=Jg((s=i.ui)!=null?s:{}),this.coreConfig=(l=i.core)!=null?l:{configName:[]},this.statisticsConfig=(d=i.statistics)!=null?d:{},this.uiConfig.features.forcePlayerDisplayBlock&&(this.rootContainer&&(this.rootContainer.style.minHeight="unset"),this.style.display="block",this.style.width="100%",this.style.height="100%"),this.videoConfig.playerView==="preview"&&(this.playerContainer.style.contain="none"),this.sentry={config:(a=this.uiConfig.sentry)!=null?a:{}},this.uiConfig.features.exposeInternalsToGlobal&&((p=this.internalsExposure)!=null||(this.internalsExposure=new nw("ui",this.playerId))),jd.push("ui",{key:"videoplayer_embed",strings:["new","player_init_player","ads.enable: "+this.uiConfig.ads.enable,"showAds: "+((f=this.videoConfig)==null?void 0:f.showAds)],numbers:[Z5()]}),uv(this.videoConfig.isMediaSessionEnabled)&&(this.uiConfig.features.mediaSession=(u=(v=this.uiConfig.features.mediaSession)!=null?v:this.videoConfig.isMediaSessionEnabled)!=null?u:!0),uv(this.videoConfig.isPictureInPictureEnabled)&&(this.uiConfig.features.pip=(w=(y=this.uiConfig.features.pip)!=null?y:this.videoConfig.isPictureInPictureEnabled)!=null?w:!0,this.uiConfig.features.dpip=(S=(x=this.uiConfig.features.dpip)!=null?x:this.videoConfig.isPictureInPictureEnabled)!=null?S:!0),this.videoConfig.isTouch=(E=(T=this.uiConfig.isMobile)!=null?T:this.videoConfig.isTouch)!=null?E:this.videoConfig.isMobile,(V=this.videoConfig).autoplay&&(V.autoplay=this.uiConfig.features.autoplay),this.videoConfig.showAds=(k=this.uiConfig.ads.enable)!=null?k:this.videoConfig.showAds,this.videoConfig.adsSlotId=(I=this.uiConfig.ads.slot)!=null?I:this.videoConfig.adsSlotId,this.videoConfig.adsPreviewParam=(R=this.uiConfig.ads.preview)!=null?R:this.videoConfig.adsPreviewParam,this.videoConfig.logoHidden=!((Y=this.uiConfig.showLogo)!=null?Y:!this.videoConfig.logoHidden),(H=this.videoConfig).canRewindLive&&(H.canRewindLive=this.uiConfig.features.liveRewind),this.videoConfig.supportLink=(F=this.videoConfig.supportLink)!=null?F:this.uiConfig.supportLink,this.videoConfig.showEndScreen=(W=this.uiConfig.features.endScreen)!=null?W:this.videoConfig.showEndScreen,this.videoConfig.showAutoplayNext=(J=this.uiConfig.features.autoplayNext)!=null?J:this.videoConfig.showAutoplayNext,this.videoConfig.showNextPrevButtons=(G=this.uiConfig.features.nextPrevButtons)!=null?G:this.videoConfig.showNextPrevButtons,this.currentPlayingVideoIndex=this.videoConfig.videoIndex&&((ce=this.videoConfig.videos)!=null&&ce[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=Pu.getLatestSupportedVersion(ue):this.pictureInPictureApi=new ca(ue)}this.mediaSessionApi=this.uiConfig.features.mediaSession?new ku:void 0,this.slotsApi=this.uiConfig.features.slots?new Cu:void 0,this.annotationsApi=this.uiConfig.features.annotations?new Au(this.uiConfig.features.annotationsInside):void 0,this.annotationsApi&&!this.uiConfig.features.annotationsInside&&this.annotationsApi.init(this.rootContainer),this.unmountComponent(this.svelteStubComponent),this.unmountComponent(this.svelteRootComponent),this.unmountComponent(this.svelteErrorComponent),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]),e0(this.pictureInPictureApi)&&this.pictureInPictureApi.setPlayerDomElement(this.playerContainer,this._shadowRoot),(ie=this.slotsApi)==null||ie.init(this.shadowRootContainer,this.store),this.focusManager=this._shadowRoot?new Vu(this._shadowRoot):void 0}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(Bn)&&(r(Bn).showNextPrevButtons=this.needToShowNextPrevButtons(),r(Bn).nextButtonActive=this.isNextButtonActive(),r(Bn).prevButtonActive=this.isPrevButtonActive(),r(Bn).endScreenVideoTitle=o.nextVideoTitle,r(Bn).endScreenVideoThumb=o.nextVideoThumb,r(Bn).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}={...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",()=>{var n,s,l;if(this.uiConfig.features.useCallbackForMediaSessionNextPrevClick)try{(l=(s=(n=this.videoConfig)==null?void 0:n.callbacks)==null?void 0:s.onNextVideoClick)==null||l.call(s)}catch(d){this.log({message:"onNextVideoClick callback failed to execute"})}else this.playNextVideo()}]),this.currentPlayingVideoIndex>0&&o.push(["previoustrack",()=>{var n,s,l;if(this.uiConfig.features.useCallbackForMediaSessionNextPrevClick)try{(l=(s=(n=this.videoConfig)==null?void 0:n.callbacks)==null?void 0:s.onPrevVideoClick)==null||l.call(s)}catch(d){this.log({message:"onPrevVideoClick callback failed to execute"})}else 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})}}moveTo(e){this.shadowDOMCallbacksDisabled=!0,e.append(this),this.shadowDOMCallbacksDisabled=!1}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)}toggleSubtitle(){var e;this.log({message:"toggle subtitle"}),(e=this.svelteRootComponent)==null||e.toggleSubtitle()}changeSubtitle(e,i){var o;this.log({message:"change subtitle"}),(o=this.svelteRootComponent)==null||o.changeSubtitle(e,i)}hideControls(){var e;this.log({message:"hide controls"}),(e=this.svelteRootComponent)==null||e.hideControls()}showControls(){var e;this.log({message:"show controls"}),(e=this.svelteRootComponent)==null||e.showControls()}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(Bn)&&(r(Bn).needToRepeatPlaylist=this.needToRepeatPlaylist,r(Bn).showNextPrevButtons=this.needToShowNextPrevButtons(),r(Bn).nextButtonActive=this.isNextButtonActive(),r(Bn).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)}setAutoQuality(){var e;(e=this.svelteRootComponent)==null||e.setAutoQuality()}toggleTrafficSaving(e){var i;(i=this.svelteRootComponent)==null||i.toggleTrafficSaving(e)}toggleHighQuality(e){var i;(i=this.svelteRootComponent)==null||i.toggleHighQuality(e)}addLanguage(e){var i;(i=this.store)==null||i.actions.internal.addLanguage(e)}async setLanguage(e){var i;await((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})}setLiveWaitingStart(){var e;this.log({message:"live waiting"}),(e=this.store)==null||e.actions.internal.setLiveWaitingStart(!0)}isLiveTailPlaying(){var e;let i=(e=this.store)==null?void 0:e.getPlayer();if(!i)return!1;let{info:o}=i;return window.console.log(`VP-4613: VP: isLiveTailPlaying: atLiveEdge$ = ${o.atLiveEdge$.getValue()}, isStalled$ = ${o.isStalled$.getValue()}`),o.canPlayLiveTailBuffer$.getValue()&&!o.isStalled$.getValue()&&!o.atLiveEdge$.getValue()}setLiveWaitingRecover(e=!1){var i;let o=this.isLiveTailPlaying(),n=e||!o;this.log({message:`live waiting recover: forceImmediate = ${e}, liveTailPlaying = ${o}`}),window.console.log(`VP-4613: VP: live waiting recover: liveTailPlaying = ${o} immediate = ${n}`);let s=()=>{var l;(l=this.store)==null||l.actions.internal.setLiveWaitingRecover(!0)};n&&s(),(i=this.store)!=null&&i.callbacks&&(this.store.callbacks.onLiveEnded=()=>{var l;n||s(),(l=this.store)==null||l.destroy()})}setLiveWaitingRecord(){var e;let i=this.isLiveTailPlaying(),o=!i;this.log({message:`live waiting record: liveTailPlaying = ${i}`});let n=()=>{var s;(s=this.store)==null||s.actions.internal.setLiveWaitingRecord(!0)};o&&n(),(e=this.store)!=null&&e.callbacks&&(this.store.callbacks.onLiveEnded=()=>{var s;o||n(),(s=this.store)==null||s.destroy()})}setLiveEnd(e){var i;let o=this.isLiveTailPlaying(),n=!o;this.log({message:`live ended: liveTailPlaying = ${o}`});let s=()=>{var l,d;(l=this.store)==null||l.actions.internal.setLiveWaitingRecover(!1),(d=this.store)==null||d.actions.internal.setLiveWaitingRecord(!1),this.unmountComponent(this.svelteRootComponent),this.createPlayer(e,{autoplay:!1})};if(n){s();return}(i=this.store)!=null&&i.callbacks&&(this.store.callbacks.onLiveEnded=s)}setLiveLowLatency(e){var i;this.log({message:"live switch to low latency "+e}),(i=this.store)==null||i.actions.external.setLiveLowLatency(e)}setLooped(e){var i;(i=this.store)==null||i.actions.internal.setLooped(e)}getDebugData(){var e,i;return(i=(e=this.store)==null?void 0:e.actions.internal.getDebugTextData())!=null?i:""}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()}async replayInteractiveChapter(e){var i,o;if(this.interactiveController&&((i=this.store)!=null&&i.state.positionExact$)){let n=xe(this.store.state.positionExact$),l=xe(this.store.state.interactiveEpisodes$).find(a=>!a.completed);this.interactiveController.events.playerChanged$.pipe(ow()).subscribe(()=>{l&&n>=l.time?this.seekTime(l.time):this.seekTime(n),e==null||e()});let d=this.interactiveController.getCurrentChapter();await 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)}togglePictureInPicture(){var e;(e=this.store)==null||e.actions.internal.togglePictureInPicture()}focus(){var e,i,o;(o=(i=(e=this.svelteRootComponent)==null?void 0:e.keyboardControls)==null?void 0:i.focus)==null||o.call(i)}restoreFocus(){var e;(e=this.focusManager)==null||e.restoreFocus()}handleExternalKeyboardEvent(e){var i,o;return!!((o=(i=this.svelteRootComponent)==null?void 0:i.keyboardControls)!=null&&o.handleExternalKeyboardEvent(e))}setAutoplayNext(e){var i;(i=this.store)==null||i.actions.internal.setAutoplayNextEnabled(e)}unmountComponent(e){e&&oa(e)}};import{InterfaceLanguage as uee,VKNumericLanguage as pee,loadVKLangPack as fee}from"@vkontakte/videoplayer-shared/es2018";import{VideoQuality as vee,VideoFormat as gee}from"@vkontakte/videoplayer-core/es2018";var oee=()=>{window.customElements.define("vk-video-player",Ru)};export{fu as ControlButtonType,ns as GridTypes,uee as InterfaceLanguage,rd as MenuItemType,hs as PlayerPhase,il as VERSION,pee as VKNumericLanguage,gee as VideoFormat,vee as VideoQuality,fee as loadVKLangPack,oee as registerPlayerWebComponent};
|
|
389
|
+
`),n=document.createElement("style");n.textContent=o;let s=this.createStretchedContainer(),l=s.attachShadow({mode:"open"});l.append(n),l.append(this.playerDomElement);let d={target:this.playerParentShadowRoot,context:this.svelteContext};this.playerDummyElement=is(av,d),(e=this.pipWindow)==null||e.document.body.append(s),this.info.isActive$.next(!0),(i=this.pipWindow)==null||i.addEventListener("unload",a=>{!this.playerDomElement||!this.playerParentShadowRoot||!this.playerDummyElement||(oa(this.playerDummyElement),this.playerParentShadowRoot.append(this.playerDomElement),this.info.isActive$.next(!1),this.pipWindow=void 0)})}async exit(){return new Promise(e=>{var i;this.pipWindow&&((i=documentPictureInPicture.window)==null||i.close()),e()})}async dispose(){await this.exit()}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 e0(t){return t instanceof Hd}var Pu=class{static getLatestSupportedVersion(e){let i=new ca(e),o=new Hd(e);if(o.isSupported())return o;if(i.isSupported())return i}};function Fd(t,e){var n,s;let i=new Set([...Object.keys(t),...Object.keys(e)]),o={};for(let l of i)o[l]=(s=(n=e[l])!=null?n:t[l])!=null?s:void 0;return o}var t0="Inner error. Unexpectedly root annotation container null reference exception",i0="Annotation with such name already exists",o0="Annotation with such name does not exist";var _l=class extends Error{constructor(e){super(e),this.name="AnnotationError"}};import{observeElementSize as N5,Subscription as O5,throttleFn as B5}from"@vkontakte/videoplayer-shared/es2018";var D5="1",H5=100,Au=class{constructor(e){this.annotationsInside=e;this.annotations=new Map;this.subscriptions=new O5}init(e){if(this.rootAnnotationsContainer=e,this.annotationsInside)return;let i=B5(()=>{for(let o of this.annotations.values())this.isElementExceedsBoundaries(o,this.playerSize.width,this.playerSize.height)?o.style.visibility="hidden":o.style.visibility="visible"},H5);this.subscriptions.add(N5(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 _l(t0);if(this.annotations.has(e))throw new _l(i0);i.style.zIndex=(o=i.style.zIndex)!=null?o:D5,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 _l(o0);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,s=e.offsetLeft,l=e.offsetWidth,d=e.offsetHeight;return n<0||s<0||s+l>i||n+d>o}registryRootContainer(e){}addLayer(e){return document.createElement("div")}getLayer(e){}removeLayer(e){}clearLayer(e){}detach(){}reattach(){}};import{assertNonNullable as Mu,Subscription as F5}from"@vkontakte/videoplayer-shared/es2018";var tn=class{init({store:e,microStores:i,interactiveController:o,config:n}){return Mu(e),Mu(i),Mu(n),n.interactiveData&&Mu(o),this.subscription=new F5,this.subscription}};var Ud=class extends tn{constructor(){super(...arguments);this.stateName="fakeIsPlaying$";this.state$={...se(null),toggle:()=>this.state$.update(i=>!i)}}init(i){let o=super.init(i),{isInteractiveExpectation$:n}=i.store.state;return o.add(n.subscribe(s=>{this.state$.set(s?!0:null)})),o}};var zd=class extends tn{constructor(){super(...arguments);this.stateName="interactiveControlsOpacity$";this.state$={...se(null),toggle:()=>this.state$.update(i=>!i)}}init(i){let o=super.init(i),{microStores:n,store:s}=i,{fakeIsPlaying$:l}=n,{isInteractiveExpectation$:d,isPlaying$:a}=s.state,{controlsVisible:p,isMobile:f}=s.ui,v=xe(f),u=()=>v&&xe(p);return o.add(p.subscribe(y=>{if(!v)return;let w=xe(l);xe(a)?this.state$.set(y):w!==null&&this.state$.set(!w||y)})),o.add(a.subscribe(y=>{this.state$.set(!y||u())})),o.add(l.subscribe(y=>{if(y===null)return;let w=xe(d);if(u()){this.state$.set(!0);return}w&&this.state$.set(!y)})),o}};var Wd=class extends tn{constructor(){super(...arguments);this.stateName="seekToInteractiveDisabledTooltip$";this.state$=se("tooltip_chapter_without_interactive")}init(i){let o=super.init(i),{store:n}=i;return o.add(n.state.interactiveEpisodes$.subscribe(s=>{s.length&&(s.every(l=>l.completed)?this.state$.set("tooltip_interactive_of_chapter_completed"):this.state$.set("tooltip_disabled_when_interactive"))})),o}};import{combine as U5}from"@vkontakte/videoplayer-shared/es2018";var dv=se(!1),Lu=null,Kd=class extends tn{constructor(){super(...arguments);this.stateName="showInteractiveTimeIndicatorTooltip$";this.state$={...dv,set:(i,o=!1)=>{i!==xe(dv)&&(this.clearTimeout(),dv.set(i),!i&&Lu&&(Lu=!1),i&&o&&(this.timeout=setTimeout(()=>{this.state$.set(!1)},3e3)))},clearTimeout:()=>this.clearTimeout()}}init(i){let o=super.init(i),{store:n,config:s}=i,{isInteractiveTime$:l,isPlaying$:d}=n.state,a=n.ui.controlsVisible,{interactiveTimeIndicator:p}=n.ui.controls;o.add(a.subscribe(v=>{xe(l)&&v&&this.state$.set(!1)}));let f=(s==null?void 0:s.interactiveData)||{tooltipHelpHintActive:!1};return o.add(U5({isPlaying$:d,isInteractiveTime$:l,interactiveTimeIndicator:p}).subscribe(({isPlaying$:v,isInteractiveTime$:u,interactiveTimeIndicator:y})=>{var w,x;if(!(!v||!(y!=null&&y.isDisplayed))){if(!u)return this.state$.set(!1);f.tooltipHelpHintActive&&Lu===null&&(Lu=!0,f.tooltipHelpHintActive=!1,this.state$.set(!0),(x=(w=n.callbacks)==null?void 0:w.onInteractiveTimeIndicatorHintDeactivated)==null||x.call(w))}})),o}clearTimeout(){window.clearTimeout(this.timeout)}};import{combine as z5,noop as W5}from"@vkontakte/videoplayer-shared/es2018";var qd=class extends tn{constructor(){super(...arguments);this.stateName="graphIsOpened$";this.graphMadePause=!1;this.state$={...se(null),toggle:W5};this.checkIfShouldHide=i=>Hs(i,"s")}init(i){let o=super.init(i),{store:n,interactiveController:s}=i,l=n.ui.currentGridType$,d=n.getLogger().createComponentLog("GraphIsOpened microStore");return this.state$.toggle=async()=>{if(this.checkIfShouldHide(xe(l)))return;let a=xe(this.state$),{isEnded$:p,playbackState$:f}=n.state,{disabledControls$:v}=n.ui.controls,u=xe(p),y=xe(f);if(a)try{await(s==null?void 0:s.toggleGraphView(!1)),this.state$.set(!1),v.remove(Np),!u&&this.graphMadePause&&n.actions.internal.play()}catch(w){d({message:"Cant hide graph"})}else{this.graphMadePause=y==="playing";try{await(s==null?void 0:s.toggleGraphView(!0)),this.state$.set(!0),v.add(Np),!u&&this.graphMadePause&&n.actions.internal.pause()}catch(w){d({message:"Cant show graph"})}}},o.add(z5({graphIsOpened:this.state$,currentGridType:l}).subscribe(async({graphIsOpened:a,currentGridType:p})=>{if(this.checkIfShouldHide(p)&&a)try{await(s==null?void 0:s.toggleGraphView(!1)),this.state$.set(!1)}catch(v){d({message:"Cant hide graph"})}})),o}};import{ValueSubject as n0}from"@vkontakte/videoplayer-shared/es2018";var Qd=class extends tn{constructor(){super(...arguments);this.stateName="pictureInPicture$";this.state$={isActive$:se(!1),isEnabled$:se(!1),type$:se(void 0)}}init(i){let o=super.init(i),{store:n}=i,{info:{isActive$:s,isEnabled$:l,type:d}}=n.webApi.pictureInPictureApi||{info:{isActive$:new n0(!1),isEnabled$:new n0(!1)}};return o.add(s.subscribe(a=>{this.state$.isActive$.set(a)})),o.add(l.subscribe(a=>{this.state$.isEnabled$.set(a)})),this.state$.type$.set(d),o}};import{filter as Q5,filterChanged as G5}from"@vkontakte/videoplayer-shared/es2018";import{safeStorage as cv}from"@vkontakte/videoplayer-shared/es2018";var r0=({maxShowCount:t,timeout:e})=>{let i=[t!==0?K5({maxCount:t}):void 0,e!==0?q5({timeout:e}):void 0].filter(o=>!!o);return{notificationShowed:o=>i.forEach(n=>n.notificationShowed(o)),canShowNotification:o=>i.every(n=>n.canShowNotification(o))}},K5=({maxCount:t})=>{let e={};return{notificationShowed:i=>{var o,n;e[i]=((o=e[i])!=null?o:0)+1,cv.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}}},q5=({timeout:t})=>{let e="videoplayer_notifications_manager",i=()=>{try{return JSON.parse(cv.get(e)||"{}")}catch(s){return{}}},o=s=>cv.set(e,JSON.stringify(s)),n=s=>{let l=i();delete l[s],o(l)};return{notificationShowed:s=>{o({...i(),[s]:{timeout:t,launchTime:Date.now()}})},canShowNotification:s=>{let l=i()[s];if(l){let d=Date.now()-l.launchTime>t;return d&&n(s),d}else return!0}}};var Gd=class extends tn{constructor(){super(...arguments);this.stateName="notifications$";this.state$={notificationsToShow$:se({}),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:s,timeoutShowSlowVideoNotification:l,showSlowVideoNotification:d,forceAutoQualityWhenSevereStallHappens:a}}}=i;this.notificationManager=r0({maxShowCount:s,timeout:l});let p=n.getPlayer();return o.add(p.events.severeStallOccured$.pipe(G5(),Q5(f=>f)).subscribe(()=>{d&&!p.info.isAutoQualityEnabled$.getValue()&&this.notificationManager.canShowNotification("slow_video")&&(a&&n.actions.internal.setQuality("auto"),this.state$.showNotification("slow_video"))})),o}};var s0=()=>[Ud,zd,Wd,Kd,qd,Qd,Gd].reduce(({subscribers:t,stores:e},i)=>{let o=new i;return{subscribers:[...t,o],stores:{...e,[o.stateName]:o.state$}}},{subscribers:[],stores:{}});import{devNull as jd}from"@vkontakte/videoplayer-shared/es2018";var Vu=class{constructor(e){this.shadowRoot=e;this.lastFocusedNode=null;this.init=()=>{this.shadowRoot.addEventListener("focusin",this.handleFocusChange)};this.handleFocusChange=()=>{this.lastFocusedNode=this.shadowRoot.activeElement};this.restoreFocus=()=>{var e;(e=this.lastFocusedNode)==null||e.focus()};this.init()}destroy(){this.shadowRoot.removeEventListener("focusin",this.handleFocusChange)}};var j5=Object.defineProperty,Y5=(t,e,i)=>e in t?j5(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Kt=(t,e,i)=>Y5(t,typeof e!="symbol"?e+"":e,i),uw={preload:!0,autoplay:!1,repeat:!1,fromTime:0,canRewindLive:!0,showAds:!1,interfaceLanguage:ew.RU,isCyrillicRelatedInterface:!0,logoClickable:!1,logoHidden:!1,isTouch:aw(),isMediaSessionEnabled:!0,isPictureInPictureEnabled:!0,isAudioDisabled:!1,callbacks:{uiInfo:{}},tuningConfig:{configName:[]},saveRate:!0,volumeMultiplier:1,showEndScreen:!0,showAutoplayNext:!0,showNextPrevButtons:!0},Bn=j(void 0),Ru=class extends HTMLElement{constructor(){super(),Kt(this,"svelteStubComponent"),Kt(this,"svelteRootComponent"),Kt(this,"svelteErrorComponent"),Kt(this,"store"),Kt(this,"microStoresRoot"),Kt(this,"statistics"),Kt(this,"sentry"),Kt(this,"_shadowRoot"),Kt(this,"playerContainer"),Kt(this,"rootContainer"),Kt(this,"shadowRootContainer"),Kt(this,"playerId"),Kt(this,"uiConfig"),Kt(this,"coreConfig"),Kt(this,"statisticsConfig"),Kt(this,"interactiveController"),Kt(this,"interactiveContainer"),Kt(this,"graphMadePause"),Kt(this,"currentPlayingVideoIndex",0),Kt(this,"needToRepeatPlaylist",!1),Kt(this,"videoConfig"),Kt(this,"pictureInPictureApi"),Kt(this,"mediaSessionApi"),Kt(this,"unsubscribePlayerPhaseSubscription"),Kt(this,"logger"),Kt(this,"log"),Kt(this,"subscription"),Kt(this,"interactiveSubscription"),Kt(this,"annotationsApi"),Kt(this,"slotsApi"),Kt(this,"focusManager"),Kt(this,"prevIsid"),Kt(this,"isInited",!1),Kt(this,"internalsExposure",null),Kt(this,"shadowDOMCallbacksDisabled",!1),Kt(this,"fatalError$",new X5(null)),Kt(this,"createOneStat",(e,i={})=>{var o,n,s,l;if(!this.videoConfig)return;let{albumId:d,statPlace:a,statUserSalt:p,statTrackCode:f,statVKAppId:v,refreshStatAuthToken:u,autoplay:y,isMobile:w,isTouch:x,refDomain:S,deviceId:T,interactiveData:E}=Fd(this.videoConfig,i),V=(o=E==null?void 0:E.projectInfo)==null?void 0:o.pid,k=(s=(n=this.interactiveController)==null?void 0:n.state.isReplay$.getValue())!=null?s:!1;k&&(this.prevIsid=void 0);let{unitedVideoId:I,isClip:R=!1}=e;if(this.uiConfig.features.statistics&&I)try{return new lw({movieId:I,albumId:d,place:a,trackCode:f,vkAppId:v,autoplay:(l=y&&!this.interactiveController)!=null?l:!1,mobile:x!=null?x:w,clip:R,refDomain:S,deviceId:T,isPreviewPlayerView:this.videoConfig.playerView==="preview",...V&&(!this.isInited||k)&&{projectId:Number(V)}},{refreshAuthToken:u,userSalt:p,config:this.statisticsConfig,...this.interactiveController&&{useIsid:!0,isid:this.prevIsid}})}catch(H){console.error(H),this.log({message:H.message})}}),jd.create("ui"),this.logger=new tw,this.log=this.logger.createComponentLog("VKVideoPlayer"),this.subscription=new a0,this.interactiveSubscription=new a0,this.graphMadePause=!1,this.fatalError$.subscribe(e=>{this.unmountComponent(this.svelteErrorComponent),e&&(this.unmountComponent(this.svelteStubComponent),this.unmountComponent(this.svelteRootComponent),this.svelteErrorComponent=is(rv,{target:this.playerContainer}))})}connectedCallback(){var e,i;if(this.rootContainer)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,s=ni({title:o,thumbUrl:n}),l={target:this.playerContainer,props:s};this.svelteStubComponent=is(nv,l)}disconnectedCallback(){var e,i,o,n,s,l,d;this.shadowDOMCallbacksDisabled||((e=this.annotationsApi)==null||e.destroy(),(i=this.slotsApi)==null||i.destroy(),(o=this.focusManager)==null||o.destroy(),(n=this.mediaSessionApi)==null||n.destroy(),this.unmountComponent(this.svelteRootComponent),this.unmountComponent(this.svelteStubComponent),this.unmountComponent(this.svelteErrorComponent),this.subscription.unsubscribe(),(s=this.unsubscribePlayerPhaseSubscription)==null||s.call(this),(l=this.interactiveController)==null||l.destroy(),this.interactiveSubscription.unsubscribe(),(d=this.internalsExposure)==null||d.destroy(),jd.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={}){if(!this.videoConfig)return;let{deviceId:o,preload:n,refreshStatAuthToken:s}=Fd(this.videoConfig,i),{unitedVideoId:l}=e;if(this.uiConfig.features.thinStatistics&&l)return new dw.ThinOneStat({deviceId:o,movieId:l,preload:n,isPreviewPlayerView:this.videoConfig.playerView==="preview"},{config:this.statisticsConfig,refreshAuthToken:s})}createPlayer(e,i={},o){var n,s,l,d,a,p,f,v,u,y;if(!this.videoConfig)return;let{albumId:w,statPlace:x,statAuthToken:S,preload:T,autoplay:E,volume:V,muted:k,fromTime:I,canRewindLive:R,supportLink:Y,showAds:H,adsSlotId:F,adsParams:W={},adsPreviewParam:J,adsAutoplayParam:G,interfaceLanguage:ce,isCyrillicRelatedInterface:ie,logoClickable:ue,logoHidden:$e,isMobile:fe,isTouch:ke,isAudioDisabled:ne,isLiveCatchUpMode:Ve,fullScreenTarget:re,failoverHosts:N,canDownload:Be,callbacks:le,interactiveData:ve,showThumbTimer:te,additionalButtons:me=[],additionalSettingsMenuItems:De=[],additionalContextMenuItems:pe=[],repeat:st,saveRate:Z,volumeMultiplier:Ae,showEndScreen:Ie,showAutoplayNext:ze,mediascopePixels:at}=Fd(this.videoConfig,i),{sources:ft,title:mt,thumbUrl:wt,unitedVideoId:Ge,isClip:Bt=!1,duration:Xt,adsParams:qt={},videoEpisodes:Ut,previewThumbsData:oe,subtitles:Dt,live:he}=e;if(!ft&&!he){let Qt=new Error("empty sources and live");this.fatalError$.next(Qt),(n=le.onCrashed)==null||n.call(le,Qt.message);return}let we={...W,...qt},ae=this.getNextVideoInfo(),Re={sources:ft,title:mt,thumbUrl:wt,subtitles:Dt,unitedVideoId:Ge,isClip:Bt,live:he,albumId:w,statPlace:x,autoplay:E,muted:k,volume:V,fromTime:I,canRewindLive:R,showAds:H,adsSlotId:F,adsParams:we,adsPreviewParam:J,adsAutoplayParam:G,duration:Xt,logoClickable:ue,logoHidden:$e,isTouch:ke!=null?ke:fe,repeat:st,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:ae.nextVideoTitle,endScreenVideoThumb:ae.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist()},qe={pictureInPictureApi:this.pictureInPictureApi,annotationsApi:this.annotationsApi,slotsApi:this.slotsApi};this.log({message:`create player, props: ${JSON.stringify(Re)}`});let Le=(s=this.interactiveController)==null?void 0:s.state.statistics$.getValue(),je=(Le==null?void 0:Le.oneStat)||this.createOneStat(e,i),Oe=this.createThinOneStat(e,i),Je;at&&(Je=new cw({pixels:at})),(je||Oe)&&(this.statistics=new pu(je,Oe,Je,Le==null?void 0:Le.statSubscription)),this.uiConfig.features.sentry&&this.uiConfig.sentry.dsn&&new da(this.uiConfig.sentry,{version:il,env:Nc},{movieId:Ge,albumId:w,place:x,autoplay:(l=E&&!this.interactiveController)!=null?l:!1,mobile:ke!=null?ke:fe,clip:Bt}),this.interactiveController&&((p=this.prevIsid)!=null||(this.prevIsid=(a=(d=this.statistics)==null?void 0:d.oneStat)==null?void 0:a.isid$.getValue())),this.sentry={...this.sentry,...da.getInstance()};let zt=!!ve,et=[],$i="tooltip_interactive_go_back_disabled_first";if(zt&&this.interactiveController){let Qt=this.interactiveController.state.isInitialChapter$.getValue(),gi=this.interactiveController.getHistoryState();Qt&&et.push("REPLAY_BUTTON"),this.interactiveController.getIsSeekable().getValue()||et.push("SEEK_TO_INTERACTIVE_BUTTON"),gi.hasPrevChapter$.getValue()||(et.push("PLAY_PREV_CHAPTER_BUTTON"),Qt||(gi.isGoBackLimited$.getValue()?$i="tooltip_interactive_go_back_disabled_limit":$i="tooltip_interactive_go_back_disabled"))}let vi=()=>{var Qt;this.isInited=!1,this.prevIsid=void 0;let gi=(o==null?void 0:o.info.isEnded$.getValue())&&((Qt=this.interactiveController)==null?void 0:Qt.state.isEndChapter$.getValue());le.onReplayInteractiveVideo&&!gi?le.onReplayInteractiveVideo():this.replayInteractiveVideo()};this.store=y1({player:o,interfaceLanguage:ce,isCyrillicRelatedInterface:ie,videoId:Ge,isClip:Bt,isLiveCatchUpMode:Ve,isAudioDisabled:ne,statAuthToken:S,callbacks:le,webApi:qe,videoEpisodes:Ut,previewThumbsData:oe,canDownload:Be,uiConfig:this.uiConfig,coreConfig:this.coreConfig,disabledControls:et,isInteractive:zt,saveRate:Z,interactiveRanges$:(f=this.interactiveController)==null?void 0:f.state.interactiveRanges$,isInteractiveTime$:(v=this.interactiveController)==null?void 0:v.state.isInteractiveTime$,stopPlayer:()=>this.stop(),replayInteractive:vi,playPrevChapterDisabledTooltip:$i,hasInteractiveBranches:!!((y=(u=this.interactiveController)==null?void 0:u.getChapterBranches())!=null&&y.length),additionalButtons:this.uiConfig.features.additionalButtons?me:[],additionalSettingsMenuItems:De!=null?De:[],additionalContextMenuItems:pe!=null?pe:[],playPrevVideo:()=>this.playPrevVideo(),playNextVideo:()=>this.playNextVideo(),looped:st&&this.videoConfig.videos.length===1,statistics:this.statistics,internalsExposure:this.internalsExposure,playerView:this.videoConfig.playerView,playerId:this.playerId});let{stores:tt}=this.microStoresRoot=s0(),ii=()=>{var Qt,gi,Io,vo,Ot,ri;if(!this.store||!this.microStoresRoot||!this.videoConfig)return;this.subscription.add(this.store.state.currentFormat$.subscribe(It=>{var ct;return(ct=le==null?void 0:le.onCurrentFormatChanged)==null?void 0:ct.call(le,It)})),this.subscription.add(tt.interactiveControlsOpacity$.subscribe(It=>{var ct;It!==null&&((ct=this==null?void 0:this.interactiveController)==null||ct.setDisabledControls(It))})),this.subscription.add(this.store.state.throughputEstimation$.subscribe(It=>{var ct;return(ct=le==null?void 0:le.onThroughputEstimationChanged)==null?void 0:ct.call(le,It)})),this.subscription.add(this.store.state.trafficSavingEnabled$.subscribe(It=>{var ct;return(ct=le==null?void 0:le.onTrafficSavingEnabledChanged)==null?void 0:ct.call(le,It)})),this.subscription.add(this.store.state.highQualityEnabled$.subscribe(It=>{var ct;return(ct=le==null?void 0:le.onHighQualityEnabledChanged)==null?void 0:ct.call(le,It)})),this.subscription.add(this.store.state.isAutoQualityEnabled$.subscribe(It=>{var ct;return(ct=le==null?void 0:le.onAutoQualityEnabledChanged)==null?void 0:ct.call(le,!!It)})),this.subscription.add(new iw(It=>{this.store&&this.subscription.add(this.store.state.currentPlaybackRate$.subscribe(ct=>It.next(ct)))}).pipe(rw(1)).subscribe(It=>{var ct;return(ct=le==null?void 0:le.onCurrentPlaybackRateChanged)==null?void 0:ct.call(le,It)})),this.subscription.add(this.store.state.volume$.subscribe(It=>{var ct;return(ct=le==null?void 0:le.onVolumeChange)==null?void 0:ct.call(le,It)})),this.subscription.add(this.store.state.muted$.subscribe(It=>{var ct,hi,ko,Ui;if(It)(ct=le==null?void 0:le.onMute)==null||ct.call(le);else{let oi=(ko=((hi=this.store)==null?void 0:hi.state.volume$)&&xe(this.store.state.volume$))!=null?ko:0;(Ui=le==null?void 0:le.onUnmute)==null||Ui.call(le,oi)}})),this.subscription.add(this.store.state.videoBitrate$.subscribe(It=>{var ct;return(ct=le==null?void 0:le.onVideoBitrateChanged)==null?void 0:ct.call(le,It)})),this.subscription.add(this.store.state.isInteractiveTime$.subscribe(It=>{var ct;let hi=(ct=this.store)==null?void 0:ct.ui.controls.disabledControls$;hi&&(It&&!hi.includes(Ql)&&hi.add(Ql),It||hi.remove(Ql))})),this.subscription.add(this.store.ui.isFullscreen.subscribe(async It=>{var ct;if(!l0.browser.isSamsungBrowser||!It||!this.interactiveController)return;document.fullscreenElement===this.shadowRootContainer&&await this.replayInteractiveChapter((ct=this.videoConfig)==null?void 0:ct.callbacks.onExternalFullscreenExit)})),this.statistics&&this.statistics.oneStat&&this.subscription.add(this.statistics.oneStat.vsid$.subscribe(It=>{var ct;return(ct=le==null?void 0:le.onVSIDChanged)==null?void 0:ct.call(le,It)})),this.initMediaSession(),O(Bn,{interactiveController:this.interactiveController,interactiveContainer:this.interactiveContainer,sources:ft,store:this.store,microStoresRoot:this.microStoresRoot,videoConfig:this.videoConfig,uiConfig:this.uiConfig,title:mt,thumbUrl:wt,subtitles:Dt,live:he,preload:T,autoplay:E,muted:k,volume:V,fromTime:I,canRewindLive:R,supportLink:Y,showAds:H,adsSlotId:F,adsParams:we,adsPreviewParam:J,adsAutoplayParam:G,duration:Xt,logoClickable:ue,logoHidden:$e,isMobile:ke!=null?ke:fe,failoverHosts:N,fullScreenTarget:re,saveRate:Z,shadowRootContainer:this.shadowRootContainer,showMiniTimer:te,outerContainerRef:this.rootContainer,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:ae.nextVideoTitle,endScreenVideoThumb:ae.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist(),playPrevChapter:()=>this.playPrevChapter(),seekToInteractive:()=>this.seekToInteractive(),volumeMultiplier:Ae,showEndScreen:Ie,showAutoplayNext:ze},!0);let on={target:this.playerContainer,props:r(Bn)};this.svelteRootComponent=is(tv,on),this.addPlayerInfoSubscriptions(),this.isInited||(this.isInited=!0,(Io=(gi=(Qt=this.videoConfig)==null?void 0:Qt.callbacks)==null?void 0:gi.onInited)==null||Io.call(gi)),(vo=this.internalsExposure)==null||vo.expose({player:this,videoConfig:this.videoConfig,coreConfig:this.coreConfig,uiConfig:this.uiConfig,statisticsConfig:this.statisticsConfig,logger:this.logger,log:this.log}),this.uiConfig.devNullLog&&((ri=(Ot=this.videoConfig)==null?void 0:Ot.callbacks)!=null&&ri.onDevNullLog)?jd.subscribe("ui",this.videoConfig.callbacks.onDevNullLog):jd.destroy("ui")};this.coreConfig.asyncResolveClientChecker?l0.isInited$.subscribe(Qt=>{Qt&&(console.log("UI SDK async start"),ii())}):ii()}addPlayerInfoSubscriptions(){var e,i;let o=this.store,n=(e=this.microStoresRoot)==null?void 0:e.stores;if(!o||!n)return;let s=(i=this.videoConfig)==null?void 0:i.callbacks;s&&this.subscription.add(o.playerPhase.subscribe(d=>{var a;return(a=s.onPlayerPhaseChanged)==null?void 0:a.call(s,d)})).add(o.state.playbackState$.subscribe(d=>{var a;return d&&((a=s.onPlaybackStateChanged)==null?void 0:a.call(s,d))})).add(o.state.isLive$.subscribe(d=>{var a;return(a=s.onIsLiveChanged)==null?void 0:a.call(s,d)})).add(o.state.isActiveLive$.subscribe(d=>{var a;return(a=s.onIsActiveLiveChanged)==null?void 0:a.call(s,d)})).add(o.state.isAudioAvailable$.subscribe(d=>{var a;return(a=s.onIsAudioAvailableChanged)==null?void 0:a.call(s,d)})).add(o.state.currentQuality$.subscribe(d=>{var a;return(a=s.onCurrentQualityChanged)==null?void 0:a.call(s,d)})).add(o.state.availableQualities$.subscribe(d=>{var a;return(a=s.onAvailableQualitiesChanged)==null?void 0:a.call(s,d.map(({value:p})=>p).filter(p=>p!=="auto"))})).add(o.state.availableAudioStreams$.subscribe(d=>{d.length>1&&s.onAudioLanguagesAvailable&&s.onAudioLanguagesAvailable()})).add(n.pictureInPicture$.isActive$.subscribe(d=>{var a,p;return d?(a=s.onPiPEnter)==null?void 0:a.call(s):(p=s.onPiPExit)==null?void 0:p.call(s)}));let l=s==null?void 0:s.uiInfo;l&&this.subscription.add(o.ui.controlsVisible.subscribe(d=>{var a;return(a=l.onControlsVisibleChanged)==null?void 0:a.call(l,d)})).add(o.ui.isMobile.subscribe(d=>{var a;return(a=l.onIsMobileChanged)==null?void 0:a.call(l,d)})).add(o.ui.playerSize.subscribe(d=>{var a;return(a=l.onPlayerSizeChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.prevButton.subscribe(d=>{var a;return(a=l.onPrevButtonChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.playButton.subscribe(d=>{var a;return(a=l.onPlayButtonChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.replayButton.subscribe(d=>{var a;return(a=l.onReplayButtonChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.nextButton.subscribe(d=>{var a;return(a=l.onNextButtonChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.playPrevChapterButton.subscribe(d=>{var a;return(a=l.onPlayPrevChapterChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.seekToInteractiveButton.subscribe(d=>{var a;return(a=l.onSeekToInteractiveButtonChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.interactiveGraphButton.subscribe(d=>{var a;return(a=l.onGraphButtonChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.liveButton.subscribe(d=>{var a;return(a=l.onLiveButtonChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.time.subscribe(d=>{var a;return(a=l.onTimeUpdateChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.episodes.subscribe(d=>{var a;return(a=l.onEpisodesChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.subtitles.subscribe(d=>{var a;return(a=l.onSubtitlesChanged)==null?void 0:a.call(l,d)})).add(o.ui.controlBlocks.topLeft.subscribe(d=>{var a;return(a=l.onTopLeftControlBlockChanged)==null?void 0:a.call(l,d)})).add(o.ui.controlBlocks.topRight.subscribe(d=>{var a;return(a=l.onTopRightControlBlockChanged)==null?void 0:a.call(l,d)})).add(o.ui.controlBlocks.bottomLeft.subscribe(d=>{var a;return(a=l.onBottomLeftControlBlockChanged)==null?void 0:a.call(l,d)})).add(o.ui.controlBlocks.bottomRight.subscribe(d=>{var a;return(a=l.onBottomRightControlBlockChanged)==null?void 0:a.call(l,d)})).add(o.ui.controlBlocks.middle.subscribe(d=>{var a;return(a=l.onMiddleControlBlockChanged)==null?void 0:a.call(l,d)})).add(o.ui.controlBlocks.bottom.subscribe(d=>{var a;return(a=l.onBottomControlBlockChanged)==null?void 0:a.call(l,d)})).add(o.ui.videoTitleInfo.subscribe(d=>{var a;return(a=l.onTitleChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.settings.subscribe(d=>{var a;return(a=l.onSettingsChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.fullscreen.subscribe(d=>{var a;return(a=l.onFullscreenChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.chromecast.subscribe(d=>{var a;return(a=l.onChromecastChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.pip.subscribe(d=>{var a;return(a=l.onPipChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.vkLogo.subscribe(d=>{var a;return(a=l.onVkLogoChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.interactiveTimeIndicator.subscribe(d=>{var a;return(a=l.onInteractiveTimeIndicatorChanged)==null?void 0:a.call(l,d)})).add(o.ui.controls.timeline.subscribe(d=>{var a;return(a=l.onTimelineChanged)==null?void 0:a.call(l,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){var o;if(!this.videoConfig)return;let n=this.videoConfig.videos[this.currentPlayingVideoIndex];if(!n){this.log({message:"no next video"});return}this.isInited&&uv(n.unitedVideoId)&&((o=this.store)==null||o.actions.internal.nextMovie(n.unitedVideoId)),this.unmountComponent(this.svelteRootComponent),this.createPlayer(n,{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)}async initInteractives(){var e,i,o,n,s,l;if((e=this.videoConfig)!=null&&e.interactiveData)try{let{Interactives:d}=await import("@vkontakte/videoplayer-interactive/es2018");this.interactiveContainer=document.createElement("div"),this.interactiveContainer.classList.add("interactive-root");let a=(i=this.store)==null?void 0:i.interfaceLanguage$,p=a?xe(a):this.videoConfig.interfaceLanguage,{projectInfo:f,initChapterId:v,historyApi:u,videoLoader:y}=this.videoConfig.interactiveData;this.interactiveController=new d({parentElement:this.interactiveContainer,fullscreenTargetElement:this.playerContainer,lang:p,graph:this.uiConfig.features.interactiveGraph,projectInfo:f,initChapterId:v,historyApi:u,vkVideoLoader:y,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,isTouch:this.videoConfig.isTouch,animationsFeatureToggles:{areaControlShadow:this.uiConfig.features.interactiveAreaControlShadow,controlsExpectTimeBlinkAnimation:this.uiConfig.features.interactiveControlsExpectTimeBlinkAnimation,controlsTapPlace:this.uiConfig.features.interactiveControlsTapPlace,controlsFillAnimation:this.uiConfig.features.interactiveControlsFillAnimation,controlsHideAnimation:this.uiConfig.features.interactiveControlsHideAnimation},endChapterHistoryFix:this.uiConfig.features.interactiveHistoryEndChapterFix});let{isInteractiveExpectation$:w,isSeekable$:x}=this.interactiveController.state;this.uiConfig.features.seekToInteractive&&this.subscription.add(x.subscribe(T=>{if(!this.isInited)return;let E=this.store;T?E.ui.controls.disabledControls$.remove("SEEK_TO_INTERACTIVE_BUTTON"):E.ui.controls.disabledControls$.add("SEEK_TO_INTERACTIVE_BUTTON")})),this.subscription.add(w.subscribe(T=>{this.store&&this.store.state.isInteractiveExpectation$.set(T)}));let S=!0;if(this.subscription.add(this.interactiveController.events.playerChanged$.subscribe(T=>{if(!this.videoConfig)return;this.videoConfig.videos[this.currentPlayingVideoIndex]={...T.config,title:(f==null?void 0:f.title)||T.config.title};let E=S?this.videoConfig.autoplay:!0;this.createPlayerWithCurrentVideo(T.player,E),S&&(S=!1)})),this.interactiveSubscription.add(this.interactiveController.events.interactiveActionChoice$.subscribe(({type:T,actionType:E})=>{var V,k,I,R,Y,H;if(!this.store||!this.microStoresRoot)return;let F=w.getValue();if(T==="action-choice"&&E==="setRandomBranch"&&(this.microStoresRoot.stores.graphIsOpened$.set(!1),this.store.ui.controls.disabledControls$.remove(Gl)),T==="action-choice-canceled"){let W=xe(this.store.state.isPlaying$)||F;if(((I=(V=this.videoConfig)==null?void 0:V.isTouch)!=null?I:(k=this.videoConfig)!=null&&k.isMobile)&&W){this.store.ui.interactiveHideMobileControls.set(!0);return}(H=(R=this.videoConfig)==null?void 0:(Y=R.callbacks).onDisabledInteractiveClick)==null||H.call(Y)}})),this.interactiveSubscription.add(this.interactiveController.events.interactiveContainerFakeRemoved$.subscribe(({type:T,removeAllOpenURI:E})=>{this.store&&T==="container-fake-removed"&&E&&this.store.ui.controls.disabledControls$.remove(Gl)})),await this.interactiveController.setManifest(this.videoConfig.interactiveData.manifest),(n=(o=this.videoConfig)==null?void 0:o.callbacks)!=null&&n.onInteractiveHistoryChanged){let T=this.interactiveController.getHistoryState();this.subscription.add(T.history$.subscribe(E=>{var V,k,I;E.length&&((I=(k=(V=this.videoConfig)==null?void 0:V.callbacks)==null?void 0:k.onInteractiveHistoryChanged)==null||I.call(k,E))}))}(l=(s=this.videoConfig)==null?void 0:s.callbacks)!=null&&l.onInteractiveChapterChanged&&this.subscription.add(this.interactiveController.events.chapterChanged$.subscribe(T=>{var E,V,k;(k=(E=this.videoConfig)==null?void 0:(V=E.callbacks).onInteractiveChapterChanged)==null||k.call(V,T.chapter,T.manifestVideo)})),this.uiConfig.features.interactiveTimeIndicator&&this.subscription.add(this.interactiveController.events.noInteraction$.subscribe(()=>{var T,E,V,k;(T=this.microStoresRoot)==null||T.stores.showInteractiveTimeIndicatorTooltip$.set(!0,!0),(k=(E=this.videoConfig)==null?void 0:(V=E.callbacks).onInteractiveTimeIndicatorClick)==null||k.call(V)})),this.interactiveSubscription.add(this.interactiveController.events.error$.subscribe(T=>{this.log({message:T.toString()})}))}catch(d){this.log({message:d.message})}}initPlayer(e,i={}){var o,n,s,l,d,a,p,f,v,u,y,w,x,S,T,E,V,k,I,R,Y,H,F,W,J,G,ce,ie;if(!Array.isArray(e.videos)||e.videos.length===0&&!e.interactiveData){let ue=new Error("empty videos");this.fatalError$.next(ue),(n=(o=e.callbacks)==null?void 0:o.onCrashed)==null||n.call(o,ue.message);return}else this.fatalError$.next(null);if(this.videoConfig=Fd(uw,J5(e,ue=>ue instanceof HTMLElement?ue:void 0)),this.playerId=sw(e.playerId),this.uiConfig=Jg((s=i.ui)!=null?s:{}),this.coreConfig=(l=i.core)!=null?l:{configName:[]},this.statisticsConfig=(d=i.statistics)!=null?d:{},this.uiConfig.features.forcePlayerDisplayBlock&&(this.rootContainer&&(this.rootContainer.style.minHeight="unset"),this.style.display="block",this.style.width="100%",this.style.height="100%"),this.videoConfig.playerView==="preview"&&(this.playerContainer.style.contain="none"),this.sentry={config:(a=this.uiConfig.sentry)!=null?a:{}},this.uiConfig.features.exposeInternalsToGlobal&&((p=this.internalsExposure)!=null||(this.internalsExposure=new nw("ui",this.playerId))),jd.push("ui",{key:"videoplayer_embed",strings:["new","player_init_player","ads.enable: "+this.uiConfig.ads.enable,"showAds: "+((f=this.videoConfig)==null?void 0:f.showAds)],numbers:[Z5()]}),uv(this.videoConfig.isMediaSessionEnabled)&&(this.uiConfig.features.mediaSession=(u=(v=this.uiConfig.features.mediaSession)!=null?v:this.videoConfig.isMediaSessionEnabled)!=null?u:!0),uv(this.videoConfig.isPictureInPictureEnabled)&&(this.uiConfig.features.pip=(w=(y=this.uiConfig.features.pip)!=null?y:this.videoConfig.isPictureInPictureEnabled)!=null?w:!0,this.uiConfig.features.dpip=(S=(x=this.uiConfig.features.dpip)!=null?x:this.videoConfig.isPictureInPictureEnabled)!=null?S:!0),this.videoConfig.isTouch=(E=(T=this.uiConfig.isMobile)!=null?T:this.videoConfig.isTouch)!=null?E:this.videoConfig.isMobile,(V=this.videoConfig).autoplay&&(V.autoplay=this.uiConfig.features.autoplay),this.videoConfig.showAds=(k=this.uiConfig.ads.enable)!=null?k:this.videoConfig.showAds,this.videoConfig.adsSlotId=(I=this.uiConfig.ads.slot)!=null?I:this.videoConfig.adsSlotId,this.videoConfig.adsPreviewParam=(R=this.uiConfig.ads.preview)!=null?R:this.videoConfig.adsPreviewParam,this.videoConfig.logoHidden=!((Y=this.uiConfig.showLogo)!=null?Y:!this.videoConfig.logoHidden),(H=this.videoConfig).canRewindLive&&(H.canRewindLive=this.uiConfig.features.liveRewind),this.videoConfig.supportLink=(F=this.videoConfig.supportLink)!=null?F:this.uiConfig.supportLink,this.videoConfig.showEndScreen=(W=this.uiConfig.features.endScreen)!=null?W:this.videoConfig.showEndScreen,this.videoConfig.showAutoplayNext=(J=this.uiConfig.features.autoplayNext)!=null?J:this.videoConfig.showAutoplayNext,this.videoConfig.showNextPrevButtons=(G=this.uiConfig.features.nextPrevButtons)!=null?G:this.videoConfig.showNextPrevButtons,this.currentPlayingVideoIndex=this.videoConfig.videoIndex&&((ce=this.videoConfig.videos)!=null&&ce[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=Pu.getLatestSupportedVersion(ue):this.pictureInPictureApi=new ca(ue)}this.mediaSessionApi=this.uiConfig.features.mediaSession?new ku:void 0,this.slotsApi=this.uiConfig.features.slots?new Cu:void 0,this.annotationsApi=this.uiConfig.features.annotations?new Au(this.uiConfig.features.annotationsInside):void 0,this.annotationsApi&&!this.uiConfig.features.annotationsInside&&this.annotationsApi.init(this.rootContainer),this.unmountComponent(this.svelteStubComponent),this.unmountComponent(this.svelteRootComponent),this.unmountComponent(this.svelteErrorComponent),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]),e0(this.pictureInPictureApi)&&this.pictureInPictureApi.setPlayerDomElement(this.playerContainer,this._shadowRoot),(ie=this.slotsApi)==null||ie.init(this.shadowRootContainer,this.store),this.focusManager=this._shadowRoot?new Vu(this._shadowRoot):void 0}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(Bn)&&(r(Bn).showNextPrevButtons=this.needToShowNextPrevButtons(),r(Bn).nextButtonActive=this.isNextButtonActive(),r(Bn).prevButtonActive=this.isPrevButtonActive(),r(Bn).endScreenVideoTitle=o.nextVideoTitle,r(Bn).endScreenVideoThumb=o.nextVideoThumb,r(Bn).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}={...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",()=>{var n,s,l;if(this.uiConfig.features.useCallbackForMediaSessionNextPrevClick)try{(l=(s=(n=this.videoConfig)==null?void 0:n.callbacks)==null?void 0:s.onNextVideoClick)==null||l.call(s)}catch(d){this.log({message:"onNextVideoClick callback failed to execute"})}else this.playNextVideo()}]),this.currentPlayingVideoIndex>0&&o.push(["previoustrack",()=>{var n,s,l;if(this.uiConfig.features.useCallbackForMediaSessionNextPrevClick)try{(l=(s=(n=this.videoConfig)==null?void 0:n.callbacks)==null?void 0:s.onPrevVideoClick)==null||l.call(s)}catch(d){this.log({message:"onPrevVideoClick callback failed to execute"})}else 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})}}moveTo(e){this.shadowDOMCallbacksDisabled=!0,e.append(this),this.shadowDOMCallbacksDisabled=!1}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)}toggleSubtitle(){var e;this.log({message:"toggle subtitle"}),(e=this.svelteRootComponent)==null||e.toggleSubtitle()}changeSubtitle(e,i){var o;this.log({message:"change subtitle"}),(o=this.svelteRootComponent)==null||o.changeSubtitle(e,i)}hideControls(){var e;this.log({message:"hide controls"}),(e=this.svelteRootComponent)==null||e.hideControls()}showControls(){var e;this.log({message:"show controls"}),(e=this.svelteRootComponent)==null||e.showControls()}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(Bn)&&(r(Bn).needToRepeatPlaylist=this.needToRepeatPlaylist,r(Bn).showNextPrevButtons=this.needToShowNextPrevButtons(),r(Bn).nextButtonActive=this.isNextButtonActive(),r(Bn).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)}setAutoQuality(){var e;(e=this.svelteRootComponent)==null||e.setAutoQuality()}toggleTrafficSaving(e){var i;(i=this.svelteRootComponent)==null||i.toggleTrafficSaving(e)}toggleHighQuality(e){var i;(i=this.svelteRootComponent)==null||i.toggleHighQuality(e)}addLanguage(e){var i;(i=this.store)==null||i.actions.internal.addLanguage(e)}async setLanguage(e){var i;await((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})}setLiveWaitingStart(){var e;this.log({message:"live waiting"}),(e=this.store)==null||e.actions.internal.setLiveWaitingStart(!0)}isLiveTailPlaying(){var e;let i=(e=this.store)==null?void 0:e.getPlayer();if(!i)return!1;let{info:o}=i;return o.canPlayLiveTailBuffer$.getValue()&&!o.atLiveEdge$.getValue()}setLiveWaitingRecover(e=!1){var i;let o=this.isLiveTailPlaying(),n=e||!o;this.log({message:`live waiting recover: forceImmediate = ${e}, liveTailPlaying = ${o}`});let s=()=>{var l;(l=this.store)==null||l.actions.internal.setLiveWaitingRecover(!0)};n&&s(),(i=this.store)!=null&&i.callbacks&&(this.store.callbacks.onLiveEnded=()=>{var l;n||s(),(l=this.store)==null||l.destroy()})}setLiveWaitingRecord(){var e;let i=this.isLiveTailPlaying(),o=!i;this.log({message:`live waiting record: liveTailPlaying = ${i}`});let n=()=>{var s;(s=this.store)==null||s.actions.internal.setLiveWaitingRecord(!0)};o&&n(),(e=this.store)!=null&&e.callbacks&&(this.store.callbacks.onLiveEnded=()=>{var s;o||n(),(s=this.store)==null||s.destroy()})}setLiveEnd(e){var i;let o=this.isLiveTailPlaying(),n=!o;this.log({message:`live ended: liveTailPlaying = ${o}`});let s=()=>{var l,d;(l=this.store)==null||l.actions.internal.setLiveWaitingRecover(!1),(d=this.store)==null||d.actions.internal.setLiveWaitingRecord(!1),this.unmountComponent(this.svelteRootComponent),this.createPlayer(e,{autoplay:!1})};if(n){s();return}(i=this.store)!=null&&i.callbacks&&(this.store.callbacks.onLiveEnded=s)}setLiveLowLatency(e){var i;this.log({message:"live switch to low latency "+e}),(i=this.store)==null||i.actions.external.setLiveLowLatency(e)}setLooped(e){var i;(i=this.store)==null||i.actions.internal.setLooped(e)}getDebugData(){var e,i;return(i=(e=this.store)==null?void 0:e.actions.internal.getDebugTextData())!=null?i:""}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()}async replayInteractiveChapter(e){var i,o;if(this.interactiveController&&((i=this.store)!=null&&i.state.positionExact$)){let n=xe(this.store.state.positionExact$),l=xe(this.store.state.interactiveEpisodes$).find(a=>!a.completed);this.interactiveController.events.playerChanged$.pipe(ow()).subscribe(()=>{l&&n>=l.time?this.seekTime(l.time):this.seekTime(n),e==null||e()});let d=this.interactiveController.getCurrentChapter();await 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)}togglePictureInPicture(){var e;(e=this.store)==null||e.actions.internal.togglePictureInPicture()}focus(){var e,i,o;(o=(i=(e=this.svelteRootComponent)==null?void 0:e.keyboardControls)==null?void 0:i.focus)==null||o.call(i)}restoreFocus(){var e;(e=this.focusManager)==null||e.restoreFocus()}handleExternalKeyboardEvent(e){var i,o;return!!((o=(i=this.svelteRootComponent)==null?void 0:i.keyboardControls)!=null&&o.handleExternalKeyboardEvent(e))}setAutoplayNext(e){var i;(i=this.store)==null||i.actions.internal.setAutoplayNextEnabled(e)}unmountComponent(e){e&&oa(e)}};import{InterfaceLanguage as uee,VKNumericLanguage as pee,loadVKLangPack as fee}from"@vkontakte/videoplayer-shared/es2018";import{VideoQuality as vee,VideoFormat as gee}from"@vkontakte/videoplayer-core/es2018";var oee=()=>{window.customElements.define("vk-video-player",Ru)};export{fu as ControlButtonType,ns as GridTypes,uee as InterfaceLanguage,rd as MenuItemType,hs as PlayerPhase,il as VERSION,pee as VKNumericLanguage,gee as VideoFormat,vee as VideoQuality,fee as loadVKLangPack,oee as registerPlayerWebComponent};
|