@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.cjs.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
  "use strict";var g0=Object.create;var fc=Object.defineProperty;var h0=Object.getOwnPropertyDescriptor;var _0=Object.getOwnPropertyNames;var b0=Object.getPrototypeOf,$0=Object.prototype.hasOwnProperty;var y0=(t,e)=>{for(var i in e)fc(t,i,{get:e[i],enumerable:!0})},kv=(t,e,i,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of _0(e))!$0.call(t,r)&&r!==i&&fc(t,r,{get:()=>e[r],enumerable:!(o=h0(e,r))||o.enumerable});return t};var Iv=(t,e,i)=>(i=t!=null?g0(b0(t)):{},kv(e||!t||!t.__esModule?fc(i,"default",{value:t,enumerable:!0}):i,t)),x0=t=>kv(fc({},"__esModule",{value:!0}),t);var Lx={};y0(Lx,{ControlButtonType:()=>Id,GridTypes:()=>Mr,InterfaceLanguage:()=>Cl.InterfaceLanguage,MenuItemType:()=>ll,PlayerPhase:()=>Jr,VERSION:()=>na,VKNumericLanguage:()=>Cl.VKNumericLanguage,VideoFormat:()=>zu.VideoFormat,VideoQuality:()=>zu.VideoQuality,loadVKLangPack:()=>Cl.loadVKLangPack,registerPlayerWebComponent:()=>Mx});module.exports=x0(Lx);var $s="[",ys="[!",Hs="]",Kr={};var Ii=Symbol(),bn=Symbol("filename"),Ev=Symbol("hmr"),Pv="http://www.w3.org/1999/xhtml",mc="http://www.w3.org/2000/svg";var ep="@attach";var vc=!0;var Av=globalThis.process?.env?.NODE_ENV,ke=Av&&!Av.toLowerCase().startsWith("prod");var Hn=Array.isArray,Mv=Array.prototype.indexOf,kl=Array.from,tp=Object.keys,Hi=Object.defineProperty,Lo=Object.getOwnPropertyDescriptor,gc=Object.getOwnPropertyDescriptors,ip=Object.prototype,Lv=Array.prototype,Fs=Object.getPrototypeOf,op=Object.isExtensible;function xs(t){return typeof t=="function"}var ne=()=>{};function Vv(t){return t()}function ws(t){for(var e=0;e<t.length;e++)t[e]()}var vo=Symbol("$state"),La=Symbol("legacy props"),Rv=Symbol(""),hc=Symbol("proxy path"),_c=1,Va=3,Fn=8;function bc(t){return t===this.v}function Ra(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function Nv(t,e){return t!==e}function Na(t){return!Ra(t,this.v)}function Bv(){if(ke){let t=new Error(`derived_references_self
@@ -41,7 +41,7 @@ ${r}
41
41
  `}),t.stack&&Hi(t,"stack",{value:t.stack.split(`
42
42
  `).filter(a=>!a.includes("svelte/src/internal")).join(`
43
43
  `)})}}var js=!1,qa=null,Ys=!1,as=!1;function mp(t){as=t}var zl=[],Wl=[],St=null,qn=!1;function bi(t){St=t}var mt=null;function Fi(t){mt=t}var Wn=null;function wc(t){St!==null&&St.f&2097152&&(Wn===null?Wn=[St,[t]]:Wn[1].push(t))}var Jo=null,Qn=0,Kn=null;function Jv(t){Kn=t}var _g=1,Mc=0,ls=!1,Lc=null;function Ml(){return++_g}function Ks(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&&mt!==null&&!ls,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],Ks(s)&&fp(s),s.wv>t.wv)return!0}(!o||mt!==null&&!ls)&&Yo(t,1024)}return!1}function bg(t,e,i=!0){var o=t.reactions;if(o!==null)for(var r=0;r<o.length;r++){var s=o[r];Wn?.[1].includes(t)&&Wn[0]===St||((s.f&2)!==0?bg(s,e,!1):e===s&&(i?Yo(s,2048):(s.f&1024)!==0&&Yo(s,4096),Vl(s)))}}function xc(t){var e=Jo,i=Qn,o=Kn,r=St,s=ls,a=Wn,l=Rt,d=qn,f=t.f;Jo=null,Qn=0,Kn=null,ls=(f&256)!==0&&(qn||!Ys||St===null),St=(f&96)===0?t:null,Wn=null,El(t.ctx),qn=!1,Mc++,t.f|=2097152;try{var p=(0,t.fn)(),g=t.deps;if(Jo!==null){var u;if(Hl(t,Qn),g!==null&&Qn>0)for(g.length=Qn+Jo.length,u=0;u<Jo.length;u++)g[Qn+u]=Jo[u];else t.deps=g=Jo;if(!ls||(f&2)!==0&&t.reactions!==null)for(u=Qn;u<g.length;u++)(g[u].reactions??=[]).push(t)}else g!==null&&Qn<g.length&&(Hl(t,Qn),g.length=Qn);if(Gr()&&Kn!==null&&!qn&&g!==null&&(t.f&6146)===0)for(u=0;u<Kn.length;u++)bg(Kn[u],t);return r!==null&&r!==t&&(Mc++,Kn!==null&&(o===null?o=Kn:o.push(...Kn))),p}catch(y){vg(y)}finally{Jo=e,Qn=i,Kn=o,St=r,ls=s,Wn=a,El(l),qn=d,t.f^=2097152}}function P0(t,e){let i=e.reactions;if(i!==null){var o=Mv.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&&(Jo===null||!Jo.includes(e))&&(Yo(e,4096),(e.f&768)===0&&(e.f^=512),yc(e),Hl(e,0))}function Hl(t,e){var i=t.deps;if(i!==null)for(var o=e;o<i.length;o++)P0(t,i[o])}function za(t){var e=t.f;if((e&16384)===0){Yo(t,1024);var i=mt,o=Ys;if(mt=t,Ys=!0,ke){var r=Un;Pl(t.component_function)}try{(e&16)!==0?cg(t):_p(t),hp(t);var s=xc(t);if(t.teardown=typeof s=="function"?s:null,t.wv=_g,ke&&Qr&&(t.f&2048)!==0&&t.deps!==null)for(var a of t.deps)a.set_during_effect&&(a.wv=Ml(),a.set_during_effect=!1);ke&&Wl.push(t)}finally{Ys=o,mt=i,ke&&Pl(r)}}}function gg(){console.error("Last ten effects were: ",Wl.slice(-10).map(t=>t.fn)),Wl=[]}function A0(){try{Fv()}catch(t){if(ke&&Hi(t,"stack",{value:""}),qa!==null)if(ke)try{Ul(t,qa)}catch(e){throw gg(),e}else Ul(t,qa);else throw ke&&gg(),t}}function Sp(){var t=Ys;try{var e=0;for(Ys=!0;zl.length>0;){e++>1e3&&A0();var i=zl,o=i.length;zl=[];for(var r=0;r<o;r++){var s=L0(i[r]);M0(s)}Fa.clear()}}finally{js=!1,Ys=t,qa=null,ke&&(Wl=[])}}function M0(t){var e=t.length;if(e!==0)for(var i=0;i<e;i++){var o=t[i];(o.f&24576)===0&&Ks(o)&&(za(o),o.deps===null&&o.first===null&&o.nodes_start===null&&(o.teardown===null?$p(o):o.fn=null))}}function Vl(t){js||(js=!0,queueMicrotask(Sp));for(var e=qa=t;e.parent!==null;){e=e.parent;var i=e.f;if((i&96)!==0){if((i&1024)===0)return;e.f^=1024}}zl.push(e)}function L0(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:Ks(i)&&za(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 Qa(t){var e;for(t&&(js=!0,Sp(),js=!0,e=t());;){if(fg(),zl.length===0)return js=!1,qa=null,ke&&(Wl=[]),e;js=!0,Sp()}}async function ao(){await Promise.resolve(),Qa()}function n(t){var e=t.f,i=(e&2)!==0;if(Lc!==null&&Lc.add(t),St!==null&&!qn){if(!Wn?.[1].includes(t)||Wn[0]!==St){var o=St.deps;t.rv<Mc&&(t.rv=Mc,Jo===null&&o!==null&&o[Qn]===t?Qn++:Jo===null?Jo=[t]:(!ls||!Jo.includes(t))&&Jo.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,Ks(r)&&fp(r)),ke&&Qr&&!qn&&Il!==null&&St!==null&&Il.reaction===St)if(t.trace)t.trace();else{var a=ss("TracedAt");if(a){var l=Il.entries.get(t);l===void 0&&(l={traces:[]},Il.entries.set(t,l));var d=l.traces[l.traces.length-1];a.stack!==d?.stack&&l.traces.push(a)}}return as&&Fa.has(t)?Fa.get(t):t.v}function $t(t){var e=qn;try{return qn=!0,t()}finally{qn=e}}var V0=-7169;function Yo(t,e){t.f=t.f&V0|e}function Rc(t){if(!(typeof t!="object"||!t||t instanceof EventTarget)){if(vo in t)Vc(t);else if(!Array.isArray(t))for(let e in t){let i=t[e];typeof i=="object"&&i&&vo in i&&Vc(i)}}}function Vc(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{Vc(t[o],e)}catch{}let i=Fs(t);if(i!==Object.prototype&&i!==Array.prototype&&i!==Map.prototype&&i!==Set.prototype&&i!==Date.prototype){let o=gc(i);for(let r in o){let s=o[r].get;if(s)try{s.call(t)}catch{}}}}}function Cp(t,e){if(e){let i=document.body;t.autofocus=!0,Xo(()=>{document.activeElement===i&&t.focus()})}}function Kl(t){var e=St,i=mt;bi(null),Fi(null);try{return t()}finally{bi(e),Fi(i)}}var Tp=new Set,Nc=new Set;function Zs(t){if(!je)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 kp(t,e,i,o={}){function r(s){if(o.capture||Ga.call(e,s),!s.cancelBubble)return Kl(()=>i?.call(this,s))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?Xo(()=>{e.addEventListener(t,r,o)}):e.addEventListener(t,r,o),r}function yt(t,e,i,o,r){var s={capture:o,passive:r},a=kp(t,e,i,s);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&go(()=>{e.removeEventListener(t,a,s)})}function dt(t){for(var e=0;e<t.length;e++)Tp.add(t[e]);for(var i of Nc)i(t)}function Ga(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){Hi(t,"currentTarget",{configurable:!0,get(){return s||i}});var p=St,g=mt;bi(null),Fi(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(Hn(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,bi(p),Fi(g)}}}var N0;function $g(){N0=void 0}function ja(t){var e=document.createElement("template");return e.innerHTML=t.replaceAll("<!>","<!---->"),e.content}function lo(t,e){var i=mt;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(je)return lo(vt,null),vt;r===void 0&&(r=ja(s?t:"<!>"+t),i||(r=ei(r)));var a=o||Rl?document.importNode(r,!0):r.cloneNode(!0);if(i){var l=ei(a),d=a.lastChild;lo(l,d)}else lo(a,a);return a}}function D0(t,e,i="svg"){var o=!t.startsWith("<!>"),r=(e&1)!==0,s=`<${i}>${o?t:"<!>"+t}</${i}>`,a;return()=>{if(je)return lo(vt,null),vt;if(!a){var l=ja(s),d=ei(l);if(r)for(a=document.createDocumentFragment();ei(d);)a.appendChild(ei(d));else a=ei(d)}var f=a.cloneNode(!0);if(r){var p=ei(f),g=f.lastChild;lo(p,g)}else lo(f,f);return f}}function we(t,e){return D0(t,e,"svg")}function Yr(t=""){if(!je){var e=Zo(t+"");return lo(e,e),e}var i=vt;return i.nodeType!==Va&&(i.before(i=Zo()),Jt(i)),lo(i,i),i}function Be(){if(je)return lo(vt,null),vt;var t=document.createDocumentFragment(),e=document.createComment(""),i=Zo();return t.append(e,i),lo(e,i),t}function b(t,e){if(je){mt.nodes_end=vt,yi();return}t!==null&&t.before(e)}var H0=/\r/g;function xg(t){t=t.replace(H0,"");let e=5381,i=t.length;for(;i--;)e=(e<<5)-e^t.charCodeAt(i);return(e>>>0).toString(36)}function wg(t){return t.endsWith("capture")&&t!=="gotpointercapture"&&t!=="lostpointercapture"}var F0=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function Sg(t){return F0.includes(t)}var U0=["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 z0={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 Cg(t){return t=t.toLowerCase(),z0[t]??t}var y6=[...U0,"formNoValidate","isMap","noModule","playsInline","readOnly","value","volume","defaultValue","defaultChecked","srcObject","noValidate","allowFullscreen","disablePictureInPicture","disableRemotePlayback"];var W0=["touchstart","touchmove"];function Tg(t){return W0.includes(t)}var K0=["$state","$state.raw","$derived","$derived.by"],x6=[...K0,"$state.snapshot","$props","$props.id","$bindable","$effect","$effect.pre","$effect.tracking","$effect.root","$inspect","$inspect().with","$inspect.trace","$host"];var q0=["textarea","script","style","title"];function kg(t){return q0.includes(t)}function Bc(t){return t?.replace(/\//g,"/\u200B")}var ql=!0;function Oc(t){ql=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 Zr(t,e){return Ig(t,e)}function Ep(t,e){Tc(),e.intro=e.intro??!1;let i=e.target,o=je,r=vt;try{for(var s=ei(i);s&&(s.nodeType!==Fn||s.data!==$s);)s=_o(s);if(!s)throw Kr;Ui(!0),Jt(s),yi();let a=Ig(t,{...e,anchor:s});if(vt===null||vt.nodeType!==Fn||vt.data!==Hs)throw Ss(),Kr;return Ui(!1),a}catch(a){if(a===Kr)return e.recover===!1&&Uv(),Tc(),Nl(i),Ui(!1),Zr(t,e);throw a}finally{Ui(o),Jt(r),$g()}}var Ya=new Map;function Ig(t,{target:e,anchor:i,props:o={},events:r,context:s,intro:a=!0}){Tc();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=Tg(y);e.addEventListener(y,Ga,{passive:x});var w=Ya.get(y);w===void 0?(document.addEventListener(y,Ga,{passive:x}),Ya.set(y,1)):Ya.set(y,w+1)}}};d(kl(Tp)),Nc.add(d);var f=void 0,p=dg(()=>{var g=i??e.appendChild(Zo());return pi(()=>{if(s){F({});var u=Rt;u.c=s}r&&(o.$$events=r),je&&lo(g,null),ql=a,f=t(g,o)||{},ql=!0,je&&(mt.nodes_end=vt),s&&U()}),()=>{for(var u of l){e.removeEventListener(u,Ga);var y=Ya.get(u);--y===0?(document.removeEventListener(u,Ga),Ya.delete(u)):Ya.set(u,y)}Nc.delete(d),g!==i&&g.parentNode?.removeChild(g)}});return Ip.set(f,p),f}var Ip=new WeakMap;function Xs(t,e){let i=Ip.get(t);return i?(Ip.delete(t),i(e)):(ke&&ig(),Promise.resolve())}function me(t,e,...i){var o=t,r=ne,s;xi(()=>{r!==(r=e())&&(s&&($i(s),s=null),ke&&r==null&&zv(),s=pi(()=>r(o,...i)))},65536),je&&(o=vt)}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;qv(e)},set:o=>{i=o}})}};Y0=t,t("$state"),t("$effect"),t("$derived"),t("$inspect"),t("$props"),t("$bindable")}var Y0;function At(t){Rt===null&&Ba("onMount"),qr&&Rt.l!==null?j0(Rt).m.push(t):De(()=>{let e=$t(t);if(typeof e=="function")return e})}function No(t){Rt===null&&Ba("onDestroy"),At(()=>()=>$t(t))}function j0(t){var e=t.l;return e.u??={a:[],b:[],m:[]}}var Eg=new Map;function Pg(t,e){var i=Eg.get(t);i||(i=new Set,Eg.set(t,i)),i.add(e)}function M(t,e,[i,o]=[0,0]){je&&i===0&&yi();var r=t,s=null,a=null,l=Ii,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(je&&o!==-1){if(i===0){let S=Cc(r);S===$s?o=0:S===ys?o=1/0:(o=parseInt(S.substring(1)),o!==o&&(o=l?1/0:-1))}let w=o>i;!!l===w&&(r=qs(),Jt(r),Ui(!1),x=!0,o=-1)}l?(s?cs(s):y&&(s=pi(()=>y(r))),a&&wn(a,()=>{a=null})):(a?cs(a):y&&(a=pi(()=>y(r,[i+1,o]))),s&&wn(s,()=>{s=null})),x&&Ui(!0)};xi(()=>{f=!1,e(p),f||g(null,null)},d),je&&(r=vt)}function Js(t,e,i){je&&yi();var o=t,r=Ii,s,a=Gr()?Nv:Ra;xi(()=>{a(r,r=e())&&(s&&wn(s),s=pi(()=>i(o)))}),je&&(o=vt)}var Ts=null;function Mp(t){Ts=t}function Ql(t,e){return e}function J0(t,e,i,o){for(var r=[],s=e.length,a=0;a<s;a++)Pc(e[a].e,r,!0);var l=s>0&&r.length===0&&i!==null;if(l){var d=i.parentNode;Nl(d),d.append(i),o.clear(),Cs(t,e[0].prev,e[s-1].next)}yp(r,()=>{for(var f=0;f<s;f++){var p=e[f];l||(o.delete(p.k),Cs(t,p.prev,p.next)),$i(p.e,!l)}})}function ai(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=je?Jt(ei(f)):f.appendChild(Zo())}je&&yi();var p=null,g=!1,u=kr(()=>{var y=i();return Hn(y)?y:y==null?[]:kl(y)});xi(()=>{var y=n(u),x=y.length;if(g&&x===0)return;g=x===0;let w=!1;if(je){var S=Cc(a)===ys;S!==(x===0)&&(a=qs(),Jt(a),Ui(!1),w=!0)}if(je){for(var T=null,k,L=0;L<x;L++){if(vt.nodeType===Fn&&vt.data===Hs){a=vt,w=!0,Ui(!1);break}var A=y[L],I=o(A,L);k=Lg(vt,l,T,null,A,I,L,r,e,i),l.items.set(I,k),T=k}x>0&&Jt(qs())}je||e_(y,l,a,r,e,o,i),s!==null&&(x===0?p?cs(p):p=pi(()=>s(a)):p!==null&&wn(p,()=>{p=null})),w&&Ui(!0),n(u)}),je&&(a=vt)}function e_(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=Lg(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&&t_(A,k,I,r),(A.e.f&8192)!==0&&(cs(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)Ag(S[D],G,i);for(D=0;D<T.length;D+=1)y.delete(T[D]);Cs(e,ee.prev,X.next),Cs(e,x,ee),Cs(e,X,G),u=G,x=X,I-=1,S=[],T=[]}else y.delete(A),Ag(A,u,i),Cs(e,A.prev,A.next),Cs(e,A,x===null?e.first:x.next),Cs(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?[]:kl(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()}J0(e,ae,ue,p)}}l&&Xo(()=>{if(w!==void 0)for(A of w)A.a?.apply()}),mt.first=e.first&&e.first.e,mt.last=x&&x.e}function t_(t,e,i,o){(o&1)!==0&&Ua(t.v,e),(o&2)!==0?Ua(t.i,i):t.i=i}function Lg(t,e,i,o,r,s,a,l,d,f){var p=Ts,g=(d&1)!==0,u=(d&16)===0,y=g?u?jr(r,!1,!1):dr(r):r,x=(d&2)===0?a:dr(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};Ts=w;try{return w.e=pi(()=>l(t,y,x,f),je),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{Ts=p}}function Ag(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=_o(s);r.before(s),s=a}}function Cs(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 i_(t,e,i){if(!e||e===xg(String(i??"")))return;let o,r=t.__svelte_meta?.loc;r?o=`near ${r.file}:${r.line}:${r.column}`:Un?.[bn]&&(o=`in ${Un[bn]}`),tg(Bc(o))}function Gl(t,e,i=!1,o=!1,r=!1){var s=t,a="";N(()=>{var l=mt;if(a===(a=e()??"")){je&&yi();return}if(l.nodes_start!==null&&(bp(l.nodes_start,l.nodes_end),l.nodes_start=l.nodes_end=null),a!==""){if(je){for(var d=vt.data,f=yi(),p=f;f!==null&&(f.nodeType!==Fn||f.data!=="");)p=f,f=_o(f);if(f===null)throw Ss(),Kr;ke&&!r&&i_(f.parentNode,d,a),lo(vt,p),s=Jt(f);return}var g=a+"";i?g=`<svg>${g}</svg>`:o&&(g=`<math>${g}</math>`);var u=ja(g);if((i||o)&&(u=ei(u)),lo(ei(u),u.lastChild),i||o)for(;ei(u);)s.before(ei(u));else s.before(u)}})}function li(t,e,i){je&&yi();var o=t,r,s;xi(()=>{r!==(r=e())&&(s&&(wn(s),s=null),r&&(s=pi(()=>i(o,r))))},65536),je&&(o=vt)}function ea(t,e,i,o,r,s){let a=je;je&&yi();var l=ke&&s&&Rt?.function[bn],d,f,p=null;je&&vt.nodeType===_c&&(p=vt,yi());var g=je?vt:t,u,y=Ts;xi(()=>{let x=e()||null;var w=r?r():i||x==="svg"?mc:null;if(x!==d){var S=Ts;Mp(y),u&&(x===null?wn(u,()=>{u=null,f=null}):x===f?cs(u):($i(u),Oc(!1))),x&&x!==f&&(u=pi(()=>{if(p=je?p:w?document.createElementNS(w,x):document.createElement(x),ke&&s&&(p.__svelte_meta={loc:{file:l,line:s[0],column:s[1]}}),lo(p,p),o){je&&kg(x)&&p.append(document.createComment(""));var T=je?ei(p):p.appendChild(Zo());je&&(T===null?Ui(!1):Jt(T)),o(p,T)}mt.nodes_end=p,g.before(p)})),d=x,d&&(f=d),Oc(!0),Mp(S)}},65536),a&&(Ui(!0),Jt(g))}var Vp;function Vg(t){return Vp=t.target,new Lp(t)}var Lp=class{#t;#e;constructor(e){var i=new Map,o=(s,a)=>{var l=jr(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===La?!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?Ep:Zr)(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)&&Qa(),this.#t=r.$$events;for(let s of Object.keys(this.#e))s==="$set"||s==="$destroy"||s==="$on"||Hi(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=()=>{Xs(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){Xo(()=>{var i=t.getRootNode(),o=i.host?i:i.head??i.ownerDocument.head??Vp?.parentNode;if(!o?.querySelector("#"+e.hash)){let r=document.createElement("style");r.id=e.hash,r.textContent=e.code,o.appendChild(r),ke&&Pg(e.hash,r)}})}function us(t,e){var i=void 0,o;xi(()=>{i!==(i=e())&&(o&&($i(o),o=null),i&&(o=pi(()=>{so(()=>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 Ng(){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 jl(t){return typeof t=="object"?Ng(t):t??""}var Bg=[...`
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||Bg.includes(o[a-1]))&&(l===o.length||Bg.includes(o[l]))?o=(a===0?"":o.substring(0,a))+o.substring(l+1):a=l}}return o===""?null:o}function Og(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 Rp(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function Hg(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(Rp)),r&&d.push(...Object.keys(r).map(Rp));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=Rp(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+=Og(o)),r&&(i+=Og(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(je||a!==i||a===void 0){var l=Dg(i,o,s);(!je||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 Np(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 nt(t,e,i,o){var r=t.__style;if(je||r!==e){var s=Hg(e,o);(!je||s!==t.getAttribute("style"))&&(s==null?t.removeAttribute("style"):t.style.cssText=s),t.__style=e}else o&&(Array.isArray(o)?(Np(t,i?.[0],o[0]),Np(t,i?.[1],o[1],"important")):Np(t,i,o));return o}function Yl(t,e,i){if(t.multiple){if(e==null)return;if(!Hn(e))return og();for(var o of t.options)o.selected=e.includes(Fg(o));return}for(o of t.options){var r=Fg(o);if(lp(r,e)){o.selected=!0;return}}(!i||e!==void 0)&&(t.selectedIndex=-1)}function Bp(t){var e=new MutationObserver(()=>{Yl(t,t.__value)});e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),go(()=>{e.disconnect()})}function Fg(t){return"__value"in t?t.__value:t.value}var Za=Symbol("class"),Xa=Symbol("style"),Wg=Symbol("is custom element"),Kg=Symbol("is html");function qg(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function Re(t,e,i,o){var r=Gg(t);if(je&&(r[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName==="LINK")){o||c_(t,e,i??"");return}r[e]!==(r[e]=i)&&(e==="loading"&&(t[Rv]=i),i==null?t.removeAttribute(e):typeof i!="string"&&jg(t).includes(e)?t[e]=i:t.setAttribute(e,i))}function Qg(t,e,i,o,r=!1){var s=Gg(t),a=s[Wg],l=!s[Kg];let d=je&&a;d&&Ui(!1);var f=e||{},p=t.tagName==="OPTION";for(var g in e)g in i||(i[g]=null);i.class?i.class=jl(i.class):(o||i[Za])&&(i.class=null),i[Xa]&&(i.style??=null);var u=jg(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?.[Za],i[Za]),f[A]=I,f[Za]=i[Za];continue}if(A==="style"){nt(t,I,e?.[Xa],i[Xa]),f[A]=I,f[Xa]=i[Xa];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=Sg(D);if(wg(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,dt([D]);else{let ee=function(X){f[A].call(this,X)};var L=ee;f[G]=kp(D,t,ee,O)}else S&&(t[`__${D}`]=void 0)}else if(A==="style")Re(t,A,I);else if(A==="autofocus")Cp(t,!!I);else if(!a&&(A==="__value"||A==="value"&&I!=null))t.value=t.__value=I;else if(A==="selected"&&p)qg(t,I);else{var T=A;l||(T=Cg(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&&Ui(!0),f}function Te(t,e,i=[],o,r=!1,s=Tr){let a=i.map(s);var l=void 0,d={},f=t.nodeName==="SELECT",p=!1;if(xi(()=>{var u=e(...a.map(n)),y=Qg(t,l,u,o,r);p&&f&&"value"in u&&Yl(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===ep&&(!l||x!==l[w])&&(d[w]&&$i(d[w]),d[w]=pi(()=>us(t,()=>x))),y[w]=x}l=y}),f){var g=t;so(()=>{Yl(g,l.value),Bp(g)})}p=!0}function Gg(t){return t.__attributes??={[Wg]:t.nodeName.includes("-"),[Kg]:t.namespaceURI===Pv}}var Ug=new Map;function jg(t){var e=Ug.get(t.nodeName);if(e)return e;Ug.set(t.nodeName,e=[]);for(var i,o=t,r=Element.prototype;r!==o;){i=gc(o);for(var s in i)i[s].set&&e.push(s);o=Fs(o)}return e}function c_(t,e,i){ke&&(e==="srcset"&&u_(t,i)||Op(t.getAttribute(e)??"",i)||eg(e,t.outerHTML.replace(t.innerHTML,t.innerHTML&&"..."),String(i)))}function Op(t,e){return t===e?!0:new URL(t,document.baseURI).href===new URL(e,document.baseURI).href}function zg(t){return t.split(",").map(e=>e.trim().split(" ").filter(Boolean))}function u_(t,e){var i=zg(t.srcset),o=zg(e);return o.length===i.length&&o.every(([r,s],a)=>s===i[a][1]&&(Op(i[a][0],r)||Op(r,i[a][0])))}var p_=vc?()=>performance.now():()=>Date.now(),Pr={tick:t=>(vc?requestAnimationFrame:ne)(t),now:()=>p_(),tasks:new Set};function Yg(){let t=Pr.now();Pr.tasks.forEach(e=>{e.c(t)||(Pr.tasks.delete(e),e.f())}),Pr.tasks.size!==0&&Pr.tick(Yg)}function Zg(t){let e;return Pr.tasks.size===0&&Pr.tick(Yg),{promise:new Promise(i=>{Pr.tasks.add(e={c:t,f:i})}),abort(){Pr.tasks.delete(e)}}}function Dc(t,e){Kl(()=>{t.dispatchEvent(new CustomEvent(e))})}function g_(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=g_(r.trim());e[a]=s.trim()}return e}var h_=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=St,A=mt;bi(null),Fi(null);try{return f??=i()(e,o?.()??{},{direction:d})}finally{bi(L),Fi(A)}}var w={is_global:l,in(){if(e.inert=p,!r){y?.abort(),y?.reset?.();return}s||u?.abort(),Dc(e,"introstart"),u=Dp(e,x(),y,1,()=>{Dc(e,"introend"),u?.abort(),u=f=void 0,e.style.overflow=g})},out(L){if(!s){L?.(),f=void 0;return}e.inert=!0,Dc(e,"outrostart"),y=Dp(e,x(),u,0,()=>{Dc(e,"outroend"),L?.()})},stop:()=>{u?.abort(),y?.abort()}},S=mt;if((S.transitions??=[]).push(w),r&&ql){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&&so(()=>{$t(()=>w.in())})}}function Dp(t,e,i,o,r){var s=o===1;if(xs(e)){var a,l=!1;return Xo(()=>{if(!l){var S=e({direction:s?"in":"out"});a=Dp(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=h_}=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&&Zg(()=>{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 Fp=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 __=new Fp({box:"border-box"});function Gn(t,e,i){var o=__.observe(t,()=>i(t[e]));so(()=>($t(()=>i(t[e])),o))}function Jg(t,e){return t===e||t?.[vo]===e}function it(t={},e,i,o){return so(()=>{var r,s;return bo(()=>{r=s,s=o?.()||[],$t(()=>{t!==i(...s)&&(e(t,...s),r&&Jg(i(...r),t)&&e(null,...r))})}),()=>{Xo(()=>{s&&Jg(i(...s),t)&&e(null,...s)})}}),t}function Ar(t=!1){let e=Rt,i=e.l.u;if(!i)return;let o=()=>Rc(e.s);if(t){let r=0,s={},a=Tr(()=>{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&&Dl(()=>{eh(e,o),ws(i.b)}),De(()=>{let r=$t(()=>i.m.map(Vv));return()=>{for(let s of r)typeof s=="function"&&s()}}),i.a.length&&De(()=>{eh(e,o),ws(i.a)})}function eh(t,e){if(t.l.s)for(let i of t.l.s)n(i);e()}function Zl(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 Ja=[];function cr(t,e){return{subscribe:ie(t,e).subscribe}}function ie(t,e=ne){let i=null,o=new Set;function r(l){if(Ra(t,l)&&(t=l,i)){let d=!Ja.length;for(let f of o)f[1](),Ja.push(f,t);if(d){for(let f=0;f<Ja.length;f+=2)Ja[f][0](Ja[f+1]);Ja.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 ti(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 cr(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)=>Zl(x,S=>{f[w]=S,p&=~(1<<w),d&&u()},()=>{p|=1<<w}));return d=!0,u(),function(){ws(y),g(),d=!1}})}function ve(t){let e;return Zl(t,i=>e=i)(),e}var Fc=!1,Up=Symbol();function $(t,e,i){let o=i[e]??={store:null,source:jr(void 0),unsubscribe:ne};if(o.store!==t&&!(Up 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=Zl(t,s=>{r?o.source.v=s:V(o.source,s)}),r=!1}return t&&Up in i?ve(t):n(o.source)}function Ve(){let t={};function e(){go(()=>{for(var i in t)t[i].unsubscribe();Hi(t,Up,{enumerable:!1,value:!0})})}return[t,e]}function zp(t){var e=Fc;try{return Fc=!1,[t(),Fc]}finally{Fc=e}}var C_={get(t,e){if(!t.exclude.includes(e))return t.props[e]},set(t,e){return ke&&Kv(`${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},C_)}var T_={get(t,e){let i=t.props.length;for(;i--;){let o=t.props[i];if(xs(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];xs(r)&&(r=r());let s=Lo(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(xs(o)&&(o=o()),typeof o=="object"&&o!==null&&e in o){let r=Lo(o,e);return r&&!r.configurable&&(r.configurable=!0),r}}},has(t,e){if(e===vo||e===La)return!1;for(let i of t.props)if(xs(i)&&(i=i()),i!=null&&e in i)return!0;return!1},ownKeys(t){let e=[];for(let i of t.props)if(xs(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 ps(...t){return new Proxy({props:t},T_)}function th(t){return t.ctx?.d??!1}function m(t,e,i,o){var r=(i&1)!==0,s=!qr||(i&2)!==0,a=(i&8)!==0,l=(i&16)!==0,d=!1,f;a?[f,d]=zp(()=>t[e]):f=t[e];var p=vo in t||La in t,g=a&&(Lo(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&&Wv(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?Tr:kr)(()=>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=jr(f),O=Tr(()=>{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=Na),function(G,D){if(Lc!==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),th(O))return G;$t(()=>n(O))}return G}return th(O)?O.v:n(O)}}var k_;typeof HTMLElement=="function"&&(k_=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=I_(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]=Wp(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=Vg({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:i,$$host:this}}),this.$$me=Ec(()=>{bo(()=>{this.$$r=!0;for(let r of tp(this.$$c)){if(!this.$$p_d[r]?.reflect)continue;this.$$d[r]=this.$$c[r];let s=Wp(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]=Wp(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 tp(this.$$p_d).find(e=>this.$$p_d[e].attribute===t||!this.$$p_d[e].attribute&&e.toLowerCase()===t)||t}});function Wp(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 I_(t){let e={};return t.childNodes.forEach(i=>{e[i.slot||"default"]=!0}),e}var ih="5";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add(ih);var bl=require("@vkontakte/videoplayer-core"),GG=require("@vkontakte/videoplayer-core"),Aa=require("@vkontakte/videoplayer-shared"),t0=require("@vkontakte/videoplayer-statistics");var ta=require("@vkontakte/videoplayer-shared");var E_={isMobile:void 0,disableInvisibleComponentsTimeout:500,debugLog:!1,devNullLog:!1,defaultLanguage:ta.InterfaceLanguage.RU,downloadVKLanguages:!0,updateBuiltinLanguages:!0,isSmoothVideoRotate:!0,showSupport:!0,supportLink:"https://vk.com/support?act=new&from=v",showLogo:void 0,logoLink:"https://vk.com/video",logoType:"vk_video",volumeDefault:1,volumeMinRestore:.05,loaderDelay:500,minSubtitlesFontSize:13,autoSubtitlesTimeout:2e3,allowChangingFullscreenTarget:!0,trafficSavingLimit:ta.VideoQuality.Q_480P,highQualityLimit:ta.VideoQuality.Q_720P,episodeMinWidthPc:8,hideThumbTimerAfterTouch:!0,preventPauseOnVideoClick:!1,sentry:{dsn:"https://e349fd23c68f405388980d0868d0ff27@sentry.mvk.com/126",sampleRate:.01,whiteErrorCategoryList:[],blackErrorCategoryList:[],whiteErrorIdList:[],blackErrorIdList:[]},features:{autoplay:!0,statistics:!0,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"},oh=t=>(0,ta.fillWithDefault)(t,E_),nh=t=>Da("ui-config",t),It=()=>Oa("ui-config");var Xl="vk_player_debug_panel_opened";var rh="videoplayer",sh="videoplayer";var Xr={KeyF:"f",KeyK:"k",KeyC:"c",KeyM:"m"},ah=new Set(["ArrowLeft","ArrowRight","KeyL","KeyJ"]),lh=new Set(["Tab","Space","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"]),dh=new Set(["ShiftRight","ShiftLeft"]);var ch=["TIMELINE"],Jl=[...ch,"GRAPH_BUTTON"],Kp=[...ch,"PLAY_BUTTON"],ed=[...Jl,"PLAY_BUTTON"];var Mr=(s=>(s.XS="xs",s.S="s",s.M="m",s.L="l",s.XL="xl",s))(Mr||{}),oa={xs:0,s:1,m:2,l:3,xl:4};var td=require("@vkontakte/videoplayer-shared"),uh=require("@vkontakte/videoplayer-core"),ph=require("@vkontakte/videoplayer-statistics");var Uc="prod",na="1.1.72-dev.c0dc5218.0";var ra=(t,e,i)=>{let o=document.createElement("a");o.href=t,o.download=`${e}.${i}`,o.style.display="none",o.click()};var fh=Symbol("storeContext"),mh=Symbol("microStoresContext"),vh=(t,e)=>{Da(fh,t),Da(mh,e),Uc==="dev"&&(window.app={store:t,microStores:e})},Se=()=>{let t=Oa(fh);return(0,td.assertNonNullable)(t,"Store context is empty!"),t},Yi=()=>{let t=Oa(mh);return(0,td.assertNonNullable)(t,"MicroStores context is empty!"),t},Kt=(t,e)=>Wc(t,t.getValue(),e),Wc=(t,e,i)=>cr(e,o=>{let r=t.subscribe(s=>{o(s),i?.(s)});return()=>r.unsubscribe()}),gh=(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=`${na} (core: ${uh.VERSION}, stat: ${ph.VERSION}, shared: ${td.VERSION})`,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||Bg.includes(o[a-1]))&&(l===o.length||Bg.includes(o[l]))?o=(a===0?"":o.substring(0,a))+o.substring(l+1):a=l}}return o===""?null:o}function Og(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 Rp(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function Hg(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(Rp)),r&&d.push(...Object.keys(r).map(Rp));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=Rp(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+=Og(o)),r&&(i+=Og(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(je||a!==i||a===void 0){var l=Dg(i,o,s);(!je||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 Np(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 nt(t,e,i,o){var r=t.__style;if(je||r!==e){var s=Hg(e,o);(!je||s!==t.getAttribute("style"))&&(s==null?t.removeAttribute("style"):t.style.cssText=s),t.__style=e}else o&&(Array.isArray(o)?(Np(t,i?.[0],o[0]),Np(t,i?.[1],o[1],"important")):Np(t,i,o));return o}function Yl(t,e,i){if(t.multiple){if(e==null)return;if(!Hn(e))return og();for(var o of t.options)o.selected=e.includes(Fg(o));return}for(o of t.options){var r=Fg(o);if(lp(r,e)){o.selected=!0;return}}(!i||e!==void 0)&&(t.selectedIndex=-1)}function Bp(t){var e=new MutationObserver(()=>{Yl(t,t.__value)});e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),go(()=>{e.disconnect()})}function Fg(t){return"__value"in t?t.__value:t.value}var Za=Symbol("class"),Xa=Symbol("style"),Wg=Symbol("is custom element"),Kg=Symbol("is html");function qg(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function Re(t,e,i,o){var r=Gg(t);if(je&&(r[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName==="LINK")){o||c_(t,e,i??"");return}r[e]!==(r[e]=i)&&(e==="loading"&&(t[Rv]=i),i==null?t.removeAttribute(e):typeof i!="string"&&jg(t).includes(e)?t[e]=i:t.setAttribute(e,i))}function Qg(t,e,i,o,r=!1){var s=Gg(t),a=s[Wg],l=!s[Kg];let d=je&&a;d&&Ui(!1);var f=e||{},p=t.tagName==="OPTION";for(var g in e)g in i||(i[g]=null);i.class?i.class=jl(i.class):(o||i[Za])&&(i.class=null),i[Xa]&&(i.style??=null);var u=jg(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?.[Za],i[Za]),f[A]=I,f[Za]=i[Za];continue}if(A==="style"){nt(t,I,e?.[Xa],i[Xa]),f[A]=I,f[Xa]=i[Xa];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=Sg(D);if(wg(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,dt([D]);else{let ee=function(X){f[A].call(this,X)};var L=ee;f[G]=kp(D,t,ee,O)}else S&&(t[`__${D}`]=void 0)}else if(A==="style")Re(t,A,I);else if(A==="autofocus")Cp(t,!!I);else if(!a&&(A==="__value"||A==="value"&&I!=null))t.value=t.__value=I;else if(A==="selected"&&p)qg(t,I);else{var T=A;l||(T=Cg(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&&Ui(!0),f}function Te(t,e,i=[],o,r=!1,s=Tr){let a=i.map(s);var l=void 0,d={},f=t.nodeName==="SELECT",p=!1;if(xi(()=>{var u=e(...a.map(n)),y=Qg(t,l,u,o,r);p&&f&&"value"in u&&Yl(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===ep&&(!l||x!==l[w])&&(d[w]&&$i(d[w]),d[w]=pi(()=>us(t,()=>x))),y[w]=x}l=y}),f){var g=t;so(()=>{Yl(g,l.value),Bp(g)})}p=!0}function Gg(t){return t.__attributes??={[Wg]:t.nodeName.includes("-"),[Kg]:t.namespaceURI===Pv}}var Ug=new Map;function jg(t){var e=Ug.get(t.nodeName);if(e)return e;Ug.set(t.nodeName,e=[]);for(var i,o=t,r=Element.prototype;r!==o;){i=gc(o);for(var s in i)i[s].set&&e.push(s);o=Fs(o)}return e}function c_(t,e,i){ke&&(e==="srcset"&&u_(t,i)||Op(t.getAttribute(e)??"",i)||eg(e,t.outerHTML.replace(t.innerHTML,t.innerHTML&&"..."),String(i)))}function Op(t,e){return t===e?!0:new URL(t,document.baseURI).href===new URL(e,document.baseURI).href}function zg(t){return t.split(",").map(e=>e.trim().split(" ").filter(Boolean))}function u_(t,e){var i=zg(t.srcset),o=zg(e);return o.length===i.length&&o.every(([r,s],a)=>s===i[a][1]&&(Op(i[a][0],r)||Op(r,i[a][0])))}var p_=vc?()=>performance.now():()=>Date.now(),Pr={tick:t=>(vc?requestAnimationFrame:ne)(t),now:()=>p_(),tasks:new Set};function Yg(){let t=Pr.now();Pr.tasks.forEach(e=>{e.c(t)||(Pr.tasks.delete(e),e.f())}),Pr.tasks.size!==0&&Pr.tick(Yg)}function Zg(t){let e;return Pr.tasks.size===0&&Pr.tick(Yg),{promise:new Promise(i=>{Pr.tasks.add(e={c:t,f:i})}),abort(){Pr.tasks.delete(e)}}}function Dc(t,e){Kl(()=>{t.dispatchEvent(new CustomEvent(e))})}function g_(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=g_(r.trim());e[a]=s.trim()}return e}var h_=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=St,A=mt;bi(null),Fi(null);try{return f??=i()(e,o?.()??{},{direction:d})}finally{bi(L),Fi(A)}}var w={is_global:l,in(){if(e.inert=p,!r){y?.abort(),y?.reset?.();return}s||u?.abort(),Dc(e,"introstart"),u=Dp(e,x(),y,1,()=>{Dc(e,"introend"),u?.abort(),u=f=void 0,e.style.overflow=g})},out(L){if(!s){L?.(),f=void 0;return}e.inert=!0,Dc(e,"outrostart"),y=Dp(e,x(),u,0,()=>{Dc(e,"outroend"),L?.()})},stop:()=>{u?.abort(),y?.abort()}},S=mt;if((S.transitions??=[]).push(w),r&&ql){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&&so(()=>{$t(()=>w.in())})}}function Dp(t,e,i,o,r){var s=o===1;if(xs(e)){var a,l=!1;return Xo(()=>{if(!l){var S=e({direction:s?"in":"out"});a=Dp(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=h_}=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&&Zg(()=>{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 Fp=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 __=new Fp({box:"border-box"});function Gn(t,e,i){var o=__.observe(t,()=>i(t[e]));so(()=>($t(()=>i(t[e])),o))}function Jg(t,e){return t===e||t?.[vo]===e}function it(t={},e,i,o){return so(()=>{var r,s;return bo(()=>{r=s,s=o?.()||[],$t(()=>{t!==i(...s)&&(e(t,...s),r&&Jg(i(...r),t)&&e(null,...r))})}),()=>{Xo(()=>{s&&Jg(i(...s),t)&&e(null,...s)})}}),t}function Ar(t=!1){let e=Rt,i=e.l.u;if(!i)return;let o=()=>Rc(e.s);if(t){let r=0,s={},a=Tr(()=>{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&&Dl(()=>{eh(e,o),ws(i.b)}),De(()=>{let r=$t(()=>i.m.map(Vv));return()=>{for(let s of r)typeof s=="function"&&s()}}),i.a.length&&De(()=>{eh(e,o),ws(i.a)})}function eh(t,e){if(t.l.s)for(let i of t.l.s)n(i);e()}function Zl(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 Ja=[];function cr(t,e){return{subscribe:ie(t,e).subscribe}}function ie(t,e=ne){let i=null,o=new Set;function r(l){if(Ra(t,l)&&(t=l,i)){let d=!Ja.length;for(let f of o)f[1](),Ja.push(f,t);if(d){for(let f=0;f<Ja.length;f+=2)Ja[f][0](Ja[f+1]);Ja.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 ti(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 cr(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)=>Zl(x,S=>{f[w]=S,p&=~(1<<w),d&&u()},()=>{p|=1<<w}));return d=!0,u(),function(){ws(y),g(),d=!1}})}function ve(t){let e;return Zl(t,i=>e=i)(),e}var Fc=!1,Up=Symbol();function $(t,e,i){let o=i[e]??={store:null,source:jr(void 0),unsubscribe:ne};if(o.store!==t&&!(Up 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=Zl(t,s=>{r?o.source.v=s:V(o.source,s)}),r=!1}return t&&Up in i?ve(t):n(o.source)}function Ve(){let t={};function e(){go(()=>{for(var i in t)t[i].unsubscribe();Hi(t,Up,{enumerable:!1,value:!0})})}return[t,e]}function zp(t){var e=Fc;try{return Fc=!1,[t(),Fc]}finally{Fc=e}}var C_={get(t,e){if(!t.exclude.includes(e))return t.props[e]},set(t,e){return ke&&Kv(`${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},C_)}var T_={get(t,e){let i=t.props.length;for(;i--;){let o=t.props[i];if(xs(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];xs(r)&&(r=r());let s=Lo(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(xs(o)&&(o=o()),typeof o=="object"&&o!==null&&e in o){let r=Lo(o,e);return r&&!r.configurable&&(r.configurable=!0),r}}},has(t,e){if(e===vo||e===La)return!1;for(let i of t.props)if(xs(i)&&(i=i()),i!=null&&e in i)return!0;return!1},ownKeys(t){let e=[];for(let i of t.props)if(xs(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 ps(...t){return new Proxy({props:t},T_)}function th(t){return t.ctx?.d??!1}function m(t,e,i,o){var r=(i&1)!==0,s=!qr||(i&2)!==0,a=(i&8)!==0,l=(i&16)!==0,d=!1,f;a?[f,d]=zp(()=>t[e]):f=t[e];var p=vo in t||La in t,g=a&&(Lo(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&&Wv(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?Tr:kr)(()=>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=jr(f),O=Tr(()=>{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=Na),function(G,D){if(Lc!==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),th(O))return G;$t(()=>n(O))}return G}return th(O)?O.v:n(O)}}var k_;typeof HTMLElement=="function"&&(k_=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=I_(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]=Wp(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=Vg({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:i,$$host:this}}),this.$$me=Ec(()=>{bo(()=>{this.$$r=!0;for(let r of tp(this.$$c)){if(!this.$$p_d[r]?.reflect)continue;this.$$d[r]=this.$$c[r];let s=Wp(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]=Wp(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 tp(this.$$p_d).find(e=>this.$$p_d[e].attribute===t||!this.$$p_d[e].attribute&&e.toLowerCase()===t)||t}});function Wp(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 I_(t){let e={};return t.childNodes.forEach(i=>{e[i.slot||"default"]=!0}),e}var ih="5";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add(ih);var bl=require("@vkontakte/videoplayer-core"),GG=require("@vkontakte/videoplayer-core"),Aa=require("@vkontakte/videoplayer-shared"),t0=require("@vkontakte/videoplayer-statistics");var ta=require("@vkontakte/videoplayer-shared");var E_={isMobile:void 0,disableInvisibleComponentsTimeout:500,debugLog:!1,devNullLog:!1,defaultLanguage:ta.InterfaceLanguage.RU,downloadVKLanguages:!0,updateBuiltinLanguages:!0,isSmoothVideoRotate:!0,showSupport:!0,supportLink:"https://vk.com/support?act=new&from=v",showLogo:void 0,logoLink:"https://vk.com/video",logoType:"vk_video",volumeDefault:1,volumeMinRestore:.05,loaderDelay:500,minSubtitlesFontSize:13,autoSubtitlesTimeout:2e3,allowChangingFullscreenTarget:!0,trafficSavingLimit:ta.VideoQuality.Q_480P,highQualityLimit:ta.VideoQuality.Q_720P,episodeMinWidthPc:8,hideThumbTimerAfterTouch:!0,preventPauseOnVideoClick:!1,sentry:{dsn:"https://e349fd23c68f405388980d0868d0ff27@sentry.mvk.com/126",sampleRate:.01,whiteErrorCategoryList:[],blackErrorCategoryList:[],whiteErrorIdList:[],blackErrorIdList:[]},features:{autoplay:!0,statistics:!0,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"},oh=t=>(0,ta.fillWithDefault)(t,E_),nh=t=>Da("ui-config",t),It=()=>Oa("ui-config");var Xl="vk_player_debug_panel_opened";var rh="videoplayer",sh="videoplayer";var Xr={KeyF:"f",KeyK:"k",KeyC:"c",KeyM:"m"},ah=new Set(["ArrowLeft","ArrowRight","KeyL","KeyJ"]),lh=new Set(["Tab","Space","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"]),dh=new Set(["ShiftRight","ShiftLeft"]);var ch=["TIMELINE"],Jl=[...ch,"GRAPH_BUTTON"],Kp=[...ch,"PLAY_BUTTON"],ed=[...Jl,"PLAY_BUTTON"];var Mr=(s=>(s.XS="xs",s.S="s",s.M="m",s.L="l",s.XL="xl",s))(Mr||{}),oa={xs:0,s:1,m:2,l:3,xl:4};var td=require("@vkontakte/videoplayer-shared"),uh=require("@vkontakte/videoplayer-core"),ph=require("@vkontakte/videoplayer-statistics");var Uc="prod",na="1.1.72";var ra=(t,e,i)=>{let o=document.createElement("a");o.href=t,o.download=`${e}.${i}`,o.style.display="none",o.click()};var fh=Symbol("storeContext"),mh=Symbol("microStoresContext"),vh=(t,e)=>{Da(fh,t),Da(mh,e),Uc==="dev"&&(window.app={store:t,microStores:e})},Se=()=>{let t=Oa(fh);return(0,td.assertNonNullable)(t,"Store context is empty!"),t},Yi=()=>{let t=Oa(mh);return(0,td.assertNonNullable)(t,"MicroStores context is empty!"),t},Kt=(t,e)=>Wc(t,t.getValue(),e),Wc=(t,e,i)=>cr(e,o=>{let r=t.subscribe(s=>{o(s),i?.(s)});return()=>r.unsubscribe()}),gh=(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=`${na} (core: ${uh.VERSION}, stat: ${ph.VERSION}, shared: ${td.VERSION})`,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.`},Hh=B_;var fs=new Map;fs.set(el.Interf
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 hv(t,e){F(e,!0),W(t,vx);let[i,o]=Ve(),r=()=>$(zt,"$isLive$",i),s=()=>$(yo,"$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,Aa.noop),lt=m(e,"playPrevChapter",7,Aa.noop),K=m(e,"volumeMultiplier",7),Me=m(e,"showAutoplayNext",7),Ue=m(e,"showEndScreen",7,!0),Ze=m(e,"keyboardControls",15,void 0),{subscribers:ut,stores:xt}=d();nh(p());let gt=It(),_t=p().logoLink,Qe=l().ui.debugPanelVisible,Dt=l().ui.playerSize,zt=l().state.isLive$,Bt=l().state.isInteractive&&bl.clientChecker.device.isAndroid,$e=Q(void 0),Ht=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}),vh(l(),xt),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(gt.features.qualityDetailsSubMenuEnabled){let H=Nh(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{Bh(l().videoId),of()&&l().actions.internal.setTrafficSavingEnabled(!0);let Ge=Xp(l().videoId);Ge&&l().actions.internal.setQuality(Ge)}};function Pe(H){let Ge=a()||H;Ge&&l().initVideo({container:n($e),sources:Ge,failoverHosts:te(),subtitles:w(),volumeMultiplier:K()});let pt=Aa.safeStorage.get(Xl)==="true";Qe.set(pt),I()>0&&l().actions.external.seekTime(I());let jt=he()?gt.volumeDefault:L()??Kc()??gt.volumeDefault,Lt=A()??Ph();if(l().actions.external.setVolume(jt),l().actions.external.setMuted(Lt),l().getAdmanWrapper().setInitialVolume(Lt?0:jt),Z(),gt.features.saveRate&&Oe()){let Gt=Lh();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()&&gt.features.preload&&l().actions.internal.preload()}let Ye=H=>{if(window.ResizeObserver){let Ge,pt;Ht=new ResizeObserver((0,Aa.throttleFn)(jt=>{let Lt=jt[0];if(Lt.contentBoxSize){let Gt=Array.isArray(Lt.contentBoxSize)?Lt.contentBoxSize[0]:Lt.contentBoxSize;Ge=Gt.inlineSize,pt=Gt.blockSize}else Lt.contentRect&&(Ge=Lt.contentRect.width,pt=Lt.contentRect.height);Dt.set({width:Ge,height:pt})},300)),Ht.observe(H)}Dt.set({width:H.clientWidth,height:H.clientHeight})},Je=()=>{document.hidden&&l().actions.external.stop()};At(()=>{Bt&&document.addEventListener("visibilitychange",Je),gt.debugLog&&l().actions.internal.startLogging(),Ye(n($e));let H=ut.map(pt=>pt.init({store:l(),microStores:xt,config:f(),interactiveController:x(),uiConfig:p()})),Ge=()=>{Bt&&document.removeEventListener("visibilitychange",Je),Ht?.disconnect(),H.forEach(pt=>pt.unsubscribe()),l().destroy()};return S()?.status==="upcoming"?(l().actions.internal.setLiveWaitingStart(!0),Ge):S()?.status==="waiting"?(l().actions.internal.setLiveWaitingRecover(!0),Ge):(S()?.status==="finished"||S()?.status==="postlive")&&!(a()&&(0,bl.areValidLiveRecordSources)(a()))?(l().actions.internal.setLiveWaitingRecord(!0),Ge):(Pe(),Ge)});function He(){n(ye)?l().actions.external.play():pe(!0)}function Le(){l().actions.external.pause()}function ot(H){l().actions.external.setMuted(H)}function rt(){l().actions.external.toggleSubtitle()}function tt(H,Ge){l().actions.external.changeSubtitle(H,Ge)}function Et(){l().webApi.slotsApi?.haveSlots()&&l().actions.external.hideControls()}function wi(){l().webApi.slotsApi?.haveSlots()&&l().actions.external.showControls()}function zi(H){he()||H>=0&&H<=1&&l().actions.external.setVolume(H)}function Mi(H){l().actions.internal.seekTime(H,t0.SeekAction.UNKNOWN)}function on(H){l().actions.external.seekEpisodeStartTime(H)}function $o(){l().actions.external.returnFocusToEpisodes()}function nn(H){l().actions.external.setPlaybackRate(H)}function rn(H){l().actions.external.setAutoQualityLimits(H)}function Oo(){l().actions.external.setQuality("auto")}function Ft(H){l().actions.external.setTrafficSavingEnabled(H)}function Zi(H){l().actions.external.setHighQualityEnabled(H)}let Tn=Au(gt.view),sn=f().playerView==="preview",yo=l().state.availableSubtitlesList$;if(gt.features.initSubtitles){let H=!1;De(()=>{if(!H&&s().length){H=!0;let Ge;if(gt.features.userVideoPrefs&&l().videoId){let jt=jc(gt.userSalt,String(l().videoId));jt?.subtitleTrackId&&(Ge=s().find(Lt=>Lt.value===jt.subtitleTrackId))}let pt=rf();pt&&(Ge??(Ge=s().find(jt=>jt.language===pt))),l().actions.internal.setSubtitle(Ge)}})}var Xi=mx();let an;var xo=_(Xi);{var Si=H=>{vv(H,{get store(){return l()},get uiConfig(){return gt},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 _t},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 lt()},firstStart:pe,seekTime:Mi,get showEndScreen(){return Ue()},get showAutoplayNext(){return Me()},get showNextPrevButtons(){return _e()},get videoContainer(){return n($e)},set videoContainer(Ge){V($e,Ge,!0)}})},wo=H=>{var Ge=Be(),pt=ce(Ge);{var jt=Gt=>{gv(Gt,{get thumbUrl(){return u()},get outsideDuration(){return j()},get canRewindLive(){return O()},get videoContainer(){return n($e)},set videoContainer(mi){V($e,mi,!0)}})},Lt=Gt=>{fv(Gt,{get store(){return l()},get uiConfig(){return gt},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 _t},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 lt()},firstStart:pe,get showEndScreen(){return Ue()},get showAutoplayNext(){return Me()},get showNextPrevButtons(){return _e()},get videoContainer(){return n($e)},set videoContainer(mi){V($e,mi,!0)},get keyboardControls(){return Ze()},set keyboardControls(mi){Ze(mi)}})};M(pt,Gt=>{sn?Gt(jt):Gt(Lt,!1)})}b(H,Ge)};M(xo,H=>{he()?H(Si):H(wo,!1)})}h(Xi),N(H=>{an=J(Xi,1,"root svelte-16kg8zb",null,an,H),nt(Xi,Tn)},[()=>({"root--miui-browser":bl.clientChecker.device.isMobile&&bl.clientChecker.browser.isMiuiBrowser,"visible-outside":sn})]),b(t,Xi);var kn=U({initVideo:Pe,play:He,pause:Le,setMuted:ot,toggleSubtitle:rt,changeSubtitle:tt,hideControls:Et,showControls:wi,setVolume:zi,seekTime:Mi,seekEpisodeStartTime:on,returnFocusToEpisodes:$o,setPlaybackRate:nn,setAutoQualityLimits:rn,setAutoQuality:Oo,toggleTrafficSaving:Ft,toggleHighQuality:Zi,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 lt()},set playPrevChapter(H){lt(H)},get volumeMultiplier(){return K()},set volumeMultiplier(H){K(H)},get showEndScreen(){return Ue()},set showEndScreen(H){Ue(H)},get keyboardControls(){return Ze()},set keyboardControls(H){Ze(H)}});return o(),kn}var gx=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 _v(t,e){let i=Ae(e,["$$slots","$$events","$$legacy","children"]);var o=gx();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 bv(t,e){let i=m(e,"isWhite",3,!1),o=v(()=>i()?"color: #fff;":"color: #909499;");_v(t,{get style(){return n(o)}})}var hx=P('<div class="title svelte-1y9fytq"> </div>'),_x=P('<div class="playerStub svelte-1y9fytq"><!> <!></div>'),bx={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 $v(t,e){W(t,bx);var i=_x(),o=_(i);{var r=l=>{var d=hx(),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);bv(l,{get isWhite(){return n(d)}})};M(s,l=>{(!e.title||!e.thumbUrl)&&l(a)})}h(i),N(()=>nt(i,e.thumbUrl?`background-image: url('${e.thumbUrl}')`:"")),b(t,i)}var $x=P('<div class="playerError svelte-m5iv29"><!></div>'),yx={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 yv(t){W(t,yx);var e=$x(),i=_(e);Ca(i,{}),h(e),b(t,e)}var Uu=require("@vkontakte/videoplayer-shared"),fi=require("@vkontakte/videoplayer-shared"),tc=require("@vkontakte/videoplayer-core"),Sl=require("@vkontakte/videoplayer-statistics");var Lu=require("@vkontakte/videoplayer-shared"),Mu=class{constructor(){this.subscription=new Lu.Subscription,this.logger=new Lu.Logger,this.log=this.logger.createComponentLog("MediaSessionApi")}isSupported(){return"mediaSession"in navigator}setMetaData({title:e,artist:i="",thumbUrl:o=""}){this.isSupported()&&(navigator.mediaSession.metadata=new MediaMetadata({title:e,artist:i,artwork:[{src:o,sizes:"96x96",type:"image/png"},{src:o,sizes:"128x128",type:"image/png"},{src:o,sizes:"192x192",type:"image/png"},{src:o,sizes:"256x256",type:"image/png"},{src:o,sizes:"384x384",type:"image/png"},{src:o,sizes:"512x512",type:"image/png"}]}))}updateActionHandlers(e){this.resetActionHandlers(),this.setActionHandlers(e)}resetActionHandlers(){let e=[["play",null],["pause",null],["stop",null],["nexttrack",null],["previoustrack",null],["seekto",null],["seekbackward",null],["seekforward",null]];this.setActionHandlers(e)}setActionHandlers(e){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()}};var $l=require("@vkontakte/videoplayer-shared");var xx=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 xv(t,e){let i=Ae(e,["$$slots","$$events","$$legacy","children"]);var o=xx();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 wx=P('<div><div><!></div> <span class="title svelte-1pbsod4"> </span></div>'),Sx={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 wv(t,e){F(e,!0),W(t,Sx);let[i,o]=Ve(),r=()=>$(f,"$interfaceLanguage$",i),s=()=>$(p,"$isMobile$",i),a=Se(),l=It(),d=!!a.webApi.pictureInPictureApi,f=a.interfaceLanguage$,p=a.ui.isMobile,g=a.ui.t,u=v(()=>r()&&g("pip_dummy_title")),y=Au(l.view);var x=wx();let w;var S=_(x);let T;var k=_(S);xv(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),nt(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 Cx=460,Tx=280,qd=class{playerDomElement;playerParentShadowRoot;playerDummyElement;svelteContext;pipWindow;info={isActive$:new $l.ValueSubject(!1),isEnabled$:new $l.ValueSubject(!1),type:1};constructor({enabled:e=!0}={enabled:!0}){this.info.isEnabled$=new $l.ValueSubject(e)}isSupported(){let{isEmbed:e}=(0,$l.detectEmbed)();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:Cx,height:Tx,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=Zr(wv,s),this.pipWindow?.document.body.append(o),this.info.isActive$.next(!0),this.pipWindow?.addEventListener("unload",a=>{!this.playerDomElement||!this.playerParentShadowRoot||!this.playerDummyElement||(Xs(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 i0(t){return t instanceof qd}var Vu=class{static getLatestSupportedVersion(e){let i=new la(e),o=new qd(e);if(o.isSupported())return o;if(i.isSupported())return i}};function Qd(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 o0="Inner error. Unexpectedly root annotation container null reference exception",n0="Annotation with such name already exists",r0="Annotation with such name does not exist";var yl=class extends Error{constructor(e){super(e),this.name="AnnotationError"}};var xl=require("@vkontakte/videoplayer-shared"),kx="1",Ix=100,Ru=class{constructor(e){this.annotationsInside=e;this.annotations=new Map;this.subscriptions=new xl.Subscription}init(e){if(this.rootAnnotationsContainer=e,this.annotationsInside)return;let i=(0,xl.throttleFn)(()=>{for(let o of this.annotations.values())this.isElementExceedsBoundaries(o,this.playerSize.width,this.playerSize.height)?o.style.visibility="hidden":o.style.visibility="visible"},Ix);this.subscriptions.add((0,xl.observeElementSize)(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 yl(o0);if(this.annotations.has(e))throw new yl(n0);i.style.zIndex=i.style.zIndex??kx,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 yl(r0);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(){}};var Ma=require("@vkontakte/videoplayer-shared"),Bo=class{init({store:e,microStores:i,interactiveController:o,config:r}){return(0,Ma.assertNonNullable)(e),(0,Ma.assertNonNullable)(i),(0,Ma.assertNonNullable)(r),r.interactiveData&&(0,Ma.assertNonNullable)(o),this.subscription=new Ma.Subscription,this.subscription}};var Gd=class extends Bo{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 jd=class extends Bo{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 Yd=class extends Bo{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}};var s0=require("@vkontakte/videoplayer-shared"),Sv=ie(!1),Nu=null,Zd=class extends Bo{constructor(){super(...arguments);this.stateName="showInteractiveTimeIndicatorTooltip$";this.state$={...Sv,set:(i,o=!1)=>{i!==ve(Sv)&&(this.clearTimeout(),Sv.set(i),!i&&Nu&&(Nu=!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((0,s0.combine)({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&&Nu===null&&(Nu=!0,p.tooltipHelpHintActive=!1,this.state$.set(!0),r.callbacks?.onInteractiveTimeIndicatorHintDeactivated?.())}})),o}clearTimeout(){window.clearTimeout(this.timeout)}};var Bu=require("@vkontakte/videoplayer-shared");var Xd=class extends Bo{constructor(){super(...arguments);this.stateName="graphIsOpened$";this.graphMadePause=!1;this.state$={...ie(null),toggle:Bu.noop};this.checkIfShouldHide=i=>Vs(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(Kp),!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(Kp),!u&&this.graphMadePause&&r.actions.internal.pause()}catch{l({message:"Cant show graph"})}}},o.add((0,Bu.combine)({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}};var Cv=require("@vkontakte/videoplayer-shared"),Jd=class extends Bo{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 Cv.ValueSubject(!1),isEnabled$:new Cv.ValueSubject(!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}};var Du=require("@vkontakte/videoplayer-shared");var Ou=require("@vkontakte/videoplayer-shared"),a0=({maxShowCount:t,timeout:e})=>{let i=[t!==0?Ex({maxCount:t}):void 0,e!==0?Px({timeout:e}):void 0].filter(o=>!!o);return{notificationShowed:o=>i.forEach(r=>r.notificationShowed(o)),canShowNotification:o=>i.every(r=>r.canShowNotification(o))}},Ex=({maxCount:t})=>{let e={};return{notificationShowed:i=>{e[i]=(e[i]??0)+1,Ou.safeStorage.set("videoplayer_notifications_manager_count",JSON.stringify(e[i]??0))},canShowNotification:i=>(e[i]??0)<t}},Px=({timeout:t})=>{let e="videoplayer_notifications_manager",i=()=>{try{return JSON.parse(Ou.safeStorage.get(e)||"{}")}catch{return{}}},o=s=>Ou.safeStorage.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 ec=class extends Bo{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=a0({maxShowCount:s,timeout:a});let f=r.getPlayer();return o.add(f.events.severeStallOccured$.pipe((0,Du.filterChanged)(),(0,Du.filter)(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 l0=()=>[Gd,jd,Yd,Zd,Xd,Jd,ec].reduce(({subscribers:t,stores:e},i)=>{let o=new i;return{subscribers:[...t,o],stores:{...e,[o.stateName]:o.state$}}},{subscribers:[],stores:{}});var wl=require("@vkontakte/videoplayer-shared");var Hu=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 Ax={preload:!0,autoplay:!1,repeat:!1,fromTime:0,canRewindLive:!0,showAds:!1,interfaceLanguage:fi.InterfaceLanguage.RU,isCyrillicRelatedInterface:!0,logoClickable:!1,logoHidden:!1,isTouch:(0,tc.isMobile)(),isMediaSessionEnabled:!0,isPictureInPictureEnabled:!0,isAudioDisabled:!1,callbacks:{uiInfo:{}},tuningConfig:{configName:[]},saveRate:!0,volumeMultiplier:1,showEndScreen:!0,showAutoplayNext:!0,showNextPrevButtons:!0},Cn=Q(void 0),Fu=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 Uu.ValueSubject(null);constructor(){super(),wl.devNull.create("ui"),this.logger=new fi.Logger,this.log=this.logger.createComponentLog("VKVideoPlayer"),this.subscription=new fi.Subscription,this.interactiveSubscription=new fi.Subscription,this.graphMadePause=!1,this.fatalError$.subscribe(e=>{this.unmountComponent(this.svelteErrorComponent),e&&(this.unmountComponent(this.svelteStubComponent),this.unmountComponent(this.svelteRootComponent),this.svelteErrorComponent=Zr(yv,{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=Zr($v,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(),wl.devNull.destroy("ui"))}initPlayerRootContainers(){this.rootContainer=document.createElement("div"),this.rootContainer.style.position="relative",this.rootContainer.className="root-container",this.rootContainer.style.width="100%",this.rootContainer.style.height="100%",this.rootContainer.style.minHeight="206px",this.shadowRootContainer=document.createElement("div"),this.shadowRootContainer.style.position="absolute",this.shadowRootContainer.className="shadow-root-container",this.shadowRootContainer.style.width="100%",this.shadowRootContainer.style.height="100%",this._shadowRoot=this.shadowRootContainer.attachShadow({mode:"open"}),this.playerContainer=document.createElement("div"),this.playerContainer.style.all="initial",this.playerContainer.style.display="block",this.playerContainer.style.contain="strict",this.playerContainer.style.width="100%",this.playerContainer.style.height="100%",this._shadowRoot.append(this.playerContainer),this.rootContainer.append(this.shadowRootContainer),this.append(this.rootContainer)}needToShowNextPrevButtons(){return this.videoConfig?this.videoConfig.videos.length>1&&this.videoConfig.showNextPrevButtons:!1}isNextButtonActive(){return this.videoConfig?this.needToShowNextPrevButtons()&&(this.currentPlayingVideoIndex<this.videoConfig.videos.length-1||this.needToRepeatPlaylist):!1}isPrevButtonActive(){return this.videoConfig?this.needToShowNextPrevButtons()&&(this.currentPlayingVideoIndex>0||this.needToRepeatPlaylist):!1}isControlDisabled(e){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}=Qd(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 Sl.OneStat({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}=Qd(this.videoConfig,i),{unitedVideoId:a}=e;if(this.uiConfig.features.thinStatistics&&a)return new Sl.ThinOneStat.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}=Qd(this.videoConfig,i),{sources:te,title:be,thumbUrl:Oe,unitedVideoId:le,isClip:lt=!1,duration:K,adsParams:Me={},videoEpisodes:Ue,previewThumbsData:Ze,subtitles:ut,live:xt}=e;if(!te&&!xt){let He=new Error("empty sources and live");this.fatalError$.next(He),Y.onCrashed?.(He.message);return}let gt={...S,...Me},_t=this.getNextVideoInfo(),Qe={sources:te,title:be,thumbUrl:Oe,subtitles:ut,unitedVideoId:le,isClip:lt,live:xt,albumId:r,statPlace:s,autoplay:d,muted:p,volume:f,fromTime:g,canRewindLive:u,showAds:x,adsSlotId:w,adsParams:gt,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:_t.nextVideoTitle,endScreenVideoThumb:_t.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist()},Dt={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(),Xe=zt?.oneStat||this.createOneStat(e,i),Bt=this.createThinOneStat(e,i),$e;de&&($e=new Sl.MediascopePixel({pixels:de})),(Xe||Bt)&&(this.statistics=new hu(Xe,Bt,$e,zt?.statSubscription)),this.uiConfig.features.sentry&&this.uiConfig.sentry.dsn&&new aa(this.uiConfig.sentry,{version:na,env:Uc},{movieId:le,albumId:r,place:s,autoplay:(d&&!this.interactiveController)??!1,mobile:D??G,clip:lt}),this.interactiveController&&(this.prevIsid??=this.statistics?.oneStat?.isid$.getValue()),this.sentry={...this.sentry,...aa.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=C1({player:o,interfaceLanguage:L,isCyrillicRelatedInterface:A,videoId:le,isClip:lt,isLiveCatchUpMode:X,isAudioDisabled:ee,statAuthToken:a,callbacks:Y,webApi:Dt,videoEpisodes:Ue,previewThumbsData:Ze,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:Ye}=this.microStoresRoot=l0(),Je=()=>{if(!this.store||!this.microStoresRoot||!this.videoConfig)return;this.subscription.add(this.store.state.currentFormat$.subscribe(Le=>Y?.onCurrentFormatChanged?.(Le))),this.subscription.add(Ye.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 fi.Observable(Le=>{this.store&&this.subscription.add(this.store.state.currentPlaybackRate$.subscribe(ot=>Le.next(ot)))}).pipe((0,fi.skip)(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 ot=(this.store?.state.volume$&&ve(this.store.state.volume$))??0;Y?.onUnmute?.(ot)}})),this.subscription.add(this.store.state.videoBitrate$.subscribe(Le=>Y?.onVideoBitrateChanged?.(Le))),this.subscription.add(this.store.state.isInteractiveTime$.subscribe(Le=>{let ot=this.store?.ui.controls.disabledControls$;ot&&(Le&&!ot.includes(Jl)&&ot.add(Jl),Le||ot.remove(Jl))})),this.subscription.add(this.store.ui.isFullscreen.subscribe(async Le=>{if(!tc.clientChecker.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(Cn,{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:ut,live:xt,preload:l,autoplay:d,muted:p,volume:f,fromTime:g,canRewindLive:u,supportLink:y,showAds:x,adsSlotId:w,adsParams:gt,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:_t.nextVideoTitle,endScreenVideoThumb:_t.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist(),playPrevChapter:()=>this.playPrevChapter(),seekToInteractive:()=>this.seekToInteractive(),volumeMultiplier:R,showEndScreen:Ee,showAutoplayNext:Ce},!0);let He={target:this.playerContainer,props:n(Cn)};this.svelteRootComponent=Zr(hv,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?wl.devNull.subscribe("ui",this.videoConfig.callbacks.onDevNullLog):wl.devNull.destroy("ui")};this.coreConfig.asyncResolveClientChecker?tc.clientChecker.isInited$.subscribe(He=>{He&&(console.log("UI SDK async start"),Je())}):Je()}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&&(0,fi.isNonNullable)(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(ed)),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(ed)})),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=Qd(Ax,(0,fi.cloneDeepWith)(e,o=>o instanceof HTMLElement?o:void 0)),this.playerId=(0,fi.getPlayerId)(e.playerId),this.uiConfig=oh(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 fi.InternalsExposure("ui",this.playerId)),wl.devNull.push("ui",{key:"videoplayer_embed",strings:["new","player_init_player","ads.enable: "+this.uiConfig.ads.enable,"showAds: "+this.videoConfig?.showAds],numbers:[(0,Uu.now)()]}),(0,fi.isNonNullable)(this.videoConfig.isMediaSessionEnabled)&&(this.uiConfig.features.mediaSession=this.uiConfig.features.mediaSession??this.videoConfig.isMediaSessionEnabled??!0),(0,fi.isNonNullable)(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 la(o)}this.mediaSessionApi=this.uiConfig.features.mediaSession?new Mu:void 0,this.slotsApi=this.uiConfig.features.slots?new Iu:void 0,this.annotationsApi=this.uiConfig.features.annotations?new Ru(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]),i0(this.pictureInPictureApi)&&this.pictureInPictureApi.setPlayerDomElement(this.playerContainer,this._shadowRoot),this.slotsApi?.init(this.shadowRootContainer,this.store),this.focusManager=this._shadowRoot?new Hu(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(Cn)&&(n(Cn).showNextPrevButtons=this.needToShowNextPrevButtons(),n(Cn).nextButtonActive=this.isNextButtonActive(),n(Cn).prevButtonActive=this.isPrevButtonActive(),n(Cn).endScreenVideoTitle=o.nextVideoTitle,n(Cn).endScreenVideoThumb=o.nextVideoThumb,n(Cn).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(Cn)&&(n(Cn).needToRepeatPlaylist=this.needToRepeatPlaylist,n(Cn).showNextPrevButtons=this.needToShowNextPrevButtons(),n(Cn).nextButtonActive=this.isNextButtonActive(),n(Cn).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((0,fi.once)()).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&&Xs(e)}};var Cl=require("@vkontakte/videoplayer-shared"),zu=require("@vkontakte/videoplayer-core"),Mx=()=>{window.customElements.define("vk-video-player",Fu)};
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=Zr(wv,s),this.pipWindow?.document.body.append(o),this.info.isActive$.next(!0),this.pipWindow?.addEventListener("unload",a=>{!this.playerDomElement||!this.playerParentShadowRoot||!this.playerDummyElement||(Xs(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 i0(t){return t instanceof qd}var Vu=class{static getLatestSupportedVersion(e){let i=new la(e),o=new qd(e);if(o.isSupported())return o;if(i.isSupported())return i}};function Qd(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 o0="Inner error. Unexpectedly root annotation container null reference exception",n0="Annotation with such name already exists",r0="Annotation with such name does not exist";var yl=class extends Error{constructor(e){super(e),this.name="AnnotationError"}};var xl=require("@vkontakte/videoplayer-shared"),kx="1",Ix=100,Ru=class{constructor(e){this.annotationsInside=e;this.annotations=new Map;this.subscriptions=new xl.Subscription}init(e){if(this.rootAnnotationsContainer=e,this.annotationsInside)return;let i=(0,xl.throttleFn)(()=>{for(let o of this.annotations.values())this.isElementExceedsBoundaries(o,this.playerSize.width,this.playerSize.height)?o.style.visibility="hidden":o.style.visibility="visible"},Ix);this.subscriptions.add((0,xl.observeElementSize)(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 yl(o0);if(this.annotations.has(e))throw new yl(n0);i.style.zIndex=i.style.zIndex??kx,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 yl(r0);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(){}};var Ma=require("@vkontakte/videoplayer-shared"),Bo=class{init({store:e,microStores:i,interactiveController:o,config:r}){return(0,Ma.assertNonNullable)(e),(0,Ma.assertNonNullable)(i),(0,Ma.assertNonNullable)(r),r.interactiveData&&(0,Ma.assertNonNullable)(o),this.subscription=new Ma.Subscription,this.subscription}};var Gd=class extends Bo{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 jd=class extends Bo{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 Yd=class extends Bo{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}};var s0=require("@vkontakte/videoplayer-shared"),Sv=ie(!1),Nu=null,Zd=class extends Bo{constructor(){super(...arguments);this.stateName="showInteractiveTimeIndicatorTooltip$";this.state$={...Sv,set:(i,o=!1)=>{i!==ve(Sv)&&(this.clearTimeout(),Sv.set(i),!i&&Nu&&(Nu=!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((0,s0.combine)({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&&Nu===null&&(Nu=!0,p.tooltipHelpHintActive=!1,this.state$.set(!0),r.callbacks?.onInteractiveTimeIndicatorHintDeactivated?.())}})),o}clearTimeout(){window.clearTimeout(this.timeout)}};var Bu=require("@vkontakte/videoplayer-shared");var Xd=class extends Bo{constructor(){super(...arguments);this.stateName="graphIsOpened$";this.graphMadePause=!1;this.state$={...ie(null),toggle:Bu.noop};this.checkIfShouldHide=i=>Vs(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(Kp),!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(Kp),!u&&this.graphMadePause&&r.actions.internal.pause()}catch{l({message:"Cant show graph"})}}},o.add((0,Bu.combine)({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}};var Cv=require("@vkontakte/videoplayer-shared"),Jd=class extends Bo{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 Cv.ValueSubject(!1),isEnabled$:new Cv.ValueSubject(!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}};var Du=require("@vkontakte/videoplayer-shared");var Ou=require("@vkontakte/videoplayer-shared"),a0=({maxShowCount:t,timeout:e})=>{let i=[t!==0?Ex({maxCount:t}):void 0,e!==0?Px({timeout:e}):void 0].filter(o=>!!o);return{notificationShowed:o=>i.forEach(r=>r.notificationShowed(o)),canShowNotification:o=>i.every(r=>r.canShowNotification(o))}},Ex=({maxCount:t})=>{let e={};return{notificationShowed:i=>{e[i]=(e[i]??0)+1,Ou.safeStorage.set("videoplayer_notifications_manager_count",JSON.stringify(e[i]??0))},canShowNotification:i=>(e[i]??0)<t}},Px=({timeout:t})=>{let e="videoplayer_notifications_manager",i=()=>{try{return JSON.parse(Ou.safeStorage.get(e)||"{}")}catch{return{}}},o=s=>Ou.safeStorage.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 ec=class extends Bo{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=a0({maxShowCount:s,timeout:a});let f=r.getPlayer();return o.add(f.events.severeStallOccured$.pipe((0,Du.filterChanged)(),(0,Du.filter)(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 l0=()=>[Gd,jd,Yd,Zd,Xd,Jd,ec].reduce(({subscribers:t,stores:e},i)=>{let o=new i;return{subscribers:[...t,o],stores:{...e,[o.stateName]:o.state$}}},{subscribers:[],stores:{}});var wl=require("@vkontakte/videoplayer-shared");var Hu=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 Ax={preload:!0,autoplay:!1,repeat:!1,fromTime:0,canRewindLive:!0,showAds:!1,interfaceLanguage:fi.InterfaceLanguage.RU,isCyrillicRelatedInterface:!0,logoClickable:!1,logoHidden:!1,isTouch:(0,tc.isMobile)(),isMediaSessionEnabled:!0,isPictureInPictureEnabled:!0,isAudioDisabled:!1,callbacks:{uiInfo:{}},tuningConfig:{configName:[]},saveRate:!0,volumeMultiplier:1,showEndScreen:!0,showAutoplayNext:!0,showNextPrevButtons:!0},Cn=Q(void 0),Fu=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 Uu.ValueSubject(null);constructor(){super(),wl.devNull.create("ui"),this.logger=new fi.Logger,this.log=this.logger.createComponentLog("VKVideoPlayer"),this.subscription=new fi.Subscription,this.interactiveSubscription=new fi.Subscription,this.graphMadePause=!1,this.fatalError$.subscribe(e=>{this.unmountComponent(this.svelteErrorComponent),e&&(this.unmountComponent(this.svelteStubComponent),this.unmountComponent(this.svelteRootComponent),this.svelteErrorComponent=Zr(yv,{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=Zr($v,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(),wl.devNull.destroy("ui"))}initPlayerRootContainers(){this.rootContainer=document.createElement("div"),this.rootContainer.style.position="relative",this.rootContainer.className="root-container",this.rootContainer.style.width="100%",this.rootContainer.style.height="100%",this.rootContainer.style.minHeight="206px",this.shadowRootContainer=document.createElement("div"),this.shadowRootContainer.style.position="absolute",this.shadowRootContainer.className="shadow-root-container",this.shadowRootContainer.style.width="100%",this.shadowRootContainer.style.height="100%",this._shadowRoot=this.shadowRootContainer.attachShadow({mode:"open"}),this.playerContainer=document.createElement("div"),this.playerContainer.style.all="initial",this.playerContainer.style.display="block",this.playerContainer.style.contain="strict",this.playerContainer.style.width="100%",this.playerContainer.style.height="100%",this._shadowRoot.append(this.playerContainer),this.rootContainer.append(this.shadowRootContainer),this.append(this.rootContainer)}needToShowNextPrevButtons(){return this.videoConfig?this.videoConfig.videos.length>1&&this.videoConfig.showNextPrevButtons:!1}isNextButtonActive(){return this.videoConfig?this.needToShowNextPrevButtons()&&(this.currentPlayingVideoIndex<this.videoConfig.videos.length-1||this.needToRepeatPlaylist):!1}isPrevButtonActive(){return this.videoConfig?this.needToShowNextPrevButtons()&&(this.currentPlayingVideoIndex>0||this.needToRepeatPlaylist):!1}isControlDisabled(e){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}=Qd(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 Sl.OneStat({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}=Qd(this.videoConfig,i),{unitedVideoId:a}=e;if(this.uiConfig.features.thinStatistics&&a)return new Sl.ThinOneStat.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}=Qd(this.videoConfig,i),{sources:te,title:be,thumbUrl:Oe,unitedVideoId:le,isClip:lt=!1,duration:K,adsParams:Me={},videoEpisodes:Ue,previewThumbsData:Ze,subtitles:ut,live:xt}=e;if(!te&&!xt){let He=new Error("empty sources and live");this.fatalError$.next(He),Y.onCrashed?.(He.message);return}let gt={...S,...Me},_t=this.getNextVideoInfo(),Qe={sources:te,title:be,thumbUrl:Oe,subtitles:ut,unitedVideoId:le,isClip:lt,live:xt,albumId:r,statPlace:s,autoplay:d,muted:p,volume:f,fromTime:g,canRewindLive:u,showAds:x,adsSlotId:w,adsParams:gt,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:_t.nextVideoTitle,endScreenVideoThumb:_t.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist()},Dt={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(),Xe=zt?.oneStat||this.createOneStat(e,i),Bt=this.createThinOneStat(e,i),$e;de&&($e=new Sl.MediascopePixel({pixels:de})),(Xe||Bt)&&(this.statistics=new hu(Xe,Bt,$e,zt?.statSubscription)),this.uiConfig.features.sentry&&this.uiConfig.sentry.dsn&&new aa(this.uiConfig.sentry,{version:na,env:Uc},{movieId:le,albumId:r,place:s,autoplay:(d&&!this.interactiveController)??!1,mobile:D??G,clip:lt}),this.interactiveController&&(this.prevIsid??=this.statistics?.oneStat?.isid$.getValue()),this.sentry={...this.sentry,...aa.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=C1({player:o,interfaceLanguage:L,isCyrillicRelatedInterface:A,videoId:le,isClip:lt,isLiveCatchUpMode:X,isAudioDisabled:ee,statAuthToken:a,callbacks:Y,webApi:Dt,videoEpisodes:Ue,previewThumbsData:Ze,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:Ye}=this.microStoresRoot=l0(),Je=()=>{if(!this.store||!this.microStoresRoot||!this.videoConfig)return;this.subscription.add(this.store.state.currentFormat$.subscribe(Le=>Y?.onCurrentFormatChanged?.(Le))),this.subscription.add(Ye.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 fi.Observable(Le=>{this.store&&this.subscription.add(this.store.state.currentPlaybackRate$.subscribe(ot=>Le.next(ot)))}).pipe((0,fi.skip)(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 ot=(this.store?.state.volume$&&ve(this.store.state.volume$))??0;Y?.onUnmute?.(ot)}})),this.subscription.add(this.store.state.videoBitrate$.subscribe(Le=>Y?.onVideoBitrateChanged?.(Le))),this.subscription.add(this.store.state.isInteractiveTime$.subscribe(Le=>{let ot=this.store?.ui.controls.disabledControls$;ot&&(Le&&!ot.includes(Jl)&&ot.add(Jl),Le||ot.remove(Jl))})),this.subscription.add(this.store.ui.isFullscreen.subscribe(async Le=>{if(!tc.clientChecker.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(Cn,{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:ut,live:xt,preload:l,autoplay:d,muted:p,volume:f,fromTime:g,canRewindLive:u,supportLink:y,showAds:x,adsSlotId:w,adsParams:gt,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:_t.nextVideoTitle,endScreenVideoThumb:_t.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist(),playPrevChapter:()=>this.playPrevChapter(),seekToInteractive:()=>this.seekToInteractive(),volumeMultiplier:R,showEndScreen:Ee,showAutoplayNext:Ce},!0);let He={target:this.playerContainer,props:n(Cn)};this.svelteRootComponent=Zr(hv,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?wl.devNull.subscribe("ui",this.videoConfig.callbacks.onDevNullLog):wl.devNull.destroy("ui")};this.coreConfig.asyncResolveClientChecker?tc.clientChecker.isInited$.subscribe(He=>{He&&(console.log("UI SDK async start"),Je())}):Je()}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&&(0,fi.isNonNullable)(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(ed)),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(ed)})),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=Qd(Ax,(0,fi.cloneDeepWith)(e,o=>o instanceof HTMLElement?o:void 0)),this.playerId=(0,fi.getPlayerId)(e.playerId),this.uiConfig=oh(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 fi.InternalsExposure("ui",this.playerId)),wl.devNull.push("ui",{key:"videoplayer_embed",strings:["new","player_init_player","ads.enable: "+this.uiConfig.ads.enable,"showAds: "+this.videoConfig?.showAds],numbers:[(0,Uu.now)()]}),(0,fi.isNonNullable)(this.videoConfig.isMediaSessionEnabled)&&(this.uiConfig.features.mediaSession=this.uiConfig.features.mediaSession??this.videoConfig.isMediaSessionEnabled??!0),(0,fi.isNonNullable)(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 la(o)}this.mediaSessionApi=this.uiConfig.features.mediaSession?new Mu:void 0,this.slotsApi=this.uiConfig.features.slots?new Iu:void 0,this.annotationsApi=this.uiConfig.features.annotations?new Ru(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]),i0(this.pictureInPictureApi)&&this.pictureInPictureApi.setPlayerDomElement(this.playerContainer,this._shadowRoot),this.slotsApi?.init(this.shadowRootContainer,this.store),this.focusManager=this._shadowRoot?new Hu(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(Cn)&&(n(Cn).showNextPrevButtons=this.needToShowNextPrevButtons(),n(Cn).nextButtonActive=this.isNextButtonActive(),n(Cn).prevButtonActive=this.isPrevButtonActive(),n(Cn).endScreenVideoTitle=o.nextVideoTitle,n(Cn).endScreenVideoThumb=o.nextVideoThumb,n(Cn).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(Cn)&&(n(Cn).needToRepeatPlaylist=this.needToRepeatPlaylist,n(Cn).showNextPrevButtons=this.needToShowNextPrevButtons(),n(Cn).nextButtonActive=this.isNextButtonActive(),n(Cn).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((0,fi.once)()).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&&Xs(e)}};var Cl=require("@vkontakte/videoplayer-shared"),zu=require("@vkontakte/videoplayer-core"),Mx=()=>{window.customElements.define("vk-video-player",Fu)};