@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/esnext.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @vkontakte/videoplayer v1.1.72-dev.c0dc5218.0
3
- * Thu, 25 Sep 2025 09:23:46 GMT
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 bs="[",$s="[!",Bs="]",zr={};var Ti=Symbol(),vn=Symbol("filename"),Jm=Symbol("hmr"),ev="http://www.w3.org/1999/xhtml",Qd="http://www.w3.org/2000/svg";var Au="@attach";var Gd=!0;var tv=globalThis.process?.env?.NODE_ENV,ke=tv&&!tv.toLowerCase().startsWith("prod");var On=Array.isArray,iv=Array.prototype.indexOf,al=Array.from,Mu=Object.keys,Bi=Object.defineProperty,Eo=Object.getOwnPropertyDescriptor,jd=Object.getOwnPropertyDescriptors,Lu=Object.prototype,ov=Array.prototype,Os=Object.getPrototypeOf,Vu=Object.isExtensible;function ys(t){return typeof t=="function"}var ne=()=>{};function nv(t){return t()}function xs(t){for(var e=0;e<t.length;e++)t[e]()}var uo=Symbol("$state"),wa=Symbol("legacy props"),rv=Symbol(""),Yd=Symbol("proxy path"),Zd=1,Sa=3,Dn=8;function Xd(t){return t===this.v}function Ca(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function sv(t,e){return t!==e}function Ta(t){return!Ca(t,this.v)}function av(){if(ke){let t=new Error(`derived_references_self
@@ -41,7 +41,7 @@ ${r}
41
41
  `}),t.stack&&Bi(t,"stack",{value:t.stack.split(`
42
42
  `).filter(a=>!a.includes("svelte/src/internal")).join(`
43
43
  `)})}}var qs=!1,Na=null,Qs=!1,rs=!1;function Ku(t){rs=t}var wl=[],Sl=[],xt=null,Wn=!1;function hi(t){xt=t}var pt=null;function Oi(t){pt=t}var Un=null;function ic(t){xt!==null&&xt.f&2097152&&(Un===null?Un=[xt,[t]]:Un[1].push(t))}var Yo=null,Kn=0,zn=null;function wv(t){zn=t}var Uv=1,uc=0,ss=!1,pc=null;function pl(){return++Uv}function Us(t){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 r,s,a=(e&512)!==0,l=o&&pt!==null&&!ss,d=i.length;if(a||l){var f=t,p=f.parent;for(r=0;r<d;r++)s=i[r],(a||!s?.reactions?.includes(f))&&(s.reactions??=[]).push(f);a&&(f.f^=512),l&&p!==null&&(p.f&256)===0&&(f.f^=256)}for(r=0;r<d;r++)if(s=i[r],Us(s)&&Wu(s),s.wv>t.wv)return!0}(!o||pt!==null&&!ss)&&Qo(t,1024)}return!1}function zv(t,e,i=!0){var o=t.reactions;if(o!==null)for(var r=0;r<o.length;r++){var s=o[r];Un?.[1].includes(t)&&Un[0]===xt||((s.f&2)!==0?zv(s,e,!1):e===s&&(i?Qo(s,2048):(s.f&1024)!==0&&Qo(s,4096),ml(s)))}}function tc(t){var e=Yo,i=Kn,o=zn,r=xt,s=ss,a=Un,l=Lt,d=Wn,f=t.f;Yo=null,Kn=0,zn=null,ss=(f&256)!==0&&(Wn||!Qs||xt===null),xt=(f&96)===0?t:null,Un=null,dl(t.ctx),Wn=!1,uc++,t.f|=2097152;try{var p=(0,t.fn)(),g=t.deps;if(Yo!==null){var u;if($l(t,Kn),g!==null&&Kn>0)for(g.length=Kn+Yo.length,u=0;u<Yo.length;u++)g[Kn+u]=Yo[u];else t.deps=g=Yo;if(!ss||(f&2)!==0&&t.reactions!==null)for(u=Kn;u<g.length;u++)(g[u].reactions??=[]).push(t)}else g!==null&&Kn<g.length&&($l(t,Kn),g.length=Kn);if(qr()&&zn!==null&&!Wn&&g!==null&&(t.f&6146)===0)for(u=0;u<zn.length;u++)zv(zn[u],t);return r!==null&&r!==t&&(uc++,zn!==null&&(o===null?o=zn:o.push(...zn))),p}catch(y){Dv(y)}finally{Yo=e,Kn=i,zn=o,xt=r,ss=s,Un=a,dl(l),Wn=d,t.f^=2097152}}function X1(t,e){let i=e.reactions;if(i!==null){var o=iv.call(i,t);if(o!==-1){var r=i.length-1;r===0?i=e.reactions=null:(i[o]=i[r],i.pop())}}i===null&&(e.f&2)!==0&&(Yo===null||!Yo.includes(e))&&(Qo(e,4096),(e.f&768)===0&&(e.f^=512),ec(e),$l(e,0))}function $l(t,e){var i=t.deps;if(i!==null)for(var o=e;o<i.length;o++)X1(t,i[o])}function La(t){var e=t.f;if((e&16384)===0){Qo(t,1024);var i=pt,o=Qs;if(pt=t,Qs=!0,ke){var r=Hn;cl(t.component_function)}try{(e&16)!==0?Vv(t):ju(t),Gu(t);var s=tc(t);if(t.teardown=typeof s=="function"?s:null,t.wv=Uv,ke&&Kr&&(t.f&2048)!==0&&t.deps!==null)for(var a of t.deps)a.set_during_effect&&(a.wv=pl(),a.set_during_effect=!1);ke&&Sl.push(t)}finally{Qs=o,pt=i,ke&&cl(r)}}}function Hv(){console.error("Last ten effects were: ",Sl.slice(-10).map(t=>t.fn)),Sl=[]}function J1(){try{uv()}catch(t){if(ke&&Bi(t,"stack",{value:""}),Na!==null)if(ke)try{xl(t,Na)}catch(e){throw Hv(),e}else xl(t,Na);else throw ke&&Hv(),t}}function tp(){var t=Qs;try{var e=0;for(Qs=!0;wl.length>0;){e++>1e3&&J1();var i=wl,o=i.length;wl=[];for(var r=0;r<o;r++){var s=t0(i[r]);e0(s)}Aa.clear()}}finally{qs=!1,Qs=t,Na=null,ke&&(Sl=[])}}function e0(t){var e=t.length;if(e!==0)for(var i=0;i<e;i++){var o=t[i];(o.f&24576)===0&&Us(o)&&(La(o),o.deps===null&&o.first===null&&o.nodes_start===null&&(o.teardown===null?Zu(o):o.fn=null))}}function ml(t){qs||(qs=!0,queueMicrotask(tp));for(var e=Na=t;e.parent!==null;){e=e.parent;var i=e.f;if((i&96)!==0){if((i&1024)===0)return;e.f^=1024}}wl.push(e)}function t0(t){for(var e=[],i=t;i!==null;){var o=i.f,r=(o&96)!==0,s=r&&(o&1024)!==0;if(!s&&(o&8192)===0){(o&4)!==0?e.push(i):r?i.f^=1024:Us(i)&&La(i);var a=i.first;if(a!==null){i=a;continue}}var l=i.parent;for(i=i.next;i===null&&l!==null;)i=l.next,l=l.parent}return e}function Ba(t){var e;for(t&&(qs=!0,tp(),qs=!0,e=t());;){if(Bv(),wl.length===0)return qs=!1,Na=null,ke&&(Sl=[]),e;qs=!0,tp()}}async function no(){await Promise.resolve(),Ba()}function n(t){var e=t.f,i=(e&2)!==0;if(pc!==null&&pc.add(t),xt!==null&&!Wn){if(!Un?.[1].includes(t)||Un[0]!==xt){var o=xt.deps;t.rv<uc&&(t.rv=uc,Yo===null&&o!==null&&o[Kn]===t?Kn++:Yo===null?Yo=[t]:(!ss||!Yo.includes(t))&&Yo.push(t))}}else if(i&&t.deps===null&&t.effects===null){var r=t,s=r.parent;s!==null&&(s.f&256)===0&&(r.f^=256)}if(i&&(r=t,Us(r)&&Wu(r)),ke&&Kr&&!Wn&&ll!==null&&xt!==null&&ll.reaction===xt)if(t.trace)t.trace();else{var a=ns("TracedAt");if(a){var l=ll.entries.get(t);l===void 0&&(l={traces:[]},ll.entries.set(t,l));var d=l.traces[l.traces.length-1];a.stack!==d?.stack&&l.traces.push(a)}}return rs&&Aa.has(t)?Aa.get(t):t.v}function _t(t){var e=Wn;try{return Wn=!0,t()}finally{Wn=e}}var i0=-7169;function Qo(t,e){t.f=t.f&i0|e}function mc(t){if(!(typeof t!="object"||!t||t instanceof EventTarget)){if(uo in t)fc(t);else if(!Array.isArray(t))for(let e in t){let i=t[e];typeof i=="object"&&i&&uo in i&&fc(i)}}}function fc(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{fc(t[o],e)}catch{}let i=Os(t);if(i!==Object.prototype&&i!==Array.prototype&&i!==Map.prototype&&i!==Set.prototype&&i!==Date.prototype){let o=jd(i);for(let r in o){let s=o[r].get;if(s)try{s.call(t)}catch{}}}}}function ip(t,e){if(e){let i=document.body;t.autofocus=!0,jo(()=>{document.activeElement===i&&t.focus()})}}function Cl(t){var e=xt,i=pt;hi(null),Oi(null);try{return t()}finally{hi(e),Oi(i)}}var op=new Set,vc=new Set;function Gs(t){if(!Ge)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 np(t,e,i,o={}){function r(s){if(o.capture||Oa.call(e,s),!s.cancelBubble)return Cl(()=>i?.call(this,s))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?jo(()=>{e.addEventListener(t,r,o)}):e.addEventListener(t,r,o),r}function bt(t,e,i,o,r){var s={capture:o,passive:r},a=np(t,e,i,s);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&po(()=>{e.removeEventListener(t,a,s)})}function lt(t){for(var e=0;e<t.length;e++)op.add(t[e]);for(var i of vc)i(t)}function Oa(t){var e=this,i=e.ownerDocument,o=t.type,r=t.composedPath?.()||[],s=r[0]||t.target,a=0,l=t.__root;if(l){var d=r.indexOf(l);if(d!==-1&&(e===document||e===window)){t.__root=e;return}var f=r.indexOf(e);if(f===-1)return;d<=f&&(a=d)}if(s=r[a]||t.target,s!==e){Bi(t,"currentTarget",{configurable:!0,get(){return s||i}});var p=xt,g=pt;hi(null),Oi(null);try{for(var u,y=[];s!==null;){var x=s.assignedSlot||s.parentNode||s.host||null;try{var w=s["__"+o];if(w!=null&&(!s.disabled||t.target===s))if(On(w)){var[S,...T]=w;S.apply(s,[t,...T])}else w.call(s,t)}catch(k){u?y.push(k):u=k}if(t.cancelBubble||x===e||x===null)break;s=x}if(u){for(let k of y)queueMicrotask(()=>{throw k});throw u}}finally{t.__root=e,delete t.currentTarget,hi(p),Oi(g)}}}var n0;function Wv(){n0=void 0}function Da(t){var e=document.createElement("template");return e.innerHTML=t.replaceAll("<!>","<!---->"),e.content}function ro(t,e){var i=pt;i.nodes_start===null&&(i.nodes_start=t,i.nodes_end=e)}function P(t,e){var i=(e&1)!==0,o=(e&2)!==0,r,s=!t.startsWith("<!>");return()=>{if(Ge)return ro(ft,null),ft;r===void 0&&(r=Da(s?t:"<!>"+t),i||(r=Xt(r)));var a=o||vl?document.importNode(r,!0):r.cloneNode(!0);if(i){var l=Xt(a),d=a.lastChild;ro(l,d)}else ro(a,a);return a}}function a0(t,e,i="svg"){var o=!t.startsWith("<!>"),r=(e&1)!==0,s=`<${i}>${o?t:"<!>"+t}</${i}>`,a;return()=>{if(Ge)return ro(ft,null),ft;if(!a){var l=Da(s),d=Xt(l);if(r)for(a=document.createDocumentFragment();Xt(d);)a.appendChild(Xt(d));else a=Xt(d)}var f=a.cloneNode(!0);if(r){var p=Xt(f),g=f.lastChild;ro(p,g)}else ro(f,f);return f}}function we(t,e){return a0(t,e,"svg")}function Gr(t=""){if(!Ge){var e=Go(t+"");return ro(e,e),e}var i=ft;return i.nodeType!==Sa&&(i.before(i=Go()),Zt(i)),ro(i,i),i}function Be(){if(Ge)return ro(ft,null),ft;var t=document.createDocumentFragment(),e=document.createComment(""),i=Go();return t.append(e,i),ro(e,i),t}function b(t,e){if(Ge){pt.nodes_end=ft,bi();return}t!==null&&t.before(e)}var l0=/\r/g;function qv(t){t=t.replace(l0,"");let e=5381,i=t.length;for(;i--;)e=(e<<5)-e^t.charCodeAt(i);return(e>>>0).toString(36)}function Qv(t){return t.endsWith("capture")&&t!=="gotpointercapture"&&t!=="lostpointercapture"}var d0=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function Gv(t){return d0.includes(t)}var c0=["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 u0={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 jv(t){return t=t.toLowerCase(),u0[t]??t}var $S=[...c0,"formNoValidate","isMap","noModule","playsInline","readOnly","value","volume","defaultValue","defaultChecked","srcObject","noValidate","allowFullscreen","disablePictureInPicture","disableRemotePlayback"];var p0=["touchstart","touchmove"];function Yv(t){return p0.includes(t)}var f0=["$state","$state.raw","$derived","$derived.by"],yS=[...f0,"$state.snapshot","$props","$props.id","$bindable","$effect","$effect.pre","$effect.tracking","$effect.root","$inspect","$inspect().with","$inspect.trace","$host"];var m0=["textarea","script","style","title"];function Zv(t){return m0.includes(t)}function gc(t){return t?.replace(/\//g,"/\u200B")}var Tl=!0;function hc(t){Tl=t}function fe(t,e){var i=e==null?"":typeof e=="object"?e+"":e;i!==(t.__t??=t.nodeValue)&&(t.__t=i,t.nodeValue=i+"")}function jr(t,e){return Xv(t,e)}function sp(t,e){rc(),e.intro=e.intro??!1;let i=e.target,o=Ge,r=ft;try{for(var s=Xt(i);s&&(s.nodeType!==Dn||s.data!==bs);)s=mo(s);if(!s)throw zr;Di(!0),Zt(s),bi();let a=Xv(t,{...e,anchor:s});if(ft===null||ft.nodeType!==Dn||ft.data!==Bs)throw ws(),zr;return Di(!1),a}catch(a){if(a===zr)return e.recover===!1&&pv(),rc(),gl(i),Di(!1),jr(t,e);throw a}finally{Di(o),Zt(r),Wv()}}var Ha=new Map;function Xv(t,{target:e,anchor:i,props:o={},events:r,context:s,intro:a=!0}){rc();var l=new Set,d=g=>{for(var u=0;u<g.length;u++){var y=g[u];if(!l.has(y)){l.add(y);var x=Yv(y);e.addEventListener(y,Oa,{passive:x});var w=Ha.get(y);w===void 0?(document.addEventListener(y,Oa,{passive:x}),Ha.set(y,1)):Ha.set(y,w+1)}}};d(al(op)),vc.add(d);var f=void 0,p=Lv(()=>{var g=i??e.appendChild(Go());return ci(()=>{if(s){F({});var u=Lt;u.c=s}r&&(o.$$events=r),Ge&&ro(g,null),Tl=a,f=t(g,o)||{},Tl=!0,Ge&&(pt.nodes_end=ft),s&&U()}),()=>{for(var u of l){e.removeEventListener(u,Oa);var y=Ha.get(u);--y===0?(document.removeEventListener(u,Oa),Ha.delete(u)):Ha.set(u,y)}vc.delete(d),g!==i&&g.parentNode?.removeChild(g)}});return rp.set(f,p),f}var rp=new WeakMap;function js(t,e){let i=rp.get(t);return i?(rp.delete(t),i(e)):(ke&&Tv(),Promise.resolve())}function me(t,e,...i){var o=t,r=ne,s;$i(()=>{r!==(r=e())&&(s&&(_i(s),s=null),ke&&r==null&&fv(),s=ci(()=>r(o,...i)))},65536),Ge&&(o=ft)}if(ke){let t=function(e){if(!(e in globalThis)){let i;Object.defineProperty(globalThis,e,{configurable:!0,get:()=>{if(i!==void 0)return i;gv(e)},set:o=>{i=o}})}};_0=t,t("$state"),t("$effect"),t("$derived"),t("$inspect"),t("$props"),t("$bindable")}var _0;function Et(t){Lt===null&&ka("onMount"),Wr&&Lt.l!==null?h0(Lt).m.push(t):De(()=>{let e=_t(t);if(typeof e=="function")return e})}function Mo(t){Lt===null&&ka("onDestroy"),Et(()=>()=>_t(t))}function h0(t){var e=t.l;return e.u??={a:[],b:[],m:[]}}var Jv=new Map;function eg(t,e){var i=Jv.get(t);i||(i=new Set,Jv.set(t,i)),i.add(e)}function M(t,e,[i,o]=[0,0]){Ge&&i===0&&bi();var r=t,s=null,a=null,l=Ti,d=i>0?65536:0,f=!1;let p=(u,y=!0)=>{f=!0,g(y,u)},g=(u,y)=>{if(l===(l=u))return;let x=!1;if(Ge&&o!==-1){if(i===0){let S=nc(r);S===bs?o=0:S===$s?o=1/0:(o=parseInt(S.substring(1)),o!==o&&(o=l?1/0:-1))}let w=o>i;!!l===w&&(r=zs(),Zt(r),Di(!1),x=!0,o=-1)}l?(s?ls(s):y&&(s=ci(()=>y(r))),a&&bn(a,()=>{a=null})):(a?ls(a):y&&(a=ci(()=>y(r,[i+1,o]))),s&&bn(s,()=>{s=null})),x&&Di(!0)};$i(()=>{f=!1,e(p),f||g(null,null)},d),Ge&&(r=ft)}function Ys(t,e,i){Ge&&bi();var o=t,r=Ti,s,a=qr()?sv:Ca;$i(()=>{a(r,r=e())&&(s&&bn(s),s=ci(()=>i(o)))}),Ge&&(o=ft)}var Cs=null;function dp(t){Cs=t}function kl(t,e){return e}function y0(t,e,i,o){for(var r=[],s=e.length,a=0;a<s;a++)dc(e[a].e,r,!0);var l=s>0&&r.length===0&&i!==null;if(l){var d=i.parentNode;gl(d),d.append(i),o.clear(),Ss(t,e[0].prev,e[s-1].next)}Xu(r,()=>{for(var f=0;f<s;f++){var p=e[f];l||(o.delete(p.k),Ss(t,p.prev,p.next)),_i(p.e,!l)}})}function ri(t,e,i,o,r,s=null){var a=t,l={flags:e,items:new Map,first:null},d=(e&4)!==0;if(d){var f=t;a=Ge?Zt(Xt(f)):f.appendChild(Go())}Ge&&bi();var p=null,g=!1,u=Tr(()=>{var y=i();return On(y)?y:y==null?[]:al(y)});$i(()=>{var y=n(u),x=y.length;if(g&&x===0)return;g=x===0;let w=!1;if(Ge){var S=nc(a)===$s;S!==(x===0)&&(a=zs(),Zt(a),Di(!1),w=!0)}if(Ge){for(var T=null,k,L=0;L<x;L++){if(ft.nodeType===Dn&&ft.data===Bs){a=ft,w=!0,Di(!1);break}var A=y[L],I=o(A,L);k=og(ft,l,T,null,A,I,L,r,e,i),l.items.set(I,k),T=k}x>0&&Zt(zs())}Ge||x0(y,l,a,r,e,o,i),s!==null&&(x===0?p?ls(p):p=ci(()=>s(a)):p!==null&&bn(p,()=>{p=null})),w&&Di(!0),n(u)}),Ge&&(a=ft)}function x0(t,e,i,o,r,s,a){var l=(r&8)!==0,d=(r&3)!==0,f=t.length,p=e.items,g=e.first,u=g,y,x=null,w,S=[],T=[],k,L,A,I;if(l)for(I=0;I<f;I+=1)k=t[I],L=s(k,I),A=p.get(L),A!==void 0&&(A.a?.measure(),(w??=new Set).add(A));for(I=0;I<f;I+=1){if(k=t[I],L=s(k,I),A=p.get(L),A===void 0){var O=u?u.e.nodes_start:i;x=og(O,e,x,x===null?e.first:x.next,k,L,I,o,r,a),p.set(L,x),S=[],T=[],u=x.next;continue}if(d&&w0(A,k,I,r),(A.e.f&8192)!==0&&(ls(A.e),l&&(A.a?.unfix(),(w??=new Set).delete(A))),A!==u){if(y!==void 0&&y.has(A)){if(S.length<T.length){var G=T[0],D;x=G.prev;var ee=S[0],X=S[S.length-1];for(D=0;D<S.length;D+=1)tg(S[D],G,i);for(D=0;D<T.length;D+=1)y.delete(T[D]);Ss(e,ee.prev,X.next),Ss(e,x,ee),Ss(e,X,G),u=G,x=X,I-=1,S=[],T=[]}else y.delete(A),tg(A,u,i),Ss(e,A.prev,A.next),Ss(e,A,x===null?e.first:x.next),Ss(e,x,A),x=A;continue}for(S=[],T=[];u!==null&&u.k!==L;)(u.e.f&8192)===0&&(y??=new Set).add(u),T.push(u),u=u.next;if(u===null)continue;A=u}S.push(A),x=A,u=A.next}if(u!==null||y!==void 0){for(var ae=y===void 0?[]:al(y);u!==null;)(u.e.f&8192)===0&&ae.push(u),u=u.next;var j=ae.length;if(j>0){var ue=(r&4)!==0&&f===0?i:null;if(l){for(I=0;I<j;I+=1)ae[I].a?.measure();for(I=0;I<j;I+=1)ae[I].a?.fix()}y0(e,ae,ue,p)}}l&&jo(()=>{if(w!==void 0)for(A of w)A.a?.apply()}),pt.first=e.first&&e.first.e,pt.last=x&&x.e}function w0(t,e,i,o){(o&1)!==0&&Ma(t.v,e),(o&2)!==0?Ma(t.i,i):t.i=i}function og(t,e,i,o,r,s,a,l,d,f){var p=Cs,g=(d&1)!==0,u=(d&16)===0,y=g?u?Qr(r,!1,!1):lr(r):r,x=(d&2)===0?a:lr(a);ke&&g&&(y.trace=()=>{var S=typeof x=="number"?a:x.v;f()[S]});var w={i:x,v:y,k:s,a:null,e:null,prev:i,next:o};Cs=w;try{return w.e=ci(()=>l(t,y,x,f),Ge),w.e.prev=i&&i.e,w.e.next=o&&o.e,i===null?e.first=w:(i.next=w,i.e.next=w.e),o!==null&&(o.prev=w,o.e.prev=w.e),w}finally{Cs=p}}function tg(t,e,i){for(var o=t.next?t.next.e.nodes_start:i,r=e?e.e.nodes_start:i,s=t.e.nodes_start;s!==o;){var a=mo(s);r.before(s),s=a}}function Ss(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 S0(t,e,i){if(!e||e===qv(String(i??"")))return;let o,r=t.__svelte_meta?.loc;r?o=`near ${r.file}:${r.line}:${r.column}`:Hn?.[vn]&&(o=`in ${Hn[vn]}`),Cv(gc(o))}function Il(t,e,i=!1,o=!1,r=!1){var s=t,a="";N(()=>{var l=pt;if(a===(a=e()??"")){Ge&&bi();return}if(l.nodes_start!==null&&(Yu(l.nodes_start,l.nodes_end),l.nodes_start=l.nodes_end=null),a!==""){if(Ge){for(var d=ft.data,f=bi(),p=f;f!==null&&(f.nodeType!==Dn||f.data!=="");)p=f,f=mo(f);if(f===null)throw ws(),zr;ke&&!r&&S0(f.parentNode,d,a),ro(ft,p),s=Zt(f);return}var g=a+"";i?g=`<svg>${g}</svg>`:o&&(g=`<math>${g}</math>`);var u=Da(g);if((i||o)&&(u=Xt(u)),ro(Xt(u),u.lastChild),i||o)for(;Xt(u);)s.before(Xt(u));else s.before(u)}})}function si(t,e,i){Ge&&bi();var o=t,r,s;$i(()=>{r!==(r=e())&&(s&&(bn(s),s=null),r&&(s=ci(()=>i(o,r))))},65536),Ge&&(o=ft)}function Zs(t,e,i,o,r,s){let a=Ge;Ge&&bi();var l=ke&&s&&Lt?.function[vn],d,f,p=null;Ge&&ft.nodeType===Zd&&(p=ft,bi());var g=Ge?ft:t,u,y=Cs;$i(()=>{let x=e()||null;var w=r?r():i||x==="svg"?Qd:null;if(x!==d){var S=Cs;dp(y),u&&(x===null?bn(u,()=>{u=null,f=null}):x===f?ls(u):(_i(u),hc(!1))),x&&x!==f&&(u=ci(()=>{if(p=Ge?p:w?document.createElementNS(w,x):document.createElement(x),ke&&s&&(p.__svelte_meta={loc:{file:l,line:s[0],column:s[1]}}),ro(p,p),o){Ge&&Zv(x)&&p.append(document.createComment(""));var T=Ge?Xt(p):p.appendChild(Go());Ge&&(T===null?Di(!1):Zt(T)),o(p,T)}pt.nodes_end=p,g.before(p)})),d=x,d&&(f=d),hc(!0),dp(S)}},65536),a&&(Di(!0),Zt(g))}var up;function ng(t){return up=t.target,new cp(t)}var cp=class{#t;#e;constructor(e){var i=new Map,o=(s,a)=>{var l=Qr(a,!1,!1);return i.set(s,l),l};let r=new Proxy({...e.props||{},$$events:{}},{get(s,a){return n(i.get(a)??o(a,Reflect.get(s,a)))},has(s,a){return a===wa?!0:(n(i.get(a)??o(a,Reflect.get(s,a))),Reflect.has(s,a))},set(s,a,l){return V(i.get(a)??o(a,l),l),Reflect.set(s,a,l)}});this.#e=(e.hydrate?sp:jr)(e.component,{target:e.target,anchor:e.anchor,props:r,context:e.context,intro:e.intro??!1,recover:e.recover}),(!e?.props?.$$host||e.sync===!1)&&Ba(),this.#t=r.$$events;for(let s of Object.keys(this.#e))s==="$set"||s==="$destroy"||s==="$on"||Bi(this,s,{get(){return this.#e[s]},set(a){this.#e[s]=a},enumerable:!0});this.#e.$set=s=>{Object.assign(r,s)},this.#e.$destroy=()=>{js(this.#e)}}$set(e){this.#e.$set(e)}$on(e,i){this.#t[e]=this.#t[e]||[];let o=(...r)=>i.call(this,...r);return this.#t[e].push(o),()=>{this.#t[e]=this.#t[e].filter(r=>r!==o)}}$destroy(){this.#e.$destroy()}};function W(t,e){jo(()=>{var i=t.getRootNode(),o=i.host?i:i.head??i.ownerDocument.head??up?.parentNode;if(!o?.querySelector("#"+e.hash)){let r=document.createElement("style");r.id=e.hash,r.textContent=e.code,o.appendChild(r),ke&&eg(e.hash,r)}})}function ds(t,e){var i=void 0,o;$i(()=>{i!==(i=e())&&(o&&(_i(o),o=null),i&&(o=ci(()=>{oo(()=>i(t))})))})}function rg(t){var e,i,o="";if(typeof t=="string"||typeof t=="number")o+=t;else if(typeof t=="object")if(Array.isArray(t)){var r=t.length;for(e=0;e<r;e++)t[e]&&(i=rg(t[e]))&&(o&&(o+=" "),o+=i)}else for(i in t)t[i]&&(o&&(o+=" "),o+=i);return o}function sg(){for(var t,e,i=0,o="",r=arguments.length;i<r;i++)(t=arguments[i])&&(e=rg(t))&&(o&&(o+=" "),o+=e);return o}function El(t){return typeof t=="object"?sg(t):t??""}var ag=[...`
44
- \r\f\xA0\v\uFEFF`];function dg(t,e,i){var o=t==null?"":""+t;if(e&&(o=o?o+" "+e:e),i){for(var r in i)if(i[r])o=o?o+" "+r:r;else if(o.length)for(var s=r.length,a=0;(a=o.indexOf(r,a))>=0;){var l=a+s;(a===0||ag.includes(o[a-1]))&&(l===o.length||ag.includes(o[l]))?o=(a===0?"":o.substring(0,a))+o.substring(l+1):a=l}}return o===""?null:o}function lg(t,e=!1){var i=e?" !important;":";",o="";for(var r in t){var s=t[r];s!=null&&s!==""&&(o+=" "+r+": "+s+i)}return o}function pp(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function cg(t,e){if(e){var i="",o,r;if(Array.isArray(e)?(o=e[0],r=e[1]):o=e,t){t=String(t).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var s=!1,a=0,l=!1,d=[];o&&d.push(...Object.keys(o).map(pp)),r&&d.push(...Object.keys(r).map(pp));var f=0,p=-1;let w=t.length;for(var g=0;g<w;g++){var u=t[g];if(l?u==="/"&&t[g-1]==="*"&&(l=!1):s?s===u&&(s=!1):u==="/"&&t[g+1]==="*"?l=!0:u==='"'||u==="'"?s=u:u==="("?a++:u===")"&&a--,!l&&s===!1&&a===0){if(u===":"&&p===-1)p=g;else if(u===";"||g===w-1){if(p!==-1){var y=pp(t.substring(f,p).trim());if(!d.includes(y)){u!==";"&&g++;var x=t.substring(f,g).trim();i+=" "+x+";"}}f=g+1,p=-1}}}}return o&&(i+=lg(o)),r&&(i+=lg(r,!0)),i=i.trim(),i===""?null:i}return t==null?null:String(t)}function J(t,e,i,o,r,s){var a=t.__className;if(Ge||a!==i||a===void 0){var l=dg(i,o,s);(!Ge||l!==t.getAttribute("class"))&&(l==null?t.removeAttribute("class"):e?t.className=l:t.setAttribute("class",l)),t.__className=i}else if(s&&r!==s)for(var d in s){var f=!!s[d];(r==null||f!==!!r[d])&&t.classList.toggle(d,f)}return s}function fp(t,e={},i,o){for(var r in i){var s=i[r];e[r]!==s&&(i[r]==null?t.style.removeProperty(r):t.style.setProperty(r,s,o))}}function ot(t,e,i,o){var r=t.__style;if(Ge||r!==e){var s=cg(e,o);(!Ge||s!==t.getAttribute("style"))&&(s==null?t.removeAttribute("style"):t.style.cssText=s),t.__style=e}else o&&(Array.isArray(o)?(fp(t,i?.[0],o[0]),fp(t,i?.[1],o[1],"important")):fp(t,i,o));return o}function Pl(t,e,i){if(t.multiple){if(e==null)return;if(!On(e))return kv();for(var o of t.options)o.selected=e.includes(ug(o));return}for(o of t.options){var r=ug(o);if(Du(r,e)){o.selected=!0;return}}(!i||e!==void 0)&&(t.selectedIndex=-1)}function mp(t){var e=new MutationObserver(()=>{Pl(t,t.__value)});e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),po(()=>{e.disconnect()})}function ug(t){return"__value"in t?t.__value:t.value}var Fa=Symbol("class"),Ua=Symbol("style"),mg=Symbol("is custom element"),vg=Symbol("is html");function gg(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function Re(t,e,i,o){var r=_g(t);if(Ge&&(r[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName==="LINK")){o||M0(t,e,i??"");return}r[e]!==(r[e]=i)&&(e==="loading"&&(t[rv]=i),i==null?t.removeAttribute(e):typeof i!="string"&&bg(t).includes(e)?t[e]=i:t.setAttribute(e,i))}function hg(t,e,i,o,r=!1){var s=_g(t),a=s[mg],l=!s[vg];let d=Ge&&a;d&&Di(!1);var f=e||{},p=t.tagName==="OPTION";for(var g in e)g in i||(i[g]=null);i.class?i.class=El(i.class):(o||i[Fa])&&(i.class=null),i[Ua]&&(i.style??=null);var u=bg(t);for(let A in i){let I=i[A];if(p&&A==="value"&&I==null){t.value=t.__value="",f[A]=I;continue}if(A==="class"){var y=t.namespaceURI==="http://www.w3.org/1999/xhtml";J(t,y,I,o,e?.[Fa],i[Fa]),f[A]=I,f[Fa]=i[Fa];continue}if(A==="style"){ot(t,I,e?.[Ua],i[Ua]),f[A]=I,f[Ua]=i[Ua];continue}var x=f[A];if(!(I===x&&!(I===void 0&&t.hasAttribute(A)))){f[A]=I;var w=A[0]+A[1];if(w!=="$$")if(w==="on"){let O={},G="$$"+A,D=A.slice(2);var S=Gv(D);if(Qv(D)&&(D=D.slice(0,-7),O.capture=!0),!S&&x){if(I!=null)continue;t.removeEventListener(D,f[G],O),f[G]=null}if(I!=null)if(S)t[`__${D}`]=I,lt([D]);else{let ee=function(X){f[A].call(this,X)};var L=ee;f[G]=np(D,t,ee,O)}else S&&(t[`__${D}`]=void 0)}else if(A==="style")Re(t,A,I);else if(A==="autofocus")ip(t,!!I);else if(!a&&(A==="__value"||A==="value"&&I!=null))t.value=t.__value=I;else if(A==="selected"&&p)gg(t,I);else{var T=A;l||(T=jv(T));var k=T==="defaultValue"||T==="defaultChecked";if(I==null&&!a&&!k)if(s[A]=null,T==="value"||T==="checked"){let O=t,G=e===void 0;if(T==="value"){let D=O.defaultValue;O.removeAttribute(T),O.defaultValue=D,O.value=O.__value=G?D:null}else{let D=O.defaultChecked;O.removeAttribute(T),O.defaultChecked=D,O.checked=G?D:!1}}else t.removeAttribute(A);else k||u.includes(T)&&(a||typeof I!="string")?t[T]=I:typeof I!="function"&&Re(t,T,I,r)}}}return d&&Di(!0),f}function Te(t,e,i=[],o,r=!1,s=Cr){let a=i.map(s);var l=void 0,d={},f=t.nodeName==="SELECT",p=!1;if($i(()=>{var u=e(...a.map(n)),y=hg(t,l,u,o,r);p&&f&&"value"in u&&Pl(t,u.value,!1);for(let w of Object.getOwnPropertySymbols(d))u[w]||_i(d[w]);for(let w of Object.getOwnPropertySymbols(u)){var x=u[w];w.description===Au&&(!l||x!==l[w])&&(d[w]&&_i(d[w]),d[w]=ci(()=>ds(t,()=>x))),y[w]=x}l=y}),f){var g=t;oo(()=>{Pl(g,l.value),mp(g)})}p=!0}function _g(t){return t.__attributes??={[mg]:t.nodeName.includes("-"),[vg]:t.namespaceURI===ev}}var pg=new Map;function bg(t){var e=pg.get(t.nodeName);if(e)return e;pg.set(t.nodeName,e=[]);for(var i,o=t,r=Element.prototype;r!==o;){i=jd(o);for(var s in i)i[s].set&&e.push(s);o=Os(o)}return e}function M0(t,e,i){ke&&(e==="srcset"&&L0(t,i)||vp(t.getAttribute(e)??"",i)||Sv(e,t.outerHTML.replace(t.innerHTML,t.innerHTML&&"..."),String(i)))}function vp(t,e){return t===e?!0:new URL(t,document.baseURI).href===new URL(e,document.baseURI).href}function fg(t){return t.split(",").map(e=>e.trim().split(" ").filter(Boolean))}function L0(t,e){var i=fg(t.srcset),o=fg(e);return o.length===i.length&&o.every(([r,s],a)=>s===i[a][1]&&(vp(i[a][0],r)||vp(r,i[a][0])))}var V0=Gd?()=>performance.now():()=>Date.now(),Er={tick:t=>(Gd?requestAnimationFrame:ne)(t),now:()=>V0(),tasks:new Set};function $g(){let t=Er.now();Er.tasks.forEach(e=>{e.c(t)||(Er.tasks.delete(e),e.f())}),Er.tasks.size!==0&&Er.tick($g)}function yg(t){let e;return Er.tasks.size===0&&Er.tick($g),{promise:new Promise(i=>{Er.tasks.add(e={c:t,f:i})}),abort(){Er.tasks.delete(e)}}}function _c(t,e){Cl(()=>{t.dispatchEvent(new CustomEvent(e))})}function O0(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 xg(t){let e={},i=t.split(";");for(let o of i){let[r,s]=o.split(":");if(!r||s===void 0)break;let a=O0(r.trim());e[a]=s.trim()}return e}var D0=t=>t;function hp(t,e,i,o){var r=(t&1)!==0,s=(t&2)!==0,a=r&&s,l=(t&4)!==0,d=a?"both":r?"in":"out",f,p=e.inert,g=e.style.overflow,u,y;function x(){var L=xt,A=pt;hi(null),Oi(null);try{return f??=i()(e,o?.()??{},{direction:d})}finally{hi(L),Oi(A)}}var w={is_global:l,in(){if(e.inert=p,!r){y?.abort(),y?.reset?.();return}s||u?.abort(),_c(e,"introstart"),u=gp(e,x(),y,1,()=>{_c(e,"introend"),u?.abort(),u=f=void 0,e.style.overflow=g})},out(L){if(!s){L?.(),f=void 0;return}e.inert=!0,_c(e,"outrostart"),y=gp(e,x(),u,0,()=>{_c(e,"outroend"),L?.()})},stop:()=>{u?.abort(),y?.abort()}},S=pt;if((S.transitions??=[]).push(w),r&&Tl){var T=l;if(!T){for(var k=S.parent;k&&(k.f&65536)!==0;)for(;(k=k.parent)&&(k.f&16)===0;);T=!k||(k.f&32768)!==0}T&&oo(()=>{_t(()=>w.in())})}}function gp(t,e,i,o,r){var s=o===1;if(ys(e)){var a,l=!1;return jo(()=>{if(!l){var S=e({direction:s?"in":"out"});a=gp(t,S,i,o,r)}}),{abort:()=>{l=!0,a?.abort()},deactivate:()=>a.deactivate(),reset:()=>a.reset(),t:()=>a.t()}}if(i?.deactivate(),!e?.duration)return r(),{abort:ne,deactivate:ne,reset:ne,t:()=>o};let{delay:d=0,css:f,tick:p,easing:g=D0}=e;var u=[];if(s&&i===void 0&&(p&&p(0,1),f)){var y=xg(f(0,1));u.push(y,y)}var x=()=>1-o,w=t.animate(u,{duration:d,fill:"forwards"});return w.onfinish=()=>{w.cancel();var S=i?.t()??1-o;i?.abort();var T=o-S,k=e.duration*Math.abs(T),L=[];if(k>0){var A=!1;if(f)for(var I=Math.ceil(k/16.666666666666668),O=0;O<=I;O+=1){var G=S+T*g(O/I),D=xg(f(G,1-G));L.push(D),A||=D.overflow==="hidden"}A&&(t.style.overflow="hidden"),x=()=>{var ee=w.currentTime;return S+T*g(ee/k)},p&&yg(()=>{if(w.playState!=="running")return!1;var ee=x();return p(ee,1-ee),!0})}w=t.animate(L,{duration:k,fill:"forwards"}),w.onfinish=()=>{x=()=>o,p?.(o,1-o),r()}},{abort:()=>{w&&(w.cancel(),w.effect=null,w.onfinish=ne)},deactivate:()=>{r=ne},reset:()=>{o===0&&p?.(1,0)},t:()=>x()}}var _p=class t{#t=new WeakMap;#e;#i;static entries=new WeakMap;constructor(e){this.#i=e}observe(e,i){var o=this.#t.get(e)||new Set;return o.add(i),this.#t.set(e,o),this.#o().observe(e,this.#i),()=>{var r=this.#t.get(e);r.delete(i),r.size===0&&(this.#t.delete(e),this.#e.unobserve(e))}}#o(){return this.#e??(this.#e=new ResizeObserver(e=>{for(var i of e){t.entries.set(i.target,i);for(var o of this.#t.get(i.target)||[])o(i)}}))}};var H0=new _p({box:"border-box"});function qn(t,e,i){var o=H0.observe(t,()=>i(t[e]));oo(()=>(_t(()=>i(t[e])),o))}function wg(t,e){return t===e||t?.[uo]===e}function tt(t={},e,i,o){return oo(()=>{var r,s;return vo(()=>{r=s,s=o?.()||[],_t(()=>{t!==i(...s)&&(e(t,...s),r&&wg(i(...r),t)&&e(null,...r))})}),()=>{jo(()=>{s&&wg(i(...s),t)&&e(null,...s)})}}),t}function Pr(t=!1){let e=Lt,i=e.l.u;if(!i)return;let o=()=>mc(e.s);if(t){let r=0,s={},a=Cr(()=>{let l=!1,d=e.s;for(let f in d)d[f]!==s[f]&&(s[f]=d[f],l=!0);return l&&r++,r});o=()=>n(a)}i.b.length&&bl(()=>{Sg(e,o),xs(i.b)}),De(()=>{let r=_t(()=>i.m.map(nv));return()=>{for(let s of r)typeof s=="function"&&s()}}),i.a.length&&De(()=>{Sg(e,o),xs(i.a)})}function Sg(t,e){if(t.l.s)for(let i of t.l.s)n(i);e()}function Al(t,e,i){if(t==null)return e(void 0),i&&i(void 0),ne;let o=_t(()=>t.subscribe(e,i));return o.unsubscribe?()=>o.unsubscribe():o}var za=[];function dr(t,e){return{subscribe:ie(t,e).subscribe}}function ie(t,e=ne){let i=null,o=new Set;function r(l){if(Ca(t,l)&&(t=l,i)){let d=!za.length;for(let f of o)f[1](),za.push(f,t);if(d){for(let f=0;f<za.length;f+=2)za[f][0](za[f+1]);za.length=0}}}function s(l){r(l(t))}function a(l,d=ne){let f=[l,d];return o.add(f),o.size===1&&(i=e(r,s)||ne),l(t),()=>{o.delete(f),o.size===0&&i&&(i(),i=null)}}return{set:r,update:s,subscribe:a}}function Jt(t,e,i){let o=!Array.isArray(t),r=o?[t]:t;if(!r.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");let s=e.length<2;return dr(i,(a,l)=>{let d=!1,f=[],p=0,g=ne,u=()=>{if(p)return;g();let x=e(o?f[0]:f,a,l);s?a(x):g=typeof x=="function"?x:ne},y=r.map((x,w)=>Al(x,S=>{f[w]=S,p&=~(1<<w),d&&u()},()=>{p|=1<<w}));return d=!0,u(),function(){xs(y),g(),d=!1}})}function ve(t){let e;return Al(t,i=>e=i)(),e}var $c=!1,bp=Symbol();function $(t,e,i){let o=i[e]??={store:null,source:Qr(void 0),unsubscribe:ne};if(o.store!==t&&!(bp in i))if(o.unsubscribe(),o.store=t??null,t==null)o.source.v=void 0,o.unsubscribe=ne;else{var r=!0;o.unsubscribe=Al(t,s=>{r?o.source.v=s:V(o.source,s)}),r=!1}return t&&bp in i?ve(t):n(o.source)}function Ve(){let t={};function e(){po(()=>{for(var i in t)t[i].unsubscribe();Bi(t,bp,{enumerable:!1,value:!0})})}return[t,e]}function $p(t){var e=$c;try{return $c=!1,[t(),$c]}finally{$c=e}}var Q0={get(t,e){if(!t.exclude.includes(e))return t.props[e]},set(t,e){return ke&&vv(`${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 Ae(t,e,i){return new Proxy(ke?{props:t,exclude:e,name:i,other:{},to_proxy:[]}:{props:t,exclude:e},Q0)}var G0={get(t,e){let i=t.props.length;for(;i--;){let o=t.props[i];if(ys(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 r=t.props[o];ys(r)&&(r=r());let s=Eo(r,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(ys(o)&&(o=o()),typeof o=="object"&&o!==null&&e in o){let r=Eo(o,e);return r&&!r.configurable&&(r.configurable=!0),r}}},has(t,e){if(e===uo||e===wa)return!1;for(let i of t.props)if(ys(i)&&(i=i()),i!=null&&e in i)return!0;return!1},ownKeys(t){let e=[];for(let i of t.props)if(ys(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 cs(...t){return new Proxy({props:t},G0)}function Cg(t){return t.ctx?.d??!1}function m(t,e,i,o){var r=(i&1)!==0,s=!Wr||(i&2)!==0,a=(i&8)!==0,l=(i&16)!==0,d=!1,f;a?[f,d]=$p(()=>t[e]):f=t[e];var p=uo in t||wa in t,g=a&&(Eo(t,e)?.set??(p&&e in t&&(G=>t[e]=G)))||void 0,u=o,y=!0,x=!1,w=()=>(x=!0,y&&(y=!1,l?u=_t(o):u=o),u);f===void 0&&o!==void 0&&(g&&s&&mv(e),f=w(),g&&g(f));var S;if(s)S=()=>{var G=t[e];return G===void 0?w():(y=!0,x=!1,G)};else{var T=(r?Cr:Tr)(()=>t[e]);T.f|=131072,S=()=>{var G=n(T);return G!==void 0&&(u=void 0),G===void 0?u:G}}if((i&4)===0&&s)return S;if(g){var k=t.$$legacy;return function(G,D){return arguments.length>0?((!s||!D||k||d)&&g(D?S():G),G):S()}}var L=!1,A=!1,I=Qr(f),O=Cr(()=>{var G=S(),D=n(I);return L?(L=!1,A=!0,D):(A=!1,I.v=G)});return a&&n(O),r||(O.equals=Ta),function(G,D){if(pc!==null&&(L=A,S(),n(I)),arguments.length>0){let ee=D?n(O):s&&a?qt(G):G;if(!O.equals(ee)){if(L=!0,V(I,ee),x&&u!==void 0&&(u=ee),Cg(O))return G;_t(()=>n(O))}return G}return Cg(O)?O.v:n(O)}}var j0;typeof HTMLElement=="function"&&(j0=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;constructor(t,e,i){super(),this.$$ctor=t,this.$$s=e,i&&this.attachShadow({mode:"open"})}addEventListener(t,e,i){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(e),this.$$c){let o=this.$$c.$on(t,e);this.$$l_u.set(e,o)}super.addEventListener(t,e,i)}removeEventListener(t,e,i){if(super.removeEventListener(t,e,i),this.$$c){let o=this.$$l_u.get(e);o&&(o(),this.$$l_u.delete(e))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(r){return s=>{let a=document.createElement("slot");r!=="default"&&(a.name=r),b(s,a)}};var t=e;if(await Promise.resolve(),!this.$$cn||this.$$c)return;let i={},o=Y0(this);for(let r of this.$$s)r in o&&(r==="default"&&!this.$$d.children?(this.$$d.children=e(r),i.default=!0):i[r]=e(r));for(let r of this.attributes){let s=this.$$g_p(r.name);s in this.$$d||(this.$$d[s]=yp(s,r.value,this.$$p_d,"toProp"))}for(let r in this.$$p_d)!(r in this.$$d)&&this[r]!==void 0&&(this.$$d[r]=this[r],delete this[r]);this.$$c=ng({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:i,$$host:this}}),this.$$me=lc(()=>{vo(()=>{this.$$r=!0;for(let r of Mu(this.$$c)){if(!this.$$p_d[r]?.reflect)continue;this.$$d[r]=this.$$c[r];let s=yp(r,this.$$d[r],this.$$p_d,"toAttribute");s==null?this.removeAttribute(this.$$p_d[r].attribute||r):this.setAttribute(this.$$p_d[r].attribute||r,s)}this.$$r=!1})});for(let r in this.$$l)for(let s of this.$$l[r]){let a=this.$$c.$on(r,s);this.$$l_u.set(s,a)}this.$$l={}}}attributeChangedCallback(t,e,i){this.$$r||(t=this.$$g_p(t),this.$$d[t]=yp(t,i,this.$$p_d,"toProp"),this.$$c?.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(t){return Mu(this.$$p_d).find(e=>this.$$p_d[e].attribute===t||!this.$$p_d[e].attribute&&e.toLowerCase()===t)||t}});function yp(t,e,i,o){let r=i[t]?.type;if(e=r==="Boolean"&&typeof e!="boolean"?e!=null:e,!o||!i[t])return e;if(o==="toAttribute")switch(r){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e??null;default:return e}else switch(r){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}function Y0(t){let e={};return t.childNodes.forEach(i=>{e[i.slot||"default"]=!0}),e}var Tg="5";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add(Tg);import{areValidLiveRecordSources as Hx,clientChecker as Hm}from"@vkontakte/videoplayer-core";import"@vkontakte/videoplayer-core";import{noop as I1,safeStorage as Fx,throttleFn as Ux}from"@vkontakte/videoplayer-shared";import{SeekAction as zx}from"@vkontakte/videoplayer-statistics";import{InterfaceLanguage as Z0,fillWithDefault as X0,VideoQuality as kg}from"@vkontakte/videoplayer-shared";var J0={isMobile:void 0,disableInvisibleComponentsTimeout:500,debugLog:!1,devNullLog:!1,defaultLanguage:Z0.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:kg.Q_480P,highQualityLimit:kg.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"},Ig=t=>X0(t,J0),Eg=t=>Ea("ui-config",t),Tt=()=>Ia("ui-config");var Ml="vk_player_debug_panel_opened";var Pg="videoplayer",Ag="videoplayer";var Yr={KeyF:"f",KeyK:"k",KeyC:"c",KeyM:"m"},Mg=new Set(["ArrowLeft","ArrowRight","KeyL","KeyJ"]),Lg=new Set(["Tab","Space","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"]),Vg=new Set(["ShiftRight","ShiftLeft"]);var Rg=["TIMELINE"],Ll=[...Rg,"GRAPH_BUTTON"],xp=[...Rg,"PLAY_BUTTON"],Vl=[...Ll,"PLAY_BUTTON"];var Zr=(s=>(s.XS="xs",s.S="s",s.M="m",s.L="l",s.XL="xl",s))(Zr||{}),Js={xs:0,s:1,m:2,l:3,xl:4};import{assertNonNullable as Ng,VERSION as e_}from"@vkontakte/videoplayer-shared";import{VERSION as t_}from"@vkontakte/videoplayer-core";import{VERSION as i_}from"@vkontakte/videoplayer-statistics";var yc="prod",Wa="1.1.72-dev.c0dc5218.0";var ea=(t,e,i)=>{let o=document.createElement("a");o.href=t,o.download=`${e}.${i}`,o.style.display="none",o.click()};var Bg=Symbol("storeContext"),Og=Symbol("microStoresContext"),Dg=(t,e)=>{Ea(Bg,t),Ea(Og,e),yc==="dev"&&(window.app={store:t,microStores:e})},Se=()=>{let t=Ia(Bg);return Ng(t,"Store context is empty!"),t},Qi=()=>{let t=Ia(Og);return Ng(t,"MicroStores context is empty!"),t},Kt=(t,e)=>wc(t,t.getValue(),e),wc=(t,e,i)=>dr(e,o=>{let r=t.subscribe(s=>{o(s),i?.(s)});return()=>r.unsubscribe()}),Hg=(t,e,i,o)=>{let r=t.info,{width:s,height:a}=ve(i.ui.playerSize),l=r.throughputEstimation$.getValue()?.toFixed(0)??0,d=r.rttEstimation$.getValue()?.toFixed(0)??0,f=r.isAutoQualityEnabled$.getValue()?"auto":"manual",p=`${Wa} (core: ${t_}, stat: ${i_}, shared: ${e_})`,g=ve(i.state.errorLog$),u=g.length?`
44
+ \r\f\xA0\v\uFEFF`];function dg(t,e,i){var o=t==null?"":""+t;if(e&&(o=o?o+" "+e:e),i){for(var r in i)if(i[r])o=o?o+" "+r:r;else if(o.length)for(var s=r.length,a=0;(a=o.indexOf(r,a))>=0;){var l=a+s;(a===0||ag.includes(o[a-1]))&&(l===o.length||ag.includes(o[l]))?o=(a===0?"":o.substring(0,a))+o.substring(l+1):a=l}}return o===""?null:o}function lg(t,e=!1){var i=e?" !important;":";",o="";for(var r in t){var s=t[r];s!=null&&s!==""&&(o+=" "+r+": "+s+i)}return o}function pp(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function cg(t,e){if(e){var i="",o,r;if(Array.isArray(e)?(o=e[0],r=e[1]):o=e,t){t=String(t).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var s=!1,a=0,l=!1,d=[];o&&d.push(...Object.keys(o).map(pp)),r&&d.push(...Object.keys(r).map(pp));var f=0,p=-1;let w=t.length;for(var g=0;g<w;g++){var u=t[g];if(l?u==="/"&&t[g-1]==="*"&&(l=!1):s?s===u&&(s=!1):u==="/"&&t[g+1]==="*"?l=!0:u==='"'||u==="'"?s=u:u==="("?a++:u===")"&&a--,!l&&s===!1&&a===0){if(u===":"&&p===-1)p=g;else if(u===";"||g===w-1){if(p!==-1){var y=pp(t.substring(f,p).trim());if(!d.includes(y)){u!==";"&&g++;var x=t.substring(f,g).trim();i+=" "+x+";"}}f=g+1,p=-1}}}}return o&&(i+=lg(o)),r&&(i+=lg(r,!0)),i=i.trim(),i===""?null:i}return t==null?null:String(t)}function J(t,e,i,o,r,s){var a=t.__className;if(Ge||a!==i||a===void 0){var l=dg(i,o,s);(!Ge||l!==t.getAttribute("class"))&&(l==null?t.removeAttribute("class"):e?t.className=l:t.setAttribute("class",l)),t.__className=i}else if(s&&r!==s)for(var d in s){var f=!!s[d];(r==null||f!==!!r[d])&&t.classList.toggle(d,f)}return s}function fp(t,e={},i,o){for(var r in i){var s=i[r];e[r]!==s&&(i[r]==null?t.style.removeProperty(r):t.style.setProperty(r,s,o))}}function ot(t,e,i,o){var r=t.__style;if(Ge||r!==e){var s=cg(e,o);(!Ge||s!==t.getAttribute("style"))&&(s==null?t.removeAttribute("style"):t.style.cssText=s),t.__style=e}else o&&(Array.isArray(o)?(fp(t,i?.[0],o[0]),fp(t,i?.[1],o[1],"important")):fp(t,i,o));return o}function Pl(t,e,i){if(t.multiple){if(e==null)return;if(!On(e))return kv();for(var o of t.options)o.selected=e.includes(ug(o));return}for(o of t.options){var r=ug(o);if(Du(r,e)){o.selected=!0;return}}(!i||e!==void 0)&&(t.selectedIndex=-1)}function mp(t){var e=new MutationObserver(()=>{Pl(t,t.__value)});e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),po(()=>{e.disconnect()})}function ug(t){return"__value"in t?t.__value:t.value}var Fa=Symbol("class"),Ua=Symbol("style"),mg=Symbol("is custom element"),vg=Symbol("is html");function gg(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function Re(t,e,i,o){var r=_g(t);if(Ge&&(r[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName==="LINK")){o||M0(t,e,i??"");return}r[e]!==(r[e]=i)&&(e==="loading"&&(t[rv]=i),i==null?t.removeAttribute(e):typeof i!="string"&&bg(t).includes(e)?t[e]=i:t.setAttribute(e,i))}function hg(t,e,i,o,r=!1){var s=_g(t),a=s[mg],l=!s[vg];let d=Ge&&a;d&&Di(!1);var f=e||{},p=t.tagName==="OPTION";for(var g in e)g in i||(i[g]=null);i.class?i.class=El(i.class):(o||i[Fa])&&(i.class=null),i[Ua]&&(i.style??=null);var u=bg(t);for(let A in i){let I=i[A];if(p&&A==="value"&&I==null){t.value=t.__value="",f[A]=I;continue}if(A==="class"){var y=t.namespaceURI==="http://www.w3.org/1999/xhtml";J(t,y,I,o,e?.[Fa],i[Fa]),f[A]=I,f[Fa]=i[Fa];continue}if(A==="style"){ot(t,I,e?.[Ua],i[Ua]),f[A]=I,f[Ua]=i[Ua];continue}var x=f[A];if(!(I===x&&!(I===void 0&&t.hasAttribute(A)))){f[A]=I;var w=A[0]+A[1];if(w!=="$$")if(w==="on"){let O={},G="$$"+A,D=A.slice(2);var S=Gv(D);if(Qv(D)&&(D=D.slice(0,-7),O.capture=!0),!S&&x){if(I!=null)continue;t.removeEventListener(D,f[G],O),f[G]=null}if(I!=null)if(S)t[`__${D}`]=I,lt([D]);else{let ee=function(X){f[A].call(this,X)};var L=ee;f[G]=np(D,t,ee,O)}else S&&(t[`__${D}`]=void 0)}else if(A==="style")Re(t,A,I);else if(A==="autofocus")ip(t,!!I);else if(!a&&(A==="__value"||A==="value"&&I!=null))t.value=t.__value=I;else if(A==="selected"&&p)gg(t,I);else{var T=A;l||(T=jv(T));var k=T==="defaultValue"||T==="defaultChecked";if(I==null&&!a&&!k)if(s[A]=null,T==="value"||T==="checked"){let O=t,G=e===void 0;if(T==="value"){let D=O.defaultValue;O.removeAttribute(T),O.defaultValue=D,O.value=O.__value=G?D:null}else{let D=O.defaultChecked;O.removeAttribute(T),O.defaultChecked=D,O.checked=G?D:!1}}else t.removeAttribute(A);else k||u.includes(T)&&(a||typeof I!="string")?t[T]=I:typeof I!="function"&&Re(t,T,I,r)}}}return d&&Di(!0),f}function Te(t,e,i=[],o,r=!1,s=Cr){let a=i.map(s);var l=void 0,d={},f=t.nodeName==="SELECT",p=!1;if($i(()=>{var u=e(...a.map(n)),y=hg(t,l,u,o,r);p&&f&&"value"in u&&Pl(t,u.value,!1);for(let w of Object.getOwnPropertySymbols(d))u[w]||_i(d[w]);for(let w of Object.getOwnPropertySymbols(u)){var x=u[w];w.description===Au&&(!l||x!==l[w])&&(d[w]&&_i(d[w]),d[w]=ci(()=>ds(t,()=>x))),y[w]=x}l=y}),f){var g=t;oo(()=>{Pl(g,l.value),mp(g)})}p=!0}function _g(t){return t.__attributes??={[mg]:t.nodeName.includes("-"),[vg]:t.namespaceURI===ev}}var pg=new Map;function bg(t){var e=pg.get(t.nodeName);if(e)return e;pg.set(t.nodeName,e=[]);for(var i,o=t,r=Element.prototype;r!==o;){i=jd(o);for(var s in i)i[s].set&&e.push(s);o=Os(o)}return e}function M0(t,e,i){ke&&(e==="srcset"&&L0(t,i)||vp(t.getAttribute(e)??"",i)||Sv(e,t.outerHTML.replace(t.innerHTML,t.innerHTML&&"..."),String(i)))}function vp(t,e){return t===e?!0:new URL(t,document.baseURI).href===new URL(e,document.baseURI).href}function fg(t){return t.split(",").map(e=>e.trim().split(" ").filter(Boolean))}function L0(t,e){var i=fg(t.srcset),o=fg(e);return o.length===i.length&&o.every(([r,s],a)=>s===i[a][1]&&(vp(i[a][0],r)||vp(r,i[a][0])))}var V0=Gd?()=>performance.now():()=>Date.now(),Er={tick:t=>(Gd?requestAnimationFrame:ne)(t),now:()=>V0(),tasks:new Set};function $g(){let t=Er.now();Er.tasks.forEach(e=>{e.c(t)||(Er.tasks.delete(e),e.f())}),Er.tasks.size!==0&&Er.tick($g)}function yg(t){let e;return Er.tasks.size===0&&Er.tick($g),{promise:new Promise(i=>{Er.tasks.add(e={c:t,f:i})}),abort(){Er.tasks.delete(e)}}}function _c(t,e){Cl(()=>{t.dispatchEvent(new CustomEvent(e))})}function O0(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 xg(t){let e={},i=t.split(";");for(let o of i){let[r,s]=o.split(":");if(!r||s===void 0)break;let a=O0(r.trim());e[a]=s.trim()}return e}var D0=t=>t;function hp(t,e,i,o){var r=(t&1)!==0,s=(t&2)!==0,a=r&&s,l=(t&4)!==0,d=a?"both":r?"in":"out",f,p=e.inert,g=e.style.overflow,u,y;function x(){var L=xt,A=pt;hi(null),Oi(null);try{return f??=i()(e,o?.()??{},{direction:d})}finally{hi(L),Oi(A)}}var w={is_global:l,in(){if(e.inert=p,!r){y?.abort(),y?.reset?.();return}s||u?.abort(),_c(e,"introstart"),u=gp(e,x(),y,1,()=>{_c(e,"introend"),u?.abort(),u=f=void 0,e.style.overflow=g})},out(L){if(!s){L?.(),f=void 0;return}e.inert=!0,_c(e,"outrostart"),y=gp(e,x(),u,0,()=>{_c(e,"outroend"),L?.()})},stop:()=>{u?.abort(),y?.abort()}},S=pt;if((S.transitions??=[]).push(w),r&&Tl){var T=l;if(!T){for(var k=S.parent;k&&(k.f&65536)!==0;)for(;(k=k.parent)&&(k.f&16)===0;);T=!k||(k.f&32768)!==0}T&&oo(()=>{_t(()=>w.in())})}}function gp(t,e,i,o,r){var s=o===1;if(ys(e)){var a,l=!1;return jo(()=>{if(!l){var S=e({direction:s?"in":"out"});a=gp(t,S,i,o,r)}}),{abort:()=>{l=!0,a?.abort()},deactivate:()=>a.deactivate(),reset:()=>a.reset(),t:()=>a.t()}}if(i?.deactivate(),!e?.duration)return r(),{abort:ne,deactivate:ne,reset:ne,t:()=>o};let{delay:d=0,css:f,tick:p,easing:g=D0}=e;var u=[];if(s&&i===void 0&&(p&&p(0,1),f)){var y=xg(f(0,1));u.push(y,y)}var x=()=>1-o,w=t.animate(u,{duration:d,fill:"forwards"});return w.onfinish=()=>{w.cancel();var S=i?.t()??1-o;i?.abort();var T=o-S,k=e.duration*Math.abs(T),L=[];if(k>0){var A=!1;if(f)for(var I=Math.ceil(k/16.666666666666668),O=0;O<=I;O+=1){var G=S+T*g(O/I),D=xg(f(G,1-G));L.push(D),A||=D.overflow==="hidden"}A&&(t.style.overflow="hidden"),x=()=>{var ee=w.currentTime;return S+T*g(ee/k)},p&&yg(()=>{if(w.playState!=="running")return!1;var ee=x();return p(ee,1-ee),!0})}w=t.animate(L,{duration:k,fill:"forwards"}),w.onfinish=()=>{x=()=>o,p?.(o,1-o),r()}},{abort:()=>{w&&(w.cancel(),w.effect=null,w.onfinish=ne)},deactivate:()=>{r=ne},reset:()=>{o===0&&p?.(1,0)},t:()=>x()}}var _p=class t{#t=new WeakMap;#e;#i;static entries=new WeakMap;constructor(e){this.#i=e}observe(e,i){var o=this.#t.get(e)||new Set;return o.add(i),this.#t.set(e,o),this.#o().observe(e,this.#i),()=>{var r=this.#t.get(e);r.delete(i),r.size===0&&(this.#t.delete(e),this.#e.unobserve(e))}}#o(){return this.#e??(this.#e=new ResizeObserver(e=>{for(var i of e){t.entries.set(i.target,i);for(var o of this.#t.get(i.target)||[])o(i)}}))}};var H0=new _p({box:"border-box"});function qn(t,e,i){var o=H0.observe(t,()=>i(t[e]));oo(()=>(_t(()=>i(t[e])),o))}function wg(t,e){return t===e||t?.[uo]===e}function tt(t={},e,i,o){return oo(()=>{var r,s;return vo(()=>{r=s,s=o?.()||[],_t(()=>{t!==i(...s)&&(e(t,...s),r&&wg(i(...r),t)&&e(null,...r))})}),()=>{jo(()=>{s&&wg(i(...s),t)&&e(null,...s)})}}),t}function Pr(t=!1){let e=Lt,i=e.l.u;if(!i)return;let o=()=>mc(e.s);if(t){let r=0,s={},a=Cr(()=>{let l=!1,d=e.s;for(let f in d)d[f]!==s[f]&&(s[f]=d[f],l=!0);return l&&r++,r});o=()=>n(a)}i.b.length&&bl(()=>{Sg(e,o),xs(i.b)}),De(()=>{let r=_t(()=>i.m.map(nv));return()=>{for(let s of r)typeof s=="function"&&s()}}),i.a.length&&De(()=>{Sg(e,o),xs(i.a)})}function Sg(t,e){if(t.l.s)for(let i of t.l.s)n(i);e()}function Al(t,e,i){if(t==null)return e(void 0),i&&i(void 0),ne;let o=_t(()=>t.subscribe(e,i));return o.unsubscribe?()=>o.unsubscribe():o}var za=[];function dr(t,e){return{subscribe:ie(t,e).subscribe}}function ie(t,e=ne){let i=null,o=new Set;function r(l){if(Ca(t,l)&&(t=l,i)){let d=!za.length;for(let f of o)f[1](),za.push(f,t);if(d){for(let f=0;f<za.length;f+=2)za[f][0](za[f+1]);za.length=0}}}function s(l){r(l(t))}function a(l,d=ne){let f=[l,d];return o.add(f),o.size===1&&(i=e(r,s)||ne),l(t),()=>{o.delete(f),o.size===0&&i&&(i(),i=null)}}return{set:r,update:s,subscribe:a}}function Jt(t,e,i){let o=!Array.isArray(t),r=o?[t]:t;if(!r.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");let s=e.length<2;return dr(i,(a,l)=>{let d=!1,f=[],p=0,g=ne,u=()=>{if(p)return;g();let x=e(o?f[0]:f,a,l);s?a(x):g=typeof x=="function"?x:ne},y=r.map((x,w)=>Al(x,S=>{f[w]=S,p&=~(1<<w),d&&u()},()=>{p|=1<<w}));return d=!0,u(),function(){xs(y),g(),d=!1}})}function ve(t){let e;return Al(t,i=>e=i)(),e}var $c=!1,bp=Symbol();function $(t,e,i){let o=i[e]??={store:null,source:Qr(void 0),unsubscribe:ne};if(o.store!==t&&!(bp in i))if(o.unsubscribe(),o.store=t??null,t==null)o.source.v=void 0,o.unsubscribe=ne;else{var r=!0;o.unsubscribe=Al(t,s=>{r?o.source.v=s:V(o.source,s)}),r=!1}return t&&bp in i?ve(t):n(o.source)}function Ve(){let t={};function e(){po(()=>{for(var i in t)t[i].unsubscribe();Bi(t,bp,{enumerable:!1,value:!0})})}return[t,e]}function $p(t){var e=$c;try{return $c=!1,[t(),$c]}finally{$c=e}}var Q0={get(t,e){if(!t.exclude.includes(e))return t.props[e]},set(t,e){return ke&&vv(`${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 Ae(t,e,i){return new Proxy(ke?{props:t,exclude:e,name:i,other:{},to_proxy:[]}:{props:t,exclude:e},Q0)}var G0={get(t,e){let i=t.props.length;for(;i--;){let o=t.props[i];if(ys(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 r=t.props[o];ys(r)&&(r=r());let s=Eo(r,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(ys(o)&&(o=o()),typeof o=="object"&&o!==null&&e in o){let r=Eo(o,e);return r&&!r.configurable&&(r.configurable=!0),r}}},has(t,e){if(e===uo||e===wa)return!1;for(let i of t.props)if(ys(i)&&(i=i()),i!=null&&e in i)return!0;return!1},ownKeys(t){let e=[];for(let i of t.props)if(ys(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 cs(...t){return new Proxy({props:t},G0)}function Cg(t){return t.ctx?.d??!1}function m(t,e,i,o){var r=(i&1)!==0,s=!Wr||(i&2)!==0,a=(i&8)!==0,l=(i&16)!==0,d=!1,f;a?[f,d]=$p(()=>t[e]):f=t[e];var p=uo in t||wa in t,g=a&&(Eo(t,e)?.set??(p&&e in t&&(G=>t[e]=G)))||void 0,u=o,y=!0,x=!1,w=()=>(x=!0,y&&(y=!1,l?u=_t(o):u=o),u);f===void 0&&o!==void 0&&(g&&s&&mv(e),f=w(),g&&g(f));var S;if(s)S=()=>{var G=t[e];return G===void 0?w():(y=!0,x=!1,G)};else{var T=(r?Cr:Tr)(()=>t[e]);T.f|=131072,S=()=>{var G=n(T);return G!==void 0&&(u=void 0),G===void 0?u:G}}if((i&4)===0&&s)return S;if(g){var k=t.$$legacy;return function(G,D){return arguments.length>0?((!s||!D||k||d)&&g(D?S():G),G):S()}}var L=!1,A=!1,I=Qr(f),O=Cr(()=>{var G=S(),D=n(I);return L?(L=!1,A=!0,D):(A=!1,I.v=G)});return a&&n(O),r||(O.equals=Ta),function(G,D){if(pc!==null&&(L=A,S(),n(I)),arguments.length>0){let ee=D?n(O):s&&a?qt(G):G;if(!O.equals(ee)){if(L=!0,V(I,ee),x&&u!==void 0&&(u=ee),Cg(O))return G;_t(()=>n(O))}return G}return Cg(O)?O.v:n(O)}}var j0;typeof HTMLElement=="function"&&(j0=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;constructor(t,e,i){super(),this.$$ctor=t,this.$$s=e,i&&this.attachShadow({mode:"open"})}addEventListener(t,e,i){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(e),this.$$c){let o=this.$$c.$on(t,e);this.$$l_u.set(e,o)}super.addEventListener(t,e,i)}removeEventListener(t,e,i){if(super.removeEventListener(t,e,i),this.$$c){let o=this.$$l_u.get(e);o&&(o(),this.$$l_u.delete(e))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(r){return s=>{let a=document.createElement("slot");r!=="default"&&(a.name=r),b(s,a)}};var t=e;if(await Promise.resolve(),!this.$$cn||this.$$c)return;let i={},o=Y0(this);for(let r of this.$$s)r in o&&(r==="default"&&!this.$$d.children?(this.$$d.children=e(r),i.default=!0):i[r]=e(r));for(let r of this.attributes){let s=this.$$g_p(r.name);s in this.$$d||(this.$$d[s]=yp(s,r.value,this.$$p_d,"toProp"))}for(let r in this.$$p_d)!(r in this.$$d)&&this[r]!==void 0&&(this.$$d[r]=this[r],delete this[r]);this.$$c=ng({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:i,$$host:this}}),this.$$me=lc(()=>{vo(()=>{this.$$r=!0;for(let r of Mu(this.$$c)){if(!this.$$p_d[r]?.reflect)continue;this.$$d[r]=this.$$c[r];let s=yp(r,this.$$d[r],this.$$p_d,"toAttribute");s==null?this.removeAttribute(this.$$p_d[r].attribute||r):this.setAttribute(this.$$p_d[r].attribute||r,s)}this.$$r=!1})});for(let r in this.$$l)for(let s of this.$$l[r]){let a=this.$$c.$on(r,s);this.$$l_u.set(s,a)}this.$$l={}}}attributeChangedCallback(t,e,i){this.$$r||(t=this.$$g_p(t),this.$$d[t]=yp(t,i,this.$$p_d,"toProp"),this.$$c?.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(t){return Mu(this.$$p_d).find(e=>this.$$p_d[e].attribute===t||!this.$$p_d[e].attribute&&e.toLowerCase()===t)||t}});function yp(t,e,i,o){let r=i[t]?.type;if(e=r==="Boolean"&&typeof e!="boolean"?e!=null:e,!o||!i[t])return e;if(o==="toAttribute")switch(r){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e??null;default:return e}else switch(r){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}function Y0(t){let e={};return t.childNodes.forEach(i=>{e[i.slot||"default"]=!0}),e}var Tg="5";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add(Tg);import{areValidLiveRecordSources as Hx,clientChecker as Hm}from"@vkontakte/videoplayer-core";import"@vkontakte/videoplayer-core";import{noop as I1,safeStorage as Fx,throttleFn as Ux}from"@vkontakte/videoplayer-shared";import{SeekAction as zx}from"@vkontakte/videoplayer-statistics";import{InterfaceLanguage as Z0,fillWithDefault as X0,VideoQuality as kg}from"@vkontakte/videoplayer-shared";var J0={isMobile:void 0,disableInvisibleComponentsTimeout:500,debugLog:!1,devNullLog:!1,defaultLanguage:Z0.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:kg.Q_480P,highQualityLimit:kg.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"},Ig=t=>X0(t,J0),Eg=t=>Ea("ui-config",t),Tt=()=>Ia("ui-config");var Ml="vk_player_debug_panel_opened";var Pg="videoplayer",Ag="videoplayer";var Yr={KeyF:"f",KeyK:"k",KeyC:"c",KeyM:"m"},Mg=new Set(["ArrowLeft","ArrowRight","KeyL","KeyJ"]),Lg=new Set(["Tab","Space","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"]),Vg=new Set(["ShiftRight","ShiftLeft"]);var Rg=["TIMELINE"],Ll=[...Rg,"GRAPH_BUTTON"],xp=[...Rg,"PLAY_BUTTON"],Vl=[...Ll,"PLAY_BUTTON"];var Zr=(s=>(s.XS="xs",s.S="s",s.M="m",s.L="l",s.XL="xl",s))(Zr||{}),Js={xs:0,s:1,m:2,l:3,xl:4};import{assertNonNullable as Ng,VERSION as e_}from"@vkontakte/videoplayer-shared";import{VERSION as t_}from"@vkontakte/videoplayer-core";import{VERSION as i_}from"@vkontakte/videoplayer-statistics";var yc="prod",Wa="1.1.72";var ea=(t,e,i)=>{let o=document.createElement("a");o.href=t,o.download=`${e}.${i}`,o.style.display="none",o.click()};var Bg=Symbol("storeContext"),Og=Symbol("microStoresContext"),Dg=(t,e)=>{Ea(Bg,t),Ea(Og,e),yc==="dev"&&(window.app={store:t,microStores:e})},Se=()=>{let t=Ia(Bg);return Ng(t,"Store context is empty!"),t},Qi=()=>{let t=Ia(Og);return Ng(t,"MicroStores context is empty!"),t},Kt=(t,e)=>wc(t,t.getValue(),e),wc=(t,e,i)=>dr(e,o=>{let r=t.subscribe(s=>{o(s),i?.(s)});return()=>r.unsubscribe()}),Hg=(t,e,i,o)=>{let r=t.info,{width:s,height:a}=ve(i.ui.playerSize),l=r.throughputEstimation$.getValue()?.toFixed(0)??0,d=r.rttEstimation$.getValue()?.toFixed(0)??0,f=r.isAutoQualityEnabled$.getValue()?"auto":"manual",p=`${Wa} (core: ${t_}, stat: ${i_}, shared: ${e_})`,g=ve(i.state.errorLog$),u=g.length?`
45
45
  `+g.map((O,G)=>{let D=`${G}) Type: ${O.id}
46
46
  `,ee=`Message: ${O.message} (${O.thrown})
47
47
  `,X=`Trace: ${O.thrown?.stack}
@@ -386,4 +386,4 @@ Try switching the\xA0quality to\xA0Auto.`},ch=c_;var us=new Map;us.set(ph.EN,ch)
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 Fm(t,e){F(e,!0),W(t,Kx);let[i,o]=Ve(),r=()=>$(zt,"$isLive$",i),s=()=>$(ho,"$availableSubtitlesList$",i),a=m(e,"sources",7),l=m(e,"store",7),d=m(e,"microStoresRoot",7),f=m(e,"videoConfig",7),p=m(e,"uiConfig",7),g=m(e,"title",7),u=m(e,"thumbUrl",7),y=m(e,"interactiveContainer",7),x=m(e,"interactiveController",7),w=m(e,"subtitles",7),S=m(e,"live",7),T=m(e,"preload",7),k=m(e,"autoplay",7),L=m(e,"volume",7,void 0),A=m(e,"muted",7,void 0),I=m(e,"fromTime",7),O=m(e,"canRewindLive",7),G=m(e,"showAds",7),D=m(e,"adsSlotId",7,void 0),ee=m(e,"adsParams",7,void 0),X=m(e,"adsPreviewParam",7,void 0),ae=m(e,"adsAutoplayParam",7,void 0),j=m(e,"duration",7,void 0),ue=m(e,"logoClickable",7),Y=m(e,"logoHidden",7),he=m(e,"isMobile",7),_e=m(e,"showNextPrevButtons",7,!1),Ie=m(e,"nextButtonActive",7,!1),Fe=m(e,"prevButtonActive",7,!1),se=m(e,"endScreenVideoTitle",7,void 0),Ne=m(e,"endScreenVideoThumb",7,void 0),oe=m(e,"isOneVideoPlaylist",7,!1),R=m(e,"supportLink",7),Ee=m(e,"shadowRootContainer",7),Ce=m(e,"outerContainerRef",7),de=m(e,"fullScreenTarget",7,void 0),te=m(e,"failoverHosts",7,void 0),be=m(e,"showMiniTimer",7,!1),Oe=m(e,"saveRate",7),le=m(e,"seekToInteractive",7,I1),at=m(e,"playPrevChapter",7,I1),K=m(e,"volumeMultiplier",7),Me=m(e,"showAutoplayNext",7),Ue=m(e,"showEndScreen",7,!0),Ye=m(e,"keyboardControls",15,void 0),{subscribers:dt,stores:$t}=d();Eg(p());let mt=Tt(),gt=p().logoLink,qe=l().ui.debugPanelVisible,Bt=l().ui.playerSize,zt=l().state.isLive$,Rt=l().state.isInteractive&&Hm.device.isAndroid,$e=Q(void 0),Ot=null,ye=Q(!1);l().getAdmanWrapper().init({switchFromAdsToVideo:l().actions.internal.switchFromAdsToVideo,switchFromVideoToAds:l().actions.internal.switchFromVideoToAds,setMuted:l().actions.external.setMuted},l().ads,{vsid:l().vsid}),Dg(l(),$t),De(()=>{l().ui.isMobile.set(he()),f().callbacks?.onDomReady?.()});let pe=(H=!1)=>{V(ye,!0),H?l().actions.external.firstStart(G()):l().actions.internal.firstStart(G())},Z=()=>{if(mt.features.qualityDetailsSubMenuEnabled){let H=sh(l().videoId);if(H)switch(H.type){case"high_quality":l().actions.internal.setHighQualityEnabled(!0,H.appliesTo);break;case"traffic_saving":l().actions.internal.setTrafficSavingEnabled(!0,H.appliesTo);break;case"exact_quality":l().actions.internal.setQuality(H.quality);break}}else{ah(l().videoId),Vp()&&l().actions.internal.setTrafficSavingEnabled(!0);let Qe=Pp(l().videoId);Qe&&l().actions.internal.setQuality(Qe)}};function Pe(H){let Qe=a()||H;Qe&&l().initVideo({container:n($e),sources:Qe,failoverHosts:te(),subtitles:w(),volumeMultiplier:K()});let ct=Fx.get(Ml)==="true";qe.set(ct),I()>0&&l().actions.external.seekTime(I());let jt=he()?mt.volumeDefault:L()??Sc()??mt.volumeDefault,At=A()??eh();if(l().actions.external.setVolume(jt),l().actions.external.setMuted(At),l().getAdmanWrapper().setInitialVolume(At?0:jt),Z(),mt.features.saveRate&&Oe()){let Gt=oh();Gt&&!r()&&l().actions.internal.setPlaybackRate(Gt)}if(Me()){let Gt=rh();Gt&&l().actions.internal.setAutoplayNextEnabled(Gt)}l().ui.isAutoplay.set(k()),k()&&pe(),T()&&mt.features.preload&&l().actions.internal.preload()}let je=H=>{if(window.ResizeObserver){let Qe,ct;Ot=new ResizeObserver(Ux(jt=>{let At=jt[0];if(At.contentBoxSize){let Gt=Array.isArray(At.contentBoxSize)?At.contentBoxSize[0]:At.contentBoxSize;Qe=Gt.inlineSize,ct=Gt.blockSize}else At.contentRect&&(Qe=At.contentRect.width,ct=At.contentRect.height);Bt.set({width:Qe,height:ct})},300)),Ot.observe(H)}Bt.set({width:H.clientWidth,height:H.clientHeight})},Xe=()=>{document.hidden&&l().actions.external.stop()};Et(()=>{Rt&&document.addEventListener("visibilitychange",Xe),mt.debugLog&&l().actions.internal.startLogging(),je(n($e));let H=dt.map(ct=>ct.init({store:l(),microStores:$t,config:f(),interactiveController:x(),uiConfig:p()})),Qe=()=>{Rt&&document.removeEventListener("visibilitychange",Xe),Ot?.disconnect(),H.forEach(ct=>ct.unsubscribe()),l().destroy()};return S()?.status==="upcoming"?(l().actions.internal.setLiveWaitingStart(!0),Qe):S()?.status==="waiting"?(l().actions.internal.setLiveWaitingRecover(!0),Qe):(S()?.status==="finished"||S()?.status==="postlive")&&!(a()&&Hx(a()))?(l().actions.internal.setLiveWaitingRecord(!0),Qe):(Pe(),Qe)});function He(){n(ye)?l().actions.external.play():pe(!0)}function Le(){l().actions.external.pause()}function it(H){l().actions.external.setMuted(H)}function nt(){l().actions.external.toggleSubtitle()}function et(H,Qe){l().actions.external.changeSubtitle(H,Qe)}function kt(){l().webApi.slotsApi?.haveSlots()&&l().actions.external.hideControls()}function yi(){l().webApi.slotsApi?.haveSlots()&&l().actions.external.showControls()}function Hi(H){he()||H>=0&&H<=1&&l().actions.external.setVolume(H)}function Ei(H){l().actions.internal.seekTime(H,zx.UNKNOWN)}function Xo(H){l().actions.external.seekEpisodeStartTime(H)}function go(){l().actions.external.returnFocusToEpisodes()}function Jo(H){l().actions.external.setPlaybackRate(H)}function en(H){l().actions.external.setAutoQualityLimits(H)}function Ro(){l().actions.external.setQuality("auto")}function Dt(H){l().actions.external.setTrafficSavingEnabled(H)}function Gi(H){l().actions.external.setHighQualityEnabled(H)}let Sn=fu(mt.view),tn=f().playerView==="preview",ho=l().state.availableSubtitlesList$;if(mt.features.initSubtitles){let H=!1;De(()=>{if(!H&&s().length){H=!0;let Qe;if(mt.features.userVideoPrefs&&l().videoId){let jt=Ic(mt.userSalt,String(l().videoId));jt?.subtitleTrackId&&(Qe=s().find(At=>At.value===jt.subtitleTrackId))}let ct=Np();ct&&(Qe??(Qe=s().find(jt=>jt.language===ct))),l().actions.internal.setSubtitle(Qe)}})}var ji=Wx();let on;var _o=_(ji);{var xi=H=>{Om(H,{get store(){return l()},get uiConfig(){return mt},get thumbUrl(){return u()},get interactiveContainer(){return y()},get live(){return S()},get autoplay(){return k()},get canRewindLive(){return O()},get showAds(){return G()},get adsSlotId(){return D()},get adsParams(){return ee()},get adsPreviewParam(){return X()},get adsAutoplayParam(){return ae()},get duration(){return j()},get logoClickable(){return ue()},get logoHidden(){return Y()},get logoTargetUrl(){return gt},get nextButtonActive(){return Ie()},get prevButtonActive(){return Fe()},get endScreenVideoTitle(){return se()},get endScreenVideoThumb(){return Ne()},get isOneVideoPlaylist(){return oe()},get supportLink(){return R()},get shadowRootContainer(){return Ee()},get outerContainerRef(){return Ce()},get fullScreenTarget(){return de()},get showMiniTimer(){return be()},get playerStarted(){return n(ye)},get seekToInteractive(){return le()},get playPrevChapter(){return at()},firstStart:pe,seekTime:Ei,get showEndScreen(){return Ue()},get showAutoplayNext(){return Me()},get showNextPrevButtons(){return _e()},get videoContainer(){return n($e)},set videoContainer(Qe){V($e,Qe,!0)}})},bo=H=>{var Qe=Be(),ct=ce(Qe);{var jt=Gt=>{Dm(Gt,{get thumbUrl(){return u()},get outsideDuration(){return j()},get canRewindLive(){return O()},get videoContainer(){return n($e)},set videoContainer(pi){V($e,pi,!0)}})},At=Gt=>{Nm(Gt,{get store(){return l()},get uiConfig(){return mt},get title(){return g()},get thumbUrl(){return u()},get interactiveContainer(){return y()},get live(){return S()},get autoplay(){return k()},get canRewindLive(){return O()},get showAds(){return G()},get adsSlotId(){return D()},get adsParams(){return ee()},get adsPreviewParam(){return X()},get adsAutoplayParam(){return ae()},get duration(){return j()},get logoClickable(){return ue()},get logoHidden(){return Y()},get logoTargetUrl(){return gt},get nextButtonActive(){return Ie()},get prevButtonActive(){return Fe()},get endScreenVideoTitle(){return se()},get endScreenVideoThumb(){return Ne()},get isOneVideoPlaylist(){return oe()},get supportLink(){return R()},get shadowRootContainer(){return Ee()},get outerContainerRef(){return Ce()},get fullScreenTarget(){return de()},get showMiniTimer(){return be()},get playerStarted(){return n(ye)},get seekToInteractive(){return le()},get playPrevChapter(){return at()},firstStart:pe,get showEndScreen(){return Ue()},get showAutoplayNext(){return Me()},get showNextPrevButtons(){return _e()},get videoContainer(){return n($e)},set videoContainer(pi){V($e,pi,!0)},get keyboardControls(){return Ye()},set keyboardControls(pi){Ye(pi)}})};M(ct,Gt=>{tn?Gt(jt):Gt(At,!1)})}b(H,Qe)};M(_o,H=>{he()?H(xi):H(bo,!1)})}h(ji),N(H=>{on=J(ji,1,"root svelte-16kg8zb",null,on,H),ot(ji,Sn)},[()=>({"root--miui-browser":Hm.device.isMobile&&Hm.browser.isMiuiBrowser,"visible-outside":tn})]),b(t,ji);var Cn=U({initVideo:Pe,play:He,pause:Le,setMuted:it,toggleSubtitle:nt,changeSubtitle:et,hideControls:kt,showControls:yi,setVolume:Hi,seekTime:Ei,seekEpisodeStartTime:Xo,returnFocusToEpisodes:go,setPlaybackRate:Jo,setAutoQualityLimits:en,setAutoQuality:Ro,toggleTrafficSaving:Dt,toggleHighQuality:Gi,get sources(){return a()},set sources(H){a(H)},get store(){return l()},set store(H){l(H)},get microStoresRoot(){return d()},set microStoresRoot(H){d(H)},get videoConfig(){return f()},set videoConfig(H){f(H)},get uiConfig(){return p()},set uiConfig(H){p(H)},get title(){return g()},set title(H){g(H)},get thumbUrl(){return u()},set thumbUrl(H){u(H)},get interactiveContainer(){return y()},set interactiveContainer(H){y(H)},get interactiveController(){return x()},set interactiveController(H){x(H)},get subtitles(){return w()},set subtitles(H){w(H)},get live(){return S()},set live(H){S(H)},get preload(){return T()},set preload(H){T(H)},get autoplay(){return k()},set autoplay(H){k(H)},get volume(){return L()},set volume(H){L(H)},get muted(){return A()},set muted(H){A(H)},get fromTime(){return I()},set fromTime(H){I(H)},get canRewindLive(){return O()},set canRewindLive(H){O(H)},get showAds(){return G()},set showAds(H){G(H)},get adsSlotId(){return D()},set adsSlotId(H){D(H)},get adsParams(){return ee()},set adsParams(H){ee(H)},get adsPreviewParam(){return X()},set adsPreviewParam(H){X(H)},get adsAutoplayParam(){return ae()},set adsAutoplayParam(H){ae(H)},get duration(){return j()},set duration(H){j(H)},get logoClickable(){return ue()},set logoClickable(H){ue(H)},get logoHidden(){return Y()},set logoHidden(H){Y(H)},get isMobile(){return he()},set isMobile(H){he(H)},get showNextPrevButtons(){return _e()},set showNextPrevButtons(H){_e(H)},get nextButtonActive(){return Ie()},set nextButtonActive(H){Ie(H)},get prevButtonActive(){return Fe()},set prevButtonActive(H){Fe(H)},get endScreenVideoTitle(){return se()},set endScreenVideoTitle(H){se(H)},get endScreenVideoThumb(){return Ne()},set endScreenVideoThumb(H){Ne(H)},get isOneVideoPlaylist(){return oe()},set isOneVideoPlaylist(H){oe(H)},get supportLink(){return R()},set supportLink(H){R(H)},get shadowRootContainer(){return Ee()},set shadowRootContainer(H){Ee(H)},get outerContainerRef(){return Ce()},set outerContainerRef(H){Ce(H)},get fullScreenTarget(){return de()},set fullScreenTarget(H){de(H)},get failoverHosts(){return te()},set failoverHosts(H){te(H)},get showMiniTimer(){return be()},set showMiniTimer(H){be(H)},get saveRate(){return Oe()},set saveRate(H){Oe(H)},get showAutoplayNext(){return Me()},set showAutoplayNext(H){Me(H)},get seekToInteractive(){return le()},set seekToInteractive(H){le(H)},get playPrevChapter(){return at()},set playPrevChapter(H){at(H)},get volumeMultiplier(){return K()},set volumeMultiplier(H){K(H)},get showEndScreen(){return Ue()},set showEndScreen(H){Ue(H)},get keyboardControls(){return Ye()},set keyboardControls(H){Ye(H)}});return o(),Cn}var qx=we('<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 Um(t,e){let i=Ae(e,["$$slots","$$events","$$legacy","children"]);var o=qx();Te(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 r=_(o);me(r,()=>e.children??ne),xe(),h(o),b(t,o)}function zm(t,e){let i=m(e,"isWhite",3,!1),o=v(()=>i()?"color: #fff;":"color: #909499;");Um(t,{get style(){return n(o)}})}var Qx=P('<div class="title svelte-1y9fytq"> </div>'),Gx=P('<div class="playerStub svelte-1y9fytq"><!> <!></div>'),jx={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 Wm(t,e){W(t,jx);var i=Gx(),o=_(i);{var r=l=>{var d=Qx(),f=_(d,!0);h(d),N(()=>fe(f,e.title)),b(l,d)};M(o,l=>{e.title&&l(r)})}var s=E(o,2);{var a=l=>{let d=v(()=>!!e.thumbUrl);zm(l,{get isWhite(){return n(d)}})};M(s,l=>{(!e.title||!e.thumbUrl)&&l(a)})}h(i),N(()=>ot(i,e.thumbUrl?`background-image: url('${e.thumbUrl}')`:"")),b(t,i)}var Yx=P('<div class="playerError svelte-m5iv29"><!></div>'),Zx={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 Km(t){W(t,Zx);var e=Yx(),i=_(e);ha(i,{}),h(e),b(t,e)}import{now as b5,ValueSubject as $5}from"@vkontakte/videoplayer-shared";import{cloneDeepWith as y5,InterfaceLanguage as x5,isNonNullable as Zm,Logger as w5,Observable as S5,Subscription as N1,once as C5,InternalsExposure as T5,skip as k5,getPlayerId as I5}from"@vkontakte/videoplayer-shared";import{clientChecker as B1,isMobile as E5}from"@vkontakte/videoplayer-core";import{OneStat as P5,ThinOneStat as A5,MediascopePixel as M5}from"@vkontakte/videoplayer-statistics";import{Logger as Xx,Subscription as Jx}from"@vkontakte/videoplayer-shared";var mu=class{constructor(){this.subscription=new Jx,this.logger=new Xx,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){if(this.isSupported())for(let[i,o]of e)try{navigator.mediaSession.setActionHandler?.(i,o)}catch{throw new Error(`The media session action "${i}" is not supported yet.`)}}attachToStore(e){!this.isSupported()||!e||(this.clearSubscriptions(),this.subscription.add(e.state.positionExact$.subscribe(i=>{let o=ve(e.state.currentPlaybackRate$),r=ve(e.state.duration$);if(!(!isFinite(i)||!isFinite(r)))try{navigator.mediaSession.setPositionState?.({position:i,playbackRate:o,duration:r})}catch{this.log({message:`MediaSession setPositionState can't call with position: ${i} and duration: ${r}`})}})))}clearSubscriptions(){this.subscription.unsubscribe()}destroy(){this.resetActionHandlers(),this.clearSubscriptions()}};import{ValueSubject as Gm,detectEmbed as o5}from"@vkontakte/videoplayer-shared";var e5=we('<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 qm(t,e){let i=Ae(e,["$$slots","$$events","$$legacy","children"]);var o=e5();Te(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 r=_(o);me(r,()=>e.children??ne),xe(),h(o),b(t,o)}var t5=P('<div><div><!></div> <span class="title svelte-1pbsod4"> </span></div>'),i5={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 Qm(t,e){F(e,!0),W(t,i5);let[i,o]=Ve(),r=()=>$(f,"$interfaceLanguage$",i),s=()=>$(p,"$isMobile$",i),a=Se(),l=Tt(),d=!!a.webApi.pictureInPictureApi,f=a.interfaceLanguage$,p=a.ui.isMobile,g=a.ui.t,u=v(()=>r()&&g("pip_dummy_title")),y=fu(l.view);var x=t5();let w;var S=_(x);let T;var k=_(S);qm(k,{}),h(S);var L=E(S,2),A=_(L,!0);h(L),h(x),N((I,O)=>{w=J(x,1,"player-pip-dummy svelte-1pbsod4",null,w,I),ot(x,y),T=J(S,1,"dummy-image svelte-1pbsod4",null,T,O),fe(A,n(u))},[()=>({"is-pip-api":d}),()=>({desktop:!s()})]),b(t,x),U(),o()}var n5=460,r5=280,Td=class{playerDomElement;playerParentShadowRoot;playerDummyElement;svelteContext;pipWindow;info={isActive$:new Gm(!1),isEnabled$:new Gm(!1),type:1};constructor({enabled:e=!0}={enabled:!0}){this.info.isEnabled$=new Gm(e)}isSupported(){let{isEmbed:e}=o5();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(){if(!this.isSupported()||!this.playerDomElement||!this.playerParentShadowRoot)return;this.pipWindow=await documentPictureInPicture.requestWindow({width:n5,height:r5,copyStyleSheets:!0}),this.pipWindow.document.body.style.margin="0";let e=[...this.playerParentShadowRoot.styleSheets].map(a=>[...a.cssRules].map(l=>l.cssText).join(" ")).filter(Boolean).join(`
389
- `),i=document.createElement("style");i.textContent=e;let o=this.createStretchedContainer(),r=o.attachShadow({mode:"open"});r.append(i),r.append(this.playerDomElement);let s={target:this.playerParentShadowRoot,context:this.svelteContext};this.playerDummyElement=jr(Qm,s),this.pipWindow?.document.body.append(o),this.info.isActive$.next(!0),this.pipWindow?.addEventListener("unload",a=>{!this.playerDomElement||!this.playerParentShadowRoot||!this.playerDummyElement||(js(this.playerDummyElement),this.playerParentShadowRoot.append(this.playerDomElement),this.info.isActive$.next(!1),this.pipWindow=void 0)})}async exit(){return new Promise(e=>{this.pipWindow&&documentPictureInPicture.window?.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 E1(t){return t instanceof Td}var vu=class{static getLatestSupportedVersion(e){let i=new ia(e),o=new Td(e);if(o.isSupported())return o;if(i.isSupported())return i}};function kd(t,e){let i=new Set([...Object.keys(t),...Object.keys(e)]),o={};for(let r of i)o[r]=e[r]??t[r]??void 0;return o}var P1="Inner error. Unexpectedly root annotation container null reference exception",A1="Annotation with such name already exists",M1="Annotation with such name does not exist";var rl=class extends Error{constructor(e){super(e),this.name="AnnotationError"}};import{observeElementSize as s5,Subscription as a5,throttleFn as l5}from"@vkontakte/videoplayer-shared";var d5="1",c5=100,gu=class{constructor(e){this.annotationsInside=e;this.annotations=new Map;this.subscriptions=new a5}init(e){if(this.rootAnnotationsContainer=e,this.annotationsInside)return;let i=l5(()=>{for(let o of this.annotations.values())this.isElementExceedsBoundaries(o,this.playerSize.width,this.playerSize.height)?o.style.visibility="hidden":o.style.visibility="visible"},c5);this.subscriptions.add(s5(this.rootAnnotationsContainer).subscribe(({width:o,height:r})=>{this.playerSize={width:o,height:r},i()})),this.mutationObserver=new MutationObserver(i),this.mutationObserver.observe(this.rootAnnotationsContainer,{attributes:!0,childList:!0,subtree:!0,characterData:!0})}add(e,i){if(!this.rootAnnotationsContainer)throw new rl(P1);if(this.annotations.has(e))throw new rl(A1);i.style.zIndex=i.style.zIndex??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 rl(M1);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(){this.annotations.clear(),this.subscriptions.unsubscribe(),this.mutationObserver?.disconnect(),this.rootAnnotationsContainer=null}isElementExceedsBoundaries(e,i,o){let r=e.offsetTop,s=e.offsetLeft,a=e.offsetWidth,l=e.offsetHeight;return r<0||s<0||s+a>i||r+l>o}registryRootContainer(e){}addLayer(e){return document.createElement("div")}getLayer(e){}removeLayer(e){}clearLayer(e){}detach(){}reattach(){}};import{assertNonNullable as hu,Subscription as u5}from"@vkontakte/videoplayer-shared";var Vo=class{init({store:e,microStores:i,interactiveController:o,config:r}){return hu(e),hu(i),hu(r),r.interactiveData&&hu(o),this.subscription=new u5,this.subscription}};var Id=class extends Vo{constructor(){super(...arguments);this.stateName="fakeIsPlaying$";this.state$={...ie(null),toggle:()=>this.state$.update(i=>!i)}}init(i){let o=super.init(i),{isInteractiveExpectation$:r}=i.store.state;return o.add(r.subscribe(s=>{this.state$.set(s?!0:null)})),o}};var Ed=class extends Vo{constructor(){super(...arguments);this.stateName="interactiveControlsOpacity$";this.state$={...ie(null),toggle:()=>this.state$.update(i=>!i)}}init(i){let o=super.init(i),{microStores:r,store:s}=i,{fakeIsPlaying$:a}=r,{isInteractiveExpectation$:l,isPlaying$:d}=s.state,{controlsVisible:f,isMobile:p}=s.ui,g=ve(p),u=()=>g&&ve(f);return o.add(f.subscribe(y=>{if(!g)return;let x=ve(a);ve(d)?this.state$.set(y):x!==null&&this.state$.set(!x||y)})),o.add(d.subscribe(y=>{this.state$.set(!y||u())})),o.add(a.subscribe(y=>{if(y===null)return;let x=ve(l);if(u()){this.state$.set(!0);return}x&&this.state$.set(!y)})),o}};var Pd=class extends Vo{constructor(){super(...arguments);this.stateName="seekToInteractiveDisabledTooltip$";this.state$=ie("tooltip_chapter_without_interactive")}init(i){let o=super.init(i),{store:r}=i;return o.add(r.state.interactiveEpisodes$.subscribe(s=>{s.length&&(s.every(a=>a.completed)?this.state$.set("tooltip_interactive_of_chapter_completed"):this.state$.set("tooltip_disabled_when_interactive"))})),o}};import{combine as p5}from"@vkontakte/videoplayer-shared";var jm=ie(!1),_u=null,Ad=class extends Vo{constructor(){super(...arguments);this.stateName="showInteractiveTimeIndicatorTooltip$";this.state$={...jm,set:(i,o=!1)=>{i!==ve(jm)&&(this.clearTimeout(),jm.set(i),!i&&_u&&(_u=!1),i&&o&&(this.timeout=setTimeout(()=>{this.state$.set(!1)},3e3)))},clearTimeout:()=>this.clearTimeout()}}init(i){let o=super.init(i),{store:r,config:s}=i,{isInteractiveTime$:a,isPlaying$:l}=r.state,d=r.ui.controlsVisible,{interactiveTimeIndicator:f}=r.ui.controls;o.add(d.subscribe(g=>{ve(a)&&g&&this.state$.set(!1)}));let p=s?.interactiveData||{tooltipHelpHintActive:!1};return o.add(p5({isPlaying$:l,isInteractiveTime$:a,interactiveTimeIndicator:f}).subscribe(({isPlaying$:g,isInteractiveTime$:u,interactiveTimeIndicator:y})=>{if(!(!g||!y?.isDisplayed)){if(!u)return this.state$.set(!1);p.tooltipHelpHintActive&&_u===null&&(_u=!0,p.tooltipHelpHintActive=!1,this.state$.set(!0),r.callbacks?.onInteractiveTimeIndicatorHintDeactivated?.())}})),o}clearTimeout(){window.clearTimeout(this.timeout)}};import{combine as f5,noop as m5}from"@vkontakte/videoplayer-shared";var Md=class extends Vo{constructor(){super(...arguments);this.stateName="graphIsOpened$";this.graphMadePause=!1;this.state$={...ie(null),toggle:m5};this.checkIfShouldHide=i=>Ms(i,"s")}init(i){let o=super.init(i),{store:r,interactiveController:s}=i,a=r.ui.currentGridType$,l=r.getLogger().createComponentLog("GraphIsOpened microStore");return this.state$.toggle=async()=>{if(this.checkIfShouldHide(ve(a)))return;let d=ve(this.state$),{isEnded$:f,playbackState$:p}=r.state,{disabledControls$:g}=r.ui.controls,u=ve(f),y=ve(p);if(d)try{await s?.toggleGraphView(!1),this.state$.set(!1),g.remove(xp),!u&&this.graphMadePause&&r.actions.internal.play()}catch{l({message:"Cant hide graph"})}else{this.graphMadePause=y==="playing";try{await s?.toggleGraphView(!0),this.state$.set(!0),g.add(xp),!u&&this.graphMadePause&&r.actions.internal.pause()}catch{l({message:"Cant show graph"})}}},o.add(f5({graphIsOpened:this.state$,currentGridType:a}).subscribe(async({graphIsOpened:d,currentGridType:f})=>{if(this.checkIfShouldHide(f)&&d)try{await s?.toggleGraphView(!1),this.state$.set(!1)}catch{l({message:"Cant hide graph"})}})),o}};import{ValueSubject as L1}from"@vkontakte/videoplayer-shared";var Ld=class extends Vo{constructor(){super(...arguments);this.stateName="pictureInPicture$";this.state$={isActive$:ie(!1),isEnabled$:ie(!1),type$:ie(void 0)}}init(i){let o=super.init(i),{store:r}=i,{info:{isActive$:s,isEnabled$:a,type:l}}=r.webApi.pictureInPictureApi||{info:{isActive$:new L1(!1),isEnabled$:new L1(!1)}};return o.add(s.subscribe(d=>{this.state$.isActive$.set(d)})),o.add(a.subscribe(d=>{this.state$.isEnabled$.set(d)})),this.state$.type$.set(l),o}};import{filter as h5,filterChanged as _5}from"@vkontakte/videoplayer-shared";import{safeStorage as Ym}from"@vkontakte/videoplayer-shared";var V1=({maxShowCount:t,timeout:e})=>{let i=[t!==0?v5({maxCount:t}):void 0,e!==0?g5({timeout:e}):void 0].filter(o=>!!o);return{notificationShowed:o=>i.forEach(r=>r.notificationShowed(o)),canShowNotification:o=>i.every(r=>r.canShowNotification(o))}},v5=({maxCount:t})=>{let e={};return{notificationShowed:i=>{e[i]=(e[i]??0)+1,Ym.set("videoplayer_notifications_manager_count",JSON.stringify(e[i]??0))},canShowNotification:i=>(e[i]??0)<t}},g5=({timeout:t})=>{let e="videoplayer_notifications_manager",i=()=>{try{return JSON.parse(Ym.get(e)||"{}")}catch{return{}}},o=s=>Ym.set(e,JSON.stringify(s)),r=s=>{let a=i();delete a[s],o(a)};return{notificationShowed:s=>{o({...i(),[s]:{timeout:t,launchTime:Date.now()}})},canShowNotification:s=>{let a=i()[s];if(a){let l=Date.now()-a.launchTime>t;return l&&r(s),l}else return!0}}};var Vd=class extends Vo{constructor(){super(...arguments);this.stateName="notifications$";this.state$={notificationsToShow$:ie({}),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:r,uiConfig:{features:{maxCountShowSlowVideoNotification:s,timeoutShowSlowVideoNotification:a,showSlowVideoNotification:l,forceAutoQualityWhenSevereStallHappens:d}}}=i;this.notificationManager=V1({maxShowCount:s,timeout:a});let f=r.getPlayer();return o.add(f.events.severeStallOccured$.pipe(_5(),h5(p=>p)).subscribe(()=>{l&&!f.info.isAutoQualityEnabled$.getValue()&&this.notificationManager.canShowNotification("slow_video")&&(d&&r.actions.internal.setQuality("auto"),this.state$.showNotification("slow_video"))})),o}};var R1=()=>[Id,Ed,Pd,Ad,Md,Ld,Vd].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 Rd}from"@vkontakte/videoplayer-shared";var bu=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=()=>{this.lastFocusedNode?.focus()};this.init()}destroy(){this.shadowRoot.removeEventListener("focusin",this.handleFocusChange)}};var L5={preload:!0,autoplay:!1,repeat:!1,fromTime:0,canRewindLive:!0,showAds:!1,interfaceLanguage:x5.RU,isCyrillicRelatedInterface:!0,logoClickable:!1,logoHidden:!1,isTouch:E5(),isMediaSessionEnabled:!0,isPictureInPictureEnabled:!0,isAudioDisabled:!1,callbacks:{uiInfo:{}},tuningConfig:{configName:[]},saveRate:!0,volumeMultiplier:1,showEndScreen:!0,showAutoplayNext:!0,showNextPrevButtons:!0},wn=Q(void 0),$u=class extends HTMLElement{svelteStubComponent;svelteRootComponent;svelteErrorComponent;store;microStoresRoot;statistics;sentry;_shadowRoot;playerContainer;rootContainer;shadowRootContainer;playerId;uiConfig;coreConfig;statisticsConfig;interactiveController;interactiveContainer;graphMadePause;currentPlayingVideoIndex=0;needToRepeatPlaylist=!1;videoConfig=void 0;pictureInPictureApi=void 0;mediaSessionApi=void 0;unsubscribePlayerPhaseSubscription=void 0;logger;log;subscription;interactiveSubscription;annotationsApi=void 0;slotsApi;focusManager;prevIsid=void 0;isInited=!1;internalsExposure=null;shadowDOMCallbacksDisabled=!1;fatalError$=new $5(null);constructor(){super(),Rd.create("ui"),this.logger=new w5,this.log=this.logger.createComponentLog("VKVideoPlayer"),this.subscription=new N1,this.interactiveSubscription=new N1,this.graphMadePause=!1,this.fatalError$.subscribe(e=>{this.unmountComponent(this.svelteErrorComponent),e&&(this.unmountComponent(this.svelteStubComponent),this.unmountComponent(this.svelteRootComponent),this.svelteErrorComponent=jr(Km,{target:this.playerContainer}))})}connectedCallback(){if(this.rootContainer)return;this.initPlayerRootContainers();let e=this.getAttribute("stub-title")??void 0,i=this.getAttribute("stub-thumb-url")??void 0,o=qt({title:e,thumbUrl:i}),r={target:this.playerContainer,props:o};this.svelteStubComponent=jr(Wm,r)}disconnectedCallback(){this.shadowDOMCallbacksDisabled||(this.annotationsApi?.destroy(),this.slotsApi?.destroy(),this.focusManager?.destroy(),this.mediaSessionApi?.destroy(),this.unmountComponent(this.svelteRootComponent),this.unmountComponent(this.svelteStubComponent),this.unmountComponent(this.svelteErrorComponent),this.subscription.unsubscribe(),this.unsubscribePlayerPhaseSubscription?.(),this.interactiveController?.destroy(),this.interactiveSubscription.unsubscribe(),this.internalsExposure?.destroy(),Rd.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){return this.store?.ui.controls.disabledControls$?.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}}createOneStat=(e,i={})=>{if(!this.videoConfig)return;let{albumId:o,statPlace:r,statUserSalt:s,statTrackCode:a,statVKAppId:l,refreshStatAuthToken:d,autoplay:f,isMobile:p,isTouch:g,refDomain:u,deviceId:y,interactiveData:x}=kd(this.videoConfig,i),w=x?.projectInfo?.pid,S=this.interactiveController?.state.isReplay$.getValue()??!1;S&&(this.prevIsid=void 0);let{unitedVideoId:T,isClip:k=!1}=e;if(this.uiConfig.features.statistics&&T)try{return new P5({movieId:T,albumId:o,place:r,trackCode:a,vkAppId:l,autoplay:(f&&!this.interactiveController)??!1,mobile:g??p,clip:k,refDomain:u,deviceId:y,isPreviewPlayerView:this.videoConfig.playerView==="preview",...w&&(!this.isInited||S)&&{projectId:Number(w)}},{refreshAuthToken:d,userSalt:s,config:this.statisticsConfig,...this.interactiveController&&{useIsid:!0,isid:this.prevIsid}})}catch(A){console.error(A),this.log({message:A.message})}};createThinOneStat(e,i={}){if(!this.videoConfig)return;let{deviceId:o,preload:r,refreshStatAuthToken:s}=kd(this.videoConfig,i),{unitedVideoId:a}=e;if(this.uiConfig.features.thinStatistics&&a)return new A5.ThinOneStat({deviceId:o,movieId:a,preload:r,isPreviewPlayerView:this.videoConfig.playerView==="preview"},{config:this.statisticsConfig,refreshAuthToken:s})}createPlayer(e,i={},o){if(!this.videoConfig)return;let{albumId:r,statPlace:s,statAuthToken:a,preload:l,autoplay:d,volume:f,muted:p,fromTime:g,canRewindLive:u,supportLink:y,showAds:x,adsSlotId:w,adsParams:S={},adsPreviewParam:T,adsAutoplayParam:k,interfaceLanguage:L,isCyrillicRelatedInterface:A,logoClickable:I,logoHidden:O,isMobile:G,isTouch:D,isAudioDisabled:ee,isLiveCatchUpMode:X,fullScreenTarget:ae,failoverHosts:j,canDownload:ue,callbacks:Y,interactiveData:he,showThumbTimer:_e,additionalButtons:Ie=[],additionalSettingsMenuItems:Fe=[],additionalContextMenuItems:se=[],repeat:Ne,saveRate:oe,volumeMultiplier:R,showEndScreen:Ee,showAutoplayNext:Ce,mediascopePixels:de}=kd(this.videoConfig,i),{sources:te,title:be,thumbUrl:Oe,unitedVideoId:le,isClip:at=!1,duration:K,adsParams:Me={},videoEpisodes:Ue,previewThumbsData:Ye,subtitles:dt,live:$t}=e;if(!te&&!$t){let He=new Error("empty sources and live");this.fatalError$.next(He),Y.onCrashed?.(He.message);return}let mt={...S,...Me},gt=this.getNextVideoInfo(),qe={sources:te,title:be,thumbUrl:Oe,subtitles:dt,unitedVideoId:le,isClip:at,live:$t,albumId:r,statPlace:s,autoplay:d,muted:p,volume:f,fromTime:g,canRewindLive:u,showAds:x,adsSlotId:w,adsParams:mt,adsPreviewParam:T,adsAutoplayParam:k,duration:K,logoClickable:I,logoHidden:O,isTouch:D??G,repeat:Ne,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:gt.nextVideoTitle,endScreenVideoThumb:gt.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist()},Bt={pictureInPictureApi:this.pictureInPictureApi,annotationsApi:this.annotationsApi,slotsApi:this.slotsApi};this.log({message:`create player, props: ${JSON.stringify(qe)}`});let zt=this.interactiveController?.state.statistics$.getValue(),Ze=zt?.oneStat||this.createOneStat(e,i),Rt=this.createThinOneStat(e,i),$e;de&&($e=new M5({pixels:de})),(Ze||Rt)&&(this.statistics=new Zc(Ze,Rt,$e,zt?.statSubscription)),this.uiConfig.features.sentry&&this.uiConfig.sentry.dsn&&new ta(this.uiConfig.sentry,{version:Wa,env:yc},{movieId:le,albumId:r,place:s,autoplay:(d&&!this.interactiveController)??!1,mobile:D??G,clip:at}),this.interactiveController&&(this.prevIsid??=this.statistics?.oneStat?.isid$.getValue()),this.sentry={...this.sentry,...ta.getInstance()};let ye=!!he,pe=[],Z="tooltip_interactive_go_back_disabled_first";if(ye&&this.interactiveController){let He=this.interactiveController.state.isInitialChapter$.getValue(),Le=this.interactiveController.getHistoryState();He&&pe.push("REPLAY_BUTTON"),this.interactiveController.getIsSeekable().getValue()||pe.push("SEEK_TO_INTERACTIVE_BUTTON"),Le.hasPrevChapter$.getValue()||(pe.push("PLAY_PREV_CHAPTER_BUTTON"),He||(Le.isGoBackLimited$.getValue()?Z="tooltip_interactive_go_back_disabled_limit":Z="tooltip_interactive_go_back_disabled"))}let Pe=()=>{this.isInited=!1,this.prevIsid=void 0;let He=o?.info.isEnded$.getValue()&&this.interactiveController?.state.isEndChapter$.getValue();Y.onReplayInteractiveVideo&&!He?Y.onReplayInteractiveVideo():this.replayInteractiveVideo()};this.store=Yh({player:o,interfaceLanguage:L,isCyrillicRelatedInterface:A,videoId:le,isClip:at,isLiveCatchUpMode:X,isAudioDisabled:ee,statAuthToken:a,callbacks:Y,webApi:Bt,videoEpisodes:Ue,previewThumbsData:Ye,canDownload:ue,uiConfig:this.uiConfig,coreConfig:this.coreConfig,disabledControls:pe,isInteractive:ye,saveRate:oe,interactiveRanges$:this.interactiveController?.state.interactiveRanges$,isInteractiveTime$:this.interactiveController?.state.isInteractiveTime$,stopPlayer:()=>this.stop(),replayInteractive:Pe,playPrevChapterDisabledTooltip:Z,hasInteractiveBranches:!!this.interactiveController?.getChapterBranches()?.length,additionalButtons:this.uiConfig.features.additionalButtons?Ie:[],additionalSettingsMenuItems:Fe??[],additionalContextMenuItems:se??[],playPrevVideo:()=>this.playPrevVideo(),playNextVideo:()=>this.playNextVideo(),looped:Ne&&this.videoConfig.videos.length===1,statistics:this.statistics,internalsExposure:this.internalsExposure,playerView:this.videoConfig.playerView,playerId:this.playerId});let{stores:je}=this.microStoresRoot=R1(),Xe=()=>{if(!this.store||!this.microStoresRoot||!this.videoConfig)return;this.subscription.add(this.store.state.currentFormat$.subscribe(Le=>Y?.onCurrentFormatChanged?.(Le))),this.subscription.add(je.interactiveControlsOpacity$.subscribe(Le=>{Le!==null&&this?.interactiveController?.setDisabledControls(Le)})),this.subscription.add(this.store.state.throughputEstimation$.subscribe(Le=>Y?.onThroughputEstimationChanged?.(Le))),this.subscription.add(this.store.state.trafficSavingEnabled$.subscribe(Le=>Y?.onTrafficSavingEnabledChanged?.(Le))),this.subscription.add(this.store.state.highQualityEnabled$.subscribe(Le=>Y?.onHighQualityEnabledChanged?.(Le))),this.subscription.add(this.store.state.isAutoQualityEnabled$.subscribe(Le=>Y?.onAutoQualityEnabledChanged?.(!!Le))),this.subscription.add(new S5(Le=>{this.store&&this.subscription.add(this.store.state.currentPlaybackRate$.subscribe(it=>Le.next(it)))}).pipe(k5(1)).subscribe(Le=>Y?.onCurrentPlaybackRateChanged?.(Le))),this.subscription.add(this.store.state.volume$.subscribe(Le=>Y?.onVolumeChange?.(Le))),this.subscription.add(this.store.state.muted$.subscribe(Le=>{if(Le)Y?.onMute?.();else{let it=(this.store?.state.volume$&&ve(this.store.state.volume$))??0;Y?.onUnmute?.(it)}})),this.subscription.add(this.store.state.videoBitrate$.subscribe(Le=>Y?.onVideoBitrateChanged?.(Le))),this.subscription.add(this.store.state.isInteractiveTime$.subscribe(Le=>{let it=this.store?.ui.controls.disabledControls$;it&&(Le&&!it.includes(Ll)&&it.add(Ll),Le||it.remove(Ll))})),this.subscription.add(this.store.ui.isFullscreen.subscribe(async Le=>{if(!B1.browser.isSamsungBrowser||!Le||!this.interactiveController)return;document.fullscreenElement===this.shadowRootContainer&&await this.replayInteractiveChapter(this.videoConfig?.callbacks.onExternalFullscreenExit)})),this.statistics&&this.statistics.oneStat&&this.subscription.add(this.statistics.oneStat.vsid$.subscribe(Le=>Y?.onVSIDChanged?.(Le))),this.initMediaSession(),V(wn,{interactiveController:this.interactiveController,interactiveContainer:this.interactiveContainer,sources:te,store:this.store,microStoresRoot:this.microStoresRoot,videoConfig:this.videoConfig,uiConfig:this.uiConfig,title:be,thumbUrl:Oe,subtitles:dt,live:$t,preload:l,autoplay:d,muted:p,volume:f,fromTime:g,canRewindLive:u,supportLink:y,showAds:x,adsSlotId:w,adsParams:mt,adsPreviewParam:T,adsAutoplayParam:k,duration:K,logoClickable:I,logoHidden:O,isMobile:D??G,failoverHosts:j,fullScreenTarget:ae,saveRate:oe,shadowRootContainer:this.shadowRootContainer,showMiniTimer:_e,outerContainerRef:this.rootContainer,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:gt.nextVideoTitle,endScreenVideoThumb:gt.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist(),playPrevChapter:()=>this.playPrevChapter(),seekToInteractive:()=>this.seekToInteractive(),volumeMultiplier:R,showEndScreen:Ee,showAutoplayNext:Ce},!0);let He={target:this.playerContainer,props:n(wn)};this.svelteRootComponent=jr(Fm,He),this.addPlayerInfoSubscriptions(),this.isInited||(this.isInited=!0,this.videoConfig?.callbacks?.onInited?.()),this.internalsExposure?.expose({player:this,videoConfig:this.videoConfig,coreConfig:this.coreConfig,uiConfig:this.uiConfig,statisticsConfig:this.statisticsConfig,logger:this.logger,log:this.log}),this.uiConfig.devNullLog&&this.videoConfig?.callbacks?.onDevNullLog?Rd.subscribe("ui",this.videoConfig.callbacks.onDevNullLog):Rd.destroy("ui")};this.coreConfig.asyncResolveClientChecker?B1.isInited$.subscribe(He=>{He&&(console.log("UI SDK async start"),Xe())}):Xe()}addPlayerInfoSubscriptions(){let e=this.store,i=this.microStoresRoot?.stores;if(!e||!i)return;let o=this.videoConfig?.callbacks;o&&this.subscription.add(e.playerPhase.subscribe(s=>o.onPlayerPhaseChanged?.(s))).add(e.state.playbackState$.subscribe(s=>s&&o.onPlaybackStateChanged?.(s))).add(e.state.isLive$.subscribe(s=>o.onIsLiveChanged?.(s))).add(e.state.isActiveLive$.subscribe(s=>o.onIsActiveLiveChanged?.(s))).add(e.state.isAudioAvailable$.subscribe(s=>o.onIsAudioAvailableChanged?.(s))).add(e.state.currentQuality$.subscribe(s=>o.onCurrentQualityChanged?.(s))).add(e.state.availableQualities$.subscribe(s=>o.onAvailableQualitiesChanged?.(s.map(({value:a})=>a).filter(a=>a!=="auto")))).add(e.state.availableAudioStreams$.subscribe(s=>{s.length>1&&o.onAudioLanguagesAvailable&&o.onAudioLanguagesAvailable()})).add(i.pictureInPicture$.isActive$.subscribe(s=>s?o.onPiPEnter?.():o.onPiPExit?.()));let r=o?.uiInfo;r&&this.subscription.add(e.ui.controlsVisible.subscribe(s=>r.onControlsVisibleChanged?.(s))).add(e.ui.isMobile.subscribe(s=>r.onIsMobileChanged?.(s))).add(e.ui.playerSize.subscribe(s=>r.onPlayerSizeChanged?.(s))).add(e.ui.controls.prevButton.subscribe(s=>r.onPrevButtonChanged?.(s))).add(e.ui.controls.playButton.subscribe(s=>r.onPlayButtonChanged?.(s))).add(e.ui.controls.replayButton.subscribe(s=>r.onReplayButtonChanged?.(s))).add(e.ui.controls.nextButton.subscribe(s=>r.onNextButtonChanged?.(s))).add(e.ui.controls.playPrevChapterButton.subscribe(s=>r.onPlayPrevChapterChanged?.(s))).add(e.ui.controls.seekToInteractiveButton.subscribe(s=>r.onSeekToInteractiveButtonChanged?.(s))).add(e.ui.controls.interactiveGraphButton.subscribe(s=>r.onGraphButtonChanged?.(s))).add(e.ui.controls.liveButton.subscribe(s=>r.onLiveButtonChanged?.(s))).add(e.ui.controls.time.subscribe(s=>r.onTimeUpdateChanged?.(s))).add(e.ui.controls.episodes.subscribe(s=>r.onEpisodesChanged?.(s))).add(e.ui.controls.subtitles.subscribe(s=>r.onSubtitlesChanged?.(s))).add(e.ui.controlBlocks.topLeft.subscribe(s=>r.onTopLeftControlBlockChanged?.(s))).add(e.ui.controlBlocks.topRight.subscribe(s=>r.onTopRightControlBlockChanged?.(s))).add(e.ui.controlBlocks.bottomLeft.subscribe(s=>r.onBottomLeftControlBlockChanged?.(s))).add(e.ui.controlBlocks.bottomRight.subscribe(s=>r.onBottomRightControlBlockChanged?.(s))).add(e.ui.controlBlocks.middle.subscribe(s=>r.onMiddleControlBlockChanged?.(s))).add(e.ui.controlBlocks.bottom.subscribe(s=>r.onBottomControlBlockChanged?.(s))).add(e.ui.videoTitleInfo.subscribe(s=>r.onTitleChanged?.(s))).add(e.ui.controls.settings.subscribe(s=>r.onSettingsChanged?.(s))).add(e.ui.controls.fullscreen.subscribe(s=>r.onFullscreenChanged?.(s))).add(e.ui.controls.chromecast.subscribe(s=>r.onChromecastChanged?.(s))).add(e.ui.controls.pip.subscribe(s=>r.onPipChanged?.(s))).add(e.ui.controls.vkLogo.subscribe(s=>r.onVkLogoChanged?.(s))).add(e.ui.controls.interactiveTimeIndicator.subscribe(s=>r.onInteractiveTimeIndicatorChanged?.(s))).add(e.ui.controls.timeline.subscribe(s=>r.onTimelineChanged?.(s)))}playNextVideo(){this.videoConfig&&(this.currentPlayingVideoIndex++,this.currentPlayingVideoIndex>=this.videoConfig.videos.length&&(this.currentPlayingVideoIndex=0),this.log({message:`play next video, index: ${this.currentPlayingVideoIndex}`}),this.createPlayerWithCurrentVideo())}playPrevVideo(){this.videoConfig&&(this.currentPlayingVideoIndex--,this.currentPlayingVideoIndex<0&&(this.currentPlayingVideoIndex=this.videoConfig.videos.length-1),this.log({message:`play prev video, index: ${this.currentPlayingVideoIndex}`}),this.createPlayerWithCurrentVideo())}createPlayerWithCurrentVideo(e,i=!0){if(!this.videoConfig)return;let o=this.videoConfig.videos[this.currentPlayingVideoIndex];if(!o){this.log({message:"no next video"});return}this.isInited&&Zm(o.unitedVideoId)&&this.store?.actions.internal.nextMovie(o.unitedVideoId),this.unmountComponent(this.svelteRootComponent),this.createPlayer(o,{autoplay:i,fromTime:0},e)}playPrevChapter(){this.interactiveController?.playPrevChapter()}seekToInteractive(){let e=this.interactiveController?.getNextInteractiveStartTime();typeof e=="number"&&this.seekTime(e/1e3)}async initInteractives(){if(this.videoConfig?.interactiveData)try{let{Interactives:e}=await import("@vkontakte/videoplayer-interactive");this.interactiveContainer=document.createElement("div"),this.interactiveContainer.classList.add("interactive-root");let i=this.store?.interfaceLanguage$,o=i?ve(i):this.videoConfig.interfaceLanguage,{projectInfo:r,initChapterId:s,historyApi:a,videoLoader:l}=this.videoConfig.interactiveData;this.interactiveController=new e({parentElement:this.interactiveContainer,fullscreenTargetElement:this.playerContainer,lang:o,graph:this.uiConfig.features.interactiveGraph,projectInfo:r,initChapterId:s,historyApi:a,vkVideoLoader:l,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$:d,isSeekable$:f}=this.interactiveController.state;this.uiConfig.features.seekToInteractive&&this.subscription.add(f.subscribe(g=>{if(!this.isInited)return;let u=this.store;g?u.ui.controls.disabledControls$.remove("SEEK_TO_INTERACTIVE_BUTTON"):u.ui.controls.disabledControls$.add("SEEK_TO_INTERACTIVE_BUTTON")})),this.subscription.add(d.subscribe(g=>{this.store&&this.store.state.isInteractiveExpectation$.set(g)}));let p=!0;if(this.subscription.add(this.interactiveController.events.playerChanged$.subscribe(g=>{if(!this.videoConfig)return;this.videoConfig.videos[this.currentPlayingVideoIndex]={...g.config,title:r?.title||g.config.title};let u=p?this.videoConfig.autoplay:!0;this.createPlayerWithCurrentVideo(g.player,u),p&&(p=!1)})),this.interactiveSubscription.add(this.interactiveController.events.interactiveActionChoice$.subscribe(({type:g,actionType:u})=>{if(!this.store||!this.microStoresRoot)return;let y=d.getValue();if(g==="action-choice"&&u==="setRandomBranch"&&(this.microStoresRoot.stores.graphIsOpened$.set(!1),this.store.ui.controls.disabledControls$.remove(Vl)),g==="action-choice-canceled"){let x=ve(this.store.state.isPlaying$)||y;if((this.videoConfig?.isTouch??this.videoConfig?.isMobile)&&x){this.store.ui.interactiveHideMobileControls.set(!0);return}this.videoConfig?.callbacks.onDisabledInteractiveClick?.()}})),this.interactiveSubscription.add(this.interactiveController.events.interactiveContainerFakeRemoved$.subscribe(({type:g,removeAllOpenURI:u})=>{this.store&&g==="container-fake-removed"&&u&&this.store.ui.controls.disabledControls$.remove(Vl)})),await this.interactiveController.setManifest(this.videoConfig.interactiveData.manifest),this.videoConfig?.callbacks?.onInteractiveHistoryChanged){let g=this.interactiveController.getHistoryState();this.subscription.add(g.history$.subscribe(u=>{u.length&&this.videoConfig?.callbacks?.onInteractiveHistoryChanged?.(u)}))}this.videoConfig?.callbacks?.onInteractiveChapterChanged&&this.subscription.add(this.interactiveController.events.chapterChanged$.subscribe(g=>{this.videoConfig?.callbacks.onInteractiveChapterChanged?.(g.chapter,g.manifestVideo)})),this.uiConfig.features.interactiveTimeIndicator&&this.subscription.add(this.interactiveController.events.noInteraction$.subscribe(()=>{this.microStoresRoot?.stores.showInteractiveTimeIndicatorTooltip$.set(!0,!0),this.videoConfig?.callbacks.onInteractiveTimeIndicatorClick?.()})),this.interactiveSubscription.add(this.interactiveController.events.error$.subscribe(g=>{this.log({message:g.toString()})}))}catch(e){this.log({message:e.message})}}initPlayer(e,i={}){if(!Array.isArray(e.videos)||e.videos.length===0&&!e.interactiveData){let o=new Error("empty videos");this.fatalError$.next(o),e.callbacks?.onCrashed?.(o.message);return}else this.fatalError$.next(null);if(this.videoConfig=kd(L5,y5(e,o=>o instanceof HTMLElement?o:void 0)),this.playerId=I5(e.playerId),this.uiConfig=Ig(i.ui??{}),this.coreConfig=i.core??{configName:[]},this.statisticsConfig=i.statistics??{},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:this.uiConfig.sentry??{}},this.uiConfig.features.exposeInternalsToGlobal&&(this.internalsExposure??=new T5("ui",this.playerId)),Rd.push("ui",{key:"videoplayer_embed",strings:["new","player_init_player","ads.enable: "+this.uiConfig.ads.enable,"showAds: "+this.videoConfig?.showAds],numbers:[b5()]}),Zm(this.videoConfig.isMediaSessionEnabled)&&(this.uiConfig.features.mediaSession=this.uiConfig.features.mediaSession??this.videoConfig.isMediaSessionEnabled??!0),Zm(this.videoConfig.isPictureInPictureEnabled)&&(this.uiConfig.features.pip=this.uiConfig.features.pip??this.videoConfig.isPictureInPictureEnabled??!0,this.uiConfig.features.dpip=this.uiConfig.features.dpip??this.videoConfig.isPictureInPictureEnabled??!0),this.videoConfig.isTouch=this.uiConfig.isMobile??this.videoConfig.isTouch??this.videoConfig.isMobile,this.videoConfig.autoplay&&=this.uiConfig.features.autoplay,this.videoConfig.showAds=this.uiConfig.ads.enable??this.videoConfig.showAds,this.videoConfig.adsSlotId=this.uiConfig.ads.slot??this.videoConfig.adsSlotId,this.videoConfig.adsPreviewParam=this.uiConfig.ads.preview??this.videoConfig.adsPreviewParam,this.videoConfig.logoHidden=!(this.uiConfig.showLogo??!this.videoConfig.logoHidden),this.videoConfig.canRewindLive&&=this.uiConfig.features.liveRewind,this.videoConfig.supportLink=this.videoConfig.supportLink??this.uiConfig.supportLink,this.videoConfig.showEndScreen=this.uiConfig.features.endScreen??this.videoConfig.showEndScreen,this.videoConfig.showAutoplayNext=this.uiConfig.features.autoplayNext??this.videoConfig.showAutoplayNext,this.videoConfig.showNextPrevButtons=this.uiConfig.features.nextPrevButtons??this.videoConfig.showNextPrevButtons,this.currentPlayingVideoIndex=this.videoConfig.videoIndex&&this.videoConfig.videos?.[this.videoConfig.videoIndex]?this.videoConfig.videoIndex:0,this.needToRepeatPlaylist=this.videoConfig.repeat,this.uiConfig.features.pip){let o={enabled:this.videoConfig.pipEnabled};this.uiConfig.features.dpip?this.pictureInPictureApi=vu.getLatestSupportedVersion(o):this.pictureInPictureApi=new ia(o)}this.mediaSessionApi=this.uiConfig.features.mediaSession?new mu:void 0,this.slotsApi=this.uiConfig.features.slots?new cu:void 0,this.annotationsApi=this.uiConfig.features.annotations?new gu(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]),E1(this.pictureInPictureApi)&&this.pictureInPictureApi.setPlayerDomElement(this.playerContainer,this._shadowRoot),this.slotsApi?.init(this.shadowRootContainer,this.store),this.focusManager=this._shadowRoot?new bu(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();n(wn)&&(n(wn).showNextPrevButtons=this.needToShowNextPrevButtons(),n(wn).nextButtonActive=this.isNextButtonActive(),n(wn).prevButtonActive=this.isPrevButtonActive(),n(wn).endScreenVideoTitle=o.nextVideoTitle,n(wn).endScreenVideoThumb=o.nextVideoThumb,n(wn).isOneVideoPlaylist=this.isOneVideoPlaylist())}updatePrevVideos(e){this.updateVideos(e,"prev")}updateNextVideos(e){this.updateVideos(e,"next")}initMediaSession(){this.mediaSessionApi&&(this.unsubscribePlayerPhaseSubscription?.(),this.mediaSessionApi.clearSubscriptions(),this.unsubscribePlayerPhaseSubscription=this.store?.playerPhase.subscribe(e=>{e==="video"?this.setupMediaSessionForVideo():e==="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",r=>this.seekTime(r.seekTime)]];this.videoConfig.videos.length>1&&(this.currentPlayingVideoIndex<this.videoConfig.videos.length-1&&o.push(["nexttrack",()=>{if(this.uiConfig.features.useCallbackForMediaSessionNextPrevClick)try{this.videoConfig?.callbacks?.onNextVideoClick?.()}catch{this.log({message:"onNextVideoClick callback failed to execute"})}else this.playNextVideo()}]),this.currentPlayingVideoIndex>0&&o.push(["previoustrack",()=>{if(this.uiConfig.features.useCallbackForMediaSessionNextPrevClick)try{this.videoConfig?.callbacks?.onPrevVideoClick?.()}catch{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(){this.isControlDisabled("PLAY_BUTTON")||this.store?.playerPhase.is("LiveWaitingStart")||this.store?.playerPhase.is("LiveWaitingRecover")||this.store?.playerPhase.is("LiveWaitingRecord")||(this.log({message:"play"}),this.svelteRootComponent?.play())}pause(){this.log({message:"pause"}),this.svelteRootComponent?.pause()}stop(){if(!this.videoConfig)return;this.log({message:"stop"});let e=!!this.interactiveController;e&&(this.interactiveController.destroy(),this.interactiveController=void 0,this.interactiveContainer=void 0,this.interactiveSubscription.unsubscribe()),this.unmountComponent(this.svelteStubComponent),this.mediaSessionApi?.destroy();let i=this.videoConfig.videos[0];i&&(this.unmountComponent(this.svelteRootComponent),e?(this.videoConfig.autoplay=!1,this.initInteractives()):this.createPlayer(i))}setMuted(e){this.log({message:`set muted, muted: ${e}`}),this.svelteRootComponent?.setMuted(e)}toggleSubtitle(){this.log({message:"toggle subtitle"}),this.svelteRootComponent?.toggleSubtitle()}changeSubtitle(e,i){this.log({message:"change subtitle"}),this.svelteRootComponent?.changeSubtitle(e,i)}hideControls(){this.log({message:"hide controls"}),this.svelteRootComponent?.hideControls()}showControls(){this.log({message:"show controls"}),this.svelteRootComponent?.showControls()}setPiPEnabled(e){this.store?.webApi.pictureInPictureApi?.setEnabled(e)}setVolume(e){this.log({message:`set volume, volume: ${e}`}),this.svelteRootComponent?.setVolume(e)}setRepeat(e){this.log({message:`set repeat, repeat: ${e}`}),this.needToRepeatPlaylist=e,n(wn)&&(n(wn).needToRepeatPlaylist=this.needToRepeatPlaylist,n(wn).showNextPrevButtons=this.needToShowNextPrevButtons(),n(wn).nextButtonActive=this.isNextButtonActive(),n(wn).prevButtonActive=this.isPrevButtonActive())}seekTime(e){this.isControlDisabled("TIMELINE")||(this.log({message:`seek time, time: ${e}`}),this.svelteRootComponent?.seekTime(e))}seekEpisodeStartTime(e){this.log({message:`seek episode start time, time: ${e}`}),this.svelteRootComponent?.seekEpisodeStartTime(e)}returnFocusToEpisodes(){this.log({message:"return focus to episodes button"}),this.svelteRootComponent?.returnFocusToEpisodes()}setPlaybackRate(e){this.log({message:`set playback rate to: ${e}`}),this.svelteRootComponent?.setPlaybackRate(e)}setAutoQualityLimits(e){this.log({message:`set auto quality limitation. Max: ${e.max??"none"}. Min: ${e.min??"none"}`}),this.svelteRootComponent?.setAutoQualityLimits(e)}setAutoQuality(){this.svelteRootComponent?.setAutoQuality()}toggleTrafficSaving(e){this.svelteRootComponent?.toggleTrafficSaving(e)}toggleHighQuality(e){this.svelteRootComponent?.toggleHighQuality(e)}addLanguage(e){this.store?.actions.internal.addLanguage(e)}async setLanguage(e){await this.store?.actions.internal.setLanguage(e)}setLiveStart(e){this.log({message:"live started"}),this.store?.actions.internal.setLiveWaitingRecover(!1),this.store?.actions.internal.setLiveWaitingStart(!1),this.unmountComponent(this.svelteRootComponent),this.createPlayer(e,{autoplay:!0})}setLiveWaitingStart(){this.log({message:"live waiting"}),this.store?.actions.internal.setLiveWaitingStart(!0)}isLiveTailPlaying(){let e=this.store?.getPlayer();if(!e)return!1;let{info:i}=e;return window.console.log(`VP-4613: VP: isLiveTailPlaying: atLiveEdge$ = ${i.atLiveEdge$.getValue()}, isStalled$ = ${i.isStalled$.getValue()}`),i.canPlayLiveTailBuffer$.getValue()&&!i.isStalled$.getValue()&&!i.atLiveEdge$.getValue()}setLiveWaitingRecover(e=!1){let i=this.isLiveTailPlaying(),o=e||!i;this.log({message:`live waiting recover: forceImmediate = ${e}, liveTailPlaying = ${i}`}),window.console.log(`VP-4613: VP: live waiting recover: liveTailPlaying = ${i} immediate = ${o}`);let r=()=>{this.store?.actions.internal.setLiveWaitingRecover(!0)};o&&r(),this.store?.callbacks&&(this.store.callbacks.onLiveEnded=()=>{o||r(),this.store?.destroy()})}setLiveWaitingRecord(){let e=this.isLiveTailPlaying(),i=!e;this.log({message:`live waiting record: liveTailPlaying = ${e}`});let o=()=>{this.store?.actions.internal.setLiveWaitingRecord(!0)};i&&o(),this.store?.callbacks&&(this.store.callbacks.onLiveEnded=()=>{i||o(),this.store?.destroy()})}setLiveEnd(e){let i=this.isLiveTailPlaying(),o=!i;this.log({message:`live ended: liveTailPlaying = ${i}`});let r=()=>{this.store?.actions.internal.setLiveWaitingRecover(!1),this.store?.actions.internal.setLiveWaitingRecord(!1),this.unmountComponent(this.svelteRootComponent),this.createPlayer(e,{autoplay:!1})};if(o){r();return}this.store?.callbacks&&(this.store.callbacks.onLiveEnded=r)}setLiveLowLatency(e){this.log({message:"live switch to low latency "+e}),this.store?.actions.external.setLiveLowLatency(e)}setLooped(e){this.store?.actions.internal.setLooped(e)}getDebugData(){return this.store?.actions.internal.getDebugTextData()??""}getDeviceId(){return this.statistics?.oneStat?.getDeviceId()??void 0}replayInteractiveVideo(){this.interactiveController&&this.interactiveController.setChapter()}async replayInteractiveChapter(e){if(this.interactiveController&&this.store?.state.positionExact$){let i=ve(this.store.state.positionExact$),r=ve(this.store.state.interactiveEpisodes$).find(a=>!a.completed);this.interactiveController.events.playerChanged$.pipe(C5()).subscribe(()=>{r&&i>=r.time?this.seekTime(r.time):this.seekTime(i),e?.()});let s=this.interactiveController.getCurrentChapter();await this.interactiveController.setChapter({chapterId:s?.chapter?.id,pushToHistory:!1})}}showInteractiveIndicatorTooltip(e,i=!1){this.microStoresRoot?.stores.showInteractiveTimeIndicatorTooltip$.set(e,i)}switchToActiveLive(){this.store?.actions.internal.switchToActiveLive()}updateAdditionalSettingsItem(e,i){this.store?.actions.external.updateAdditionalSettingsItem(e,i)}addAdditionalSettingsItem(e){this.store?.actions.external.addAdditionalSettingsItem(e)}removeAdditionalSettingsItem(e){this.store?.actions.external.removeAdditionalSettingsItem(e)}updateAdditionalContextItem(e,i){this.store?.actions.external.updateAdditionalContextItem(e,i)}addAdditionalContextItem(e){this.store?.actions.external.addAdditionalContextItem(e)}removeAdditionalContextItem(e){this.store?.actions.external.removeAdditionalContextItem(e)}updateAdditionalButton(e,i){this.store?.actions.external.updateAdditionalButton(e,i)}addAdditionalButton(e){this.store?.actions.external.addAdditionalButton(e)}removeAdditionalButton(e){this.store?.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){this.store?.actions.internal.setTimerNextVideoRunning(e)}togglePictureInPicture(){this.store?.actions.internal.togglePictureInPicture()}focus(){this.svelteRootComponent?.keyboardControls?.focus?.()}restoreFocus(){this.focusManager?.restoreFocus()}handleExternalKeyboardEvent(e){return!!this.svelteRootComponent?.keyboardControls?.handleExternalKeyboardEvent(e)}setAutoplayNext(e){this.store?.actions.internal.setAutoplayNextEnabled(e)}unmountComponent(e){e&&js(e)}};import{InterfaceLanguage as EJ,VKNumericLanguage as PJ,loadVKLangPack as AJ}from"@vkontakte/videoplayer-shared";import{VideoQuality as LJ,VideoFormat as VJ}from"@vkontakte/videoplayer-core";var yJ=()=>{window.customElements.define("vk-video-player",$u)};export{Xc as ControlButtonType,Zr as GridTypes,EJ as InterfaceLanguage,Kl as MenuItemType,ps as PlayerPhase,Wa as VERSION,PJ as VKNumericLanguage,VJ as VideoFormat,LJ as VideoQuality,AJ as loadVKLangPack,yJ as registerPlayerWebComponent};
389
+ `),i=document.createElement("style");i.textContent=e;let o=this.createStretchedContainer(),r=o.attachShadow({mode:"open"});r.append(i),r.append(this.playerDomElement);let s={target:this.playerParentShadowRoot,context:this.svelteContext};this.playerDummyElement=jr(Qm,s),this.pipWindow?.document.body.append(o),this.info.isActive$.next(!0),this.pipWindow?.addEventListener("unload",a=>{!this.playerDomElement||!this.playerParentShadowRoot||!this.playerDummyElement||(js(this.playerDummyElement),this.playerParentShadowRoot.append(this.playerDomElement),this.info.isActive$.next(!1),this.pipWindow=void 0)})}async exit(){return new Promise(e=>{this.pipWindow&&documentPictureInPicture.window?.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 E1(t){return t instanceof Td}var vu=class{static getLatestSupportedVersion(e){let i=new ia(e),o=new Td(e);if(o.isSupported())return o;if(i.isSupported())return i}};function kd(t,e){let i=new Set([...Object.keys(t),...Object.keys(e)]),o={};for(let r of i)o[r]=e[r]??t[r]??void 0;return o}var P1="Inner error. Unexpectedly root annotation container null reference exception",A1="Annotation with such name already exists",M1="Annotation with such name does not exist";var rl=class extends Error{constructor(e){super(e),this.name="AnnotationError"}};import{observeElementSize as s5,Subscription as a5,throttleFn as l5}from"@vkontakte/videoplayer-shared";var d5="1",c5=100,gu=class{constructor(e){this.annotationsInside=e;this.annotations=new Map;this.subscriptions=new a5}init(e){if(this.rootAnnotationsContainer=e,this.annotationsInside)return;let i=l5(()=>{for(let o of this.annotations.values())this.isElementExceedsBoundaries(o,this.playerSize.width,this.playerSize.height)?o.style.visibility="hidden":o.style.visibility="visible"},c5);this.subscriptions.add(s5(this.rootAnnotationsContainer).subscribe(({width:o,height:r})=>{this.playerSize={width:o,height:r},i()})),this.mutationObserver=new MutationObserver(i),this.mutationObserver.observe(this.rootAnnotationsContainer,{attributes:!0,childList:!0,subtree:!0,characterData:!0})}add(e,i){if(!this.rootAnnotationsContainer)throw new rl(P1);if(this.annotations.has(e))throw new rl(A1);i.style.zIndex=i.style.zIndex??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 rl(M1);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(){this.annotations.clear(),this.subscriptions.unsubscribe(),this.mutationObserver?.disconnect(),this.rootAnnotationsContainer=null}isElementExceedsBoundaries(e,i,o){let r=e.offsetTop,s=e.offsetLeft,a=e.offsetWidth,l=e.offsetHeight;return r<0||s<0||s+a>i||r+l>o}registryRootContainer(e){}addLayer(e){return document.createElement("div")}getLayer(e){}removeLayer(e){}clearLayer(e){}detach(){}reattach(){}};import{assertNonNullable as hu,Subscription as u5}from"@vkontakte/videoplayer-shared";var Vo=class{init({store:e,microStores:i,interactiveController:o,config:r}){return hu(e),hu(i),hu(r),r.interactiveData&&hu(o),this.subscription=new u5,this.subscription}};var Id=class extends Vo{constructor(){super(...arguments);this.stateName="fakeIsPlaying$";this.state$={...ie(null),toggle:()=>this.state$.update(i=>!i)}}init(i){let o=super.init(i),{isInteractiveExpectation$:r}=i.store.state;return o.add(r.subscribe(s=>{this.state$.set(s?!0:null)})),o}};var Ed=class extends Vo{constructor(){super(...arguments);this.stateName="interactiveControlsOpacity$";this.state$={...ie(null),toggle:()=>this.state$.update(i=>!i)}}init(i){let o=super.init(i),{microStores:r,store:s}=i,{fakeIsPlaying$:a}=r,{isInteractiveExpectation$:l,isPlaying$:d}=s.state,{controlsVisible:f,isMobile:p}=s.ui,g=ve(p),u=()=>g&&ve(f);return o.add(f.subscribe(y=>{if(!g)return;let x=ve(a);ve(d)?this.state$.set(y):x!==null&&this.state$.set(!x||y)})),o.add(d.subscribe(y=>{this.state$.set(!y||u())})),o.add(a.subscribe(y=>{if(y===null)return;let x=ve(l);if(u()){this.state$.set(!0);return}x&&this.state$.set(!y)})),o}};var Pd=class extends Vo{constructor(){super(...arguments);this.stateName="seekToInteractiveDisabledTooltip$";this.state$=ie("tooltip_chapter_without_interactive")}init(i){let o=super.init(i),{store:r}=i;return o.add(r.state.interactiveEpisodes$.subscribe(s=>{s.length&&(s.every(a=>a.completed)?this.state$.set("tooltip_interactive_of_chapter_completed"):this.state$.set("tooltip_disabled_when_interactive"))})),o}};import{combine as p5}from"@vkontakte/videoplayer-shared";var jm=ie(!1),_u=null,Ad=class extends Vo{constructor(){super(...arguments);this.stateName="showInteractiveTimeIndicatorTooltip$";this.state$={...jm,set:(i,o=!1)=>{i!==ve(jm)&&(this.clearTimeout(),jm.set(i),!i&&_u&&(_u=!1),i&&o&&(this.timeout=setTimeout(()=>{this.state$.set(!1)},3e3)))},clearTimeout:()=>this.clearTimeout()}}init(i){let o=super.init(i),{store:r,config:s}=i,{isInteractiveTime$:a,isPlaying$:l}=r.state,d=r.ui.controlsVisible,{interactiveTimeIndicator:f}=r.ui.controls;o.add(d.subscribe(g=>{ve(a)&&g&&this.state$.set(!1)}));let p=s?.interactiveData||{tooltipHelpHintActive:!1};return o.add(p5({isPlaying$:l,isInteractiveTime$:a,interactiveTimeIndicator:f}).subscribe(({isPlaying$:g,isInteractiveTime$:u,interactiveTimeIndicator:y})=>{if(!(!g||!y?.isDisplayed)){if(!u)return this.state$.set(!1);p.tooltipHelpHintActive&&_u===null&&(_u=!0,p.tooltipHelpHintActive=!1,this.state$.set(!0),r.callbacks?.onInteractiveTimeIndicatorHintDeactivated?.())}})),o}clearTimeout(){window.clearTimeout(this.timeout)}};import{combine as f5,noop as m5}from"@vkontakte/videoplayer-shared";var Md=class extends Vo{constructor(){super(...arguments);this.stateName="graphIsOpened$";this.graphMadePause=!1;this.state$={...ie(null),toggle:m5};this.checkIfShouldHide=i=>Ms(i,"s")}init(i){let o=super.init(i),{store:r,interactiveController:s}=i,a=r.ui.currentGridType$,l=r.getLogger().createComponentLog("GraphIsOpened microStore");return this.state$.toggle=async()=>{if(this.checkIfShouldHide(ve(a)))return;let d=ve(this.state$),{isEnded$:f,playbackState$:p}=r.state,{disabledControls$:g}=r.ui.controls,u=ve(f),y=ve(p);if(d)try{await s?.toggleGraphView(!1),this.state$.set(!1),g.remove(xp),!u&&this.graphMadePause&&r.actions.internal.play()}catch{l({message:"Cant hide graph"})}else{this.graphMadePause=y==="playing";try{await s?.toggleGraphView(!0),this.state$.set(!0),g.add(xp),!u&&this.graphMadePause&&r.actions.internal.pause()}catch{l({message:"Cant show graph"})}}},o.add(f5({graphIsOpened:this.state$,currentGridType:a}).subscribe(async({graphIsOpened:d,currentGridType:f})=>{if(this.checkIfShouldHide(f)&&d)try{await s?.toggleGraphView(!1),this.state$.set(!1)}catch{l({message:"Cant hide graph"})}})),o}};import{ValueSubject as L1}from"@vkontakte/videoplayer-shared";var Ld=class extends Vo{constructor(){super(...arguments);this.stateName="pictureInPicture$";this.state$={isActive$:ie(!1),isEnabled$:ie(!1),type$:ie(void 0)}}init(i){let o=super.init(i),{store:r}=i,{info:{isActive$:s,isEnabled$:a,type:l}}=r.webApi.pictureInPictureApi||{info:{isActive$:new L1(!1),isEnabled$:new L1(!1)}};return o.add(s.subscribe(d=>{this.state$.isActive$.set(d)})),o.add(a.subscribe(d=>{this.state$.isEnabled$.set(d)})),this.state$.type$.set(l),o}};import{filter as h5,filterChanged as _5}from"@vkontakte/videoplayer-shared";import{safeStorage as Ym}from"@vkontakte/videoplayer-shared";var V1=({maxShowCount:t,timeout:e})=>{let i=[t!==0?v5({maxCount:t}):void 0,e!==0?g5({timeout:e}):void 0].filter(o=>!!o);return{notificationShowed:o=>i.forEach(r=>r.notificationShowed(o)),canShowNotification:o=>i.every(r=>r.canShowNotification(o))}},v5=({maxCount:t})=>{let e={};return{notificationShowed:i=>{e[i]=(e[i]??0)+1,Ym.set("videoplayer_notifications_manager_count",JSON.stringify(e[i]??0))},canShowNotification:i=>(e[i]??0)<t}},g5=({timeout:t})=>{let e="videoplayer_notifications_manager",i=()=>{try{return JSON.parse(Ym.get(e)||"{}")}catch{return{}}},o=s=>Ym.set(e,JSON.stringify(s)),r=s=>{let a=i();delete a[s],o(a)};return{notificationShowed:s=>{o({...i(),[s]:{timeout:t,launchTime:Date.now()}})},canShowNotification:s=>{let a=i()[s];if(a){let l=Date.now()-a.launchTime>t;return l&&r(s),l}else return!0}}};var Vd=class extends Vo{constructor(){super(...arguments);this.stateName="notifications$";this.state$={notificationsToShow$:ie({}),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:r,uiConfig:{features:{maxCountShowSlowVideoNotification:s,timeoutShowSlowVideoNotification:a,showSlowVideoNotification:l,forceAutoQualityWhenSevereStallHappens:d}}}=i;this.notificationManager=V1({maxShowCount:s,timeout:a});let f=r.getPlayer();return o.add(f.events.severeStallOccured$.pipe(_5(),h5(p=>p)).subscribe(()=>{l&&!f.info.isAutoQualityEnabled$.getValue()&&this.notificationManager.canShowNotification("slow_video")&&(d&&r.actions.internal.setQuality("auto"),this.state$.showNotification("slow_video"))})),o}};var R1=()=>[Id,Ed,Pd,Ad,Md,Ld,Vd].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 Rd}from"@vkontakte/videoplayer-shared";var bu=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=()=>{this.lastFocusedNode?.focus()};this.init()}destroy(){this.shadowRoot.removeEventListener("focusin",this.handleFocusChange)}};var L5={preload:!0,autoplay:!1,repeat:!1,fromTime:0,canRewindLive:!0,showAds:!1,interfaceLanguage:x5.RU,isCyrillicRelatedInterface:!0,logoClickable:!1,logoHidden:!1,isTouch:E5(),isMediaSessionEnabled:!0,isPictureInPictureEnabled:!0,isAudioDisabled:!1,callbacks:{uiInfo:{}},tuningConfig:{configName:[]},saveRate:!0,volumeMultiplier:1,showEndScreen:!0,showAutoplayNext:!0,showNextPrevButtons:!0},wn=Q(void 0),$u=class extends HTMLElement{svelteStubComponent;svelteRootComponent;svelteErrorComponent;store;microStoresRoot;statistics;sentry;_shadowRoot;playerContainer;rootContainer;shadowRootContainer;playerId;uiConfig;coreConfig;statisticsConfig;interactiveController;interactiveContainer;graphMadePause;currentPlayingVideoIndex=0;needToRepeatPlaylist=!1;videoConfig=void 0;pictureInPictureApi=void 0;mediaSessionApi=void 0;unsubscribePlayerPhaseSubscription=void 0;logger;log;subscription;interactiveSubscription;annotationsApi=void 0;slotsApi;focusManager;prevIsid=void 0;isInited=!1;internalsExposure=null;shadowDOMCallbacksDisabled=!1;fatalError$=new $5(null);constructor(){super(),Rd.create("ui"),this.logger=new w5,this.log=this.logger.createComponentLog("VKVideoPlayer"),this.subscription=new N1,this.interactiveSubscription=new N1,this.graphMadePause=!1,this.fatalError$.subscribe(e=>{this.unmountComponent(this.svelteErrorComponent),e&&(this.unmountComponent(this.svelteStubComponent),this.unmountComponent(this.svelteRootComponent),this.svelteErrorComponent=jr(Km,{target:this.playerContainer}))})}connectedCallback(){if(this.rootContainer)return;this.initPlayerRootContainers();let e=this.getAttribute("stub-title")??void 0,i=this.getAttribute("stub-thumb-url")??void 0,o=qt({title:e,thumbUrl:i}),r={target:this.playerContainer,props:o};this.svelteStubComponent=jr(Wm,r)}disconnectedCallback(){this.shadowDOMCallbacksDisabled||(this.annotationsApi?.destroy(),this.slotsApi?.destroy(),this.focusManager?.destroy(),this.mediaSessionApi?.destroy(),this.unmountComponent(this.svelteRootComponent),this.unmountComponent(this.svelteStubComponent),this.unmountComponent(this.svelteErrorComponent),this.subscription.unsubscribe(),this.unsubscribePlayerPhaseSubscription?.(),this.interactiveController?.destroy(),this.interactiveSubscription.unsubscribe(),this.internalsExposure?.destroy(),Rd.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){return this.store?.ui.controls.disabledControls$?.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}}createOneStat=(e,i={})=>{if(!this.videoConfig)return;let{albumId:o,statPlace:r,statUserSalt:s,statTrackCode:a,statVKAppId:l,refreshStatAuthToken:d,autoplay:f,isMobile:p,isTouch:g,refDomain:u,deviceId:y,interactiveData:x}=kd(this.videoConfig,i),w=x?.projectInfo?.pid,S=this.interactiveController?.state.isReplay$.getValue()??!1;S&&(this.prevIsid=void 0);let{unitedVideoId:T,isClip:k=!1}=e;if(this.uiConfig.features.statistics&&T)try{return new P5({movieId:T,albumId:o,place:r,trackCode:a,vkAppId:l,autoplay:(f&&!this.interactiveController)??!1,mobile:g??p,clip:k,refDomain:u,deviceId:y,isPreviewPlayerView:this.videoConfig.playerView==="preview",...w&&(!this.isInited||S)&&{projectId:Number(w)}},{refreshAuthToken:d,userSalt:s,config:this.statisticsConfig,...this.interactiveController&&{useIsid:!0,isid:this.prevIsid}})}catch(A){console.error(A),this.log({message:A.message})}};createThinOneStat(e,i={}){if(!this.videoConfig)return;let{deviceId:o,preload:r,refreshStatAuthToken:s}=kd(this.videoConfig,i),{unitedVideoId:a}=e;if(this.uiConfig.features.thinStatistics&&a)return new A5.ThinOneStat({deviceId:o,movieId:a,preload:r,isPreviewPlayerView:this.videoConfig.playerView==="preview"},{config:this.statisticsConfig,refreshAuthToken:s})}createPlayer(e,i={},o){if(!this.videoConfig)return;let{albumId:r,statPlace:s,statAuthToken:a,preload:l,autoplay:d,volume:f,muted:p,fromTime:g,canRewindLive:u,supportLink:y,showAds:x,adsSlotId:w,adsParams:S={},adsPreviewParam:T,adsAutoplayParam:k,interfaceLanguage:L,isCyrillicRelatedInterface:A,logoClickable:I,logoHidden:O,isMobile:G,isTouch:D,isAudioDisabled:ee,isLiveCatchUpMode:X,fullScreenTarget:ae,failoverHosts:j,canDownload:ue,callbacks:Y,interactiveData:he,showThumbTimer:_e,additionalButtons:Ie=[],additionalSettingsMenuItems:Fe=[],additionalContextMenuItems:se=[],repeat:Ne,saveRate:oe,volumeMultiplier:R,showEndScreen:Ee,showAutoplayNext:Ce,mediascopePixels:de}=kd(this.videoConfig,i),{sources:te,title:be,thumbUrl:Oe,unitedVideoId:le,isClip:at=!1,duration:K,adsParams:Me={},videoEpisodes:Ue,previewThumbsData:Ye,subtitles:dt,live:$t}=e;if(!te&&!$t){let He=new Error("empty sources and live");this.fatalError$.next(He),Y.onCrashed?.(He.message);return}let mt={...S,...Me},gt=this.getNextVideoInfo(),qe={sources:te,title:be,thumbUrl:Oe,subtitles:dt,unitedVideoId:le,isClip:at,live:$t,albumId:r,statPlace:s,autoplay:d,muted:p,volume:f,fromTime:g,canRewindLive:u,showAds:x,adsSlotId:w,adsParams:mt,adsPreviewParam:T,adsAutoplayParam:k,duration:K,logoClickable:I,logoHidden:O,isTouch:D??G,repeat:Ne,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:gt.nextVideoTitle,endScreenVideoThumb:gt.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist()},Bt={pictureInPictureApi:this.pictureInPictureApi,annotationsApi:this.annotationsApi,slotsApi:this.slotsApi};this.log({message:`create player, props: ${JSON.stringify(qe)}`});let zt=this.interactiveController?.state.statistics$.getValue(),Ze=zt?.oneStat||this.createOneStat(e,i),Rt=this.createThinOneStat(e,i),$e;de&&($e=new M5({pixels:de})),(Ze||Rt)&&(this.statistics=new Zc(Ze,Rt,$e,zt?.statSubscription)),this.uiConfig.features.sentry&&this.uiConfig.sentry.dsn&&new ta(this.uiConfig.sentry,{version:Wa,env:yc},{movieId:le,albumId:r,place:s,autoplay:(d&&!this.interactiveController)??!1,mobile:D??G,clip:at}),this.interactiveController&&(this.prevIsid??=this.statistics?.oneStat?.isid$.getValue()),this.sentry={...this.sentry,...ta.getInstance()};let ye=!!he,pe=[],Z="tooltip_interactive_go_back_disabled_first";if(ye&&this.interactiveController){let He=this.interactiveController.state.isInitialChapter$.getValue(),Le=this.interactiveController.getHistoryState();He&&pe.push("REPLAY_BUTTON"),this.interactiveController.getIsSeekable().getValue()||pe.push("SEEK_TO_INTERACTIVE_BUTTON"),Le.hasPrevChapter$.getValue()||(pe.push("PLAY_PREV_CHAPTER_BUTTON"),He||(Le.isGoBackLimited$.getValue()?Z="tooltip_interactive_go_back_disabled_limit":Z="tooltip_interactive_go_back_disabled"))}let Pe=()=>{this.isInited=!1,this.prevIsid=void 0;let He=o?.info.isEnded$.getValue()&&this.interactiveController?.state.isEndChapter$.getValue();Y.onReplayInteractiveVideo&&!He?Y.onReplayInteractiveVideo():this.replayInteractiveVideo()};this.store=Yh({player:o,interfaceLanguage:L,isCyrillicRelatedInterface:A,videoId:le,isClip:at,isLiveCatchUpMode:X,isAudioDisabled:ee,statAuthToken:a,callbacks:Y,webApi:Bt,videoEpisodes:Ue,previewThumbsData:Ye,canDownload:ue,uiConfig:this.uiConfig,coreConfig:this.coreConfig,disabledControls:pe,isInteractive:ye,saveRate:oe,interactiveRanges$:this.interactiveController?.state.interactiveRanges$,isInteractiveTime$:this.interactiveController?.state.isInteractiveTime$,stopPlayer:()=>this.stop(),replayInteractive:Pe,playPrevChapterDisabledTooltip:Z,hasInteractiveBranches:!!this.interactiveController?.getChapterBranches()?.length,additionalButtons:this.uiConfig.features.additionalButtons?Ie:[],additionalSettingsMenuItems:Fe??[],additionalContextMenuItems:se??[],playPrevVideo:()=>this.playPrevVideo(),playNextVideo:()=>this.playNextVideo(),looped:Ne&&this.videoConfig.videos.length===1,statistics:this.statistics,internalsExposure:this.internalsExposure,playerView:this.videoConfig.playerView,playerId:this.playerId});let{stores:je}=this.microStoresRoot=R1(),Xe=()=>{if(!this.store||!this.microStoresRoot||!this.videoConfig)return;this.subscription.add(this.store.state.currentFormat$.subscribe(Le=>Y?.onCurrentFormatChanged?.(Le))),this.subscription.add(je.interactiveControlsOpacity$.subscribe(Le=>{Le!==null&&this?.interactiveController?.setDisabledControls(Le)})),this.subscription.add(this.store.state.throughputEstimation$.subscribe(Le=>Y?.onThroughputEstimationChanged?.(Le))),this.subscription.add(this.store.state.trafficSavingEnabled$.subscribe(Le=>Y?.onTrafficSavingEnabledChanged?.(Le))),this.subscription.add(this.store.state.highQualityEnabled$.subscribe(Le=>Y?.onHighQualityEnabledChanged?.(Le))),this.subscription.add(this.store.state.isAutoQualityEnabled$.subscribe(Le=>Y?.onAutoQualityEnabledChanged?.(!!Le))),this.subscription.add(new S5(Le=>{this.store&&this.subscription.add(this.store.state.currentPlaybackRate$.subscribe(it=>Le.next(it)))}).pipe(k5(1)).subscribe(Le=>Y?.onCurrentPlaybackRateChanged?.(Le))),this.subscription.add(this.store.state.volume$.subscribe(Le=>Y?.onVolumeChange?.(Le))),this.subscription.add(this.store.state.muted$.subscribe(Le=>{if(Le)Y?.onMute?.();else{let it=(this.store?.state.volume$&&ve(this.store.state.volume$))??0;Y?.onUnmute?.(it)}})),this.subscription.add(this.store.state.videoBitrate$.subscribe(Le=>Y?.onVideoBitrateChanged?.(Le))),this.subscription.add(this.store.state.isInteractiveTime$.subscribe(Le=>{let it=this.store?.ui.controls.disabledControls$;it&&(Le&&!it.includes(Ll)&&it.add(Ll),Le||it.remove(Ll))})),this.subscription.add(this.store.ui.isFullscreen.subscribe(async Le=>{if(!B1.browser.isSamsungBrowser||!Le||!this.interactiveController)return;document.fullscreenElement===this.shadowRootContainer&&await this.replayInteractiveChapter(this.videoConfig?.callbacks.onExternalFullscreenExit)})),this.statistics&&this.statistics.oneStat&&this.subscription.add(this.statistics.oneStat.vsid$.subscribe(Le=>Y?.onVSIDChanged?.(Le))),this.initMediaSession(),V(wn,{interactiveController:this.interactiveController,interactiveContainer:this.interactiveContainer,sources:te,store:this.store,microStoresRoot:this.microStoresRoot,videoConfig:this.videoConfig,uiConfig:this.uiConfig,title:be,thumbUrl:Oe,subtitles:dt,live:$t,preload:l,autoplay:d,muted:p,volume:f,fromTime:g,canRewindLive:u,supportLink:y,showAds:x,adsSlotId:w,adsParams:mt,adsPreviewParam:T,adsAutoplayParam:k,duration:K,logoClickable:I,logoHidden:O,isMobile:D??G,failoverHosts:j,fullScreenTarget:ae,saveRate:oe,shadowRootContainer:this.shadowRootContainer,showMiniTimer:_e,outerContainerRef:this.rootContainer,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:gt.nextVideoTitle,endScreenVideoThumb:gt.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist(),playPrevChapter:()=>this.playPrevChapter(),seekToInteractive:()=>this.seekToInteractive(),volumeMultiplier:R,showEndScreen:Ee,showAutoplayNext:Ce},!0);let He={target:this.playerContainer,props:n(wn)};this.svelteRootComponent=jr(Fm,He),this.addPlayerInfoSubscriptions(),this.isInited||(this.isInited=!0,this.videoConfig?.callbacks?.onInited?.()),this.internalsExposure?.expose({player:this,videoConfig:this.videoConfig,coreConfig:this.coreConfig,uiConfig:this.uiConfig,statisticsConfig:this.statisticsConfig,logger:this.logger,log:this.log}),this.uiConfig.devNullLog&&this.videoConfig?.callbacks?.onDevNullLog?Rd.subscribe("ui",this.videoConfig.callbacks.onDevNullLog):Rd.destroy("ui")};this.coreConfig.asyncResolveClientChecker?B1.isInited$.subscribe(He=>{He&&(console.log("UI SDK async start"),Xe())}):Xe()}addPlayerInfoSubscriptions(){let e=this.store,i=this.microStoresRoot?.stores;if(!e||!i)return;let o=this.videoConfig?.callbacks;o&&this.subscription.add(e.playerPhase.subscribe(s=>o.onPlayerPhaseChanged?.(s))).add(e.state.playbackState$.subscribe(s=>s&&o.onPlaybackStateChanged?.(s))).add(e.state.isLive$.subscribe(s=>o.onIsLiveChanged?.(s))).add(e.state.isActiveLive$.subscribe(s=>o.onIsActiveLiveChanged?.(s))).add(e.state.isAudioAvailable$.subscribe(s=>o.onIsAudioAvailableChanged?.(s))).add(e.state.currentQuality$.subscribe(s=>o.onCurrentQualityChanged?.(s))).add(e.state.availableQualities$.subscribe(s=>o.onAvailableQualitiesChanged?.(s.map(({value:a})=>a).filter(a=>a!=="auto")))).add(e.state.availableAudioStreams$.subscribe(s=>{s.length>1&&o.onAudioLanguagesAvailable&&o.onAudioLanguagesAvailable()})).add(i.pictureInPicture$.isActive$.subscribe(s=>s?o.onPiPEnter?.():o.onPiPExit?.()));let r=o?.uiInfo;r&&this.subscription.add(e.ui.controlsVisible.subscribe(s=>r.onControlsVisibleChanged?.(s))).add(e.ui.isMobile.subscribe(s=>r.onIsMobileChanged?.(s))).add(e.ui.playerSize.subscribe(s=>r.onPlayerSizeChanged?.(s))).add(e.ui.controls.prevButton.subscribe(s=>r.onPrevButtonChanged?.(s))).add(e.ui.controls.playButton.subscribe(s=>r.onPlayButtonChanged?.(s))).add(e.ui.controls.replayButton.subscribe(s=>r.onReplayButtonChanged?.(s))).add(e.ui.controls.nextButton.subscribe(s=>r.onNextButtonChanged?.(s))).add(e.ui.controls.playPrevChapterButton.subscribe(s=>r.onPlayPrevChapterChanged?.(s))).add(e.ui.controls.seekToInteractiveButton.subscribe(s=>r.onSeekToInteractiveButtonChanged?.(s))).add(e.ui.controls.interactiveGraphButton.subscribe(s=>r.onGraphButtonChanged?.(s))).add(e.ui.controls.liveButton.subscribe(s=>r.onLiveButtonChanged?.(s))).add(e.ui.controls.time.subscribe(s=>r.onTimeUpdateChanged?.(s))).add(e.ui.controls.episodes.subscribe(s=>r.onEpisodesChanged?.(s))).add(e.ui.controls.subtitles.subscribe(s=>r.onSubtitlesChanged?.(s))).add(e.ui.controlBlocks.topLeft.subscribe(s=>r.onTopLeftControlBlockChanged?.(s))).add(e.ui.controlBlocks.topRight.subscribe(s=>r.onTopRightControlBlockChanged?.(s))).add(e.ui.controlBlocks.bottomLeft.subscribe(s=>r.onBottomLeftControlBlockChanged?.(s))).add(e.ui.controlBlocks.bottomRight.subscribe(s=>r.onBottomRightControlBlockChanged?.(s))).add(e.ui.controlBlocks.middle.subscribe(s=>r.onMiddleControlBlockChanged?.(s))).add(e.ui.controlBlocks.bottom.subscribe(s=>r.onBottomControlBlockChanged?.(s))).add(e.ui.videoTitleInfo.subscribe(s=>r.onTitleChanged?.(s))).add(e.ui.controls.settings.subscribe(s=>r.onSettingsChanged?.(s))).add(e.ui.controls.fullscreen.subscribe(s=>r.onFullscreenChanged?.(s))).add(e.ui.controls.chromecast.subscribe(s=>r.onChromecastChanged?.(s))).add(e.ui.controls.pip.subscribe(s=>r.onPipChanged?.(s))).add(e.ui.controls.vkLogo.subscribe(s=>r.onVkLogoChanged?.(s))).add(e.ui.controls.interactiveTimeIndicator.subscribe(s=>r.onInteractiveTimeIndicatorChanged?.(s))).add(e.ui.controls.timeline.subscribe(s=>r.onTimelineChanged?.(s)))}playNextVideo(){this.videoConfig&&(this.currentPlayingVideoIndex++,this.currentPlayingVideoIndex>=this.videoConfig.videos.length&&(this.currentPlayingVideoIndex=0),this.log({message:`play next video, index: ${this.currentPlayingVideoIndex}`}),this.createPlayerWithCurrentVideo())}playPrevVideo(){this.videoConfig&&(this.currentPlayingVideoIndex--,this.currentPlayingVideoIndex<0&&(this.currentPlayingVideoIndex=this.videoConfig.videos.length-1),this.log({message:`play prev video, index: ${this.currentPlayingVideoIndex}`}),this.createPlayerWithCurrentVideo())}createPlayerWithCurrentVideo(e,i=!0){if(!this.videoConfig)return;let o=this.videoConfig.videos[this.currentPlayingVideoIndex];if(!o){this.log({message:"no next video"});return}this.isInited&&Zm(o.unitedVideoId)&&this.store?.actions.internal.nextMovie(o.unitedVideoId),this.unmountComponent(this.svelteRootComponent),this.createPlayer(o,{autoplay:i,fromTime:0},e)}playPrevChapter(){this.interactiveController?.playPrevChapter()}seekToInteractive(){let e=this.interactiveController?.getNextInteractiveStartTime();typeof e=="number"&&this.seekTime(e/1e3)}async initInteractives(){if(this.videoConfig?.interactiveData)try{let{Interactives:e}=await import("@vkontakte/videoplayer-interactive");this.interactiveContainer=document.createElement("div"),this.interactiveContainer.classList.add("interactive-root");let i=this.store?.interfaceLanguage$,o=i?ve(i):this.videoConfig.interfaceLanguage,{projectInfo:r,initChapterId:s,historyApi:a,videoLoader:l}=this.videoConfig.interactiveData;this.interactiveController=new e({parentElement:this.interactiveContainer,fullscreenTargetElement:this.playerContainer,lang:o,graph:this.uiConfig.features.interactiveGraph,projectInfo:r,initChapterId:s,historyApi:a,vkVideoLoader:l,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$:d,isSeekable$:f}=this.interactiveController.state;this.uiConfig.features.seekToInteractive&&this.subscription.add(f.subscribe(g=>{if(!this.isInited)return;let u=this.store;g?u.ui.controls.disabledControls$.remove("SEEK_TO_INTERACTIVE_BUTTON"):u.ui.controls.disabledControls$.add("SEEK_TO_INTERACTIVE_BUTTON")})),this.subscription.add(d.subscribe(g=>{this.store&&this.store.state.isInteractiveExpectation$.set(g)}));let p=!0;if(this.subscription.add(this.interactiveController.events.playerChanged$.subscribe(g=>{if(!this.videoConfig)return;this.videoConfig.videos[this.currentPlayingVideoIndex]={...g.config,title:r?.title||g.config.title};let u=p?this.videoConfig.autoplay:!0;this.createPlayerWithCurrentVideo(g.player,u),p&&(p=!1)})),this.interactiveSubscription.add(this.interactiveController.events.interactiveActionChoice$.subscribe(({type:g,actionType:u})=>{if(!this.store||!this.microStoresRoot)return;let y=d.getValue();if(g==="action-choice"&&u==="setRandomBranch"&&(this.microStoresRoot.stores.graphIsOpened$.set(!1),this.store.ui.controls.disabledControls$.remove(Vl)),g==="action-choice-canceled"){let x=ve(this.store.state.isPlaying$)||y;if((this.videoConfig?.isTouch??this.videoConfig?.isMobile)&&x){this.store.ui.interactiveHideMobileControls.set(!0);return}this.videoConfig?.callbacks.onDisabledInteractiveClick?.()}})),this.interactiveSubscription.add(this.interactiveController.events.interactiveContainerFakeRemoved$.subscribe(({type:g,removeAllOpenURI:u})=>{this.store&&g==="container-fake-removed"&&u&&this.store.ui.controls.disabledControls$.remove(Vl)})),await this.interactiveController.setManifest(this.videoConfig.interactiveData.manifest),this.videoConfig?.callbacks?.onInteractiveHistoryChanged){let g=this.interactiveController.getHistoryState();this.subscription.add(g.history$.subscribe(u=>{u.length&&this.videoConfig?.callbacks?.onInteractiveHistoryChanged?.(u)}))}this.videoConfig?.callbacks?.onInteractiveChapterChanged&&this.subscription.add(this.interactiveController.events.chapterChanged$.subscribe(g=>{this.videoConfig?.callbacks.onInteractiveChapterChanged?.(g.chapter,g.manifestVideo)})),this.uiConfig.features.interactiveTimeIndicator&&this.subscription.add(this.interactiveController.events.noInteraction$.subscribe(()=>{this.microStoresRoot?.stores.showInteractiveTimeIndicatorTooltip$.set(!0,!0),this.videoConfig?.callbacks.onInteractiveTimeIndicatorClick?.()})),this.interactiveSubscription.add(this.interactiveController.events.error$.subscribe(g=>{this.log({message:g.toString()})}))}catch(e){this.log({message:e.message})}}initPlayer(e,i={}){if(!Array.isArray(e.videos)||e.videos.length===0&&!e.interactiveData){let o=new Error("empty videos");this.fatalError$.next(o),e.callbacks?.onCrashed?.(o.message);return}else this.fatalError$.next(null);if(this.videoConfig=kd(L5,y5(e,o=>o instanceof HTMLElement?o:void 0)),this.playerId=I5(e.playerId),this.uiConfig=Ig(i.ui??{}),this.coreConfig=i.core??{configName:[]},this.statisticsConfig=i.statistics??{},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:this.uiConfig.sentry??{}},this.uiConfig.features.exposeInternalsToGlobal&&(this.internalsExposure??=new T5("ui",this.playerId)),Rd.push("ui",{key:"videoplayer_embed",strings:["new","player_init_player","ads.enable: "+this.uiConfig.ads.enable,"showAds: "+this.videoConfig?.showAds],numbers:[b5()]}),Zm(this.videoConfig.isMediaSessionEnabled)&&(this.uiConfig.features.mediaSession=this.uiConfig.features.mediaSession??this.videoConfig.isMediaSessionEnabled??!0),Zm(this.videoConfig.isPictureInPictureEnabled)&&(this.uiConfig.features.pip=this.uiConfig.features.pip??this.videoConfig.isPictureInPictureEnabled??!0,this.uiConfig.features.dpip=this.uiConfig.features.dpip??this.videoConfig.isPictureInPictureEnabled??!0),this.videoConfig.isTouch=this.uiConfig.isMobile??this.videoConfig.isTouch??this.videoConfig.isMobile,this.videoConfig.autoplay&&=this.uiConfig.features.autoplay,this.videoConfig.showAds=this.uiConfig.ads.enable??this.videoConfig.showAds,this.videoConfig.adsSlotId=this.uiConfig.ads.slot??this.videoConfig.adsSlotId,this.videoConfig.adsPreviewParam=this.uiConfig.ads.preview??this.videoConfig.adsPreviewParam,this.videoConfig.logoHidden=!(this.uiConfig.showLogo??!this.videoConfig.logoHidden),this.videoConfig.canRewindLive&&=this.uiConfig.features.liveRewind,this.videoConfig.supportLink=this.videoConfig.supportLink??this.uiConfig.supportLink,this.videoConfig.showEndScreen=this.uiConfig.features.endScreen??this.videoConfig.showEndScreen,this.videoConfig.showAutoplayNext=this.uiConfig.features.autoplayNext??this.videoConfig.showAutoplayNext,this.videoConfig.showNextPrevButtons=this.uiConfig.features.nextPrevButtons??this.videoConfig.showNextPrevButtons,this.currentPlayingVideoIndex=this.videoConfig.videoIndex&&this.videoConfig.videos?.[this.videoConfig.videoIndex]?this.videoConfig.videoIndex:0,this.needToRepeatPlaylist=this.videoConfig.repeat,this.uiConfig.features.pip){let o={enabled:this.videoConfig.pipEnabled};this.uiConfig.features.dpip?this.pictureInPictureApi=vu.getLatestSupportedVersion(o):this.pictureInPictureApi=new ia(o)}this.mediaSessionApi=this.uiConfig.features.mediaSession?new mu:void 0,this.slotsApi=this.uiConfig.features.slots?new cu:void 0,this.annotationsApi=this.uiConfig.features.annotations?new gu(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]),E1(this.pictureInPictureApi)&&this.pictureInPictureApi.setPlayerDomElement(this.playerContainer,this._shadowRoot),this.slotsApi?.init(this.shadowRootContainer,this.store),this.focusManager=this._shadowRoot?new bu(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();n(wn)&&(n(wn).showNextPrevButtons=this.needToShowNextPrevButtons(),n(wn).nextButtonActive=this.isNextButtonActive(),n(wn).prevButtonActive=this.isPrevButtonActive(),n(wn).endScreenVideoTitle=o.nextVideoTitle,n(wn).endScreenVideoThumb=o.nextVideoThumb,n(wn).isOneVideoPlaylist=this.isOneVideoPlaylist())}updatePrevVideos(e){this.updateVideos(e,"prev")}updateNextVideos(e){this.updateVideos(e,"next")}initMediaSession(){this.mediaSessionApi&&(this.unsubscribePlayerPhaseSubscription?.(),this.mediaSessionApi.clearSubscriptions(),this.unsubscribePlayerPhaseSubscription=this.store?.playerPhase.subscribe(e=>{e==="video"?this.setupMediaSessionForVideo():e==="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",r=>this.seekTime(r.seekTime)]];this.videoConfig.videos.length>1&&(this.currentPlayingVideoIndex<this.videoConfig.videos.length-1&&o.push(["nexttrack",()=>{if(this.uiConfig.features.useCallbackForMediaSessionNextPrevClick)try{this.videoConfig?.callbacks?.onNextVideoClick?.()}catch{this.log({message:"onNextVideoClick callback failed to execute"})}else this.playNextVideo()}]),this.currentPlayingVideoIndex>0&&o.push(["previoustrack",()=>{if(this.uiConfig.features.useCallbackForMediaSessionNextPrevClick)try{this.videoConfig?.callbacks?.onPrevVideoClick?.()}catch{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(){this.isControlDisabled("PLAY_BUTTON")||this.store?.playerPhase.is("LiveWaitingStart")||this.store?.playerPhase.is("LiveWaitingRecover")||this.store?.playerPhase.is("LiveWaitingRecord")||(this.log({message:"play"}),this.svelteRootComponent?.play())}pause(){this.log({message:"pause"}),this.svelteRootComponent?.pause()}stop(){if(!this.videoConfig)return;this.log({message:"stop"});let e=!!this.interactiveController;e&&(this.interactiveController.destroy(),this.interactiveController=void 0,this.interactiveContainer=void 0,this.interactiveSubscription.unsubscribe()),this.unmountComponent(this.svelteStubComponent),this.mediaSessionApi?.destroy();let i=this.videoConfig.videos[0];i&&(this.unmountComponent(this.svelteRootComponent),e?(this.videoConfig.autoplay=!1,this.initInteractives()):this.createPlayer(i))}setMuted(e){this.log({message:`set muted, muted: ${e}`}),this.svelteRootComponent?.setMuted(e)}toggleSubtitle(){this.log({message:"toggle subtitle"}),this.svelteRootComponent?.toggleSubtitle()}changeSubtitle(e,i){this.log({message:"change subtitle"}),this.svelteRootComponent?.changeSubtitle(e,i)}hideControls(){this.log({message:"hide controls"}),this.svelteRootComponent?.hideControls()}showControls(){this.log({message:"show controls"}),this.svelteRootComponent?.showControls()}setPiPEnabled(e){this.store?.webApi.pictureInPictureApi?.setEnabled(e)}setVolume(e){this.log({message:`set volume, volume: ${e}`}),this.svelteRootComponent?.setVolume(e)}setRepeat(e){this.log({message:`set repeat, repeat: ${e}`}),this.needToRepeatPlaylist=e,n(wn)&&(n(wn).needToRepeatPlaylist=this.needToRepeatPlaylist,n(wn).showNextPrevButtons=this.needToShowNextPrevButtons(),n(wn).nextButtonActive=this.isNextButtonActive(),n(wn).prevButtonActive=this.isPrevButtonActive())}seekTime(e){this.isControlDisabled("TIMELINE")||(this.log({message:`seek time, time: ${e}`}),this.svelteRootComponent?.seekTime(e))}seekEpisodeStartTime(e){this.log({message:`seek episode start time, time: ${e}`}),this.svelteRootComponent?.seekEpisodeStartTime(e)}returnFocusToEpisodes(){this.log({message:"return focus to episodes button"}),this.svelteRootComponent?.returnFocusToEpisodes()}setPlaybackRate(e){this.log({message:`set playback rate to: ${e}`}),this.svelteRootComponent?.setPlaybackRate(e)}setAutoQualityLimits(e){this.log({message:`set auto quality limitation. Max: ${e.max??"none"}. Min: ${e.min??"none"}`}),this.svelteRootComponent?.setAutoQualityLimits(e)}setAutoQuality(){this.svelteRootComponent?.setAutoQuality()}toggleTrafficSaving(e){this.svelteRootComponent?.toggleTrafficSaving(e)}toggleHighQuality(e){this.svelteRootComponent?.toggleHighQuality(e)}addLanguage(e){this.store?.actions.internal.addLanguage(e)}async setLanguage(e){await this.store?.actions.internal.setLanguage(e)}setLiveStart(e){this.log({message:"live started"}),this.store?.actions.internal.setLiveWaitingRecover(!1),this.store?.actions.internal.setLiveWaitingStart(!1),this.unmountComponent(this.svelteRootComponent),this.createPlayer(e,{autoplay:!0})}setLiveWaitingStart(){this.log({message:"live waiting"}),this.store?.actions.internal.setLiveWaitingStart(!0)}isLiveTailPlaying(){let e=this.store?.getPlayer();if(!e)return!1;let{info:i}=e;return i.canPlayLiveTailBuffer$.getValue()&&!i.atLiveEdge$.getValue()}setLiveWaitingRecover(e=!1){let i=this.isLiveTailPlaying(),o=e||!i;this.log({message:`live waiting recover: forceImmediate = ${e}, liveTailPlaying = ${i}`});let r=()=>{this.store?.actions.internal.setLiveWaitingRecover(!0)};o&&r(),this.store?.callbacks&&(this.store.callbacks.onLiveEnded=()=>{o||r(),this.store?.destroy()})}setLiveWaitingRecord(){let e=this.isLiveTailPlaying(),i=!e;this.log({message:`live waiting record: liveTailPlaying = ${e}`});let o=()=>{this.store?.actions.internal.setLiveWaitingRecord(!0)};i&&o(),this.store?.callbacks&&(this.store.callbacks.onLiveEnded=()=>{i||o(),this.store?.destroy()})}setLiveEnd(e){let i=this.isLiveTailPlaying(),o=!i;this.log({message:`live ended: liveTailPlaying = ${i}`});let r=()=>{this.store?.actions.internal.setLiveWaitingRecover(!1),this.store?.actions.internal.setLiveWaitingRecord(!1),this.unmountComponent(this.svelteRootComponent),this.createPlayer(e,{autoplay:!1})};if(o){r();return}this.store?.callbacks&&(this.store.callbacks.onLiveEnded=r)}setLiveLowLatency(e){this.log({message:"live switch to low latency "+e}),this.store?.actions.external.setLiveLowLatency(e)}setLooped(e){this.store?.actions.internal.setLooped(e)}getDebugData(){return this.store?.actions.internal.getDebugTextData()??""}getDeviceId(){return this.statistics?.oneStat?.getDeviceId()??void 0}replayInteractiveVideo(){this.interactiveController&&this.interactiveController.setChapter()}async replayInteractiveChapter(e){if(this.interactiveController&&this.store?.state.positionExact$){let i=ve(this.store.state.positionExact$),r=ve(this.store.state.interactiveEpisodes$).find(a=>!a.completed);this.interactiveController.events.playerChanged$.pipe(C5()).subscribe(()=>{r&&i>=r.time?this.seekTime(r.time):this.seekTime(i),e?.()});let s=this.interactiveController.getCurrentChapter();await this.interactiveController.setChapter({chapterId:s?.chapter?.id,pushToHistory:!1})}}showInteractiveIndicatorTooltip(e,i=!1){this.microStoresRoot?.stores.showInteractiveTimeIndicatorTooltip$.set(e,i)}switchToActiveLive(){this.store?.actions.internal.switchToActiveLive()}updateAdditionalSettingsItem(e,i){this.store?.actions.external.updateAdditionalSettingsItem(e,i)}addAdditionalSettingsItem(e){this.store?.actions.external.addAdditionalSettingsItem(e)}removeAdditionalSettingsItem(e){this.store?.actions.external.removeAdditionalSettingsItem(e)}updateAdditionalContextItem(e,i){this.store?.actions.external.updateAdditionalContextItem(e,i)}addAdditionalContextItem(e){this.store?.actions.external.addAdditionalContextItem(e)}removeAdditionalContextItem(e){this.store?.actions.external.removeAdditionalContextItem(e)}updateAdditionalButton(e,i){this.store?.actions.external.updateAdditionalButton(e,i)}addAdditionalButton(e){this.store?.actions.external.addAdditionalButton(e)}removeAdditionalButton(e){this.store?.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){this.store?.actions.internal.setTimerNextVideoRunning(e)}togglePictureInPicture(){this.store?.actions.internal.togglePictureInPicture()}focus(){this.svelteRootComponent?.keyboardControls?.focus?.()}restoreFocus(){this.focusManager?.restoreFocus()}handleExternalKeyboardEvent(e){return!!this.svelteRootComponent?.keyboardControls?.handleExternalKeyboardEvent(e)}setAutoplayNext(e){this.store?.actions.internal.setAutoplayNextEnabled(e)}unmountComponent(e){e&&js(e)}};import{InterfaceLanguage as EJ,VKNumericLanguage as PJ,loadVKLangPack as AJ}from"@vkontakte/videoplayer-shared";import{VideoQuality as LJ,VideoFormat as VJ}from"@vkontakte/videoplayer-core";var yJ=()=>{window.customElements.define("vk-video-player",$u)};export{Xc as ControlButtonType,Zr as GridTypes,EJ as InterfaceLanguage,Kl as MenuItemType,ps as PlayerPhase,Wa as VERSION,PJ as VKNumericLanguage,VJ as VideoFormat,LJ as VideoQuality,AJ as loadVKLangPack,yJ as registerPlayerWebComponent};