UNPKG

react-audio-player-component-dk

Version:

A mobile-friendly audio player for React with a modern look and convenient usage.

54 lines (47 loc) 41.2 kB
(function(fe,T){typeof exports=="object"&&typeof module<"u"?T(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],T):(fe=typeof globalThis<"u"?globalThis:fe||self,T(fe.AudioPlayer={},fe.React))})(this,function(fe,T){"use strict";var qe={exports:{}},Le={};/** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var lr;function jr(){if(lr)return Le;lr=1;var I=T,p=Symbol.for("react.element"),h=Symbol.for("react.fragment"),E=Object.prototype.hasOwnProperty,w=I.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,b={key:!0,ref:!0,__self:!0,__source:!0};function x(m,f,M){var s,d={},j=null,S=null;M!==void 0&&(j=""+M),f.key!==void 0&&(j=""+f.key),f.ref!==void 0&&(S=f.ref);for(s in f)E.call(f,s)&&!b.hasOwnProperty(s)&&(d[s]=f[s]);if(m&&m.defaultProps)for(s in f=m.defaultProps,f)d[s]===void 0&&(d[s]=f[s]);return{$$typeof:p,type:m,key:j,ref:S,props:d,_owner:w.current}}return Le.Fragment=h,Le.jsx=x,Le.jsxs=x,Le}var ze={};/** * @license React * react-jsx-runtime.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var fr;function Dr(){return fr||(fr=1,process.env.NODE_ENV!=="production"&&function(){var I=T,p=Symbol.for("react.element"),h=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),b=Symbol.for("react.profiler"),x=Symbol.for("react.provider"),m=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),s=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),S=Symbol.for("react.offscreen"),R=Symbol.iterator,_="@@iterator";function P(e){if(e===null||typeof e!="object")return null;var r=R&&e[R]||e[_];return typeof r=="function"?r:null}var v=I.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function c(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];D("error",e,t)}}function D(e,r,t){{var n=v.ReactDebugCurrentFrame,i=n.getStackAddendum();i!==""&&(r+="%s",t=t.concat([i]));var u=t.map(function(o){return String(o)});u.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,u)}}var ae=!1,oe=!1,K=!1,_e=!1,Pe=!1,de;de=Symbol.for("react.module.reference");function Qe(e){return!!(typeof e=="string"||typeof e=="function"||e===E||e===b||Pe||e===w||e===M||e===s||_e||e===S||ae||oe||K||typeof e=="object"&&e!==null&&(e.$$typeof===j||e.$$typeof===d||e.$$typeof===x||e.$$typeof===m||e.$$typeof===f||e.$$typeof===de||e.getModuleId!==void 0))}function Ue(e,r,t){var n=e.displayName;if(n)return n;var i=r.displayName||r.name||"";return i!==""?t+"("+i+")":t}function ye(e){return e.displayName||"Context"}function C(e){if(e==null)return null;if(typeof e.tag=="number"&&c("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case E:return"Fragment";case h:return"Portal";case b:return"Profiler";case w:return"StrictMode";case M:return"Suspense";case s:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case m:var r=e;return ye(r)+".Consumer";case x:var t=e;return ye(t._context)+".Provider";case f:return Ue(e,e.render,"ForwardRef");case d:var n=e.displayName||null;return n!==null?n:C(e.type)||"Memo";case j:{var i=e,u=i._payload,o=i._init;try{return C(o(u))}catch{return null}}}return null}var k=Object.assign,Q=0,ie,ge,pe,Me,ue,ve,je;function De(){}De.__reactDisabledLog=!0;function be(){{if(Q===0){ie=console.log,ge=console.info,pe=console.warn,Me=console.error,ue=console.group,ve=console.groupCollapsed,je=console.groupEnd;var e={configurable:!0,enumerable:!0,value:De,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}Q++}}function Ye(){{if(Q--,Q===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:k({},e,{value:ie}),info:k({},e,{value:ge}),warn:k({},e,{value:pe}),error:k({},e,{value:Me}),group:k({},e,{value:ue}),groupCollapsed:k({},e,{value:ve}),groupEnd:k({},e,{value:je})})}Q<0&&c("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var $=v.ReactCurrentDispatcher,q;function V(e,r,t){{if(q===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);q=n&&n[1]||""}return` `+q+e}}var ee=!1,H;{var Oe=typeof WeakMap=="function"?WeakMap:Map;H=new Oe}function Ne(e,r){if(!e||ee)return"";{var t=H.get(e);if(t!==void 0)return t}var n;ee=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var u;u=$.current,$.current=null,be();try{if(r){var o=function(){throw Error()};if(Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(z){n=z}Reflect.construct(e,[],o)}else{try{o.call()}catch(z){n=z}e.call(o.prototype)}}else{try{throw Error()}catch(z){n=z}e()}}catch(z){if(z&&n&&typeof z.stack=="string"){for(var a=z.stack.split(` `),N=n.stack.split(` `),y=a.length-1,g=N.length-1;y>=1&&g>=0&&a[y]!==N[g];)g--;for(;y>=1&&g>=0;y--,g--)if(a[y]!==N[g]){if(y!==1||g!==1)do if(y--,g--,g<0||a[y]!==N[g]){var A=` `+a[y].replace(" at new "," at ");return e.displayName&&A.includes("<anonymous>")&&(A=A.replace("<anonymous>",e.displayName)),typeof e=="function"&&H.set(e,A),A}while(y>=1&&g>=0);break}}}finally{ee=!1,$.current=u,Ye(),Error.prepareStackTrace=i}var B=e?e.displayName||e.name:"",Ke=B?V(B):"";return typeof e=="function"&&H.set(e,Ke),Ke}function l(e,r,t){return Ne(e,!1)}function J(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function Z(e,r,t){if(e==null)return"";if(typeof e=="function")return Ne(e,J(e));if(typeof e=="string")return V(e);switch(e){case M:return V("Suspense");case s:return V("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case f:return l(e.render);case d:return Z(e.type,r,t);case j:{var n=e,i=n._payload,u=n._init;try{return Z(u(i),r,t)}catch{}}}return""}var U=Object.prototype.hasOwnProperty,se={},X=v.ReactDebugCurrentFrame;function F(e){if(e){var r=e._owner,t=Z(e.type,e._source,r?r.type:null);X.setExtraStackFrame(t)}else X.setExtraStackFrame(null)}function Fe(e,r,t,n,i){{var u=Function.call.bind(U);for(var o in e)if(u(e,o)){var a=void 0;try{if(typeof e[o]!="function"){var N=Error((n||"React class")+": "+t+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw N.name="Invariant Violation",N}a=e[o](r,o,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(y){a=y}a&&!(a instanceof Error)&&(F(i),c("%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).",n||"React class",t,o,typeof a),F(null)),a instanceof Error&&!(a.message in se)&&(se[a.message]=!0,F(i),c("Failed %s type: %s",t,a.message),F(null))}}}var We=Array.isArray;function G(e){return We(e)}function me(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function Se(e){try{return Ie(e),!1}catch{return!0}}function Ie(e){return""+e}function ce(e){if(Se(e))return c("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",me(e)),Ie(e)}var Y=v.ReactCurrentOwner,Ee={key:!0,ref:!0,__self:!0,__source:!0},Te,he,re;re={};function te(e){if(U.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function Be(e){if(U.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Ce(e,r){if(typeof e.ref=="string"&&Y.current&&r&&Y.current.stateNode!==r){var t=C(Y.current.type);re[t]||(c('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',C(Y.current.type),e.ref),re[t]=!0)}}function ke(e,r){{var t=function(){Te||(Te=!0,c("%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)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function Ze(e,r){{var t=function(){he||(he=!0,c("%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)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var L=function(e,r,t,n,i,u,o){var a={$$typeof:p,type:e,key:r,ref:t,props:o,_owner:u};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function ne(e,r,t,n,i){{var u,o={},a=null,N=null;t!==void 0&&(ce(t),a=""+t),Be(r)&&(ce(r.key),a=""+r.key),te(r)&&(N=r.ref,Ce(r,i));for(u in r)U.call(r,u)&&!Ee.hasOwnProperty(u)&&(o[u]=r[u]);if(e&&e.defaultProps){var y=e.defaultProps;for(u in y)o[u]===void 0&&(o[u]=y[u])}if(a||N){var g=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&ke(o,g),N&&Ze(o,g)}return L(e,a,N,i,n,Y.current,o)}}var le=v.ReactCurrentOwner,we=v.ReactDebugCurrentFrame;function W(e){if(e){var r=e._owner,t=Z(e.type,e._source,r?r.type:null);we.setExtraStackFrame(t)}else we.setExtraStackFrame(null)}var Ae;Ae=!1;function xe(e){return typeof e=="object"&&e!==null&&e.$$typeof===p}function Ve(){{if(le.current){var e=C(le.current.type);if(e)return` Check the render method of \``+e+"`."}return""}}function tr(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),t=e.lineNumber;return` Check your code at `+r+":"+t+"."}return""}}var He={};function nr(e){{var r=Ve();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=` Check the top-level render call using <`+t+">.")}return r}}function Ge(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=nr(r);if(He[t])return;He[t]=!0;var n="";e&&e._owner&&e._owner!==le.current&&(n=" It was passed a child from "+C(e._owner.type)+"."),W(e),c('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),W(null)}}function Je(e,r){{if(typeof e!="object")return;if(G(e))for(var t=0;t<e.length;t++){var n=e[t];xe(n)&&Ge(n,r)}else if(xe(e))e._store&&(e._store.validated=!0);else if(e){var i=P(e);if(typeof i=="function"&&i!==e.entries)for(var u=i.call(e),o;!(o=u.next()).done;)xe(o.value)&&Ge(o.value,r)}}}function ar(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===f||r.$$typeof===d))t=r.propTypes;else return;if(t){var n=C(r);Fe(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!Ae){Ae=!0;var i=C(r);c("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",i||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&c("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function or(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){W(e),c("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),W(null);break}}e.ref!==null&&(W(e),c("Invalid attribute `ref` supplied to `React.Fragment`."),W(null))}}function Xe(e,r,t,n,i,u){{var o=Qe(e);if(!o){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" 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 N=tr(i);N?a+=N:a+=Ve();var y;e===null?y="null":G(e)?y="array":e!==void 0&&e.$$typeof===p?(y="<"+(C(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):y=typeof e,c("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",y,a)}var g=ne(e,r,t,i,u);if(g==null)return g;if(o){var A=r.children;if(A!==void 0)if(n)if(G(A)){for(var B=0;B<A.length;B++)Je(A[B],e);Object.freeze&&Object.freeze(A)}else c("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 Je(A,e)}return e===E?or(g):ar(g),g}}function ir(e,r,t){return Xe(e,r,t,!0)}function ur(e,r,t){return Xe(e,r,t,!1)}var sr=ur,cr=ir;ze.Fragment=E,ze.jsx=sr,ze.jsxs=cr}()),ze}process.env.NODE_ENV==="production"?qe.exports=jr():qe.exports=Dr();var O=qe.exports,er={exports:{}},Re={};/** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var dr;function Nr(){if(dr)return Re;dr=1;var I=T,p=Symbol.for("react.element"),h=Symbol.for("react.fragment"),E=Object.prototype.hasOwnProperty,w=I.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,b={key:!0,ref:!0,__self:!0,__source:!0};function x(m,f,M){var s,d={},j=null,S=null;M!==void 0&&(j=""+M),f.key!==void 0&&(j=""+f.key),f.ref!==void 0&&(S=f.ref);for(s in f)E.call(f,s)&&!b.hasOwnProperty(s)&&(d[s]=f[s]);if(m&&m.defaultProps)for(s in f=m.defaultProps,f)d[s]===void 0&&(d[s]=f[s]);return{$$typeof:p,type:m,key:j,ref:S,props:d,_owner:w.current}}return Re.Fragment=h,Re.jsx=x,Re.jsxs=x,Re}var $e={};/** * @license React * react-jsx-runtime.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var yr;function mr(){return yr||(yr=1,process.env.NODE_ENV!=="production"&&function(){var I=T,p=Symbol.for("react.element"),h=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),b=Symbol.for("react.profiler"),x=Symbol.for("react.provider"),m=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),s=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),S=Symbol.for("react.offscreen"),R=Symbol.iterator,_="@@iterator";function P(e){if(e===null||typeof e!="object")return null;var r=R&&e[R]||e[_];return typeof r=="function"?r:null}var v=I.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function c(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];D("error",e,t)}}function D(e,r,t){{var n=v.ReactDebugCurrentFrame,i=n.getStackAddendum();i!==""&&(r+="%s",t=t.concat([i]));var u=t.map(function(o){return String(o)});u.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,u)}}var ae=!1,oe=!1,K=!1,_e=!1,Pe=!1,de;de=Symbol.for("react.module.reference");function Qe(e){return!!(typeof e=="string"||typeof e=="function"||e===E||e===b||Pe||e===w||e===M||e===s||_e||e===S||ae||oe||K||typeof e=="object"&&e!==null&&(e.$$typeof===j||e.$$typeof===d||e.$$typeof===x||e.$$typeof===m||e.$$typeof===f||e.$$typeof===de||e.getModuleId!==void 0))}function Ue(e,r,t){var n=e.displayName;if(n)return n;var i=r.displayName||r.name||"";return i!==""?t+"("+i+")":t}function ye(e){return e.displayName||"Context"}function C(e){if(e==null)return null;if(typeof e.tag=="number"&&c("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case E:return"Fragment";case h:return"Portal";case b:return"Profiler";case w:return"StrictMode";case M:return"Suspense";case s:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case m:var r=e;return ye(r)+".Consumer";case x:var t=e;return ye(t._context)+".Provider";case f:return Ue(e,e.render,"ForwardRef");case d:var n=e.displayName||null;return n!==null?n:C(e.type)||"Memo";case j:{var i=e,u=i._payload,o=i._init;try{return C(o(u))}catch{return null}}}return null}var k=Object.assign,Q=0,ie,ge,pe,Me,ue,ve,je;function De(){}De.__reactDisabledLog=!0;function be(){{if(Q===0){ie=console.log,ge=console.info,pe=console.warn,Me=console.error,ue=console.group,ve=console.groupCollapsed,je=console.groupEnd;var e={configurable:!0,enumerable:!0,value:De,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}Q++}}function Ye(){{if(Q--,Q===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:k({},e,{value:ie}),info:k({},e,{value:ge}),warn:k({},e,{value:pe}),error:k({},e,{value:Me}),group:k({},e,{value:ue}),groupCollapsed:k({},e,{value:ve}),groupEnd:k({},e,{value:je})})}Q<0&&c("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var $=v.ReactCurrentDispatcher,q;function V(e,r,t){{if(q===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);q=n&&n[1]||""}return` `+q+e}}var ee=!1,H;{var Oe=typeof WeakMap=="function"?WeakMap:Map;H=new Oe}function Ne(e,r){if(!e||ee)return"";{var t=H.get(e);if(t!==void 0)return t}var n;ee=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var u;u=$.current,$.current=null,be();try{if(r){var o=function(){throw Error()};if(Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(z){n=z}Reflect.construct(e,[],o)}else{try{o.call()}catch(z){n=z}e.call(o.prototype)}}else{try{throw Error()}catch(z){n=z}e()}}catch(z){if(z&&n&&typeof z.stack=="string"){for(var a=z.stack.split(` `),N=n.stack.split(` `),y=a.length-1,g=N.length-1;y>=1&&g>=0&&a[y]!==N[g];)g--;for(;y>=1&&g>=0;y--,g--)if(a[y]!==N[g]){if(y!==1||g!==1)do if(y--,g--,g<0||a[y]!==N[g]){var A=` `+a[y].replace(" at new "," at ");return e.displayName&&A.includes("<anonymous>")&&(A=A.replace("<anonymous>",e.displayName)),typeof e=="function"&&H.set(e,A),A}while(y>=1&&g>=0);break}}}finally{ee=!1,$.current=u,Ye(),Error.prepareStackTrace=i}var B=e?e.displayName||e.name:"",Ke=B?V(B):"";return typeof e=="function"&&H.set(e,Ke),Ke}function l(e,r,t){return Ne(e,!1)}function J(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function Z(e,r,t){if(e==null)return"";if(typeof e=="function")return Ne(e,J(e));if(typeof e=="string")return V(e);switch(e){case M:return V("Suspense");case s:return V("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case f:return l(e.render);case d:return Z(e.type,r,t);case j:{var n=e,i=n._payload,u=n._init;try{return Z(u(i),r,t)}catch{}}}return""}var U=Object.prototype.hasOwnProperty,se={},X=v.ReactDebugCurrentFrame;function F(e){if(e){var r=e._owner,t=Z(e.type,e._source,r?r.type:null);X.setExtraStackFrame(t)}else X.setExtraStackFrame(null)}function Fe(e,r,t,n,i){{var u=Function.call.bind(U);for(var o in e)if(u(e,o)){var a=void 0;try{if(typeof e[o]!="function"){var N=Error((n||"React class")+": "+t+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw N.name="Invariant Violation",N}a=e[o](r,o,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(y){a=y}a&&!(a instanceof Error)&&(F(i),c("%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).",n||"React class",t,o,typeof a),F(null)),a instanceof Error&&!(a.message in se)&&(se[a.message]=!0,F(i),c("Failed %s type: %s",t,a.message),F(null))}}}var We=Array.isArray;function G(e){return We(e)}function me(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function Se(e){try{return Ie(e),!1}catch{return!0}}function Ie(e){return""+e}function ce(e){if(Se(e))return c("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",me(e)),Ie(e)}var Y=v.ReactCurrentOwner,Ee={key:!0,ref:!0,__self:!0,__source:!0},Te,he,re;re={};function te(e){if(U.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function Be(e){if(U.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Ce(e,r){if(typeof e.ref=="string"&&Y.current&&r&&Y.current.stateNode!==r){var t=C(Y.current.type);re[t]||(c('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',C(Y.current.type),e.ref),re[t]=!0)}}function ke(e,r){{var t=function(){Te||(Te=!0,c("%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)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function Ze(e,r){{var t=function(){he||(he=!0,c("%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)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var L=function(e,r,t,n,i,u,o){var a={$$typeof:p,type:e,key:r,ref:t,props:o,_owner:u};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function ne(e,r,t,n,i){{var u,o={},a=null,N=null;t!==void 0&&(ce(t),a=""+t),Be(r)&&(ce(r.key),a=""+r.key),te(r)&&(N=r.ref,Ce(r,i));for(u in r)U.call(r,u)&&!Ee.hasOwnProperty(u)&&(o[u]=r[u]);if(e&&e.defaultProps){var y=e.defaultProps;for(u in y)o[u]===void 0&&(o[u]=y[u])}if(a||N){var g=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&ke(o,g),N&&Ze(o,g)}return L(e,a,N,i,n,Y.current,o)}}var le=v.ReactCurrentOwner,we=v.ReactDebugCurrentFrame;function W(e){if(e){var r=e._owner,t=Z(e.type,e._source,r?r.type:null);we.setExtraStackFrame(t)}else we.setExtraStackFrame(null)}var Ae;Ae=!1;function xe(e){return typeof e=="object"&&e!==null&&e.$$typeof===p}function Ve(){{if(le.current){var e=C(le.current.type);if(e)return` Check the render method of \``+e+"`."}return""}}function tr(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),t=e.lineNumber;return` Check your code at `+r+":"+t+"."}return""}}var He={};function nr(e){{var r=Ve();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=` Check the top-level render call using <`+t+">.")}return r}}function Ge(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=nr(r);if(He[t])return;He[t]=!0;var n="";e&&e._owner&&e._owner!==le.current&&(n=" It was passed a child from "+C(e._owner.type)+"."),W(e),c('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),W(null)}}function Je(e,r){{if(typeof e!="object")return;if(G(e))for(var t=0;t<e.length;t++){var n=e[t];xe(n)&&Ge(n,r)}else if(xe(e))e._store&&(e._store.validated=!0);else if(e){var i=P(e);if(typeof i=="function"&&i!==e.entries)for(var u=i.call(e),o;!(o=u.next()).done;)xe(o.value)&&Ge(o.value,r)}}}function ar(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===f||r.$$typeof===d))t=r.propTypes;else return;if(t){var n=C(r);Fe(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!Ae){Ae=!0;var i=C(r);c("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",i||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&c("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function or(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){W(e),c("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),W(null);break}}e.ref!==null&&(W(e),c("Invalid attribute `ref` supplied to `React.Fragment`."),W(null))}}function Xe(e,r,t,n,i,u){{var o=Qe(e);if(!o){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" 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 N=tr(i);N?a+=N:a+=Ve();var y;e===null?y="null":G(e)?y="array":e!==void 0&&e.$$typeof===p?(y="<"+(C(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):y=typeof e,c("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",y,a)}var g=ne(e,r,t,i,u);if(g==null)return g;if(o){var A=r.children;if(A!==void 0)if(n)if(G(A)){for(var B=0;B<A.length;B++)Je(A[B],e);Object.freeze&&Object.freeze(A)}else c("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 Je(A,e)}return e===E?or(g):ar(g),g}}function ir(e,r,t){return Xe(e,r,t,!0)}function ur(e,r,t){return Xe(e,r,t,!1)}var sr=ur,cr=ir;$e.Fragment=E,$e.jsx=sr,$e.jsxs=cr}()),$e}process.env.NODE_ENV==="production"?er.exports=Nr():er.exports=mr();var Ir=er.exports;const Er=(I,p,h,E,w)=>{const b=I.getChannelData(0),x=h/(E+w),m=Math.floor(b.length/x),f=p/2;let M=[],s=0;for(let d=0;d<x;d++){const j=[];let S=0;const R=[];let _=0;for(let c=0;c<m&&d*m+c<I.length;c++){const D=b[d*m+c];D<=0&&(j.push(D),S++),D>0&&(R.push(D),_++)}const P=j.reduce((c,D)=>c+D,0)/S,v={max:R.reduce((c,D)=>c+D,0)/_,min:P};v.max>s&&(s=v.max),Math.abs(v.min)>s&&(s=Math.abs(v.min)),M.push(v)}if(f*.8>s*f){const d=f*.8/s;M=M.map(j=>({max:j.max*d,min:j.min*d}))}return M},rr=(I,p,h,E,w,b,x,m=0,f=1)=>{const M=p.height/2,s=p.getContext("2d");if(!s)return;s.clearRect(0,0,p.width,p.height),w!=="transparent"&&(s.fillStyle=w,s.fillRect(0,0,p.width,p.height));const d=(m||0)/f;I.forEach((j,S)=>{const R=S/I.length,_=d>R;s.fillStyle=_&&x?x:b;const P=S*(h+E),v=M+j.min,c=h,D=M+j.max-v;s.beginPath(),s.roundRect?(s.roundRect(P,v,c,D,50),s.fill()):s.fillRect(P,v,c,D)})},gr=T.forwardRef(({blob:I,width:p,height:h,barWidth:E=2,gap:w=1,currentTime:b,style:x,backgroundColor:m="transparent",barColor:f="rgb(184, 184, 184)",barPlayedColor:M="rgb(160, 198, 255)"},s)=>{const d=T.useRef(null),[j,S]=T.useState([]),[R,_]=T.useState(0);return T.useImperativeHandle(s,()=>d.current,[]),T.useEffect(()=>{(async()=>{if(!d.current)return;if(!I){const v=Array.from({length:100},()=>({max:0,min:0}));rr(v,d.current,E,w,m,f,M);return}const P=await I.arrayBuffer();await new AudioContext().decodeAudioData(P,v=>{if(!d.current)return;_(v.duration);const c=Er(v,h,p,E,w);S(c),rr(c,d.current,E,w,m,f,M)})})()},[I,d.current]),T.useEffect(()=>{d.current&&rr(j,d.current,E,w,m,f,M,b,R)},[b,R]),Ir.jsx("canvas",{ref:d,width:p,height:h,style:{...x}})});gr.displayName="AudioVisualizer";const Tr="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiBmaWxsPSJyZ2JhKDEwOSw1NiwxNzQsMSkiPjxwYXRoIGQ9Ik02IDIwLjE5NTdWMy44MDQyMUM2IDMuMDE4NzggNi44NjM5NSAyLjUzOTkzIDcuNTMgMi45NTYyMUwyMC42NDMyIDExLjE1MkMyMS4yNjk5IDExLjU0MzYgMjEuMjY5OSAxMi40NTYzIDIwLjY0MzIgMTIuODQ4TDcuNTMgMjEuMDQzN0M2Ljg2Mzk1IDIxLjQ2IDYgMjAuOTgxMiA2IDIwLjE5NTdaIj48L3BhdGg+PC9zdmc+",hr="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMC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DNS41NDc1OSAxOS42MzQ5IDUuMjM3MTUgMTkuNTcyOSA1LjA4Mzk3IDE5LjM0MzFDNS4wMjkyMiAxOS4yNjEgNSAxOS4xNjQ1IDUgMTkuMDY1N1Y0LjkzNDI2QzUgNC42NTgxMiA1LjIyMzg2IDQuNDM0MjYgNS41IDQuNDM0MjZDNS41OTg3MSA0LjQzNDI2IDUuNjk1MjIgNC40NjM0OCA1Ljc3NzM1IDQuNTE4MjNMMTYgMTEuMzMzM1Y1QzE2IDQuNDQ3NzIgMTYuNDQ3NyA0IDE3IDRDMTcuNTUyMyA0IDE4IDQuNDQ3NzIgMTggNVYxOUMxOCAxOS41NTIzIDE3LjU1MjMgMjAgMTcgMjBDMTYuNDQ3NyAyMCAxNiAxOS41NTIzIDE2IDE5VjEyLjY2NjdaTTcgNy43MzcwM1YxNi4yNjNMMTMuMzk0NCAxMkw3IDcuNzM3MDNaIj48L3BhdGg+PC9zdmc+",pr=({isPlaying:I,allowSkip:p,onPlayClick:h,onPauseClick:E,onSkipForwardClick:w,onSkipBackwardClick:b})=>O.jsxs("div",{style:{display:"flex",alignItems:"center",gridColumn:"2 / 2",gap:15},children:[p&&O.jsx("img",{src:wr,onClick:b,title:"Skip backwards",style:{cursor:"pointer",height:16,width:16},"data-testid":"skip-back"}),O.jsx("img",{src:I?hr:Tr,onClick:I?E:h,title:I?"Pause":"Play",style:{cursor:"pointer",height:"24px",width:"24px"},"data-testid":"play-pause"}),p&&O.jsx("img",{src:Ar,onClick:w,title:"Skip forwards",style:{cursor:"pointer",height:16,width:16},"data-testid":"skip-forward"})]}),Mr=({current:I,setCurrent:p,total:h,showTrack:E=!0,showKnob:w=!0,trackHeight:b=1,color:x="rgba(140, 140, 140)",...m})=>{const[f,M]=T.useState(!1),s=T.useRef(null),d=()=>`${I/h*100}%`,j=D=>{if(!s.current)return;const ae=s.current.getBoundingClientRect(),oe=ae.width,K=S(D)-ae.left;K<0?p(0):K>oe?p(h):p(h*K/oe)},S=D=>D instanceof TouchEvent?D.touches[0].clientX:D.clientX,R=D=>{D.nativeEvent instanceof MouseEvent?(window.addEventListener("mousemove",_),window.addEventListener("mouseup",P)):(window.addEventListener("touchmove",_),window.addEventListener("touchend",P)),j(D.nativeEvent),M(!0)},_=D=>{j(D)},P=D=>{D instanceof MouseEvent?(window.removeEventListener("mousemove",_),window.removeEventListener("mouseup",P)):(window.removeEventListener("touchmove",_),window.removeEventListener("touchend",P)),M(!1)},v=()=>{M(!0)},c=()=>{M(!1)};return O.jsx("div",{tabIndex:0,style:{height:"15px",width:"100%",gridColumn:1/1,gridRow:1/1,placeSelf:"center",display:"flex",alignItems:"center",cursor:"pointer"},onMouseDown:R,onTouchStart:R,onMouseEnter:v,onMouseLeave:c,ref:s,"data-testid":m["data-testid"]?`${m["data-testid"]}-trackbar`:"trackbar",children:O.jsx("div",{style:{backgroundColor:x,height:E?b:0,width:"100%",display:"flex",alignItems:"center",position:"relative",cursor:"pointer"},children:O.jsx("div",{style:{width:"10px",height:"10px",borderRadius:"50%",backgroundColor:x,opacity:w||f?1:0,position:"absolute",left:d(),marginLeft:-5,cursor:"pointer",transition:f?"opacity 0.3s ease-in-out":"opacity 0.75s ease-in-out"}})})})},xr="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2IiBmaWxsPSJyZ2JhKDg0LDg0LDg0LDEpIj48cGF0aCBkPSJNOC44ODg4OSAxNi4wMDAxSDVDNC40NDc3MiAxNi4wMDAxIDQgMTUuNTUyNCA0IDE1LjAwMDFWOS4wMDAwN0M0IDguNDQ3NzggNC40NDc3MiA4LjAwMDA3IDUgOC4wMDAwN0g4Ljg4ODg5TDE0LjE4MzQgMy42NjgyMUMxNC4zOTcxIDMuNDkzMzUgMTQuNzEyMSAzLjUyNDg1IDE0Ljg4NyAzLjczODU3QzE0Ljk2MDEgMy44M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jI5MjY2IDIxLjE3OTkgNS42MDc5NCAyMS4wMDMxIDUuODIwMDhDMjAuOTA4MSA1LjkzNDA3IDIwLjc2NzQgNS45OTk5OCAyMC42MTkgNS45OTk5OEgxNkw2IDZDNC44OTU0MyA2IDQgNi44OTU0MyA0IDhWMTZIMlY4QzIgNS43OTA4NiAzLjc5MDg2IDQgNiA0SDE2Wk0xMSA4SDEzVjE2SDExVjEwSDlWOUwxMSA4WiI+PC9wYXRoPjwvc3ZnPg==",vr=({seconds:I})=>O.jsx("div",{style:{color:"#000000",fontSize:14},"data-testid":"timer",children:I!==void 0?`${Math.floor(I/60).toString().padStart(2,"0")}:${String(Math.round(I%60)).padStart(2,"0")}`:"--:--"}),Cr=({src:I,loop:p=!1,volume:h=.75,muted:E=!1,autoplay:w=!1,crossOrigin:b=null,preload:x="",playbackRate:m=1,onabort:f=null,oncanplay:M=null,oncanplaythrough:s=null,ondurationchange:d=null,onemptied:j=null,onended:S=null,onerror:R=null,onloadeddata:_=null,onloadedmetadata:P=null,onloadstart:v=null,onpause:c=null,onplay:D=null,onplaying:ae=null,onprogress:oe=null,onratechange:K=null,onseeked:_e=null,onseeking:Pe=null,onstalled:de=null,onsuspend:Qe=null,ontimeupdate:Ue=null,onvolumechange:ye=null,onwaiting:C=null,minimal:k=!1,width:Q,trackHeight:ie=75,barWidth:ge=2,gap:pe=1,visualise:Me=!0,backgroundColor:ue="#EFEFEF",barColor:ve,barPlayedColor:je,allowSkip:De=!0,skipDuration:be=5,showLoopOption:Ye=!0,showVolumeControl:$=!0,seekBarColor:q,volumeControlColor:V,hideSeekBar:ee=!1,hideSeekKnobWhenPlaying:H=!1})=>{const[Oe,Ne]=T.useState(),[l]=T.useState(()=>new Audio),[J,Z]=T.useState(0),[U,se]=T.useState(0),[X,F]=T.useState(!1),[Fe,We]=T.useState(h),[G,me]=T.useState(!1),[Se,Ie]=T.useState(p);T.useEffect(()=>(fetch(I).then(async L=>{const ne=await L.blob();return l.src=URL.createObjectURL(ne),l.volume=h,l.loop=p,l.muted=E,l.autoplay=w,l.crossOrigin=b,l.preload=x,l.playbackRate=m,l.onabort=f,l.oncanplay=M,l.oncanplaythrough=s,l.ondurationchange=d,l.onemptied=j,l.onended=S,l.onerror=R,l.onloadeddata=_,l.onloadedmetadata=P,l.onloadstart=v,l.onpause=c,l.onplay=D,l.onplaying=ae,l.onprogress=oe,l.onratechange=K,l.onseeked=_e,l.onseeking=Pe,l.onstalled=de,l.onsuspend=Qe,l.ontimeupdate=Ue,l.onvolumechange=ye,l.onwaiting=C,l.addEventListener("ended",ce),Ne(ne),ne}).then(async L=>{const ne=await L.arrayBuffer();await new AudioContext().decodeAudioData(ne,we=>{se(we.duration)})}),()=>{l.removeEventListener("ended",ce)}),[]);const ce=()=>{F(!1),te(0)},Y=()=>{if(!l.src)return;l.duration!==1/0&&se(l.duration),l.play(),F(!0);const L=()=>{if(l.currentTime>=U){Ee(),te(0);return}Z(l.currentTime),requestAnimationFrame(L)};requestAnimationFrame(L)},Ee=()=>{l.pause(),F(!1)},Te=()=>{l.volume=0,me(!0)},he=()=>{l.volume=h,me(!1)},re=L=>{me(!1),We(L),l.volume=L},te=L=>{l.currentTime=L,Z(L)},Be=()=>{Ie(L=>!L),l.loop=!Se},Ce=()=>{te(Math.min(U,J+be))},ke=()=>{te(Math.max(0,J-be))},Ze=L=>{te(L)};return O.jsxs("div",{style:{backgroundColor:ue,borderRadius:"5px",width:Q,height:"max-content",display:"flex",gap:10,flexDirection:"column",alignItems:"center",padding:k?"7px 10px":"10px 20px 15px",position:"relative"},children:[O.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:k?10:15,width:Q},children:[k?O.jsx(pr,{isPlaying:X,allowSkip:!1,onPauseClick:Ee,onPlayClick:Y,onSkipBackwardClick:ke,onSkipForwardClick:Ce}):O.jsx(vr,{seconds:J}),O.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr",gridTemplateRows:"1fr",width:Q*.7,height:ie},children:[Me&&Oe&&O.jsx(gr,{width:Q*.7,height:ie,barWidth:ge,gap:pe,blob:Oe,currentTime:J,backgroundColor:ue,barColor:ve,barPlayedColor:je,style:{gridColumn:1/1,gridRow:1/1,placeSelf:"center"}}),O.jsx(Mr,{total:U,current:J,setCurrent:Ze,color:q,showTrack:!ee,showKnob:!(H&&X),"data-testid":"seek-trackbar"})]}),O.jsx(vr,{seconds:k&&X?J:Math.round(U)})]}),!k&&O.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr",placeItems:"center",width:"98%"},children:[Ye&&O.jsx("img",{src:Se?Or:Sr,onClick:Be,title:"Loop",style:{cursor:"pointer",justifySelf:"flex-start",height:16,width:16}}),O.jsx(pr,{isPlaying:X,allowSkip:De,onPauseClick:Ee,onPlayClick:Y,onSkipBackwardClick:ke,onSkipForwardClick:Ce}),$&&O.jsxs("div",{style:{display:"flex",gap:8,justifySelf:"flex-end",width:80},children:[O.jsx("img",{src:!G&&h>0?xr:br,onClick:G?he:Te,title:G?"Un-mute":"Mute",style:{cursor:"pointer",height:16,width:16}}),O.jsx(Mr,{current:Fe,total:1,setCurrent:re,color:V,"data-testid":"volume"})]})]})]})};fe.AudioPlayer=Cr,Object.defineProperty(fe,Symbol.toStringTag,{value:"Module"})});