twist-aplayer 1.4.0 → 1.4.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.
- package/dist/index.js +9 -9
- package/dist/index.min.css +1 -1
- package/dist/index.mjs +2 -1
- package/dist/twist-aplayer.umd.js +9 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react");function qr(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 ee=qr(c);var be={exports:{}},oe={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
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 Je;function Dr(){if(Je)return oe;Je=1;var e=
|
|
9
|
+
*/var Je;function Dr(){if(Je)return oe;Je=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,l={key:!0,ref:!0,__self:!0,__source:!0};function p(E,s,f){var d,y={},S=null,x=null;f!==void 0&&(S=""+f),s.key!==void 0&&(S=""+s.key),s.ref!==void 0&&(x=s.ref);for(d in s)a.call(s,d)&&!l.hasOwnProperty(d)&&(y[d]=s[d]);if(E&&E.defaultProps)for(d in s=E.defaultProps,s)y[d]===void 0&&(y[d]=s[d]);return{$$typeof:r,type:E,key:S,ref:x,props:y,_owner:i.current}}return oe.Fragment=n,oe.jsx=p,oe.jsxs=p,oe}var ue={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,7 +14,7 @@
|
|
|
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
|
-
*/var Xe;function Ir(){return Xe||(Xe=1,process.env.NODE_ENV!=="production"&&function(){var e=
|
|
17
|
+
*/var Xe;function Ir(){return Xe||(Xe=1,process.env.NODE_ENV!=="production"&&function(){var e=c,r=Symbol.for("react.element"),n=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),p=Symbol.for("react.provider"),E=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),y=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),x=Symbol.for("react.offscreen"),g=Symbol.iterator,u="@@iterator";function m(t){if(t===null||typeof t!="object")return null;var o=g&&t[g]||t[u];return typeof o=="function"?o:null}var b=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function j(t){{for(var o=arguments.length,h=new Array(o>1?o-1:0),_=1;_<o;_++)h[_-1]=arguments[_];O("error",t,h)}}function O(t,o,h){{var _=b.ReactDebugCurrentFrame,R=_.getStackAddendum();R!==""&&(o+="%s",h=h.concat([R]));var C=h.map(function(w){return String(w)});C.unshift("Warning: "+o),Function.prototype.apply.call(console[t],console,C)}}var P=!1,V=!1,F=!1,N=!1,U=!1,M;M=Symbol.for("react.module.reference");function ce(t){return!!(typeof t=="string"||typeof t=="function"||t===a||t===l||U||t===i||t===f||t===d||N||t===x||P||V||F||typeof t=="object"&&t!==null&&(t.$$typeof===S||t.$$typeof===y||t.$$typeof===p||t.$$typeof===E||t.$$typeof===s||t.$$typeof===M||t.getModuleId!==void 0))}function Se(t,o,h){var _=t.displayName;if(_)return _;var R=o.displayName||o.name||"";return R!==""?h+"("+R+")":h}function fe(t){return t.displayName||"Context"}function B(t){if(t==null)return null;if(typeof t.tag=="number"&&j("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 a:return"Fragment";case n:return"Portal";case l:return"Profiler";case i:return"StrictMode";case f:return"Suspense";case d:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case E:var o=t;return fe(o)+".Consumer";case p:var h=t;return fe(h._context)+".Provider";case s:return Se(t,t.render,"ForwardRef");case y:var _=t.displayName||null;return _!==null?_:B(t.type)||"Memo";case S:{var R=t,C=R._payload,w=R._init;try{return B(w(C))}catch{return null}}}return null}var z=Object.assign,Y=0,K,re,te,D,J,ne,ae;function de(){}de.__reactDisabledLog=!0;function ie(){{if(Y===0){K=console.log,re=console.info,te=console.warn,D=console.error,J=console.group,ne=console.groupCollapsed,ae=console.groupEnd;var t={configurable:!0,enumerable:!0,value:de,writable:!0};Object.defineProperties(console,{info:t,log:t,warn:t,error:t,group:t,groupCollapsed:t,groupEnd:t})}Y++}}function vr(){{if(Y--,Y===0){var t={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:z({},t,{value:K}),info:z({},t,{value:re}),warn:z({},t,{value:te}),error:z({},t,{value:D}),group:z({},t,{value:J}),groupCollapsed:z({},t,{value:ne}),groupEnd:z({},t,{value:ae})})}Y<0&&j("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var _e=b.ReactCurrentDispatcher,Te;function ve(t,o,h){{if(Te===void 0)try{throw Error()}catch(R){var _=R.stack.trim().match(/\n( *(at )?)/);Te=_&&_[1]||""}return`
|
|
18
18
|
`+Te+t}}var we=!1,me;{var mr=typeof WeakMap=="function"?WeakMap:Map;me=new mr}function ke(t,o){if(!t||we)return"";{var h=me.get(t);if(h!==void 0)return h}var _;we=!0;var R=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var C;C=_e.current,_e.current=null,ie();try{if(o){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(H){_=H}Reflect.construct(t,[],w)}else{try{w.call()}catch(H){_=H}t.call(w.prototype)}}else{try{throw Error()}catch(H){_=H}t()}}catch(H){if(H&&_&&typeof H.stack=="string"){for(var T=H.stack.split(`
|
|
19
19
|
`),q=_.stack.split(`
|
|
20
20
|
`),$=T.length-1,A=q.length-1;$>=1&&A>=0&&T[$]!==q[A];)A--;for(;$>=1&&A>=0;$--,A--)if(T[$]!==q[A]){if($!==1||A!==1)do if($--,A--,A<0||T[$]!==q[A]){var I=`
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
|
|
23
23
|
Check the render method of \``+t+"`."}return""}}function Cr(t){return""}var We={};function Pr(t){{var o=He();if(!o){var h=typeof t=="string"?t:t.displayName||t.name;h&&(o=`
|
|
24
24
|
|
|
25
|
-
Check the top-level render call using <`+h+">.")}return o}}function Ue(t,o){{if(!t._store||t._store.validated||t.key!=null)return;t._store.validated=!0;var h=Pr(o);if(We[h])return;We[h]=!0;var _="";t&&t._owner&&t._owner!==Oe.current&&(_=" It was passed a child from "+B(t._owner.type)+"."),X(t),j('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',h,_),X(null)}}function Ye(t,o){{if(typeof t!="object")return;if(je(t))for(var h=0;h<t.length;h++){var _=t[h];Ce(_)&&Ue(_,o)}else if(Ce(t))t._store&&(t._store.validated=!0);else if(t){var R=m(t);if(typeof R=="function"&&R!==t.entries)for(var C=R.call(t),w;!(w=C.next()).done;)Ce(w.value)&&Ue(w.value,o)}}}function Lr(t){{var o=t.type;if(o==null||typeof o=="string")return;var h;if(typeof o=="function")h=o.propTypes;else if(typeof o=="object"&&(o.$$typeof===s||o.$$typeof===y))h=o.propTypes;else return;if(h){var _=B(o);yr(h,t.props,"prop",_,t)}else if(o.PropTypes!==void 0&&!Re){Re=!0;var R=B(o);j("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",R||"Unknown")}typeof o.getDefaultProps=="function"&&!o.getDefaultProps.isReactClassApproved&&j("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function $r(t){{for(var o=Object.keys(t.props),h=0;h<o.length;h++){var _=o[h];if(_!=="children"&&_!=="key"){X(t),j("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",_),X(null);break}}t.ref!==null&&(X(t),j("Invalid attribute `ref` supplied to `React.Fragment`."),X(null))}}function Ge(t,o,h,_,R,C){{var w=ce(t);if(!w){var T="";(t===void 0||typeof t=="object"&&t!==null&&Object.keys(t).length===0)&&(T+=" 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=Cr();q?T+=q:T+=He();var $;t===null?$="null":je(t)?$="array":t!==void 0&&t.$$typeof===r?($="<"+(B(t.type)||"Unknown")+" />",T=" Did you accidentally export a JSX literal instead of a component?"):$=typeof t,j("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",$,T)}var A=Rr(t,o,h,R,C);if(A==null)return A;if(w){var I=o.children;if(I!==void 0)if(_)if(je(I)){for(var Q=0;Q<I.length;Q++)Ye(I[Q],t);Object.freeze&&Object.freeze(I)}else j("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 Ye(I,t)}return t===a?$r(A):Lr(A),A}}function Mr(t,o,h){return Ge(t,o,h,!0)}function Ar(t,o,h){return Ge(t,o,h,!1)}var kr=Ar,Nr=Mr;ue.Fragment=a,ue.jsx=kr,ue.jsxs=Nr}()),ue}var Qe;function Vr(){return Qe||(Qe=1,process.env.NODE_ENV==="production"?be.exports=Dr():be.exports=Ir()),be.exports}var v=Vr(),ge=e=>`--${e}`,Ze=e=>`var(--${e})`,er=(e,r)=>`--${e}: ${r};`;function Fr(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=>ge(`${n()}-${e}-${a}`),cvm:(a,i={})=>{const
|
|
26
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Wr(e,r){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var a,i,
|
|
27
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var c,p=!0,E=!1;return{s:function(){n=n.call(e)},n:function(){var f=n.next();return p=f.done,f},e:function(f){E=!0,c=f},f:function(){try{p||n.return==null||n.return()}finally{if(E)throw c}}}}function lr(e,r){if(e){if(typeof e=="string")return rr(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)?rr(e,r):void 0}}function rr(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 xe(){return xe=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},xe.apply(null,arguments)}function tr(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 le(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?tr(Object(n),!0).forEach(function(a){Gr(e,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tr(Object(n)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))})}return e}function Gr(e,r,n){return(r=Kr(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function Kr(e){var r=Jr(e,"string");return se(r)=="symbol"?r:r+""}function Jr(e,r){if(se(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var a=n.call(e,r);if(se(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function Xr(e,r){if(e==null)return{};var n,a,i=Qr(e,r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(a=0;a<c.length;a++)n=c[a],r.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Qr(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 Zr(e){var r=e.attrs,n=e.size,a=e.title,i=e.spin,c=e.rotate,p=e.color,E=Xr(e,Br),s=function(d){var y=n||d.size||"1em",S,x="",g="";return d.className&&(S=d.className),e.className&&(S=S?"".concat(S," ").concat(e.className):e.className),i&&(S?S+=" twist-icon-loading":S="twist-icon-loading"),c&&(x="rotate(".concat(c,"deg)"),g="rotate(".concat(c,"deg)")),ee.createElement("svg",xe({xmlns:"http://www.w3.org/2000/svg"},d.attrs,r,E,{className:S,style:le(le({color:p||d.color,msTransform:x,transform:g},d.style),e.style),width:y,height:y}),a&&ee.createElement("title",null,a),e.children)};return Ae!==void 0?ee.createElement(Ae.Consumer,null,function(f){return s(f)}):s(sr)}function et(e){var r={},n=e.split(";"),a=Yr(n),i;try{for(a.s();!(i=a.n()).done;){var c=i.value,p=c.split(":"),E=zr(p,2),s=E[0],f=E[1];if(s&&f){var d=s.trim().replace(/-./g,function(y){return y.charAt(1).toUpperCase()});r[d]=f.trim()}}}catch(y){a.e(y)}finally{a.f()}return r}function cr(e){return e&&e.map(function(r,n){return ee.createElement(r.tag,le(le({},r.attrs),{},{key:n,style:r.attrs.style?et(r.attrs.style):null}),cr(r.children))})}function k(e){return function(r){return ee.createElement(Zr,xe({attrs:le({},e.attrs)},r),cr(e.children))}}function rt(e){return k({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 tt(e){return k({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 nt(e){return k({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 at(e){return k({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 it(e){return k({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 ot(e){return k({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"}}]})(e)}function ut(e){return k({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 st(e){return k({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 lt(e){return k({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 ct(e){return k({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 ft(e){return k({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M14 19V5h4v14zm-8 0V5h4v14z"}}]})(e)}function dt(e){return k({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 vt(e){return k({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 mt(e){return k({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 ht(e){return k({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 pt(e){return k({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M7 15V9h4l5-5v16l-5-5z"}}]})(e)}function yt(e){return k({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 bt(e){return k({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M18.25 12L8.5 17.629V6.37z"}}]})(e)}function Pe(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 Le(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 fr(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=fr(e[r]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function L(){for(var e,r,n=0,a="",i=arguments.length;n<i;n++)(e=arguments[n])&&(r=fr(e))&&(a&&(a+=" "),a+=r);return a}function gt({bufferedPercentage:e,playedPercentage:r,onSeek:n}){const a=W("aplayer-bar"),i=W("aplayer-icon"),c=l.useRef(null),[p,E]=l.useState(r),s=l.useRef(!1);l.useEffect(()=>{s.current||E(r)},[r]);const f=l.useCallback(d=>{s.current=!0;const y=Pe(d,c);E(y);const S=g=>{const u=Pe(g,c);E(u)},x=g=>{document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",x);const u=Pe(g,c);E(u),n==null||n(u),s.current=!1};document.addEventListener("mousemove",S),document.addEventListener("mouseup",x)},[n]);return v.jsx("div",{ref:c,className:L(a.b(),a.bs("vars")),onMouseDown:f,role:"slider","aria-label":"Audio progress","aria-valuenow":p?p*100:0,"aria-valuemin":0,"aria-valuemax":100,"aria-live":"polite",children:v.jsxs("div",{className:a.be("inner"),children:[typeof e<"u"?v.jsx("div",{className:a.be("loaded"),style:{width:`${e*100}%`}}):null,typeof p<"u"?v.jsx("div",{className:a.be("played"),style:{width:`${p*100}%`},children:v.jsx("span",{className:a.be("thumb"),children:v.jsx("span",{className:L(i.bs("loading")),children:v.jsx(nt,{})})})}):null]})})}function Et({volume:e,muted:r,onToggleMuted:n,onChangeVolume:a}){const i=W("aplayer-volumn"),c=W("aplayer-icon"),p=l.useRef(null),[E,s]=l.useState(!1),f=l.useCallback(d=>{a(Le(d,p)),s(!0);const y=x=>{a(Le(x,p))},S=x=>{document.removeEventListener("mouseup",S),document.removeEventListener("mousemove",y),s(!1),a(Le(x,p))};document.addEventListener("mousemove",y),document.addEventListener("mouseup",S)},[a]);return v.jsxs("div",{className:L(i.b(),i.bs("vars")),children:[v.jsx("button",{type:"button",className:L(c.b(),c.bs("volume-down")),onClick:()=>n(),"aria-label":r||!e?"Muted":"unMuted",children:r||!e?v.jsx(pt,{}):e>=1?v.jsx(yt,{}):v.jsx(ht,{})}),v.jsx("div",{className:L(i.be("bar-wrap"),{[i.bem("bar-wrap","active")]:E}),ref:p,onMouseDown:f,children:v.jsx("div",{className:i.be("bar"),children:v.jsx("div",{className:i.be("thumb"),style:{height:r?0:`${e*100}%`}})})})]})}function nr(e){if(typeof e>"u")return"--:--";if(Number.isNaN(e))return"00:00";const r=p=>p<10?`0${p}`:`${p}`,n=Math.trunc(e/60),a=Math.trunc(e-n*60),i=Math.trunc(n/60),c=Math.trunc(e/60-60*Math.trunc(e/60/60));return e>=3600?`${r(i)}:${r(c)}:${r(a)}`:`${r(n)}:${r(a)}`}function xt({volume:e,onChangeVolume:r,muted:n,currentTime:a,audioDurationSeconds:i,bufferedSeconds:c,onToggleMenu:p,onToggleMuted:E,order:s,onOrderChange:f,loop:d,onLoopChange:y,onSeek:S,isPlaying:x,onTogglePlay:g,onSkipForward:u,onSkipBack:m,showLyrics:b=!0,onToggleLyrics:j}){const O=W("aplayer-controller"),P=W("aplayer-icon"),V=l.useCallback(()=>{const N={list:"random",random:"list"}[s];f(N)},[s,f]),F=l.useCallback(()=>{const N={all:"one",one:"none",none:"all"}[d];y(N)},[d,y]);return v.jsxs("div",{className:L(O.b(),O.bs("vars")),role:"group","aria-label":"Audio Controls",children:[v.jsx(gt,{playedPercentage:typeof a>"u"||typeof i>"u"?void 0:a/i,bufferedPercentage:typeof c>"u"||typeof i>"u"?void 0:c/i,onSeek:N=>S==null?void 0:S(N*i)}),v.jsxs("div",{className:O.be("time"),children:[v.jsxs("span",{className:O.be("time-inner"),"aria-live":"polite",children:[v.jsx("span",{className:O.be("ptime"),children:nr(a)})," / ",v.jsx("span",{className:O.be("dtime"),children:nr(i)})]}),v.jsx("button",{className:L(P.b(),P.bs("back")),onClick:m,type:"button","aria-label":"Previous track",children:v.jsx(rt,{})}),v.jsx("button",{className:L(P.b(),P.bs("play")),onClick:g,type:"button","aria-label":x?"Pause audio":"Play audio",children:x?v.jsx(ft,{}):v.jsx(dt,{})}),v.jsx("button",{className:L(P.b(),P.bs("forward")),onClick:u,type:"button","aria-label":"Next track",children:v.jsx(tt,{})}),v.jsx(Et,{volume:e,muted:n,onToggleMuted:E,onChangeVolume:r}),v.jsx("button",{className:L(P.b(),P.bs("order")),onClick:V,type:"button","aria-label":`Playback order: ${s}`,children:{list:v.jsx(lt,{}),random:v.jsx(st,{})}[s]}),v.jsx("button",{className:L(P.b(),P.bs("order")),onClick:F,type:"button","aria-label":`Loop mode: ${d}`,children:{all:v.jsx(mt,{}),one:v.jsx(vt,{}),none:v.jsx(ut,{})}[d]}),v.jsx("button",{type:"button",className:L(P.b(),P.bs("menu")),onClick:()=>p==null?void 0:p(),"aria-label":"Toggle playlist menu",children:v.jsx(ot,{})}),v.jsx("button",{type:"button",className:L(P.b(),P.bs("lrc"),{[P.ns("lrc-inactivity")]:!b}),onClick:j,"aria-label":b?"Hide lyrics":"Show lyrics","aria-pressed":b,children:v.jsx(ct,{})})]})]})}function St({open:e,audio:r,playingAudioUrl:n,onPlayAudio:a,listMaxHeight:i}){const c=W("aplayer-list"),p=i?{maxHeight:i}:void 0,E=l.useCallback(f=>f?typeof f=="string"?f:f.name??"Audio artist":"Audio artist",[]),s=l.useRef(null);return l.useEffect(()=>{if(s.current){const f=s.current;return f.style.maxHeight=`${Math.min(f.scrollHeight,i??1/0)}px`,()=>{f.removeAttribute("style")}}},[i]),v.jsx("div",{ref:s,className:L(c.b(),{[c.bm("hide")]:!e}),"aria-label":"Audio playlist","aria-live":"polite",children:v.jsx("ol",{style:p,children:r.map((f,d)=>v.jsxs("li",{className:L({[c.bm("active")]:f.url===n}),onClick:()=>{f.url!==n&&(a==null||a(f))},role:"button","aria-label":`${f.name??"Audio name"} by ${E(f.artist)}}`,children:[v.jsx("span",{className:c.be("cur")}),v.jsx("span",{className:c.be("index"),children:d+1}),v.jsx("span",{className:c.be("title"),children:f.name??"Audio name"}),v.jsx("span",{className:c.be("author"),children:E(f.artist)})]},f.name||d))})})}function ar({show:e,lrcText:r,currentTime:n}){const a=W("aplayer-lrc"),i=l.useMemo(()=>_t(r),[r]),c=l.useMemo(()=>{for(let E=0;E<i.length;E++){const s=i[E],f=i[E+1];if(n>=s[0]&&(!f||n<f[0]))return E}return 0},[n,i]),p=l.useMemo(()=>({transform:`translateY(${-c*16}px)`,WebkitTransform:`translateY(${-c*16}px)`}),[c]);return v.jsx("div",{className:L(a.b(),{[a.bm("hide")]:!e}),children:r?v.jsx("div",{className:a.be("contents"),style:p,children:i.map(([,E],s)=>v.jsx("p",{className:L({[a.be("current")]:s===c}),children:E},s))}):null})}function _t(e){if(e){e=e.replace(/([^\]^\n])\[/g,(i,c)=>`${c}
|
|
25
|
+
Check the top-level render call using <`+h+">.")}return o}}function Ue(t,o){{if(!t._store||t._store.validated||t.key!=null)return;t._store.validated=!0;var h=Pr(o);if(We[h])return;We[h]=!0;var _="";t&&t._owner&&t._owner!==Oe.current&&(_=" It was passed a child from "+B(t._owner.type)+"."),X(t),j('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',h,_),X(null)}}function Ye(t,o){{if(typeof t!="object")return;if(je(t))for(var h=0;h<t.length;h++){var _=t[h];Ce(_)&&Ue(_,o)}else if(Ce(t))t._store&&(t._store.validated=!0);else if(t){var R=m(t);if(typeof R=="function"&&R!==t.entries)for(var C=R.call(t),w;!(w=C.next()).done;)Ce(w.value)&&Ue(w.value,o)}}}function Lr(t){{var o=t.type;if(o==null||typeof o=="string")return;var h;if(typeof o=="function")h=o.propTypes;else if(typeof o=="object"&&(o.$$typeof===s||o.$$typeof===y))h=o.propTypes;else return;if(h){var _=B(o);yr(h,t.props,"prop",_,t)}else if(o.PropTypes!==void 0&&!Re){Re=!0;var R=B(o);j("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",R||"Unknown")}typeof o.getDefaultProps=="function"&&!o.getDefaultProps.isReactClassApproved&&j("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function $r(t){{for(var o=Object.keys(t.props),h=0;h<o.length;h++){var _=o[h];if(_!=="children"&&_!=="key"){X(t),j("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",_),X(null);break}}t.ref!==null&&(X(t),j("Invalid attribute `ref` supplied to `React.Fragment`."),X(null))}}function Ge(t,o,h,_,R,C){{var w=ce(t);if(!w){var T="";(t===void 0||typeof t=="object"&&t!==null&&Object.keys(t).length===0)&&(T+=" 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=Cr();q?T+=q:T+=He();var $;t===null?$="null":je(t)?$="array":t!==void 0&&t.$$typeof===r?($="<"+(B(t.type)||"Unknown")+" />",T=" Did you accidentally export a JSX literal instead of a component?"):$=typeof t,j("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",$,T)}var A=Rr(t,o,h,R,C);if(A==null)return A;if(w){var I=o.children;if(I!==void 0)if(_)if(je(I)){for(var Q=0;Q<I.length;Q++)Ye(I[Q],t);Object.freeze&&Object.freeze(I)}else j("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 Ye(I,t)}return t===a?$r(A):Lr(A),A}}function Mr(t,o,h){return Ge(t,o,h,!0)}function Ar(t,o,h){return Ge(t,o,h,!1)}var kr=Ar,Nr=Mr;ue.Fragment=a,ue.jsx=kr,ue.jsxs=Nr}()),ue}var Qe;function Vr(){return Qe||(Qe=1,process.env.NODE_ENV==="production"?be.exports=Dr():be.exports=Ir()),be.exports}var v=Vr(),ge=e=>`--${e}`,Ze=e=>`var(--${e})`,er=(e,r)=>`--${e}: ${r};`;function Fr(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=>ge(`${n()}-${e}-${a}`),cvm:(a,i={})=>{const l=n();for(const p of Object.keys(a))i[ge(`${l}-${e}-${p}`)]=a[p];return i},gcv:a=>Ze(`${n()}-${e}-${a}`),scv:(a,i)=>er(`${n()}-${e}-${a}`,i),nv:a=>ge(`${n()}-${a}`),nvm:(a,i={})=>{const l=n();for(const p of Object.keys(a))i[ge(`${l}-${p}`)]=a[p];return i},gnv:a=>Ze(`${n()}-${a}`),snv:(a,i)=>er(`${n()}-${a}`,i)}}function W(e){return c.useMemo(()=>Fr(e,"twist"),[e])}var sr={color:void 0,size:void 0,className:void 0,style:void 0,attrs:void 0},Ae=ee.createContext(sr);Ae.Provider;function se(e){"@babel/helpers - typeof";return se=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},se(e)}var Br=["attrs","size","title","spin","rotate","color"];function zr(e,r){return Ur(e)||Wr(e,r)||lr(e,r)||Hr()}function Hr(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
26
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Wr(e,r){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var a,i,l,p,E=[],s=!0,f=!1;try{if(l=(n=n.call(e)).next,r!==0)for(;!(s=(a=l.call(n)).done)&&(E.push(a.value),E.length!==r);s=!0);}catch(d){f=!0,i=d}finally{try{if(!s&&n.return!=null&&(p=n.return(),Object(p)!==p))return}finally{if(f)throw i}}return E}}function Ur(e){if(Array.isArray(e))return e}function Yr(e,r){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=lr(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(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
27
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var l,p=!0,E=!1;return{s:function(){n=n.call(e)},n:function(){var f=n.next();return p=f.done,f},e:function(f){E=!0,l=f},f:function(){try{p||n.return==null||n.return()}finally{if(E)throw l}}}}function lr(e,r){if(e){if(typeof e=="string")return rr(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)?rr(e,r):void 0}}function rr(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 xe(){return xe=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},xe.apply(null,arguments)}function tr(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 le(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?tr(Object(n),!0).forEach(function(a){Gr(e,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tr(Object(n)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))})}return e}function Gr(e,r,n){return(r=Kr(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function Kr(e){var r=Jr(e,"string");return se(r)=="symbol"?r:r+""}function Jr(e,r){if(se(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var a=n.call(e,r);if(se(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function Xr(e,r){if(e==null)return{};var n,a,i=Qr(e,r);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(a=0;a<l.length;a++)n=l[a],r.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Qr(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 Zr(e){var r=e.attrs,n=e.size,a=e.title,i=e.spin,l=e.rotate,p=e.color,E=Xr(e,Br),s=function(d){var y=n||d.size||"1em",S,x="",g="";return d.className&&(S=d.className),e.className&&(S=S?"".concat(S," ").concat(e.className):e.className),i&&(S?S+=" twist-icon-loading":S="twist-icon-loading"),l&&(x="rotate(".concat(l,"deg)"),g="rotate(".concat(l,"deg)")),ee.createElement("svg",xe({xmlns:"http://www.w3.org/2000/svg"},d.attrs,r,E,{className:S,style:le(le({color:p||d.color,msTransform:x,transform:g},d.style),e.style),width:y,height:y}),a&&ee.createElement("title",null,a),e.children)};return Ae!==void 0?ee.createElement(Ae.Consumer,null,function(f){return s(f)}):s(sr)}function et(e){var r={},n=e.split(";"),a=Yr(n),i;try{for(a.s();!(i=a.n()).done;){var l=i.value,p=l.split(":"),E=zr(p,2),s=E[0],f=E[1];if(s&&f){var d=s.trim().replace(/-./g,function(y){return y.charAt(1).toUpperCase()});r[d]=f.trim()}}}catch(y){a.e(y)}finally{a.f()}return r}function cr(e){return e&&e.map(function(r,n){return ee.createElement(r.tag,le(le({},r.attrs),{},{key:n,style:r.attrs.style?et(r.attrs.style):null}),cr(r.children))})}function k(e){return function(r){return ee.createElement(Zr,xe({attrs:le({},e.attrs)},r),cr(e.children))}}function rt(e){return k({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 tt(e){return k({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 nt(e){return k({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 at(e){return k({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 it(e){return k({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 ot(e){return k({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"}}]})(e)}function ut(e){return k({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 st(e){return k({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 lt(e){return k({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 ct(e){return k({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 ft(e){return k({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M14 19V5h4v14zm-8 0V5h4v14z"}}]})(e)}function dt(e){return k({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 vt(e){return k({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 mt(e){return k({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 ht(e){return k({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 pt(e){return k({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M7 15V9h4l5-5v16l-5-5z"}}]})(e)}function yt(e){return k({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 bt(e){return k({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M18.25 12L8.5 17.629V6.37z"}}]})(e)}function Pe(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 Le(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 fr(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=fr(e[r]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function L(){for(var e,r,n=0,a="",i=arguments.length;n<i;n++)(e=arguments[n])&&(r=fr(e))&&(a&&(a+=" "),a+=r);return a}function gt({bufferedPercentage:e,playedPercentage:r,onSeek:n}){const a=W("aplayer-bar"),i=W("aplayer-icon"),l=c.useRef(null),[p,E]=c.useState(r),s=c.useRef(!1);c.useEffect(()=>{s.current||E(r)},[r]);const f=c.useCallback(d=>{s.current=!0;const y=Pe(d,l);E(y);const S=g=>{const u=Pe(g,l);E(u)},x=g=>{document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",x);const u=Pe(g,l);E(u),n==null||n(u),s.current=!1};document.addEventListener("mousemove",S),document.addEventListener("mouseup",x)},[n]);return v.jsx("div",{ref:l,className:L(a.b(),a.bs("vars")),onMouseDown:f,role:"slider","aria-label":"Audio progress","aria-valuenow":p?p*100:0,"aria-valuemin":0,"aria-valuemax":100,"aria-live":"polite",children:v.jsxs("div",{className:a.be("inner"),children:[typeof e<"u"?v.jsx("div",{className:a.be("loaded"),style:{width:`${e*100}%`}}):null,typeof p<"u"?v.jsx("div",{className:a.be("played"),style:{width:`${p*100}%`},children:v.jsx("span",{className:a.be("thumb"),children:v.jsx("span",{className:L(i.bs("loading")),children:v.jsx(nt,{})})})}):null]})})}function Et({volume:e,muted:r,onToggleMuted:n,onChangeVolume:a}){const i=W("aplayer-volumn"),l=W("aplayer-icon"),p=c.useRef(null),[E,s]=c.useState(!1),f=c.useCallback(d=>{a(Le(d,p)),s(!0);const y=x=>{a(Le(x,p))},S=x=>{document.removeEventListener("mouseup",S),document.removeEventListener("mousemove",y),s(!1),a(Le(x,p))};document.addEventListener("mousemove",y),document.addEventListener("mouseup",S)},[a]);return v.jsxs("div",{className:L(i.b(),i.bs("vars")),children:[v.jsx("button",{type:"button",className:L(l.b(),l.bs("volume-down")),onClick:()=>n(),"aria-label":r||!e?"Muted":"unMuted",children:r||!e?v.jsx(pt,{}):e>=1?v.jsx(yt,{}):v.jsx(ht,{})}),v.jsx("div",{className:L(i.be("bar-wrap"),{[i.bem("bar-wrap","active")]:E}),ref:p,onMouseDown:f,children:v.jsx("div",{className:i.be("bar"),children:v.jsx("div",{className:i.be("thumb"),style:{height:r?0:`${e*100}%`}})})})]})}function nr(e){if(typeof e>"u")return"--:--";if(Number.isNaN(e))return"00:00";const r=p=>p<10?`0${p}`:`${p}`,n=Math.trunc(e/60),a=Math.trunc(e-n*60),i=Math.trunc(n/60),l=Math.trunc(e/60-60*Math.trunc(e/60/60));return e>=3600?`${r(i)}:${r(l)}:${r(a)}`:`${r(n)}:${r(a)}`}function xt({volume:e,onChangeVolume:r,muted:n,currentTime:a,audioDurationSeconds:i,bufferedSeconds:l,onToggleMenu:p,onToggleMuted:E,order:s,onOrderChange:f,loop:d,onLoopChange:y,onSeek:S,isPlaying:x,onTogglePlay:g,onSkipForward:u,onSkipBack:m,showLyrics:b=!0,onToggleLyrics:j}){const O=W("aplayer-controller"),P=W("aplayer-icon"),V=c.useCallback(()=>{const N={list:"random",random:"list"}[s];f(N)},[s,f]),F=c.useCallback(()=>{const N={all:"one",one:"none",none:"all"}[d];y(N)},[d,y]);return v.jsxs("div",{className:L(O.b(),O.bs("vars")),role:"group","aria-label":"Audio Controls",children:[v.jsx(gt,{playedPercentage:typeof a>"u"||typeof i>"u"?void 0:a/i,bufferedPercentage:typeof l>"u"||typeof i>"u"?void 0:l/i,onSeek:N=>S==null?void 0:S(N*i)}),v.jsxs("div",{className:O.be("time"),children:[v.jsxs("span",{className:O.be("time-inner"),"aria-live":"polite",children:[v.jsx("span",{className:O.be("ptime"),children:nr(a)})," / ",v.jsx("span",{className:O.be("dtime"),children:nr(i)})]}),v.jsx("button",{className:L(P.b(),P.bs("back")),onClick:m,type:"button","aria-label":"Previous track",children:v.jsx(rt,{})}),v.jsx("button",{className:L(P.b(),P.bs("play")),onClick:g,type:"button","aria-label":x?"Pause audio":"Play audio",children:x?v.jsx(ft,{}):v.jsx(dt,{})}),v.jsx("button",{className:L(P.b(),P.bs("forward")),onClick:u,type:"button","aria-label":"Next track",children:v.jsx(tt,{})}),v.jsx(Et,{volume:e,muted:n,onToggleMuted:E,onChangeVolume:r}),v.jsx("button",{className:L(P.b(),P.bs("order")),onClick:V,type:"button","aria-label":`Playback order: ${s}`,children:{list:v.jsx(lt,{}),random:v.jsx(st,{})}[s]}),v.jsx("button",{className:L(P.b(),P.bs("order")),onClick:F,type:"button","aria-label":`Loop mode: ${d}`,children:{all:v.jsx(mt,{}),one:v.jsx(vt,{}),none:v.jsx(ut,{})}[d]}),v.jsx("button",{type:"button",className:L(P.b(),P.bs("menu")),onClick:()=>p==null?void 0:p(),"aria-label":"Toggle playlist menu",children:v.jsx(ot,{})}),v.jsx("button",{type:"button",className:L(P.b(),P.bs("lrc"),{[P.ns("lrc-inactivity")]:!b}),onClick:j,"aria-label":b?"Hide lyrics":"Show lyrics","aria-pressed":b,children:v.jsx(ct,{})})]})]})}function St({open:e,audio:r,playingAudioUrl:n,onPlayAudio:a,listMaxHeight:i}){const l=W("aplayer-list"),p=i?{maxHeight:i}:void 0,E=c.useCallback(f=>f?typeof f=="string"?f:f.name??"Audio artist":"Audio artist",[]),s=c.useRef(null);return c.useEffect(()=>{if(s.current){const f=s.current;return f.style.maxHeight=`${Math.min(f.scrollHeight,i??1/0)}px`,()=>{f.removeAttribute("style")}}},[i]),v.jsx("div",{ref:s,className:L(l.b(),{[l.bm("hide")]:!e,[l.bs("vars")]:!0}),"aria-label":"Audio playlist","aria-live":"polite",children:v.jsx("ol",{style:p,children:r.map((f,d)=>v.jsxs("li",{className:L({[l.bm("active")]:f.url===n}),onClick:()=>{f.url!==n&&(a==null||a(f))},role:"button","aria-label":`${f.name??"Audio name"} by ${E(f.artist)}}`,children:[v.jsx("span",{className:l.be("cur")}),v.jsx("span",{className:l.be("index"),children:d+1}),v.jsx("span",{className:l.be("title"),children:f.name??"Audio name"}),v.jsx("span",{className:l.be("author"),children:E(f.artist)})]},f.name||d))})})}function ar({show:e,lrcText:r,currentTime:n}){const a=W("aplayer-lrc"),i=c.useMemo(()=>_t(r),[r]),l=c.useMemo(()=>{for(let E=0;E<i.length;E++){const s=i[E],f=i[E+1];if(n>=s[0]&&(!f||n<f[0]))return E}return 0},[n,i]),p=c.useMemo(()=>({transform:`translateY(${-l*16}px)`,WebkitTransform:`translateY(${-l*16}px)`}),[l]);return v.jsx("div",{className:L(a.b(),{[a.bm("hide")]:!e}),children:r?v.jsx("div",{className:a.be("contents"),style:p,children:i.map(([,E],s)=>v.jsx("p",{className:L({[a.be("current")]:s===l}),children:E},s))}):null})}function _t(e){if(e){e=e.replace(/([^\]^\n])\[/g,(i,l)=>`${l}
|
|
28
28
|
[`);const r=e.split(`
|
|
29
|
-
`),n=[],a=r.length;for(let i=0;i<a;i++){const
|
|
29
|
+
`),n=[],a=r.length;for(let i=0;i<a;i++){const l=r[i].match(/\[(\d{2}):(\d{2})(\.(\d{2,3}))?\]/g),p=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(l){const E=l.length;for(let s=0;s<E;s++){const f=/\[(\d{2}):(\d{2})(\.(\d{2,3}))?\]/.exec(l[s]),d=f[1]*60,y=Number.parseInt(f[2]),S=f[4]?Number.parseInt(f[4])/(`${f[4]}`.length===2?100:1e3):0,x=d+y+S;n.push([x,p])}}}return n.sort((i,l)=>i[0]-l[0]),n}else return[]}var Ee={exports:{}},$e={};/**
|
|
30
30
|
* @license React
|
|
31
31
|
* use-sync-external-store-shim.production.js
|
|
32
32
|
*
|
|
@@ -34,7 +34,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
34
34
|
*
|
|
35
35
|
* This source code is licensed under the MIT license found in the
|
|
36
36
|
* LICENSE file in the root directory of this source tree.
|
|
37
|
-
*/var ir;function Tt(){if(ir)return $e;ir=1;var e=
|
|
37
|
+
*/var ir;function Tt(){if(ir)return $e;ir=1;var e=c;function r(y,S){return y===S&&(y!==0||1/y===1/S)||y!==y&&S!==S}var n=typeof Object.is=="function"?Object.is:r,a=e.useState,i=e.useEffect,l=e.useLayoutEffect,p=e.useDebugValue;function E(y,S){var x=S(),g=a({inst:{value:x,getSnapshot:S}}),u=g[0].inst,m=g[1];return l(function(){u.value=x,u.getSnapshot=S,s(u)&&m({inst:u})},[y,x,S]),i(function(){return s(u)&&m({inst:u}),y(function(){s(u)&&m({inst:u})})},[y]),p(x),x}function s(y){var S=y.getSnapshot;y=y.value;try{var x=S();return!n(y,x)}catch{return!0}}function f(y,S){return S()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:E;return $e.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,$e}var Me={};/**
|
|
38
38
|
* @license React
|
|
39
39
|
* use-sync-external-store-shim.development.js
|
|
40
40
|
*
|
|
@@ -42,4 +42,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
42
42
|
*
|
|
43
43
|
* This source code is licensed under the MIT license found in the
|
|
44
44
|
* LICENSE file in the root directory of this source tree.
|
|
45
|
-
*/var or;function wt(){return or||(or=1,process.env.NODE_ENV!=="production"&&function(){function e(x,g){return x===g&&(x!==0||1/x===1/g)||x!==x&&g!==g}function r(x,g){d||i.startTransition===void 0||(d=!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 u=g();if(!y){var m=g();c(u,m)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),y=!0)}m=p({inst:{value:u,getSnapshot:g}});var b=m[0].inst,j=m[1];return s(function(){b.value=u,b.getSnapshot=g,n(b)&&j({inst:b})},[x,u,g]),E(function(){return n(b)&&j({inst:b}),x(function(){n(b)&&j({inst:b})})},[x]),f(u),u}function n(x){var g=x.getSnapshot;x=x.value;try{var u=g();return!c(x,u)}catch{return!0}}function a(x,g){return g()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var i=l,c=typeof Object.is=="function"?Object.is:e,p=i.useState,E=i.useEffect,s=i.useLayoutEffect,f=i.useDebugValue,d=!1,y=!1,S=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?a:r;Me.useSyncExternalStore=i.useSyncExternalStore!==void 0?i.useSyncExternalStore:S,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Me}var ur;function jt(){return ur||(ur=1,process.env.NODE_ENV==="production"?Ee.exports=Tt():Ee.exports=wt()),Ee.exports}var G=jt();const Z=[];function Ot(e){const r=l.useRef();return l.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),Z.includes(n)||Z.push(n)}},[e==null?void 0:e.autoPlay,e==null?void 0:e.initialVolume,e==null?void 0:e.src]),l.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]),l.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]),l.useEffect(()=>()=>{const n=r.current;if(n){n.pause(),n.currentTime=0;const a=Z.indexOf(n);a!==-1&&Z.splice(a,1)}r.current=void 0},[]),r}function Rt(e){const r=Ot(e),n=l.useCallback(u=>{for(let m=0;m<Z.length;m++){const b=Z[m];b!==u&&!b.paused&&b.pause()}},[]),a=l.useCallback(async u=>{var b;const m=r.current;if(m){e.mutex&&n(m),m.src!==u&&(m.pause(),m.currentTime=0,m.src=u);try{await((b=r.current)==null?void 0:b.play())}catch{}}},[r,e.mutex,n]),i=l.useCallback(u=>{const m=r.current;m&&(m.paused?a(u):m.pause())},[r,a]),c=l.useCallback(u=>{r.current.currentTime=u},[r]),p=l.useCallback(()=>{r.current&&(r.current.muted=!r.current.muted)},[r]),E=l.useCallback(u=>{r.current&&(r.current.volume=u)},[r]),s=G.useSyncExternalStore(l.useCallback(u=>{var m;return(m=r.current)==null||m.addEventListener("volumechange",u),()=>{var b;(b=r.current)==null||b.removeEventListener("volumechange",u)}},[r]),()=>{var u;return(u=r.current)==null?void 0:u.volume},()=>{}),f=G.useSyncExternalStore(l.useCallback(u=>{var m;return(m=r.current)==null||m.addEventListener("volumechange",u),()=>{var b;(b=r.current)==null||b.removeEventListener("volumechange",u)}},[r]),()=>{var u;return(u=r.current)==null?void 0:u.muted},()=>{}),d=G.useSyncExternalStore(l.useCallback(u=>{var m;return(m=r.current)==null||m.addEventListener("timeupdate",u),()=>{var b;(b=r.current)==null||b.removeEventListener("timeupdate",u)}},[r]),()=>{if(r.current)return Math.round(r.current.currentTime)},()=>{}),y=G.useSyncExternalStore(l.useCallback(u=>{var m;return(m=r.current)==null||m.addEventListener("durationchange",u),()=>{var b;(b=r.current)==null||b.removeEventListener("durationchange",u)}},[r]),()=>{var u;return(u=r.current)==null?void 0:u.duration},()=>{}),S=G.useSyncExternalStore(l.useCallback(u=>{var m;return(m=r.current)==null||m.addEventListener("progress",u),()=>{var b;(b=r.current)==null||b.removeEventListener("progress",u)}},[r]),()=>{const u=r.current;return u&&u.buffered.length>0?u.buffered.end(u.buffered.length-1):0},()=>{}),x=G.useSyncExternalStore(l.useCallback(u=>{var m,b;return(m=r.current)==null||m.addEventListener("play",u),(b=r.current)==null||b.addEventListener("pause",u),()=>{var j,O;(j=r.current)==null||j.removeEventListener("play",u),(O=r.current)==null||O.removeEventListener("pause",u)}},[r]),()=>{const u=r.current;return u?!u.paused:!1},()=>{}),g=G.useSyncExternalStore(l.useCallback(u=>{var m,b;return(m=r.current)==null||m.addEventListener("playing",u),(b=r.current)==null||b.addEventListener("waiting",u),()=>{var j,O;(j=r.current)==null||j.removeEventListener("playing",u),(O=r.current)==null||O.removeEventListener("waiting",u)}},[r]),()=>{const u=r.current;return u?u.networkState===u.NETWORK_LOADING:!1},()=>{});return{audio:r.current,playAudio:a,togglePlay:i,seek:c,toggleMuted:p,setVolume:E,volume:s,muted:f,currentTime:d,duration:y,bufferedSeconds:S,isPlaying:x,isLoading:g}}function Ct(e,r){return l.useMemo(()=>{const n={...r};for(const a in e)e[a]!==void 0&&(n[a]=e[a]);return n},[e,r])}function Pt(e){const[r,n]=l.useState(e);return l.useEffect(()=>{n(e)},[e]),{mini:r,setMini:n}}function dr(){const e=l.useRef([]);return l.useEffect(()=>{const n=e.current;return()=>{for(const a of n)clearTimeout(a)}},[]),l.useCallback((n,a)=>{const i=setTimeout(n,a);return e.current.push(i),i},[])}function Lt(){const e=l.useRef(),[r,n]=l.useState({text:"",style:{opacity:0}}),a=dr(),i=l.useCallback((c,p=2e3)=>{e.current&&clearTimeout(e.current),n({text:c,style:{opacity:1}}),e.current=a(()=>{n({text:c,style:{opacity:0}})},p)},[a]);return[r,i]}function $t(e){return Mt(e.slice())}function Mt(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 At(e,r){const{initialLoop:n="all",initialOrder:a="list"}=r,[i,c]=l.useState(n),[p,E]=l.useState(a),s=l.useMemo(()=>p==="list"?e:$t(e),[e,p]),[f,d]=l.useState(s[0]),y=l.useCallback(m=>m.url,[]),S=l.useMemo(()=>s.findIndex(b=>y(b)===y(f))<s.length-1||i!=="none",[s,f,i,y]),x=l.useCallback(()=>{d(m=>{const b=s.findIndex(j=>y(j)===y(m));return b<s.length-1?s[b+1]:{...s[0]}})},[i,s,y]),g=l.useCallback(()=>{d(m=>{const b=s.indexOf(m);return b>0?s[b-1]:m})},[s]),u=l.useCallback(m=>{d(m)},[]);return l.useEffect(()=>{const m=s.find(b=>y(b)===y(f));d(m||s[0])},[s,y,f]),{list:s,currentSong:f,hasNextSong:S,next:x,previous:g,prioritize:u,order:p,setOrder:E,loop:i,setLoop:c,length:s.length}}function kt(e){const r=Ct(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:c,volume:p,autoPlay:E,listMaxHeight:s,listFolded:f,mutex:d,theme:y,border:S}=r,x=l.useMemo(()=>Array.isArray(n)?n:[n],[n]),g=At(x,{initialLoop:i,initialOrder:c}),[u,m]=Lt(),{mini:b,setMini:j}=Pt(r.mini),O=dr(),P=l.useRef(),V=l.useCallback(()=>{P.current&&(clearTimeout(P.current),P.current=void 0)},[]),F=l.useRef(!1),N=Rt({src:g.currentSong.url,initialVolume:p,autoPlay:E,mutex:d,onError(D){const{error:J}=D.target;J&&m("An audio error has occurred, player will skip forward in 2 seconds."),g.hasNextSong&&(P.current=O(()=>{g.next()},2e3))},onEnded(){const{list:D,currentSong:J,loop:ne,prioritize:ae,hasNextSong:de}=g,{audio:ie}=N;if(ne==="one"){ae({...J});return}if(!de&&ne==="none"){F.current=!0,ie.currentTime=0,ie.pause(),ie.src=D[0].url,ae(D[0]);return}g.next()}}),U=g.length>1,M=l.useCallback(()=>{V(),N.togglePlay(g.currentSong.url)},[N,V,g.currentSong.url]),{prioritize:ce}=g,Se=l.useCallback(D=>{V(),ce(D)},[V,ce]),[fe,B]=l.useState(()=>U&&!f),[z,Y]=l.useState(!0),K=l.useRef(null);l.useEffect(()=>{E&&N.playAudio(g.currentSong.url)},[]);const re=l.useRef(!0),te=l.useRef(g.currentSong);return l.useEffect(()=>{if(re.current){re.current=!1;return}if(F.current){F.current=!1;return}g.currentSong&&(g.loop==="one"||g.currentSong!==te.current)&&(te.current=g.currentSong,N.playAudio(g.currentSong.url))},[g.currentSong]),l.useEffect(()=>{if(a==="fixed"&&K.current){const D=K.current;return D.style.width=`${D.offsetWidth-18}px`,()=>{D.removeAttribute("style")}}},[a]),{bodyRef:K,appearance:a,volume:p,listMaxHeight:s,theme:y,border:S,notice:u,audioControl:N,audio:x,handlePlayButtonClick:M,handlePlayAudioFromList:Se,isPlaylistOpen:fe,setPlaylistOpen:B,mini:b,displayLyrics:z,setDisplayLyrics:Y,setMini:j,playlist:g,hasPlaylist:U}}function Nt(e){var F,N,U;const r=W("aplayer"),{bodyRef:n,appearance:a,volume:i,listMaxHeight:c,theme:p,border:E,notice:s,audio:f,audioControl:d,handlePlayButtonClick:y,handlePlayAudioFromList:S,isPlaylistOpen:x,setPlaylistOpen:g,mini:u,displayLyrics:m,setDisplayLyrics:b,setMini:j,playlist:O,hasPlaylist:P}=kt(e),V=l.useCallback(M=>M?typeof M=="string"?M:M.url?v.jsx("a",{href:M.url,target:"_blank",rel:"noreferrer",children:M.name??"Audio artist"}):M.name??"Audio artist":"Audio artist",[]);return v.jsxs("div",{className:L(r.b(),{[r.bs(p)]:!0,[r.bs("vars")]:!0,[r.bm(a)]:!0,[r.bm("loading")]:d.isLoading,[r.bm("withlist")]:P,[r.bm("list-folded")]:!x,[r.bm("withlrc")]:!!O.currentSong.lrc&&a!=="fixed",[r.bm("narrow")]:u,[r.bm("border")]:E}),role:"region","aria-label":"Audio Player",children:[v.jsxs("div",{ref:n,className:r.be("body"),children:[v.jsx("div",{className:r.be("pic"),onClick:y,style:{backgroundImage:`url("${(F=O.currentSong)==null?void 0:F.cover}")`},role:"button","aria-label":d.isPlaying?"Pause audio":"Play audio",children:v.jsx("div",{className:L(r.be("button"),d.isPlaying?r.bm("pause"):r.bm("play")),role:"presentation",children:d.isPlaying?v.jsx(it,{}):v.jsx(bt,{})})}),v.jsxs("div",{className:L(r.be("info")),children:[v.jsxs("div",{className:L(r.be("music")),children:[v.jsx("span",{className:L(r.be("title")),children:((N=O.currentSong)==null?void 0:N.name)??"Audio name"}),v.jsxs("span",{className:L(r.be("author")),children:[" ","-"," ",V((U=O.currentSong)==null?void 0:U.artist)]})]}),a==="fixed"?null:v.jsx(ar,{show:m,lrcText:O.currentSong.lrc,currentTime:d.currentTime??0}),v.jsx(xt,{volume:d.volume??i,onChangeVolume:d.setVolume,muted:d.muted??!1,onToggleMuted:()=>d.toggleMuted(),currentTime:d.currentTime,audioDurationSeconds:d.duration,bufferedSeconds:d.bufferedSeconds,onSeek:M=>d.seek(M),onToggleMenu:()=>g(M=>!M),order:O.order,onOrderChange:O.setOrder,loop:O.loop,onLoopChange:O.setLoop,isPlaying:d.isPlaying??!1,onTogglePlay:y,onSkipForward:()=>{O.hasNextSong&&O.next()},onSkipBack:()=>{O.previous()},showLyrics:m,onToggleLyrics:()=>{b(M=>!M)}})]}),v.jsx("div",{className:r.be("notice"),style:s.style,children:s.text}),v.jsx("div",{className:r.be("miniswitcher"),onClick:()=>j(M=>!M),children:v.jsx("button",{className:L(r.bs("icon"),r.bs("icon-right")),type:"button",children:v.jsx(at,{})})})]}),P?v.jsx(St,{open:x,audio:f,playingAudioUrl:O.currentSong.url,onPlayAudio:S,listMaxHeight:c}):null,a==="fixed"&&v.jsx(ar,{show:m,lrcText:O.currentSong.lrc,currentTime:d.currentTime??0})]})}exports.TwistAPlayer=Nt;
|
|
45
|
+
*/var or;function wt(){return or||(or=1,process.env.NODE_ENV!=="production"&&function(){function e(x,g){return x===g&&(x!==0||1/x===1/g)||x!==x&&g!==g}function r(x,g){d||i.startTransition===void 0||(d=!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 u=g();if(!y){var m=g();l(u,m)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),y=!0)}m=p({inst:{value:u,getSnapshot:g}});var b=m[0].inst,j=m[1];return s(function(){b.value=u,b.getSnapshot=g,n(b)&&j({inst:b})},[x,u,g]),E(function(){return n(b)&&j({inst:b}),x(function(){n(b)&&j({inst:b})})},[x]),f(u),u}function n(x){var g=x.getSnapshot;x=x.value;try{var u=g();return!l(x,u)}catch{return!0}}function a(x,g){return g()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var i=c,l=typeof Object.is=="function"?Object.is:e,p=i.useState,E=i.useEffect,s=i.useLayoutEffect,f=i.useDebugValue,d=!1,y=!1,S=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?a:r;Me.useSyncExternalStore=i.useSyncExternalStore!==void 0?i.useSyncExternalStore:S,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Me}var ur;function jt(){return ur||(ur=1,process.env.NODE_ENV==="production"?Ee.exports=Tt():Ee.exports=wt()),Ee.exports}var G=jt();const Z=[];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),Z.includes(n)||Z.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=Z.indexOf(n);a!==-1&&Z.splice(a,1)}r.current=void 0},[]),r}function Rt(e){const r=Ot(e),n=c.useCallback(u=>{for(let m=0;m<Z.length;m++){const b=Z[m];b!==u&&!b.paused&&b.pause()}},[]),a=c.useCallback(async u=>{var b;const m=r.current;if(m){e.mutex&&n(m),m.src!==u&&(m.pause(),m.currentTime=0,m.src=u);try{await((b=r.current)==null?void 0:b.play())}catch{}}},[r,e.mutex,n]),i=c.useCallback(u=>{const m=r.current;m&&(m.paused?a(u):m.pause())},[r,a]),l=c.useCallback(u=>{r.current.currentTime=u},[r]),p=c.useCallback(()=>{r.current&&(r.current.muted=!r.current.muted)},[r]),E=c.useCallback(u=>{r.current&&(r.current.volume=u)},[r]),s=G.useSyncExternalStore(c.useCallback(u=>{var m;return(m=r.current)==null||m.addEventListener("volumechange",u),()=>{var b;(b=r.current)==null||b.removeEventListener("volumechange",u)}},[r]),()=>{var u;return(u=r.current)==null?void 0:u.volume},()=>{}),f=G.useSyncExternalStore(c.useCallback(u=>{var m;return(m=r.current)==null||m.addEventListener("volumechange",u),()=>{var b;(b=r.current)==null||b.removeEventListener("volumechange",u)}},[r]),()=>{var u;return(u=r.current)==null?void 0:u.muted},()=>{}),d=G.useSyncExternalStore(c.useCallback(u=>{var m;return(m=r.current)==null||m.addEventListener("timeupdate",u),()=>{var b;(b=r.current)==null||b.removeEventListener("timeupdate",u)}},[r]),()=>{if(r.current)return Math.round(r.current.currentTime)},()=>{}),y=G.useSyncExternalStore(c.useCallback(u=>{var m;return(m=r.current)==null||m.addEventListener("durationchange",u),()=>{var b;(b=r.current)==null||b.removeEventListener("durationchange",u)}},[r]),()=>{var u;return(u=r.current)==null?void 0:u.duration},()=>{}),S=G.useSyncExternalStore(c.useCallback(u=>{var m;return(m=r.current)==null||m.addEventListener("progress",u),()=>{var b;(b=r.current)==null||b.removeEventListener("progress",u)}},[r]),()=>{const u=r.current;return u&&u.buffered.length>0?u.buffered.end(u.buffered.length-1):0},()=>{}),x=G.useSyncExternalStore(c.useCallback(u=>{var m,b;return(m=r.current)==null||m.addEventListener("play",u),(b=r.current)==null||b.addEventListener("pause",u),()=>{var j,O;(j=r.current)==null||j.removeEventListener("play",u),(O=r.current)==null||O.removeEventListener("pause",u)}},[r]),()=>{const u=r.current;return u?!u.paused:!1},()=>{}),g=G.useSyncExternalStore(c.useCallback(u=>{var m,b;return(m=r.current)==null||m.addEventListener("playing",u),(b=r.current)==null||b.addEventListener("waiting",u),()=>{var j,O;(j=r.current)==null||j.removeEventListener("playing",u),(O=r.current)==null||O.removeEventListener("waiting",u)}},[r]),()=>{const u=r.current;return u?u.networkState===u.NETWORK_LOADING:!1},()=>{});return{audio:r.current,playAudio:a,togglePlay:i,seek:l,toggleMuted:p,setVolume:E,volume:s,muted:f,currentTime:d,duration:y,bufferedSeconds:S,isPlaying:x,isLoading:g}}function Ct(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 Pt(e){const[r,n]=c.useState(e);return c.useEffect(()=>{n(e)},[e]),{mini:r,setMini:n}}function dr(){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 Lt(){const e=c.useRef(),[r,n]=c.useState({text:"",style:{opacity:0}}),a=dr(),i=c.useCallback((l,p=2e3)=>{e.current&&clearTimeout(e.current),n({text:l,style:{opacity:1}}),e.current=a(()=>{n({text:l,style:{opacity:0}})},p)},[a]);return[r,i]}function $t(e){return Mt(e.slice())}function Mt(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 At(e,r){const{initialLoop:n="all",initialOrder:a="list"}=r,[i,l]=c.useState(n),[p,E]=c.useState(a),s=c.useMemo(()=>p==="list"?e:$t(e),[e,p]),[f,d]=c.useState(s[0]),y=c.useCallback(m=>m.url,[]),S=c.useMemo(()=>s.findIndex(b=>y(b)===y(f))<s.length-1||i!=="none",[s,f,i,y]),x=c.useCallback(()=>{d(m=>{const b=s.findIndex(j=>y(j)===y(m));return b<s.length-1?s[b+1]:{...s[0]}})},[i,s,y]),g=c.useCallback(()=>{d(m=>{const b=s.indexOf(m);return b>0?s[b-1]:m})},[s]),u=c.useCallback(m=>{d(m)},[]);return c.useEffect(()=>{const m=s.find(b=>y(b)===y(f));d(m||s[0])},[s,y,f]),{list:s,currentSong:f,hasNextSong:S,next:x,previous:g,prioritize:u,order:p,setOrder:E,loop:i,setLoop:l,length:s.length}}function kt(e){const r=Ct(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:l,volume:p,autoPlay:E,listMaxHeight:s,listFolded:f,mutex:d,theme:y,border:S}=r,x=c.useMemo(()=>Array.isArray(n)?n:[n],[n]),g=At(x,{initialLoop:i,initialOrder:l}),[u,m]=Lt(),{mini:b,setMini:j}=Pt(r.mini),O=dr(),P=c.useRef(),V=c.useCallback(()=>{P.current&&(clearTimeout(P.current),P.current=void 0)},[]),F=c.useRef(!1),N=Rt({src:g.currentSong.url,initialVolume:p,autoPlay:E,mutex:d,onError(D){const{error:J}=D.target;J&&m("An audio error has occurred, player will skip forward in 2 seconds."),g.hasNextSong&&(P.current=O(()=>{g.next()},2e3))},onEnded(){const{list:D,currentSong:J,loop:ne,prioritize:ae,hasNextSong:de}=g,{audio:ie}=N;if(ne==="one"){ae({...J});return}if(!de&&ne==="none"){F.current=!0,ie.currentTime=0,ie.pause(),ie.src=D[0].url,ae(D[0]);return}g.next()}}),U=g.length>1,M=c.useCallback(()=>{V(),N.togglePlay(g.currentSong.url)},[N,V,g.currentSong.url]),{prioritize:ce}=g,Se=c.useCallback(D=>{V(),ce(D)},[V,ce]),[fe,B]=c.useState(()=>U&&!f),[z,Y]=c.useState(!0),K=c.useRef(null);c.useEffect(()=>{E&&N.playAudio(g.currentSong.url)},[]);const re=c.useRef(!0),te=c.useRef(g.currentSong);return c.useEffect(()=>{if(re.current){re.current=!1;return}if(F.current){F.current=!1;return}g.currentSong&&(g.loop==="one"||g.currentSong!==te.current)&&(te.current=g.currentSong,N.playAudio(g.currentSong.url))},[g.currentSong]),c.useEffect(()=>{if(a==="fixed"&&K.current){const D=K.current;return D.style.width=`${D.offsetWidth-18}px`,()=>{D.removeAttribute("style")}}},[a]),{bodyRef:K,appearance:a,volume:p,listMaxHeight:s,theme:y,border:S,notice:u,audioControl:N,audio:x,handlePlayButtonClick:M,handlePlayAudioFromList:Se,isPlaylistOpen:fe,setPlaylistOpen:B,mini:b,displayLyrics:z,setDisplayLyrics:Y,setMini:j,playlist:g,hasPlaylist:U}}function Nt(e){var F,N,U;const r=W("aplayer"),{bodyRef:n,appearance:a,volume:i,listMaxHeight:l,theme:p,border:E,notice:s,audio:f,audioControl:d,handlePlayButtonClick:y,handlePlayAudioFromList:S,isPlaylistOpen:x,setPlaylistOpen:g,mini:u,displayLyrics:m,setDisplayLyrics:b,setMini:j,playlist:O,hasPlaylist:P}=kt(e),V=c.useCallback(M=>M?typeof M=="string"?M:M.url?v.jsx("a",{href:M.url,target:"_blank",rel:"noreferrer",children:M.name??"Audio artist"}):M.name??"Audio artist":"Audio artist",[]);return v.jsxs("div",{className:L(r.b(),{[r.bs(p)]:!0,[r.bs("vars")]:!0,[r.bm(a)]:!0,[r.bm("loading")]:d.isLoading,[r.bm("withlist")]:P,[r.bm("list-folded")]:!x,[r.bm("withlrc")]:!!O.currentSong.lrc&&a!=="fixed",[r.bm("narrow")]:u,[r.bm("border")]:E}),role:"region","aria-label":"Audio Player",children:[v.jsxs("div",{ref:n,className:r.be("body"),children:[v.jsx("div",{className:r.be("pic"),onClick:y,style:{backgroundImage:`url("${(F=O.currentSong)==null?void 0:F.cover}")`},role:"button","aria-label":d.isPlaying?"Pause audio":"Play audio",children:v.jsx("div",{className:L(r.be("button"),d.isPlaying?r.bm("pause"):r.bm("play")),role:"presentation",children:d.isPlaying?v.jsx(it,{}):v.jsx(bt,{})})}),v.jsxs("div",{className:L(r.be("info")),children:[v.jsxs("div",{className:L(r.be("music")),children:[v.jsx("span",{className:L(r.be("title")),children:((N=O.currentSong)==null?void 0:N.name)??"Audio name"}),v.jsxs("span",{className:L(r.be("author")),children:[" ","-"," ",V((U=O.currentSong)==null?void 0:U.artist)]})]}),a==="fixed"?null:v.jsx(ar,{show:m,lrcText:O.currentSong.lrc,currentTime:d.currentTime??0}),v.jsx(xt,{volume:d.volume??i,onChangeVolume:d.setVolume,muted:d.muted??!1,onToggleMuted:()=>d.toggleMuted(),currentTime:d.currentTime,audioDurationSeconds:d.duration,bufferedSeconds:d.bufferedSeconds,onSeek:M=>d.seek(M),onToggleMenu:()=>g(M=>!M),order:O.order,onOrderChange:O.setOrder,loop:O.loop,onLoopChange:O.setLoop,isPlaying:d.isPlaying??!1,onTogglePlay:y,onSkipForward:()=>{O.hasNextSong&&O.next()},onSkipBack:()=>{O.previous()},showLyrics:m,onToggleLyrics:()=>{b(M=>!M)}})]}),v.jsx("div",{className:r.be("notice"),style:s.style,children:s.text}),v.jsx("div",{className:r.be("miniswitcher"),onClick:()=>j(M=>!M),children:v.jsx("button",{className:L(r.bs("icon"),r.bs("icon-right")),type:"button",children:v.jsx(at,{})})})]}),P?v.jsx(St,{open:x,audio:f,playingAudioUrl:O.currentSong.url,onPlayAudio:S,listMaxHeight:l}):null,a==="fixed"&&v.jsx(ar,{show:m,lrcText:O.currentSong.lrc,currentTime:d.currentTime??0})]})}exports.TwistAPlayer=Nt;
|
package/dist/index.min.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.twist-aplayer-icon{width:var(--tp-icon-width);height:var(--tp-icon-width);border:none;background-color:transparent;outline:none;cursor:pointer;opacity:.8;vertical-align:middle;padding:0;font-size:var(--tp-icon-font-size);margin:0;display:inline-block}.twist-aplayer-icon path{transition:all var(--tp-icon-transition-timing) var(--tp-icon-transition-function)}.twist-aplayer .twist-aplayer-icon-lrc-inactivity svg{opacity:.4}.twist-aplayer.twist-aplayer--fixed .twist-aplayer-icon-right{display:flex;justify-content:center;align-items:center}.twist-aplayer.twist-aplayer--fixed .twist-aplayer-icon-back,.twist-aplayer.twist-aplayer--fixed .twist-aplayer-icon-forward,.twist-aplayer.twist-aplayer--fixed .twist-aplayer-icon-lrc,.twist-aplayer.twist-aplayer--fixed .twist-aplayer-icon-play{display:inline-block}.twist-aplayer.twist-aplayer--fixed .twist-aplayer-icon-back,.twist-aplayer.twist-aplayer--fixed .twist-aplayer-icon-forward,.twist-aplayer.twist-aplayer--fixed .twist-aplayer-icon-menu,.twist-aplayer.twist-aplayer--fixed .twist-aplayer-icon-play{position:absolute;bottom:27px;width:20px;height:20px;font-size:20px}.twist-aplayer.twist-aplayer--fixed .twist-aplayer-icon-back{right:75px}.twist-aplayer.twist-aplayer--fixed .twist-aplayer-icon-play{right:50px}.twist-aplayer.twist-aplayer--fixed .twist-aplayer-icon-forward{right:25px}.twist-aplayer.twist-aplayer--fixed .twist-aplayer-icon-menu{right:0%}.twist-aplayer--withlist .twist-aplayer-icon-order,.twist-aplayer--withlist .twist-aplayer-icon-menu{display:inline}.twist-aplayer--fixed.twist-aplayer--narrow .twist-aplayer-icon{transform:rotateY(0)}@keyframes rotate{0%{transform:rotate(0)}to{transform:rotate(1turn)}}.twist-aplayer-bar{margin:0 0 0 5px;padding:4px 0;cursor:pointer!important;flex:1;transition:all .2s ease-in-out}.twist-aplayer-bar-vars{--tp-bar-width: 100%;--tp-bar-height: 2px;--tp-bar-background: hsl(var(--tp-primary) / .2);--tp-bar-played-background: hsl(var(--tp-accent-foreground));--tp-bar-loaded-background: hsl(var(--tp-secondary));--tp-bar-loaded-transition-timing: .5s;--tp-bar-loaded-transition-function: ease;--tp-bar-thumb-width: 10px;--tp-bar-thumb-height: 10px;--tp-bar-thumb-margin-top: -4px;--tp-bar-thumb-margin-right: -10px;--tp-bar-thumb-transition-function: ease-in-out;--tp-bar-thumb-transition-timing: .3s;--tp-bar-thumb-hover-scale: 1;--tp-bar-thumb-border-radius: 50%;--tp-bar-thumb-background: hsl(var(--tp-foreground))}.twist-aplayer-bar__inner{position:relative;width:var(--tp-bar-width);height:var(--tp-bar-height);background:var(--tp-bar-background)}.twist-aplayer-bar__loaded{position:absolute;left:0;top:0;bottom:0;height:var(--tp-bar-height);background:var(--tp-bar-loaded-background);transition:all var(--tp-bar-loaded-transition-timing) var(--tp-bar-loaded-transition-function)}.twist-aplayer-bar__played{position:absolute;left:0;top:0;bottom:0;height:var(--tp-bar-height);background-color:var(--tp-bar-played-background)}.twist-aplayer-bar__thumb{position:absolute;top:0;right:5px;margin-top:var(--tp-bar-thumb-margin-top);margin-right:var(--tp-bar-thumb-margin-right);width:var(--tp-bar-thumb-width);height:var(--tp-bar-thumb-height);border-radius:var(--tp-bar-thumb-border-radius);cursor:pointer;background-color:var(--tp-bar-thumb-background);transition:all var(--tp-bar-thumb-transition-timing) var(--tp-bar-thumb-transition-function);transform:scale(0);-webkit-transform:scale(0)}.twist-aplayer-bar:hover .twist-aplayer-bar__thumb{transform:scale(var(--tp-bar-thumb-hover-scale));-webkit-transform:scale(var(--tp-bar-thumb-hover-scale))}.twist-aplayer-volumn{position:relative;display:inline-block;margin-left:3px;cursor:pointer!important}.twist-aplayer-volumn-vars{--tp-volume-bar-background: hsl(var(--tp-primary) / .3);--tp-volume-bar-width: 5px;--tp-volume-bar-height: 35px;--tp-volume-bar-border-radius: 2.5px;--tp-volume-thumb-width: 5px;--tp-volume-thumb-background: hsl(var(--tp-primary));--tp-volume-thumb-transition-function: ease;--tp-volume-bar-wrap-transition-function: ease-in-out;--tp-volume-bar-wrap-timing: .2s;--tp-volume-thumb-timing: .1s}.twist-aplayer-volumn__bar-wrap{position:absolute;bottom:15px;right:-3px;width:25px;height:0;z-index:99;overflow:hidden;transition:all var(--tp-volume-bar-wrap-timing) var(--tp-volume-bar-wrap-transition-function)}.twist-aplayer-volumn:hover .twist-aplayer-volumn__bar-wrap,.twist-aplayer-volumn__bar-wrap--active{height:40px}.twist-aplayer-volumn__bar{position:absolute;bottom:0;right:10px;width:var(--tp-volume-bar-width);height:var(--tp-volume-bar-height);background:var(--tp-volume-bar-background);border-radius:var(--tp-volume-bar-border-radius);overflow:hidden}.twist-aplayer-volumn__thumb{position:absolute;bottom:0;right:0;width:var(--tp-volume-thumb-width);background-color:var(--tp-volume-thumb-background);transition:all var(--tp-volume-thumb-timing) var(--tp-volume-thumb-transition-function)}.twist-aplayer-list{overflow:auto;transition:all .5s ease;will-change:height;display:none;overflow:hidden}.twist-aplayer-list--hide{max-height:0!important}.twist-aplayer-list ol{list-style-type:none;margin:0;padding:0;overflow-y:auto}.twist-aplayer-list ol li{position:relative;height:32px;line-height:32px;padding:0 15px;font-size:12px;border-top:1px solid hsl(var(--tp-border));cursor:pointer;transition:all .2s ease;overflow:hidden;margin:0;background-color:hsl(var(--tp-background))}.twist-aplayer-list ol li.twist-aplayer-list--active{background-color:hsl(var(--tp-secondary))}.twist-aplayer-list ol li:first-child{border:none}.twist-aplayer-list__cur{display:none;width:3px;height:22px;position:absolute;left:0;top:5px;cursor:pointer;background-color:hsl(var(--tp-accent-foreground))}.twist-aplayer-list--active .twist-aplayer-list__cur{display:inline-block}.twist-aplayer-list__index{color:hsl(var(--tp-muted-foreground));margin-right:12px;cursor:pointer}.twist-aplayer-list__title{color:hsl(var(--tp-secondary-foreground))}.twist-aplayer-list__author{color:hsl(var(--tp-muted-foreground));float:right;cursor:pointer}.twist-aplayer-lrc{display:none;position:relative;height:30px;text-align:center;overflow:hidden;margin:-10px 0 7px}.twist-aplayer-lrc:after,.twist-aplayer-lrc:before{content:" ";position:absolute;z-index:1;display:block;overflow:hidden;width:100%}.twist-aplayer-lrc:before{top:0;height:10%;background:linear-gradient(180deg,hsl(var(--tp-background)) 0,#fff0);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ffffff",endColorstr="#00ffffff",GradientType=0)}.twist-aplayer-lrc:after{bottom:0;height:33%;background:linear-gradient(180deg,#fff0 0,hsl(var(--tp-background)));filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#00ffffff",endColorstr="#ccffffff",GradientType=0)}.twist-aplayer-lrc p{font-size:12px;color:hsl(var(--tp-secondary-foreground));line-height:16px!important;height:16px!important;padding:0!important;margin:0!important;transition:all .5s ease-out;opacity:.4;overflow:hidden;text-shadow:none}.twist-aplayer-lrc__contents{width:100%;transition:all .5s ease-out;-webkit-user-select:text;-moz-user-select:text;user-select:text;cursor:default}.twist-aplayer-lrc p.twist-aplayer-lrc__current{opacity:1;overflow:visible;height:auto!important;min-height:16px}.twist-aplayer-lrc.twist-aplayer-lrc--hide{display:none}.twist-aplayer-light{--tp-background: 0 0% 100%;--tp-foreground: 240 10% 3.9%;--tp-card: 0 0% 100%;--tp-card-foreground: 240 10% 3.9%;--tp-primary: 240 5.9% 10%;--tp-primary-foreground: 0 0% 98%;--tp-secondary: 240 4.8% 95.9%;--tp-secondary-foreground: 240 5.9% 10%;--tp-muted: 240 4.8% 95.9%;--tp-muted-foreground: 240 3.8% 46.1%;--tp-accent: 240 4.8% 95.9%;--tp-accent-foreground: 240 5.9% 10%;--tp-border: 240 5.9% 90%}.twist-aplayer-dark{--tp-background: 240 10% 3.9%;--tp-foreground: 0 0% 98%;--tp-card: 240 10% 3.9%;--tp-card-foreground: 0 0% 98%;--tp-primary: 0 0% 98%;--tp-primary-foreground: 240 5.9% 10%;--tp-secondary: 240 3.7% 15.9%;--tp-secondary-foreground: 0 0% 98%;--tp-muted: 240 3.7% 15.9%;--tp-muted-foreground: 240 5% 64.9%;--tp-accent: 240 3.7% 15.9%;--tp-accent-foreground: 0 0% 98%;--tp-border: 240 3.7% 15.9%}.twist-aplayer-vars{--tp-icon-width: 15px;--tp-icon-height: 15px;--tp-icon-font-size: 15px;--tp-icon-transition-function: ease-in-out;--tp-icon-transition-timing: .2s;--tp-max-width: 400px;--tp-zIndex: 99;--tp-pic-width: 66px;--tp-pic-height: 66px;--tp-pic-transition-function: ease;--tp-pic-transition-timing: .3s;--tp-button-background: rgba(0, 0, 0, .2);--tp-box-shadow: 0 0 #0000, 0 0 #0000, 0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tp-user-border: hsl(var(--tp-border) / .3)}.twist-aplayer{font-family:Arial,Helvetica,sans-serif;-webkit-user-select:none;-moz-user-select:none;user-select:none;line-height:normal;border-radius:2px;margin:5px;box-shadow:var(--tp-box-shadow);overflow:hidden}.twist-aplayer *{box-sizing:content-box}.twist-aplayer__body{background-color:hsl(var(--tp-background))}.twist-aplayer__pic{position:relative;float:left;width:var(--tp-pic-width);height:var(--tp-pic-height);background-size:cover;background-position:50%;transition:all var(--tp-pic-transition-timing) var(--tp-pic-transition-function);cursor:pointer}.twist-aplayer__button{position:absolute;border-radius:50%;opacity:.8;text-shadow:0 1px 1px rgba(0,0,0,.2);box-shadow:0 1px 1px #0003;background:hsl(var(--tp-primary-foreground));transition:all .1s ease}.twist-aplayer--play{width:28px;height:28px;bottom:50%;right:50%;margin:0 -15px -15px 0}.twist-aplayer--play svg{position:absolute;top:4px;left:5px;height:20px;width:20px}.twist-aplayer--pause{font-size:12px;width:18px;height:18px;bottom:4px;right:4px}.twist-aplayer--pause svg{position:absolute;top:3px;left:3px;height:12px;width:12px}.twist-aplayer--play path,.twist-aplayer--pause path{fill:hsl(var(--tp-accent-foreground))}.twist-aplayer__info{margin-left:66px;padding:14px 7px 0 10px;height:66px;box-sizing:border-box}.twist-aplayer__music{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin:0 0 13px 5px;-webkit-user-select:text;-moz-user-select:text;user-select:text;cursor:default;padding-bottom:2px;height:20px}.twist-aplayer__title{color:hsl(var(--tp-secondary-foreground));font-size:14px}.twist-aplayer__author{font-size:12px;color:hsl(var(--tp-muted-foreground))}.twist-aplayer__author>a{color:inherit;text-decoration:none}.twist-aplayer-controller{position:relative;display:flex}.twist-aplayer-controller__time{position:relative;right:0;bottom:4px;height:17px;font-size:11px;padding-left:7px}.twist-aplayer-controller__time-inner{color:hsl(var(--tp-muted-foreground));vertical-align:middle}.twist-aplayer-controller__time .twist-aplayer-icon{cursor:pointer;transition:all .2s ease}.twist-aplayer-controller__time .twist-aplayer-icon path{fill:hsl(var(--tp-muted-foreground))}.twist-aplayer-controller__time .twist-aplayer-icon:hover path{fill:hsl(var(--tp-primary))}.twist-aplayer__notice{opacity:0;position:absolute;top:50%;left:50%;z-index:100;transform:translate(-50%,-50%);font-size:12px;border-radius:4px;padding:5px 10px;transition:all .3s ease-in-out;overflow:hidden;pointer-events:none;background-color:hsl(var(--tp-accent));color:hsl(var(--tp-accent-foreground))}.twist-aplayer__miniswitcher{display:none;position:absolute;top:0;right:0;bottom:0;height:100%;background:hsl(var(--tp-accent));width:18px;border-radius:0 2px 2px 0}.twist-aplayer__miniswitcher .twist-aplayer-icon{height:100%;width:100%;transform:rotateY(180deg);transition:all .3s ease}.twist-aplayer__miniswitcher .twist-aplayer-icon path{fill:hsl(var(--tp-muted-foreground))}.twist-aplayer-icon-lrc-inactivity svg{opacity:.4}.twist-aplayer-icon-loading{display:none}.twist-aplayer-icon-loading svg{position:absolute;top:1px;left:1px;width:8px;height:8px;animation:rotate 1s linear infinite}.twist-aplayer-icon-loading svg path{fill:hsl(var(--tp-background))}.twist-aplayer-icon-back,.twist-aplayer-icon-forward,.twist-aplayer-icon-lrc,.twist-aplayer-icon-order,.twist-aplayer-icon-play{display:none}.twist-aplayer--border{border:1px solid var(--tp-user-border)}.twist-aplayer.twist-aplayer--fixed{position:fixed;bottom:0;left:0;right:0;margin:0;z-index:var(--tp-zIndex);overflow:visible;max-width:var(--tp-max-width);box-shadow:none}.twist-aplayer.twist-aplayer--fixed .twist-aplayer__body{position:fixed;bottom:0;left:0;right:0;margin:0;z-index:99;padding-right:18px;transition:all .3s ease;max-width:400px}.twist-aplayer.twist-aplayer--fixed .twist-aplayer__info{transform:scaleX(1);transform-origin:0 0;transition:all .3s ease;border-bottom:none;border-top:1px solid hsl(var(--tp-border))}.twist-aplayer.twist-aplayer--fixed .twist-aplayer-list{margin-bottom:65px;border:1px solid hsl(var(--tp-border));border-bottom:none}.twist-aplayer.twist-aplayer--fixed .twist-aplayer__music{width:calc(100% - 105px)}.twist-aplayer.twist-aplayer--fixed .twist-aplayer.twist-aplayer--border.twist-aplayer--list-folded .twist-aplayer__info,.twist-aplayer.twist-aplayer--fixed .twist-aplayer--list-folded .twist-aplayer__info{border-top:none}.twist-aplayer.twist-aplayer--fixed .twist-aplayer--border.twist-aplayer--list-folded .twist-aplayer__info,.twist-aplayer.twist-aplayer--fixed .twist-aplayer--list-folded .twist-aplayer__info{border-bottom:none}.twist-aplayer.twist-aplayer--fixed .twist-aplayer-lrc{display:block;position:fixed;bottom:10px;left:0;right:0;margin:0;z-index:98;pointer-events:none;text-shadow:-1px -1px 0 #fff}.twist-aplayer.twist-aplayer--fixed .twist-aplayer-lrc:after,.twist-aplayer.twist-aplayer--fixed .twist-aplayer-lrc:before{display:none}.twist-aplayer.twist-aplayer--fixed .twist-aplayer-lrc.twist-aplayer-lrc--hide{display:none}.twist-aplayer.twist-aplayer--fixed .twist-aplayer__miniswitcher{display:block}.twist-aplayer.twist-aplayer--fixed .twist-aplayer-list--hide.twist-aplayer-list{border-top:none}.twist-aplayer.twist-aplayer--fixed.twist-aplayer--narrow{width:66px}.twist-aplayer.twist-aplayer--fixed.twist-aplayer--narrow .twist-aplayer__info,.twist-aplayer.twist-aplayer--fixed.twist-aplayer--narrow .twist-aplayer-list{display:none}.twist-aplayer.twist-aplayer--fixed.twist-aplayer--narrow .twist-aplayer__body,.twist-aplayer.twist-aplayer--fixed.twist-aplayer--narrow .twist-aplayer__pic{width:66px!important;height:66px!important}.twist-aplayer.twist-aplayer--withlist .twist-aplayer-list{display:block}.twist-aplayer.twist-aplayer--withlist .twist-aplayer__info{border-bottom:1px solid hsl(var(--tp-border))}.twist-aplayer.twist-aplayer--withlrc .twist-aplayer__info{margin-left:90px;height:90px;padding:10px 7px 0}.twist-aplayer.twist-aplayer--withlrc .twist-aplayer__pic{width:90px;height:90px}.twist-aplayer.twist-aplayer--withlrc .twist-aplayer-lrc,.twist-aplayer--loading .twist-aplayer-icon-loading{display:block}.twist-aplayer--normal.twist-aplayer--border.twist-aplayer--list-folded .twist-aplayer__info,.twist-aplayer--withlist.twist-aplayer--list-folded .twist-aplayer__info{border-bottom:none}
|
|
1
|
+
.twist-aplayer-icon{width:var(--tp-icon-width);height:var(--tp-icon-width);border:none;background-color:transparent;outline:none;cursor:pointer;opacity:.8;vertical-align:middle;padding:0;font-size:var(--tp-icon-font-size);margin:0;display:inline-block}.twist-aplayer-icon path{transition:all var(--tp-icon-transition-timing) var(--tp-icon-transition-function)}.twist-aplayer .twist-aplayer-icon-lrc-inactivity svg{opacity:.4}.twist-aplayer.twist-aplayer--fixed .twist-aplayer-icon-right{display:flex;justify-content:center;align-items:center}.twist-aplayer.twist-aplayer--fixed .twist-aplayer-icon-back,.twist-aplayer.twist-aplayer--fixed .twist-aplayer-icon-forward,.twist-aplayer.twist-aplayer--fixed .twist-aplayer-icon-lrc,.twist-aplayer.twist-aplayer--fixed .twist-aplayer-icon-play{display:inline-block}.twist-aplayer.twist-aplayer--fixed .twist-aplayer-icon-back,.twist-aplayer.twist-aplayer--fixed .twist-aplayer-icon-forward,.twist-aplayer.twist-aplayer--fixed .twist-aplayer-icon-menu,.twist-aplayer.twist-aplayer--fixed .twist-aplayer-icon-play{position:absolute;bottom:27px;width:20px;height:20px;font-size:20px}.twist-aplayer.twist-aplayer--fixed .twist-aplayer-icon-back{right:75px}.twist-aplayer.twist-aplayer--fixed .twist-aplayer-icon-play{right:50px}.twist-aplayer.twist-aplayer--fixed .twist-aplayer-icon-forward{right:25px}.twist-aplayer.twist-aplayer--fixed .twist-aplayer-icon-menu{right:0%}.twist-aplayer--withlist .twist-aplayer-icon-order,.twist-aplayer--withlist .twist-aplayer-icon-menu{display:inline}.twist-aplayer--fixed.twist-aplayer--narrow .twist-aplayer-icon{transform:rotateY(0)}@keyframes rotate{0%{transform:rotate(0)}to{transform:rotate(1turn)}}.twist-aplayer-bar{margin:0 0 0 5px;padding:4px 0;cursor:pointer!important;flex:1;transition:all .2s ease-in-out}.twist-aplayer-bar-vars{--tp-bar-width: 100%;--tp-bar-height: 2px;--tp-bar-background: hsl(var(--tp-primary) / .2);--tp-bar-played-background: hsl(var(--tp-accent-foreground));--tp-bar-loaded-background: hsl(var(--tp-secondary));--tp-bar-loaded-transition-timing: .5s;--tp-bar-loaded-transition-function: ease;--tp-bar-thumb-width: 10px;--tp-bar-thumb-height: 10px;--tp-bar-thumb-margin-top: -4px;--tp-bar-thumb-margin-right: -10px;--tp-bar-thumb-transition-function: ease-in-out;--tp-bar-thumb-transition-timing: .3s;--tp-bar-thumb-hover-scale: 1;--tp-bar-thumb-border-radius: 50%;--tp-bar-thumb-background: hsl(var(--tp-foreground))}.twist-aplayer-bar__inner{position:relative;width:var(--tp-bar-width);height:var(--tp-bar-height);background:var(--tp-bar-background)}.twist-aplayer-bar__loaded{position:absolute;left:0;top:0;bottom:0;height:var(--tp-bar-height);background:var(--tp-bar-loaded-background);transition:all var(--tp-bar-loaded-transition-timing) var(--tp-bar-loaded-transition-function)}.twist-aplayer-bar__played{position:absolute;left:0;top:0;bottom:0;height:var(--tp-bar-height);background-color:var(--tp-bar-played-background)}.twist-aplayer-bar__thumb{position:absolute;top:0;right:5px;margin-top:var(--tp-bar-thumb-margin-top);margin-right:var(--tp-bar-thumb-margin-right);width:var(--tp-bar-thumb-width);height:var(--tp-bar-thumb-height);border-radius:var(--tp-bar-thumb-border-radius);cursor:pointer;background-color:var(--tp-bar-thumb-background);transition:all var(--tp-bar-thumb-transition-timing) var(--tp-bar-thumb-transition-function);transform:scale(0);-webkit-transform:scale(0)}.twist-aplayer-bar:hover .twist-aplayer-bar__thumb{transform:scale(var(--tp-bar-thumb-hover-scale));-webkit-transform:scale(var(--tp-bar-thumb-hover-scale))}.twist-aplayer-volumn{position:relative;display:inline-block;margin-left:3px;cursor:pointer!important}.twist-aplayer-volumn-vars{--tp-volume-bar-background: hsl(var(--tp-primary) / .3);--tp-volume-bar-width: 5px;--tp-volume-bar-height: 35px;--tp-volume-bar-border-radius: 2.5px;--tp-volume-thumb-width: 5px;--tp-volume-thumb-background: hsl(var(--tp-primary));--tp-volume-thumb-transition-function: ease;--tp-volume-bar-wrap-transition-function: ease-in-out;--tp-volume-bar-wrap-timing: .2s;--tp-volume-thumb-timing: .1s}.twist-aplayer-volumn__bar-wrap{position:absolute;bottom:15px;right:-3px;width:25px;height:0;z-index:99;overflow:hidden;transition:all var(--tp-volume-bar-wrap-timing) var(--tp-volume-bar-wrap-transition-function)}.twist-aplayer-volumn:hover .twist-aplayer-volumn__bar-wrap,.twist-aplayer-volumn__bar-wrap--active{height:40px}.twist-aplayer-volumn__bar{position:absolute;bottom:0;right:10px;width:var(--tp-volume-bar-width);height:var(--tp-volume-bar-height);background:var(--tp-volume-bar-background);border-radius:var(--tp-volume-bar-border-radius);overflow:hidden}.twist-aplayer-volumn__thumb{position:absolute;bottom:0;right:0;width:var(--tp-volume-thumb-width);background-color:var(--tp-volume-thumb-background);transition:all var(--tp-volume-thumb-timing) var(--tp-volume-thumb-transition-function)}.twist-aplayer-list{overflow:auto;transition:all .5s ease;will-change:height;display:none;overflow:hidden}.twist-aplayer-list-vars{--tp-list-scrollbar-thumb-color: #8884;--tp-list-scrollbar-thumb-hover-color: hsl(var(--tp-muted-foreground) / .6)}.twist-aplayer-list--hide{max-height:0!important}.twist-aplayer-list ol{list-style-type:none;margin:0;padding:0;overflow-y:auto}.twist-aplayer-list ol li{position:relative;height:32px;line-height:32px;padding:0 15px;font-size:12px;border-top:1px solid hsl(var(--tp-border));cursor:pointer;transition:all .2s ease;overflow:hidden;margin:0;background-color:hsl(var(--tp-background))}.twist-aplayer-list ol li.twist-aplayer-list--active{background-color:hsl(var(--tp-secondary))}.twist-aplayer-list ol li:first-child{border:none}.twist-aplayer-list ol li:hover{background-color:hsl(var(--tp-secondary)/.8)}.twist-aplayer-list ol::-webkit-scrollbar{width:5px}.twist-aplayer-list ol::-webkit-scrollbar-thumb{border-radius:3px;background-color:var(--tp-list-scrollbar-thumb-color)}.twist-aplayer-list ol::-webkit-scrollbar-thumb:hover{background-color:var(--tp-list-scrollbar-thumb-hover-color)}.twist-aplayer-list__cur{display:none;width:3px;height:22px;position:absolute;left:0;top:5px;cursor:pointer;background-color:hsl(var(--tp-accent-foreground))}.twist-aplayer-list--active .twist-aplayer-list__cur{display:inline-block}.twist-aplayer-list__index{color:hsl(var(--tp-muted-foreground));margin-right:12px;cursor:pointer}.twist-aplayer-list__title{color:hsl(var(--tp-secondary-foreground))}.twist-aplayer-list__author{color:hsl(var(--tp-muted-foreground));float:right;cursor:pointer}.twist-aplayer-lrc{display:none;position:relative;height:30px;text-align:center;overflow:hidden;margin:-10px 0 7px}.twist-aplayer-lrc:after,.twist-aplayer-lrc:before{content:" ";position:absolute;z-index:1;display:block;overflow:hidden;width:100%}.twist-aplayer-lrc:before{top:0;height:10%;background:linear-gradient(180deg,hsl(var(--tp-background)) 0,#fff0);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ffffff",endColorstr="#00ffffff",GradientType=0)}.twist-aplayer-lrc:after{bottom:0;height:33%;background:linear-gradient(180deg,#fff0 0,hsl(var(--tp-background)));filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#00ffffff",endColorstr="#ccffffff",GradientType=0)}.twist-aplayer-lrc p{font-size:12px;color:hsl(var(--tp-secondary-foreground));line-height:16px!important;height:16px!important;padding:0!important;margin:0!important;transition:all .5s ease-out;opacity:.4;overflow:hidden;text-shadow:none}.twist-aplayer-lrc__contents{width:100%;transition:all .5s ease-out;-webkit-user-select:text;-moz-user-select:text;user-select:text;cursor:default}.twist-aplayer-lrc p.twist-aplayer-lrc__current{opacity:1;overflow:visible;height:auto!important;min-height:16px}.twist-aplayer-lrc.twist-aplayer-lrc--hide{display:none}.twist-aplayer-light{--tp-background: 0 0% 100%;--tp-foreground: 240 10% 3.9%;--tp-card: 0 0% 100%;--tp-card-foreground: 240 10% 3.9%;--tp-primary: 240 5.9% 10%;--tp-primary-foreground: 0 0% 98%;--tp-secondary: 240 4.8% 95.9%;--tp-secondary-foreground: 240 5.9% 10%;--tp-muted: 240 4.8% 95.9%;--tp-muted-foreground: 240 3.8% 46.1%;--tp-accent: 240 4.8% 95.9%;--tp-accent-foreground: 240 5.9% 10%;--tp-border: 240 5.9% 90%}.twist-aplayer-dark{--tp-background: 240 10% 3.9%;--tp-foreground: 0 0% 98%;--tp-card: 240 10% 3.9%;--tp-card-foreground: 0 0% 98%;--tp-primary: 0 0% 98%;--tp-primary-foreground: 240 5.9% 10%;--tp-secondary: 240 3.7% 15.9%;--tp-secondary-foreground: 0 0% 98%;--tp-muted: 240 3.7% 15.9%;--tp-muted-foreground: 240 5% 64.9%;--tp-accent: 240 3.7% 15.9%;--tp-accent-foreground: 0 0% 98%;--tp-border: 240 3.7% 15.9%}.twist-aplayer-vars{--tp-icon-width: 15px;--tp-icon-height: 15px;--tp-icon-font-size: 15px;--tp-icon-transition-function: ease-in-out;--tp-icon-transition-timing: .2s;--tp-max-width: 400px;--tp-zIndex: 99;--tp-pic-width: 66px;--tp-pic-height: 66px;--tp-pic-transition-function: ease;--tp-pic-transition-timing: .3s;--tp-button-background: rgba(0, 0, 0, .2);--tp-box-shadow: 0 0 #0000, 0 0 #0000, 0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tp-user-border: hsl(var(--tp-border) / .3)}.twist-aplayer{font-family:Arial,Helvetica,sans-serif;-webkit-user-select:none;-moz-user-select:none;user-select:none;line-height:normal;border-radius:2px;margin:5px;box-shadow:var(--tp-box-shadow);overflow:hidden}.twist-aplayer *{box-sizing:content-box}.twist-aplayer__body{background-color:hsl(var(--tp-background))}.twist-aplayer__pic{position:relative;float:left;width:var(--tp-pic-width);height:var(--tp-pic-height);background-size:cover;background-position:50%;transition:all var(--tp-pic-transition-timing) var(--tp-pic-transition-function);cursor:pointer}.twist-aplayer__button{position:absolute;border-radius:50%;opacity:.8;text-shadow:0 1px 1px rgba(0,0,0,.2);box-shadow:0 1px 1px #0003;background:hsl(var(--tp-primary-foreground));transition:all .1s ease}.twist-aplayer--play{width:28px;height:28px;bottom:50%;right:50%;margin:0 -15px -15px 0}.twist-aplayer--play svg{position:absolute;top:4px;left:5px;height:20px;width:20px}.twist-aplayer--pause{font-size:12px;width:18px;height:18px;bottom:4px;right:4px}.twist-aplayer--pause svg{position:absolute;top:3px;left:3px;height:12px;width:12px}.twist-aplayer--play path,.twist-aplayer--pause path{fill:hsl(var(--tp-accent-foreground))}.twist-aplayer__info{margin-left:66px;padding:14px 7px 0 10px;height:66px;box-sizing:border-box}.twist-aplayer__music{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin:0 0 13px 5px;-webkit-user-select:text;-moz-user-select:text;user-select:text;cursor:default;padding-bottom:2px;height:20px}.twist-aplayer__title{color:hsl(var(--tp-secondary-foreground));font-size:14px}.twist-aplayer__author{font-size:12px;color:hsl(var(--tp-muted-foreground))}.twist-aplayer__author>a{color:inherit;text-decoration:none}.twist-aplayer-controller{position:relative;display:flex}.twist-aplayer-controller__time{position:relative;right:0;bottom:4px;height:17px;font-size:11px;padding-left:7px}.twist-aplayer-controller__time-inner{color:hsl(var(--tp-muted-foreground));vertical-align:middle}.twist-aplayer-controller__time .twist-aplayer-icon{cursor:pointer;transition:all .2s ease}.twist-aplayer-controller__time .twist-aplayer-icon path{fill:hsl(var(--tp-muted-foreground))}.twist-aplayer-controller__time .twist-aplayer-icon:hover path{fill:hsl(var(--tp-primary))}.twist-aplayer__notice{opacity:0;position:absolute;top:50%;left:50%;z-index:100;transform:translate(-50%,-50%);font-size:12px;border-radius:4px;padding:5px 10px;transition:all .3s ease-in-out;overflow:hidden;pointer-events:none;background-color:hsl(var(--tp-accent));color:hsl(var(--tp-accent-foreground))}.twist-aplayer__miniswitcher{display:none;position:absolute;top:0;right:0;bottom:0;height:100%;background:hsl(var(--tp-accent));width:18px;border-radius:0 2px 2px 0}.twist-aplayer__miniswitcher .twist-aplayer-icon{height:100%;width:100%;transform:rotateY(180deg);transition:all .3s ease}.twist-aplayer__miniswitcher .twist-aplayer-icon path{fill:hsl(var(--tp-muted-foreground))}.twist-aplayer-icon-lrc-inactivity svg{opacity:.4}.twist-aplayer-icon-loading{display:none}.twist-aplayer-icon-loading svg{position:absolute;top:1px;left:1px;width:8px;height:8px;animation:rotate 1s linear infinite}.twist-aplayer-icon-loading svg path{fill:hsl(var(--tp-background))}.twist-aplayer-icon-back,.twist-aplayer-icon-forward,.twist-aplayer-icon-lrc,.twist-aplayer-icon-order,.twist-aplayer-icon-play{display:none}.twist-aplayer--border{border:1px solid var(--tp-user-border)}.twist-aplayer.twist-aplayer--fixed{position:fixed;bottom:0;left:0;right:0;margin:0;z-index:var(--tp-zIndex);overflow:visible;max-width:var(--tp-max-width);box-shadow:none}.twist-aplayer.twist-aplayer--fixed .twist-aplayer__body{position:fixed;bottom:0;left:0;right:0;margin:0;z-index:99;padding-right:18px;transition:all .3s ease;max-width:400px}.twist-aplayer.twist-aplayer--fixed .twist-aplayer__info{transform:scaleX(1);transform-origin:0 0;transition:all .3s ease;border-bottom:none;border-top:1px solid hsl(var(--tp-border))}.twist-aplayer.twist-aplayer--fixed .twist-aplayer-list{margin-bottom:65px;border:1px solid hsl(var(--tp-border));border-bottom:none}.twist-aplayer.twist-aplayer--fixed .twist-aplayer__music{width:calc(100% - 105px)}.twist-aplayer.twist-aplayer--fixed .twist-aplayer.twist-aplayer--border.twist-aplayer--list-folded .twist-aplayer__info,.twist-aplayer.twist-aplayer--fixed .twist-aplayer--list-folded .twist-aplayer__info{border-top:none}.twist-aplayer.twist-aplayer--fixed .twist-aplayer--border.twist-aplayer--list-folded .twist-aplayer__info,.twist-aplayer.twist-aplayer--fixed .twist-aplayer--list-folded .twist-aplayer__info{border-bottom:none}.twist-aplayer.twist-aplayer--fixed .twist-aplayer-lrc{display:block;position:fixed;bottom:10px;left:0;right:0;margin:0;z-index:98;pointer-events:none;text-shadow:-1px -1px 0 #fff}.twist-aplayer.twist-aplayer--fixed .twist-aplayer-lrc:after,.twist-aplayer.twist-aplayer--fixed .twist-aplayer-lrc:before{display:none}.twist-aplayer.twist-aplayer--fixed .twist-aplayer-lrc.twist-aplayer-lrc--hide{display:none}.twist-aplayer.twist-aplayer--fixed .twist-aplayer__miniswitcher{display:block}.twist-aplayer.twist-aplayer--fixed .twist-aplayer-list--hide.twist-aplayer-list{border-top:none}.twist-aplayer.twist-aplayer--fixed.twist-aplayer--narrow{width:66px}.twist-aplayer.twist-aplayer--fixed.twist-aplayer--narrow .twist-aplayer__info,.twist-aplayer.twist-aplayer--fixed.twist-aplayer--narrow .twist-aplayer-list{display:none}.twist-aplayer.twist-aplayer--fixed.twist-aplayer--narrow .twist-aplayer__body,.twist-aplayer.twist-aplayer--fixed.twist-aplayer--narrow .twist-aplayer__pic{width:66px!important;height:66px!important}.twist-aplayer.twist-aplayer--withlist .twist-aplayer-list{display:block}.twist-aplayer.twist-aplayer--withlist .twist-aplayer__info{border-bottom:1px solid hsl(var(--tp-border))}.twist-aplayer.twist-aplayer--withlrc .twist-aplayer__info{margin-left:90px;height:90px;padding:10px 7px 0}.twist-aplayer.twist-aplayer--withlrc .twist-aplayer__pic{width:90px;height:90px}.twist-aplayer.twist-aplayer--withlrc .twist-aplayer-lrc,.twist-aplayer--loading .twist-aplayer-icon-loading{display:block}.twist-aplayer--normal.twist-aplayer--border.twist-aplayer--list-folded .twist-aplayer__info,.twist-aplayer--withlist.twist-aplayer--list-folded .twist-aplayer__info{border-bottom:none}
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(Y,
|
|
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 mr(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 J=mr(c);var fe={exports:{}},te={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
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 qe;function hr(){if(qe)return te;qe=1;var e=
|
|
9
|
+
*/var qe;function hr(){if(qe)return te;qe=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,l={key:!0,ref:!0,__self:!0,__source:!0};function p(g,s,f){var m,y={},E=null,T=null;f!==void 0&&(E=""+f),s.key!==void 0&&(E=""+s.key),s.ref!==void 0&&(T=s.ref);for(m in s)a.call(s,m)&&!l.hasOwnProperty(m)&&(y[m]=s[m]);if(g&&g.defaultProps)for(m in s=g.defaultProps,s)y[m]===void 0&&(y[m]=s[m]);return{$$typeof:r,type:g,key:E,ref:T,props:y,_owner:i.current}}return te.Fragment=n,te.jsx=p,te.jsxs=p,te}var ne={},Re;function pr(){if(Re)return ne;Re=1;var e={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,7 +14,7 @@
|
|
|
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=
|
|
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"),l=Symbol.for("react.strict_mode"),p=Symbol.for("react.profiler"),g=Symbol.for("react.provider"),s=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),y=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),b=Symbol.for("react.offscreen"),o=Symbol.iterator,d="@@iterator";function x(t){if(t===null||typeof t!="object")return null;var u=o&&t[o]||t[d];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 V=!1,F=!1,q=!1,K=!1,k=!1,oe;oe=Symbol.for("react.module.reference");function Oe(t){return!!(typeof t=="string"||typeof t=="function"||t===i||t===p||k||t===l||t===m||t===y||K||t===b||V||F||q||typeof t=="object"&&t!==null&&(t.$$typeof===T||t.$$typeof===E||t.$$typeof===g||t.$$typeof===s||t.$$typeof===f||t.$$typeof===oe||t.getModuleId!==void 0))}function Ce(t,u,h){var _=t.displayName;if(_)return _;var O=u.displayName||u.name||"";return O!==""?h+"("+O+")":h}function he(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 p:return"Profiler";case l:return"StrictMode";case m:return"Suspense";case y:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case s:var u=t;return he(u)+".Consumer";case g:var h=t;return he(h._context)+".Provider";case f:return Ce(t,t.render,"ForwardRef");case E: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 H=Object.assign,W=0,ue,se,D,Q,le,ce,pe;function Z(){}Z.__reactDisabledLog=!0;function mt(){{if(W===0){ue=console.log,se=console.info,D=console.warn,Q=console.error,le=console.group,ce=console.groupCollapsed,pe=console.groupEnd;var t={configurable:!0,enumerable:!0,value:Z,writable:!0};Object.defineProperties(console,{info:t,log:t,warn:t,error:t,group:t,groupCollapsed:t,groupEnd:t})}W++}}function ht(){{if(W--,W===0){var t={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:H({},t,{value:ue}),info:H({},t,{value:se}),warn:H({},t,{value:D}),error:H({},t,{value:Q}),group:H({},t,{value:le}),groupCollapsed:H({},t,{value:ce}),groupEnd:H({},t,{value:pe})})}W<0&&S("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Pe=C.ReactCurrentDispatcher,Le;function ye(t,u,h){{if(Le===void 0)try{throw Error()}catch(O){var _=O.stack.trim().match(/\n( *(at )?)/);Le=_&&_[1]||""}return`
|
|
18
18
|
`+Le+t}}var $e=!1,be;{var pt=typeof WeakMap=="function"?WeakMap:Map;be=new pt}function Ze(t,u){if(!t||$e)return"";{var h=be.get(t);if(h!==void 0)return h}var _;$e=!0;var O=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var P;P=Pe.current,Pe.current=null,mt();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(U){_=U}Reflect.construct(t,[],j)}else{try{j.call()}catch(U){_=U}t.call(j.prototype)}}else{try{throw Error()}catch(U){_=U}t()}}catch(U){if(U&&_&&typeof U.stack=="string"){for(var w=U.stack.split(`
|
|
19
19
|
`),R=_.stack.split(`
|
|
20
20
|
`),M=w.length-1,A=R.length-1;M>=1&&A>=0&&w[M]!==R[A];)A--;for(;M>=1&&A>=0;M--,A--)if(w[M]!==R[A]){if(M!==1||A!==1)do if(M--,A--,A<0||w[M]!==R[A]){var I=`
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
|
|
23
23
|
Check the render method of \``+t+"`."}return""}}function $t(t){return""}var lr={};function Mt(t){{var u=sr();if(!u){var h=typeof t=="string"?t:t.displayName||t.name;h&&(u=`
|
|
24
24
|
|
|
25
|
-
Check the top-level render call using <`+h+">.")}return u}}function cr(t,u){{if(!t._store||t._store.validated||t.key!=null)return;t._store.validated=!0;var h=Mt(u);if(lr[h])return;lr[h]=!0;var _="";t&&t._owner&&t._owner!==Ae.current&&(_=" It was passed a child from "+z(t._owner.type)+"."),ee(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,_),ee(null)}}function fr(t,u){{if(typeof t!="object")return;if(Me(t))for(var h=0;h<t.length;h++){var _=t[h];Ne(_)&&cr(_,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)&&cr(j.value,u)}}}function At(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===f||u.$$typeof===E))h=u.propTypes;else return;if(h){var _=z(u);gt(h,t.props,"prop",_,t)}else if(u.PropTypes!==void 0&&!ke){ke=!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 kt(t){{for(var u=Object.keys(t.props),h=0;h<u.length;h++){var _=u[h];if(_!=="children"&&_!=="key"){ee(t),S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",_),ee(null);break}}t.ref!==null&&(ee(t),S("Invalid attribute `ref` supplied to `React.Fragment`."),ee(null))}}function dr(t,u,h,_,O,P){{var j=Oe(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=$t();R?w+=R:w+=sr();var M;t===null?M="null":Me(t)?M="array":t!==void 0&&t.$$typeof===n?(M="<"+(z(t.type)||"Unknown")+" />",w=" Did you accidentally export a JSX literal instead of a component?"):M=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",M,w)}var A=Lt(t,u,h,O,P);if(A==null)return A;if(j){var I=u.children;if(I!==void 0)if(_)if(Me(I)){for(var re=0;re<I.length;re++)fr(I[re],t);Object.freeze&&Object.freeze(I)}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 fr(I,t)}return t===i?kt(A):At(A),A}}function Nt(t,u,h){return dr(t,u,h,!0)}function qt(t,u,h){return dr(t,u,h,!1)}var Rt=qt,Dt=Nt;ne.Fragment=i,ne.jsx=Rt,ne.jsxs=Dt}(),ne}var De;function yr(){if(De)return fe.exports;De=1;var e={};return e.NODE_ENV==="production"?fe.exports=hr():fe.exports=pr(),fe.exports}var v=yr(),de=e=>`--${e}`,Ie=e=>`var(--${e})`,Ve=(e,r)=>`--${e}: ${r};`;function br(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=>de(`${n()}-${e}-${a}`),cvm:(a,i={})=>{const
|
|
26
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Sr(e,r){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var a,i,
|
|
27
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var c,p=!0,g=!1;return{s:function(){n=n.call(e)},n:function(){var f=n.next();return p=f.done,f},e:function(f){g=!0,c=f},f:function(){try{p||n.return==null||n.return()}finally{if(g)throw c}}}}function Be(e,r){if(e){if(typeof e=="string")return ze(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)?ze(e,r):void 0}}function ze(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 ve(){return ve=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},ve.apply(null,arguments)}function He(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 ie(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?He(Object(n),!0).forEach(function(a){wr(e,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):He(Object(n)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))})}return e}function wr(e,r,n){return(r=jr(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function jr(e){var r=Or(e,"string");return ae(r)=="symbol"?r:r+""}function Or(e,r){if(ae(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var a=n.call(e,r);if(ae(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function Cr(e,r){if(e==null)return{};var n,a,i=Pr(e,r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(a=0;a<c.length;a++)n=c[a],r.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Pr(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 Lr(e){var r=e.attrs,n=e.size,a=e.title,i=e.spin,c=e.rotate,p=e.color,g=Cr(e,gr),s=function(m){var y=n||m.size||"1em",E,T="",b="";return m.className&&(E=m.className),e.className&&(E=E?"".concat(E," ").concat(e.className):e.className),i&&(E?E+=" twist-icon-loading":E="twist-icon-loading"),c&&(T="rotate(".concat(c,"deg)"),b="rotate(".concat(c,"deg)")),J.createElement("svg",ve({xmlns:"http://www.w3.org/2000/svg"},m.attrs,r,g,{className:E,style:ie(ie({color:p||m.color,msTransform:T,transform:b},m.style),e.style),width:y,height:y}),a&&J.createElement("title",null,a),e.children)};return Se!==void 0?J.createElement(Se.Consumer,null,function(f){return s(f)}):s(Fe)}function $r(e){var r={},n=e.split(";"),a=Tr(n),i;try{for(a.s();!(i=a.n()).done;){var c=i.value,p=c.split(":"),g=Er(p,2),s=g[0],f=g[1];if(s&&f){var m=s.trim().replace(/-./g,function(y){return y.charAt(1).toUpperCase()});r[m]=f.trim()}}}catch(y){a.e(y)}finally{a.f()}return r}function We(e){return e&&e.map(function(r,n){return J.createElement(r.tag,ie(ie({},r.attrs),{},{key:n,style:r.attrs.style?$r(r.attrs.style):null}),We(r.children))})}function N(e){return function(r){return J.createElement(Lr,ve({attrs:ie({},e.attrs)},r),We(e.children))}}function Mr(e){return N({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 Ar(e){return N({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 kr(e){return N({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 Nr(e){return N({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 qr(e){return N({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 Rr(e){return N({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"}}]})(e)}function Dr(e){return N({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 Ir(e){return N({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 Vr(e){return N({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 Fr(e){return N({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 Br(e){return N({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M14 19V5h4v14zm-8 0V5h4v14z"}}]})(e)}function zr(e){return N({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 Hr(e){return N({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 Wr(e){return N({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 Ur(e){return N({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 Yr(e){return N({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M7 15V9h4l5-5v16l-5-5z"}}]})(e)}function Gr(e){return N({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 Kr(e){return N({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M18.25 12L8.5 17.629V6.37z"}}]})(e)}function _e(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 Te(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 Ue(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=Ue(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=Ue(e))&&(a&&(a+=" "),a+=r);return a}function Jr({bufferedPercentage:e,playedPercentage:r,onSeek:n}){const a=B("aplayer-bar"),i=B("aplayer-icon"),c=l.useRef(null),[p,g]=l.useState(r),s=l.useRef(!1);l.useEffect(()=>{s.current||g(r)},[r]);const f=l.useCallback(m=>{s.current=!0;const y=_e(m,c);g(y);const E=b=>{const o=_e(b,c);g(o)},T=b=>{document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",T);const o=_e(b,c);g(o),n==null||n(o),s.current=!1};document.addEventListener("mousemove",E),document.addEventListener("mouseup",T)},[n]);return v.jsx("div",{ref:c,className:$(a.b(),a.bs("vars")),onMouseDown:f,role:"slider","aria-label":"Audio progress","aria-valuenow":p?p*100:0,"aria-valuemin":0,"aria-valuemax":100,"aria-live":"polite",children:v.jsxs("div",{className:a.be("inner"),children:[typeof e<"u"?v.jsx("div",{className:a.be("loaded"),style:{width:`${e*100}%`}}):null,typeof p<"u"?v.jsx("div",{className:a.be("played"),style:{width:`${p*100}%`},children:v.jsx("span",{className:a.be("thumb"),children:v.jsx("span",{className:$(i.bs("loading")),children:v.jsx(kr,{})})})}):null]})})}function Xr({volume:e,muted:r,onToggleMuted:n,onChangeVolume:a}){const i=B("aplayer-volumn"),c=B("aplayer-icon"),p=l.useRef(null),[g,s]=l.useState(!1),f=l.useCallback(m=>{a(Te(m,p)),s(!0);const y=T=>{a(Te(T,p))},E=T=>{document.removeEventListener("mouseup",E),document.removeEventListener("mousemove",y),s(!1),a(Te(T,p))};document.addEventListener("mousemove",y),document.addEventListener("mouseup",E)},[a]);return v.jsxs("div",{className:$(i.b(),i.bs("vars")),children:[v.jsx("button",{type:"button",className:$(c.b(),c.bs("volume-down")),onClick:()=>n(),"aria-label":r||!e?"Muted":"unMuted",children:r||!e?v.jsx(Yr,{}):e>=1?v.jsx(Gr,{}):v.jsx(Ur,{})}),v.jsx("div",{className:$(i.be("bar-wrap"),{[i.bem("bar-wrap","active")]:g}),ref:p,onMouseDown:f,children:v.jsx("div",{className:i.be("bar"),children:v.jsx("div",{className:i.be("thumb"),style:{height:r?0:`${e*100}%`}})})})]})}function Ye(e){if(typeof e>"u")return"--:--";if(Number.isNaN(e))return"00:00";const r=p=>p<10?`0${p}`:`${p}`,n=Math.trunc(e/60),a=Math.trunc(e-n*60),i=Math.trunc(n/60),c=Math.trunc(e/60-60*Math.trunc(e/60/60));return e>=3600?`${r(i)}:${r(c)}:${r(a)}`:`${r(n)}:${r(a)}`}function Qr({volume:e,onChangeVolume:r,muted:n,currentTime:a,audioDurationSeconds:i,bufferedSeconds:c,onToggleMenu:p,onToggleMuted:g,order:s,onOrderChange:f,loop:m,onLoopChange:y,onSeek:E,isPlaying:T,onTogglePlay:b,onSkipForward:o,onSkipBack:d,showLyrics:x=!0,onToggleLyrics:C}){const S=B("aplayer-controller"),L=B("aplayer-icon"),V=l.useCallback(()=>{const q={list:"random",random:"list"}[s];f(q)},[s,f]),F=l.useCallback(()=>{const q={all:"one",one:"none",none:"all"}[m];y(q)},[m,y]);return v.jsxs("div",{className:$(S.b(),S.bs("vars")),role:"group","aria-label":"Audio Controls",children:[v.jsx(Jr,{playedPercentage:typeof a>"u"||typeof i>"u"?void 0:a/i,bufferedPercentage:typeof c>"u"||typeof i>"u"?void 0:c/i,onSeek:q=>E==null?void 0:E(q*i)}),v.jsxs("div",{className:S.be("time"),children:[v.jsxs("span",{className:S.be("time-inner"),"aria-live":"polite",children:[v.jsx("span",{className:S.be("ptime"),children:Ye(a)})," / ",v.jsx("span",{className:S.be("dtime"),children:Ye(i)})]}),v.jsx("button",{className:$(L.b(),L.bs("back")),onClick:d,type:"button","aria-label":"Previous track",children:v.jsx(Mr,{})}),v.jsx("button",{className:$(L.b(),L.bs("play")),onClick:b,type:"button","aria-label":T?"Pause audio":"Play audio",children:T?v.jsx(Br,{}):v.jsx(zr,{})}),v.jsx("button",{className:$(L.b(),L.bs("forward")),onClick:o,type:"button","aria-label":"Next track",children:v.jsx(Ar,{})}),v.jsx(Xr,{volume:e,muted:n,onToggleMuted:g,onChangeVolume:r}),v.jsx("button",{className:$(L.b(),L.bs("order")),onClick:V,type:"button","aria-label":`Playback order: ${s}`,children:{list:v.jsx(Vr,{}),random:v.jsx(Ir,{})}[s]}),v.jsx("button",{className:$(L.b(),L.bs("order")),onClick:F,type:"button","aria-label":`Loop mode: ${m}`,children:{all:v.jsx(Wr,{}),one:v.jsx(Hr,{}),none:v.jsx(Dr,{})}[m]}),v.jsx("button",{type:"button",className:$(L.b(),L.bs("menu")),onClick:()=>p==null?void 0:p(),"aria-label":"Toggle playlist menu",children:v.jsx(Rr,{})}),v.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:v.jsx(Fr,{})})]})]})}function Zr({open:e,audio:r,playingAudioUrl:n,onPlayAudio:a,listMaxHeight:i}){const c=B("aplayer-list"),p=i?{maxHeight:i}:void 0,g=l.useCallback(f=>f?typeof f=="string"?f:f.name??"Audio artist":"Audio artist",[]),s=l.useRef(null);return l.useEffect(()=>{if(s.current){const f=s.current;return f.style.maxHeight=`${Math.min(f.scrollHeight,i??1/0)}px`,()=>{f.removeAttribute("style")}}},[i]),v.jsx("div",{ref:s,className:$(c.b(),{[c.bm("hide")]:!e}),"aria-label":"Audio playlist","aria-live":"polite",children:v.jsx("ol",{style:p,children:r.map((f,m)=>v.jsxs("li",{className:$({[c.bm("active")]:f.url===n}),onClick:()=>{f.url!==n&&(a==null||a(f))},role:"button","aria-label":`${f.name??"Audio name"} by ${g(f.artist)}}`,children:[v.jsx("span",{className:c.be("cur")}),v.jsx("span",{className:c.be("index"),children:m+1}),v.jsx("span",{className:c.be("title"),children:f.name??"Audio name"}),v.jsx("span",{className:c.be("author"),children:g(f.artist)})]},f.name||m))})})}function Ge({show:e,lrcText:r,currentTime:n}){const a=B("aplayer-lrc"),i=l.useMemo(()=>et(r),[r]),c=l.useMemo(()=>{for(let g=0;g<i.length;g++){const s=i[g],f=i[g+1];if(n>=s[0]&&(!f||n<f[0]))return g}return 0},[n,i]),p=l.useMemo(()=>({transform:`translateY(${-c*16}px)`,WebkitTransform:`translateY(${-c*16}px)`}),[c]);return v.jsx("div",{className:$(a.b(),{[a.bm("hide")]:!e}),children:r?v.jsx("div",{className:a.be("contents"),style:p,children:i.map(([,g],s)=>v.jsx("p",{className:$({[a.be("current")]:s===c}),children:g},s))}):null})}function et(e){if(e){e=e.replace(/([^\]^\n])\[/g,(i,c)=>`${c}
|
|
25
|
+
Check the top-level render call using <`+h+">.")}return u}}function cr(t,u){{if(!t._store||t._store.validated||t.key!=null)return;t._store.validated=!0;var h=Mt(u);if(lr[h])return;lr[h]=!0;var _="";t&&t._owner&&t._owner!==Ae.current&&(_=" It was passed a child from "+z(t._owner.type)+"."),ee(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,_),ee(null)}}function fr(t,u){{if(typeof t!="object")return;if(Me(t))for(var h=0;h<t.length;h++){var _=t[h];Ne(_)&&cr(_,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)&&cr(j.value,u)}}}function At(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===f||u.$$typeof===E))h=u.propTypes;else return;if(h){var _=z(u);gt(h,t.props,"prop",_,t)}else if(u.PropTypes!==void 0&&!ke){ke=!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 kt(t){{for(var u=Object.keys(t.props),h=0;h<u.length;h++){var _=u[h];if(_!=="children"&&_!=="key"){ee(t),S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",_),ee(null);break}}t.ref!==null&&(ee(t),S("Invalid attribute `ref` supplied to `React.Fragment`."),ee(null))}}function dr(t,u,h,_,O,P){{var j=Oe(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=$t();R?w+=R:w+=sr();var M;t===null?M="null":Me(t)?M="array":t!==void 0&&t.$$typeof===n?(M="<"+(z(t.type)||"Unknown")+" />",w=" Did you accidentally export a JSX literal instead of a component?"):M=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",M,w)}var A=Lt(t,u,h,O,P);if(A==null)return A;if(j){var I=u.children;if(I!==void 0)if(_)if(Me(I)){for(var re=0;re<I.length;re++)fr(I[re],t);Object.freeze&&Object.freeze(I)}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 fr(I,t)}return t===i?kt(A):At(A),A}}function Nt(t,u,h){return dr(t,u,h,!0)}function qt(t,u,h){return dr(t,u,h,!1)}var Rt=qt,Dt=Nt;ne.Fragment=i,ne.jsx=Rt,ne.jsxs=Dt}(),ne}var De;function yr(){if(De)return fe.exports;De=1;var e={};return e.NODE_ENV==="production"?fe.exports=hr():fe.exports=pr(),fe.exports}var v=yr(),de=e=>`--${e}`,Ie=e=>`var(--${e})`,Ve=(e,r)=>`--${e}: ${r};`;function br(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=>de(`${n()}-${e}-${a}`),cvm:(a,i={})=>{const l=n();for(const p of Object.keys(a))i[de(`${l}-${e}-${p}`)]=a[p];return i},gcv:a=>Ie(`${n()}-${e}-${a}`),scv:(a,i)=>Ve(`${n()}-${e}-${a}`,i),nv:a=>de(`${n()}-${a}`),nvm:(a,i={})=>{const l=n();for(const p of Object.keys(a))i[de(`${l}-${p}`)]=a[p];return i},gnv:a=>Ie(`${n()}-${a}`),snv:(a,i)=>Ve(`${n()}-${a}`,i)}}function B(e){return c.useMemo(()=>br(e,"twist"),[e])}var Fe={color:void 0,size:void 0,className:void 0,style:void 0,attrs:void 0},Se=J.createContext(Fe);Se.Provider;function ae(e){"@babel/helpers - typeof";return ae=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},ae(e)}var gr=["attrs","size","title","spin","rotate","color"];function Er(e,r){return _r(e)||Sr(e,r)||Be(e,r)||xr()}function xr(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
26
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Sr(e,r){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var a,i,l,p,g=[],s=!0,f=!1;try{if(l=(n=n.call(e)).next,r!==0)for(;!(s=(a=l.call(n)).done)&&(g.push(a.value),g.length!==r);s=!0);}catch(m){f=!0,i=m}finally{try{if(!s&&n.return!=null&&(p=n.return(),Object(p)!==p))return}finally{if(f)throw i}}return g}}function _r(e){if(Array.isArray(e))return e}function Tr(e,r){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Be(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(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
27
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var l,p=!0,g=!1;return{s:function(){n=n.call(e)},n:function(){var f=n.next();return p=f.done,f},e:function(f){g=!0,l=f},f:function(){try{p||n.return==null||n.return()}finally{if(g)throw l}}}}function Be(e,r){if(e){if(typeof e=="string")return ze(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)?ze(e,r):void 0}}function ze(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 ve(){return ve=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},ve.apply(null,arguments)}function He(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 ie(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?He(Object(n),!0).forEach(function(a){wr(e,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):He(Object(n)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))})}return e}function wr(e,r,n){return(r=jr(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function jr(e){var r=Or(e,"string");return ae(r)=="symbol"?r:r+""}function Or(e,r){if(ae(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var a=n.call(e,r);if(ae(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function Cr(e,r){if(e==null)return{};var n,a,i=Pr(e,r);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(a=0;a<l.length;a++)n=l[a],r.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Pr(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 Lr(e){var r=e.attrs,n=e.size,a=e.title,i=e.spin,l=e.rotate,p=e.color,g=Cr(e,gr),s=function(m){var y=n||m.size||"1em",E,T="",b="";return m.className&&(E=m.className),e.className&&(E=E?"".concat(E," ").concat(e.className):e.className),i&&(E?E+=" twist-icon-loading":E="twist-icon-loading"),l&&(T="rotate(".concat(l,"deg)"),b="rotate(".concat(l,"deg)")),J.createElement("svg",ve({xmlns:"http://www.w3.org/2000/svg"},m.attrs,r,g,{className:E,style:ie(ie({color:p||m.color,msTransform:T,transform:b},m.style),e.style),width:y,height:y}),a&&J.createElement("title",null,a),e.children)};return Se!==void 0?J.createElement(Se.Consumer,null,function(f){return s(f)}):s(Fe)}function $r(e){var r={},n=e.split(";"),a=Tr(n),i;try{for(a.s();!(i=a.n()).done;){var l=i.value,p=l.split(":"),g=Er(p,2),s=g[0],f=g[1];if(s&&f){var m=s.trim().replace(/-./g,function(y){return y.charAt(1).toUpperCase()});r[m]=f.trim()}}}catch(y){a.e(y)}finally{a.f()}return r}function We(e){return e&&e.map(function(r,n){return J.createElement(r.tag,ie(ie({},r.attrs),{},{key:n,style:r.attrs.style?$r(r.attrs.style):null}),We(r.children))})}function N(e){return function(r){return J.createElement(Lr,ve({attrs:ie({},e.attrs)},r),We(e.children))}}function Mr(e){return N({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 Ar(e){return N({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 kr(e){return N({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 Nr(e){return N({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 qr(e){return N({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 Rr(e){return N({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"}}]})(e)}function Dr(e){return N({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 Ir(e){return N({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 Vr(e){return N({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 Fr(e){return N({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 Br(e){return N({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M14 19V5h4v14zm-8 0V5h4v14z"}}]})(e)}function zr(e){return N({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 Hr(e){return N({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 Wr(e){return N({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 Ur(e){return N({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 Yr(e){return N({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M7 15V9h4l5-5v16l-5-5z"}}]})(e)}function Gr(e){return N({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 Kr(e){return N({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M18.25 12L8.5 17.629V6.37z"}}]})(e)}function _e(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 Te(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 Ue(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=Ue(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=Ue(e))&&(a&&(a+=" "),a+=r);return a}function Jr({bufferedPercentage:e,playedPercentage:r,onSeek:n}){const a=B("aplayer-bar"),i=B("aplayer-icon"),l=c.useRef(null),[p,g]=c.useState(r),s=c.useRef(!1);c.useEffect(()=>{s.current||g(r)},[r]);const f=c.useCallback(m=>{s.current=!0;const y=_e(m,l);g(y);const E=b=>{const o=_e(b,l);g(o)},T=b=>{document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",T);const o=_e(b,l);g(o),n==null||n(o),s.current=!1};document.addEventListener("mousemove",E),document.addEventListener("mouseup",T)},[n]);return v.jsx("div",{ref:l,className:$(a.b(),a.bs("vars")),onMouseDown:f,role:"slider","aria-label":"Audio progress","aria-valuenow":p?p*100:0,"aria-valuemin":0,"aria-valuemax":100,"aria-live":"polite",children:v.jsxs("div",{className:a.be("inner"),children:[typeof e<"u"?v.jsx("div",{className:a.be("loaded"),style:{width:`${e*100}%`}}):null,typeof p<"u"?v.jsx("div",{className:a.be("played"),style:{width:`${p*100}%`},children:v.jsx("span",{className:a.be("thumb"),children:v.jsx("span",{className:$(i.bs("loading")),children:v.jsx(kr,{})})})}):null]})})}function Xr({volume:e,muted:r,onToggleMuted:n,onChangeVolume:a}){const i=B("aplayer-volumn"),l=B("aplayer-icon"),p=c.useRef(null),[g,s]=c.useState(!1),f=c.useCallback(m=>{a(Te(m,p)),s(!0);const y=T=>{a(Te(T,p))},E=T=>{document.removeEventListener("mouseup",E),document.removeEventListener("mousemove",y),s(!1),a(Te(T,p))};document.addEventListener("mousemove",y),document.addEventListener("mouseup",E)},[a]);return v.jsxs("div",{className:$(i.b(),i.bs("vars")),children:[v.jsx("button",{type:"button",className:$(l.b(),l.bs("volume-down")),onClick:()=>n(),"aria-label":r||!e?"Muted":"unMuted",children:r||!e?v.jsx(Yr,{}):e>=1?v.jsx(Gr,{}):v.jsx(Ur,{})}),v.jsx("div",{className:$(i.be("bar-wrap"),{[i.bem("bar-wrap","active")]:g}),ref:p,onMouseDown:f,children:v.jsx("div",{className:i.be("bar"),children:v.jsx("div",{className:i.be("thumb"),style:{height:r?0:`${e*100}%`}})})})]})}function Ye(e){if(typeof e>"u")return"--:--";if(Number.isNaN(e))return"00:00";const r=p=>p<10?`0${p}`:`${p}`,n=Math.trunc(e/60),a=Math.trunc(e-n*60),i=Math.trunc(n/60),l=Math.trunc(e/60-60*Math.trunc(e/60/60));return e>=3600?`${r(i)}:${r(l)}:${r(a)}`:`${r(n)}:${r(a)}`}function Qr({volume:e,onChangeVolume:r,muted:n,currentTime:a,audioDurationSeconds:i,bufferedSeconds:l,onToggleMenu:p,onToggleMuted:g,order:s,onOrderChange:f,loop:m,onLoopChange:y,onSeek:E,isPlaying:T,onTogglePlay:b,onSkipForward:o,onSkipBack:d,showLyrics:x=!0,onToggleLyrics:C}){const S=B("aplayer-controller"),L=B("aplayer-icon"),V=c.useCallback(()=>{const q={list:"random",random:"list"}[s];f(q)},[s,f]),F=c.useCallback(()=>{const q={all:"one",one:"none",none:"all"}[m];y(q)},[m,y]);return v.jsxs("div",{className:$(S.b(),S.bs("vars")),role:"group","aria-label":"Audio Controls",children:[v.jsx(Jr,{playedPercentage:typeof a>"u"||typeof i>"u"?void 0:a/i,bufferedPercentage:typeof l>"u"||typeof i>"u"?void 0:l/i,onSeek:q=>E==null?void 0:E(q*i)}),v.jsxs("div",{className:S.be("time"),children:[v.jsxs("span",{className:S.be("time-inner"),"aria-live":"polite",children:[v.jsx("span",{className:S.be("ptime"),children:Ye(a)})," / ",v.jsx("span",{className:S.be("dtime"),children:Ye(i)})]}),v.jsx("button",{className:$(L.b(),L.bs("back")),onClick:d,type:"button","aria-label":"Previous track",children:v.jsx(Mr,{})}),v.jsx("button",{className:$(L.b(),L.bs("play")),onClick:b,type:"button","aria-label":T?"Pause audio":"Play audio",children:T?v.jsx(Br,{}):v.jsx(zr,{})}),v.jsx("button",{className:$(L.b(),L.bs("forward")),onClick:o,type:"button","aria-label":"Next track",children:v.jsx(Ar,{})}),v.jsx(Xr,{volume:e,muted:n,onToggleMuted:g,onChangeVolume:r}),v.jsx("button",{className:$(L.b(),L.bs("order")),onClick:V,type:"button","aria-label":`Playback order: ${s}`,children:{list:v.jsx(Vr,{}),random:v.jsx(Ir,{})}[s]}),v.jsx("button",{className:$(L.b(),L.bs("order")),onClick:F,type:"button","aria-label":`Loop mode: ${m}`,children:{all:v.jsx(Wr,{}),one:v.jsx(Hr,{}),none:v.jsx(Dr,{})}[m]}),v.jsx("button",{type:"button",className:$(L.b(),L.bs("menu")),onClick:()=>p==null?void 0:p(),"aria-label":"Toggle playlist menu",children:v.jsx(Rr,{})}),v.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:v.jsx(Fr,{})})]})]})}function Zr({open:e,audio:r,playingAudioUrl:n,onPlayAudio:a,listMaxHeight:i}){const l=B("aplayer-list"),p=i?{maxHeight:i}:void 0,g=c.useCallback(f=>f?typeof f=="string"?f:f.name??"Audio artist":"Audio artist",[]),s=c.useRef(null);return c.useEffect(()=>{if(s.current){const f=s.current;return f.style.maxHeight=`${Math.min(f.scrollHeight,i??1/0)}px`,()=>{f.removeAttribute("style")}}},[i]),v.jsx("div",{ref:s,className:$(l.b(),{[l.bm("hide")]:!e,[l.bs("vars")]:!0}),"aria-label":"Audio playlist","aria-live":"polite",children:v.jsx("ol",{style:p,children:r.map((f,m)=>v.jsxs("li",{className:$({[l.bm("active")]:f.url===n}),onClick:()=>{f.url!==n&&(a==null||a(f))},role:"button","aria-label":`${f.name??"Audio name"} by ${g(f.artist)}}`,children:[v.jsx("span",{className:l.be("cur")}),v.jsx("span",{className:l.be("index"),children:m+1}),v.jsx("span",{className:l.be("title"),children:f.name??"Audio name"}),v.jsx("span",{className:l.be("author"),children:g(f.artist)})]},f.name||m))})})}function Ge({show:e,lrcText:r,currentTime:n}){const a=B("aplayer-lrc"),i=c.useMemo(()=>et(r),[r]),l=c.useMemo(()=>{for(let g=0;g<i.length;g++){const s=i[g],f=i[g+1];if(n>=s[0]&&(!f||n<f[0]))return g}return 0},[n,i]),p=c.useMemo(()=>({transform:`translateY(${-l*16}px)`,WebkitTransform:`translateY(${-l*16}px)`}),[l]);return v.jsx("div",{className:$(a.b(),{[a.bm("hide")]:!e}),children:r?v.jsx("div",{className:a.be("contents"),style:p,children:i.map(([,g],s)=>v.jsx("p",{className:$({[a.be("current")]:s===l}),children:g},s))}):null})}function et(e){if(e){e=e.replace(/([^\]^\n])\[/g,(i,l)=>`${l}
|
|
28
28
|
[`);const r=e.split(`
|
|
29
|
-
`),n=[],a=r.length;for(let i=0;i<a;i++){const
|
|
29
|
+
`),n=[],a=r.length;for(let i=0;i<a;i++){const l=r[i].match(/\[(\d{2}):(\d{2})(\.(\d{2,3}))?\]/g),p=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(l){const g=l.length;for(let s=0;s<g;s++){const f=/\[(\d{2}):(\d{2})(\.(\d{2,3}))?\]/.exec(l[s]),m=f[1]*60,y=Number.parseInt(f[2]),E=f[4]?Number.parseInt(f[4])/(`${f[4]}`.length===2?100:1e3):0,T=m+y+E;n.push([T,p])}}}return n.sort((i,l)=>i[0]-l[0]),n}else return[]}var me={exports:{}},we={};/**
|
|
30
30
|
* @license React
|
|
31
31
|
* use-sync-external-store-shim.production.js
|
|
32
32
|
*
|
|
@@ -34,7 +34,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
34
34
|
*
|
|
35
35
|
* This source code is licensed under the MIT license found in the
|
|
36
36
|
* LICENSE file in the root directory of this source tree.
|
|
37
|
-
*/var Ke;function rt(){if(Ke)return we;Ke=1;var e=
|
|
37
|
+
*/var Ke;function rt(){if(Ke)return we;Ke=1;var e=c;function r(y,E){return y===E&&(y!==0||1/y===1/E)||y!==y&&E!==E}var n=typeof Object.is=="function"?Object.is:r,a=e.useState,i=e.useEffect,l=e.useLayoutEffect,p=e.useDebugValue;function g(y,E){var T=E(),b=a({inst:{value:T,getSnapshot:E}}),o=b[0].inst,d=b[1];return l(function(){o.value=T,o.getSnapshot=E,s(o)&&d({inst:o})},[y,T,E]),i(function(){return s(o)&&d({inst:o}),y(function(){s(o)&&d({inst:o})})},[y]),p(T),T}function s(y){var E=y.getSnapshot;y=y.value;try{var T=E();return!n(y,T)}catch{return!0}}function f(y,E){return E()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:g;return we.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,we}var je={},Je;function tt(){if(Je)return je;Je=1;var e={};/**
|
|
38
38
|
* @license React
|
|
39
39
|
* use-sync-external-store-shim.development.js
|
|
40
40
|
*
|
|
@@ -42,4 +42,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
42
42
|
*
|
|
43
43
|
* This source code is licensed under the MIT license found in the
|
|
44
44
|
* LICENSE file in the root directory of this source tree.
|
|
45
|
-
*/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){y||c.startTransition===void 0||(y=!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 d=o();if(!E){var x=o();p(d,x)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),E=!0)}x=g({inst:{value:d,getSnapshot:o}});var C=x[0].inst,S=x[1];return f(function(){C.value=d,C.getSnapshot=o,a(C)&&S({inst:C})},[b,d,o]),s(function(){return a(C)&&S({inst:C}),b(function(){a(C)&&S({inst:C})})},[b]),m(d),d}function a(b){var o=b.getSnapshot;b=b.value;try{var d=o();return!p(b,d)}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 c=l,p=typeof Object.is=="function"?Object.is:r,g=c.useState,s=c.useEffect,f=c.useLayoutEffect,m=c.useDebugValue,y=!1,E=!1,T=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?i:n;je.useSyncExternalStore=c.useSyncExternalStore!==void 0?c.useSyncExternalStore:T,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}(),je}var Xe;function nt(){if(Xe)return me.exports;Xe=1;var e={};return e.NODE_ENV==="production"?me.exports=rt():me.exports=tt(),me.exports}var G=nt();const X=[];function at(e){const r=l.useRef();return l.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),X.includes(n)||X.push(n)}},[e==null?void 0:e.autoPlay,e==null?void 0:e.initialVolume,e==null?void 0:e.src]),l.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]),l.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]),l.useEffect(()=>()=>{const n=r.current;if(n){n.pause(),n.currentTime=0;const a=X.indexOf(n);a!==-1&&X.splice(a,1)}r.current=void 0},[]),r}function it(e){const r=at(e),n=l.useCallback(o=>{for(let d=0;d<X.length;d++){const x=X[d];x!==o&&!x.paused&&x.pause()}},[]),a=l.useCallback(async o=>{var x;const d=r.current;if(d){e.mutex&&n(d),d.src!==o&&(d.pause(),d.currentTime=0,d.src=o);try{await((x=r.current)==null?void 0:x.play())}catch{}}},[r,e.mutex,n]),i=l.useCallback(o=>{const d=r.current;d&&(d.paused?a(o):d.pause())},[r,a]),c=l.useCallback(o=>{r.current.currentTime=o},[r]),p=l.useCallback(()=>{r.current&&(r.current.muted=!r.current.muted)},[r]),g=l.useCallback(o=>{r.current&&(r.current.volume=o)},[r]),s=G.useSyncExternalStore(l.useCallback(o=>{var d;return(d=r.current)==null||d.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},()=>{}),f=G.useSyncExternalStore(l.useCallback(o=>{var d;return(d=r.current)==null||d.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},()=>{}),m=G.useSyncExternalStore(l.useCallback(o=>{var d;return(d=r.current)==null||d.addEventListener("timeupdate",o),()=>{var x;(x=r.current)==null||x.removeEventListener("timeupdate",o)}},[r]),()=>{if(r.current)return Math.round(r.current.currentTime)},()=>{}),y=G.useSyncExternalStore(l.useCallback(o=>{var d;return(d=r.current)==null||d.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},()=>{}),E=G.useSyncExternalStore(l.useCallback(o=>{var d;return(d=r.current)==null||d.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(l.useCallback(o=>{var d,x;return(d=r.current)==null||d.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(l.useCallback(o=>{var d,x;return(d=r.current)==null||d.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:c,toggleMuted:p,setVolume:g,volume:s,muted:f,currentTime:m,duration:y,bufferedSeconds:E,isPlaying:T,isLoading:b}}function ot(e,r){return l.useMemo(()=>{const n={...r};for(const a in e)e[a]!==void 0&&(n[a]=e[a]);return n},[e,r])}function ut(e){const[r,n]=l.useState(e);return l.useEffect(()=>{n(e)},[e]),{mini:r,setMini:n}}function Qe(){const e=l.useRef([]);return l.useEffect(()=>{const n=e.current;return()=>{for(const a of n)clearTimeout(a)}},[]),l.useCallback((n,a)=>{const i=setTimeout(n,a);return e.current.push(i),i},[])}function st(){const e=l.useRef(),[r,n]=l.useState({text:"",style:{opacity:0}}),a=Qe(),i=l.useCallback((c,p=2e3)=>{e.current&&clearTimeout(e.current),n({text:c,style:{opacity:1}}),e.current=a(()=>{n({text:c,style:{opacity:0}})},p)},[a]);return[r,i]}function lt(e){return ct(e.slice())}function ct(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 ft(e,r){const{initialLoop:n="all",initialOrder:a="list"}=r,[i,c]=l.useState(n),[p,g]=l.useState(a),s=l.useMemo(()=>p==="list"?e:lt(e),[e,p]),[f,m]=l.useState(s[0]),y=l.useCallback(d=>d.url,[]),E=l.useMemo(()=>s.findIndex(x=>y(x)===y(f))<s.length-1||i!=="none",[s,f,i,y]),T=l.useCallback(()=>{m(d=>{const x=s.findIndex(C=>y(C)===y(d));return x<s.length-1?s[x+1]:{...s[0]}})},[i,s,y]),b=l.useCallback(()=>{m(d=>{const x=s.indexOf(d);return x>0?s[x-1]:d})},[s]),o=l.useCallback(d=>{m(d)},[]);return l.useEffect(()=>{const d=s.find(x=>y(x)===y(f));m(d||s[0])},[s,y,f]),{list:s,currentSong:f,hasNextSong:E,next:T,previous:b,prioritize:o,order:p,setOrder:g,loop:i,setLoop:c,length:s.length}}function dt(e){const r=ot(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:c,volume:p,autoPlay:g,listMaxHeight:s,listFolded:f,mutex:m,theme:y,border:E}=r,T=l.useMemo(()=>Array.isArray(n)?n:[n],[n]),b=ft(T,{initialLoop:i,initialOrder:c}),[o,d]=st(),{mini:x,setMini:C}=ut(r.mini),S=Qe(),L=l.useRef(),V=l.useCallback(()=>{L.current&&(clearTimeout(L.current),L.current=void 0)},[]),F=l.useRef(!1),q=it({src:b.currentSong.url,initialVolume:p,autoPlay:g,mutex:m,onError(D){const{error:Q}=D.target;Q&&d("An audio error has occurred, player will skip forward in 2 seconds."),b.hasNextSong&&(L.current=S(()=>{b.next()},2e3))},onEnded(){const{list:D,currentSong:Q,loop:le,prioritize:ce,hasNextSong:pe}=b,{audio:Z}=q;if(le==="one"){ce({...Q});return}if(!pe&&le==="none"){F.current=!0,Z.currentTime=0,Z.pause(),Z.src=D[0].url,ce(D[0]);return}b.next()}}),K=b.length>1,k=l.useCallback(()=>{V(),q.togglePlay(b.currentSong.url)},[q,V,b.currentSong.url]),{prioritize:oe}=b,Oe=l.useCallback(D=>{V(),oe(D)},[V,oe]),[Ce,he]=l.useState(()=>K&&!f),[z,H]=l.useState(!0),W=l.useRef(null);l.useEffect(()=>{g&&q.playAudio(b.currentSong.url)},[]);const ue=l.useRef(!0),se=l.useRef(b.currentSong);return l.useEffect(()=>{if(ue.current){ue.current=!1;return}if(F.current){F.current=!1;return}b.currentSong&&(b.loop==="one"||b.currentSong!==se.current)&&(se.current=b.currentSong,q.playAudio(b.currentSong.url))},[b.currentSong]),l.useEffect(()=>{if(a==="fixed"&&W.current){const D=W.current;return D.style.width=`${D.offsetWidth-18}px`,()=>{D.removeAttribute("style")}}},[a]),{bodyRef:W,appearance:a,volume:p,listMaxHeight:s,theme:y,border:E,notice:o,audioControl:q,audio:T,handlePlayButtonClick:k,handlePlayAudioFromList:Oe,isPlaylistOpen:Ce,setPlaylistOpen:he,mini:x,displayLyrics:z,setDisplayLyrics:H,setMini:C,playlist:b,hasPlaylist:K}}function vt(e){var F,q,K;const r=B("aplayer"),{bodyRef:n,appearance:a,volume:i,listMaxHeight:c,theme:p,border:g,notice:s,audio:f,audioControl:m,handlePlayButtonClick:y,handlePlayAudioFromList:E,isPlaylistOpen:T,setPlaylistOpen:b,mini:o,displayLyrics:d,setDisplayLyrics:x,setMini:C,playlist:S,hasPlaylist:L}=dt(e),V=l.useCallback(k=>k?typeof k=="string"?k:k.url?v.jsx("a",{href:k.url,target:"_blank",rel:"noreferrer",children:k.name??"Audio artist"}):k.name??"Audio artist":"Audio artist",[]);return v.jsxs("div",{className:$(r.b(),{[r.bs(p)]:!0,[r.bs("vars")]:!0,[r.bm(a)]:!0,[r.bm("loading")]:m.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")]:g}),role:"region","aria-label":"Audio Player",children:[v.jsxs("div",{ref:n,className:r.be("body"),children:[v.jsx("div",{className:r.be("pic"),onClick:y,style:{backgroundImage:`url("${(F=S.currentSong)==null?void 0:F.cover}")`},role:"button","aria-label":m.isPlaying?"Pause audio":"Play audio",children:v.jsx("div",{className:$(r.be("button"),m.isPlaying?r.bm("pause"):r.bm("play")),role:"presentation",children:m.isPlaying?v.jsx(qr,{}):v.jsx(Kr,{})})}),v.jsxs("div",{className:$(r.be("info")),children:[v.jsxs("div",{className:$(r.be("music")),children:[v.jsx("span",{className:$(r.be("title")),children:((q=S.currentSong)==null?void 0:q.name)??"Audio name"}),v.jsxs("span",{className:$(r.be("author")),children:[" ","-"," ",V((K=S.currentSong)==null?void 0:K.artist)]})]}),a==="fixed"?null:v.jsx(Ge,{show:d,lrcText:S.currentSong.lrc,currentTime:m.currentTime??0}),v.jsx(Qr,{volume:m.volume??i,onChangeVolume:m.setVolume,muted:m.muted??!1,onToggleMuted:()=>m.toggleMuted(),currentTime:m.currentTime,audioDurationSeconds:m.duration,bufferedSeconds:m.bufferedSeconds,onSeek:k=>m.seek(k),onToggleMenu:()=>b(k=>!k),order:S.order,onOrderChange:S.setOrder,loop:S.loop,onLoopChange:S.setLoop,isPlaying:m.isPlaying??!1,onTogglePlay:y,onSkipForward:()=>{S.hasNextSong&&S.next()},onSkipBack:()=>{S.previous()},showLyrics:d,onToggleLyrics:()=>{x(k=>!k)}})]}),v.jsx("div",{className:r.be("notice"),style:s.style,children:s.text}),v.jsx("div",{className:r.be("miniswitcher"),onClick:()=>C(k=>!k),children:v.jsx("button",{className:$(r.bs("icon"),r.bs("icon-right")),type:"button",children:v.jsx(Nr,{})})})]}),L?v.jsx(Zr,{open:T,audio:f,playingAudioUrl:S.currentSong.url,onPlayAudio:E,listMaxHeight:c}):null,a==="fixed"&&v.jsx(Ge,{show:d,lrcText:S.currentSong.lrc,currentTime:m.currentTime??0})]})}Y.TwistAPlayer=vt,Object.defineProperty(Y,Symbol.toStringTag,{value:"Module"})});
|
|
45
|
+
*/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){y||l.startTransition===void 0||(y=!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 d=o();if(!E){var x=o();p(d,x)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),E=!0)}x=g({inst:{value:d,getSnapshot:o}});var C=x[0].inst,S=x[1];return f(function(){C.value=d,C.getSnapshot=o,a(C)&&S({inst:C})},[b,d,o]),s(function(){return a(C)&&S({inst:C}),b(function(){a(C)&&S({inst:C})})},[b]),m(d),d}function a(b){var o=b.getSnapshot;b=b.value;try{var d=o();return!p(b,d)}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 l=c,p=typeof Object.is=="function"?Object.is:r,g=l.useState,s=l.useEffect,f=l.useLayoutEffect,m=l.useDebugValue,y=!1,E=!1,T=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?i:n;je.useSyncExternalStore=l.useSyncExternalStore!==void 0?l.useSyncExternalStore:T,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}(),je}var Xe;function nt(){if(Xe)return me.exports;Xe=1;var e={};return e.NODE_ENV==="production"?me.exports=rt():me.exports=tt(),me.exports}var G=nt();const X=[];function at(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),X.includes(n)||X.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=X.indexOf(n);a!==-1&&X.splice(a,1)}r.current=void 0},[]),r}function it(e){const r=at(e),n=c.useCallback(o=>{for(let d=0;d<X.length;d++){const x=X[d];x!==o&&!x.paused&&x.pause()}},[]),a=c.useCallback(async o=>{var x;const d=r.current;if(d){e.mutex&&n(d),d.src!==o&&(d.pause(),d.currentTime=0,d.src=o);try{await((x=r.current)==null?void 0:x.play())}catch{}}},[r,e.mutex,n]),i=c.useCallback(o=>{const d=r.current;d&&(d.paused?a(o):d.pause())},[r,a]),l=c.useCallback(o=>{r.current.currentTime=o},[r]),p=c.useCallback(()=>{r.current&&(r.current.muted=!r.current.muted)},[r]),g=c.useCallback(o=>{r.current&&(r.current.volume=o)},[r]),s=G.useSyncExternalStore(c.useCallback(o=>{var d;return(d=r.current)==null||d.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},()=>{}),f=G.useSyncExternalStore(c.useCallback(o=>{var d;return(d=r.current)==null||d.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},()=>{}),m=G.useSyncExternalStore(c.useCallback(o=>{var d;return(d=r.current)==null||d.addEventListener("timeupdate",o),()=>{var x;(x=r.current)==null||x.removeEventListener("timeupdate",o)}},[r]),()=>{if(r.current)return Math.round(r.current.currentTime)},()=>{}),y=G.useSyncExternalStore(c.useCallback(o=>{var d;return(d=r.current)==null||d.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},()=>{}),E=G.useSyncExternalStore(c.useCallback(o=>{var d;return(d=r.current)==null||d.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 d,x;return(d=r.current)==null||d.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 d,x;return(d=r.current)==null||d.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:l,toggleMuted:p,setVolume:g,volume:s,muted:f,currentTime:m,duration:y,bufferedSeconds:E,isPlaying:T,isLoading:b}}function ot(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 ut(e){const[r,n]=c.useState(e);return c.useEffect(()=>{n(e)},[e]),{mini:r,setMini:n}}function Qe(){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 st(){const e=c.useRef(),[r,n]=c.useState({text:"",style:{opacity:0}}),a=Qe(),i=c.useCallback((l,p=2e3)=>{e.current&&clearTimeout(e.current),n({text:l,style:{opacity:1}}),e.current=a(()=>{n({text:l,style:{opacity:0}})},p)},[a]);return[r,i]}function lt(e){return ct(e.slice())}function ct(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 ft(e,r){const{initialLoop:n="all",initialOrder:a="list"}=r,[i,l]=c.useState(n),[p,g]=c.useState(a),s=c.useMemo(()=>p==="list"?e:lt(e),[e,p]),[f,m]=c.useState(s[0]),y=c.useCallback(d=>d.url,[]),E=c.useMemo(()=>s.findIndex(x=>y(x)===y(f))<s.length-1||i!=="none",[s,f,i,y]),T=c.useCallback(()=>{m(d=>{const x=s.findIndex(C=>y(C)===y(d));return x<s.length-1?s[x+1]:{...s[0]}})},[i,s,y]),b=c.useCallback(()=>{m(d=>{const x=s.indexOf(d);return x>0?s[x-1]:d})},[s]),o=c.useCallback(d=>{m(d)},[]);return c.useEffect(()=>{const d=s.find(x=>y(x)===y(f));m(d||s[0])},[s,y,f]),{list:s,currentSong:f,hasNextSong:E,next:T,previous:b,prioritize:o,order:p,setOrder:g,loop:i,setLoop:l,length:s.length}}function dt(e){const r=ot(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:l,volume:p,autoPlay:g,listMaxHeight:s,listFolded:f,mutex:m,theme:y,border:E}=r,T=c.useMemo(()=>Array.isArray(n)?n:[n],[n]),b=ft(T,{initialLoop:i,initialOrder:l}),[o,d]=st(),{mini:x,setMini:C}=ut(r.mini),S=Qe(),L=c.useRef(),V=c.useCallback(()=>{L.current&&(clearTimeout(L.current),L.current=void 0)},[]),F=c.useRef(!1),q=it({src:b.currentSong.url,initialVolume:p,autoPlay:g,mutex:m,onError(D){const{error:Q}=D.target;Q&&d("An audio error has occurred, player will skip forward in 2 seconds."),b.hasNextSong&&(L.current=S(()=>{b.next()},2e3))},onEnded(){const{list:D,currentSong:Q,loop:le,prioritize:ce,hasNextSong:pe}=b,{audio:Z}=q;if(le==="one"){ce({...Q});return}if(!pe&&le==="none"){F.current=!0,Z.currentTime=0,Z.pause(),Z.src=D[0].url,ce(D[0]);return}b.next()}}),K=b.length>1,k=c.useCallback(()=>{V(),q.togglePlay(b.currentSong.url)},[q,V,b.currentSong.url]),{prioritize:oe}=b,Oe=c.useCallback(D=>{V(),oe(D)},[V,oe]),[Ce,he]=c.useState(()=>K&&!f),[z,H]=c.useState(!0),W=c.useRef(null);c.useEffect(()=>{g&&q.playAudio(b.currentSong.url)},[]);const ue=c.useRef(!0),se=c.useRef(b.currentSong);return c.useEffect(()=>{if(ue.current){ue.current=!1;return}if(F.current){F.current=!1;return}b.currentSong&&(b.loop==="one"||b.currentSong!==se.current)&&(se.current=b.currentSong,q.playAudio(b.currentSong.url))},[b.currentSong]),c.useEffect(()=>{if(a==="fixed"&&W.current){const D=W.current;return D.style.width=`${D.offsetWidth-18}px`,()=>{D.removeAttribute("style")}}},[a]),{bodyRef:W,appearance:a,volume:p,listMaxHeight:s,theme:y,border:E,notice:o,audioControl:q,audio:T,handlePlayButtonClick:k,handlePlayAudioFromList:Oe,isPlaylistOpen:Ce,setPlaylistOpen:he,mini:x,displayLyrics:z,setDisplayLyrics:H,setMini:C,playlist:b,hasPlaylist:K}}function vt(e){var F,q,K;const r=B("aplayer"),{bodyRef:n,appearance:a,volume:i,listMaxHeight:l,theme:p,border:g,notice:s,audio:f,audioControl:m,handlePlayButtonClick:y,handlePlayAudioFromList:E,isPlaylistOpen:T,setPlaylistOpen:b,mini:o,displayLyrics:d,setDisplayLyrics:x,setMini:C,playlist:S,hasPlaylist:L}=dt(e),V=c.useCallback(k=>k?typeof k=="string"?k:k.url?v.jsx("a",{href:k.url,target:"_blank",rel:"noreferrer",children:k.name??"Audio artist"}):k.name??"Audio artist":"Audio artist",[]);return v.jsxs("div",{className:$(r.b(),{[r.bs(p)]:!0,[r.bs("vars")]:!0,[r.bm(a)]:!0,[r.bm("loading")]:m.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")]:g}),role:"region","aria-label":"Audio Player",children:[v.jsxs("div",{ref:n,className:r.be("body"),children:[v.jsx("div",{className:r.be("pic"),onClick:y,style:{backgroundImage:`url("${(F=S.currentSong)==null?void 0:F.cover}")`},role:"button","aria-label":m.isPlaying?"Pause audio":"Play audio",children:v.jsx("div",{className:$(r.be("button"),m.isPlaying?r.bm("pause"):r.bm("play")),role:"presentation",children:m.isPlaying?v.jsx(qr,{}):v.jsx(Kr,{})})}),v.jsxs("div",{className:$(r.be("info")),children:[v.jsxs("div",{className:$(r.be("music")),children:[v.jsx("span",{className:$(r.be("title")),children:((q=S.currentSong)==null?void 0:q.name)??"Audio name"}),v.jsxs("span",{className:$(r.be("author")),children:[" ","-"," ",V((K=S.currentSong)==null?void 0:K.artist)]})]}),a==="fixed"?null:v.jsx(Ge,{show:d,lrcText:S.currentSong.lrc,currentTime:m.currentTime??0}),v.jsx(Qr,{volume:m.volume??i,onChangeVolume:m.setVolume,muted:m.muted??!1,onToggleMuted:()=>m.toggleMuted(),currentTime:m.currentTime,audioDurationSeconds:m.duration,bufferedSeconds:m.bufferedSeconds,onSeek:k=>m.seek(k),onToggleMenu:()=>b(k=>!k),order:S.order,onOrderChange:S.setOrder,loop:S.loop,onLoopChange:S.setLoop,isPlaying:m.isPlaying??!1,onTogglePlay:y,onSkipForward:()=>{S.hasNextSong&&S.next()},onSkipBack:()=>{S.previous()},showLyrics:d,onToggleLyrics:()=>{x(k=>!k)}})]}),v.jsx("div",{className:r.be("notice"),style:s.style,children:s.text}),v.jsx("div",{className:r.be("miniswitcher"),onClick:()=>C(k=>!k),children:v.jsx("button",{className:$(r.bs("icon"),r.bs("icon-right")),type:"button",children:v.jsx(Nr,{})})})]}),L?v.jsx(Zr,{open:T,audio:f,playingAudioUrl:S.currentSong.url,onPlayAudio:E,listMaxHeight:l}):null,a==="fixed"&&v.jsx(Ge,{show:d,lrcText:S.currentSong.lrc,currentTime:m.currentTime??0})]})}Y.TwistAPlayer=vt,Object.defineProperty(Y,Symbol.toStringTag,{value:"Module"})});
|