@aigamo/hydrangean-diva 0.0.1-alpha.23 → 0.0.1-alpha.24

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.
@@ -0,0 +1 @@
1
+ export * from './PlayQueueStoreContext';
@@ -1 +1,2 @@
1
+ export * from './contexts';
1
2
  export * from './interfaces';
package/dist/index.cjs.js CHANGED
@@ -1,15 +1,15 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("mobx"),v=require("react"),sr=require("@emotion/cache"),l=require("@elastic/eui"),S=require("@fluentui/react-icons"),H=require("@aigamo/nostalgic-diva"),O=require("mobx-react-lite"),lr=require("react-sortablejs"),cr=require("ajv"),pt=require("lodash-es"),ur=require("@tanstack/react-router");function dr(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const K=dr(v),Qe=81;class Ke{makeObservable(t,r){return d.makeObservable(t,r)}}class fr{makeObservable(t,r){return t}}var $=(e=>(e.Off="Off",e.All="All",e.One="One",e))($||{}),ke={exports:{}},me={};var yt;function pr(){if(yt)return me;yt=1;var e=v,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,a=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function u(y,m,b){var E,I={},z=null,j=null;b!==void 0&&(z=""+b),m.key!==void 0&&(z=""+m.key),m.ref!==void 0&&(j=m.ref);for(E in m)i.call(m,E)&&!s.hasOwnProperty(E)&&(I[E]=m[E]);if(y&&y.defaultProps)for(E in m=y.defaultProps,m)I[E]===void 0&&(I[E]=m[E]);return{$$typeof:t,type:y,key:z,ref:j,props:I,_owner:a.current}}return me.Fragment=r,me.jsx=u,me.jsxs=u,me}var he={};var mt;function yr(){return mt||(mt=1,process.env.NODE_ENV!=="production"&&(function(){var e=v,t=Symbol.for("react.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),y=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),j=Symbol.for("react.offscreen"),F=Symbol.iterator,Y="@@iterator";function J(n){if(n===null||typeof n!="object")return null;var c=F&&n[F]||n[Y];return typeof c=="function"?c:null}var L=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function k(n){{for(var c=arguments.length,p=new Array(c>1?c-1:0),g=1;g<c;g++)p[g-1]=arguments[g];D("error",n,p)}}function D(n,c,p){{var g=L.ReactDebugCurrentFrame,R=g.getStackAddendum();R!==""&&(c+="%s",p=p.concat([R]));var x=p.map(function(w){return String(w)});x.unshift("Warning: "+c),Function.prototype.apply.call(console[n],console,x)}}var _=!1,f=!1,V=!1,se=!1,Pe=!1,Ee;Ee=Symbol.for("react.module.reference");function Me(n){return!!(typeof n=="string"||typeof n=="function"||n===i||n===s||Pe||n===a||n===b||n===E||se||n===j||_||f||V||typeof n=="object"&&n!==null&&(n.$$typeof===z||n.$$typeof===I||n.$$typeof===u||n.$$typeof===y||n.$$typeof===m||n.$$typeof===Ee||n.getModuleId!==void 0))}function Ne(n,c,p){var g=n.displayName;if(g)return g;var R=c.displayName||c.name||"";return R!==""?p+"("+R+")":p}function we(n){return n.displayName||"Context"}function B(n){if(n==null)return null;if(typeof n.tag=="number"&&k("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case i:return"Fragment";case r:return"Portal";case s:return"Profiler";case a:return"StrictMode";case b:return"Suspense";case E:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case y:var c=n;return we(c)+".Consumer";case u:var p=n;return we(p._context)+".Provider";case m:return Ne(n,n.render,"ForwardRef");case I:var g=n.displayName||null;return g!==null?g:B(n.type)||"Memo";case z:{var R=n,x=R._payload,w=R._init;try{return B(w(x))}catch{return null}}}return null}var Q=Object.assign,X=0,Se,Ie,le,Re,ce,Ce,Te;function xe(){}xe.__reactDisabledLog=!0;function $e(){{if(X===0){Se=console.log,Ie=console.info,le=console.warn,Re=console.error,ce=console.group,Ce=console.groupCollapsed,Te=console.groupEnd;var n={configurable:!0,enumerable:!0,value:xe,writable:!0};Object.defineProperties(console,{info:n,log:n,warn:n,error:n,group:n,groupCollapsed:n,groupEnd:n})}X++}}function je(){{if(X--,X===0){var n={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:Q({},n,{value:Se}),info:Q({},n,{value:Ie}),warn:Q({},n,{value:le}),error:Q({},n,{value:Re}),group:Q({},n,{value:ce}),groupCollapsed:Q({},n,{value:Ce}),groupEnd:Q({},n,{value:Te})})}X<0&&k("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ue=L.ReactCurrentDispatcher,de;function re(n,c,p){{if(de===void 0)try{throw Error()}catch(R){var g=R.stack.trim().match(/\n( *(at )?)/);de=g&&g[1]||""}return`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("mobx"),v=require("react"),sr=require("@emotion/cache"),l=require("@elastic/eui"),S=require("@fluentui/react-icons"),H=require("@aigamo/nostalgic-diva"),O=require("mobx-react-lite"),lr=require("react-sortablejs"),cr=require("ajv"),mt=require("lodash-es"),ur=require("@tanstack/react-router");function dr(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const K=dr(v),Qe=81;class Ke{makeObservable(t,r){return d.makeObservable(t,r)}}class fr{makeObservable(t,r){return t}}const Xe=v.createContext(void 0),Ze=()=>v.useContext(Xe);var $=(e=>(e.Off="Off",e.All="All",e.One="One",e))($||{}),ke={exports:{}},me={};var ht;function pr(){if(ht)return me;ht=1;var e=v,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,a=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function u(y,m,b){var E,I={},z=null,j=null;b!==void 0&&(z=""+b),m.key!==void 0&&(z=""+m.key),m.ref!==void 0&&(j=m.ref);for(E in m)i.call(m,E)&&!s.hasOwnProperty(E)&&(I[E]=m[E]);if(y&&y.defaultProps)for(E in m=y.defaultProps,m)I[E]===void 0&&(I[E]=m[E]);return{$$typeof:t,type:y,key:z,ref:j,props:I,_owner:a.current}}return me.Fragment=r,me.jsx=u,me.jsxs=u,me}var he={};var vt;function yr(){return vt||(vt=1,process.env.NODE_ENV!=="production"&&(function(){var e=v,t=Symbol.for("react.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),y=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),j=Symbol.for("react.offscreen"),F=Symbol.iterator,Y="@@iterator";function J(n){if(n===null||typeof n!="object")return null;var c=F&&n[F]||n[Y];return typeof c=="function"?c:null}var L=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function k(n){{for(var c=arguments.length,p=new Array(c>1?c-1:0),g=1;g<c;g++)p[g-1]=arguments[g];D("error",n,p)}}function D(n,c,p){{var g=L.ReactDebugCurrentFrame,R=g.getStackAddendum();R!==""&&(c+="%s",p=p.concat([R]));var x=p.map(function(w){return String(w)});x.unshift("Warning: "+c),Function.prototype.apply.call(console[n],console,x)}}var _=!1,f=!1,V=!1,se=!1,Pe=!1,Ee;Ee=Symbol.for("react.module.reference");function Me(n){return!!(typeof n=="string"||typeof n=="function"||n===i||n===s||Pe||n===a||n===b||n===E||se||n===j||_||f||V||typeof n=="object"&&n!==null&&(n.$$typeof===z||n.$$typeof===I||n.$$typeof===u||n.$$typeof===y||n.$$typeof===m||n.$$typeof===Ee||n.getModuleId!==void 0))}function Ne(n,c,p){var g=n.displayName;if(g)return g;var R=c.displayName||c.name||"";return R!==""?p+"("+R+")":p}function we(n){return n.displayName||"Context"}function B(n){if(n==null)return null;if(typeof n.tag=="number"&&k("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case i:return"Fragment";case r:return"Portal";case s:return"Profiler";case a:return"StrictMode";case b:return"Suspense";case E:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case y:var c=n;return we(c)+".Consumer";case u:var p=n;return we(p._context)+".Provider";case m:return Ne(n,n.render,"ForwardRef");case I:var g=n.displayName||null;return g!==null?g:B(n.type)||"Memo";case z:{var R=n,x=R._payload,w=R._init;try{return B(w(x))}catch{return null}}}return null}var Q=Object.assign,X=0,Se,Ie,le,Re,ce,Ce,Te;function xe(){}xe.__reactDisabledLog=!0;function $e(){{if(X===0){Se=console.log,Ie=console.info,le=console.warn,Re=console.error,ce=console.group,Ce=console.groupCollapsed,Te=console.groupEnd;var n={configurable:!0,enumerable:!0,value:xe,writable:!0};Object.defineProperties(console,{info:n,log:n,warn:n,error:n,group:n,groupCollapsed:n,groupEnd:n})}X++}}function je(){{if(X--,X===0){var n={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:Q({},n,{value:Se}),info:Q({},n,{value:Ie}),warn:Q({},n,{value:le}),error:Q({},n,{value:Re}),group:Q({},n,{value:ce}),groupCollapsed:Q({},n,{value:Ce}),groupEnd:Q({},n,{value:Te})})}X<0&&k("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ue=L.ReactCurrentDispatcher,de;function re(n,c,p){{if(de===void 0)try{throw Error()}catch(R){var g=R.stack.trim().match(/\n( *(at )?)/);de=g&&g[1]||""}return`
2
2
  `+de+n}}var fe=!1,ne;{var qe=typeof WeakMap=="function"?WeakMap:Map;ne=new qe}function h(n,c){if(!n||fe)return"";{var p=ne.get(n);if(p!==void 0)return p}var g;fe=!0;var R=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var x;x=ue.current,ue.current=null,$e();try{if(c){var w=function(){throw Error()};if(Object.defineProperty(w.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(w,[])}catch(U){g=U}Reflect.construct(n,[],w)}else{try{w.call()}catch(U){g=U}n.call(w.prototype)}}else{try{throw Error()}catch(U){g=U}n()}}catch(U){if(U&&g&&typeof U.stack=="string"){for(var P=U.stack.split(`
3
3
  `),q=g.stack.split(`
4
4
  `),A=P.length-1,M=q.length-1;A>=1&&M>=0&&P[A]!==q[M];)M--;for(;A>=1&&M>=0;A--,M--)if(P[A]!==q[M]){if(A!==1||M!==1)do if(A--,M--,M<0||P[A]!==q[M]){var G=`
5
- `+P[A].replace(" at new "," at ");return n.displayName&&G.includes("<anonymous>")&&(G=G.replace("<anonymous>",n.displayName)),typeof n=="function"&&ne.set(n,G),G}while(A>=1&&M>=0);break}}}finally{fe=!1,ue.current=x,je(),Error.prepareStackTrace=R}var oe=n?n.displayName||n.name:"",ee=oe?re(oe):"";return typeof n=="function"&&ne.set(n,ee),ee}function pe(n,c,p){return h(n,!1)}function ie(n){var c=n.prototype;return!!(c&&c.isReactComponent)}function Z(n,c,p){if(n==null)return"";if(typeof n=="function")return h(n,ie(n));if(typeof n=="string")return re(n);switch(n){case b:return re("Suspense");case E:return re("SuspenseList")}if(typeof n=="object")switch(n.$$typeof){case m:return pe(n.render);case I:return Z(n.type,c,p);case z:{var g=n,R=g._payload,x=g._init;try{return Z(x(R),c,p)}catch{}}}return""}var ye=Object.prototype.hasOwnProperty,Ze={},et=L.ReactDebugCurrentFrame;function Oe(n){if(n){var c=n._owner,p=Z(n.type,n._source,c?c.type:null);et.setExtraStackFrame(p)}else et.setExtraStackFrame(null)}function qt(n,c,p,g,R){{var x=Function.call.bind(ye);for(var w in n)if(x(n,w)){var P=void 0;try{if(typeof n[w]!="function"){var q=Error((g||"React class")+": "+p+" type `"+w+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof n[w]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw q.name="Invariant Violation",q}P=n[w](c,w,g,p,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(A){P=A}P&&!(P instanceof Error)&&(Oe(R),k("%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).",g||"React class",p,w,typeof P),Oe(null)),P instanceof Error&&!(P.message in Ze)&&(Ze[P.message]=!0,Oe(R),k("Failed %s type: %s",p,P.message),Oe(null))}}}var zt=Array.isArray;function ze(n){return zt(n)}function Lt(n){{var c=typeof Symbol=="function"&&Symbol.toStringTag,p=c&&n[Symbol.toStringTag]||n.constructor.name||"Object";return p}}function Vt(n){try{return tt(n),!1}catch{return!0}}function tt(n){return""+n}function rt(n){if(Vt(n))return k("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Lt(n)),tt(n)}var nt=L.ReactCurrentOwner,Ut={key:!0,ref:!0,__self:!0,__source:!0},it,at;function Yt(n){if(ye.call(n,"ref")){var c=Object.getOwnPropertyDescriptor(n,"ref").get;if(c&&c.isReactWarning)return!1}return n.ref!==void 0}function Gt(n){if(ye.call(n,"key")){var c=Object.getOwnPropertyDescriptor(n,"key").get;if(c&&c.isReactWarning)return!1}return n.key!==void 0}function Ht(n,c){typeof n.ref=="string"&&nt.current}function Bt(n,c){{var p=function(){it||(it=!0,k("%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)",c))};p.isReactWarning=!0,Object.defineProperty(n,"key",{get:p,configurable:!0})}}function Wt(n,c){{var p=function(){at||(at=!0,k("%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)",c))};p.isReactWarning=!0,Object.defineProperty(n,"ref",{get:p,configurable:!0})}}var Jt=function(n,c,p,g,R,x,w){var P={$$typeof:t,type:n,key:c,ref:p,props:w,_owner:x};return P._store={},Object.defineProperty(P._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(P,"_self",{configurable:!1,enumerable:!1,writable:!1,value:g}),Object.defineProperty(P,"_source",{configurable:!1,enumerable:!1,writable:!1,value:R}),Object.freeze&&(Object.freeze(P.props),Object.freeze(P)),P};function Qt(n,c,p,g,R){{var x,w={},P=null,q=null;p!==void 0&&(rt(p),P=""+p),Gt(c)&&(rt(c.key),P=""+c.key),Yt(c)&&(q=c.ref,Ht(c,R));for(x in c)ye.call(c,x)&&!Ut.hasOwnProperty(x)&&(w[x]=c[x]);if(n&&n.defaultProps){var A=n.defaultProps;for(x in A)w[x]===void 0&&(w[x]=A[x])}if(P||q){var M=typeof n=="function"?n.displayName||n.name||"Unknown":n;P&&Bt(w,M),q&&Wt(w,M)}return Jt(n,P,q,R,g,nt.current,w)}}var Le=L.ReactCurrentOwner,ot=L.ReactDebugCurrentFrame;function ae(n){if(n){var c=n._owner,p=Z(n.type,n._source,c?c.type:null);ot.setExtraStackFrame(p)}else ot.setExtraStackFrame(null)}var Ve;Ve=!1;function Ue(n){return typeof n=="object"&&n!==null&&n.$$typeof===t}function st(){{if(Le.current){var n=B(Le.current.type);if(n)return`
5
+ `+P[A].replace(" at new "," at ");return n.displayName&&G.includes("<anonymous>")&&(G=G.replace("<anonymous>",n.displayName)),typeof n=="function"&&ne.set(n,G),G}while(A>=1&&M>=0);break}}}finally{fe=!1,ue.current=x,je(),Error.prepareStackTrace=R}var oe=n?n.displayName||n.name:"",ee=oe?re(oe):"";return typeof n=="function"&&ne.set(n,ee),ee}function pe(n,c,p){return h(n,!1)}function ie(n){var c=n.prototype;return!!(c&&c.isReactComponent)}function Z(n,c,p){if(n==null)return"";if(typeof n=="function")return h(n,ie(n));if(typeof n=="string")return re(n);switch(n){case b:return re("Suspense");case E:return re("SuspenseList")}if(typeof n=="object")switch(n.$$typeof){case m:return pe(n.render);case I:return Z(n.type,c,p);case z:{var g=n,R=g._payload,x=g._init;try{return Z(x(R),c,p)}catch{}}}return""}var ye=Object.prototype.hasOwnProperty,tt={},rt=L.ReactDebugCurrentFrame;function Oe(n){if(n){var c=n._owner,p=Z(n.type,n._source,c?c.type:null);rt.setExtraStackFrame(p)}else rt.setExtraStackFrame(null)}function qt(n,c,p,g,R){{var x=Function.call.bind(ye);for(var w in n)if(x(n,w)){var P=void 0;try{if(typeof n[w]!="function"){var q=Error((g||"React class")+": "+p+" type `"+w+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof n[w]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw q.name="Invariant Violation",q}P=n[w](c,w,g,p,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(A){P=A}P&&!(P instanceof Error)&&(Oe(R),k("%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).",g||"React class",p,w,typeof P),Oe(null)),P instanceof Error&&!(P.message in tt)&&(tt[P.message]=!0,Oe(R),k("Failed %s type: %s",p,P.message),Oe(null))}}}var zt=Array.isArray;function ze(n){return zt(n)}function Lt(n){{var c=typeof Symbol=="function"&&Symbol.toStringTag,p=c&&n[Symbol.toStringTag]||n.constructor.name||"Object";return p}}function Vt(n){try{return nt(n),!1}catch{return!0}}function nt(n){return""+n}function it(n){if(Vt(n))return k("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Lt(n)),nt(n)}var at=L.ReactCurrentOwner,Ut={key:!0,ref:!0,__self:!0,__source:!0},ot,st;function Yt(n){if(ye.call(n,"ref")){var c=Object.getOwnPropertyDescriptor(n,"ref").get;if(c&&c.isReactWarning)return!1}return n.ref!==void 0}function Gt(n){if(ye.call(n,"key")){var c=Object.getOwnPropertyDescriptor(n,"key").get;if(c&&c.isReactWarning)return!1}return n.key!==void 0}function Ht(n,c){typeof n.ref=="string"&&at.current}function Bt(n,c){{var p=function(){ot||(ot=!0,k("%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)",c))};p.isReactWarning=!0,Object.defineProperty(n,"key",{get:p,configurable:!0})}}function Wt(n,c){{var p=function(){st||(st=!0,k("%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)",c))};p.isReactWarning=!0,Object.defineProperty(n,"ref",{get:p,configurable:!0})}}var Jt=function(n,c,p,g,R,x,w){var P={$$typeof:t,type:n,key:c,ref:p,props:w,_owner:x};return P._store={},Object.defineProperty(P._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(P,"_self",{configurable:!1,enumerable:!1,writable:!1,value:g}),Object.defineProperty(P,"_source",{configurable:!1,enumerable:!1,writable:!1,value:R}),Object.freeze&&(Object.freeze(P.props),Object.freeze(P)),P};function Qt(n,c,p,g,R){{var x,w={},P=null,q=null;p!==void 0&&(it(p),P=""+p),Gt(c)&&(it(c.key),P=""+c.key),Yt(c)&&(q=c.ref,Ht(c,R));for(x in c)ye.call(c,x)&&!Ut.hasOwnProperty(x)&&(w[x]=c[x]);if(n&&n.defaultProps){var A=n.defaultProps;for(x in A)w[x]===void 0&&(w[x]=A[x])}if(P||q){var M=typeof n=="function"?n.displayName||n.name||"Unknown":n;P&&Bt(w,M),q&&Wt(w,M)}return Jt(n,P,q,R,g,at.current,w)}}var Le=L.ReactCurrentOwner,lt=L.ReactDebugCurrentFrame;function ae(n){if(n){var c=n._owner,p=Z(n.type,n._source,c?c.type:null);lt.setExtraStackFrame(p)}else lt.setExtraStackFrame(null)}var Ve;Ve=!1;function Ue(n){return typeof n=="object"&&n!==null&&n.$$typeof===t}function ct(){{if(Le.current){var n=B(Le.current.type);if(n)return`
6
6
 
7
- Check the render method of \``+n+"`."}return""}}function Kt(n){return""}var lt={};function Xt(n){{var c=st();if(!c){var p=typeof n=="string"?n:n.displayName||n.name;p&&(c=`
7
+ Check the render method of \``+n+"`."}return""}}function Kt(n){return""}var ut={};function Xt(n){{var c=ct();if(!c){var p=typeof n=="string"?n:n.displayName||n.name;p&&(c=`
8
8
 
9
- Check the top-level render call using <`+p+">.")}return c}}function ct(n,c){{if(!n._store||n._store.validated||n.key!=null)return;n._store.validated=!0;var p=Xt(c);if(lt[p])return;lt[p]=!0;var g="";n&&n._owner&&n._owner!==Le.current&&(g=" It was passed a child from "+B(n._owner.type)+"."),ae(n),k('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',p,g),ae(null)}}function ut(n,c){{if(typeof n!="object")return;if(ze(n))for(var p=0;p<n.length;p++){var g=n[p];Ue(g)&&ct(g,c)}else if(Ue(n))n._store&&(n._store.validated=!0);else if(n){var R=J(n);if(typeof R=="function"&&R!==n.entries)for(var x=R.call(n),w;!(w=x.next()).done;)Ue(w.value)&&ct(w.value,c)}}}function Zt(n){{var c=n.type;if(c==null||typeof c=="string")return;var p;if(typeof c=="function")p=c.propTypes;else if(typeof c=="object"&&(c.$$typeof===m||c.$$typeof===I))p=c.propTypes;else return;if(p){var g=B(c);qt(p,n.props,"prop",g,n)}else if(c.PropTypes!==void 0&&!Ve){Ve=!0;var R=B(c);k("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",R||"Unknown")}typeof c.getDefaultProps=="function"&&!c.getDefaultProps.isReactClassApproved&&k("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function er(n){{for(var c=Object.keys(n.props),p=0;p<c.length;p++){var g=c[p];if(g!=="children"&&g!=="key"){ae(n),k("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",g),ae(null);break}}n.ref!==null&&(ae(n),k("Invalid attribute `ref` supplied to `React.Fragment`."),ae(null))}}var dt={};function ft(n,c,p,g,R,x){{var w=Me(n);if(!w){var P="";(n===void 0||typeof n=="object"&&n!==null&&Object.keys(n).length===0)&&(P+=" 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 q=Kt();q?P+=q:P+=st();var A;n===null?A="null":ze(n)?A="array":n!==void 0&&n.$$typeof===t?(A="<"+(B(n.type)||"Unknown")+" />",P=" Did you accidentally export a JSX literal instead of a component?"):A=typeof n,k("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",A,P)}var M=Qt(n,c,p,R,x);if(M==null)return M;if(w){var G=c.children;if(G!==void 0)if(g)if(ze(G)){for(var oe=0;oe<G.length;oe++)ut(G[oe],n);Object.freeze&&Object.freeze(G)}else k("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 ut(G,n)}if(ye.call(c,"key")){var ee=B(n),U=Object.keys(c).filter(function(or){return or!=="key"}),Ye=U.length>0?"{key: someKey, "+U.join(": ..., ")+": ...}":"{key: someKey}";if(!dt[ee+Ye]){var ar=U.length>0?"{"+U.join(": ..., ")+": ...}":"{}";k(`A props object containing a "key" prop is being spread into JSX:
9
+ Check the top-level render call using <`+p+">.")}return c}}function dt(n,c){{if(!n._store||n._store.validated||n.key!=null)return;n._store.validated=!0;var p=Xt(c);if(ut[p])return;ut[p]=!0;var g="";n&&n._owner&&n._owner!==Le.current&&(g=" It was passed a child from "+B(n._owner.type)+"."),ae(n),k('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',p,g),ae(null)}}function ft(n,c){{if(typeof n!="object")return;if(ze(n))for(var p=0;p<n.length;p++){var g=n[p];Ue(g)&&dt(g,c)}else if(Ue(n))n._store&&(n._store.validated=!0);else if(n){var R=J(n);if(typeof R=="function"&&R!==n.entries)for(var x=R.call(n),w;!(w=x.next()).done;)Ue(w.value)&&dt(w.value,c)}}}function Zt(n){{var c=n.type;if(c==null||typeof c=="string")return;var p;if(typeof c=="function")p=c.propTypes;else if(typeof c=="object"&&(c.$$typeof===m||c.$$typeof===I))p=c.propTypes;else return;if(p){var g=B(c);qt(p,n.props,"prop",g,n)}else if(c.PropTypes!==void 0&&!Ve){Ve=!0;var R=B(c);k("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",R||"Unknown")}typeof c.getDefaultProps=="function"&&!c.getDefaultProps.isReactClassApproved&&k("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function er(n){{for(var c=Object.keys(n.props),p=0;p<c.length;p++){var g=c[p];if(g!=="children"&&g!=="key"){ae(n),k("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",g),ae(null);break}}n.ref!==null&&(ae(n),k("Invalid attribute `ref` supplied to `React.Fragment`."),ae(null))}}var pt={};function yt(n,c,p,g,R,x){{var w=Me(n);if(!w){var P="";(n===void 0||typeof n=="object"&&n!==null&&Object.keys(n).length===0)&&(P+=" 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 q=Kt();q?P+=q:P+=ct();var A;n===null?A="null":ze(n)?A="array":n!==void 0&&n.$$typeof===t?(A="<"+(B(n.type)||"Unknown")+" />",P=" Did you accidentally export a JSX literal instead of a component?"):A=typeof n,k("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",A,P)}var M=Qt(n,c,p,R,x);if(M==null)return M;if(w){var G=c.children;if(G!==void 0)if(g)if(ze(G)){for(var oe=0;oe<G.length;oe++)ft(G[oe],n);Object.freeze&&Object.freeze(G)}else k("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 ft(G,n)}if(ye.call(c,"key")){var ee=B(n),U=Object.keys(c).filter(function(or){return or!=="key"}),Ye=U.length>0?"{key: someKey, "+U.join(": ..., ")+": ...}":"{key: someKey}";if(!pt[ee+Ye]){var ar=U.length>0?"{"+U.join(": ..., ")+": ...}":"{}";k(`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} />`,Ye,ee,ar,ee),dt[ee+Ye]=!0}}return n===i?er(M):Zt(M),M}}function tr(n,c,p){return ft(n,c,p,!0)}function rr(n,c,p){return ft(n,c,p,!1)}var nr=rr,ir=tr;he.Fragment=i,he.jsx=nr,he.jsxs=ir})()),he}var ht;function mr(){return ht||(ht=1,process.env.NODE_ENV==="production"?ke.exports=pr():ke.exports=yr()),ke.exports}var ge=mr(),_e={exports:{}},C={};var vt;function hr(){if(vt)return C;vt=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,i=e?Symbol.for("react.fragment"):60107,a=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,u=e?Symbol.for("react.provider"):60109,y=e?Symbol.for("react.context"):60110,m=e?Symbol.for("react.async_mode"):60111,b=e?Symbol.for("react.concurrent_mode"):60111,E=e?Symbol.for("react.forward_ref"):60112,I=e?Symbol.for("react.suspense"):60113,z=e?Symbol.for("react.suspense_list"):60120,j=e?Symbol.for("react.memo"):60115,F=e?Symbol.for("react.lazy"):60116,Y=e?Symbol.for("react.block"):60121,J=e?Symbol.for("react.fundamental"):60117,L=e?Symbol.for("react.responder"):60118,k=e?Symbol.for("react.scope"):60119;function D(f){if(typeof f=="object"&&f!==null){var V=f.$$typeof;switch(V){case t:switch(f=f.type,f){case m:case b:case i:case s:case a:case I:return f;default:switch(f=f&&f.$$typeof,f){case y:case E:case F:case j:case u:return f;default:return V}}case r:return V}}}function _(f){return D(f)===b}return C.AsyncMode=m,C.ConcurrentMode=b,C.ContextConsumer=y,C.ContextProvider=u,C.Element=t,C.ForwardRef=E,C.Fragment=i,C.Lazy=F,C.Memo=j,C.Portal=r,C.Profiler=s,C.StrictMode=a,C.Suspense=I,C.isAsyncMode=function(f){return _(f)||D(f)===m},C.isConcurrentMode=_,C.isContextConsumer=function(f){return D(f)===y},C.isContextProvider=function(f){return D(f)===u},C.isElement=function(f){return typeof f=="object"&&f!==null&&f.$$typeof===t},C.isForwardRef=function(f){return D(f)===E},C.isFragment=function(f){return D(f)===i},C.isLazy=function(f){return D(f)===F},C.isMemo=function(f){return D(f)===j},C.isPortal=function(f){return D(f)===r},C.isProfiler=function(f){return D(f)===s},C.isStrictMode=function(f){return D(f)===a},C.isSuspense=function(f){return D(f)===I},C.isValidElementType=function(f){return typeof f=="string"||typeof f=="function"||f===i||f===b||f===s||f===a||f===I||f===z||typeof f=="object"&&f!==null&&(f.$$typeof===F||f.$$typeof===j||f.$$typeof===u||f.$$typeof===y||f.$$typeof===E||f.$$typeof===J||f.$$typeof===L||f.$$typeof===k||f.$$typeof===Y)},C.typeOf=D,C}var T={};var gt;function vr(){return gt||(gt=1,process.env.NODE_ENV!=="production"&&(function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,i=e?Symbol.for("react.fragment"):60107,a=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,u=e?Symbol.for("react.provider"):60109,y=e?Symbol.for("react.context"):60110,m=e?Symbol.for("react.async_mode"):60111,b=e?Symbol.for("react.concurrent_mode"):60111,E=e?Symbol.for("react.forward_ref"):60112,I=e?Symbol.for("react.suspense"):60113,z=e?Symbol.for("react.suspense_list"):60120,j=e?Symbol.for("react.memo"):60115,F=e?Symbol.for("react.lazy"):60116,Y=e?Symbol.for("react.block"):60121,J=e?Symbol.for("react.fundamental"):60117,L=e?Symbol.for("react.responder"):60118,k=e?Symbol.for("react.scope"):60119;function D(h){return typeof h=="string"||typeof h=="function"||h===i||h===b||h===s||h===a||h===I||h===z||typeof h=="object"&&h!==null&&(h.$$typeof===F||h.$$typeof===j||h.$$typeof===u||h.$$typeof===y||h.$$typeof===E||h.$$typeof===J||h.$$typeof===L||h.$$typeof===k||h.$$typeof===Y)}function _(h){if(typeof h=="object"&&h!==null){var pe=h.$$typeof;switch(pe){case t:var ie=h.type;switch(ie){case m:case b:case i:case s:case a:case I:return ie;default:var Z=ie&&ie.$$typeof;switch(Z){case y:case E:case F:case j:case u:return Z;default:return pe}}case r:return pe}}}var f=m,V=b,se=y,Pe=u,Ee=t,Me=E,Ne=i,we=F,B=j,Q=r,X=s,Se=a,Ie=I,le=!1;function Re(h){return le||(le=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),ce(h)||_(h)===m}function ce(h){return _(h)===b}function Ce(h){return _(h)===y}function Te(h){return _(h)===u}function xe(h){return typeof h=="object"&&h!==null&&h.$$typeof===t}function $e(h){return _(h)===E}function je(h){return _(h)===i}function ue(h){return _(h)===F}function de(h){return _(h)===j}function re(h){return _(h)===r}function fe(h){return _(h)===s}function ne(h){return _(h)===a}function qe(h){return _(h)===I}T.AsyncMode=f,T.ConcurrentMode=V,T.ContextConsumer=se,T.ContextProvider=Pe,T.Element=Ee,T.ForwardRef=Me,T.Fragment=Ne,T.Lazy=we,T.Memo=B,T.Portal=Q,T.Profiler=X,T.StrictMode=Se,T.Suspense=Ie,T.isAsyncMode=Re,T.isConcurrentMode=ce,T.isContextConsumer=Ce,T.isContextProvider=Te,T.isElement=xe,T.isForwardRef=$e,T.isFragment=je,T.isLazy=ue,T.isMemo=de,T.isPortal=re,T.isProfiler=fe,T.isStrictMode=ne,T.isSuspense=qe,T.isValidElementType=D,T.typeOf=_})()),T}var bt;function gr(){return bt||(bt=1,process.env.NODE_ENV==="production"?_e.exports=hr():_e.exports=vr()),_e.exports}var Ge,Pt;function br(){if(Pt)return Ge;Pt=1;var e=gr(),t={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},r={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};s[e.ForwardRef]=i,s[e.Memo]=a;function u(F){return e.isMemo(F)?a:s[F.$$typeof]||t}var y=Object.defineProperty,m=Object.getOwnPropertyNames,b=Object.getOwnPropertySymbols,E=Object.getOwnPropertyDescriptor,I=Object.getPrototypeOf,z=Object.prototype;function j(F,Y,J){if(typeof Y!="string"){if(z){var L=I(Y);L&&L!==z&&j(F,L,J)}var k=m(Y);b&&(k=k.concat(b(Y)));for(var D=u(F),_=u(Y),f=0;f<k.length;++f){var V=k[f];if(!r[V]&&!(J&&J[V])&&!(_&&_[V])&&!(D&&D[V])){var se=E(Y,V);try{y(F,V,se)}catch{}}}}return F}return Ge=j,Ge}br();var Pr=!0;function Er(e,t,r){var i="";return r.split(" ").forEach(function(a){e[a]!==void 0?t.push(e[a]+";"):a&&(i+=a+" ")}),i}var Rt=function(t,r,i){var a=t.key+"-"+r.name;(i===!1||Pr===!1)&&t.registered[a]===void 0&&(t.registered[a]=r.styles)},wr=function(t,r,i){Rt(t,r,i);var a=t.key+"-"+r.name;if(t.inserted[r.name]===void 0){var s=r;do t.insert(r===s?"."+a:"",s,t.sheet,!0),s=s.next;while(s!==void 0)}};function Sr(e){for(var t=0,r,i=0,a=e.length;a>=4;++i,a-=4)r=e.charCodeAt(i)&255|(e.charCodeAt(++i)&255)<<8|(e.charCodeAt(++i)&255)<<16|(e.charCodeAt(++i)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,t=(r&65535)*1540483477+((r>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(a){case 3:t^=(e.charCodeAt(i+2)&255)<<16;case 2:t^=(e.charCodeAt(i+1)&255)<<8;case 1:t^=e.charCodeAt(i)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var Ir={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function Rr(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var Cr=/[A-Z]|^ms/g,Tr=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Ct=function(t){return t.charCodeAt(1)===45},Et=function(t){return t!=null&&typeof t!="boolean"},He=Rr(function(e){return Ct(e)?e:e.replace(Cr,"-$&").toLowerCase()}),wt=function(t,r){switch(t){case"animation":case"animationName":if(typeof r=="string")return r.replace(Tr,function(i,a,s){return W={name:a,styles:s,next:W},a})}return Ir[t]!==1&&!Ct(t)&&typeof r=="number"&&r!==0?r+"px":r};function be(e,t,r){if(r==null)return"";var i=r;if(i.__emotion_styles!==void 0)return i;switch(typeof r){case"boolean":return"";case"object":{var a=r;if(a.anim===1)return W={name:a.name,styles:a.styles,next:W},a.name;var s=r;if(s.styles!==void 0){var u=s.next;if(u!==void 0)for(;u!==void 0;)W={name:u.name,styles:u.styles,next:W},u=u.next;var y=s.styles+";";return y}return xr(e,t,r)}case"function":{if(e!==void 0){var m=W,b=r(e);return W=m,be(e,t,b)}break}}var E=r;return E}function xr(e,t,r){var i="";if(Array.isArray(r))for(var a=0;a<r.length;a++)i+=be(e,t,r[a])+";";else for(var s in r){var u=r[s];if(typeof u!="object"){var y=u;Et(y)&&(i+=He(s)+":"+wt(s,y)+";")}else if(Array.isArray(u)&&typeof u[0]=="string"&&t==null)for(var m=0;m<u.length;m++)Et(u[m])&&(i+=He(s)+":"+wt(s,u[m])+";");else{var b=be(e,t,u);switch(s){case"animation":case"animationName":{i+=He(s)+":"+b+";";break}default:i+=s+"{"+b+"}"}}}return i}var St=/label:\s*([^\s;{]+)\s*(;|$)/g,W;function Or(e,t,r){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var i=!0,a="";W=void 0;var s=e[0];if(s==null||s.raw===void 0)i=!1,a+=be(r,t,s);else{var u=s;a+=u[0]}for(var y=1;y<e.length;y++)if(a+=be(r,t,e[y]),i){var m=s;a+=m[y]}St.lastIndex=0;for(var b="",E;(E=St.exec(a))!==null;)b+="-"+E[1];var I=Sr(a)+b;return{name:I,styles:a,next:W}}var kr=function(t){return t()},_r=K.useInsertionEffect?K.useInsertionEffect:!1,Ar=_r||kr,Tt=K.createContext(typeof HTMLElement<"u"?sr({key:"css"}):null);Tt.Provider;var Fr=function(t){return v.forwardRef(function(r,i){var a=v.useContext(Tt);return t(r,a,i)})},Dr=K.createContext({}),Fe={}.hasOwnProperty,We="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",xt=function(t,r){var i={};for(var a in r)Fe.call(r,a)&&(i[a]=r[a]);return i[We]=t,i},Mr=function(t){var r=t.cache,i=t.serialized,a=t.isStringTag;return Rt(r,i,a),Ar(function(){return wr(r,i,a)}),null},Nr=Fr(function(e,t,r){var i=e.css;typeof i=="string"&&t.registered[i]!==void 0&&(i=t.registered[i]);var a=e[We],s=[i],u="";typeof e.className=="string"?u=Er(t.registered,s,e.className):e.className!=null&&(u=e.className+" ");var y=Or(s,void 0,K.useContext(Dr));u+=t.key+"-"+y.name;var m={};for(var b in e)Fe.call(e,b)&&b!=="css"&&b!==We&&(m[b]=e[b]);return m.className=u,r&&(m.ref=r),K.createElement(K.Fragment,null,K.createElement(Mr,{cache:t,serialized:y,isStringTag:typeof a=="string"}),K.createElement(a,m))}),Ot=Nr,De=ge.Fragment,o=function(t,r,i){return Fe.call(r,"css")?ge.jsx(Ot,xt(t,r),i):ge.jsx(t,r,i)},N=function(t,r,i){return Fe.call(r,"css")?ge.jsxs(Ot,xt(t,r),i):ge.jsxs(t,r,i)};const $r={mediaPlayer:{enablePlaylists:process.env.NODE_ENV!=="production"}},jr="http://localhost".replace(/\/+$/,"");class kt{constructor(t={}){this.configuration=t}set config(t){this.configuration=t}get basePath(){return this.configuration.basePath!=null?this.configuration.basePath:jr}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||_t}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){const t=this.configuration.apiKey;if(t)return typeof t=="function"?t:()=>t}get accessToken(){const t=this.configuration.accessToken;if(t)return typeof t=="function"?t:async()=>t}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}}const qr=new kt;class Xe{constructor(t=qr){this.configuration=t,this.middleware=t.middleware}static jsonRegex=new RegExp("^(:?application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(:?;.*)?$","i");middleware;withMiddleware(...t){const r=this.clone();return r.middleware=r.middleware.concat(...t),r}withPreMiddleware(...t){const r=t.map(i=>({pre:i}));return this.withMiddleware(...r)}withPostMiddleware(...t){const r=t.map(i=>({post:i}));return this.withMiddleware(...r)}isJsonMime(t){return t?Xe.jsonRegex.test(t):!1}async request(t,r){const{url:i,init:a}=await this.createFetchParams(t,r),s=await this.fetchApi(i,a);if(s&&s.status>=200&&s.status<300)return s;throw new Vr(s,"Response returned an error code")}async createFetchParams(t,r){let i=this.configuration.basePath+t.path;t.query!==void 0&&Object.keys(t.query).length!==0&&(i+="?"+this.configuration.queryParamsStringify(t.query));const a=Object.assign({},this.configuration.headers,t.headers);Object.keys(a).forEach(E=>a[E]===void 0?delete a[E]:{});const s=typeof r=="function"?r:async()=>r,u={method:t.method,headers:a,body:t.body,credentials:this.configuration.credentials},y={...u,...await s({init:u,context:t})};let m;Lr(y.body)||y.body instanceof URLSearchParams||zr(y.body)?m=y.body:this.isJsonMime(a["Content-Type"])?m=JSON.stringify(y.body):m=y.body;const b={...y,body:m};return{url:i,init:b}}fetchApi=async(t,r)=>{let i={url:t,init:r};for(const s of this.middleware)s.pre&&(i=await s.pre({fetch:this.fetchApi,...i})||i);let a;try{a=await(this.configuration.fetchApi||fetch)(i.url,i.init)}catch(s){for(const u of this.middleware)u.onError&&(a=await u.onError({fetch:this.fetchApi,url:i.url,init:i.init,error:s,response:a?a.clone():void 0})||a);if(a===void 0)throw s instanceof Error?new Ur(s,"The request failed and the interceptors did not return an alternative response"):s}for(const s of this.middleware)s.post&&(a=await s.post({fetch:this.fetchApi,url:i.url,init:i.init,response:a.clone()})||a);return a};clone(){const t=this.constructor,r=new t(this.configuration);return r.middleware=this.middleware.slice(),r}}function zr(e){return typeof Blob<"u"&&e instanceof Blob}function Lr(e){return typeof FormData<"u"&&e instanceof FormData}class Vr extends Error{constructor(t,r){super(r),this.response=t}name="ResponseError"}class Ur extends Error{constructor(t,r){super(r),this.cause=t}name="FetchError"}class ve extends Error{constructor(t,r){super(r),this.field=t}name="RequiredError"}function _t(e,t=""){return Object.keys(e).map(r=>At(r,e[r],t)).filter(r=>r.length>0).join("&")}function At(e,t,r=""){const i=r+(r.length?`[${e}]`:e);if(t instanceof Array){const a=t.map(s=>encodeURIComponent(String(s))).join(`&${encodeURIComponent(i)}=`);return`${encodeURIComponent(i)}=${a}`}if(t instanceof Set){const a=Array.from(t);return At(e,a,r)}return t instanceof Date?`${encodeURIComponent(i)}=${encodeURIComponent(t.toISOString())}`:t instanceof Object?_t(t,i):`${encodeURIComponent(i)}=${encodeURIComponent(String(t))}`}class te{constructor(t,r=i=>i){this.raw=t,this.transformer=r}async value(){return this.transformer(await this.raw.json())}}function Ft(e){return Yr(e)}function Yr(e,t){return e==null?e:{id:e.id,name:e.name}}function Gr(e){return Hr(e)}function Hr(e,t){return e==null?e:{playlist:Ft(e.playlist)}}function Br(e){return Wr(e)}function Wr(e,t){return e==null?e:{items:e.items.map(Ft)}}function Jr(e){return Qr(e)}function Qr(e,t){return e==null?e:{id:e.id,url:e.url,type:e.type,videoId:e.videoId,title:e.title}}function Kr(e){return Xr(e)}function Xr(e,t){return e==null?e:{items:e.items.map(Jr)}}function Zr(e){return en(e,!1)}function en(e,t=!1){return e==null?e:{name:e.name}}function tn(e){return rn(e,!1)}function rn(e,t=!1){return e==null?e:{name:e.name}}class nn extends Xe{async mediaPlayerPlaylistsGetRaw(t){const r={},i={},s=await this.request({path:"/media-player/playlists",method:"GET",headers:i,query:r},t);return new te(s,u=>Br(u))}async mediaPlayerPlaylistsGet(t){return await(await this.mediaPlayerPlaylistsGetRaw(t)).value()}async mediaPlayerPlaylistsIdDeleteRaw(t,r){if(t.id==null)throw new ve("id",'Required parameter "id" was null or undefined when calling mediaPlayerPlaylistsIdDelete().');const i={},a={};let s="/media-player/playlists/{id}";s=s.replace("{id}",encodeURIComponent(String(t.id)));const u=await this.request({path:s,method:"DELETE",headers:a,query:i},r);return new te(u)}async mediaPlayerPlaylistsIdDelete(t,r){return await(await this.mediaPlayerPlaylistsIdDeleteRaw(t,r)).value()}async mediaPlayerPlaylistsIdGetRaw(t,r){if(t.id==null)throw new ve("id",'Required parameter "id" was null or undefined when calling mediaPlayerPlaylistsIdGet().');const i={},a={};let s="/media-player/playlists/{id}";s=s.replace("{id}",encodeURIComponent(String(t.id)));const u=await this.request({path:s,method:"GET",headers:a,query:i},r);return new te(u,y=>Gr(y))}async mediaPlayerPlaylistsIdGet(t,r){return await(await this.mediaPlayerPlaylistsIdGetRaw(t,r)).value()}async mediaPlayerPlaylistsIdRenamePostRaw(t,r){if(t.id==null)throw new ve("id",'Required parameter "id" was null or undefined when calling mediaPlayerPlaylistsIdRenamePost().');const i={},a={};a["Content-Type"]="application/json";let s="/media-player/playlists/{id}:rename";s=s.replace("{id}",encodeURIComponent(String(t.id)));const u=await this.request({path:s,method:"POST",headers:a,query:i,body:tn(t.hydrangeanDivaMediaPlayerEndpointsPlaylistsRenamePlaylistRequest)},r);return new te(u)}async mediaPlayerPlaylistsIdRenamePost(t,r){return await(await this.mediaPlayerPlaylistsIdRenamePostRaw(t,r)).value()}async mediaPlayerPlaylistsIdTracksGetRaw(t,r){if(t.id==null)throw new ve("id",'Required parameter "id" was null or undefined when calling mediaPlayerPlaylistsIdTracksGet().');const i={},a={};let s="/media-player/playlists/{id}/tracks";s=s.replace("{id}",encodeURIComponent(String(t.id)));const u=await this.request({path:s,method:"GET",headers:a,query:i},r);return new te(u,y=>Kr(y))}async mediaPlayerPlaylistsIdTracksGet(t,r){return await(await this.mediaPlayerPlaylistsIdTracksGetRaw(t,r)).value()}async mediaPlayerPlaylistsIdTracksPutRaw(t,r){if(t.id==null)throw new ve("id",'Required parameter "id" was null or undefined when calling mediaPlayerPlaylistsIdTracksPut().');const i={},a={};let s="/media-player/playlists/{id}/tracks";s=s.replace("{id}",encodeURIComponent(String(t.id)));const u=await this.request({path:s,method:"PUT",headers:a,query:i},r);return new te(u)}async mediaPlayerPlaylistsIdTracksPut(t,r){return await(await this.mediaPlayerPlaylistsIdTracksPutRaw(t,r)).value()}async mediaPlayerPlaylistsPostRaw(t,r){const i={},a={};a["Content-Type"]="application/json";const u=await this.request({path:"/media-player/playlists",method:"POST",headers:a,query:i,body:Zr(t.hydrangeanDivaMediaPlayerEndpointsPlaylistsCreatePlaylistRequest)},r);return new te(u)}async mediaPlayerPlaylistsPost(t={},r){return await(await this.mediaPlayerPlaylistsPostRaw(t,r)).value()}}const an=new kt({basePath:new URL("api",window.location.origin).toString()}),on=new nn(an),sn=({disabled:e,onAddToPlaylist:t})=>{const[r,i]=v.useState(!1),[a,s]=v.useState("loading");return v.useEffect(()=>{on.mediaPlayerPlaylistsGet().then(u=>s(u.items.map(y=>({key:y.id,label:y.name}))))},[]),o(l.EuiPopover,{panelPaddingSize:"none",button:o(l.EuiButton,{iconType:S.AddRegular,onClick:()=>i(!r),disabled:e,children:"Add to"}),isOpen:r,closePopover:()=>i(!1),children:o(l.EuiSelectable,{searchable:!0,searchProps:{compressed:!0},options:a==="loading"?void 0:a,isLoading:a==="loading",onChange:async(u,y,m)=>{i(!1),await t(m)},singleSelection:!0,children:(u,y)=>N("div",{style:{width:240},children:[o(l.EuiPopoverTitle,{paddingSize:"s",children:y}),u,o(l.EuiPopoverFooter,{paddingSize:"s",children:o(l.EuiButton,{size:"s",fullWidth:!0,iconType:S.AddRegular,children:"New playlist"})})]})})})},ln=({onCancel:e,onSave:t})=>{const r=l.useGeneratedHtmlId({prefix:"modalForm"}),[i,a]=v.useState(""),[s,u]=v.useState(""),[y,m]=v.useState(!1);return N(l.EuiModal,{onClose:e,initialFocus:"[name=url]",children:[o(l.EuiModalHeader,{children:o(l.EuiModalHeaderTitle,{children:"Add video"})}),o(l.EuiModalBody,{children:N(l.EuiForm,{id:r,component:"form",onSubmit:async b=>{b.preventDefault();try{m(!0),await t({url:i,title:s})}finally{m(!1)}},children:[o(l.EuiFormRow,{label:"URL",children:o(l.EuiFieldText,{name:"url",value:i,onChange:b=>a(b.target.value)})}),o(l.EuiFormRow,{label:"Title",children:o(l.EuiFieldText,{name:"title",value:s,onChange:b=>u(b.target.value)})})]})}),N(l.EuiModalFooter,{children:[o(l.EuiButtonEmpty,{onClick:e,children:"Cancel"}),o(l.EuiButton,{type:"submit",form:r,fill:!0,disabled:i.trim().length===0,isLoading:y,children:"Add video"})]})]})},It=v.memo(({onSave:e})=>{const[t,r]=v.useState(!1),i=v.useCallback(async a=>{await e(a),r(!1)},[e]);return N(De,{children:[o(l.EuiButton,{onClick:()=>r(!0),iconType:S.AddRegular,color:"primary",children:"Add video"}),t&&o(ln,{onCancel:()=>r(!1),onSave:i})]})}),Dt={Audio:"",Dailymotion:"https://www.dailymotion.com/favicon.ico",Niconico:"https://www.nicovideo.jp/favicon.ico",SoundCloud:"https://soundcloud.com/favicon.ico",Twitch:"https://www.twitch.tv/favicon.ico",Vimeo:"https://vimeo.com/favicon.ico",YouTube:"https://www.youtube.com/favicon.ico"},cn=O.observer(({playQueueStore:e})=>{const{euiTheme:t}=l.useEuiTheme();return N(l.EuiTableHeader,{style:{position:"sticky",top:112,zIndex:998,background:t.colors.backgroundBasePlain},children:[o(l.EuiTableHeaderCellCheckbox,{children:o(l.EuiCheckbox,{id:"",checked:e.allItemsSelected,onChange:r=>{e.allItemsSelected=r.target.checked}})}),o(l.EuiTableHeaderCell,{width:24}),o(l.EuiTableHeaderCell,{children:"Title"}),o(l.EuiTableHeaderCell,{})]})}),un=v.memo(({item:e,closePopover:t})=>{const r=v.useMemo(()=>[{id:0,items:[{name:"Play first",icon:o(l.EuiIcon,{type:""}),onClick:async()=>{t(),await e.playFirst()}},{name:"Play next",icon:o(l.EuiIcon,{type:""}),onClick:async()=>{t(),await e.playNext()}},{name:"Add to play queue",icon:o(l.EuiIcon,{type:S.AddRegular}),onClick:async()=>{t(),await e.addToPlayQueue()}},{isSeparator:!0},{name:"Move to the top",icon:o(l.EuiIcon,{type:S.ArrowUploadRegular}),onClick:async()=>{t(),e.moveToTop()},disabled:!e.canMoveToTop},{name:"Move to the bottom",icon:o(l.EuiIcon,{type:S.ArrowDownloadRegular}),onClick:async()=>{t(),e.moveToBottom()},disabled:!e.canMoveToBottom},{isSeparator:!0},{name:"Remove to the top",icon:o(l.EuiIcon,{type:""}),onClick:async()=>{t(),await e.removeToTop()},disabled:!e.canRemoveToTop},{name:"Remove others",icon:o(l.EuiIcon,{type:""}),onClick:async()=>{t(),await e.removeOthers()},disabled:!e.canRemoveOthers}]}],[t,e]);return o(l.EuiContextMenu,{initialPanelId:0,panels:r})}),dn=v.memo(({item:e})=>{const[t,r]=v.useState(!1),i=v.useCallback(()=>r(!t),[t]),a=v.useCallback(()=>r(!1),[]);return o(l.EuiPopover,{button:o(l.EuiButtonIcon,{title:"More options","aria-label":"More options",iconType:S.MoreHorizontalFilled,size:"s",color:"text",onClick:i}),isOpen:t,closePopover:a,panelPaddingSize:"none",anchorPosition:"leftCenter",children:o(un,{item:e,closePopover:a})})}),fn=O.observer(({item:e})=>{const t=H.useNostalgicDiva();return N(l.EuiTableRowCell,{textOnly:!1,hasActions:!0,align:"right",children:[o(l.EuiButton,{iconType:S.PlayRegular,size:"s",onClick:async()=>{e.isCurrent?await t.setCurrentTime(0):e.play()},children:"Play"}),o(l.EuiButton,{iconType:S.DismissRegular,size:"s",onClick:e.remove,children:"Remove"}),o(dn,{item:e})]})}),pn=O.observer(({item:e})=>{const t=H.useNostalgicDiva();return N(l.EuiTableRow,{isSelected:e.isCurrent,children:[o(l.EuiTableRowCellCheckbox,{children:o(l.EuiCheckbox,{id:e.id.toString(),checked:e.isSelected,onChange:e.toggleSelected})}),o(l.EuiTableRowCell,{textOnly:!1,children:o("img",{src:Dt[e.type],width:16,height:16,alt:e.type})}),o(l.EuiTableRowCell,{children:o(l.EuiLink,{href:e.url,target:"_blank",external:!0,onClick:()=>t.pause(),children:e.title})}),o(fn,{item:e})]},e.id)}),yn=O.observer(({playQueueStore:e})=>o(lr.ReactSortable,{tag:"tbody",list:e.items,setList:t=>e.setItems(t),children:e.items.map(t=>o(pn,{item:t},t.id))})),mn=O.observer(({playQueueStore:e})=>N(l.EuiTable,{children:[o(cn,{playQueueStore:e}),o(yn,{playQueueStore:e})]}));function hn(e){return e!==null&&typeof e=="object"&&"title"in e&&typeof e.title=="string"}const vn=O.observer(({playQueueStore:e})=>o(l.EuiButton,{iconType:S.AddRegular,onClick:e.addSelectedItems,disabled:e.isEmpty||e.selectedItems.length===0,children:"Add to play queue"}));O.observer(({playQueueStore:e})=>{const[t,r]=v.useState(!1);return N(De,{children:[t&&o(l.EuiFlyout,{type:"push",size:"s",onClose:()=>r(!1),children:o("div",{style:{blockSize:"100%"},children:o(l.EuiCodeBlock,{language:"json",overflowHeight:"100%",isCopyable:!0,isVirtualized:!0,children:JSON.stringify(e.localStorageState,void 0,2)})})}),o(l.EuiButton,{onClick:()=>r(i=>!i),iconType:S.WindowDevToolsRegular,children:"Developer tools"})]})});const Mt=O.observer(({playQueueStore:e})=>{const{euiTheme:t}=l.useEuiTheme(),r=v.useCallback(async()=>{},[]),i=v.useCallback(async a=>{const s=H.findVideoService(a.url);if(s!==void 0){const u=s.extractVideoId(a.url);if(u!==void 0){const m=await(await fetch(`https://noembed.com/embed?url=${encodeURIComponent(a.url)}`)).json();await e.addItems([e.createItem({url:a.url,type:s.type,videoId:u,title:a.title||(hn(m)?m.title:u)})])}}},[e]);return N(De,{children:[N(l.EuiFlexGroup,{alignItems:"center",gutterSize:"m",style:{position:"sticky",top:48,zIndex:998,background:t.colors.backgroundBasePlain},children:[o(l.EuiFlexItem,{grow:!1,children:o(l.EuiButton,{disabled:e.isEmpty||e.selectedItems.length===0,onClick:e.playSelectedItemsNext,children:"Play next"})}),o(l.EuiFlexItem,{grow:!1,children:o(vn,{playQueueStore:e})}),o(l.EuiFlexItem,{grow:!1,children:o(sn,{disabled:!$r.mediaPlayer.enablePlaylists,onAddToPlaylist:r})}),o(l.EuiFlexItem,{grow:!1,children:o(l.EuiButton,{iconType:S.DismissRegular,onClick:e.removeSelectedItems,disabled:e.isEmpty||e.selectedItems.length===0,children:"Remove"})}),o(l.EuiFlexItem,{grow:!1,children:o(l.EuiButton,{iconType:S.DeleteRegular,onClick:e.clear,disabled:e.isEmpty,children:"Clear"})}),o(l.EuiFlexItem,{grow:!0}),N(l.EuiFlexItem,{grow:!1,children:[!1,o(It,{onSave:i})]})]}),o(l.EuiSpacer,{size:"l",style:{position:"sticky",top:88,zIndex:998,background:t.colors.backgroundBasePlain}}),e.isEmpty?o(l.EuiEmptyPrompt,{title:o("h2",{children:"We couldn't find any videos"}),body:o("p",{children:"Your video library doesn't contain any video content."}),actions:o(It,{onSave:i})}):o(mn,{playQueueStore:e})]})}),Nt=v.createContext(void 0),$t=()=>v.useContext(Nt),Be=new cr({coerceTypes:!0});function gn(e,t){let r;if(r=Be.getSchema(t),r===void 0&&(Be.addSchema(e,t),r=Be.getSchema(t)),r===void 0||r.schema!==e)throw new Error(`Invalid schema. Expected: '${JSON.stringify(e)}', but got '${JSON.stringify(r?.schema)}'.`);return r}const bn={type:"object",properties:{url:{type:"string"},type:{type:"string"},videoId:{type:"string"},title:{type:"string"}},required:["url","type","videoId","title"]},Pn={type:"object",properties:{version:{type:"string",nullable:!0},repeat:{type:"string",enum:Object.values($),nullable:!0},shuffle:{type:"boolean",nullable:!0},items:{type:"array",nullable:!0,items:bn},currentIndex:{type:"integer",nullable:!0}}};class Ae{constructor(t,r,i){this.observableStateProvider=t,this.playQueueStore=r,this.dto=i,this.id=Ae.nextId++,t.makeObservable(this,{isSelected:d.observable,isCurrent:d.computed,index:d.computed,isFirst:d.computed,isLast:d.computed,canMoveToTop:d.computed,canMoveToBottom:d.computed,canRemoveToTop:d.computed,canRemoveOthers:d.computed,unselect:d.action,toggleSelected:d.action.bound,play:d.action,remove:d.action.bound,playFirst:d.action.bound,playNext:d.action.bound,addToPlayQueue:d.action.bound,moveToTop:d.action.bound,moveToBottom:d.action.bound,removeToTop:d.action.bound,removeOthers:d.action.bound})}static nextId=1;id;isSelected=!1;static fromDto(t,r,i){return new Ae(t,r,i)}get url(){return this.dto.url}get type(){return this.dto.type}get videoId(){return this.dto.videoId}get title(){return this.dto.title}get isCurrent(){return this.playQueueStore.currentItem===this}get index(){return this.playQueueStore.items.indexOf(this)}get isFirst(){return this.index===0}get isLast(){return this.index===this.playQueueStore.items.length-1}get canMoveToTop(){return!this.isFirst}get canMoveToBottom(){return!this.isLast}get canRemoveToTop(){return!this.isFirst}get canRemoveOthers(){return this.playQueueStore.hasMultipleItems}clone(){return this.playQueueStore.createItem(this.dto)}unselect(){this.isSelected=!1}toggleSelected(){this.isSelected=!this.isSelected}play(){this.playQueueStore.setCurrentItem(this)}remove(){return this.playQueueStore.removeItems([this])}async playFirst(){await this.playQueueStore.playFirst([this.clone()])}async playNext(){await this.playQueueStore.playNext([this.clone()])}async addToPlayQueue(){await this.playQueueStore.addItems([this.clone()])}moveToTop(){this.playQueueStore.moveItem(this,0)}moveToBottom(){this.playQueueStore.moveItem(this,this.playQueueStore.items.length-1)}removeToTop(){return this.playQueueStore.removeItemsAbove(this)}removeOthers(){return this.playQueueStore.removeOtherItems(this)}}class En{constructor(t){this.observableStateProvider=t,t.makeObservable(this,{interacted:d.observable,items:d.observable,currentId:d.observable,repeat:d.observable,shuffle:d.observable,localStorageState:d.computed.struct,isEmpty:d.computed,currentItem:d.computed,canPlay:d.computed,canPause:d.computed,hasMultipleItems:d.computed,currentIndex:d.computed,hasPreviousItem:d.computed,hasNextItem:d.computed,isLastItem:d.computed,selectedItems:d.computed,allItemsSelected:d.computed,selectedItemsOrAllItems:d.computed,setItems:d.action,interact:d.action,clear:d.action.bound,unselectAll:d.action,setCurrentItem:d.action,setNextItems:d.action,clearAndSetItems:d.action,playNext:d.action,playSelectedItemsNext:d.action.bound,addItems:d.action,addSelectedItems:d.action.bound,playFirst:d.action,moveItem:d.action,goToFirst:d.action,removeItems:d.action,removeSelectedItems:d.action.bound,removeOtherItems:d.action,removeItemsAbove:d.action,toggleRepeat:d.action.bound,toggleShuffle:d.action.bound,previous:d.action,next:d.action.bound})}interacted=!1;items=[];currentId;repeat=$.Off;shuffle=!1;createItem(t){return Ae.fromDto(this.observableStateProvider,this,{url:t.url,type:t.type,videoId:t.videoId,title:t.title})}get localStorageState(){return{version:"1.0",repeat:this.repeat,shuffle:this.shuffle,items:this.items.map(t=>t.dto),currentIndex:this.currentIndex}}set localStorageState(t){this.repeat=t.repeat??$.Off,this.shuffle=t.shuffle??!1,this.items=t.items?.map(r=>this.createItem(r))??[],this.currentIndex=t.currentIndex}validateLocalStorageState(t){return gn(Pn,"PlayQueueDto")(t)}get isEmpty(){return this.items.length===0}get currentItem(){return this.items.find(t=>t.id===this.currentId)}get canPlay(){return this.currentItem!==void 0}get canPause(){return this.currentItem!==void 0}get hasMultipleItems(){return this.items.length>1}get currentIndex(){return this.currentId!==void 0?this.items.findIndex(t=>t.id===this.currentId):void 0}set currentIndex(t){this.currentId=t!==void 0?this.items.at(t)?.id:void 0}get hasPreviousItem(){return this.hasMultipleItems&&this.currentIndex!==void 0&&this.currentIndex>0}get hasNextItem(){return this.hasMultipleItems&&this.currentIndex!==void 0&&this.currentIndex<this.items.length-1}get isLastItem(){return this.currentIndex!==void 0&&this.currentIndex===this.items.length-1}get selectedItems(){return this.items.filter(t=>t.isSelected)}get allItemsSelected(){return this.selectedItems.length===this.items.length}set allItemsSelected(t){for(const r of this.items)r.isSelected=t}get selectedItemsOrAllItems(){return this.selectedItems.length>0?this.selectedItems:this.items}setItems(t){this.items=t}interact(){this.interacted=!0}clear(){this.interact(),this.currentIndex=void 0,this.items=[]}unselectAll(){for(const t of this.items)t.unselect()}setCurrentItem(t){this.interact(),this.currentId=t?.id}setNextItems(t){this.currentIndex!==void 0&&this.items.splice(this.currentIndex+1,0,...t)}clearAndSetItems(t){this.clear(),this.setCurrentItem(t[0]),this.setNextItems(t)}async playNext(t){if(this.isEmpty){this.clearAndSetItems(t);return}this.setNextItems(t)}async playSelectedItemsNext(){await this.playNext(this.selectedItemsOrAllItems.map(t=>t.clone())),this.unselectAll()}async addItems(t){if(this.isEmpty){this.clearAndSetItems(t);return}this.items.push(...t)}async addSelectedItems(){await this.addItems(this.selectedItemsOrAllItems.map(t=>t.clone())),this.unselectAll()}async playFirst(t){if(this.isEmpty){this.clearAndSetItems(t);return}const{currentIndex:r}=this;r!==void 0&&(this.interact(),this.items.splice(r,0,...t),this.currentIndex=r)}moveItem(t,r){const i=this.items.splice(this.items.indexOf(t),1)[0];this.items.splice(r,0,i)}async goToFirst(){this.currentIndex!==void 0&&(this.currentIndex=0)}async removeItems(t){const{currentItem:r}=this;pt.pull(this.items,...t.filter(s=>s!==r));const{currentIndex:i,isLastItem:a}=this;pt.pull(this.items,t.find(s=>s===r)),this.currentItem!==r&&(this.interact(),a?await this.goToFirst():this.currentIndex=i)}async removeSelectedItems(){await this.removeItems(this.selectedItemsOrAllItems),this.unselectAll()}async removeOtherItems(t){const r=t.id;return this.removeItems(this.items.filter(i=>i.id!==r))}async removeItemsAbove(t){const r=this.items.indexOf(t);return this.removeItems(this.items.filter((i,a)=>a<r))}toggleRepeat(){switch(this.repeat){case $.Off:this.repeat=$.All;break;case $.All:this.repeat=$.One;break;case $.One:this.repeat=$.Off;break}}toggleShuffle(){this.shuffle=!this.shuffle}async previous(){this.currentIndex!==void 0&&this.hasPreviousItem&&(this.interact(),this.currentIndex--)}async next(){this.currentIndex!==void 0&&this.hasNextItem&&(this.interact(),this.currentIndex++)}}const wn=({children:e})=>{const[t]=v.useState(()=>new En(new Ke)),r=H.useNostalgicDiva();return v.useEffect(()=>d.reaction(()=>t.currentItem,async(i,a)=>{i===void 0||a===void 0||i.type===a.type&&i.videoId===a.videoId&&await r.setCurrentTime(0)}),[t,r]),o(Nt.Provider,{value:t,children:e})},Sn=({breadcrumbs:e,tabs:t,...r})=>{const i=ur.useRouter();return o(l.EuiPageTemplate.Header,{...r,breadcrumbs:e?.map(({linkProps:a,...s})=>({...s,href:a===void 0?void 0:i.buildLocation(a).href,onClick:a===void 0?void 0:async u=>{u.preventDefault(),await i.navigate(a)}})),tabs:t?.map(({linkProps:a,...s})=>({...s,href:a===void 0?void 0:i.buildLocation(a).href,onClick:a===void 0?void 0:async u=>{u.preventDefault(),await i.navigate(a)}}))})},In=()=>{const e=$t();return N(De,{children:[o(Sn,{pageTitle:"Play queue",rightSideItems:[]}),o(l.EuiPageTemplate.Section,{children:o(Mt,{playQueueStore:e})})]})},Rn=O.observer(({bottomBarStore:e})=>o(l.EuiButtonIcon,{title:`Shuffle: ${e.shuffle?"On":"Off"}`,"aria-label":`Shuffle: ${e.shuffle?"On":"Off"}`,iconType:e.shuffle?S.ArrowShuffleFilled:S.ArrowShuffleOffFilled,size:"s",iconSize:"l",onClick:e.toggleShuffle,disabled:!e.canToggleShuffle})),Cn=O.observer(({bottomBarStore:e})=>o(l.EuiButtonIcon,{title:"Previous","aria-label":"Previous",iconType:S.PreviousFilled,size:"s",iconSize:"l",onClick:e.previous,disabled:!e.canPrevious})),Tn=O.observer(({bottomBarStore:e})=>o(l.EuiButtonIcon,{title:"Skip back 10 seconds","aria-label":"Skip back 10 seconds",iconType:S.SkipBack10Regular,size:"s",iconSize:"l",onClick:e.skipBack10,disabled:!e.canSkipBack10})),xn=O.observer(({bottomBarStore:e})=>o(l.EuiButtonIcon,{title:"Pause","aria-label":"Pause",iconType:S.PauseFilled,size:"s",iconSize:"l",onClick:e.pause,disabled:!e.canPause})),On=O.observer(({bottomBarStore:e})=>o(l.EuiButtonIcon,{title:"Play","aria-label":"Play",iconType:S.PlayFilled,size:"s",iconSize:"l",onClick:e.play,disabled:!e.canPlay})),kn=O.observer(({bottomBarStore:e})=>o(l.EuiButtonIcon,{title:"Skip forward 30 seconds","aria-label":"Skip forward 30 seconds",iconType:S.SkipForward30Regular,size:"s",iconSize:"l",onClick:e.skipForward30,disabled:!e.canSkipForward30})),_n=O.observer(({bottomBarStore:e})=>o(l.EuiButtonIcon,{title:"Next","aria-label":"Next",iconType:S.NextFilled,size:"s",iconSize:"l",onClick:e.next,disabled:!e.canNext})),An={[$.Off]:S.ArrowRepeatAllOffFilled,[$.All]:S.ArrowRepeatAllFilled,[$.One]:S.ArrowRepeat1Filled},Fn=O.observer(({bottomBarStore:e})=>o(l.EuiButtonIcon,{title:`Repeat: ${e.repeat===$.All?"All":e.repeat===$.One?"One":"Off"}`,"aria-label":`Repeat: ${e.repeat===$.All?"All":e.repeat===$.One?"One":"Off"}`,iconType:An[e.repeat],size:"s",iconSize:"l",onClick:e.toggleRepeat,disabled:!e.canToggleRepeat})),Dn=O.observer(({bottomBarStore:e})=>N(l.EuiFlexGroup,{responsive:!1,gutterSize:"s",justifyContent:"center",alignItems:"center",children:[o(Rn,{bottomBarStore:e}),o(Cn,{bottomBarStore:e}),o(Tn,{bottomBarStore:e}),e.playing?o(xn,{bottomBarStore:e}):o(On,{bottomBarStore:e}),o(kn,{bottomBarStore:e}),o(_n,{bottomBarStore:e}),o(Fn,{bottomBarStore:e})]})),Mn=v.memo(({item:e,closePopover:t})=>{const r=H.useNostalgicDiva(),i=v.useMemo(()=>[{id:0,items:[{name:"Open in new tab",icon:o(l.EuiIcon,{type:S.OpenRegular}),onClick:async()=>{t(),await r.pause(),window.open(e.dto.url,"_blank")}},{name:"Copy link address",icon:o(l.EuiIcon,{type:""}),onClick:async()=>{t(),await navigator.clipboard.writeText(e.dto.url)}},{name:"Copy link text",icon:o(l.EuiIcon,{type:""}),onClick:async()=>{t(),await navigator.clipboard.writeText(e.dto.title)}}]}],[t,r,e]);return o(l.EuiContextMenu,{initialPanelId:0,panels:i})}),Nn=v.memo(({item:e})=>{const[t,r]=v.useState(!1),i=v.useCallback(()=>r(!t),[t]),a=v.useCallback(()=>r(!1),[]);return o(l.EuiPopover,{button:o(l.EuiButtonEmpty,{iconType:Dt[e.type],size:"s",onClick:i,children:e.title}),isOpen:t,closePopover:a,panelPaddingSize:"none",anchorPosition:"upLeft",children:o(Mn,{item:e,closePopover:a})})}),$n=O.observer(({bottomBarStore:e})=>o(l.EuiFlexGroup,{responsive:!1,gutterSize:"s",justifyContent:"flexStart",alignItems:"center",children:e.currentItem&&o(Nn,{item:e.currentItem})})),jn=O.observer(({bottomBarStore:e})=>o(l.EuiButtonIcon,{title:"Mute","aria-label":"Mute",iconType:S.Speaker2Regular,size:"s",iconSize:"l",disabled:!e.playerStore.controller.supports("setMuted")})),qn=O.observer(({bottomBarStore:e,button:t,isOpen:r,closePopover:i})=>{const[a,s]=v.useState("0"),u=H.useNostalgicDiva();v.useLayoutEffect(()=>{r&&u.getVolume().then(m=>{m!==void 0&&s(Math.floor(m*100).toString())})},[r,u]);const y=v.useCallback(async m=>{s(m.currentTarget.value),await u.setVolume(Number(m.currentTarget.value)/100)},[u]);return o(l.EuiPopover,{button:t,isOpen:r,closePopover:i,anchorPosition:"upRight",children:o(l.EuiFormRow,{children:N(l.EuiFlexGroup,{responsive:!1,gutterSize:"s",justifyContent:"center",alignItems:"center",children:[o(jn,{bottomBarStore:e}),o(l.EuiRange,{min:0,max:100,step:1,value:a,onChange:y,css:{blockSize:32},disabled:!e.playerStore.controller.supports("setVolume")})]})})})}),zn=O.observer(({bottomBarStore:e})=>{const[t,r]=v.useState(!1),i=()=>r(!t);return o(qn,{bottomBarStore:e,button:o(l.EuiButtonIcon,{title:"Volume","aria-label":"Volume",iconType:S.Speaker2Regular,size:"s",iconSize:"l",onClick:i,disabled:!e.playerStore.controller.supports("getVolume")}),isOpen:t,closePopover:()=>r(!1)})}),Ln=({onClickPlayQueueButton:e})=>o(l.EuiButtonIcon,{title:"Play queue","aria-label":"Play queue",iconType:S.NavigationPlayRegular,size:"s",iconSize:"l",onClick:e}),Vn=O.observer(({bottomBarStore:e,closePopover:t})=>{const r=H.useNostalgicDiva(),i=v.useCallback(async()=>{await e.skipBack10(),t()},[e,t]),a=v.useCallback(async()=>{await e.skipForward30(),t()},[e,t]),s=v.useCallback(async I=>{await r.setPlaybackRate(I),t()},[r,t]),u=v.useCallback(async()=>{e.currentItem!==void 0&&await e.playQueueStore.removeItems([e.currentItem]),t()},[e,t]),[y,m]=v.useState(),b=v.useCallback(async()=>{await e.playerStore.controller.getPlaybackRate().then(I=>m(I))},[e]),E=v.useMemo(()=>[{id:0,items:[{name:"Speed",icon:o(l.EuiIcon,{type:S.TopSpeedRegular}),panel:1,onClick:b,disabled:!e.playerStore.controller.supports("getPlaybackRate")},{name:"Skip back 10 seconds",icon:o(l.EuiIcon,{type:S.SkipBack10Regular}),onClick:i,disabled:!e.canSkipBack10},{name:"Skip forward 30 seconds",icon:o(l.EuiIcon,{type:S.SkipForward30Regular}),onClick:a,disabled:!e.canSkipForward30},{isSeparator:!0},{name:"Remove from play queue",icon:o(l.EuiIcon,{type:S.DismissRegular}),onClick:u,disabled:e.playQueueStore.isEmpty}]},{id:1,title:"Speed",items:[.25,.5,.75,1,1.25,1.5,1.75,2].map(I=>({name:I.toString(),onClick:()=>s(I),icon:I===y?"check":"empty",disabled:!e.playerStore.controller.supports("setPlaybackRate")}))}],[e,b,i,a,u,s,y]);return o(l.EuiContextMenu,{initialPanelId:0,panels:E})}),Un=v.memo(({bottomBarStore:e,button:t,isOpen:r,closePopover:i})=>o(l.EuiPopover,{button:t,isOpen:r,closePopover:i,panelPaddingSize:"none",anchorPosition:"upRight",children:o(Vn,{bottomBarStore:e,closePopover:i})})),Yn=v.memo(({bottomBarStore:e})=>{const[t,r]=v.useState(!1),i=()=>r(!t);return o(Un,{bottomBarStore:e,button:o(l.EuiButtonIcon,{title:"More options","aria-label":"More options",iconType:S.MoreHorizontalFilled,size:"s",iconSize:"l",onClick:i}),isOpen:t,closePopover:()=>r(!1)})}),Gn=v.memo(({bottomBarStore:e,onClickPlayQueueButton:t})=>N(l.EuiFlexGroup,{responsive:!1,gutterSize:"s",justifyContent:"flexEnd",alignItems:"center",children:[o(zn,{bottomBarStore:e}),t&&o(Ln,{onClickPlayQueueButton:t}),o(Yn,{bottomBarStore:e})]})),Hn=O.observer(({bottomBarStore:e})=>{const t=H.useNostalgicDiva(),r=v.useCallback(s=>{const u=Number(s.currentTarget.value)/100;e.playerStore.setPercent(u)},[e]),i=v.useCallback(s=>{s.button===0&&e.playerStore.setSeeking(!0)},[e]),a=v.useCallback(async s=>{if(s.button===0){const u=Number(s.currentTarget.value)/100;e.playerStore.setSeeking(!1);const y=await t.getDuration();y!==void 0&&await t.setCurrentTime(y*u)}},[e,t]);return o(l.EuiRange,{min:0,max:100,step:1e-7,value:e.playerStore.percent*100,onChange:r,onMouseDown:i,onMouseUp:a,fullWidth:!0,showRange:!0,css:{blockSize:32},disabled:e.playQueueStore.isEmpty})}),Bn=O.observer(({bottomBarStore:e,onClickPlayQueueButton:t})=>o(l.EuiBottomBar,{paddingSize:"s",children:N(l.EuiFlexGroup,{direction:"column",gutterSize:"none",children:[o(l.EuiFlexItem,{children:o(Hn,{bottomBarStore:e})}),o(l.EuiFlexItem,{children:N(l.EuiFlexGroup,{responsive:!1,children:[o(l.EuiFlexItem,{css:{width:"calc(100% / 3)"},children:o($n,{bottomBarStore:e})}),o(l.EuiFlexItem,{css:{width:"calc(100% / 3)"},children:o(Dn,{bottomBarStore:e})}),o(l.EuiFlexItem,{css:{width:"calc(100% / 3)"},children:o(Gn,{bottomBarStore:e,onClickPlayQueueButton:t})})]})})]})})),Wn=e=>o(H.NostalgicDivaProvider,{...e}),Je={width:400,height:225},Jn=O.observer(({children:e})=>{const t=$t();return N(l.EuiPageTemplate,{panelled:!0,style:{minBlockSize:`max(460px, 100vh - ${Qe}px)`},children:[e,!t.isEmpty&&o(l.EuiSpacer,{style:{blockSize:Je.height}})]})}),Qn=O.observer(({miniPlayerStore:e})=>{const t=v.useMemo(()=>({onLoaded:e.onLoaded,onPlay:e.onPlay,onPause:e.onPause,onEnded:e.onEnded,onTimeUpdate:e.onTimeUpdate}),[e]);return o("div",{css:{position:"fixed",right:0,bottom:Qe,width:Je.width,height:Je.height,zIndex:998,backgroundColor:"rgb(39, 39, 39)",display:"flex",flexDirection:"column"},children:o("div",{css:{flexGrow:1,backgroundColor:"black"},children:e.currentItem&&o(H.NostalgicDiva,{src:e.currentItem.url,options:t,onControllerChange:e.onControllerChange})})})});class Kn{controller=H.nullPlayerController;playing=!1;percent=0;seeking=!1;constructor(t){t.makeObservable(this,{controller:d.observable,playing:d.observable,percent:d.observable,seeking:d.observable,setPlaying:d.action,setPercent:d.action,setSeeking:d.action,onControllerChange:d.action.bound,onPlay:d.action.bound,onPause:d.action.bound,onEnded:d.action.bound,onTimeUpdate:d.action.bound})}setPlaying(t){this.playing=t}setPercent(t){this.percent=t}setSeeking(t){this.seeking=t}onControllerChange(t){this.controller=t}onPlay(){this.playing=!0}onPause(){this.playing=!1}onEnded(){this.playing=!1}onTimeUpdate({percent:t}){t!==void 0&&(this.seeking||(this.percent=t))}}const jt=v.createContext(void 0),Xn=({children:e})=>{const[t]=v.useState(()=>new Kn(new Ke));return o(jt.Provider,{value:t,children:e})},Zn=()=>v.useContext(jt);exports.BottomBar=Bn;exports.HydrangeanDivaProvider=Wn;exports.MediaPlayerLayout=Jn;exports.MiniPlayer=Qn;exports.MobXObservableStateProvider=Ke;exports.ObservableStateProvider=fr;exports.PlayQueue=Mt;exports.PlayQueuePage=In;exports.PlayQueueStoreProvider=wn;exports.PlayerStoreProvider=Xn;exports.RepeatMode=$;exports.bottomBarHeight=Qe;exports.usePlayerStore=Zn;
14
+ <%s key={someKey} {...props} />`,Ye,ee,ar,ee),pt[ee+Ye]=!0}}return n===i?er(M):Zt(M),M}}function tr(n,c,p){return yt(n,c,p,!0)}function rr(n,c,p){return yt(n,c,p,!1)}var nr=rr,ir=tr;he.Fragment=i,he.jsx=nr,he.jsxs=ir})()),he}var gt;function mr(){return gt||(gt=1,process.env.NODE_ENV==="production"?ke.exports=pr():ke.exports=yr()),ke.exports}var ge=mr(),_e={exports:{}},C={};var bt;function hr(){if(bt)return C;bt=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,i=e?Symbol.for("react.fragment"):60107,a=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,u=e?Symbol.for("react.provider"):60109,y=e?Symbol.for("react.context"):60110,m=e?Symbol.for("react.async_mode"):60111,b=e?Symbol.for("react.concurrent_mode"):60111,E=e?Symbol.for("react.forward_ref"):60112,I=e?Symbol.for("react.suspense"):60113,z=e?Symbol.for("react.suspense_list"):60120,j=e?Symbol.for("react.memo"):60115,F=e?Symbol.for("react.lazy"):60116,Y=e?Symbol.for("react.block"):60121,J=e?Symbol.for("react.fundamental"):60117,L=e?Symbol.for("react.responder"):60118,k=e?Symbol.for("react.scope"):60119;function D(f){if(typeof f=="object"&&f!==null){var V=f.$$typeof;switch(V){case t:switch(f=f.type,f){case m:case b:case i:case s:case a:case I:return f;default:switch(f=f&&f.$$typeof,f){case y:case E:case F:case j:case u:return f;default:return V}}case r:return V}}}function _(f){return D(f)===b}return C.AsyncMode=m,C.ConcurrentMode=b,C.ContextConsumer=y,C.ContextProvider=u,C.Element=t,C.ForwardRef=E,C.Fragment=i,C.Lazy=F,C.Memo=j,C.Portal=r,C.Profiler=s,C.StrictMode=a,C.Suspense=I,C.isAsyncMode=function(f){return _(f)||D(f)===m},C.isConcurrentMode=_,C.isContextConsumer=function(f){return D(f)===y},C.isContextProvider=function(f){return D(f)===u},C.isElement=function(f){return typeof f=="object"&&f!==null&&f.$$typeof===t},C.isForwardRef=function(f){return D(f)===E},C.isFragment=function(f){return D(f)===i},C.isLazy=function(f){return D(f)===F},C.isMemo=function(f){return D(f)===j},C.isPortal=function(f){return D(f)===r},C.isProfiler=function(f){return D(f)===s},C.isStrictMode=function(f){return D(f)===a},C.isSuspense=function(f){return D(f)===I},C.isValidElementType=function(f){return typeof f=="string"||typeof f=="function"||f===i||f===b||f===s||f===a||f===I||f===z||typeof f=="object"&&f!==null&&(f.$$typeof===F||f.$$typeof===j||f.$$typeof===u||f.$$typeof===y||f.$$typeof===E||f.$$typeof===J||f.$$typeof===L||f.$$typeof===k||f.$$typeof===Y)},C.typeOf=D,C}var T={};var Pt;function vr(){return Pt||(Pt=1,process.env.NODE_ENV!=="production"&&(function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,i=e?Symbol.for("react.fragment"):60107,a=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,u=e?Symbol.for("react.provider"):60109,y=e?Symbol.for("react.context"):60110,m=e?Symbol.for("react.async_mode"):60111,b=e?Symbol.for("react.concurrent_mode"):60111,E=e?Symbol.for("react.forward_ref"):60112,I=e?Symbol.for("react.suspense"):60113,z=e?Symbol.for("react.suspense_list"):60120,j=e?Symbol.for("react.memo"):60115,F=e?Symbol.for("react.lazy"):60116,Y=e?Symbol.for("react.block"):60121,J=e?Symbol.for("react.fundamental"):60117,L=e?Symbol.for("react.responder"):60118,k=e?Symbol.for("react.scope"):60119;function D(h){return typeof h=="string"||typeof h=="function"||h===i||h===b||h===s||h===a||h===I||h===z||typeof h=="object"&&h!==null&&(h.$$typeof===F||h.$$typeof===j||h.$$typeof===u||h.$$typeof===y||h.$$typeof===E||h.$$typeof===J||h.$$typeof===L||h.$$typeof===k||h.$$typeof===Y)}function _(h){if(typeof h=="object"&&h!==null){var pe=h.$$typeof;switch(pe){case t:var ie=h.type;switch(ie){case m:case b:case i:case s:case a:case I:return ie;default:var Z=ie&&ie.$$typeof;switch(Z){case y:case E:case F:case j:case u:return Z;default:return pe}}case r:return pe}}}var f=m,V=b,se=y,Pe=u,Ee=t,Me=E,Ne=i,we=F,B=j,Q=r,X=s,Se=a,Ie=I,le=!1;function Re(h){return le||(le=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),ce(h)||_(h)===m}function ce(h){return _(h)===b}function Ce(h){return _(h)===y}function Te(h){return _(h)===u}function xe(h){return typeof h=="object"&&h!==null&&h.$$typeof===t}function $e(h){return _(h)===E}function je(h){return _(h)===i}function ue(h){return _(h)===F}function de(h){return _(h)===j}function re(h){return _(h)===r}function fe(h){return _(h)===s}function ne(h){return _(h)===a}function qe(h){return _(h)===I}T.AsyncMode=f,T.ConcurrentMode=V,T.ContextConsumer=se,T.ContextProvider=Pe,T.Element=Ee,T.ForwardRef=Me,T.Fragment=Ne,T.Lazy=we,T.Memo=B,T.Portal=Q,T.Profiler=X,T.StrictMode=Se,T.Suspense=Ie,T.isAsyncMode=Re,T.isConcurrentMode=ce,T.isContextConsumer=Ce,T.isContextProvider=Te,T.isElement=xe,T.isForwardRef=$e,T.isFragment=je,T.isLazy=ue,T.isMemo=de,T.isPortal=re,T.isProfiler=fe,T.isStrictMode=ne,T.isSuspense=qe,T.isValidElementType=D,T.typeOf=_})()),T}var Et;function gr(){return Et||(Et=1,process.env.NODE_ENV==="production"?_e.exports=hr():_e.exports=vr()),_e.exports}var Ge,wt;function br(){if(wt)return Ge;wt=1;var e=gr(),t={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},r={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};s[e.ForwardRef]=i,s[e.Memo]=a;function u(F){return e.isMemo(F)?a:s[F.$$typeof]||t}var y=Object.defineProperty,m=Object.getOwnPropertyNames,b=Object.getOwnPropertySymbols,E=Object.getOwnPropertyDescriptor,I=Object.getPrototypeOf,z=Object.prototype;function j(F,Y,J){if(typeof Y!="string"){if(z){var L=I(Y);L&&L!==z&&j(F,L,J)}var k=m(Y);b&&(k=k.concat(b(Y)));for(var D=u(F),_=u(Y),f=0;f<k.length;++f){var V=k[f];if(!r[V]&&!(J&&J[V])&&!(_&&_[V])&&!(D&&D[V])){var se=E(Y,V);try{y(F,V,se)}catch{}}}}return F}return Ge=j,Ge}br();var Pr=!0;function Er(e,t,r){var i="";return r.split(" ").forEach(function(a){e[a]!==void 0?t.push(e[a]+";"):a&&(i+=a+" ")}),i}var Tt=function(t,r,i){var a=t.key+"-"+r.name;(i===!1||Pr===!1)&&t.registered[a]===void 0&&(t.registered[a]=r.styles)},wr=function(t,r,i){Tt(t,r,i);var a=t.key+"-"+r.name;if(t.inserted[r.name]===void 0){var s=r;do t.insert(r===s?"."+a:"",s,t.sheet,!0),s=s.next;while(s!==void 0)}};function Sr(e){for(var t=0,r,i=0,a=e.length;a>=4;++i,a-=4)r=e.charCodeAt(i)&255|(e.charCodeAt(++i)&255)<<8|(e.charCodeAt(++i)&255)<<16|(e.charCodeAt(++i)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,t=(r&65535)*1540483477+((r>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(a){case 3:t^=(e.charCodeAt(i+2)&255)<<16;case 2:t^=(e.charCodeAt(i+1)&255)<<8;case 1:t^=e.charCodeAt(i)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var Ir={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function Rr(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var Cr=/[A-Z]|^ms/g,Tr=/_EMO_([^_]+?)_([^]*?)_EMO_/g,xt=function(t){return t.charCodeAt(1)===45},St=function(t){return t!=null&&typeof t!="boolean"},He=Rr(function(e){return xt(e)?e:e.replace(Cr,"-$&").toLowerCase()}),It=function(t,r){switch(t){case"animation":case"animationName":if(typeof r=="string")return r.replace(Tr,function(i,a,s){return W={name:a,styles:s,next:W},a})}return Ir[t]!==1&&!xt(t)&&typeof r=="number"&&r!==0?r+"px":r};function be(e,t,r){if(r==null)return"";var i=r;if(i.__emotion_styles!==void 0)return i;switch(typeof r){case"boolean":return"";case"object":{var a=r;if(a.anim===1)return W={name:a.name,styles:a.styles,next:W},a.name;var s=r;if(s.styles!==void 0){var u=s.next;if(u!==void 0)for(;u!==void 0;)W={name:u.name,styles:u.styles,next:W},u=u.next;var y=s.styles+";";return y}return xr(e,t,r)}case"function":{if(e!==void 0){var m=W,b=r(e);return W=m,be(e,t,b)}break}}var E=r;return E}function xr(e,t,r){var i="";if(Array.isArray(r))for(var a=0;a<r.length;a++)i+=be(e,t,r[a])+";";else for(var s in r){var u=r[s];if(typeof u!="object"){var y=u;St(y)&&(i+=He(s)+":"+It(s,y)+";")}else if(Array.isArray(u)&&typeof u[0]=="string"&&t==null)for(var m=0;m<u.length;m++)St(u[m])&&(i+=He(s)+":"+It(s,u[m])+";");else{var b=be(e,t,u);switch(s){case"animation":case"animationName":{i+=He(s)+":"+b+";";break}default:i+=s+"{"+b+"}"}}}return i}var Rt=/label:\s*([^\s;{]+)\s*(;|$)/g,W;function Or(e,t,r){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var i=!0,a="";W=void 0;var s=e[0];if(s==null||s.raw===void 0)i=!1,a+=be(r,t,s);else{var u=s;a+=u[0]}for(var y=1;y<e.length;y++)if(a+=be(r,t,e[y]),i){var m=s;a+=m[y]}Rt.lastIndex=0;for(var b="",E;(E=Rt.exec(a))!==null;)b+="-"+E[1];var I=Sr(a)+b;return{name:I,styles:a,next:W}}var kr=function(t){return t()},_r=K.useInsertionEffect?K.useInsertionEffect:!1,Ar=_r||kr,Ot=K.createContext(typeof HTMLElement<"u"?sr({key:"css"}):null);Ot.Provider;var Fr=function(t){return v.forwardRef(function(r,i){var a=v.useContext(Ot);return t(r,a,i)})},Dr=K.createContext({}),Fe={}.hasOwnProperty,We="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",kt=function(t,r){var i={};for(var a in r)Fe.call(r,a)&&(i[a]=r[a]);return i[We]=t,i},Mr=function(t){var r=t.cache,i=t.serialized,a=t.isStringTag;return Tt(r,i,a),Ar(function(){return wr(r,i,a)}),null},Nr=Fr(function(e,t,r){var i=e.css;typeof i=="string"&&t.registered[i]!==void 0&&(i=t.registered[i]);var a=e[We],s=[i],u="";typeof e.className=="string"?u=Er(t.registered,s,e.className):e.className!=null&&(u=e.className+" ");var y=Or(s,void 0,K.useContext(Dr));u+=t.key+"-"+y.name;var m={};for(var b in e)Fe.call(e,b)&&b!=="css"&&b!==We&&(m[b]=e[b]);return m.className=u,r&&(m.ref=r),K.createElement(K.Fragment,null,K.createElement(Mr,{cache:t,serialized:y,isStringTag:typeof a=="string"}),K.createElement(a,m))}),_t=Nr,De=ge.Fragment,o=function(t,r,i){return Fe.call(r,"css")?ge.jsx(_t,kt(t,r),i):ge.jsx(t,r,i)},N=function(t,r,i){return Fe.call(r,"css")?ge.jsxs(_t,kt(t,r),i):ge.jsxs(t,r,i)};const $r={mediaPlayer:{enablePlaylists:process.env.NODE_ENV!=="production"}},jr="http://localhost".replace(/\/+$/,"");class At{constructor(t={}){this.configuration=t}set config(t){this.configuration=t}get basePath(){return this.configuration.basePath!=null?this.configuration.basePath:jr}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||Ft}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){const t=this.configuration.apiKey;if(t)return typeof t=="function"?t:()=>t}get accessToken(){const t=this.configuration.accessToken;if(t)return typeof t=="function"?t:async()=>t}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}}const qr=new At;class et{constructor(t=qr){this.configuration=t,this.middleware=t.middleware}static jsonRegex=new RegExp("^(:?application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(:?;.*)?$","i");middleware;withMiddleware(...t){const r=this.clone();return r.middleware=r.middleware.concat(...t),r}withPreMiddleware(...t){const r=t.map(i=>({pre:i}));return this.withMiddleware(...r)}withPostMiddleware(...t){const r=t.map(i=>({post:i}));return this.withMiddleware(...r)}isJsonMime(t){return t?et.jsonRegex.test(t):!1}async request(t,r){const{url:i,init:a}=await this.createFetchParams(t,r),s=await this.fetchApi(i,a);if(s&&s.status>=200&&s.status<300)return s;throw new Vr(s,"Response returned an error code")}async createFetchParams(t,r){let i=this.configuration.basePath+t.path;t.query!==void 0&&Object.keys(t.query).length!==0&&(i+="?"+this.configuration.queryParamsStringify(t.query));const a=Object.assign({},this.configuration.headers,t.headers);Object.keys(a).forEach(E=>a[E]===void 0?delete a[E]:{});const s=typeof r=="function"?r:async()=>r,u={method:t.method,headers:a,body:t.body,credentials:this.configuration.credentials},y={...u,...await s({init:u,context:t})};let m;Lr(y.body)||y.body instanceof URLSearchParams||zr(y.body)?m=y.body:this.isJsonMime(a["Content-Type"])?m=JSON.stringify(y.body):m=y.body;const b={...y,body:m};return{url:i,init:b}}fetchApi=async(t,r)=>{let i={url:t,init:r};for(const s of this.middleware)s.pre&&(i=await s.pre({fetch:this.fetchApi,...i})||i);let a;try{a=await(this.configuration.fetchApi||fetch)(i.url,i.init)}catch(s){for(const u of this.middleware)u.onError&&(a=await u.onError({fetch:this.fetchApi,url:i.url,init:i.init,error:s,response:a?a.clone():void 0})||a);if(a===void 0)throw s instanceof Error?new Ur(s,"The request failed and the interceptors did not return an alternative response"):s}for(const s of this.middleware)s.post&&(a=await s.post({fetch:this.fetchApi,url:i.url,init:i.init,response:a.clone()})||a);return a};clone(){const t=this.constructor,r=new t(this.configuration);return r.middleware=this.middleware.slice(),r}}function zr(e){return typeof Blob<"u"&&e instanceof Blob}function Lr(e){return typeof FormData<"u"&&e instanceof FormData}class Vr extends Error{constructor(t,r){super(r),this.response=t}name="ResponseError"}class Ur extends Error{constructor(t,r){super(r),this.cause=t}name="FetchError"}class ve extends Error{constructor(t,r){super(r),this.field=t}name="RequiredError"}function Ft(e,t=""){return Object.keys(e).map(r=>Dt(r,e[r],t)).filter(r=>r.length>0).join("&")}function Dt(e,t,r=""){const i=r+(r.length?`[${e}]`:e);if(t instanceof Array){const a=t.map(s=>encodeURIComponent(String(s))).join(`&${encodeURIComponent(i)}=`);return`${encodeURIComponent(i)}=${a}`}if(t instanceof Set){const a=Array.from(t);return Dt(e,a,r)}return t instanceof Date?`${encodeURIComponent(i)}=${encodeURIComponent(t.toISOString())}`:t instanceof Object?Ft(t,i):`${encodeURIComponent(i)}=${encodeURIComponent(String(t))}`}class te{constructor(t,r=i=>i){this.raw=t,this.transformer=r}async value(){return this.transformer(await this.raw.json())}}function Mt(e){return Yr(e)}function Yr(e,t){return e==null?e:{id:e.id,name:e.name}}function Gr(e){return Hr(e)}function Hr(e,t){return e==null?e:{playlist:Mt(e.playlist)}}function Br(e){return Wr(e)}function Wr(e,t){return e==null?e:{items:e.items.map(Mt)}}function Jr(e){return Qr(e)}function Qr(e,t){return e==null?e:{id:e.id,url:e.url,type:e.type,videoId:e.videoId,title:e.title}}function Kr(e){return Xr(e)}function Xr(e,t){return e==null?e:{items:e.items.map(Jr)}}function Zr(e){return en(e,!1)}function en(e,t=!1){return e==null?e:{name:e.name}}function tn(e){return rn(e,!1)}function rn(e,t=!1){return e==null?e:{name:e.name}}class nn extends et{async mediaPlayerPlaylistsGetRaw(t){const r={},i={},s=await this.request({path:"/media-player/playlists",method:"GET",headers:i,query:r},t);return new te(s,u=>Br(u))}async mediaPlayerPlaylistsGet(t){return await(await this.mediaPlayerPlaylistsGetRaw(t)).value()}async mediaPlayerPlaylistsIdDeleteRaw(t,r){if(t.id==null)throw new ve("id",'Required parameter "id" was null or undefined when calling mediaPlayerPlaylistsIdDelete().');const i={},a={};let s="/media-player/playlists/{id}";s=s.replace("{id}",encodeURIComponent(String(t.id)));const u=await this.request({path:s,method:"DELETE",headers:a,query:i},r);return new te(u)}async mediaPlayerPlaylistsIdDelete(t,r){return await(await this.mediaPlayerPlaylistsIdDeleteRaw(t,r)).value()}async mediaPlayerPlaylistsIdGetRaw(t,r){if(t.id==null)throw new ve("id",'Required parameter "id" was null or undefined when calling mediaPlayerPlaylistsIdGet().');const i={},a={};let s="/media-player/playlists/{id}";s=s.replace("{id}",encodeURIComponent(String(t.id)));const u=await this.request({path:s,method:"GET",headers:a,query:i},r);return new te(u,y=>Gr(y))}async mediaPlayerPlaylistsIdGet(t,r){return await(await this.mediaPlayerPlaylistsIdGetRaw(t,r)).value()}async mediaPlayerPlaylistsIdRenamePostRaw(t,r){if(t.id==null)throw new ve("id",'Required parameter "id" was null or undefined when calling mediaPlayerPlaylistsIdRenamePost().');const i={},a={};a["Content-Type"]="application/json";let s="/media-player/playlists/{id}:rename";s=s.replace("{id}",encodeURIComponent(String(t.id)));const u=await this.request({path:s,method:"POST",headers:a,query:i,body:tn(t.hydrangeanDivaMediaPlayerEndpointsPlaylistsRenamePlaylistRequest)},r);return new te(u)}async mediaPlayerPlaylistsIdRenamePost(t,r){return await(await this.mediaPlayerPlaylistsIdRenamePostRaw(t,r)).value()}async mediaPlayerPlaylistsIdTracksGetRaw(t,r){if(t.id==null)throw new ve("id",'Required parameter "id" was null or undefined when calling mediaPlayerPlaylistsIdTracksGet().');const i={},a={};let s="/media-player/playlists/{id}/tracks";s=s.replace("{id}",encodeURIComponent(String(t.id)));const u=await this.request({path:s,method:"GET",headers:a,query:i},r);return new te(u,y=>Kr(y))}async mediaPlayerPlaylistsIdTracksGet(t,r){return await(await this.mediaPlayerPlaylistsIdTracksGetRaw(t,r)).value()}async mediaPlayerPlaylistsIdTracksPutRaw(t,r){if(t.id==null)throw new ve("id",'Required parameter "id" was null or undefined when calling mediaPlayerPlaylistsIdTracksPut().');const i={},a={};let s="/media-player/playlists/{id}/tracks";s=s.replace("{id}",encodeURIComponent(String(t.id)));const u=await this.request({path:s,method:"PUT",headers:a,query:i},r);return new te(u)}async mediaPlayerPlaylistsIdTracksPut(t,r){return await(await this.mediaPlayerPlaylistsIdTracksPutRaw(t,r)).value()}async mediaPlayerPlaylistsPostRaw(t,r){const i={},a={};a["Content-Type"]="application/json";const u=await this.request({path:"/media-player/playlists",method:"POST",headers:a,query:i,body:Zr(t.hydrangeanDivaMediaPlayerEndpointsPlaylistsCreatePlaylistRequest)},r);return new te(u)}async mediaPlayerPlaylistsPost(t={},r){return await(await this.mediaPlayerPlaylistsPostRaw(t,r)).value()}}const an=new At({basePath:new URL("api",window.location.origin).toString()}),on=new nn(an),sn=({disabled:e,onAddToPlaylist:t})=>{const[r,i]=v.useState(!1),[a,s]=v.useState("loading");return v.useEffect(()=>{on.mediaPlayerPlaylistsGet().then(u=>s(u.items.map(y=>({key:y.id,label:y.name}))))},[]),o(l.EuiPopover,{panelPaddingSize:"none",button:o(l.EuiButton,{iconType:S.AddRegular,onClick:()=>i(!r),disabled:e,children:"Add to"}),isOpen:r,closePopover:()=>i(!1),children:o(l.EuiSelectable,{searchable:!0,searchProps:{compressed:!0},options:a==="loading"?void 0:a,isLoading:a==="loading",onChange:async(u,y,m)=>{i(!1),await t(m)},singleSelection:!0,children:(u,y)=>N("div",{style:{width:240},children:[o(l.EuiPopoverTitle,{paddingSize:"s",children:y}),u,o(l.EuiPopoverFooter,{paddingSize:"s",children:o(l.EuiButton,{size:"s",fullWidth:!0,iconType:S.AddRegular,children:"New playlist"})})]})})})},ln=({onCancel:e,onSave:t})=>{const r=l.useGeneratedHtmlId({prefix:"modalForm"}),[i,a]=v.useState(""),[s,u]=v.useState(""),[y,m]=v.useState(!1);return N(l.EuiModal,{onClose:e,initialFocus:"[name=url]",children:[o(l.EuiModalHeader,{children:o(l.EuiModalHeaderTitle,{children:"Add video"})}),o(l.EuiModalBody,{children:N(l.EuiForm,{id:r,component:"form",onSubmit:async b=>{b.preventDefault();try{m(!0),await t({url:i,title:s})}finally{m(!1)}},children:[o(l.EuiFormRow,{label:"URL",children:o(l.EuiFieldText,{name:"url",value:i,onChange:b=>a(b.target.value)})}),o(l.EuiFormRow,{label:"Title",children:o(l.EuiFieldText,{name:"title",value:s,onChange:b=>u(b.target.value)})})]})}),N(l.EuiModalFooter,{children:[o(l.EuiButtonEmpty,{onClick:e,children:"Cancel"}),o(l.EuiButton,{type:"submit",form:r,fill:!0,disabled:i.trim().length===0,isLoading:y,children:"Add video"})]})]})},Ct=v.memo(({onSave:e})=>{const[t,r]=v.useState(!1),i=v.useCallback(async a=>{await e(a),r(!1)},[e]);return N(De,{children:[o(l.EuiButton,{onClick:()=>r(!0),iconType:S.AddRegular,color:"primary",children:"Add video"}),t&&o(ln,{onCancel:()=>r(!1),onSave:i})]})}),Nt={Audio:"",Dailymotion:"https://www.dailymotion.com/favicon.ico",Niconico:"https://www.nicovideo.jp/favicon.ico",SoundCloud:"https://soundcloud.com/favicon.ico",Twitch:"https://www.twitch.tv/favicon.ico",Vimeo:"https://vimeo.com/favicon.ico",YouTube:"https://www.youtube.com/favicon.ico"},cn=O.observer(({playQueueStore:e})=>{const{euiTheme:t}=l.useEuiTheme();return N(l.EuiTableHeader,{style:{position:"sticky",top:112,zIndex:998,background:t.colors.backgroundBasePlain},children:[o(l.EuiTableHeaderCellCheckbox,{children:o(l.EuiCheckbox,{id:"",checked:e.allItemsSelected,onChange:r=>{e.allItemsSelected=r.target.checked}})}),o(l.EuiTableHeaderCell,{width:24}),o(l.EuiTableHeaderCell,{children:"Title"}),o(l.EuiTableHeaderCell,{})]})}),un=v.memo(({item:e,closePopover:t})=>{const r=v.useMemo(()=>[{id:0,items:[{name:"Play first",icon:o(l.EuiIcon,{type:""}),onClick:async()=>{t(),await e.playFirst()}},{name:"Play next",icon:o(l.EuiIcon,{type:""}),onClick:async()=>{t(),await e.playNext()}},{name:"Add to play queue",icon:o(l.EuiIcon,{type:S.AddRegular}),onClick:async()=>{t(),await e.addToPlayQueue()}},{isSeparator:!0},{name:"Move to the top",icon:o(l.EuiIcon,{type:S.ArrowUploadRegular}),onClick:async()=>{t(),e.moveToTop()},disabled:!e.canMoveToTop},{name:"Move to the bottom",icon:o(l.EuiIcon,{type:S.ArrowDownloadRegular}),onClick:async()=>{t(),e.moveToBottom()},disabled:!e.canMoveToBottom},{isSeparator:!0},{name:"Remove to the top",icon:o(l.EuiIcon,{type:""}),onClick:async()=>{t(),await e.removeToTop()},disabled:!e.canRemoveToTop},{name:"Remove others",icon:o(l.EuiIcon,{type:""}),onClick:async()=>{t(),await e.removeOthers()},disabled:!e.canRemoveOthers}]}],[t,e]);return o(l.EuiContextMenu,{initialPanelId:0,panels:r})}),dn=v.memo(({item:e})=>{const[t,r]=v.useState(!1),i=v.useCallback(()=>r(!t),[t]),a=v.useCallback(()=>r(!1),[]);return o(l.EuiPopover,{button:o(l.EuiButtonIcon,{title:"More options","aria-label":"More options",iconType:S.MoreHorizontalFilled,size:"s",color:"text",onClick:i}),isOpen:t,closePopover:a,panelPaddingSize:"none",anchorPosition:"leftCenter",children:o(un,{item:e,closePopover:a})})}),fn=O.observer(({item:e})=>{const t=H.useNostalgicDiva();return N(l.EuiTableRowCell,{textOnly:!1,hasActions:!0,align:"right",children:[o(l.EuiButton,{iconType:S.PlayRegular,size:"s",onClick:async()=>{e.isCurrent?await t.setCurrentTime(0):e.play()},children:"Play"}),o(l.EuiButton,{iconType:S.DismissRegular,size:"s",onClick:e.remove,children:"Remove"}),o(dn,{item:e})]})}),pn=O.observer(({item:e})=>{const t=H.useNostalgicDiva();return N(l.EuiTableRow,{isSelected:e.isCurrent,children:[o(l.EuiTableRowCellCheckbox,{children:o(l.EuiCheckbox,{id:e.id.toString(),checked:e.isSelected,onChange:e.toggleSelected})}),o(l.EuiTableRowCell,{textOnly:!1,children:o("img",{src:Nt[e.type],width:16,height:16,alt:e.type})}),o(l.EuiTableRowCell,{children:o(l.EuiLink,{href:e.url,target:"_blank",external:!0,onClick:()=>t.pause(),children:e.title})}),o(fn,{item:e})]},e.id)}),yn=O.observer(({playQueueStore:e})=>o(lr.ReactSortable,{tag:"tbody",list:e.items,setList:t=>e.setItems(t),children:e.items.map(t=>o(pn,{item:t},t.id))})),mn=O.observer(({playQueueStore:e})=>N(l.EuiTable,{children:[o(cn,{playQueueStore:e}),o(yn,{playQueueStore:e})]}));function hn(e){return e!==null&&typeof e=="object"&&"title"in e&&typeof e.title=="string"}const vn=O.observer(({playQueueStore:e})=>o(l.EuiButton,{iconType:S.AddRegular,onClick:e.addSelectedItems,disabled:e.isEmpty||e.selectedItems.length===0,children:"Add to play queue"}));O.observer(({playQueueStore:e})=>{const[t,r]=v.useState(!1);return N(De,{children:[t&&o(l.EuiFlyout,{type:"push",size:"s",onClose:()=>r(!1),children:o("div",{style:{blockSize:"100%"},children:o(l.EuiCodeBlock,{language:"json",overflowHeight:"100%",isCopyable:!0,isVirtualized:!0,children:JSON.stringify(e.localStorageState,void 0,2)})})}),o(l.EuiButton,{onClick:()=>r(i=>!i),iconType:S.WindowDevToolsRegular,children:"Developer tools"})]})});const $t=O.observer(({playQueueStore:e})=>{const{euiTheme:t}=l.useEuiTheme(),r=v.useCallback(async()=>{},[]),i=v.useCallback(async a=>{const s=H.findVideoService(a.url);if(s!==void 0){const u=s.extractVideoId(a.url);if(u!==void 0){const m=await(await fetch(`https://noembed.com/embed?url=${encodeURIComponent(a.url)}`)).json();await e.addItems([e.createItem({url:a.url,type:s.type,videoId:u,title:a.title||(hn(m)?m.title:u)})])}}},[e]);return N(De,{children:[N(l.EuiFlexGroup,{alignItems:"center",gutterSize:"m",style:{position:"sticky",top:48,zIndex:998,background:t.colors.backgroundBasePlain},children:[o(l.EuiFlexItem,{grow:!1,children:o(l.EuiButton,{disabled:e.isEmpty||e.selectedItems.length===0,onClick:e.playSelectedItemsNext,children:"Play next"})}),o(l.EuiFlexItem,{grow:!1,children:o(vn,{playQueueStore:e})}),o(l.EuiFlexItem,{grow:!1,children:o(sn,{disabled:!$r.mediaPlayer.enablePlaylists,onAddToPlaylist:r})}),o(l.EuiFlexItem,{grow:!1,children:o(l.EuiButton,{iconType:S.DismissRegular,onClick:e.removeSelectedItems,disabled:e.isEmpty||e.selectedItems.length===0,children:"Remove"})}),o(l.EuiFlexItem,{grow:!1,children:o(l.EuiButton,{iconType:S.DeleteRegular,onClick:e.clear,disabled:e.isEmpty,children:"Clear"})}),o(l.EuiFlexItem,{grow:!0}),N(l.EuiFlexItem,{grow:!1,children:[!1,o(Ct,{onSave:i})]})]}),o(l.EuiSpacer,{size:"l",style:{position:"sticky",top:88,zIndex:998,background:t.colors.backgroundBasePlain}}),e.isEmpty?o(l.EuiEmptyPrompt,{title:o("h2",{children:"We couldn't find any videos"}),body:o("p",{children:"Your video library doesn't contain any video content."}),actions:o(Ct,{onSave:i})}):o(mn,{playQueueStore:e})]})}),Be=new cr({coerceTypes:!0});function gn(e,t){let r;if(r=Be.getSchema(t),r===void 0&&(Be.addSchema(e,t),r=Be.getSchema(t)),r===void 0||r.schema!==e)throw new Error(`Invalid schema. Expected: '${JSON.stringify(e)}', but got '${JSON.stringify(r?.schema)}'.`);return r}const bn={type:"object",properties:{url:{type:"string"},type:{type:"string"},videoId:{type:"string"},title:{type:"string"}},required:["url","type","videoId","title"]},Pn={type:"object",properties:{version:{type:"string",nullable:!0},repeat:{type:"string",enum:Object.values($),nullable:!0},shuffle:{type:"boolean",nullable:!0},items:{type:"array",nullable:!0,items:bn},currentIndex:{type:"integer",nullable:!0}}};class Ae{constructor(t,r,i){this.observableStateProvider=t,this.playQueueStore=r,this.dto=i,this.id=Ae.nextId++,t.makeObservable(this,{isSelected:d.observable,isCurrent:d.computed,index:d.computed,isFirst:d.computed,isLast:d.computed,canMoveToTop:d.computed,canMoveToBottom:d.computed,canRemoveToTop:d.computed,canRemoveOthers:d.computed,unselect:d.action,toggleSelected:d.action.bound,play:d.action,remove:d.action.bound,playFirst:d.action.bound,playNext:d.action.bound,addToPlayQueue:d.action.bound,moveToTop:d.action.bound,moveToBottom:d.action.bound,removeToTop:d.action.bound,removeOthers:d.action.bound})}static nextId=1;id;isSelected=!1;static fromDto(t,r,i){return new Ae(t,r,i)}get url(){return this.dto.url}get type(){return this.dto.type}get videoId(){return this.dto.videoId}get title(){return this.dto.title}get isCurrent(){return this.playQueueStore.currentItem===this}get index(){return this.playQueueStore.items.indexOf(this)}get isFirst(){return this.index===0}get isLast(){return this.index===this.playQueueStore.items.length-1}get canMoveToTop(){return!this.isFirst}get canMoveToBottom(){return!this.isLast}get canRemoveToTop(){return!this.isFirst}get canRemoveOthers(){return this.playQueueStore.hasMultipleItems}clone(){return this.playQueueStore.createItem(this.dto)}unselect(){this.isSelected=!1}toggleSelected(){this.isSelected=!this.isSelected}play(){this.playQueueStore.setCurrentItem(this)}remove(){return this.playQueueStore.removeItems([this])}async playFirst(){await this.playQueueStore.playFirst([this.clone()])}async playNext(){await this.playQueueStore.playNext([this.clone()])}async addToPlayQueue(){await this.playQueueStore.addItems([this.clone()])}moveToTop(){this.playQueueStore.moveItem(this,0)}moveToBottom(){this.playQueueStore.moveItem(this,this.playQueueStore.items.length-1)}removeToTop(){return this.playQueueStore.removeItemsAbove(this)}removeOthers(){return this.playQueueStore.removeOtherItems(this)}}class En{constructor(t){this.observableStateProvider=t,t.makeObservable(this,{interacted:d.observable,items:d.observable,currentId:d.observable,repeat:d.observable,shuffle:d.observable,localStorageState:d.computed.struct,isEmpty:d.computed,currentItem:d.computed,canPlay:d.computed,canPause:d.computed,hasMultipleItems:d.computed,currentIndex:d.computed,hasPreviousItem:d.computed,hasNextItem:d.computed,isLastItem:d.computed,selectedItems:d.computed,allItemsSelected:d.computed,selectedItemsOrAllItems:d.computed,setItems:d.action,interact:d.action,clear:d.action.bound,unselectAll:d.action,setCurrentItem:d.action,setNextItems:d.action,clearAndSetItems:d.action,playNext:d.action,playSelectedItemsNext:d.action.bound,addItems:d.action,addSelectedItems:d.action.bound,playFirst:d.action,moveItem:d.action,goToFirst:d.action,removeItems:d.action,removeSelectedItems:d.action.bound,removeOtherItems:d.action,removeItemsAbove:d.action,toggleRepeat:d.action.bound,toggleShuffle:d.action.bound,previous:d.action,next:d.action.bound})}interacted=!1;items=[];currentId;repeat=$.Off;shuffle=!1;createItem(t){return Ae.fromDto(this.observableStateProvider,this,{url:t.url,type:t.type,videoId:t.videoId,title:t.title})}get localStorageState(){return{version:"1.0",repeat:this.repeat,shuffle:this.shuffle,items:this.items.map(t=>t.dto),currentIndex:this.currentIndex}}set localStorageState(t){this.repeat=t.repeat??$.Off,this.shuffle=t.shuffle??!1,this.items=t.items?.map(r=>this.createItem(r))??[],this.currentIndex=t.currentIndex}validateLocalStorageState(t){return gn(Pn,"PlayQueueDto")(t)}get isEmpty(){return this.items.length===0}get currentItem(){return this.items.find(t=>t.id===this.currentId)}get canPlay(){return this.currentItem!==void 0}get canPause(){return this.currentItem!==void 0}get hasMultipleItems(){return this.items.length>1}get currentIndex(){return this.currentId!==void 0?this.items.findIndex(t=>t.id===this.currentId):void 0}set currentIndex(t){this.currentId=t!==void 0?this.items.at(t)?.id:void 0}get hasPreviousItem(){return this.hasMultipleItems&&this.currentIndex!==void 0&&this.currentIndex>0}get hasNextItem(){return this.hasMultipleItems&&this.currentIndex!==void 0&&this.currentIndex<this.items.length-1}get isLastItem(){return this.currentIndex!==void 0&&this.currentIndex===this.items.length-1}get selectedItems(){return this.items.filter(t=>t.isSelected)}get allItemsSelected(){return this.selectedItems.length===this.items.length}set allItemsSelected(t){for(const r of this.items)r.isSelected=t}get selectedItemsOrAllItems(){return this.selectedItems.length>0?this.selectedItems:this.items}setItems(t){this.items=t}interact(){this.interacted=!0}clear(){this.interact(),this.currentIndex=void 0,this.items=[]}unselectAll(){for(const t of this.items)t.unselect()}setCurrentItem(t){this.interact(),this.currentId=t?.id}setNextItems(t){this.currentIndex!==void 0&&this.items.splice(this.currentIndex+1,0,...t)}clearAndSetItems(t){this.clear(),this.setCurrentItem(t[0]),this.setNextItems(t)}async playNext(t){if(this.isEmpty){this.clearAndSetItems(t);return}this.setNextItems(t)}async playSelectedItemsNext(){await this.playNext(this.selectedItemsOrAllItems.map(t=>t.clone())),this.unselectAll()}async addItems(t){if(this.isEmpty){this.clearAndSetItems(t);return}this.items.push(...t)}async addSelectedItems(){await this.addItems(this.selectedItemsOrAllItems.map(t=>t.clone())),this.unselectAll()}async playFirst(t){if(this.isEmpty){this.clearAndSetItems(t);return}const{currentIndex:r}=this;r!==void 0&&(this.interact(),this.items.splice(r,0,...t),this.currentIndex=r)}moveItem(t,r){const i=this.items.splice(this.items.indexOf(t),1)[0];this.items.splice(r,0,i)}async goToFirst(){this.currentIndex!==void 0&&(this.currentIndex=0)}async removeItems(t){const{currentItem:r}=this;mt.pull(this.items,...t.filter(s=>s!==r));const{currentIndex:i,isLastItem:a}=this;mt.pull(this.items,t.find(s=>s===r)),this.currentItem!==r&&(this.interact(),a?await this.goToFirst():this.currentIndex=i)}async removeSelectedItems(){await this.removeItems(this.selectedItemsOrAllItems),this.unselectAll()}async removeOtherItems(t){const r=t.id;return this.removeItems(this.items.filter(i=>i.id!==r))}async removeItemsAbove(t){const r=this.items.indexOf(t);return this.removeItems(this.items.filter((i,a)=>a<r))}toggleRepeat(){switch(this.repeat){case $.Off:this.repeat=$.All;break;case $.All:this.repeat=$.One;break;case $.One:this.repeat=$.Off;break}}toggleShuffle(){this.shuffle=!this.shuffle}async previous(){this.currentIndex!==void 0&&this.hasPreviousItem&&(this.interact(),this.currentIndex--)}async next(){this.currentIndex!==void 0&&this.hasNextItem&&(this.interact(),this.currentIndex++)}}const wn=({children:e})=>{const[t]=v.useState(()=>new En(new Ke)),r=H.useNostalgicDiva();return v.useEffect(()=>d.reaction(()=>t.currentItem,async(i,a)=>{i===void 0||a===void 0||i.type===a.type&&i.videoId===a.videoId&&await r.setCurrentTime(0)}),[t,r]),o(Xe.Provider,{value:t,children:e})},Sn=({breadcrumbs:e,tabs:t,...r})=>{const i=ur.useRouter();return o(l.EuiPageTemplate.Header,{...r,breadcrumbs:e?.map(({linkProps:a,...s})=>({...s,href:a===void 0?void 0:i.buildLocation(a).href,onClick:a===void 0?void 0:async u=>{u.preventDefault(),await i.navigate(a)}})),tabs:t?.map(({linkProps:a,...s})=>({...s,href:a===void 0?void 0:i.buildLocation(a).href,onClick:a===void 0?void 0:async u=>{u.preventDefault(),await i.navigate(a)}}))})},In=()=>{const e=Ze();return N(De,{children:[o(Sn,{pageTitle:"Play queue",rightSideItems:[]}),o(l.EuiPageTemplate.Section,{children:o($t,{playQueueStore:e})})]})},Rn=O.observer(({bottomBarStore:e})=>o(l.EuiButtonIcon,{title:`Shuffle: ${e.shuffle?"On":"Off"}`,"aria-label":`Shuffle: ${e.shuffle?"On":"Off"}`,iconType:e.shuffle?S.ArrowShuffleFilled:S.ArrowShuffleOffFilled,size:"s",iconSize:"l",onClick:e.toggleShuffle,disabled:!e.canToggleShuffle})),Cn=O.observer(({bottomBarStore:e})=>o(l.EuiButtonIcon,{title:"Previous","aria-label":"Previous",iconType:S.PreviousFilled,size:"s",iconSize:"l",onClick:e.previous,disabled:!e.canPrevious})),Tn=O.observer(({bottomBarStore:e})=>o(l.EuiButtonIcon,{title:"Skip back 10 seconds","aria-label":"Skip back 10 seconds",iconType:S.SkipBack10Regular,size:"s",iconSize:"l",onClick:e.skipBack10,disabled:!e.canSkipBack10})),xn=O.observer(({bottomBarStore:e})=>o(l.EuiButtonIcon,{title:"Pause","aria-label":"Pause",iconType:S.PauseFilled,size:"s",iconSize:"l",onClick:e.pause,disabled:!e.canPause})),On=O.observer(({bottomBarStore:e})=>o(l.EuiButtonIcon,{title:"Play","aria-label":"Play",iconType:S.PlayFilled,size:"s",iconSize:"l",onClick:e.play,disabled:!e.canPlay})),kn=O.observer(({bottomBarStore:e})=>o(l.EuiButtonIcon,{title:"Skip forward 30 seconds","aria-label":"Skip forward 30 seconds",iconType:S.SkipForward30Regular,size:"s",iconSize:"l",onClick:e.skipForward30,disabled:!e.canSkipForward30})),_n=O.observer(({bottomBarStore:e})=>o(l.EuiButtonIcon,{title:"Next","aria-label":"Next",iconType:S.NextFilled,size:"s",iconSize:"l",onClick:e.next,disabled:!e.canNext})),An={[$.Off]:S.ArrowRepeatAllOffFilled,[$.All]:S.ArrowRepeatAllFilled,[$.One]:S.ArrowRepeat1Filled},Fn=O.observer(({bottomBarStore:e})=>o(l.EuiButtonIcon,{title:`Repeat: ${e.repeat===$.All?"All":e.repeat===$.One?"One":"Off"}`,"aria-label":`Repeat: ${e.repeat===$.All?"All":e.repeat===$.One?"One":"Off"}`,iconType:An[e.repeat],size:"s",iconSize:"l",onClick:e.toggleRepeat,disabled:!e.canToggleRepeat})),Dn=O.observer(({bottomBarStore:e})=>N(l.EuiFlexGroup,{responsive:!1,gutterSize:"s",justifyContent:"center",alignItems:"center",children:[o(Rn,{bottomBarStore:e}),o(Cn,{bottomBarStore:e}),o(Tn,{bottomBarStore:e}),e.playing?o(xn,{bottomBarStore:e}):o(On,{bottomBarStore:e}),o(kn,{bottomBarStore:e}),o(_n,{bottomBarStore:e}),o(Fn,{bottomBarStore:e})]})),Mn=v.memo(({item:e,closePopover:t})=>{const r=H.useNostalgicDiva(),i=v.useMemo(()=>[{id:0,items:[{name:"Open in new tab",icon:o(l.EuiIcon,{type:S.OpenRegular}),onClick:async()=>{t(),await r.pause(),window.open(e.dto.url,"_blank")}},{name:"Copy link address",icon:o(l.EuiIcon,{type:""}),onClick:async()=>{t(),await navigator.clipboard.writeText(e.dto.url)}},{name:"Copy link text",icon:o(l.EuiIcon,{type:""}),onClick:async()=>{t(),await navigator.clipboard.writeText(e.dto.title)}}]}],[t,r,e]);return o(l.EuiContextMenu,{initialPanelId:0,panels:i})}),Nn=v.memo(({item:e})=>{const[t,r]=v.useState(!1),i=v.useCallback(()=>r(!t),[t]),a=v.useCallback(()=>r(!1),[]);return o(l.EuiPopover,{button:o(l.EuiButtonEmpty,{iconType:Nt[e.type],size:"s",onClick:i,children:e.title}),isOpen:t,closePopover:a,panelPaddingSize:"none",anchorPosition:"upLeft",children:o(Mn,{item:e,closePopover:a})})}),$n=O.observer(({bottomBarStore:e})=>o(l.EuiFlexGroup,{responsive:!1,gutterSize:"s",justifyContent:"flexStart",alignItems:"center",children:e.currentItem&&o(Nn,{item:e.currentItem})})),jn=O.observer(({bottomBarStore:e})=>o(l.EuiButtonIcon,{title:"Mute","aria-label":"Mute",iconType:S.Speaker2Regular,size:"s",iconSize:"l",disabled:!e.playerStore.controller.supports("setMuted")})),qn=O.observer(({bottomBarStore:e,button:t,isOpen:r,closePopover:i})=>{const[a,s]=v.useState("0"),u=H.useNostalgicDiva();v.useLayoutEffect(()=>{r&&u.getVolume().then(m=>{m!==void 0&&s(Math.floor(m*100).toString())})},[r,u]);const y=v.useCallback(async m=>{s(m.currentTarget.value),await u.setVolume(Number(m.currentTarget.value)/100)},[u]);return o(l.EuiPopover,{button:t,isOpen:r,closePopover:i,anchorPosition:"upRight",children:o(l.EuiFormRow,{children:N(l.EuiFlexGroup,{responsive:!1,gutterSize:"s",justifyContent:"center",alignItems:"center",children:[o(jn,{bottomBarStore:e}),o(l.EuiRange,{min:0,max:100,step:1,value:a,onChange:y,css:{blockSize:32},disabled:!e.playerStore.controller.supports("setVolume")})]})})})}),zn=O.observer(({bottomBarStore:e})=>{const[t,r]=v.useState(!1),i=()=>r(!t);return o(qn,{bottomBarStore:e,button:o(l.EuiButtonIcon,{title:"Volume","aria-label":"Volume",iconType:S.Speaker2Regular,size:"s",iconSize:"l",onClick:i,disabled:!e.playerStore.controller.supports("getVolume")}),isOpen:t,closePopover:()=>r(!1)})}),Ln=({onClickPlayQueueButton:e})=>o(l.EuiButtonIcon,{title:"Play queue","aria-label":"Play queue",iconType:S.NavigationPlayRegular,size:"s",iconSize:"l",onClick:e}),Vn=O.observer(({bottomBarStore:e,closePopover:t})=>{const r=H.useNostalgicDiva(),i=v.useCallback(async()=>{await e.skipBack10(),t()},[e,t]),a=v.useCallback(async()=>{await e.skipForward30(),t()},[e,t]),s=v.useCallback(async I=>{await r.setPlaybackRate(I),t()},[r,t]),u=v.useCallback(async()=>{e.currentItem!==void 0&&await e.playQueueStore.removeItems([e.currentItem]),t()},[e,t]),[y,m]=v.useState(),b=v.useCallback(async()=>{await e.playerStore.controller.getPlaybackRate().then(I=>m(I))},[e]),E=v.useMemo(()=>[{id:0,items:[{name:"Speed",icon:o(l.EuiIcon,{type:S.TopSpeedRegular}),panel:1,onClick:b,disabled:!e.playerStore.controller.supports("getPlaybackRate")},{name:"Skip back 10 seconds",icon:o(l.EuiIcon,{type:S.SkipBack10Regular}),onClick:i,disabled:!e.canSkipBack10},{name:"Skip forward 30 seconds",icon:o(l.EuiIcon,{type:S.SkipForward30Regular}),onClick:a,disabled:!e.canSkipForward30},{isSeparator:!0},{name:"Remove from play queue",icon:o(l.EuiIcon,{type:S.DismissRegular}),onClick:u,disabled:e.playQueueStore.isEmpty}]},{id:1,title:"Speed",items:[.25,.5,.75,1,1.25,1.5,1.75,2].map(I=>({name:I.toString(),onClick:()=>s(I),icon:I===y?"check":"empty",disabled:!e.playerStore.controller.supports("setPlaybackRate")}))}],[e,b,i,a,u,s,y]);return o(l.EuiContextMenu,{initialPanelId:0,panels:E})}),Un=v.memo(({bottomBarStore:e,button:t,isOpen:r,closePopover:i})=>o(l.EuiPopover,{button:t,isOpen:r,closePopover:i,panelPaddingSize:"none",anchorPosition:"upRight",children:o(Vn,{bottomBarStore:e,closePopover:i})})),Yn=v.memo(({bottomBarStore:e})=>{const[t,r]=v.useState(!1),i=()=>r(!t);return o(Un,{bottomBarStore:e,button:o(l.EuiButtonIcon,{title:"More options","aria-label":"More options",iconType:S.MoreHorizontalFilled,size:"s",iconSize:"l",onClick:i}),isOpen:t,closePopover:()=>r(!1)})}),Gn=v.memo(({bottomBarStore:e,onClickPlayQueueButton:t})=>N(l.EuiFlexGroup,{responsive:!1,gutterSize:"s",justifyContent:"flexEnd",alignItems:"center",children:[o(zn,{bottomBarStore:e}),t&&o(Ln,{onClickPlayQueueButton:t}),o(Yn,{bottomBarStore:e})]})),Hn=O.observer(({bottomBarStore:e})=>{const t=H.useNostalgicDiva(),r=v.useCallback(s=>{const u=Number(s.currentTarget.value)/100;e.playerStore.setPercent(u)},[e]),i=v.useCallback(s=>{s.button===0&&e.playerStore.setSeeking(!0)},[e]),a=v.useCallback(async s=>{if(s.button===0){const u=Number(s.currentTarget.value)/100;e.playerStore.setSeeking(!1);const y=await t.getDuration();y!==void 0&&await t.setCurrentTime(y*u)}},[e,t]);return o(l.EuiRange,{min:0,max:100,step:1e-7,value:e.playerStore.percent*100,onChange:r,onMouseDown:i,onMouseUp:a,fullWidth:!0,showRange:!0,css:{blockSize:32},disabled:e.playQueueStore.isEmpty})}),Bn=O.observer(({bottomBarStore:e,onClickPlayQueueButton:t})=>o(l.EuiBottomBar,{paddingSize:"s",children:N(l.EuiFlexGroup,{direction:"column",gutterSize:"none",children:[o(l.EuiFlexItem,{children:o(Hn,{bottomBarStore:e})}),o(l.EuiFlexItem,{children:N(l.EuiFlexGroup,{responsive:!1,children:[o(l.EuiFlexItem,{css:{width:"calc(100% / 3)"},children:o($n,{bottomBarStore:e})}),o(l.EuiFlexItem,{css:{width:"calc(100% / 3)"},children:o(Dn,{bottomBarStore:e})}),o(l.EuiFlexItem,{css:{width:"calc(100% / 3)"},children:o(Gn,{bottomBarStore:e,onClickPlayQueueButton:t})})]})})]})})),Wn=e=>o(H.NostalgicDivaProvider,{...e}),Je={width:400,height:225},Jn=O.observer(({children:e})=>{const t=Ze();return N(l.EuiPageTemplate,{panelled:!0,style:{minBlockSize:`max(460px, 100vh - ${Qe}px)`},children:[e,!t.isEmpty&&o(l.EuiSpacer,{style:{blockSize:Je.height}})]})}),Qn=O.observer(({miniPlayerStore:e})=>{const t=v.useMemo(()=>({onLoaded:e.onLoaded,onPlay:e.onPlay,onPause:e.onPause,onEnded:e.onEnded,onTimeUpdate:e.onTimeUpdate}),[e]);return o("div",{css:{position:"fixed",right:0,bottom:Qe,width:Je.width,height:Je.height,zIndex:998,backgroundColor:"rgb(39, 39, 39)",display:"flex",flexDirection:"column"},children:o("div",{css:{flexGrow:1,backgroundColor:"black"},children:e.currentItem&&o(H.NostalgicDiva,{src:e.currentItem.url,options:t,onControllerChange:e.onControllerChange})})})});class Kn{controller=H.nullPlayerController;playing=!1;percent=0;seeking=!1;constructor(t){t.makeObservable(this,{controller:d.observable,playing:d.observable,percent:d.observable,seeking:d.observable,setPlaying:d.action,setPercent:d.action,setSeeking:d.action,onControllerChange:d.action.bound,onPlay:d.action.bound,onPause:d.action.bound,onEnded:d.action.bound,onTimeUpdate:d.action.bound})}setPlaying(t){this.playing=t}setPercent(t){this.percent=t}setSeeking(t){this.seeking=t}onControllerChange(t){this.controller=t}onPlay(){this.playing=!0}onPause(){this.playing=!1}onEnded(){this.playing=!1}onTimeUpdate({percent:t}){t!==void 0&&(this.seeking||(this.percent=t))}}const jt=v.createContext(void 0),Xn=({children:e})=>{const[t]=v.useState(()=>new Kn(new Ke));return o(jt.Provider,{value:t,children:e})},Zn=()=>v.useContext(jt);exports.BottomBar=Bn;exports.HydrangeanDivaProvider=Wn;exports.MediaPlayerLayout=Jn;exports.MiniPlayer=Qn;exports.MobXObservableStateProvider=Ke;exports.ObservableStateProvider=fr;exports.PlayQueue=$t;exports.PlayQueuePage=In;exports.PlayQueueStoreContext=Xe;exports.PlayQueueStoreProvider=wn;exports.PlayerStoreProvider=Xn;exports.RepeatMode=$;exports.bottomBarHeight=Qe;exports.usePlayQueueStore=Ze;exports.usePlayerStore=Zn;
15
15
  //# sourceMappingURL=index.cjs.js.map