twist-aplayer 1.4.6 → 1.5.1

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.
@@ -1,37 +1,29 @@
1
- (function(Y,c){typeof exports=="object"&&typeof module<"u"?c(exports,require("react"),require("./styles/main.scss")):typeof define=="function"&&define.amd?define(["exports","react","./styles/main.scss"],c):(Y=typeof globalThis<"u"?globalThis:Y||self,c(Y.TwistAPlayer={},Y.React))})(this,function(Y,c){"use strict";function pr(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,a.get?a:{enumerable:!0,get:()=>e[n]})}}return r.default=e,Object.freeze(r)}const X=pr(c);var ve={exports:{}},ne={};/**
1
+ (function(V,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("react"),require("./styles/main.scss")):typeof define=="function"&&define.amd?define(["exports","react","./styles/main.scss"],s):(V=typeof globalThis<"u"?globalThis:V||self,s(V.TwistAPlayer={},V.React))})(this,function(V,s){"use strict";function $e(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const D=$e(s);var ee={exports:{}},U={};/**
2
2
  * @license React
3
- * react-jsx-runtime.production.min.js
3
+ * react-jsx-runtime.production.js
4
4
  *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var De;function yr(){if(De)return ne;De=1;var e=c,r=Symbol.for("react.element"),n=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,f={key:!0,ref:!0,__self:!0,__source:!0};function d(E,s,y){var l,p={},g=null,T=null;y!==void 0&&(g=""+y),s.key!==void 0&&(g=""+s.key),s.ref!==void 0&&(T=s.ref);for(l in s)a.call(s,l)&&!f.hasOwnProperty(l)&&(p[l]=s[l]);if(E&&E.defaultProps)for(l in s=E.defaultProps,s)p[l]===void 0&&(p[l]=s[l]);return{$$typeof:r,type:E,key:g,ref:T,props:p,_owner:i.current}}return ne.Fragment=n,ne.jsx=d,ne.jsxs=d,ne}var ae={},Ie;function br(){if(Ie)return ae;Ie=1;var e={};/**
9
+ */var he;function ke(){if(he)return U;he=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,a,i){var f=null;if(i!==void 0&&(f=""+i),a.key!==void 0&&(f=""+a.key),"key"in a){i={};for(var p in a)p!=="key"&&(i[p]=a[p])}else i=a;return a=i.ref,{$$typeof:e,type:n,key:f,ref:a!==void 0?a:null,props:i}}return U.Fragment=t,U.jsx=r,U.jsxs=r,U}var W={},ye;function Me(){if(ye)return W;ye=1;var e={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
13
- * Copyright (c) Facebook, Inc. and its affiliates.
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */return e.NODE_ENV!=="production"&&function(){var r=c,n=Symbol.for("react.element"),a=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),f=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),E=Symbol.for("react.provider"),s=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),g=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),b=Symbol.for("react.offscreen"),o=Symbol.iterator,v="@@iterator";function x(t){if(t===null||typeof t!="object")return null;var u=o&&t[o]||t[v];return typeof u=="function"?u:null}var C=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function S(t){{for(var u=arguments.length,h=new Array(u>1?u-1:0),_=1;_<u;_++)h[_-1]=arguments[_];L("error",t,h)}}function L(t,u,h){{var _=C.ReactDebugCurrentFrame,O=_.getStackAddendum();O!==""&&(u+="%s",h=h.concat([O]));var P=h.map(function(j){return String(j)});P.unshift("Warning: "+u),Function.prototype.apply.call(console[t],console,P)}}var F=!1,B=!1,N=!1,K=!1,k=!1,ue;ue=Symbol.for("react.module.reference");function Ce(t){return!!(typeof t=="string"||typeof t=="function"||t===i||t===d||k||t===f||t===l||t===p||K||t===b||F||B||N||typeof t=="object"&&t!==null&&(t.$$typeof===T||t.$$typeof===g||t.$$typeof===E||t.$$typeof===s||t.$$typeof===y||t.$$typeof===ue||t.getModuleId!==void 0))}function Pe(t,u,h){var _=t.displayName;if(_)return _;var O=u.displayName||u.name||"";return O!==""?h+"("+O+")":h}function ye(t){return t.displayName||"Context"}function z(t){if(t==null)return null;if(typeof t.tag=="number"&&S("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case i:return"Fragment";case a:return"Portal";case d:return"Profiler";case f:return"StrictMode";case l:return"Suspense";case p:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case s:var u=t;return ye(u)+".Consumer";case E:var h=t;return ye(h._context)+".Provider";case y:return Pe(t,t.render,"ForwardRef");case g:var _=t.displayName||null;return _!==null?_:z(t.type)||"Memo";case T:{var O=t,P=O._payload,j=O._init;try{return z(j(P))}catch{return null}}}return null}var W=Object.assign,U=0,se,le,I,Z,ce,fe,be;function ee(){}ee.__reactDisabledLog=!0;function pt(){{if(U===0){se=console.log,le=console.info,I=console.warn,Z=console.error,ce=console.group,fe=console.groupCollapsed,be=console.groupEnd;var t={configurable:!0,enumerable:!0,value:ee,writable:!0};Object.defineProperties(console,{info:t,log:t,warn:t,error:t,group:t,groupCollapsed:t,groupEnd:t})}U++}}function yt(){{if(U--,U===0){var t={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:W({},t,{value:se}),info:W({},t,{value:le}),warn:W({},t,{value:I}),error:W({},t,{value:Z}),group:W({},t,{value:ce}),groupCollapsed:W({},t,{value:fe}),groupEnd:W({},t,{value:be})})}U<0&&S("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Le=C.ReactCurrentDispatcher,$e;function ge(t,u,h){{if($e===void 0)try{throw Error()}catch(O){var _=O.stack.trim().match(/\n( *(at )?)/);$e=_&&_[1]||""}return`
18
- `+$e+t}}var Ae=!1,Ee;{var bt=typeof WeakMap=="function"?WeakMap:Map;Ee=new bt}function rr(t,u){if(!t||Ae)return"";{var h=Ee.get(t);if(h!==void 0)return h}var _;Ae=!0;var O=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var P;P=Le.current,Le.current=null,pt();try{if(u){var j=function(){throw Error()};if(Object.defineProperty(j.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(j,[])}catch(D){_=D}Reflect.construct(t,[],j)}else{try{j.call()}catch(D){_=D}t.call(j.prototype)}}else{try{throw Error()}catch(D){_=D}t()}}catch(D){if(D&&_&&typeof D.stack=="string"){for(var w=D.stack.split(`
19
- `),R=_.stack.split(`
20
- `),A=w.length-1,M=R.length-1;A>=1&&M>=0&&w[A]!==R[M];)M--;for(;A>=1&&M>=0;A--,M--)if(w[A]!==R[M]){if(A!==1||M!==1)do if(A--,M--,M<0||w[A]!==R[M]){var V=`
21
- `+w[A].replace(" at new "," at ");return t.displayName&&V.includes("<anonymous>")&&(V=V.replace("<anonymous>",t.displayName)),typeof t=="function"&&Ee.set(t,V),V}while(A>=1&&M>=0);break}}}finally{Ae=!1,Le.current=P,yt(),Error.prepareStackTrace=O}var te=t?t.displayName||t.name:"",J=te?ge(te):"";return typeof t=="function"&&Ee.set(t,J),J}function gt(t,u,h){return rr(t,!1)}function Et(t){var u=t.prototype;return!!(u&&u.isReactComponent)}function xe(t,u,h){if(t==null)return"";if(typeof t=="function")return rr(t,Et(t));if(typeof t=="string")return ge(t);switch(t){case l:return ge("Suspense");case p:return ge("SuspenseList")}if(typeof t=="object")switch(t.$$typeof){case y:return gt(t.render);case g:return xe(t.type,u,h);case T:{var _=t,O=_._payload,P=_._init;try{return xe(P(O),u,h)}catch{}}}return""}var de=Object.prototype.hasOwnProperty,tr={},nr=C.ReactDebugCurrentFrame;function Se(t){if(t){var u=t._owner,h=xe(t.type,t._source,u?u.type:null);nr.setExtraStackFrame(h)}else nr.setExtraStackFrame(null)}function xt(t,u,h,_,O){{var P=Function.call.bind(de);for(var j in t)if(P(t,j)){var w=void 0;try{if(typeof t[j]!="function"){var R=Error((_||"React class")+": "+h+" type `"+j+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof t[j]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw R.name="Invariant Violation",R}w=t[j](u,j,_,h,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(A){w=A}w&&!(w instanceof Error)&&(Se(O),S("%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).",_||"React class",h,j,typeof w),Se(null)),w instanceof Error&&!(w.message in tr)&&(tr[w.message]=!0,Se(O),S("Failed %s type: %s",h,w.message),Se(null))}}}var St=Array.isArray;function Me(t){return St(t)}function _t(t){{var u=typeof Symbol=="function"&&Symbol.toStringTag,h=u&&t[Symbol.toStringTag]||t.constructor.name||"Object";return h}}function Tt(t){try{return ar(t),!1}catch{return!0}}function ar(t){return""+t}function ir(t){if(Tt(t))return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",_t(t)),ar(t)}var or=C.ReactCurrentOwner,wt={key:!0,ref:!0,__self:!0,__source:!0},ur,sr;function jt(t){if(de.call(t,"ref")){var u=Object.getOwnPropertyDescriptor(t,"ref").get;if(u&&u.isReactWarning)return!1}return t.ref!==void 0}function Ot(t){if(de.call(t,"key")){var u=Object.getOwnPropertyDescriptor(t,"key").get;if(u&&u.isReactWarning)return!1}return t.key!==void 0}function Ct(t,u){typeof t.ref=="string"&&or.current}function Pt(t,u){{var h=function(){ur||(ur=!0,S("%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)",u))};h.isReactWarning=!0,Object.defineProperty(t,"key",{get:h,configurable:!0})}}function Lt(t,u){{var h=function(){sr||(sr=!0,S("%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)",u))};h.isReactWarning=!0,Object.defineProperty(t,"ref",{get:h,configurable:!0})}}var $t=function(t,u,h,_,O,P,j){var w={$$typeof:n,type:t,key:u,ref:h,props:j,_owner:P};return w._store={},Object.defineProperty(w._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(w,"_self",{configurable:!1,enumerable:!1,writable:!1,value:_}),Object.defineProperty(w,"_source",{configurable:!1,enumerable:!1,writable:!1,value:O}),Object.freeze&&(Object.freeze(w.props),Object.freeze(w)),w};function At(t,u,h,_,O){{var P,j={},w=null,R=null;h!==void 0&&(ir(h),w=""+h),Ot(u)&&(ir(u.key),w=""+u.key),jt(u)&&(R=u.ref,Ct(u,O));for(P in u)de.call(u,P)&&!wt.hasOwnProperty(P)&&(j[P]=u[P]);if(t&&t.defaultProps){var A=t.defaultProps;for(P in A)j[P]===void 0&&(j[P]=A[P])}if(w||R){var M=typeof t=="function"?t.displayName||t.name||"Unknown":t;w&&Pt(j,M),R&&Lt(j,M)}return $t(t,w,R,O,_,or.current,j)}}var ke=C.ReactCurrentOwner,lr=C.ReactDebugCurrentFrame;function re(t){if(t){var u=t._owner,h=xe(t.type,t._source,u?u.type:null);lr.setExtraStackFrame(h)}else lr.setExtraStackFrame(null)}var qe;qe=!1;function Ne(t){return typeof t=="object"&&t!==null&&t.$$typeof===n}function cr(){{if(ke.current){var t=z(ke.current.type);if(t)return`
22
-
23
- Check the render method of \``+t+"`."}return""}}function Mt(t){return""}var fr={};function kt(t){{var u=cr();if(!u){var h=typeof t=="string"?t:t.displayName||t.name;h&&(u=`
24
-
25
- Check the top-level render call using <`+h+">.")}return u}}function dr(t,u){{if(!t._store||t._store.validated||t.key!=null)return;t._store.validated=!0;var h=kt(u);if(fr[h])return;fr[h]=!0;var _="";t&&t._owner&&t._owner!==ke.current&&(_=" It was passed a child from "+z(t._owner.type)+"."),re(t),S('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',h,_),re(null)}}function vr(t,u){{if(typeof t!="object")return;if(Me(t))for(var h=0;h<t.length;h++){var _=t[h];Ne(_)&&dr(_,u)}else if(Ne(t))t._store&&(t._store.validated=!0);else if(t){var O=x(t);if(typeof O=="function"&&O!==t.entries)for(var P=O.call(t),j;!(j=P.next()).done;)Ne(j.value)&&dr(j.value,u)}}}function qt(t){{var u=t.type;if(u==null||typeof u=="string")return;var h;if(typeof u=="function")h=u.propTypes;else if(typeof u=="object"&&(u.$$typeof===y||u.$$typeof===g))h=u.propTypes;else return;if(h){var _=z(u);xt(h,t.props,"prop",_,t)}else if(u.PropTypes!==void 0&&!qe){qe=!0;var O=z(u);S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",O||"Unknown")}typeof u.getDefaultProps=="function"&&!u.getDefaultProps.isReactClassApproved&&S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Nt(t){{for(var u=Object.keys(t.props),h=0;h<u.length;h++){var _=u[h];if(_!=="children"&&_!=="key"){re(t),S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",_),re(null);break}}t.ref!==null&&(re(t),S("Invalid attribute `ref` supplied to `React.Fragment`."),re(null))}}var mr={};function hr(t,u,h,_,O,P){{var j=Ce(t);if(!j){var w="";(t===void 0||typeof t=="object"&&t!==null&&Object.keys(t).length===0)&&(w+=" 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 R=Mt();R?w+=R:w+=cr();var A;t===null?A="null":Me(t)?A="array":t!==void 0&&t.$$typeof===n?(A="<"+(z(t.type)||"Unknown")+" />",w=" Did you accidentally export a JSX literal instead of a component?"):A=typeof t,S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",A,w)}var M=At(t,u,h,O,P);if(M==null)return M;if(j){var V=u.children;if(V!==void 0)if(_)if(Me(V)){for(var te=0;te<V.length;te++)vr(V[te],t);Object.freeze&&Object.freeze(V)}else S("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 vr(V,t)}if(de.call(u,"key")){var J=z(t),D=Object.keys(u).filter(function(Bt){return Bt!=="key"}),Re=D.length>0?"{key: someKey, "+D.join(": ..., ")+": ...}":"{key: someKey}";if(!mr[J+Re]){var Ft=D.length>0?"{"+D.join(": ..., ")+": ...}":"{}";S(`A props object containing a "key" prop is being spread into JSX:
17
+ */return e.NODE_ENV!=="production"&&function(){function t(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===fe?null:o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case c:return"Fragment";case w:return"Profiler";case y:return"StrictMode";case k:return"Suspense";case P:return"SuspenseList";case ae:return"Activity"}if(typeof o=="object")switch(typeof o.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),o.$$typeof){case u:return"Portal";case T:return(o.displayName||"Context")+".Provider";case S:return(o._context.displayName||"Context")+".Consumer";case $:var E=o.render;return o=o.displayName,o||(o=E.displayName||E.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case z:return E=o.displayName||null,E!==null?E:t(o.type)||"Memo";case O:E=o._payload,o=o._init;try{return t(o(E))}catch{}}return null}function r(o){return""+o}function n(o){try{r(o);var E=!1}catch{E=!0}if(E){E=console;var _=E.error,L=typeof Symbol=="function"&&Symbol.toStringTag&&o[Symbol.toStringTag]||o.constructor.name||"Object";return _.call(E,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",L),r(o)}}function a(o){if(o===c)return"<>";if(typeof o=="object"&&o!==null&&o.$$typeof===O)return"<...>";try{var E=t(o);return E?"<"+E+">":"<...>"}catch{return"<...>"}}function i(){var o=K.A;return o===null?null:o.getOwner()}function f(){return Error("react-stack-top-frame")}function p(o){if(ue.call(o,"key")){var E=Object.getOwnPropertyDescriptor(o,"key").get;if(E&&E.isReactWarning)return!1}return o.key!==void 0}function l(o,E){function _(){H||(H=!0,console.error("%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://react.dev/link/special-props)",E))}_.isReactWarning=!0,Object.defineProperty(o,"key",{get:_,configurable:!0})}function h(){var o=t(this.type);return Q[o]||(Q[o]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),o=this.props.ref,o!==void 0?o:null}function d(o,E,_,L,I,M,me,ve){return _=M.ref,o={$$typeof:b,type:o,key:E,props:M,_owner:I},(_!==void 0?_:null)!==null?Object.defineProperty(o,"ref",{enumerable:!1,get:h}):Object.defineProperty(o,"ref",{enumerable:!1,value:null}),o._store={},Object.defineProperty(o._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(o,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(o,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:me}),Object.defineProperty(o,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ve}),Object.freeze&&(Object.freeze(o.props),Object.freeze(o)),o}function v(o,E,_,L,I,M,me,ve){var N=E.children;if(N!==void 0)if(L)if(de(N)){for(L=0;L<N.length;L++)g(N[L]);Object.freeze&&Object.freeze(N)}else console.error("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 g(N);if(ue.call(E,"key")){N=t(o);var F=Object.keys(E).filter(function($t){return $t!=="key"});L=0<F.length?"{key: someKey, "+F.join(": ..., ")+": ...}":"{key: someKey}",Y[N+L]||(F=0<F.length?"{"+F.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
26
18
  let props = %s;
27
19
  <%s {...props} />
28
20
  React keys must be passed directly to JSX without using spread:
29
21
  let props = %s;
30
- <%s key={someKey} {...props} />`,Re,J,Ft,J),mr[J+Re]=!0}}return t===i?Nt(M):qt(M),M}}function Rt(t,u,h){return hr(t,u,h,!0)}function Dt(t,u,h){return hr(t,u,h,!1)}var It=Dt,Vt=Rt;ae.Fragment=i,ae.jsx=It,ae.jsxs=Vt}(),ae}var Ve;function gr(){if(Ve)return ve.exports;Ve=1;var e={};return e.NODE_ENV==="production"?ve.exports=yr():ve.exports=br(),ve.exports}var m=gr(),me=e=>`--${e}`,Fe=e=>`var(--${e})`,Be=(e,r)=>`--${e}: ${r};`;function Er(e,r){const n=a=>r;return{b:()=>`${n()}-${e}`,be:a=>`${n()}-${e}__${a}`,bm:a=>`${n()}-${e}--${a}`,bem:(a,i)=>`${n()}-${e}__${a}--${i}`,bs:a=>`${n()}-${e}-${a}`,ns:a=>`${n()}-${a}`,cb:()=>`.${n()}-${e}`,cbe:a=>`.${n()}-${e}__${a}`,cbm:a=>`.${n()}-${e}--${a}`,cbem:(a,i)=>`.${n()}-${e}__${a}--${i}`,cbs:a=>`.${n()}-${e}-${a}`,cns:a=>`.${n()}-${a}`,cv:a=>me(`${n()}-${e}-${a}`),cvm:(a,i={})=>{const f=n();for(const d of Object.keys(a))i[me(`${f}-${e}-${d}`)]=a[d];return i},gcv:a=>Fe(`${n()}-${e}-${a}`),scv:(a,i)=>Be(`${n()}-${e}-${a}`,i),nv:a=>me(`${n()}-${a}`),nvm:(a,i={})=>{const f=n();for(const d of Object.keys(a))i[me(`${f}-${d}`)]=a[d];return i},gnv:a=>Fe(`${n()}-${a}`),snv:(a,i)=>Be(`${n()}-${a}`,i)}}function H(e){return c.useMemo(()=>Er(e,"twist"),[e])}var ze={color:void 0,size:void 0,className:void 0,style:void 0,attrs:void 0},_e=X.createContext(ze);_e.Provider;function ie(e){"@babel/helpers - typeof";return ie=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ie(e)}var xr=["attrs","size","title","spin","rotate","color"];function Sr(e,r){return wr(e)||Tr(e,r)||He(e,r)||_r()}function _r(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
31
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Tr(e,r){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var a,i,f,d,E=[],s=!0,y=!1;try{if(f=(n=n.call(e)).next,r!==0)for(;!(s=(a=f.call(n)).done)&&(E.push(a.value),E.length!==r);s=!0);}catch(l){y=!0,i=l}finally{try{if(!s&&n.return!=null&&(d=n.return(),Object(d)!==d))return}finally{if(y)throw i}}return E}}function wr(e){if(Array.isArray(e))return e}function jr(e,r){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=He(e))||r){n&&(e=n);var a=0,i=function(){};return{s:i,n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(y){throw y},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
32
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var f,d=!0,E=!1;return{s:function(){n=n.call(e)},n:function(){var y=n.next();return d=y.done,y},e:function(y){E=!0,f=y},f:function(){try{d||n.return==null||n.return()}finally{if(E)throw f}}}}function He(e,r){if(e){if(typeof e=="string")return We(e,r);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?We(e,r):void 0}}function We(e,r){(r==null||r>e.length)&&(r=e.length);for(var n=0,a=Array(r);n<r;n++)a[n]=e[n];return a}function he(){return he=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var a in n)({}).hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},he.apply(null,arguments)}function Ue(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);r&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,a)}return n}function oe(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?Ue(Object(n),!0).forEach(function(a){Or(e,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ue(Object(n)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))})}return e}function Or(e,r,n){return(r=Cr(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function Cr(e){var r=Pr(e,"string");return ie(r)=="symbol"?r:r+""}function Pr(e,r){if(ie(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var a=n.call(e,r);if(ie(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function Lr(e,r){if(e==null)return{};var n,a,i=$r(e,r);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(e);for(a=0;a<f.length;a++)n=f[a],r.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function $r(e,r){if(e==null)return{};var n={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(r.includes(a))continue;n[a]=e[a]}return n}function Ar(e){var r=e.attrs,n=e.size,a=e.title,i=e.spin,f=e.rotate,d=e.color,E=Lr(e,xr),s=function(l){var p=n||l.size||"1em",g,T="",b="";return l.className&&(g=l.className),e.className&&(g=g?"".concat(g," ").concat(e.className):e.className),i&&(g?g+=" twist-icon-loading":g="twist-icon-loading"),f&&(T="rotate(".concat(f,"deg)"),b="rotate(".concat(f,"deg)")),X.createElement("svg",he({xmlns:"http://www.w3.org/2000/svg"},l.attrs,r,E,{className:g,style:oe(oe({color:d||l.color,msTransform:T,transform:b},l.style),e.style),width:p,height:p}),a&&X.createElement("title",null,a),e.children)};return _e!==void 0?X.createElement(_e.Consumer,null,function(y){return s(y)}):s(ze)}function Mr(e){var r={},n=e.split(";"),a=jr(n),i;try{for(a.s();!(i=a.n()).done;){var f=i.value,d=f.split(":"),E=Sr(d,2),s=E[0],y=E[1];if(s&&y){var l=s.trim().replace(/-./g,function(p){return p.charAt(1).toUpperCase()});r[l]=y.trim()}}}catch(p){a.e(p)}finally{a.f()}return r}function Ye(e){return e&&e.map(function(r,n){return X.createElement(r.tag,oe(oe({},r.attrs),{},{key:n,style:r.attrs.style?Mr(r.attrs.style):null}),Ye(r.children))})}function q(e){return function(r){return X.createElement(Ar,he({attrs:oe({},e.attrs)},r),Ye(e.children))}}function kr(e){return q({attrs:{viewBox:"0 0 1024 1024"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M485.6 249.9L198.2 498c-8.3 7.1-8.3 20.8 0 27.9l287.4 248.2c10.7 9.2 26.4.9 26.4-14V263.8c0-14.8-15.7-23.2-26.4-13.9m320 0L518.2 498a18.6 18.6 0 0 0-6.2 14c0 5.2 2.1 10.4 6.2 14l287.4 248.2c10.7 9.2 26.4.9 26.4-14V263.8c0-14.8-15.7-23.2-26.4-13.9"}}]})(e)}function qr(e){return q({attrs:{viewBox:"0 0 1024 1024"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M825.8 498L538.4 249.9c-10.7-9.2-26.4-.9-26.4 14v496.3c0 14.9 15.7 23.2 26.4 14L825.8 526c8.3-7.2 8.3-20.8 0-28m-320 0L218.4 249.9c-10.7-9.2-26.4-.9-26.4 14v496.3c0 14.9 15.7 23.2 26.4 14L505.8 526c4.1-3.6 6.2-8.8 6.2-14s-2.1-10.4-6.2-14"}}]})(e)}function Nr(e){return q({attrs:{viewBox:"0 0 1024 1024"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M512 1024c-69.1 0-136.2-13.5-199.3-40.2C251.7 958 197 921 150 874S66 772.3 40.2 711.3C13.5 648.2 0 581.1 0 512c0-19.9 16.1-36 36-36s36 16.1 36 36c0 59.4 11.6 117 34.6 171.3c22.2 52.4 53.9 99.5 94.3 139.9s87.5 72.2 139.9 94.3C395 940.4 452.6 952 512 952s117-11.6 171.3-34.6c52.4-22.2 99.5-53.9 139.9-94.3s72.2-87.5 94.3-139.9C940.4 629 952 571.4 952 512s-11.6-117-34.6-171.3a440.5 440.5 0 0 0-94.3-139.9a437.7 437.7 0 0 0-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.2C772.3 66 827 103 874 150s83.9 101.8 109.7 162.7c26.7 63.1 40.2 130.2 40.2 199.3s-13.5 136.2-40.2 199.3C958 772.3 921 827 874 874s-101.8 83.9-162.7 109.7c-63.1 26.8-130.2 40.3-199.3 40.3"}}]})(e)}function Rr(e){return q({attrs:{viewBox:"0 0 512 512"},children:[{tag:"path",attrs:{d:"M294.1 256L167 129c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.3 34 0L345 239c9.1 9.1 9.3 23.7.7 33.1L201.1 417c-4.7 4.7-10.9 7-17 7s-12.3-2.3-17-7c-9.4-9.4-9.4-24.6 0-33.9l127-127.1z",fill:"currentColor"}}]})(e)}function Dr(e){return q({attrs:{viewBox:"0 0 512 512"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M208 432h-48a16 16 0 0 1-16-16V96a16 16 0 0 1 16-16h48a16 16 0 0 1 16 16v320a16 16 0 0 1-16 16m144 0h-48a16 16 0 0 1-16-16V96a16 16 0 0 1 16-16h48a16 16 0 0 1 16 16v320a16 16 0 0 1-16 16"}}]})(e)}function Ir(e){return q({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"}}]})(e)}function Vr(e){return q({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M2 5.27L3.28 4L20 20.72L18.73 22l-3-3H7v3l-4-4l4-4v3h6.73L7 10.27V11H5V8.27zM17 13h2v4.18l-2-2zm0-8V2l4 4l-4 4V7H8.82l-2-2z"}}]})(e)}function Fr(e){return q({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"m17 3l5.25 4.5L17 12l5.25 4.5L17 21v-3h-2.74l-2.82-2.82l2.12-2.12L15.5 15H17V9h-1.5l-9 9H2v-3h3.26l9-9H17zM2 6h4.5l2.82 2.82l-2.12 2.12L5.26 9H2z"}}]})(e)}function Br(e){return q({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M16.15 13H5q-.425 0-.712-.288T4 12t.288-.712T5 11h11.15L13.3 8.15q-.3-.3-.288-.7t.288-.7q.3-.3.713-.312t.712.287L19.3 11.3q.15.15.213.325t.062.375t-.062.375t-.213.325l-4.575 4.575q-.3.3-.712.288t-.713-.313q-.275-.3-.288-.7t.288-.7z"}}]})(e)}function zr(e){return q({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M10.5 17q1.05 0 1.775-.725T13 14.5V9h3V7h-4v5.5q-.325-.225-.7-.363T10.5 12q-1.05 0-1.775.725T8 14.5t.725 1.775T10.5 17M4 20q-.825 0-1.412-.587T2 18V6q0-.825.588-1.412T4 4h16q.825 0 1.413.588T22 6v12q0 .825-.587 1.413T20 20z"}}]})(e)}function Hr(e){return q({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M14 19V5h4v14zm-8 0V5h4v14z"}}]})(e)}function Wr(e){return q({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8 17.175V6.825q0-.425.3-.713t.7-.287q.125 0 .263.037t.262.113l8.15 5.175q.225.15.338.375t.112.475t-.112.475t-.338.375l-8.15 5.175q-.125.075-.262.113T9 18.175q-.4 0-.7-.288t-.3-.712"}}]})(e)}function Ur(e){return q({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M11.5 10.5h-.75q-.325 0-.537-.213T10 9.75t.213-.537T10.75 9H12q.425 0 .713.288T13 10v4.25q0 .325-.213.538T12.25 15t-.537-.213t-.213-.537zM6.85 19l.85.85q.3.3.288.7t-.288.7q-.3.3-.712.313t-.713-.288L3.7 18.7q-.15-.15-.213-.325T3.426 18t.063-.375t.212-.325l2.575-2.575q.3-.3.713-.287t.712.312q.275.3.288.7t-.288.7l-.85.85H17v-3q0-.425.288-.712T18 13t.713.288T19 14v3q0 .825-.587 1.413T17 19zm10.3-12H7v3q0 .425-.288.713T6 11t-.712-.288T5 10V7q0-.825.588-1.412T7 5h10.15l-.85-.85q-.3-.3-.288-.7t.288-.7q.3-.3.712-.312t.713.287L20.3 5.3q.15.15.213.325t.062.375t-.062.375t-.213.325l-2.575 2.575q-.3.3-.712.288T16.3 9.25q-.275-.3-.288-.7t.288-.7z"}}]})(e)}function Yr(e){return q({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"m6.85 19l.85.85q.3.3.288.7t-.288.7q-.3.3-.712.313t-.713-.288L3.7 18.7q-.15-.15-.213-.325T3.426 18t.063-.375t.212-.325l2.575-2.575q.3-.3.713-.287t.712.312q.275.3.288.7t-.288.7l-.85.85H17v-3q0-.425.288-.712T18 13t.713.288T19 14v3q0 .825-.587 1.413T17 19zm10.3-12H7v3q0 .425-.288.713T6 11t-.712-.288T5 10V7q0-.825.588-1.412T7 5h10.15l-.85-.85q-.3-.3-.288-.7t.288-.7q.3-.3.712-.312t.713.287L20.3 5.3q.15.15.213.325t.062.375t-.062.375t-.213.325l-2.575 2.575q-.3.3-.712.288T16.3 9.25q-.275-.3-.288-.7t.288-.7z"}}]})(e)}function Gr(e){return q({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M9 15H6q-.425 0-.712-.288T5 14v-4q0-.425.288-.712T6 9h3l3.3-3.3q.475-.475 1.088-.213t.612.938v11.15q0 .675-.612.938T12.3 18.3zm9.5-3q0 1.05-.475 1.988t-1.25 1.537q-.25.15-.512.013T16 15.1V8.85q0-.3.263-.437t.512.012q.775.625 1.25 1.575t.475 2"}}]})(e)}function Kr(e){return q({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M7 15V9h4l5-5v16l-5-5z"}}]})(e)}function Jr(e){return q({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M19 11.975q0-2.075-1.1-3.787t-2.95-2.563q-.375-.175-.55-.537t-.05-.738q.15-.4.538-.575t.787 0Q18.1 4.85 19.55 7.063T21 11.974t-1.45 4.913t-3.875 3.287q-.4.175-.788 0t-.537-.575q-.125-.375.05-.737t.55-.538q1.85-.85 2.95-2.562t1.1-3.788M7 15H4q-.425 0-.712-.288T3 14v-4q0-.425.288-.712T4 9h3l3.3-3.3q.475-.475 1.088-.213t.612.938v11.15q0 .675-.612.938T10.3 18.3zm9.5-3q0 1.05-.475 1.988t-1.25 1.537q-.25.15-.513.013T14 15.1V8.85q0-.3.263-.437t.512.012q.775.625 1.25 1.575t.475 2"}}]})(e)}function Xr(e){return q({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M18.25 12L8.5 17.629V6.37z"}}]})(e)}function Te(e,r){if(!r.current)return 0;let n=(e.clientX-r.current.getBoundingClientRect().left)/r.current.clientWidth;return n=Math.max(n,0),n=Math.min(n,1),n=Math.floor(n*100)/100,n}function we(e,r){if(!r.current)return 0;let n=1-(e.clientY-r.current.getBoundingClientRect().top)/r.current.clientHeight;return n=Math.max(n,0),n=Math.min(n,1),n=Math.floor(n*100)/100,n}function Ge(e){var r,n,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(r=0;r<i;r++)e[r]&&(n=Ge(e[r]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function $(){for(var e,r,n=0,a="",i=arguments.length;n<i;n++)(e=arguments[n])&&(r=Ge(e))&&(a&&(a+=" "),a+=r);return a}function Qr({bufferedPercentage:e,playedPercentage:r,onSeek:n}){const a=H("aplayer-bar"),i=H("aplayer-icon"),f=c.useRef(null),[d,E]=c.useState(r),s=c.useRef(!1);c.useEffect(()=>{s.current||E(r)},[r]);const y=c.useCallback(l=>{s.current=!0;const p=Te(l,f);E(p);const g=b=>{const o=Te(b,f);E(o)},T=b=>{document.removeEventListener("mousemove",g),document.removeEventListener("mouseup",T);const o=Te(b,f);E(o),n==null||n(o),s.current=!1};document.addEventListener("mousemove",g),document.addEventListener("mouseup",T)},[n]);return m.jsx("div",{ref:f,className:$(a.b(),a.bs("vars")),onMouseDown:y,role:"slider","aria-label":"Audio progress","aria-valuenow":d?d*100:0,"aria-valuemin":0,"aria-valuemax":100,"aria-live":"polite",children:m.jsxs("div",{className:a.be("inner"),children:[typeof e<"u"?m.jsx("div",{className:a.be("loaded"),style:{width:`${e*100}%`}}):null,typeof d<"u"?m.jsx("div",{className:a.be("played"),style:{width:`${d*100}%`},children:m.jsx("span",{className:a.be("thumb"),children:m.jsx("span",{className:$(i.bs("loading")),children:m.jsx(Nr,{})})})}):null]})})}function Zr({volume:e,muted:r,onToggleMuted:n,onChangeVolume:a}){const i=H("aplayer-volumn"),f=H("aplayer-icon"),d=c.useRef(null),[E,s]=c.useState(!1),y=c.useCallback(l=>{a(we(l,d)),s(!0);const p=T=>{a(we(T,d))},g=T=>{document.removeEventListener("mouseup",g),document.removeEventListener("mousemove",p),s(!1),a(we(T,d))};document.addEventListener("mousemove",p),document.addEventListener("mouseup",g)},[a]);return m.jsxs("div",{className:$(i.b(),i.bs("vars")),children:[m.jsx("button",{type:"button",className:$(f.b(),f.bs("volume-down")),onClick:()=>n(),"aria-label":r||!e?"Muted":"unMuted",children:r||!e?m.jsx(Kr,{}):e>=1?m.jsx(Jr,{}):m.jsx(Gr,{})}),m.jsx("div",{className:$(i.be("bar-wrap"),{[i.bem("bar-wrap","active")]:E}),ref:d,onMouseDown:y,children:m.jsx("div",{className:i.be("bar"),children:m.jsx("div",{className:i.be("thumb"),style:{height:r?0:`${e*100}%`}})})})]})}function Ke(e){if(typeof e>"u")return"--:--";if(Number.isNaN(e))return"00:00";const r=d=>d<10?`0${d}`:`${d}`,n=Math.trunc(e/60),a=Math.trunc(e-n*60),i=Math.trunc(n/60),f=Math.trunc(e/60-60*Math.trunc(e/60/60));return e>=3600?`${r(i)}:${r(f)}:${r(a)}`:`${r(n)}:${r(a)}`}function et({volume:e,onChangeVolume:r,muted:n,currentTime:a,audioDurationSeconds:i,bufferedSeconds:f,onToggleMenu:d,onToggleMuted:E,order:s,onOrderChange:y,loop:l,onLoopChange:p,onSeek:g,isPlaying:T,onTogglePlay:b,onSkipForward:o,onSkipBack:v,showLyrics:x=!0,onToggleLyrics:C}){const S=H("aplayer-controller"),L=H("aplayer-icon"),F=c.useCallback(()=>{const N={list:"random",random:"list"}[s];y(N)},[s,y]),B=c.useCallback(()=>{const N={all:"one",one:"none",none:"all"}[l];p(N)},[l,p]);return m.jsxs("div",{className:$(S.b(),S.bs("vars")),role:"group","aria-label":"Audio Controls",children:[m.jsx(Qr,{playedPercentage:typeof a>"u"||typeof i>"u"?void 0:a/i,bufferedPercentage:typeof f>"u"||typeof i>"u"?void 0:f/i,onSeek:N=>g==null?void 0:g(N*i)}),m.jsxs("div",{className:S.be("time"),children:[m.jsxs("span",{className:S.be("time-inner"),"aria-live":"polite",children:[m.jsx("span",{className:S.be("ptime"),children:Ke(a)})," / ",m.jsx("span",{className:S.be("dtime"),children:Ke(i)})]}),m.jsx("button",{className:$(L.b(),L.bs("back")),onClick:v,type:"button","aria-label":"Previous track",children:m.jsx(kr,{})}),m.jsx("button",{className:$(L.b(),L.bs("play")),onClick:b,type:"button","aria-label":T?"Pause audio":"Play audio",children:T?m.jsx(Hr,{}):m.jsx(Wr,{})}),m.jsx("button",{className:$(L.b(),L.bs("forward")),onClick:o,type:"button","aria-label":"Next track",children:m.jsx(qr,{})}),m.jsx(Zr,{volume:e,muted:n,onToggleMuted:E,onChangeVolume:r}),m.jsx("button",{className:$(L.b(),L.bs("order")),onClick:F,type:"button","aria-label":`Playback order: ${s}`,children:{list:m.jsx(Br,{}),random:m.jsx(Fr,{})}[s]}),m.jsx("button",{className:$(L.b(),L.bs("order")),onClick:B,type:"button","aria-label":`Loop mode: ${l}`,children:{all:m.jsx(Yr,{}),one:m.jsx(Ur,{}),none:m.jsx(Vr,{})}[l]}),m.jsx("button",{type:"button",className:$(L.b(),L.bs("menu")),onClick:()=>d==null?void 0:d(),"aria-label":"Toggle playlist menu",children:m.jsx(Ir,{})}),m.jsx("button",{type:"button",className:$(L.b(),L.bs("lrc"),{[L.ns("lrc-inactivity")]:!x}),onClick:C,"aria-label":x?"Hide lyrics":"Show lyrics","aria-pressed":x,children:m.jsx(zr,{})})]})]})}function rt({open:e,audio:r,playingAudioUrl:n,onPlayAudio:a,listMaxHeight:i,mini:f}){const d=H("aplayer-list"),E=i?{maxHeight:i}:void 0,s=c.useCallback(l=>l?typeof l=="string"?l:l.name??"Audio artist":"Audio artist",[]),y=c.useRef(null);return c.useEffect(()=>{if(y.current){const l=y.current;return l.style.maxHeight=`${Math.min(l.scrollHeight,i??1/0)}px`,()=>{l.removeAttribute("style")}}},[i,f]),m.jsx("div",{ref:y,className:$(d.b(),{[d.bm("hide")]:!e,[d.bs("vars")]:!0}),"aria-label":"Audio playlist","aria-live":"polite",children:m.jsx("ol",{style:E,children:r.map((l,p)=>m.jsxs("li",{className:$({[d.bm("active")]:l.url===n}),onClick:()=>{l.url!==n&&(a==null||a(l))},role:"button","aria-label":`${l.name??"Audio name"} by ${s(l.artist)}}`,children:[m.jsx("span",{className:d.be("cur")}),m.jsx("span",{className:d.be("index"),children:p+1}),m.jsx("span",{className:d.be("title"),children:l.name??"Audio name"}),m.jsx("span",{className:d.be("author"),children:s(l.artist)})]},l.name||p))})})}function Je({show:e,lrcText:r,currentTime:n}){const a=H("aplayer-lrc"),i=c.useMemo(()=>tt(r),[r]),f=c.useMemo(()=>{for(let E=0;E<i.length;E++){const s=i[E],y=i[E+1];if(n>=s[0]&&(!y||n<y[0]))return E}return 0},[n,i]),d=c.useMemo(()=>({transform:`translateY(${-f*16}px)`,WebkitTransform:`translateY(${-f*16}px)`}),[f]);return m.jsx("div",{className:$(a.b(),{[a.bm("hide")]:!e}),children:r?m.jsx("div",{className:a.be("contents"),style:d,children:i.map(([,E],s)=>m.jsx("p",{className:$({[a.be("current")]:s===f}),children:E},s))}):null})}function tt(e){if(e){e=e.replace(/([^\]^\n])\[/g,(i,f)=>`${f}
33
- [`);const r=e.split(`
34
- `),n=[],a=r.length;for(let i=0;i<a;i++){const f=r[i].match(/\[(\d{2}):(\d{2})(\.(\d{2,3}))?\]/g),d=r[i].replace(/.*\[(\d{2}):(\d{2})(\.(\d{2,3}))?\]/g,"").replace(/<(\d{2}):(\d{2})(\.(\d{2,3}))?>/g,"").replace(/^\s+|\s+$/g,"");if(f){const E=f.length;for(let s=0;s<E;s++){const y=/\[(\d{2}):(\d{2})(\.(\d{2,3}))?\]/.exec(f[s]),l=y[1]*60,p=Number.parseInt(y[2]),g=y[4]?Number.parseInt(y[4])/(`${y[4]}`.length===2?100:1e3):0,T=l+p+g;n.push([T,d])}}}return n.sort((i,f)=>i[0]-f[0]),n}else return[]}var pe={exports:{}},je={};/**
22
+ <%s key={someKey} {...props} />`,L,N,F,N),Y[N+L]=!0)}if(N=null,_!==void 0&&(n(_),N=""+_),p(E)&&(n(E.key),N=""+E.key),"key"in E){_={};for(var be in E)be!=="key"&&(_[be]=E[be])}else _=E;return N&&l(_,typeof o=="function"?o.displayName||o.name||"Unknown":o),d(o,N,M,I,i(),_,me,ve)}function g(o){typeof o=="object"&&o!==null&&o.$$typeof===b&&o._store&&(o._store.validated=1)}var x=s,b=Symbol.for("react.transitional.element"),u=Symbol.for("react.portal"),c=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),S=Symbol.for("react.consumer"),T=Symbol.for("react.context"),$=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),ae=Symbol.for("react.activity"),fe=Symbol.for("react.client.reference"),K=x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue=Object.prototype.hasOwnProperty,de=Array.isArray,X=console.createTask?console.createTask:function(){return null};x={"react-stack-bottom-frame":function(o){return o()}};var H,Q={},Z=x["react-stack-bottom-frame"].bind(x,f)(),C=X(a(f)),Y={};W.Fragment=c,W.jsx=function(o,E,_,L,I){var M=1e4>K.recentlyCreatedOwnerStacks++;return v(o,E,_,!1,L,I,M?Error("react-stack-top-frame"):Z,M?X(a(o)):C)},W.jsxs=function(o,E,_,L,I){var M=1e4>K.recentlyCreatedOwnerStacks++;return v(o,E,_,!0,L,I,M?Error("react-stack-top-frame"):Z,M?X(a(o)):C)}}(),W}var pe;function qe(){if(pe)return ee.exports;pe=1;var e={};return e.NODE_ENV==="production"?ee.exports=ke():ee.exports=Me(),ee.exports}var m=qe(),te=e=>`--${e}`,ge=e=>`var(--${e})`,Ee=(e,t)=>`--${e}: ${t};`;function Ie(e,t){const r=n=>t;return{b:()=>`${r()}-${e}`,be:n=>`${r()}-${e}__${n}`,bm:n=>`${r()}-${e}--${n}`,bem:(n,a)=>`${r()}-${e}__${n}--${a}`,bs:n=>`${r()}-${e}-${n}`,ns:n=>`${r()}-${n}`,cb:()=>`.${r()}-${e}`,cbe:n=>`.${r()}-${e}__${n}`,cbm:n=>`.${r()}-${e}--${n}`,cbem:(n,a)=>`.${r()}-${e}__${n}--${a}`,cbs:n=>`.${r()}-${e}-${n}`,cns:n=>`.${r()}-${n}`,cv:n=>te(`${r()}-${e}-${n}`),cvm:(n,a={})=>{const i=r();for(const f of Object.keys(n))a[te(`${i}-${e}-${f}`)]=n[f];return a},gcv:n=>ge(`${r()}-${e}-${n}`),scv:(n,a)=>Ee(`${r()}-${e}-${n}`,a),nv:n=>te(`${r()}-${n}`),nvm:(n,a={})=>{const i=r();for(const f of Object.keys(n))a[te(`${i}-${f}`)]=n[f];return a},gnv:n=>ge(`${r()}-${n}`),snv:(n,a)=>Ee(`${r()}-${n}`,a)}}function q(e){return s.useMemo(()=>Ie(e,"twist"),[e])}var xe={color:void 0,size:void 0,className:void 0,style:void 0,attrs:void 0},oe=D.createContext(xe);oe.Provider;function G(e){"@babel/helpers - typeof";return G=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},G(e)}var Ve=["attrs","size","title","spin","rotate","color"];function Re(e,t){return Be(e)||De(e,t)||Se(e,t)||ze()}function ze(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
23
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function De(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,f,p=[],l=!0,h=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(l=(n=i.call(r)).done)&&(p.push(n.value),p.length!==t);l=!0);}catch(d){h=!0,a=d}finally{try{if(!l&&r.return!=null&&(f=r.return(),Object(f)!==f))return}finally{if(h)throw a}}return p}}function Be(e){if(Array.isArray(e))return e}function He(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Se(e))||t){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(h){throw h},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
24
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,f=!0,p=!1;return{s:function(){r=r.call(e)},n:function(){var h=r.next();return f=h.done,h},e:function(h){p=!0,i=h},f:function(){try{f||r.return==null||r.return()}finally{if(p)throw i}}}}function Se(e,t){if(e){if(typeof e=="string")return Te(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Te(e,t):void 0}}function Te(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function re(){return re=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},re.apply(null,arguments)}function _e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function J(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_e(Object(r),!0).forEach(function(n){Ye(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_e(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ye(e,t,r){return(t=Fe(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Fe(e){var t=Ue(e,"string");return G(t)=="symbol"?t:t+""}function Ue(e,t){if(G(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(G(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function We(e,t){if(e==null)return{};var r,n,a=Ge(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function Ge(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}function Je(e){var t=e.attrs,r=e.size,n=e.title,a=e.spin,i=e.rotate,f=e.color,p=We(e,Ve),l=function(d){var v=r||d.size||"1em",g,x="",b="";return d.className&&(g=d.className),e.className&&(g=g?"".concat(g," ").concat(e.className):e.className),a&&(g?g+=" twist-icon-loading":g="twist-icon-loading"),i&&(x="rotate(".concat(i,"deg)"),b="rotate(".concat(i,"deg)")),D.createElement("svg",re({xmlns:"http://www.w3.org/2000/svg"},d.attrs,t,p,{className:g,style:J(J({color:f||d.color,msTransform:x,transform:b},d.style),e.style),width:v,height:v}),n&&D.createElement("title",null,n),e.children)};return oe!==void 0?D.createElement(oe.Consumer,null,function(h){return l(h)}):l(xe)}function Ke(e){var t={},r=e.split(";"),n=He(r),a;try{for(n.s();!(a=n.n()).done;){var i=a.value,f=i.split(":"),p=Re(f,2),l=p[0],h=p[1];if(l&&h){var d=l.trim().replace(/-./g,function(v){return v.charAt(1).toUpperCase()});t[d]=h.trim()}}}catch(v){n.e(v)}finally{n.f()}return t}function je(e){return e&&e.map(function(t,r){return D.createElement(t.tag,J(J({},t.attrs),{},{key:r,style:t.attrs.style?Ke(t.attrs.style):null}),je(t.children))})}function A(e){return function(t){return D.createElement(Je,re({attrs:J({},e.attrs)},t),je(e.children))}}function Xe(e){return A({attrs:{viewBox:"0 0 1024 1024"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M485.6 249.9L198.2 498c-8.3 7.1-8.3 20.8 0 27.9l287.4 248.2c10.7 9.2 26.4.9 26.4-14V263.8c0-14.8-15.7-23.2-26.4-13.9m320 0L518.2 498a18.6 18.6 0 0 0-6.2 14c0 5.2 2.1 10.4 6.2 14l287.4 248.2c10.7 9.2 26.4.9 26.4-14V263.8c0-14.8-15.7-23.2-26.4-13.9"}}]})(e)}function Qe(e){return A({attrs:{viewBox:"0 0 1024 1024"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M825.8 498L538.4 249.9c-10.7-9.2-26.4-.9-26.4 14v496.3c0 14.9 15.7 23.2 26.4 14L825.8 526c8.3-7.2 8.3-20.8 0-28m-320 0L218.4 249.9c-10.7-9.2-26.4-.9-26.4 14v496.3c0 14.9 15.7 23.2 26.4 14L505.8 526c4.1-3.6 6.2-8.8 6.2-14s-2.1-10.4-6.2-14"}}]})(e)}function Ze(e){return A({attrs:{viewBox:"0 0 1024 1024"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M512 1024c-69.1 0-136.2-13.5-199.3-40.2C251.7 958 197 921 150 874S66 772.3 40.2 711.3C13.5 648.2 0 581.1 0 512c0-19.9 16.1-36 36-36s36 16.1 36 36c0 59.4 11.6 117 34.6 171.3c22.2 52.4 53.9 99.5 94.3 139.9s87.5 72.2 139.9 94.3C395 940.4 452.6 952 512 952s117-11.6 171.3-34.6c52.4-22.2 99.5-53.9 139.9-94.3s72.2-87.5 94.3-139.9C940.4 629 952 571.4 952 512s-11.6-117-34.6-171.3a440.5 440.5 0 0 0-94.3-139.9a437.7 437.7 0 0 0-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.2C772.3 66 827 103 874 150s83.9 101.8 109.7 162.7c26.7 63.1 40.2 130.2 40.2 199.3s-13.5 136.2-40.2 199.3C958 772.3 921 827 874 874s-101.8 83.9-162.7 109.7c-63.1 26.8-130.2 40.3-199.3 40.3"}}]})(e)}function et(e){return A({attrs:{viewBox:"0 0 512 512"},children:[{tag:"path",attrs:{d:"M294.1 256L167 129c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.3 34 0L345 239c9.1 9.1 9.3 23.7.7 33.1L201.1 417c-4.7 4.7-10.9 7-17 7s-12.3-2.3-17-7c-9.4-9.4-9.4-24.6 0-33.9l127-127.1z",fill:"currentColor"}}]})(e)}function tt(e){return A({attrs:{viewBox:"0 0 512 512"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M208 432h-48a16 16 0 0 1-16-16V96a16 16 0 0 1 16-16h48a16 16 0 0 1 16 16v320a16 16 0 0 1-16 16m144 0h-48a16 16 0 0 1-16-16V96a16 16 0 0 1 16-16h48a16 16 0 0 1 16 16v320a16 16 0 0 1-16 16"}}]})(e)}function rt(e){return A({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"}}]})(e)}function nt(e){return A({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M2 5.27L3.28 4L20 20.72L18.73 22l-3-3H7v3l-4-4l4-4v3h6.73L7 10.27V11H5V8.27zM17 13h2v4.18l-2-2zm0-8V2l4 4l-4 4V7H8.82l-2-2z"}}]})(e)}function at(e){return A({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"m17 3l5.25 4.5L17 12l5.25 4.5L17 21v-3h-2.74l-2.82-2.82l2.12-2.12L15.5 15H17V9h-1.5l-9 9H2v-3h3.26l9-9H17zM2 6h4.5l2.82 2.82l-2.12 2.12L5.26 9H2z"}}]})(e)}function ut(e){return A({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M16.15 13H5q-.425 0-.712-.288T4 12t.288-.712T5 11h11.15L13.3 8.15q-.3-.3-.288-.7t.288-.7q.3-.3.713-.312t.712.287L19.3 11.3q.15.15.213.325t.062.375t-.062.375t-.213.325l-4.575 4.575q-.3.3-.712.288t-.713-.313q-.275-.3-.288-.7t.288-.7z"}}]})(e)}function ot(e){return A({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M10.5 17q1.05 0 1.775-.725T13 14.5V9h3V7h-4v5.5q-.325-.225-.7-.363T10.5 12q-1.05 0-1.775.725T8 14.5t.725 1.775T10.5 17M4 20q-.825 0-1.412-.587T2 18V6q0-.825.588-1.412T4 4h16q.825 0 1.413.588T22 6v12q0 .825-.587 1.413T20 20z"}}]})(e)}function st(e){return A({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M14 19V5h4v14zm-8 0V5h4v14z"}}]})(e)}function it(e){return A({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8 17.175V6.825q0-.425.3-.713t.7-.287q.125 0 .263.037t.262.113l8.15 5.175q.225.15.338.375t.112.475t-.112.475t-.338.375l-8.15 5.175q-.125.075-.262.113T9 18.175q-.4 0-.7-.288t-.3-.712"}}]})(e)}function lt(e){return A({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M11.5 10.5h-.75q-.325 0-.537-.213T10 9.75t.213-.537T10.75 9H12q.425 0 .713.288T13 10v4.25q0 .325-.213.538T12.25 15t-.537-.213t-.213-.537zM6.85 19l.85.85q.3.3.288.7t-.288.7q-.3.3-.712.313t-.713-.288L3.7 18.7q-.15-.15-.213-.325T3.426 18t.063-.375t.212-.325l2.575-2.575q.3-.3.713-.287t.712.312q.275.3.288.7t-.288.7l-.85.85H17v-3q0-.425.288-.712T18 13t.713.288T19 14v3q0 .825-.587 1.413T17 19zm10.3-12H7v3q0 .425-.288.713T6 11t-.712-.288T5 10V7q0-.825.588-1.412T7 5h10.15l-.85-.85q-.3-.3-.288-.7t.288-.7q.3-.3.712-.312t.713.287L20.3 5.3q.15.15.213.325t.062.375t-.062.375t-.213.325l-2.575 2.575q-.3.3-.712.288T16.3 9.25q-.275-.3-.288-.7t.288-.7z"}}]})(e)}function ct(e){return A({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"m6.85 19l.85.85q.3.3.288.7t-.288.7q-.3.3-.712.313t-.713-.288L3.7 18.7q-.15-.15-.213-.325T3.426 18t.063-.375t.212-.325l2.575-2.575q.3-.3.713-.287t.712.312q.275.3.288.7t-.288.7l-.85.85H17v-3q0-.425.288-.712T18 13t.713.288T19 14v3q0 .825-.587 1.413T17 19zm10.3-12H7v3q0 .425-.288.713T6 11t-.712-.288T5 10V7q0-.825.588-1.412T7 5h10.15l-.85-.85q-.3-.3-.288-.7t.288-.7q.3-.3.712-.312t.713.287L20.3 5.3q.15.15.213.325t.062.375t-.062.375t-.213.325l-2.575 2.575q-.3.3-.712.288T16.3 9.25q-.275-.3-.288-.7t.288-.7z"}}]})(e)}function ft(e){return A({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M9 15H6q-.425 0-.712-.288T5 14v-4q0-.425.288-.712T6 9h3l3.3-3.3q.475-.475 1.088-.213t.612.938v11.15q0 .675-.612.938T12.3 18.3zm9.5-3q0 1.05-.475 1.988t-1.25 1.537q-.25.15-.512.013T16 15.1V8.85q0-.3.263-.437t.512.012q.775.625 1.25 1.575t.475 2"}}]})(e)}function dt(e){return A({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M7 15V9h4l5-5v16l-5-5z"}}]})(e)}function mt(e){return A({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M19 11.975q0-2.075-1.1-3.787t-2.95-2.563q-.375-.175-.55-.537t-.05-.738q.15-.4.538-.575t.787 0Q18.1 4.85 19.55 7.063T21 11.974t-1.45 4.913t-3.875 3.287q-.4.175-.788 0t-.537-.575q-.125-.375.05-.737t.55-.538q1.85-.85 2.95-2.562t1.1-3.788M7 15H4q-.425 0-.712-.288T3 14v-4q0-.425.288-.712T4 9h3l3.3-3.3q.475-.475 1.088-.213t.612.938v11.15q0 .675-.612.938T10.3 18.3zm9.5-3q0 1.05-.475 1.988t-1.25 1.537q-.25.15-.513.013T14 15.1V8.85q0-.3.263-.437t.512.012q.775.625 1.25 1.575t.475 2"}}]})(e)}function vt(e){return A({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M18.25 12L8.5 17.629V6.37z"}}]})(e)}function se(e,t){if(!t.current)return 0;let r=(e.clientX-t.current.getBoundingClientRect().left)/t.current.clientWidth;return r=Math.max(r,0),r=Math.min(r,1),r=Math.floor(r*100)/100,r}function ie(e,t){if(!t.current)return 0;let r=1-(e.clientY-t.current.getBoundingClientRect().top)/t.current.clientHeight;return r=Math.max(r,0),r=Math.min(r,1),r=Math.floor(r*100)/100,r}function we(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=we(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function j(){for(var e,t,r=0,n="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=we(e))&&(n&&(n+=" "),n+=t);return n}function bt({bufferedPercentage:e,playedPercentage:t,onSeek:r}){const n=q("aplayer-bar"),a=q("aplayer-icon"),i=s.useRef(null),[f,p]=s.useState(t),l=s.useRef(!1);s.useEffect(()=>{l.current||p(t)},[t]);const h=s.useCallback(d=>{l.current=!0;const v=se(d,i);p(v);const g=b=>{const u=se(b,i);p(u)},x=b=>{document.removeEventListener("mousemove",g),document.removeEventListener("mouseup",x);const u=se(b,i);p(u),r==null||r(u),l.current=!1};document.addEventListener("mousemove",g),document.addEventListener("mouseup",x)},[r]);return m.jsx("div",{ref:i,className:j(n.b(),n.bs("vars")),onMouseDown:h,role:"slider","aria-label":"Audio progress","aria-valuenow":f?f*100:0,"aria-valuemin":0,"aria-valuemax":100,"aria-live":"polite",children:m.jsxs("div",{className:n.be("inner"),children:[typeof e<"u"?m.jsx("div",{className:n.be("loaded"),style:{width:`${e*100}%`}}):null,typeof f<"u"?m.jsx("div",{className:n.be("played"),style:{width:`${f*100}%`},children:m.jsx("span",{className:n.be("thumb"),children:m.jsx("span",{className:j(a.bs("loading")),children:m.jsx(Ze,{})})})}):null]})})}function ht({volume:e,muted:t,onToggleMuted:r,onChangeVolume:n}){const a=q("aplayer-volumn"),i=q("aplayer-icon"),f=s.useRef(null),[p,l]=s.useState(!1),h=s.useCallback(d=>{n(ie(d,f)),l(!0);const v=x=>{n(ie(x,f))},g=x=>{document.removeEventListener("mouseup",g),document.removeEventListener("mousemove",v),l(!1),n(ie(x,f))};document.addEventListener("mousemove",v),document.addEventListener("mouseup",g)},[n]);return m.jsxs("div",{className:j(a.b(),a.bs("vars")),children:[m.jsx("button",{type:"button",className:j(i.b(),i.bs("volume-down")),onClick:()=>r(),"aria-label":t||!e?"Muted":"unMuted",children:t||!e?m.jsx(dt,{}):e>=1?m.jsx(mt,{}):m.jsx(ft,{})}),m.jsx("div",{className:j(a.be("bar-wrap"),{[a.bem("bar-wrap","active")]:p}),ref:f,onMouseDown:h,children:m.jsx("div",{className:a.be("bar"),children:m.jsx("div",{className:a.be("thumb"),style:{height:t?0:`${e*100}%`}})})})]})}function Oe(e){if(typeof e>"u")return"--:--";if(Number.isNaN(e))return"00:00";const t=f=>f<10?`0${f}`:`${f}`,r=Math.trunc(e/60),n=Math.trunc(e-r*60),a=Math.trunc(r/60),i=Math.trunc(e/60-60*Math.trunc(e/60/60));return e>=3600?`${t(a)}:${t(i)}:${t(n)}`:`${t(r)}:${t(n)}`}function yt({volume:e,onChangeVolume:t,muted:r,currentTime:n,audioDurationSeconds:a,bufferedSeconds:i,onToggleMenu:f,onToggleMuted:p,order:l,onOrderChange:h,loop:d,onLoopChange:v,onSeek:g,isPlaying:x,onTogglePlay:b,onSkipForward:u,onSkipBack:c,showLyrics:y=!0,onToggleLyrics:w}){const S=q("aplayer-controller"),T=q("aplayer-icon"),$=s.useCallback(()=>{const P={list:"random",random:"list"}[l];h(P)},[l,h]),k=s.useCallback(()=>{const P={all:"one",one:"none",none:"all"}[d];v(P)},[d,v]);return m.jsxs("div",{className:j(S.b(),S.bs("vars")),role:"group","aria-label":"Audio Controls",children:[m.jsx(bt,{playedPercentage:typeof n>"u"||typeof a>"u"?void 0:n/a,bufferedPercentage:typeof i>"u"||typeof a>"u"?void 0:i/a,onSeek:P=>g==null?void 0:g(P*a)}),m.jsxs("div",{className:S.be("time"),children:[m.jsxs("span",{className:S.be("time-inner"),"aria-live":"polite",children:[m.jsx("span",{className:S.be("ptime"),children:Oe(n)})," / ",m.jsx("span",{className:S.be("dtime"),children:Oe(a)})]}),m.jsx("button",{className:j(T.b(),T.bs("back")),onClick:c,type:"button","aria-label":"Previous track",children:m.jsx(Xe,{})}),m.jsx("button",{className:j(T.b(),T.bs("play")),onClick:b,type:"button","aria-label":x?"Pause audio":"Play audio",children:x?m.jsx(st,{}):m.jsx(it,{})}),m.jsx("button",{className:j(T.b(),T.bs("forward")),onClick:u,type:"button","aria-label":"Next track",children:m.jsx(Qe,{})}),m.jsx(ht,{volume:e,muted:r,onToggleMuted:p,onChangeVolume:t}),m.jsx("button",{className:j(T.b(),T.bs("order")),onClick:$,type:"button","aria-label":`Playback order: ${l}`,children:{list:m.jsx(ut,{}),random:m.jsx(at,{})}[l]}),m.jsx("button",{className:j(T.b(),T.bs("order")),onClick:k,type:"button","aria-label":`Loop mode: ${d}`,children:{all:m.jsx(ct,{}),one:m.jsx(lt,{}),none:m.jsx(nt,{})}[d]}),m.jsx("button",{type:"button",className:j(T.b(),T.bs("menu")),onClick:()=>f==null?void 0:f(),"aria-label":"Toggle playlist menu",children:m.jsx(rt,{})}),m.jsx("button",{type:"button",className:j(T.b(),T.bs("lrc"),{[T.ns("lrc-inactivity")]:!y}),onClick:w,"aria-label":y?"Hide lyrics":"Show lyrics","aria-pressed":y,children:m.jsx(ot,{})})]})]})}function pt({open:e,audio:t,playingAudioUrl:r,onPlayAudio:n,listMaxHeight:a,mini:i}){const f=q("aplayer-list"),p=a?{maxHeight:a}:void 0,l=s.useCallback(d=>d?typeof d=="string"?d:d.name??"Audio artist":"Audio artist",[]),h=s.useRef(null);return s.useEffect(()=>{if(h.current){const d=h.current;return d.style.maxHeight=`${Math.min(d.scrollHeight,a??1/0)}px`,()=>{d.removeAttribute("style")}}},[a,i]),m.jsx("div",{ref:h,className:j(f.b(),{[f.bm("hide")]:!e,[f.bs("vars")]:!0}),"aria-label":"Audio playlist","aria-live":"polite",children:m.jsx("ol",{style:p,children:t.map((d,v)=>m.jsxs("li",{className:j({[f.bm("active")]:d.url===r}),onClick:()=>{d.url!==r&&(n==null||n(d))},role:"button","aria-label":`${d.name??"Audio name"} by ${l(d.artist)}}`,children:[m.jsx("span",{className:f.be("cur")}),m.jsx("span",{className:f.be("index"),children:v+1}),m.jsx("span",{className:f.be("title"),children:d.name??"Audio name"}),m.jsx("span",{className:f.be("author"),children:l(d.artist)})]},d.name||v))})})}function Le({show:e,lrcText:t,currentTime:r}){const n=q("aplayer-lrc"),a=s.useMemo(()=>gt(t),[t]),i=s.useMemo(()=>{for(let p=0;p<a.length;p++){const l=a[p],h=a[p+1];if(r>=l[0]&&(!h||r<h[0]))return p}return 0},[r,a]),f=s.useMemo(()=>({transform:`translateY(${-i*16}px)`,WebkitTransform:`translateY(${-i*16}px)`}),[i]);return m.jsx("div",{className:j(n.b(),{[n.bm("hide")]:!e}),children:t?m.jsx("div",{className:n.be("contents"),style:f,children:a.map(([,p],l)=>m.jsx("p",{className:j({[n.be("current")]:l===i}),children:p},l))}):null})}function gt(e){if(e){e=e.replace(/([^\]^\n])\[/g,(a,i)=>`${i}
25
+ [`);const t=e.split(`
26
+ `),r=[],n=t.length;for(let a=0;a<n;a++){const i=t[a].match(/\[(\d{2}):(\d{2})(\.(\d{2,3}))?\]/g),f=t[a].replace(/.*\[(\d{2}):(\d{2})(\.(\d{2,3}))?\]/g,"").replace(/<(\d{2}):(\d{2})(\.(\d{2,3}))?>/g,"").replace(/^\s+|\s+$/g,"");if(i){const p=i.length;for(let l=0;l<p;l++){const h=/\[(\d{2}):(\d{2})(\.(\d{2,3}))?\]/.exec(i[l]),d=h[1]*60,v=Number.parseInt(h[2]),g=h[4]?Number.parseInt(h[4])/(`${h[4]}`.length===2?100:1e3):0,x=d+v+g;r.push([x,f])}}}return r.sort((a,i)=>a[0]-i[0]),r}else return[]}var ne={exports:{}},le={};/**
35
27
  * @license React
36
28
  * use-sync-external-store-shim.production.js
37
29
  *
@@ -39,7 +31,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
39
31
  *
40
32
  * This source code is licensed under the MIT license found in the
41
33
  * LICENSE file in the root directory of this source tree.
42
- */var Xe;function nt(){if(Xe)return je;Xe=1;var e=c;function r(p,g){return p===g&&(p!==0||1/p===1/g)||p!==p&&g!==g}var n=typeof Object.is=="function"?Object.is:r,a=e.useState,i=e.useEffect,f=e.useLayoutEffect,d=e.useDebugValue;function E(p,g){var T=g(),b=a({inst:{value:T,getSnapshot:g}}),o=b[0].inst,v=b[1];return f(function(){o.value=T,o.getSnapshot=g,s(o)&&v({inst:o})},[p,T,g]),i(function(){return s(o)&&v({inst:o}),p(function(){s(o)&&v({inst:o})})},[p]),d(T),T}function s(p){var g=p.getSnapshot;p=p.value;try{var T=g();return!n(p,T)}catch{return!0}}function y(p,g){return g()}var l=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?y:E;return je.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:l,je}var Oe={},Qe;function at(){if(Qe)return Oe;Qe=1;var e={};/**
34
+ */var Ae;function Et(){if(Ae)return le;Ae=1;var e=s;function t(v,g){return v===g&&(v!==0||1/v===1/g)||v!==v&&g!==g}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,a=e.useEffect,i=e.useLayoutEffect,f=e.useDebugValue;function p(v,g){var x=g(),b=n({inst:{value:x,getSnapshot:g}}),u=b[0].inst,c=b[1];return i(function(){u.value=x,u.getSnapshot=g,l(u)&&c({inst:u})},[v,x,g]),a(function(){return l(u)&&c({inst:u}),v(function(){l(u)&&c({inst:u})})},[v]),f(x),x}function l(v){var g=v.getSnapshot;v=v.value;try{var x=g();return!r(v,x)}catch{return!0}}function h(v,g){return g()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:p;return le.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,le}var ce={},Pe;function xt(){if(Pe)return ce;Pe=1;var e={};/**
43
35
  * @license React
44
36
  * use-sync-external-store-shim.development.js
45
37
  *
@@ -47,4 +39,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
47
39
  *
48
40
  * This source code is licensed under the MIT license found in the
49
41
  * LICENSE file in the root directory of this source tree.
50
- */return e.NODE_ENV!=="production"&&function(){function r(b,o){return b===o&&(b!==0||1/b===1/o)||b!==b&&o!==o}function n(b,o){p||f.startTransition===void 0||(p=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var v=o();if(!g){var x=o();d(v,x)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),g=!0)}x=E({inst:{value:v,getSnapshot:o}});var C=x[0].inst,S=x[1];return y(function(){C.value=v,C.getSnapshot=o,a(C)&&S({inst:C})},[b,v,o]),s(function(){return a(C)&&S({inst:C}),b(function(){a(C)&&S({inst:C})})},[b]),l(v),v}function a(b){var o=b.getSnapshot;b=b.value;try{var v=o();return!d(b,v)}catch{return!0}}function i(b,o){return o()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var f=c,d=typeof Object.is=="function"?Object.is:r,E=f.useState,s=f.useEffect,y=f.useLayoutEffect,l=f.useDebugValue,p=!1,g=!1,T=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?i:n;Oe.useSyncExternalStore=f.useSyncExternalStore!==void 0?f.useSyncExternalStore:T,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}(),Oe}var Ze;function it(){if(Ze)return pe.exports;Ze=1;var e={};return e.NODE_ENV==="production"?pe.exports=nt():pe.exports=at(),pe.exports}var G=it();const Q=[];function ot(e){const r=c.useRef();return c.useEffect(()=>{if(typeof window<"u"&&!r.current){const n=r.current=document.createElement("audio");typeof(e==null?void 0:e.src)<"u"&&(n.src=e.src),typeof(e==null?void 0:e.autoPlay)<"u"&&(n.autoplay=e.autoPlay),typeof(e==null?void 0:e.initialVolume)<"u"&&(n.volume=e.initialVolume),Q.includes(n)||Q.push(n)}},[e==null?void 0:e.autoPlay,e==null?void 0:e.initialVolume,e==null?void 0:e.src]),c.useEffect(()=>{if(typeof window>"u")return;const n=r.current;if(n&&(e!=null&&e.onError))return n.addEventListener("error",e.onError),()=>{n.removeEventListener("error",e.onError)}},[e==null?void 0:e.onError]),c.useEffect(()=>{if(typeof window>"u")return;const n=r.current;if(n&&(e!=null&&e.onEnded))return n.addEventListener("ended",e.onEnded),()=>{n.removeEventListener("ended",e.onEnded)}},[e==null?void 0:e.onEnded]),c.useEffect(()=>()=>{const n=r.current;if(n){n.pause(),n.currentTime=0;const a=Q.indexOf(n);a!==-1&&Q.splice(a,1)}r.current=void 0},[]),r}function ut(e){const r=ot(e),n=c.useCallback(o=>{for(let v=0;v<Q.length;v++){const x=Q[v];x!==o&&!x.paused&&x.pause()}},[]),a=c.useCallback(async o=>{var x;const v=r.current;if(v){e.mutex&&n(v),v.src!==o&&(v.pause(),v.currentTime=0,v.src=o);try{await((x=r.current)==null?void 0:x.play())}catch{}}},[r,e.mutex,n]),i=c.useCallback(o=>{const v=r.current;v&&(v.paused?a(o):v.pause())},[r,a]),f=c.useCallback(o=>{r.current.currentTime=o},[r]),d=c.useCallback(()=>{r.current&&(r.current.muted=!r.current.muted)},[r]),E=c.useCallback(o=>{r.current&&(r.current.volume=o)},[r]),s=G.useSyncExternalStore(c.useCallback(o=>{var v;return(v=r.current)==null||v.addEventListener("volumechange",o),()=>{var x;(x=r.current)==null||x.removeEventListener("volumechange",o)}},[r]),()=>{var o;return(o=r.current)==null?void 0:o.volume},()=>{}),y=G.useSyncExternalStore(c.useCallback(o=>{var v;return(v=r.current)==null||v.addEventListener("volumechange",o),()=>{var x;(x=r.current)==null||x.removeEventListener("volumechange",o)}},[r]),()=>{var o;return(o=r.current)==null?void 0:o.muted},()=>{}),l=G.useSyncExternalStore(c.useCallback(o=>{var v;return(v=r.current)==null||v.addEventListener("timeupdate",o),()=>{var x;(x=r.current)==null||x.removeEventListener("timeupdate",o)}},[r]),()=>{if(r.current)return Math.round(r.current.currentTime)},()=>{}),p=G.useSyncExternalStore(c.useCallback(o=>{var v;return(v=r.current)==null||v.addEventListener("durationchange",o),()=>{var x;(x=r.current)==null||x.removeEventListener("durationchange",o)}},[r]),()=>{var o;return(o=r.current)==null?void 0:o.duration},()=>{}),g=G.useSyncExternalStore(c.useCallback(o=>{var v;return(v=r.current)==null||v.addEventListener("progress",o),()=>{var x;(x=r.current)==null||x.removeEventListener("progress",o)}},[r]),()=>{const o=r.current;return o&&o.buffered.length>0?o.buffered.end(o.buffered.length-1):0},()=>{}),T=G.useSyncExternalStore(c.useCallback(o=>{var v,x;return(v=r.current)==null||v.addEventListener("play",o),(x=r.current)==null||x.addEventListener("pause",o),()=>{var C,S;(C=r.current)==null||C.removeEventListener("play",o),(S=r.current)==null||S.removeEventListener("pause",o)}},[r]),()=>{const o=r.current;return o?!o.paused:!1},()=>{}),b=G.useSyncExternalStore(c.useCallback(o=>{var v,x;return(v=r.current)==null||v.addEventListener("playing",o),(x=r.current)==null||x.addEventListener("waiting",o),()=>{var C,S;(C=r.current)==null||C.removeEventListener("playing",o),(S=r.current)==null||S.removeEventListener("waiting",o)}},[r]),()=>{const o=r.current;return o?o.networkState===o.NETWORK_LOADING:!1},()=>{});return{audio:r.current,playAudio:a,togglePlay:i,seek:f,toggleMuted:d,setVolume:E,volume:s,muted:y,currentTime:l,duration:p,bufferedSeconds:g,isPlaying:T,isLoading:b}}function st(e,r){return c.useMemo(()=>{const n={...r};for(const a in e)e[a]!==void 0&&(n[a]=e[a]);return n},[e,r])}function lt(e){const[r,n]=c.useState(e);return c.useEffect(()=>{n(e)},[e]),{mini:r,setMini:n}}function er(){const e=c.useRef([]);return c.useEffect(()=>{const n=e.current;return()=>{for(const a of n)clearTimeout(a)}},[]),c.useCallback((n,a)=>{const i=setTimeout(n,a);return e.current.push(i),i},[])}function ct(){const e=c.useRef(null),[r,n]=c.useState({text:"",style:{opacity:0}}),a=er(),i=c.useCallback((f,d=2e3)=>{e.current&&clearTimeout(e.current),n({text:f,style:{opacity:1}}),e.current=a(()=>{n({text:f,style:{opacity:0}})},d)},[a]);return[r,i]}function ft(e){const r=st(e,{appearance:"normal",volume:.7,autoPlay:!1,listMaxHeight:250,mini:!1,mutex:!0,listFolded:!1,theme:"light",border:!1}),{audio:n,appearance:a,initialLoop:i,initialOrder:f,volume:d,autoPlay:E,listMaxHeight:s,listFolded:y,mutex:l,theme:p,border:g}=r,T=c.useMemo(()=>Array.isArray(n)?n:[n],[n]),b=mt(T,{initialLoop:i,initialOrder:f}),[o,v]=ct(),{mini:x,setMini:C}=lt(r.mini),S=er(),L=c.useRef(null),F=c.useCallback(()=>{L.current&&(clearTimeout(L.current),L.current=null)},[]),B=c.useRef(!1),N=ut({src:b.currentSong.url,initialVolume:d,autoPlay:E,mutex:l,onError(I){const{error:Z}=I.target;Z&&v("An audio error has occurred, player will skip forward in 2 seconds."),b.hasNextSong&&(L.current=S(()=>{b.next()},2e3))},onEnded(){const{list:I,currentSong:Z,loop:ce,prioritize:fe,hasNextSong:be}=b,{audio:ee}=N;if(ce==="one"){fe({...Z});return}if(!be&&ce==="none"){B.current=!0,ee.currentTime=0,ee.pause(),ee.src=I[0].url,fe(I[0]);return}b.next()}}),K=b.length>1,k=c.useCallback(()=>{F(),N.togglePlay(b.currentSong.url)},[N,F,b.currentSong.url]),{prioritize:ue}=b,Ce=c.useCallback(I=>{F(),ue(I)},[F,ue]),[Pe,ye]=c.useState(()=>K&&!y),[z,W]=c.useState(a!=="fixed"),U=c.useRef(null);c.useEffect(()=>{E&&N.playAudio(b.currentSong.url)},[]);const se=c.useRef(!0),le=c.useRef(b.currentSong);return c.useEffect(()=>{if(se.current){se.current=!1;return}if(B.current){B.current=!1;return}b.currentSong&&(b.loop==="one"||b.currentSong!==le.current)&&(le.current=b.currentSong,N.playAudio(b.currentSong.url))},[b.currentSong]),c.useEffect(()=>{if(a==="fixed"&&U.current){const I=U.current;return I.style.width="400px",()=>{I.removeAttribute("style")}}},[a]),{bodyRef:U,appearance:a,volume:d,listMaxHeight:s,theme:p,border:g,notice:o,audioControl:N,audio:T,handlePlayButtonClick:k,handlePlayAudioFromList:Ce,isPlaylistOpen:Pe,setPlaylistOpen:ye,mini:x,displayLyrics:z,setDisplayLyrics:W,setMini:C,playlist:b,hasPlaylist:K}}function dt(e){return vt(e.slice())}function vt(e){let r=e.length,n;for(;r!==0;)n=Math.floor(Math.random()*r),r--,[e[r],e[n]]=[e[n],e[r]];return e}function mt(e,r){const{initialLoop:n="all",initialOrder:a="list"}=r,[i,f]=c.useState(n),[d,E]=c.useState(a),s=c.useMemo(()=>d==="list"?e:dt(e),[e,d]),[y,l]=c.useState(s[0]),p=c.useCallback(v=>v.url,[]),g=c.useMemo(()=>s.findIndex(x=>p(x)===p(y))<s.length-1||i!=="none",[s,y,i,p]),T=c.useCallback(()=>{l(v=>{const x=s.findIndex(C=>p(C)===p(v));return x<s.length-1?s[x+1]:{...s[0]}})},[i,s,p]),b=c.useCallback(()=>{l(v=>{const x=s.indexOf(v);return x>0?s[x-1]:v})},[s]),o=c.useCallback(v=>{l(v)},[]);return c.useEffect(()=>{const v=s.find(x=>p(x)===p(y));l(v||s[0])},[s,p,y]),{list:s,currentSong:y,hasNextSong:g,next:T,previous:b,prioritize:o,order:d,setOrder:E,loop:i,setLoop:f,length:s.length}}function ht(e){var B,N,K;const r=H("aplayer"),{bodyRef:n,appearance:a,volume:i,listMaxHeight:f,theme:d,border:E,notice:s,audio:y,audioControl:l,handlePlayButtonClick:p,handlePlayAudioFromList:g,isPlaylistOpen:T,setPlaylistOpen:b,mini:o,displayLyrics:v,setDisplayLyrics:x,setMini:C,playlist:S,hasPlaylist:L}=ft(e),F=c.useCallback(k=>k?typeof k=="string"?k:k.url?m.jsx("a",{href:k.url,target:"_blank",rel:"noreferrer",children:k.name??"Audio artist"}):k.name??"Audio artist":"Audio artist",[]);return m.jsxs("div",{className:$(r.b(),{[r.bs(d)]:!0,[r.bs("vars")]:!0,[r.bm(a)]:!0,[r.bm("loading")]:l.isLoading,[r.bm("withlist")]:L,[r.bm("list-folded")]:!T,[r.bm("withlrc")]:!!S.currentSong.lrc&&a!=="fixed",[r.bm("narrow")]:o,[r.bm("border")]:E}),role:"region","aria-label":"Audio Player",children:[m.jsxs("div",{ref:n,className:r.be("body"),children:[m.jsx("div",{className:r.be("pic"),onClick:p,style:{backgroundImage:`url("${(B=S.currentSong)==null?void 0:B.cover}")`},role:"button","aria-label":l.isPlaying?"Pause audio":"Play audio",children:m.jsx("div",{className:$(r.be("button"),l.isPlaying?r.bm("pause"):r.bm("play")),role:"presentation",children:l.isPlaying?m.jsx(Dr,{}):m.jsx(Xr,{})})}),m.jsxs("div",{className:$(r.be("info")),children:[m.jsxs("div",{className:$(r.be("music")),children:[m.jsx("span",{className:$(r.be("title")),children:((N=S.currentSong)==null?void 0:N.name)??"Audio name"}),m.jsxs("span",{className:$(r.be("author")),children:[" ","-"," ",F((K=S.currentSong)==null?void 0:K.artist)]})]}),a==="fixed"?null:m.jsx(Je,{show:v,lrcText:S.currentSong.lrc,currentTime:l.currentTime??0}),m.jsx(et,{volume:l.volume??i,onChangeVolume:l.setVolume,muted:l.muted??!1,onToggleMuted:()=>l.toggleMuted(),currentTime:l.currentTime,audioDurationSeconds:l.duration,bufferedSeconds:l.bufferedSeconds,onSeek:k=>l.seek(k),onToggleMenu:()=>b(k=>!k),order:S.order,onOrderChange:S.setOrder,loop:S.loop,onLoopChange:S.setLoop,isPlaying:l.isPlaying??!1,onTogglePlay:p,onSkipForward:()=>{S.hasNextSong&&S.next()},onSkipBack:()=>{S.previous()},showLyrics:v,onToggleLyrics:()=>{x(k=>!k)}})]}),m.jsx("div",{className:r.be("notice"),style:s.style,children:s.text}),m.jsx("div",{className:r.be("miniswitcher"),onClick:()=>C(k=>!k),children:m.jsx("button",{className:$(r.bs("icon"),r.bs("icon-right")),type:"button",children:m.jsx(Rr,{})})})]}),L?m.jsx(rt,{open:T,audio:y,playingAudioUrl:S.currentSong.url,onPlayAudio:g,listMaxHeight:f,mini:o}):null,a==="fixed"&&m.jsx(Je,{show:v,lrcText:S.currentSong.lrc,currentTime:l.currentTime??0})]})}Y.TwistAPlayer=ht,Object.defineProperty(Y,Symbol.toStringTag,{value:"Module"})});
42
+ */return e.NODE_ENV!=="production"&&function(){function t(b,u){return b===u&&(b!==0||1/b===1/u)||b!==b&&u!==u}function r(b,u){v||i.startTransition===void 0||(v=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var c=u();if(!g){var y=u();f(c,y)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),g=!0)}y=p({inst:{value:c,getSnapshot:u}});var w=y[0].inst,S=y[1];return h(function(){w.value=c,w.getSnapshot=u,n(w)&&S({inst:w})},[b,c,u]),l(function(){return n(w)&&S({inst:w}),b(function(){n(w)&&S({inst:w})})},[b]),d(c),c}function n(b){var u=b.getSnapshot;b=b.value;try{var c=u();return!f(b,c)}catch{return!0}}function a(b,u){return u()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var i=s,f=typeof Object.is=="function"?Object.is:t,p=i.useState,l=i.useEffect,h=i.useLayoutEffect,d=i.useDebugValue,v=!1,g=!1,x=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?a:r;ce.useSyncExternalStore=i.useSyncExternalStore!==void 0?i.useSyncExternalStore:x,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}(),ce}var Ne;function St(){if(Ne)return ne.exports;Ne=1;var e={};return e.NODE_ENV==="production"?ne.exports=Et():ne.exports=xt(),ne.exports}var R=St();const B=[];function Tt(e){const t=s.useRef(null);return s.useEffect(()=>{if(typeof window<"u"&&!t.current){const r=t.current=document.createElement("audio");typeof(e==null?void 0:e.src)<"u"&&(r.src=e.src),typeof(e==null?void 0:e.autoPlay)<"u"&&(r.autoplay=e.autoPlay),typeof(e==null?void 0:e.initialVolume)<"u"&&(r.volume=e.initialVolume),B.includes(r)||B.push(r)}},[e==null?void 0:e.autoPlay,e==null?void 0:e.initialVolume,e==null?void 0:e.src]),s.useEffect(()=>{if(typeof window>"u")return;const r=t.current;if(r&&(e!=null&&e.onError))return r.addEventListener("error",e.onError),()=>{r.removeEventListener("error",e.onError)}},[e==null?void 0:e.onError]),s.useEffect(()=>{if(typeof window>"u")return;const r=t.current;if(r&&(e!=null&&e.onEnded))return r.addEventListener("ended",e.onEnded),()=>{r.removeEventListener("ended",e.onEnded)}},[e==null?void 0:e.onEnded]),s.useEffect(()=>()=>{const r=t.current;if(r){r.pause(),r.currentTime=0;const n=B.indexOf(r);n!==-1&&B.splice(n,1)}t.current=null},[]),t}function _t(e){const t=Tt(e),r=s.useCallback(u=>{for(let c=0;c<B.length;c++){const y=B[c];y!==u&&!y.paused&&y.pause()}},[]),n=s.useCallback(async u=>{var y;const c=t.current;if(c){e.mutex&&r(c),c.src!==u&&(c.pause(),c.currentTime=0,c.src=u);try{await((y=t.current)==null?void 0:y.play())}catch{}}},[t,e.mutex,r]),a=s.useCallback(u=>{const c=t.current;c&&(c.paused?n(u):c.pause())},[t,n]),i=s.useCallback(u=>{t.current.currentTime=u},[t]),f=s.useCallback(()=>{t.current&&(t.current.muted=!t.current.muted)},[t]),p=s.useCallback(u=>{t.current&&(t.current.volume=u)},[t]),l=R.useSyncExternalStore(s.useCallback(u=>{var c;return(c=t.current)==null||c.addEventListener("volumechange",u),()=>{var y;(y=t.current)==null||y.removeEventListener("volumechange",u)}},[t]),()=>{var u;return(u=t.current)==null?void 0:u.volume},()=>{}),h=R.useSyncExternalStore(s.useCallback(u=>{var c;return(c=t.current)==null||c.addEventListener("volumechange",u),()=>{var y;(y=t.current)==null||y.removeEventListener("volumechange",u)}},[t]),()=>{var u;return(u=t.current)==null?void 0:u.muted},()=>{}),d=R.useSyncExternalStore(s.useCallback(u=>{var c;return(c=t.current)==null||c.addEventListener("timeupdate",u),()=>{var y;(y=t.current)==null||y.removeEventListener("timeupdate",u)}},[t]),()=>{if(t.current)return Math.round(t.current.currentTime)},()=>{}),v=R.useSyncExternalStore(s.useCallback(u=>{var c;return(c=t.current)==null||c.addEventListener("durationchange",u),()=>{var y;(y=t.current)==null||y.removeEventListener("durationchange",u)}},[t]),()=>{var u;return(u=t.current)==null?void 0:u.duration},()=>{}),g=R.useSyncExternalStore(s.useCallback(u=>{var c;return(c=t.current)==null||c.addEventListener("progress",u),()=>{var y;(y=t.current)==null||y.removeEventListener("progress",u)}},[t]),()=>{const u=t.current;return u&&u.buffered.length>0?u.buffered.end(u.buffered.length-1):0},()=>{}),x=R.useSyncExternalStore(s.useCallback(u=>{var c,y;return(c=t.current)==null||c.addEventListener("play",u),(y=t.current)==null||y.addEventListener("pause",u),()=>{var w,S;(w=t.current)==null||w.removeEventListener("play",u),(S=t.current)==null||S.removeEventListener("pause",u)}},[t]),()=>{const u=t.current;return u?!u.paused:!1},()=>{}),b=R.useSyncExternalStore(s.useCallback(u=>{var c,y;return(c=t.current)==null||c.addEventListener("playing",u),(y=t.current)==null||y.addEventListener("waiting",u),()=>{var w,S;(w=t.current)==null||w.removeEventListener("playing",u),(S=t.current)==null||S.removeEventListener("waiting",u)}},[t]),()=>{const u=t.current;return u?u.networkState===u.NETWORK_LOADING:!1},()=>{});return{audio:t.current,playAudio:n,togglePlay:a,seek:i,toggleMuted:f,setVolume:p,volume:l,muted:h,currentTime:d,duration:v,bufferedSeconds:g,isPlaying:x,isLoading:b}}function jt(e,t){return s.useMemo(()=>{const r={...t};for(const n in e)e[n]!==void 0&&(r[n]=e[n]);return r},[e,t])}function wt(e){const[t,r]=s.useState(e);return s.useEffect(()=>{r(e)},[e]),{mini:t,setMini:r}}function Ce(){const e=s.useRef([]);return s.useEffect(()=>{const r=e.current;return()=>{for(const n of r)clearTimeout(n)}},[]),s.useCallback((r,n)=>{const a=setTimeout(r,n);return e.current.push(a),a},[])}function Ot(){const e=s.useRef(null),[t,r]=s.useState({text:"",style:{opacity:0}}),n=Ce(),a=s.useCallback((i,f=2e3)=>{e.current&&clearTimeout(e.current),r({text:i,style:{opacity:1}}),e.current=n(()=>{r({text:i,style:{opacity:0}})},f)},[n]);return[t,a]}function Lt(e){const t=jt(e,{appearance:"normal",volume:.7,autoPlay:!1,listMaxHeight:250,mini:!1,mutex:!0,listFolded:!1,theme:"light",border:!1}),{audio:r,appearance:n,initialLoop:a,initialOrder:i,volume:f,autoPlay:p,listMaxHeight:l,listFolded:h,mutex:d,theme:v,border:g}=t,x=s.useMemo(()=>Array.isArray(r)?r:[r],[r]),b=Nt(x,{initialLoop:a,initialOrder:i}),[u,c]=Ot(),{mini:y,setMini:w}=wt(t.mini),S=Ce(),T=s.useRef(null),$=s.useCallback(()=>{T.current&&(clearTimeout(T.current),T.current=null)},[]),k=s.useRef(!1),P=_t({src:b.currentSong.url,initialVolume:f,autoPlay:p,mutex:d,onError(C){const{error:Y}=C.target;Y&&c("An audio error has occurred, player will skip forward in 2 seconds."),b.hasNextSong&&(T.current=S(()=>{b.next()},2e3))},onEnded(){const{list:C,currentSong:Y,loop:o,prioritize:E,hasNextSong:_}=b,{audio:L}=P;if(o==="one"){E({...Y});return}if(!_&&o==="none"){k.current=!0,L.currentTime=0,L.pause(),L.src=C[0].url,E(C[0]);return}b.next()}}),z=b.length>1,O=s.useCallback(()=>{$(),P.togglePlay(b.currentSong.url)},[P,$,b.currentSong.url]),{prioritize:ae}=b,fe=s.useCallback(C=>{$(),ae(C)},[$,ae]),[K,ue]=s.useState(()=>z&&!h),[de,X]=s.useState(!0),H=s.useRef(null);s.useEffect(()=>{p&&P.playAudio(b.currentSong.url)},[]);const Q=s.useRef(!0),Z=s.useRef(b.currentSong);return s.useEffect(()=>{if(Q.current){Q.current=!1;return}if(k.current){k.current=!1;return}b.currentSong&&(b.loop==="one"||b.currentSong!==Z.current)&&(Z.current=b.currentSong,P.playAudio(b.currentSong.url))},[b.currentSong]),s.useEffect(()=>{if(n==="fixed"&&H.current){const C=H.current;return C.style.width="400px",()=>{C.removeAttribute("style")}}},[n]),{bodyRef:H,appearance:n,volume:f,listMaxHeight:l,theme:v,border:g,notice:u,audioControl:P,audio:x,handlePlayButtonClick:O,handlePlayAudioFromList:fe,isPlaylistOpen:K,setPlaylistOpen:ue,mini:y,displayLyrics:de,setDisplayLyrics:X,setMini:w,playlist:b,hasPlaylist:z}}function At(e){return Pt(e.slice())}function Pt(e){let t=e.length,r;for(;t!==0;)r=Math.floor(Math.random()*t),t--,[e[t],e[r]]=[e[r],e[t]];return e}function Nt(e,t){const{initialLoop:r="all",initialOrder:n="list"}=t,[a,i]=s.useState(r),[f,p]=s.useState(n),l=s.useMemo(()=>f==="list"?e:At(e),[e,f]),[h,d]=s.useState(l[0]),v=s.useCallback(c=>c.url,[]),g=s.useMemo(()=>l.findIndex(y=>v(y)===v(h))<l.length-1||a!=="none",[l,h,a,v]),x=s.useCallback(()=>{d(c=>{const y=l.findIndex(w=>v(w)===v(c));return y<l.length-1?l[y+1]:{...l[0]}})},[a,l,v]),b=s.useCallback(()=>{d(c=>{const y=l.indexOf(c);return y>0?l[y-1]:c})},[l]),u=s.useCallback(c=>{d(c)},[]);return s.useEffect(()=>{const c=l.find(y=>v(y)===v(h));d(c||l[0])},[l,v,h]),{list:l,currentSong:h,hasNextSong:g,next:x,previous:b,prioritize:u,order:f,setOrder:p,loop:a,setLoop:i,length:l.length}}function Ct(e){var k,P,z;const t=q("aplayer"),{bodyRef:r,appearance:n,volume:a,listMaxHeight:i,theme:f,border:p,notice:l,audio:h,audioControl:d,handlePlayButtonClick:v,handlePlayAudioFromList:g,isPlaylistOpen:x,setPlaylistOpen:b,mini:u,displayLyrics:c,setDisplayLyrics:y,setMini:w,playlist:S,hasPlaylist:T}=Lt(e),$=s.useCallback(O=>O?typeof O=="string"?O:O.url?m.jsx("a",{href:O.url,target:"_blank",rel:"noreferrer",children:O.name??"Audio artist"}):O.name??"Audio artist":"Audio artist",[]);return m.jsxs("div",{className:j(t.b(),{[t.bs(f)]:!0,[t.bs("vars")]:!0,[t.bm(n)]:!0,[t.bm("loading")]:d.isLoading,[t.bm("withlist")]:T,[t.bm("list-folded")]:!x,[t.bm("withlrc")]:!!S.currentSong.lrc&&n!=="fixed",[t.bm("narrow")]:u,[t.bm("border")]:p}),role:"region","aria-label":"Audio Player",children:[m.jsxs("div",{ref:r,className:t.be("body"),children:[m.jsx("div",{className:t.be("pic"),onClick:v,style:{backgroundImage:`url("${(k=S.currentSong)==null?void 0:k.cover}")`},role:"button","aria-label":d.isPlaying?"Pause audio":"Play audio",children:m.jsx("div",{className:j(t.be("button"),d.isPlaying?t.bm("pause"):t.bm("play")),role:"presentation",children:d.isPlaying?m.jsx(tt,{}):m.jsx(vt,{})})}),m.jsxs("div",{className:j(t.be("info")),children:[m.jsxs("div",{className:j(t.be("music")),children:[m.jsx("span",{className:j(t.be("title")),children:((P=S.currentSong)==null?void 0:P.name)??"Audio name"}),m.jsxs("span",{className:j(t.be("author")),children:[" ","-"," ",$((z=S.currentSong)==null?void 0:z.artist)]})]}),n==="fixed"?null:m.jsx(Le,{show:c,lrcText:S.currentSong.lrc,currentTime:d.currentTime??0}),m.jsx(yt,{volume:d.volume??a,onChangeVolume:d.setVolume,muted:d.muted??!1,onToggleMuted:()=>d.toggleMuted(),currentTime:d.currentTime,audioDurationSeconds:d.duration,bufferedSeconds:d.bufferedSeconds,onSeek:O=>d.seek(O),onToggleMenu:()=>b(O=>!O),order:S.order,onOrderChange:S.setOrder,loop:S.loop,onLoopChange:S.setLoop,isPlaying:d.isPlaying??!1,onTogglePlay:v,onSkipForward:()=>{S.hasNextSong&&S.next()},onSkipBack:()=>{S.previous()},showLyrics:c,onToggleLyrics:()=>{y(O=>!O)}})]}),m.jsx("div",{className:t.be("notice"),style:l.style,children:l.text}),m.jsx("div",{className:t.be("miniswitcher"),onClick:()=>w(O=>!O),children:m.jsx("button",{className:j(t.bs("icon"),t.bs("icon-right")),type:"button",children:m.jsx(et,{})})})]}),T?m.jsx(pt,{open:x,audio:h,playingAudioUrl:S.currentSong.url,onPlayAudio:g,listMaxHeight:i,mini:u}):null,n==="fixed"&&m.jsx(Le,{show:c,lrcText:S.currentSong.lrc,currentTime:d.currentTime??0})]})}V.TwistAPlayer=Ct,Object.defineProperty(V,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "twist-aplayer",
3
3
  "type": "module",
4
- "version": "1.4.6",
4
+ "version": "1.5.1",
5
5
  "private": false,
6
6
  "description": "A shadui theme aplayer",
7
7
  "author": {
@@ -38,6 +38,9 @@
38
38
  "lint": "eslint .",
39
39
  "prepublishOnly": "pnpm build"
40
40
  },
41
+ "peerDependencies": {
42
+ "react": ">=18.2.0"
43
+ },
41
44
  "dependencies": {
42
45
  "@twistify/react-icons": "^1.0.4",
43
46
  "@twistui/bem-helper": "^1.0.1",
@@ -50,8 +53,8 @@
50
53
  "@commitlint/config-angular": "^19.7.0",
51
54
  "@eslint-react/eslint-plugin": "^1.23.2",
52
55
  "@testing-library/react": "^16.2.0",
53
- "@types/react": "18",
54
- "@types/react-dom": "18",
56
+ "@types/react": "^19.0.10",
57
+ "@types/react-dom": "^19.0.4",
55
58
  "@types/use-sync-external-store": "^0.0.6",
56
59
  "@vitejs/plugin-react": "^4.3.4",
57
60
  "@vitest/coverage-v8": "3.0.9",
@@ -60,8 +63,8 @@
60
63
  "eslint-plugin-react-refresh": "^0.4.19",
61
64
  "happy-dom": "^17.4.4",
62
65
  "postcss": "^8.5.3",
63
- "react": "18",
64
- "react-dom": "18",
66
+ "react": "^19.1.0",
67
+ "react-dom": "^19.1.0",
65
68
  "rimraf": "^6.0.1",
66
69
  "sass": "^1.86.0",
67
70
  "typescript": "^5.8.2",