/ *
THIS IS A GENERATED / BUNDLED FILE BY ESBUILD
if you want to view the source visit the plugins github repository
* /
"use strict" ; var VL = Object . create ; var Wo = Object . defineProperty ; var FL = Object . getOwnPropertyDescriptor ; var zL = Object . getOwnPropertyNames ; var UL = Object . getPrototypeOf , jL = Object . prototype . hasOwnProperty ; var HL = ( t , e , n ) => e in t ? Wo ( t , e , { enumerable : ! 0 , configurable : ! 0 , writable : ! 0 , value : n } ) : t [ e ] = n ; var Ue = ( t , e ) => ( ) => ( t && ( e = t ( t = 0 ) ) , e ) ; var pt = ( t , e ) => ( ) => ( e || t ( ( e = { exports : { } } ) . exports , e ) , e . exports ) , kt = ( t , e ) => { for ( var n in e ) Wo ( t , n , { get : e [ n ] , enumerable : ! 0 } ) } , Ix = ( t , e , n , i ) => { if ( e && typeof e == "object" || typeof e == "function" ) for ( let r of zL ( e ) ) ! jL . call ( t , r ) && r !== n && Wo ( t , r , { get : ( ) => e [ r ] , enumerable : ! ( i = FL ( e , r ) ) || i . enumerable } ) ; return t } ; var $ = ( t , e , n ) => ( n = t != null ? VL ( UL ( t ) ) : { } , Ix ( e || ! t || ! t . _ _esModule ? Wo ( n , "default" , { value : t , enumerable : ! 0 } ) : n , t ) ) , qL = t => Ix ( Wo ( { } , "__esModule" , { value : ! 0 } ) , t ) ; var _ = ( t , e , n ) => ( HL ( t , typeof e != "symbol" ? e + "" : e , n ) , n ) , fg = ( t , e , n ) => { if ( ! e . has ( t ) ) throw TypeError ( "Cannot " + n ) } ; var k = ( t , e , n ) => ( fg ( t , e , "read from private field" ) , n ? n . call ( t ) : e . get ( t ) ) , V = ( t , e , n ) => { if ( e . has ( t ) ) throw TypeError ( "Cannot add the same private member more than once" ) ; e instanceof WeakSet ? e . add ( t ) : e . set ( t , n ) } , we = ( t , e , n , i ) => ( fg ( t , e , "write to private field" ) , i ? i . call ( t , n ) : e . set ( t , n ) , n ) ; var M = ( t , e , n ) => ( fg ( t , e , "access private method" ) , n ) ; var n0 = pt ( ie => { "use strict" ; var Yo = Symbol . for ( "react.element" ) , nI = Symbol . for ( "react.portal" ) , iI = Symbol . for ( "react.fragment" ) , rI = Symbol . for ( "react.strict_mode" ) , sI = Symbol . for ( "react.profiler" ) , aI = Symbol . for ( "react.provider" ) , oI = Symbol . for ( "react.context" ) , lI = Symbol . for ( "react.forward_ref" ) , cI = Symbol . for ( "react.suspense" ) , uI = Symbol . for ( "react.memo" ) , dI = Symbol . for ( "react.lazy" ) , Wx = Symbol . iterator ; function pI ( t ) { return t === null || typeof t != "object" ? null : ( t = Wx && t [ Wx ] || t [ "@@iterator" ] , typeof t == "function" ? t : null ) } var Yx = { isMounted : function ( ) { return ! 1 } , enqueueForceUpdate : function ( ) { } , enqueueReplaceState : function ( ) { } , enqueueSetState : function ( ) { } } , Qx = Object . assign , Xx = { } ; function ea ( t , e , n ) { this . props = t , this . context = e , this . refs = Xx , this . updater = n || Yx } ea . prototype . isReactComponent = { } ; ea . prototype . setState = function ( t , e ) { if ( typeof t != "object" && typeof t != "function" && t != null ) throw Error ( "setState(...): takes an object of state variables to update or a function which returns an object of state variables." ) ; this . updater . enqueueSetState ( this , t , e , "setState" ) } ; ea . prototype . forceUpdate = function ( t ) { this . updater . enqueueForceUpdate ( this , t , "forceUpdate" ) } ; function Zx ( ) { } Zx . prototype = ea . prototype ; function wg ( t , e , n ) { this . props = t , this . context = e , this . refs = Xx , this . updater = n || Yx } var bg = wg . prototype = new Zx ; bg . constructor = wg ; Qx ( bg , ea . prototype ) ; bg . isPureReactComponent = ! 0 ; var Kx = Array . isArray , Jx = Object . prototype . hasOwnProperty , xg = { current : null } , e0 = { key : ! 0 , ref : ! 0 , _ _self : ! 0 , _ _source : ! 0 } ; function t0 ( t , e , n ) { var i , r = { } , s = null , a = null ; if ( e != null ) for ( i in e . ref !== void 0 && ( a = e . ref ) , e . key !== void 0 && ( s = "" + e . key ) , e ) Jx . call ( e , i ) && ! e0 . hasOwnProperty ( i ) && ( r [ i ] = e [ i ] ) ; var o = arguments . length - 2 ; if ( o === 1 ) r . children = n ; else if ( 1 < o ) { for ( var l = Array ( o ) , c = 0 ; c < o ; c ++ ) l [ c ] = arguments [ c + 2 ] ; r . children = l } if ( t && t . defaultProps ) for ( i in o = t . defaultProps , o ) r [ i ] === void 0 && ( r [ i ] = o [ i ] ) ; return { $$typeof : Yo , type : t , key : s , ref : a , props : r , _owner : xg . current } } function hI ( t , e ) { return { $$typeof : Yo , type : t . type , key : e , ref : t . ref , props : t . props , _owner : t . _owner } } function kg ( t ) { return typeof t == "object" && t !== null && t . $$typeof === Yo } function fI ( t ) { var e = { "=" : "=0" , ":" : "=2" } ; return "$" + t . replace ( /[=:]/g , function ( n ) { return e [ n ] } ) } var Gx = /\/+/g ; function _g ( t , e ) { return typeof t == "object" && t !== null && t . key != null ? fI ( "" + t . key ) : e . toString ( 36 ) } function ld ( t , e , n , i , r ) { var s = typeof t ; ( s === "undefined" || s === "boolean" ) && ( t = null ) ; var a = ! 1 ; if ( t === null ) a = ! 0 ; else switch ( s ) { case "string" : case "number" : a = ! 0 ; break ; case "object" : switch ( t . $$typeof ) { case Yo : case nI : a = ! 0 } } if ( a ) return a = t , r = r ( a ) , t = i === "" ? "." + _g ( a , 0 ) : i , Kx ( r ) ? ( n = "" , t != null && ( n = t . replace ( Gx , "$&/" ) + "/" ) , ld ( r , e , n , "" , function ( c ) { return c } ) ) : r != null && ( kg ( r ) && ( r = hI ( r , n + ( ! r . key || a && a . key === r . key ? "" : ( "" + r . key ) . replace ( Gx , "$&/" ) + "/" ) + t ) ) , e . push ( r ) ) , 1 ; if ( a = 0 , i = i === "" ? "." : i + ":" , Kx ( t ) ) for ( var o = 0 ; o < t . length ; o ++ ) { s = t [ o ] ; var l = i + _g ( s , o ) ; a += ld ( s , e , n , l , r ) } else if ( l = pI ( t ) , typeof l == "function" ) for ( t = l . call ( t )
` +Ig+t}var Ag=!1;function Ng(t,e){if(!t||Ag)return"";Ag=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(c){var i=c}Reflect.construct(t,[],e)}else{try{e.call()}catch(c){i=c}t.call(e.prototype)}else{try{throw Error()}catch(c){i=c}t()}}catch(c){if(c&&i&&typeof c.stack=="string"){for(var r=c.stack.split( `
` ),s=i.stack.split( `
` ),a=r.length-1,o=s.length-1;1<=a&&0<=o&&r[a]!==s[o];)o--;for(;1<=a&&0<=o;a--,o--)if(r[a]!==s[o]){if(a!==1||o!==1)do if(a--,o--,0>o||r[a]!==s[o]){var l= `
` +r[a].replace(" at new "," at ");return t.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",t.displayName)),l}while(1<=a&&0<=o);break}}}finally{Ag=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?ol(t):""}function xI(t){switch(t.tag){case 5:return ol(t.type);case 16:return ol("Lazy");case 13:return ol("Suspense");case 19:return ol("SuspenseList");case 0:case 2:case 15:return t=Ng(t.type,!1),t;case 11:return t=Ng(t.type.render,!1),t;case 1:return t=Ng(t.type,!0),t;default:return""}}function sv(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case ra:return"Fragment";case ia:return"Portal";case nv:return"Profiler";case Qv:return"StrictMode";case iv:return"Suspense";case rv:return"SuspenseList"}if(typeof t=="object")switch(t. $ $ typeof){case Ek:return(t.displayName||"Context")+".Consumer";case Tk:return(t._context.displayName||"Context")+".Provider";case Xv:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Zv:return e=t.displayName||null,e!==null?e:sv(t.type)||"Memo";case hr:e=t._payload,t=t._init;try{return sv(t(e))}catch{}}return null}function kI(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return sv(e);case 8:return e===Qv?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Pr(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Pk(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function TI(t){var e=Pk(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),i=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var r=n.get,s=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return r.call(this)},set:function(a){i=""+a,s.call(this,a)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(a){i=""+a},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function gd(t){t._valueTracker||(t._valueTracker=TI(t))}function Ck(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),i="";return t&&(i=Pk(t)?t.checked?"true":"false":t.value),t=i,t!==n?(e.setValue(t),!0):!1}function qd(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function av(t,e){var n=e.checked;return Re({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function _0(t,e){var n=e.defaultValue==null?"":e.defaultValue,i=e.checked!=null?e.checked:e.defaultChecked;n=Pr(e.value!=null?e.value:n),t._wrapperState={initialChecked:i,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function $ k(t,e){e=e.checked,e!=null&&Yv(t,"checked",e,!1)}function ov(t,e){ $ k(t,e);var n=Pr(e.value),i=e.type;if(n!=null)i==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(i==="submit"||i==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?lv(t,e.type,n):e.hasOwnProperty("defaultValue")&&lv(t,e.type,Pr(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function w0(t,e,n){if(e.hasOwnProperty("val
` ).replace(LA,"")}function Cd(t,e,n){if(e=q0(e),q0(t)!==e&&n)throw Error(P(425))}function Zd(){}var xv=null,kv=null;function Tv(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var Ev=typeof setTimeout=="function"?setTimeout:void 0,IA=typeof clearTimeout=="function"?clearTimeout:void 0,B0=typeof Promise=="function"?Promise:void 0,AA=typeof queueMicrotask=="function"?queueMicrotask:typeof B0<"u"?function(t){return B0.resolve(null).then(t).catch(NA)}:Ev;function NA(t){setTimeout(function(){throw t})}function Bg(t,e){var n=e,i=0;do{var r=n.nextSibling;if(t.removeChild(n),r&&r.nodeType===8)if(n=r.data,n==="/ $ "){if(i===0){t.removeChild(r),El(e);return}i--}else n!==" $ "&&n!==" $ ?"&&n!==" $ !"||i++;n=r}while(n);El(e)}function xr(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e===" $ "||e===" $ !"||e===" $ ?")break;if(e==="/ $ ")return null}}return t}function W0(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n===" $ "||n===" $ !"||n===" $ ?"){if(e===0)return t;e--}else n==="/ $ "&&e++}t=t.previousSibling}return null}var $ a=Math.random().toString(36).slice(2),hi="__reactFiber $ "+ $ a,Ml="__reactProps $ "+ $ a,Fi="__reactContainer $ "+ $ a,Sv="__reactEvents $ "+ $ a,DA="__reactListeners $ "+ $ a,OA="__reactHandles $ "+ $ a;function cs(t){var e=t[hi];if(e)return e;for(var n=t.parentNode;n;){if(e=n[Fi]||n[hi]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=W0(t);t!==null;){if(n=t[hi])return n;t=W0(t)}return e}t=n,n=t.parentNode}return null}function Fl(t){return t=t[hi]||t[Fi],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function la(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(P(33))}function yp(t){return t[Ml]||null}var Pv=[],ca=-1;function Mr(t){return{current:t}}function xe(t){0>ca||(t.current=Pv[ca],Pv[ca]=null,ca--)}function ve(t,e){ca++,Pv[ca]=t.current,t.current=e}var Cr={},vt=Mr(Cr),jt=Mr(!1),fs=Cr;function xa(t,e){var n=t.type.contextTypes;if(!n)return Cr;var i=t.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===e)return i.__reactInternalMemoizedMaskedChildContext;var r={},s;for(s in n)r[s]=e[s];return i&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=r),r}function Ht(t){return t=t.childContextTypes,t!=null}function Jd(){xe(jt),xe(vt)}function K0(t,e,n){if(vt.current!==Cr)throw Error(P(168));ve(vt,e),ve(jt,n)}function vT(t,e,n){var i=t.stateNode;if(e=e.childContextTypes,typeof i.getChildContext!="function")return n;i=i.getChildContext();for(var r in i)if(!(r in e))throw Error(P(108,kI(t)||"Unknown",r));return Re({},n,i)}function ep(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Cr,fs=vt.current,ve(vt,t),ve(jt,jt.current),!0}function G0(t,e,n){var i=t.stateNode;if(!i)throw Error(P(169));n?(t=vT(t,e,fs),i.__reactInternalMemoizedMergedChildContext=t,xe(jt),xe(vt),ve(vt,t)):xe(jt),ve(jt,n)}var Ai=null,_p=!1,Wg=!1;function yT(t){Ai===null?Ai=[t]:Ai.push(t)}function VA(t){_p=!0,yT(t)}function Rr(){if(!Wg&&Ai!==null){Wg=!0;var t=0,e=pe;try{var n=Ai;for(pe=1;t<n.length;t++){var i=n[t];do i=i(!0);while(i!==null)}Ai=null,_p=!1}catch(r){throw Ai!==null&&(Ai=Ai.slice(t+1)),Hk(ey,Rr),r}finally{pe=e,Wg=!1}}return null}var ua=[],da=0,tp=null,np=0,bn=[],xn=0,ms=null,Ni=1,Di="";function os(t,e){ua[da++]=np,ua[da++]=tp,tp=t,np=e}function _T(t,e,n){bn[xn++]=Ni,bn[xn++]=Di,bn[xn++]=ms,ms=t;var i=Ni;t=Di;var r=32-Xn(i)-1;i&=~(1<<r),n+=1;var s=32-Xn(e)+r;if(30<s){var a=r-r%5;s=(i&(1<<a)-1).toString(32),i>>=a,r-=a,Ni=1<<32-Xn(e)+r|n<<r|i,Di=s+t}else Ni=1<<s|n<<r|i,Di=t}function cy(t){t.return!==null&&(os(t,1),_T(t,1,0))}function uy(t){for(;t===tp;)tp=ua[--da],ua[da]=null,np=ua[--da],ua[da]=null;for(;t===ms;)ms=bn[--xn],bn[xn]=null,Di=bn[--xn],bn[xn]=null,Ni=bn[--xn],bn[xn]=null}var rn=null,nn=null,Pe=!1,Qn=null;function wT(t,e){var n=kn(5,null,null,0);n.elementType="DELETED",n.stateNode=e,n.return=t,e=t.deletio
Error generating stack : ` +s.message+ `
` +s.stack}return{value:t,source:e,stack:r,digest:null}}function Xg(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function Iv(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var KA=typeof WeakMap=="function"?WeakMap:Map;function GT(t,e,n){n=Oi(-1,n),n.tag=3,n.payload={element:null};var i=e.value;return n.callback=function(){up||(up=!0,Hv=i),Iv(t,e)},n}function YT(t,e,n){n=Oi(-1,n),n.tag=3;var i=t.type.getDerivedStateFromError;if(typeof i=="function"){var r=e.value;n.payload=function(){return i(r)},n.callback=function(){Iv(t,e)}}var s=t.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){Iv(t,e),typeof i!="function"&&(Tr===null?Tr=new Set([this]):Tr.add(this));var a=e.stack;this.componentDidCatch(e.value,{componentStack:a!==null?a:""})}),n}function rk(t,e,n){var i=t.pingCache;if(i===null){i=t.pingCache=new KA;var r=new Set;i.set(e,r)}else r=i.get(e),r===void 0&&(r=new Set,i.set(e,r));r.has(n)||(r.add(n),t=oN.bind(null,t,e,n),e.then(t,t))}function sk(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function ak(t,e,n,i,r){return t.mode&1?(t.flags|=65536,t.lanes=r,t):(t===e?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(e=Oi(-1,1),e.tag=2,kr(n,e,1))),n.lanes|=1),t)}var GA=ji.ReactCurrentOwner,Ut=!1;function Pt(t,e,n,i){e.child=t===null?PT(e,null,n,i):Ta(e,t.child,n,i)}function ok(t,e,n,i,r){n=n.render;var s=e.ref;return _a(e,r),i=by(t,e,n,i,s,r),n=xy(),t!==null&&!Ut?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~r,Ui(t,e,r)):(Pe&&n&&cy(e),e.flags|=1,Pt(t,e,i,r),e.child)}function lk(t,e,n,i,r){if(t===null){var s=n.type;return typeof s=="function"&&!Ly(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=s,QT(t,e,s,i,r)):(t=Hd(n.type,null,i,e,e.mode,r),t.ref=e.ref,t.return=e,e.child=t)}if(s=t.child,!(t.lanes&r)){var a=s.memoizedProps;if(n=n.compare,n=n!==null?n:Pl,n(a,i)&&t.ref===e.ref)return Ui(t,e,r)}return e.flags|=1,t=Sr(s,i),t.ref=e.ref,t.return=e,e.child=t}function QT(t,e,n,i,r){if(t!==null){var s=t.memoizedProps;if(Pl(s,i)&&t.ref===e.ref)if(Ut=!1,e.pendingProps=i=s,(t.lanes&r)!==0)t.flags&131072&&(Ut=!0);else return e.lanes=t.lanes,Ui(t,e,r)}return Av(t,e,n,i,r)}function XT(t,e,n){var i=e.pendingProps,r=i.children,s=t!==null?t.memoizedState:null;if(i.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},ve(fa,tn),tn|=n;else{if(!(n&1073741824))return t=s!==null?s.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,ve(fa,tn),tn|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=s!==null?s.baseLanes:n,ve(fa,tn),tn|=i}else s!==null?(i=s.baseLanes|n,e.memoizedState=null):i=n,ve(fa,tn),tn|=i;return Pt(t,e,r,n),e.child}function ZT(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function Av(t,e,n,i,r){var s=Ht(n)?fs:vt.current;return s=xa(e,s),_a(e,r),n=by(t,e,n,i,s,r),i=xy(),t!==null&&!Ut?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~r,Ui(t,e,r)):(Pe&&i&&cy(e),e.flags|=1,Pt(t,e,n,r),e.child)}function ck(t,e,n,i,r){if(Ht(n)){var s=!0;ep(e)}else s=!1;if(_a(e,r),e.stateNode===null)zd(t,e),ET(e,n,i),Lv(e,n,i,r),i=!0;else if(t===null){var a=e.stateNode,o=e.memoizedProps;a.props=o;var l=a.context,c=n.contextType;typeof c=="object"&&c!==null?c=En(c):(c=Ht(n)?fs:vt.current,c=xa(e,c));var u=n.getDerivedStateFromProps,d=typeof u=="function"||typeof a.getSnapshotBeforeUpdate=="function";d||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==i||l!==c)&&ek(e,a,i,c),fr=!1;var p=e.memoizedState;a.state=p,sp(e,i,a,r),l=e.memoizedState,o!==i||p!==l||jt.current||fr?(typeof u=="function"&&(Rv(e,n,u,i),l=e.memoizedState),(o=fr||J0(e,n,o,i,p,l,c))?(d||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.
` :"")+e;else if(e.includes(O2)){let i=this.o(e,n);i&&(this.a=new Wi(i[0],i[1],i[2].join(" ")),this.a.id=this.l,this.c=Fa.Cue)}this.l=e}o(e,n){return super.o(e.replace(D2,"."),n)}}});var g_={};kt(g_,{ParseErrorBuilder:()=>F2});var F2,v_=Ue(()=>{"use strict";nc();F2={p(){return new Gt({code:Mn.BadSignature,reason:"missing WEBVTT file header",line:1})},q(t,e){return new Gt({code:Mn.BadTimestamp,reason: ` cue start timestamp \ ` ${ t } \` is invalid on line ${ e } ` , line : e } ) } , r ( t , e ) { return new Gt ( { code : Mn . BadTimestamp , reason : ` cue end timestamp \` ${ t } \` is invalid on line ${ e } ` , line : e } ) } , s ( t , e , n ) { return new Gt ( { code : Mn . BadTimestamp , reason : ` cue end timestamp \` ${ e } \` is greater than start \` ${ t } \` on line ${ n } ` , line : n } ) } , w ( t , e , n ) { return new Gt ( { code : Mn . BadSettingValue , reason : ` invalid value for cue setting \` ${ t } \` on line ${ n } (value: ${ e } ) ` , line : n } ) } , v ( t , e , n ) { return new Gt ( { code : Mn . UnknownSetting , reason : ` unknown cue setting \` ${ t } \` on line ${ n } (value: ${ e } ) ` , line : n } ) } , u ( t , e , n ) { return new Gt ( { code : Mn . BadSettingValue , reason : ` invalid value for region setting \` ${ t } \` on line ${ n } (value: ${ e } ) ` , line : n } ) } , t ( t , e , n ) { return new Gt ( { code : Mn . UnknownSetting , reason : ` unknown region setting \` ${ t } \` on line ${ n } (value: ${ e } ) ` , line : n } ) } , T ( t , e ) { return new Gt ( { code : Mn . BadFormat , reason : ` format missing for \` ${ t } \` block on line ${ e } ` , line : e } ) } } } ) ; var PS = { } ; kt ( PS , { SSAParser : ( ) => Zp , default : ( ) => z2 } ) ; function _ _ ( t ) { let e = parseInt ( t . replace ( "&H" , "" ) , 16 ) ; if ( e >= 0 ) { let i = ( e >> 24 & 255 ^ 255 ) / 255 , r = e >> 16 & 255 , s = e >> 8 & 255 ; return "rgba(" + [ e & 255 , s , r , i ] . join ( "," ) + ")" } return null } function w _ ( t , e , n ) { let i = Math . ceil ( 2 * Math . PI * t ) , r = "" ; for ( let s = 0 ; s < i ; s ++ ) { let a = 2 * Math . PI * s / i ; r += t * Math . cos ( a ) + "px " + e * Math . sin ( a ) + "px 0 " + n + ( s == i - 1 ? "" : "," ) } return r } function z2 ( ) { return new Zp } var Qp , xS , kS , Xp , TS , ES , SS , y _ , Zp , CS = Ue ( ( ) => { "use strict" ; nc ( ) ; Qp = /^Format:[\s\t]*/ , xS = /^Style:[\s\t]*/ , kS = /^Dialogue:[\s\t]*/ , Xp = /[\s\t]*,[\s\t]*/ , TS = /\{[^}]+\}/g , ES = /\\N/g , SS = /^\[(.*)[\s\t]?Styles\]$/ , y _ = /^\[(.*)[\s\t]?Events\]$/ , Zp = class { constructor ( ) { _ ( this , "f" ) ; _ ( this , "O" , 0 ) ; _ ( this , "a" , null ) ; _ ( this , "j" , [ ] ) ; _ ( this , "k" , [ ] ) ; _ ( this , "N" , null ) ; _ ( this , "d" ) ; _ ( this , "P" , { } ) } async init ( e ) { this . f = e , e . errors && ( this . d = ( await Promise . resolve ( ) . then ( ( ) => ( v _ ( ) , g _ ) ) ) . ParseErrorBuilder ) } parse ( e , n ) { if ( this . O ) switch ( this . O ) { case 1 : if ( e === "" ) this . O = 0 ; else if ( xS . test ( e ) ) if ( this . N ) { let i = e . replace ( xS , "" ) . split ( Xp ) ; this . S ( i ) } else this . e ( this . d ? . T ( "Style" , n ) ) ; else Qp . test ( e ) ? this . N = e . replace ( Qp , "" ) . split ( Xp ) : y _ . test ( e ) && ( this . N = null , this . O = 2 ) ; break ; case 2 : if ( e === "" ) this . Q ( ) ; else if ( kS . test ( e ) ) if ( this . Q ( ) , this . N ) { let i = e . replace ( kS , "" ) . split ( Xp ) , r = this . U ( i , n ) ; r && ( this . a = r ) } else this . e ( this . d ? . T ( "Dialogue" , n ) ) ; else this . a ? this . a . text += `
` +e.replace(TS,"").replace(ES, `
` ):Qp.test(e)?this.N=e.replace(Qp,"").split(Xp):SS.test(e)?(this.N=null,this.O=1):y_.test(e)&&(this.N=null)}else e===""||(SS.test(e)?(this.N=null,this.O=1):y_.test(e)&&(this.N=null,this.O=2))}done(){return{metadata:{},cues:this.j,regions:[],errors:this.k}}Q(){this.a&&(this.j.push(this.a),this.f.onCue?.(this.a),this.a=null)}S(e){let n="Default",i={},r,s="center",a="bottom",o,l=1.2,c,u,d=3,p=[];for(let h=0;h<this.N.length;h++){let y=this.N[h],v=e[h];switch(y){case"Name":n=v;break;case"Fontname":i["font-family"]=v;break;case"Fontsize":i["font-size"]= ` calc ( $ { v } / var ( -- overlay - height ) ) ` ;break;case"PrimaryColour":let w=__(v);w&&(i["--cue-color"]=w);break;case"BorderStyle":d=parseInt(v,10);break;case"BackColour":u=__(v);break;case"OutlineColour":let m=__(v);m&&(c=m);break;case"Bold":parseInt(v)&&(i["font-weight"]="bold");break;case"Italic":parseInt(v)&&(i["font-style"]="italic");break;case"Underline":parseInt(v)&&(i["text-decoration"]="underline");break;case"StrikeOut":parseInt(v)&&(i["text-decoration"]="line-through");break;case"Spacing":i["letter-spacing"]=v+"px";break;case"AlphaLevel":i.opacity=parseFloat(v);break;case"ScaleX":p.push( ` scaleX ( $ { parseFloat ( v ) / 100 } ) ` );break;case"ScaleY":p.push( ` scaleY ( $ { parseFloat ( v ) / 100 } ) ` );break;case"Angle":p.push( ` rotate ( $ { v } deg ) ` );break;case"Shadow":l=parseInt(v,10)*1.2;break;case"MarginL":i["--cue-width"]="auto",i["--cue-left"]=parseFloat(v)+"px";break;case"MarginR":i["--cue-width"]="auto",i["--cue-right"]=parseFloat(v)+"px";break;case"MarginV":o=parseFloat(v);break;case"Outline":r=parseInt(v,10);break;case"Alignment":let f=parseInt(v,10);switch(f>=4&&(a=f>=7?"top":"center"),f%3){case 1:s="start";break;case 2:s="center";break;case 3:s="end";break}}}if(i.R=a,i["--cue-white-space"]="normal",i["--cue-line-height"]="normal",i["--cue-text-align"]=s,a==="center"?(i["--cue-top"]="50%",p.push("translateY(-50%)")):i[ ` -- cue - $ { a } ` ]=(o||0)+"px",d===1&&(i["--cue-padding-y"]="0"),(d===1||u)&&(i["--cue-bg-color"]=d===1?"none":u),d===3&&c&&(i["--cue-outline"]= ` $ { r } px solid $ { c } ` ),d===1&&typeof r=="number"){let h=u??"#000";i["--cue-text-shadow"]=[c&&w_(r*1.2,l*1.2,c),c?w_(r*(r/2),l*(r/2),h):w_(r,l,h)].filter(Boolean).join(", ")}p.length&&(i["--cue-transform"]=p.join(" ")),this.P[n]=i}U(e,n){let i=this.V(e),r=this.o(i.Start,i.End,n);if(!r)return;let s=new Wi(r[0],r[1],""),a={...this.P[i.Style]||{}},o=i.Name? ` < v $ { i . Name } > ` :"",l=a.R,c=i.MarginL&&parseFloat(i.MarginL),u=i.MarginR&&parseFloat(i.MarginR),d=i.MarginV&&parseFloat(i.MarginV);return c&&(a["--cue-width"]="auto",a["--cue-left"]=c+"px"),u&&(a["--cue-width"]="auto",a["--cue-right"]=u+"px"),d&&l!=="center"&&(a[ ` -- cue - $ { l } ` ]=d+"px"),s.text=o+e.slice(this.N.length-1).join(", ").replace(TS,"").replace(ES, `
` ),delete a.R,Object.keys(a).length&&(s.style=a),s}V(e){let n={};for(let i=0;i<this.N.length;i++)n[this.N[i]]=e[i];return n}o(e,n,i){let r=Ki(e),s=Ki(n);if(r!==null&&s!==null&&s>r)return[r,s];r===null&&this.e(this.d?.q(e,i)),s===null&&this.e(this.d?.r(n,i)),r!=null&&s!==null&&s>r&&this.e(this.d?.s(r,s,i))}e(e){if(e){if(this.k.push(e),this.f.strict)throw this.f.cancel(),e;this.f.onError?.(e)}}}});async function AS(t,e){let n=new ReadableStream({start(i){let r=t.split(IS);for(let s of r)i.enqueue(s);i.close()}});return nh(n,e)}async function nh(t,e){let n=e?.type??"vtt",i;if(typeof n=="string")switch(n){case"srt":i=(await Promise.resolve().then(()=>(bS(),wS))).default;break;case"ssa":case"ass":i=(await Promise.resolve().then(()=>(CS(),PS))).default;break;default:i=(await Promise.resolve().then(function(){return rD})).default}else i=n;let r,s=t.getReader(),a=i(),o=!!e?.strict||!!e?.errors;await a.init({strict:!1,...e,errors:o,type:n,cancel(){s.cancel(),r=a.done(!0)}});let l=1;for(;;){let{value:c,done:u}=await s.read();if(u){a.parse("",l),r=a.done(!1);break}a.parse(c,l),l++}return r}async function NS(t,e){let n=await t;if(!n.ok||!n.body)return{metadata:{},cues:[],regions:[],errors:[void 0]};let i=n.headers.get("content-type")||"",r=i.match(/text \/ (.*?)(?:;| $ )/)?.[1],s=i.match(/charset=(.*?)(?:;| $ )/)?.[1];return T_(n.body,{type:r,encoding:s,...e})}async function T_(t,{encoding:e="utf-8",...n}={}){let i=t.pipeThrough(new x_(e));return nh(i,n)}function H2(t){let e=parseInt(t,10);return Number.isNaN(e)?null:e}function rc(t){let e=parseInt(t.replace(j2,""),10);return!Number.isNaN(e)&&e>=0&&e<=100?e:null}function MS(t){if(!t.includes( $ S))return null;let[e,n]=t.split( $ S).map(rc);return e!==null&&n!==null?[e,n]:null}function q2(t){let e=parseFloat(t);return Number.isNaN(e)?null:e}function Ki(t){let e=t.match(nD);if(!e)return null;let n=e[1]?parseInt(e[1],10):0,i=parseInt(e[2],10),r=parseInt(e[3],10),s=e[4]?parseInt(e[4].padEnd(3,"0"),10):0,a=n*3600+i*60+r+s/1e3;return n<0||i<0||r<0||s<0||i>59||r>59?null:a}function iD(){return new za}function S_(t){let e="",n=1,i=[],r=[],s;for(let c=0;c<t.text.length;c++){let u=t.text[c];switch(n){case 1:u==="<"?(l(),n=2):e+=u;break;case 2:switch(u){case `
` :case" ":case" ":a(),n=4;break;case".":a(),n=3;break;case"/":n=5;break;case">":a(),n=1;break;default:!e&&sD.test(u)&&(n=6),e+=u;break}break;case 3:switch(u){case" ":case" ":case `
` :o(),s&&s.class?.trim(),n=4;break;case".":o();break;case">":o(),s&&s.class?.trim(),n=1;break;default:e+=u}break;case 4:u===">"?(e=e.replace(aD," "),s?.type==="v"?s.voice=b_(e):s?.type==="lang"&&(s.lang=b_(e)),e="",n=1):e+=u;break;case 5:u===">"&&(e="",s=r.pop(),n=1);break;case 6:if(u===">"){let d=Ki(e);d!==null&&d>=t.startTime&&d<=t.endTime&&(e="timestamp",a(),s.time=d),e="",n=1}else e+=u;break}}function a(){if(uD.has(e)){let c=s;s=dD(e),c?(r[r.length-1]!==c&&r.push(c),c.children.push(s)):i.push(s)}e="",n=1}function o(){if(s&&e){let c=e.replace("bg_","");cD.has(c)?s[e.startsWith("bg_")?"bgColor":"color"]=c:s.class=s.class?s.class+" "+e:e}e=""}function l(){if(!e)return;let c={type:"text",data:b_(e)};s?s.children.push(c):i.push(c),e=""}return n===1&&l(),i}function dD(t){return{tagName:DS[t],type:t,children:[]}}function b_(t){return t.replace(lD,e=>oD[e]||"'")}function Nt(t,e,n){t.style.setProperty( ` -- $ { e } ` ,n+"")}function Ar(t,e,n=!0){t.setAttribute( ` data - $ { e } ` ,n===!0?"":n+"")}function Jp(t,e){t.setAttribute("data-part",e)}function pD(t){return parseFloat(getComputedStyle(t).lineHeight)||0}function OS(t){if(E_)throw Error("[media-captions] called ` createVTTCueTemplate ` on the server - use ` renderVTTCueString ` ");let e=document.createElement("template");return e.innerHTML=ih(t),{cue:t,content:e.content}}function ih(t,e=0){return rh(S_(t),e)}function rh(t,e=0){let n,i="";for(let r of t)if(r.type==="text")i+=r.data;else{let s=r.type==="timestamp";n={},n.class=r.class,n.title=r.type==="v"&&r.voice,n.lang=r.type==="lang"&&r.lang,n["data-part"]=r.type==="v"&&"voice",s&&(n["data-part"]="timed",n["data-time"]=r.time,n["data-future"]=r.time>e,n["data-past"]=r.time<e),n.style= ` $ { r . color ? ` color: ${ r . color } ; ` : "" } $ { r . bgColor ? ` background-color: ${ r . bgColor } ; ` : "" } ` ;let a=Object.entries(n).filter(o=>o[1]).map(o=> ` $ { o [ 0 ] } = "${o[1]===!0?" ":o[1]}" ` ).join(" ");i+= ` < $ { r . tagName } $ { a ? " " + a : "" } > $ { rh ( r . children ) } < /${r.tagName}>`}return i}function P_(t,e){if(!E_)for(let n of t.querySelectorAll('[data-part="timed"]')){let i=Number(n.getAttribute("data-time"));Number.isNaN(i)||(i>e?Ar(n,"future"):n.removeAttribute("data-future"),i<e?Ar(n,"past"):n.removeAttribute("data-past"))}}function hD(t,e){let n=null,i;function r(){s(),t(...i),i=void 0}function s(){clearTimeout(n),n=null}function a(){i=[].slice.call(arguments),s(),n=setTimeout(r,e)}return a}function C_(t){return t instanceof HTMLElement?{top:t.offsetTop,width:t.clientWidth,height:t.clientHeight,left:t.offsetLeft,right:t.offsetLeft+t.clientWidth,bottom:t.offsetTop+t.clientHeight}:{...t}}function eh(t,e,n){switch(e){case"+x":t.left+=n,t.right+=n;break;case"-x":t.left-=n,t.right-=n;break;case"+y":t.top+=n,t.bottom+=n;break;case"-y":t.top-=n,t.bottom-=n;break}}function fD(t,e){return t.left<=e.right&&t.right>=e.left&&t.top<=e.bottom&&t.bottom>=e.top}function mD(t,e){for(let n=0;n<e.length;n++)if(fD(t,e[n]))return e[n];return null}function LS(t,e){return e.top>=0&&e.bottom<=t.height&&e.left>=0&&e.right<=t.width}function gD(t,e,n){switch(n){case"+x":return e.left<0;case"-x":return e.right>t.width;case"+y":return e.top<0;case"-y":return e.bottom>t.height}}function vD(t,e){let n=Math.max(0,Math.min(t.width,e.right)-Math.max(0,e.left)),i=Math.max(0,Math.min(t.height,e.bottom)-Math.max(0,e.top));return n*i/ ( t . height * t . width ) } function $ _ ( t , e ) { return { top : e . top / t . height , left : e . left / t . width , right : ( t . width - e . right ) / t . width , bottom : ( t . height - e . bottom ) / t . height } } function VS ( t , e ) { return e . top = e . top * t . height , e . left = e . left * t . width , e . right = t . width - e . right * t . width , e . bottom = t . height - e . bottom * t . height , e } function zS ( t , e , n , i ) { let r = $ _ ( e , n ) ; for ( let s of FS ) Nt ( t , ` ${ i } - ${ s } ` , r [ s ] * 100 + "%" ) } function US ( t , e , n , i ) { let r = 1 , s , a = { ... e } ; for ( let o = 0 ; o < i . length ; o ++ ) { for ( ; gD ( t , e , i [ o ] ) || LS ( t , e ) && mD ( e , n ) ; ) eh ( e , i [ o ] , 1 ) ; if ( LS ( t , e ) ) return e ; let l = vD ( t , e ) ; r > l && ( s = { ... e } , r = l ) , e = { ... a } } return s || a } function yD ( t , e , n , i ) { let r = n . firstElementChild , s = bD ( e ) , a , o = [ ] ; if ( n [ Nr ] || ( n [ Nr ] = _D ( t , n ) ) , a = VS ( t , { ... n [ Nr ] } ) , n [ sc ] ) o = [ n [ sc ] === "top" ? "+y" : "-y" , "+x" , "-x" ] ; else if ( e . snapToLines ) { let l ; switch ( e . vertical ) { case "" : o = [ "+y" , "-y" ] , l = "height" ; break ; case "rl" : o = [ " + x
` :"")+e}break;case 3:this.n(e.split(ic),n);break}else if(e.startsWith(G2))this.c=4;else if(e.startsWith(Y2))this.c=3,this.b=new oc,this.n(e.replace(Q2,"").split(ic),n);else if(e.includes(X2)){let i=this.o(e,n);i&&(this.a=new Wi(i[0],i[1],""),this.a.id=this.l,this.m(i[2],n)),this.c=2}else n===1&&this.i(e,n);this.l=e}done(){return{metadata:this.g,cues:this.j,regions:Object.values(this.h),errors:this.k}}i(e,n){if(n>1){if(Ua.test(e)){let[i,r]=e.split(Ua);i&&(this.g[i]=(r||"").replace(ic,""))}}else e.startsWith(B2)?this.c=1:this.e(this.d?.p())}o(e,n){let[i,r=""]=e.split(Z2),[s,...a]=r.split(ic),o=Ki(i),l=Ki(s);if(o!==null&&l!==null&&l>o)return[o,l,a];o===null&&this.e(this.d?.q(i,n)),l===null&&this.e(this.d?.r(s,n)),o!=null&&l!==null&&l>o&&this.e(this.d?.s(o,l,n))}n(e,n){let i;for(let r=0;r<e.length;r++)if(Ua.test(e[r])){i=!1;let[s,a]=e[r].split(Ua);switch(s){case"id":this.b.id=a;break;case"width":let o=rc(a);o!==null?this.b.width=o:i=!0;break;case"lines":let l=H2(a);l!==null?this.b.lines=l:i=!0;break;case"regionanchor":let c=MS(a);c!==null?(this.b.regionAnchorX=c[0],this.b.regionAnchorY=c[1]):i=!0;break;case"viewportanchor":let u=MS(a);u!==null?(this.b.viewportAnchorX=u[0],this.b.viewportAnchorY=u[1]):i=!0;break;case"scroll":a==="up"?this.b.scroll="up":i=!0;break;default:this.e(this.d?.t(s,a,n))}i&&this.e(this.d?.u(s,a,n))}}m(e,n){let i;for(let r=0;r<e.length;r++)if(i=!1,Ua.test(e[r])){let[s,a]=e[r].split(Ua);switch(s){case"region":let o=this.h[a];o&&(this.a.region=o);break;case"vertical":a==="lr"||a==="rl"?(this.a.vertical=a,this.a.region=null):i=!0;break;case"line":let[l,c]=a.split(RS);if(l.includes(W2)){let y=rc(l);y!==null?(this.a.line=y,this.a.snapToLines=!1):i=!0}else{let y=q2(l);y!==null?this.a.line=y:i=!0}eD.test(c)?this.a.lineAlign=c:c&&(i=!0),this.a.line!=="auto"&&(this.a.region=null);break;case"position":let[u,d]=a.split(RS),p=rc(u);p!==null?this.a.position=p:i=!0,d&&tD.test(d)?this.a.positionAlign=d:d&&(i=!0);break;case"size":let h=rc(a);h!==null?(this.a.size=h,h<100&&(this.a.region=null)):i=!0;break;case"align":J2.test(a)?this.a.align=a:i=!0;break;default:this.e(this.d?.v(s,a,n))}i&&this.e(this.d?.w(s,a,n))}}e(e){if(e){if(this.k.push(e),this.f.strict)throw this.f.cancel(),e;this.f.onError?.(e)}}};rD=Object.freeze({__proto__:null,VTTBlock:Fa,VTTParser:za,default:iD,parseVTTTimestamp:Ki}),sD=/[0-9]/,aD=/[ \s \t ]+/,DS={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span",timestamp:"span"},oD={"&":"&","<":"<",">":">",""":'"',"'":"'"," ":" \x A0","‎":" \u 200E","‏":" \u 200F"},lD=/&(?:amp|lt|gt|quot|#(0+)?39|nbsp|lrm|rlm);/g,cD=new Set(["white","lime","cyan","red","yellow","magenta","blue","black"]),uD=new Set(Object.keys(DS));Nr=Symbol(0);FS=["top","left","right","bottom"];sc=Symbol(0);TD=["-y","+y","-x","+x"];th=class{constructor(e,n){_(this,"overlay");_(this,"z");_(this,"A",0);_(this,"C","ltr");_(this,"B",[]);_(this,"D",!1);_(this,"E");_(this,"h",new Map);_(this,"j",new Map);_(this,"K",hD(()=>{this.D=!1,this.G();for(let e of this.h.values())e[Nr]=null;for(let e of this.j.values())e&&(e[Nr]=null);this.H(!0)},50));this.overlay=e,this.dir=n?.dir??"ltr",e.setAttribute("translate","yes"),e.setAttribute("aria-live","off"),e.setAttribute("aria-atomic","true"),Jp(e,"captions"),this.G(),this.E=new ResizeObserver(this.I.bind(this)),this.E.observe(e)}get dir(){return this.C}set dir(e){this.C=e,Ar(this.overlay,"dir",e)}get currentTime(){return this.A}set currentTime(e){this.A=e,this.update()}changeTrack({regions:e,cues:n}){this.reset(),this.J(e);for(let i of n)this.j.set(i,null);this.update()}addCue(e){this.j.set(e,null),this.update()}removeCue(e){this.j.delete(e),this.update()}update(e=!1){this.H(e)}reset(){this.j.clear(),this.h.clear(),this.B=[],this.overlay.textContent=""}destroy(){this.reset(),this.E.disconnect()}I(){this.D=!0,this.K()}G(){this.z=C_(this.overlay),Nt(this.overlay,"overlay-width",this.z.width+"px"),Nt(this.overlay,"overlay-height",this.z.height+"px")}H(e=!1){if(!this.j.size||this.D)return;let n,i=[...this.j.keys()].filter(s=>this.A>=s.startTime&&this.A<=s.endTime).sort
` )[1].trim():null}function ZO(t){let e=t.split( `
` );for(let n of e)if(n.startsWith("#EXT-X-TARGETDURATION")){let i=parseFloat(n.split(":")[1]);if(!isNaN(i))return i}return-1}function kP(t){return(qe(t)?t:[!U(t)&&"src"in t?t:{src:t}]).map(({src:e,type:n,...i})=>({src:e,type:n??(U(e)?u1.get(e):null)??(!U(e)||e.startsWith("blob:")?"video/object":e.includes("youtube")?"video/youtube":e.includes("vimeo")?"video/vimeo":"?"),...i})).sort(e=>e.type==="?"?1:-1)}function TP(t,e){return t?.src===e?.src&&t?.type===e?.type}function a3(t){return t?"true":"false"}function Xt(t){return()=>a3(t())}function EP(t,e,n){let i=e-t,r=n-t;return i>0?r/i:0}function o3(t,e,n,i){return jw(t,Dt(n,sh(i)),e)}function l3(t,e,n,i){let r=jw(0,n,1),s=e-t,a=s*r,o=a/i,l=i*o;return t+l}function pw(t,e){let n=String(t),i=n.length;if(i<e){let s=e-i;return ` $ { "0" . repeat ( s ) } $ { t } ` }return n}function d1(t){let e=Math.trunc(t/3600),n=Math.trunc(t%3600/60),i=Math.trunc(t%60),r=Number((t-Math.trunc(t)).toPrecision(3));return{hours:e,minutes:n,seconds:i,fraction:r}}function Ur(t,e=null,n=null,i=!1){let{hours:r,minutes:s,seconds:a}=d1(t),o=e?pw(r,2):r,l=n||vi(n)&&t>=3600?pw(s,2):s,c=pw(a,2);return r>0||i? ` $ { o } : $ { l } : $ { c } ` : ` $ { l } : $ { c } ` }function kc(t){let e=[],{hours:n,minutes:i,seconds:r}=d1(t);return n>0&&e.push( ` $ { n } hour ` ),i>0&&e.push( ` $ { i } min ` ),(r>0||e.length===0)&&e.push( ` $ { r } sec ` ),e.join(" ")}function Hw(t,{clamp:e,offset:n,orientation:i}){let r=getComputedStyle(t),s=parseFloat(r.width),a=parseFloat(r.height),o={top:null,right:null,bottom:null,left:null};if(o[i==="horizontal"?"bottom":"left"]= ` calc ( 100 % + var ( -- media - slider - preview - offset , $ { n } px ) ) ` ,i==="horizontal"){let l=s/2;if(!e)o.left= ` calc ( var ( -- slider - pointer ) - $ { l } px ) ` ;else{let c= ` max ( 0 px , calc ( var ( -- slider - pointer ) - $ { l } px ) ) ` ,u= ` calc ( 100 % - $ { s } px ) ` ;o.left= ` min ( $ { c } , $ { u } ) ` }}else{let l=a/2;if(!e)o.bottom= ` calc ( var ( -- slider - pointer ) - $ { l } px ) ` ;else{let c= ` max ( $ { l } px , calc ( var ( -- slider - pointer ) - $ { l } px ) ) ` ,u= ` calc ( 100 % - $ { a } px ) ` ;o.bottom= ` min ( $ { c } , $ { u } ) ` }}Object.assign(t.style,o)}function j3(t){return ke.isValidElement(t)&&t.type===U3}function H3(t,e){let n={...e};for(let i in e){let r=t[i],s=e[i];/^on[A-Z]/.test(i)?r&&s?n[i]=(...o)=>{s(...o),r(...o)}:r&&(n[i]=r):i==="style"?n[i]={...r,...s}:i==="className"&&(n[i]=[r,s].filter(Boolean).join(" "))}return{...t,...n}}function f1(t){return t?. $ $ PROVIDER_TYPE==="REMOTION"}function _e(t,e){let n=Lr(Vs);return he((e?.current?. $ state||n||B3)[t])}var ke,UD,jD,HD,qD,BD,WD,KD,GD,YD,QD,XD,Y,aP,vc,pn,oP,lP,cP,Qt,Rn,Cs,kh,Th,D,ZD,gh,dP,pc,I_,LP,Aw,le,yh,iO,rO,sO,aO,oO,lO,cO,K,pP,hP,fP,un,uO,Vs,dO,au,Ga,mw,Ba,Ph,_h,Dr,gO,yO,wO,MO,LO,NO,Xi, $ h,lu,Mh,gw,Rh,Fw,Lh,mc,Ih,Ah,FO,zO,dn,Nh,JP,_P,UO,wP,vw,jO,Dh,e1,t1,n1,i1,r1,s1,Oh,_c,a1,l1,Vh,Fh,uw,qO,BO,zh,yw,_w,Uh,ww,bw,WO,xw,kw,KO,jh,fn,GO,YO,Te,fe,QO,u1,Ew,Sw,JO,e3,t3,Qa,Hh,qh,Bh,Ka,n3,Wh,Kh,wc,it,i3,r3,s3,bc,Gh,Yh,Qh,Xh,Zh,Jh,ef,tf,nf,mf,SP,Pw,xc,gf,xi,Zi,Yi,bh,rf,Xa,sf,c3,u3,d3,Ms,p3,h3,f3,Za,Tc,Ec,Ja,m3,g3,vf,Ji,ut,v3,PP,Cw,y3,_3,cu,w3,er,b3,x3,k3,Rs,af,of,gc,Sc, $ w,Fr,T3,E3,p1,eo,S3,P3,C3,to, $ 3,M3,qw,Ls,R3,L3,Bw,Is,I3,A3,Ww,As,N3,D3,Kw,Ns,O3,V3,Gw,Ds,lf,Mw,cf,Pc,Cc,F3,z3,Rw,Os,uf, $ c,Mc,df,Rc,Lc,Ic,Ac,Nc,Dc,Oc,Vc,Fc,zc,Uc,jc,Hc,qc,Bc,Wc,Kc,Gc,Yc,Qc,Xc,Zc,Jc,eu,tu,nu,iu,ru,pf,no,su,h1,Lw,U3,q3,H,CP,B3,Yt=Ue(()=>{"use strict";"use client";ke= $ (j(),1);At();jD=Symbol(0);UD=jD;HD=Symbol(0),qD=Symbol(0),BD=Symbol(0),WD=Symbol(0),KD=Symbol(0),GD=Symbol(0),YD=Symbol(0),QD=Symbol(0),XD=Symbol(0),Y={_add:HD,_remove:qD,_reset:BD,_select:WD,_readonly:KD,_setReadonly:GD,_onReset:YD,_onRemove:QD,_onUserSelect:XD},vc=class extends Ia{constructor(){super(...arguments),this._items=[],this[aP]=!1}get length(){return this._items.length}get readonly(){return this[Y._readonly]}toArray(){return[...this._items]}[(aP=Y._readonly,Symbol.iterator)](){return this._items.values()}[Y._add](e,n){let i=this._items.length;""+i in this||Object.defineProperty(this,i,{get(){return this._items[i]}}),!this._items.includes(e)&&(this._items.push(e),this.dispatchEvent(new q("add",{detail:e,trigger:n})))}[Y._remove](e,n){let i=this._items.indexOf(e);i>=0&&(this[Y._onRemove]?.(e,n),this._items.splice(i,1),this.
` ],{type:"text/vtt"});n.src=URL.createObjectURL(a),n.addEventListener("load",s),n.addEventListener("error",s)}return n.label=e.label,n.kind=e.kind,n.default=i,e.language&&(n.srclang=e.language),i&&!r&&this._copyCues(e,n.track),n}_copyCues(e,n){if(!(e.src&&e.type==="vtt"||n.cues?.length))for(let i of e.cues)n.addCue(i)}_onChange(e){for(let n of this._tracks){let i=n[K._native]?.track;if(!i)continue;if(!this._display){i.mode="disabled";continue}let r=i.mode==="showing";r&&this._copyCues(n,i),n.setMode(r?"showing":"disabled",e)}}},Rh=class{constructor(e){this._media=e,this._video=null,this._renderers=[],this._nativeDisplay=!1,this._nativeRenderer=null,this._customRenderer=null;let n=e.textTracks;this._textTracks=n,b(this._watchControls.bind(this)),G(this._detach.bind(this)),S(n,"add",this._onAddTrack.bind(this)),S(n,"remove",this._onRemoveTrack.bind(this)),S(n,"mode-change",this._update.bind(this))}_watchControls(){let{ $ state:e, $ iosControls:n}=this._media;this._nativeDisplay=e.controls()||n(),this._update()}add(e){this._renderers.push(e),this._update()}remove(e){e.detach(),this._renderers.splice(this._renderers.indexOf(e),1),this._update()}_attachVideo(e){requestAnimationFrame(()=>{if(this._video=e,e){this._nativeRenderer=new gw,this._nativeRenderer.attach(e);for(let n of this._textTracks)this._addNativeTrack(n)}this._update()})}_addNativeTrack(e){We(e)&&this._nativeRenderer?.addTrack(e)}_removeNativeTrack(e){We(e)&&this._nativeRenderer?.removeTrack(e)}_onAddTrack(e){this._addNativeTrack(e.detail)}_onRemoveTrack(e){this._removeNativeTrack(e.detail)}_update(){let e=this._textTracks.selected;if(this._video&&(this._nativeDisplay||e?.[K._nativeHLS])){this._customRenderer?.changeTrack(null),this._nativeRenderer?.setDisplay(!0),this._nativeRenderer?.changeTrack(e);return}if(this._nativeRenderer?.setDisplay(!1),this._nativeRenderer?.changeTrack(null),!e){this._customRenderer?.changeTrack(null);return}let n=this._renderers.sort((i,r)=>i.priority-r.priority).find(i=>i.canRender(e,this._video));this._customRenderer!==n&&(this._customRenderer?.detach(),n?.attach(this._video),this._customRenderer=n??null),n?.changeTrack(e)}_detach(){this._nativeRenderer?.detach(),this._nativeRenderer=null,this._customRenderer?.detach(),this._customRenderer=null}},Fw=VO;Lh=class extends vc{constructor(){super(),this._canLoad=!1,this._defaults={},this._storage=null,this._preferredLang=null,this._selectCaptions=Fw(async()=>{if(!this._canLoad||this.selected||await this._storage?.getCaptions()===!1)return;!this._preferredLang&&this._storage&&(this._preferredLang=await this._storage.getLang());let e=this._preferredLang&&this._items.find(i=>We(i)&&i.language===this._preferredLang),n=this._defaults.captions;e?e.mode="showing":n&&n&&(n.mode="showing"),this._storage?.setLang?.(this._preferredLang??n?.language??null)},300),this._onTrackModeChangeBind=this._onTrackModeChange.bind(this)}get selected(){return this._items.find(n=>n.mode==="showing"&&We(n))??null}get preferredLang(){return this._preferredLang}set preferredLang(e){this._preferredLang=e}add(e,n){let i=e instanceof un,r=i?e:new un(e),s=e.kind==="captions"||e.kind==="subtitles"?"captions":e.kind;return this._defaults[s]&&e.default&&delete e.default,r.addEventListener("mode-change",this._onTrackModeChangeBind),this[Y._add](r,n),r[K._crossOrigin]=this[K._crossOrigin],this._canLoad&&r[K._canLoad](),e.default&&(this._defaults[s]=r,s!=="captions"?r.mode="showing":this._selectCaptions()),this}remove(e,n){if(this._items.includes(e))return e===this._defaults[e.kind]&&delete this._defaults[e.kind],e.mode="disabled",e[K._onModeChange]=null,e.removeEventListener("mode-change",this._onTrackModeChangeBind),this[Y._remove](e,n),this}clear(e){for(let n of[...this._items])this.remove(n,e);return this}getById(e){return this._items.find(n=>n.id===e)??null}getByKind(e){let n=Array.isArray(e)?e:[e];return this._items.filter(i=>n.includes(i.kind))}[K._canLoad](){if(!this._canLoad){for(let e of this._items)e[K._canLoad]();this._canLoad=!0,this._selectCaptions()}}_onTrackModeChange(e){let n=e.detail;if(this._storage&&We(n)&&(t
# bilibili - player . bpx - player - control - wrap {
opacity : 0 ! important ;
}
. mx - show - controls # bilibili - player . bpx - player - control - wrap {
opacity : 100 ! important ;
}
\ ` ,o=class extends h{findMedia(){return l("#bilibili-player video")}getStyle(){return w}async onload(){this.controller.handle("bili_getManifest",()=>({value:window.player.getManifest()})),localStorage.setItem("recommend_auto_play","close"),localStorage.setItem("bpx_player_profile",JSON.stringify({media:{autoplay:!1}})),await super.onload(),this.revertAutoSeek(),Promise.all([this.toggleDanmaku(!1)]),await this.untilWebFullscreen()}get player(){return this.media.closest("#bilibili-player")}async toggleDanmaku(e){if(window.player){e===void 0&&(e=!window.player.danmaku.isOpen()),e?window.player.danmaku.open():window.player.danmaku.close();return}let t=await l(".bui-danmaku-switch",this.player);if(!t)return;let i=t.querySelector("input.bui-danmaku-switch-input");if(i){if(e===void 0){i.click();return}e!==this.isDanmakuOn(t)&&i.click()}}isDanmakuOn(e){return e.querySelector(".bui-danmaku-switch-off")?.offsetHeight===0}isWebFullscreen(){return this.player.classList.contains("mode-webscreen")}enterWebFullscreen(){this.isWebFullscreen()||l(".bpx-player-ctrl-web",this.player).then(e=>{e.click()})}revertAutoSeek(){let t=this.player.querySelector(".bpx-player-toast-auto");if(!t)return;let i=()=>{this.stateRef.prevSeek&&this.stateRef.prevSeek.time>Date.now()-5e3?this.media.currentTime=this.stateRef.prevSeek.value:this.media.currentTime=0},n=new MutationObserver(u=>{u.find(a=>a.type==="childList"&&a.addedNodes.length>0)?.addedNodes.forEach(a=>{a.textContent?.includes(" \\ u5DF2 \\ u4E3A \\ u60A8 \\ u5B9A \\ u4F4D \\ u81F3")&&(a.style.opacity="0",i())})});n.observe(t,{childList:!0,subtree:!0}),this.register(()=>n.disconnect())}async untilWebFullscreen(){let e=this.player;this.isWebFullscreen()||await new Promise(t=>{let i=new MutationObserver(n=>{n.find(a=>a.type==="attributes"&&a.attributeName==="class"&&e?.classList.contains("mode-webscreen"))&&(i.disconnect(),t(void 0))});i.observe(e,{attributes:!0}),setTimeout(()=>{i.disconnect(),t(void 0)},6e3)})}};
` ;var tC= ` "use strict" ; var a = Object . defineProperty ; var l = Object . getOwnPropertyDescriptor ; var p = Object . getOwnPropertyNames ; var d = Object . prototype . hasOwnProperty ; var u = ( r , e ) => { for ( var o in e ) a ( r , o , { get : e [ o ] , enumerable : ! 0 } ) } , m = ( r , e , o , s ) => { if ( e && typeof e == "object" || typeof e == "function" ) for ( let t of p ( e ) ) ! d . call ( r , t ) && t !== o && a ( r , t , { get : ( ) => e [ t ] , enumerable : ! ( s = l ( e , t ) ) || s . enumerable } ) ; return r } ; var c = r => m ( a ( { } , "__esModule" , { value : ! 0 } ) , r ) ; var b = { } ; u ( b , { default : ( ) => i } ) ; module . exports = c ( b ) ; var n = ( ) => require ( "media-extended" ) ; var y = \ `
body : not ( . mx - show - controls ) . vp - player - ui - overlays {
opacity : 0 ! important ;
}
\ ` ,{waitForSelector:x,MediaPlugin:M}=n(),i=class extends M{findMedia(){return x("#main [data-player] .vp-video video")}getStyle(){return super.getStyle()+ \`
\ ` +y}};
` ;var nC= ` "use strict" ; var d = Object . defineProperty ; var u = Object . getOwnPropertyDescriptor ; var y = Object . getOwnPropertyNames ; var h = Object . prototype . hasOwnProperty ; var b = ( o , t ) => { for ( var e in t ) d ( o , e , { get : t [ e ] , enumerable : ! 0 } ) } , g = ( o , t , e , n ) => { if ( t && typeof t == "object" || typeof t == "function" ) for ( let r of y ( t ) ) ! h . call ( o , r ) && r !== e && d ( o , r , { get : ( ) => t [ r ] , enumerable : ! ( n = u ( t , r ) ) || n . enumerable } ) ; return o } ; var v = o => g ( d ( { } , "__esModule" , { value : ! 0 } ) , o ) ; var x = { } ; b ( x , { default : ( ) => l } ) ; module . exports = v ( x ) ; var a = ( ) => require ( "media-extended" ) ; var w = \ `
body : not ( . mx - player - ready ) # movie _player ,
ytd - watch - flexy [ theater ] # movie _player {
position : fixed ! important ;
top : 0 ! important ;
left : 0 ! important ;
width : 100 vw ! important ;
height : 100 vh ! important ;
max - width : none ! important ;
max - height : none ! important ;
min - width : 0 ! important ;
min - height : 0 ! important ;
margin : 0 ! important ;
padding : 0 ! important ;
z - index : 2147483647 ! important ; /* Ensure it's on top of other elements */
background - color : # 000 ! important ;
transform : none ! important ;
}
. mx - parent {
overflow : visible ! important ;
z - index : auto ! important ;
transform : none ! important ;
- webkit - transform - style : flat ! important ;
transition : none ! important ;
contain : none ! important ;
}
. mx - absolute {
position : absolute ! important ;
}
html , body {
overflow : hidden ! important ;
zoom : 100 % ! important ;
}
. mx - parent video {
object - fit : contain ! important ;
}
ytd - app . html5 - endscreen {
opacity : 0 ! important ;
}
body : not ( . mx - show - controls ) ytd - app . ytp - chrome - bottom {
opacity : 0 ! important ;
}
\ ` .trim(),f= \`
/* \\u9996\\u9875\\u9876\\u90E8\\u6A2A\\u5E45\\u5E7F\\u544A */
# masthead - ad ,
/* \\u9996\\u9875\\u89C6\\u9891\\u6392\\u7248\\u5E7F\\u544A */
ytd - rich - item - renderer . style - scope . ytd - rich - grid - row # content : has ( . ytd - display - ad - renderer ) ,
/* \\u64AD\\u653E\\u5668\\u5E95\\u90E8\\u5E7F\\u544A */
. video - ads . ytp - ad - module ,
/* \\u64AD\\u653E\\u9875\\u4F1A\\u5458\\u4FC3\\u9500\\u5E7F\\u544A */
tp - yt - paper - dialog : has ( yt - mealbar - promo - renderer ) ,
/* \\u64AD\\u653E\\u9875\\u53F3\\u4E0A\\u65B9\\u63A8\\u8350\\u5E7F\\u544A */
ytd - engagement - panel - section - list - renderer [ target - id = "engagement-panel-ads" ] ,
/* \\u64AD\\u653E\\u9875\\u8BC4\\u8BBA\\u533A\\u53F3\\u4FA7\\u63A8\\u5E7F\\u5E7F\\u544A */
# related # player - ads ,
/* \\u64AD\\u653E\\u9875\\u8BC4\\u8BBA\\u533A\\u53F3\\u4FA7\\u89C6\\u9891\\u6392\\u7248\\u5E7F\\u544A */
# related ytd - ad - slot - renderer ,
/* \\u641C\\u7D22\\u9875\\u5E7F\\u544A */
ytd - ad - slot - renderer ,
/* \\u64AD\\u653E\\u9875\\u4F1A\\u5458\\u63A8\\u8350\\u5E7F\\u544A */
yt - mealbar - promo - renderer ,
/* M\\u64AD\\u653E\\u9875\\u7B2C\\u4E09\\u65B9\\u63A8\\u8350\\u5E7F */
ad - slot - renderer ,
/* M\\u53EF\\u8DF3\\u8FC7\\u7684\\u89C6\\u9891\\u5E7F\\u544A\\u94FE\\u63A5 */
ytm - companion - ad - renderer {
opacity : 0 ! important ;
}
\ ` .trim(),{waitForSelector:s,MediaPlugin:E}=a(),i=class extends E{findMedia(){return s("ytd-app #movie_player video")}getStyle(){return w+ \`
\ ` +f}async onload(){await super.onload(),this.disableAutoPlay(),s("ytd-consent-bump-v2-lightbox",this.app).then(()=>{this.controller.send("mx-open-browser",{message:"Seems like YouTube is showing a consent popup that block playback. To continue playback, you should handle it in dedicated login browser. ",url:"https://youtube.com"})})}get app(){return this.media.closest("ytd-app")}get moviePlayer(){return this.media.closest("#movie_player")}async disableAutoPlay(){let e=await s('button.ytp-button[data-tooltip-target-id="ytp-autonav-toggle-button"]',this.app);if(!e)throw new Error("Autoplay button not found");let n=e.querySelector(".ytp-autonav-toggle-button");if(!n)throw new Error("Autoplay button label not found");let r=()=>n.getAttribute("aria-checked")==="true";r()&&(e.click(),await new Promise(m=>{let c=new MutationObserver(()=>{r()||(c.disconnect(),m())});c.observe(n,{attributes:!0})}))}enterWebFullscreen(){this.assignParentClass(this.moviePlayer),(async()=>{let t=await s("#movie_player .ytp-size-button"),e=()=>!!this.app.querySelector("ytd-watch-flexy[theater]");if(!e())do t.click(),await M(200);while(!e());window.dispatchEvent(new Event("resize"))})()}};function M(o){return new Promise(t=>setTimeout(t,o))}var{waitForSelector:p}=a(),l=class extends i{findMedia(){return p("ytd-app #movie_player video")}async onload(){await super.onload(),p(".video-ads.ytp-ad-module",this.app).then(t=>this.removePlayerAD(t))}removePlayerAD(t){let e=new MutationObserver(()=>this.skipAd());this.registerInterval(()=>this.skipAd(),500),e.observe(t,{childList:!0,subtree:!0})}skipAd(){let t=this.media,e=this.moviePlayer.querySelector(".ytp-ad-skip-button")||this.moviePlayer.querySelector(".ytp-ad-skip-button-modern"),n=this.moviePlayer.querySelector(".video-ads.ytp-ad-module .ytp-ad-player-overlay");if(t)if(e){if(window.location.href.indexOf("https://m.youtube.com/")===-1&&(t.muted=!0),t.currentTime>.5){t.currentTime=t.duration;return}e.click(),T.call(e)}else n&&(t.currentTime=t.duration)}};function T(){let o=new Touch({identifier:Date.now(),target:this,clientX:12,clientY:34,radiusX:56,radiusY:78,rotationAngle:0,force:1}),t=new TouchEvent("touchstart",{bubbles:!0,cancelable:!0,view:window,touches:[o],targetTouches:[o],changedTouches:[o]});this.dispatchEvent(t);let e=new TouchEvent("touchend",{bubbles:!0,cancelable:!0,view:window,touches:[],targetTouches:[],changedTouches:[o]});this.dispatchEvent(e)}
` ;var iC={bilibili:eC,youtube:nC,vimeo:tC,coursera:void 0,generic:void 0};var rC={generic:t=>t,bilibili:t=>t.replaceAll(/[-_]哔哩哔哩.+ $ |[-_]bilibili.+ $ |-(?:番剧|电影|纪录片|国创|电视剧|综艺)-.+/g,""),youtube:t=>t.replace(/^ \( \d + \) /,"").replace(/ - YouTube $ /,""),vimeo:t=>t.replace(/ on Vimeo $ /,""),coursera:t=>t.replace(/ \| Coursera $ /,"")};var EC=require("url"),lo=require("obsidian");var fu=require("obsidian");function Lf(t){return t===0?"00:00:00":fu.moment.utc(fu.moment.duration({seconds:t}).as("milliseconds")).format("HH:mm:ss")}function oC(t){return t===0?"DT0S":fu.moment.duration(t,"seconds").toISOString()}var sC=(t,e=2)=>{let n,i;return Number.isInteger(t)?n=t.toString():[n,i]=t.toFixed(e).split("."),n.length===1&&(n="0"+n),i?n+"."+i:n};function mu(t){return t.replace(/t=[^&]+/,"")}function lb(t,e){if(t=mu(t.trim().replace(/^#/,"")),!e)return t;let n=cb(e);return t? ` $ { t } & $ { n } ` :n??""}function lC(t,e){let n=Number.isNaN(t)?-1:t,i=Number.isNaN(e)?-1:e;return{start:n,end:i}}function cb(t){let{start:e,end:n}=t,i={get start(){return aC(e)},get end(){return aC(n)}};return Pn(t)? ` t = $ { i . start } ` :e<0&&n>0?Number.isFinite(n)? ` t = , $ { i . end } ` :null:e>0&&n>0? ` t = $ { i . start } , $ { i . end } ` :null}function aC(t){if(Number.isNaN(t)||t<0)throw new Error("durationInSecond must be positive");if(t===1/0)return"e";let e=fu.moment.duration(t,"seconds"),n=e.hours(),i=e.minutes(),r=e.seconds()+e.milliseconds()/1e3;if(n>0)return[n,...[i,r].map(s=>sC(s))].join(":");if(i>0)return[i,r].map(s=>sC(s)).join(":");if(r>0)return r.toFixed(2);throw new Error("durationInSecond must be positive")}var cC=require("obsidian"),EF=cC.Platform.isWin?require("path/win32"):require("path/posix"),ii=EF;function Ei(t){let e=new URL(t.href),n=mu(e.hash);return e.hash===n?t:e}function dC(t){return t.hostname==="b23.tv"?!1:t.hostname.endsWith(".bilibili.com")&&(t.pathname.startsWith("/video/")||t.pathname.startsWith("/bangumi/play/"))?t.pathname.split("/").filter(Boolean).slice(-1)[0]:null}var pC=t=>dC(t)===null?null:"bilibili",hC=t=>{let e=dC(t);if(e===null)throw new Error("Invalid bilibili url");let n=Bt(t.hash),i=SF(t),r=qn(t);r.searchParams.forEach((o,l,c)=>{l==="p"&&o!=="1"||c.delete(l)}),r.searchParams.sort();let s=r.searchParams.get("p")??"1",a=new URL(r);return!n&&i>0&&(n={start:i,end:-1}),n&&Pn(n)&&(a=uC(a,n)),a=Ei(a),{source:a,cleaned:r,tempFrag:n,print:o=>uC(a,o).href,id: ` $ { s } @ $ { e } ` ||void 0}};function uC(t,e){let n=new URL(t.href);return n.searchParams.set("t",String(e.start)),n}function SF(t){let e=t.searchParams.get("t"),n=e?Number(e):NaN;return Number.isNaN(n)?NaN:n}var fC=t=>t.hostname==="www.coursera.org"?"coursera":null,mC=t=>{let e=qn(t);e.search="";let n=new URL(t);return{cleaned:e,source:Ei(n),tempFrag:Bt(t.hash)}};var gC=require("obsidian");var vC=t=>({type:"generic",cleaned:qn(t),source:Ei(t.protocol==="file:"?PF(t):t),tempFrag:Bt(t.hash)});function PF(t){let e=new URL(gC.Platform.resourcePathPrefix+t.href.substring(8));return e.search=Date.now().toString(),e}var yC=t=>t.hostname!=="vimeo.com"||!t.pathname.substring(1).match(/^ \d + $ /)?null:"vimeo",_C=t=>{let e=t.pathname.substring(1);if(!e.match(/^ \d + $ /))throw new Error("Invalid vimeo url");let n=qn(t);n.search="";let i=new URL(t);return{cleaned:n,source:Ei(i),tempFrag:Bt(t.hash),id:e}};function xC(t){let e=t.pathname.split("/");if(t.hostname==="youtu.be"&&e.length===2)return e[1];if(t.hostname==="www.youtube.com"||t.hostname==="youtube.com"){if(e.length===2&&e[1]==="watch")return t.searchParams.get("v");let n=["shorts","embed","v"];if(e.length===3&&n.includes(e[1]))return e[2]}return null}var kC=t=>xC(t)?"youtube":null,TC=t=>{let e=Bt(t.hash),n=ub(t.searchParams.get("t")),i=ub(t.searchParams.get("start")),r=ub(t.searchParams.get("end")),s=xC(t);if(!s)throw new Error("Invalid youtube url");let a=qn("https://www.youtube.com/watch");a.search=new URLSearchParams({v:s}).toString();let o=new URL(a);return t.searchParams.has("list")&&o.searchParams.set("list",t.searchParams.get("list")),e||(i>0&&r>0?e=lC(i,r):i>0?e={start:i,end:1/0}:r>0?e={start:0,end:r}:n>0&&(e={start:n,end:-1})),e&&(o=wC(o,e)
-- -
` );return await s.processFrontMatter(o,l=>{Object.assign(l,i(o.path))}),o};function BM(t){let e=[];return t.iterateAllLeaves(n=>{yg(n.view.getViewType())&&e.push(n)}),e.sort(Rm),e}function S4(t,e,n){let i=n.getLeavesOfType(e).filter(r=>Li(t)?HM(r,t):qM(r,t));return i.sort(Rm),i}function Ub(t){return!!t&&yg(t.view.getViewType())}function Rm(t,e){return e.activeTime-t.activeTime}function P4(t,e){e.setEphemeralState({subpath:t})}function C4(t,e,n){return i=>{let r=n.workspace.activeEditor;if(!r)return t?t(i):void 0;if(e&&r.getMode()!=="preview")return r instanceof Lm.MarkdownView&&r.inlineTitleEl.isActiveElement()?void 0:e(i,r.editor,r)}}function Zr({playerCheckCallback:t,noteCheckCallback:e,...n},i){let{app:r}=i,s=i.addCommand({...n,checkCallback:C4(t&&(a=>!t||!Ub(r.workspace.activeLeaf)?!1:a?!0:t(a,r.workspace.activeLeaf.view)),e&&((a,o,l)=>{if(!l.file)return!1;let c=i.mediaNote.findMedia(l.file),u=i.leafOpener.detectActiveMediaLeaf(r.workspace.activeLeaf);return e(a,u?.view,{isMediaNote:c,file:l.file,editor:o})}),r)});return!e||!n.menu||i.registerEvent(i.app.workspace.on("editor-menu",(a,o,l)=>{if(!l.file)return!1;let c=i.mediaNote.findMedia(l.file),u=i.leafOpener.detectActiveMediaLeaf(r.workspace.activeLeaf);if(!e(!0,u?.view,{isMediaNote:c,file:l.file,editor:o}))return;let d=l.file;a.addItem(p=>{n.icon&&p.setIcon(n.icon),n.name&&p.setTitle(n.name),n.section&&p.setSection(n.section),p.onClick(()=>{e(!1,u?.view,{isMediaNote:c,file:d,editor:o})})})})),s}function YM(t,{onKeyDown:e,onTrigger:n,onKeyUp:i}){let r=null,s=new Set;return t.register(()=>{s.forEach(a=>{window.removeEventListener("keyup",a,{capture:!0})})}),t.registerDomEvent(window,"keydown",a=>{if(!r)return;let o=a.target;if(o.instanceOf(HTMLElement)&&o.matches("input.prompt-input"))return;let l=a;if(e(a,...r),i){let c=r,u=d=>{let p= $ 4(l);(d.code===l.code&&p.every(h=>Lm.Keymap.isModifier(d,h))||p.some(h=>d.key===h))&&(i(d,...c),window.removeEventListener("keyup",u,{capture:!0}),s.delete(u))};s.add(u),window.addEventListener("keyup",u,{passive:!0,capture:!0})}r=null},!0),{callback:(...a)=>{r=a,setTimeout(()=>{r===null||(n?.(...a),r=null)},0)}}}function $ 4(t){let e=[];return t.ctrlKey&&e.push("Ctrl"),t.altKey&&e.push("Alt"),t.shiftKey&&e.push("Shift"),t.metaKey&&e.push("Meta"),e}var M4=t=>[{id:"toggle-play",label:"Play/pause",icon:"play",action:e=>{e.paused=!e.paused}},...[.5,1,2,5,10,30,60].flatMap(e=>[{id: ` forward - $ { e } s ` ,label: ` Forward $ { e } s ` ,icon:"forward",action:n=>{n.currentTime+=e},repeat:!0},{id: ` rewind - $ { e } s ` ,label: ` Rewind $ { e } s ` ,icon:"rewind",action:n=>{n.currentTime-=e},repeat:!0}]),{id:"toggle-mute",label:"Mute/unmute",icon:"volume-x",action:e=>{e.muted=!e.muted}},{id:"toggle-fullscreen",label:"Enter/exit fullscreen",icon:"expand",check:e=>e.state.canFullscreen,action:e=>{e.state.fullscreen?e.exitFullscreen():e.enterFullscreen()}},...R4(t)];function R4(t){let e=null,n=(0,Po.debounce)(()=>e?.hide(),2e3,!0);function i(a){!e||e.noticeEl.isConnected===!1?e=new Po.Notice(a,0):e.setMessage(a),n()}function r(a){!e||e.noticeEl.isConnected===!1?e=new Po.Notice(a,0):e.setMessage(a)}function s(a){new Po.Notice(a,2e3)}return[...yn.filter(a=>a>1).map(a=>{let o=!1,{callback:l}=YM(t,{onKeyDown(c,u){c.repeat&&(o=!0,u.playbackRate=a,r( ` Fast forwarding at $ { a } x ` ))},onKeyUp(c,u){o&&(u.playbackRate=1,e?.hide())}});return{id: ` fast - forward - $ { a } x ` ,label: ` Fast forward at $ { a } x by holding hotkey ` ,icon:"forward",action:l,repeat:!0}}),...yn.map(a=>({id: ` set - speed - $ { a } x ` ,label: ` Set playback speed to $ { a } x ` ,icon:"gauge",action:async o=>{o.playbackRate=a,i( ` Speed set to $ { a } x ` )}})),{id:"reset-speed",label:"Reset playback speed",icon:"reset",check:a=>a.state.playbackRate!==1,action:a=>{a.playbackRate=1,s("Speed reset to 1x")}},{id:"increase-speed",label:"Increase playback speed",icon:"arrow-up",action:a=>{let o=a.playbackRate;if(o>=yn.last()){s("Cannot increase speed further");return}let l=yn.find(c=>c>o);a.playbackRate=l,i( ` Speed increased to $ { l } x ` )}},{id:"decrease-speed",label:"Decrease playback speed",icon:"arrow-down",action:a=>{let o=a.playbackRate;if(o<=yn.first()){s("Cannot de
- { { TIMESTAMP } } ` ,screenshotEmbedTemplate:"{{TITLE}}{{DURATION}}|50",screenshotTemplate: `
- ! { { SCREENSHOT } } { { TIMESTAMP } } ` ,insertBefore:!1,timestampOffset:0,biliDefaultQuality:80,screenshotFormat:"image/webp"};function FR(){return Ye.Platform.isDesktopApp?require("os").hostname()||(Ye.Platform.isMacOS?"Mac":Ye.Platform.isWin?"Windows":Ye.Platform.isLinux?"Linux":"Desktop"):Ye.Platform.isIosApp?Ye.Platform.isPhone?"iPhone":Ye.Platform.isTablet?"iPad":"iOS Device":Ye.Platform.isAndroidApp?Ye.Platform.isPhone?"Android Phone":Ye.Platform.isTablet?"Android Tablet":"Android Device":"Unknown Device"}function zR(t){return new Map(t.map(e=>[ ` $ { e . appId } % $ { e . protocol } ` ,e.replace]))}function Z4(t){return Array.from(t.entries()).map(([e,n])=>{let[i,r]=e.split("%");return{appId:i,protocol:r,replace:n}}).filter(e=>e.appId&&e.protocol&&e.replace)}function jR(t){let e=(0,Ye.debounce)(n=>{let i=mg(n,OR);t.saveData({...i,urlMappingData:n.getUrlMappingData()})},1e3);return $ p((n,i)=>({...ed(VR,["urlMappingData"]),setScreenshotFormat(r){n({screenshotFormat:r}),e(i())},setScreenshotQuality(r){n({screenshotQuality:r??void 0}),e(i())},setDefaultLanguage(r){n({defaultLanguage:r?.format()}),e(i())},getDefaultLang(){let r=i().defaultLanguage,s=Ye.moment.locale();return r&&!fb(r)?(new Ye.Notice( ` Invalid language code detected in preferences : $ { r } , reverting to $ { s } . ` ),n({defaultLanguage:void 0}),e(i()),s):r??Ye.moment.locale()},getUrlMappingData(){return Z4(i().urlMapping)},setBiliDefaultQuality(r){n({biliDefaultQuality:r}),e(i())},setInsertPosition(r){n({insertBefore:r==="before"}),e(i())},setLinkHandler(r,s){n(a=>{let o={...a.linkHandler};for(let l of Object.keys(o)){let c=l;o[c]=o[c].filter(u=>typeof u=="string"?u!==r:typeof r=="string"||!J4(u,r)),c===s&&(o[c]=[...o[c],r])}return{linkHandler:o}}),e(i())},setTimestampOffset(r){n({timestampOffset:r}),e(i())},setDefaultMxLinkBehavior:r=>{let s;r==="split"||r==="split-horizontal"?s="window":r==="window"?s="tab":r==="tab"?s="split":s=null,n({defaultMxLinkClick:{click:r,alt:s}}),e(i())},setTemplate(r,s){switch(r){case"screenshot":n({screenshotTemplate:s});break;case"screenshotEmbed":n({screenshotEmbedTemplate:s});break;case"timestamp":n({timestampTemplate:s});break;default:(0,UR.assertNever)(r)}e(i())},setMxLinkAltBehavior:r=>{n(({defaultMxLinkClick:s})=>({defaultMxLinkClick:{...s,alt:r}})),e(i())},urlMapping:zR(VR.urlMappingData),setDefaultVolume:r=>{n({defaultVolume:r}),e(i())},getUrlMapping:r=>i().urlMapping.get( ` $ { t . app . appId } % $ { r } ` ),setUrlMapping:(r,s)=>{if(r.includes("%"))throw new Error("Protocol cannot contain %");let a= ` $ { t . app . appId } % $ { r } ` ;n(o=>({urlMapping:new Map(o.urlMapping).set(a,s),devices:o.getDeviceName()?o.devices:[...o.devices,{appId:t.app.appId,name:FR()}]})),e(i())},removeUrlMapping:r=>{if(r.includes("%"))throw new Error("Protocol cannot contain %");n(s=>{let a= ` $ { t . app . appId } % $ { r } ` ,o=new Map(s.urlMapping);return o.delete(a),{urlMapping:o}}),e(i())},getDeviceName(r=t.app.appId){return i().devices.find(s=>s.appId===r)?.name},getDeviceNameWithDefault(r=t.app.appId){let s=i().devices.find(a=>a.appId===r);return s?s.name:r===t.app.appId?FR():"Unknown Device"},setDeviceName(r,s=t.app.appId){n({devices:[...i().devices.filter(a=>a.appId!==s),{appId:s,name:r}]}),e(i())},setLoadStrategy:r=>{n({loadStrategy:r}),e(i())},setScreenshotFolder(r){r!==null?(r=(0,Ye.normalizePath)(r),r==="."?r="/":r.startsWith("./")&&(r=r.slice(2)),n({screenshotFolderPath:r})):n({screenshotFolderPath:void 0})},load:async()=>{let r=await t.loadData();if(!r)return;let{urlMappingData:s,...a}=mg(r,OR);n({...a,urlMapping:zR(s??[])})},save:()=>{e(i())}}))}function J4(t,e){let n=new Set([...Object.keys(t),...Object.keys(e)]);for(let i of n)if(t[i]!==e[i])return!1;return!0}var BR=require("url"),mx= $ (pb()),Z=require("obsidian");var Bm=class extends Z.PluginSettingTab{constructor(n){super(n.app,n);_(this,"plugin");this.plugin=n}get state(){return this.plugin.settings.getState()}get sub(){return this.plugin.settings.subscribe.bind(this.plugin.settings)}protocol(){new Z.Setting(this.containerEl).setHeading().setName("Protocols").setDesc("Create custom protocols that resolve link per device");let n=this.containe
const { session , webContents , net } = require ( "electron" ) ;
const webviewSession = session . fromPartition ( $ { n } ) ;
const webContent = webContents . fromId ( $ { t } ) ;
webviewSession . webRequest . onSendHeaders (
{
urls : $ { Sx . filter } , type : $ { Sx . types }
} , ( { url , method , requestHeaders , webContentsId } ) => {
if ( method !== "GET" || webContentsId === undefined ) return ;
webContent . send ( $ { qu } , { type : $ { Sx . type } , url , method , requestHeaders , webContentsId } ) ;
} )
` .trim():(console.log("partition disabled, cannot watch requests"),"")}async function cL(t,e){return g6(t.pipeThrough(new DecompressionStream("gzip")),e)}function uL(t){return new ReadableStream({start(e){e.enqueue(new Uint8Array(t)),e.close()}})}async function g6(t,e){let n=t.getReader(),i=[];for(;;){let{done:r,value:s}=await n.read();if(r)break;i.push(s)}return new Blob(i,{type:e})}function v6(t){return ` $ { t . aid } - $ { t . bvid } - $ { t . cid } ` }var Bu,Wu,Lo,Ym=class extends Qm.Component{constructor(n){super();this.plugin=n;V(this,Bu,Ip());V(this,Wu,new Map);V(this,Lo,new Map);_(this,"app");_(this,"db");this.app=n.app,this.db=aL( ` mx - cache - $ { this . app . appId } ` ,1,{upgrade(i){i.createObjectStore("bili-subtitle")}}),this.app=n.app}async getPlayerApiResp(n,i=1e4){let{aid:r,bvid:s,cid:a}=await n.methods.bili_getManifest(),o=v6({aid:r,bvid:s,cid:a}),l=k(this,Wu).get(o);if(l)return l;let c=k(this,Lo).get( ` $ { s } - $ { a } ` )??k(this,Lo).get( ` $ { r } - $ { a } ` );c||(c=await new Promise((p,h)=>{let y=k(this,Bu).on("player_v2",w=>{a===w.cid&&(r===w.aid||s===w.bvid)&&(p(w.url),window.clearTimeout(v))}),v=window.setTimeout(()=>{y(),h(new Error("player_v2 timeout: "+o))},i)}));let u=await n.methods.fetch(c,{gzip:!1,credentials:"include"});if(u.type!=="application/json")throw new Error( ` Unexpected response type $ { u . type } for player _v2 api ` );let d=JSON.parse(new TextDecoder().decode(u.ab));if(d.code!==0)throw new Error( ` player _v2 api error : ( $ { d . code } ) $ { d . message } ` );return k(this,Wu).set(o,d.data),d.data}async cacheSubtitle(n,i){(await this.db).put("bili-subtitle",i,n.toString())}async getCachedSubtitle(n){let r=await(await this.db).get("bili-subtitle",n.toString());if(!r)return null;let{ab:s,gzip:a}=r,o="application/json",c=await(a?await cL(uL(s),o):new Blob([s],{type:o})).text();return JSON.parse(c)}async hasSubtitle(n){return await(await this.db).count("bili-subtitle",n.toString())>0}async onload(){if(!Qm.Platform.isDesktopApp)throw new Error("Cannot register ipc events, not in desktop app");let n=require("path"),i=require("fs/promises"),{ipcRenderer:r}=require("electron"),s=require("@electron/remote"),a=(o,l)=>{if(l.type!=="player_v2")return;let c=new URL(l.url),u=c.searchParams.get("aid"),d=c.searchParams.get("bvid"),p=c.searchParams.get("cid");if(!u&&!d||!p)return;k(this,Bu).emit("player_v2",{url:l.url,aid:+u,bvid:d,cid:+p});let h=d? ` $ { d } - $ { p } ` : ` $ { u } - $ { p } ` ;k(this,Lo).set(h,l.url)};r.on(qu,a);try{let o=s.getCurrentWebContents().id,l=lL(o,this.app),c=n.join(this.app.vault.adapter.getBasePath(),...this.app.vault.configDir.split("/"), ` mx - player - hack . $ { Date . now ( ) } . js ` );await i.writeFile(c,l,"utf-8");try{await s.require(c),console.log("mx-player-hack loaded")}finally{await i.rm(c,{force:!0,maxRetries:5})}this.register(()=>{r.off(qu,a)})}catch(o){throw r.off(qu,a),o}}};Bu=new WeakMap,Wu=new WeakMap,Lo=new WeakMap;var dL=require("obsidian");async function pL(){if(!dL.Platform.isDesktopApp)return;let t=Go(this.app.appId);t&&(this.settings.subscribe((e,n)=>{e.biliDefaultQuality!==n.biliDefaultQuality&&hx(t,e.biliDefaultQuality)}),await hx(t,this.settings.getState().biliDefaultQuality))}var OL= $ (Hm()),dg=require("obsidian");var Qu=class{constructor(t,e,n,i,r,s){_(this,"type",3);_(this,"name","");_(this,"prefix","");_(this,"value","");_(this,"suffix","");_(this,"modifier",3);this.type=t,this.name=e,this.prefix=n,this.value=i,this.suffix=r,this.modifier=s}hasCustomName(){return this.name!==""&&typeof this.name!="number"}},y6=/[ $ _ \p {ID_Start}]/u,_6=/[ $ _ \u 200C \u 200D \p {ID_Continue}]/u,Cx=".*";function w6(t,e){return(e?/^[ \x 00- \x FF]* $ /:/^[ \x 00- \x 7F]* $ /).test(t)}function vL(t,e=!1){let n=[],i=0;for(;i<t.length;){let r=t[i],s=function(a){if(!e)throw new TypeError(a);n.push({type:"INVALID_CHAR",index:i,value:t[i++]})};if(r==="*"){n.push({type:"ASTERISK",index:i,value:t[i++]});continue}if(r==="+"||r==="?"){n.push({type:"OTHER_MODIFIER",index:i,value:t[i++]});continue}if(r===" \\ "){n.push({type:"ESCAPED_CHAR",index:i++,value:t[i++]});continue}if(r==="{"){n.push({type:"OPEN",index:i,value:t[i++]});continue}if(r==="}"){n.push({type:"CLOSE",index:i,value:t[i++]});continue}if(r===":")
/ * ! B u n d l e d l i c e n s e i n f o r m a t i o n :
react / cjs / react . production . min . js :
( * *
* @ license React
* react . production . min . js
*
* Copyright ( c ) Facebook , Inc . and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* )
scheduler / cjs / scheduler . production . min . js :
( * *
* @ license React
* scheduler . production . min . js
*
* Copyright ( c ) Facebook , Inc . and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* )
react - dom / cjs / react - dom . production . min . js :
( * *
* @ license React
* react - dom . production . min . js
*
* Copyright ( c ) Facebook , Inc . and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* )
use - sync - external - store / cjs / use - sync - external - store - shim . production . min . js :
( * *
* @ license React
* use - sync - external - store - shim . production . min . js
*
* Copyright ( c ) Facebook , Inc . and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* )
use - sync - external - store / cjs / use - sync - external - store - shim / with - selector . production . min . js :
( * *
* @ license React
* use - sync - external - store - shim / with - selector . production . min . js
*
* Copyright ( c ) Facebook , Inc . and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* )
react / cjs / react - jsx - runtime . production . min . js :
( * *
* @ license React
* react - jsx - runtime . production . min . js
*
* Copyright ( c ) Facebook , Inc . and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* )
* /