twist-aplayer 1.2.1 → 1.3.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/LICENSE.md +20 -20
- package/README.md +139 -139
- package/dist/index.d.ts +39 -22
- package/dist/index.js +12 -12
- package/dist/index.mjs +682 -684
- package/dist/twist-aplayer.umd.js +13 -13
- package/package.json +84 -75
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(H,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):(H=typeof globalThis<"u"?globalThis:H||self,c(H.TwistAPlayer={},H.React))})(this,function(H,c){"use strict";function
|
|
1
|
+
(function(H,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):(H=typeof globalThis<"u"?globalThis:H||self,c(H.TwistAPlayer={},H.React))})(this,function(H,c){"use strict";function yr(e){const t=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(t,n,a.get?a:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const G=yr(c);var ce={exports:{}},Q={};/**
|
|
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
|
|
9
|
+
*/var De;function pr(){if(De)return Q;De=1;var e=c,t=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,d){var x,b={},f=null,h=null;d!==void 0&&(f=""+d),s.key!==void 0&&(f=""+s.key),s.ref!==void 0&&(h=s.ref);for(x in s)a.call(s,x)&&!l.hasOwnProperty(x)&&(b[x]=s[x]);if(E&&E.defaultProps)for(x in s=E.defaultProps,s)b[x]===void 0&&(b[x]=s[x]);return{$$typeof:t,type:E,key:f,ref:h,props:b,_owner:i.current}}return Q.Fragment=n,Q.jsx=p,Q.jsxs=p,Q}var Z={},Ie;function br(){if(Ie)return Z;Ie=1;var e={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,19 +14,19 @@
|
|
|
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 t=c,n=Symbol.for("react.element"),a=Symbol.for("react.portal"),
|
|
18
|
-
`+
|
|
17
|
+
*/return e.NODE_ENV!=="production"&&function(){var t=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"),E=Symbol.for("react.provider"),s=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),b=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),T=Symbol.for("react.offscreen"),o=Symbol.iterator,y="@@iterator";function g(r){if(r===null||typeof r!="object")return null;var u=o&&r[o]||r[y];return typeof u=="function"?u:null}var O=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function S(r){{for(var u=arguments.length,m=new Array(u>1?u-1:0),_=1;_<u;_++)m[_-1]=arguments[_];M("error",r,m)}}function M(r,u,m){{var _=O.ReactDebugCurrentFrame,C=_.getStackAddendum();C!==""&&(u+="%s",m=m.concat([C]));var L=m.map(function(j){return String(j)});L.unshift("Warning: "+u),Function.prototype.apply.call(console[r],console,L)}}var te=!1,U=!1,V=!1,me=!1,Oe=!1,ne;ne=Symbol.for("react.module.reference");function Ce(r){return!!(typeof r=="string"||typeof r=="function"||r===i||r===p||Oe||r===l||r===x||r===b||me||r===T||te||U||V||typeof r=="object"&&r!==null&&(r.$$typeof===h||r.$$typeof===f||r.$$typeof===E||r.$$typeof===s||r.$$typeof===d||r.$$typeof===ne||r.getModuleId!==void 0))}function Pe(r,u,m){var _=r.displayName;if(_)return _;var C=u.displayName||u.name||"";return C!==""?m+"("+C+")":m}function ae(r){return r.displayName||"Context"}function D(r){if(r==null)return null;if(typeof r.tag=="number"&&S("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case i:return"Fragment";case a:return"Portal";case p:return"Profiler";case l:return"StrictMode";case x:return"Suspense";case b:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case s:var u=r;return ae(u)+".Consumer";case E:var m=r;return ae(m._context)+".Provider";case d:return Pe(r,r.render,"ForwardRef");case f:var _=r.displayName||null;return _!==null?_:D(r.type)||"Memo";case h:{var C=r,L=C._payload,j=C._init;try{return D(j(L))}catch{return null}}}return null}var F=Object.assign,B=0,ie,oe,ue,se,le,P,Y;function he(){}he.__reactDisabledLog=!0;function Le(){{if(B===0){ie=console.log,oe=console.info,ue=console.warn,se=console.error,le=console.group,P=console.groupCollapsed,Y=console.groupEnd;var r={configurable:!0,enumerable:!0,value:he,writable:!0};Object.defineProperties(console,{info:r,log:r,warn:r,error:r,group:r,groupCollapsed:r,groupEnd:r})}B++}}function ye(){{if(B--,B===0){var r={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:F({},r,{value:ie}),info:F({},r,{value:oe}),warn:F({},r,{value:ue}),error:F({},r,{value:se}),group:F({},r,{value:le}),groupCollapsed:F({},r,{value:P}),groupEnd:F({},r,{value:Y})})}B<0&&S("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var $e=O.ReactCurrentDispatcher,Ae;function pe(r,u,m){{if(Ae===void 0)try{throw Error()}catch(C){var _=C.stack.trim().match(/\n( *(at )?)/);Ae=_&&_[1]||""}return`
|
|
18
|
+
`+Ae+r}}var Me=!1,be;{var vt=typeof WeakMap=="function"?WeakMap:Map;be=new vt}function rr(r,u){if(!r||Me)return"";{var m=be.get(r);if(m!==void 0)return m}var _;Me=!0;var C=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var L;L=$e.current,$e.current=null,Le();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(z){_=z}Reflect.construct(r,[],j)}else{try{j.call()}catch(z){_=z}r.call(j.prototype)}}else{try{throw Error()}catch(z){_=z}r()}}catch(z){if(z&&_&&typeof z.stack=="string"){for(var w=z.stack.split(`
|
|
19
19
|
`),q=_.stack.split(`
|
|
20
|
-
`),A=w.length-1,
|
|
21
|
-
`+w[A].replace(" at new "," at ");return r.displayName&&R.includes("<anonymous>")&&(R=R.replace("<anonymous>",r.displayName)),typeof r=="function"&&
|
|
20
|
+
`),A=w.length-1,k=q.length-1;A>=1&&k>=0&&w[A]!==q[k];)k--;for(;A>=1&&k>=0;A--,k--)if(w[A]!==q[k]){if(A!==1||k!==1)do if(A--,k--,k<0||w[A]!==q[k]){var R=`
|
|
21
|
+
`+w[A].replace(" at new "," at ");return r.displayName&&R.includes("<anonymous>")&&(R=R.replace("<anonymous>",r.displayName)),typeof r=="function"&&be.set(r,R),R}while(A>=1&&k>=0);break}}}finally{Me=!1,$e.current=L,ye(),Error.prepareStackTrace=C}var X=r?r.displayName||r.name:"",hr=X?pe(X):"";return typeof r=="function"&&be.set(r,hr),hr}function mt(r,u,m){return rr(r,!1)}function ht(r){var u=r.prototype;return!!(u&&u.isReactComponent)}function ge(r,u,m){if(r==null)return"";if(typeof r=="function")return rr(r,ht(r));if(typeof r=="string")return pe(r);switch(r){case x:return pe("Suspense");case b:return pe("SuspenseList")}if(typeof r=="object")switch(r.$$typeof){case d:return mt(r.render);case f:return ge(r.type,u,m);case h:{var _=r,C=_._payload,L=_._init;try{return ge(L(C),u,m)}catch{}}}return""}var Ee=Object.prototype.hasOwnProperty,tr={},nr=O.ReactDebugCurrentFrame;function xe(r){if(r){var u=r._owner,m=ge(r.type,r._source,u?u.type:null);nr.setExtraStackFrame(m)}else nr.setExtraStackFrame(null)}function yt(r,u,m,_,C){{var L=Function.call.bind(Ee);for(var j in r)if(L(r,j)){var w=void 0;try{if(typeof r[j]!="function"){var q=Error((_||"React class")+": "+m+" type `"+j+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof r[j]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw q.name="Invariant Violation",q}w=r[j](u,j,_,m,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(A){w=A}w&&!(w instanceof Error)&&(xe(C),S("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",_||"React class",m,j,typeof w),xe(null)),w instanceof Error&&!(w.message in tr)&&(tr[w.message]=!0,xe(C),S("Failed %s type: %s",m,w.message),xe(null))}}}var pt=Array.isArray;function ke(r){return pt(r)}function bt(r){{var u=typeof Symbol=="function"&&Symbol.toStringTag,m=u&&r[Symbol.toStringTag]||r.constructor.name||"Object";return m}}function gt(r){try{return ar(r),!1}catch{return!0}}function ar(r){return""+r}function ir(r){if(gt(r))return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",bt(r)),ar(r)}var or=O.ReactCurrentOwner,Et={key:!0,ref:!0,__self:!0,__source:!0},ur,sr;function xt(r){if(Ee.call(r,"ref")){var u=Object.getOwnPropertyDescriptor(r,"ref").get;if(u&&u.isReactWarning)return!1}return r.ref!==void 0}function St(r){if(Ee.call(r,"key")){var u=Object.getOwnPropertyDescriptor(r,"key").get;if(u&&u.isReactWarning)return!1}return r.key!==void 0}function _t(r,u){typeof r.ref=="string"&&or.current}function Tt(r,u){{var m=function(){ur||(ur=!0,S("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",u))};m.isReactWarning=!0,Object.defineProperty(r,"key",{get:m,configurable:!0})}}function wt(r,u){{var m=function(){sr||(sr=!0,S("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",u))};m.isReactWarning=!0,Object.defineProperty(r,"ref",{get:m,configurable:!0})}}var jt=function(r,u,m,_,C,L,j){var w={$$typeof:n,type:r,key:u,ref:m,props:j,_owner:L};return w._store={},Object.defineProperty(w._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(w,"_self",{configurable:!1,enumerable:!1,writable:!1,value:_}),Object.defineProperty(w,"_source",{configurable:!1,enumerable:!1,writable:!1,value:C}),Object.freeze&&(Object.freeze(w.props),Object.freeze(w)),w};function Ot(r,u,m,_,C){{var L,j={},w=null,q=null;m!==void 0&&(ir(m),w=""+m),St(u)&&(ir(u.key),w=""+u.key),xt(u)&&(q=u.ref,_t(u,C));for(L in u)Ee.call(u,L)&&!Et.hasOwnProperty(L)&&(j[L]=u[L]);if(r&&r.defaultProps){var A=r.defaultProps;for(L in A)j[L]===void 0&&(j[L]=A[L])}if(w||q){var k=typeof r=="function"?r.displayName||r.name||"Unknown":r;w&&Tt(j,k),q&&wt(j,k)}return jt(r,w,q,C,_,or.current,j)}}var Ne=O.ReactCurrentOwner,lr=O.ReactDebugCurrentFrame;function J(r){if(r){var u=r._owner,m=ge(r.type,r._source,u?u.type:null);lr.setExtraStackFrame(m)}else lr.setExtraStackFrame(null)}var qe;qe=!1;function Re(r){return typeof r=="object"&&r!==null&&r.$$typeof===n}function cr(){{if(Ne.current){var r=D(Ne.current.type);if(r)return`
|
|
22
22
|
|
|
23
|
-
Check the render method of \``+r+"`."}return""}}function Ct(r){return""}var
|
|
23
|
+
Check the render method of \``+r+"`."}return""}}function Ct(r){return""}var fr={};function Pt(r){{var u=cr();if(!u){var m=typeof r=="string"?r:r.displayName||r.name;m&&(u=`
|
|
24
24
|
|
|
25
|
-
Check the top-level render call using <`+m+">.")}return u}}function
|
|
26
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
27
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var l,y=!0,b=!1;return{s:function(){n=n.call(e)},n:function(){var d=n.next();return y=d.done,d},e:function(d){b=!0,l=d},f:function(){try{y||n.return==null||n.return()}finally{if(b)throw l}}}}function Fe(e,t){if(e){if(typeof e=="string")return Be(e,t);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)?Be(e,t):void 0}}function Be(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n<t;n++)a[n]=e[n];return a}function fe(){return fe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)({}).hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},fe.apply(null,arguments)}function ze(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,a)}return n}function re(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ze(Object(n),!0).forEach(function(a){wr(e,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ze(Object(n)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))})}return e}function wr(e,t,n){return(t=jr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jr(e){var t=Or(e,"string");return ee(t)=="symbol"?t:t+""}function Or(e,t){if(ee(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var a=n.call(e,t);if(ee(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Cr(e,t){if(e==null)return{};var n,a,o=Pr(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(a=0;a<l.length;a++)n=l[a],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Pr(e,t){if(e==null)return{};var n={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.includes(a))continue;n[a]=e[a]}return n}function Lr(e){var t=e.attrs,n=e.size,a=e.title,o=e.spin,l=e.rotate,y=e.color,b=Cr(e,gr),s=function(E){var g=n||E.size||"1em",f,h="",T="";return E.className&&(f=E.className),e.className&&(f=f?"".concat(f," ").concat(e.className):e.className),o&&(f?f+=" twist-icon-loading":f="twist-icon-loading"),l&&(h="rotate(".concat(l,"deg)"),T="rotate(".concat(l,"deg)")),Y.createElement("svg",fe({xmlns:"http://www.w3.org/2000/svg"},E.attrs,t,b,{className:f,style:re(re({color:y||E.color,msTransform:h,transform:T},E.style),e.style),width:g,height:g}),a&&Y.createElement("title",null,a),e.children)};return _e!==void 0?Y.createElement(_e.Consumer,null,function(d){return s(d)}):s(Ie)}function $r(e){var t={},n=e.split(";"),a=Tr(n),o;try{for(a.s();!(o=a.n()).done;){var l=o.value,y=l.split(":"),b=Er(y,2),s=b[0],d=b[1];if(s&&d){var E=s.trim().replace(/-./g,function(g){return g.charAt(1).toUpperCase()});t[E]=d.trim()}}}catch(g){a.e(g)}finally{a.f()}return t}function He(e){return e&&e.map(function(t,n){return Y.createElement(t.tag,re(re({},t.attrs),{},{key:n,style:t.attrs.style?$r(t.attrs.style):null}),He(t.children))})}function k(e){return function(t){return Y.createElement(Lr,fe({attrs:re({},e.attrs)},t),He(e.children))}}function Ar(e){return k({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M12 2.25c-5.384 0-9.75 4.366-9.75 9.75s4.366 9.75 9.75 9.75v-2.437A7.312 7.312 0 1 1 19.313 12h2.437c0-5.384-4.366-9.75-9.75-9.75"}}]})(e)}function Mr(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 Ue(e){var t,n,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Ue(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function $(){for(var e,t,n=0,a="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Ue(e))&&(a&&(a+=" "),a+=t);return a}function Nr({bufferedPercentage:e,playedPercentage:t,onSeek:n}){const a=V("aplayer-bar"),o=V("aplayer-icon"),l=c.useRef(null),[y,b]=c.useState(t),s=c.useRef(!1);c.useEffect(()=>{s.current||b(t)},[t]);const d=c.useCallback(E=>{s.current=!0;const g=Ee(E,l);b(g);const f=T=>{const i=Ee(T,l);b(i)},h=T=>{document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",h);const i=Ee(T,l);b(i),n==null||n(i),s.current=!1};document.addEventListener("mousemove",f),document.addEventListener("mouseup",h)},[n]);return v.jsx("div",{ref:l,className:$(a.b(),a.bs("vars")),onMouseDown:d,role:"slider","aria-label":"Audio progress","aria-valuenow":y?y*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 y<"u"?v.jsx("div",{className:a.be("played"),style:{width:`${y*100}%`},children:v.jsx("span",{className:a.be("thumb"),children:v.jsx("span",{className:$(o.bs("loading")),children:v.jsx(Ar,{})})})}):null]})})}function kr(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 qr(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 Rr(e){return k({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M14 19V5h4v14zm-8 0V5h4v14z"}}]})(e)}function Dr(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 Vr(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 Ir(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 Fr(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 Br(e){return k({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M7 15V9h4l5-5v16l-5-5z"}}]})(e)}function zr(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 Hr({volume:e,muted:t,onToggleMuted:n,onChangeVolume:a}){const o=V("aplayer-volumn"),l=V("aplayer-icon"),y=c.useRef(null),[b,s]=c.useState(!1),d=c.useCallback(E=>{a(xe(E,y)),s(!0);const g=h=>{a(xe(h,y))},f=h=>{document.removeEventListener("mouseup",f),document.removeEventListener("mousemove",g),s(!1),a(xe(h,y))};document.addEventListener("mousemove",g),document.addEventListener("mouseup",f)},[a]);return v.jsxs("div",{className:$(o.b(),o.bs("vars")),children:[v.jsx("button",{type:"button",className:$(l.b(),l.bs("volume-down")),onClick:()=>n(),"aria-label":t||!e?"Muted":"unMuted",children:t||!e?v.jsx(Br,{}):e>=1?v.jsx(zr,{}):v.jsx(Fr,{})}),v.jsx("div",{className:$(o.be("bar-wrap"),{[o.bem("bar-wrap","active")]:b}),ref:y,onMouseDown:d,children:v.jsx("div",{className:o.be("bar"),children:v.jsx("div",{className:o.be("thumb"),style:{height:t?0:`${e*100}%`}})})})]})}function We(e){if(typeof e>"u")return"--:--";if(Number.isNaN(e))return"00:00";const t=y=>y<10?`0${y}`:`${y}`,n=Math.trunc(e/60),a=Math.trunc(e-n*60),o=Math.trunc(n/60),l=Math.trunc(e/60-60*Math.trunc(e/60/60));return e>=3600?`${t(o)}:${t(l)}:${t(a)}`:`${t(n)}:${t(a)}`}function Ur(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 Wr(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 Yr(e){return k({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"}}]})(e)}function Gr(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 Kr(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 Jr({volume:e,onChangeVolume:t,muted:n,currentTime:a,audioDurationSeconds:o,bufferedSeconds:l,onToggleMenu:y,onToggleMuted:b,order:s,onOrderChange:d,loop:E,onLoopChange:g,onSeek:f,isPlaying:h,onTogglePlay:T,onSkipForward:i,onSkipBack:p,showLyrics:S=!0,onToggleLyrics:P}){const x=V("aplayer-controller"),M=V("aplayer-icon"),te=c.useCallback(()=>{const I={list:"random",random:"list"}[s];d(I)},[s,d]),W=c.useCallback(()=>{const I={all:"one",one:"none",none:"all"}[E];g(I)},[E,g]);return v.jsxs("div",{className:$(x.b(),x.bs("vars")),role:"group","aria-label":"Audio Controls",children:[v.jsx(Nr,{playedPercentage:typeof a>"u"||typeof o>"u"?void 0:a/o,bufferedPercentage:typeof l>"u"||typeof o>"u"?void 0:l/o,onSeek:I=>f==null?void 0:f(I*o)}),v.jsxs("div",{className:x.be("time"),children:[v.jsxs("span",{className:x.be("time-inner"),"aria-live":"polite",children:[v.jsx("span",{className:x.be("ptime"),children:We(a)})," / ",v.jsx("span",{className:x.be("dtime"),children:We(o)})]}),v.jsx("button",{className:$(M.b(),M.bs("back")),onClick:p,type:"button","aria-label":"Previous track",children:v.jsx(Ur,{})}),v.jsx("button",{className:$(M.b(),M.bs("play")),onClick:T,type:"button","aria-label":h?"Pause audio":"Play audio",children:h?v.jsx(Rr,{}):v.jsx(Dr,{})}),v.jsx("button",{className:$(M.b(),M.bs("forward")),onClick:i,type:"button","aria-label":"Next track",children:v.jsx(Wr,{})}),v.jsx(Hr,{volume:e,muted:n,onToggleMuted:b,onChangeVolume:t}),v.jsx("button",{className:$(M.b(),M.bs("order")),onClick:te,type:"button","aria-label":`Playback order: ${s}`,children:{list:v.jsx(kr,{}),random:v.jsx(Kr,{})}[s]}),v.jsx("button",{className:$(M.b(),M.bs("order")),onClick:W,type:"button","aria-label":`Loop mode: ${E}`,children:{all:v.jsx(Ir,{}),one:v.jsx(Vr,{}),none:v.jsx(Gr,{})}[E]}),v.jsx("button",{type:"button",className:$(M.b(),M.bs("menu")),onClick:()=>y==null?void 0:y(),"aria-label":"Toggle playlist menu",children:v.jsx(Yr,{})}),v.jsx("button",{type:"button",className:$(M.b(),M.bs("lrc"),{[M.ns("lrc-inactivity")]:!S}),onClick:P,"aria-label":S?"Hide lyrics":"Show lyrics","aria-pressed":S,children:v.jsx(qr,{})})]})]})}function Xr({open:e,audio:t,playingAudioUrl:n,onPlayAudio:a,listMaxHeight:o}){const l=V("aplayer-list"),y=o?{maxHeight:o}:void 0,b=c.useCallback(d=>d?typeof d=="string"?d:d.name??"Audio artist":"Audio artist",[]),s=c.useRef(null);return c.useEffect(()=>{if(s.current){const d=s.current;return d.style.maxHeight=`${Math.min(d.scrollHeight,o??1/0)}px`,()=>{d.removeAttribute("style")}}},[o]),v.jsx("div",{ref:s,className:$(l.b(),{[l.bm("hide")]:!e}),"aria-label":"Audio playlist","aria-live":"polite",children:v.jsx("ol",{style:y,children:t.map((d,E)=>v.jsxs("li",{className:$({[l.bm("active")]:d.url===n}),onClick:()=>{d.url!==n&&(a==null||a(d))},role:"button","aria-label":`${d.name??"Audio name"} by ${b(d.artist)}}`,children:[v.jsx("span",{className:l.be("cur")}),v.jsx("span",{className:l.be("index"),children:E+1}),v.jsx("span",{className:l.be("title"),children:d.name??"Audio name"}),v.jsx("span",{className:l.be("author"),children:b(d.artist)})]},d.name||E))})})}function Ye({show:e,lrcText:t,currentTime:n}){const a=V("aplayer-lrc"),o=c.useMemo(()=>Qr(t),[t]),l=c.useMemo(()=>{for(let b=0;b<o.length;b++){const s=o[b],d=o[b+1];if(n>=s[0]&&(!d||n<d[0]))return b}return 0},[n,o]),y=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:t?v.jsx("div",{className:a.be("contents"),style:y,children:o.map(([,b],s)=>v.jsx("p",{className:$({[a.be("current")]:s===l}),children:b},s))}):null})}function Qr(e){if(e){e=e.replace(/([^\]^\n])\[/g,(o,l)=>`${l}
|
|
25
|
+
Check the top-level render call using <`+m+">.")}return u}}function dr(r,u){{if(!r._store||r._store.validated||r.key!=null)return;r._store.validated=!0;var m=Pt(u);if(fr[m])return;fr[m]=!0;var _="";r&&r._owner&&r._owner!==Ne.current&&(_=" It was passed a child from "+D(r._owner.type)+"."),J(r),S('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',m,_),J(null)}}function vr(r,u){{if(typeof r!="object")return;if(ke(r))for(var m=0;m<r.length;m++){var _=r[m];Re(_)&&dr(_,u)}else if(Re(r))r._store&&(r._store.validated=!0);else if(r){var C=g(r);if(typeof C=="function"&&C!==r.entries)for(var L=C.call(r),j;!(j=L.next()).done;)Re(j.value)&&dr(j.value,u)}}}function Lt(r){{var u=r.type;if(u==null||typeof u=="string")return;var m;if(typeof u=="function")m=u.propTypes;else if(typeof u=="object"&&(u.$$typeof===d||u.$$typeof===f))m=u.propTypes;else return;if(m){var _=D(u);yt(m,r.props,"prop",_,r)}else if(u.PropTypes!==void 0&&!qe){qe=!0;var C=D(u);S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",C||"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 $t(r){{for(var u=Object.keys(r.props),m=0;m<u.length;m++){var _=u[m];if(_!=="children"&&_!=="key"){J(r),S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",_),J(null);break}}r.ref!==null&&(J(r),S("Invalid attribute `ref` supplied to `React.Fragment`."),J(null))}}function mr(r,u,m,_,C,L){{var j=Ce(r);if(!j){var w="";(r===void 0||typeof r=="object"&&r!==null&&Object.keys(r).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 q=Ct();q?w+=q:w+=cr();var A;r===null?A="null":ke(r)?A="array":r!==void 0&&r.$$typeof===n?(A="<"+(D(r.type)||"Unknown")+" />",w=" Did you accidentally export a JSX literal instead of a component?"):A=typeof r,S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",A,w)}var k=Ot(r,u,m,C,L);if(k==null)return k;if(j){var R=u.children;if(R!==void 0)if(_)if(ke(R)){for(var X=0;X<R.length;X++)vr(R[X],r);Object.freeze&&Object.freeze(R)}else S("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else vr(R,r)}return r===i?$t(k):Lt(k),k}}function At(r,u,m){return mr(r,u,m,!0)}function Mt(r,u,m){return mr(r,u,m,!1)}var kt=Mt,Nt=At;Z.Fragment=i,Z.jsx=kt,Z.jsxs=Nt}(),Z}var Ve;function gr(){if(Ve)return ce.exports;Ve=1;var e={};return e.NODE_ENV==="production"?ce.exports=pr():ce.exports=br(),ce.exports}var v=gr(),fe=e=>`--${e}`,Fe=e=>`var(--${e})`,Be=(e,t)=>`--${e}: ${t};`;function Er(e,t){const n=a=>t;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=>fe(`${n()}-${e}-${a}`),cvm:(a,i={})=>{const l=n();for(const p of Object.keys(a))i[fe(`${l}-${e}-${p}`)]=a[p];return i},gcv:a=>Fe(`${n()}-${e}-${a}`),scv:(a,i)=>Be(`${n()}-${e}-${a}`,i),nv:a=>fe(`${n()}-${a}`),nvm:(a,i={})=>{const l=n();for(const p of Object.keys(a))i[fe(`${l}-${p}`)]=a[p];return i},gnv:a=>Fe(`${n()}-${a}`),snv:(a,i)=>Be(`${n()}-${a}`,i)}}function I(e){return c.useMemo(()=>Er(e,"twist"),[e])}function Se(e,t){if(!t.current)return 0;let n=(e.clientX-t.current.getBoundingClientRect().left)/t.current.clientWidth;return n=Math.max(n,0),n=Math.min(n,1),n=Math.floor(n*100)/100,n}function _e(e,t){if(!t.current)return 0;let n=1-(e.clientY-t.current.getBoundingClientRect().top)/t.current.clientHeight;return n=Math.max(n,0),n=Math.min(n,1),n=Math.floor(n*100)/100,n}var ze={color:void 0,size:void 0,className:void 0,style:void 0,attrs:void 0},Te=G.createContext(ze);Te.Provider;function ee(e){"@babel/helpers - typeof";return ee=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ee(e)}var xr=["attrs","size","title","spin","rotate","color"];function Sr(e,t){return wr(e)||Tr(e,t)||He(e,t)||_r()}function _r(){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 Tr(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var a,i,l,p,E=[],s=!0,d=!1;try{if(l=(n=n.call(e)).next,t!==0)for(;!(s=(a=l.call(n)).done)&&(E.push(a.value),E.length!==t);s=!0);}catch(x){d=!0,i=x}finally{try{if(!s&&n.return!=null&&(p=n.return(),Object(p)!==p))return}finally{if(d)throw i}}return E}}function wr(e){if(Array.isArray(e))return e}function jr(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=He(e))||t){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(d){throw d},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 d=n.next();return p=d.done,d},e:function(d){E=!0,l=d},f:function(){try{p||n.return==null||n.return()}finally{if(E)throw l}}}}function He(e,t){if(e){if(typeof e=="string")return We(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?We(e,t):void 0}}function We(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n<t;n++)a[n]=e[n];return a}function de(){return de=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)({}).hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},de.apply(null,arguments)}function Ue(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,a)}return n}function re(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ue(Object(n),!0).forEach(function(a){Or(e,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ue(Object(n)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))})}return e}function Or(e,t,n){return(t=Cr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cr(e){var t=Pr(e,"string");return ee(t)=="symbol"?t:t+""}function Pr(e,t){if(ee(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var a=n.call(e,t);if(ee(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Lr(e,t){if(e==null)return{};var n,a,i=$r(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(a=0;a<l.length;a++)n=l[a],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function $r(e,t){if(e==null)return{};var n={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.includes(a))continue;n[a]=e[a]}return n}function Ar(e){var t=e.attrs,n=e.size,a=e.title,i=e.spin,l=e.rotate,p=e.color,E=Lr(e,xr),s=function(x){var b=n||x.size||"1em",f,h="",T="";return x.className&&(f=x.className),e.className&&(f=f?"".concat(f," ").concat(e.className):e.className),i&&(f?f+=" twist-icon-loading":f="twist-icon-loading"),l&&(h="rotate(".concat(l,"deg)"),T="rotate(".concat(l,"deg)")),G.createElement("svg",de({xmlns:"http://www.w3.org/2000/svg"},x.attrs,t,E,{className:f,style:re(re({color:p||x.color,msTransform:h,transform:T},x.style),e.style),width:b,height:b}),a&&G.createElement("title",null,a),e.children)};return Te!==void 0?G.createElement(Te.Consumer,null,function(d){return s(d)}):s(ze)}function Mr(e){var t={},n=e.split(";"),a=jr(n),i;try{for(a.s();!(i=a.n()).done;){var l=i.value,p=l.split(":"),E=Sr(p,2),s=E[0],d=E[1];if(s&&d){var x=s.trim().replace(/-./g,function(b){return b.charAt(1).toUpperCase()});t[x]=d.trim()}}}catch(b){a.e(b)}finally{a.f()}return t}function Ye(e){return e&&e.map(function(t,n){return G.createElement(t.tag,re(re({},t.attrs),{},{key:n,style:t.attrs.style?Mr(t.attrs.style):null}),Ye(t.children))})}function N(e){return function(t){return G.createElement(Ar,de({attrs:re({},e.attrs)},t),Ye(e.children))}}function kr(e){return N({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M12 2.25c-5.384 0-9.75 4.366-9.75 9.75s4.366 9.75 9.75 9.75v-2.437A7.312 7.312 0 1 1 19.313 12h2.437c0-5.384-4.366-9.75-9.75-9.75"}}]})(e)}function Nr(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 Ge(e){var t,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(t=0;t<i;t++)e[t]&&(n=Ge(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function $(){for(var e,t,n=0,a="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Ge(e))&&(a&&(a+=" "),a+=t);return a}function qr({bufferedPercentage:e,playedPercentage:t,onSeek:n}){const a=I("aplayer-bar"),i=I("aplayer-icon"),l=c.useRef(null),[p,E]=c.useState(t),s=c.useRef(!1);c.useEffect(()=>{s.current||E(t)},[t]);const d=c.useCallback(x=>{s.current=!0;const b=Se(x,l);E(b);const f=T=>{const o=Se(T,l);E(o)},h=T=>{document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",h);const o=Se(T,l);E(o),n==null||n(o),s.current=!1};document.addEventListener("mousemove",f),document.addEventListener("mouseup",h)},[n]);return v.jsx("div",{ref:l,className:$(a.b(),a.bs("vars")),onMouseDown:d,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 Rr(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 Dr(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 Ir(e){return N({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M14 19V5h4v14zm-8 0V5h4v14z"}}]})(e)}function Vr(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 Fr(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 Br(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 zr(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 Hr(e){return N({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M7 15V9h4l5-5v16l-5-5z"}}]})(e)}function Wr(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 Ur({volume:e,muted:t,onToggleMuted:n,onChangeVolume:a}){const i=I("aplayer-volumn"),l=I("aplayer-icon"),p=c.useRef(null),[E,s]=c.useState(!1),d=c.useCallback(x=>{a(_e(x,p)),s(!0);const b=h=>{a(_e(h,p))},f=h=>{document.removeEventListener("mouseup",f),document.removeEventListener("mousemove",b),s(!1),a(_e(h,p))};document.addEventListener("mousemove",b),document.addEventListener("mouseup",f)},[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":t||!e?"Muted":"unMuted",children:t||!e?v.jsx(Hr,{}):e>=1?v.jsx(Wr,{}):v.jsx(zr,{})}),v.jsx("div",{className:$(i.be("bar-wrap"),{[i.bem("bar-wrap","active")]:E}),ref:p,onMouseDown:d,children:v.jsx("div",{className:i.be("bar"),children:v.jsx("div",{className:i.be("thumb"),style:{height:t?0:`${e*100}%`}})})})]})}function Ke(e){if(typeof e>"u")return"--:--";if(Number.isNaN(e))return"00:00";const t=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?`${t(i)}:${t(l)}:${t(a)}`:`${t(n)}:${t(a)}`}function Yr(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 Gr(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 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"}}]})(e)}function Jr(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 Xr(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 Qr({volume:e,onChangeVolume:t,muted:n,currentTime:a,audioDurationSeconds:i,bufferedSeconds:l,onToggleMenu:p,onToggleMuted:E,order:s,onOrderChange:d,loop:x,onLoopChange:b,onSeek:f,isPlaying:h,onTogglePlay:T,onSkipForward:o,onSkipBack:y,showLyrics:g=!0,onToggleLyrics:O}){const S=I("aplayer-controller"),M=I("aplayer-icon"),te=c.useCallback(()=>{const V={list:"random",random:"list"}[s];d(V)},[s,d]),U=c.useCallback(()=>{const V={all:"one",one:"none",none:"all"}[x];b(V)},[x,b]);return v.jsxs("div",{className:$(S.b(),S.bs("vars")),role:"group","aria-label":"Audio Controls",children:[v.jsx(qr,{playedPercentage:typeof a>"u"||typeof i>"u"?void 0:a/i,bufferedPercentage:typeof l>"u"||typeof i>"u"?void 0:l/i,onSeek:V=>f==null?void 0:f(V*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:Ke(a)})," / ",v.jsx("span",{className:S.be("dtime"),children:Ke(i)})]}),v.jsx("button",{className:$(M.b(),M.bs("back")),onClick:y,type:"button","aria-label":"Previous track",children:v.jsx(Yr,{})}),v.jsx("button",{className:$(M.b(),M.bs("play")),onClick:T,type:"button","aria-label":h?"Pause audio":"Play audio",children:h?v.jsx(Ir,{}):v.jsx(Vr,{})}),v.jsx("button",{className:$(M.b(),M.bs("forward")),onClick:o,type:"button","aria-label":"Next track",children:v.jsx(Gr,{})}),v.jsx(Ur,{volume:e,muted:n,onToggleMuted:E,onChangeVolume:t}),v.jsx("button",{className:$(M.b(),M.bs("order")),onClick:te,type:"button","aria-label":`Playback order: ${s}`,children:{list:v.jsx(Rr,{}),random:v.jsx(Xr,{})}[s]}),v.jsx("button",{className:$(M.b(),M.bs("order")),onClick:U,type:"button","aria-label":`Loop mode: ${x}`,children:{all:v.jsx(Br,{}),one:v.jsx(Fr,{}),none:v.jsx(Jr,{})}[x]}),v.jsx("button",{type:"button",className:$(M.b(),M.bs("menu")),onClick:()=>p==null?void 0:p(),"aria-label":"Toggle playlist menu",children:v.jsx(Kr,{})}),v.jsx("button",{type:"button",className:$(M.b(),M.bs("lrc"),{[M.ns("lrc-inactivity")]:!g}),onClick:O,"aria-label":g?"Hide lyrics":"Show lyrics","aria-pressed":g,children:v.jsx(Dr,{})})]})]})}function Zr({open:e,audio:t,playingAudioUrl:n,onPlayAudio:a,listMaxHeight:i}){const l=I("aplayer-list"),p=i?{maxHeight:i}:void 0,E=c.useCallback(d=>d?typeof d=="string"?d:d.name??"Audio artist":"Audio artist",[]),s=c.useRef(null);return c.useEffect(()=>{if(s.current){const d=s.current;return d.style.maxHeight=`${Math.min(d.scrollHeight,i??1/0)}px`,()=>{d.removeAttribute("style")}}},[i]),v.jsx("div",{ref:s,className:$(l.b(),{[l.bm("hide")]:!e}),"aria-label":"Audio playlist","aria-live":"polite",children:v.jsx("ol",{style:p,children:t.map((d,x)=>v.jsxs("li",{className:$({[l.bm("active")]:d.url===n}),onClick:()=>{d.url!==n&&(a==null||a(d))},role:"button","aria-label":`${d.name??"Audio name"} by ${E(d.artist)}}`,children:[v.jsx("span",{className:l.be("cur")}),v.jsx("span",{className:l.be("index"),children:x+1}),v.jsx("span",{className:l.be("title"),children:d.name??"Audio name"}),v.jsx("span",{className:l.be("author"),children:E(d.artist)})]},d.name||x))})})}function Je({show:e,lrcText:t,currentTime:n}){const a=I("aplayer-lrc"),i=c.useMemo(()=>et(t),[t]),l=c.useMemo(()=>{for(let E=0;E<i.length;E++){const s=i[E],d=i[E+1];if(n>=s[0]&&(!d||n<d[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:$(a.b(),{[a.bm("hide")]:!e}),children:t?v.jsx("div",{className:a.be("contents"),style:p,children:i.map(([,E],s)=>v.jsx("p",{className:$({[a.be("current")]:s===l}),children:E},s))}):null})}function et(e){if(e){e=e.replace(/([^\]^\n])\[/g,(i,l)=>`${l}
|
|
28
28
|
[`);const t=e.split(`
|
|
29
|
-
`),n=[],a=t.length;for(let
|
|
29
|
+
`),n=[],a=t.length;for(let i=0;i<a;i++){const l=t[i].match(/\[(\d{2}):(\d{2})(\.(\d{2,3}))?\]/g),p=t[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 d=/\[(\d{2}):(\d{2})(\.(\d{2,3}))?\]/.exec(l[s]),x=d[1]*60,b=Number.parseInt(d[2]),f=d[4]?Number.parseInt(d[4])/(`${d[4]}`.length===2?100:1e3):0,h=x+b+f;n.push([h,p])}}}return n.sort((i,l)=>i[0]-l[0]),n}else return[]}var ve={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
|
|
37
|
+
*/var Xe;function rt(){if(Xe)return we;Xe=1;var e=c;function t(b,f){return b===f&&(b!==0||1/b===1/f)||b!==b&&f!==f}var n=typeof Object.is=="function"?Object.is:t,a=e.useState,i=e.useEffect,l=e.useLayoutEffect,p=e.useDebugValue;function E(b,f){var h=f(),T=a({inst:{value:h,getSnapshot:f}}),o=T[0].inst,y=T[1];return l(function(){o.value=h,o.getSnapshot=f,s(o)&&y({inst:o})},[b,h,f]),i(function(){return s(o)&&y({inst:o}),b(function(){s(o)&&y({inst:o})})},[b]),p(h),h}function s(b){var f=b.getSnapshot;b=b.value;try{var h=f();return!n(b,h)}catch{return!0}}function d(b,f){return f()}var x=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:E;return we.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:x,we}var je={},Qe;function tt(){if(Qe)return je;Qe=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 t(T,i){return T===i&&(T!==0||1/T===1/i)||T!==T&&i!==i}function n(T,i){g||l.startTransition===void 0||(g=!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 p=i();if(!f){var S=i();y(p,S)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}S=b({inst:{value:p,getSnapshot:i}});var P=S[0].inst,x=S[1];return d(function(){P.value=p,P.getSnapshot=i,a(P)&&x({inst:P})},[T,p,i]),s(function(){return a(P)&&x({inst:P}),T(function(){a(P)&&x({inst:P})})},[T]),E(p),p}function a(T){var i=T.getSnapshot;T=T.value;try{var p=i();return!y(T,p)}catch{return!0}}function o(T,i){return i()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var l=c,y=typeof Object.is=="function"?Object.is:t,b=l.useState,s=l.useEffect,d=l.useLayoutEffect,E=l.useDebugValue,g=!1,f=!1,h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?o:n;Te.useSyncExternalStore=l.useSyncExternalStore!==void 0?l.useSyncExternalStore:h,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}(),Te}var Je;function rt(){if(Je)return de.exports;Je=1;var e={};return e.NODE_ENV==="production"?de.exports=Zr():de.exports=et(),de.exports}var U=rt();const G=[];function tt(e){const t=c.useRef();return c.useEffect(()=>{if(typeof window<"u"&&!t.current){const n=t.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),G.includes(n)||G.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=t.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=t.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=t.current;if(n){n.pause(),n.currentTime=0;const a=G.indexOf(n);a!==-1&&G.splice(a,1)}t.current=void 0},[]),t}function nt(e){const t=tt(e),n=c.useCallback(i=>{for(let p=0;p<G.length;p++){const S=G[p];S!==i&&!S.paused&&S.pause()}},[]),a=c.useCallback(async i=>{var S;const p=t.current;if(p){e.mutex&&n(p),p.src!==i&&(p.pause(),p.currentTime=0,p.src=i);try{await((S=t.current)==null?void 0:S.play())}catch{}}},[t,e.mutex,n]),o=c.useCallback(i=>{const p=t.current;p&&(p.paused?a(i):p.pause())},[t,a]),l=c.useCallback(i=>{t.current.currentTime=i},[t]),y=c.useCallback(()=>{t.current&&(t.current.muted=!t.current.muted)},[t]),b=c.useCallback(i=>{t.current&&(t.current.volume=i)},[t]),s=U.useSyncExternalStore(c.useCallback(i=>{var p;return(p=t.current)==null||p.addEventListener("volumechange",i),()=>{var S;(S=t.current)==null||S.removeEventListener("volumechange",i)}},[t]),()=>{var i;return(i=t.current)==null?void 0:i.volume},()=>{}),d=U.useSyncExternalStore(c.useCallback(i=>{var p;return(p=t.current)==null||p.addEventListener("volumechange",i),()=>{var S;(S=t.current)==null||S.removeEventListener("volumechange",i)}},[t]),()=>{var i;return(i=t.current)==null?void 0:i.muted},()=>{}),E=U.useSyncExternalStore(c.useCallback(i=>{var p;return(p=t.current)==null||p.addEventListener("timeupdate",i),()=>{var S;(S=t.current)==null||S.removeEventListener("timeupdate",i)}},[t]),()=>{if(t.current)return Math.round(t.current.currentTime)},()=>{}),g=U.useSyncExternalStore(c.useCallback(i=>{var p;return(p=t.current)==null||p.addEventListener("durationchange",i),()=>{var S;(S=t.current)==null||S.removeEventListener("durationchange",i)}},[t]),()=>{var i;return(i=t.current)==null?void 0:i.duration},()=>{}),f=U.useSyncExternalStore(c.useCallback(i=>{var p;return(p=t.current)==null||p.addEventListener("progress",i),()=>{var S;(S=t.current)==null||S.removeEventListener("progress",i)}},[t]),()=>{const i=t.current;return i&&i.buffered.length>0?i.buffered.end(i.buffered.length-1):0},()=>{}),h=U.useSyncExternalStore(c.useCallback(i=>{var p,S;return(p=t.current)==null||p.addEventListener("play",i),(S=t.current)==null||S.addEventListener("pause",i),()=>{var P,x;(P=t.current)==null||P.removeEventListener("play",i),(x=t.current)==null||x.removeEventListener("pause",i)}},[t]),()=>{const i=t.current;return i?!i.paused:!1},()=>{}),T=U.useSyncExternalStore(c.useCallback(i=>{var p,S;return(p=t.current)==null||p.addEventListener("playing",i),(S=t.current)==null||S.addEventListener("waiting",i),()=>{var P,x;(P=t.current)==null||P.removeEventListener("playing",i),(x=t.current)==null||x.removeEventListener("waiting",i)}},[t]),()=>{const i=t.current;return i?i.networkState===i.NETWORK_LOADING:!1},()=>{});return{playAudio:a,togglePlay:o,seek:l,toggleMuted:y,setVolume:b,volume:s,muted:d,currentTime:E,duration:g,bufferedSeconds:f,isPlaying:h,isLoading:T}}function Xe(){const e=c.useRef([]);return c.useEffect(()=>{const n=e.current;return()=>{for(const a of n)clearTimeout(a)}},[]),c.useCallback((n,a)=>{const o=setTimeout(n,a);return e.current.push(o),o},[])}function at(){const e=c.useRef(),[t,n]=c.useState({text:"",style:{opacity:0}}),a=Xe(),o=c.useCallback((l,y=2e3)=>{e.current&&clearTimeout(e.current),n({text:l,style:{opacity:1}}),e.current=a(()=>{n({text:l,style:{opacity:0}})},y)},[a]);return[t,o]}function it(e){return ot(e.slice())}function ot(e){let t=e.length,n;for(;t!==0;)n=Math.floor(Math.random()*t),t--,[e[t],e[n]]=[e[n],e[t]];return e}function ut(e,{initialLoop:t="all",initialOrder:n="list",getSongId:a}){const[o,l]=c.useState(t),[y,b]=c.useState(n),s=c.useMemo(()=>y==="list"?e:it(e),[e,y]),[d,E]=c.useState(s[0]);c.useEffect(()=>{const i=s.find(p=>a(p)===a(d));E(i||s[0])},[s,a,d]);const g=c.useMemo(()=>{if(o==="one")return{...d};const i=s.indexOf(d);if(i<s.length-1)return s[i+1];if(o!=="none")return s[0]},[s,d,o]),f=c.useCallback(()=>{g&&E(g)},[g]),h=c.useCallback(()=>{E(i=>{const p=s.indexOf(i);return p>0?s[p-1]:i})},[s]),T=c.useCallback(i=>{E(i)},[]);return{currentSong:d,hasNextSong:typeof g<"u",next:f,previous:h,prioritize:T,order:y,setOrder:b,loop:o,setLoop:l,length:s.length}}function st(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 lt(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 ct({audio:e,appearance:t="normal",volume:n=.7,initialLoop:a,initialOrder:o,autoPlay:l=!1,listMaxHeight:y=250,mini:b=!1,mutex:s=!0,listFolded:d=!1,theme:E="light",border:g=!1}){var oe,ue,se;const f=V("aplayer"),h=ut(Array.isArray(e)?e:[e],{initialLoop:a,initialOrder:o,getSongId:O=>O.url}),[T,i]=at(),p=Xe(),S=c.useRef(),P=c.useCallback(()=>{S.current&&(clearTimeout(S.current),S.current=void 0)},[]),x=nt({src:h.currentSong.url,initialVolume:n,autoPlay:l,mutex:s,onError(O){const{error:me}=O.target;me&&i("An audio error has occurred, player will skip forward in 2 seconds."),h.hasNextSong&&(S.current=p(()=>{h.next()},2e3))},onEnded(){h.hasNextSong&&h.next()}}),M=c.useCallback(()=>{P(),x.togglePlay(h.currentSong.url)},[x,P,h.currentSong.url]),te=c.useCallback(O=>O?typeof O=="string"?O:O.url?v.jsx("a",{href:O.url,target:"_blank",rel:"noreferrer",children:O.name??"Audio artist"}):O.name??"Audio artist":"Audio artist",[]),W=h.length>1,I=c.useMemo(()=>Array.isArray(e)?e:[e],[e]),{prioritize:ve}=h,we=c.useCallback(O=>{P(),ve(O)},[P,ve]),[ne,je]=c.useState(()=>W&&!d),[Oe,ae]=c.useState(b),[D,F]=c.useState(!0),B=c.useRef(null);c.useEffect(()=>{ae(b)},[b]),c.useEffect(()=>{l&&x.playAudio(h.currentSong.url)},[]);const K=c.useRef(null),ie=c.useRef(!0);return c.useEffect(()=>{if(!h.currentSong)return;const O=h.currentSong.url;if(ie.current){ie.current=!1,K.current=O;return}(h.loop==="one"||O!==K.current)&&(x.playAudio(O),K.current=O)},[h.currentSong,h.loop]),c.useEffect(()=>{if(t==="fixed"&&B.current){const O=B.current;return O.style.width=`${O.offsetWidth-18}px`,()=>{O.removeAttribute("style")}}},[t]),v.jsxs("div",{className:$(f.b(),{[f.bs(E)]:!0,[f.bs("vars")]:!0,[f.bm(t)]:!0,[f.bm("loading")]:x.isLoading,[f.bm("withlist")]:W,[f.bm("list-folded")]:!ne,[f.bm("withlrc")]:!!h.currentSong.lrc&&t!=="fixed",[f.bm("narrow")]:Oe,[f.bm("border")]:g}),role:"region","aria-label":"Audio Player",children:[v.jsxs("div",{ref:B,className:f.be("body"),children:[v.jsx("div",{className:f.be("pic"),onClick:M,style:{backgroundImage:`url("${(oe=h.currentSong)==null?void 0:oe.cover}")`},role:"button","aria-label":x.isPlaying?"Pause audio":"Play audio",children:v.jsx("div",{className:$(f.be("button"),x.isPlaying?f.bm("pause"):f.bm("play")),role:"presentation",children:x.isPlaying?v.jsx(lt,{}):v.jsx(Mr,{})})}),v.jsxs("div",{className:$(f.be("info")),children:[v.jsxs("div",{className:$(f.be("music")),children:[v.jsx("span",{className:$(f.be("title")),children:((ue=h.currentSong)==null?void 0:ue.name)??"Audio name"}),v.jsxs("span",{className:$(f.be("author")),children:[" ","-"," ",te((se=h.currentSong)==null?void 0:se.artist)]})]}),t==="fixed"?null:v.jsx(Ye,{show:D,lrcText:h.currentSong.lrc,currentTime:x.currentTime??0}),v.jsx(Jr,{volume:x.volume??n,onChangeVolume:x.setVolume,muted:x.muted??!1,onToggleMuted:()=>x.toggleMuted(),currentTime:x.currentTime,audioDurationSeconds:x.duration,bufferedSeconds:x.bufferedSeconds,onSeek:O=>x.seek(O),onToggleMenu:()=>je(O=>!O),order:h.order,onOrderChange:h.setOrder,loop:h.loop,onLoopChange:h.setLoop,isPlaying:x.isPlaying??!1,onTogglePlay:M,onSkipForward:()=>{h.hasNextSong&&h.next()},onSkipBack:()=>{h.previous()},showLyrics:D,onToggleLyrics:()=>{F(O=>!O)}})]}),v.jsx("div",{className:f.be("notice"),style:T.style,children:T.text}),v.jsx("div",{className:f.be("miniswitcher"),onClick:()=>ae(O=>!O),children:v.jsx("button",{className:$(f.bs("icon"),f.bs("icon-right")),type:"button",children:v.jsx(st,{})})})]}),W?v.jsx(Xr,{open:ne,audio:I,playingAudioUrl:h.currentSong.url,onPlayAudio:we,listMaxHeight:y}):null,t==="fixed"&&v.jsx(Ye,{show:D,lrcText:h.currentSong.lrc,currentTime:x.currentTime??0})]})}H.TwistAPlayer=ct,Object.defineProperty(H,Symbol.toStringTag,{value:"Module"})});
|
|
45
|
+
*/return e.NODE_ENV!=="production"&&function(){function t(T,o){return T===o&&(T!==0||1/T===1/o)||T!==T&&o!==o}function n(T,o){b||l.startTransition===void 0||(b=!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 y=o();if(!f){var g=o();p(y,g)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}g=E({inst:{value:y,getSnapshot:o}});var O=g[0].inst,S=g[1];return d(function(){O.value=y,O.getSnapshot=o,a(O)&&S({inst:O})},[T,y,o]),s(function(){return a(O)&&S({inst:O}),T(function(){a(O)&&S({inst:O})})},[T]),x(y),y}function a(T){var o=T.getSnapshot;T=T.value;try{var y=o();return!p(T,y)}catch{return!0}}function i(T,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:t,E=l.useState,s=l.useEffect,d=l.useLayoutEffect,x=l.useDebugValue,b=!1,f=!1,h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?i:n;je.useSyncExternalStore=l.useSyncExternalStore!==void 0?l.useSyncExternalStore:h,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}(),je}var Ze;function nt(){if(Ze)return ve.exports;Ze=1;var e={};return e.NODE_ENV==="production"?ve.exports=rt():ve.exports=tt(),ve.exports}var W=nt();const K=[];function at(e){const t=c.useRef();return c.useEffect(()=>{if(typeof window<"u"&&!t.current){const n=t.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),K.includes(n)||K.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=t.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=t.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=t.current;if(n){n.pause(),n.currentTime=0;const a=K.indexOf(n);a!==-1&&K.splice(a,1)}t.current=void 0},[]),t}function it(e){const t=at(e),n=c.useCallback(o=>{for(let y=0;y<K.length;y++){const g=K[y];g!==o&&!g.paused&&g.pause()}},[]),a=c.useCallback(async o=>{var g;const y=t.current;if(y){e.mutex&&n(y),y.src!==o&&(y.pause(),y.currentTime=0,y.src=o);try{await((g=t.current)==null?void 0:g.play())}catch{}}},[t,e.mutex,n]),i=c.useCallback(o=>{const y=t.current;y&&(y.paused?a(o):y.pause())},[t,a]),l=c.useCallback(o=>{t.current.currentTime=o},[t]),p=c.useCallback(()=>{t.current&&(t.current.muted=!t.current.muted)},[t]),E=c.useCallback(o=>{t.current&&(t.current.volume=o)},[t]),s=W.useSyncExternalStore(c.useCallback(o=>{var y;return(y=t.current)==null||y.addEventListener("volumechange",o),()=>{var g;(g=t.current)==null||g.removeEventListener("volumechange",o)}},[t]),()=>{var o;return(o=t.current)==null?void 0:o.volume},()=>{}),d=W.useSyncExternalStore(c.useCallback(o=>{var y;return(y=t.current)==null||y.addEventListener("volumechange",o),()=>{var g;(g=t.current)==null||g.removeEventListener("volumechange",o)}},[t]),()=>{var o;return(o=t.current)==null?void 0:o.muted},()=>{}),x=W.useSyncExternalStore(c.useCallback(o=>{var y;return(y=t.current)==null||y.addEventListener("timeupdate",o),()=>{var g;(g=t.current)==null||g.removeEventListener("timeupdate",o)}},[t]),()=>{if(t.current)return Math.round(t.current.currentTime)},()=>{}),b=W.useSyncExternalStore(c.useCallback(o=>{var y;return(y=t.current)==null||y.addEventListener("durationchange",o),()=>{var g;(g=t.current)==null||g.removeEventListener("durationchange",o)}},[t]),()=>{var o;return(o=t.current)==null?void 0:o.duration},()=>{}),f=W.useSyncExternalStore(c.useCallback(o=>{var y;return(y=t.current)==null||y.addEventListener("progress",o),()=>{var g;(g=t.current)==null||g.removeEventListener("progress",o)}},[t]),()=>{const o=t.current;return o&&o.buffered.length>0?o.buffered.end(o.buffered.length-1):0},()=>{}),h=W.useSyncExternalStore(c.useCallback(o=>{var y,g;return(y=t.current)==null||y.addEventListener("play",o),(g=t.current)==null||g.addEventListener("pause",o),()=>{var O,S;(O=t.current)==null||O.removeEventListener("play",o),(S=t.current)==null||S.removeEventListener("pause",o)}},[t]),()=>{const o=t.current;return o?!o.paused:!1},()=>{}),T=W.useSyncExternalStore(c.useCallback(o=>{var y,g;return(y=t.current)==null||y.addEventListener("playing",o),(g=t.current)==null||g.addEventListener("waiting",o),()=>{var O,S;(O=t.current)==null||O.removeEventListener("playing",o),(S=t.current)==null||S.removeEventListener("waiting",o)}},[t]),()=>{const o=t.current;return o?o.networkState===o.NETWORK_LOADING:!1},()=>{});return{audio:t.current,playAudio:a,togglePlay:i,seek:l,toggleMuted:p,setVolume:E,volume:s,muted:d,currentTime:x,duration:b,bufferedSeconds:f,isPlaying:h,isLoading:T}}function er(){const e=c.useRef([]);return c.useEffect(()=>{const n=e.current;return()=>{for(const a of n)clearTimeout(a)}},[]),c.useCallback((n,a)=>{const i=setTimeout(n,a);return e.current.push(i),i},[])}function ot(){const e=c.useRef(),[t,n]=c.useState({text:"",style:{opacity:0}}),a=er(),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[t,i]}function ut(e){return st(e.slice())}function st(e){let t=e.length,n;for(;t!==0;)n=Math.floor(Math.random()*t),t--,[e[t],e[n]]=[e[n],e[t]];return e}function lt(e,t){const{initialLoop:n="all",initialOrder:a="list"}=t,[i,l]=c.useState(n),[p,E]=c.useState(a),s=c.useMemo(()=>p==="list"?e:ut(e),[e,p]),[d,x]=c.useState(s[0]),b=c.useCallback(y=>y.url,[]),f=c.useMemo(()=>s.findIndex(g=>b(g)===b(d))<s.length-1||i!=="none",[s,d,i,b]),h=c.useCallback(()=>{x(y=>{const g=s.findIndex(O=>b(O)===b(y));return g<s.length-1?s[g+1]:{...s[0]}})},[i,s,b]),T=c.useCallback(()=>{x(y=>{const g=s.indexOf(y);return g>0?s[g-1]:y})},[s]),o=c.useCallback(y=>{x(y)},[]);return c.useEffect(()=>{const y=s.find(g=>b(g)===b(d));x(y||s[0])},[s,b,d]),{currentSong:d,hasNextSong:f,next:h,previous:T,prioritize:o,order:p,setOrder:E,loop:i,setLoop:l,length:s.length}}function ct(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 ft(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 dt({audio:e,appearance:t="normal",volume:n=.7,initialLoop:a,initialOrder:i,autoPlay:l=!1,listMaxHeight:p=250,mini:E=!1,mutex:s=!0,listFolded:d=!1,theme:x="light",border:b=!1}){var ue,se,le;const f=I("aplayer"),h=lt(Array.isArray(e)?e:[e],{initialLoop:a,initialOrder:i}),[T,o]=ot(),y=er(),g=c.useRef(),O=c.useCallback(()=>{g.current&&(clearTimeout(g.current),g.current=void 0)},[]),S=it({src:h.currentSong.url,initialVolume:n,autoPlay:l,mutex:s,onError(P){const{error:Y}=P.target;Y&&o("An audio error has occurred, player will skip forward in 2 seconds."),h.hasNextSong&&(g.current=y(()=>{h.next()},2e3))},onEnded(){const{currentSong:P,loop:Y,prioritize:he,hasNextSong:Le}=h;if(Y==="one"){he({...P});return}if(!Le&&Y==="none"){const{audio:ye}=S;ye.currentTime=0,ye.pause();return}h.next()}}),M=c.useCallback(()=>{O(),S.togglePlay(h.currentSong.url)},[S,O,h.currentSong.url]),te=c.useCallback(P=>P?typeof P=="string"?P:P.url?v.jsx("a",{href:P.url,target:"_blank",rel:"noreferrer",children:P.name??"Audio artist"}):P.name??"Audio artist":"Audio artist",[]),U=h.length>1,V=c.useMemo(()=>Array.isArray(e)?e:[e],[e]),{prioritize:me}=h,Oe=c.useCallback(P=>{O(),me(P)},[O,me]),[ne,Ce]=c.useState(()=>U&&!d),[Pe,ae]=c.useState(E),[D,F]=c.useState(!0),B=c.useRef(null);c.useEffect(()=>{ae(E)},[E]),c.useEffect(()=>{l&&S.playAudio(h.currentSong.url)},[]);const ie=c.useRef(!0),oe=c.useRef(h.currentSong);return c.useEffect(()=>{if(ie.current){ie.current=!1;return}h.currentSong&&(h.loop==="one"||h.currentSong!==oe.current)&&(oe.current=h.currentSong,S.playAudio(h.currentSong.url))},[h.currentSong]),c.useEffect(()=>{if(t==="fixed"&&B.current){const P=B.current;return P.style.width=`${P.offsetWidth-18}px`,()=>{P.removeAttribute("style")}}},[t]),v.jsxs("div",{className:$(f.b(),{[f.bs(x)]:!0,[f.bs("vars")]:!0,[f.bm(t)]:!0,[f.bm("loading")]:S.isLoading,[f.bm("withlist")]:U,[f.bm("list-folded")]:!ne,[f.bm("withlrc")]:!!h.currentSong.lrc&&t!=="fixed",[f.bm("narrow")]:Pe,[f.bm("border")]:b}),role:"region","aria-label":"Audio Player",children:[v.jsxs("div",{ref:B,className:f.be("body"),children:[v.jsx("div",{className:f.be("pic"),onClick:M,style:{backgroundImage:`url("${(ue=h.currentSong)==null?void 0:ue.cover}")`},role:"button","aria-label":S.isPlaying?"Pause audio":"Play audio",children:v.jsx("div",{className:$(f.be("button"),S.isPlaying?f.bm("pause"):f.bm("play")),role:"presentation",children:S.isPlaying?v.jsx(ft,{}):v.jsx(Nr,{})})}),v.jsxs("div",{className:$(f.be("info")),children:[v.jsxs("div",{className:$(f.be("music")),children:[v.jsx("span",{className:$(f.be("title")),children:((se=h.currentSong)==null?void 0:se.name)??"Audio name"}),v.jsxs("span",{className:$(f.be("author")),children:[" ","-"," ",te((le=h.currentSong)==null?void 0:le.artist)]})]}),t==="fixed"?null:v.jsx(Je,{show:D,lrcText:h.currentSong.lrc,currentTime:S.currentTime??0}),v.jsx(Qr,{volume:S.volume??n,onChangeVolume:S.setVolume,muted:S.muted??!1,onToggleMuted:()=>S.toggleMuted(),currentTime:S.currentTime,audioDurationSeconds:S.duration,bufferedSeconds:S.bufferedSeconds,onSeek:P=>S.seek(P),onToggleMenu:()=>Ce(P=>!P),order:h.order,onOrderChange:h.setOrder,loop:h.loop,onLoopChange:h.setLoop,isPlaying:S.isPlaying??!1,onTogglePlay:M,onSkipForward:()=>{h.hasNextSong&&h.next()},onSkipBack:()=>{h.previous()},showLyrics:D,onToggleLyrics:()=>{F(P=>!P)}})]}),v.jsx("div",{className:f.be("notice"),style:T.style,children:T.text}),v.jsx("div",{className:f.be("miniswitcher"),onClick:()=>ae(P=>!P),children:v.jsx("button",{className:$(f.bs("icon"),f.bs("icon-right")),type:"button",children:v.jsx(ct,{})})})]}),U?v.jsx(Zr,{open:ne,audio:V,playingAudioUrl:h.currentSong.url,onPlayAudio:Oe,listMaxHeight:p}):null,t==="fixed"&&v.jsx(Je,{show:D,lrcText:h.currentSong.lrc,currentTime:S.currentTime??0})]})}H.TwistAPlayer=dt,Object.defineProperty(H,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,75 +1,84 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "twist-aplayer",
|
|
3
|
-
"type": "module",
|
|
4
|
-
"version": "1.
|
|
5
|
-
"private": false,
|
|
6
|
-
"description": "A shadui theme aplayer",
|
|
7
|
-
"author": {
|
|
8
|
-
"name": "razzh",
|
|
9
|
-
"email": "razzhavenir@163.com",
|
|
10
|
-
"url": "https://razzh.cn"
|
|
11
|
-
},
|
|
12
|
-
"license": "MIT",
|
|
13
|
-
"repository": {
|
|
14
|
-
"type": "git",
|
|
15
|
-
"url": "https://github.com/twist-space/twist-aplayer"
|
|
16
|
-
},
|
|
17
|
-
"keywords": [
|
|
18
|
-
"aplayer",
|
|
19
|
-
"music player",
|
|
20
|
-
"twist"
|
|
21
|
-
],
|
|
22
|
-
"sideEffects": [
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
},
|
|
46
|
-
"
|
|
47
|
-
"@
|
|
48
|
-
"@
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
"@
|
|
54
|
-
"@
|
|
55
|
-
"
|
|
56
|
-
"eslint-
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"react": "18.2.
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
"
|
|
74
|
-
|
|
75
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "twist-aplayer",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "1.3.1",
|
|
5
|
+
"private": false,
|
|
6
|
+
"description": "A shadui theme aplayer",
|
|
7
|
+
"author": {
|
|
8
|
+
"name": "razzh",
|
|
9
|
+
"email": "razzhavenir@163.com",
|
|
10
|
+
"url": "https://razzh.cn"
|
|
11
|
+
},
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "https://github.com/twist-space/twist-aplayer"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"aplayer",
|
|
19
|
+
"music player",
|
|
20
|
+
"twist"
|
|
21
|
+
],
|
|
22
|
+
"sideEffects": [
|
|
23
|
+
"*.css"
|
|
24
|
+
],
|
|
25
|
+
"main": "dist/index.js",
|
|
26
|
+
"module": "dist/index.mjs",
|
|
27
|
+
"unpkg": "dist/twist-aplayer.umd.js",
|
|
28
|
+
"types": "dist/index.d.ts",
|
|
29
|
+
"files": [
|
|
30
|
+
"dist"
|
|
31
|
+
],
|
|
32
|
+
"scripts": {
|
|
33
|
+
"dev": "vite",
|
|
34
|
+
"build": "rimraf dist && pnpm build:umd && vite --config vite.config.build.ts build",
|
|
35
|
+
"build:umd": "vite --config vite.config.umd.ts build",
|
|
36
|
+
"preview": "vite preview",
|
|
37
|
+
"test": "vitest",
|
|
38
|
+
"test:coverage": "vitest --coverage",
|
|
39
|
+
"lint": "eslint .",
|
|
40
|
+
"prepublishOnly": "pnpm build"
|
|
41
|
+
},
|
|
42
|
+
"peerDependencies": {
|
|
43
|
+
"react": "^18.2.0",
|
|
44
|
+
"react-dom": "^18.2.0"
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"@twistify/react-icons": "^1.0.4",
|
|
48
|
+
"@twistui/bem-helper": "^1.0.1",
|
|
49
|
+
"clsx": "^2.1.1",
|
|
50
|
+
"use-sync-external-store": "^1.4.0"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@antfu/eslint-config": "^3.12.2",
|
|
54
|
+
"@commitlint/cli": "^19.6.1",
|
|
55
|
+
"@commitlint/config-angular": "^19.7.0",
|
|
56
|
+
"@eslint-react/eslint-plugin": "^1.23.2",
|
|
57
|
+
"@testing-library/react": "^16.2.0",
|
|
58
|
+
"@types/react": "^18.2.66",
|
|
59
|
+
"@types/react-dom": "^18.2.22",
|
|
60
|
+
"@types/use-sync-external-store": "^0.0.6",
|
|
61
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
62
|
+
"autoprefixer": "^10.4.21",
|
|
63
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
64
|
+
"eslint-plugin-react-refresh": "^0.4.19",
|
|
65
|
+
"happy-dom": "^17.4.4",
|
|
66
|
+
"postcss": "^8.5.3",
|
|
67
|
+
"react": "18.2.0",
|
|
68
|
+
"react-dom": "18.2.0",
|
|
69
|
+
"rimraf": "^6.0.1",
|
|
70
|
+
"sass": "^1.86.0",
|
|
71
|
+
"typescript": "^5.8.2",
|
|
72
|
+
"vite": "^6.2.2",
|
|
73
|
+
"vite-plugin-dts": "^4.5.3",
|
|
74
|
+
"vitest": "^3.0.9"
|
|
75
|
+
},
|
|
76
|
+
"browserslist": [
|
|
77
|
+
"last 2 versions",
|
|
78
|
+
"not dead",
|
|
79
|
+
"> 1%"
|
|
80
|
+
],
|
|
81
|
+
"publishConfig": {
|
|
82
|
+
"access": "public"
|
|
83
|
+
}
|
|
84
|
+
}
|