@vkontakte/videoplayer 1.1.62-dev.b50ee8d3.0 → 1.1.62-dev.cb3c3ded.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es2015.cjs.js +36 -36
- package/es2015.esm.js +36 -36
- package/es2018.cjs.js +5 -5
- package/es2018.esm.js +5 -5
- package/es2024.cjs.js +21 -21
- package/es2024.esm.js +21 -21
- package/esnext.cjs.js +21 -21
- package/esnext.esm.js +21 -21
- package/evergreen.esm.js +21 -21
- package/package.json +5 -5
- package/types/VKVideoPlayer/index.svelte.d.ts +1 -0
- package/types/components/Ads/admanWrapper.d.ts +0 -2
- package/types/config.d.ts +0 -1
package/es2018.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/videoplayer v1.1.62-dev.
|
|
3
|
-
* Tue, 27 May 2025
|
|
2
|
+
* @vkontakte/videoplayer v1.1.62-dev.cb3c3ded.0
|
|
3
|
+
* Tue, 27 May 2025 10:55:31 GMT
|
|
4
4
|
* https://st.mycdn.me/static/vkontakte-videoplayer/1-1-62/doc/
|
|
5
5
|
*/
|
|
6
6
|
var E1=Object.defineProperty;var Bm=t=>{throw TypeError(t)};var P1=(t,e,i)=>e in t?E1(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var Nn=(t,e,i)=>P1(t,typeof e!="symbol"?e+"":e,i),gu=(t,e,i)=>e.has(t)||Bm("Cannot "+i);var Ii=(t,e,i)=>(gu(t,e,"read from private field"),i?i.call(t):e.get(t)),cs=(t,e,i)=>e.has(t)?Bm("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),ga=(t,e,i,o)=>(gu(t,e,"write to private field"),o?o.call(t,i):e.set(t,i),i),Dm=(t,e,i)=>(gu(t,e,"access private method"),i);var us="[",Ps="[!",As="]",Kr={};var Ei=Symbol(),pi=Symbol("filename"),Om=Symbol("hmr"),Hm="http://www.w3.org/1999/xhtml",hu="http://www.w3.org/2000/svg";var Fd=!0;var Um,zm,Fm=(zm=(Um=globalThis.process)==null?void 0:Um.env)==null?void 0:zm.NODE_ENV,Te=Fm&&!Fm.toLowerCase().startsWith("prod");var Oo=Symbol("$state"),Qr=Symbol("$state metadata"),ol=Symbol("legacy props"),qm=Symbol("");var yr=Array.isArray,Wm=Array.prototype.indexOf,nl=Array.from,_u=Object.keys,oo=Object.defineProperty,Bn=Object.getOwnPropertyDescriptor,Ud=Object.getOwnPropertyDescriptors,bu=Object.prototype,Km=Array.prototype,Gr=Object.getPrototypeOf;function ps(t){return typeof t=="function"}var ie=()=>{};function Qm(t){return t()}function fs(t){for(var e=0;e<t.length;e++)t[e]()}var rl=[],$u=[];function Gm(){var t=rl;rl=[],fs(t)}function A1(){var t=$u;$u=[],fs(t)}function jo(t){rl.length===0&&queueMicrotask(Gm),rl.push(t)}function yu(){rl.length>0&&Gm(),$u.length>0&&A1()}function zd(t){return t===this.v}function ha(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function Ym(t,e){return t!==e}function _a(t){return!ha(t,this.v)}function jm(){if(Te){let t=new Error(`derived_references_self
|
|
@@ -45,7 +45,7 @@ ${l}in ${u}`).join("")}
|
|
|
45
45
|
`)){let n=(i=U1.exec(o))!=null?i:z1.exec(o);n&&e.push({file:n[1],line:+n[2],column:+n[3]})}return e}function Nv(){var e;let t=(e=q1())==null?void 0:e.slice(4);if(!t)return null;for(let i=0;i<t.length;i++){let o=t[i],n=F1[o.file];if(!n){if(i===0)return null;continue}for(let a of n){if(a.end==null)return null;if(a.start.line<o.line&&a.end.line>o.line)return a.component}}return null}var nc=Symbol("ADD_OWNER");function Hu(t,e,i=!1,o=!1){if(t&&!i){let n=on,a=t[Qr];if(a&&!Fu(a,n)){let s=Uu(a);e&&e[pi]!==n[pi]&&!o&&_v(n[pi],e[pi],s[pi])}}rc(t,e,new Set)}function Pu(t,e){if(e.owners!==null)for(;t;){if(t.owners===null){e.owners=null;break}for(let i of t.owners)e.owners.add(i);t=t.parent}}function rc(t,e,i){var a;let o=t==null?void 0:t[Qr];if(o)"owners"in o&&o.owners!=null&&(e?o.owners.add(e):o.owners=null);else if(t&&typeof t=="object"){if(i.has(t))return;if(i.add(t),nc in t&&t[nc])_o(()=>{t[nc](e)});else{var n=Gr(t);if(n===Object.prototype)for(let s in t)if((a=Object.getOwnPropertyDescriptor(t,s))!=null&&a.get){let d=Ei;_o(()=>{let l=t[s];d!==l&&(d=l,rc(l,e,i))})}else rc(t[s],e,i);else if(n===Array.prototype)for(let s=0;s<t.length;s+=1)rc(t[s],e,i)}}}function Fu(t,e){return t.owners===null?!0:t.owners.has(e)||pi in e&&[...t.owners].some(i=>i[pi]===e[pi])||t.parent!==null&&Fu(t.parent,e)}function Uu(t){var e,i;return(i=(e=t==null?void 0:t.owners)==null?void 0:e.values().next().value)!=null?i:Uu(t.parent)}var W1=!1;function $v(t){if(W1)return;let e=Nv();if(e&&!Fu(t,e)){let i=Uu(t);i[pi]!==e[pi]?Eu(e[pi],i[pi]):Eu()}}function Ia(t){if(Te){let e=new Error(`lifecycle_outside_component
|
|
46
46
|
\`${t}(...)\` can only be used during component initialisation
|
|
47
47
|
https://svelte.dev/e/lifecycle_outside_component`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/lifecycle_outside_component")}var St=null;function vl(t){St=t}var on=null;function gl(t){on=t}function Ea(t){return zu("getContext").get(t)}function Pa(t,e){let i=zu("setContext");return Te&&_t(()=>Hu(e,null,!0)),i.set(t,e),e}function _l(){return zu("getAllContexts")}function z(t,e=!1,i){var o=St={p:St,c:null,d:!1,e:null,m:!1,s:t,x:null,l:null};Br&&!e&&(St.l={s:null,u:null,r1:[],r2:Hi(!1)}),nn(()=>{o.d=!0}),Te&&(St.function=i,on=i)}function q(t){var s,d;let e=St;if(e!==null){t!==void 0&&(e.x=t);let l=e.e;if(l!==null){var i=yt,o=Rt;e.e=null;try{for(var n=0;n<l.length;n++){var a=l[n];no(a.effect),go(a.reaction),vn(a.fn)}}finally{no(i),go(o)}}St=e.p,Te&&(on=(d=(s=e.p)==null?void 0:s.function)!=null?d:null),e.m=!0}return t||{}}function Or(){return!Br||St!==null&&St.l===null}function zu(t){var e;return St===null&&Ia(t),(e=St.c)!=null?e:St.c=new Map(Q1(St)||void 0)}function Q1(t){let e=t.p;for(;e!==null;){let i=e.c;if(i!==null)return i;e=e.p}return null}var G1=/\r/g;function Bv(t){t=t.replace(G1,"");let e=5381,i=t.length;for(;i--;)e=(e<<5)-e^t.charCodeAt(i);return(e>>>0).toString(36)}function Dv(t){return t.endsWith("capture")&&t!=="gotpointercapture"&&t!=="lostpointercapture"}var Y1=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function Ov(t){return Y1.includes(t)}var j1=["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 Z1={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 Hv(t){var e;return t=t.toLowerCase(),(e=Z1[t])!=null?e:t}var i6=[...j1,"formNoValidate","isMap","noModule","playsInline","readOnly","value","volume","defaultValue","defaultChecked","srcObject","noValidate","allowFullscreen","disablePictureInPicture","disableRemotePlayback"];var X1=["touchstart","touchmove"];function Fv(t){return X1.includes(t)}var J1=["textarea","script","style","title"];function Uv(t){return J1.includes(t)}function qu(t){return t==null?void 0:t.replace(/\//g,"/\u200B")}var zv=new Map;function qv(t,e){var i=zv.get(t);i||(i=new Set,zv.set(t,i)),i.add(e)}function Wu(t,e){if(e){let i=document.body;t.autofocus=!0,jo(()=>{document.activeElement===i&&t.focus()})}}function bl(t){var e=Rt,i=yt;go(null),no(null);try{return t()}finally{go(e),no(i)}}var Ku=new Set,sc=new Set;function Fs(t){if(!Ye)return;t.onload&&t.removeAttribute("onload"),t.onerror&&t.removeAttribute("onerror");let e=t.__e;e!==void 0&&(t.__e=void 0,queueMicrotask(()=>{t.isConnected&&t.dispatchEvent(e)}))}function Qu(t,e,i,o={}){function n(a){if(o.capture||Aa.call(e,a),!a.cancelBubble)return bl(()=>i==null?void 0:i.call(this,a))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?jo(()=>{e.addEventListener(t,n,o)}):e.addEventListener(t,n,o),n}function Tt(t,e,i,o,n){var a={capture:o,passive:n},s=Qu(t,e,i,a);(e===document.body||e===window||e===document)&&nn(()=>{e.removeEventListener(t,s,a)})}function rt(t){for(var e=0;e<t.length;e++)Ku.add(t[e]);for(var i of sc)i(t)}function Aa(t){var P;var e=this,i=e.ownerDocument,o=t.type,n=((P=t.composedPath)==null?void 0:P.call(t))||[],a=n[0]||t.target,s=0,d=t.__root;if(d){var l=n.indexOf(d);if(l!==-1&&(e===document||e===window)){t.__root=e;return}var p=n.indexOf(e);if(p===-1)return;l<=p&&(s=l)}if(a=n[s]||t.target,a!==e){oo(t,"currentTarget",{configurable:!0,get(){return a||i}});var f=Rt,_=yt;go(null),no(null);try{for(var u,$=[];a!==null;){var w=a.assignedSlot||a.parentNode||a.host||null;try{var y=a["__"+o];if(y!=null&&(!a.disabled||t.target===a))if(yr(y)){var[S,...k]=y;S.apply(a,[t,...k])}else y.call(a,t)}catch(A){u?$.push(A):u=A}if(t.cancelBubble||w===e||w===null)break;a=w}if(u){for(let A of $)queueMicrotask(()=>{throw A});throw u}}finally{t.__root=e,delete t.currentTarget,go(f),no(_)}}}var t0;function Wv(){t0=void 0}function Ma(t){var e=document.createElement("template");return e.innerHTML=t,e.content}function bo(t,e){var i=yt;i.nodes_start===null&&(i.nodes_start=t,i.nodes_end=e)}function L(t,e){var i=(e&1)!==0,o=(e&2)!==0,n,a=!t.startsWith("<!>");return()=>{if(Ye)return bo(ft,null),ft;n===void 0&&(n=Ma(a?t:"<!>"+t),i||(n=mi(n)));var s=o||dl?document.importNode(n,!0):n.cloneNode(!0);if(i){var d=mi(s),l=s.lastChild;bo(d,l)}else bo(s,s);return s}}function be(t,e,i="svg"){var o=!t.startsWith("<!>"),n=(e&1)!==0,a=`<${i}>${o?t:"<!>"+t}</${i}>`,s;return()=>{if(Ye)return bo(ft,null),ft;if(!s){var d=Ma(a),l=mi(d);if(n)for(s=document.createDocumentFragment();mi(l);)s.appendChild(mi(l));else s=mi(l)}var p=s.cloneNode(!0);if(n){var f=mi(p),_=p.lastChild;bo(f,_)}else bo(p,p);return p}}function rr(t=""){if(!Ye){var e=en(t+"");return bo(e,e),e}var i=ft;return i.nodeType!==3&&(i.before(i=en()),fi(i)),bo(i,i),i}function Fe(){if(Ye)return bo(ft,null),ft;var t=document.createDocumentFragment(),e=document.createComment(""),i=en();return t.append(e,i),bo(e,i),t}function b(t,e){if(Ye){yt.nodes_end=ft,Vi();return}t!==null&&t.before(e)}var $l=!0;function ac(t){$l=t}function ve(t,e){var o;var i=e==null?"":typeof e=="object"?e+"":e;i!==((o=t.__t)!=null?o:t.__t=t.nodeValue)&&(t.__t=i,t.nodeValue=i+"")}function es(t,e){return Qv(t,e)}function Yu(t,e){var s;Gd(),e.intro=(s=e.intro)!=null?s:!1;let i=e.target,o=Ye,n=ft;try{for(var a=mi(i);a&&(a.nodeType!==8||a.data!==us);)a=Ao(a);if(!a)throw Kr;so(!0),fi(a),Vi();let d=Qv(t,{...e,anchor:a});if(ft===null||ft.nodeType!==8||ft.data!==As)throw Bs(),Kr;return so(!1),d}catch(d){if(d===Kr)return e.recover===!1&&tv(),Gd(),cl(i),so(!1),es(t,e);throw d}finally{so(o),fi(n),Wv()}}var La=new Map;function Qv(t,{target:e,anchor:i,props:o={},events:n,context:a,intro:s=!0}){Gd();var d=new Set,l=_=>{for(var u=0;u<_.length;u++){var $=_[u];if(!d.has($)){d.add($);var w=Fv($);e.addEventListener($,Aa,{passive:w});var y=La.get($);y===void 0?(document.addEventListener($,Aa,{passive:w}),La.set($,1)):La.set($,y+1)}}};l(nl(Ku)),sc.add(l);var p=void 0,f=Vv(()=>{var _=i!=null?i:e.appendChild(en());return Fi(()=>{if(a){z({});var u=St;u.c=a}n&&(o.$$events=n),Ye&&bo(_,null),$l=s,p=t(_,o)||{},$l=!0,Ye&&(yt.nodes_end=ft),a&&q()}),()=>{var w;for(var u of d){e.removeEventListener(u,Aa);var $=La.get(u);--$===0?(document.removeEventListener(u,Aa),La.delete(u)):La.set(u,$)}sc.delete(l),_!==i&&((w=_.parentNode)==null||w.removeChild(_))}});return Gu.set(p,f),p}var Gu=new WeakMap;function Us(t,e){let i=Gu.get(t);return i?(Gu.delete(t),i(e)):(Te&&hv(),Promise.resolve())}function R(t,e,[i,o]=[0,0]){Ye&&i===0&&Vi();var n=t,a=null,s=null,d=Ei,l=i>0?65536:0,p=!1;let f=(u,$=!0)=>{p=!0,_($,u)},_=(u,$)=>{if(d===(d=u))return;let w=!1;if(Ye&&o!==-1){if(i===0){let S=n.data;S===us?o=0:S===Ps?o=1/0:(o=parseInt(S.substring(1)),o!==o&&(o=d?1/0:-1))}let y=o>i;!!d===y&&(n=wa(),fi(n),so(!1),w=!0,o=-1)}d?(a?Jr(a):$&&(a=Fi(()=>$(n))),s&&gn(s,()=>{s=null})):(s?Jr(s):$&&(s=Fi(()=>$(n,[i+1,o]))),a&&gn(a,()=>{a=null})),w&&so(!0)};ao(()=>{p=!1,e(f),p||_(null,null)},l),Ye&&(n=ft)}function zs(t,e,i){Ye&&Vi();var o=t,n=Ei,a,s=Or()?Ym:ha;ao(()=>{s(n,n=e())&&(a&&gn(a),a=Fi(()=>i(o)))}),Ye&&(o=ft)}var gs=null;function Xu(t){gs=t}function yl(t,e){return e}function r0(t,e,i,o){for(var n=[],a=e.length,s=0;s<a;s++)oc(e[s].e,n,!0);var d=a>0&&n.length===0&&i!==null;if(d){var l=i.parentNode;cl(l),l.append(i),o.clear(),vs(t,e[0].prev,e[a-1].next)}Ou(n,()=>{for(var p=0;p<a;p++){var f=e[p];d||(o.delete(f.k),vs(t,f.prev,f.next)),ro(f.e,!d)}})}function $i(t,e,i,o,n,a=null){var s=t,d={flags:e,items:new Map,first:null},l=(e&4)!==0;if(l){var p=t;s=Ye?fi(mi(p)):p.appendChild(en())}Ye&&Vi();var f=null,_=!1,u=Sr(()=>{var $=i();return yr($)?$:$==null?[]:nl($)});ao(()=>{var $=r(u),w=$.length;if(_&&w===0)return;_=w===0;let y=!1;if(Ye){var S=s.data===Ps;S!==(w===0)&&(s=wa(),fi(s),so(!1),y=!0)}if(Ye){for(var k=null,P,A=0;A<w;A++){if(ft.nodeType===8&&ft.data===As){s=ft,y=!0,so(!1);break}var E=$[A],T=o(E,A);P=jv(ft,d,k,null,E,T,A,n,e,i),d.items.set(T,P),k=P}w>0&&fi(wa())}Ye||s0($,d,s,n,e,o,i),a!==null&&(w===0?f?Jr(f):f=Fi(()=>a(s)):f!==null&&gn(f,()=>{f=null})),y&&so(!0),r(u)}),Ye&&(s=ft)}function s0(t,e,i,o,n,a,s){var le,Ve,Ae,J;var d=(n&8)!==0,l=(n&3)!==0,p=t.length,f=e.items,_=e.first,u=_,$,w=null,y,S=[],k=[],P,A,E,T;if(d)for(T=0;T<p;T+=1)P=t[T],A=a(P,T),E=f.get(A),E!==void 0&&((le=E.a)==null||le.measure(),(y!=null?y:y=new Set).add(E));for(T=0;T<p;T+=1){if(P=t[T],A=a(P,T),E=f.get(A),E===void 0){var V=u?u.e.nodes_start:i;w=jv(V,e,w,w===null?e.first:w.next,P,A,T,o,n,s),f.set(A,w),S=[],k=[],u=w.next;continue}if(l&&a0(E,P,T,n),(E.e.f&8192)!==0&&(Jr(E.e),d&&((Ve=E.a)==null||Ve.unfix(),(y!=null?y:y=new Set).delete(E))),E!==u){if($!==void 0&&$.has(E)){if(S.length<k.length){var U=k[0],G;w=U.prev;var F=S[0],Y=S[S.length-1];for(G=0;G<S.length;G+=1)Gv(S[G],U,i);for(G=0;G<k.length;G+=1)$.delete(k[G]);vs(e,F.prev,Y.next),vs(e,w,F),vs(e,Y,U),u=U,w=Y,T-=1,S=[],k=[]}else $.delete(E),Gv(E,u,i),vs(e,E.prev,E.next),vs(e,E,w===null?e.first:w.next),vs(e,w,E),w=E;continue}for(S=[],k=[];u!==null&&u.k!==A;)(u.e.f&8192)===0&&($!=null?$:$=new Set).add(u),k.push(u),u=u.next;if(u===null)continue;E=u}S.push(E),w=E,u=E.next}if(u!==null||$!==void 0){for(var X=$===void 0?[]:nl($);u!==null;)(u.e.f&8192)===0&&X.push(u),u=u.next;var oe=X.length;if(oe>0){var pe=(n&4)!==0&&p===0?i:null;if(d){for(T=0;T<oe;T+=1)(Ae=X[T].a)==null||Ae.measure();for(T=0;T<oe;T+=1)(J=X[T].a)==null||J.fix()}r0(e,X,pe,f)}}d&&jo(()=>{var Me;if(y!==void 0)for(E of y)(Me=E.a)==null||Me.apply()}),yt.first=e.first&&e.first.e,yt.last=w&&w.e}function a0(t,e,i,o){(o&1)!==0&&$a(t.v,e),(o&2)!==0?$a(t.i,i):t.i=i}function jv(t,e,i,o,n,a,s,d,l,p){var f=gs,_=(l&1)!==0,u=(l&16)===0,$=_?u?Zr(n):Hi(n):n,w=(l&2)===0?s:Hi(s);Te&&_&&($.debug=()=>{var S=typeof w=="number"?s:w.v;p()[S]});var y={i:w,v:$,k:a,a:null,e:null,prev:i,next:o};gs=y;try{return y.e=Fi(()=>d(t,$,w,p),Ye),y.e.prev=i&&i.e,y.e.next=o&&o.e,i===null?e.first=y:(i.next=y,i.e.next=y.e),o!==null&&(o.prev=y,o.e.prev=y.e),y}finally{gs=f}}function Gv(t,e,i){for(var o=t.next?t.next.e.nodes_start:i,n=e?e.e.nodes_start:i,a=t.e.nodes_start;a!==o;){var s=Ao(a);n.before(a),a=s}}function vs(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 l0(t,e,i){var a,s;if(!e||e===Bv(String(i!=null?i:"")))return;let o,n=(a=t.__svelte_meta)==null?void 0:a.loc;n?o=`near ${n.file}:${n.line}:${n.column}`:(s=on)!=null&&s[pi]&&(o=`in ${on[pi]}`),gv(qu(o))}function xl(t,e,i,o,n){var a=t,s="",d;ao(()=>{var l;if(s===(s=(l=e())!=null?l:"")){Ye&&Vi();return}d!==void 0&&(ro(d),d=void 0),s!==""&&(d=Fi(()=>{if(Ye){for(var p=ft.data,f=Vi(),_=f;f!==null&&(f.nodeType!==8||f.data!=="");)_=f,f=Ao(f);if(f===null)throw Bs(),Kr;Te&&!n&&l0(f.parentNode,p,s),bo(ft,_),a=fi(f);return}var u=s+"";i?u=`<svg>${u}</svg>`:o&&(u=`<math>${u}</math>`);var $=Ma(u);if((i||o)&&($=mi($)),bo(mi($),$.lastChild),i||o)for(;mi($);)a.before(mi($));else a.before($)}))})}function ge(t,e,...i){var o=t,n=ie,a;ao(()=>{n!==(n=e())&&(a&&(ro(a),a=null),Te&&n==null&&iv(),a=Fi(()=>n(o,...i)))},65536),Ye&&(o=ft)}function yi(t,e,i){Ye&&Vi();var o=t,n,a;ao(()=>{n!==(n=e())&&(a&&(gn(a),a=null),n&&(a=Fi(()=>i(o,n))))},65536),Ye&&(o=ft)}function wl(t,e,i,o,n,a){var w;let s=Ye;Ye&&Vi();var d=Te&&a&&((w=St)==null?void 0:w.function[pi]),l,p,f=null;Ye&&ft.nodeType===1&&(f=ft,Vi());var _=Ye?ft:t,u,$=gs;ao(()=>{let y=e()||null;var S=n?n():i||y==="svg"?hu:null;if(y!==l){var k=gs;Xu($),u&&(y===null?gn(u,()=>{u=null,p=null}):y===p?Jr(u):(ro(u),ac(!1))),y&&y!==p&&(u=Fi(()=>{if(f=Ye?f:S?document.createElementNS(S,y):document.createElement(y),Te&&a&&(f.__svelte_meta={loc:{file:d,line:a[0],column:a[1]}}),bo(f,f),o){Ye&&Uv(y)&&f.append(document.createComment(""));var P=Ye?mi(f):f.appendChild(en());Ye&&(P===null?so(!1):fi(P)),o(f,P)}yt.nodes_end=f,_.before(f)})),l=y,l&&(p=l),ac(!0),Xu(k)}},65536),s&&(so(!0),fi(_))}var ep;function Zv(t){return ep=t.target,new Ju(t)}var ts,sr,Ju=class{constructor(e){cs(this,ts);cs(this,sr);var a,s;var i=new Map,o=(d,l)=>{var p=Zr(l);return i.set(d,p),p};let n=new Proxy({...e.props||{},$$events:{}},{get(d,l){var p;return r((p=i.get(l))!=null?p:o(l,Reflect.get(d,l)))},has(d,l){var p;return l===ol?!0:(r((p=i.get(l))!=null?p:o(l,Reflect.get(d,l))),Reflect.has(d,l))},set(d,l,p){var f;return O((f=i.get(l))!=null?f:o(l,p),p),Reflect.set(d,l,p)}});ga(this,sr,(e.hydrate?Yu:es)(e.component,{target:e.target,anchor:e.anchor,props:n,context:e.context,intro:(a=e.intro)!=null?a:!1,recover:e.recover})),(!((s=e==null?void 0:e.props)!=null&&s.$$host)||e.sync===!1)&&Ta(),ga(this,ts,n.$$events);for(let d of Object.keys(Ii(this,sr)))d==="$set"||d==="$destroy"||d==="$on"||oo(this,d,{get(){return Ii(this,sr)[d]},set(l){Ii(this,sr)[d]=l},enumerable:!0});Ii(this,sr).$set=d=>{Object.assign(n,d)},Ii(this,sr).$destroy=()=>{Us(Ii(this,sr))}}$set(e){Ii(this,sr).$set(e)}$on(e,i){Ii(this,ts)[e]=Ii(this,ts)[e]||[];let o=(...n)=>i.call(this,...n);return Ii(this,ts)[e].push(o),()=>{Ii(this,ts)[e]=Ii(this,ts)[e].filter(n=>n!==o)}}$destroy(){Ii(this,sr).$destroy()}};ts=new WeakMap,sr=new WeakMap;function K(t,e){jo(()=>{var n,a,s;var i=t.getRootNode(),o=i.host?i:(s=(n=i.head)!=null?n:i.ownerDocument.head)!=null?s:(a=ep)==null?void 0:a.parentNode;if(!(o!=null&&o.querySelector("#"+e.hash))){let d=document.createElement("style");d.id=e.hash,d.textContent=e.code,o.appendChild(d),Te&&qv(e.hash,d)}})}function Xv(t){var e,i,o="";if(typeof t=="string"||typeof t=="number")o+=t;else if(typeof t=="object")if(Array.isArray(t)){var n=t.length;for(e=0;e<n;e++)t[e]&&(i=Xv(t[e]))&&(o&&(o+=" "),o+=i)}else for(i in t)t[i]&&(o&&(o+=" "),o+=i);return o}function Jv(){for(var t,e,i=0,o="",n=arguments.length;i<n;i++)(t=arguments[i])&&(e=Xv(t))&&(o&&(o+=" "),o+=e);return o}function Sl(t){return typeof t=="object"?Jv(t):t!=null?t:""}var eg=[...`
|
|
48
|
-
\r\f\xA0\v\uFEFF`];function ig(t,e,i){var o=t==null?"":""+t;if(e&&(o=o?o+" "+e:e),i){for(var n in i)if(i[n])o=o?o+" "+n:n;else if(o.length)for(var a=n.length,s=0;(s=o.indexOf(n,s))>=0;){var d=s+a;(s===0||eg.includes(o[s-1]))&&(d===o.length||eg.includes(o[d]))?o=(s===0?"":o.substring(0,s))+o.substring(d+1):s=d}}return o===""?null:o}function tg(t,e=!1){var i=e?" !important;":";",o="";for(var n in t){var a=t[n];a!=null&&a!==""&&(o+=" "+n+": "+a+i)}return o}function tp(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function og(t,e){if(e){var i="",o,n;if(Array.isArray(e)?(o=e[0],n=e[1]):o=e,t){t=String(t).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var a=!1,s=0,d=!1,l=[];o&&l.push(...Object.keys(o).map(tp)),n&&l.push(...Object.keys(n).map(tp));var p=0,f=-1;let y=t.length;for(var _=0;_<y;_++){var u=t[_];if(d?u==="/"&&t[_-1]==="*"&&(d=!1):a?a===u&&(a=!1):u==="/"&&t[_+1]==="*"?d=!0:u==='"'||u==="'"?a=u:u==="("?s++:u===")"&&s--,!d&&a===!1&&s===0){if(u===":"&&f===-1)f=_;else if(u===";"||_===y-1){if(f!==-1){var $=tp(t.substring(p,f).trim());if(!l.includes($)){u!==";"&&_++;var w=t.substring(p,_).trim();i+=" "+w+";"}}p=_+1,f=-1}}}}return o&&(i+=tg(o)),n&&(i+=tg(n,!0)),i=i.trim(),i===""?null:i}return t==null?null:String(t)}function te(t,e,i,o,n,a){var s=t.__className;if(Ye||s!==i){var d=ig(i,o,a);(!Ye||d!==t.getAttribute("class"))&&(d==null?t.removeAttribute("class"):e?t.className=d:t.setAttribute("class",d)),t.__className=i}else if(a&&n!==a)for(var l in a){var p=!!a[l];(n==null||p!==!!n[l])&&t.classList.toggle(l,p)}return a}function ip(t,e={},i,o){for(var n in i){var a=i[n];e[n]!==a&&(i[n]==null?t.style.removeProperty(n):t.style.setProperty(n,a,o))}}function et(t,e,i,o){var n=t.__style;if(Ye||n!==e){var a=og(e,o);(!Ye||a!==t.getAttribute("style"))&&(a==null?t.removeAttribute("style"):t.style.cssText=a),t.__style=e}else o&&(Array.isArray(o)?(ip(t,i==null?void 0:i[0],o[0]),ip(t,i==null?void 0:i[1],o[1],"important")):ip(t,i,o));return o}var Va=Symbol("class"),Ra=Symbol("style"),sg=Symbol("is custom element"),ag=Symbol("is html");function lg(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function Oe(t,e,i,o){var n=dg(t);if(Ye&&(n[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName==="LINK")){o||v0(t,e,i!=null?i:"");return}n[e]!==(n[e]=i)&&(e==="loading"&&(t[qm]=i),i==null?t.removeAttribute(e):typeof i!="string"&&cg(t).includes(e)?t[e]=i:t.setAttribute(e,i))}function we(t,e,i,o,n=!1){var E;var a=dg(t),s=a[sg],d=!a[ag];let l=Ye&&s;l&&so(!1);var p=e||{},f=t.tagName==="OPTION";for(var _ in e)_ in i||(i[_]=null);i.class?i.class=Sl(i.class):(o||i[Va])&&(i.class=null),i[Ra]&&((E=i.style)!=null||(i.style=null));var u=cg(t);for(let T in i){let V=i[T];if(f&&T==="value"&&V==null){t.value=t.__value="",p[T]=V;continue}if(T==="class"){var $=t.namespaceURI==="http://www.w3.org/1999/xhtml";te(t,$,V,o,e==null?void 0:e[Va],i[Va]),p[T]=V,p[Va]=i[Va];continue}if(T==="style"){et(t,V,e==null?void 0:e[Ra],i[Ra]),p[T]=V,p[Ra]=i[Ra];continue}var w=p[T];if(V!==w){p[T]=V;var y=T[0]+T[1];if(y!=="$$")if(y==="on"){let U={},G="$$"+T,F=T.slice(2);var S=Ov(F);if(Dv(F)&&(F=F.slice(0,-7),U.capture=!0),!S&&w){if(V!=null)continue;t.removeEventListener(F,p[G],U),p[G]=null}if(V!=null)if(S)t[`__${F}`]=V,rt([F]);else{let Y=function(X){p[T].call(this,X)};var A=Y;p[G]=Qu(F,t,Y,U)}else S&&(t[`__${F}`]=void 0)}else if(T==="style")Oe(t,T,V);else if(T==="autofocus")Wu(t,!!V);else if(!s&&(T==="__value"||T==="value"&&V!=null))t.value=t.__value=V;else if(T==="selected"&&f)lg(t,V);else{var k=T;d||(k=Hv(k));var P=k==="defaultValue"||k==="defaultChecked";if(V==null&&!s&&!P)if(a[T]=null,k==="value"||k==="checked"){let U=t,G=e===void 0;if(k==="value"){let F=U.defaultValue;U.removeAttribute(k),U.defaultValue=F,U.value=U.__value=G?F:null}else{let F=U.defaultChecked;U.removeAttribute(k),U.defaultChecked=F,U.checked=G?F:!1}}else t.removeAttribute(T);else P||u.includes(k)&&(s||typeof V!="string")?t[k]=V:typeof V!="function"&&Oe(t,k,V,n)}}}return l&&so(!0),p}function dg(t){var e;return(e=t.__attributes)!=null?e:t.__attributes={[sg]:t.nodeName.includes("-"),[ag]:t.namespaceURI===Hm}}var ng=new Map;function cg(t){var e=ng.get(t.nodeName);if(e)return e;ng.set(t.nodeName,e=[]);for(var i,o=t,n=Element.prototype;n!==o;){i=Ud(o);for(var a in i)i[a].set&&e.push(a);o=Gr(o)}return e}function v0(t,e,i){var o;Te&&(e==="srcset"&&g0(t,i)||op((o=t.getAttribute(e))!=null?o:"",i)||vv(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 rg(t){return t.split(",").map(e=>e.trim().split(" ").filter(Boolean))}function g0(t,e){var i=rg(t.srcset),o=rg(e);return o.length===i.length&&o.every(([n,a],s)=>a===i[s][1]&&(op(i[s][0],n)||op(n,i[s][0])))}var h0=Fd?()=>performance.now():()=>Date.now(),Tr={tick:t=>(Fd?requestAnimationFrame:ie)(t),now:()=>h0(),tasks:new Set};function ug(){let t=Tr.now();Tr.tasks.forEach(e=>{e.c(t)||(Tr.tasks.delete(e),e.f())}),Tr.tasks.size!==0&&Tr.tick(ug)}function pg(t){let e;return Tr.tasks.size===0&&Tr.tick(ug),{promise:new Promise(i=>{Tr.tasks.add(e={c:t,f:i})}),abort(){Tr.tasks.delete(e)}}}function lc(t,e){bl(()=>{t.dispatchEvent(new CustomEvent(e))})}function y0(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 fg(t){let e={},i=t.split(";");for(let o of i){let[n,a]=o.split(":");if(!n||a===void 0)break;let s=y0(n.trim());e[s]=a.trim()}return e}var x0=t=>t;function rp(t,e,i,o){var A;var n=(t&1)!==0,a=(t&2)!==0,s=n&&a,d=(t&4)!==0,l=s?"both":n?"in":"out",p,f=e.inert,_=e.style.overflow,u,$;function w(){var V;var E=Rt,T=yt;go(null),no(null);try{return p!=null?p:p=i()(e,(V=o==null?void 0:o())!=null?V:{},{direction:l})}finally{go(E),no(T)}}var y={is_global:d,in(){var E;if(e.inert=f,!n){$==null||$.abort(),(E=$==null?void 0:$.reset)==null||E.call($);return}a||u==null||u.abort(),lc(e,"introstart"),u=np(e,w(),$,1,()=>{lc(e,"introend"),u==null||u.abort(),u=p=void 0,e.style.overflow=_})},out(E){if(!a){E==null||E(),p=void 0;return}e.inert=!0,lc(e,"outrostart"),$=np(e,w(),u,0,()=>{lc(e,"outroend"),E==null||E()})},stop:()=>{u==null||u.abort(),$==null||$.abort()}},S=yt;if(((A=S.transitions)!=null?A:S.transitions=[]).push(y),n&&$l){var k=d;if(!k){for(var P=S.parent;P&&(P.f&65536)!==0;)for(;(P=P.parent)&&(P.f&16)===0;);k=!P||(P.f&32768)!==0}k&&vn(()=>{_t(()=>y.in())})}}function np(t,e,i,o,n){var a=o===1;if(ps(e)){var s,d=!1;return jo(()=>{if(!d){var S=e({direction:a?"in":"out"});s=np(t,S,i,o,n)}}),{abort:()=>{d=!0,s==null||s.abort()},deactivate:()=>s.deactivate(),reset:()=>s.reset(),t:()=>s.t()}}if(i==null||i.deactivate(),!(e!=null&&e.duration))return n(),{abort:ie,deactivate:ie,reset:ie,t:()=>o};let{delay:l=0,css:p,tick:f,easing:_=x0}=e;var u=[];if(a&&i===void 0&&(f&&f(0,1),p)){var $=fg(p(0,1));u.push($,$)}var w=()=>1-o,y=t.animate(u,{duration:l});return y.onfinish=()=>{var F;var S=(F=i==null?void 0:i.t())!=null?F:1-o;i==null||i.abort();var k=o-S,P=e.duration*Math.abs(k),A=[];if(P>0){var E=!1;if(p)for(var T=Math.ceil(P/16.666666666666668),V=0;V<=T;V+=1){var U=S+k*_(V/T),G=fg(p(U,1-U));A.push(G),E||(E=G.overflow==="hidden")}E&&(t.style.overflow="hidden"),w=()=>{var Y=y.currentTime;return S+k*_(Y/P)},f&&pg(()=>{if(y.playState!=="running")return!1;var Y=w();return f(Y,1-Y),!0})}y=t.animate(A,{duration:P,fill:"forwards"}),y.onfinish=()=>{w=()=>o,f==null||f(o,1-o),n()}},{abort:()=>{y&&(y.cancel(),y.effect=null,y.onfinish=ie)},deactivate:()=>{n=ie},reset:()=>{o===0&&(f==null||f(1,0))},t:()=>w()}}var hs,Na,Cl,cc,mg,uc=class uc{constructor(e){cs(this,cc);cs(this,hs,new WeakMap);cs(this,Na);cs(this,Cl);ga(this,Cl,e)}observe(e,i){var o=Ii(this,hs).get(e)||new Set;return o.add(i),Ii(this,hs).set(e,o),Dm(this,cc,mg).call(this).observe(e,Ii(this,Cl)),()=>{var n=Ii(this,hs).get(e);n.delete(i),n.size===0&&(Ii(this,hs).delete(e),Ii(this,Na).unobserve(e))}}};hs=new WeakMap,Na=new WeakMap,Cl=new WeakMap,cc=new WeakSet,mg=function(){var e;return(e=Ii(this,Na))!=null?e:ga(this,Na,new ResizeObserver(i=>{for(var o of i){uc.entries.set(o.target,o);for(var n of Ii(this,hs).get(o.target)||[])n(o)}}))},Nn(uc,"entries",new WeakMap);var sp=uc;var C0=new sp({box:"border-box"});function Hr(t,e,i){var o=C0.observe(t,()=>i(t[e]));vn(()=>(_t(()=>i(t[e])),o))}function vg(t,e){return t===e||(t==null?void 0:t[Oo])===e}function dt(t={},e,i,o){return vn(()=>{var n,a;return _o(()=>{n=a,a=(o==null?void 0:o())||[],_t(()=>{t!==i(...a)&&(e(t,...a),n&&vg(i(...n),t)&&e(null,...n))})}),()=>{jo(()=>{a&&vg(i(...a),t)&&e(null,...a)})}}),t}function kr(t=!1){let e=St,i=e.l.u;if(!i)return;let o=()=>ec(e.s);if(t){let n=0,a={},s=m(()=>{let d=!1,l=e.s;for(let p in l)l[p]!==a[p]&&(a[p]=l[p],d=!0);return d&&n++,n});o=()=>r(s)}i.b.length&&ka(()=>{gg(e,o),fs(i.b)}),qe(()=>{let n=_t(()=>i.m.map(Qm));return()=>{for(let a of n)typeof a=="function"&&a()}}),i.a.length&&qe(()=>{gg(e,o),fs(i.a)})}function gg(t,e){if(t.l.s)for(let i of t.l.s)r(i);e()}if(Te){let t=function(e){if(!(e in globalThis)){let i;Object.defineProperty(globalThis,e,{configurable:!0,get:()=>{if(i!==void 0)return i;rv(e)},set:o=>{i=o}})}};k0=t,t("$state"),t("$effect"),t("$derived"),t("$inspect"),t("$props"),t("$bindable")}var k0;function Ot(t){St===null&&Ia("onMount"),Br&&St.l!==null?T0(St).m.push(t):qe(()=>{let e=_t(t);if(typeof e=="function")return e})}function hn(t){St===null&&Ia("onDestroy"),Ot(()=>()=>_t(t))}function T0(t){var i;var e=t.l;return(i=e.u)!=null?i:e.u={a:[],b:[],m:[]}}function Tl(t,e,i){if(t==null)return e(void 0),i&&i(void 0),ie;let o=_t(()=>t.subscribe(e,i));return o.unsubscribe?()=>o.unsubscribe():o}var Ba=[];function ar(t,e){return{subscribe:ae(t,e).subscribe}}function ae(t,e=ie){let i=null,o=new Set;function n(d){if(ha(t,d)&&(t=d,i)){let l=!Ba.length;for(let p of o)p[1](),Ba.push(p,t);if(l){for(let p=0;p<Ba.length;p+=2)Ba[p][0](Ba[p+1]);Ba.length=0}}}function a(d){n(d(t))}function s(d,l=ie){let p=[d,l];return o.add(p),o.size===1&&(i=e(n,a)||ie),d(t),()=>{o.delete(p),o.size===0&&i&&(i(),i=null)}}return{set:n,update:a,subscribe:s}}function vi(t,e,i){let o=!Array.isArray(t),n=o?[t]:t;if(!n.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");let a=e.length<2;return ar(i,(s,d)=>{let l=!1,p=[],f=0,_=ie,u=()=>{if(f)return;_();let w=e(o?p[0]:p,s,d);a?s(w):_=typeof w=="function"?w:ie},$=n.map((w,y)=>Tl(w,S=>{p[y]=S,f&=~(1<<y),l&&u()},()=>{f|=1<<y}));return l=!0,u(),function(){fs($),_(),l=!1}})}function ye(t){let e;return Tl(t,i=>e=i)(),e}var pc=!1,ap=Symbol();function C(t,e,i){var a;let o=(a=i[e])!=null?a:i[e]={store:null,source:Zr(void 0),unsubscribe:ie};if(o.store!==t&&!(ap in i))if(o.unsubscribe(),o.store=t!=null?t:null,t==null)o.source.v=void 0,o.unsubscribe=ie;else{var n=!0;o.unsubscribe=Tl(t,s=>{n?o.source.v=s:O(o.source,s)}),n=!1}return t&&ap in i?ye(t):r(o.source)}function He(){let t={};function e(){nn(()=>{for(var i in t)t[i].unsubscribe();oo(t,ap,{enumerable:!1,value:!0})})}return[t,e]}function lp(t){var e=pc;try{return pc=!1,[t(),pc]}finally{pc=e}}var V0={get(t,e){if(!t.exclude.includes(e))return t.props[e]},set(t,e){return Te&&nv(`${t.name}.${String(e)}`),!1},getOwnPropertyDescriptor(t,e){if(!t.exclude.includes(e)&&e in t.props)return{enumerable:!0,configurable:!0,value:t.props[e]}},has(t,e){return t.exclude.includes(e)?!1:e in t.props},ownKeys(t){return Reflect.ownKeys(t.props).filter(e=>!t.exclude.includes(e))}};function ke(t,e,i){return new Proxy(Te?{props:t,exclude:e,name:i,other:{},to_proxy:[]}:{props:t,exclude:e},V0)}var R0={get(t,e){let i=t.props.length;for(;i--;){let o=t.props[i];if(ps(o)&&(o=o()),typeof o=="object"&&o!==null&&e in o)return o[e]}},set(t,e,i){let o=t.props.length;for(;o--;){let n=t.props[o];ps(n)&&(n=n());let a=Bn(n,e);if(a&&a.set)return a.set(i),!0}return!1},getOwnPropertyDescriptor(t,e){let i=t.props.length;for(;i--;){let o=t.props[i];if(ps(o)&&(o=o()),typeof o=="object"&&o!==null&&e in o){let n=Bn(o,e);return n&&!n.configurable&&(n.configurable=!0),n}}},has(t,e){if(e===Oo||e===ol)return!1;for(let i of t.props)if(ps(i)&&(i=i()),i!=null&&e in i)return!0;return!1},ownKeys(t){let e=[];for(let i of t.props){ps(i)&&(i=i());for(let o in i)e.includes(o)||e.push(o)}return e}};function is(...t){return new Proxy({props:t},R0)}function hg(t){var e,i;return(i=(e=t.ctx)==null?void 0:e.d)!=null?i:!1}function v(t,e,i,o){var U,G;var n=(i&1)!==0,a=!Br||(i&2)!==0,s=(i&8)!==0,d=(i&16)!==0,l=!1,p;s?[p,l]=lp(()=>t[e]):p=t[e];var f=Oo in t||ol in t,_=s&&((G=(U=Bn(t,e))==null?void 0:U.set)!=null?G:f&&e in t&&(F=>t[e]=F))||void 0,u=o,$=!0,w=!1,y=()=>(w=!0,$&&($=!1,d?u=_t(o):u=o),u);p===void 0&&o!==void 0&&(_&&a&&ov(e),p=y(),_&&_(p));var S;if(a)S=()=>{var F=t[e];return F===void 0?y():($=!0,w=!1,F)};else{var k=(n?m:Sr)(()=>t[e]);k.f|=131072,S=()=>{var F=r(k);return F!==void 0&&(u=void 0),F===void 0?u:F}}if((i&4)===0)return S;if(_){var P=t.$$legacy;return function(F,Y){return arguments.length>0?((!a||!Y||P||l)&&_(Y?S():F),F):S()}}var A=!1,E=!1,T=Zr(p),V=m(()=>{var F=S(),Y=r(T);return A?(A=!1,E=!0,Y):(E=!1,T.v=F)});return s&&r(V),n||(V.equals=_a),function(F,Y){if(al!==null&&(A=E,S(),r(T)),arguments.length>0){let X=Y?r(V):a&&s?me(F):F;if(!V.equals(X)){if(A=!0,O(T,X),w&&u!==void 0&&(u=X),hg(V))return F;_t(()=>r(V))}return F}return hg(V)?V.v:r(V)}}var N0;typeof HTMLElement=="function"&&(N0=class extends HTMLElement{constructor(e,i,o){super();Nn(this,"$$ctor");Nn(this,"$$s");Nn(this,"$$c");Nn(this,"$$cn",!1);Nn(this,"$$d",{});Nn(this,"$$r",!1);Nn(this,"$$p_d",{});Nn(this,"$$l",{});Nn(this,"$$l_u",new Map);Nn(this,"$$me");this.$$ctor=e,this.$$s=i,o&&this.attachShadow({mode:"open"})}addEventListener(e,i,o){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(i),this.$$c){let n=this.$$c.$on(e,i);this.$$l_u.set(i,n)}super.addEventListener(e,i,o)}removeEventListener(e,i,o){if(super.removeEventListener(e,i,o),this.$$c){let n=this.$$l_u.get(i);n&&(n(),this.$$l_u.delete(i))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let i=function(a){return s=>{let d=document.createElement("slot");a!=="default"&&(d.name=a),b(s,d)}};var e=i;if(await Promise.resolve(),!this.$$cn||this.$$c)return;let o={},n=B0(this);for(let a of this.$$s)a in n&&(a==="default"&&!this.$$d.children?(this.$$d.children=i(a),o.default=!0):o[a]=i(a));for(let a of this.attributes){let s=this.$$g_p(a.name);s in this.$$d||(this.$$d[s]=dp(s,a.value,this.$$p_d,"toProp"))}for(let a in this.$$p_d)!(a in this.$$d)&&this[a]!==void 0&&(this.$$d[a]=this[a],delete this[a]);this.$$c=Zv({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:o,$$host:this}}),this.$$me=ic(()=>{_o(()=>{var a;this.$$r=!0;for(let s of _u(this.$$c)){if(!((a=this.$$p_d[s])!=null&&a.reflect))continue;this.$$d[s]=this.$$c[s];let d=dp(s,this.$$d[s],this.$$p_d,"toAttribute");d==null?this.removeAttribute(this.$$p_d[s].attribute||s):this.setAttribute(this.$$p_d[s].attribute||s,d)}this.$$r=!1})});for(let a in this.$$l)for(let s of this.$$l[a]){let d=this.$$c.$on(a,s);this.$$l_u.set(s,d)}this.$$l={}}}attributeChangedCallback(e,i,o){var n;this.$$r||(e=this.$$g_p(e),this.$$d[e]=dp(e,o,this.$$p_d,"toProp"),(n=this.$$c)==null||n.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(e){return _u(this.$$p_d).find(i=>this.$$p_d[i].attribute===e||!this.$$p_d[i].attribute&&i.toLowerCase()===e)||e}});function dp(t,e,i,o){var a;let n=(a=i[t])==null?void 0:a.type;if(e=n==="Boolean"&&typeof e!="boolean"?e!=null:e,!o||!i[t])return e;if(o==="toAttribute")switch(n){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e==null?null:e;default:return e}else switch(n){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}function B0(t){let e={};return t.childNodes.forEach(i=>{e[i.slot||"default"]=!0}),e}var _g="5";var bg,$g,yg;typeof window!="undefined"&&((yg=($g=(bg=window.__svelte)!=null?bg:window.__svelte={}).v)!=null?yg:$g.v=new Set).add(_g);import{clientChecker as Sm}from"@vkontakte/videoplayer-core/es2018";import"@vkontakte/videoplayer-core/es2018";import{noop as h1,safeStorage as px,throttleFn as fx}from"@vkontakte/videoplayer-shared/es2018";import{SeekAction as mx}from"@vkontakte/videoplayer-statistics/es2018";import{InterfaceLanguage as O0,fillWithDefault as H0,VideoQuality as xg}from"@vkontakte/videoplayer-shared/es2018";var F0={isMobile:void 0,debugLog:!1,devNullLog:!1,defaultLanguage:O0.RU,downloadVKLanguages:!0,updateBuiltinLanguages:!0,isSmoothVideoRotate:!0,showSupport:!0,supportLink:"https://vk.com/support?act=new&from=v",showLogo:void 0,logoLink:"https://vk.com/video",logoType:"vk_video",volumeDefault:1,volumeMinRestore:.05,loaderDelay:500,minSubtitlesFontSize:13,autoSubtitlesTimeout:2e3,allowChangingFullscreenTarget:!0,trafficSavingLimit:xg.Q_480P,highQualityLimit:xg.Q_720P,episodeMinWidthPc:8,hideThumbTimerAfterTouch:!0,preventPauseOnVideoClick:!1,sentry:{dsn:"https://e349fd23c68f405388980d0868d0ff27@sentry.mvk.com/126",sampleRate:.01,whiteErrorCategoryList:[],blackErrorCategoryList:[],whiteErrorIdList:[],blackErrorIdList:[]},features:{autoplay:!0,statistics:!0,sentry:!0,preload:!0,subtitles:!0,episodes:!0,fullscreen:!0,timelinePreview:!0,mediaSession:!0,annotations:!0,slots:!0,annotationsInside:!1,pip:!0,dpip:!0,download:!0,liveRewind:!0,playbackRate:!0,trafficSaving:!0,episodesClustering:!0,copyVideoLink:!0,videoRotate:!0,interactiveGraph:!1,interactiveResponsiveUi:!1,seekToInteractive:!0,interactiveLastFrame:!1,interactiveTextPermanent:!0,interactiveHideTime:!0,interactivePlayPrevChapter:!0,interactiveTimeIndicator:!0,interactiveTimeOpenUri:!1,interactiveAreaControlShadow:!1,interactiveControlsExpectTimeBlinkAnimation:!1,thumbTimer:!0,hotKeyMapModal:!0,hotKeyHelpers:!0,saveDebugInfoToFile:!1,saveTraceInfoToFile:!1,additionalButtons:!0,additionalButtonsDesktopControlPanelRight:!0,additionalSettingsMenuItems:!0,additionalContextMenuItems:!0,contextMenuButton:!0,audioLanguages:!1,saveRate:!1,fullscreenInternalTargetPlayerContainer:!1,endScreen:!0,autoplayNext:!0,nextPrevButtons:!0,previewNoEmptySpace:!1,exposeInternalsToGlobal:!1,skipInitialPlaybackRateValue:!1,qualityDetailsSubMenuEnabled:!1,showSlowVideoNotification:!1,forceAutoQualityWhenSevereStallHappens:!1,timeoutShowSlowVideoNotification:0,maxCountShowSlowVideoNotification:1,forcePlayerDisplayBlock:!1,playbackStatusAnimationDuration:1e3,playbackStatusShow:!1,playbackStatusNextVideoShow:!1,playbackStatusNextVideoAnimationDuration:1e3},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}},wg=t=>H0(t,F0),Sg=t=>Pa("ui-config",t),Wt=()=>Ea("ui-config");var kl="vk_player_debug_panel_opened";var Cg="videoplayer",Tg="videoplayer";var Fr={KeyF:"f",KeyK:"k",KeyC:"c",KeyM:"m"},kg=new Set(["ArrowLeft","ArrowRight","KeyL","KeyJ"]),Ig=new Set(["Tab","Space","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"]),Eg=new Set(["ShiftRight","ShiftLeft"]);var Pg=["TIMELINE"],Il=[...Pg,"GRAPH_BUTTON"],cp=[...Pg,"PLAY_BUTTON"],El=[...Il,"PLAY_BUTTON"];var Ur=(a=>(a.XS="xs",a.S="s",a.M="m",a.L="l",a.XL="xl",a))(Ur||{}),Ws={xs:0,s:1,m:2,l:3,xl:4};import{assertNonNullable as Ag,VERSION as U0}from"@vkontakte/videoplayer-shared/es2018";import{VERSION as z0}from"@vkontakte/videoplayer-core/es2018";import{VERSION as q0}from"@vkontakte/videoplayer-statistics/es2018";var fc="prod",Da="1.1.62-dev.b50ee8d3.0";var Ks=(t,e,i)=>{let o=document.createElement("a");o.href=t,o.download=`${e}.${i}`,o.style.display="none",o.click()};var Mg=Symbol("storeContext"),Lg=Symbol("microStoresContext"),Vg=(t,e)=>{Pa(Mg,t),Pa(Lg,e),fc==="dev"&&(window.app={store:t,microStores:e})},Se=()=>{let t=Ea(Mg);return Ag(t,"Store context is empty!"),t},lo=()=>{let t=Ea(Lg);return Ag(t,"MicroStores context is empty!"),t},Yt=(t,e)=>vc(t,t.getValue(),e),vc=(t,e,i)=>ar(e,o=>{let n=t.subscribe(a=>{o(a),i==null||i(a)});return()=>n.unsubscribe()}),Rg=(t,e,i)=>{var k,P,A,E,T,V;let o=t.info,{width:n,height:a}=ye(i.ui.playerSize),s=(P=(k=o.throughputEstimation$.getValue())==null?void 0:k.toFixed(0))!=null?P:0,d=(E=(A=o.rttEstimation$.getValue())==null?void 0:A.toFixed(0))!=null?E:0,l=o.isAutoQualityEnabled$.getValue()?"auto":"manual",p=`${Da} (core: ${z0}, stat: ${q0}, shared: ${U0})`,f=ye(i.state.errorLog$),_=f.length?`
|
|
48
|
+
\r\f\xA0\v\uFEFF`];function ig(t,e,i){var o=t==null?"":""+t;if(e&&(o=o?o+" "+e:e),i){for(var n in i)if(i[n])o=o?o+" "+n:n;else if(o.length)for(var a=n.length,s=0;(s=o.indexOf(n,s))>=0;){var d=s+a;(s===0||eg.includes(o[s-1]))&&(d===o.length||eg.includes(o[d]))?o=(s===0?"":o.substring(0,s))+o.substring(d+1):s=d}}return o===""?null:o}function tg(t,e=!1){var i=e?" !important;":";",o="";for(var n in t){var a=t[n];a!=null&&a!==""&&(o+=" "+n+": "+a+i)}return o}function tp(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function og(t,e){if(e){var i="",o,n;if(Array.isArray(e)?(o=e[0],n=e[1]):o=e,t){t=String(t).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var a=!1,s=0,d=!1,l=[];o&&l.push(...Object.keys(o).map(tp)),n&&l.push(...Object.keys(n).map(tp));var p=0,f=-1;let y=t.length;for(var _=0;_<y;_++){var u=t[_];if(d?u==="/"&&t[_-1]==="*"&&(d=!1):a?a===u&&(a=!1):u==="/"&&t[_+1]==="*"?d=!0:u==='"'||u==="'"?a=u:u==="("?s++:u===")"&&s--,!d&&a===!1&&s===0){if(u===":"&&f===-1)f=_;else if(u===";"||_===y-1){if(f!==-1){var $=tp(t.substring(p,f).trim());if(!l.includes($)){u!==";"&&_++;var w=t.substring(p,_).trim();i+=" "+w+";"}}p=_+1,f=-1}}}}return o&&(i+=tg(o)),n&&(i+=tg(n,!0)),i=i.trim(),i===""?null:i}return t==null?null:String(t)}function te(t,e,i,o,n,a){var s=t.__className;if(Ye||s!==i){var d=ig(i,o,a);(!Ye||d!==t.getAttribute("class"))&&(d==null?t.removeAttribute("class"):e?t.className=d:t.setAttribute("class",d)),t.__className=i}else if(a&&n!==a)for(var l in a){var p=!!a[l];(n==null||p!==!!n[l])&&t.classList.toggle(l,p)}return a}function ip(t,e={},i,o){for(var n in i){var a=i[n];e[n]!==a&&(i[n]==null?t.style.removeProperty(n):t.style.setProperty(n,a,o))}}function et(t,e,i,o){var n=t.__style;if(Ye||n!==e){var a=og(e,o);(!Ye||a!==t.getAttribute("style"))&&(a==null?t.removeAttribute("style"):t.style.cssText=a),t.__style=e}else o&&(Array.isArray(o)?(ip(t,i==null?void 0:i[0],o[0]),ip(t,i==null?void 0:i[1],o[1],"important")):ip(t,i,o));return o}var Va=Symbol("class"),Ra=Symbol("style"),sg=Symbol("is custom element"),ag=Symbol("is html");function lg(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function Oe(t,e,i,o){var n=dg(t);if(Ye&&(n[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName==="LINK")){o||v0(t,e,i!=null?i:"");return}n[e]!==(n[e]=i)&&(e==="loading"&&(t[qm]=i),i==null?t.removeAttribute(e):typeof i!="string"&&cg(t).includes(e)?t[e]=i:t.setAttribute(e,i))}function we(t,e,i,o,n=!1){var E;var a=dg(t),s=a[sg],d=!a[ag];let l=Ye&&s;l&&so(!1);var p=e||{},f=t.tagName==="OPTION";for(var _ in e)_ in i||(i[_]=null);i.class?i.class=Sl(i.class):(o||i[Va])&&(i.class=null),i[Ra]&&((E=i.style)!=null||(i.style=null));var u=cg(t);for(let T in i){let V=i[T];if(f&&T==="value"&&V==null){t.value=t.__value="",p[T]=V;continue}if(T==="class"){var $=t.namespaceURI==="http://www.w3.org/1999/xhtml";te(t,$,V,o,e==null?void 0:e[Va],i[Va]),p[T]=V,p[Va]=i[Va];continue}if(T==="style"){et(t,V,e==null?void 0:e[Ra],i[Ra]),p[T]=V,p[Ra]=i[Ra];continue}var w=p[T];if(V!==w){p[T]=V;var y=T[0]+T[1];if(y!=="$$")if(y==="on"){let U={},G="$$"+T,F=T.slice(2);var S=Ov(F);if(Dv(F)&&(F=F.slice(0,-7),U.capture=!0),!S&&w){if(V!=null)continue;t.removeEventListener(F,p[G],U),p[G]=null}if(V!=null)if(S)t[`__${F}`]=V,rt([F]);else{let Y=function(X){p[T].call(this,X)};var A=Y;p[G]=Qu(F,t,Y,U)}else S&&(t[`__${F}`]=void 0)}else if(T==="style")Oe(t,T,V);else if(T==="autofocus")Wu(t,!!V);else if(!s&&(T==="__value"||T==="value"&&V!=null))t.value=t.__value=V;else if(T==="selected"&&f)lg(t,V);else{var k=T;d||(k=Hv(k));var P=k==="defaultValue"||k==="defaultChecked";if(V==null&&!s&&!P)if(a[T]=null,k==="value"||k==="checked"){let U=t,G=e===void 0;if(k==="value"){let F=U.defaultValue;U.removeAttribute(k),U.defaultValue=F,U.value=U.__value=G?F:null}else{let F=U.defaultChecked;U.removeAttribute(k),U.defaultChecked=F,U.checked=G?F:!1}}else t.removeAttribute(T);else P||u.includes(k)&&(s||typeof V!="string")?t[k]=V:typeof V!="function"&&Oe(t,k,V,n)}}}return l&&so(!0),p}function dg(t){var e;return(e=t.__attributes)!=null?e:t.__attributes={[sg]:t.nodeName.includes("-"),[ag]:t.namespaceURI===Hm}}var ng=new Map;function cg(t){var e=ng.get(t.nodeName);if(e)return e;ng.set(t.nodeName,e=[]);for(var i,o=t,n=Element.prototype;n!==o;){i=Ud(o);for(var a in i)i[a].set&&e.push(a);o=Gr(o)}return e}function v0(t,e,i){var o;Te&&(e==="srcset"&&g0(t,i)||op((o=t.getAttribute(e))!=null?o:"",i)||vv(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 rg(t){return t.split(",").map(e=>e.trim().split(" ").filter(Boolean))}function g0(t,e){var i=rg(t.srcset),o=rg(e);return o.length===i.length&&o.every(([n,a],s)=>a===i[s][1]&&(op(i[s][0],n)||op(n,i[s][0])))}var h0=Fd?()=>performance.now():()=>Date.now(),Tr={tick:t=>(Fd?requestAnimationFrame:ie)(t),now:()=>h0(),tasks:new Set};function ug(){let t=Tr.now();Tr.tasks.forEach(e=>{e.c(t)||(Tr.tasks.delete(e),e.f())}),Tr.tasks.size!==0&&Tr.tick(ug)}function pg(t){let e;return Tr.tasks.size===0&&Tr.tick(ug),{promise:new Promise(i=>{Tr.tasks.add(e={c:t,f:i})}),abort(){Tr.tasks.delete(e)}}}function lc(t,e){bl(()=>{t.dispatchEvent(new CustomEvent(e))})}function y0(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 fg(t){let e={},i=t.split(";");for(let o of i){let[n,a]=o.split(":");if(!n||a===void 0)break;let s=y0(n.trim());e[s]=a.trim()}return e}var x0=t=>t;function rp(t,e,i,o){var A;var n=(t&1)!==0,a=(t&2)!==0,s=n&&a,d=(t&4)!==0,l=s?"both":n?"in":"out",p,f=e.inert,_=e.style.overflow,u,$;function w(){var V;var E=Rt,T=yt;go(null),no(null);try{return p!=null?p:p=i()(e,(V=o==null?void 0:o())!=null?V:{},{direction:l})}finally{go(E),no(T)}}var y={is_global:d,in(){var E;if(e.inert=f,!n){$==null||$.abort(),(E=$==null?void 0:$.reset)==null||E.call($);return}a||u==null||u.abort(),lc(e,"introstart"),u=np(e,w(),$,1,()=>{lc(e,"introend"),u==null||u.abort(),u=p=void 0,e.style.overflow=_})},out(E){if(!a){E==null||E(),p=void 0;return}e.inert=!0,lc(e,"outrostart"),$=np(e,w(),u,0,()=>{lc(e,"outroend"),E==null||E()})},stop:()=>{u==null||u.abort(),$==null||$.abort()}},S=yt;if(((A=S.transitions)!=null?A:S.transitions=[]).push(y),n&&$l){var k=d;if(!k){for(var P=S.parent;P&&(P.f&65536)!==0;)for(;(P=P.parent)&&(P.f&16)===0;);k=!P||(P.f&32768)!==0}k&&vn(()=>{_t(()=>y.in())})}}function np(t,e,i,o,n){var a=o===1;if(ps(e)){var s,d=!1;return jo(()=>{if(!d){var S=e({direction:a?"in":"out"});s=np(t,S,i,o,n)}}),{abort:()=>{d=!0,s==null||s.abort()},deactivate:()=>s.deactivate(),reset:()=>s.reset(),t:()=>s.t()}}if(i==null||i.deactivate(),!(e!=null&&e.duration))return n(),{abort:ie,deactivate:ie,reset:ie,t:()=>o};let{delay:l=0,css:p,tick:f,easing:_=x0}=e;var u=[];if(a&&i===void 0&&(f&&f(0,1),p)){var $=fg(p(0,1));u.push($,$)}var w=()=>1-o,y=t.animate(u,{duration:l});return y.onfinish=()=>{var F;var S=(F=i==null?void 0:i.t())!=null?F:1-o;i==null||i.abort();var k=o-S,P=e.duration*Math.abs(k),A=[];if(P>0){var E=!1;if(p)for(var T=Math.ceil(P/16.666666666666668),V=0;V<=T;V+=1){var U=S+k*_(V/T),G=fg(p(U,1-U));A.push(G),E||(E=G.overflow==="hidden")}E&&(t.style.overflow="hidden"),w=()=>{var Y=y.currentTime;return S+k*_(Y/P)},f&&pg(()=>{if(y.playState!=="running")return!1;var Y=w();return f(Y,1-Y),!0})}y=t.animate(A,{duration:P,fill:"forwards"}),y.onfinish=()=>{w=()=>o,f==null||f(o,1-o),n()}},{abort:()=>{y&&(y.cancel(),y.effect=null,y.onfinish=ie)},deactivate:()=>{n=ie},reset:()=>{o===0&&(f==null||f(1,0))},t:()=>w()}}var hs,Na,Cl,cc,mg,uc=class uc{constructor(e){cs(this,cc);cs(this,hs,new WeakMap);cs(this,Na);cs(this,Cl);ga(this,Cl,e)}observe(e,i){var o=Ii(this,hs).get(e)||new Set;return o.add(i),Ii(this,hs).set(e,o),Dm(this,cc,mg).call(this).observe(e,Ii(this,Cl)),()=>{var n=Ii(this,hs).get(e);n.delete(i),n.size===0&&(Ii(this,hs).delete(e),Ii(this,Na).unobserve(e))}}};hs=new WeakMap,Na=new WeakMap,Cl=new WeakMap,cc=new WeakSet,mg=function(){var e;return(e=Ii(this,Na))!=null?e:ga(this,Na,new ResizeObserver(i=>{for(var o of i){uc.entries.set(o.target,o);for(var n of Ii(this,hs).get(o.target)||[])n(o)}}))},Nn(uc,"entries",new WeakMap);var sp=uc;var C0=new sp({box:"border-box"});function Hr(t,e,i){var o=C0.observe(t,()=>i(t[e]));vn(()=>(_t(()=>i(t[e])),o))}function vg(t,e){return t===e||(t==null?void 0:t[Oo])===e}function dt(t={},e,i,o){return vn(()=>{var n,a;return _o(()=>{n=a,a=(o==null?void 0:o())||[],_t(()=>{t!==i(...a)&&(e(t,...a),n&&vg(i(...n),t)&&e(null,...n))})}),()=>{jo(()=>{a&&vg(i(...a),t)&&e(null,...a)})}}),t}function kr(t=!1){let e=St,i=e.l.u;if(!i)return;let o=()=>ec(e.s);if(t){let n=0,a={},s=m(()=>{let d=!1,l=e.s;for(let p in l)l[p]!==a[p]&&(a[p]=l[p],d=!0);return d&&n++,n});o=()=>r(s)}i.b.length&&ka(()=>{gg(e,o),fs(i.b)}),qe(()=>{let n=_t(()=>i.m.map(Qm));return()=>{for(let a of n)typeof a=="function"&&a()}}),i.a.length&&qe(()=>{gg(e,o),fs(i.a)})}function gg(t,e){if(t.l.s)for(let i of t.l.s)r(i);e()}if(Te){let t=function(e){if(!(e in globalThis)){let i;Object.defineProperty(globalThis,e,{configurable:!0,get:()=>{if(i!==void 0)return i;rv(e)},set:o=>{i=o}})}};k0=t,t("$state"),t("$effect"),t("$derived"),t("$inspect"),t("$props"),t("$bindable")}var k0;function Ot(t){St===null&&Ia("onMount"),Br&&St.l!==null?T0(St).m.push(t):qe(()=>{let e=_t(t);if(typeof e=="function")return e})}function hn(t){St===null&&Ia("onDestroy"),Ot(()=>()=>_t(t))}function T0(t){var i;var e=t.l;return(i=e.u)!=null?i:e.u={a:[],b:[],m:[]}}function Tl(t,e,i){if(t==null)return e(void 0),i&&i(void 0),ie;let o=_t(()=>t.subscribe(e,i));return o.unsubscribe?()=>o.unsubscribe():o}var Ba=[];function ar(t,e){return{subscribe:ae(t,e).subscribe}}function ae(t,e=ie){let i=null,o=new Set;function n(d){if(ha(t,d)&&(t=d,i)){let l=!Ba.length;for(let p of o)p[1](),Ba.push(p,t);if(l){for(let p=0;p<Ba.length;p+=2)Ba[p][0](Ba[p+1]);Ba.length=0}}}function a(d){n(d(t))}function s(d,l=ie){let p=[d,l];return o.add(p),o.size===1&&(i=e(n,a)||ie),d(t),()=>{o.delete(p),o.size===0&&i&&(i(),i=null)}}return{set:n,update:a,subscribe:s}}function vi(t,e,i){let o=!Array.isArray(t),n=o?[t]:t;if(!n.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");let a=e.length<2;return ar(i,(s,d)=>{let l=!1,p=[],f=0,_=ie,u=()=>{if(f)return;_();let w=e(o?p[0]:p,s,d);a?s(w):_=typeof w=="function"?w:ie},$=n.map((w,y)=>Tl(w,S=>{p[y]=S,f&=~(1<<y),l&&u()},()=>{f|=1<<y}));return l=!0,u(),function(){fs($),_(),l=!1}})}function ye(t){let e;return Tl(t,i=>e=i)(),e}var pc=!1,ap=Symbol();function C(t,e,i){var a;let o=(a=i[e])!=null?a:i[e]={store:null,source:Zr(void 0),unsubscribe:ie};if(o.store!==t&&!(ap in i))if(o.unsubscribe(),o.store=t!=null?t:null,t==null)o.source.v=void 0,o.unsubscribe=ie;else{var n=!0;o.unsubscribe=Tl(t,s=>{n?o.source.v=s:O(o.source,s)}),n=!1}return t&&ap in i?ye(t):r(o.source)}function He(){let t={};function e(){nn(()=>{for(var i in t)t[i].unsubscribe();oo(t,ap,{enumerable:!1,value:!0})})}return[t,e]}function lp(t){var e=pc;try{return pc=!1,[t(),pc]}finally{pc=e}}var V0={get(t,e){if(!t.exclude.includes(e))return t.props[e]},set(t,e){return Te&&nv(`${t.name}.${String(e)}`),!1},getOwnPropertyDescriptor(t,e){if(!t.exclude.includes(e)&&e in t.props)return{enumerable:!0,configurable:!0,value:t.props[e]}},has(t,e){return t.exclude.includes(e)?!1:e in t.props},ownKeys(t){return Reflect.ownKeys(t.props).filter(e=>!t.exclude.includes(e))}};function ke(t,e,i){return new Proxy(Te?{props:t,exclude:e,name:i,other:{},to_proxy:[]}:{props:t,exclude:e},V0)}var R0={get(t,e){let i=t.props.length;for(;i--;){let o=t.props[i];if(ps(o)&&(o=o()),typeof o=="object"&&o!==null&&e in o)return o[e]}},set(t,e,i){let o=t.props.length;for(;o--;){let n=t.props[o];ps(n)&&(n=n());let a=Bn(n,e);if(a&&a.set)return a.set(i),!0}return!1},getOwnPropertyDescriptor(t,e){let i=t.props.length;for(;i--;){let o=t.props[i];if(ps(o)&&(o=o()),typeof o=="object"&&o!==null&&e in o){let n=Bn(o,e);return n&&!n.configurable&&(n.configurable=!0),n}}},has(t,e){if(e===Oo||e===ol)return!1;for(let i of t.props)if(ps(i)&&(i=i()),i!=null&&e in i)return!0;return!1},ownKeys(t){let e=[];for(let i of t.props){ps(i)&&(i=i());for(let o in i)e.includes(o)||e.push(o)}return e}};function is(...t){return new Proxy({props:t},R0)}function hg(t){var e,i;return(i=(e=t.ctx)==null?void 0:e.d)!=null?i:!1}function v(t,e,i,o){var U,G;var n=(i&1)!==0,a=!Br||(i&2)!==0,s=(i&8)!==0,d=(i&16)!==0,l=!1,p;s?[p,l]=lp(()=>t[e]):p=t[e];var f=Oo in t||ol in t,_=s&&((G=(U=Bn(t,e))==null?void 0:U.set)!=null?G:f&&e in t&&(F=>t[e]=F))||void 0,u=o,$=!0,w=!1,y=()=>(w=!0,$&&($=!1,d?u=_t(o):u=o),u);p===void 0&&o!==void 0&&(_&&a&&ov(e),p=y(),_&&_(p));var S;if(a)S=()=>{var F=t[e];return F===void 0?y():($=!0,w=!1,F)};else{var k=(n?m:Sr)(()=>t[e]);k.f|=131072,S=()=>{var F=r(k);return F!==void 0&&(u=void 0),F===void 0?u:F}}if((i&4)===0)return S;if(_){var P=t.$$legacy;return function(F,Y){return arguments.length>0?((!a||!Y||P||l)&&_(Y?S():F),F):S()}}var A=!1,E=!1,T=Zr(p),V=m(()=>{var F=S(),Y=r(T);return A?(A=!1,E=!0,Y):(E=!1,T.v=F)});return s&&r(V),n||(V.equals=_a),function(F,Y){if(al!==null&&(A=E,S(),r(T)),arguments.length>0){let X=Y?r(V):a&&s?me(F):F;if(!V.equals(X)){if(A=!0,O(T,X),w&&u!==void 0&&(u=X),hg(V))return F;_t(()=>r(V))}return F}return hg(V)?V.v:r(V)}}var N0;typeof HTMLElement=="function"&&(N0=class extends HTMLElement{constructor(e,i,o){super();Nn(this,"$$ctor");Nn(this,"$$s");Nn(this,"$$c");Nn(this,"$$cn",!1);Nn(this,"$$d",{});Nn(this,"$$r",!1);Nn(this,"$$p_d",{});Nn(this,"$$l",{});Nn(this,"$$l_u",new Map);Nn(this,"$$me");this.$$ctor=e,this.$$s=i,o&&this.attachShadow({mode:"open"})}addEventListener(e,i,o){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(i),this.$$c){let n=this.$$c.$on(e,i);this.$$l_u.set(i,n)}super.addEventListener(e,i,o)}removeEventListener(e,i,o){if(super.removeEventListener(e,i,o),this.$$c){let n=this.$$l_u.get(i);n&&(n(),this.$$l_u.delete(i))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let i=function(a){return s=>{let d=document.createElement("slot");a!=="default"&&(d.name=a),b(s,d)}};var e=i;if(await Promise.resolve(),!this.$$cn||this.$$c)return;let o={},n=B0(this);for(let a of this.$$s)a in n&&(a==="default"&&!this.$$d.children?(this.$$d.children=i(a),o.default=!0):o[a]=i(a));for(let a of this.attributes){let s=this.$$g_p(a.name);s in this.$$d||(this.$$d[s]=dp(s,a.value,this.$$p_d,"toProp"))}for(let a in this.$$p_d)!(a in this.$$d)&&this[a]!==void 0&&(this.$$d[a]=this[a],delete this[a]);this.$$c=Zv({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:o,$$host:this}}),this.$$me=ic(()=>{_o(()=>{var a;this.$$r=!0;for(let s of _u(this.$$c)){if(!((a=this.$$p_d[s])!=null&&a.reflect))continue;this.$$d[s]=this.$$c[s];let d=dp(s,this.$$d[s],this.$$p_d,"toAttribute");d==null?this.removeAttribute(this.$$p_d[s].attribute||s):this.setAttribute(this.$$p_d[s].attribute||s,d)}this.$$r=!1})});for(let a in this.$$l)for(let s of this.$$l[a]){let d=this.$$c.$on(a,s);this.$$l_u.set(s,d)}this.$$l={}}}attributeChangedCallback(e,i,o){var n;this.$$r||(e=this.$$g_p(e),this.$$d[e]=dp(e,o,this.$$p_d,"toProp"),(n=this.$$c)==null||n.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(e){return _u(this.$$p_d).find(i=>this.$$p_d[i].attribute===e||!this.$$p_d[i].attribute&&i.toLowerCase()===e)||e}});function dp(t,e,i,o){var a;let n=(a=i[t])==null?void 0:a.type;if(e=n==="Boolean"&&typeof e!="boolean"?e!=null:e,!o||!i[t])return e;if(o==="toAttribute")switch(n){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e==null?null:e;default:return e}else switch(n){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}function B0(t){let e={};return t.childNodes.forEach(i=>{e[i.slot||"default"]=!0}),e}var _g="5";var bg,$g,yg;typeof window!="undefined"&&((yg=($g=(bg=window.__svelte)!=null?bg:window.__svelte={}).v)!=null?yg:$g.v=new Set).add(_g);import{clientChecker as Sm}from"@vkontakte/videoplayer-core/es2018";import"@vkontakte/videoplayer-core/es2018";import{noop as h1,safeStorage as px,throttleFn as fx}from"@vkontakte/videoplayer-shared/es2018";import{SeekAction as mx}from"@vkontakte/videoplayer-statistics/es2018";import{InterfaceLanguage as O0,fillWithDefault as H0,VideoQuality as xg}from"@vkontakte/videoplayer-shared/es2018";var F0={isMobile:void 0,debugLog:!1,devNullLog:!1,defaultLanguage:O0.RU,downloadVKLanguages:!0,updateBuiltinLanguages:!0,isSmoothVideoRotate:!0,showSupport:!0,supportLink:"https://vk.com/support?act=new&from=v",showLogo:void 0,logoLink:"https://vk.com/video",logoType:"vk_video",volumeDefault:1,volumeMinRestore:.05,loaderDelay:500,minSubtitlesFontSize:13,autoSubtitlesTimeout:2e3,allowChangingFullscreenTarget:!0,trafficSavingLimit:xg.Q_480P,highQualityLimit:xg.Q_720P,episodeMinWidthPc:8,hideThumbTimerAfterTouch:!0,preventPauseOnVideoClick:!1,sentry:{dsn:"https://e349fd23c68f405388980d0868d0ff27@sentry.mvk.com/126",sampleRate:.01,whiteErrorCategoryList:[],blackErrorCategoryList:[],whiteErrorIdList:[],blackErrorIdList:[]},features:{autoplay:!0,statistics:!0,sentry:!0,preload:!0,subtitles:!0,episodes:!0,fullscreen:!0,timelinePreview:!0,mediaSession:!0,annotations:!0,slots:!0,annotationsInside:!1,pip:!0,dpip:!0,download:!0,liveRewind:!0,playbackRate:!0,trafficSaving:!0,episodesClustering:!0,copyVideoLink:!0,videoRotate:!0,interactiveGraph:!1,interactiveResponsiveUi:!1,seekToInteractive:!0,interactiveLastFrame:!1,interactiveTextPermanent:!0,interactiveHideTime:!0,interactivePlayPrevChapter:!0,interactiveTimeIndicator:!0,interactiveTimeOpenUri:!1,interactiveAreaControlShadow:!1,interactiveControlsExpectTimeBlinkAnimation:!1,thumbTimer:!0,hotKeyMapModal:!0,hotKeyHelpers:!0,saveDebugInfoToFile:!1,saveTraceInfoToFile:!1,additionalButtons:!0,additionalButtonsDesktopControlPanelRight:!0,additionalSettingsMenuItems:!0,additionalContextMenuItems:!0,contextMenuButton:!0,audioLanguages:!1,saveRate:!1,fullscreenInternalTargetPlayerContainer:!1,endScreen:!0,autoplayNext:!0,nextPrevButtons:!0,previewNoEmptySpace:!1,exposeInternalsToGlobal:!1,skipInitialPlaybackRateValue:!1,qualityDetailsSubMenuEnabled:!1,showSlowVideoNotification:!1,forceAutoQualityWhenSevereStallHappens:!1,timeoutShowSlowVideoNotification:0,maxCountShowSlowVideoNotification:1,forcePlayerDisplayBlock:!1,playbackStatusAnimationDuration:1e3,playbackStatusShow:!1,playbackStatusNextVideoShow:!1,playbackStatusNextVideoAnimationDuration:1e3},controls:{showOnStartupAtAutoplay:!0,hideTimeout:500,hideTimeoutMobile:3e3,hideTimeoutInitial:200,hideTimeoutFullscreen:3e3,hideTimeoutCursor:3e3,hideTimeoutTooltips:1e3,collapseMobileUnmute:6e3,hide360IconTimeout:3e3,hideHotKeyHelpers:2e3,playbackRateMin:.25,playbackRateMax:2,playbackRateStep:.25,volumeStepKeyboard:.05,volumeStepWheel:.05,volumeBarTimeout:300,seekStepKeyboard:1e4,seekStepMobile:15e3,seekStepFrame:400},ads:{enable:void 0,initTimeout:2e3,loadTimeout:2e3,runtimeTimeout:5e3,slot:void 0,preview:void 0,isMobileGoToSiteButton:!0,useAdmanFromNPM:!1,volumeMultiplier:1,isVsidOriginal:!1},interactive:{historyMaxLength:100,noInteractionEventTimeout:3e4},view:{timelineSliderColor:null,timelineSliderHandleColor:null,timelineSliderFilledColor:null,timelineSliderLoadedColor:null,volumeSliderColor:null,volumeSliderHandleColor:null,volumeSliderFilledColor:null,controlsTimeColor:null,timelineSliderFilledActiveLiveColor:null,timelineSliderHandleActiveLiveColor:null,buttonColor:null,buttonToggleOnColor:null,focusedColor:null}},wg=t=>H0(t,F0),Sg=t=>Pa("ui-config",t),Wt=()=>Ea("ui-config");var kl="vk_player_debug_panel_opened";var Cg="videoplayer",Tg="videoplayer";var Fr={KeyF:"f",KeyK:"k",KeyC:"c",KeyM:"m"},kg=new Set(["ArrowLeft","ArrowRight","KeyL","KeyJ"]),Ig=new Set(["Tab","Space","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"]),Eg=new Set(["ShiftRight","ShiftLeft"]);var Pg=["TIMELINE"],Il=[...Pg,"GRAPH_BUTTON"],cp=[...Pg,"PLAY_BUTTON"],El=[...Il,"PLAY_BUTTON"];var Ur=(a=>(a.XS="xs",a.S="s",a.M="m",a.L="l",a.XL="xl",a))(Ur||{}),Ws={xs:0,s:1,m:2,l:3,xl:4};import{assertNonNullable as Ag,VERSION as U0}from"@vkontakte/videoplayer-shared/es2018";import{VERSION as z0}from"@vkontakte/videoplayer-core/es2018";import{VERSION as q0}from"@vkontakte/videoplayer-statistics/es2018";var fc="prod",Da="1.1.62-dev.cb3c3ded.0";var Ks=(t,e,i)=>{let o=document.createElement("a");o.href=t,o.download=`${e}.${i}`,o.style.display="none",o.click()};var Mg=Symbol("storeContext"),Lg=Symbol("microStoresContext"),Vg=(t,e)=>{Pa(Mg,t),Pa(Lg,e),fc==="dev"&&(window.app={store:t,microStores:e})},Se=()=>{let t=Ea(Mg);return Ag(t,"Store context is empty!"),t},lo=()=>{let t=Ea(Lg);return Ag(t,"MicroStores context is empty!"),t},Yt=(t,e)=>vc(t,t.getValue(),e),vc=(t,e,i)=>ar(e,o=>{let n=t.subscribe(a=>{o(a),i==null||i(a)});return()=>n.unsubscribe()}),Rg=(t,e,i)=>{var k,P,A,E,T,V;let o=t.info,{width:n,height:a}=ye(i.ui.playerSize),s=(P=(k=o.throughputEstimation$.getValue())==null?void 0:k.toFixed(0))!=null?P:0,d=(E=(A=o.rttEstimation$.getValue())==null?void 0:A.toFixed(0))!=null?E:0,l=o.isAutoQualityEnabled$.getValue()?"auto":"manual",p=`${Da} (core: ${z0}, stat: ${q0}, shared: ${U0})`,f=ye(i.state.errorLog$),_=f.length?`
|
|
49
49
|
`+f.map((U,G)=>{var oe;let F=`${G}) Type: ${U.id}
|
|
50
50
|
`,Y=`Message: ${U.message} (${U.thrown})
|
|
51
51
|
`,X=`Trace: ${(oe=U.thrown)==null?void 0:oe.stack}
|
|
@@ -226,7 +226,7 @@ Try switching the\xA0quality to\xA0Auto.`},oh=G0;var os=new Map;os.set(rh.EN,oh)
|
|
|
226
226
|
}
|
|
227
227
|
}`};function lf(t,e){z(e,!0),K(t,I$);let i=v(e,"isMobile",3,!1),o=m(()=>e.iconState===Ah.CONNECTED),n=m(()=>e.iconState===Ah.CONNECTING);var a=Fe(),s=ue(a);{var d=p=>{var f=T$(),_=h(f),u=h(_),$=h(u);_e(),g(u);var w=M(u);_e(),g(_);var y=M(_),S=h(y),k=h(S);g(S),_e(),g(y),g(f),I(()=>{Oe($,"fill",r(o)?"#2688EB":"var(--btn-color, #fff)"),Oe(w,"fill",r(o)?"#2688EB":"var(--btn-color, #fff)"),Oe(k,"fill",r(o)?"#2688EB":"var(--btn-color, #fff)")}),b(p,f)},l=p=>{var f=k$();let _;var u=h(f),$=M(h(u),5);let w;g(u),g(f),I((y,S)=>{_=te(f,0,"svelte-8z1bf5",null,_,y),w=te($,0,"svelte-8z1bf5",null,w,S)},[()=>({connecting:r(n)}),()=>({hidden:!r(o)})]),b(p,f)};R(s,p=>{i()?p(d):p(l,!1)})}b(t,a),q()}import{noop as P$}from"@vkontakte/videoplayer-shared/es2018";function Zl(t,e){z(e,!0);let i=v(e,"ref",15,void 0),o=v(e,"isMobile",3,!1),n=v(e,"click",3,P$),s=Se().ui.t,d=m(()=>e.state===E$.CONNECTED?s("tooltip_chromecast_on"):s("tooltip_chromecast_off"));Et(t,{get ariaLabel(){return r(d)},get click(){return n()},testId:"btn-chromecast",get ref(){return i()},set ref(l){i(l)},children:(l,p)=>{lf(l,{get isMobile(){return o()},get iconState(){return e.state}})},$$slots:{default:!0}}),q()}var A$=L('<div class="tooltip-wrapper svelte-5ygsa2"><div><!></div></div>'),M$={hash:"svelte-5ygsa2",code:'.tooltip-wrapper.svelte-5ygsa2 {position:relative;display:block;}.tooltip.svelte-5ygsa2 {position:absolute;opacity:0;visibility:hidden;transition:opacity 200ms, visibility 200ms;bottom:100%;transform:translateX(-50%);}.pointer.svelte-5ygsa2:after {position:absolute;bottom:0;left:50%;width:0;border-top:5px solid rgba(41, 41, 41, .8);border-right:5px solid transparent;border-left:5px solid transparent;content:" ";font-size:0;line-height:0;transform:translate(-50%, 5px);}.tooltip.active.svelte-5ygsa2 {opacity:1;visibility:visible;}'};function df(t,e){K(t,M$);let i=v(e,"active",3,!1),o=v(e,"pointer",3,!1),n=v(e,"translateXPx",3,0),a=v(e,"translateYPx",3,0),s=ee(void 0),d=ee(void 0);function l(w){if(!r(d))return 0;let{width:y}=r(d).getBoundingClientRect(),S=y/2;return w<S?S:w>e.containerWidth-S?e.containerWidth-S:w}let p=m(()=>l(n()));var f=A$(),_=h(f);let u;var $=h(_);ge($,()=>{var w;return(w=e.children)!=null?w:ie}),g(_),dt(_,w=>O(d,w),()=>r(d)),g(f),dt(f,w=>O(s,w),()=>r(s)),I(w=>{et(f,`transform: translate(${r(p)}px, ${a()}px);`),u=te(_,1,"tooltip svelte-5ygsa2",null,u,w),et(_,`opacity: ${i()?1:0}; visibility: ${i()?"visible":"hidden"}`)},[()=>({active:i(),pointer:o()})]),b(t,f)}var Nc=(t,e,i)=>i.filter(o=>o.time<=t*e).pop();var Mh=t=>!!(Math.round(Math.abs(t)/90)%2),Lh=t=>Math.abs(t)/90%4===1;var L$=L('<div class="preview svelte-1wqg760"></div>'),V$=L('<div class="time svelte-1wqg760"> </div>'),R$=L('<div><!> <div class="episode svelte-1wqg760"><!></div> <!></div>'),N$={hash:"svelte-1wqg760",code:".timeline-preview.svelte-1wqg760 {bottom:18px;border-radius:2px;pointer-events:none;}.timeline-preview.mobile.svelte-1wqg760 {bottom:72px;}.preview.svelte-1wqg760 {background-color:var(--timeline-preview-bg);box-shadow:0 0 2px var(--timeline-preview-shadow), 0 8px 24px var(--timeline-preview-shadow);border-radius:8px;border:1px solid var(--white);}.episode.svelte-1wqg760 {margin-top:10px;margin-bottom:4px;font-size:13px;line-height:16px;text-shadow:0 8px 24px var(--timeline-preview-shadow), 0 0 2px var(--timeline-preview-shadow);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center;font-weight:500;}.time.svelte-1wqg760 {font-size:13px;line-height:16px;text-align:center;color:var(--white);text-shadow:0 8px 24px var(--timeline-preview-shadow), 0 0 2px var(--timeline-preview-shadow);font-weight:500;}"};function cf(t,e){z(e,!0),K(t,N$);let[i,o]=He(),n=()=>C(w,"$rotateAlpha",i),a=()=>C(y,"$playerSize",i),s={MOBILE:150,DESKTOP:278},d=v(e,"time",3,""),l=v(e,"isMobile",3,!1),p=v(e,"videoEpisodes",19,()=>[]),f=v(e,"progress",3,0),_=v(e,"duration",3,0),u=v(e,"isInteractive",3,!1),$=Se(),w=$.ui.rotateAlpha,y=$.ui.playerSize,S=ee(0),k=ee(0),P=ee(""),A=ee(0),E=ee(0),T=ee(0),V=ee(0),U=m(()=>Nc(f(),_(),p())),G=m(()=>Mh(n())),F=m(()=>Lh(n())),Y=m(pe),X=m(()=>(r(F)?1:-1)*(r(S)/2-r(k)/2)),oe=m(()=>r(X)*-1);qe(()=>{(D=>(O(S,me(D.width)),O(k,me(D.height))))(Ve())}),qe(()=>{(D=>(O(P,me(D.imgSrc)),O(A,me(D.imgWidth)),O(E,me(D.imgHeight)),O(T,me(D.imgOffsetX)),O(V,me(D.imgOffsetY))))(Ae(f()))});function pe(){var Qe;let D=l()?s.MOBILE:s.DESKTOP,{isVertical:de}=le(),Ee=30;return(Qe=r(U))!=null&&Qe.text&&(Ee+=16),(de||r(G))&&(Ee+=18,Ee+=50),Math.min(Math.max(a().height-Ee,0),D)}function le(){let D=e.previewThumbsData.frameWidth,de=e.previewThumbsData.frameHeight,Ee=de>D;return{width:D,height:de,isHorizontal:!Ee,isVertical:Ee}}function Ve(){let{height:D,isHorizontal:de,isVertical:Ee,width:Qe}=le();return de&&(D=D/Qe*r(Y),Qe=r(Y)),Ee&&(Qe=Qe/D*r(Y),D=r(Y)),{width:Qe,height:D}}function Ae(D){let de;e.previewThumbsData.isUV?de=Math.floor(_()*D/e.previewThumbsData.frequency):de=Math.min(e.previewThumbsData.countTotal,Math.max(0,Math.floor(e.previewThumbsData.countTotal*D)));let Ee=Math.floor(de/e.previewThumbsData.countPerImage),Qe=Math.floor(de%e.previewThumbsData.countPerImage/e.previewThumbsData.countPerRow),st=de%e.previewThumbsData.countPerRow,Pe=Math.floor(e.previewThumbsData.countPerImage/e.previewThumbsData.countPerRow);!e.previewThumbsData.isUV&&Ee===Math.floor(e.previewThumbsData.countTotal/e.previewThumbsData.countPerImage)&&(Pe=Math.floor(e.previewThumbsData.countTotal%e.previewThumbsData.countPerImage/e.previewThumbsData.countPerRow),e.previewThumbsData.countTotal%e.previewThumbsData.countPerImage%e.previewThumbsData.countPerRow>0&&Pe++);let $e=e.previewThumbsData.countPerRow;!e.previewThumbsData.isUV&&Ee===Math.floor(e.previewThumbsData.countTotal/e.previewThumbsData.countPerImage)&&e.previewThumbsData.countTotal%e.previewThumbsData.countPerImage>0&&($e=Math.min(e.previewThumbsData.countPerRow,e.previewThumbsData.countTotal%e.previewThumbsData.countPerImage));let Le=r(S)*$e,je=r(k)*Pe,ct=-st*r(S),ot=-Qe*r(k);return{imgSrc:e.previewThumbsData.links[Ee],imgWidth:Le,imgHeight:je,imgOffsetX:ct,imgOffsetY:ot}}var J=R$();let Me;var j=h(J);{var B=D=>{var de=L$();I(()=>et(de,`width: ${r(S)}px; height: ${r(k)}px; background-image: url(${r(P)}); background-size: ${r(A)}px ${r(E)}px; background-position: ${r(T)}px ${r(V)}px;
|
|
228
228
|
transform: rotate(${n()}deg) ${r(G)?`translate(${r(X)}px, ${r(oe)}px)`:""};
|
|
229
|
-
`)),b(D,de)};R(j,D=>{r(P)&&D(B)})}var Re=M(j,2),ne=h(Re);{var Ie=D=>{var de=Fe(),Ee=ue(de);{var Qe=Pe=>{var $e=rr();I(Le=>ve($e,Le),[()=>H("tooltip_episode_unfinished")]),b(Pe,$e)},st=Pe=>{var $e=rr();I(()=>ve($e,r(U).text||"")),b(Pe,$e)};R(Ee,Pe=>{u()&&r(U).completed===!1?Pe(Qe):Pe(st,!1)})}b(D,de)};R(ne,D=>{r(U)&&D(Ie)})}g(Re);var Ne=M(Re,2);{var fe=D=>{var de=V$(),Ee=h(de,!0);g(de),I(()=>ve(Ee,d())),b(D,de)};R(Ne,D=>{u()||D(fe)})}g(J),I(D=>{Me=te(J,1,"timeline-preview svelte-1wqg760",null,Me,D),et(J,`width: ${r(G)?r(k):r(S)}px;`)},[()=>({mobile:l()})]),b(t,J),q(),o()}var B$=L('<span class="time svelte-1jr6obn"> </span>'),D$=L("<!> <!>",1),O$={hash:"svelte-1jr6obn",code:".time.svelte-1jr6obn {display:inline-block;padding:6px 10px;border-radius:3px;color:var(--white);background-color:rgba(41, 41, 41, .8);}.timeline-slider {--slider-bg: var(--timeline-slider-bg);--slider-filled-bg: var(--timeline-slider-filled-bg);--slider-handle-bg: var(--timeline-slider-handle-bg);--slider-loaded-bg: var(--timeline-slider-loaded-bg);}"};function uf(t,e){var he;z(e,!0),K(t,O$);let[i,o]=He(),n=()=>C(Y,"$interactiveEpisodes$",i),a=()=>C(E,"$duration$",i),s=()=>C(A,"$position$",i),d=()=>C(pe,"$isInteractiveExpectation$",i),l=()=>C(oe,"$isInteractiveTime$",i),p=()=>C(T,"$isLive$",i),f=()=>C(U,"$isMobile",i),_=()=>C(V,"$isActiveLive$",i),u=()=>C(P,"$bufferedProgress$",i),$=()=>C(Ae,"$disabledControls$",i),w=v(e,"showTimeline",3,!1),y=v(e,"ref",15,void 0),S=Se(),k=Wt(),P=S.state.bufferedProgress$,A=S.state.positionWithScrubbing$,E=S.state.duration$,T=S.state.isLive$,V=S.state.isActiveLive$,U=S.ui.isMobile,G=k.features.episodes?S.actions.internal.getVideoEpisodes():void 0,F=S.actions.internal.getPreviewThumbsData(),Y=S.state.interactiveEpisodes$,X=S.state.isInteractive,oe=S.state.isInteractiveTime$,pe=S.state.isInteractiveExpectation$,le=S.actions.internal.correctSeekTimeToInteractive,Ve=(he=S.callbacks)==null?void 0:he.onDisabledTimelineClick,Ae=S.ui.controls.disabledControls$,J=S.ui.t,Me=k.features.interactiveResponsiveUi,j=m(()=>X?n():G),B=m(()=>lr(a())),Re=m(()=>lr(s())),ne=m(()=>s()/a()),Ie=m(()=>d()||l()),Ne=ee(!1),fe=ee(""),D=ee(0),de=ee(0),Ee=ee(0),Qe=m(()=>({containerWidth:r(de),translateXPx:r(D),translateYPx:X&&F?-36:-16,active:r(Ne)&&w()&&!r(Ie)&&!Me,pointer:!k.features.timelinePreview||!F||p()})),st=J("aria_timeline"),Pe=m(()=>J("aria_timeline_value",{position:r(Re),duration:r(B)}));function $e(Ce){return!le||!X?Ce:le(Ce*a())/a()}function Le(Ce){S.actions.internal.startScrubbing($e(Ce))}function je(Ce){l()||S.actions.internal.progressScrubbing($e(Ce))}function ct(Ce){S.actions.internal.completeScrubbing($e(Ce)),O(Ne,!1)}function ot(Ce,De,ut){$t(Ce,De,ut),O(Ne,!0)}function Nt(Ce,De,ut){$t(Ce,De,ut),O(Ne,!0)}function nt(){O(Ne,!1)}function $t(Ce,De,ut){O(Ee,me($e(Ce))),O(D,me(De)),ut&&O(de,me(ut)),O(fe,me(Ut(Ce)))}function Ut(Ce){let De=lr((p()?1-Ce:Ce)*a());return p()?`-${De}`:De}var Kt=D$(),Be=ue(Kt);df(Be,is(()=>r(Qe),{children:(Ce,De)=>{var ut=Fe(),zt=ue(ut);{var Ge=Xe=>{cf(Xe,{get time(){return r(fe)},get isMobile(){return f()},get videoEpisodes(){return r(j)},previewThumbsData:F,get progress(){return r(Ee)},get duration(){return a()},isInteractive:X})},at=Xe=>{var Ct=B$(),Jt=h(Ct,!0);g(Ct),I(()=>ve(Jt,r(fe))),b(Xe,Ct)};R(zt,Xe=>{k.features.timelinePreview&&F&&!p()?Xe(Ge):Xe(at,!1)})}b(Ce,ut)},$$slots:{default:!0}}));var re=M(Be,2);let W=m(()=>Math.round(r(ne)*100)),se=m(()=>$().has("TIMELINE"));oa(re,{className:"timeline-slider",get isActiveLive(){return _()},get isMobile(){return f()},ariaLabel:st,ariaValueMin:0,get ariaValueMax(){return a()},get ariaValueNow(){return r(W)},get ariaValueText(){return r(Pe)},get loadedProgress(){return u()},get filledProgress(){return r(ne)},get handleProgress(){return r(ne)},get videoEpisodes(){return r(j)},onPointerDown:Le,onHandleMove:je,onPointerMove:Nt,onPointerUp:ct,onPointerEnter:ot,onPointerLeave:nt,onDisabledClick:Ve,isInteractive:X,get disabled(){return r(se)},get hideHandel(){return l()},get ref(){return y()},set ref(Ce){y(Ce)}}),b(t,Kt),q(),o()}var H$={hash:"svelte-1yate8h",code:".timeline-ads-slider {--slider-bg: var(--timeline-slider-bg);--slider-filled-bg: var(--timeline-slider-filled-bg);--slider-handle-bg: var(--timeline-slider-handle-bg);--slider-loaded-bg: var(--timeline-slider-loaded-bg);}"};function Xl(t,e){z(e,!0),K(t,H$);let[i,o]=He(),n=()=>C(l,"$isMobile",i),a=v(e,"position",3,0),s=v(e,"duration",3,0),d=Se(),l=d.ui.isMobile,p=d.ui.t,f=m(()=>lr(s())),_=m(()=>lr(a())),u=m(()=>a()/s()),$=m(()=>p("aria_timeline_value",{position:r(_),duration:r(f)})),w=m(()=>Math.round(r(u)*100));oa(t,{className:"timeline-ads-slider",ariaValueMin:0,get ariaValueMax(){return s()},get ariaValueNow(){return r(w)},get ariaValueText(){return r($)},get filledProgress(){return r(u)},hideHandel:!0,get squareBorders(){return n()}}),q(),o()}var F$=L("<div><!></div>"),U$=L("<div></div>"),z$={hash:"svelte-1gqonyf",code:".timeline.svelte-1gqonyf {position:relative;pointer-events:all;display:flex;align-items:center;bottom:0;width:100%;min-width:86px;padding:3px 10px 4px;box-sizing:border-box;}.timeline.mobile.svelte-1gqonyf {height:16px;padding:6px 12px 7px;margin-top:6px;}.timeline-stub.svelte-1gqonyf {width:100%;min-width:20px;}.timeline-stub.mobile.svelte-1gqonyf {height:8px;}"};function Jl(t,e){z(e,!0),K(t,z$);let[i,o]=He(),n=()=>C(u,"$isLive$",i),a=()=>C(y,"$isMobile",i),s=()=>C(w,"$adPosition",i),d=()=>C($,"$adDuration",i),l=v(e,"isAds",3,!1),p=v(e,"isHidden",3,!1),f=v(e,"ref",15,void 0),_=Se(),u=_.state.isLive$,$=_.ads.duration,w=_.ads.position,y=_.ui.isMobile,S=m(()=>!p()&&(!n()||n()&&e.canRewindLive&&e.isRewindableLive||l()));var k=Fe(),P=ue(k);{var A=T=>{var V=F$();let U;var G=h(V);{var F=X=>{Xl(X,{get position(){return s()},get duration(){return d()}})},Y=X=>{uf(X,{get showTimeline(){return r(S)},get ref(){return f()},set ref(oe){f(oe)}})};R(G,X=>{l()?X(F):X(Y,!1)})}g(V),I(X=>U=te(V,1,"timeline svelte-1gqonyf",null,U,X),[()=>({mobile:a()})]),b(T,V)},E=T=>{var V=U$();let U;I(G=>U=te(V,1,"timeline-stub svelte-1gqonyf",null,U,G),[()=>({mobile:a()})]),b(T,V)};R(P,T=>{r(S)?T(A):T(E,!1)})}b(t,k),q(),o()}import{noop as K$}from"@vkontakte/videoplayer-shared/es2018";var q$=be('<svg><!><path fill="var(--btn-color, #fff)" fill-rule="evenodd" d="m21.616 16.495-.012.07c-.156.852-.282 1.541-.427 2.093-.148.569-.333 1.063-.64 1.5a4.4 4.4 0 0 1-2.507 1.732c-.52.133-1.046.131-1.63.069-.568-.06-1.257-.187-2.11-.343l-4.34-.794c-.853-.156-1.542-.282-2.094-.426-.568-.149-1.062-.334-1.5-.642a4.4 4.4 0 0 1-1.731-2.507c-.133-.518-.131-1.045-.069-1.63.06-.567.187-1.257.343-2.11l.012-.068c.156-.853.282-1.542.427-2.095.148-.568.333-1.062.641-1.5a4.4 4.4 0 0 1 2.507-1.731c.518-.133 1.045-.131 1.63-.069.567.06 1.256.187 2.109.343l4.34.794c.853.156 1.542.282 2.094.426.568.149 1.062.334 1.5.642a4.4 4.4 0 0 1 1.731 2.506c.133.52.131 1.046.069 1.63-.06.568-.187 1.258-.343 2.11m-1.446-2.3c.052-.483.035-.769-.022-.993a2.6 2.6 0 0 0-1.023-1.481c-.19-.133-.45-.25-.921-.373-.48-.125-1.102-.24-1.997-.404l-4.272-.781c-.895-.164-1.518-.277-2.01-.33-.483-.051-.769-.035-.993.023-.6.153-1.125.516-1.481 1.023-.133.19-.25.45-.373.92-.125.48-.24 1.103-.403 1.998s-.277 1.518-.33 2.01c-.051.484-.035.77.023.994.153.6.516 1.125 1.023 1.481.189.133.45.25.92.373.48.125 1.102.24 1.997.404l4.272.781c.895.164 1.518.277 2.01.33.483.051.77.035.993-.023a2.6 2.6 0 0 0 1.481-1.023c.133-.19.25-.45.373-.92.125-.48.24-1.103.403-1.998s.278-1.518.33-2.01Z" clip-rule="evenodd"></path><path fill="var(--btn-color, #fff)" fill-rule="evenodd" d="M18.187 7.488a.9.9 0 0 1-1.045-.727c-.145-.807-.199-1.086-.28-1.296A2.6 2.6 0 0 0 14.504 3.8c-.224-.006-.505.036-1.315.169l-5.846.962c-1.366.224-1.834.313-2.174.492A2.6 2.6 0 0 0 3.837 7.18c-.08.376-.039.85.114 2.226l.011.1a.9.9 0 1 1-1.787.198l-.01-.093-.019-.17c-.129-1.147-.217-1.937-.068-2.636A4.4 4.4 0 0 1 4.332 3.83c.633-.333 1.417-.461 2.556-.648l.163-.027 5.846-.961.098-.016c.674-.111 1.138-.188 1.556-.177a4.4 4.4 0 0 1 3.99 2.819c.15.39.234.853.355 1.526l.017.097a.9.9 0 0 1-.726 1.045" clip-rule="evenodd"></path><path fill="var(--btn-color, #fff)" d="M12.724 12.414a.415.415 0 0 0-.69.231l-.72 4.18a.4.4 0 0 0 .025.221c.085.21.327.311.539.226l3.669-1.467a.406.406 0 0 0 .127-.68z"></path></svg>');function pf(t,e){let i=ke(e,["$$slots","$$events","$$legacy","children"]);var o=q$();let n;var a=h(o);ge(a,()=>{var s;return(s=e.children)!=null?s:ie}),_e(3),g(o),I(()=>n=we(o,n,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none","aria-hidden":"true","data-testid":"episodes-icon",style:"flex-shrink:0",role:"img",...i})),b(t,o)}var W$=be('<svg><!><path fill="var(--btn-color, #fff)" fill-rule="evenodd" d="M4.146 3.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L6.793 6.5 4.146 3.854a.5.5 0 0 1 0-.708" clip-rule="evenodd" opacity=".7"></path></svg>');function ff(t,e){let i=ke(e,["$$slots","$$events","$$legacy","children"]);var o=W$();let n;var a=h(o);ge(a,()=>{var s;return(s=e.children)!=null?s:ie}),_e(),g(o),I(()=>n=we(o,n,{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"13",fill:"none","aria-hidden":"true","data-testid":"chevron-light-icon",role:"img",...i})),b(t,o)}var Q$=L('<span class="text mobile svelte-1yhs2ga"> </span> <div class="chevron-episodes svelte-1yhs2ga"><!></div>',1),G$=L('<span class="text svelte-1yhs2ga"> </span>'),Y$=L('<span class="text count svelte-1yhs2ga"> </span>'),j$=L("<!> <!>",1),Z$={hash:"svelte-1yhs2ga",code:".text.svelte-1yhs2ga {padding:0 8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}.text.count.svelte-1yhs2ga {overflow:visible;}.text.mobile.svelte-1yhs2ga {padding:0 3px 0 4px;}.chevron-episodes.svelte-1yhs2ga {margin-bottom:-4px;}"};function ed(t,e){var le,Ve,Ae;z(e,!0),K(t,Z$);let[i,o]=He(),n=()=>C(w,"$currentGridType$",i),a=()=>C(y,"$openedByKeyboard$",i),s=()=>C(S,"$panelOpened$",i),d=()=>C(k,"$isMobile",i),l=v(e,"position",3,0),p=v(e,"duration",3,0),f=v(e,"timeCodes",19,()=>[]),_=Se(),u=(Ve=(le=_.callbacks)==null?void 0:le.onEpisodeChanged)!=null?Ve:K$,$=!!((Ae=_.callbacks)!=null&&Ae.onEpisodeClicked),w=_.ui.currentGridType$,y=_.ui.episodes.openedByKeyboard$,S=_.ui.episodes.panelOpened$,k=_.ui.isMobile,P=_.ui.t,A=ee(void 0),E=J=>{var j,B,Re;if(!!((j=_.callbacks)!=null&&j.onEpisodeClicked)){let ne=ys(J);y.set(ne),S.set(!0),(Re=(B=_.callbacks)==null?void 0:B.onEpisodeClicked)==null||Re.call(B,ne)}},T=ee(null),V=m(()=>l()/p());qe(()=>{var Me;let J=Nc(r(V),p(),f());J?((Me=r(T))==null?void 0:Me.time)!==J.time&&(u(J),O(T,me(J))):O(T,null)});let U=m(()=>{var J;return((J=r(T))==null?void 0:J.text)||""}),G=m(()=>Ui(n(),"xl")?"FULL":Ui(n(),"m")&&Eh(n(),"xl")?"COUNT":"SHORT"),F=m(()=>`${P("tooltip_episodes")}: ${r(U)}`),Y=async(J,Me,j)=>{await ho(),(J==null?void 0:J.getAttribute("aria-expanded"))==="false"&&Me&&!j&&_t(()=>{y.set(!1),J.focus()})};qe(()=>{Y(r(A),a(),s())});var X=Fe(),oe=ue(X);{var pe=J=>{let Me=m(()=>d()?"px-0":"");Et(J,{get className(){var j;return`w-max btn-full-opacity btn-jc-l ${(j=r(Me))!=null?j:""}`},testId:"btn-episodes",click:E,disabled:!$,get ariaExpanded(){return s()},get ariaLabel(){return r(F)},get ref(){return r(A)},set ref(j){O(A,me(j))},children:(j,B)=>{var Re=Fe(),ne=ue(Re);{var Ie=fe=>{var D=Q$(),de=ue(D),Ee=h(de,!0);g(de);var Qe=M(de,2),st=h(Qe);ff(st,{}),g(Qe),I(()=>ve(Ee,r(U))),b(fe,D)},Ne=fe=>{var D=j$(),de=ue(D);pf(de,{});var Ee=M(de,2);{var Qe=Pe=>{var $e=G$(),Le=h($e,!0);g($e),I(()=>ve(Le,r(U))),b(Pe,$e)},st=(Pe,$e)=>{{var Le=je=>{var ct=Y$(),ot=h(ct,!0);g(ct),I(()=>ve(ot,f().length)),b(je,ct)};R(Pe,je=>{r(G)==="COUNT"&&je(Le)},$e)}};R(Ee,Pe=>{r(G)==="FULL"?Pe(Qe):Pe(st,!1)})}b(fe,D)};R(ne,fe=>{d()?fe(Ie):fe(Ne,!1)})}b(j,Re)},$$slots:{default:!0}})};R(oe,J=>{r(T)&&J(pe)})}b(t,X),q(),o()}import{debounceFn as Z2}from"@vkontakte/videoplayer-shared/es2018";import{ChromecastState as r2,PlaybackState as td,Player as s2,PredefinedQualityLimits as qr,VideoFormat as id,clientChecker as a2}from"@vkontakte/videoplayer-core/es2018";import{assertNonNullable as Un,getHighestQuality as l2,InterfaceLanguage as d2,isInvariantQuality as c2,isNonNullable as u2,loadVKLangPack as p2,Logger as f2,map as Fh,merge as m2,Observable as v2,Subject as zc,Subscription as bf,Tracer as g2,ValueSubject as h2,VideoQuality as _2,devNull as b2,now as $2}from"@vkontakte/videoplayer-shared/es2018";import{SeekAction as ns}from"@vkontakte/videoplayer-statistics/es2018";import{detectEmbed as X$,devNull as Qt,now as Gt}from"@vkontakte/videoplayer-shared/es2018";import{addScript as J$,Subject as Ho,clearVideoElement as e2}from"@vkontakte/videoplayer-shared/es2018";var Vh=(t,e)=>t<400||e<225?5:t<640||e<360?0:t<960||e<540?1:t<1280||e<720?2:3;var t2="//ad.mail.ru/static/admanhtml/rbadman-html5.min.js",Bc=class{constructor(e,i){this.adman=null;this.initialVolume=1;this.videoElement=null;this.currentAdSection=null;this.actions=null;this.adsState=null;this.playerState=null;this.events={init$:new Ho,loadStarted$:new Ho,loadEnded$:new Ho,loadError$:new Ho,ready$:new Ho,slotRequested$:new Ho,started$:new Ho,timeRemained$:new Ho,paused$:new Ho,resumed$:new Ho,ended$:new Ho,empty$:new Ho,skipped$:new Ho,clicked$:new Ho,closed$:new Ho,error$:new Ho};this.loadAdman=e=>(Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_load_start",this.useAdmanFromNPM?"npm":"http"],numbers:[Gt()]}),this.useAdmanFromNPM?this.loadAdmanNPM(e):this.loadAdmanMailRu(e));this.loadAdmanMailRu=e=>new Promise((i,o)=>{let n;this.events.loadStarted$.next();let a=()=>{clearTimeout(n),delete window.admanAsyncInit,window.AdmanHTML?(Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_async_init_done","http"],numbers:[Gt()]}),i(),this.events.loadEnded$.next()):(Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_init_timed_out","http"],numbers:[Gt()]}),o())};J$(t2,e,this.loadTimeout).then(()=>{Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_script_loaded","http"],numbers:[Gt()]}),window.AdmanHTML?(Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_already_inited","http"],numbers:[Gt()]}),i(),this.events.loadEnded$.next()):(Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_wait_async_init","http"],numbers:[Gt()]}),window.admanAsyncInit=a,n=window.setTimeout(a,this.initTimeout))}).catch(s=>{Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_script_load_error","http",String(s)],numbers:[Gt()]}),o(),clearTimeout(n)})});this.loadAdmanNPM=e=>new Promise((i,o)=>{let n;this.events.loadStarted$.next();let a=()=>{clearTimeout(n),delete window.admanAsyncInit,window.AdmanHTML?(Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_init_done","npm"],numbers:[Gt()]}),i(),this.events.loadEnded$.next()):(Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_init_timed_out","npm"],numbers:[Gt()]}),o())},s=()=>{d=!0,o()},d=!1,l=window.setTimeout(()=>{Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_load_timed_out","npm"],numbers:[Gt()]}),s()},this.loadTimeout);e.addEventListener("abort",s),e.aborted&&(Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_load_aborted","npm"],numbers:[Gt()]}),s()),window.AdmanHTML=window.AdmanHTML||null,import("@adtech/rbadman/out/rbadman-html5.min.js").then(()=>{Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_chunk_imorted","npm","failed: "+String(d)],numbers:[Gt()]}),!d&&(window.AdmanHTML?(Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_already_inited","npm"],numbers:[Gt()]}),i(),this.events.loadEnded$.next()):(Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_wait_async_init","npm"],numbers:[Gt()]}),window.admanAsyncInit=a,n=window.setTimeout(a,this.initTimeout)))},s).finally(()=>{clearTimeout(n),clearTimeout(l),e.removeEventListener("abort",s)})});this.onAdsReady=()=>{Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_ads_ready"],numbers:[Gt()]}),this.log({message:"ads ready"}),this.events.ready$.next(),this.startPreroll()};this.onAdStarted=(e,i)=>{Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_ad_started",e,"muted: "+i.muted],numbers:[Gt(),i.bannerID]}),this.adsState&&this.playerState&&this.actions?(this.log({message:`ad started, section: ${e}, banner: ${JSON.stringify(i)}`}),this.events.started$.next(e),i.muted&&(this.setVolume(0),this.actions.setMuted(!0),this.log({message:"ad muted start"}),ye(this.playerState.isMobile)&&this.playerState.mobileUnmuteButtonVisible.set(!0)),this.adsState.duration.set(i.duration),this.adsState.playbackState.set("playing"),this.adsState.canSkip.set(i.allowClose),this.adsState.secondsToWatchBeforeSkip.set(i.allowCloseDelay),this.startWatchDog()):this.onAdError("Started callback failed: Adman is not initialized")};this.onAdTimeRemained=e=>{this.adsState?(this.adsState.position.set(e.currentTime),this.events.timeRemained$.next(e),this.startWatchDog()):this.onAdError("TimeRemained callback failed: Adman state is not initialized")};this.onAdPaused=()=>{var e;Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_ad_pased",(e=this.currentAdSection)!=null?e:""],numbers:[Gt()]}),this.stopWatchDog(),this.adsState?(this.log({message:"ad paused"}),this.adsState.playbackState.set("paused")):this.onAdError("Paused callback failed: Adman state is not initialized")};this.onAdPlayed=()=>{var e;Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_ad_played",(e=this.currentAdSection)!=null?e:""],numbers:[Gt()]}),this.startWatchDog(),this.adsState?(this.log({message:"ad played"}),this.adsState.playbackState.set("playing")):this.onAdError("Player callback failed: Adman is not initialized")};this.onAdMidrollPoint=()=>{if(Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_ad_midroll_pioint"],numbers:[Gt()]}),this.adman&&this.actions){this.log({message:"midroll point"}),this.actions.switchFromVideoToAds(),this.currentAdSection="midroll",this.startWatchDog();try{this.adman.start("midroll")}catch(e){this.onAdError("could not start midroll")}}else this.onAdError("Midroll callback failed: Adman is not initialized")};this.onAdSkipped=()=>{var e;Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_ad_skipped",(e=this.currentAdSection)!=null?e:""],numbers:[Gt()]}),this.log({message:"ad skipped"}),this.stopWatchDog()};this.onAdClosed=()=>{var e;Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_ad_closed",(e=this.currentAdSection)!=null?e:""],numbers:[Gt()]}),this.log({message:"ad closed"}),this.currentAdSection&&this.events.closed$.next(this.currentAdSection),this.stopWatchDog(),this.switchToVideo()};this.onAdCompleted=()=>{var e;Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_ad_completed",(e=this.currentAdSection)!=null?e:""],numbers:[Gt()]}),this.log({message:"ad completed"}),this.currentAdSection?this.events.ended$.next(this.currentAdSection):this.events.empty$.next(),this.switchToVideo(),this.stopWatchDog()};this.onAdClicked=()=>{var e,i;Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_ad_clicked",(e=this.currentAdSection)!=null?e:""],numbers:[Gt()]}),this.log({message:"ad clicked"}),(i=this.videoElement)==null||i.pause(),this.currentAdSection&&this.events.clicked$.next(this.currentAdSection),this.stopWatchDog()};this.onAdError=(e="ad error")=>{Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_ad_error",e],numbers:[Gt()]}),this.log({message:e}),this.events.error$.next(e),this.switchToVideo(!0),this.stopWatchDog()};this.log=e.createComponentLog("AdmanWrapper"),Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_created"],numbers:[Gt()]}),this.loadTimeout=i.loadTimeout,this.initTimeout=i.initTimeout,this.runtimeTimeout=i.runtimeTimeout,this.useAdmanFromNPM=i.useAdmanFromNPM,this.volumeMultiplier=Math.max(0,Math.min(i.volumeMultiplier,1)),this.isVsidOriginal=i.isVsidOriginal,this.usePuid=i.usePuid}init(e,i,o){this.actions=e,this.adsState=i,this.playerState=o}onAdmanLoadingError(){this.onAdError("adman loading error")}initAdman(e){var A;if(Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_init","already inited: "+!!this.adman],numbers:[Gt(),e.slotId]}),this.adman)return;this.events.init$.next(),this.startWatchDog();let{width:i,height:o,isFullscreen:n,isAutoplay:a,adsContainer:s,adsVideoElement:d,slotId:l,params:p={},duration:f,previewParam:_}=e,u,$=this.playerState&&ye(this.playerState.vsid);$&&(this.isVsidOriginal?u=$:u=parseInt($,36));let{isEmbed:w,immediateOrigin:y}=X$(),S=(A=w?y:window.location.href)!=null?A:window.location.href,k={...p,dl:encodeURIComponent(S),autoplay:a?1:0,player_width:i,player_height:o,preview:_,...u?{request_id:u}:{},duration:f,...this.usePuid?{puid10:Vh(i,o),puid11:n?0:1}:{}};_||delete k.preview;let P={slot:l,wrapper:s,videoEl:d,videoQuality:o,params:k,browser:{mobile:!1}};try{let E=new window.AdmanHTML;E.setDebug(!1),E.onReady(this.onAdsReady),E.onStarted(this.onAdStarted),E.onPlayed(this.onAdPlayed),E.onPaused(this.onAdPaused),E.adMidrollPoint(this.onAdMidrollPoint),E.onClosed(this.onAdClosed),E.onSkipped(this.onAdSkipped),E.onClicked(this.onAdClicked),E.onTimeRemained(this.onAdTimeRemained),E.onCompleted(this.onAdCompleted),E.onError(this.onAdError),E.init(P),this.adman=E,this.videoElement=d,this.events.slotRequested$.next(),this.log({message:`adman init, config: ${JSON.stringify(P)}`})}catch(E){Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_init_threw",String(E)],numbers:[Gt()]}),this.onAdError("could not init adman")}}switchToVideo(e=!1){var o,n,a;if(Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_switch_to_video",(o=this.currentAdSection)!=null?o:"","force: "+e],numbers:[Gt()]}),this.currentAdSection===null&&!e){this.log({message:"switch to video, no currentAdSection. can't switch"});return}let i=this.currentAdSection==="postroll";if(this.actions){if(this.adsState&&this.playerState)this.adsState.playbackState.set("inactive"),this.currentAdSection=null,this.playerState.mobileUnmuteButtonVisible.set(!1),this.log({message:`switch to video, isPostroll: ${i}`}),i&&(this.adsState.postrollPassed.set(!0),this.log({message:"postroll passed"}));else{let s="Switch to video: Adman state was not updated correctly";this.log({message:s}),this.events.error$.next(s)}(a=(n=this.actions).switchFromAdsToVideo)==null||a.call(n,!i)}}togglePlay(){var e;if(Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_toggle_play",(e=this.currentAdSection)!=null?e:""],numbers:[Gt()]}),this.adsState){this.log({message:"toggle play"});let i=ye(this.adsState.playbackState);i==="playing"?this.pause():i==="paused"&&this.play()}else this.onAdError("Can not toggle play: Adman state is not initialized")}setInitialVolume(e){this.log({message:`set initial volume ${e}`}),this.initialVolume=e}setVolume(e){let i=e*this.volumeMultiplier;if(this.log({message:`set volume ${i}`}),this.adman)try{this.adman.setVolume(i)}catch(o){this.onAdError("could not set ad volume")}this.videoElement&&(this.videoElement.volume=i)}setFullscreen(e){if(this.log({message:`set fullscreen ${e}`}),this.adman)try{this.adman.setFullscreen(e)}catch(i){this.onAdError("could not set ad fullscreen")}}startPreroll(){if(Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_start_preroll"],numbers:[Gt()]}),this.adman){if(!this.isDestroyed){this.log({message:"start preroll"}),this.setVolume(this.initialVolume),this.currentAdSection="preroll",this.startWatchDog();try{this.adman.start("preroll")}catch(e){this.onAdError("could not start preroll")}}}else this.onAdError("Can not start preroll: Adman is not initialized")}startPostroll(){var e;if(Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_start_postroll",(e=this.currentAdSection)!=null?e:""],numbers:[Gt()]}),this.adman&&this.actions){this.log({message:"start postroll"}),this.actions.switchFromVideoToAds(),this.currentAdSection="postroll",this.startWatchDog();try{this.adman.start("postroll")}catch(i){this.onAdError("could not start postroll")}}else this.onAdError("Can not start postroll: Adman is not initialized")}startWatchDog(){this.watchDogTimeout&&clearTimeout(this.watchDogTimeout),this.watchDogTimeout=window.setTimeout(()=>this.onAdError("Watchdog timeout"),this.runtimeTimeout)}stopWatchDog(){clearTimeout(this.watchDogTimeout)}play(){var e;if(Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_pplay",(e=this.currentAdSection)!=null?e:""],numbers:[Gt()]}),this.adman){this.log({message:"ad play"}),this.startWatchDog();try{this.adman.resume(),this.events.resumed$.next()}catch(i){this.onAdError("could not resume ad")}}else this.onAdError("Can not play: Adman is not initialized")}pause(){var e;if(Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_pause",(e=this.currentAdSection)!=null?e:""],numbers:[Gt()]}),this.adman){this.stopWatchDog(),this.log({message:"ad pause"});try{this.adman.pause(),this.events.paused$.next()}catch(i){this.onAdError("could not pause ad")}}else this.onAdError("Can not pause: Adman is not initialized")}skip(){var e;if(Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_skip",(e=this.currentAdSection)!=null?e:""],numbers:[Gt()]}),this.adman){this.stopWatchDog(),this.log({message:"ad skip"});try{this.adman.skip(),this.events.skipped$.next()}catch(i){this.onAdError("could not skip ad")}}else this.onAdError("Can not skip: Adman is not initialized")}setPosition(e,i){var o;(o=this.adman)==null||o.setPosition(Math.floor(e),Math.floor(i))}destroy(){var e,i,o,n,a,s,d,l,p,f,_,u;Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_destroy"],numbers:[Gt()]}),this.log({message:"destroy"}),this.stopWatchDog(),(e=this.adman)==null||e.onReady(void 0),(i=this.adman)==null||i.onStarted(void 0),(o=this.adman)==null||o.onPlayed(void 0),(n=this.adman)==null||n.onPaused(void 0),(a=this.adman)==null||a.adMidrollPoint(void 0),(s=this.adman)==null||s.onClosed(void 0),(d=this.adman)==null||d.onSkipped(void 0),(l=this.adman)==null||l.onClicked(void 0),(p=this.adman)==null||p.onTimeRemained(void 0),(f=this.adman)==null||f.onCompleted(void 0),(_=this.adman)==null||_.onError(void 0),(u=this.adman)==null||u.destroy(),this.videoElement&&e2(this.videoElement),this.isDestroyed=!0}};var Rh=t=>{let e=Math.round(t);return isNaN(e)||e<40?"":e>=40&&e<55?50:e>=55&&e<90?60:e>=90&&e<180?120:e>=180?240:""};var mf=class{constructor(){this.oneLineRegExp=/\r\n|\n|\r/;this.twoLinesRegExp=/\r\n\r\n|\n\n|\r\r/}parse(e,i){let o=[],n=e.split(this.twoLinesRegExp);for(let a of n){let s={startTime:0,endTime:0,texts:[],lang:i},d=a.split(this.oneLineRegExp);for(let l of d)if(!s.startTime&&!s.endTime){let p=new Dc,{startTime:f,endTime:_}=p.parse(l);s.startTime=f,s.endTime=_}else if(l.trim()!==""){let p=new vf,{texts:f}=p.parse(l);s.texts=[...s.texts,...f]}(s.startTime||s.endTime)&&s.texts.length>0&&o.push(s)}return o}},Dc=class{constructor(){this.timeRegExp=/(\d{2,})?:?(\d{2}):(\d{2}).(\d{2,3})/;this.timingRegExp=new RegExp(`${this.timeRegExp.source}( ?--> ?)${this.timeRegExp.source}`)}parse(e){let i={startTime:0,endTime:0},o=this.timingRegExp.exec(e);return o&&(i.startTime=this.calcTime(o[1],o[2],o[3],o[4]),i.endTime=this.calcTime(o[6],o[7],o[8],o[9])),i}parseTime(e){let i=this.timeRegExp.exec(e);return i?this.calcTime(i[1],i[2],i[3],i[4]):0}isTime(e){return this.timeRegExp.test(e)}calcTime(e="0",i="0",o="0",n="0"){let a=Number(e)*60*60,s=Number(i)*60,d=Number(o),l=+`0.${n}`;return a+s+d+l}},vf=class{constructor(){this.letterTagRegExp=/<[a-z]*>|<\/[a-z]*>/}parse(e){let i={texts:[]},n=e.replace(new RegExp(this.letterTagRegExp,"g"),"").split({[Symbol.split](s){let d=0,l=[];for(;d<s.length;){let p=["<",">"].reduce((f,_)=>{let u=s.indexOf(_,d);return f===-1||f>u?u:f},-1);if(p===-1){l.push(s.substring(d));break}l.push(s.substring(d,p)),d=p+1}return l}}),a=new Dc;for(let s of n)a.isTime(s)?i.texts.push({type:"timestamp",value:a.parseTime(s)}):i.texts.push({type:"text",value:s});return i}},Nh=mf;import{isNonNullable as gf}from"@vkontakte/videoplayer-shared/es2018";var na,xi,hf=0,_f=!1,Bh="",Dh=(t,e=0,i=0)=>t<e&&t<i,Oc=(t,e=0,i=0)=>t>=e&&t<=i,i2=(t,e=0,i=0)=>t>e&&t>i,Oh=(t,e,i,o=!1)=>{var d;let n=(d=i.find(({id:l})=>l===e.value))==null?void 0:d.subtitles;if(o)return n==null?void 0:n.find(({startTime:p,endTime:f})=>Oc(t,p,f));let a=t>=hf,s=t<hf;if(hf=t,s&&(_f=!1),gf(na)&&Oc(t,na.startTime,na.endTime)&&Bh===e.value)return na;if(!gf(xi)&&(n!=null&&n.length)&&!_f){xi=n.find(({startTime:p,endTime:f})=>Oc(t,p,f)||a&&Dh(t,p,f)),na=void 0,!gf(xi)&&n[n.length-1].endTime<t&&(_f=!0);return}else{if(Oc(t,xi==null?void 0:xi.startTime,xi==null?void 0:xi.endTime))return na=xi,xi=void 0,Bh=e.value,na;(a&&i2(t,xi==null?void 0:xi.startTime,xi==null?void 0:xi.endTime)||s&&Dh(t,xi==null?void 0:xi.startTime,xi==null?void 0:xi.endTime))&&(xi=void 0)}};var Hh={ru:"\u0420\u0443\u0441\u0441\u043A\u0438\u0439",en:"English",uk:"\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430",be:"\u0411\u0435\u043B\u0430\u0440\u0443\u0441\u043A\u0430\u044F (\u0442\u0430\u0440\u0430\u0448\u043A\u0435\u0432i\u0446\u0430)",es:"Espa\xF1ol",fi:"Suomi",de:"Deutsch",it:"Italiano",bg:"\u0411\u044A\u043B\u0433\u0430\u0440\u0441\u043A\u0438",hr:"Hrvatski",hu:"Magyar",sr:"\u0421\u0440\u043F\u0441\u043A\u0438",pt:"Portugu\xEAs",el:"\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AC",pl:"Polski",fr:"Fran\xE7ais",ko:"\uD55C\uAD6D\uC5B4","zh-CN":"\u6C49\u8BED",lt:"Lietuvi\u0173",ja:"\u65E5\u672C\u8A9E",cs:"\u010Ce\u0161tina",et:"Eesti",tt:"\u0422\u0430\u0442\u0430\u0440\u0447\u0430",ba:"\u0411\u0430\u0448\u04A1\u043E\u0440\u0442\u0441\u0430",cv:"\u0427\u0103\u0432\u0430\u0448\u043B\u0430",sk:"Sloven\u010Dina",ro:"Rom\xE2n\u0103",no:"Norsk",lv:"Latvie\u0161u",az:"Az\u0259rbaycan dili",hy:"\u0540\u0561\u0575\u0565\u0580\u0565\u0576",sv:"Svenska",nl:"Nederlands",tk:"T\xFCrkmen",ka:"\u10E5\u10D0\u10E0\u10D7\u10E3\u10DA\u10D8",da:"Dansk",uz:"O\u2018zbek",th:"\u0E20\u0E32\u0E29\u0E32\u0E44\u0E17\u0E22",id:"Bahasa Indonesia",tg:"\u0422\u043E\u04B7\u0438\u043A\u04E3",sl:"Sloven\u0161\u010Dina",bs:"Bosanski","pt-BR":"Portugu\xEAs brasileiro",fa:"\u0641\u0627\u0631\u0633\u06CC",vi:"Ti\u1EBFng Vi\u1EC7t",hi:"\u0939\u093F\u0928\u094D\u0926\u0940",si:"\u0DC3\u0DD2\u0D82\u0DC4\u0DBD",bn:"\u09AC\u09BE\u0982\u09B2\u09BE",tl:"Tagalog",mn:"\u041C\u043E\u043D\u0433\u043E\u043B",my:"\u1017\u1019\u102C\u1005\u102C",tr:"T\xFCrk\xE7e",ne:"\u0928\u0947\u092A\u093E\u0932\u0940",ur:"\u0627\u0631\u062F\u0648",ky:"\u041A\u044B\u0440\u0433\u044B\u0437 \u0442\u0438\u043B\u0438",pa:"\u067E\u0646\u062C\u0627\u0628\u06CC",os:"\u0418\u0440\u043E\u043D",kn:"\u0C95\u0CA8\u0CCD\u0CA8\u0CA1",sw:"Kiswahili",kk:"\u049A\u0430\u0437\u0430\u049B\u0448\u0430",ar:"\u0627\u0644\u0639\u0631\u0628\u064A\u0629",he:"\u05E2\u05D1\u05E8\u05D9\u05EA",ab:"\u0410\u04A7\u0441\u0448\u04D9\u0430",eu:"Euskara",eo:"Esperanto"},o2={abk:"as",ara:"ar",aze:"az",bak:"ba",bel:"be",ben:"bn",bos:"bs",bul:"bg",ces:"cs",chv:"cv",dan:"da",deu:"de",ell:"el",eng:"en",epo:"eo",est:"et",eus:"eu",fas:"fa",fin:"fi",fra:"fr",heb:"he",hin:"hi",hrv:"hr",hun:"hu",hye:"hy",ind:"id",ita:"it",jpn:"ja",kan:"kn",kat:"ka",kaz:"kk",kir:"ky",kor:"ko",lav:"lv",lit:"lt",mon:"mn",mya:"my",nep:"ne",nld:"nl",nor:"no",oss:"os",pan:"pa",pol:"pl",por:"pt",ron:"ro",rus:"ru",sin:"si",slk:"sk",slv:"sl",spa:"es",srp:"sr",swa:"sw",swe:"sv",tat:"tt",tgk:"tg",tgl:"tl",tha:"th",tuk:"tk",tur:"tr",ukr:"uk",urd:"ur",uzb:"uz",vie:"vi"},Hc=t=>{var e,i;return(i=(e=Hh[t])!=null?e:Hh[o2[t]])!=null?i:void 0};import{Subscription as n2}from"@vkontakte/videoplayer-shared/es2018";import"@vkontakte/videoplayer-statistics/es2018";var Fc=class{constructor(e,i=new n2){this.oneStat=e;this.statSubscription=i}destroy(){this.oneStat.destroy(),this.statSubscription.unsubscribe()}};var Uc=(i=>(i.DESKTOP_CONTROL_PANEL_LEFT="desktop-control-panel-left",i.DESKTOP_CONTROL_PANEL_RIGHT="desktop-control-panel-right",i))(Uc||{});var zr=t=>t!=null?t:0,Qa=(t,e)=>{var n,a;let i=(n=t==null?void 0:t.getBoundingClientRect)==null?void 0:n.call(t),o=(a=e==null?void 0:e.getBoundingClientRect)==null?void 0:a.call(e);return{top:Math.round(zr(i==null?void 0:i.top)-zr(o==null?void 0:o.top)),left:Math.round(zr(i==null?void 0:i.left)-zr(o==null?void 0:o.left)),bottom:Math.round(zr(i==null?void 0:i.bottom)-zr(o==null?void 0:o.top)),right:Math.round(zr(i==null?void 0:i.right)-zr(o==null?void 0:o.left))}},Ga=t=>{var i;let e=(i=t==null?void 0:t.getBoundingClientRect)==null?void 0:i.call(t);return{width:zr(e==null?void 0:e.width),height:zr(e==null?void 0:e.height)}};var Uh=({interfaceLanguage:t,isCyrillicRelatedInterface:e,videoId:i,isClip:o,isLiveCatchUpMode:n,statAuthToken:a,isAudioDisabled:s,canDownload:d,callbacks:l,webApi:p,videoEpisodes:f,previewThumbsData:_,uiConfig:u,coreConfig:$,player:w,disabledControls:y,isInteractive:S,interactiveRanges$:k,isInteractiveTime$:P,replayInteractive:A,stopPlayer:E,hasInteractiveBranches:T,playPrevChapterDisabledTooltip:V,additionalButtons:U,additionalSettingsMenuItems:G,additionalContextMenuItems:F,playPrevVideo:Y,playNextVideo:X,looped:oe=!1,statistics:pe,saveRate:le,internalsExposure:Ve})=>{var Do,Rm,Nm;let Ae={...$,configName:[...(Do=$.configName)!=null?Do:[],"ui"],isAudioDisabled:s,live:{...(Rm=$.live)!=null?Rm:{},isLiveCatchUpMode:!!n}},J=u,Me=g2.createRootTracer(J.features.saveTraceInfoToFile),j=Me.createComponentTracer("Store"),B=w||new s2(Ae,Me);Ve==null||Ve.expose({corePlayer:B});let Re=new f2,ne=new Bc(Re,{loadTimeout:J.ads.loadTimeout,initTimeout:J.ads.initTimeout,runtimeTimeout:J.ads.runtimeTimeout,useAdmanFromNPM:J.ads.useAdmanFromNPM,volumeMultiplier:J.ads.volumeMultiplier,isVsidOriginal:J.ads.isVsidOriginal,usePuid:J.ads.usePuid}),Ie=Qs.getInstance(),Ne=p==null?void 0:p.pictureInPictureApi,fe=p==null?void 0:p.annotationsApi,D=Re.createComponentLog("Store"),de,Ee,Qe={},st=new mc,Pe=pe?Yt(pe.oneStat.vsid$):ar(void 0),$e=ae(_s()),Le=ae(!1),je=(Nm=Ne==null?void 0:Ne.info.isActive$)!=null?Nm:new h2(!1),ct=ae(0),ot=ae([]),Nt=m2(B.events.fatalError$,B.events.managedError$).subscribe(c=>ot.update(x=>[...x,c])),nt=ar(!1,c=>{let x=B.events.fatalError$.subscribe(()=>c(!0));return()=>x.unsubscribe()}),$t=async c=>{var ce;let x=Object.values(d2).includes(c);if(J.downloadVKLanguages&&(x&&J.updateBuiltinLanguages||!Sp(c))){let We;try{We=await p2(c,Cg,Tg)}catch(wt){(ce=pe==null?void 0:pe.oneStat)==null||ce.logError({errorType:"VKLangPack",fatal:!1}),Ie==null||Ie.report(wt,{errorType:"VKLangPack",fatal:!1})}We&&(wp({language:c,pack:We,fallback:J.defaultLanguage}),Ut.set(c))}Sp(c)&&Ut.set(c)},Ut=ae(t),Kt=ae(e);$t(t);let Be=(c,x)=>{let N=ye(Ut);return Cp(N,c,x,J.defaultLanguage)},re=ae("thumb"),W=(()=>{let c=vi([nt,re],([x,N])=>x?"crashed":N);return{...c,is:x=>ye(c)===x}})(),se=(()=>{let c=ae(new Set(y));return{...c,add:x=>{c.update(N=>new Set([...N].concat(x)))},remove:x=>{c.update(N=>{let ce=[...N];return new Set(Array.isArray(x)?ce.filter(We=>!x.includes(We)):ce.filter(We=>We!==x))})},includes:x=>{let N=ye(c);return Array.isArray(x)?x.every(ce=>N.has(ce)):N.has(x)}}})();j.log("create store"),D({message:"create store"});let he=c=>{let x=c.container;x.append(B.experimental.element$.getValue()),Xe=new MutationObserver(N=>{let{removedNodes:ce}=N[0];ce.length&&x.append(B.experimental.element$.getValue())}),Xe.observe(x,{childList:!0})},Ce=c=>{D({message:`init video, config: ${JSON.stringify(c)}`}),S?he(c):(b2.push("ui",{key:"videoplayer_embed",strings:["new","core_init_video"],numbers:[$2()]}),B.initVideo(c)),j.log("init video",{isInteractive:S}),c.subtitles&&B.setExternalTextTracks(c.subtitles),de=c},De=new zc,ut=c=>De.next(c),zt=new zc,Ge=new zc,at=new zc,Xe=null,Ct={actionRewind$:zt,actionSeek$:Ge,inPiP$:je,inFullscreen$:new v2(c=>$e.subscribe(x=>c.next(x))),actionSetSubtitle$:at,nextMovie$:De};if(pe){let{oneStat:c,statSubscription:x}=pe;S||x.add(c.attachTo(B)),x.add(c.attachToUi(Ct)),x.add(c.attachToAds(ne.events)),c.authorize(a).catch(N=>{D({message:`onestat auth error ${String(N)}`})})}if(Ie){let c=new bf,x=(N,ce)=>c.add(N.subscribe(ce));if(x(B.events.managedError$,N=>{Ie.logIError(N)}),x(B.events.fatalError$,N=>{Ie.logIError(N,!0)}),pe){let{oneStat:N}=pe;x(N.experimental.error$,ce=>{Ie.logIError(ce)})}Ie.sentrySubscription.add(c)}let Jt=()=>{a2.device.isIOS&&Ee&&dh(Ee).catch(c=>{D({message:`exitIosSafariFullscreen failed: ${c}`})})},Ke=new bf().add(B.experimental.element$.subscribe(c=>{c&&(Ee=c,c.classList.add("player-media"),js(Ne)&&(Ne.updateVideoElement(),Ne.registryEventHandlers()),S&&c.setAttribute("pip","false"))})).add(B.events.ended$.subscribe(()=>{var c;Jt(),(c=l==null?void 0:l.onEnded)==null||c.call(l)})).add(B.events.looped$.subscribe(()=>{var c;(c=l==null?void 0:l.onLooped)==null||c.call(l)})).add(B.events.started$.subscribe(async()=>{var x,N;js(Ne)&&await(Ne==null?void 0:Ne.revealPictureInPicture());let c=B.info.muted$.getValue();(x=l==null?void 0:l.onStarted)==null||x.call(l),(N=Qe.onStarted)==null||N.call(Qe,c)})).add(B.events.willSeek$.subscribe(({from:c,to:x})=>{var N;(N=l==null?void 0:l.onSeek)==null||N.call(l,c,x)})).add(B.events.autoplaySoundProhibited$.subscribe(()=>{var c;(c=l==null?void 0:l.onAutoplaySoundProhibited)==null||c.call(l)})).add(B.info.position$.subscribe(c=>{var N;let x=B.info.duration$.getValue();isFinite(x)&&x>0&&((N=l==null?void 0:l.onTimeupdate)==null||N.call(l,x,c),ne.setPosition(c,x))})).add(B.events.fatalError$.subscribe(c=>{var x;(x=l==null?void 0:l.onCrashed)==null||x.call(l,c?`${c.id}: ${c.message}`:void 0)})).add(B.events.fetcherRecoverableError$.subscribe(c=>{var x;(x=l==null?void 0:l.onRecoverableError)==null||x.call(l,c?`${c.id}: ${c.message}`:void 0)})).add(B.events.loadedMetadata$.subscribe(()=>{vt.state.loadedMetadata$.set(!0)})).add(B.info.is3DVideo$.subscribe(c=>{vt.ui.is3DVideo.set(c)})).add(B.info.isEnded$.subscribe(c=>{S&&(c?(P!=null&&P.getValue()&&se.add(El),se.add("PLAY_BUTTON")):se.remove("PLAY_BUTTON"))})).add(B.info.liveTime$.subscribe(c=>{var x;(x=l==null?void 0:l.onLiveTime)==null||x.call(l,c)})).add(B.info.isStalled$.subscribe(c=>{var x;(x=l==null?void 0:l.onStalledChanged)==null||x.call(l,c)})).add(B.info.isLiveEnded$.subscribe(c=>{var x;return c&&((x=l==null?void 0:l.onLiveEnded)==null?void 0:x.call(l))})).add(ne.events.loadStarted$.subscribe(()=>{var c,x;return(x=(c=l==null?void 0:l.adsInfo)==null?void 0:c.onLoadStarted)==null?void 0:x.call(c)})).add(ne.events.loadEnded$.subscribe(()=>{var c,x;return(x=(c=l==null?void 0:l.adsInfo)==null?void 0:c.onLoadEnded)==null?void 0:x.call(c)})).add(ne.events.loadError$.subscribe(()=>{var c,x;return(x=(c=l==null?void 0:l.adsInfo)==null?void 0:c.onLoadError)==null?void 0:x.call(c)})).add(ne.events.init$.subscribe(()=>{var c,x;return(x=(c=l==null?void 0:l.adsInfo)==null?void 0:c.onInit)==null?void 0:x.call(c)})).add(ne.events.ready$.subscribe(()=>{var c,x;return(x=(c=l==null?void 0:l.adsInfo)==null?void 0:c.onReady)==null?void 0:x.call(c)})).add(ne.events.started$.subscribe(c=>{var x,N;return(N=(x=l==null?void 0:l.adsInfo)==null?void 0:x.onStarted)==null?void 0:N.call(x,c)})).add(ne.events.timeRemained$.subscribe(c=>{var x,N;return(N=(x=l==null?void 0:l.adsInfo)==null?void 0:x.onTimeRemained)==null?void 0:N.call(x,c)})).add(ne.events.ended$.subscribe(c=>{var x,N;return(N=(x=l==null?void 0:l.adsInfo)==null?void 0:x.onCompleted)==null?void 0:N.call(x,c)})).add(ne.events.empty$.subscribe(()=>{var c,x;return(x=(c=l==null?void 0:l.adsInfo)==null?void 0:c.onEmpty)==null?void 0:x.call(c)})).add(ne.events.clicked$.subscribe(c=>{var x,N;return(N=(x=l==null?void 0:l.adsInfo)==null?void 0:x.onClicked)==null?void 0:N.call(x,c)})).add(ne.events.closed$.subscribe(c=>{var x,N;return(N=(x=l==null?void 0:l.adsInfo)==null?void 0:x.onClosed)==null?void 0:N.call(x,c)})).add(ne.events.error$.subscribe(c=>{var x,N;return(N=(x=l==null?void 0:l.adsInfo)==null?void 0:x.onError)==null?void 0:N.call(x,c)})).add(ne.events.paused$.subscribe(()=>{var c,x;return(x=(c=l==null?void 0:l.adsInfo)==null?void 0:c.onPaused)==null?void 0:x.call(c)})).add(ne.events.resumed$.subscribe(()=>{var c,x;return(x=(c=l==null?void 0:l.adsInfo)==null?void 0:c.onResumed)==null?void 0:x.call(c)})),lt=new bf,ti=()=>{var wt,Lt,Ft;let{debugLog:c}=J,x,N="#9df7b7",ce="#efd169";if(c&&c!==!0){let{colors:Vt}=c;x=c.tag,N=(wt=Vt==null?void 0:Vt[0])!=null?wt:N,ce=(Ft=(Lt=Vt==null?void 0:Vt[1])!=null?Lt:Vt==null?void 0:Vt[0])!=null?Ft:ce}let We=x?`: ${x}`:"";lt.add(B.events.log$.subscribe(Vt=>{console.debug(`%c sdk${We} `,`background:${N};`,`sdk component: ${Vt.component}`,Vt.message)})).add(Re.log$.subscribe(Vt=>{console.debug(`%c ui${We} `,`background:${ce};`,`ui component: ${Vt.component}.`,Vt.message)}))},Ri=()=>{lt.unsubscribe()},Lo=(c,x)=>{j.log("start camera manual rotation",{mx:c,my:x}),B.startCameraManualRotation(c,x)},Ni=(c=!1)=>{j.log("stop camera manual rotation",{immediate:c}),B.stopCameraManualRotation(c)},yo=(c,x,N)=>{j.log("move camera focus px",{xpx:c,ypx:x,dt:N}),B.moveCameraFocusPX(c,x,N)},Vo=()=>{B.holdCamera()},Pt=()=>{B.releaseCamera()},gt=ar(B.info.position$.getValue(),c=>{let x,N,ce=()=>{let We=B.info.playbackState$.getValue(),wt=B.info.isLive$.getValue(),Lt=B.info.duration$.getValue(),Ft=B.info.position$.getValue();if(We&&[td.PLAYING,td.PAUSED].includes(We)){let Vt=wt?Ft-Lt:B.getExactTime();Vt!==N&&c(Vt),N=Vt}x=requestAnimationFrame(ce)};return ce(),()=>cancelAnimationFrame(x)}),kt=Yt(B.info.playbackState$),Z=Yt(B.info.currentBuffer$),ei=Yt(B.info.isEnded$),Pi=Yt(B.info.isLive$),wi=J.features.playbackRate?Yt(B.info.canChangePlaybackSpeed$):ar(!1),ii=Yt(B.info.liveBufferTime$),zi=Yt(B.info.volume$),Ai=Yt(B.info.muted$),Ro=vc(B.info.predefinedQualityLimitType$.pipe(Fh(c=>c===qr.TRAFFIC_SAVING)),B.info.predefinedQualityLimitType$.getValue()===qr.TRAFFIC_SAVING),Bi=vc(B.info.predefinedQualityLimitType$.pipe(Fh(c=>c===qr.HIGH_QUALITY)),B.info.predefinedQualityLimitType$.getValue()===qr.HIGH_QUALITY),Bt=Yt(B.info.autoQualityLimitingAvailable$),ui=Yt(B.info.availableQualities$),xt=Yt(B.info.availableQualitiesFps$),qt=Yt(B.info.chromecastState$),co=Yt(B.info.chromecastDeviceName$),jt=Yt(B.info.currentFormat$),qn=Yt(B.info.throughputEstimation$),xo=Yt(B.info.videoBitrate$),wo=Yt(B.info.intrinsicVideoSize$),si=Yt(B.info.duration$),bt=Yt(B.info.isAudioAvailable$),gi=null,Mi=B.info.isBuffering$,Di=ar(Mi.getValue(),c=>{let x=Mi.subscribe(N=>{N&&gi===null?gi=window.setTimeout(()=>{c(Mi.getValue()),gi=null},J.loaderDelay):c(N)});return()=>{x.unsubscribe(),gi&&clearTimeout(gi)}}),$n=()=>{gi&&clearTimeout(gi),gi=null},Si=vi([si,Pi],([c,x])=>x?-c:c),Zi=vi([kt],([c])=>c===td.PLAYING),rn=Yt(B.info.atLiveEdge$),yn=Yt(B.info.atLiveDurationEdge$),Li=Yt(B.info.position$),Wn=vi([Li,si],([c,x])=>isFinite(c)&&isFinite(x)&&!!x),sn=vi([qt],([c])=>c===r2.CONNECTED),So=Yt(B.info.availableVideoStreams$),xn=J.features.audioLanguages?Yt(B.info.availableAudioStreams$):ar([]),Mr=Yt(B.info.currentVideoStream$),cr=Yt(B.info.currentAudioStream$),Kn=c=>{c.language&&xp(c.language),B.setVideoStream(c)},wn=c=>{c.language&&xp(c.language),B.setAudioStream(c)},an=c=>{let x;if(c.length===1&&(x=c.at(0)),x!=null||(x=c.find(ce=>"isDefault"in ce&&ce.isDefault)),x)return x;let N=Yg();return N&&(x=c.find(({language:ce})=>N===ce)),x!=null||(x=c.at(0)),x},Sn=!1;Ke.add(B.info.availableAudioStreams$.subscribe(c=>{if(!Sn&&c.length){let x=an(c);x&&(B.setAudioStream(x),Sn=!0)}}));let uo=!1;Ke.add(B.info.availableVideoStreams$.subscribe(c=>{if(!uo&&c.length){let x=an(c);x&&(B.setVideoStream(x),uo=!0)}}));let Je=ae(void 0),ln=Yt(B.info.isAutoQualityEnabled$,c=>c&&Je.set(void 0)),Qn=Yt(B.info.currentQuality$,()=>Je.set(void 0)),Gn=vi([Je,Qn],([c,x])=>c!=null?c:x),Cn=vi(jt,c=>c!==id.MPEG),dn=vi([ui,xt,ln,Gn,Cn],([c,x,N,ce,We])=>{let wt=[];We&&wt.push({value:"auto",displayValue:Be("auto_quality_option"),selected:N});let Lt=c.filter(Ft=>!c2(Ft));for(let Ft of Lt){let Vt=x[Ft];wt.push({value:Ft,displayValue:`${Ft}${Vt?Rh(Vt):""}`,selected:N?!1:Ft===ce})}return wt}),cn=Yt(B.info.currentPlaybackRate$),Uo=vi([cn,rn,yn],([c,x,N])=>{let ce=N||S?1:J.controls.playbackRateMin,We=x?1:J.controls.playbackRateMax,wt=J.controls.playbackRateStep,Lt=[];for(let Ft=ce;Ft<=We;Ft+=wt)Lt.push({value:Ft,displayValue:Ft===1?Be("playback_rate_1"):Be("playback_rate",{multiplier:Ft.toString(10)}),selected:c===Ft});return Lt}),qi={displayValue:Be("subtitles_off"),value:"off"},Wi=ae({...qi}),Yn=J.features.subtitles?Yt(B.info.availableTextTracks$):ar([]),Tn=Hg(),jn=vi([Yn,Wi],([c,x],N)=>{var wt;let ce=[],We=c.find(({id:Lt})=>Lt===x.value);if(We!=null&&We.url){let[,Lt]=(wt=Tn.find(We.url))!=null?wt:[];if(Lt){N(Lt);return}st.download(We.url).then(Ft=>{if(!Ft||st.isDestroyed())return;let Vt=new Nh,ds=We.language;if(ds){let k1=!!We.isAuto,I1=Vt.parse(Ft,ds);ce.push({lang:ds,subtitles:I1,isAuto:k1,id:We.id})}Tn.add(We.url,ce),ye(Wi).value===x.value&&N(ce)}).catch(Ft=>{var Vt;(Vt=pe==null?void 0:pe.oneStat)==null||Vt.logError({errorType:"Subtitles download",fatal:!1}),Ie==null||Ie.report(Ft,{errorType:"Subtitles download",fatal:!1})})}N(ce)}),ur=vi([cn,Zi,Wi],([c,x,N],ce)=>{let Lt;if(B.info.isLive$.getValue()&&x&&N.value!==qi.value){let Vt=()=>{let ds=1e3/(3*c);Lt=setTimeout(Vt,ds),ce(Date.now())};return Vt(),()=>clearTimeout(Lt)}}),Xi=vi([Yn,Wi],([c,x])=>{if(!c.length)return[];let N=[];for(let{language:ce,isAuto:We,id:wt}of c){let Lt=ce&&Hc(ce);ce&&Lt&&N.push({displayValue:We?Be("subtitles_auto",{language:Lt}):Lt,value:wt,selected:(x==null?void 0:x.value)===wt,isAuto:We})}return N.length?(N.unshift({...qi,selected:(x==null?void 0:x.value)===qi.value}),N):[]}),Ji={available:[],prev:[]},kn=()=>{var x,N;let c=B.experimental.getCurrentTime$.getValue();return(N=(x=c==null?void 0:c())!=null?x:Ee==null?void 0:Ee.currentTime)!=null?N:0},In=vi([gt,Wi,jn,ur],([c,x,N,ce])=>{var wt;let We=B.info.isLive$.getValue();if(We&&Ji.prev!==N){let Lt=N.find(({id:Vt})=>Vt===x.value),Ft=Ji.prev.find(({id:Vt})=>Vt===x.value);if(Lt){let Vt={...Lt,subtitles:[...(wt=Ft==null?void 0:Ft.subtitles)!=null?wt:[],...Lt.subtitles]};Ji.available=[Vt],Ji.prev=N}}if(x&&x.value!==qi.value){let Lt=We?kn():c,Ft=We?Ji.available:N;return Oh(Lt,x,Ft,We)}}),po=vi([In],([c])=>c!=null&&c.texts?c.texts:[]),eo=ae(!0),En=vi([Z,Si,Li,ii],([c,x,N,ce])=>{var Ft;let We=(Ft=c==null?void 0:c.end)!=null?Ft:0;if(!ce)return We/x;let Lt=-N+ce-x;return(We-Lt)/x}),No=Yt(B.info.availableSources$),Lr=vi([No],([c])=>Object.keys((c==null?void 0:c[id.MPEG])||{}).length>0),Pn=()=>{var N,ce,We;let c=Object.keys(((ce=(N=B.info.availableSources$)==null?void 0:N.getValue())==null?void 0:ce[id.MPEG])||{}),x=l2(c)||_2.Q_144P;return(We=de.sources[id.MPEG])==null?void 0:We[x]},pr=()=>{var x;let c=Pn();if(c)j.log("download video",{url:c}),Bg(c,((x=de==null?void 0:de.meta)==null?void 0:x.title)||"video");else{let N="There is no URL for download video";j.log("download video",{message:N}),D({message:N})}},An=()=>{D({message:"toggle muted"});let c=B.info.muted$.getValue();B.info.volume$.getValue()===0&&!c?Ln(Xn()):oi(!c)},Mn=()=>{var c;if(vt.ui.settingsMenu.visible$.set(!1),!ye(vt.ui.settingsSubMenu.visible$)){let x=ye(vt.ui.settingsMenu.ref$);if((c=l==null?void 0:l.uiInfo)!=null&&c.onSettingsMenu&&x){let ce=Ga(x),We={top:0,left:0,bottom:0,right:0};l.uiInfo.onSettingsMenu({visible:!1,size:ce,position:We,name:"settings"})}}j.log("close settings menu")},Vr=async(c,x=()=>Promise.resolve())=>{var We;vt.ui.settingsMenu.openedByBtnKeyboard$.set(!!c),vt.ui.settingsMenu.visible$.set(!0),await x();let N=ye(vt.ui.settingsMenu.ref$),ce=Es();if((We=l==null?void 0:l.uiInfo)!=null&&We.onSettingsMenu&&N&&ce){let Lt=Ga(N),Ft=Qa(N,ce);l.uiInfo.onSettingsMenu({visible:!0,size:Lt,position:Ft,name:"settings"})}j.log("open settings menu",{wasOpenedByKeyboard:c})},Zn=(c,x=!1)=>{var wt;vt.ui.settingsSubMenu.visible$.set(!1);let N=ye(vt.ui.settingsMenu.ref$),ce=Es(),We=ye(vt.ui.settingsMenu.visible$);if((wt=l==null?void 0:l.uiInfo)!=null&&wt.onSettingsMenu&&N&&ce)if(We&&!x){let Ft=Ga(N),Vt=Qa(N,ce);l.uiInfo.onSettingsMenu({visible:!0,size:Ft,position:Vt,name:"settings"})}else{let Ft=Ga(c),Vt={top:0,left:0,bottom:0,right:0},ds=ye(vt.ui.settingsSubMenu.name$);l.uiInfo.onSettingsMenu({visible:!1,size:Ft,position:Vt,name:ds})}j.log("close settings sub menu")},fr=(c,x)=>{var ce;vt.ui.settingsSubMenu.visible$.set(!0),vt.ui.settingsSubMenu.ref$.set(x),vt.ui.settingsSubMenu.name$.set(c);let N=Es();if((ce=l==null?void 0:l.uiInfo)!=null&&ce.onSettingsMenu&&x&&N){let wt=Ga(x),Lt=Qa(x,N);l.uiInfo.onSettingsMenu({visible:!0,name:c,size:wt,position:Lt})}j.log("open settings sub menu",{name:c})},Xn=()=>{var x;let c=Math.max(J.volumeMinRestore,(x=gc())!=null?x:0);return c===0?J.volumeDefault:c},Ln=c=>{let x=c===0?Xn():c,N=B.info.muted$.getValue();D({message:`set volume, volume: ${c}, preferredVolume: ${x}`}),N&&c>0&&!s&&(N=!1,$p(!1)),B.setVolume(c,N),ne.setVolume(c),vp(x)},oi=c=>{let x=B.info.volume$.getValue();if(D({message:`set muted, currentVolume: ${x}, mute: ${c}`}),B.setMuted(c),ne.setVolume(c?0:x),$p(c),!c&&x===0){let N=Xn();B.setVolume(N),vp(N),ne.setVolume(N)}},zo=ae(!1),mr=c=>{j.log("set looped",{isLooped:c}),zo.set(c),B.setLooped(c)};mr(oe);let Rr=()=>{var c,x;(x=(c=l==null?void 0:l.uiInfo)==null?void 0:c.onReportProblem)==null||x.call(c)},tt=(c,x=!1)=>{var N;D({message:`set autoplayNextEnabled, value: ${c}`}),j.log("set autoplay next enabled",{autoplayNextEnabled:c}),vt.ui.autoplayNextEnabled$.set(c),Xg(c),x&&((N=l==null?void 0:l.onSetAutoplayNextEnabled)==null||N.call(l,c))},pt=c=>{D({message:`set timerNextVideoRunning, value: ${c}`}),j.log("set timer next video running",{timerNextVideoRunning:c}),vt.ui.timerNextVideoRunning$.set(c)},Ci=(c=!0)=>{var ce;let x=!0;if(c&&(l!=null&&l.onPrevVideoClick))try{x=(ce=l==null?void 0:l.onPrevVideoClick)==null?void 0:ce.call(l)}catch(We){D({message:"onPrevVideoClick callback failed to execute"})}if(!x)return;c&&Ki("prev")||Y()},to=(c=!0)=>{var ce;let x=!0;if(c&&(l!=null&&l.onNextVideoClick))try{x=(ce=l==null?void 0:l.onNextVideoClick)==null?void 0:ce.call(l)}catch(We){D({message:"onNextVideoClick callback failed to execute"})}if(!x)return;c&&Ki("next")||X()},Ki=c=>{let{isMobile:x,features:{playbackStatusNextVideoShow:N,playbackStatusShow:ce}}=J;return N&&ce&&!x?(vt.ui.aboutToGoNextVideo.set(c),vt.ui.userActionsDisabled.set(!0),!0):!1},Co=()=>{var c;(c=l==null?void 0:l.onNextVideoAnnouncementShow)==null||c.call(l)},To=()=>{var c;(c=l==null?void 0:l.onNextVideoAnnouncementClick)==null||c.call(l)},qo=()=>{var c;(c=l==null?void 0:l.onNextVideoAnnouncementAuto)==null||c.call(l)},ko=()=>{var c;(c=l==null?void 0:l.onNextVideoAnnouncementCancel)==null||c.call(l)},ci=()=>{B.prepare()},Ze=()=>{Un(vt);let c=ye(vt.ui.controls.disabledControls$),x=ye(vt.playerPhase),N={playerPhase:x,isInteractive:S,isVideoEnded:!1,action:"none"};if(c.has("PLAY_BUTTON"))return;if(D({message:"toggle play"}),x==="ads"){N.action="play",j.log("toggle adman play",N),ne.togglePlay();return}let ce=()=>{var wt;D({message:"toggle play, call player.play"}),N.action="play",B.play(),(wt=l==null?void 0:l.onPlay)==null||wt.call(l)},We=()=>{var wt;D({message:"toggle play, call player.pause"}),N.action="pause",B.pause(),(wt=l==null?void 0:l.onPause)==null||wt.call(l)};if(B.info.isEnded$.getValue()){if(D({message:"toggle play, video ended, seek to 0"}),zt.next(),Ge.next(ns.REWIND),S){A==null||A();return}B.seekTime(0),ce()}else B.info.playbackState$.getValue()!==td.PLAYING?ce():We();j.log("toggle play",N)},At=(c,{changeReason:x="default",appliesTo:N="to-video"}={})=>{D({message:`set quality, quality: ${c}`}),j.log("set quality",{quality:c}),B.setAutoQuality(c==="auto"),c!=="auto"?(J.features.qualityDetailsSubMenuEnabled?(hc({type:"exact_quality",quality:c,videoId:i},N),Al(),B.setPredefinedQualityLimits(qr.UNKNOWN)):gp(i,c),Je.set(c),B.setQuality(c)):J.features.qualityDetailsSubMenuEnabled?x==="default"&&(Gi("auto_quality",N),ye(Ro)&&Qi(!1),ye(Bi)&&hi(!1)):Al()},Qi=(c,x="as-default")=>{D({message:`set trafficSavingEnabled, value: ${c}`}),j.log("set traffic saving enabled",{trafficSavingEnabled:c});let N=c?qr.TRAFFIC_SAVING:qr.UNKNOWN;J.features.qualityDetailsSubMenuEnabled?(_i(N,x),Pl(!1)):(B.setPredefinedQualityLimits(N),Pl(c))},hi=(c,x="as-default")=>{D({message:`set highQualityEnabled, value: ${c}`}),j.log("set high quality enabled",{highQualityEnabled:c}),_i(c?qr.HIGH_QUALITY:qr.UNKNOWN,x)},_i=(c,x)=>{c!==qr.UNKNOWN&&(ye(Bt)&&!ye(ln)&&At("auto",{appliesTo:x,changeReason:"limit-changed"}),Gi(c,x)),B.setPredefinedQualityLimits(c)},Gi=(c,x)=>{hc({type:c,videoId:i},x),x==="as-default"&&hc({type:c,videoId:i},"to-video")},Bo=c=>{j.log("set playback rate",{playbackRate:c}),B.setPlaybackRate(c),J.features.saveRate&&le&&!B.info.isLive$.getValue()&&jg(c)},io=()=>{let c=ye(Uo),x=c.findIndex(({selected:ce})=>ce);if(x===c.length-1)return;let N=c[x+1];Bo(N.value)},Jn=()=>{let c=ye(Uo),x=c.findIndex(({selected:ce})=>ce);if(x===0)return;let N=c[x-1];Bo(N.value)},un=(c={...qi,selected:!1})=>{j.log("set subtitles",{...c}),c&&c.value!==qi.value&&at.next(c.isAuto?c.value+"_auto":c.value),Wi.set(c)},vr=()=>{j.log("toggle subtitles");let c=ye(Xi),x=ye(Wi),N=ye(Ut);if((x==null?void 0:x.value)===qi.value){let ce=c.filter(We=>We.value!==qi.value).find(We=>We.value===N)||c[1];un(ce)}else un()},Io=(c,x,N=!0)=>{var ce;if(D({message:`seek to time, time: ${c}`}),j.log("seek to time",{time:c,action:x,forcePrecise:N}),Ge.next(x),B.info.isLive$.getValue()){let We=B.info.duration$.getValue(),wt=Math.min(0,We+c);B.seekTime(wt,N)}else{if(P!=null&&P.getValue())return;B.info.isEnded$.getValue()&&(D({message:"seek after ended, call callbacks.onPlay"}),(ce=l==null?void 0:l.onPlay)==null||ce.call(l)),B.seekTime(Ue(c),N)}},gr=c=>{D({message:`seek to episode start time: ${c}`}),j.log("seek to episode start time",{time:c}),Io(c,ns.EPISODE,!0)},hr=(c,x)=>{D({message:`seek to percent, percent: ${c}`}),j.log("seek to percent",{percent:c,action:x});let N=ye(Si)*c;Io(N,x,!1)},_r=c=>{D({message:`seek external, time: ${c}`}),j.log("seek external",{time:c}),Ge.next(ns.UNKNOWN),B.seekTime(B.info.isLive$.getValue()?-c:c)},Nr=c=>{var ce,We;let x=(ce=c.max)!=null?ce:"none",N=(We=c.min)!=null?We:"none";D({message:`set auto quality limitation. Max: ${x}. Min: ${N}`}),j.log("set auto quality limits",{max:x,min:N}),B.setAutoQualityLimits(c)},Wo=c=>{D({message:`seek external to episode start time: ${c}`}),j.log("seek external to episode start time",{time:c}),Io(c,ns.EPISODE,!0)},br=c=>{D({message:`set playback rate to: ${c}`}),j.log("set playback rate external",{playbackRate:c}),B.setPlaybackRate(c)},er=ae(void 0),tr=ae(!1),$r=c=>{D({message:`start scrubbing, progress: ${c}`}),j.log("start scrubbing",{progress:c}),tr.set(!0),fo(c)},fo=c=>{er.set(c)},Vn,it,Dt=()=>{er.set(void 0),tr.set(!1)},Ti=()=>{clearTimeout(it),clearTimeout(Vn),Vn=window.setTimeout(()=>{Dt()},500),Ee==null||Ee.removeEventListener("seeked",Ti)},Ko=c=>{D({message:`complete scrubbing, progress: ${c}`}),j.log("complete scrubbing",{progress:c}),hr(c,ns.SLIDER),ye(vt.ui.isMobile)&&ye(vt.state.currentFormat$)===id.HLS?(Ee==null||Ee.addEventListener("seeked",Ti),it=window.setTimeout(()=>{Ti()},300)):Dt()},Rn=vi([gt,Si,er],([c,x,N],ce)=>{ce(u2(N)?N*x:c)}),xe=ae(!1),Mt=()=>{xe.set(!0)},li=()=>{xe.set(!1)},It=ae({width:0,height:0}),Zt=vi([It],([{width:c}],x)=>{let N=Ph(c);x(N)}),di=ae(!1),Oi=U.filter(c=>Dg(c)),mo=vi([Zt,di],([c,x])=>x?Oi.filter(N=>!N.hideOnMobile):Oi.filter(N=>{var ce;return!((ce=N.hideOnDesktopGridTypes)!=null&&ce.includes(c))})),ni=ae(U.filter(c=>Og(c))),Eo=vi([ni,Zt],([c,x])=>c.filter(N=>{var ce;return!((ce=N.hideOnDesktopGridTypes)!=null&&ce.includes(x))})),ze=vi([Eo,mo],([c,x])=>[...J.features.additionalButtonsDesktopControlPanelRight?c.filter(N=>N.type==="desktop-control-panel-right"):[],...J.features.additionalButtons?x.map((N,ce)=>{var We;return{id:ce,weight:ce,type:"desktop-control-panel-right",testId:N.testId,icon:N.iconUrl,onClick:N.onClick,ariaLabel:(We=N.ariaLabel)!=null?We:N.tooltip,tooltipText:N.tooltip}}):[]]),Ht=ae(G),bi=vi([Ht],([c])=>J.features.additionalSettingsMenuItems?c.map(x=>x.type==="SWITCH"?{...x,onClick:x.onChangeEnabled}:x):[]),Po=(c,x)=>{let N=ye(ni).map(ce=>ce.id!==c?ce:{...ce,...x});ni.set(N)},Qo=c=>{let x=ye(ni);if(x.some(N=>N.id===c.id)){D({message:`Additional button with id: "${c.id}" was exist! Can't add more with the same id`});return}x.push(c),ni.set(x)},ls=c=>{let x=ye(ni);if(!x.some(N=>N.id===c)){D({message:`Can't find additional button with id: "${c}"! Can't remove item with this id`});return}x=x.filter(N=>N.id!==c),ni.set(x)},pn=c=>{Ge.next(ns.LIVE),D({message:"live switch to low latency "+c}),j.log("live switch to low latency "+c),B.setLiveLowLatency(c)},Wr=(c,x)=>{let N=ye(Ht).map(ce=>ce.id!==c?ce:{...ce,...x});Ht.set(N)},ca=c=>{let x=ye(Ht);if(x.some(N=>N.id===c.id)){D({message:`Settings menu item with id: "${c.id}" was exist! Can't add more with the same id`});return}x.push(c),Ht.set(x)},ua=c=>{let x=ye(Ht);if(!x.some(N=>N.id===c)){D({message:`Can't find settings menu item with id: "${c}"! Can't remove item with this id`});return}x=x.filter(N=>N.id!==c),Ht.set(x)},ir=ae(F),el=vi([ir],([c])=>J.features.additionalContextMenuItems?c:[]),ks=(c,x)=>{let N=ye(ir).map(ce=>ce.id!==c?ce:{...ce,...x});ir.set(N)},pa=c=>{let x=ye(ir);if(x.some(N=>N.id===c.id)){D({message:`Context menu item with id: "${c.id}" was exist! Can't add more with the same id`});return}x.push(c),ir.set(x)},mt=c=>{let x=ye(ir);if(!x.some(N=>N.id===c)){D({message:`Can't find context menu item with id: "${c}"! Can't remove item with this id`});return}x=x.filter(N=>N.id!==c),ir.set(x)},ht=vi([di,nt],([c,x],N)=>{N(c&&x)}),Yi=()=>{Ge.next(ns.LIVE),D({message:"switch to active live"}),j.log("switch to active live"),B.seekTime(0),B.info.playbackState$.getValue()!==td.PLAYING&&vt.actions.internal.togglePlay()},Go=()=>{j.log("skip adman"),ne.skip()},ji=(c=!0)=>{Un(vt),D({message:`switch from ads to video, callPlay: ${c}`}),j.log("switch from ads to video",{callPlay:c}),re.set("video"),c&&B.play()},ai=()=>{Un(vt),D({message:"switch from video to ads"}),j.log("switch from video to ads"),vt.actions.internal.pause(),Jt(),re.set("ads")},ki=c=>{Un(vt);let x=c?"LiveWaitingStart":"thumb";j.log("set live waiting start",{state:c,playerPhase:x}),re.set(x)},Is=c=>{Un(vt);let x=c?"LiveWaitingRecover":"thumb";j.log("set live waiting recover",{state:c,playerPhase:x}),re.set(x)},fa=c=>{Un(vt);let x=c?"LiveWaitingRecord":"thumb";j.log("set live waiting record",{state:c,playerPhase:x}),re.set(x)},cu=()=>(Un(vt),j.log("get debug text data"),Rg(B,de,vt)),Ld=()=>(Un(vt),JSON.stringify(Me.getFinishedSpans())),uu=()=>(Un(vt),Ng(B,de,vt)),Es=()=>Ee,pu=()=>{D({message:"toggle chromecast"}),j.log("toggle chromecast"),B.toggleChromecast()},tl=c=>{var N;if(Un(vt),B.info.isEnded$.getValue())return;let x=!c;if(ye(vt.playerPhase)==="ads"){D({message:`pause ads, internalCall: ${x}`}),j.log("pause ads",{internalCall:x}),ne.pause();return}D({message:`pause video, internalCall: ${x}`}),j.log("pause video",{internalCall:x}),x&&((N=l==null?void 0:l.onPause)==null||N.call(l)),B.pause()},Vd=c=>{var N;Un(vt);let x=!c;if(ye(vt.playerPhase)==="ads"){D({message:`play ads, internalCall: ${x}`}),j.log("play ads",{internalCall:x}),ne.play();return}D({message:`play video, internalCall: ${x}`}),j.log("play video",{internalCall:x}),x&&((N=l==null?void 0:l.onPlay)==null||N.call(l)),B.play()},Rd=c=>{Un(vt);let x=!c;if(ye(vt.playerPhase)==="ads"){D({message:"player cannot be stopped during ads via external method"});return}D({message:`player will be stopped, internalCall: ${x}`}),E==null||E()},Nd=(c,x)=>{Un(vt),D({message:`first start, show ads: ${c}, internalCall: ${!x}`}),j.log("first start",{showAds:c,external:x}),c?re.set("ads"):(re.set("video"),x?B.play():vt.actions.internal.togglePlay())},ma=()=>(D({message:"getting time codes"}),f),il=()=>{let c=ma();if(!c||[0,1].includes(c.length))return;let x=B.info.position$.getValue();return c.find(N=>N.time>x)},Bd=c=>{let x=c;x||(x=il());let N=B.info.position$.getValue();j.log("seek to next episode",{currentTime:N,...x}),x&&(D({message:"seek to next episode"}),Io(x.time,ns.EPISODE,!0))},Dd=()=>{let c=ma();if(!c||[0,1].includes(c.length))return;let x=B.info.position$.getValue(),N=c.findIndex(We=>We.time>x),ce=N===-1?c.length-2:N-2;if(!(ce<0))return c[ce]},Od=c=>{let x=c;x||(x=Dd());let N=B.info.position$.getValue();j.log("seek to prev episode",{currentTime:N,...x}),x&&(D({message:"seek to prev episode"}),Io(x.time,ns.EPISODE,!0))},fu=()=>(D({message:"getting preview thumbs data"}),j.log("get preview thumbs data",{..._}),_),Hd=async()=>{let c=Ne==null?void 0:Ne.isActive(),x="none";Ne!=null&&Ne.isActive()?(x="remove",await(Ne==null?void 0:Ne.remove())):(x="request",await(Ne==null?void 0:Ne.request())),j.log("toggle picture in picture",{isActive:c,action:x})},mu=(c=-90)=>{j.log("rotate video",{alphaDiff:c}),ct.update(x=>x+c)},va=ae([]);k==null||k.subscribe(c=>{let x=[];for(let N=0;N<c.length;N++){let{range:[ce,We],subjects:wt}=c[N];N===0&&ce!==0&&x.push({time:0,text:"",interactive:!1,completed:!0}),x.push({time:ce/1e3,text:"",interactive:!0,completed:J.features.interactiveTimeOpenUri?!wt.length||wt.every(Lt=>Lt.isRemoved):!wt.length}),We!==1/0&&x.push({time:We/1e3,text:"",interactive:!1,completed:!0})}va.set(x)});let vu=ae(!1);P==null||P.subscribe(c=>{c&&ye(tr)&&Dt()});let Ue=c=>{if(!S)return c;let x=ye(va),N=ye(Si),We=ye(Li)/N,wt=x.find(Lt=>Lt.interactive&&!Lt.completed&&Lt.time>We);return typeof(wt==null?void 0:wt.time)=="number"?Math.min(c,wt.time-.05):c},ri=()=>{vt.ui.episodes.panelOpened$.set(!1)},Yo=()=>{j.log("destroy store"),clearTimeout(it),clearTimeout(Vn),Ke.unsubscribe(),lt.unsubscribe(),B.destroy(),ne.destroy(),pe==null||pe.destroy(),Ie==null||Ie.destroy(),Nt.unsubscribe(),Xe==null||Xe.disconnect(),Xe=null,st.destroy()},vt={interfaceLanguage$:Ut,isCyrillicRelatedInterface$:Kt,initVideo:Ce,videoId:i,isClip:o,playerPhase:W,vsid:Pe,state:{positionExact$:gt,positionWithScrubbing$:Rn,duration$:Si,playbackState$:kt,isPlaying$:Zi,isLoaderVisible:Di,bufferedProgress$:En,isLive$:Pi,canChangePlaybackSpeed$:wi,isActiveLive$:rn,isOldestAvailableLive$:yn,isRewindableLive$:Wn,isEnded$:ei,muted$:Ai,volume$:zi,trafficSavingEnabled$:Ro,highQualityEnabled$:Bi,autoQualityLimitingAvailable$:Bt,availableVideoStreams$:So,availableAudioStreams$:xn,videoStream$:Mr,audioStream$:cr,currentQuality$:Gn,isAutoQualityEnabled$:ln,availableQualities$:dn,currentPlaybackRate$:cn,availablePlaybackRates$:Uo,currentSubtitle$:Wi,availableTextTracks$:Yn,availableSubtitlesList$:Xi,currentSubtitleCaptions$:po,isAutoSubtitleCaptionVisible$:eo,chromecastState$:qt,chromecastDeviceName$:co,chromecastConnected$:sn,currentFormat$:jt,throughputEstimation$:qn,videoBitrate$:xo,videoSize$:wo,errorLog$:ot,crashed$:nt,isAudioAvailable$:bt,isAudioDisabled:!!s,canDownload:J.features.download&&!!d,availableSources$:No,hasMpegSources$:Lr,isInteractive:S,showInteractiveGraph:J.features.interactiveGraph,showSeekToInteractive:J.features.seekToInteractive,showPlayPrevChapter:J.features.interactivePlayPrevChapter,showInteractiveTimeIndicator:J.features.interactiveTimeIndicator&&!!ye(va).length,interactiveEpisodes$:va,isInteractiveTime$:P?Yt(P):ae(!1),isInteractiveExpectation$:vu,hasInteractiveBranches:T,playPrevChapterDisabledTooltip:V,looped$:zo,loadedMetadata$:ae(!1),isAutoQualityAvailable$:Cn},ui:{t:Be,controlsVisible:ae(!1),touched:ae(!1),controls:{prevButton:ae(void 0),playButton:ae(void 0),replayButton:ae(void 0),nextButton:ae(void 0),playPrevChapterButton:ae(void 0),seekToInteractiveButton:ae(void 0),interactiveGraphButton:ae(void 0),liveButton:ae(void 0),time:ae(void 0),episodes:ae(void 0),volume:ae(void 0),subtitles:ae(void 0),settings:ae(void 0),context:ae(void 0),chromecast:ae(void 0),pip:ae(void 0),fullscreen:ae(void 0),vkLogo:ae(void 0),interactiveTimeIndicator:ae(void 0),timeline:ae(void 0),autoplayNextToggle:ae(void 0),additionalButtons:U.length?U.reduce(c=>[...c,ae(void 0)],[]):[],disabledControls$:se},modals:{hotKeyMap:{show:ae(!1),data:ae({title:"",closeBtnText:"",groups:[]})}},isFullscreen:$e,isFullscreenOpenedByKeyboard:Le,rotateAlpha:ct,isAutoplay:ae(!1),debugPanelVisible:ae(!1),episodes:{panelOpened$:ae(!1),openedByKeyboard$:ae(!1)},contextMenu:{visible$:ae(!1),btnRef$:ae(void 0),openedByBtnKeyboard$:ae(!1),openedByHotKey$:ae(!1),lastActiveElem$:ae(void 0),showContextMenuBtn$:ae(!1),position$:ae({top:0,left:0})},playerSize:It,isMobile:di,mobileNotReportControlHidden$:ht,mobileUnmuteButtonExpanded:ae(!1),mobileUnmuteButtonVisible:ae(!1),icon3DVideoVisible:ae(!1),scrubbingInProgress:tr,volumeChangingInProgress:xe,is3DVideo:ae(!1),currentGridType$:Zt,additionalButtonsDeprecated$:mo,additionalDesktopControlPanelRightButtons$:ze,additionalSettingsMenuItems$:bi,additionalContextMenuItems$:el,interactiveHideMobileControls:ae(!1),overlayContainer$:ae(void 0),startedByKeyboard$:ae(!1),autoplayNextEnabled$:ae(!1),timerNextVideoRunning$:ae(!0),settingsMenu:{visible$:ae(!1),ref$:ae(void 0),openedByBtnKeyboard$:ae(!1)},settingsSubMenu:{visible$:ae(!1),ref$:ae(void 0),name$:ae(void 0)},aboutToGoNextVideo:ae(void 0),userActionsDisabled:ae(!1)},ads:{position:ae(0),duration:ae(0),playbackState:ae("inactive"),canSkip:ae(!1),secondsToWatchBeforeSkip:ae(0),postrollPassed:ae(!1)},webApi:{pictureInPictureApi:Ne,annotationsApi:fe},actions:{internal:{preload:ci,firstStart:c=>Nd(c,!1),play:()=>Vd(!1),pause:()=>tl(!1),togglePlay:Ze,toggleMuted:An,openSettingsMenu:Vr,closeSettingsMenu:Mn,openSettingsSubMenu:fr,closeSettingsSubMenu:Zn,setVolume:Ln,startVolumeChanging:Mt,stopVolumeChanging:li,setVideoStream:Kn,setAudioStream:wn,setQuality:At,setTrafficSavingEnabled:Qi,setHighQualityEnabled:hi,setPlaybackRate:Bo,incrementPlaybackRate:io,decrementPlaybackRate:Jn,setSubtitle:un,toggleSubtitle:vr,togglePictureInPicture:Hd,startScrubbing:$r,progressScrubbing:fo,completeScrubbing:Ko,toggleChromecast:pu,switchToActiveLive:Yi,switchFromAdsToVideo:ji,switchFromVideoToAds:ai,skipAd:Go,setLiveWaitingStart:ki,setLiveWaitingRecover:Is,setLiveWaitingRecord:fa,getDebugTextData:cu,getTraceTextData:Ld,getDebugPanelData:uu,getVideoElement:Es,seekTime:(c,x,N)=>Io(c,x,N),clearDelayedBufferingCheckTimeout:$n,seekEpisodeStartTime:gr,seekToPercent:hr,getNextEpisode:il,seekToNextEpisode:Bd,getPrevEpisode:Dd,seekToPrevEpisode:Od,startLogging:ti,stopLogging:Ri,startCameraManualRotation:Lo,stopCameraManualRotation:Ni,moveCameraFocusPX:yo,holdCamera:Vo,releaseCamera:Pt,getVideoEpisodes:ma,getPreviewThumbsData:fu,downloadVideo:pr,addLanguage:wp,setLanguage:$t,nextMovie:ut,videoRotate:mu,correctSeekTimeToInteractive:Ue,replayInteractive:A,setLooped:mr,reportProblem:Rr,setAutoplayNextEnabled:tt,setTimerNextVideoRunning:pt,prevVideoClick:Ci,nextVideoClick:to,nextVideoAnnouncementShow:Co,nextVideoAnnouncementClick:To,nextVideoAnnouncementAuto:qo,nextVideoAnnouncementCancel:ko},external:{firstStart:c=>Nd(c,!0),play:()=>Vd(!0),pause:()=>tl(!0),stop:()=>Rd(!0),seekTime:c=>_r(c),seekEpisodeStartTime:c=>Wo(c),setPlaybackRate:c=>br(c),setAutoQualityLimits:c=>Nr(c),setMuted:oi,setVolume:Ln,returnFocusToEpisodes:ri,updateAdditionalSettingsItem:Wr,addAdditionalSettingsItem:ca,removeAdditionalSettingsItem:ua,updateAdditionalContextItem:ks,addAdditionalContextItem:pa,removeAdditionalContextItem:mt,updateAdditionalButton:Po,addAdditionalButton:Qo,removeAdditionalButton:ls,setLiveLowLatency:pn}},callbacks:l,setUiCallbacks:c=>{Qe={...c}},getAdmanWrapper:()=>ne,getLogger:()=>Re,getPlayer:()=>B,destroy:Yo};return vt};function ra(t,e,i,o){var _;let n=["interactiveTimeIndicator"],a=(_=e[i])==null?void 0:_.getBoundingClientRect(),s=(o||n.includes(i))&&!!a&&!!(a.right-a.left),{top:d,left:l,bottom:p,right:f}=Qa(e[i],t||void 0);return{left:s?l:0,right:s?f:0,top:s?d:0,bottom:s?p:0,isDisplayed:s}}var qc=(t,e,i,o)=>{if(t)for(let[n,a]of Object.entries(e))["tooltipPointerOffsetX","disabledControls$","additionalButtons"].includes(n)||a.set(ra(t,i,n,o))};var Wc=async(t,e,i)=>{await ho(),e&&i&&(i.focus(),t.set(!1))};var y2=be('<svg><!><path fill="var(--btn-color, #fff)" d="M18 10c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2m-6 4c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m-6 0c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2"></path></svg>');function $f(t,e){let i=ke(e,["$$slots","$$events","$$legacy","children"]);var o=y2();let n;var a=h(o);ge(a,()=>{var s;return(s=e.children)!=null?s:ie}),_e(),g(o),I(()=>n=we(o,n,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none","aria-hidden":"true","data-testid":"dots-icon",role:"img",...i})),b(t,o)}function yf(t,e){z(e,!0);let[i,o]=He(),n=()=>C(l,"$contextMenuVisible$",i),a=v(e,"disabled",3,!1),s=v(e,"ariaLabel",3,""),d=Se(),l=d.ui.contextMenu.visible$,p=d.ui.contextMenu.openedByBtnKeyboard$,f=d.ui.contextMenu.showContextMenuBtn$,_=d.ui.contextMenu.position$,u=d.ui.contextMenu.btnRef$,$=ee(void 0);qe(()=>{r($)&&_t(()=>{u.set(r($))})});let w=P=>{let A=ys(P),E=xh(r($));_.set(E),p.set(A),l.set(!n())},y=()=>{f.set(!0)},S=()=>{f.set(!1)},k=m(()=>n()?"opened":"");Et(t,{get className(){return r(k)},testId:"btn-context-menu",get disabled(){return a()},get ariaLabel(){return s()},click:w,focus:y,blur:S,get ariaExpanded(){return n()},get ref(){return r($)},set ref(P){O($,me(P))},children:(P,A)=>{$f(P,{})},$$slots:{default:!0}}),q(),o()}var x2=t=>{t.stopPropagation()},w2=L("<div><!> <div></div> <div></div></div>"),S2={hash:"svelte-od3veb",code:`.interactive-episode-icon-animated.svelte-od3veb {position:absolute;top:16px;right:16px;width:32px;height:32px;transition:0.3s;opacity:1;}.interactive-episode-icon-animated.icon-small.svelte-od3veb {width:28px;height:28px;}.invisible.svelte-od3veb {opacity:0;visibility:hidden;}.fullscreen.svelte-od3veb:not(.mobile) {width:40px;top:19px;right:23px;height:40px;}.mobile.svelte-od3veb {width:28px;height:28px;top:12px;right:14px;}.fullscreen.mobile.svelte-od3veb {width:32px;height:32px;}
|
|
229
|
+
`)),b(D,de)};R(j,D=>{r(P)&&D(B)})}var Re=M(j,2),ne=h(Re);{var Ie=D=>{var de=Fe(),Ee=ue(de);{var Qe=Pe=>{var $e=rr();I(Le=>ve($e,Le),[()=>H("tooltip_episode_unfinished")]),b(Pe,$e)},st=Pe=>{var $e=rr();I(()=>ve($e,r(U).text||"")),b(Pe,$e)};R(Ee,Pe=>{u()&&r(U).completed===!1?Pe(Qe):Pe(st,!1)})}b(D,de)};R(ne,D=>{r(U)&&D(Ie)})}g(Re);var Ne=M(Re,2);{var fe=D=>{var de=V$(),Ee=h(de,!0);g(de),I(()=>ve(Ee,d())),b(D,de)};R(Ne,D=>{u()||D(fe)})}g(J),I(D=>{Me=te(J,1,"timeline-preview svelte-1wqg760",null,Me,D),et(J,`width: ${r(G)?r(k):r(S)}px;`)},[()=>({mobile:l()})]),b(t,J),q(),o()}var B$=L('<span class="time svelte-1jr6obn"> </span>'),D$=L("<!> <!>",1),O$={hash:"svelte-1jr6obn",code:".time.svelte-1jr6obn {display:inline-block;padding:6px 10px;border-radius:3px;color:var(--white);background-color:rgba(41, 41, 41, .8);}.timeline-slider {--slider-bg: var(--timeline-slider-bg);--slider-filled-bg: var(--timeline-slider-filled-bg);--slider-handle-bg: var(--timeline-slider-handle-bg);--slider-loaded-bg: var(--timeline-slider-loaded-bg);}"};function uf(t,e){var he;z(e,!0),K(t,O$);let[i,o]=He(),n=()=>C(Y,"$interactiveEpisodes$",i),a=()=>C(E,"$duration$",i),s=()=>C(A,"$position$",i),d=()=>C(pe,"$isInteractiveExpectation$",i),l=()=>C(oe,"$isInteractiveTime$",i),p=()=>C(T,"$isLive$",i),f=()=>C(U,"$isMobile",i),_=()=>C(V,"$isActiveLive$",i),u=()=>C(P,"$bufferedProgress$",i),$=()=>C(Ae,"$disabledControls$",i),w=v(e,"showTimeline",3,!1),y=v(e,"ref",15,void 0),S=Se(),k=Wt(),P=S.state.bufferedProgress$,A=S.state.positionWithScrubbing$,E=S.state.duration$,T=S.state.isLive$,V=S.state.isActiveLive$,U=S.ui.isMobile,G=k.features.episodes?S.actions.internal.getVideoEpisodes():void 0,F=S.actions.internal.getPreviewThumbsData(),Y=S.state.interactiveEpisodes$,X=S.state.isInteractive,oe=S.state.isInteractiveTime$,pe=S.state.isInteractiveExpectation$,le=S.actions.internal.correctSeekTimeToInteractive,Ve=(he=S.callbacks)==null?void 0:he.onDisabledTimelineClick,Ae=S.ui.controls.disabledControls$,J=S.ui.t,Me=k.features.interactiveResponsiveUi,j=m(()=>X?n():G),B=m(()=>lr(a())),Re=m(()=>lr(s())),ne=m(()=>s()/a()),Ie=m(()=>d()||l()),Ne=ee(!1),fe=ee(""),D=ee(0),de=ee(0),Ee=ee(0),Qe=m(()=>({containerWidth:r(de),translateXPx:r(D),translateYPx:X&&F?-36:-16,active:r(Ne)&&w()&&!r(Ie)&&!Me,pointer:!k.features.timelinePreview||!F||p()})),st=J("aria_timeline"),Pe=m(()=>J("aria_timeline_value",{position:r(Re),duration:r(B)}));function $e(Ce){return!le||!X?Ce:le(Ce*a())/a()}function Le(Ce){S.actions.internal.startScrubbing($e(Ce))}function je(Ce){l()||S.actions.internal.progressScrubbing($e(Ce))}function ct(Ce){S.actions.internal.completeScrubbing($e(Ce)),O(Ne,!1)}function ot(Ce,De,ut){$t(Ce,De,ut),O(Ne,!0)}function Nt(Ce,De,ut){$t(Ce,De,ut),O(Ne,!0)}function nt(){O(Ne,!1)}function $t(Ce,De,ut){O(Ee,me($e(Ce))),O(D,me(De)),ut&&O(de,me(ut)),O(fe,me(Ut(Ce)))}function Ut(Ce){let De=lr((p()?1-Ce:Ce)*a());return p()?`-${De}`:De}var Kt=D$(),Be=ue(Kt);df(Be,is(()=>r(Qe),{children:(Ce,De)=>{var ut=Fe(),zt=ue(ut);{var Ge=Xe=>{cf(Xe,{get time(){return r(fe)},get isMobile(){return f()},get videoEpisodes(){return r(j)},previewThumbsData:F,get progress(){return r(Ee)},get duration(){return a()},isInteractive:X})},at=Xe=>{var Ct=B$(),Jt=h(Ct,!0);g(Ct),I(()=>ve(Jt,r(fe))),b(Xe,Ct)};R(zt,Xe=>{k.features.timelinePreview&&F&&!p()?Xe(Ge):Xe(at,!1)})}b(Ce,ut)},$$slots:{default:!0}}));var re=M(Be,2);let W=m(()=>Math.round(r(ne)*100)),se=m(()=>$().has("TIMELINE"));oa(re,{className:"timeline-slider",get isActiveLive(){return _()},get isMobile(){return f()},ariaLabel:st,ariaValueMin:0,get ariaValueMax(){return a()},get ariaValueNow(){return r(W)},get ariaValueText(){return r(Pe)},get loadedProgress(){return u()},get filledProgress(){return r(ne)},get handleProgress(){return r(ne)},get videoEpisodes(){return r(j)},onPointerDown:Le,onHandleMove:je,onPointerMove:Nt,onPointerUp:ct,onPointerEnter:ot,onPointerLeave:nt,onDisabledClick:Ve,isInteractive:X,get disabled(){return r(se)},get hideHandel(){return l()},get ref(){return y()},set ref(Ce){y(Ce)}}),b(t,Kt),q(),o()}var H$={hash:"svelte-1yate8h",code:".timeline-ads-slider {--slider-bg: var(--timeline-slider-bg);--slider-filled-bg: var(--timeline-slider-filled-bg);--slider-handle-bg: var(--timeline-slider-handle-bg);--slider-loaded-bg: var(--timeline-slider-loaded-bg);}"};function Xl(t,e){z(e,!0),K(t,H$);let[i,o]=He(),n=()=>C(l,"$isMobile",i),a=v(e,"position",3,0),s=v(e,"duration",3,0),d=Se(),l=d.ui.isMobile,p=d.ui.t,f=m(()=>lr(s())),_=m(()=>lr(a())),u=m(()=>a()/s()),$=m(()=>p("aria_timeline_value",{position:r(_),duration:r(f)})),w=m(()=>Math.round(r(u)*100));oa(t,{className:"timeline-ads-slider",ariaValueMin:0,get ariaValueMax(){return s()},get ariaValueNow(){return r(w)},get ariaValueText(){return r($)},get filledProgress(){return r(u)},hideHandel:!0,get squareBorders(){return n()}}),q(),o()}var F$=L("<div><!></div>"),U$=L("<div></div>"),z$={hash:"svelte-1gqonyf",code:".timeline.svelte-1gqonyf {position:relative;pointer-events:all;display:flex;align-items:center;bottom:0;width:100%;min-width:86px;padding:3px 10px 4px;box-sizing:border-box;}.timeline.mobile.svelte-1gqonyf {height:16px;padding:6px 12px 7px;margin-top:6px;}.timeline-stub.svelte-1gqonyf {width:100%;min-width:20px;}.timeline-stub.mobile.svelte-1gqonyf {height:8px;}"};function Jl(t,e){z(e,!0),K(t,z$);let[i,o]=He(),n=()=>C(u,"$isLive$",i),a=()=>C(y,"$isMobile",i),s=()=>C(w,"$adPosition",i),d=()=>C($,"$adDuration",i),l=v(e,"isAds",3,!1),p=v(e,"isHidden",3,!1),f=v(e,"ref",15,void 0),_=Se(),u=_.state.isLive$,$=_.ads.duration,w=_.ads.position,y=_.ui.isMobile,S=m(()=>!p()&&(!n()||n()&&e.canRewindLive&&e.isRewindableLive||l()));var k=Fe(),P=ue(k);{var A=T=>{var V=F$();let U;var G=h(V);{var F=X=>{Xl(X,{get position(){return s()},get duration(){return d()}})},Y=X=>{uf(X,{get showTimeline(){return r(S)},get ref(){return f()},set ref(oe){f(oe)}})};R(G,X=>{l()?X(F):X(Y,!1)})}g(V),I(X=>U=te(V,1,"timeline svelte-1gqonyf",null,U,X),[()=>({mobile:a()})]),b(T,V)},E=T=>{var V=U$();let U;I(G=>U=te(V,1,"timeline-stub svelte-1gqonyf",null,U,G),[()=>({mobile:a()})]),b(T,V)};R(P,T=>{r(S)?T(A):T(E,!1)})}b(t,k),q(),o()}import{noop as K$}from"@vkontakte/videoplayer-shared/es2018";var q$=be('<svg><!><path fill="var(--btn-color, #fff)" fill-rule="evenodd" d="m21.616 16.495-.012.07c-.156.852-.282 1.541-.427 2.093-.148.569-.333 1.063-.64 1.5a4.4 4.4 0 0 1-2.507 1.732c-.52.133-1.046.131-1.63.069-.568-.06-1.257-.187-2.11-.343l-4.34-.794c-.853-.156-1.542-.282-2.094-.426-.568-.149-1.062-.334-1.5-.642a4.4 4.4 0 0 1-1.731-2.507c-.133-.518-.131-1.045-.069-1.63.06-.567.187-1.257.343-2.11l.012-.068c.156-.853.282-1.542.427-2.095.148-.568.333-1.062.641-1.5a4.4 4.4 0 0 1 2.507-1.731c.518-.133 1.045-.131 1.63-.069.567.06 1.256.187 2.109.343l4.34.794c.853.156 1.542.282 2.094.426.568.149 1.062.334 1.5.642a4.4 4.4 0 0 1 1.731 2.506c.133.52.131 1.046.069 1.63-.06.568-.187 1.258-.343 2.11m-1.446-2.3c.052-.483.035-.769-.022-.993a2.6 2.6 0 0 0-1.023-1.481c-.19-.133-.45-.25-.921-.373-.48-.125-1.102-.24-1.997-.404l-4.272-.781c-.895-.164-1.518-.277-2.01-.33-.483-.051-.769-.035-.993.023-.6.153-1.125.516-1.481 1.023-.133.19-.25.45-.373.92-.125.48-.24 1.103-.403 1.998s-.277 1.518-.33 2.01c-.051.484-.035.77.023.994.153.6.516 1.125 1.023 1.481.189.133.45.25.92.373.48.125 1.102.24 1.997.404l4.272.781c.895.164 1.518.277 2.01.33.483.051.77.035.993-.023a2.6 2.6 0 0 0 1.481-1.023c.133-.19.25-.45.373-.92.125-.48.24-1.103.403-1.998s.278-1.518.33-2.01Z" clip-rule="evenodd"></path><path fill="var(--btn-color, #fff)" fill-rule="evenodd" d="M18.187 7.488a.9.9 0 0 1-1.045-.727c-.145-.807-.199-1.086-.28-1.296A2.6 2.6 0 0 0 14.504 3.8c-.224-.006-.505.036-1.315.169l-5.846.962c-1.366.224-1.834.313-2.174.492A2.6 2.6 0 0 0 3.837 7.18c-.08.376-.039.85.114 2.226l.011.1a.9.9 0 1 1-1.787.198l-.01-.093-.019-.17c-.129-1.147-.217-1.937-.068-2.636A4.4 4.4 0 0 1 4.332 3.83c.633-.333 1.417-.461 2.556-.648l.163-.027 5.846-.961.098-.016c.674-.111 1.138-.188 1.556-.177a4.4 4.4 0 0 1 3.99 2.819c.15.39.234.853.355 1.526l.017.097a.9.9 0 0 1-.726 1.045" clip-rule="evenodd"></path><path fill="var(--btn-color, #fff)" d="M12.724 12.414a.415.415 0 0 0-.69.231l-.72 4.18a.4.4 0 0 0 .025.221c.085.21.327.311.539.226l3.669-1.467a.406.406 0 0 0 .127-.68z"></path></svg>');function pf(t,e){let i=ke(e,["$$slots","$$events","$$legacy","children"]);var o=q$();let n;var a=h(o);ge(a,()=>{var s;return(s=e.children)!=null?s:ie}),_e(3),g(o),I(()=>n=we(o,n,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none","aria-hidden":"true","data-testid":"episodes-icon",style:"flex-shrink:0",role:"img",...i})),b(t,o)}var W$=be('<svg><!><path fill="var(--btn-color, #fff)" fill-rule="evenodd" d="M4.146 3.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L6.793 6.5 4.146 3.854a.5.5 0 0 1 0-.708" clip-rule="evenodd" opacity=".7"></path></svg>');function ff(t,e){let i=ke(e,["$$slots","$$events","$$legacy","children"]);var o=W$();let n;var a=h(o);ge(a,()=>{var s;return(s=e.children)!=null?s:ie}),_e(),g(o),I(()=>n=we(o,n,{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"13",fill:"none","aria-hidden":"true","data-testid":"chevron-light-icon",role:"img",...i})),b(t,o)}var Q$=L('<span class="text mobile svelte-1yhs2ga"> </span> <div class="chevron-episodes svelte-1yhs2ga"><!></div>',1),G$=L('<span class="text svelte-1yhs2ga"> </span>'),Y$=L('<span class="text count svelte-1yhs2ga"> </span>'),j$=L("<!> <!>",1),Z$={hash:"svelte-1yhs2ga",code:".text.svelte-1yhs2ga {padding:0 8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}.text.count.svelte-1yhs2ga {overflow:visible;}.text.mobile.svelte-1yhs2ga {padding:0 3px 0 4px;}.chevron-episodes.svelte-1yhs2ga {margin-bottom:-4px;}"};function ed(t,e){var le,Ve,Ae;z(e,!0),K(t,Z$);let[i,o]=He(),n=()=>C(w,"$currentGridType$",i),a=()=>C(y,"$openedByKeyboard$",i),s=()=>C(S,"$panelOpened$",i),d=()=>C(k,"$isMobile",i),l=v(e,"position",3,0),p=v(e,"duration",3,0),f=v(e,"timeCodes",19,()=>[]),_=Se(),u=(Ve=(le=_.callbacks)==null?void 0:le.onEpisodeChanged)!=null?Ve:K$,$=!!((Ae=_.callbacks)!=null&&Ae.onEpisodeClicked),w=_.ui.currentGridType$,y=_.ui.episodes.openedByKeyboard$,S=_.ui.episodes.panelOpened$,k=_.ui.isMobile,P=_.ui.t,A=ee(void 0),E=J=>{var j,B,Re;if(!!((j=_.callbacks)!=null&&j.onEpisodeClicked)){let ne=ys(J);y.set(ne),S.set(!0),(Re=(B=_.callbacks)==null?void 0:B.onEpisodeClicked)==null||Re.call(B,ne)}},T=ee(null),V=m(()=>l()/p());qe(()=>{var Me;let J=Nc(r(V),p(),f());J?((Me=r(T))==null?void 0:Me.time)!==J.time&&(u(J),O(T,me(J))):O(T,null)});let U=m(()=>{var J;return((J=r(T))==null?void 0:J.text)||""}),G=m(()=>Ui(n(),"xl")?"FULL":Ui(n(),"m")&&Eh(n(),"xl")?"COUNT":"SHORT"),F=m(()=>`${P("tooltip_episodes")}: ${r(U)}`),Y=async(J,Me,j)=>{await ho(),(J==null?void 0:J.getAttribute("aria-expanded"))==="false"&&Me&&!j&&_t(()=>{y.set(!1),J.focus()})};qe(()=>{Y(r(A),a(),s())});var X=Fe(),oe=ue(X);{var pe=J=>{let Me=m(()=>d()?"px-0":"");Et(J,{get className(){var j;return`w-max btn-full-opacity btn-jc-l ${(j=r(Me))!=null?j:""}`},testId:"btn-episodes",click:E,disabled:!$,get ariaExpanded(){return s()},get ariaLabel(){return r(F)},get ref(){return r(A)},set ref(j){O(A,me(j))},children:(j,B)=>{var Re=Fe(),ne=ue(Re);{var Ie=fe=>{var D=Q$(),de=ue(D),Ee=h(de,!0);g(de);var Qe=M(de,2),st=h(Qe);ff(st,{}),g(Qe),I(()=>ve(Ee,r(U))),b(fe,D)},Ne=fe=>{var D=j$(),de=ue(D);pf(de,{});var Ee=M(de,2);{var Qe=Pe=>{var $e=G$(),Le=h($e,!0);g($e),I(()=>ve(Le,r(U))),b(Pe,$e)},st=(Pe,$e)=>{{var Le=je=>{var ct=Y$(),ot=h(ct,!0);g(ct),I(()=>ve(ot,f().length)),b(je,ct)};R(Pe,je=>{r(G)==="COUNT"&&je(Le)},$e)}};R(Ee,Pe=>{r(G)==="FULL"?Pe(Qe):Pe(st,!1)})}b(fe,D)};R(ne,fe=>{d()?fe(Ie):fe(Ne,!1)})}b(j,Re)},$$slots:{default:!0}})};R(oe,J=>{r(T)&&J(pe)})}b(t,X),q(),o()}import{debounceFn as Z2}from"@vkontakte/videoplayer-shared/es2018";import{ChromecastState as r2,PlaybackState as td,Player as s2,PredefinedQualityLimits as qr,VideoFormat as id,clientChecker as a2}from"@vkontakte/videoplayer-core/es2018";import{assertNonNullable as Un,getHighestQuality as l2,InterfaceLanguage as d2,isInvariantQuality as c2,isNonNullable as u2,loadVKLangPack as p2,Logger as f2,map as Fh,merge as m2,Observable as v2,Subject as zc,Subscription as bf,Tracer as g2,ValueSubject as h2,VideoQuality as _2,devNull as b2,now as $2}from"@vkontakte/videoplayer-shared/es2018";import{SeekAction as ns}from"@vkontakte/videoplayer-statistics/es2018";import{detectEmbed as X$,devNull as Qt,now as Gt}from"@vkontakte/videoplayer-shared/es2018";import{addScript as J$,Subject as Ho,clearVideoElement as e2}from"@vkontakte/videoplayer-shared/es2018";var Vh=(t,e)=>t<400||e<225?5:t<640||e<360?0:t<960||e<540?1:t<1280||e<720?2:3;var t2="//ad.mail.ru/static/admanhtml/rbadman-html5.min.js",Bc=class{constructor(e,i){this.adman=null;this.initialVolume=1;this.videoElement=null;this.currentAdSection=null;this.actions=null;this.adsState=null;this.playerState=null;this.events={init$:new Ho,loadStarted$:new Ho,loadEnded$:new Ho,loadError$:new Ho,ready$:new Ho,slotRequested$:new Ho,started$:new Ho,timeRemained$:new Ho,paused$:new Ho,resumed$:new Ho,ended$:new Ho,empty$:new Ho,skipped$:new Ho,clicked$:new Ho,closed$:new Ho,error$:new Ho};this.loadAdman=e=>(Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_load_start",this.useAdmanFromNPM?"npm":"http"],numbers:[Gt()]}),this.useAdmanFromNPM?this.loadAdmanNPM(e):this.loadAdmanMailRu(e));this.loadAdmanMailRu=e=>new Promise((i,o)=>{let n;this.events.loadStarted$.next();let a=()=>{clearTimeout(n),delete window.admanAsyncInit,window.AdmanHTML?(Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_async_init_done","http"],numbers:[Gt()]}),i(),this.events.loadEnded$.next()):(Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_init_timed_out","http"],numbers:[Gt()]}),o())};J$(t2,e,this.loadTimeout).then(()=>{Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_script_loaded","http"],numbers:[Gt()]}),window.AdmanHTML?(Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_already_inited","http"],numbers:[Gt()]}),i(),this.events.loadEnded$.next()):(Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_wait_async_init","http"],numbers:[Gt()]}),window.admanAsyncInit=a,n=window.setTimeout(a,this.initTimeout))}).catch(s=>{Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_script_load_error","http",String(s)],numbers:[Gt()]}),o(),clearTimeout(n)})});this.loadAdmanNPM=e=>new Promise((i,o)=>{let n;this.events.loadStarted$.next();let a=()=>{clearTimeout(n),delete window.admanAsyncInit,window.AdmanHTML?(Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_init_done","npm"],numbers:[Gt()]}),i(),this.events.loadEnded$.next()):(Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_init_timed_out","npm"],numbers:[Gt()]}),o())},s=()=>{d=!0,o()},d=!1,l=window.setTimeout(()=>{Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_load_timed_out","npm"],numbers:[Gt()]}),s()},this.loadTimeout);e.addEventListener("abort",s),e.aborted&&(Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_load_aborted","npm"],numbers:[Gt()]}),s()),window.AdmanHTML=window.AdmanHTML||null,import("@adtech/rbadman/out/rbadman-html5.min.js").then(()=>{Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_chunk_imorted","npm","failed: "+String(d)],numbers:[Gt()]}),!d&&(window.AdmanHTML?(Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_already_inited","npm"],numbers:[Gt()]}),i(),this.events.loadEnded$.next()):(Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_wait_async_init","npm"],numbers:[Gt()]}),window.admanAsyncInit=a,n=window.setTimeout(a,this.initTimeout)))},s).finally(()=>{clearTimeout(n),clearTimeout(l),e.removeEventListener("abort",s)})});this.onAdsReady=()=>{Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_ads_ready"],numbers:[Gt()]}),this.log({message:"ads ready"}),this.events.ready$.next(),this.startPreroll()};this.onAdStarted=(e,i)=>{Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_ad_started",e,"muted: "+i.muted],numbers:[Gt(),i.bannerID]}),this.adsState&&this.playerState&&this.actions?(this.log({message:`ad started, section: ${e}, banner: ${JSON.stringify(i)}`}),this.events.started$.next(e),i.muted&&(this.setVolume(0),this.actions.setMuted(!0),this.log({message:"ad muted start"}),ye(this.playerState.isMobile)&&this.playerState.mobileUnmuteButtonVisible.set(!0)),this.adsState.duration.set(i.duration),this.adsState.playbackState.set("playing"),this.adsState.canSkip.set(i.allowClose),this.adsState.secondsToWatchBeforeSkip.set(i.allowCloseDelay),this.startWatchDog()):this.onAdError("Started callback failed: Adman is not initialized")};this.onAdTimeRemained=e=>{this.adsState?(this.adsState.position.set(e.currentTime),this.events.timeRemained$.next(e),this.startWatchDog()):this.onAdError("TimeRemained callback failed: Adman state is not initialized")};this.onAdPaused=()=>{var e;Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_ad_pased",(e=this.currentAdSection)!=null?e:""],numbers:[Gt()]}),this.stopWatchDog(),this.adsState?(this.log({message:"ad paused"}),this.adsState.playbackState.set("paused")):this.onAdError("Paused callback failed: Adman state is not initialized")};this.onAdPlayed=()=>{var e;Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_ad_played",(e=this.currentAdSection)!=null?e:""],numbers:[Gt()]}),this.startWatchDog(),this.adsState?(this.log({message:"ad played"}),this.adsState.playbackState.set("playing")):this.onAdError("Player callback failed: Adman is not initialized")};this.onAdMidrollPoint=()=>{if(Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_ad_midroll_pioint"],numbers:[Gt()]}),this.adman&&this.actions){this.log({message:"midroll point"}),this.actions.switchFromVideoToAds(),this.currentAdSection="midroll",this.startWatchDog();try{this.adman.start("midroll")}catch(e){this.onAdError("could not start midroll")}}else this.onAdError("Midroll callback failed: Adman is not initialized")};this.onAdSkipped=()=>{var e;Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_ad_skipped",(e=this.currentAdSection)!=null?e:""],numbers:[Gt()]}),this.log({message:"ad skipped"}),this.stopWatchDog()};this.onAdClosed=()=>{var e;Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_ad_closed",(e=this.currentAdSection)!=null?e:""],numbers:[Gt()]}),this.log({message:"ad closed"}),this.currentAdSection&&this.events.closed$.next(this.currentAdSection),this.stopWatchDog(),this.switchToVideo()};this.onAdCompleted=()=>{var e;Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_ad_completed",(e=this.currentAdSection)!=null?e:""],numbers:[Gt()]}),this.log({message:"ad completed"}),this.currentAdSection?this.events.ended$.next(this.currentAdSection):this.events.empty$.next(),this.switchToVideo(),this.stopWatchDog()};this.onAdClicked=()=>{var e,i;Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_ad_clicked",(e=this.currentAdSection)!=null?e:""],numbers:[Gt()]}),this.log({message:"ad clicked"}),(i=this.videoElement)==null||i.pause(),this.currentAdSection&&this.events.clicked$.next(this.currentAdSection),this.stopWatchDog()};this.onAdError=(e="ad error")=>{Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_ad_error",e],numbers:[Gt()]}),this.log({message:e}),this.events.error$.next(e),this.switchToVideo(!0),this.stopWatchDog()};this.log=e.createComponentLog("AdmanWrapper"),Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_created"],numbers:[Gt()]}),this.loadTimeout=i.loadTimeout,this.initTimeout=i.initTimeout,this.runtimeTimeout=i.runtimeTimeout,this.useAdmanFromNPM=i.useAdmanFromNPM,this.volumeMultiplier=Math.max(0,Math.min(i.volumeMultiplier,1)),this.isVsidOriginal=i.isVsidOriginal}init(e,i,o){this.actions=e,this.adsState=i,this.playerState=o}onAdmanLoadingError(){this.onAdError("adman loading error")}initAdman(e){var A;if(Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_init","already inited: "+!!this.adman],numbers:[Gt(),e.slotId]}),this.adman)return;this.events.init$.next(),this.startWatchDog();let{width:i,height:o,isFullscreen:n,isAutoplay:a,adsContainer:s,adsVideoElement:d,slotId:l,params:p={},duration:f,previewParam:_}=e,u,$=this.playerState&&ye(this.playerState.vsid);$&&(this.isVsidOriginal?u=$:u=parseInt($,36));let{isEmbed:w,immediateOrigin:y}=X$(),S=(A=w?y:window.location.href)!=null?A:window.location.href,k={...p,dl:encodeURIComponent(S),autoplay:a?1:0,player_width:i,player_height:o,preview:_,...u?{request_id:u}:{},duration:f,puid10:Vh(i,o),puid11:n?0:1};_||delete k.preview;let P={slot:l,wrapper:s,videoEl:d,videoQuality:o,params:k,browser:{mobile:!1}};try{let E=new window.AdmanHTML;E.setDebug(!1),E.onReady(this.onAdsReady),E.onStarted(this.onAdStarted),E.onPlayed(this.onAdPlayed),E.onPaused(this.onAdPaused),E.adMidrollPoint(this.onAdMidrollPoint),E.onClosed(this.onAdClosed),E.onSkipped(this.onAdSkipped),E.onClicked(this.onAdClicked),E.onTimeRemained(this.onAdTimeRemained),E.onCompleted(this.onAdCompleted),E.onError(this.onAdError),E.init(P),this.adman=E,this.videoElement=d,this.events.slotRequested$.next(),this.log({message:`adman init, config: ${JSON.stringify(P)}`})}catch(E){Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_init_threw",String(E)],numbers:[Gt()]}),this.onAdError("could not init adman")}}switchToVideo(e=!1){var o,n,a;if(Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_switch_to_video",(o=this.currentAdSection)!=null?o:"","force: "+e],numbers:[Gt()]}),this.currentAdSection===null&&!e){this.log({message:"switch to video, no currentAdSection. can't switch"});return}let i=this.currentAdSection==="postroll";if(this.actions){if(this.adsState&&this.playerState)this.adsState.playbackState.set("inactive"),this.currentAdSection=null,this.playerState.mobileUnmuteButtonVisible.set(!1),this.log({message:`switch to video, isPostroll: ${i}`}),i&&(this.adsState.postrollPassed.set(!0),this.log({message:"postroll passed"}));else{let s="Switch to video: Adman state was not updated correctly";this.log({message:s}),this.events.error$.next(s)}(a=(n=this.actions).switchFromAdsToVideo)==null||a.call(n,!i)}}togglePlay(){var e;if(Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_toggle_play",(e=this.currentAdSection)!=null?e:""],numbers:[Gt()]}),this.adsState){this.log({message:"toggle play"});let i=ye(this.adsState.playbackState);i==="playing"?this.pause():i==="paused"&&this.play()}else this.onAdError("Can not toggle play: Adman state is not initialized")}setInitialVolume(e){this.log({message:`set initial volume ${e}`}),this.initialVolume=e}setVolume(e){let i=e*this.volumeMultiplier;if(this.log({message:`set volume ${i}`}),this.adman)try{this.adman.setVolume(i)}catch(o){this.onAdError("could not set ad volume")}this.videoElement&&(this.videoElement.volume=i)}setFullscreen(e){if(this.log({message:`set fullscreen ${e}`}),this.adman)try{this.adman.setFullscreen(e)}catch(i){this.onAdError("could not set ad fullscreen")}}startPreroll(){if(Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_start_preroll"],numbers:[Gt()]}),this.adman){if(!this.isDestroyed){this.log({message:"start preroll"}),this.setVolume(this.initialVolume),this.currentAdSection="preroll",this.startWatchDog();try{this.adman.start("preroll")}catch(e){this.onAdError("could not start preroll")}}}else this.onAdError("Can not start preroll: Adman is not initialized")}startPostroll(){var e;if(Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_start_postroll",(e=this.currentAdSection)!=null?e:""],numbers:[Gt()]}),this.adman&&this.actions){this.log({message:"start postroll"}),this.actions.switchFromVideoToAds(),this.currentAdSection="postroll",this.startWatchDog();try{this.adman.start("postroll")}catch(i){this.onAdError("could not start postroll")}}else this.onAdError("Can not start postroll: Adman is not initialized")}startWatchDog(){this.watchDogTimeout&&clearTimeout(this.watchDogTimeout),this.watchDogTimeout=window.setTimeout(()=>this.onAdError("Watchdog timeout"),this.runtimeTimeout)}stopWatchDog(){clearTimeout(this.watchDogTimeout)}play(){var e;if(Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_pplay",(e=this.currentAdSection)!=null?e:""],numbers:[Gt()]}),this.adman){this.log({message:"ad play"}),this.startWatchDog();try{this.adman.resume(),this.events.resumed$.next()}catch(i){this.onAdError("could not resume ad")}}else this.onAdError("Can not play: Adman is not initialized")}pause(){var e;if(Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_pause",(e=this.currentAdSection)!=null?e:""],numbers:[Gt()]}),this.adman){this.stopWatchDog(),this.log({message:"ad pause"});try{this.adman.pause(),this.events.paused$.next()}catch(i){this.onAdError("could not pause ad")}}else this.onAdError("Can not pause: Adman is not initialized")}skip(){var e;if(Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_skip",(e=this.currentAdSection)!=null?e:""],numbers:[Gt()]}),this.adman){this.stopWatchDog(),this.log({message:"ad skip"});try{this.adman.skip(),this.events.skipped$.next()}catch(i){this.onAdError("could not skip ad")}}else this.onAdError("Can not skip: Adman is not initialized")}setPosition(e,i){var o;(o=this.adman)==null||o.setPosition(Math.floor(e),Math.floor(i))}destroy(){var e,i,o,n,a,s,d,l,p,f,_,u;Qt.push("ui",{key:"videoplayer_embed",strings:["new","adman_destroy"],numbers:[Gt()]}),this.log({message:"destroy"}),this.stopWatchDog(),(e=this.adman)==null||e.onReady(void 0),(i=this.adman)==null||i.onStarted(void 0),(o=this.adman)==null||o.onPlayed(void 0),(n=this.adman)==null||n.onPaused(void 0),(a=this.adman)==null||a.adMidrollPoint(void 0),(s=this.adman)==null||s.onClosed(void 0),(d=this.adman)==null||d.onSkipped(void 0),(l=this.adman)==null||l.onClicked(void 0),(p=this.adman)==null||p.onTimeRemained(void 0),(f=this.adman)==null||f.onCompleted(void 0),(_=this.adman)==null||_.onError(void 0),(u=this.adman)==null||u.destroy(),this.videoElement&&e2(this.videoElement),this.isDestroyed=!0}};var Rh=t=>{let e=Math.round(t);return isNaN(e)||e<40?"":e>=40&&e<55?50:e>=55&&e<90?60:e>=90&&e<180?120:e>=180?240:""};var mf=class{constructor(){this.oneLineRegExp=/\r\n|\n|\r/;this.twoLinesRegExp=/\r\n\r\n|\n\n|\r\r/}parse(e,i){let o=[],n=e.split(this.twoLinesRegExp);for(let a of n){let s={startTime:0,endTime:0,texts:[],lang:i},d=a.split(this.oneLineRegExp);for(let l of d)if(!s.startTime&&!s.endTime){let p=new Dc,{startTime:f,endTime:_}=p.parse(l);s.startTime=f,s.endTime=_}else if(l.trim()!==""){let p=new vf,{texts:f}=p.parse(l);s.texts=[...s.texts,...f]}(s.startTime||s.endTime)&&s.texts.length>0&&o.push(s)}return o}},Dc=class{constructor(){this.timeRegExp=/(\d{2,})?:?(\d{2}):(\d{2}).(\d{2,3})/;this.timingRegExp=new RegExp(`${this.timeRegExp.source}( ?--> ?)${this.timeRegExp.source}`)}parse(e){let i={startTime:0,endTime:0},o=this.timingRegExp.exec(e);return o&&(i.startTime=this.calcTime(o[1],o[2],o[3],o[4]),i.endTime=this.calcTime(o[6],o[7],o[8],o[9])),i}parseTime(e){let i=this.timeRegExp.exec(e);return i?this.calcTime(i[1],i[2],i[3],i[4]):0}isTime(e){return this.timeRegExp.test(e)}calcTime(e="0",i="0",o="0",n="0"){let a=Number(e)*60*60,s=Number(i)*60,d=Number(o),l=+`0.${n}`;return a+s+d+l}},vf=class{constructor(){this.letterTagRegExp=/<[a-z]*>|<\/[a-z]*>/}parse(e){let i={texts:[]},n=e.replace(new RegExp(this.letterTagRegExp,"g"),"").split({[Symbol.split](s){let d=0,l=[];for(;d<s.length;){let p=["<",">"].reduce((f,_)=>{let u=s.indexOf(_,d);return f===-1||f>u?u:f},-1);if(p===-1){l.push(s.substring(d));break}l.push(s.substring(d,p)),d=p+1}return l}}),a=new Dc;for(let s of n)a.isTime(s)?i.texts.push({type:"timestamp",value:a.parseTime(s)}):i.texts.push({type:"text",value:s});return i}},Nh=mf;import{isNonNullable as gf}from"@vkontakte/videoplayer-shared/es2018";var na,xi,hf=0,_f=!1,Bh="",Dh=(t,e=0,i=0)=>t<e&&t<i,Oc=(t,e=0,i=0)=>t>=e&&t<=i,i2=(t,e=0,i=0)=>t>e&&t>i,Oh=(t,e,i,o=!1)=>{var d;let n=(d=i.find(({id:l})=>l===e.value))==null?void 0:d.subtitles;if(o)return n==null?void 0:n.find(({startTime:p,endTime:f})=>Oc(t,p,f));let a=t>=hf,s=t<hf;if(hf=t,s&&(_f=!1),gf(na)&&Oc(t,na.startTime,na.endTime)&&Bh===e.value)return na;if(!gf(xi)&&(n!=null&&n.length)&&!_f){xi=n.find(({startTime:p,endTime:f})=>Oc(t,p,f)||a&&Dh(t,p,f)),na=void 0,!gf(xi)&&n[n.length-1].endTime<t&&(_f=!0);return}else{if(Oc(t,xi==null?void 0:xi.startTime,xi==null?void 0:xi.endTime))return na=xi,xi=void 0,Bh=e.value,na;(a&&i2(t,xi==null?void 0:xi.startTime,xi==null?void 0:xi.endTime)||s&&Dh(t,xi==null?void 0:xi.startTime,xi==null?void 0:xi.endTime))&&(xi=void 0)}};var Hh={ru:"\u0420\u0443\u0441\u0441\u043A\u0438\u0439",en:"English",uk:"\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430",be:"\u0411\u0435\u043B\u0430\u0440\u0443\u0441\u043A\u0430\u044F (\u0442\u0430\u0440\u0430\u0448\u043A\u0435\u0432i\u0446\u0430)",es:"Espa\xF1ol",fi:"Suomi",de:"Deutsch",it:"Italiano",bg:"\u0411\u044A\u043B\u0433\u0430\u0440\u0441\u043A\u0438",hr:"Hrvatski",hu:"Magyar",sr:"\u0421\u0440\u043F\u0441\u043A\u0438",pt:"Portugu\xEAs",el:"\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AC",pl:"Polski",fr:"Fran\xE7ais",ko:"\uD55C\uAD6D\uC5B4","zh-CN":"\u6C49\u8BED",lt:"Lietuvi\u0173",ja:"\u65E5\u672C\u8A9E",cs:"\u010Ce\u0161tina",et:"Eesti",tt:"\u0422\u0430\u0442\u0430\u0440\u0447\u0430",ba:"\u0411\u0430\u0448\u04A1\u043E\u0440\u0442\u0441\u0430",cv:"\u0427\u0103\u0432\u0430\u0448\u043B\u0430",sk:"Sloven\u010Dina",ro:"Rom\xE2n\u0103",no:"Norsk",lv:"Latvie\u0161u",az:"Az\u0259rbaycan dili",hy:"\u0540\u0561\u0575\u0565\u0580\u0565\u0576",sv:"Svenska",nl:"Nederlands",tk:"T\xFCrkmen",ka:"\u10E5\u10D0\u10E0\u10D7\u10E3\u10DA\u10D8",da:"Dansk",uz:"O\u2018zbek",th:"\u0E20\u0E32\u0E29\u0E32\u0E44\u0E17\u0E22",id:"Bahasa Indonesia",tg:"\u0422\u043E\u04B7\u0438\u043A\u04E3",sl:"Sloven\u0161\u010Dina",bs:"Bosanski","pt-BR":"Portugu\xEAs brasileiro",fa:"\u0641\u0627\u0631\u0633\u06CC",vi:"Ti\u1EBFng Vi\u1EC7t",hi:"\u0939\u093F\u0928\u094D\u0926\u0940",si:"\u0DC3\u0DD2\u0D82\u0DC4\u0DBD",bn:"\u09AC\u09BE\u0982\u09B2\u09BE",tl:"Tagalog",mn:"\u041C\u043E\u043D\u0433\u043E\u043B",my:"\u1017\u1019\u102C\u1005\u102C",tr:"T\xFCrk\xE7e",ne:"\u0928\u0947\u092A\u093E\u0932\u0940",ur:"\u0627\u0631\u062F\u0648",ky:"\u041A\u044B\u0440\u0433\u044B\u0437 \u0442\u0438\u043B\u0438",pa:"\u067E\u0646\u062C\u0627\u0628\u06CC",os:"\u0418\u0440\u043E\u043D",kn:"\u0C95\u0CA8\u0CCD\u0CA8\u0CA1",sw:"Kiswahili",kk:"\u049A\u0430\u0437\u0430\u049B\u0448\u0430",ar:"\u0627\u0644\u0639\u0631\u0628\u064A\u0629",he:"\u05E2\u05D1\u05E8\u05D9\u05EA",ab:"\u0410\u04A7\u0441\u0448\u04D9\u0430",eu:"Euskara",eo:"Esperanto"},o2={abk:"as",ara:"ar",aze:"az",bak:"ba",bel:"be",ben:"bn",bos:"bs",bul:"bg",ces:"cs",chv:"cv",dan:"da",deu:"de",ell:"el",eng:"en",epo:"eo",est:"et",eus:"eu",fas:"fa",fin:"fi",fra:"fr",heb:"he",hin:"hi",hrv:"hr",hun:"hu",hye:"hy",ind:"id",ita:"it",jpn:"ja",kan:"kn",kat:"ka",kaz:"kk",kir:"ky",kor:"ko",lav:"lv",lit:"lt",mon:"mn",mya:"my",nep:"ne",nld:"nl",nor:"no",oss:"os",pan:"pa",pol:"pl",por:"pt",ron:"ro",rus:"ru",sin:"si",slk:"sk",slv:"sl",spa:"es",srp:"sr",swa:"sw",swe:"sv",tat:"tt",tgk:"tg",tgl:"tl",tha:"th",tuk:"tk",tur:"tr",ukr:"uk",urd:"ur",uzb:"uz",vie:"vi"},Hc=t=>{var e,i;return(i=(e=Hh[t])!=null?e:Hh[o2[t]])!=null?i:void 0};import{Subscription as n2}from"@vkontakte/videoplayer-shared/es2018";import"@vkontakte/videoplayer-statistics/es2018";var Fc=class{constructor(e,i=new n2){this.oneStat=e;this.statSubscription=i}destroy(){this.oneStat.destroy(),this.statSubscription.unsubscribe()}};var Uc=(i=>(i.DESKTOP_CONTROL_PANEL_LEFT="desktop-control-panel-left",i.DESKTOP_CONTROL_PANEL_RIGHT="desktop-control-panel-right",i))(Uc||{});var zr=t=>t!=null?t:0,Qa=(t,e)=>{var n,a;let i=(n=t==null?void 0:t.getBoundingClientRect)==null?void 0:n.call(t),o=(a=e==null?void 0:e.getBoundingClientRect)==null?void 0:a.call(e);return{top:Math.round(zr(i==null?void 0:i.top)-zr(o==null?void 0:o.top)),left:Math.round(zr(i==null?void 0:i.left)-zr(o==null?void 0:o.left)),bottom:Math.round(zr(i==null?void 0:i.bottom)-zr(o==null?void 0:o.top)),right:Math.round(zr(i==null?void 0:i.right)-zr(o==null?void 0:o.left))}},Ga=t=>{var i;let e=(i=t==null?void 0:t.getBoundingClientRect)==null?void 0:i.call(t);return{width:zr(e==null?void 0:e.width),height:zr(e==null?void 0:e.height)}};var Uh=({interfaceLanguage:t,isCyrillicRelatedInterface:e,videoId:i,isClip:o,isLiveCatchUpMode:n,statAuthToken:a,isAudioDisabled:s,canDownload:d,callbacks:l,webApi:p,videoEpisodes:f,previewThumbsData:_,uiConfig:u,coreConfig:$,player:w,disabledControls:y,isInteractive:S,interactiveRanges$:k,isInteractiveTime$:P,replayInteractive:A,stopPlayer:E,hasInteractiveBranches:T,playPrevChapterDisabledTooltip:V,additionalButtons:U,additionalSettingsMenuItems:G,additionalContextMenuItems:F,playPrevVideo:Y,playNextVideo:X,looped:oe=!1,statistics:pe,saveRate:le,internalsExposure:Ve})=>{var Do,Rm,Nm;let Ae={...$,configName:[...(Do=$.configName)!=null?Do:[],"ui"],isAudioDisabled:s,live:{...(Rm=$.live)!=null?Rm:{},isLiveCatchUpMode:!!n}},J=u,Me=g2.createRootTracer(J.features.saveTraceInfoToFile),j=Me.createComponentTracer("Store"),B=w||new s2(Ae,Me);Ve==null||Ve.expose({corePlayer:B});let Re=new f2,ne=new Bc(Re,{loadTimeout:J.ads.loadTimeout,initTimeout:J.ads.initTimeout,runtimeTimeout:J.ads.runtimeTimeout,useAdmanFromNPM:J.ads.useAdmanFromNPM,volumeMultiplier:J.ads.volumeMultiplier,isVsidOriginal:J.ads.isVsidOriginal}),Ie=Qs.getInstance(),Ne=p==null?void 0:p.pictureInPictureApi,fe=p==null?void 0:p.annotationsApi,D=Re.createComponentLog("Store"),de,Ee,Qe={},st=new mc,Pe=pe?Yt(pe.oneStat.vsid$):ar(void 0),$e=ae(_s()),Le=ae(!1),je=(Nm=Ne==null?void 0:Ne.info.isActive$)!=null?Nm:new h2(!1),ct=ae(0),ot=ae([]),Nt=m2(B.events.fatalError$,B.events.managedError$).subscribe(c=>ot.update(x=>[...x,c])),nt=ar(!1,c=>{let x=B.events.fatalError$.subscribe(()=>c(!0));return()=>x.unsubscribe()}),$t=async c=>{var ce;let x=Object.values(d2).includes(c);if(J.downloadVKLanguages&&(x&&J.updateBuiltinLanguages||!Sp(c))){let We;try{We=await p2(c,Cg,Tg)}catch(wt){(ce=pe==null?void 0:pe.oneStat)==null||ce.logError({errorType:"VKLangPack",fatal:!1}),Ie==null||Ie.report(wt,{errorType:"VKLangPack",fatal:!1})}We&&(wp({language:c,pack:We,fallback:J.defaultLanguage}),Ut.set(c))}Sp(c)&&Ut.set(c)},Ut=ae(t),Kt=ae(e);$t(t);let Be=(c,x)=>{let N=ye(Ut);return Cp(N,c,x,J.defaultLanguage)},re=ae("thumb"),W=(()=>{let c=vi([nt,re],([x,N])=>x?"crashed":N);return{...c,is:x=>ye(c)===x}})(),se=(()=>{let c=ae(new Set(y));return{...c,add:x=>{c.update(N=>new Set([...N].concat(x)))},remove:x=>{c.update(N=>{let ce=[...N];return new Set(Array.isArray(x)?ce.filter(We=>!x.includes(We)):ce.filter(We=>We!==x))})},includes:x=>{let N=ye(c);return Array.isArray(x)?x.every(ce=>N.has(ce)):N.has(x)}}})();j.log("create store"),D({message:"create store"});let he=c=>{let x=c.container;x.append(B.experimental.element$.getValue()),Xe=new MutationObserver(N=>{let{removedNodes:ce}=N[0];ce.length&&x.append(B.experimental.element$.getValue())}),Xe.observe(x,{childList:!0})},Ce=c=>{D({message:`init video, config: ${JSON.stringify(c)}`}),S?he(c):(b2.push("ui",{key:"videoplayer_embed",strings:["new","core_init_video"],numbers:[$2()]}),B.initVideo(c)),j.log("init video",{isInteractive:S}),c.subtitles&&B.setExternalTextTracks(c.subtitles),de=c},De=new zc,ut=c=>De.next(c),zt=new zc,Ge=new zc,at=new zc,Xe=null,Ct={actionRewind$:zt,actionSeek$:Ge,inPiP$:je,inFullscreen$:new v2(c=>$e.subscribe(x=>c.next(x))),actionSetSubtitle$:at,nextMovie$:De};if(pe){let{oneStat:c,statSubscription:x}=pe;S||x.add(c.attachTo(B)),x.add(c.attachToUi(Ct)),x.add(c.attachToAds(ne.events)),c.authorize(a).catch(N=>{D({message:`onestat auth error ${String(N)}`})})}if(Ie){let c=new bf,x=(N,ce)=>c.add(N.subscribe(ce));if(x(B.events.managedError$,N=>{Ie.logIError(N)}),x(B.events.fatalError$,N=>{Ie.logIError(N,!0)}),pe){let{oneStat:N}=pe;x(N.experimental.error$,ce=>{Ie.logIError(ce)})}Ie.sentrySubscription.add(c)}let Jt=()=>{a2.device.isIOS&&Ee&&dh(Ee).catch(c=>{D({message:`exitIosSafariFullscreen failed: ${c}`})})},Ke=new bf().add(B.experimental.element$.subscribe(c=>{c&&(Ee=c,c.classList.add("player-media"),js(Ne)&&(Ne.updateVideoElement(),Ne.registryEventHandlers()),S&&c.setAttribute("pip","false"))})).add(B.events.ended$.subscribe(()=>{var c;Jt(),(c=l==null?void 0:l.onEnded)==null||c.call(l)})).add(B.events.looped$.subscribe(()=>{var c;(c=l==null?void 0:l.onLooped)==null||c.call(l)})).add(B.events.started$.subscribe(async()=>{var x,N;js(Ne)&&await(Ne==null?void 0:Ne.revealPictureInPicture());let c=B.info.muted$.getValue();(x=l==null?void 0:l.onStarted)==null||x.call(l),(N=Qe.onStarted)==null||N.call(Qe,c)})).add(B.events.willSeek$.subscribe(({from:c,to:x})=>{var N;(N=l==null?void 0:l.onSeek)==null||N.call(l,c,x)})).add(B.events.autoplaySoundProhibited$.subscribe(()=>{var c;(c=l==null?void 0:l.onAutoplaySoundProhibited)==null||c.call(l)})).add(B.info.position$.subscribe(c=>{var N;let x=B.info.duration$.getValue();isFinite(x)&&x>0&&((N=l==null?void 0:l.onTimeupdate)==null||N.call(l,x,c),ne.setPosition(c,x))})).add(B.events.fatalError$.subscribe(c=>{var x;(x=l==null?void 0:l.onCrashed)==null||x.call(l,c?`${c.id}: ${c.message}`:void 0)})).add(B.events.fetcherRecoverableError$.subscribe(c=>{var x;(x=l==null?void 0:l.onRecoverableError)==null||x.call(l,c?`${c.id}: ${c.message}`:void 0)})).add(B.events.loadedMetadata$.subscribe(()=>{vt.state.loadedMetadata$.set(!0)})).add(B.info.is3DVideo$.subscribe(c=>{vt.ui.is3DVideo.set(c)})).add(B.info.isEnded$.subscribe(c=>{S&&(c?(P!=null&&P.getValue()&&se.add(El),se.add("PLAY_BUTTON")):se.remove("PLAY_BUTTON"))})).add(B.info.liveTime$.subscribe(c=>{var x;(x=l==null?void 0:l.onLiveTime)==null||x.call(l,c)})).add(B.info.isStalled$.subscribe(c=>{var x;(x=l==null?void 0:l.onStalledChanged)==null||x.call(l,c)})).add(B.info.isLiveEnded$.subscribe(c=>{var x;return c&&((x=l==null?void 0:l.onLiveEnded)==null?void 0:x.call(l))})).add(B.info.currentFormat$.subscribe(()=>{var c;(c=p==null?void 0:p.pictureInPictureApi)==null||c.remove()})).add(ne.events.loadStarted$.subscribe(()=>{var c,x;return(x=(c=l==null?void 0:l.adsInfo)==null?void 0:c.onLoadStarted)==null?void 0:x.call(c)})).add(ne.events.loadEnded$.subscribe(()=>{var c,x;return(x=(c=l==null?void 0:l.adsInfo)==null?void 0:c.onLoadEnded)==null?void 0:x.call(c)})).add(ne.events.loadError$.subscribe(()=>{var c,x;return(x=(c=l==null?void 0:l.adsInfo)==null?void 0:c.onLoadError)==null?void 0:x.call(c)})).add(ne.events.init$.subscribe(()=>{var c,x;return(x=(c=l==null?void 0:l.adsInfo)==null?void 0:c.onInit)==null?void 0:x.call(c)})).add(ne.events.ready$.subscribe(()=>{var c,x;return(x=(c=l==null?void 0:l.adsInfo)==null?void 0:c.onReady)==null?void 0:x.call(c)})).add(ne.events.started$.subscribe(c=>{var x,N;return(N=(x=l==null?void 0:l.adsInfo)==null?void 0:x.onStarted)==null?void 0:N.call(x,c)})).add(ne.events.timeRemained$.subscribe(c=>{var x,N;return(N=(x=l==null?void 0:l.adsInfo)==null?void 0:x.onTimeRemained)==null?void 0:N.call(x,c)})).add(ne.events.ended$.subscribe(c=>{var x,N;return(N=(x=l==null?void 0:l.adsInfo)==null?void 0:x.onCompleted)==null?void 0:N.call(x,c)})).add(ne.events.empty$.subscribe(()=>{var c,x;return(x=(c=l==null?void 0:l.adsInfo)==null?void 0:c.onEmpty)==null?void 0:x.call(c)})).add(ne.events.clicked$.subscribe(c=>{var x,N;return(N=(x=l==null?void 0:l.adsInfo)==null?void 0:x.onClicked)==null?void 0:N.call(x,c)})).add(ne.events.closed$.subscribe(c=>{var x,N;return(N=(x=l==null?void 0:l.adsInfo)==null?void 0:x.onClosed)==null?void 0:N.call(x,c)})).add(ne.events.error$.subscribe(c=>{var x,N;return(N=(x=l==null?void 0:l.adsInfo)==null?void 0:x.onError)==null?void 0:N.call(x,c)})).add(ne.events.paused$.subscribe(()=>{var c,x;return(x=(c=l==null?void 0:l.adsInfo)==null?void 0:c.onPaused)==null?void 0:x.call(c)})).add(ne.events.resumed$.subscribe(()=>{var c,x;return(x=(c=l==null?void 0:l.adsInfo)==null?void 0:c.onResumed)==null?void 0:x.call(c)})),lt=new bf,ti=()=>{var wt,Lt,Ft;let{debugLog:c}=J,x,N="#9df7b7",ce="#efd169";if(c&&c!==!0){let{colors:Vt}=c;x=c.tag,N=(wt=Vt==null?void 0:Vt[0])!=null?wt:N,ce=(Ft=(Lt=Vt==null?void 0:Vt[1])!=null?Lt:Vt==null?void 0:Vt[0])!=null?Ft:ce}let We=x?`: ${x}`:"";lt.add(B.events.log$.subscribe(Vt=>{console.debug(`%c sdk${We} `,`background:${N};`,`sdk component: ${Vt.component}`,Vt.message)})).add(Re.log$.subscribe(Vt=>{console.debug(`%c ui${We} `,`background:${ce};`,`ui component: ${Vt.component}.`,Vt.message)}))},Ri=()=>{lt.unsubscribe()},Lo=(c,x)=>{j.log("start camera manual rotation",{mx:c,my:x}),B.startCameraManualRotation(c,x)},Ni=(c=!1)=>{j.log("stop camera manual rotation",{immediate:c}),B.stopCameraManualRotation(c)},yo=(c,x,N)=>{j.log("move camera focus px",{xpx:c,ypx:x,dt:N}),B.moveCameraFocusPX(c,x,N)},Vo=()=>{B.holdCamera()},Pt=()=>{B.releaseCamera()},gt=ar(B.info.position$.getValue(),c=>{let x,N,ce=()=>{let We=B.info.playbackState$.getValue(),wt=B.info.isLive$.getValue(),Lt=B.info.duration$.getValue(),Ft=B.info.position$.getValue();if(We&&[td.PLAYING,td.PAUSED].includes(We)){let Vt=wt?Ft-Lt:B.getExactTime();Vt!==N&&c(Vt),N=Vt}x=requestAnimationFrame(ce)};return ce(),()=>cancelAnimationFrame(x)}),kt=Yt(B.info.playbackState$),Z=Yt(B.info.currentBuffer$),ei=Yt(B.info.isEnded$),Pi=Yt(B.info.isLive$),wi=J.features.playbackRate?Yt(B.info.canChangePlaybackSpeed$):ar(!1),ii=Yt(B.info.liveBufferTime$),zi=Yt(B.info.volume$),Ai=Yt(B.info.muted$),Ro=vc(B.info.predefinedQualityLimitType$.pipe(Fh(c=>c===qr.TRAFFIC_SAVING)),B.info.predefinedQualityLimitType$.getValue()===qr.TRAFFIC_SAVING),Bi=vc(B.info.predefinedQualityLimitType$.pipe(Fh(c=>c===qr.HIGH_QUALITY)),B.info.predefinedQualityLimitType$.getValue()===qr.HIGH_QUALITY),Bt=Yt(B.info.autoQualityLimitingAvailable$),ui=Yt(B.info.availableQualities$),xt=Yt(B.info.availableQualitiesFps$),qt=Yt(B.info.chromecastState$),co=Yt(B.info.chromecastDeviceName$),jt=Yt(B.info.currentFormat$),qn=Yt(B.info.throughputEstimation$),xo=Yt(B.info.videoBitrate$),wo=Yt(B.info.intrinsicVideoSize$),si=Yt(B.info.duration$),bt=Yt(B.info.isAudioAvailable$),gi=null,Mi=B.info.isBuffering$,Di=ar(Mi.getValue(),c=>{let x=Mi.subscribe(N=>{N&&gi===null?gi=window.setTimeout(()=>{c(Mi.getValue()),gi=null},J.loaderDelay):c(N)});return()=>{x.unsubscribe(),gi&&clearTimeout(gi)}}),$n=()=>{gi&&clearTimeout(gi),gi=null},Si=vi([si,Pi],([c,x])=>x?-c:c),Zi=vi([kt],([c])=>c===td.PLAYING),rn=Yt(B.info.atLiveEdge$),yn=Yt(B.info.atLiveDurationEdge$),Li=Yt(B.info.position$),Wn=vi([Li,si],([c,x])=>isFinite(c)&&isFinite(x)&&!!x),sn=vi([qt],([c])=>c===r2.CONNECTED),So=Yt(B.info.availableVideoStreams$),xn=J.features.audioLanguages?Yt(B.info.availableAudioStreams$):ar([]),Mr=Yt(B.info.currentVideoStream$),cr=Yt(B.info.currentAudioStream$),Kn=c=>{c.language&&xp(c.language),B.setVideoStream(c)},wn=c=>{c.language&&xp(c.language),B.setAudioStream(c)},an=c=>{let x;if(c.length===1&&(x=c.at(0)),x!=null||(x=c.find(ce=>"isDefault"in ce&&ce.isDefault)),x)return x;let N=Yg();return N&&(x=c.find(({language:ce})=>N===ce)),x!=null||(x=c.at(0)),x},Sn=!1;Ke.add(B.info.availableAudioStreams$.subscribe(c=>{if(!Sn&&c.length){let x=an(c);x&&(B.setAudioStream(x),Sn=!0)}}));let uo=!1;Ke.add(B.info.availableVideoStreams$.subscribe(c=>{if(!uo&&c.length){let x=an(c);x&&(B.setVideoStream(x),uo=!0)}}));let Je=ae(void 0),ln=Yt(B.info.isAutoQualityEnabled$,c=>c&&Je.set(void 0)),Qn=Yt(B.info.currentQuality$,()=>Je.set(void 0)),Gn=vi([Je,Qn],([c,x])=>c!=null?c:x),Cn=vi(jt,c=>c!==id.MPEG),dn=vi([ui,xt,ln,Gn,Cn],([c,x,N,ce,We])=>{let wt=[];We&&wt.push({value:"auto",displayValue:Be("auto_quality_option"),selected:N});let Lt=c.filter(Ft=>!c2(Ft));for(let Ft of Lt){let Vt=x[Ft];wt.push({value:Ft,displayValue:`${Ft}${Vt?Rh(Vt):""}`,selected:N?!1:Ft===ce})}return wt}),cn=Yt(B.info.currentPlaybackRate$),Uo=vi([cn,rn,yn],([c,x,N])=>{let ce=N||S?1:J.controls.playbackRateMin,We=x?1:J.controls.playbackRateMax,wt=J.controls.playbackRateStep,Lt=[];for(let Ft=ce;Ft<=We;Ft+=wt)Lt.push({value:Ft,displayValue:Ft===1?Be("playback_rate_1"):Be("playback_rate",{multiplier:Ft.toString(10)}),selected:c===Ft});return Lt}),qi={displayValue:Be("subtitles_off"),value:"off"},Wi=ae({...qi}),Yn=J.features.subtitles?Yt(B.info.availableTextTracks$):ar([]),Tn=Hg(),jn=vi([Yn,Wi],([c,x],N)=>{var wt;let ce=[],We=c.find(({id:Lt})=>Lt===x.value);if(We!=null&&We.url){let[,Lt]=(wt=Tn.find(We.url))!=null?wt:[];if(Lt){N(Lt);return}st.download(We.url).then(Ft=>{if(!Ft||st.isDestroyed())return;let Vt=new Nh,ds=We.language;if(ds){let k1=!!We.isAuto,I1=Vt.parse(Ft,ds);ce.push({lang:ds,subtitles:I1,isAuto:k1,id:We.id})}Tn.add(We.url,ce),ye(Wi).value===x.value&&N(ce)}).catch(Ft=>{var Vt;(Vt=pe==null?void 0:pe.oneStat)==null||Vt.logError({errorType:"Subtitles download",fatal:!1}),Ie==null||Ie.report(Ft,{errorType:"Subtitles download",fatal:!1})})}N(ce)}),ur=vi([cn,Zi,Wi],([c,x,N],ce)=>{let Lt;if(B.info.isLive$.getValue()&&x&&N.value!==qi.value){let Vt=()=>{let ds=1e3/(3*c);Lt=setTimeout(Vt,ds),ce(Date.now())};return Vt(),()=>clearTimeout(Lt)}}),Xi=vi([Yn,Wi],([c,x])=>{if(!c.length)return[];let N=[];for(let{language:ce,isAuto:We,id:wt}of c){let Lt=ce&&Hc(ce);ce&&Lt&&N.push({displayValue:We?Be("subtitles_auto",{language:Lt}):Lt,value:wt,selected:(x==null?void 0:x.value)===wt,isAuto:We})}return N.length?(N.unshift({...qi,selected:(x==null?void 0:x.value)===qi.value}),N):[]}),Ji={available:[],prev:[]},kn=()=>{var x,N;let c=B.experimental.getCurrentTime$.getValue();return(N=(x=c==null?void 0:c())!=null?x:Ee==null?void 0:Ee.currentTime)!=null?N:0},In=vi([gt,Wi,jn,ur],([c,x,N,ce])=>{var wt;let We=B.info.isLive$.getValue();if(We&&Ji.prev!==N){let Lt=N.find(({id:Vt})=>Vt===x.value),Ft=Ji.prev.find(({id:Vt})=>Vt===x.value);if(Lt){let Vt={...Lt,subtitles:[...(wt=Ft==null?void 0:Ft.subtitles)!=null?wt:[],...Lt.subtitles]};Ji.available=[Vt],Ji.prev=N}}if(x&&x.value!==qi.value){let Lt=We?kn():c,Ft=We?Ji.available:N;return Oh(Lt,x,Ft,We)}}),po=vi([In],([c])=>c!=null&&c.texts?c.texts:[]),eo=ae(!0),En=vi([Z,Si,Li,ii],([c,x,N,ce])=>{var Ft;let We=(Ft=c==null?void 0:c.end)!=null?Ft:0;if(!ce)return We/x;let Lt=-N+ce-x;return(We-Lt)/x}),No=Yt(B.info.availableSources$),Lr=vi([No],([c])=>Object.keys((c==null?void 0:c[id.MPEG])||{}).length>0),Pn=()=>{var N,ce,We;let c=Object.keys(((ce=(N=B.info.availableSources$)==null?void 0:N.getValue())==null?void 0:ce[id.MPEG])||{}),x=l2(c)||_2.Q_144P;return(We=de.sources[id.MPEG])==null?void 0:We[x]},pr=()=>{var x;let c=Pn();if(c)j.log("download video",{url:c}),Bg(c,((x=de==null?void 0:de.meta)==null?void 0:x.title)||"video");else{let N="There is no URL for download video";j.log("download video",{message:N}),D({message:N})}},An=()=>{D({message:"toggle muted"});let c=B.info.muted$.getValue();B.info.volume$.getValue()===0&&!c?Ln(Xn()):oi(!c)},Mn=()=>{var c;if(vt.ui.settingsMenu.visible$.set(!1),!ye(vt.ui.settingsSubMenu.visible$)){let x=ye(vt.ui.settingsMenu.ref$);if((c=l==null?void 0:l.uiInfo)!=null&&c.onSettingsMenu&&x){let ce=Ga(x),We={top:0,left:0,bottom:0,right:0};l.uiInfo.onSettingsMenu({visible:!1,size:ce,position:We,name:"settings"})}}j.log("close settings menu")},Vr=async(c,x=()=>Promise.resolve())=>{var We;vt.ui.settingsMenu.openedByBtnKeyboard$.set(!!c),vt.ui.settingsMenu.visible$.set(!0),await x();let N=ye(vt.ui.settingsMenu.ref$),ce=Es();if((We=l==null?void 0:l.uiInfo)!=null&&We.onSettingsMenu&&N&&ce){let Lt=Ga(N),Ft=Qa(N,ce);l.uiInfo.onSettingsMenu({visible:!0,size:Lt,position:Ft,name:"settings"})}j.log("open settings menu",{wasOpenedByKeyboard:c})},Zn=(c,x=!1)=>{var wt;vt.ui.settingsSubMenu.visible$.set(!1);let N=ye(vt.ui.settingsMenu.ref$),ce=Es(),We=ye(vt.ui.settingsMenu.visible$);if((wt=l==null?void 0:l.uiInfo)!=null&&wt.onSettingsMenu&&N&&ce)if(We&&!x){let Ft=Ga(N),Vt=Qa(N,ce);l.uiInfo.onSettingsMenu({visible:!0,size:Ft,position:Vt,name:"settings"})}else{let Ft=Ga(c),Vt={top:0,left:0,bottom:0,right:0},ds=ye(vt.ui.settingsSubMenu.name$);l.uiInfo.onSettingsMenu({visible:!1,size:Ft,position:Vt,name:ds})}j.log("close settings sub menu")},fr=(c,x)=>{var ce;vt.ui.settingsSubMenu.visible$.set(!0),vt.ui.settingsSubMenu.ref$.set(x),vt.ui.settingsSubMenu.name$.set(c);let N=Es();if((ce=l==null?void 0:l.uiInfo)!=null&&ce.onSettingsMenu&&x&&N){let wt=Ga(x),Lt=Qa(x,N);l.uiInfo.onSettingsMenu({visible:!0,name:c,size:wt,position:Lt})}j.log("open settings sub menu",{name:c})},Xn=()=>{var x;let c=Math.max(J.volumeMinRestore,(x=gc())!=null?x:0);return c===0?J.volumeDefault:c},Ln=c=>{let x=c===0?Xn():c,N=B.info.muted$.getValue();D({message:`set volume, volume: ${c}, preferredVolume: ${x}`}),N&&c>0&&!s&&(N=!1,$p(!1)),B.setVolume(c,N),ne.setVolume(c),vp(x)},oi=c=>{let x=B.info.volume$.getValue();if(D({message:`set muted, currentVolume: ${x}, mute: ${c}`}),B.setMuted(c),ne.setVolume(c?0:x),$p(c),!c&&x===0){let N=Xn();B.setVolume(N),vp(N),ne.setVolume(N)}},zo=ae(!1),mr=c=>{j.log("set looped",{isLooped:c}),zo.set(c),B.setLooped(c)};mr(oe);let Rr=()=>{var c,x;(x=(c=l==null?void 0:l.uiInfo)==null?void 0:c.onReportProblem)==null||x.call(c)},tt=(c,x=!1)=>{var N;D({message:`set autoplayNextEnabled, value: ${c}`}),j.log("set autoplay next enabled",{autoplayNextEnabled:c}),vt.ui.autoplayNextEnabled$.set(c),Xg(c),x&&((N=l==null?void 0:l.onSetAutoplayNextEnabled)==null||N.call(l,c))},pt=c=>{D({message:`set timerNextVideoRunning, value: ${c}`}),j.log("set timer next video running",{timerNextVideoRunning:c}),vt.ui.timerNextVideoRunning$.set(c)},Ci=(c=!0)=>{var ce;let x=!0;if(c&&(l!=null&&l.onPrevVideoClick))try{x=(ce=l==null?void 0:l.onPrevVideoClick)==null?void 0:ce.call(l)}catch(We){D({message:"onPrevVideoClick callback failed to execute"})}if(!x)return;c&&Ki("prev")||Y()},to=(c=!0)=>{var ce;let x=!0;if(c&&(l!=null&&l.onNextVideoClick))try{x=(ce=l==null?void 0:l.onNextVideoClick)==null?void 0:ce.call(l)}catch(We){D({message:"onNextVideoClick callback failed to execute"})}if(!x)return;c&&Ki("next")||X()},Ki=c=>{let{isMobile:x,features:{playbackStatusNextVideoShow:N,playbackStatusShow:ce}}=J;return N&&ce&&!x?(vt.ui.aboutToGoNextVideo.set(c),vt.ui.userActionsDisabled.set(!0),!0):!1},Co=()=>{var c;(c=l==null?void 0:l.onNextVideoAnnouncementShow)==null||c.call(l)},To=()=>{var c;(c=l==null?void 0:l.onNextVideoAnnouncementClick)==null||c.call(l)},qo=()=>{var c;(c=l==null?void 0:l.onNextVideoAnnouncementAuto)==null||c.call(l)},ko=()=>{var c;(c=l==null?void 0:l.onNextVideoAnnouncementCancel)==null||c.call(l)},ci=()=>{B.prepare()},Ze=()=>{Un(vt);let c=ye(vt.ui.controls.disabledControls$),x=ye(vt.playerPhase),N={playerPhase:x,isInteractive:S,isVideoEnded:!1,action:"none"};if(c.has("PLAY_BUTTON"))return;if(D({message:"toggle play"}),x==="ads"){N.action="play",j.log("toggle adman play",N),ne.togglePlay();return}let ce=()=>{var wt;D({message:"toggle play, call player.play"}),N.action="play",B.play(),(wt=l==null?void 0:l.onPlay)==null||wt.call(l)},We=()=>{var wt;D({message:"toggle play, call player.pause"}),N.action="pause",B.pause(),(wt=l==null?void 0:l.onPause)==null||wt.call(l)};if(B.info.isEnded$.getValue()){if(D({message:"toggle play, video ended, seek to 0"}),zt.next(),Ge.next(ns.REWIND),S){A==null||A();return}B.seekTime(0),ce()}else B.info.playbackState$.getValue()!==td.PLAYING?ce():We();j.log("toggle play",N)},At=(c,{changeReason:x="default",appliesTo:N="to-video"}={})=>{D({message:`set quality, quality: ${c}`}),j.log("set quality",{quality:c}),B.setAutoQuality(c==="auto"),c!=="auto"?(J.features.qualityDetailsSubMenuEnabled?(hc({type:"exact_quality",quality:c,videoId:i},N),Al(),B.setPredefinedQualityLimits(qr.UNKNOWN)):gp(i,c),Je.set(c),B.setQuality(c)):J.features.qualityDetailsSubMenuEnabled?x==="default"&&(Gi("auto_quality",N),ye(Ro)&&Qi(!1),ye(Bi)&&hi(!1)):Al()},Qi=(c,x="as-default")=>{D({message:`set trafficSavingEnabled, value: ${c}`}),j.log("set traffic saving enabled",{trafficSavingEnabled:c});let N=c?qr.TRAFFIC_SAVING:qr.UNKNOWN;J.features.qualityDetailsSubMenuEnabled?(_i(N,x),Pl(!1)):(B.setPredefinedQualityLimits(N),Pl(c))},hi=(c,x="as-default")=>{D({message:`set highQualityEnabled, value: ${c}`}),j.log("set high quality enabled",{highQualityEnabled:c}),_i(c?qr.HIGH_QUALITY:qr.UNKNOWN,x)},_i=(c,x)=>{c!==qr.UNKNOWN&&(ye(Bt)&&!ye(ln)&&At("auto",{appliesTo:x,changeReason:"limit-changed"}),Gi(c,x)),B.setPredefinedQualityLimits(c)},Gi=(c,x)=>{hc({type:c,videoId:i},x),x==="as-default"&&hc({type:c,videoId:i},"to-video")},Bo=c=>{j.log("set playback rate",{playbackRate:c}),B.setPlaybackRate(c),J.features.saveRate&&le&&!B.info.isLive$.getValue()&&jg(c)},io=()=>{let c=ye(Uo),x=c.findIndex(({selected:ce})=>ce);if(x===c.length-1)return;let N=c[x+1];Bo(N.value)},Jn=()=>{let c=ye(Uo),x=c.findIndex(({selected:ce})=>ce);if(x===0)return;let N=c[x-1];Bo(N.value)},un=(c={...qi,selected:!1})=>{j.log("set subtitles",{...c}),c&&c.value!==qi.value&&at.next(c.isAuto?c.value+"_auto":c.value),Wi.set(c)},vr=()=>{j.log("toggle subtitles");let c=ye(Xi),x=ye(Wi),N=ye(Ut);if((x==null?void 0:x.value)===qi.value){let ce=c.filter(We=>We.value!==qi.value).find(We=>We.value===N)||c[1];un(ce)}else un()},Io=(c,x,N=!0)=>{var ce;if(D({message:`seek to time, time: ${c}`}),j.log("seek to time",{time:c,action:x,forcePrecise:N}),Ge.next(x),B.info.isLive$.getValue()){let We=B.info.duration$.getValue(),wt=Math.min(0,We+c);B.seekTime(wt,N)}else{if(P!=null&&P.getValue())return;B.info.isEnded$.getValue()&&(D({message:"seek after ended, call callbacks.onPlay"}),(ce=l==null?void 0:l.onPlay)==null||ce.call(l)),B.seekTime(Ue(c),N)}},gr=c=>{D({message:`seek to episode start time: ${c}`}),j.log("seek to episode start time",{time:c}),Io(c,ns.EPISODE,!0)},hr=(c,x)=>{D({message:`seek to percent, percent: ${c}`}),j.log("seek to percent",{percent:c,action:x});let N=ye(Si)*c;Io(N,x,!1)},_r=c=>{D({message:`seek external, time: ${c}`}),j.log("seek external",{time:c}),Ge.next(ns.UNKNOWN),B.seekTime(B.info.isLive$.getValue()?-c:c)},Nr=c=>{var ce,We;let x=(ce=c.max)!=null?ce:"none",N=(We=c.min)!=null?We:"none";D({message:`set auto quality limitation. Max: ${x}. Min: ${N}`}),j.log("set auto quality limits",{max:x,min:N}),B.setAutoQualityLimits(c)},Wo=c=>{D({message:`seek external to episode start time: ${c}`}),j.log("seek external to episode start time",{time:c}),Io(c,ns.EPISODE,!0)},br=c=>{D({message:`set playback rate to: ${c}`}),j.log("set playback rate external",{playbackRate:c}),B.setPlaybackRate(c)},er=ae(void 0),tr=ae(!1),$r=c=>{D({message:`start scrubbing, progress: ${c}`}),j.log("start scrubbing",{progress:c}),tr.set(!0),fo(c)},fo=c=>{er.set(c)},Vn,it,Dt=()=>{er.set(void 0),tr.set(!1)},Ti=()=>{clearTimeout(it),clearTimeout(Vn),Vn=window.setTimeout(()=>{Dt()},500),Ee==null||Ee.removeEventListener("seeked",Ti)},Ko=c=>{D({message:`complete scrubbing, progress: ${c}`}),j.log("complete scrubbing",{progress:c}),hr(c,ns.SLIDER),ye(vt.ui.isMobile)&&ye(vt.state.currentFormat$)===id.HLS?(Ee==null||Ee.addEventListener("seeked",Ti),it=window.setTimeout(()=>{Ti()},300)):Dt()},Rn=vi([gt,Si,er],([c,x,N],ce)=>{ce(u2(N)?N*x:c)}),xe=ae(!1),Mt=()=>{xe.set(!0)},li=()=>{xe.set(!1)},It=ae({width:0,height:0}),Zt=vi([It],([{width:c}],x)=>{let N=Ph(c);x(N)}),di=ae(!1),Oi=U.filter(c=>Dg(c)),mo=vi([Zt,di],([c,x])=>x?Oi.filter(N=>!N.hideOnMobile):Oi.filter(N=>{var ce;return!((ce=N.hideOnDesktopGridTypes)!=null&&ce.includes(c))})),ni=ae(U.filter(c=>Og(c))),Eo=vi([ni,Zt],([c,x])=>c.filter(N=>{var ce;return!((ce=N.hideOnDesktopGridTypes)!=null&&ce.includes(x))})),ze=vi([Eo,mo],([c,x])=>[...J.features.additionalButtonsDesktopControlPanelRight?c.filter(N=>N.type==="desktop-control-panel-right"):[],...J.features.additionalButtons?x.map((N,ce)=>{var We;return{id:ce,weight:ce,type:"desktop-control-panel-right",testId:N.testId,icon:N.iconUrl,onClick:N.onClick,ariaLabel:(We=N.ariaLabel)!=null?We:N.tooltip,tooltipText:N.tooltip}}):[]]),Ht=ae(G),bi=vi([Ht],([c])=>J.features.additionalSettingsMenuItems?c.map(x=>x.type==="SWITCH"?{...x,onClick:x.onChangeEnabled}:x):[]),Po=(c,x)=>{let N=ye(ni).map(ce=>ce.id!==c?ce:{...ce,...x});ni.set(N)},Qo=c=>{let x=ye(ni);if(x.some(N=>N.id===c.id)){D({message:`Additional button with id: "${c.id}" was exist! Can't add more with the same id`});return}x.push(c),ni.set(x)},ls=c=>{let x=ye(ni);if(!x.some(N=>N.id===c)){D({message:`Can't find additional button with id: "${c}"! Can't remove item with this id`});return}x=x.filter(N=>N.id!==c),ni.set(x)},pn=c=>{Ge.next(ns.LIVE),D({message:"live switch to low latency "+c}),j.log("live switch to low latency "+c),B.setLiveLowLatency(c)},Wr=(c,x)=>{let N=ye(Ht).map(ce=>ce.id!==c?ce:{...ce,...x});Ht.set(N)},ca=c=>{let x=ye(Ht);if(x.some(N=>N.id===c.id)){D({message:`Settings menu item with id: "${c.id}" was exist! Can't add more with the same id`});return}x.push(c),Ht.set(x)},ua=c=>{let x=ye(Ht);if(!x.some(N=>N.id===c)){D({message:`Can't find settings menu item with id: "${c}"! Can't remove item with this id`});return}x=x.filter(N=>N.id!==c),Ht.set(x)},ir=ae(F),el=vi([ir],([c])=>J.features.additionalContextMenuItems?c:[]),ks=(c,x)=>{let N=ye(ir).map(ce=>ce.id!==c?ce:{...ce,...x});ir.set(N)},pa=c=>{let x=ye(ir);if(x.some(N=>N.id===c.id)){D({message:`Context menu item with id: "${c.id}" was exist! Can't add more with the same id`});return}x.push(c),ir.set(x)},mt=c=>{let x=ye(ir);if(!x.some(N=>N.id===c)){D({message:`Can't find context menu item with id: "${c}"! Can't remove item with this id`});return}x=x.filter(N=>N.id!==c),ir.set(x)},ht=vi([di,nt],([c,x],N)=>{N(c&&x)}),Yi=()=>{Ge.next(ns.LIVE),D({message:"switch to active live"}),j.log("switch to active live"),B.seekTime(0),B.info.playbackState$.getValue()!==td.PLAYING&&vt.actions.internal.togglePlay()},Go=()=>{j.log("skip adman"),ne.skip()},ji=(c=!0)=>{Un(vt),D({message:`switch from ads to video, callPlay: ${c}`}),j.log("switch from ads to video",{callPlay:c}),re.set("video"),c&&B.play()},ai=()=>{Un(vt),D({message:"switch from video to ads"}),j.log("switch from video to ads"),vt.actions.internal.pause(),Jt(),re.set("ads")},ki=c=>{Un(vt);let x=c?"LiveWaitingStart":"thumb";j.log("set live waiting start",{state:c,playerPhase:x}),re.set(x)},Is=c=>{Un(vt);let x=c?"LiveWaitingRecover":"thumb";j.log("set live waiting recover",{state:c,playerPhase:x}),re.set(x)},fa=c=>{Un(vt);let x=c?"LiveWaitingRecord":"thumb";j.log("set live waiting record",{state:c,playerPhase:x}),re.set(x)},cu=()=>(Un(vt),j.log("get debug text data"),Rg(B,de,vt)),Ld=()=>(Un(vt),JSON.stringify(Me.getFinishedSpans())),uu=()=>(Un(vt),Ng(B,de,vt)),Es=()=>Ee,pu=()=>{D({message:"toggle chromecast"}),j.log("toggle chromecast"),B.toggleChromecast()},tl=c=>{var N;if(Un(vt),B.info.isEnded$.getValue())return;let x=!c;if(ye(vt.playerPhase)==="ads"){D({message:`pause ads, internalCall: ${x}`}),j.log("pause ads",{internalCall:x}),ne.pause();return}D({message:`pause video, internalCall: ${x}`}),j.log("pause video",{internalCall:x}),x&&((N=l==null?void 0:l.onPause)==null||N.call(l)),B.pause()},Vd=c=>{var N;Un(vt);let x=!c;if(ye(vt.playerPhase)==="ads"){D({message:`play ads, internalCall: ${x}`}),j.log("play ads",{internalCall:x}),ne.play();return}D({message:`play video, internalCall: ${x}`}),j.log("play video",{internalCall:x}),x&&((N=l==null?void 0:l.onPlay)==null||N.call(l)),B.play()},Rd=c=>{Un(vt);let x=!c;if(ye(vt.playerPhase)==="ads"){D({message:"player cannot be stopped during ads via external method"});return}D({message:`player will be stopped, internalCall: ${x}`}),E==null||E()},Nd=(c,x)=>{Un(vt),D({message:`first start, show ads: ${c}, internalCall: ${!x}`}),j.log("first start",{showAds:c,external:x}),c?re.set("ads"):(re.set("video"),x?B.play():vt.actions.internal.togglePlay())},ma=()=>(D({message:"getting time codes"}),f),il=()=>{let c=ma();if(!c||[0,1].includes(c.length))return;let x=B.info.position$.getValue();return c.find(N=>N.time>x)},Bd=c=>{let x=c;x||(x=il());let N=B.info.position$.getValue();j.log("seek to next episode",{currentTime:N,...x}),x&&(D({message:"seek to next episode"}),Io(x.time,ns.EPISODE,!0))},Dd=()=>{let c=ma();if(!c||[0,1].includes(c.length))return;let x=B.info.position$.getValue(),N=c.findIndex(We=>We.time>x),ce=N===-1?c.length-2:N-2;if(!(ce<0))return c[ce]},Od=c=>{let x=c;x||(x=Dd());let N=B.info.position$.getValue();j.log("seek to prev episode",{currentTime:N,...x}),x&&(D({message:"seek to prev episode"}),Io(x.time,ns.EPISODE,!0))},fu=()=>(D({message:"getting preview thumbs data"}),j.log("get preview thumbs data",{..._}),_),Hd=async()=>{let c=Ne==null?void 0:Ne.isActive(),x="none";Ne!=null&&Ne.isActive()?(x="remove",await(Ne==null?void 0:Ne.remove())):(x="request",await(Ne==null?void 0:Ne.request())),j.log("toggle picture in picture",{isActive:c,action:x})},mu=(c=-90)=>{j.log("rotate video",{alphaDiff:c}),ct.update(x=>x+c)},va=ae([]);k==null||k.subscribe(c=>{let x=[];for(let N=0;N<c.length;N++){let{range:[ce,We],subjects:wt}=c[N];N===0&&ce!==0&&x.push({time:0,text:"",interactive:!1,completed:!0}),x.push({time:ce/1e3,text:"",interactive:!0,completed:J.features.interactiveTimeOpenUri?!wt.length||wt.every(Lt=>Lt.isRemoved):!wt.length}),We!==1/0&&x.push({time:We/1e3,text:"",interactive:!1,completed:!0})}va.set(x)});let vu=ae(!1);P==null||P.subscribe(c=>{c&&ye(tr)&&Dt()});let Ue=c=>{if(!S)return c;let x=ye(va),N=ye(Si),We=ye(Li)/N,wt=x.find(Lt=>Lt.interactive&&!Lt.completed&&Lt.time>We);return typeof(wt==null?void 0:wt.time)=="number"?Math.min(c,wt.time-.05):c},ri=()=>{vt.ui.episodes.panelOpened$.set(!1)},Yo=()=>{j.log("destroy store"),clearTimeout(it),clearTimeout(Vn),Ke.unsubscribe(),lt.unsubscribe(),B.destroy(),ne.destroy(),pe==null||pe.destroy(),Ie==null||Ie.destroy(),Nt.unsubscribe(),Xe==null||Xe.disconnect(),Xe=null,st.destroy()},vt={interfaceLanguage$:Ut,isCyrillicRelatedInterface$:Kt,initVideo:Ce,videoId:i,isClip:o,playerPhase:W,vsid:Pe,state:{positionExact$:gt,positionWithScrubbing$:Rn,duration$:Si,playbackState$:kt,isPlaying$:Zi,isLoaderVisible:Di,bufferedProgress$:En,isLive$:Pi,canChangePlaybackSpeed$:wi,isActiveLive$:rn,isOldestAvailableLive$:yn,isRewindableLive$:Wn,isEnded$:ei,muted$:Ai,volume$:zi,trafficSavingEnabled$:Ro,highQualityEnabled$:Bi,autoQualityLimitingAvailable$:Bt,availableVideoStreams$:So,availableAudioStreams$:xn,videoStream$:Mr,audioStream$:cr,currentQuality$:Gn,isAutoQualityEnabled$:ln,availableQualities$:dn,currentPlaybackRate$:cn,availablePlaybackRates$:Uo,currentSubtitle$:Wi,availableTextTracks$:Yn,availableSubtitlesList$:Xi,currentSubtitleCaptions$:po,isAutoSubtitleCaptionVisible$:eo,chromecastState$:qt,chromecastDeviceName$:co,chromecastConnected$:sn,currentFormat$:jt,throughputEstimation$:qn,videoBitrate$:xo,videoSize$:wo,errorLog$:ot,crashed$:nt,isAudioAvailable$:bt,isAudioDisabled:!!s,canDownload:J.features.download&&!!d,availableSources$:No,hasMpegSources$:Lr,isInteractive:S,showInteractiveGraph:J.features.interactiveGraph,showSeekToInteractive:J.features.seekToInteractive,showPlayPrevChapter:J.features.interactivePlayPrevChapter,showInteractiveTimeIndicator:J.features.interactiveTimeIndicator&&!!ye(va).length,interactiveEpisodes$:va,isInteractiveTime$:P?Yt(P):ae(!1),isInteractiveExpectation$:vu,hasInteractiveBranches:T,playPrevChapterDisabledTooltip:V,looped$:zo,loadedMetadata$:ae(!1),isAutoQualityAvailable$:Cn},ui:{t:Be,controlsVisible:ae(!1),touched:ae(!1),controls:{prevButton:ae(void 0),playButton:ae(void 0),replayButton:ae(void 0),nextButton:ae(void 0),playPrevChapterButton:ae(void 0),seekToInteractiveButton:ae(void 0),interactiveGraphButton:ae(void 0),liveButton:ae(void 0),time:ae(void 0),episodes:ae(void 0),volume:ae(void 0),subtitles:ae(void 0),settings:ae(void 0),context:ae(void 0),chromecast:ae(void 0),pip:ae(void 0),fullscreen:ae(void 0),vkLogo:ae(void 0),interactiveTimeIndicator:ae(void 0),timeline:ae(void 0),autoplayNextToggle:ae(void 0),additionalButtons:U.length?U.reduce(c=>[...c,ae(void 0)],[]):[],disabledControls$:se},modals:{hotKeyMap:{show:ae(!1),data:ae({title:"",closeBtnText:"",groups:[]})}},isFullscreen:$e,isFullscreenOpenedByKeyboard:Le,rotateAlpha:ct,isAutoplay:ae(!1),debugPanelVisible:ae(!1),episodes:{panelOpened$:ae(!1),openedByKeyboard$:ae(!1)},contextMenu:{visible$:ae(!1),btnRef$:ae(void 0),openedByBtnKeyboard$:ae(!1),openedByHotKey$:ae(!1),lastActiveElem$:ae(void 0),showContextMenuBtn$:ae(!1),position$:ae({top:0,left:0})},playerSize:It,isMobile:di,mobileNotReportControlHidden$:ht,mobileUnmuteButtonExpanded:ae(!1),mobileUnmuteButtonVisible:ae(!1),icon3DVideoVisible:ae(!1),scrubbingInProgress:tr,volumeChangingInProgress:xe,is3DVideo:ae(!1),currentGridType$:Zt,additionalButtonsDeprecated$:mo,additionalDesktopControlPanelRightButtons$:ze,additionalSettingsMenuItems$:bi,additionalContextMenuItems$:el,interactiveHideMobileControls:ae(!1),overlayContainer$:ae(void 0),startedByKeyboard$:ae(!1),autoplayNextEnabled$:ae(!1),timerNextVideoRunning$:ae(!0),settingsMenu:{visible$:ae(!1),ref$:ae(void 0),openedByBtnKeyboard$:ae(!1)},settingsSubMenu:{visible$:ae(!1),ref$:ae(void 0),name$:ae(void 0)},aboutToGoNextVideo:ae(void 0),userActionsDisabled:ae(!1)},ads:{position:ae(0),duration:ae(0),playbackState:ae("inactive"),canSkip:ae(!1),secondsToWatchBeforeSkip:ae(0),postrollPassed:ae(!1)},webApi:{pictureInPictureApi:Ne,annotationsApi:fe},actions:{internal:{preload:ci,firstStart:c=>Nd(c,!1),play:()=>Vd(!1),pause:()=>tl(!1),togglePlay:Ze,toggleMuted:An,openSettingsMenu:Vr,closeSettingsMenu:Mn,openSettingsSubMenu:fr,closeSettingsSubMenu:Zn,setVolume:Ln,startVolumeChanging:Mt,stopVolumeChanging:li,setVideoStream:Kn,setAudioStream:wn,setQuality:At,setTrafficSavingEnabled:Qi,setHighQualityEnabled:hi,setPlaybackRate:Bo,incrementPlaybackRate:io,decrementPlaybackRate:Jn,setSubtitle:un,toggleSubtitle:vr,togglePictureInPicture:Hd,startScrubbing:$r,progressScrubbing:fo,completeScrubbing:Ko,toggleChromecast:pu,switchToActiveLive:Yi,switchFromAdsToVideo:ji,switchFromVideoToAds:ai,skipAd:Go,setLiveWaitingStart:ki,setLiveWaitingRecover:Is,setLiveWaitingRecord:fa,getDebugTextData:cu,getTraceTextData:Ld,getDebugPanelData:uu,getVideoElement:Es,seekTime:(c,x,N)=>Io(c,x,N),clearDelayedBufferingCheckTimeout:$n,seekEpisodeStartTime:gr,seekToPercent:hr,getNextEpisode:il,seekToNextEpisode:Bd,getPrevEpisode:Dd,seekToPrevEpisode:Od,startLogging:ti,stopLogging:Ri,startCameraManualRotation:Lo,stopCameraManualRotation:Ni,moveCameraFocusPX:yo,holdCamera:Vo,releaseCamera:Pt,getVideoEpisodes:ma,getPreviewThumbsData:fu,downloadVideo:pr,addLanguage:wp,setLanguage:$t,nextMovie:ut,videoRotate:mu,correctSeekTimeToInteractive:Ue,replayInteractive:A,setLooped:mr,reportProblem:Rr,setAutoplayNextEnabled:tt,setTimerNextVideoRunning:pt,prevVideoClick:Ci,nextVideoClick:to,nextVideoAnnouncementShow:Co,nextVideoAnnouncementClick:To,nextVideoAnnouncementAuto:qo,nextVideoAnnouncementCancel:ko},external:{firstStart:c=>Nd(c,!0),play:()=>Vd(!0),pause:()=>tl(!0),stop:()=>Rd(!0),seekTime:c=>_r(c),seekEpisodeStartTime:c=>Wo(c),setPlaybackRate:c=>br(c),setAutoQualityLimits:c=>Nr(c),setMuted:oi,setVolume:Ln,returnFocusToEpisodes:ri,updateAdditionalSettingsItem:Wr,addAdditionalSettingsItem:ca,removeAdditionalSettingsItem:ua,updateAdditionalContextItem:ks,addAdditionalContextItem:pa,removeAdditionalContextItem:mt,updateAdditionalButton:Po,addAdditionalButton:Qo,removeAdditionalButton:ls,setLiveLowLatency:pn}},callbacks:l,setUiCallbacks:c=>{Qe={...c}},getAdmanWrapper:()=>ne,getLogger:()=>Re,getPlayer:()=>B,destroy:Yo};return vt};function ra(t,e,i,o){var _;let n=["interactiveTimeIndicator"],a=(_=e[i])==null?void 0:_.getBoundingClientRect(),s=(o||n.includes(i))&&!!a&&!!(a.right-a.left),{top:d,left:l,bottom:p,right:f}=Qa(e[i],t||void 0);return{left:s?l:0,right:s?f:0,top:s?d:0,bottom:s?p:0,isDisplayed:s}}var qc=(t,e,i,o)=>{if(t)for(let[n,a]of Object.entries(e))["tooltipPointerOffsetX","disabledControls$","additionalButtons"].includes(n)||a.set(ra(t,i,n,o))};var Wc=async(t,e,i)=>{await ho(),e&&i&&(i.focus(),t.set(!1))};var y2=be('<svg><!><path fill="var(--btn-color, #fff)" d="M18 10c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2m-6 4c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m-6 0c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2"></path></svg>');function $f(t,e){let i=ke(e,["$$slots","$$events","$$legacy","children"]);var o=y2();let n;var a=h(o);ge(a,()=>{var s;return(s=e.children)!=null?s:ie}),_e(),g(o),I(()=>n=we(o,n,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none","aria-hidden":"true","data-testid":"dots-icon",role:"img",...i})),b(t,o)}function yf(t,e){z(e,!0);let[i,o]=He(),n=()=>C(l,"$contextMenuVisible$",i),a=v(e,"disabled",3,!1),s=v(e,"ariaLabel",3,""),d=Se(),l=d.ui.contextMenu.visible$,p=d.ui.contextMenu.openedByBtnKeyboard$,f=d.ui.contextMenu.showContextMenuBtn$,_=d.ui.contextMenu.position$,u=d.ui.contextMenu.btnRef$,$=ee(void 0);qe(()=>{r($)&&_t(()=>{u.set(r($))})});let w=P=>{let A=ys(P),E=xh(r($));_.set(E),p.set(A),l.set(!n())},y=()=>{f.set(!0)},S=()=>{f.set(!1)},k=m(()=>n()?"opened":"");Et(t,{get className(){return r(k)},testId:"btn-context-menu",get disabled(){return a()},get ariaLabel(){return s()},click:w,focus:y,blur:S,get ariaExpanded(){return n()},get ref(){return r($)},set ref(P){O($,me(P))},children:(P,A)=>{$f(P,{})},$$slots:{default:!0}}),q(),o()}var x2=t=>{t.stopPropagation()},w2=L("<div><!> <div></div> <div></div></div>"),S2={hash:"svelte-od3veb",code:`.interactive-episode-icon-animated.svelte-od3veb {position:absolute;top:16px;right:16px;width:32px;height:32px;transition:0.3s;opacity:1;}.interactive-episode-icon-animated.icon-small.svelte-od3veb {width:28px;height:28px;}.invisible.svelte-od3veb {opacity:0;visibility:hidden;}.fullscreen.svelte-od3veb:not(.mobile) {width:40px;top:19px;right:23px;height:40px;}.mobile.svelte-od3veb {width:28px;height:28px;top:12px;right:14px;}.fullscreen.mobile.svelte-od3veb {width:32px;height:32px;}
|
|
230
230
|
|
|
231
231
|
@media screen and (orientation: portrait) {.interactive-episode-icon-animated.mobile.fullscreen.svelte-od3veb {top:40px;right:16px;}
|
|
232
232
|
}
|
|
@@ -392,4 +392,4 @@ Try switching the\xA0quality to\xA0Auto.`},oh=G0;var os=new Map;os.set(rh.EN,oh)
|
|
|
392
392
|
/* css reset end */.hidden {visibility:hidden;opacity:0;}.overlay-container {pointer-events:none;top:0;left:0;height:100%;width:100%;position:fixed;z-index:var(--overlay-container-z-index);}
|
|
393
393
|
|
|
394
394
|
/* \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 Cm(t,e){z(e,!0),K(t,gx);let[i,o]=He(),n=()=>C(Ut,"$isLive$",i),a=v(e,"sources",7),s=v(e,"store",7),d=v(e,"microStoresRoot",7),l=v(e,"videoConfig",7),p=v(e,"uiConfig",7),f=v(e,"title",7),_=v(e,"thumbUrl",7),u=v(e,"interactiveContainer",7),$=v(e,"interactiveController",7),w=v(e,"subtitles",7),y=v(e,"live",7),S=v(e,"preload",7),k=v(e,"autoplay",7),P=v(e,"volume",7,void 0),A=v(e,"muted",7,void 0),E=v(e,"fromTime",7),T=v(e,"canRewindLive",7),V=v(e,"showAds",7),U=v(e,"adsSlotId",7,void 0),G=v(e,"adsParams",7,void 0),F=v(e,"adsPreviewParam",7,void 0),Y=v(e,"adsAutoplayParam",7,void 0),X=v(e,"duration",7,void 0),oe=v(e,"logoClickable",7),pe=v(e,"logoHidden",7),le=v(e,"isMobile",7),Ve=v(e,"showNextPrevButtons",7,!1),Ae=v(e,"nextButtonActive",7,!1),J=v(e,"prevButtonActive",7,!1),Me=v(e,"endScreenVideoTitle",7,void 0),j=v(e,"endScreenVideoThumb",7,void 0),B=v(e,"isOneVideoPlaylist",7,!1),Re=v(e,"supportLink",7),ne=v(e,"shadowRootContainer",7,void 0),Ie=v(e,"outerContainerRef",7,void 0),Ne=v(e,"fullScreenTarget",7,void 0),fe=v(e,"failoverHosts",7,void 0),D=v(e,"showMiniTimer",7,!1),de=v(e,"saveRate",7),Ee=v(e,"seekToInteractive",7,h1),Qe=v(e,"playPrevChapter",7,h1),st=v(e,"volumeMultiplier",7),Pe=v(e,"showAutoplayNext",7),$e=v(e,"showEndScreen",7,!0),Le=v(e,"keyboardControls",15,void 0),{subscribers:je,stores:ct}=d();Sg(p());let ot=Wt(),Nt=p().logoLink,nt=s().ui.debugPanelVisible,$t=s().ui.playerSize,Ut=s().state.isLive$,Be=s().state.isInteractive&&Sm.device.isAndroid,re=ee(void 0),W=null,se=ee(!1);s().getAdmanWrapper().init({switchFromAdsToVideo:s().actions.internal.switchFromAdsToVideo,switchFromVideoToAds:s().actions.internal.switchFromVideoToAds,setMuted:s().actions.external.setMuted},s().ads,{isMobile:s().ui.isMobile,mobileUnmuteButtonVisible:s().ui.mobileUnmuteButtonVisible,vsid:s().vsid}),Vg(s(),ct),qe(()=>{s().ui.isMobile.set(le())});let he=(Z=!1)=>{O(se,!0),Z?s().actions.external.firstStart(V()):s().actions.internal.firstStart(V())},Ce=()=>{if(ot.features.qualityDetailsSubMenuEnabled){let Z=eh(s().videoId);if(Z)switch(Z.type){case"high_quality":s().actions.internal.setHighQualityEnabled(!0,Z.appliesTo);break;case"traffic_saving":s().actions.internal.setTrafficSavingEnabled(!0,Z.appliesTo);break;case"exact_quality":s().actions.internal.setQuality(Z.quality);break}}else{th(s().videoId),yp()&&s().actions.internal.setTrafficSavingEnabled(!0);let ei=hp(s().videoId);ei&&s().actions.internal.setQuality(ei)}};function De(Z){var zi,Ai,Ro;let ei=a()||Z;ei&&s().initVideo({container:r(re),sources:ei,failoverHosts:fe(),subtitles:w(),volumeMultiplier:st()});let Pi=px.get(kl)==="true";nt.set(Pi),E()>0&&s().actions.external.seekTime(E());let wi=le()?ot.volumeDefault:(Ai=(zi=P())!=null?zi:gc())!=null?Ai:ot.volumeDefault,ii=(Ro=A())!=null?Ro:Gg();if(s().actions.external.setVolume(wi),s().actions.external.setMuted(ii),s().getAdmanWrapper().setInitialVolume(ii?0:wi),Ce(),ot.features.saveRate&&de()){let Bi=Zg();Bi&&!n()&&s().actions.internal.setPlaybackRate(Bi)}if(Pe()){let Bi=Jg();Bi&&s().actions.internal.setAutoplayNextEnabled(Bi)}s().ui.isAutoplay.set(k()),k()?he():S()&&ot.features.preload&&s().actions.internal.preload()}let ut=Z=>{if(window.ResizeObserver){let ei,Pi;W=new ResizeObserver(fx(wi=>{let ii=wi[0];if(ii.contentBoxSize){let zi=Array.isArray(ii.contentBoxSize)?ii.contentBoxSize[0]:ii.contentBoxSize;ei=zi.inlineSize,Pi=zi.blockSize}else ii.contentRect&&(ei=ii.contentRect.width,Pi=ii.contentRect.height);$t.set({width:ei,height:Pi})},300)),W.observe(Z)}$t.set({width:Z.clientWidth,height:Z.clientHeight})},zt=()=>{document.hidden&&s().actions.external.stop()};Ot(()=>{var Pi,wi,ii,zi;Be&&document.addEventListener("visibilitychange",zt),ot.debugLog&&s().actions.internal.startLogging(),ut(r(re));let Z=je.map(Ai=>Ai.init({store:s(),microStores:ct,config:l(),interactiveController:$(),uiConfig:p()})),ei=()=>{Be&&document.removeEventListener("visibilitychange",zt),W==null||W.disconnect(),Z.forEach(Ai=>Ai.unsubscribe()),s().destroy()};return((Pi=y())==null?void 0:Pi.status)==="upcoming"?(s().actions.internal.setLiveWaitingStart(!0),ei):((wi=y())==null?void 0:wi.status)==="waiting"?(s().actions.internal.setLiveWaitingRecover(!0),ei):(((ii=y())==null?void 0:ii.status)==="finished"||((zi=y())==null?void 0:zi.status)==="postlive")&&!Object.keys(a()||[]).length?(s().actions.internal.setLiveWaitingRecord(!0),ei):(De(),ei)});function Ge(){r(se)?s().actions.external.play():he(!0)}function at(){s().actions.external.pause()}function Xe(Z){s().actions.external.setMuted(Z)}function Ct(Z){le()||Z>=0&&Z<=1&&s().actions.external.setVolume(Z)}function Jt(Z){s().actions.internal.seekTime(Z,mx.UNKNOWN)}function Ke(Z){s().actions.external.seekEpisodeStartTime(Z)}function lt(){s().actions.external.returnFocusToEpisodes()}function ti(Z){s().actions.external.setPlaybackRate(Z)}function Ri(Z){s().actions.external.setAutoQualityLimits(Z)}let Lo=iu(ot.view);var Ni=vx();let yo;et(Ni,Lo);var Vo=h(Ni);{var Pt=Z=>{wm(Z,{get store(){return s()},uiConfig:ot,get thumbUrl(){return _()},get interactiveContainer(){return u()},get live(){return y()},get autoplay(){return k()},get canRewindLive(){return T()},get showAds(){return V()},get adsSlotId(){return U()},get adsParams(){return G()},get adsPreviewParam(){return F()},get adsAutoplayParam(){return Y()},get duration(){return X()},get logoClickable(){return oe()},get logoHidden(){return pe()},logoTargetUrl:Nt,get nextButtonActive(){return Ae()},get prevButtonActive(){return J()},get endScreenVideoTitle(){return Me()},get endScreenVideoThumb(){return j()},get isOneVideoPlaylist(){return B()},get supportLink(){return Re()},get shadowRootContainer(){return ne()},get outerContainerRef(){return Ie()},get fullScreenTarget(){return Ne()},get showMiniTimer(){return D()},get playerStarted(){return r(se)},get seekToInteractive(){return Ee()},get playPrevChapter(){return Qe()},firstStart:he,seekTime:Jt,get showEndScreen(){return $e()},get showAutoplayNext(){return Pe()},get showNextPrevButtons(){return Ve()},get videoContainer(){return r(re)},set videoContainer(ei){O(re,me(ei))}})},gt=Z=>{ym(Z,{get store(){return s()},uiConfig:ot,get title(){return f()},get thumbUrl(){return _()},get interactiveContainer(){return u()},get live(){return y()},get autoplay(){return k()},get canRewindLive(){return T()},get showAds(){return V()},get adsSlotId(){return U()},get adsParams(){return G()},get adsPreviewParam(){return F()},get adsAutoplayParam(){return Y()},get duration(){return X()},get logoClickable(){return oe()},get logoHidden(){return pe()},logoTargetUrl:Nt,get nextButtonActive(){return Ae()},get prevButtonActive(){return J()},get endScreenVideoTitle(){return Me()},get endScreenVideoThumb(){return j()},get isOneVideoPlaylist(){return B()},get supportLink(){return Re()},get shadowRootContainer(){return ne()},get outerContainerRef(){return Ie()},get fullScreenTarget(){return Ne()},get showMiniTimer(){return D()},get playerStarted(){return r(se)},get seekToInteractive(){return Ee()},get playPrevChapter(){return Qe()},firstStart:he,get showEndScreen(){return $e()},get showAutoplayNext(){return Pe()},get showNextPrevButtons(){return Ve()},get videoContainer(){return r(re)},set videoContainer(ei){O(re,me(ei))},get keyboardControls(){return Le()},set keyboardControls(ei){Le(ei)}})};R(Vo,Z=>{le()?Z(Pt):Z(gt,!1)})}g(Ni),I(Z=>yo=te(Ni,1,"root svelte-15wsbym",null,yo,Z),[()=>({"root--miui-browser":Sm.device.isMobile&&Sm.browser.isMiuiBrowser})]),b(t,Ni);var kt=q({initVideo:De,play:Ge,pause:at,setMuted:Xe,setVolume:Ct,seekTime:Jt,seekEpisodeStartTime:Ke,returnFocusToEpisodes:lt,setPlaybackRate:ti,setAutoQualityLimits:Ri,get sources(){return a()},set sources(Z){a(Z)},get store(){return s()},set store(Z){s(Z)},get microStoresRoot(){return d()},set microStoresRoot(Z){d(Z)},get videoConfig(){return l()},set videoConfig(Z){l(Z)},get uiConfig(){return p()},set uiConfig(Z){p(Z)},get title(){return f()},set title(Z){f(Z)},get thumbUrl(){return _()},set thumbUrl(Z){_(Z)},get interactiveContainer(){return u()},set interactiveContainer(Z){u(Z)},get interactiveController(){return $()},set interactiveController(Z){$(Z)},get subtitles(){return w()},set subtitles(Z){w(Z)},get live(){return y()},set live(Z){y(Z)},get preload(){return S()},set preload(Z){S(Z)},get autoplay(){return k()},set autoplay(Z){k(Z)},get volume(){return P()},set volume(Z){P(Z)},get muted(){return A()},set muted(Z){A(Z)},get fromTime(){return E()},set fromTime(Z){E(Z)},get canRewindLive(){return T()},set canRewindLive(Z){T(Z)},get showAds(){return V()},set showAds(Z){V(Z)},get adsSlotId(){return U()},set adsSlotId(Z){U(Z)},get adsParams(){return G()},set adsParams(Z){G(Z)},get adsPreviewParam(){return F()},set adsPreviewParam(Z){F(Z)},get adsAutoplayParam(){return Y()},set adsAutoplayParam(Z){Y(Z)},get duration(){return X()},set duration(Z){X(Z)},get logoClickable(){return oe()},set logoClickable(Z){oe(Z)},get logoHidden(){return pe()},set logoHidden(Z){pe(Z)},get isMobile(){return le()},set isMobile(Z){le(Z)},get showNextPrevButtons(){return Ve()},set showNextPrevButtons(Z){Ve(Z)},get nextButtonActive(){return Ae()},set nextButtonActive(Z){Ae(Z)},get prevButtonActive(){return J()},set prevButtonActive(Z){J(Z)},get endScreenVideoTitle(){return Me()},set endScreenVideoTitle(Z){Me(Z)},get endScreenVideoThumb(){return j()},set endScreenVideoThumb(Z){j(Z)},get isOneVideoPlaylist(){return B()},set isOneVideoPlaylist(Z){B(Z)},get supportLink(){return Re()},set supportLink(Z){Re(Z)},get shadowRootContainer(){return ne()},set shadowRootContainer(Z){ne(Z)},get outerContainerRef(){return Ie()},set outerContainerRef(Z){Ie(Z)},get fullScreenTarget(){return Ne()},set fullScreenTarget(Z){Ne(Z)},get failoverHosts(){return fe()},set failoverHosts(Z){fe(Z)},get showMiniTimer(){return D()},set showMiniTimer(Z){D(Z)},get saveRate(){return de()},set saveRate(Z){de(Z)},get showAutoplayNext(){return Pe()},set showAutoplayNext(Z){Pe(Z)},get seekToInteractive(){return Ee()},set seekToInteractive(Z){Ee(Z)},get playPrevChapter(){return Qe()},set playPrevChapter(Z){Qe(Z)},get volumeMultiplier(){return st()},set volumeMultiplier(Z){st(Z)},get showEndScreen(){return $e()},set showEndScreen(Z){$e(Z)},get keyboardControls(){return Le()},set keyboardControls(Z){Le(Z)}});return o(),kt}var hx=be('<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 Tm(t,e){let i=ke(e,["$$slots","$$events","$$legacy","children"]);var o=hx();let n;var a=h(o);ge(a,()=>{var s;return(s=e.children)!=null?s:ie}),_e(),g(o),I(()=>n=we(o,n,{xmlns:"http://www.w3.org/2000/svg",width:"57",height:"60",fill:"none","aria-hidden":"true","data-testid":"stub-icon",role:"img",...i})),b(t,o)}function km(t,e){let i=v(e,"isWhite",3,!1),o=m(()=>i()?"color: #fff;":"color: #909499;");Tm(t,{get style(){return r(o)}})}var _x=L('<div class="title svelte-1y9fytq"> </div>'),bx=L('<div class="playerStub svelte-1y9fytq"><!> <!></div>'),$x={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 Im(t,e){K(t,$x);var i=bx(),o=h(i);{var n=d=>{var l=_x(),p=h(l,!0);g(l),I(()=>ve(p,e.title)),b(d,l)};R(o,d=>{e.title&&d(n)})}var a=M(o,2);{var s=d=>{let l=m(()=>!!e.thumbUrl);km(d,{get isWhite(){return r(l)}})};R(a,d=>{(!e.title||!e.thumbUrl)&&d(s)})}g(i),I(()=>et(i,e.thumbUrl?`background-image: url('${e.thumbUrl}')`:"")),b(t,i)}import{now as Kx}from"@vkontakte/videoplayer-shared/es2018";import{cloneDeepWith as Qx,InterfaceLanguage as Gx,isNonNullable as Vm,Logger as Yx,Observable as jx,Subscription as C1,once as Zx,InternalsExposure as Xx,skip as Jx}from"@vkontakte/videoplayer-shared/es2018";import{clientChecker as T1,isMobile as e5}from"@vkontakte/videoplayer-core/es2018";import{OneStat as t5}from"@vkontakte/videoplayer-statistics/es2018";import{Logger as yx,Subscription as xx}from"@vkontakte/videoplayer-shared/es2018";var ou=class{constructor(){this.subscription=new xx,this.logger=new yx,this.log=this.logger.createComponentLog("MediaSessionApi")}isSupported(){return"mediaSession"in navigator}setMetaData({title:e,artist:i="",thumbUrl:o=""}){this.isSupported()&&(navigator.mediaSession.metadata=new MediaMetadata({title:e,artist:i,artwork:[{src:o,sizes:"96x96",type:"image/png"},{src:o,sizes:"128x128",type:"image/png"},{src:o,sizes:"192x192",type:"image/png"},{src:o,sizes:"256x256",type:"image/png"},{src:o,sizes:"384x384",type:"image/png"},{src:o,sizes:"512x512",type:"image/png"}]}))}updateActionHandlers(e){this.resetActionHandlers(),this.setActionHandlers(e)}resetActionHandlers(){let e=[["play",null],["pause",null],["stop",null],["nexttrack",null],["previoustrack",null],["seekto",null],["seekbackward",null],["seekforward",null]];this.setActionHandlers(e)}setActionHandlers(e){var i,o;if(this.isSupported())for(let[n,a]of e)try{(o=(i=navigator.mediaSession).setActionHandler)==null||o.call(i,n,a)}catch(s){throw new Error(`The media session action "${n}" is not supported yet.`)}}attachToStore(e){!this.isSupported()||!e||(this.clearSubscriptions(),this.subscription.add(e.state.positionExact$.subscribe(i=>{var a,s;let o=ye(e.state.currentPlaybackRate$),n=ye(e.state.duration$);if(!(!isFinite(i)||!isFinite(n)))try{(s=(a=navigator.mediaSession).setPositionState)==null||s.call(a,{position:i,playbackRate:o,duration:n})}catch(d){this.log({message:`MediaSession setPositionState can't call with position: ${i} and duration: ${n}`})}})))}clearSubscriptions(){this.subscription.unsubscribe()}destroy(){this.resetActionHandlers(),this.clearSubscriptions()}};import{ValueSubject as Am,detectEmbed as Ix}from"@vkontakte/videoplayer-shared/es2018";var wx=be('<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 Em(t,e){let i=ke(e,["$$slots","$$events","$$legacy","children"]);var o=wx();let n;var a=h(o);ge(a,()=>{var s;return(s=e.children)!=null?s:ie}),_e(),g(o),I(()=>n=we(o,n,{xmlns:"http://www.w3.org/2000/svg",width:"57",height:"56",fill:"none","aria-label":"dummy-image","data-testid":"pip-dummy-icon",role:"img",...i})),b(t,o)}var Sx=L('<div><div><!></div> <span class="title svelte-1pbsod4"> </span></div>'),Cx={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 Pm(t,e){z(e,!0),K(t,Cx);let[i,o]=He(),n=()=>C(p,"$interfaceLanguage$",i),a=()=>C(f,"$isMobile$",i),s=Se(),d=Wt(),l=!!s.webApi.pictureInPictureApi,p=s.interfaceLanguage$,f=s.ui.isMobile,_=s.ui.t,u=m(()=>n()&&_("pip_dummy_title")),$=iu(d.view);var w=Sx();te(w,1,"player-pip-dummy svelte-1pbsod4",null,{},{"is-pip-api":l}),et(w,$);var y=h(w);let S;var k=h(y);Em(k,{}),g(y);var P=M(y,2),A=h(P,!0);g(P),g(w),I(E=>{S=te(y,1,"dummy-image svelte-1pbsod4",null,S,E),ve(A,r(u))},[()=>({desktop:!a()})]),b(t,w),q(),o()}var Tx=Object.defineProperty,kx=(t,e,i)=>e in t?Tx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Xa=(t,e,i)=>kx(t,typeof e!="symbol"?e+"":e,i),Ex=460,Px=280,Sd=class{constructor({enabled:e=!0}={enabled:!0}){Xa(this,"playerDomElement"),Xa(this,"playerParentShadowRoot"),Xa(this,"playerDummyElement"),Xa(this,"svelteContext"),Xa(this,"pipWindow"),Xa(this,"info",{isActive$:new Am(!1),isEnabled$:new Am(!1),type:1}),this.info.isEnabled$=new Am(e)}isSupported(){let{isEmbed:e}=Ix();return"documentPictureInPicture"in window&&!e}isActive(){return this.isSupported()&&!!documentPictureInPicture.window}setPlayerDomElement(e,i){this.playerDomElement=e,this.playerParentShadowRoot=i}setContext(e){this.svelteContext=e}async request(){var e,i;if(!this.isSupported()||!this.playerDomElement||!this.playerParentShadowRoot)return;this.pipWindow=await documentPictureInPicture.requestWindow({width:Ex,height:Px,copyStyleSheets:!0}),this.pipWindow.document.body.style.margin="0";let o=[...this.playerParentShadowRoot.styleSheets].map(l=>[...l.cssRules].map(p=>p.cssText).join(" ")).filter(Boolean).join(`
|
|
395
|
-
`),n=document.createElement("style");n.textContent=o;let a=this.createStretchedContainer(),s=a.attachShadow({mode:"open"});s.append(n),s.append(this.playerDomElement);let d={target:this.playerParentShadowRoot,context:this.svelteContext};this.playerDummyElement=es(Pm,d),(e=this.pipWindow)==null||e.document.body.append(a),this.info.isActive$.next(!0),(i=this.pipWindow)==null||i.addEventListener("unload",l=>{!this.playerDomElement||!this.playerParentShadowRoot||!this.playerDummyElement||(Us(this.playerDummyElement),this.playerParentShadowRoot.append(this.playerDomElement),this.info.isActive$.next(!1))})}async remove(){return new Promise(e=>{var i;(i=documentPictureInPicture.window)==null||i.close(),e()})}async dispose(){await this.remove()}setEnabled(e){this.info.isEnabled$.next(e)}createStretchedContainer(){let e=document.createElement("div");return e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.width="100%",e.style.height="100%",e}};function _1(t){return t instanceof Sd}var nu=class{static getLatestSupportedVersion(e){let i=new Ys,o=new Sd(e);if(o.isSupported())return o;if(i.isSupported())return i}};function ru(t,e){var n,a;let i=new Set([...Object.keys(t),...Object.keys(e)]),o={};for(let s of i)o[s]=(a=(n=e[s])!=null?n:t[s])!=null?a:void 0;return o}var b1="Inner error. Unexpectedly root annotation container null reference exception",$1="Annotation with such name already exists",y1="Annotation with such name does not exist";var Ja=class extends Error{constructor(e){super(e),this.name="AnnotationError"}};import{observeElementSize as Ax,Subscription as Mx,throttleFn as Lx}from"@vkontakte/videoplayer-shared/es2018";var Vx="1",Rx=100,su=class{constructor(e){this.annotationsInside=e;this.annotations=new Map;this.subscriptions=new Mx}init(e){if(this.rootAnnotationsContainer=e,this.annotationsInside)return;let i=Lx(()=>{for(let o of this.annotations.values())this.isElementExceedsBoundaries(o,this.playerSize.width,this.playerSize.height)?o.style.visibility="hidden":o.style.visibility="visible"},Rx);this.subscriptions.add(Ax(this.rootAnnotationsContainer).subscribe(({width:o,height:n})=>{this.playerSize={width:o,height:n},i()})),this.mutationObserver=new MutationObserver(i),this.mutationObserver.observe(this.rootAnnotationsContainer,{attributes:!0,childList:!0,subtree:!0,characterData:!0})}add(e,i){var o;if(!this.rootAnnotationsContainer)throw new Ja(b1);if(this.annotations.has(e))throw new Ja($1);i.style.zIndex=(o=i.style.zIndex)!=null?o:Vx,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 Ja(y1);return i}remove(e){let i=this.get(e);this.annotations.delete(e)&&i.remove()}clear(){for(let e in this.annotations.keys())this.remove(e)}destroy(){var e;this.annotations.clear(),this.subscriptions.unsubscribe(),(e=this.mutationObserver)==null||e.disconnect(),this.rootAnnotationsContainer=null}isElementExceedsBoundaries(e,i,o){let n=e.offsetTop,a=e.offsetLeft,s=e.offsetWidth,d=e.offsetHeight;return n<0||a<0||a+s>i||n+d>o}registryRootContainer(e){}addLayer(e){return document.createElement("div")}getLayer(e){}removeLayer(e){}clearLayer(e){}detach(){}reattach(){}};import{assertNonNullable as au,Subscription as Nx}from"@vkontakte/videoplayer-shared/es2018";var Fo=class{init({store:e,microStores:i,interactiveController:o,config:n}){return au(e),au(i),au(n),n.interactiveData&&au(o),this.subscription=new Nx,this.subscription}};var Cd=class extends Fo{constructor(){super(...arguments);this.stateName="fakeIsPlaying$";this.state$={...ae(null),toggle:()=>this.state$.update(i=>!i)}}init(i){let o=super.init(i),{isInteractiveExpectation$:n}=i.store.state;return o.add(n.subscribe(a=>{this.state$.set(a?!0:null)})),o}};var Td=class extends Fo{constructor(){super(...arguments);this.stateName="interactiveControlsOpacity$";this.state$={...ae(null),toggle:()=>this.state$.update(i=>!i)}}init(i){let o=super.init(i),{microStores:n,store:a}=i,{fakeIsPlaying$:s}=n,{isInteractiveExpectation$:d,isPlaying$:l}=a.state,{controlsVisible:p,isMobile:f}=a.ui,_=ye(f),u=()=>_&&ye(p);return o.add(p.subscribe($=>{if(!_)return;let w=ye(s);ye(l)?this.state$.set($):w!==null&&this.state$.set(!w||$)})),o.add(l.subscribe($=>{this.state$.set(!$||u())})),o.add(s.subscribe($=>{if($===null)return;let w=ye(d);if(u()){this.state$.set(!0);return}w&&this.state$.set(!$)})),o}};var kd=class extends Fo{constructor(){super(...arguments);this.stateName="seekToInteractiveDisabledTooltip$";this.state$=ae("tooltip_chapter_without_interactive")}init(i){let o=super.init(i),{store:n}=i;return o.add(n.state.interactiveEpisodes$.subscribe(a=>{a.length&&(a.every(s=>s.completed)?this.state$.set("tooltip_interactive_of_chapter_completed"):this.state$.set("tooltip_disabled_when_interactive"))})),o}};import{combine as Bx}from"@vkontakte/videoplayer-shared/es2018";var Mm=ae(!1),lu=null,Id=class extends Fo{constructor(){super(...arguments);this.stateName="showInteractiveTimeIndicatorTooltip$";this.state$={...Mm,set:(i,o=!1)=>{i!==ye(Mm)&&(this.clearTimeout(),Mm.set(i),!i&&lu&&(lu=!1),i&&o&&(this.timeout=setTimeout(()=>{this.state$.set(!1)},3e3)))},clearTimeout:()=>this.clearTimeout()}}init(i){let o=super.init(i),{store:n,config:a}=i,{isInteractiveTime$:s,isPlaying$:d}=n.state,l=n.ui.controlsVisible,{interactiveTimeIndicator:p}=n.ui.controls;o.add(l.subscribe(_=>{ye(s)&&_&&this.state$.set(!1)}));let f=(a==null?void 0:a.interactiveData)||{tooltipHelpHintActive:!1};return o.add(Bx({isPlaying$:d,isInteractiveTime$:s,interactiveTimeIndicator:p}).subscribe(({isPlaying$:_,isInteractiveTime$:u,interactiveTimeIndicator:$})=>{var w,y;if(!(!_||!($!=null&&$.isDisplayed))){if(!u)return this.state$.set(!1);f.tooltipHelpHintActive&&lu===null&&(lu=!0,f.tooltipHelpHintActive=!1,this.state$.set(!0),(y=(w=n.callbacks)==null?void 0:w.onInteractiveTimeIndicatorHintDeactivated)==null||y.call(w))}})),o}clearTimeout(){window.clearTimeout(this.timeout)}};import{combine as Dx,noop as Ox}from"@vkontakte/videoplayer-shared/es2018";var Ed=class extends Fo{constructor(){super(...arguments);this.stateName="graphIsOpened$";this.graphMadePause=!1;this.state$={...ae(null),toggle:Ox};this.checkIfShouldHide=i=>Ss(i,"s")}init(i){let o=super.init(i),{store:n,interactiveController:a}=i,s=n.ui.currentGridType$,d=n.getLogger().createComponentLog("GraphIsOpened microStore");return this.state$.toggle=async()=>{if(this.checkIfShouldHide(ye(s)))return;let l=ye(this.state$),{isEnded$:p,playbackState$:f}=n.state,{disabledControls$:_}=n.ui.controls,u=ye(p),$=ye(f);if(l)try{await(a==null?void 0:a.toggleGraphView(!1)),this.state$.set(!1),_.remove(cp),!u&&this.graphMadePause&&n.actions.internal.play()}catch(w){d({message:"Cant hide graph"})}else{this.graphMadePause=$==="playing";try{await(a==null?void 0:a.toggleGraphView(!0)),this.state$.set(!0),_.add(cp),!u&&this.graphMadePause&&n.actions.internal.pause()}catch(w){d({message:"Cant show graph"})}}},o.add(Dx({graphIsOpened:this.state$,currentGridType:s}).subscribe(async({graphIsOpened:l,currentGridType:p})=>{if(this.checkIfShouldHide(p)&&l)try{await(a==null?void 0:a.toggleGraphView(!1)),this.state$.set(!1)}catch(_){d({message:"Cant hide graph"})}})),o}};import{ValueSubject as x1}from"@vkontakte/videoplayer-shared/es2018";var Pd=class extends Fo{constructor(){super(...arguments);this.stateName="pictureInPicture$";this.state$={isActive$:ae(!1),isEnabled$:ae(!1),type$:ae(void 0)}}init(i){let o=super.init(i),{store:n}=i,{info:{isActive$:a,isEnabled$:s,type:d}}=n.webApi.pictureInPictureApi||{info:{isActive$:new x1(!1),isEnabled$:new x1(!1)}};return o.add(a.subscribe(l=>{this.state$.isActive$.set(l)})),o.add(s.subscribe(l=>{this.state$.isEnabled$.set(l)})),this.state$.type$.set(d),o}};import{filter as Ux,filterChanged as zx}from"@vkontakte/videoplayer-shared/es2018";import{safeStorage as Lm}from"@vkontakte/videoplayer-shared/es2018";var w1=({maxShowCount:t,timeout:e})=>{let i=[t!==0?Hx({maxCount:t}):void 0,e!==0?Fx({timeout:e}):void 0].filter(o=>!!o);return{notificationShowed:o=>i.forEach(n=>n.notificationShowed(o)),canShowNotification:o=>i.every(n=>n.canShowNotification(o))}},Hx=({maxCount:t})=>{let e={};return{notificationShowed:i=>{var o,n;e[i]=((o=e[i])!=null?o:0)+1,Lm.set("videoplayer_notifications_manager_count",JSON.stringify((n=e[i])!=null?n:0))},canShowNotification:i=>{var o;return((o=e[i])!=null?o:0)<t}}},Fx=({timeout:t})=>{let e="videoplayer_notifications_manager",i=()=>{try{return JSON.parse(Lm.get(e)||"{}")}catch(a){return{}}},o=a=>Lm.set(e,JSON.stringify(a)),n=a=>{let s=i();delete s[a],o(s)};return{notificationShowed:a=>{o({...i(),[a]:{timeout:t,launchTime:Date.now()}})},canShowNotification:a=>{let s=i()[a];if(s){let d=Date.now()-s.launchTime>t;return d&&n(a),d}else return!0}}};var Ad=class extends Fo{constructor(){super(...arguments);this.stateName="notifications$";this.state$={notificationsToShow$:ae({}),showNotification:i=>{this.state$.notificationsToShow$.update(o=>(o[i]=!0,o)),this.notificationManager.notificationShowed(i)},closeNotification:i=>{this.state$.notificationsToShow$.update(o=>(delete o[i],o))}}}init(i){let o=super.init(i),{store:n,uiConfig:{features:{maxCountShowSlowVideoNotification:a,timeoutShowSlowVideoNotification:s,showSlowVideoNotification:d,forceAutoQualityWhenSevereStallHappens:l}}}=i;this.notificationManager=w1({maxShowCount:a,timeout:s});let p=n.getPlayer();return o.add(p.events.severeStallOccured$.pipe(zx(),Ux(f=>f)).subscribe(()=>{d&&!p.info.isAutoQualityEnabled$.getValue()&&this.notificationManager.canShowNotification("slow_video")&&(l&&n.actions.internal.setQuality("auto"),this.state$.showNotification("slow_video"))})),o}};var S1=()=>[Cd,Td,kd,Id,Ed,Pd,Ad].reduce(({subscribers:t,stores:e},i)=>{let o=new i;return{subscribers:[...t,o],stores:{...e,[o.stateName]:o.state$}}},{subscribers:[],stores:{}});import{devNull as Md}from"@vkontakte/videoplayer-shared/es2018";var qx=Object.defineProperty,Wx=(t,e,i)=>e in t?qx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Xt=(t,e,i)=>Wx(t,typeof e!="symbol"?e+"":e,i),i5={preload:!0,autoplay:!1,repeat:!1,fromTime:0,canRewindLive:!0,showAds:!1,interfaceLanguage:Gx.RU,isCyrillicRelatedInterface:!0,logoClickable:!1,logoHidden:!1,isTouch:e5(),isMediaSessionEnabled:!0,isPictureInPictureEnabled:!0,isAudioDisabled:!1,callbacks:{uiInfo:{}},tuningConfig:{configName:[]},saveRate:!0,volumeMultiplier:1,showEndScreen:!0,showAutoplayNext:!0,showNextPrevButtons:!0},bn=ee(void 0),du=class extends HTMLElement{constructor(){super(),Xt(this,"svelteStubComponent"),Xt(this,"svelteRootComponent"),Xt(this,"store"),Xt(this,"microStoresRoot"),Xt(this,"statistics"),Xt(this,"sentry"),Xt(this,"_shadowRoot"),Xt(this,"playerContainer"),Xt(this,"rootContainer"),Xt(this,"shadowRootContainer"),Xt(this,"uiConfig"),Xt(this,"coreConfig"),Xt(this,"statisticsConfig"),Xt(this,"interactiveController"),Xt(this,"interactiveContainer"),Xt(this,"graphMadePause"),Xt(this,"currentPlayingVideoIndex",0),Xt(this,"needToRepeatPlaylist",!1),Xt(this,"videoConfig"),Xt(this,"pictureInPictureApi"),Xt(this,"mediaSessionApi"),Xt(this,"unsubscribePlayerPhaseSubscription"),Xt(this,"logger"),Xt(this,"log"),Xt(this,"subscription"),Xt(this,"interactiveSubscription"),Xt(this,"annotationsApi"),Xt(this,"slotsApi"),Xt(this,"prevIsid"),Xt(this,"isInited",!1),Xt(this,"internalsExposure",null),Xt(this,"shadowDOMCallbacksDisabled",!1),Xt(this,"createOneStat",(e,i={})=>{var o,n,a,s;let{albumId:d,statPlace:l,statUserSalt:p,statTrackCode:f,statVKAppId:_,refreshStatAuthToken:u,autoplay:$,isMobile:w,isTouch:y,refDomain:S,deviceId:k,interactiveData:P}=ru(this.videoConfig,i),A=(o=P==null?void 0:P.projectInfo)==null?void 0:o.pid,E=(a=(n=this.interactiveController)==null?void 0:n.state.isReplay$.getValue())!=null?a:!1;E&&(this.prevIsid=void 0);let{unitedVideoId:T,isClip:V=!1}=e;if(this.uiConfig.features.statistics&&T)return new t5({movieId:T,albumId:d,place:l,trackCode:f,vkAppId:_,autoplay:(s=$&&!this.interactiveController)!=null?s:!1,mobile:y!=null?y:w,clip:V,refDomain:S,deviceId:k,...A&&(!this.isInited||E)&&{projectId:Number(A)}},{refreshAuthToken:u,userSalt:p,config:this.statisticsConfig,...this.interactiveController&&{useIsid:!0,isid:this.prevIsid}})}),Md.create("ui"),this.logger=new Yx,this.log=this.logger.createComponentLog("VKVideoPlayer"),this.subscription=new C1,this.interactiveSubscription=new C1,this.graphMadePause=!1}connectedCallback(){var e,i;if(this.isInited||this.shadowDOMCallbacksDisabled)return;this.initPlayerRootContainers();let o=(e=this.getAttribute("stub-title"))!=null?e:void 0,n=(i=this.getAttribute("stub-thumb-url"))!=null?i:void 0,a=me({title:o,thumbUrl:n}),s={target:this.playerContainer,props:a};this.svelteStubComponent=es(Im,s)}disconnectedCallback(){var e,i,o,n,a;this.shadowDOMCallbacksDisabled||((e=this.annotationsApi)==null||e.destroy(),(i=this.mediaSessionApi)==null||i.destroy(),this.unmountComponent(this.svelteRootComponent),this.unmountComponent(this.svelteStubComponent),this.subscription.unsubscribe(),(o=this.unsubscribePlayerPhaseSubscription)==null||o.call(this),(n=this.interactiveController)==null||n.destroy(),this.interactiveSubscription.unsubscribe(),(a=this.internalsExposure)==null||a.destroy(),Md.destroy("ui"))}initPlayerRootContainers(){this.rootContainer=document.createElement("div"),this.rootContainer.style.position="relative",this.rootContainer.className="root-container",this.rootContainer.style.width="100%",this.rootContainer.style.height="100%",this.rootContainer.style.minHeight="206px",this.shadowRootContainer=document.createElement("div"),this.shadowRootContainer.style.position="absolute",this.shadowRootContainer.className="shadow-root-container",this.shadowRootContainer.style.width="100%",this.shadowRootContainer.style.height="100%",this._shadowRoot=this.shadowRootContainer.attachShadow({mode:"open"}),this.playerContainer=document.createElement("div"),this.playerContainer.style.all="initial",this.playerContainer.style.display="block",this.playerContainer.style.contain="strict",this.playerContainer.style.width="100%",this.playerContainer.style.height="100%",this._shadowRoot.append(this.playerContainer),this.rootContainer.append(this.shadowRootContainer),this.append(this.rootContainer)}needToShowNextPrevButtons(){return this.videoConfig?this.videoConfig.videos.length>1&&this.videoConfig.showNextPrevButtons:!1}isNextButtonActive(){return this.videoConfig?this.needToShowNextPrevButtons()&&(this.currentPlayingVideoIndex<this.videoConfig.videos.length-1||this.needToRepeatPlaylist):!1}isPrevButtonActive(){return this.videoConfig?this.needToShowNextPrevButtons()&&(this.currentPlayingVideoIndex>0||this.needToRepeatPlaylist):!1}isControlDisabled(e){var i;let o=(i=this.store)==null?void 0:i.ui.controls.disabledControls$;return(o==null?void 0:o.includes(e))||!1}getNextVideoInfo(){if(!this.videoConfig)return{nextVideoTitle:void 0,nextVideoThumb:void 0};let e=this.videoConfig.videos[this.currentPlayingVideoIndex+1]||{};return{nextVideoTitle:e.title,nextVideoThumb:e.thumbUrl}}createPlayer(e,i={},o){var n,a,s,d,l,p,f,_;if(!this.videoConfig)return;let{albumId:u,statPlace:$,statAuthToken:w,preload:y,autoplay:S,volume:k,muted:P,fromTime:A,canRewindLive:E,supportLink:T,showAds:V,adsSlotId:U,adsParams:G={},adsPreviewParam:F,adsAutoplayParam:Y,interfaceLanguage:X,isCyrillicRelatedInterface:oe,logoClickable:pe,logoHidden:le,isMobile:Ve,isTouch:Ae,isAudioDisabled:J,isLiveCatchUpMode:Me,fullScreenTarget:j,failoverHosts:B,canDownload:Re,callbacks:ne,interactiveData:Ie,showThumbTimer:Ne,additionalButtons:fe=[],additionalSettingsMenuItems:D=[],additionalContextMenuItems:de=[],repeat:Ee,saveRate:Qe,volumeMultiplier:st,showEndScreen:Pe,showAutoplayNext:$e}=ru(this.videoConfig,i),{sources:Le,title:je,thumbUrl:ct,unitedVideoId:ot,isClip:Nt=!1,duration:nt,adsParams:$t={},videoEpisodes:Ut,previewThumbsData:Kt,subtitles:Be,live:re}=e,W={...G,...$t},se=this.getNextVideoInfo(),he={sources:Le,title:je,thumbUrl:ct,subtitles:Be,unitedVideoId:ot,isClip:Nt,live:re,albumId:u,statPlace:$,autoplay:S,muted:P,volume:k,fromTime:A,canRewindLive:E,showAds:V,adsSlotId:U,adsParams:W,adsPreviewParam:F,adsAutoplayParam:Y,duration:nt,logoClickable:pe,logoHidden:le,isTouch:Ae!=null?Ae:Ve,repeat:Ee,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:se.nextVideoTitle,endScreenVideoThumb:se.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist()},Ce={pictureInPictureApi:this.pictureInPictureApi,annotationsApi:this.annotationsApi};this.log({message:`create player, props: ${JSON.stringify(he)}`});let De=(n=this.interactiveController)==null?void 0:n.state.statistics$.getValue(),ut=(De==null?void 0:De.oneStat)||this.createOneStat(e,i);ut&&(this.statistics=new Fc(ut,De==null?void 0:De.statSubscription)),this.uiConfig.features.sentry&&this.uiConfig.sentry.dsn&&new Qs(this.uiConfig.sentry,{version:Da,env:fc},{movieId:ot,albumId:u,place:$,autoplay:(a=S&&!this.interactiveController)!=null?a:!1,mobile:Ae!=null?Ae:Ve,clip:Nt}),this.interactiveController&&((d=this.prevIsid)!=null||(this.prevIsid=(s=this.statistics)==null?void 0:s.oneStat.isid$.getValue())),this.sentry={...this.sentry,...Qs.getInstance()};let Ge=!!Ie,at=[],Xe="tooltip_interactive_go_back_disabled_first";if(Ge&&this.interactiveController){let lt=this.interactiveController.state.isInitialChapter$.getValue(),ti=this.interactiveController.getHistoryState();lt&&at.push("REPLAY_BUTTON"),this.interactiveController.getIsSeekable().getValue()||at.push("SEEK_TO_INTERACTIVE_BUTTON"),ti.hasPrevChapter$.getValue()||(at.push("PLAY_PREV_CHAPTER_BUTTON"),lt||(ti.isGoBackLimited$.getValue()?Xe="tooltip_interactive_go_back_disabled_limit":Xe="tooltip_interactive_go_back_disabled"))}let Ct=()=>{var lt;this.isInited=!1,this.prevIsid=void 0;let ti=(o==null?void 0:o.info.isEnded$.getValue())&&((lt=this.interactiveController)==null?void 0:lt.state.isEndChapter$.getValue());ne.onReplayInteractiveVideo&&!ti?ne.onReplayInteractiveVideo():this.replayInteractiveVideo()};this.store=Uh({player:o,interfaceLanguage:X,isCyrillicRelatedInterface:oe,videoId:ot,isClip:Nt,isLiveCatchUpMode:Me,isAudioDisabled:J,statAuthToken:w,callbacks:ne,webApi:Ce,videoEpisodes:Ut,previewThumbsData:Kt,canDownload:Re,uiConfig:this.uiConfig,coreConfig:this.coreConfig,disabledControls:at,isInteractive:Ge,saveRate:Qe,interactiveRanges$:(l=this.interactiveController)==null?void 0:l.state.interactiveRanges$,isInteractiveTime$:(p=this.interactiveController)==null?void 0:p.state.isInteractiveTime$,stopPlayer:()=>this.stop(),replayInteractive:Ct,playPrevChapterDisabledTooltip:Xe,hasInteractiveBranches:!!((_=(f=this.interactiveController)==null?void 0:f.getChapterBranches())!=null&&_.length),additionalButtons:this.uiConfig.features.additionalButtons?fe:[],additionalSettingsMenuItems:D!=null?D:[],additionalContextMenuItems:de!=null?de:[],playPrevVideo:()=>this.playPrevVideo(),playNextVideo:()=>this.playNextVideo(),looped:Ee&&this.videoConfig.videos.length===1,statistics:this.statistics,internalsExposure:this.internalsExposure});let{stores:Jt}=this.microStoresRoot=S1(),Ke=()=>{var lt,ti,Ri,Lo,Ni,yo;if(!this.store||!this.microStoresRoot||!this.videoConfig)return;this.subscription.add(this.store.state.currentFormat$.subscribe(Pt=>{var gt;return(gt=ne==null?void 0:ne.onCurrentFormatChanged)==null?void 0:gt.call(ne,Pt)})),this.subscription.add(Jt.interactiveControlsOpacity$.subscribe(Pt=>{var gt;Pt!==null&&((gt=this==null?void 0:this.interactiveController)==null||gt.setDisabledControls(Pt))})),this.subscription.add(this.store.state.throughputEstimation$.subscribe(Pt=>{var gt;return(gt=ne==null?void 0:ne.onThroughputEstimationChanged)==null?void 0:gt.call(ne,Pt)})),this.subscription.add(this.store.state.trafficSavingEnabled$.subscribe(Pt=>{var gt;return(gt=ne==null?void 0:ne.onTrafficSavingEnabledChanged)==null?void 0:gt.call(ne,Pt)})),this.subscription.add(new jx(Pt=>{this.store&&this.subscription.add(this.store.state.currentPlaybackRate$.subscribe(gt=>Pt.next(gt)))}).pipe(this.uiConfig.features.skipInitialPlaybackRateValue?Jx(1):Pt=>Pt).subscribe(Pt=>{var gt;return(gt=ne==null?void 0:ne.onCurrentPlaybackRateChanged)==null?void 0:gt.call(ne,Pt)})),this.subscription.add(this.store.state.volume$.subscribe(Pt=>{var gt;return(gt=ne==null?void 0:ne.onVolumeChange)==null?void 0:gt.call(ne,Pt)})),this.subscription.add(this.store.state.muted$.subscribe(Pt=>{var gt,kt;return Pt?(gt=ne==null?void 0:ne.onMute)==null?void 0:gt.call(ne):(kt=ne==null?void 0:ne.onUnmute)==null?void 0:kt.call(ne)})),this.subscription.add(this.store.state.videoBitrate$.subscribe(Pt=>{var gt;return(gt=ne==null?void 0:ne.onVideoBitrateChanged)==null?void 0:gt.call(ne,Pt)})),this.subscription.add(this.store.state.isInteractiveTime$.subscribe(Pt=>{var gt;let kt=(gt=this.store)==null?void 0:gt.ui.controls.disabledControls$;kt&&(Pt&&!kt.includes(Il)&&kt.add(Il),Pt||kt.remove(Il))})),this.subscription.add(this.store.ui.isFullscreen.subscribe(async Pt=>{var gt;if(!T1.browser.isSamsungBrowser||!Pt||!this.interactiveController)return;document.fullscreenElement===this.shadowRootContainer&&await this.replayInteractiveChapter((gt=this.videoConfig)==null?void 0:gt.callbacks.onExternalFullscreenExit)})),this.statistics&&this.subscription.add(this.statistics.oneStat.vsid$.subscribe(Pt=>{var gt;return(gt=ne==null?void 0:ne.onVSIDChanged)==null?void 0:gt.call(ne,Pt)})),this.initMediaSession(),O(bn,me({interactiveController:this.interactiveController,interactiveContainer:this.interactiveContainer,sources:Le,store:this.store,microStoresRoot:this.microStoresRoot,videoConfig:this.videoConfig,uiConfig:this.uiConfig,title:je,thumbUrl:ct,subtitles:Be,live:re,preload:y,autoplay:S,muted:P,volume:k,fromTime:A,canRewindLive:E,supportLink:T,showAds:V,adsSlotId:U,adsParams:W,adsPreviewParam:F,adsAutoplayParam:Y,duration:nt,logoClickable:pe,logoHidden:le,isMobile:Ae!=null?Ae:Ve,failoverHosts:B,fullScreenTarget:j,saveRate:Qe,shadowRootContainer:this.shadowRootContainer,showMiniTimer:Ne,outerContainerRef:this.rootContainer,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:se.nextVideoTitle,endScreenVideoThumb:se.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist(),playPrevChapter:()=>this.playPrevChapter(),seekToInteractive:()=>this.seekToInteractive(),volumeMultiplier:st,showEndScreen:Pe,showAutoplayNext:$e}));let Vo={target:this.playerContainer,props:r(bn)};this.svelteRootComponent=es(Cm,Vo),this.addPlayerInfoSubscriptions(),this.isInited||(this.isInited=!0,(Ri=(ti=(lt=this.videoConfig)==null?void 0:lt.callbacks)==null?void 0:ti.onInited)==null||Ri.call(ti)),(Lo=this.internalsExposure)==null||Lo.expose({player:this,videoConfig:this.videoConfig,coreConfig:this.coreConfig,uiConfig:this.uiConfig,statisticsConfig:this.statisticsConfig,logger:this.logger,log:this.log}),this.uiConfig.devNullLog&&((yo=(Ni=this.videoConfig)==null?void 0:Ni.callbacks)!=null&&yo.onDevNullLog)?Md.subscribe("ui",this.videoConfig.callbacks.onDevNullLog):Md.destroy("ui")};this.coreConfig.asyncResolveClientChecker?T1.isInited$.subscribe(lt=>{lt&&(console.log("UI SDK async start"),Ke())}):Ke()}addPlayerInfoSubscriptions(){var e,i;let o=this.store,n=(e=this.microStoresRoot)==null?void 0:e.stores;if(!o||!n)return;let a=(i=this.videoConfig)==null?void 0:i.callbacks;a&&this.subscription.add(o.playerPhase.subscribe(d=>{var l;return(l=a.onPlayerPhaseChanged)==null?void 0:l.call(a,d)})).add(o.state.playbackState$.subscribe(d=>{var l;return d&&((l=a.onPlaybackStateChanged)==null?void 0:l.call(a,d))})).add(o.state.isLive$.subscribe(d=>{var l;return(l=a.onIsLiveChanged)==null?void 0:l.call(a,d)})).add(o.state.isActiveLive$.subscribe(d=>{var l;return(l=a.onIsActiveLiveChanged)==null?void 0:l.call(a,d)})).add(o.state.isAudioAvailable$.subscribe(d=>{var l;return(l=a.onIsAudioAvailableChanged)==null?void 0:l.call(a,d)})).add(o.state.currentQuality$.subscribe(d=>{var l;return(l=a.onCurrentQualityChanged)==null?void 0:l.call(a,d)})).add(o.state.availableQualities$.subscribe(d=>{var l;return(l=a.onAvailableQualitiesChanged)==null?void 0:l.call(a,d.map(({value:p})=>p).filter(p=>p!=="auto"))})).add(o.state.availableAudioStreams$.subscribe(d=>{d.length>1&&a.onAudioLanguagesAvailable&&a.onAudioLanguagesAvailable()})).add(n.pictureInPicture$.isActive$.subscribe(d=>{var l,p;return d?(l=a.onPiPEnter)==null?void 0:l.call(a):(p=a.onPiPExit)==null?void 0:p.call(a)}));let s=a==null?void 0:a.uiInfo;s&&this.subscription.add(o.ui.controlsVisible.subscribe(d=>{var l;return(l=s.onControlsVisibleChanged)==null?void 0:l.call(s,d)})).add(o.ui.isMobile.subscribe(d=>{var l;return(l=s.onIsMobileChanged)==null?void 0:l.call(s,d)})).add(o.ui.playerSize.subscribe(d=>{var l;return(l=s.onPlayerSizeChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.prevButton.subscribe(d=>{var l;return(l=s.onPrevButtonChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.playButton.subscribe(d=>{var l;return(l=s.onPlayButtonChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.replayButton.subscribe(d=>{var l;return(l=s.onReplayButtonChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.nextButton.subscribe(d=>{var l;return(l=s.onNextButtonChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.playPrevChapterButton.subscribe(d=>{var l;return(l=s.onPlayPrevChapterChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.seekToInteractiveButton.subscribe(d=>{var l;return(l=s.onSeekToInteractiveButtonChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.interactiveGraphButton.subscribe(d=>{var l;return(l=s.onGraphButtonChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.liveButton.subscribe(d=>{var l;return(l=s.onLiveButtonChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.time.subscribe(d=>{var l;return(l=s.onTimeUpdateChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.episodes.subscribe(d=>{var l;return(l=s.onEpisodesChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.subtitles.subscribe(d=>{var l;return(l=s.onSubtitlesChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.settings.subscribe(d=>{var l;return(l=s.onSettingsChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.fullscreen.subscribe(d=>{var l;return(l=s.onFullscreenChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.chromecast.subscribe(d=>{var l;return(l=s.onChromecastChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.pip.subscribe(d=>{var l;return(l=s.onPipChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.vkLogo.subscribe(d=>{var l;return(l=s.onVkLogoChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.interactiveTimeIndicator.subscribe(d=>{var l;return(l=s.onInteractiveTimeIndicatorChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.timeline.subscribe(d=>{var l;return(l=s.onTimelineChanged)==null?void 0:l.call(s,d)}))}playNextVideo(){this.videoConfig&&(this.currentPlayingVideoIndex++,this.currentPlayingVideoIndex>=this.videoConfig.videos.length&&(this.currentPlayingVideoIndex=0),this.log({message:`play next video, index: ${this.currentPlayingVideoIndex}`}),this.createPlayerWithCurrentVideo())}playPrevVideo(){this.videoConfig&&(this.currentPlayingVideoIndex--,this.currentPlayingVideoIndex<0&&(this.currentPlayingVideoIndex=this.videoConfig.videos.length-1),this.log({message:`play prev video, index: ${this.currentPlayingVideoIndex}`}),this.createPlayerWithCurrentVideo())}createPlayerWithCurrentVideo(e,i=!0){var o;if(!this.videoConfig)return;let n=this.videoConfig.videos[this.currentPlayingVideoIndex];if(!n){this.log({message:"no next video"});return}this.isInited&&Vm(n.unitedVideoId)&&((o=this.store)==null||o.actions.internal.nextMovie(n.unitedVideoId)),this.unmountComponent(this.svelteRootComponent),this.createPlayer(n,{autoplay:i,fromTime:0},e)}playPrevChapter(){var e;(e=this.interactiveController)==null||e.playPrevChapter()}seekToInteractive(){var e;let i=(e=this.interactiveController)==null?void 0:e.getNextInteractiveStartTime();typeof i=="number"&&this.seekTime(i/1e3)}async initInteractives(){var e,i,o,n;if((e=this.videoConfig)!=null&&e.interactiveData)try{let{Interactives:a}=await import("@vkontakte/videoplayer-interactive/es2018");this.interactiveContainer=document.createElement("div"),this.interactiveContainer.classList.add("interactive-root");let s=(i=this.store)==null?void 0:i.interfaceLanguage$,d=s?ye(s):this.videoConfig.interfaceLanguage,{projectInfo:l,initChapterId:p,historyApi:f,videoLoader:_}=this.videoConfig.interactiveData;this.interactiveController=new a({parentElement:this.interactiveContainer,fullscreenTargetElement:this.playerContainer,lang:d,graph:this.uiConfig.features.interactiveGraph,projectInfo:l,initChapterId:p,historyApi:f,vkVideoLoader:_,lastFrame:this.uiConfig.features.interactiveLastFrame,permanentTextControls:this.uiConfig.features.interactiveTextPermanent,interactiveTimeOpenUri:this.uiConfig.features.interactiveTimeOpenUri,initSeamless:!0,config:this.uiConfig.interactive,coreConfig:this.coreConfig,createOneStat:this.createOneStat,animationsFeatureToggles:{areaControlShadow:this.uiConfig.features.interactiveAreaControlShadow,controlsExpectTimeBlinkAnimation:this.uiConfig.features.interactiveControlsExpectTimeBlinkAnimation}});let{isInteractiveExpectation$:u,isSeekable$:$}=this.interactiveController.state;this.uiConfig.features.seekToInteractive&&this.subscription.add($.subscribe(y=>{if(!this.isInited)return;let S=this.store;y?S.ui.controls.disabledControls$.remove("SEEK_TO_INTERACTIVE_BUTTON"):S.ui.controls.disabledControls$.add("SEEK_TO_INTERACTIVE_BUTTON")})),this.subscription.add(u.subscribe(y=>{this.store&&this.store.state.isInteractiveExpectation$.set(y)}));let w=!0;if(this.subscription.add(this.interactiveController.events.playerChanged$.subscribe(y=>{if(!this.videoConfig)return;this.videoConfig.videos[this.currentPlayingVideoIndex]={...y.config,title:(l==null?void 0:l.title)||y.config.title};let S=w?this.videoConfig.autoplay:!0;this.createPlayerWithCurrentVideo(y.player,S),w&&(w=!1)})),this.interactiveSubscription.add(this.interactiveController.events.interactiveActionChoice$.subscribe(({type:y,actionType:S})=>{var k,P,A,E,T,V;if(!this.store||!this.microStoresRoot)return;let U=u.getValue();if(y==="action-choice"&&S==="setRandomBranch"&&(this.microStoresRoot.stores.graphIsOpened$.set(!1),this.store.ui.controls.disabledControls$.remove(El)),y==="action-choice-canceled"){let G=ye(this.store.state.isPlaying$)||U;if(((A=(k=this.videoConfig)==null?void 0:k.isTouch)!=null?A:(P=this.videoConfig)!=null&&P.isMobile)&&G){this.store.ui.interactiveHideMobileControls.set(!0);return}(V=(E=this.videoConfig)==null?void 0:(T=E.callbacks).onDisabledInteractiveClick)==null||V.call(T)}})),this.interactiveSubscription.add(this.interactiveController.events.interactiveContainerFakeRemoved$.subscribe(({type:y,removeAllOpenURI:S})=>{this.store&&y==="container-fake-removed"&&S&&this.store.ui.controls.disabledControls$.remove(El)})),await this.interactiveController.setManifest(this.videoConfig.interactiveData.manifest),(n=(o=this.videoConfig)==null?void 0:o.callbacks)!=null&&n.onInteractiveHistoryChanged){let y=this.interactiveController.getHistoryState();this.subscription.add(y.history$.subscribe(S=>{var k,P,A;S.length&&((A=(P=(k=this.videoConfig)==null?void 0:k.callbacks)==null?void 0:P.onInteractiveHistoryChanged)==null||A.call(P,S))}))}this.uiConfig.features.interactiveTimeIndicator&&this.subscription.add(this.interactiveController.events.noInteraction$.subscribe(()=>{var y,S,k,P;(y=this.microStoresRoot)==null||y.stores.showInteractiveTimeIndicatorTooltip$.set(!0,!0),(P=(S=this.videoConfig)==null?void 0:(k=S.callbacks).onInteractiveTimeIndicatorClick)==null||P.call(k)})),this.interactiveSubscription.add(this.interactiveController.events.error$.subscribe(y=>{this.log({message:y.toString()})}))}catch(a){this.log({message:a.message})}}initPlayer(e,i={}){var o,n,a,s,d,l,p,f,_,u,$,w,y,S,k,P,A,E,T,V,U,G,F,Y,X,oe;if(!Array.isArray(e.videos)||e.videos.length===0&&!e.interactiveData)throw new Error("empty videos");if(this.videoConfig=ru(i5,Qx(e,pe=>pe instanceof HTMLElement?pe:void 0)),this.uiConfig=wg((o=i.ui)!=null?o:{}),this.coreConfig=(n=i.core)!=null?n:{configName:[]},this.statisticsConfig=(a=i.statistics)!=null?a:{},this.uiConfig.features.forcePlayerDisplayBlock&&(this.rootContainer.style.minHeight="unset",this.style.display="block",this.style.width="100%",this.style.height="100%"),this.sentry={config:(s=this.uiConfig.sentry)!=null?s:{}},this.uiConfig.features.exposeInternalsToGlobal&&((d=this.internalsExposure)!=null||(this.internalsExposure=new Xx("UI"))),Md.push("ui",{key:"videoplayer_embed",strings:["new","player_init_player","ads.enable: "+this.uiConfig.ads.enable,"showAds: "+((l=this.videoConfig)==null?void 0:l.showAds)],numbers:[Kx()]}),Vm(this.videoConfig.isMediaSessionEnabled)&&(this.uiConfig.features.mediaSession=(f=(p=this.uiConfig.features.mediaSession)!=null?p:this.videoConfig.isMediaSessionEnabled)!=null?f:!0),Vm(this.videoConfig.isPictureInPictureEnabled)&&(this.uiConfig.features.pip=(u=(_=this.uiConfig.features.pip)!=null?_:this.videoConfig.isPictureInPictureEnabled)!=null?u:!0,this.uiConfig.features.dpip=(w=($=this.uiConfig.features.dpip)!=null?$:this.videoConfig.isPictureInPictureEnabled)!=null?w:!0),this.videoConfig.isTouch=(S=(y=this.uiConfig.isMobile)!=null?y:this.videoConfig.isTouch)!=null?S:this.videoConfig.isMobile,(k=this.videoConfig).autoplay&&(k.autoplay=this.uiConfig.features.autoplay),this.videoConfig.showAds=(P=this.uiConfig.ads.enable)!=null?P:this.videoConfig.showAds,this.videoConfig.adsSlotId=(A=this.uiConfig.ads.slot)!=null?A:this.videoConfig.adsSlotId,this.videoConfig.adsPreviewParam=(E=this.uiConfig.ads.preview)!=null?E:this.videoConfig.adsPreviewParam,this.videoConfig.logoHidden=!((T=this.uiConfig.showLogo)!=null?T:!this.videoConfig.logoHidden),(V=this.videoConfig).canRewindLive&&(V.canRewindLive=this.uiConfig.features.liveRewind),this.videoConfig.supportLink=(U=this.videoConfig.supportLink)!=null?U:this.uiConfig.supportLink,this.videoConfig.showEndScreen=(G=this.uiConfig.features.endScreen)!=null?G:this.videoConfig.showEndScreen,this.videoConfig.showAutoplayNext=(F=this.uiConfig.features.autoplayNext)!=null?F:this.videoConfig.showAutoplayNext,this.videoConfig.showNextPrevButtons=(Y=this.uiConfig.features.nextPrevButtons)!=null?Y:this.videoConfig.showNextPrevButtons,this.currentPlayingVideoIndex=this.videoConfig.videoIndex&&((X=this.videoConfig.videos)!=null&&X[this.videoConfig.videoIndex])?this.videoConfig.videoIndex:0,this.needToRepeatPlaylist=this.videoConfig.repeat,this.uiConfig.features.pip){let pe={enabled:this.videoConfig.pipEnabled};this.uiConfig.features.dpip?this.pictureInPictureApi=nu.getLatestSupportedVersion(pe):this.pictureInPictureApi=new Ys(pe)}this.mediaSessionApi=this.uiConfig.features.mediaSession?new ou:void 0,this.slotsApi=this.uiConfig.features.slots?new Jc:void 0,this.annotationsApi=this.uiConfig.features.annotations?new su(this.uiConfig.features.annotationsInside):void 0,this.annotationsApi&&!this.uiConfig.features.annotationsInside&&this.annotationsApi.init(this.rootContainer),(oe=this.slotsApi)==null||oe.init(this.shadowRootContainer),this.unmountComponent(this.svelteStubComponent),this.unmountComponent(this.svelteRootComponent),this.isInited=!1,this.prevIsid=void 0,this.interactiveController&&(this.interactiveController.destroy(),this.interactiveController=void 0,this.interactiveSubscription.unsubscribe()),this.videoConfig.interactiveData?this.initInteractives():this.createPlayer(this.videoConfig.videos[this.currentPlayingVideoIndex]),_1(this.pictureInPictureApi)&&this.pictureInPictureApi.setPlayerDomElement(this.playerContainer,this._shadowRoot)}isOneVideoPlaylist(){return this.videoConfig?this.videoConfig.videos.length===1:!1}updateVideos(e,i){if(!this.videoConfig)return;this.log({message:`update ${i} videos, videos: ${JSON.stringify(e)}`}),i==="prev"?(this.videoConfig.videos.splice(0,this.currentPlayingVideoIndex),this.videoConfig.videos.unshift(...e),this.currentPlayingVideoIndex=e.length):i==="next"&&(this.videoConfig.videos.splice(this.currentPlayingVideoIndex+1),this.videoConfig.videos.push(...e));let o=this.getNextVideoInfo();r(bn)&&(r(bn).showNextPrevButtons=this.needToShowNextPrevButtons(),r(bn).nextButtonActive=this.isNextButtonActive(),r(bn).prevButtonActive=this.isPrevButtonActive(),r(bn).endScreenVideoTitle=o.nextVideoTitle,r(bn).endScreenVideoThumb=o.nextVideoThumb,r(bn).isOneVideoPlaylist=this.isOneVideoPlaylist())}updatePrevVideos(e){this.updateVideos(e,"prev")}updateNextVideos(e){this.updateVideos(e,"next")}initMediaSession(){var e,i;this.mediaSessionApi&&((e=this.unsubscribePlayerPhaseSubscription)==null||e.call(this),this.mediaSessionApi.clearSubscriptions(),this.unsubscribePlayerPhaseSubscription=(i=this.store)==null?void 0:i.playerPhase.subscribe(o=>{o==="video"?this.setupMediaSessionForVideo():o==="ads"&&this.setupMediaSessionForAds()}))}setupMediaSessionForVideo(){if(!(!this.videoConfig||!this.mediaSessionApi))try{let{title:e,thumbUrl:i}={...this.videoConfig.videos[this.currentPlayingVideoIndex]},o=[["play",()=>this.play()],["pause",()=>this.pause()],["seekto",n=>this.seekTime(n.seekTime)]];this.videoConfig.videos.length>1&&(this.currentPlayingVideoIndex<this.videoConfig.videos.length-1&&o.push(["nexttrack",()=>this.playNextVideo()]),this.currentPlayingVideoIndex>0&&o.push(["previoustrack",()=>this.playPrevVideo()])),this.mediaSessionApi.setMetaData({title:e,thumbUrl:i}),this.mediaSessionApi.updateActionHandlers(o),this.mediaSessionApi.attachToStore(this.store)}catch(e){this.log({message:e.message})}}setupMediaSessionForAds(){if(!(!this.videoConfig||!this.mediaSessionApi))try{let e="\u0420\u0435\u043A\u043B\u0430\u043C\u0430",i=[["play",()=>this.play()],["pause",()=>this.pause()]];this.mediaSessionApi.setMetaData({title:e}),this.mediaSessionApi.updateActionHandlers(i),this.mediaSessionApi.attachToStore(this.store)}catch(e){this.log({message:e.message})}}moveTo(e){this.shadowDOMCallbacksDisabled=!0,e.append(this),this.shadowDOMCallbacksDisabled=!1}play(){var e,i,o,n;this.isControlDisabled("PLAY_BUTTON")||(e=this.store)!=null&&e.playerPhase.is("LiveWaitingStart")||(i=this.store)!=null&&i.playerPhase.is("LiveWaitingRecover")||(o=this.store)!=null&&o.playerPhase.is("LiveWaitingRecord")||(this.log({message:"play"}),(n=this.svelteRootComponent)==null||n.play())}pause(){var e;this.log({message:"pause"}),(e=this.svelteRootComponent)==null||e.pause()}stop(){var e;if(!this.videoConfig)return;this.log({message:"stop"});let i=!!this.interactiveController;i&&(this.interactiveController.destroy(),this.interactiveController=void 0,this.interactiveContainer=void 0,this.interactiveSubscription.unsubscribe()),this.unmountComponent(this.svelteStubComponent),(e=this.mediaSessionApi)==null||e.destroy();let o=this.videoConfig.videos[0];o&&(this.unmountComponent(this.svelteRootComponent),i?(this.videoConfig.autoplay=!1,this.initInteractives()):this.createPlayer(o))}setMuted(e){var i;this.log({message:`set muted, muted: ${e}`}),(i=this.svelteRootComponent)==null||i.setMuted(e)}setPiPEnabled(e){var i,o;(o=(i=this.store)==null?void 0:i.webApi.pictureInPictureApi)==null||o.setEnabled(e)}setVolume(e){var i;this.log({message:`set volume, volume: ${e}`}),(i=this.svelteRootComponent)==null||i.setVolume(e)}setRepeat(e){this.log({message:`set repeat, repeat: ${e}`}),this.needToRepeatPlaylist=e,r(bn)&&(r(bn).needToRepeatPlaylist=this.needToRepeatPlaylist,r(bn).showNextPrevButtons=this.needToShowNextPrevButtons(),r(bn).nextButtonActive=this.isNextButtonActive(),r(bn).prevButtonActive=this.isPrevButtonActive())}seekTime(e){var i;this.isControlDisabled("TIMELINE")||(this.log({message:`seek time, time: ${e}`}),(i=this.svelteRootComponent)==null||i.seekTime(e))}seekEpisodeStartTime(e){var i;this.log({message:`seek episode start time, time: ${e}`}),(i=this.svelteRootComponent)==null||i.seekEpisodeStartTime(e)}returnFocusToEpisodes(){var e;this.log({message:"return focus to episodes button"}),(e=this.svelteRootComponent)==null||e.returnFocusToEpisodes()}setPlaybackRate(e){var i;this.log({message:`set playback rate to: ${e}`}),(i=this.svelteRootComponent)==null||i.setPlaybackRate(e)}setAutoQualityLimits(e){var i,o,n;this.log({message:`set auto quality limitation. Max: ${(i=e.max)!=null?i:"none"}. Min: ${(o=e.min)!=null?o:"none"}`}),(n=this.svelteRootComponent)==null||n.setAutoQualityLimits(e)}addLanguage(e){var i;(i=this.store)==null||i.actions.internal.addLanguage(e)}async setLanguage(e){var i;await((i=this.store)==null?void 0:i.actions.internal.setLanguage(e))}setLiveStart(e){var i,o;this.log({message:"live started"}),(i=this.store)==null||i.actions.internal.setLiveWaitingRecover(!1),(o=this.store)==null||o.actions.internal.setLiveWaitingStart(!1),this.unmountComponent(this.svelteRootComponent),this.createPlayer(e,{autoplay:!0})}setLiveWaitingRecover(){var e;this.log({message:"live waiting"}),(e=this.store)!=null&&e.callbacks&&(this.store.callbacks.onLiveEnded=()=>{var i,o;(i=this.store)==null||i.actions.internal.setLiveWaitingRecover(!0),(o=this.store)==null||o.destroy()})}setLiveWaitingRecord(){var e;this.log({message:"post live"}),(e=this.store)!=null&&e.callbacks&&(this.store.callbacks.onLiveEnded=()=>{var i,o;(i=this.store)==null||i.actions.internal.setLiveWaitingRecord(!0),(o=this.store)==null||o.destroy()})}setLiveEnd(e){var i;this.log({message:"live ended"}),(i=this.store)!=null&&i.callbacks&&(this.store.callbacks.onLiveEnded=()=>{var o,n;(o=this.store)==null||o.actions.internal.setLiveWaitingRecover(!1),(n=this.store)==null||n.actions.internal.setLiveWaitingRecord(!1),this.unmountComponent(this.svelteRootComponent),this.createPlayer(e,{autoplay:!1})})}setLiveLowLatency(e){var i;this.log({message:"live switch to low latency "+e}),(i=this.store)==null||i.actions.external.setLiveLowLatency(e)}getDebugData(){var e,i;return(i=(e=this.store)==null?void 0:e.actions.internal.getDebugTextData())!=null?i:""}getDeviceId(){var e,i;return(i=(e=this.statistics)==null?void 0:e.oneStat.getDeviceId())!=null?i:void 0}replayInteractiveVideo(){this.interactiveController&&this.interactiveController.setChapter()}async replayInteractiveChapter(e){var i,o;if(this.interactiveController&&((i=this.store)!=null&&i.state.positionExact$)){let n=ye(this.store.state.positionExact$),s=ye(this.store.state.interactiveEpisodes$).find(l=>!l.completed);this.interactiveController.events.playerChanged$.pipe(Zx()).subscribe(()=>{s&&n>=s.time?this.seekTime(s.time):this.seekTime(n),e==null||e()});let d=this.interactiveController.getCurrentChapter();await this.interactiveController.setChapter({chapterId:(o=d==null?void 0:d.chapter)==null?void 0:o.id,pushToHistory:!1})}}showInteractiveIndicatorTooltip(e,i=!1){var o;(o=this.microStoresRoot)==null||o.stores.showInteractiveTimeIndicatorTooltip$.set(e,i)}switchToActiveLive(){var e;(e=this.store)==null||e.actions.internal.switchToActiveLive()}updateAdditionalSettingsItem(e,i){var o;(o=this.store)==null||o.actions.external.updateAdditionalSettingsItem(e,i)}addAdditionalSettingsItem(e){var i;(i=this.store)==null||i.actions.external.addAdditionalSettingsItem(e)}removeAdditionalSettingsItem(e){var i;(i=this.store)==null||i.actions.external.removeAdditionalSettingsItem(e)}updateAdditionalContextItem(e,i){var o;(o=this.store)==null||o.actions.external.updateAdditionalContextItem(e,i)}addAdditionalContextItem(e){var i;(i=this.store)==null||i.actions.external.addAdditionalContextItem(e)}removeAdditionalContextItem(e){var i;(i=this.store)==null||i.actions.external.removeAdditionalContextItem(e)}updateAdditionalButton(e,i){var o;(o=this.store)==null||o.actions.external.updateAdditionalButton(e,i)}addAdditionalButton(e){var i;(i=this.store)==null||i.actions.external.addAdditionalButton(e)}removeAdditionalButton(e){var i;(i=this.store)==null||i.actions.external.removeAdditionalButton(e)}updateStatContext(e){this.statistics&&this.statistics.oneStat.updateContext(e)}handleTimerNextVideo(e){var i;(i=this.store)==null||i.actions.internal.setTimerNextVideoRunning(e)}focus(){var e,i,o;(o=(i=(e=this.svelteRootComponent)==null?void 0:e.keyboardControls)==null?void 0:i.focus)==null||o.call(i)}unmountComponent(e){e&&Us(e)}};import{InterfaceLanguage as vZ,VKNumericLanguage as gZ,loadVKLangPack as hZ}from"@vkontakte/videoplayer-shared/es2018";import{VideoQuality as bZ,VideoFormat as $Z}from"@vkontakte/videoplayer-core/es2018";var aZ=()=>{window.customElements.define("vk-video-player",du)};export{Uc as ControlButtonType,Ur as GridTypes,vZ as InterfaceLanguage,Dl as MenuItemType,Gs as PlayerPhase,Da as VERSION,gZ as VKNumericLanguage,$Z as VideoFormat,bZ as VideoQuality,hZ as loadVKLangPack,aZ as registerPlayerWebComponent};
|
|
395
|
+
`),n=document.createElement("style");n.textContent=o;let a=this.createStretchedContainer(),s=a.attachShadow({mode:"open"});s.append(n),s.append(this.playerDomElement);let d={target:this.playerParentShadowRoot,context:this.svelteContext};this.playerDummyElement=es(Pm,d),(e=this.pipWindow)==null||e.document.body.append(a),this.info.isActive$.next(!0),(i=this.pipWindow)==null||i.addEventListener("unload",l=>{!this.playerDomElement||!this.playerParentShadowRoot||!this.playerDummyElement||(Us(this.playerDummyElement),this.playerParentShadowRoot.append(this.playerDomElement),this.info.isActive$.next(!1))})}async remove(){return new Promise(e=>{var i;(i=documentPictureInPicture.window)==null||i.close(),e()})}async dispose(){await this.remove()}setEnabled(e){this.info.isEnabled$.next(e)}createStretchedContainer(){let e=document.createElement("div");return e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.width="100%",e.style.height="100%",e}};function _1(t){return t instanceof Sd}var nu=class{static getLatestSupportedVersion(e){let i=new Ys,o=new Sd(e);if(o.isSupported())return o;if(i.isSupported())return i}};function ru(t,e){var n,a;let i=new Set([...Object.keys(t),...Object.keys(e)]),o={};for(let s of i)o[s]=(a=(n=e[s])!=null?n:t[s])!=null?a:void 0;return o}var b1="Inner error. Unexpectedly root annotation container null reference exception",$1="Annotation with such name already exists",y1="Annotation with such name does not exist";var Ja=class extends Error{constructor(e){super(e),this.name="AnnotationError"}};import{observeElementSize as Ax,Subscription as Mx,throttleFn as Lx}from"@vkontakte/videoplayer-shared/es2018";var Vx="1",Rx=100,su=class{constructor(e){this.annotationsInside=e;this.annotations=new Map;this.subscriptions=new Mx}init(e){if(this.rootAnnotationsContainer=e,this.annotationsInside)return;let i=Lx(()=>{for(let o of this.annotations.values())this.isElementExceedsBoundaries(o,this.playerSize.width,this.playerSize.height)?o.style.visibility="hidden":o.style.visibility="visible"},Rx);this.subscriptions.add(Ax(this.rootAnnotationsContainer).subscribe(({width:o,height:n})=>{this.playerSize={width:o,height:n},i()})),this.mutationObserver=new MutationObserver(i),this.mutationObserver.observe(this.rootAnnotationsContainer,{attributes:!0,childList:!0,subtree:!0,characterData:!0})}add(e,i){var o;if(!this.rootAnnotationsContainer)throw new Ja(b1);if(this.annotations.has(e))throw new Ja($1);i.style.zIndex=(o=i.style.zIndex)!=null?o:Vx,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 Ja(y1);return i}remove(e){let i=this.get(e);this.annotations.delete(e)&&i.remove()}clear(){for(let e in this.annotations.keys())this.remove(e)}destroy(){var e;this.annotations.clear(),this.subscriptions.unsubscribe(),(e=this.mutationObserver)==null||e.disconnect(),this.rootAnnotationsContainer=null}isElementExceedsBoundaries(e,i,o){let n=e.offsetTop,a=e.offsetLeft,s=e.offsetWidth,d=e.offsetHeight;return n<0||a<0||a+s>i||n+d>o}registryRootContainer(e){}addLayer(e){return document.createElement("div")}getLayer(e){}removeLayer(e){}clearLayer(e){}detach(){}reattach(){}};import{assertNonNullable as au,Subscription as Nx}from"@vkontakte/videoplayer-shared/es2018";var Fo=class{init({store:e,microStores:i,interactiveController:o,config:n}){return au(e),au(i),au(n),n.interactiveData&&au(o),this.subscription=new Nx,this.subscription}};var Cd=class extends Fo{constructor(){super(...arguments);this.stateName="fakeIsPlaying$";this.state$={...ae(null),toggle:()=>this.state$.update(i=>!i)}}init(i){let o=super.init(i),{isInteractiveExpectation$:n}=i.store.state;return o.add(n.subscribe(a=>{this.state$.set(a?!0:null)})),o}};var Td=class extends Fo{constructor(){super(...arguments);this.stateName="interactiveControlsOpacity$";this.state$={...ae(null),toggle:()=>this.state$.update(i=>!i)}}init(i){let o=super.init(i),{microStores:n,store:a}=i,{fakeIsPlaying$:s}=n,{isInteractiveExpectation$:d,isPlaying$:l}=a.state,{controlsVisible:p,isMobile:f}=a.ui,_=ye(f),u=()=>_&&ye(p);return o.add(p.subscribe($=>{if(!_)return;let w=ye(s);ye(l)?this.state$.set($):w!==null&&this.state$.set(!w||$)})),o.add(l.subscribe($=>{this.state$.set(!$||u())})),o.add(s.subscribe($=>{if($===null)return;let w=ye(d);if(u()){this.state$.set(!0);return}w&&this.state$.set(!$)})),o}};var kd=class extends Fo{constructor(){super(...arguments);this.stateName="seekToInteractiveDisabledTooltip$";this.state$=ae("tooltip_chapter_without_interactive")}init(i){let o=super.init(i),{store:n}=i;return o.add(n.state.interactiveEpisodes$.subscribe(a=>{a.length&&(a.every(s=>s.completed)?this.state$.set("tooltip_interactive_of_chapter_completed"):this.state$.set("tooltip_disabled_when_interactive"))})),o}};import{combine as Bx}from"@vkontakte/videoplayer-shared/es2018";var Mm=ae(!1),lu=null,Id=class extends Fo{constructor(){super(...arguments);this.stateName="showInteractiveTimeIndicatorTooltip$";this.state$={...Mm,set:(i,o=!1)=>{i!==ye(Mm)&&(this.clearTimeout(),Mm.set(i),!i&&lu&&(lu=!1),i&&o&&(this.timeout=setTimeout(()=>{this.state$.set(!1)},3e3)))},clearTimeout:()=>this.clearTimeout()}}init(i){let o=super.init(i),{store:n,config:a}=i,{isInteractiveTime$:s,isPlaying$:d}=n.state,l=n.ui.controlsVisible,{interactiveTimeIndicator:p}=n.ui.controls;o.add(l.subscribe(_=>{ye(s)&&_&&this.state$.set(!1)}));let f=(a==null?void 0:a.interactiveData)||{tooltipHelpHintActive:!1};return o.add(Bx({isPlaying$:d,isInteractiveTime$:s,interactiveTimeIndicator:p}).subscribe(({isPlaying$:_,isInteractiveTime$:u,interactiveTimeIndicator:$})=>{var w,y;if(!(!_||!($!=null&&$.isDisplayed))){if(!u)return this.state$.set(!1);f.tooltipHelpHintActive&&lu===null&&(lu=!0,f.tooltipHelpHintActive=!1,this.state$.set(!0),(y=(w=n.callbacks)==null?void 0:w.onInteractiveTimeIndicatorHintDeactivated)==null||y.call(w))}})),o}clearTimeout(){window.clearTimeout(this.timeout)}};import{combine as Dx,noop as Ox}from"@vkontakte/videoplayer-shared/es2018";var Ed=class extends Fo{constructor(){super(...arguments);this.stateName="graphIsOpened$";this.graphMadePause=!1;this.state$={...ae(null),toggle:Ox};this.checkIfShouldHide=i=>Ss(i,"s")}init(i){let o=super.init(i),{store:n,interactiveController:a}=i,s=n.ui.currentGridType$,d=n.getLogger().createComponentLog("GraphIsOpened microStore");return this.state$.toggle=async()=>{if(this.checkIfShouldHide(ye(s)))return;let l=ye(this.state$),{isEnded$:p,playbackState$:f}=n.state,{disabledControls$:_}=n.ui.controls,u=ye(p),$=ye(f);if(l)try{await(a==null?void 0:a.toggleGraphView(!1)),this.state$.set(!1),_.remove(cp),!u&&this.graphMadePause&&n.actions.internal.play()}catch(w){d({message:"Cant hide graph"})}else{this.graphMadePause=$==="playing";try{await(a==null?void 0:a.toggleGraphView(!0)),this.state$.set(!0),_.add(cp),!u&&this.graphMadePause&&n.actions.internal.pause()}catch(w){d({message:"Cant show graph"})}}},o.add(Dx({graphIsOpened:this.state$,currentGridType:s}).subscribe(async({graphIsOpened:l,currentGridType:p})=>{if(this.checkIfShouldHide(p)&&l)try{await(a==null?void 0:a.toggleGraphView(!1)),this.state$.set(!1)}catch(_){d({message:"Cant hide graph"})}})),o}};import{ValueSubject as x1}from"@vkontakte/videoplayer-shared/es2018";var Pd=class extends Fo{constructor(){super(...arguments);this.stateName="pictureInPicture$";this.state$={isActive$:ae(!1),isEnabled$:ae(!1),type$:ae(void 0)}}init(i){let o=super.init(i),{store:n}=i,{info:{isActive$:a,isEnabled$:s,type:d}}=n.webApi.pictureInPictureApi||{info:{isActive$:new x1(!1),isEnabled$:new x1(!1)}};return o.add(a.subscribe(l=>{this.state$.isActive$.set(l)})),o.add(s.subscribe(l=>{this.state$.isEnabled$.set(l)})),this.state$.type$.set(d),o}};import{filter as Ux,filterChanged as zx}from"@vkontakte/videoplayer-shared/es2018";import{safeStorage as Lm}from"@vkontakte/videoplayer-shared/es2018";var w1=({maxShowCount:t,timeout:e})=>{let i=[t!==0?Hx({maxCount:t}):void 0,e!==0?Fx({timeout:e}):void 0].filter(o=>!!o);return{notificationShowed:o=>i.forEach(n=>n.notificationShowed(o)),canShowNotification:o=>i.every(n=>n.canShowNotification(o))}},Hx=({maxCount:t})=>{let e={};return{notificationShowed:i=>{var o,n;e[i]=((o=e[i])!=null?o:0)+1,Lm.set("videoplayer_notifications_manager_count",JSON.stringify((n=e[i])!=null?n:0))},canShowNotification:i=>{var o;return((o=e[i])!=null?o:0)<t}}},Fx=({timeout:t})=>{let e="videoplayer_notifications_manager",i=()=>{try{return JSON.parse(Lm.get(e)||"{}")}catch(a){return{}}},o=a=>Lm.set(e,JSON.stringify(a)),n=a=>{let s=i();delete s[a],o(s)};return{notificationShowed:a=>{o({...i(),[a]:{timeout:t,launchTime:Date.now()}})},canShowNotification:a=>{let s=i()[a];if(s){let d=Date.now()-s.launchTime>t;return d&&n(a),d}else return!0}}};var Ad=class extends Fo{constructor(){super(...arguments);this.stateName="notifications$";this.state$={notificationsToShow$:ae({}),showNotification:i=>{this.state$.notificationsToShow$.update(o=>(o[i]=!0,o)),this.notificationManager.notificationShowed(i)},closeNotification:i=>{this.state$.notificationsToShow$.update(o=>(delete o[i],o))}}}init(i){let o=super.init(i),{store:n,uiConfig:{features:{maxCountShowSlowVideoNotification:a,timeoutShowSlowVideoNotification:s,showSlowVideoNotification:d,forceAutoQualityWhenSevereStallHappens:l}}}=i;this.notificationManager=w1({maxShowCount:a,timeout:s});let p=n.getPlayer();return o.add(p.events.severeStallOccured$.pipe(zx(),Ux(f=>f)).subscribe(()=>{d&&!p.info.isAutoQualityEnabled$.getValue()&&this.notificationManager.canShowNotification("slow_video")&&(l&&n.actions.internal.setQuality("auto"),this.state$.showNotification("slow_video"))})),o}};var S1=()=>[Cd,Td,kd,Id,Ed,Pd,Ad].reduce(({subscribers:t,stores:e},i)=>{let o=new i;return{subscribers:[...t,o],stores:{...e,[o.stateName]:o.state$}}},{subscribers:[],stores:{}});import{devNull as Md}from"@vkontakte/videoplayer-shared/es2018";var qx=Object.defineProperty,Wx=(t,e,i)=>e in t?qx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Xt=(t,e,i)=>Wx(t,typeof e!="symbol"?e+"":e,i),i5={preload:!0,autoplay:!1,repeat:!1,fromTime:0,canRewindLive:!0,showAds:!1,interfaceLanguage:Gx.RU,isCyrillicRelatedInterface:!0,logoClickable:!1,logoHidden:!1,isTouch:e5(),isMediaSessionEnabled:!0,isPictureInPictureEnabled:!0,isAudioDisabled:!1,callbacks:{uiInfo:{}},tuningConfig:{configName:[]},saveRate:!0,volumeMultiplier:1,showEndScreen:!0,showAutoplayNext:!0,showNextPrevButtons:!0},bn=ee(void 0),du=class extends HTMLElement{constructor(){super(),Xt(this,"svelteStubComponent"),Xt(this,"svelteRootComponent"),Xt(this,"store"),Xt(this,"microStoresRoot"),Xt(this,"statistics"),Xt(this,"sentry"),Xt(this,"_shadowRoot"),Xt(this,"playerContainer"),Xt(this,"rootContainer"),Xt(this,"shadowRootContainer"),Xt(this,"uiConfig"),Xt(this,"coreConfig"),Xt(this,"statisticsConfig"),Xt(this,"interactiveController"),Xt(this,"interactiveContainer"),Xt(this,"graphMadePause"),Xt(this,"currentPlayingVideoIndex",0),Xt(this,"needToRepeatPlaylist",!1),Xt(this,"videoConfig"),Xt(this,"pictureInPictureApi"),Xt(this,"mediaSessionApi"),Xt(this,"unsubscribePlayerPhaseSubscription"),Xt(this,"logger"),Xt(this,"log"),Xt(this,"subscription"),Xt(this,"interactiveSubscription"),Xt(this,"annotationsApi"),Xt(this,"slotsApi"),Xt(this,"prevIsid"),Xt(this,"isInited",!1),Xt(this,"internalsExposure",null),Xt(this,"shadowDOMCallbacksDisabled",!1),Xt(this,"createOneStat",(e,i={})=>{var o,n,a,s;let{albumId:d,statPlace:l,statUserSalt:p,statTrackCode:f,statVKAppId:_,refreshStatAuthToken:u,autoplay:$,isMobile:w,isTouch:y,refDomain:S,deviceId:k,interactiveData:P}=ru(this.videoConfig,i),A=(o=P==null?void 0:P.projectInfo)==null?void 0:o.pid,E=(a=(n=this.interactiveController)==null?void 0:n.state.isReplay$.getValue())!=null?a:!1;E&&(this.prevIsid=void 0);let{unitedVideoId:T,isClip:V=!1}=e;if(this.uiConfig.features.statistics&&T)return new t5({movieId:T,albumId:d,place:l,trackCode:f,vkAppId:_,autoplay:(s=$&&!this.interactiveController)!=null?s:!1,mobile:y!=null?y:w,clip:V,refDomain:S,deviceId:k,...A&&(!this.isInited||E)&&{projectId:Number(A)}},{refreshAuthToken:u,userSalt:p,config:this.statisticsConfig,...this.interactiveController&&{useIsid:!0,isid:this.prevIsid}})}),Md.create("ui"),this.logger=new Yx,this.log=this.logger.createComponentLog("VKVideoPlayer"),this.subscription=new C1,this.interactiveSubscription=new C1,this.graphMadePause=!1}connectedCallback(){var e,i;if(this.isInited||this.shadowDOMCallbacksDisabled)return;this.initPlayerRootContainers();let o=(e=this.getAttribute("stub-title"))!=null?e:void 0,n=(i=this.getAttribute("stub-thumb-url"))!=null?i:void 0,a=me({title:o,thumbUrl:n}),s={target:this.playerContainer,props:a};this.svelteStubComponent=es(Im,s)}disconnectedCallback(){var e,i,o,n,a;this.shadowDOMCallbacksDisabled||((e=this.annotationsApi)==null||e.destroy(),(i=this.mediaSessionApi)==null||i.destroy(),this.unmountComponent(this.svelteRootComponent),this.unmountComponent(this.svelteStubComponent),this.subscription.unsubscribe(),(o=this.unsubscribePlayerPhaseSubscription)==null||o.call(this),(n=this.interactiveController)==null||n.destroy(),this.interactiveSubscription.unsubscribe(),(a=this.internalsExposure)==null||a.destroy(),Md.destroy("ui"))}initPlayerRootContainers(){this.rootContainer=document.createElement("div"),this.rootContainer.style.position="relative",this.rootContainer.className="root-container",this.rootContainer.style.width="100%",this.rootContainer.style.height="100%",this.rootContainer.style.minHeight="206px",this.shadowRootContainer=document.createElement("div"),this.shadowRootContainer.style.position="absolute",this.shadowRootContainer.className="shadow-root-container",this.shadowRootContainer.style.width="100%",this.shadowRootContainer.style.height="100%",this._shadowRoot=this.shadowRootContainer.attachShadow({mode:"open"}),this.playerContainer=document.createElement("div"),this.playerContainer.style.all="initial",this.playerContainer.style.display="block",this.playerContainer.style.contain="strict",this.playerContainer.style.width="100%",this.playerContainer.style.height="100%",this._shadowRoot.append(this.playerContainer),this.rootContainer.append(this.shadowRootContainer),this.append(this.rootContainer)}needToShowNextPrevButtons(){return this.videoConfig?this.videoConfig.videos.length>1&&this.videoConfig.showNextPrevButtons:!1}isNextButtonActive(){return this.videoConfig?this.needToShowNextPrevButtons()&&(this.currentPlayingVideoIndex<this.videoConfig.videos.length-1||this.needToRepeatPlaylist):!1}isPrevButtonActive(){return this.videoConfig?this.needToShowNextPrevButtons()&&(this.currentPlayingVideoIndex>0||this.needToRepeatPlaylist):!1}isControlDisabled(e){var i;let o=(i=this.store)==null?void 0:i.ui.controls.disabledControls$;return(o==null?void 0:o.includes(e))||!1}getNextVideoInfo(){if(!this.videoConfig)return{nextVideoTitle:void 0,nextVideoThumb:void 0};let e=this.videoConfig.videos[this.currentPlayingVideoIndex+1]||{};return{nextVideoTitle:e.title,nextVideoThumb:e.thumbUrl}}createPlayer(e,i={},o){var n,a,s,d,l,p,f,_;if(!this.videoConfig)return;let{albumId:u,statPlace:$,statAuthToken:w,preload:y,autoplay:S,volume:k,muted:P,fromTime:A,canRewindLive:E,supportLink:T,showAds:V,adsSlotId:U,adsParams:G={},adsPreviewParam:F,adsAutoplayParam:Y,interfaceLanguage:X,isCyrillicRelatedInterface:oe,logoClickable:pe,logoHidden:le,isMobile:Ve,isTouch:Ae,isAudioDisabled:J,isLiveCatchUpMode:Me,fullScreenTarget:j,failoverHosts:B,canDownload:Re,callbacks:ne,interactiveData:Ie,showThumbTimer:Ne,additionalButtons:fe=[],additionalSettingsMenuItems:D=[],additionalContextMenuItems:de=[],repeat:Ee,saveRate:Qe,volumeMultiplier:st,showEndScreen:Pe,showAutoplayNext:$e}=ru(this.videoConfig,i),{sources:Le,title:je,thumbUrl:ct,unitedVideoId:ot,isClip:Nt=!1,duration:nt,adsParams:$t={},videoEpisodes:Ut,previewThumbsData:Kt,subtitles:Be,live:re}=e,W={...G,...$t},se=this.getNextVideoInfo(),he={sources:Le,title:je,thumbUrl:ct,subtitles:Be,unitedVideoId:ot,isClip:Nt,live:re,albumId:u,statPlace:$,autoplay:S,muted:P,volume:k,fromTime:A,canRewindLive:E,showAds:V,adsSlotId:U,adsParams:W,adsPreviewParam:F,adsAutoplayParam:Y,duration:nt,logoClickable:pe,logoHidden:le,isTouch:Ae!=null?Ae:Ve,repeat:Ee,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:se.nextVideoTitle,endScreenVideoThumb:se.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist()},Ce={pictureInPictureApi:this.pictureInPictureApi,annotationsApi:this.annotationsApi};this.log({message:`create player, props: ${JSON.stringify(he)}`});let De=(n=this.interactiveController)==null?void 0:n.state.statistics$.getValue(),ut=(De==null?void 0:De.oneStat)||this.createOneStat(e,i);ut&&(this.statistics=new Fc(ut,De==null?void 0:De.statSubscription)),this.uiConfig.features.sentry&&this.uiConfig.sentry.dsn&&new Qs(this.uiConfig.sentry,{version:Da,env:fc},{movieId:ot,albumId:u,place:$,autoplay:(a=S&&!this.interactiveController)!=null?a:!1,mobile:Ae!=null?Ae:Ve,clip:Nt}),this.interactiveController&&((d=this.prevIsid)!=null||(this.prevIsid=(s=this.statistics)==null?void 0:s.oneStat.isid$.getValue())),this.sentry={...this.sentry,...Qs.getInstance()};let Ge=!!Ie,at=[],Xe="tooltip_interactive_go_back_disabled_first";if(Ge&&this.interactiveController){let lt=this.interactiveController.state.isInitialChapter$.getValue(),ti=this.interactiveController.getHistoryState();lt&&at.push("REPLAY_BUTTON"),this.interactiveController.getIsSeekable().getValue()||at.push("SEEK_TO_INTERACTIVE_BUTTON"),ti.hasPrevChapter$.getValue()||(at.push("PLAY_PREV_CHAPTER_BUTTON"),lt||(ti.isGoBackLimited$.getValue()?Xe="tooltip_interactive_go_back_disabled_limit":Xe="tooltip_interactive_go_back_disabled"))}let Ct=()=>{var lt;this.isInited=!1,this.prevIsid=void 0;let ti=(o==null?void 0:o.info.isEnded$.getValue())&&((lt=this.interactiveController)==null?void 0:lt.state.isEndChapter$.getValue());ne.onReplayInteractiveVideo&&!ti?ne.onReplayInteractiveVideo():this.replayInteractiveVideo()};this.store=Uh({player:o,interfaceLanguage:X,isCyrillicRelatedInterface:oe,videoId:ot,isClip:Nt,isLiveCatchUpMode:Me,isAudioDisabled:J,statAuthToken:w,callbacks:ne,webApi:Ce,videoEpisodes:Ut,previewThumbsData:Kt,canDownload:Re,uiConfig:this.uiConfig,coreConfig:this.coreConfig,disabledControls:at,isInteractive:Ge,saveRate:Qe,interactiveRanges$:(l=this.interactiveController)==null?void 0:l.state.interactiveRanges$,isInteractiveTime$:(p=this.interactiveController)==null?void 0:p.state.isInteractiveTime$,stopPlayer:()=>this.stop(),replayInteractive:Ct,playPrevChapterDisabledTooltip:Xe,hasInteractiveBranches:!!((_=(f=this.interactiveController)==null?void 0:f.getChapterBranches())!=null&&_.length),additionalButtons:this.uiConfig.features.additionalButtons?fe:[],additionalSettingsMenuItems:D!=null?D:[],additionalContextMenuItems:de!=null?de:[],playPrevVideo:()=>this.playPrevVideo(),playNextVideo:()=>this.playNextVideo(),looped:Ee&&this.videoConfig.videos.length===1,statistics:this.statistics,internalsExposure:this.internalsExposure});let{stores:Jt}=this.microStoresRoot=S1(),Ke=()=>{var lt,ti,Ri,Lo,Ni,yo;if(!this.store||!this.microStoresRoot||!this.videoConfig)return;this.subscription.add(this.store.state.currentFormat$.subscribe(Pt=>{var gt;return(gt=ne==null?void 0:ne.onCurrentFormatChanged)==null?void 0:gt.call(ne,Pt)})),this.subscription.add(Jt.interactiveControlsOpacity$.subscribe(Pt=>{var gt;Pt!==null&&((gt=this==null?void 0:this.interactiveController)==null||gt.setDisabledControls(Pt))})),this.subscription.add(this.store.state.throughputEstimation$.subscribe(Pt=>{var gt;return(gt=ne==null?void 0:ne.onThroughputEstimationChanged)==null?void 0:gt.call(ne,Pt)})),this.subscription.add(this.store.state.trafficSavingEnabled$.subscribe(Pt=>{var gt;return(gt=ne==null?void 0:ne.onTrafficSavingEnabledChanged)==null?void 0:gt.call(ne,Pt)})),this.subscription.add(new jx(Pt=>{this.store&&this.subscription.add(this.store.state.currentPlaybackRate$.subscribe(gt=>Pt.next(gt)))}).pipe(this.uiConfig.features.skipInitialPlaybackRateValue?Jx(1):Pt=>Pt).subscribe(Pt=>{var gt;return(gt=ne==null?void 0:ne.onCurrentPlaybackRateChanged)==null?void 0:gt.call(ne,Pt)})),this.subscription.add(this.store.state.volume$.subscribe(Pt=>{var gt;return(gt=ne==null?void 0:ne.onVolumeChange)==null?void 0:gt.call(ne,Pt)})),this.subscription.add(this.store.state.muted$.subscribe(Pt=>{var gt,kt;return Pt?(gt=ne==null?void 0:ne.onMute)==null?void 0:gt.call(ne):(kt=ne==null?void 0:ne.onUnmute)==null?void 0:kt.call(ne)})),this.subscription.add(this.store.state.videoBitrate$.subscribe(Pt=>{var gt;return(gt=ne==null?void 0:ne.onVideoBitrateChanged)==null?void 0:gt.call(ne,Pt)})),this.subscription.add(this.store.state.isInteractiveTime$.subscribe(Pt=>{var gt;let kt=(gt=this.store)==null?void 0:gt.ui.controls.disabledControls$;kt&&(Pt&&!kt.includes(Il)&&kt.add(Il),Pt||kt.remove(Il))})),this.subscription.add(this.store.ui.isFullscreen.subscribe(async Pt=>{var gt;if(!T1.browser.isSamsungBrowser||!Pt||!this.interactiveController)return;document.fullscreenElement===this.shadowRootContainer&&await this.replayInteractiveChapter((gt=this.videoConfig)==null?void 0:gt.callbacks.onExternalFullscreenExit)})),this.statistics&&this.subscription.add(this.statistics.oneStat.vsid$.subscribe(Pt=>{var gt;return(gt=ne==null?void 0:ne.onVSIDChanged)==null?void 0:gt.call(ne,Pt)})),this.initMediaSession(),O(bn,me({interactiveController:this.interactiveController,interactiveContainer:this.interactiveContainer,sources:Le,store:this.store,microStoresRoot:this.microStoresRoot,videoConfig:this.videoConfig,uiConfig:this.uiConfig,title:je,thumbUrl:ct,subtitles:Be,live:re,preload:y,autoplay:S,muted:P,volume:k,fromTime:A,canRewindLive:E,supportLink:T,showAds:V,adsSlotId:U,adsParams:W,adsPreviewParam:F,adsAutoplayParam:Y,duration:nt,logoClickable:pe,logoHidden:le,isMobile:Ae!=null?Ae:Ve,failoverHosts:B,fullScreenTarget:j,saveRate:Qe,shadowRootContainer:this.shadowRootContainer,showMiniTimer:Ne,outerContainerRef:this.rootContainer,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:se.nextVideoTitle,endScreenVideoThumb:se.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist(),playPrevChapter:()=>this.playPrevChapter(),seekToInteractive:()=>this.seekToInteractive(),volumeMultiplier:st,showEndScreen:Pe,showAutoplayNext:$e}));let Vo={target:this.playerContainer,props:r(bn)};this.svelteRootComponent=es(Cm,Vo),this.addPlayerInfoSubscriptions(),this.isInited||(this.isInited=!0,(Ri=(ti=(lt=this.videoConfig)==null?void 0:lt.callbacks)==null?void 0:ti.onInited)==null||Ri.call(ti)),(Lo=this.internalsExposure)==null||Lo.expose({player:this,videoConfig:this.videoConfig,coreConfig:this.coreConfig,uiConfig:this.uiConfig,statisticsConfig:this.statisticsConfig,logger:this.logger,log:this.log}),this.uiConfig.devNullLog&&((yo=(Ni=this.videoConfig)==null?void 0:Ni.callbacks)!=null&&yo.onDevNullLog)?Md.subscribe("ui",this.videoConfig.callbacks.onDevNullLog):Md.destroy("ui")};this.coreConfig.asyncResolveClientChecker?T1.isInited$.subscribe(lt=>{lt&&(console.log("UI SDK async start"),Ke())}):Ke()}addPlayerInfoSubscriptions(){var e,i;let o=this.store,n=(e=this.microStoresRoot)==null?void 0:e.stores;if(!o||!n)return;let a=(i=this.videoConfig)==null?void 0:i.callbacks;a&&this.subscription.add(o.playerPhase.subscribe(d=>{var l;return(l=a.onPlayerPhaseChanged)==null?void 0:l.call(a,d)})).add(o.state.playbackState$.subscribe(d=>{var l;return d&&((l=a.onPlaybackStateChanged)==null?void 0:l.call(a,d))})).add(o.state.isLive$.subscribe(d=>{var l;return(l=a.onIsLiveChanged)==null?void 0:l.call(a,d)})).add(o.state.isActiveLive$.subscribe(d=>{var l;return(l=a.onIsActiveLiveChanged)==null?void 0:l.call(a,d)})).add(o.state.isAudioAvailable$.subscribe(d=>{var l;return(l=a.onIsAudioAvailableChanged)==null?void 0:l.call(a,d)})).add(o.state.currentQuality$.subscribe(d=>{var l;return(l=a.onCurrentQualityChanged)==null?void 0:l.call(a,d)})).add(o.state.availableQualities$.subscribe(d=>{var l;return(l=a.onAvailableQualitiesChanged)==null?void 0:l.call(a,d.map(({value:p})=>p).filter(p=>p!=="auto"))})).add(o.state.availableAudioStreams$.subscribe(d=>{d.length>1&&a.onAudioLanguagesAvailable&&a.onAudioLanguagesAvailable()})).add(n.pictureInPicture$.isActive$.subscribe(d=>{var l,p;return d?(l=a.onPiPEnter)==null?void 0:l.call(a):(p=a.onPiPExit)==null?void 0:p.call(a)}));let s=a==null?void 0:a.uiInfo;s&&this.subscription.add(o.ui.controlsVisible.subscribe(d=>{var l;return(l=s.onControlsVisibleChanged)==null?void 0:l.call(s,d)})).add(o.ui.isMobile.subscribe(d=>{var l;return(l=s.onIsMobileChanged)==null?void 0:l.call(s,d)})).add(o.ui.playerSize.subscribe(d=>{var l;return(l=s.onPlayerSizeChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.prevButton.subscribe(d=>{var l;return(l=s.onPrevButtonChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.playButton.subscribe(d=>{var l;return(l=s.onPlayButtonChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.replayButton.subscribe(d=>{var l;return(l=s.onReplayButtonChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.nextButton.subscribe(d=>{var l;return(l=s.onNextButtonChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.playPrevChapterButton.subscribe(d=>{var l;return(l=s.onPlayPrevChapterChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.seekToInteractiveButton.subscribe(d=>{var l;return(l=s.onSeekToInteractiveButtonChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.interactiveGraphButton.subscribe(d=>{var l;return(l=s.onGraphButtonChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.liveButton.subscribe(d=>{var l;return(l=s.onLiveButtonChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.time.subscribe(d=>{var l;return(l=s.onTimeUpdateChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.episodes.subscribe(d=>{var l;return(l=s.onEpisodesChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.subtitles.subscribe(d=>{var l;return(l=s.onSubtitlesChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.settings.subscribe(d=>{var l;return(l=s.onSettingsChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.fullscreen.subscribe(d=>{var l;return(l=s.onFullscreenChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.chromecast.subscribe(d=>{var l;return(l=s.onChromecastChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.pip.subscribe(d=>{var l;return(l=s.onPipChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.vkLogo.subscribe(d=>{var l;return(l=s.onVkLogoChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.interactiveTimeIndicator.subscribe(d=>{var l;return(l=s.onInteractiveTimeIndicatorChanged)==null?void 0:l.call(s,d)})).add(o.ui.controls.timeline.subscribe(d=>{var l;return(l=s.onTimelineChanged)==null?void 0:l.call(s,d)}))}playNextVideo(){this.videoConfig&&(this.currentPlayingVideoIndex++,this.currentPlayingVideoIndex>=this.videoConfig.videos.length&&(this.currentPlayingVideoIndex=0),this.log({message:`play next video, index: ${this.currentPlayingVideoIndex}`}),this.createPlayerWithCurrentVideo())}playPrevVideo(){this.videoConfig&&(this.currentPlayingVideoIndex--,this.currentPlayingVideoIndex<0&&(this.currentPlayingVideoIndex=this.videoConfig.videos.length-1),this.log({message:`play prev video, index: ${this.currentPlayingVideoIndex}`}),this.createPlayerWithCurrentVideo())}createPlayerWithCurrentVideo(e,i=!0){var o;if(!this.videoConfig)return;let n=this.videoConfig.videos[this.currentPlayingVideoIndex];if(!n){this.log({message:"no next video"});return}this.isInited&&Vm(n.unitedVideoId)&&((o=this.store)==null||o.actions.internal.nextMovie(n.unitedVideoId)),this.unmountComponent(this.svelteRootComponent),this.createPlayer(n,{autoplay:i,fromTime:0},e)}playPrevChapter(){var e;(e=this.interactiveController)==null||e.playPrevChapter()}seekToInteractive(){var e;let i=(e=this.interactiveController)==null?void 0:e.getNextInteractiveStartTime();typeof i=="number"&&this.seekTime(i/1e3)}async initInteractives(){var e,i,o,n;if((e=this.videoConfig)!=null&&e.interactiveData)try{let{Interactives:a}=await import("@vkontakte/videoplayer-interactive/es2018");this.interactiveContainer=document.createElement("div"),this.interactiveContainer.classList.add("interactive-root");let s=(i=this.store)==null?void 0:i.interfaceLanguage$,d=s?ye(s):this.videoConfig.interfaceLanguage,{projectInfo:l,initChapterId:p,historyApi:f,videoLoader:_}=this.videoConfig.interactiveData;this.interactiveController=new a({parentElement:this.interactiveContainer,fullscreenTargetElement:this.playerContainer,lang:d,graph:this.uiConfig.features.interactiveGraph,projectInfo:l,initChapterId:p,historyApi:f,vkVideoLoader:_,lastFrame:this.uiConfig.features.interactiveLastFrame,permanentTextControls:this.uiConfig.features.interactiveTextPermanent,interactiveTimeOpenUri:this.uiConfig.features.interactiveTimeOpenUri,initSeamless:!0,config:this.uiConfig.interactive,coreConfig:this.coreConfig,createOneStat:this.createOneStat,animationsFeatureToggles:{areaControlShadow:this.uiConfig.features.interactiveAreaControlShadow,controlsExpectTimeBlinkAnimation:this.uiConfig.features.interactiveControlsExpectTimeBlinkAnimation}});let{isInteractiveExpectation$:u,isSeekable$:$}=this.interactiveController.state;this.uiConfig.features.seekToInteractive&&this.subscription.add($.subscribe(y=>{if(!this.isInited)return;let S=this.store;y?S.ui.controls.disabledControls$.remove("SEEK_TO_INTERACTIVE_BUTTON"):S.ui.controls.disabledControls$.add("SEEK_TO_INTERACTIVE_BUTTON")})),this.subscription.add(u.subscribe(y=>{this.store&&this.store.state.isInteractiveExpectation$.set(y)}));let w=!0;if(this.subscription.add(this.interactiveController.events.playerChanged$.subscribe(y=>{if(!this.videoConfig)return;this.videoConfig.videos[this.currentPlayingVideoIndex]={...y.config,title:(l==null?void 0:l.title)||y.config.title};let S=w?this.videoConfig.autoplay:!0;this.createPlayerWithCurrentVideo(y.player,S),w&&(w=!1)})),this.interactiveSubscription.add(this.interactiveController.events.interactiveActionChoice$.subscribe(({type:y,actionType:S})=>{var k,P,A,E,T,V;if(!this.store||!this.microStoresRoot)return;let U=u.getValue();if(y==="action-choice"&&S==="setRandomBranch"&&(this.microStoresRoot.stores.graphIsOpened$.set(!1),this.store.ui.controls.disabledControls$.remove(El)),y==="action-choice-canceled"){let G=ye(this.store.state.isPlaying$)||U;if(((A=(k=this.videoConfig)==null?void 0:k.isTouch)!=null?A:(P=this.videoConfig)!=null&&P.isMobile)&&G){this.store.ui.interactiveHideMobileControls.set(!0);return}(V=(E=this.videoConfig)==null?void 0:(T=E.callbacks).onDisabledInteractiveClick)==null||V.call(T)}})),this.interactiveSubscription.add(this.interactiveController.events.interactiveContainerFakeRemoved$.subscribe(({type:y,removeAllOpenURI:S})=>{this.store&&y==="container-fake-removed"&&S&&this.store.ui.controls.disabledControls$.remove(El)})),await this.interactiveController.setManifest(this.videoConfig.interactiveData.manifest),(n=(o=this.videoConfig)==null?void 0:o.callbacks)!=null&&n.onInteractiveHistoryChanged){let y=this.interactiveController.getHistoryState();this.subscription.add(y.history$.subscribe(S=>{var k,P,A;S.length&&((A=(P=(k=this.videoConfig)==null?void 0:k.callbacks)==null?void 0:P.onInteractiveHistoryChanged)==null||A.call(P,S))}))}this.uiConfig.features.interactiveTimeIndicator&&this.subscription.add(this.interactiveController.events.noInteraction$.subscribe(()=>{var y,S,k,P;(y=this.microStoresRoot)==null||y.stores.showInteractiveTimeIndicatorTooltip$.set(!0,!0),(P=(S=this.videoConfig)==null?void 0:(k=S.callbacks).onInteractiveTimeIndicatorClick)==null||P.call(k)})),this.interactiveSubscription.add(this.interactiveController.events.error$.subscribe(y=>{this.log({message:y.toString()})}))}catch(a){this.log({message:a.message})}}initPlayer(e,i={}){var o,n,a,s,d,l,p,f,_,u,$,w,y,S,k,P,A,E,T,V,U,G,F,Y,X,oe;if(!Array.isArray(e.videos)||e.videos.length===0&&!e.interactiveData)throw new Error("empty videos");if(this.videoConfig=ru(i5,Qx(e,pe=>pe instanceof HTMLElement?pe:void 0)),this.uiConfig=wg((o=i.ui)!=null?o:{}),this.coreConfig=(n=i.core)!=null?n:{configName:[]},this.statisticsConfig=(a=i.statistics)!=null?a:{},this.uiConfig.features.forcePlayerDisplayBlock&&(this.rootContainer.style.minHeight="unset",this.style.display="block",this.style.width="100%",this.style.height="100%"),this.sentry={config:(s=this.uiConfig.sentry)!=null?s:{}},this.uiConfig.features.exposeInternalsToGlobal&&((d=this.internalsExposure)!=null||(this.internalsExposure=new Xx("UI"))),Md.push("ui",{key:"videoplayer_embed",strings:["new","player_init_player","ads.enable: "+this.uiConfig.ads.enable,"showAds: "+((l=this.videoConfig)==null?void 0:l.showAds)],numbers:[Kx()]}),Vm(this.videoConfig.isMediaSessionEnabled)&&(this.uiConfig.features.mediaSession=(f=(p=this.uiConfig.features.mediaSession)!=null?p:this.videoConfig.isMediaSessionEnabled)!=null?f:!0),Vm(this.videoConfig.isPictureInPictureEnabled)&&(this.uiConfig.features.pip=(u=(_=this.uiConfig.features.pip)!=null?_:this.videoConfig.isPictureInPictureEnabled)!=null?u:!0,this.uiConfig.features.dpip=(w=($=this.uiConfig.features.dpip)!=null?$:this.videoConfig.isPictureInPictureEnabled)!=null?w:!0),this.videoConfig.isTouch=(S=(y=this.uiConfig.isMobile)!=null?y:this.videoConfig.isTouch)!=null?S:this.videoConfig.isMobile,(k=this.videoConfig).autoplay&&(k.autoplay=this.uiConfig.features.autoplay),this.videoConfig.showAds=(P=this.uiConfig.ads.enable)!=null?P:this.videoConfig.showAds,this.videoConfig.adsSlotId=(A=this.uiConfig.ads.slot)!=null?A:this.videoConfig.adsSlotId,this.videoConfig.adsPreviewParam=(E=this.uiConfig.ads.preview)!=null?E:this.videoConfig.adsPreviewParam,this.videoConfig.logoHidden=!((T=this.uiConfig.showLogo)!=null?T:!this.videoConfig.logoHidden),(V=this.videoConfig).canRewindLive&&(V.canRewindLive=this.uiConfig.features.liveRewind),this.videoConfig.supportLink=(U=this.videoConfig.supportLink)!=null?U:this.uiConfig.supportLink,this.videoConfig.showEndScreen=(G=this.uiConfig.features.endScreen)!=null?G:this.videoConfig.showEndScreen,this.videoConfig.showAutoplayNext=(F=this.uiConfig.features.autoplayNext)!=null?F:this.videoConfig.showAutoplayNext,this.videoConfig.showNextPrevButtons=(Y=this.uiConfig.features.nextPrevButtons)!=null?Y:this.videoConfig.showNextPrevButtons,this.currentPlayingVideoIndex=this.videoConfig.videoIndex&&((X=this.videoConfig.videos)!=null&&X[this.videoConfig.videoIndex])?this.videoConfig.videoIndex:0,this.needToRepeatPlaylist=this.videoConfig.repeat,this.uiConfig.features.pip){let pe={enabled:this.videoConfig.pipEnabled};this.uiConfig.features.dpip?this.pictureInPictureApi=nu.getLatestSupportedVersion(pe):this.pictureInPictureApi=new Ys(pe)}this.mediaSessionApi=this.uiConfig.features.mediaSession?new ou:void 0,this.slotsApi=this.uiConfig.features.slots?new Jc:void 0,this.annotationsApi=this.uiConfig.features.annotations?new su(this.uiConfig.features.annotationsInside):void 0,this.annotationsApi&&!this.uiConfig.features.annotationsInside&&this.annotationsApi.init(this.rootContainer),(oe=this.slotsApi)==null||oe.init(this.shadowRootContainer),this.unmountComponent(this.svelteStubComponent),this.unmountComponent(this.svelteRootComponent),this.isInited=!1,this.prevIsid=void 0,this.interactiveController&&(this.interactiveController.destroy(),this.interactiveController=void 0,this.interactiveSubscription.unsubscribe()),this.videoConfig.interactiveData?this.initInteractives():this.createPlayer(this.videoConfig.videos[this.currentPlayingVideoIndex]),_1(this.pictureInPictureApi)&&this.pictureInPictureApi.setPlayerDomElement(this.playerContainer,this._shadowRoot)}isOneVideoPlaylist(){return this.videoConfig?this.videoConfig.videos.length===1:!1}updateVideos(e,i){if(!this.videoConfig)return;this.log({message:`update ${i} videos, videos: ${JSON.stringify(e)}`}),i==="prev"?(this.videoConfig.videos.splice(0,this.currentPlayingVideoIndex),this.videoConfig.videos.unshift(...e),this.currentPlayingVideoIndex=e.length):i==="next"&&(this.videoConfig.videos.splice(this.currentPlayingVideoIndex+1),this.videoConfig.videos.push(...e));let o=this.getNextVideoInfo();r(bn)&&(r(bn).showNextPrevButtons=this.needToShowNextPrevButtons(),r(bn).nextButtonActive=this.isNextButtonActive(),r(bn).prevButtonActive=this.isPrevButtonActive(),r(bn).endScreenVideoTitle=o.nextVideoTitle,r(bn).endScreenVideoThumb=o.nextVideoThumb,r(bn).isOneVideoPlaylist=this.isOneVideoPlaylist())}updatePrevVideos(e){this.updateVideos(e,"prev")}updateNextVideos(e){this.updateVideos(e,"next")}initMediaSession(){var e,i;this.mediaSessionApi&&((e=this.unsubscribePlayerPhaseSubscription)==null||e.call(this),this.mediaSessionApi.clearSubscriptions(),this.unsubscribePlayerPhaseSubscription=(i=this.store)==null?void 0:i.playerPhase.subscribe(o=>{o==="video"?this.setupMediaSessionForVideo():o==="ads"&&this.setupMediaSessionForAds()}))}setupMediaSessionForVideo(){if(!(!this.videoConfig||!this.mediaSessionApi))try{let{title:e,thumbUrl:i}={...this.videoConfig.videos[this.currentPlayingVideoIndex]},o=[["play",()=>this.play()],["pause",()=>this.pause()],["seekto",n=>this.seekTime(n.seekTime)]];this.videoConfig.videos.length>1&&(this.currentPlayingVideoIndex<this.videoConfig.videos.length-1&&o.push(["nexttrack",()=>this.playNextVideo()]),this.currentPlayingVideoIndex>0&&o.push(["previoustrack",()=>this.playPrevVideo()])),this.mediaSessionApi.setMetaData({title:e,thumbUrl:i}),this.mediaSessionApi.updateActionHandlers(o),this.mediaSessionApi.attachToStore(this.store)}catch(e){this.log({message:e.message})}}setupMediaSessionForAds(){if(!(!this.videoConfig||!this.mediaSessionApi))try{let e="\u0420\u0435\u043A\u043B\u0430\u043C\u0430",i=[["play",()=>this.play()],["pause",()=>this.pause()]];this.mediaSessionApi.setMetaData({title:e}),this.mediaSessionApi.updateActionHandlers(i),this.mediaSessionApi.attachToStore(this.store)}catch(e){this.log({message:e.message})}}moveTo(e){this.shadowDOMCallbacksDisabled=!0,e.append(this),this.shadowDOMCallbacksDisabled=!1}play(){var e,i,o,n;this.isControlDisabled("PLAY_BUTTON")||(e=this.store)!=null&&e.playerPhase.is("LiveWaitingStart")||(i=this.store)!=null&&i.playerPhase.is("LiveWaitingRecover")||(o=this.store)!=null&&o.playerPhase.is("LiveWaitingRecord")||(this.log({message:"play"}),(n=this.svelteRootComponent)==null||n.play())}pause(){var e;this.log({message:"pause"}),(e=this.svelteRootComponent)==null||e.pause()}stop(){var e;if(!this.videoConfig)return;this.log({message:"stop"});let i=!!this.interactiveController;i&&(this.interactiveController.destroy(),this.interactiveController=void 0,this.interactiveContainer=void 0,this.interactiveSubscription.unsubscribe()),this.unmountComponent(this.svelteStubComponent),(e=this.mediaSessionApi)==null||e.destroy();let o=this.videoConfig.videos[0];o&&(this.unmountComponent(this.svelteRootComponent),i?(this.videoConfig.autoplay=!1,this.initInteractives()):this.createPlayer(o))}setMuted(e){var i;this.log({message:`set muted, muted: ${e}`}),(i=this.svelteRootComponent)==null||i.setMuted(e)}setPiPEnabled(e){var i,o;(o=(i=this.store)==null?void 0:i.webApi.pictureInPictureApi)==null||o.setEnabled(e)}setVolume(e){var i;this.log({message:`set volume, volume: ${e}`}),(i=this.svelteRootComponent)==null||i.setVolume(e)}setRepeat(e){this.log({message:`set repeat, repeat: ${e}`}),this.needToRepeatPlaylist=e,r(bn)&&(r(bn).needToRepeatPlaylist=this.needToRepeatPlaylist,r(bn).showNextPrevButtons=this.needToShowNextPrevButtons(),r(bn).nextButtonActive=this.isNextButtonActive(),r(bn).prevButtonActive=this.isPrevButtonActive())}seekTime(e){var i;this.isControlDisabled("TIMELINE")||(this.log({message:`seek time, time: ${e}`}),(i=this.svelteRootComponent)==null||i.seekTime(e))}seekEpisodeStartTime(e){var i;this.log({message:`seek episode start time, time: ${e}`}),(i=this.svelteRootComponent)==null||i.seekEpisodeStartTime(e)}returnFocusToEpisodes(){var e;this.log({message:"return focus to episodes button"}),(e=this.svelteRootComponent)==null||e.returnFocusToEpisodes()}setPlaybackRate(e){var i;this.log({message:`set playback rate to: ${e}`}),(i=this.svelteRootComponent)==null||i.setPlaybackRate(e)}setAutoQualityLimits(e){var i,o,n;this.log({message:`set auto quality limitation. Max: ${(i=e.max)!=null?i:"none"}. Min: ${(o=e.min)!=null?o:"none"}`}),(n=this.svelteRootComponent)==null||n.setAutoQualityLimits(e)}addLanguage(e){var i;(i=this.store)==null||i.actions.internal.addLanguage(e)}async setLanguage(e){var i;await((i=this.store)==null?void 0:i.actions.internal.setLanguage(e))}setLiveStart(e){var i,o;this.log({message:"live started"}),(i=this.store)==null||i.actions.internal.setLiveWaitingRecover(!1),(o=this.store)==null||o.actions.internal.setLiveWaitingStart(!1),this.unmountComponent(this.svelteRootComponent),this.createPlayer(e,{autoplay:!0})}setLiveWaitingStart(){var e;this.log({message:"live waiting"}),(e=this.store)==null||e.actions.internal.setLiveWaitingStart(!0)}setLiveWaitingRecover(){var e;this.log({message:"live waiting recover"}),(e=this.store)!=null&&e.callbacks&&(this.store.callbacks.onLiveEnded=()=>{var i,o;(i=this.store)==null||i.actions.internal.setLiveWaitingRecover(!0),(o=this.store)==null||o.destroy()})}setLiveWaitingRecord(){var e;this.log({message:"post live"}),(e=this.store)!=null&&e.callbacks&&(this.store.callbacks.onLiveEnded=()=>{var i,o;(i=this.store)==null||i.actions.internal.setLiveWaitingRecord(!0),(o=this.store)==null||o.destroy()})}setLiveEnd(e){var i;this.log({message:"live ended"}),(i=this.store)!=null&&i.callbacks&&(this.store.callbacks.onLiveEnded=()=>{var o,n;(o=this.store)==null||o.actions.internal.setLiveWaitingRecover(!1),(n=this.store)==null||n.actions.internal.setLiveWaitingRecord(!1),this.unmountComponent(this.svelteRootComponent),this.createPlayer(e,{autoplay:!1})})}setLiveLowLatency(e){var i;this.log({message:"live switch to low latency "+e}),(i=this.store)==null||i.actions.external.setLiveLowLatency(e)}getDebugData(){var e,i;return(i=(e=this.store)==null?void 0:e.actions.internal.getDebugTextData())!=null?i:""}getDeviceId(){var e,i;return(i=(e=this.statistics)==null?void 0:e.oneStat.getDeviceId())!=null?i:void 0}replayInteractiveVideo(){this.interactiveController&&this.interactiveController.setChapter()}async replayInteractiveChapter(e){var i,o;if(this.interactiveController&&((i=this.store)!=null&&i.state.positionExact$)){let n=ye(this.store.state.positionExact$),s=ye(this.store.state.interactiveEpisodes$).find(l=>!l.completed);this.interactiveController.events.playerChanged$.pipe(Zx()).subscribe(()=>{s&&n>=s.time?this.seekTime(s.time):this.seekTime(n),e==null||e()});let d=this.interactiveController.getCurrentChapter();await this.interactiveController.setChapter({chapterId:(o=d==null?void 0:d.chapter)==null?void 0:o.id,pushToHistory:!1})}}showInteractiveIndicatorTooltip(e,i=!1){var o;(o=this.microStoresRoot)==null||o.stores.showInteractiveTimeIndicatorTooltip$.set(e,i)}switchToActiveLive(){var e;(e=this.store)==null||e.actions.internal.switchToActiveLive()}updateAdditionalSettingsItem(e,i){var o;(o=this.store)==null||o.actions.external.updateAdditionalSettingsItem(e,i)}addAdditionalSettingsItem(e){var i;(i=this.store)==null||i.actions.external.addAdditionalSettingsItem(e)}removeAdditionalSettingsItem(e){var i;(i=this.store)==null||i.actions.external.removeAdditionalSettingsItem(e)}updateAdditionalContextItem(e,i){var o;(o=this.store)==null||o.actions.external.updateAdditionalContextItem(e,i)}addAdditionalContextItem(e){var i;(i=this.store)==null||i.actions.external.addAdditionalContextItem(e)}removeAdditionalContextItem(e){var i;(i=this.store)==null||i.actions.external.removeAdditionalContextItem(e)}updateAdditionalButton(e,i){var o;(o=this.store)==null||o.actions.external.updateAdditionalButton(e,i)}addAdditionalButton(e){var i;(i=this.store)==null||i.actions.external.addAdditionalButton(e)}removeAdditionalButton(e){var i;(i=this.store)==null||i.actions.external.removeAdditionalButton(e)}updateStatContext(e){this.statistics&&this.statistics.oneStat.updateContext(e)}handleTimerNextVideo(e){var i;(i=this.store)==null||i.actions.internal.setTimerNextVideoRunning(e)}focus(){var e,i,o;(o=(i=(e=this.svelteRootComponent)==null?void 0:e.keyboardControls)==null?void 0:i.focus)==null||o.call(i)}unmountComponent(e){e&&Us(e)}};import{InterfaceLanguage as vZ,VKNumericLanguage as gZ,loadVKLangPack as hZ}from"@vkontakte/videoplayer-shared/es2018";import{VideoQuality as bZ,VideoFormat as $Z}from"@vkontakte/videoplayer-core/es2018";var aZ=()=>{window.customElements.define("vk-video-player",du)};export{Uc as ControlButtonType,Ur as GridTypes,vZ as InterfaceLanguage,Dl as MenuItemType,Gs as PlayerPhase,Da as VERSION,gZ as VKNumericLanguage,$Z as VideoFormat,bZ as VideoQuality,hZ as loadVKLangPack,aZ as registerPlayerWebComponent};
|