@halibegic/react-video-player 0.0.49 → 0.0.51
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/README.md +7 -6
- package/dist/react-video-player.es.js +1415 -1217
- package/dist/react-video-player.es.js.map +1 -1
- package/dist/react-video-player.umd.js +10 -10
- package/dist/react-video-player.umd.js.map +1 -1
- package/dist/src/components/live-player/live-player-activity-listener.d.ts +5 -0
- package/dist/src/components/live-player/live-player-event-check.d.ts +4 -4
- package/dist/src/components/live-player/live-player-tech.d.ts +2 -3
- package/dist/src/components/live-player.d.ts +5 -5
- package/dist/src/components/player/player-activity-listener.d.ts +10 -0
- package/dist/src/components/player/player-hls-engine.d.ts +2 -3
- package/dist/src/components/player/player-tech.d.ts +2 -3
- package/dist/src/components/vod-player/vod-player-activity-listener.d.ts +5 -0
- package/dist/src/stores/player-store.d.ts +2 -0
- package/dist/src/types/player.d.ts +4 -1
- package/dist/src/utils/date-time.d.ts +6 -3
- package/dist/src/utils/url.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
`+
|
|
3
|
-
`),J=
|
|
4
|
-
`),
|
|
5
|
-
`+
|
|
1
|
+
(function(j,f){typeof exports=="object"&&typeof module!="undefined"?f(exports,require("react"),require("zustand"),require("mitt"),require("hls.js"),require("@radix-ui/react-slider"),require("@radix-ui/react-popover"),require("@radix-ui/react-scroll-area")):typeof define=="function"&&define.amd?define(["exports","react","zustand","mitt","hls.js","@radix-ui/react-slider","@radix-ui/react-popover","@radix-ui/react-scroll-area"],f):(j=typeof globalThis!="undefined"?globalThis:j||self,f(j.ReactVideoPlayer={},j.React,j.zustand,j.Mitt,j.Hls,j.RadixUISlider,j.RadixUIPopover,j.RadixUIScrollArea))})(this,(function(j,f,Y,te,$,ln,un,dn){"use strict";var wo=Object.defineProperty,Co=Object.defineProperties;var To=Object.getOwnPropertyDescriptors;var Ve=Object.getOwnPropertySymbols;var an=Object.prototype.hasOwnProperty,cn=Object.prototype.propertyIsEnumerable;var sn=(j,f,Y)=>f in j?wo(j,f,{enumerable:!0,configurable:!0,writable:!0,value:Y}):j[f]=Y,F=(j,f)=>{for(var Y in f||(f={}))an.call(f,Y)&&sn(j,Y,f[Y]);if(Ve)for(var Y of Ve(f))cn.call(f,Y)&&sn(j,Y,f[Y]);return j},pe=(j,f)=>Co(j,To(f));var re=(j,f)=>{var Y={};for(var te in j)an.call(j,te)&&f.indexOf(te)<0&&(Y[te]=j[te]);if(j!=null&&Ve)for(var te of Ve(j))f.indexOf(te)<0&&cn.call(j,te)&&(Y[te]=j[te]);return Y};function Ae(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const xe=Ae(ln),ve=Ae(un),Re=Ae(dn);function $e(e){var t=this.constructor;return this.then(function(n){return t.resolve(e()).then(function(){return n})},function(n){return t.resolve(e()).then(function(){return t.reject(n)})})}function et(e){var t=this;return new t(function(n,r){if(!(e&&typeof e.length!="undefined"))return r(new TypeError(typeof e+" "+e+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var a=Array.prototype.slice.call(e);if(a.length===0)return n([]);var c=a.length;function u(l,d){if(d&&(typeof d=="object"||typeof d=="function")){var w=d.then;if(typeof w=="function"){w.call(d,function(_){u(l,_)},function(_){a[l]={status:"rejected",reason:_},--c===0&&n(a)});return}}a[l]={status:"fulfilled",value:d},--c===0&&n(a)}for(var i=0;i<a.length;i++)u(i,a[i])})}function tt(e,t){this.name="AggregateError",this.errors=e,this.message=t||""}tt.prototype=Error.prototype;function nt(e){var t=this;return new t(function(n,r){if(!(e&&typeof e.length!="undefined"))return r(new TypeError("Promise.any accepts an array"));var a=Array.prototype.slice.call(e);if(a.length===0)return r();for(var c=[],u=0;u<a.length;u++)try{t.resolve(a[u]).then(n).catch(function(i){c.push(i),c.length===a.length&&r(new tt(c,"All promises were rejected"))})}catch(i){r(i)}})}var fn=setTimeout;function rt(e){return!!(e&&typeof e.length!="undefined")}function hn(){}function mn(e,t){return function(){e.apply(t,arguments)}}function V(e){if(!(this instanceof V))throw new TypeError("Promises must be constructed via new");if(typeof e!="function")throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],it(e,this)}function ot(e,t){for(;e._state===3;)e=e._value;if(e._state===0){e._deferreds.push(t);return}e._handled=!0,V._immediateFn(function(){var n=e._state===1?t.onFulfilled:t.onRejected;if(n===null){(e._state===1?Oe:ye)(t.promise,e._value);return}var r;try{r=n(e._value)}catch(a){ye(t.promise,a);return}Oe(t.promise,r)})}function Oe(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&(typeof t=="object"||typeof t=="function")){var n=t.then;if(t instanceof V){e._state=3,e._value=t,He(e);return}else if(typeof n=="function"){it(mn(n,t),e);return}}e._state=1,e._value=t,He(e)}catch(r){ye(e,r)}}function ye(e,t){e._state=2,e._value=t,He(e)}function He(e){e._state===2&&e._deferreds.length===0&&V._immediateFn(function(){e._handled||V._unhandledRejectionFn(e._value)});for(var t=0,n=e._deferreds.length;t<n;t++)ot(e,e._deferreds[t]);e._deferreds=null}function pn(e,t,n){this.onFulfilled=typeof e=="function"?e:null,this.onRejected=typeof t=="function"?t:null,this.promise=n}function it(e,t){var n=!1;try{e(function(r){n||(n=!0,Oe(t,r))},function(r){n||(n=!0,ye(t,r))})}catch(r){if(n)return;n=!0,ye(t,r)}}V.prototype.catch=function(e){return this.then(null,e)},V.prototype.then=function(e,t){var n=new this.constructor(hn);return ot(this,new pn(e,t,n)),n},V.prototype.finally=$e,V.all=function(e){return new V(function(t,n){if(!rt(e))return n(new TypeError("Promise.all accepts an array"));var r=Array.prototype.slice.call(e);if(r.length===0)return t([]);var a=r.length;function c(i,l){try{if(l&&(typeof l=="object"||typeof l=="function")){var d=l.then;if(typeof d=="function"){d.call(l,function(w){c(i,w)},n);return}}r[i]=l,--a===0&&t(r)}catch(w){n(w)}}for(var u=0;u<r.length;u++)c(u,r[u])})},V.any=nt,V.allSettled=et,V.resolve=function(e){return e&&typeof e=="object"&&e.constructor===V?e:new V(function(t){t(e)})},V.reject=function(e){return new V(function(t,n){n(e)})},V.race=function(e){return new V(function(t,n){if(!rt(e))return n(new TypeError("Promise.race accepts an array"));for(var r=0,a=e.length;r<a;r++)V.resolve(e[r]).then(t,n)})},V._immediateFn=typeof setImmediate=="function"&&function(e){setImmediate(e)}||function(e){fn(e,0)},V._unhandledRejectionFn=function(t){typeof console!="undefined"&&console&&console.warn("Possible Unhandled Promise Rejection:",t)};var ae=(function(){if(typeof self!="undefined")return self;if(typeof window!="undefined")return window;if(typeof global!="undefined")return global;throw new Error("unable to locate global object")})();typeof ae.Promise!="function"?ae.Promise=V:(ae.Promise.prototype.finally||(ae.Promise.prototype.finally=$e),ae.Promise.allSettled||(ae.Promise.allSettled=et),ae.Promise.any||(ae.Promise.any=nt));var Se={exports:{}},ge={};var st;function vn(){if(st)return ge;st=1;var e=f,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,a=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function u(i,l,d){var w,_={},g=null,E=null;d!==void 0&&(g=""+d),l.key!==void 0&&(g=""+l.key),l.ref!==void 0&&(E=l.ref);for(w in l)r.call(l,w)&&!c.hasOwnProperty(w)&&(_[w]=l[w]);if(i&&i.defaultProps)for(w in l=i.defaultProps,l)_[w]===void 0&&(_[w]=l[w]);return{$$typeof:t,type:i,key:g,ref:E,props:_,_owner:a.current}}return ge.Fragment=n,ge.jsx=u,ge.jsxs=u,ge}var we={};var at;function yn(){return at||(at=1,process.env.NODE_ENV!=="production"&&(function(){var e=f,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),i=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),w=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),E=Symbol.for("react.offscreen"),k=Symbol.iterator,x="@@iterator";function C(o){if(o===null||typeof o!="object")return null;var m=k&&o[k]||o[x];return typeof m=="function"?m:null}var S=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function L(o){{for(var m=arguments.length,y=new Array(m>1?m-1:0),T=1;T<m;T++)y[T-1]=arguments[T];b("error",o,y)}}function b(o,m,y){{var T=S.ReactDebugCurrentFrame,I=T.getStackAddendum();I!==""&&(m+="%s",y=y.concat([I]));var M=y.map(function(P){return String(P)});M.unshift("Warning: "+m),Function.prototype.apply.call(console[o],console,M)}}var B=!1,O=!1,p=!1,v=!1,U=!1,D;D=Symbol.for("react.module.reference");function H(o){return!!(typeof o=="string"||typeof o=="function"||o===r||o===c||U||o===a||o===d||o===w||v||o===E||B||O||p||typeof o=="object"&&o!==null&&(o.$$typeof===g||o.$$typeof===_||o.$$typeof===u||o.$$typeof===i||o.$$typeof===l||o.$$typeof===D||o.getModuleId!==void 0))}function N(o,m,y){var T=o.displayName;if(T)return T;var I=m.displayName||m.name||"";return I!==""?y+"("+I+")":y}function Q(o){return o.displayName||"Context"}function K(o){if(o==null)return null;if(typeof o.tag=="number"&&L("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case r:return"Fragment";case n:return"Portal";case c:return"Profiler";case a:return"StrictMode";case d:return"Suspense";case w:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case i:var m=o;return Q(m)+".Consumer";case u:var y=o;return Q(y._context)+".Provider";case l:return N(o,o.render,"ForwardRef");case _:var T=o.displayName||null;return T!==null?T:K(o.type)||"Memo";case g:{var I=o,M=I._payload,P=I._init;try{return K(P(M))}catch(R){return null}}}return null}var G=Object.assign,se=0,fe,ne,X,_e,Ht,Ut,Bt;function Wt(){}Wt.__reactDisabledLog=!0;function Yr(){{if(se===0){fe=console.log,ne=console.info,X=console.warn,_e=console.error,Ht=console.group,Ut=console.groupCollapsed,Bt=console.groupEnd;var o={configurable:!0,enumerable:!0,value:Wt,writable:!0};Object.defineProperties(console,{info:o,log:o,warn:o,error:o,group:o,groupCollapsed:o,groupEnd:o})}se++}}function Zr(){{if(se--,se===0){var o={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:G({},o,{value:fe}),info:G({},o,{value:ne}),warn:G({},o,{value:X}),error:G({},o,{value:_e}),group:G({},o,{value:Ht}),groupCollapsed:G({},o,{value:Ut}),groupEnd:G({},o,{value:Bt})})}se<0&&L("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Ye=S.ReactCurrentDispatcher,Ze;function De(o,m,y){{if(Ze===void 0)try{throw Error()}catch(I){var T=I.stack.trim().match(/\n( *(at )?)/);Ze=T&&T[1]||""}return`
|
|
2
|
+
`+Ze+o}}var Ke=!1,Ne;{var Kr=typeof WeakMap=="function"?WeakMap:Map;Ne=new Kr}function zt(o,m){if(!o||Ke)return"";{var y=Ne.get(o);if(y!==void 0)return y}var T;Ke=!0;var I=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var M;M=Ye.current,Ye.current=null,Yr();try{if(m){var P=function(){throw Error()};if(Object.defineProperty(P.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(P,[])}catch(q){T=q}Reflect.construct(o,[],P)}else{try{P.call()}catch(q){T=q}o.call(P.prototype)}}else{try{throw Error()}catch(q){T=q}o()}}catch(q){if(q&&T&&typeof q.stack=="string"){for(var R=q.stack.split(`
|
|
3
|
+
`),J=T.stack.split(`
|
|
4
|
+
`),W=R.length-1,z=J.length-1;W>=1&&z>=0&&R[W]!==J[z];)z--;for(;W>=1&&z>=0;W--,z--)if(R[W]!==J[z]){if(W!==1||z!==1)do if(W--,z--,z<0||R[W]!==J[z]){var ee=`
|
|
5
|
+
`+R[W].replace(" at new "," at ");return o.displayName&&ee.includes("<anonymous>")&&(ee=ee.replace("<anonymous>",o.displayName)),typeof o=="function"&&Ne.set(o,ee),ee}while(W>=1&&z>=0);break}}}finally{Ke=!1,Ye.current=M,Zr(),Error.prepareStackTrace=I}var me=o?o.displayName||o.name:"",le=me?De(me):"";return typeof o=="function"&&Ne.set(o,le),le}function Gr(o,m,y){return zt(o,!1)}function Xr(o){var m=o.prototype;return!!(m&&m.isReactComponent)}function Me(o,m,y){if(o==null)return"";if(typeof o=="function")return zt(o,Xr(o));if(typeof o=="string")return De(o);switch(o){case d:return De("Suspense");case w:return De("SuspenseList")}if(typeof o=="object")switch(o.$$typeof){case l:return Gr(o.render);case _:return Me(o.type,m,y);case g:{var T=o,I=T._payload,M=T._init;try{return Me(M(I),m,y)}catch(P){}}}return""}var Ee=Object.prototype.hasOwnProperty,Yt={},Zt=S.ReactDebugCurrentFrame;function Fe(o){if(o){var m=o._owner,y=Me(o.type,o._source,m?m.type:null);Zt.setExtraStackFrame(y)}else Zt.setExtraStackFrame(null)}function Jr(o,m,y,T,I){{var M=Function.call.bind(Ee);for(var P in o)if(M(o,P)){var R=void 0;try{if(typeof o[P]!="function"){var J=Error((T||"React class")+": "+y+" type `"+P+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[P]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw J.name="Invariant Violation",J}R=o[P](m,P,T,y,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(W){R=W}R&&!(R instanceof Error)&&(Fe(I),L("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",T||"React class",y,P,typeof R),Fe(null)),R instanceof Error&&!(R.message in Yt)&&(Yt[R.message]=!0,Fe(I),L("Failed %s type: %s",y,R.message),Fe(null))}}}var Qr=Array.isArray;function Ge(o){return Qr(o)}function qr(o){{var m=typeof Symbol=="function"&&Symbol.toStringTag,y=m&&o[Symbol.toStringTag]||o.constructor.name||"Object";return y}}function $r(o){try{return Kt(o),!1}catch(m){return!0}}function Kt(o){return""+o}function Gt(o){if($r(o))return L("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",qr(o)),Kt(o)}var Xt=S.ReactCurrentOwner,eo={key:!0,ref:!0,__self:!0,__source:!0},Jt,Qt;function to(o){if(Ee.call(o,"ref")){var m=Object.getOwnPropertyDescriptor(o,"ref").get;if(m&&m.isReactWarning)return!1}return o.ref!==void 0}function no(o){if(Ee.call(o,"key")){var m=Object.getOwnPropertyDescriptor(o,"key").get;if(m&&m.isReactWarning)return!1}return o.key!==void 0}function ro(o,m){typeof o.ref=="string"&&Xt.current}function oo(o,m){{var y=function(){Jt||(Jt=!0,L("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",m))};y.isReactWarning=!0,Object.defineProperty(o,"key",{get:y,configurable:!0})}}function io(o,m){{var y=function(){Qt||(Qt=!0,L("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",m))};y.isReactWarning=!0,Object.defineProperty(o,"ref",{get:y,configurable:!0})}}var so=function(o,m,y,T,I,M,P){var R={$$typeof:t,type:o,key:m,ref:y,props:P,_owner:M};return R._store={},Object.defineProperty(R._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(R,"_self",{configurable:!1,enumerable:!1,writable:!1,value:T}),Object.defineProperty(R,"_source",{configurable:!1,enumerable:!1,writable:!1,value:I}),Object.freeze&&(Object.freeze(R.props),Object.freeze(R)),R};function ao(o,m,y,T,I){{var M,P={},R=null,J=null;y!==void 0&&(Gt(y),R=""+y),no(m)&&(Gt(m.key),R=""+m.key),to(m)&&(J=m.ref,ro(m,I));for(M in m)Ee.call(m,M)&&!eo.hasOwnProperty(M)&&(P[M]=m[M]);if(o&&o.defaultProps){var W=o.defaultProps;for(M in W)P[M]===void 0&&(P[M]=W[M])}if(R||J){var z=typeof o=="function"?o.displayName||o.name||"Unknown":o;R&&oo(P,z),J&&io(P,z)}return so(o,R,J,I,T,Xt.current,P)}}var Xe=S.ReactCurrentOwner,qt=S.ReactDebugCurrentFrame;function he(o){if(o){var m=o._owner,y=Me(o.type,o._source,m?m.type:null);qt.setExtraStackFrame(y)}else qt.setExtraStackFrame(null)}var Je;Je=!1;function Qe(o){return typeof o=="object"&&o!==null&&o.$$typeof===t}function $t(){{if(Xe.current){var o=K(Xe.current.type);if(o)return`
|
|
6
6
|
|
|
7
|
-
Check the render method of \``+
|
|
7
|
+
Check the render method of \``+o+"`."}return""}}function co(o){return""}var en={};function lo(o){{var m=$t();if(!m){var y=typeof o=="string"?o:o.displayName||o.name;y&&(m=`
|
|
8
8
|
|
|
9
|
-
Check the top-level render call using <`+
|
|
9
|
+
Check the top-level render call using <`+y+">.")}return m}}function tn(o,m){{if(!o._store||o._store.validated||o.key!=null)return;o._store.validated=!0;var y=lo(m);if(en[y])return;en[y]=!0;var T="";o&&o._owner&&o._owner!==Xe.current&&(T=" It was passed a child from "+K(o._owner.type)+"."),he(o),L('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',y,T),he(null)}}function nn(o,m){{if(typeof o!="object")return;if(Ge(o))for(var y=0;y<o.length;y++){var T=o[y];Qe(T)&&tn(T,m)}else if(Qe(o))o._store&&(o._store.validated=!0);else if(o){var I=C(o);if(typeof I=="function"&&I!==o.entries)for(var M=I.call(o),P;!(P=M.next()).done;)Qe(P.value)&&tn(P.value,m)}}}function uo(o){{var m=o.type;if(m==null||typeof m=="string")return;var y;if(typeof m=="function")y=m.propTypes;else if(typeof m=="object"&&(m.$$typeof===l||m.$$typeof===_))y=m.propTypes;else return;if(y){var T=K(m);Jr(y,o.props,"prop",T,o)}else if(m.PropTypes!==void 0&&!Je){Je=!0;var I=K(m);L("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",I||"Unknown")}typeof m.getDefaultProps=="function"&&!m.getDefaultProps.isReactClassApproved&&L("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function fo(o){{for(var m=Object.keys(o.props),y=0;y<m.length;y++){var T=m[y];if(T!=="children"&&T!=="key"){he(o),L("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",T),he(null);break}}o.ref!==null&&(he(o),L("Invalid attribute `ref` supplied to `React.Fragment`."),he(null))}}var rn={};function on(o,m,y,T,I,M){{var P=H(o);if(!P){var R="";(o===void 0||typeof o=="object"&&o!==null&&Object.keys(o).length===0)&&(R+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var J=co();J?R+=J:R+=$t();var W;o===null?W="null":Ge(o)?W="array":o!==void 0&&o.$$typeof===t?(W="<"+(K(o.type)||"Unknown")+" />",R=" Did you accidentally export a JSX literal instead of a component?"):W=typeof o,L("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",W,R)}var z=ao(o,m,y,I,M);if(z==null)return z;if(P){var ee=m.children;if(ee!==void 0)if(T)if(Ge(ee)){for(var me=0;me<ee.length;me++)nn(ee[me],o);Object.freeze&&Object.freeze(ee)}else L("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else nn(ee,o)}if(Ee.call(m,"key")){var le=K(o),q=Object.keys(m).filter(function(go){return go!=="key"}),qe=q.length>0?"{key: someKey, "+q.join(": ..., ")+": ...}":"{key: someKey}";if(!rn[le+qe]){var yo=q.length>0?"{"+q.join(": ..., ")+": ...}":"{}";L(`A props object containing a "key" prop is being spread into JSX:
|
|
10
10
|
let props = %s;
|
|
11
11
|
<%s {...props} />
|
|
12
12
|
React keys must be passed directly to JSX without using spread:
|
|
13
13
|
let props = %s;
|
|
14
|
-
<%s key={someKey} {...props} />`,Ge,le,ao,le),qt[le+Ge]=!0}}return r===o?no(U):to(U),U}}function ro(r,m,p){return $t(r,m,p,!0)}function oo(r,m,p){return $t(r,m,p,!1)}var io=oo,so=ro;we.Fragment=o,we.jsx=io,we.jsxs=so})()),we}var it;function hn(){return it||(it=1,process.env.NODE_ENV==="production"?Re.exports=dn():Re.exports=fn()),Re.exports}var s=hn();const oe={playerNotice:"_playerNotice_x3acc_1",playerNoticeTitle:"_playerNoticeTitle_x3acc_19",playerNoticeText:"_playerNoticeText_x3acc_28",playerNoticeLowZIndex:"_playerNoticeLowZIndex_x3acc_37"},st=typeof window!="undefined"?f.useLayoutEffect:f.useEffect;function be(e,t){const n=f.useRef(e);st(()=>{n.current=e},[e]),f.useEffect(()=>{if(t===null)return;const o=setInterval(()=>{n.current()},t);return()=>{clearInterval(o)}},[t])}function mn(e){const[,t]=f.useState(0);be(()=>t(n=>n+1),e)}const pn=()=>B.create(e=>({delay:0,startDate:null,viewerCount:null,setDelay:t=>e({delay:t}),setStartDate:t=>e({startDate:t}),setViewerCount:t=>e({viewerCount:t})})),at=f.createContext(null),vn=({children:e})=>{const t=f.useRef(null);return t.current||(t.current=pn()),s.jsx(at.Provider,{value:t.current,children:e})},N=e=>{const t=f.useContext(at);if(!t)throw new Error("usePlayerStore must be used within PlayerStoreProvider");return B.useStore(t,e)};function yn(e,t,n){const o={days:86400,hours:3600,minutes:60,seconds:1,milliseconds:.001};return e*(o[t]/o[n])}function gn(e){return yn(e,"milliseconds","seconds")}const Ce=e=>{if(isNaN(e)||e===1/0)return"0:00";const t=c=>(c<10?"0":"")+c,n=Math.floor(e/3600),o=Math.floor(e%3600/60),a=Math.floor(e%60);return n===0?`${o}:${t(a)}`:`${n}:${t(o)}:${t(a)}`};function wn(e,t){var n,o,a,c,u,i;if(typeof Intl!="undefined"&&Intl.DateTimeFormat)try{const d=new Intl.DateTimeFormat("en-US",{timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).formatToParts(e),y=parseInt(((n=d.find(P=>P.type==="year"))==null?void 0:n.value)||"0",10),g=parseInt(((o=d.find(P=>P.type==="month"))==null?void 0:o.value)||"0",10)-1,w=parseInt(((a=d.find(P=>P.type==="day"))==null?void 0:a.value)||"0",10),k=parseInt(((c=d.find(P=>P.type==="hour"))==null?void 0:c.value)||"0",10),M=parseInt(((u=d.find(P=>P.type==="minute"))==null?void 0:u.value)||"0",10),T=parseInt(((i=d.find(P=>P.type==="second"))==null?void 0:i.value)||"0",10);return new Date(y,g,w,k,M,T)}catch(l){return console.warn(`Failed to convert date to timezone ${t}, returning original date:`,l),e}return console.warn("Intl.DateTimeFormat not available, timezone conversion may be inaccurate"),e}function ct(e){var n;const t=typeof window!="undefined"&&((n=window.navigator)==null?void 0:n.userAgent)||"";return e.test(t)}const lt=ct(/iPhone|iPad|iPod/i),Cn=ct(/Tizen/i);function xn(){const e=document;return!!(e.fullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||e.msFullscreenElement)}function Tn(e){e.requestFullscreen?e.requestFullscreen():e.msRequestFullscreen?e.msRequestFullscreen():e.webkitRequestFullScreen?e.webkitRequestFullScreen():e.webkitEnterFullScreen?e.webkitEnterFullScreen():e.mozRequestFullScreen&&e.mozRequestFullScreen()}function _n(e){e.exitFullscreen?e.exitFullscreen():e.msExitFullscreen?e.msExitFullscreen():e.webkitExitFullscreen?e.webkitExitFullscreen():e.mozCancelFullScreen&&e.mozCancelFullScreen()}function En(e,t){return e.addEventListener("fullscreenchange",t),e.addEventListener("webkitfullscreenchange",t),e.addEventListener("mozfullscreenchange",t),e.addEventListener("MSFullscreenChange",t),()=>{e.removeEventListener("fullscreenchange",t),e.removeEventListener("webkitfullscreenchange",t),e.removeEventListener("mozfullscreenchange",t),e.removeEventListener("MSFullscreenChange",t)}}const Rn=()=>ee(),bn=(e,t)=>({currentTime:0,duration:0,isEnded:!1,isLoading:!1,isLoop:!1,isMetaLoaded:!1,isPlaying:!1,isReady:!1,isStarted:!1,pauseTime:0,seekTime:-1,startTime:-1,volume:100,destroy:()=>{},handleDurationChange:()=>{const n=t().techRef.current;n&&e({duration:n.duration})},handleEnd:()=>{t().techRef.current&&(t().eventEmitter.emit("ended"),e({isEnded:!0,isLoading:!1,isMetaLoaded:!1,isPlaying:!1}))},handleLoadedMetadata:()=>{const n=t().techRef.current;n&&(t().eventEmitter.emit("loadedMetadata",{duration:n.duration}),n.loop=t().isLoop,n.volume=n.muted?0:1,t().startTime!==-1&&(n.currentTime=t().startTime),e({currentTime:t().startTime!==-1?t().startTime:n.currentTime,duration:n.duration,startTime:-1,isMetaLoaded:!0,volume:n.muted?0:100}))},handleLoadStart:()=>{const n=t().techRef.current;n&&(t().eventEmitter.emit("loadStart"),e({isReady:!0}),n.play().then(()=>{e({isEnded:!1,isLoading:!1,isPlaying:!0,isStarted:!0,pauseTime:0})}).catch(()=>{e({isStarted:!1,isEnded:!1,isLoading:!1,isPlaying:!1})}))},handlePause:()=>{t().techRef.current&&(t().eventEmitter.emit("pause"),e({isPlaying:!1,pauseTime:Date.now()}))},handlePlay:()=>{t().techRef.current&&(t().eventEmitter.emit("play"),e({isPlaying:!0,pauseTime:0}))},handlePlaying:()=>{t().techRef.current&&(t().eventEmitter.emit("playing"),e({isLoading:!1}))},handleSeeked:()=>{t().techRef.current&&(t().eventEmitter.emit("seeked"),e({isLoading:!1}))},handleSeeking:()=>{t().techRef.current&&(t().eventEmitter.emit("seeking"),e({isLoading:!0}))},handleTimeUpdate:()=>{const n=t().techRef.current;n&&(t().eventEmitter.emit("timeUpdate",{currentTime:n.currentTime,duration:n.duration}),e({currentTime:n.currentTime}))},handleWaiting:()=>{t().techRef.current&&(t().eventEmitter.emit("waiting"),e({isLoading:!0}))},handleVolumeChange:()=>{const n=t().techRef.current;n&&t().eventEmitter.emit("volumeChange",{volume:n.volume})},handleError:n=>{const o=t().techRef.current;if(!o)return;t().eventEmitter.emit("error",n);const a=o.error;if(!a)return;const c=`${a.code}`,u=a.message||"Unknown error occurred";e({error:{message:u,code:c,tech:"native"}})},pause:()=>{const n=t().techRef.current;n&&(n.pause(),e({isEnded:!1,isPlaying:!1,pauseTime:Date.now()}))},getPauseTimeDiff:()=>!t().isStarted||!t().pauseTime?0:parseInt(gn(Date.now()-t().pauseTime).toFixed(0)),play:()=>{const n=t().techRef.current;n&&n.play().then(()=>{e({isEnded:!1,isLoading:!1,isPlaying:!0,isStarted:!0,pauseTime:0})}).catch(()=>{e({isStarted:!1,isEnded:!1,isLoading:!1,isPlaying:!1})})},seek:n=>{const o=t().techRef.current;o&&(o.currentTime=n,(o.paused||o.ended)&&o.play(),e({seekTime:-1,currentTime:n,isStarted:!0,isEnded:!1,isPlaying:!0}))},setIsLoading:n=>e({isLoading:n}),setIsLoop:n=>{const o=t().techRef.current;o&&(o.loop=n,e({isLoop:n}))},setStartTime:n=>e({startTime:n}),setVolume:n=>{const o=t().techRef.current;o&&(o.muted=n===0,o.volume=n/100,e({volume:n}))},stop:()=>{t().techRef.current&&e({isPlaying:!1,isLoading:!1})}}),Sn=(e,t)=>({isIdle:!1,setIsIdle:n=>e({isIdle:n}),resetIdle:()=>t().eventEmitter.emit("resetIdle")}),jn=e=>({idleLocks:new Set,addIdleLock:t=>e(n=>({idleLocks:new Set(n.idleLocks).add(t)})),removeIdleLock:t=>e(n=>{const o=new Set(n.idleLocks);return o.delete(t),{idleLocks:o}})}),Pn=(e,t)=>({level:null,levels:null,setLevels:n=>e({levels:n}),setLevel:n=>{n&&t().eventEmitter.emit("qualityChange",{level:n}),e({level:n})}}),Ln=(e,t)=>({isFullscreen:!1,isFullscreenReady:!1,exitFullscreen:()=>{t().eventEmitter.emit("fullscreenChange",{isFullscreen:!1}),_n(document),e({isFullscreen:!1})},requestFullscreen:()=>{const n=t().techRef.current,o=t().containerRef.current;if(!n||!o)return;t().eventEmitter.emit("fullscreenChange",{isFullscreen:!0});const a=lt?n:o;a&&Tn(a),e({isFullscreen:!0})},setIsFullscreen:n=>e({isFullscreen:n}),setIsFullscreenReady:n=>e({isFullscreenReady:n})}),kn=e=>({error:null,setError:t=>e({error:t})}),In=()=>({eventEmitter:Rn()}),Dn=e=>()=>L({},e),Mn=(e,t)=>B.create()((...n)=>L(L(L(L(L(L(L(L({},bn(...n)),Sn(...n)),jn(...n)),Ln(...n)),Pn(...n)),kn(...n)),In(...n)),Dn({techRef:e,containerRef:t})(...n))),ut=f.createContext(null);function Fn({children:e}){const t=f.useRef(null),n=f.useRef(null),o=f.useRef(null);return t.current||(t.current=Mn(n,o)),s.jsx(ut.Provider,{value:t.current,children:e})}const h=e=>{const t=f.useContext(ut);if(!t)throw new Error("usePlayerStore must be used within PlayerStoreProvider");return B.useStore(t,e)};function Vn(e){const t=e.split(`
|
|
15
|
-
`);for(const n of t){const
|
|
16
|
-
`);let o=!1;for(const a of n){const c=a.trim();if(c.startsWith("#EXT-X-STREAM-INF:")){o=!0;continue}if(o&&!c.startsWith("#")){if(c.startsWith("http"))return c;{const u=new URL(t);return new URL(c,u.origin+u.pathname.substring(0,u.pathname.lastIndexOf("/"))+"/").toString()}}}return null}function An(e){return e.replace("playlist.m3u8","playlist_fmp4_dvr.m3u8")}async function On(e){try{const t=An(e);console.log("Converting to DVR URL:",t);const n=await fetch(t);if(!n.ok)throw new Error(`Failed to fetch master playlist: ${n.status} ${n.statusText}`);const o=await n.text(),a=Nn(o,t);if(!a)throw new Error("No chunklist URL found in master playlist");console.log("Found chunklist URL:",a);const c=await fetch(a);if(!c.ok)throw new Error(`Failed to fetch chunklist: ${c.status} ${c.statusText}`);const u=await c.text(),i=Vn(u);return i?console.log("Successfully detected start time:",i.toISOString()):console.log(" No start time found in chunklist"),i}catch(t){return console.error("Error getting start time from HLS URL:",t),null}}function Hn(n){var o=n,{url:e}=o,t=re(o,["url"]);const[a,c]=f.useState(!0),u=N(d=>d.startDate),i=N(d=>d.setStartDate),l=f.useCallback(async()=>{const d=await On(e);d&&i(d)},[e,i]);return f.useEffect(()=>{(async()=>{c(!0),await l(),c(!1)})()},[l]),be(l,u?null:5e3),a?null:s.jsx(Un,L({},t))}function Un({children:e,messages:t={}}){var u,i,l;const n=N(d=>d.startDate),o=h(d=>d.isStarted);return mn(o?null:5e3),n?Date.now()<n.getTime()?s.jsx(Bn,{startDate:n,title:(i=t==null?void 0:t.eventNotStarted)!=null?i:"Event has not started yet.",message:(l=t==null?void 0:t.eventStartingSoon)!=null?l:"Starting in few seconds..."}):s.jsx(s.Fragment,{children:e}):s.jsx("div",{className:oe.playerNotice,children:s.jsx("h3",{className:oe.playerNoticeTitle,children:(u=t==null?void 0:t.unableToPlay)!=null?u:"Unable to play the video. Please try again later."})})}function Bn({startDate:e,title:t,message:n}){const o=e.getTime()-Date.now(),a=Math.floor(o/(1e3*60*60)),c=Math.floor(o%(1e3*60*60)/(1e3*60));return a||c?s.jsxs("div",{className:oe.playerNotice,children:[s.jsx("h3",{className:oe.playerNoticeTitle,children:t}),s.jsxs("p",{className:oe.playerNoticeText,children:["(",a>0?`${a}h ${c}m`:`${c}m`,")"]})]}):s.jsx("div",{className:oe.playerNotice,children:s.jsx("h3",{className:oe.playerNoticeTitle,children:n})})}function dt({callback:e}){const t=h(n=>n.eventEmitter);return f.useEffect(()=>{const n=()=>e("play",void 0),o=()=>e("pause",void 0),a=()=>e("ended",void 0),c=()=>e("seeking",void 0),u=()=>e("seeked",void 0),i=T=>e("volumeChange",T),l=T=>e("fullscreenChange",T),d=T=>e("qualityChange",T),y=T=>e("loadedMetadata",T),g=()=>e("loadStart",void 0),w=()=>e("playing",void 0),k=()=>e("waiting",void 0),M=()=>e("error",void 0);return t.on("play",n),t.on("pause",o),t.on("ended",a),t.on("seeking",c),t.on("seeked",u),t.on("volumeChange",i),t.on("fullscreenChange",l),t.on("qualityChange",d),t.on("loadedMetadata",y),t.on("loadStart",g),t.on("playing",w),t.on("waiting",k),t.on("error",M),()=>{t.off("play",n),t.off("pause",o),t.off("ended",a),t.off("seeking",c),t.off("seeked",u),t.off("volumeChange",i),t.off("fullscreenChange",l),t.off("qualityChange",d),t.off("loadedMetadata",y),t.off("loadStart",g),t.off("playing",w),t.off("waiting",k),t.off("error",M)}},[e,t]),null}const ft=(e,t=0)=>parseInt(Math.max(0,(Date.now()-(e+t*1e3))/1e3).toFixed(0)),ht=(e,t)=>Math.max(0,(Date.now()-e-t*1e3)/1e3),zn=(e,t)=>Math.max(0,(t-e)/1e3),Wn=(e,t=0)=>{const o=t<0?0:t,a=["bytes","kb","mb","gb","tb","pb","eb","zb","yb"],c=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,c)).toFixed(o))}${a[c]}`};function Zn({isAuto:e,level:t,levels:n}){const o=n.length,a=[];return o>1&&a.push({sid:"quality-level-auto",label:"Auto",value:-1,selected:e||t===-1}),n.sort(function(c,u){const i=c.height||c.bitrate||0,l=u.height||u.bitrate||0;return i===l?0:i>l?1:-1}),n.map(c=>{const{bitrate:u,height:i,index:l}=c;a.push({sid:`quality-level-${l}`,label:i?`${i}p`:Wn(u),value:l,selected:o===1||!e&&l===t})}),a}function Kn({callback:e}){const t=N(c=>c.delay),n=N(c=>c.startDate),o=n?n.getTime():0,a=h(c=>c.eventEmitter);return f.useEffect(()=>{const c=()=>e("timeUpdate",{currentTime:ht(o,t),duration:-1});return a.on("timeUpdate",c),()=>{a.off("timeUpdate",c)}},[e,a]),s.jsx(dt,{callback:e})}function mt(){const e=h(i=>i.exitFullscreen),t=h(i=>i.isFullscreen),n=h(i=>i.isFullscreenReady),o=h(i=>i.requestFullscreen),a=h(i=>i.setVolume),c=h(i=>i.volume),u=f.useCallback(i=>{let l=!1;if(!(i.target instanceof HTMLInputElement||i.ctrlKey)){switch(i.code){case"ArrowUp":a(c+10<100?c+10:100),l=!0;break;case"ArrowDown":a(c-10>0?c-10:0),l=!0;break;case"KeyM":a(c===0?100:0),l=!0;break;case"KeyF":n&&(t?e():o(),l=!0);break}l&&i.preventDefault()}},[e,t,n,o,a,c]);return f.useEffect(()=>(document.addEventListener("keydown",u),()=>{document.removeEventListener("keydown",u)}),[u]),null}function Yn(){const e=N(i=>i.delay),t=h(i=>i.isPlaying),n=h(i=>i.pause),o=h(i=>i.getPauseTimeDiff),a=h(i=>i.play),c=N(i=>i.setDelay),u=f.useCallback(i=>{let l=!1;if(!(i.target instanceof HTMLInputElement||i.ctrlKey)){switch(i.code){case"ArrowLeft":c(e+10),l=!0;break;case"ArrowRight":c(e-10>0?e-10:0),l=!0;break;case"Space":if(t)n();else{const d=o();d&&c(e+d),a()}l=!0;break}l&&i.preventDefault()}},[e,o,t,n,a,c]);return f.useEffect(()=>(document.addEventListener("keydown",u),()=>{document.removeEventListener("keydown",u)}),[u]),s.jsx(mt,{})}function pt({children:e}){return s.jsx(Fn,{children:e})}function Xn({children:e}){return s.jsx(vn,{children:s.jsx(pt,{children:e})})}function Gn({url:e,isLive:t,messages:n}){const o=f.useRef(null),a=h(x=>x.level),c=h(x=>x.levels),u=h(x=>x.setLevel),i=h(x=>x.setLevels),l=h(x=>x.techRef),d=h(x=>x.setError),y=f.useRef(0),g=f.useRef(null),w=50,k=1e4,M=f.useCallback(x=>{if(o.current&&(o.current.nextLevel=x,u(null),c)){const V=c.map(v=>pe(L({},v),{selected:v.value===x}));i(V)}},[c,u,i,o]),T=f.useCallback(()=>{o.current&&(console.log("[Player][HLS] MEDIA_ATTACHED"),o.current.loadSource(e))},[e]),P=f.useCallback(()=>{if(!o.current)return;console.log("[Player][HLS] MANIFEST_LOADED"),d(null),g.current&&(clearTimeout(g.current),g.current=null),y.current=0;const x=o.current.levels,V=o.current.currentLevel,v=o.current.autoLevelEnabled;i(Zn({levels:x.map((W,G)=>{const{bitrate:Z,height:O,width:D}=W;return{bitrate:Z,height:O,index:G,width:D}}),level:V,isAuto:v}))},[d,i]),A=f.useCallback((x,V)=>{var v;if(o.current&&V.fatal)switch(V.type){case te.ErrorTypes.NETWORK_ERROR:let W=(v=n==null?void 0:n.unableToPlay)!=null?v:"Unable to play the video. Please try again later.",G="NETWORK_ERROR";console.log("[Player][HLS] NETWORK_ERROR",V),t?(y.current<w&&(g.current&&clearTimeout(g.current),y.current+=1,g.current=setTimeout(()=>{if(o.current)try{console.log("[Player][HLS] Retrying stream..."),o.current.loadSource(e)}catch(Z){console.error("[Player][HLS] Retry failed:",Z)}},k)),G="LIVE_MANIFEST_LOAD_ERROR"):o.current.startLoad(),d({message:W,code:G,tech:"hls"});break;case te.ErrorTypes.MEDIA_ERROR:o.current.recoverMediaError();break}},[t,e,d]),S=f.useCallback(()=>{if(!l.current)return;let x={startLevel:-1,maxBufferSize:30*1024*1024};Cn?(x.backBufferLength=-1,x.enableWorker=!1):t?x.backBufferLength=10:x.backBufferLength=60;try{console.log("[Player][HLS] URL",e),console.log("[Player][HLS] Config",JSON.stringify(x)),console.log("[Player][HLS] Version",te.version),o.current=new te(x),o.current.attachMedia(l.current),o.current.on(te.Events.MEDIA_ATTACHED,T),o.current.on(te.Events.MANIFEST_LOADED,P),o.current.on(te.Events.ERROR,A)}catch(V){throw new Error(`Error initializing Hls: ${V}`)}},[P,T,A,t,l,e]),I=f.useCallback(()=>{o.current&&(o.current.off(te.Events.MEDIA_ATTACHED,T),o.current.off(te.Events.MANIFEST_LOADED,P),o.current.off(te.Events.ERROR,A),o.current.destroy(),o.current=null),g.current&&(clearTimeout(g.current),g.current=null),y.current=0},[P,T,A]);return f.useEffect(()=>{a!==null&&M(a)},[a,M]),f.useEffect(()=>(te.isSupported()&&S(),I),[I,S]),null}const Jn={playerVideo:"_playerVideo_wc0sm_1"};function vt({url:e,isLive:t,isMuted:n=!1,messages:o={}}){const a=h(v=>v.handleDurationChange),c=h(v=>v.handleEnd),u=h(v=>v.handleLoadedMetadata),i=h(v=>v.handleLoadStart),l=h(v=>v.handlePause),d=h(v=>v.handlePlay),y=h(v=>v.handlePlaying),g=h(v=>v.handleSeeked),w=h(v=>v.handleSeeking),k=h(v=>v.handleTimeUpdate),M=h(v=>v.handleWaiting),T=h(v=>v.handleVolumeChange),P=h(v=>v.handleError),A=h(v=>v.techRef),S=f.useRef(null),I=()=>t?{onTimeUpdate:x}:{onDurationChange:a,onSeeked:g,onSeeking:w,onTimeUpdate:x},x=()=>{(!S.current||Date.now()-S.current>=1e3)&&(k(),S.current=Date.now())},V=I();return s.jsxs(s.Fragment,{children:[s.jsx(Gn,{isLive:t,url:e,messages:o}),s.jsx("video",L({ref:A,className:Jn.playerVideo,playsInline:!0,autoPlay:!0,controls:!1,muted:n,preload:"auto",crossOrigin:"anonymous",onEnded:c,onError:P,onLoadedMetadata:u,onLoadStart:i,onPause:l,onPlay:d,onPlaying:y,onWaiting:M,onVolumeChange:T,tabIndex:-1},V))]})}function Qn({url:e,messages:t={}}){const[n,o]=f.useState(null),a=N(u=>u.delay),c=f.useCallback(async()=>{o(a?e.replace("-live","-catchup").replace("playlist.m3u8",`playlist_fmp4_dvr_timeshift-${a}.m3u8`):e)},[a,e]);return f.useEffect(()=>{c()},[c]),n?s.jsx(vt,{url:n,isLive:!0,messages:t}):null}function qn({url:e}){return h(n=>n.isStarted)?s.jsx($n,{url:e}):null}function $n({url:e}){const t=N(c=>c.setViewerCount),n=f.useRef(null),o=c=>{try{return new URL(c).pathname.split("/").filter(d=>d.length>0)[0]||null}catch(u){return console.error("Failed to extract URI from player URL:",u),null}},a=async()=>{var l;const c=o(e);if(!c){console.error("Could not extract URI from URL:",e);return}n.current&&n.current.abort(),n.current=new AbortController;const i=`https://${e.includes("staging")?"stg":"prd"}-fitnessanny.spectar.tv/analytics-api/v1/token-info/uri/${c}`;try{const d=await fetch(i,{signal:n.current.signal});if(!d.ok)throw new Error(`HTTP error! status: ${d.status}`);const g=(l=(await d.json()).count)!=null?l:0;t(g)}catch(d){if(d.name==="AbortError")return;console.error("Failed to fetch viewer count:",d),t(null)}};return f.useEffect(()=>(a(),()=>{n.current&&n.current.abort()}),[e]),be(a,15e3),null}function er(e,{defaultValue:t=!1,initializeWithValue:n=!0}={}){const o=i=>typeof window=="undefined"?t:window.matchMedia(i).matches,[a,c]=f.useState(()=>n?o(e):t);function u(){c(o(e))}return st(()=>{if(typeof window=="undefined")return;const i=window.matchMedia(e);return u(),i.addListener?i.addListener(u):i.addEventListener("change",u),()=>{i.removeListener?i.removeListener(u):i.removeEventListener("change",u)}},[e]),a}const ue={playbackButton:"_playbackButton_lgsgw_1",seekIndicator:"_seekIndicator_lgsgw_23",seekIndicatorLeft:"_seekIndicatorLeft_lgsgw_49",seekIndicatorRight:"_seekIndicatorRight_lgsgw_53",seekIndicatorVisible:"_seekIndicatorVisible_lgsgw_57"},tr=10;function yt(i){var l=i,{className:e,onClick:t,onForwardSeek:n,onBackwardSeek:o,maxForwardTime:a,maxBackwardTime:c}=l,u=re(l,["className","onClick","onForwardSeek","onBackwardSeek","maxForwardTime","maxBackwardTime"]);return er("(pointer: coarse)")?s.jsx(rr,L({className:e,maxForwardTime:a,maxBackwardTime:c,onForwardSeek:n,onBackwardSeek:o},u)):s.jsx(nr,L({className:e,onClick:t},u))}function nr(o){var a=o,{className:e,onClick:t}=a,n=re(a,["className","onClick"]);const c=f.useRef(null),u=h(T=>T.exitFullscreen),i=h(T=>T.isFullscreen),l=h(T=>T.requestFullscreen),d=h(T=>T.resetIdle),y=T=>{k()?(w(),i?u():l()):g(T)},g=T=>{c.current=window.setTimeout(()=>{t==null||t(T),w()},200)},w=()=>{c.current!==null&&(window.clearTimeout(c.current),c.current=null)},k=()=>c.current!==null,M=()=>{d()};return f.useEffect(()=>()=>{w()},[]),s.jsx("button",L({onClick:y,onMouseMove:M,className:[ue.playbackButton,e].filter(Boolean).join(" "),"aria-label":"Player gestures"},n))}function rr(u){var i=u,{className:e,maxForwardTime:t,maxBackwardTime:n,onForwardSeek:o,onBackwardSeek:a}=i,c=re(i,["className","maxForwardTime","maxBackwardTime","onForwardSeek","onBackwardSeek"]);const l=f.useRef(null),d=f.useRef({single:null,indicator:null,accumulate:null}),y=f.useRef(null),g=f.useRef(0),w=f.useRef(null),[k,M]=f.useState({visible:!1,direction:null,time:0}),T=h(v=>v.isIdle),P=h(v=>v.setIsIdle),A=h(v=>v.resetIdle),S=(v,W)=>v<W/2?"backward":"forward",I=v=>{if(!y.current)return;const W=v.changedTouches[0];if(!W)return;const G=Date.now(),Z=y.current.getBoundingClientRect(),O=W.clientX-Z.left,D=W.clientY-Z.top;if(O<0||O>Z.width||D<0||D>Z.height)return;const q=l.current,X=q?G-q.time:1/0,K=S(O,Z.width),se=w.current!==null&&w.current===K&&q!==null&&X<700&&Math.abs(O-q.x)<100;if(q!==null&&w.current===null&&X<300&&Math.abs(O-q.x)<50||se){v.preventDefault(),v.stopPropagation(),d.current.single&&(window.clearTimeout(d.current.single),d.current.single=null),A(),(w.current===null||w.current!==K)&&(g.current=0,w.current=K);const ne=K==="backward"?n:t;g.current=Math.min(g.current+tr,ne!=null?ne:1/0),x(K,g.current),d.current.accumulate&&window.clearTimeout(d.current.accumulate),d.current.accumulate=window.setTimeout(()=>{const Y=g.current;Y>0&&(w.current==="backward"?a==null||a(Y):o==null||o(Y),A()),g.current=0,w.current=null,l.current=null,V(),d.current.accumulate=null},500),l.current={time:G,x:O}}else{l.current={time:G,x:O},d.current.single&&window.clearTimeout(d.current.single);const ne=w.current!==null?700:350;d.current.single=window.setTimeout(()=>{if(w.current===null){d.current.single=null;const Y=T;P(!Y),Y&&A()}l.current=null},ne)}},x=(v,W)=>{W!==0&&(M({visible:!0,direction:v,time:W}),d.current.indicator&&window.clearTimeout(d.current.indicator),d.current.indicator=window.setTimeout(()=>{V()},700))},V=()=>{M({visible:!1,direction:null,time:0}),d.current.indicator&&(window.clearTimeout(d.current.indicator),d.current.indicator=null)};return f.useEffect(()=>()=>{d.current.single&&window.clearTimeout(d.current.single),d.current.indicator&&window.clearTimeout(d.current.indicator),d.current.accumulate&&window.clearTimeout(d.current.accumulate)},[]),s.jsxs(s.Fragment,{children:[s.jsx("button",L({ref:y,onTouchEnd:I,className:[ue.playbackButton,e].filter(Boolean).join(" "),"aria-label":"Player gestures"},c)),k.visible&&s.jsxs("div",{className:`${ue.seekIndicator} ${ue.seekIndicatorVisible} ${k.direction==="backward"?ue.seekIndicatorLeft:ue.seekIndicatorRight}`,children:[k.direction==="backward"?"-":"+",Ce(k.time)]})]})}function or(){const e=h(l=>l.isPlaying),t=h(l=>l.pause),n=h(l=>l.getPauseTimeDiff),o=h(l=>l.play),a=N(l=>l.delay),c=N(l=>l.setDelay),u=N(l=>l.startDate),i=u?u.getTime():0;return s.jsx(yt,{onClick:()=>{if(e)t();else{const l=n();l&&c(a+l),o()}},onBackwardSeek:l=>{const d=a+l;c(d)},onForwardSeek:l=>{const d=Math.max(0,a-l);c(d)},maxBackwardTime:Math.floor(i),maxForwardTime:Math.floor(a)})}const gt={playerButton:"_playerButton_izwqq_1",playerButtonCircle:"_playerButtonCircle_izwqq_42"},ce=f.forwardRef((a,o)=>{var c=a,{shape:e="circle",className:t}=c,n=re(c,["shape","className"]);const u=e==="circle"?gt.playerButtonCircle:"",i=[gt.playerButton,u,t].filter(Boolean).join(" ");return s.jsx("button",L({ref:o,className:i},n))});ce.displayName="PlayerButton";const Se={liveIndicator:"_liveIndicator_1jczn_1",liveIndicatorHasDelay:"_liveIndicatorHasDelay_1jczn_9",liveIndicatorNoDelay:"_liveIndicatorNoDelay_1jczn_13"};function ir(n){var o=n,{message:e}=o,t=re(o,["message"]);const a=N(l=>l.delay),c=N(l=>l.setDelay),u=()=>{a&&c(0)},i=a?`${Se.liveIndicator} ${Se.liveIndicatorHasDelay}`:`${Se.liveIndicator} ${Se.liveIndicatorNoDelay}`;return s.jsxs(ce,pe(L({onClick:u,shape:"square"},t),{children:[s.jsx("div",{className:i}),e||"Live"]}))}function wt(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M6 5H8V19H6V5ZM16 5H18V19H16V5Z"})})}function Ct(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M19.376 12.4161L8.77735 19.4818C8.54759 19.635 8.23715 19.5729 8.08397 19.3432C8.02922 19.261 8 19.1645 8 19.0658V4.93433C8 4.65818 8.22386 4.43433 8.5 4.43433C8.59871 4.43433 8.69522 4.46355 8.77735 4.5183L19.376 11.584C19.6057 11.7372 19.6678 12.0477 19.5146 12.2774C19.478 12.3323 19.4309 12.3795 19.376 12.4161Z"})})}function sr(){const e=h(i=>i.isPlaying),t=h(i=>i.pause),n=h(i=>i.getPauseTimeDiff),o=h(i=>i.play),a=N(i=>i.delay),c=N(i=>i.setDelay),u=()=>{if(e)t();else{const i=n();i&&c(a+i),o()}};return s.jsx(ce,{onClick:u,children:e?s.jsx(wt,{}):s.jsx(Ct,{})})}const ie={progressSlider:"_progressSlider_hwzgf_1",tipContainer:"_tipContainer_hwzgf_7",tipContainerVisible:"_tipContainerVisible_hwzgf_17",tipContainerHidden:"_tipContainerHidden_hwzgf_22",tipContent:"_tipContent_hwzgf_27"},je={sliderRoot:"_sliderRoot_aeak6_1",sliderTrack:"_sliderTrack_aeak6_18",sliderRange:"_sliderRange_aeak6_28",sliderThumb:"_sliderThumb_aeak6_37"},Pe=f.forwardRef((c,a)=>{var u=c,{max:e=100,min:t=0,className:n}=u,o=re(u,["max","min","className"]);return s.jsxs(_e.Root,pe(L({ref:a,min:t,max:e,"aria-label":"Player progress",className:[je.sliderRoot,n].filter(Boolean).join(" "),onKeyDown:i=>i.preventDefault()},o),{children:[s.jsx(_e.Track,{className:je.sliderTrack,children:s.jsx(_e.Range,{className:je.sliderRange})}),s.jsx(_e.Thumb,{className:je.sliderThumb})]}))});Pe.displayName="PlayerSlider";function Le(e){const t=e.getBoundingClientRect();return e.offsetWidth/e.offsetHeight>e.clientWidth/e.clientHeight?{left:t.left*100,right:t.right*100,top:t.top*100,bottom:t.bottom*100,width:t.width*100,height:t.height*100}:t}const xt="vod-player-progress-bar";function ar(){const e=f.useRef(null),t=f.useRef(null),[n,o]=f.useState(0),[a,c]=f.useState(0),[u,i]=f.useState(!1),[l,d]=f.useState(-1),[y,g]=f.useState(-1),w=N(D=>D.delay),k=N(D=>D.startDate),M=k?k.getTime():0,T=new Date().getTime(),P=N(D=>D.setDelay),A=h(D=>D.isPlaying),S=h(D=>D.addIdleLock),I=h(D=>D.removeIdleLock),x=f.useCallback(()=>{o(ht(M,w)),c(zn(M,T))},[w,T,M]),V=parseFloat((a?(y!==-1?y:n)/a*100:0).toFixed(1)),v=D=>{g(a*(D[0]/100)),S(xt)},W=()=>{if(y!==-1){const D=ft(M,y);P(D),g(-1),I(xt)}},G=()=>i(!0),Z=()=>i(!1),O=f.useCallback(D=>{const q=e.current,X=t.current;if(q&&X){const K=Le(q),se=Le(X),fe=(D.pageX||D.clientX)-K.left,ne=fe/K.width;if(ne<0)return;let Y=fe-se.width/2;Y<0&&(Y=0),Y>K.width-se.width&&(Y=-1),X.style.left=Y>-1?`${Y}px`:"auto",X.style.right=Y>-1?"auto":"0px";const xe=a-ne*a;d(xe>0?xe:0)}G()},[a]);return be(()=>x(),A?1e3:null),f.useEffect(()=>{x()},[x]),s.jsxs("div",{className:ie.progressSlider,children:[s.jsx(Pe,{ref:e,value:[V],onPointerLeave:Z,onPointerDown:Z,onPointerMove:O,onValueChange:v,onValueCommit:W,step:.1}),s.jsx("div",{ref:t,className:`${ie.tipContainer} ${u?ie.tipContainerVisible:ie.tipContainerHidden}`,children:s.jsx("p",{className:ie.tipContent,children:`-${Ce(l)}`})})]})}function cr(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M22 12C22 17.5228 17.5229 22 12 22C6.4772 22 2 17.5228 2 12C2 6.47715 6.4772 2 12 2V4C7.5817 4 4 7.58172 4 12C4 16.4183 7.5817 20 12 20C16.4183 20 20 16.4183 20 12C20 9.53614 18.8862 7.33243 17.1346 5.86492L15 8V2L21 2L18.5535 4.44656C20.6649 6.28002 22 8.9841 22 12Z"})})}function lr(){const e=N(a=>a.startDate),t=N(a=>a.setDelay),n=e?e.getTime():0,o=()=>t(ft(n));return s.jsx(ce,{onClick:o,children:s.jsx(cr,{})})}const ke={viewersContainer:"_viewersContainer_z1ihz_1",viewersIndicator:"_viewersIndicator_z1ihz_16",viewersIcon:"_viewersIcon_z1ihz_24",viewersCount:"_viewersCount_z1ihz_28"};function ur(){const e=N(t=>t.viewerCount);return e?s.jsxs("div",{className:ke.viewersContainer,children:[s.jsx("span",{className:ke.viewersIndicator}),s.jsxs("svg",{className:ke.viewersIcon,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[s.jsx("path",{d:"M8 7C9.10457 7 10 6.10457 10 5C10 3.89543 9.10457 3 8 3C6.89543 3 6 3.89543 6 5C6 6.10457 6.89543 7 8 7Z",fill:"currentColor"}),s.jsx("path",{d:"M8 8C5.79086 8 4 9.79086 4 12V13H12V12C12 9.79086 10.2091 8 8 8Z",fill:"currentColor"})]}),s.jsx("span",{className:ke.viewersCount,children:e.toLocaleString()})]}):null}function Tt(){const e=h(n=>n.error);if(!e)return null;const t=e.code==="LIVE_MANIFEST_LOAD_ERROR";return s.jsx("div",{className:`${oe.playerNotice} ${t?oe.playerNoticeLowZIndex:""}`,children:s.jsx("h3",{className:oe.playerNoticeTitle,children:e.message})})}const z={playerContainer:"_playerContainer_146tx_1",controlsTop:"_controlsTop_146tx_12",controlsBottom:"_controlsBottom_146tx_29",controlsContainer:"_controlsContainer_146tx_45",controlsRow:"_controlsRow_146tx_61",controlsSection:"_controlsSection_146tx_68",controlsSectionStart:"_controlsSectionStart_146tx_78",controlsSectionEnd:"_controlsSectionEnd_146tx_82"};function dr(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M16 3H22V9H20V5H16V3ZM2 3H8V5H4V9H2V3ZM20 19V15H22V21H16V19H20ZM4 19H8V21H2V15H4V19Z"})})}function fr(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M18 7H22V9H16V3H18V7ZM8 9H2V7H6V3H8V9ZM18 17V21H16V15H22V17H18ZM8 15V21H6V17H2V15H8Z"})})}function _t(){const e=h(d=>d.containerRef),t=h(d=>d.exitFullscreen),n=h(d=>d.isFullscreen),o=h(d=>d.requestFullscreen),a=h(d=>d.setIsFullscreen),c=h(d=>d.setIsFullscreenReady),u=h(d=>d.techRef),i=f.useCallback(d=>{d.stopPropagation(),a(xn())},[a]),l=()=>{n?t():o()};return f.useEffect(()=>{const d=lt?u.current:e.current;if(d)return En(d,i)},[e,i,u]),f.useEffect(()=>{c(!0)},[c]),s.jsx(ce,{onClick:l,children:n?s.jsx(fr,{}):s.jsx(dr,{})})}const Ue={idleCheckContainer:"_idleCheckContainer_crh2s_1",idleCheckContainerIdle:"_idleCheckContainerIdle_crh2s_5",idleCheckContainerActive:"_idleCheckContainerActive_crh2s_11"},hr=5*1e3;function Et({children:e}){const t=f.useRef(null),n=h(w=>w.isIdle),o=h(w=>w.setIsIdle),a=f.useRef(null),u=h(w=>w.idleLocks).size,i=h(w=>w.eventEmitter),l=f.useCallback(()=>{a.current!==null&&(window.clearTimeout(a.current),a.current=null)},[]),d=f.useCallback(()=>{l(),a.current=window.setTimeout(()=>o(!0),hr)},[l]);f.useEffect(()=>(o(!1),d(),()=>{l()}),[l,d]),f.useEffect(()=>{const w=()=>{o(!1),d()};return i.on("resetIdle",w),()=>{i.off("resetIdle",w)}},[i,o,d]);const y=n&&!u,g=`${Ue.idleCheckContainer} ${y?Ue.idleCheckContainerIdle:Ue.idleCheckContainerActive}`;return s.jsx("div",{ref:t,className:g,children:e})}const mr={spinner:"_spinner_oo4hi_10"};function pr(e){return s.jsx("div",L({className:mr.spinner},e))}function vr(e,t=500){const[n,o]=f.useState(e);return f.useEffect(()=>{const a=window.setTimeout(()=>o(e),t);return()=>{window.clearTimeout(a)}},[e,t]),n}const yr={loadingContainer:"_loadingContainer_v9v7r_1"};function Rt(n){var o=n,{style:e}=o,t=re(o,["style"]);const a=h(u=>u.isLoading);return vr(a,100)?s.jsx("div",pe(L({className:yr.loadingContainer,style:e},t),{children:s.jsx(pr,{})})):null}function gr(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M9.9997 15.1709L19.1921 5.97852L20.6063 7.39273L9.9997 17.9993L3.63574 11.6354L5.04996 10.2212L9.9997 15.1709Z"})})}function wr(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M4 5V19H20V5H4ZM3 3H21C21.5523 3 22 3.44772 22 4V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V4C2 3.44772 2.44772 3 3 3ZM7.5 11.25H9.5V9H11V15H9.5V12.75H7.5V15H6V9H7.5V11.25ZM14.5 10.5V13.5H16C16.2761 13.5 16.5 13.2761 16.5 13V11C16.5 10.7239 16.2761 10.5 16 10.5H14.5ZM13 9H16C17.1046 9 18 9.89543 18 11V13C18 14.1046 17.1046 15 16 15H13V9Z"})})}const de={dropdownMenuContent:"_dropdownMenuContent_b7j6b_1",dropdownMenuItem:"_dropdownMenuItem_b7j6b_83",scrollAreaRoot:"_scrollAreaRoot_b7j6b_125",scrollAreaViewport:"_scrollAreaViewport_b7j6b_133",scrollAreaScrollbar:"_scrollAreaScrollbar_b7j6b_141",scrollAreaThumb:"_scrollAreaThumb_b7j6b_168"},Cr=ve.Root,xr=ve.Trigger,Tr=ve.Portal,bt=f.forwardRef((c,a)=>{var u=c,{sideOffset:e=4,className:t,children:n}=u,o=re(u,["sideOffset","className","children"]);return s.jsx(ve.Content,pe(L({ref:a,sideOffset:e,className:[de.dropdownMenuContent,t].filter(Boolean).join(" "),onOpenAutoFocus:i=>{i.preventDefault()},onCloseAutoFocus:i=>{i.preventDefault()}},o),{children:s.jsxs(Ee.Root,{className:de.scrollAreaRoot,type:"always",scrollHideDelay:0,children:[s.jsx(Ee.Viewport,{className:de.scrollAreaViewport,children:n}),s.jsx(Ee.Scrollbar,{className:de.scrollAreaScrollbar,orientation:"vertical",children:s.jsx(Ee.Thumb,{className:de.scrollAreaThumb})})]})}))});bt.displayName="PlayerMenuContent";const St=f.forwardRef((a,o)=>{var c=a,{className:e,onClick:t}=c,n=re(c,["className","onClick"]);const u=l=>{t==null||t(l)},i=l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),t==null||t(l))};return s.jsx(ve.Close,{asChild:!0,children:s.jsx("div",L({ref:o,className:[de.dropdownMenuItem,e].filter(Boolean).join(" "),role:"menuitem",tabIndex:0,onClick:u,onKeyDown:i},n))})});St.displayName="PlayerMenuItem";const jt="settings";function Pt(){const[e,t]=f.useState(!1),n=h(l=>l.containerRef),o=h(l=>l.addIdleLock),a=h(l=>l.removeIdleLock),c=h(l=>l.levels),u=h(l=>l.setLevel),i=f.useCallback(l=>{t(l),l?o(jt):a(jt)},[o,a]);return s.jsxs(Cr,{open:e,onOpenChange:i,children:[s.jsx(xr,{asChild:!0,children:s.jsx(ce,{children:s.jsx(wr,{})})}),s.jsx(Tr,{container:n.current,children:s.jsx(bt,{side:"top",align:"end",children:c==null?void 0:c.map(l=>s.jsxs(St,{onClick:()=>u(l.value),children:[l.label,l.selected&&s.jsx(gr,{})]},l.sid))})})]})}function _r(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M6.60282 10.0001L10 7.22056V16.7796L6.60282 14.0001H3V10.0001H6.60282ZM2 16.0001H5.88889L11.1834 20.3319C11.2727 20.405 11.3846 20.4449 11.5 20.4449C11.7761 20.4449 12 20.2211 12 19.9449V4.05519C12 3.93977 11.9601 3.8279 11.887 3.73857C11.7121 3.52485 11.3971 3.49335 11.1834 3.66821L5.88889 8.00007H2C1.44772 8.00007 1 8.44778 1 9.00007V15.0001C1 15.5524 1.44772 16.0001 2 16.0001ZM23 12C23 15.292 21.5539 18.2463 19.2622 20.2622L17.8445 18.8444C19.7758 17.1937 21 14.7398 21 12C21 9.26016 19.7758 6.80629 17.8445 5.15557L19.2622 3.73779C21.5539 5.75368 23 8.70795 23 12ZM18 12C18 10.0883 17.106 8.38548 15.7133 7.28673L14.2842 8.71584C15.3213 9.43855 16 10.64 16 12C16 13.36 15.3213 14.5614 14.2842 15.2841L15.7133 16.7132C17.106 15.6145 18 13.9116 18 12Z"})})}function Er(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M13 7.22056L9.60282 10.0001H6V14.0001H9.60282L13 16.7796V7.22056ZM8.88889 16.0001H5C4.44772 16.0001 4 15.5524 4 15.0001V9.00007C4 8.44778 4.44772 8.00007 5 8.00007H8.88889L14.1834 3.66821C14.3971 3.49335 14.7121 3.52485 14.887 3.73857C14.9601 3.8279 15 3.93977 15 4.05519V19.9449C15 20.2211 14.7761 20.4449 14.5 20.4449C14.3846 20.4449 14.2727 20.405 14.1834 20.3319L8.88889 16.0001ZM18.8631 16.5911L17.4411 15.1691C18.3892 14.4376 19 13.2902 19 12.0001C19 10.5697 18.2493 9.31476 17.1203 8.60766L18.5589 7.16906C20.0396 8.26166 21 10.0187 21 12.0001C21 13.8422 20.1698 15.4905 18.8631 16.5911Z"})})}function Rr(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M10 7.22056L6.60282 10.0001H3V14.0001H6.60282L10 16.7796V7.22056ZM5.88889 16.0001H2C1.44772 16.0001 1 15.5524 1 15.0001V9.00007C1 8.44778 1.44772 8.00007 2 8.00007H5.88889L11.1834 3.66821C11.3971 3.49335 11.7121 3.52485 11.887 3.73857C11.9601 3.8279 12 3.93977 12 4.05519V19.9449C12 20.2211 11.7761 20.4449 11.5 20.4449C11.3846 20.4449 11.2727 20.405 11.1834 20.3319L5.88889 16.0001ZM20.4142 12.0001L23.9497 15.5356L22.5355 16.9498L19 13.4143L15.4645 16.9498L14.0503 15.5356L17.5858 12.0001L14.0503 8.46454L15.4645 7.05032L19 10.5859L22.5355 7.05032L23.9497 8.46454L20.4142 12.0001Z"})})}const Lt={volumeContainer:"_volumeContainer_4d6jg_1",volumeSlider:"_volumeSlider_4d6jg_8"},kt="volume";function It(){const e=h(i=>i.setVolume),t=h(i=>i.volume),n=h(i=>i.addIdleLock),o=h(i=>i.removeIdleLock),a=i=>{e(i[0]),n(kt)},c=()=>{o(kt)},u=()=>e(t?0:100);return s.jsxs("div",{className:Lt.volumeContainer,children:[s.jsx(ce,{onClick:u,className:"shrink-0",children:t?t>50?s.jsx(_r,{}):s.jsx(Er,{}):s.jsx(Rr,{})}),s.jsx("div",{className:Lt.volumeSlider,children:s.jsx(Pe,{value:[t],onValueChange:a,onValueCommit:c})})]})}const Dt={version:"0.0.49"};function br(e){return s.jsx(Xn,{children:s.jsx(Sr,L({},e))})}function Sr({url:e,messages:t,onEvent:n}){const o=h(a=>a.containerRef);return f.useEffect(()=>{console.log(`[Player][Live] Version: ${Dt.version}`)},[]),s.jsxs("div",{ref:o,className:z.playerContainer,children:[s.jsxs(Hn,{url:e,messages:{eventNotStarted:t==null?void 0:t.eventNotStarted,eventStartingSoon:t==null?void 0:t.eventStartingSoon,unableToPlay:t==null?void 0:t.unableToPlay},children:[s.jsx(Qn,{url:e,messages:{eventFinished:t==null?void 0:t.eventFinished,unableToPlay:t==null?void 0:t.unableToPlay}}),s.jsx(Tt,{}),s.jsx(Rt,{}),s.jsx(or,{}),s.jsxs(Et,{children:[s.jsx("div",{className:z.controlsTop,children:s.jsx("div",{className:z.controlsContainer,children:s.jsx("div",{className:z.controlsRow,children:s.jsx(ur,{})})})}),s.jsx("div",{className:z.controlsBottom,children:s.jsxs("div",{className:z.controlsContainer,children:[s.jsx(ar,{}),s.jsxs("div",{className:z.controlsRow,children:[s.jsxs("div",{className:`${z.controlsSection} ${z.controlsSectionStart}`,children:[s.jsx(sr,{}),s.jsx(lr,{}),s.jsx(It,{})]}),s.jsxs("div",{className:`${z.controlsSection} ${z.controlsSectionEnd}`,children:[s.jsx(ir,{message:t==null?void 0:t.live}),s.jsx(Pt,{}),s.jsx(_t,{})]})]})]})})]})]}),s.jsx(Yn,{}),s.jsx(qn,{url:e}),n&&s.jsx(Kn,{callback:n})]})}function jr(){const e=h(u=>u.isPlaying),t=h(u=>u.pause),n=h(u=>u.play),o=h(u=>u.currentTime),a=h(u=>u.duration),c=h(u=>u.seek);return s.jsx(yt,{onClick:()=>{e?t():n()},onBackwardSeek:u=>{const i=Math.max(0,o-u);c(i)},onForwardSeek:u=>{const i=Math.min(o+u,a);c(i)},maxBackwardTime:Math.floor(o),maxForwardTime:Math.floor(a-o)})}function Pr(){const e=h(a=>a.isPlaying),t=h(a=>a.pause),n=h(a=>a.play),o=()=>{e?t():n()};return s.jsx(ce,{onClick:o,children:e?s.jsx(wt,{}):s.jsx(Ct,{})})}const Mt="vod-player-progress-bar";function Lr(){const e=f.useRef(null),t=f.useRef(null),[n,o]=f.useState(!1),[a,c]=f.useState(-1),[u,i]=f.useState(-1),l=h(I=>I.currentTime),d=h(I=>I.duration),y=h(I=>I.seek),g=h(I=>I.addIdleLock),w=h(I=>I.removeIdleLock),k=parseFloat((d?(u!==-1?u:l)/d*100:0).toFixed(1)),M=I=>{i(d*(I[0]/100)),g(Mt)},T=()=>{u!==-1&&(y(u),i(-1),w(Mt))},P=()=>o(!0),A=()=>o(!1),S=f.useCallback(I=>{const x=e.current,V=t.current;if(x&&V){const v=Le(x),W=Le(V),G=(I.pageX||I.clientX)-v.left,Z=G/v.width;if(Z<0)return;let O=G-W.width/2;O<0&&(O=0),O>v.width-W.width&&(O=-1),V.style.left=O>-1?`${O}px`:"auto",V.style.right=O>-1?"auto":"0px",c(Z*d)}P()},[d]);return s.jsxs("div",{className:ie.progressSlider,children:[s.jsx(Pe,{ref:e,value:[k],onPointerLeave:A,onPointerDown:A,onPointerMove:S,onValueChange:M,onValueCommit:T,step:.1}),s.jsx("div",{ref:t,className:`${ie.tipContainer} ${n?ie.tipContainerVisible:ie.tipContainerHidden}`,children:s.jsx("p",{className:ie.tipContent,children:Ce(a)})})]})}const Ie={remainingTimeContainer:"_remainingTimeContainer_1yyhb_1",remainingTime:"_remainingTime_1yyhb_1",remainingSeparator:"_remainingSeparator_1yyhb_17"};function kr(){const e=h(n=>n.currentTime),t=h(n=>n.duration);return s.jsxs("div",{className:Ie.remainingTimeContainer,children:[s.jsx("p",{className:Ie.remainingTime,children:Ce(e)}),s.jsx("p",{className:Ie.remainingSeparator}),s.jsx("p",{className:Ie.remainingTime,children:Ce(t)})]})}function Ir({callback:e}){const t=h(n=>n.eventEmitter);return f.useEffect(()=>{const n=o=>e("timeUpdate",o);return t.on("timeUpdate",n),()=>{t.off("timeUpdate",n)}},[e,t]),s.jsx(dt,{callback:e})}function Dr(){const e=h(i=>i.currentTime),t=h(i=>i.duration),n=h(i=>i.isPlaying),o=h(i=>i.pause),a=h(i=>i.play),c=h(i=>i.seek),u=f.useCallback(i=>{let l=!1;if(!(i.target instanceof HTMLInputElement||i.ctrlKey)){switch(i.code){case"ArrowLeft":c(e-10>=0?e-10:0),l=!0;break;case"ArrowRight":c(e+10<t?e+10:t),l=!0;break;case"Space":n?o():a(),l=!0;break}l&&i.preventDefault()}},[e,t,n,o,a,c]);return f.useEffect(()=>(document.addEventListener("keydown",u),()=>{document.removeEventListener("keydown",u)}),[u]),s.jsx(mt,{})}function Mr(e){return s.jsx(pt,{children:s.jsx(Fr,L({},e))})}function Fr({url:e,messages:t,onEvent:n,startTime:o}){const a=h(u=>u.setStartTime),c=h(u=>u.containerRef);return f.useEffect(()=>{o&&a(o)},[o,a]),f.useEffect(()=>{console.log(`[Player][VOD] Version: ${Dt.version}`)},[]),s.jsxs("div",{ref:c,className:z.playerContainer,children:[s.jsx(vt,{url:e,isLive:!1,messages:t}),s.jsx(Tt,{}),s.jsx(Rt,{}),s.jsx(jr,{}),s.jsx(Et,{children:s.jsx("div",{className:z.controlsBottom,children:s.jsxs("div",{className:z.controlsContainer,children:[s.jsx(Lr,{}),s.jsxs("div",{className:z.controlsRow,children:[s.jsxs("div",{className:`${z.controlsSection} ${z.controlsSectionStart}`,children:[s.jsx(Pr,{}),s.jsx(It,{}),s.jsx(kr,{})]}),s.jsxs("div",{className:`${z.controlsSection} ${z.controlsSectionEnd}`,children:[s.jsx(Pt,{}),s.jsx(_t,{})]})]})]})})}),s.jsx(Dr,{}),n&&s.jsx(Ir,{callback:n})]})}R.LivePlayer=br,R.VodPlayer=Mr,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})}));
|
|
14
|
+
<%s key={someKey} {...props} />`,qe,le,yo,le),rn[le+qe]=!0}}return o===r?fo(z):uo(z),z}}function ho(o,m,y){return on(o,m,y,!0)}function mo(o,m,y){return on(o,m,y,!1)}var po=mo,vo=ho;we.Fragment=r,we.jsx=po,we.jsxs=vo})()),we}var ct;function gn(){return ct||(ct=1,process.env.NODE_ENV==="production"?Se.exports=vn():Se.exports=yn()),Se.exports}var s=gn();const lt=typeof window!="undefined"?f.useLayoutEffect:f.useEffect;function Ce(e,t){const n=f.useRef(e);lt(()=>{n.current=e},[e]),f.useEffect(()=>{if(t===null)return;const r=setInterval(()=>{n.current()},t);return()=>{clearInterval(r)}},[t])}function wn(e,t){var n,r,a,c,u,i;if(typeof Intl!="undefined"&&Intl.DateTimeFormat)try{const d=new Intl.DateTimeFormat("en-US",{timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).formatToParts(e),w=parseInt(((n=d.find(C=>C.type==="year"))==null?void 0:n.value)||"0",10),_=parseInt(((r=d.find(C=>C.type==="month"))==null?void 0:r.value)||"0",10)-1,g=parseInt(((a=d.find(C=>C.type==="day"))==null?void 0:a.value)||"0",10),E=parseInt(((c=d.find(C=>C.type==="hour"))==null?void 0:c.value)||"0",10),k=parseInt(((u=d.find(C=>C.type==="minute"))==null?void 0:u.value)||"0",10),x=parseInt(((i=d.find(C=>C.type==="second"))==null?void 0:i.value)||"0",10);return new Date(w,_,g,E,k,x)}catch(l){return console.warn(`Failed to convert date to timezone ${t}, returning original date:`,l),e}return console.warn("Intl.DateTimeFormat not available, timezone conversion may be inaccurate"),e}function Cn(e,t,n){return ut(t.getTime()-e.getTime(),n,"milliseconds")}function Tn(){const e=new Date,t="YYYY-MM-DD HH:mm:ss.SSSSSS",n=(a,c=2)=>String(a).padStart(c,"0"),r={YYYY:String(e.getFullYear()),MM:n(e.getMonth()+1),DD:n(e.getDate()),HH:n(e.getHours()),mm:n(e.getMinutes()),ss:n(e.getSeconds()),SSSSSS:n(e.getMilliseconds(),3)+"000"};return Object.entries(r).reduce((a,[c,u])=>a.replace(c,u),t)}const Te=e=>{if(isNaN(e)||e===1/0)return"0:00";const t=c=>(c<10?"0":"")+c,n=Math.floor(e/3600),r=Math.floor(e%3600/60),a=Math.floor(e%60);return n===0?`${r}:${t(a)}`:`${n}:${t(r)}:${t(a)}`};function _n(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return console.warn("Failed to get time zone, returning default time zone:",e),"Europe/Sarajevo"}}function En(e){return ut(e,"milliseconds","seconds")}function ut(e,t,n){const r={days:86400,hours:3600,minutes:60,seconds:1,milliseconds:.001};return e*(r[t]/r[n])}function dt(e){var n;const t=typeof window!="undefined"&&((n=window.navigator)==null?void 0:n.userAgent)||"";return e.test(t)}const ft=dt(/iPhone|iPad|iPod/i),xn=dt(/Tizen/i);function Rn(){const e=document;return!!(e.fullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||e.msFullscreenElement)}function Sn(e){e.requestFullscreen?e.requestFullscreen():e.msRequestFullscreen?e.msRequestFullscreen():e.webkitRequestFullScreen?e.webkitRequestFullScreen():e.webkitEnterFullScreen?e.webkitEnterFullScreen():e.mozRequestFullScreen&&e.mozRequestFullScreen()}function bn(e){e.exitFullscreen?e.exitFullscreen():e.msExitFullscreen?e.msExitFullscreen():e.webkitExitFullscreen?e.webkitExitFullscreen():e.mozCancelFullScreen&&e.mozCancelFullScreen()}function Pn(e,t){return e.addEventListener("fullscreenchange",t),e.addEventListener("webkitfullscreenchange",t),e.addEventListener("mozfullscreenchange",t),e.addEventListener("MSFullscreenChange",t),()=>{e.removeEventListener("fullscreenchange",t),e.removeEventListener("webkitfullscreenchange",t),e.removeEventListener("mozfullscreenchange",t),e.removeEventListener("MSFullscreenChange",t)}}const Ln=()=>te(),jn=(e,t)=>({currentTime:0,duration:0,isEnded:!1,isLoading:!1,isLoop:!1,isMetaLoaded:!1,isPlaying:!1,isReady:!1,isStarted:!1,pauseTime:0,seekTime:-1,startTime:-1,volume:100,destroy:()=>{t().isStarted&&t().eventEmitter.emit("ended")},handleDurationChange:()=>{const n=t().techRef.current;n&&e({duration:n.duration})},handleEnd:()=>{t().techRef.current&&(t().eventEmitter.emit("ended"),e({isEnded:!0,isLoading:!1,isMetaLoaded:!1,isPlaying:!1}))},handleLoadedMetadata:()=>{const n=t().techRef.current;n&&(t().eventEmitter.emit("loadedMetadata",{duration:n.duration}),n.loop=t().isLoop,n.volume=n.muted?0:1,t().startTime!==-1&&(n.currentTime=t().startTime),e({currentTime:t().startTime!==-1?t().startTime:n.currentTime,duration:n.duration,startTime:-1,isMetaLoaded:!0,volume:n.muted?0:100}))},handleLoadStart:()=>{const n=t().techRef.current;n&&(t().eventEmitter.emit("loadStart"),e({isReady:!0}),n.play().then(()=>{e({isEnded:!1,isLoading:!1,isPlaying:!0,isStarted:!0,pauseTime:0})}).catch(()=>{e({isStarted:!1,isEnded:!1,isLoading:!1,isPlaying:!1})}))},handlePause:()=>{t().techRef.current&&(t().eventEmitter.emit("pause"),e({isPlaying:!1,pauseTime:Date.now()}))},handlePlay:()=>{t().techRef.current&&(t().eventEmitter.emit(t().isStarted&&!t().isEnded?"resume":"play"),e({isPlaying:!0,pauseTime:0}))},handlePlaying:()=>{t().techRef.current&&(t().eventEmitter.emit("playing"),e({isLoading:!1}))},handleSeeked:()=>{t().techRef.current&&(t().eventEmitter.emit("seeked"),e({isLoading:!1}))},handleSeeking:()=>{t().techRef.current&&(t().eventEmitter.emit("seeking"),e({isLoading:!0}))},handleTimeUpdate:()=>{const n=t().techRef.current;n&&(t().eventEmitter.emit("timeUpdate",{currentTime:n.currentTime,duration:n.duration}),e({currentTime:n.currentTime}))},handleWaiting:()=>{t().techRef.current&&(t().eventEmitter.emit("waiting"),e({isLoading:!0}))},handleVolumeChange:()=>{const n=t().techRef.current;n&&t().eventEmitter.emit("volumeChange",{volume:n.volume})},handleError:n=>{const r=t().techRef.current;if(!r)return;t().eventEmitter.emit("error",n);const a=r.error;if(!a)return;const c=`${a.code}`,u=a.message||"Unknown error occurred";e({error:{message:u,code:c,tech:"native"}})},pause:()=>{const n=t().techRef.current;n&&(n.pause(),e({isEnded:!1,isPlaying:!1,pauseTime:Date.now()}))},getPauseTimeDiff:()=>!t().isStarted||!t().pauseTime?0:parseInt(En(Date.now()-t().pauseTime).toFixed(0)),play:()=>{const n=t().techRef.current;n&&n.play().then(()=>{e({isEnded:!1,isLoading:!1,isPlaying:!0,isStarted:!0,pauseTime:0})}).catch(()=>{e({isStarted:!1,isEnded:!1,isLoading:!1,isPlaying:!1})})},restart:()=>{t().eventEmitter.emit("restart")},seek:n=>{const r=t().techRef.current;r&&(r.currentTime=n,(r.paused||r.ended)&&r.play(),e({seekTime:-1,currentTime:n,isStarted:!0,isEnded:!1,isPlaying:!0}))},setIsLoading:n=>e({isLoading:n}),setIsLoop:n=>{const r=t().techRef.current;r&&(r.loop=n,e({isLoop:n}))},setStartTime:n=>e({startTime:n}),setVolume:n=>{const r=t().techRef.current;r&&(r.muted=n===0,r.volume=n/100,e({volume:n}))},stop:()=>{t().techRef.current&&e({isPlaying:!1,isLoading:!1})}}),kn=(e,t)=>({isIdle:!1,setIsIdle:n=>e({isIdle:n}),resetIdle:()=>t().eventEmitter.emit("resetIdle")}),In=e=>({idleLocks:new Set,addIdleLock:t=>e(n=>({idleLocks:new Set(n.idleLocks).add(t)})),removeIdleLock:t=>e(n=>{const r=new Set(n.idleLocks);return r.delete(t),{idleLocks:r}})}),Dn=(e,t)=>({level:null,levels:null,setLevels:n=>e({levels:n}),setLevel:n=>e({level:n}),logLevel:n=>{n&&t().eventEmitter.emit("qualityChange",{level:n})}}),Nn=(e,t)=>({isFullscreen:!1,isFullscreenReady:!1,exitFullscreen:()=>{t().eventEmitter.emit("fullscreenChange",{isFullscreen:!1}),bn(document),e({isFullscreen:!1})},requestFullscreen:()=>{const n=t().techRef.current,r=t().containerRef.current;if(!n||!r)return;t().eventEmitter.emit("fullscreenChange",{isFullscreen:!0});const a=ft?n:r;a&&Sn(a),e({isFullscreen:!0})},setIsFullscreen:n=>e({isFullscreen:n}),setIsFullscreenReady:n=>e({isFullscreenReady:n})}),Mn=e=>({error:null,setError:t=>e({error:t})}),Fn=()=>({eventEmitter:Ln()}),Vn=e=>()=>F({},e),An=(e,t)=>Y.create()((...n)=>F(F(F(F(F(F(F(F({},jn(...n)),kn(...n)),In(...n)),Nn(...n)),Dn(...n)),Mn(...n)),Fn(...n)),Vn({techRef:e,containerRef:t})(...n))),ht=f.createContext(null);function On({children:e}){const t=f.useRef(null),n=f.useRef(null),r=f.useRef(null);return t.current||(t.current=An(n,r)),s.jsx(ht.Provider,{value:t.current,children:e})}const h=e=>{const t=f.useContext(ht);if(!t)throw new Error("usePlayerStore must be used within PlayerStoreProvider");return Y.useStore(t,e)},Ue={version:"0.0.51"},Be=11e3,We={DEBUG:2,INFO:3,WARNING:4};function mt({title:e,id:t,kind:n,delay:r,url:a}){const c=f.useRef(null),u=f.useRef(!1),[i,l]=f.useState(null),d=h(C=>C.eventEmitter),w=h(C=>C.isPlaying),g=(a.includes("staging")?"stg":"prd")==="stg"?"https://collector-staging.spectar.tv/ingest":"https://collector.spectar.tv/ingest";u.current=w;const E=f.useCallback(async({type:C,message:S,level:L=We.INFO,duration:b,valueStr1:B,valueStr2:O})=>{const p={content_kind:n,datetime:{date:Tn(),timezone:_n()},level_num:L,log_source:"fitnessanny_player",capp_version:Ue.version,message:S,target_index:C==="client"?"client_log":"watching_activity_log"};e&&(p.title=e),t&&(p.value_int1=t),B&&(p.value_str1=B),O&&(p.value_str2=O),C==="watch"&&(b&&(p.interval_duration=b),r&&(p.catchup_time=r));const v=await fetch(g,{method:"POST",body:JSON.stringify(p)});if(!v.ok)throw new Error(`HTTP error! status: ${v.status}`)},[g,r,t,n,e]),k=f.useCallback(C=>{c.current=C!=null?C:new Date},[]),x=f.useCallback(async C=>{!C&&c.current&&(C=Cn(c.current,new Date,"milliseconds")),console.log("[Player][Activity]","Watching",C),await E({type:"watch",message:"WATCHING",duration:C})},[E]);return Ce(()=>{x(i),k()},i),f.useEffect(()=>{const C=()=>{l(Be),E({type:"watch",message:"PLAY"}),k()},S=()=>{l(null),E({type:"watch",message:"PAUSE"}),x(),k()},L=()=>{l(Be),E({type:"watch",message:"RESUME"}),k()},b=()=>{l(null),u.current&&(E({type:"watch",message:"STOP"}),x()),l(Be),E({type:"watch",message:"PLAY"}),k()},B=()=>{l(null),E({type:"watch",message:"STOP"}),u.current&&x(),k()},O=({level:v})=>{v&&E({type:"client",message:"QUALITY_CHANGE",level:We.DEBUG,valueStr1:v})},p=v=>{let U="UNKNOWN_ERROR",D="Unknown error occurred";v instanceof MediaError&&(v.code&&(U=`${v.code}`),v.message&&(D=`${v.message}`)),E({type:"client",message:"ERROR",level:We.WARNING,valueStr1:U,valueStr2:D})};return d.on("play",C),d.on("pause",S),d.on("resume",L),d.on("restart",b),d.on("ended",B),d.on("qualityChange",O),d.on("error",p),()=>{d.off("play",C),d.off("pause",S),d.off("resume",L),d.off("restart",b),d.off("ended",B),d.off("qualityChange",O),d.off("error",p)}},[d,E,k,x]),null}const Hn=()=>Y.create(e=>({delay:0,startDate:null,viewerCount:null,setDelay:t=>e({delay:t}),setStartDate:t=>e({startDate:t}),setViewerCount:t=>e({viewerCount:t})})),pt=f.createContext(null),Un=({children:e})=>{const t=f.useRef(null);return t.current||(t.current=Hn()),s.jsx(pt.Provider,{value:t.current,children:e})},A=e=>{const t=f.useContext(pt);if(!t)throw new Error("useLivePlayerStore must be used within PlayerStoreProvider");return Y.useStore(t,e)};function vt(e){try{const n=new URL(e).searchParams,r={};return n.forEach((a,c)=>{r[c]=a}),r}catch(t){return console.error("Invalid URL:",t),{}}}function Bn({url:e}){const{video_id:t}=vt(e),n=A(r=>r.delay);return s.jsx(mt,{kind:n?"catchup":"live",delay:n,url:e,id:t?Number(t):void 0})}const oe={playerNotice:"_playerNotice_x3acc_1",playerNoticeTitle:"_playerNoticeTitle_x3acc_19",playerNoticeText:"_playerNoticeText_x3acc_28",playerNoticeLowZIndex:"_playerNoticeLowZIndex_x3acc_37"};function Wn(e){const[,t]=f.useState(0);Ce(()=>t(n=>n+1),e)}function zn(e){const t=e.split(`
|
|
15
|
+
`);for(const n of t){const r=n.trim();if(r.startsWith("#EXT-X-PROGRAM-DATE-TIME:")){const a=r.replace("#EXT-X-PROGRAM-DATE-TIME:","").trim(),c=new Date(a);if(!isNaN(c.getTime()))return wn(c,"Europe/Sarajevo")}}return null}function Yn(e,t){const n=e.split(`
|
|
16
|
+
`);let r=!1;for(const a of n){const c=a.trim();if(c.startsWith("#EXT-X-STREAM-INF:")){r=!0;continue}if(r&&!c.startsWith("#")){if(c.startsWith("http"))return c;{const u=new URL(t);return new URL(c,u.origin+u.pathname.substring(0,u.pathname.lastIndexOf("/"))+"/").toString()}}}return null}function Zn(e){return e.replace("playlist.m3u8","playlist_fmp4_dvr.m3u8")}async function Kn(e){try{const t=Zn(e);console.log("Converting to DVR URL:",t);const n=await fetch(t);if(!n.ok)throw new Error(`Failed to fetch master playlist: ${n.status} ${n.statusText}`);const r=await n.text(),a=Yn(r,t);if(!a)throw new Error("No chunklist URL found in master playlist");console.log("Found chunklist URL:",a);const c=await fetch(a);if(!c.ok)throw new Error(`Failed to fetch chunklist: ${c.status} ${c.statusText}`);const u=await c.text(),i=zn(u);return i?console.log("Successfully detected start time:",i.toISOString()):console.log(" No start time found in chunklist"),i}catch(t){return console.error("Error getting start time from HLS URL:",t),null}}function Gn(n){var r=n,{url:e}=r,t=re(r,["url"]);const[a,c]=f.useState(!0),u=A(d=>d.startDate),i=A(d=>d.setStartDate),l=f.useCallback(async()=>{const d=await Kn(e);d&&i(d)},[e,i]);return f.useEffect(()=>{(async()=>{c(!0),await l(),c(!1)})()},[l]),Ce(l,u?null:5e3),a?null:s.jsx(Xn,F({},t))}function Xn({children:e,messages:t}){const n=A(u=>u.startDate),r=h(u=>u.isStarted);return Wn(r?null:5e3),n?Date.now()<n.getTime()?s.jsx(Jn,{startDate:n,title:t.eventNotStarted,message:t.eventStartingSoon}):s.jsx(s.Fragment,{children:e}):s.jsx("div",{className:oe.playerNotice,children:s.jsx("h3",{className:oe.playerNoticeTitle,children:t.unableToPlay})})}function Jn({startDate:e,title:t,message:n}){const r=e.getTime()-Date.now(),a=Math.floor(r/(1e3*60*60)),c=Math.floor(r%(1e3*60*60)/(1e3*60));return a||c?s.jsxs("div",{className:oe.playerNotice,children:[s.jsx("h3",{className:oe.playerNoticeTitle,children:t}),s.jsxs("p",{className:oe.playerNoticeText,children:["(",a>0?`${a}h ${c}m`:`${c}m`,")"]})]}):s.jsx("div",{className:oe.playerNotice,children:s.jsx("h3",{className:oe.playerNoticeTitle,children:n})})}function yt({callback:e}){const t=h(n=>n.eventEmitter);return f.useEffect(()=>{const n=()=>e("play",void 0),r=()=>e("pause",void 0),a=()=>e("resume",void 0),c=()=>e("restart",void 0),u=()=>e("ended",void 0),i=()=>e("seeking",void 0),l=()=>e("seeked",void 0),d=S=>e("volumeChange",S),w=S=>e("fullscreenChange",S),_=S=>e("qualityChange",S),g=S=>e("loadedMetadata",S),E=()=>e("loadStart",void 0),k=()=>e("playing",void 0),x=()=>e("waiting",void 0),C=()=>e("error",void 0);return t.on("play",n),t.on("pause",r),t.on("resume",a),t.on("restart",c),t.on("ended",u),t.on("seeking",i),t.on("seeked",l),t.on("volumeChange",d),t.on("fullscreenChange",w),t.on("qualityChange",_),t.on("loadedMetadata",g),t.on("loadStart",E),t.on("playing",k),t.on("waiting",x),t.on("error",C),()=>{t.off("play",n),t.off("pause",r),t.off("resume",a),t.off("restart",c),t.off("ended",u),t.off("seeking",i),t.off("seeked",l),t.off("volumeChange",d),t.off("fullscreenChange",w),t.off("qualityChange",_),t.off("loadedMetadata",g),t.off("loadStart",E),t.off("playing",k),t.off("waiting",x),t.off("error",C)}},[e,t]),null}const gt=(e,t=0)=>parseInt(Math.max(0,(Date.now()-(e+t*1e3))/1e3).toFixed(0)),wt=(e,t)=>Math.max(0,(Date.now()-e-t*1e3)/1e3),Qn=(e,t)=>Math.max(0,(t-e)/1e3),qn=(e,t=0)=>{const r=t<0?0:t,a=["bytes","kb","mb","gb","tb","pb","eb","zb","yb"],c=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,c)).toFixed(r))}${a[c]}`};function $n({isAuto:e,level:t,levels:n}){const r=n.length,a=[];return r>1&&a.push({sid:"quality-level-auto",label:"Auto",value:-1,selected:e||t===-1}),n.sort(function(c,u){const i=c.height||c.bitrate||0,l=u.height||u.bitrate||0;return i===l?0:i>l?1:-1}),n.map(c=>{const{bitrate:u,height:i,index:l}=c;a.push({sid:`quality-level-${l}`,label:i?`${i}p`:qn(u),value:l,selected:r===1||!e&&l===t})}),a}function er({callback:e}){const t=A(c=>c.delay),n=A(c=>c.startDate),r=n?n.getTime():0,a=h(c=>c.eventEmitter);return f.useEffect(()=>{const c=()=>e("timeUpdate",{currentTime:wt(r,t),duration:-1});return a.on("timeUpdate",c),()=>{a.off("timeUpdate",c)}},[e,t,a,r]),s.jsx(yt,{callback:e})}function Ct(){const e=h(i=>i.exitFullscreen),t=h(i=>i.isFullscreen),n=h(i=>i.isFullscreenReady),r=h(i=>i.requestFullscreen),a=h(i=>i.setVolume),c=h(i=>i.volume),u=f.useCallback(i=>{let l=!1;if(!(i.target instanceof HTMLInputElement||i.ctrlKey)){switch(i.code){case"ArrowUp":a(c+10<100?c+10:100),l=!0;break;case"ArrowDown":a(c-10>0?c-10:0),l=!0;break;case"KeyM":a(c===0?100:0),l=!0;break;case"KeyF":n&&(t?e():r(),l=!0);break}l&&i.preventDefault()}},[e,t,n,r,a,c]);return f.useEffect(()=>(document.addEventListener("keydown",u),()=>{document.removeEventListener("keydown",u)}),[u]),null}function tr(){const e=A(i=>i.delay),t=h(i=>i.isPlaying),n=h(i=>i.pause),r=h(i=>i.getPauseTimeDiff),a=h(i=>i.play),c=A(i=>i.setDelay),u=f.useCallback(i=>{let l=!1;if(!(i.target instanceof HTMLInputElement||i.ctrlKey)){switch(i.code){case"ArrowLeft":c(e+10),l=!0;break;case"ArrowRight":c(e-10>0?e-10:0),l=!0;break;case"Space":if(t)n();else{const d=r();d&&c(e+d),a()}l=!0;break}l&&i.preventDefault()}},[e,r,t,n,a,c]);return f.useEffect(()=>(document.addEventListener("keydown",u),()=>{document.removeEventListener("keydown",u)}),[u]),s.jsx(Ct,{})}function Tt({children:e}){return s.jsx(On,{children:e})}function nr({children:e}){return s.jsx(Un,{children:s.jsx(Tt,{children:e})})}function rr({url:e,isLive:t,messages:n}){const r=f.useRef(null),a=h(p=>p.level),c=h(p=>p.levels),u=h(p=>p.setLevel),i=h(p=>p.setLevels),l=h(p=>p.logLevel),d=h(p=>p.techRef),w=h(p=>p.setError),_=f.useRef(0),g=f.useRef(null),E=50,k=1e4,x=f.useCallback(p=>{if(r.current&&(r.current.nextLevel=p,u(null),c)){const v=c.map(U=>pe(F({},U),{selected:U.value===p}));i(v)}},[c,u,i]),C=f.useCallback(()=>{r.current&&(console.log("[Player][HLS] MEDIA_ATTACHED"),r.current.loadSource(e))},[e]),S=f.useCallback(()=>{if(!r.current)return;console.log("[Player][HLS] MANIFEST_LOADED"),w(null),g.current&&(clearTimeout(g.current),g.current=null),_.current=0;const p=r.current.levels,v=r.current.currentLevel,U=r.current.autoLevelEnabled;i($n({levels:p.map((D,H)=>{const{bitrate:N,height:Q,width:K}=D;return{bitrate:N,height:Q,index:H,width:K}}),level:v,isAuto:U}))},[w,i]),L=f.useCallback(()=>{if(!r.current)return;console.log("[Player][HLS] LEVEL_SWITCHED");const p=r.current.levels,v=r.current.currentLevel;if(p[v]?JSON.stringify(p[v]):null){let D="";p[v].height?D=`${p[v].height}p`:p[v].bitrate&&(D=`${p[v].bitrate}bps`),l(D)}},[l]),b=f.useCallback((p,v)=>{if(r.current&&v.fatal){let U,D="UNKNOWN_ERROR";switch(v.type){case $.ErrorTypes.NETWORK_ERROR:U=n.unableToPlay,console.log("[Player][HLS] NETWORK_ERROR",v),t?(_.current<E&&(g.current&&clearTimeout(g.current),_.current+=1,g.current=setTimeout(()=>{if(r.current)try{console.log("[Player][HLS] Retrying stream..."),r.current.loadSource(e)}catch(H){console.error("[Player][HLS] Retry failed:",H)}},k)),D="LIVE_MANIFEST_LOAD_ERROR"):(r.current.startLoad(),D="NETWORK_ERROR"),w({message:U,code:D,tech:"hls"});break;case $.ErrorTypes.MEDIA_ERROR:r.current.recoverMediaError();break}}},[t,e,w,n]),B=f.useCallback(()=>{if(!d.current)return;const p={startLevel:-1,maxBufferSize:30*1024*1024};xn?(p.backBufferLength=-1,p.enableWorker=!1):t?p.backBufferLength=10:p.backBufferLength=60;try{console.log("[Player][HLS] URL",e),console.log("[Player][HLS] Config",JSON.stringify(p)),console.log("[Player][HLS] Version",$.version),r.current=new $(p),r.current.attachMedia(d.current),r.current.on($.Events.MEDIA_ATTACHED,C),r.current.on($.Events.MANIFEST_LOADED,S),r.current.on($.Events.LEVEL_SWITCHED,L),r.current.on($.Events.ERROR,b)}catch(v){throw new Error(`Error initializing Hls: ${v}`)}},[S,C,L,b,t,d,e]),O=f.useCallback(()=>{r.current&&(r.current.off($.Events.MEDIA_ATTACHED,C),r.current.off($.Events.MANIFEST_LOADED,S),r.current.off($.Events.LEVEL_SWITCHED,L),r.current.off($.Events.ERROR,b),r.current.destroy(),r.current=null),g.current&&(clearTimeout(g.current),g.current=null),_.current=0},[L,S,C,b]);return f.useEffect(()=>{a!==null&&x(a)},[a,x]),f.useEffect(()=>($.isSupported()&&B(),O),[O,B]),null}const or={playerVideo:"_playerVideo_wc0sm_1"};function _t({url:e,isLive:t,isMuted:n=!1,messages:r}){const a=h(v=>v.destroy),c=h(v=>v.handleDurationChange),u=h(v=>v.handleEnd),i=h(v=>v.handleLoadedMetadata),l=h(v=>v.handleLoadStart),d=h(v=>v.handlePause),w=h(v=>v.handlePlay),_=h(v=>v.handlePlaying),g=h(v=>v.handleSeeked),E=h(v=>v.handleSeeking),k=h(v=>v.handleTimeUpdate),x=h(v=>v.handleWaiting),C=h(v=>v.handleVolumeChange),S=h(v=>v.handleError),L=h(v=>v.techRef),b=f.useRef(null),B=()=>t?{onTimeUpdate:O}:{onDurationChange:c,onSeeked:g,onSeeking:E,onTimeUpdate:O},O=()=>{(!b.current||Date.now()-b.current>=1e3)&&(k(),b.current=Date.now())},p=B();return f.useEffect(()=>()=>{a()},[a]),s.jsxs(s.Fragment,{children:[s.jsx(rr,{isLive:t,url:e,messages:r}),s.jsx("video",F({ref:L,className:or.playerVideo,playsInline:!0,autoPlay:!0,controls:!1,muted:n,preload:"auto",crossOrigin:"anonymous",onEnded:u,onError:S,onLoadedMetadata:i,onLoadStart:l,onPause:d,onPlay:w,onPlaying:_,onWaiting:x,onVolumeChange:C,tabIndex:-1},p))]})}function ir({url:e,messages:t}){const[n,r]=f.useState(null),a=A(u=>u.delay),c=f.useCallback(async()=>{r(a?e.replace("-live","-catchup").replace("playlist.m3u8",`playlist_fmp4_dvr_timeshift-${a}.m3u8`):e)},[a,e]);return f.useEffect(()=>{const u=requestAnimationFrame(()=>c());return()=>cancelAnimationFrame(u)},[c]),n?s.jsx(_t,{url:n,isLive:!0,messages:t}):null}function sr({url:e}){return h(n=>n.isStarted)?s.jsx(ar,{url:e}):null}function ar({url:e}){const t=A(c=>c.setViewerCount),n=f.useRef(null),r=c=>{try{return new URL(c).pathname.split("/").filter(d=>d.length>0)[0]||null}catch(u){return console.error("Failed to extract URI from player URL:",u),null}},a=f.useCallback(async()=>{var l;const c=r(e);if(!c){console.error("Could not extract URI from URL:",e);return}n.current&&n.current.abort(),n.current=new AbortController;const i=`https://${e.includes("staging")?"stg":"prd"}-fitnessanny.spectar.tv/analytics-api/v1/token-info/uri/${c}`;try{const d=await fetch(i,{signal:n.current.signal});if(!d.ok)throw new Error(`HTTP error! status: ${d.status}`);const _=(l=(await d.json()).count)!=null?l:0;t(_)}catch(d){if(d.name==="AbortError")return;console.error("Failed to fetch viewer count:",d),t(null)}},[t,e]);return f.useEffect(()=>(a(),()=>{n.current&&n.current.abort()}),[a,e]),Ce(a,15e3),null}function cr(e,{defaultValue:t=!1,initializeWithValue:n=!0}={}){const r=i=>typeof window=="undefined"?t:window.matchMedia(i).matches,[a,c]=f.useState(()=>n?r(e):t);function u(){c(r(e))}return lt(()=>{if(typeof window=="undefined")return;const i=window.matchMedia(e);return u(),i.addListener?i.addListener(u):i.addEventListener("change",u),()=>{i.removeListener?i.removeListener(u):i.removeEventListener("change",u)}},[e]),a}const ue={playbackButton:"_playbackButton_lgsgw_1",seekIndicator:"_seekIndicator_lgsgw_23",seekIndicatorLeft:"_seekIndicatorLeft_lgsgw_49",seekIndicatorRight:"_seekIndicatorRight_lgsgw_53",seekIndicatorVisible:"_seekIndicatorVisible_lgsgw_57"},lr=10;function Et(i){var l=i,{className:e,onClick:t,onForwardSeek:n,onBackwardSeek:r,maxForwardTime:a,maxBackwardTime:c}=l,u=re(l,["className","onClick","onForwardSeek","onBackwardSeek","maxForwardTime","maxBackwardTime"]);return cr("(pointer: coarse)")?s.jsx(dr,F({className:e,maxForwardTime:a,maxBackwardTime:c,onForwardSeek:n,onBackwardSeek:r},u)):s.jsx(ur,F({className:e,onClick:t},u))}function ur(r){var a=r,{className:e,onClick:t}=a,n=re(a,["className","onClick"]);const c=f.useRef(null),u=h(x=>x.exitFullscreen),i=h(x=>x.isFullscreen),l=h(x=>x.requestFullscreen),d=h(x=>x.resetIdle),w=x=>{E()?(g(),i?u():l()):_(x)},_=x=>{c.current=window.setTimeout(()=>{t==null||t(x),g()},200)},g=()=>{c.current!==null&&(window.clearTimeout(c.current),c.current=null)},E=()=>c.current!==null,k=()=>{d()};return f.useEffect(()=>()=>{g()},[]),s.jsx("button",F({onClick:w,onMouseMove:k,className:[ue.playbackButton,e].filter(Boolean).join(" "),"aria-label":"Player gestures"},n))}function dr(u){var i=u,{className:e,maxForwardTime:t,maxBackwardTime:n,onForwardSeek:r,onBackwardSeek:a}=i,c=re(i,["className","maxForwardTime","maxBackwardTime","onForwardSeek","onBackwardSeek"]);const l=f.useRef(null),d=f.useRef({single:null,indicator:null,accumulate:null}),w=f.useRef(null),_=f.useRef(0),g=f.useRef(null),[E,k]=f.useState({visible:!1,direction:null,time:0}),x=h(p=>p.isIdle),C=h(p=>p.setIsIdle),S=h(p=>p.resetIdle),L=(p,v)=>p<v/2?"backward":"forward",b=p=>{if(!w.current)return;const v=p.changedTouches[0];if(!v)return;const U=Date.now(),D=w.current.getBoundingClientRect(),H=v.clientX-D.left,N=v.clientY-D.top;if(H<0||H>D.width||N<0||N>D.height)return;const Q=l.current,K=Q?U-Q.time:1/0,G=L(H,D.width),se=g.current!==null&&g.current===G&&Q!==null&&K<700&&Math.abs(H-Q.x)<100;if(Q!==null&&g.current===null&&K<300&&Math.abs(H-Q.x)<50||se){p.preventDefault(),p.stopPropagation(),d.current.single&&(window.clearTimeout(d.current.single),d.current.single=null),S(),(g.current===null||g.current!==G)&&(_.current=0,g.current=G);const ne=G==="backward"?n:t;_.current=Math.min(_.current+lr,ne!=null?ne:1/0),B(G,_.current),d.current.accumulate&&window.clearTimeout(d.current.accumulate),d.current.accumulate=window.setTimeout(()=>{const X=_.current;X>0&&(g.current==="backward"?a==null||a(X):r==null||r(X),S()),_.current=0,g.current=null,l.current=null,O(),d.current.accumulate=null},500),l.current={time:U,x:H}}else{l.current={time:U,x:H},d.current.single&&window.clearTimeout(d.current.single);const ne=g.current!==null?700:350;d.current.single=window.setTimeout(()=>{if(g.current===null){d.current.single=null;const X=x;C(!X),X&&S()}l.current=null},ne)}},B=(p,v)=>{v!==0&&(k({visible:!0,direction:p,time:v}),d.current.indicator&&window.clearTimeout(d.current.indicator),d.current.indicator=window.setTimeout(()=>{O()},700))},O=()=>{k({visible:!1,direction:null,time:0}),d.current.indicator&&(window.clearTimeout(d.current.indicator),d.current.indicator=null)};return f.useEffect(()=>{const p=d.current;return()=>{p!=null&&p.single&&window.clearTimeout(p.single),p!=null&&p.indicator&&window.clearTimeout(p.indicator),p!=null&&p.accumulate&&window.clearTimeout(p.accumulate)}},[]),s.jsxs(s.Fragment,{children:[s.jsx("button",F({ref:w,onTouchEnd:b,className:[ue.playbackButton,e].filter(Boolean).join(" "),"aria-label":"Player gestures"},c)),E.visible&&s.jsxs("div",{className:`${ue.seekIndicator} ${ue.seekIndicatorVisible} ${E.direction==="backward"?ue.seekIndicatorLeft:ue.seekIndicatorRight}`,children:[E.direction==="backward"?"-":"+",Te(E.time)]})]})}function fr(){const e=h(l=>l.isPlaying),t=h(l=>l.pause),n=h(l=>l.getPauseTimeDiff),r=h(l=>l.play),a=A(l=>l.delay),c=A(l=>l.setDelay),u=A(l=>l.startDate),i=u?u.getTime():0;return s.jsx(Et,{onClick:()=>{if(e)t();else{const l=n();l&&c(a+l),r()}},onBackwardSeek:l=>{const d=a+l;c(d)},onForwardSeek:l=>{const d=Math.max(0,a-l);c(d)},maxBackwardTime:Math.floor(i),maxForwardTime:Math.floor(a)})}const xt={playerButton:"_playerButton_izwqq_1",playerButtonCircle:"_playerButtonCircle_izwqq_42"},ce=f.forwardRef((a,r)=>{var c=a,{shape:e="circle",className:t}=c,n=re(c,["shape","className"]);const u=e==="circle"?xt.playerButtonCircle:"",i=[xt.playerButton,u,t].filter(Boolean).join(" ");return s.jsx("button",F({ref:r,className:i},n))});ce.displayName="PlayerButton";const be={liveIndicator:"_liveIndicator_1jczn_1",liveIndicatorHasDelay:"_liveIndicatorHasDelay_1jczn_9",liveIndicatorNoDelay:"_liveIndicatorNoDelay_1jczn_13"};function hr(n){var r=n,{message:e}=r,t=re(r,["message"]);const a=h(d=>d.restart),c=A(d=>d.delay),u=A(d=>d.setDelay),i=()=>{c&&(a(),u(0))},l=c?`${be.liveIndicator} ${be.liveIndicatorHasDelay}`:`${be.liveIndicator} ${be.liveIndicatorNoDelay}`;return s.jsxs(ce,pe(F({onClick:i,shape:"square"},t),{children:[s.jsx("div",{className:l}),e||"Live"]}))}function Rt(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M6 5H8V19H6V5ZM16 5H18V19H16V5Z"})})}function St(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M19.376 12.4161L8.77735 19.4818C8.54759 19.635 8.23715 19.5729 8.08397 19.3432C8.02922 19.261 8 19.1645 8 19.0658V4.93433C8 4.65818 8.22386 4.43433 8.5 4.43433C8.59871 4.43433 8.69522 4.46355 8.77735 4.5183L19.376 11.584C19.6057 11.7372 19.6678 12.0477 19.5146 12.2774C19.478 12.3323 19.4309 12.3795 19.376 12.4161Z"})})}function mr(){const e=h(i=>i.isPlaying),t=h(i=>i.pause),n=h(i=>i.getPauseTimeDiff),r=h(i=>i.play),a=A(i=>i.delay),c=A(i=>i.setDelay),u=()=>{if(e)t();else{const i=n();i&&c(a+i),r()}};return s.jsx(ce,{onClick:u,children:e?s.jsx(Rt,{}):s.jsx(St,{})})}const ie={progressSlider:"_progressSlider_hwzgf_1",tipContainer:"_tipContainer_hwzgf_7",tipContainerVisible:"_tipContainerVisible_hwzgf_17",tipContainerHidden:"_tipContainerHidden_hwzgf_22",tipContent:"_tipContent_hwzgf_27"},Pe={sliderRoot:"_sliderRoot_aeak6_1",sliderTrack:"_sliderTrack_aeak6_18",sliderRange:"_sliderRange_aeak6_28",sliderThumb:"_sliderThumb_aeak6_37"},Le=f.forwardRef((c,a)=>{var u=c,{max:e=100,min:t=0,className:n}=u,r=re(u,["max","min","className"]);return s.jsxs(xe.Root,pe(F({ref:a,min:t,max:e,"aria-label":"Player progress",className:[Pe.sliderRoot,n].filter(Boolean).join(" "),onKeyDown:i=>i.preventDefault()},r),{children:[s.jsx(xe.Track,{className:Pe.sliderTrack,children:s.jsx(xe.Range,{className:Pe.sliderRange})}),s.jsx(xe.Thumb,{className:Pe.sliderThumb})]}))});Le.displayName="PlayerSlider";function je(e){const t=e.getBoundingClientRect();return e.offsetWidth/e.offsetHeight>e.clientWidth/e.clientHeight?{left:t.left*100,right:t.right*100,top:t.top*100,bottom:t.bottom*100,width:t.width*100,height:t.height*100}:t}const bt="vod-player-progress-bar";function pr(){const e=f.useRef(null),t=f.useRef(null),[n,r]=f.useState(0),[a,c]=f.useState(0),[u,i]=f.useState(!1),[l,d]=f.useState(-1),[w,_]=f.useState(-1),g=A(N=>N.delay),E=A(N=>N.startDate),k=E?E.getTime():0,x=new Date().getTime(),C=A(N=>N.setDelay),S=h(N=>N.isPlaying),L=h(N=>N.addIdleLock),b=h(N=>N.removeIdleLock),B=f.useCallback(()=>{r(wt(k,g)),c(Qn(k,x))},[g,x,k]),O=parseFloat((a?(w!==-1?w:n)/a*100:0).toFixed(1)),p=N=>{_(a*(N[0]/100)),L(bt)},v=()=>{if(w!==-1){const N=gt(k,w);C(N),_(-1),b(bt)}},U=()=>i(!0),D=()=>i(!1),H=f.useCallback(N=>{const Q=e.current,K=t.current;if(Q&&K){const G=je(Q),se=je(K),fe=(N.pageX||N.clientX)-G.left,ne=fe/G.width;if(ne<0)return;let X=fe-se.width/2;X<0&&(X=0),X>G.width-se.width&&(X=-1),K.style.left=X>-1?`${X}px`:"auto",K.style.right=X>-1?"auto":"0px";const _e=a-ne*a;d(_e>0?_e:0)}U()},[a]);return Ce(()=>B(),S?1e3:null),f.useEffect(()=>{const N=requestAnimationFrame(()=>B());return()=>cancelAnimationFrame(N)},[B]),s.jsxs("div",{className:ie.progressSlider,children:[s.jsx(Le,{ref:e,value:[O],onPointerLeave:D,onPointerDown:D,onPointerMove:H,onValueChange:p,onValueCommit:v,step:.1}),s.jsx("div",{ref:t,className:`${ie.tipContainer} ${u?ie.tipContainerVisible:ie.tipContainerHidden}`,children:s.jsx("p",{className:ie.tipContent,children:`-${Te(l)}`})})]})}function vr(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M22 12C22 17.5228 17.5229 22 12 22C6.4772 22 2 17.5228 2 12C2 6.47715 6.4772 2 12 2V4C7.5817 4 4 7.58172 4 12C4 16.4183 7.5817 20 12 20C16.4183 20 20 16.4183 20 12C20 9.53614 18.8862 7.33243 17.1346 5.86492L15 8V2L21 2L18.5535 4.44656C20.6649 6.28002 22 8.9841 22 12Z"})})}function yr(){const e=A(a=>a.startDate),t=A(a=>a.setDelay),n=e?e.getTime():0,r=()=>t(gt(n));return s.jsx(ce,{onClick:r,children:s.jsx(vr,{})})}const ke={viewersContainer:"_viewersContainer_z1ihz_1",viewersIndicator:"_viewersIndicator_z1ihz_16",viewersIcon:"_viewersIcon_z1ihz_24",viewersCount:"_viewersCount_z1ihz_28"};function gr(){const e=A(t=>t.viewerCount);return e?s.jsxs("div",{className:ke.viewersContainer,children:[s.jsx("span",{className:ke.viewersIndicator}),s.jsxs("svg",{className:ke.viewersIcon,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[s.jsx("path",{d:"M8 7C9.10457 7 10 6.10457 10 5C10 3.89543 9.10457 3 8 3C6.89543 3 6 3.89543 6 5C6 6.10457 6.89543 7 8 7Z",fill:"currentColor"}),s.jsx("path",{d:"M8 8C5.79086 8 4 9.79086 4 12V13H12V12C12 9.79086 10.2091 8 8 8Z",fill:"currentColor"})]}),s.jsx("span",{className:ke.viewersCount,children:e.toLocaleString()})]}):null}function Pt(){const e=h(n=>n.error);if(!e)return null;const t=e.code==="LIVE_MANIFEST_LOAD_ERROR";return s.jsx("div",{className:`${oe.playerNotice} ${t?oe.playerNoticeLowZIndex:""}`,children:s.jsx("h3",{className:oe.playerNoticeTitle,children:e.message})})}const Z={playerContainer:"_playerContainer_146tx_1",controlsTop:"_controlsTop_146tx_12",controlsBottom:"_controlsBottom_146tx_29",controlsContainer:"_controlsContainer_146tx_45",controlsRow:"_controlsRow_146tx_61",controlsSection:"_controlsSection_146tx_68",controlsSectionStart:"_controlsSectionStart_146tx_78",controlsSectionEnd:"_controlsSectionEnd_146tx_82"};function wr(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M16 3H22V9H20V5H16V3ZM2 3H8V5H4V9H2V3ZM20 19V15H22V21H16V19H20ZM4 19H8V21H2V15H4V19Z"})})}function Cr(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M18 7H22V9H16V3H18V7ZM8 9H2V7H6V3H8V9ZM18 17V21H16V15H22V17H18ZM8 15V21H6V17H2V15H8Z"})})}function Lt(){const e=h(d=>d.containerRef),t=h(d=>d.exitFullscreen),n=h(d=>d.isFullscreen),r=h(d=>d.requestFullscreen),a=h(d=>d.setIsFullscreen),c=h(d=>d.setIsFullscreenReady),u=h(d=>d.techRef),i=f.useCallback(d=>{d.stopPropagation(),a(Rn())},[a]),l=()=>{n?t():r()};return f.useEffect(()=>{const d=ft?u.current:e.current;if(d)return Pn(d,i)},[e,i,u]),f.useEffect(()=>{c(!0)},[c]),s.jsx(ce,{onClick:l,children:n?s.jsx(Cr,{}):s.jsx(wr,{})})}const ze={idleCheckContainer:"_idleCheckContainer_crh2s_1",idleCheckContainerIdle:"_idleCheckContainerIdle_crh2s_5",idleCheckContainerActive:"_idleCheckContainerActive_crh2s_11"},Tr=5*1e3;function jt({children:e}){const t=f.useRef(null),n=h(g=>g.isIdle),r=h(g=>g.setIsIdle),a=f.useRef(null),u=h(g=>g.idleLocks).size,i=h(g=>g.eventEmitter),l=f.useCallback(()=>{a.current!==null&&(window.clearTimeout(a.current),a.current=null)},[]),d=f.useCallback(()=>{l(),a.current=window.setTimeout(()=>r(!0),Tr)},[l,r]);f.useEffect(()=>(r(!1),d(),()=>{l()}),[l,r,d]),f.useEffect(()=>{const g=()=>{r(!1),d()};return i.on("resetIdle",g),()=>{i.off("resetIdle",g)}},[i,r,d]);const w=n&&!u,_=`${ze.idleCheckContainer} ${w?ze.idleCheckContainerIdle:ze.idleCheckContainerActive}`;return s.jsx("div",{ref:t,className:_,children:e})}const _r={spinner:"_spinner_oo4hi_10"};function Er(e){return s.jsx("div",F({className:_r.spinner},e))}function xr(e,t=500){const[n,r]=f.useState(e);return f.useEffect(()=>{const a=window.setTimeout(()=>r(e),t);return()=>{window.clearTimeout(a)}},[e,t]),n}const Rr={loadingContainer:"_loadingContainer_v9v7r_1"};function kt(n){var r=n,{style:e}=r,t=re(r,["style"]);const a=h(u=>u.isLoading);return xr(a,100)?s.jsx("div",pe(F({className:Rr.loadingContainer,style:e},t),{children:s.jsx(Er,{})})):null}function Sr(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M9.9997 15.1709L19.1921 5.97852L20.6063 7.39273L9.9997 17.9993L3.63574 11.6354L5.04996 10.2212L9.9997 15.1709Z"})})}function br(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M4 5V19H20V5H4ZM3 3H21C21.5523 3 22 3.44772 22 4V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V4C2 3.44772 2.44772 3 3 3ZM7.5 11.25H9.5V9H11V15H9.5V12.75H7.5V15H6V9H7.5V11.25ZM14.5 10.5V13.5H16C16.2761 13.5 16.5 13.2761 16.5 13V11C16.5 10.7239 16.2761 10.5 16 10.5H14.5ZM13 9H16C17.1046 9 18 9.89543 18 11V13C18 14.1046 17.1046 15 16 15H13V9Z"})})}const de={dropdownMenuContent:"_dropdownMenuContent_b7j6b_1",dropdownMenuItem:"_dropdownMenuItem_b7j6b_83",scrollAreaRoot:"_scrollAreaRoot_b7j6b_125",scrollAreaViewport:"_scrollAreaViewport_b7j6b_133",scrollAreaScrollbar:"_scrollAreaScrollbar_b7j6b_141",scrollAreaThumb:"_scrollAreaThumb_b7j6b_168"},Pr=ve.Root,Lr=ve.Trigger,jr=ve.Portal,It=f.forwardRef((c,a)=>{var u=c,{sideOffset:e=4,className:t,children:n}=u,r=re(u,["sideOffset","className","children"]);return s.jsx(ve.Content,pe(F({ref:a,sideOffset:e,className:[de.dropdownMenuContent,t].filter(Boolean).join(" "),onOpenAutoFocus:i=>{i.preventDefault()},onCloseAutoFocus:i=>{i.preventDefault()}},r),{children:s.jsxs(Re.Root,{className:de.scrollAreaRoot,type:"always",scrollHideDelay:0,children:[s.jsx(Re.Viewport,{className:de.scrollAreaViewport,children:n}),s.jsx(Re.Scrollbar,{className:de.scrollAreaScrollbar,orientation:"vertical",children:s.jsx(Re.Thumb,{className:de.scrollAreaThumb})})]})}))});It.displayName="PlayerMenuContent";const Dt=f.forwardRef((a,r)=>{var c=a,{className:e,onClick:t}=c,n=re(c,["className","onClick"]);const u=l=>{t==null||t(l)},i=l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),t==null||t(l))};return s.jsx(ve.Close,{asChild:!0,children:s.jsx("div",F({ref:r,className:[de.dropdownMenuItem,e].filter(Boolean).join(" "),role:"menuitem",tabIndex:0,onClick:u,onKeyDown:i},n))})});Dt.displayName="PlayerMenuItem";const Nt="settings";function Mt(){const[e,t]=f.useState(!1),n=h(l=>l.containerRef),r=h(l=>l.addIdleLock),a=h(l=>l.removeIdleLock),c=h(l=>l.levels),u=h(l=>l.setLevel),i=f.useCallback(l=>{t(l),l?r(Nt):a(Nt)},[r,a]);return s.jsxs(Pr,{open:e,onOpenChange:i,children:[s.jsx(Lr,{asChild:!0,children:s.jsx(ce,{children:s.jsx(br,{})})}),s.jsx(jr,{container:n.current,children:s.jsx(It,{side:"top",align:"end",children:c==null?void 0:c.map(l=>s.jsxs(Dt,{onClick:()=>u(l.value),children:[l.label,l.selected&&s.jsx(Sr,{})]},l.sid))})})]})}function kr(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M6.60282 10.0001L10 7.22056V16.7796L6.60282 14.0001H3V10.0001H6.60282ZM2 16.0001H5.88889L11.1834 20.3319C11.2727 20.405 11.3846 20.4449 11.5 20.4449C11.7761 20.4449 12 20.2211 12 19.9449V4.05519C12 3.93977 11.9601 3.8279 11.887 3.73857C11.7121 3.52485 11.3971 3.49335 11.1834 3.66821L5.88889 8.00007H2C1.44772 8.00007 1 8.44778 1 9.00007V15.0001C1 15.5524 1.44772 16.0001 2 16.0001ZM23 12C23 15.292 21.5539 18.2463 19.2622 20.2622L17.8445 18.8444C19.7758 17.1937 21 14.7398 21 12C21 9.26016 19.7758 6.80629 17.8445 5.15557L19.2622 3.73779C21.5539 5.75368 23 8.70795 23 12ZM18 12C18 10.0883 17.106 8.38548 15.7133 7.28673L14.2842 8.71584C15.3213 9.43855 16 10.64 16 12C16 13.36 15.3213 14.5614 14.2842 15.2841L15.7133 16.7132C17.106 15.6145 18 13.9116 18 12Z"})})}function Ir(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M13 7.22056L9.60282 10.0001H6V14.0001H9.60282L13 16.7796V7.22056ZM8.88889 16.0001H5C4.44772 16.0001 4 15.5524 4 15.0001V9.00007C4 8.44778 4.44772 8.00007 5 8.00007H8.88889L14.1834 3.66821C14.3971 3.49335 14.7121 3.52485 14.887 3.73857C14.9601 3.8279 15 3.93977 15 4.05519V19.9449C15 20.2211 14.7761 20.4449 14.5 20.4449C14.3846 20.4449 14.2727 20.405 14.1834 20.3319L8.88889 16.0001ZM18.8631 16.5911L17.4411 15.1691C18.3892 14.4376 19 13.2902 19 12.0001C19 10.5697 18.2493 9.31476 17.1203 8.60766L18.5589 7.16906C20.0396 8.26166 21 10.0187 21 12.0001C21 13.8422 20.1698 15.4905 18.8631 16.5911Z"})})}function Dr(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M10 7.22056L6.60282 10.0001H3V14.0001H6.60282L10 16.7796V7.22056ZM5.88889 16.0001H2C1.44772 16.0001 1 15.5524 1 15.0001V9.00007C1 8.44778 1.44772 8.00007 2 8.00007H5.88889L11.1834 3.66821C11.3971 3.49335 11.7121 3.52485 11.887 3.73857C11.9601 3.8279 12 3.93977 12 4.05519V19.9449C12 20.2211 11.7761 20.4449 11.5 20.4449C11.3846 20.4449 11.2727 20.405 11.1834 20.3319L5.88889 16.0001ZM20.4142 12.0001L23.9497 15.5356L22.5355 16.9498L19 13.4143L15.4645 16.9498L14.0503 15.5356L17.5858 12.0001L14.0503 8.46454L15.4645 7.05032L19 10.5859L22.5355 7.05032L23.9497 8.46454L20.4142 12.0001Z"})})}const Ft={volumeContainer:"_volumeContainer_4d6jg_1",volumeSlider:"_volumeSlider_4d6jg_8"},Vt="volume";function At(){const e=h(i=>i.setVolume),t=h(i=>i.volume),n=h(i=>i.addIdleLock),r=h(i=>i.removeIdleLock),a=i=>{e(i[0]),n(Vt)},c=()=>{r(Vt)},u=()=>e(t?0:100);return s.jsxs("div",{className:Ft.volumeContainer,children:[s.jsx(ce,{onClick:u,className:"shrink-0",children:t?t>50?s.jsx(kr,{}):s.jsx(Ir,{}):s.jsx(Dr,{})}),s.jsx("div",{className:Ft.volumeSlider,children:s.jsx(Le,{value:[t],onValueChange:a,onValueCommit:c})})]})}function Nr(e){return s.jsx(nr,{children:s.jsx(Mr,F({},e))})}function Mr({url:e,messages:t={},onEvent:n}){var c,u,i,l;const r=h(d=>d.containerRef),a={eventNotStarted:"Event has not started yet.",eventStartingSoon:"Starting in few seconds...",unableToPlay:"Unable to play the live stream. Please try again later."};return f.useEffect(()=>{console.log(`[Player][Live] Version: ${Ue.version}`)},[]),s.jsxs("div",{ref:r,className:Z.playerContainer,children:[s.jsxs(Gn,{url:e,messages:{eventNotStarted:(c=t==null?void 0:t.eventNotStarted)!=null?c:a.eventNotStarted,eventStartingSoon:(u=t==null?void 0:t.eventStartingSoon)!=null?u:a.eventStartingSoon,unableToPlay:(i=t==null?void 0:t.unableToPlay)!=null?i:a.unableToPlay},children:[s.jsx(ir,{url:e,messages:{unableToPlay:(l=t==null?void 0:t.unableToPlay)!=null?l:a.unableToPlay}}),s.jsx(Pt,{}),s.jsx(kt,{}),s.jsx(fr,{}),s.jsxs(jt,{children:[s.jsx("div",{className:Z.controlsTop,children:s.jsx("div",{className:Z.controlsContainer,children:s.jsx("div",{className:Z.controlsRow,children:s.jsx(gr,{})})})}),s.jsx("div",{className:Z.controlsBottom,children:s.jsxs("div",{className:Z.controlsContainer,children:[s.jsx(pr,{}),s.jsxs("div",{className:Z.controlsRow,children:[s.jsxs("div",{className:`${Z.controlsSection} ${Z.controlsSectionStart}`,children:[s.jsx(mr,{}),s.jsx(yr,{}),s.jsx(At,{})]}),s.jsxs("div",{className:`${Z.controlsSection} ${Z.controlsSectionEnd}`,children:[s.jsx(hr,{message:t==null?void 0:t.live}),s.jsx(Mt,{}),s.jsx(Lt,{})]})]})]})})]}),s.jsx(Bn,{url:e}),s.jsx(tr,{}),s.jsx(sr,{url:e})]}),n&&s.jsx(er,{callback:n})]})}function Fr(){const e=h(u=>u.isPlaying),t=h(u=>u.pause),n=h(u=>u.play),r=h(u=>u.currentTime),a=h(u=>u.duration),c=h(u=>u.seek);return s.jsx(Et,{onClick:()=>{e?t():n()},onBackwardSeek:u=>{const i=Math.max(0,r-u);c(i)},onForwardSeek:u=>{const i=Math.min(r+u,a);c(i)},maxBackwardTime:Math.floor(r),maxForwardTime:Math.floor(a-r)})}function Vr(){const e=h(a=>a.isPlaying),t=h(a=>a.pause),n=h(a=>a.play),r=()=>{e?t():n()};return s.jsx(ce,{onClick:r,children:e?s.jsx(Rt,{}):s.jsx(St,{})})}const Ot="vod-player-progress-bar";function Ar(){const e=f.useRef(null),t=f.useRef(null),[n,r]=f.useState(!1),[a,c]=f.useState(-1),[u,i]=f.useState(-1),l=h(b=>b.currentTime),d=h(b=>b.duration),w=h(b=>b.seek),_=h(b=>b.addIdleLock),g=h(b=>b.removeIdleLock),E=parseFloat((d?(u!==-1?u:l)/d*100:0).toFixed(1)),k=b=>{i(d*(b[0]/100)),_(Ot)},x=()=>{u!==-1&&(w(u),i(-1),g(Ot))},C=()=>r(!0),S=()=>r(!1),L=f.useCallback(b=>{const B=e.current,O=t.current;if(B&&O){const p=je(B),v=je(O),U=(b.pageX||b.clientX)-p.left,D=U/p.width;if(D<0)return;let H=U-v.width/2;H<0&&(H=0),H>p.width-v.width&&(H=-1),O.style.left=H>-1?`${H}px`:"auto",O.style.right=H>-1?"auto":"0px",c(D*d)}C()},[d]);return s.jsxs("div",{className:ie.progressSlider,children:[s.jsx(Le,{ref:e,value:[E],onPointerLeave:S,onPointerDown:S,onPointerMove:L,onValueChange:k,onValueCommit:x,step:.1}),s.jsx("div",{ref:t,className:`${ie.tipContainer} ${n?ie.tipContainerVisible:ie.tipContainerHidden}`,children:s.jsx("p",{className:ie.tipContent,children:Te(a)})})]})}const Ie={remainingTimeContainer:"_remainingTimeContainer_1yyhb_1",remainingTime:"_remainingTime_1yyhb_1",remainingSeparator:"_remainingSeparator_1yyhb_17"};function Or(){const e=h(n=>n.currentTime),t=h(n=>n.duration);return s.jsxs("div",{className:Ie.remainingTimeContainer,children:[s.jsx("p",{className:Ie.remainingTime,children:Te(e)}),s.jsx("p",{className:Ie.remainingSeparator}),s.jsx("p",{className:Ie.remainingTime,children:Te(t)})]})}function Hr({url:e}){const{video_id:t}=vt(e);return s.jsx(mt,{kind:"vod",url:e,id:t?Number(t):void 0})}function Ur({callback:e}){const t=h(n=>n.eventEmitter);return f.useEffect(()=>{const n=r=>e("timeUpdate",r);return t.on("timeUpdate",n),()=>{t.off("timeUpdate",n)}},[e,t]),s.jsx(yt,{callback:e})}function Br(){const e=h(i=>i.currentTime),t=h(i=>i.duration),n=h(i=>i.isPlaying),r=h(i=>i.pause),a=h(i=>i.play),c=h(i=>i.seek),u=f.useCallback(i=>{let l=!1;if(!(i.target instanceof HTMLInputElement||i.ctrlKey)){switch(i.code){case"ArrowLeft":c(e-10>=0?e-10:0),l=!0;break;case"ArrowRight":c(e+10<t?e+10:t),l=!0;break;case"Space":n?r():a(),l=!0;break}l&&i.preventDefault()}},[e,t,n,r,a,c]);return f.useEffect(()=>(document.addEventListener("keydown",u),()=>{document.removeEventListener("keydown",u)}),[u]),s.jsx(Ct,{})}function Wr(e){return s.jsx(Tt,{children:s.jsx(zr,F({},e))})}function zr({url:e,messages:t,onEvent:n,startTime:r}){var i;const a=h(l=>l.setStartTime),c=h(l=>l.containerRef),u={unableToPlay:"Unable to play the video. Please try again later."};return f.useEffect(()=>{r&&a(r)},[r,a]),f.useEffect(()=>{console.log(`[Player][VOD] Version: ${Ue.version}`)},[]),s.jsxs("div",{ref:c,className:Z.playerContainer,children:[s.jsx(_t,{url:e,isLive:!1,messages:{unableToPlay:(i=t==null?void 0:t.unableToPlay)!=null?i:u.unableToPlay}}),s.jsx(Pt,{}),s.jsx(kt,{}),s.jsx(Fr,{}),s.jsx(jt,{children:s.jsx("div",{className:Z.controlsBottom,children:s.jsxs("div",{className:Z.controlsContainer,children:[s.jsx(Ar,{}),s.jsxs("div",{className:Z.controlsRow,children:[s.jsxs("div",{className:`${Z.controlsSection} ${Z.controlsSectionStart}`,children:[s.jsx(Vr,{}),s.jsx(At,{}),s.jsx(Or,{})]}),s.jsxs("div",{className:`${Z.controlsSection} ${Z.controlsSectionEnd}`,children:[s.jsx(Mt,{}),s.jsx(Lt,{})]})]})]})})}),s.jsx(Br,{}),s.jsx(Hr,{url:e}),n&&s.jsx(Ur,{callback:n})]})}j.LivePlayer=Nr,j.VodPlayer=Wr,Object.defineProperty(j,Symbol.toStringTag,{value:"Module"})}));
|
|
17
17
|
//# sourceMappingURL=react-video-player.umd.js.map
|