You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP

react-h5-audio-player

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-h5-audio-player - npm Package Compare versions

Comparing version

to
3.8.1

@@ -357,3 +357,3 @@ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";

}, actionIcon), showJumpControls && React.createElement("button", {
"aria-label": "Forward",
"aria-label": i18nAriaLabels.forward,
className: "rhap_button-clear rhap_main-controls-button rhap_forward-button",

@@ -365,3 +365,3 @@ type: "button",

})), showSkipControls && React.createElement("button", {
"aria-label": "Skip",
"aria-label": i18nAriaLabels.next,
className: "rhap_button-clear rhap_main-controls-button rhap_skip-button",

@@ -427,3 +427,3 @@ type: "button",

}, React.createElement("button", {
"aria-label": volume ? 'Mute' : 'Unmute',
"aria-label": volume ? i18nAriaLabels.volume : i18nAriaLabels.volumeMute,
onClick: _this.handleClickVolumeButton,

@@ -430,0 +430,0 @@ type: "button",

@@ -377,3 +377,3 @@ "use strict";

}, actionIcon), showJumpControls && _react.default.createElement("button", {
"aria-label": "Forward",
"aria-label": i18nAriaLabels.forward,
className: "rhap_button-clear rhap_main-controls-button rhap_forward-button",

@@ -385,3 +385,3 @@ type: "button",

})), showSkipControls && _react.default.createElement("button", {
"aria-label": "Skip",
"aria-label": i18nAriaLabels.next,
className: "rhap_button-clear rhap_main-controls-button rhap_skip-button",

@@ -447,3 +447,3 @@ type: "button",

}, _react.default.createElement("button", {
"aria-label": volume ? 'Mute' : 'Unmute',
"aria-label": volume ? i18nAriaLabels.volume : i18nAriaLabels.volumeMute,
onClick: _this.handleClickVolumeButton,

@@ -450,0 +450,0 @@ type: "button",

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("React")):"function"==typeof define&&define.amd?define("ReactH5AudioPlayer",["React"],t):"object"==typeof exports?exports.ReactH5AudioPlayer=t(require("React")):e.ReactH5AudioPlayer=t(e.React)}(window,(function(e){return function(e){var t={};function o(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=e,o.c=t,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=22)}([function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(t,o){t.exports=e},function(e,t){function o(t){return e.exports=o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,o(t)}e.exports=o,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.InlineIcon=t.Icon=void 0;var n,r=(n=o(2))&&n.__esModule?n:{default:n};function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var u=0,s=/(-?[0-9.]*[0-9]+[0-9.]*)/g,l=/^-?[0-9.]*[0-9]+[0-9.]*$/g,c=["width","height","inline","hFlip","vFlip","flip","rotate","align","color","box"],d={left:0,top:0,width:16,height:16,rotate:0,hFlip:!1,vFlip:!1};var p=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._item=t}var t,o,n;return t=e,n=[{key:"splitAttributes",value:function(e){var t={icon:Object.create(null),node:Object.create(null)};return Object.keys(e).forEach((function(o){t[-1===c.indexOf(o)?"node":"icon"][o]=e[o]})),t}},{key:"calculateDimension",value:function(e,t,o){if(1===t)return e;if(o=void 0===o?100:o,"number"==typeof e)return Math.ceil(e*t*o)/o;var n=e.split(s);if(null===n||!n.length)return null;for(var r,a=[],i=n.shift(),u=l.test(i);;){if(u?(r=parseFloat(i),isNaN(r)?a.push(i):a.push(Math.ceil(r*t*o)/o)):a.push(i),void 0===(i=n.shift()))return a.join("");u=!u}}},{key:"replaceIDs",value:function(e){var t,o,n=/\sid="(\S+)"/g,r=[];function a(e,t,o){for(var n=0;-1!==(n=o.indexOf(e,n));)o=o.slice(0,n)+t+o.slice(n+e.length),n+=t.length;return o}for(;t=n.exec(e);)r.push(t[1]);return r.length?(o="IconifyId-"+Date.now().toString(16)+"-"+(16777216*Math.random()|0).toString(16)+"-",r.forEach((function(t){var n=o+u;u++,e=a('="'+t+'"','="'+n+'"',e),e=a('="#'+t+'"','="#'+n+'"',e),e=a("(#"+t+")","(#"+n+")",e)})),e):e}}],(o=[{key:"getAttributes",value:function(t){var o=this._item;"object"!==a(t)&&(t=Object.create(null));var n={horizontal:"center",vertical:"middle",slice:!1},r={rotate:o.rotate,hFlip:o.hFlip,vFlip:o.vFlip},i=Object.create(null),u=Object.create(null),s=!0===t.inline||"true"===t.inline||"1"===t.inline,l={left:o.left,top:s?o.inlineTop:o.top,width:o.width,height:s?o.inlineHeight:o.height};if(["hFlip","vFlip"].forEach((function(e){void 0===t[e]||!0!==t[e]&&"true"!==t[e]&&"1"!==t[e]||(r[e]=!r[e])})),void 0!==t.flip&&t.flip.toLowerCase().split(/[\s,]+/).forEach((function(e){switch(e){case"horizontal":r.hFlip=!r.hFlip;break;case"vertical":r.vFlip=!r.vFlip}})),void 0!==t.rotate){var c=t.rotate;if("number"==typeof c)r.rotate+=c;else if("string"==typeof c){var d=c.replace(/^-?[0-9.]*/,"");if(""===d)c=parseInt(c),isNaN(c)||(r.rotate+=c);else if(d!==c){var p=!1;switch(d){case"%":p=25;break;case"deg":p=90}p&&(c=parseInt(c.slice(0,c.length-d.length)),isNaN(c)||(r.rotate+=Math.round(c/p)))}}}var h,f=[];switch(r.hFlip?r.vFlip?r.rotate+=2:(f.push("translate("+(l.width+l.left)+" "+(0-l.top)+")"),f.push("scale(-1 1)"),l.top=l.left=0):r.vFlip&&(f.push("translate("+(0-l.left)+" "+(l.height+l.top)+")"),f.push("scale(1 -1)"),l.top=l.left=0),r.rotate%4){case 1:h=l.height/2+l.top,f.unshift("rotate(90 "+h+" "+h+")"),0===l.left&&0===l.top||(h=l.left,l.left=l.top,l.top=h),l.width!==l.height&&(h=l.width,l.width=l.height,l.height=h);break;case 2:f.unshift("rotate(180 "+(l.width/2+l.left)+" "+(l.height/2+l.top)+")");break;case 3:h=l.width/2+l.left,f.unshift("rotate(-90 "+h+" "+h+")"),0===l.left&&0===l.top||(h=l.left,l.left=l.top,l.top=h),l.width!==l.height&&(h=l.width,l.width=l.height,l.height=h)}var m,v,g=t.width?t.width:null,y=t.height?t.height:null;null===g&&null===y&&(y="1em"),null!==g&&null!==y?(m=g,v=y):null!==g?(m=g,v=e.calculateDimension(m,l.height/l.width)):(v=y,m=e.calculateDimension(v,l.width/l.height)),!1!==m&&(u.width="auto"===m?l.width:m),!1!==v&&(u.height="auto"===v?l.height:v),s&&0!==o.verticalAlign&&(i["vertical-align"]=o.verticalAlign+"em"),void 0!==t.align&&t.align.toLowerCase().split(/[\s,]+/).forEach((function(e){switch(e){case"left":case"right":case"center":n.horizontal=e;break;case"top":case"bottom":case"middle":n.vertical=e;break;case"crop":n.slice=!0;break;case"meet":n.slice=!1}})),u.preserveAspectRatio=function(e){var t;switch(e.horizontal){case"left":t="xMin";break;case"right":t="xMax";break;default:t="xMid"}switch(e.vertical){case"top":t+="YMin";break;case"bottom":t+="YMax";break;default:t+="YMid"}return t+=e.slice?" slice":" meet"}(n),u.viewBox=l.left+" "+l.top+" "+l.width+" "+l.height;var w=e.replaceIDs(o.body);return void 0!==t.color&&(w=w.replace(/currentColor/g,t.color)),f.length&&(w='<g transform="'+f.join(" ")+'">'+w+"</g>"),!0!==t.box&&"true"!==t.box&&"1"!==t.box||(w+='<rect x="'+l.left+'" y="'+l.top+'" width="'+l.width+'" height="'+l.height+'" fill="rgba(0, 0, 0, 0)" />'),{attributes:u,body:w,style:i}}},{key:"getSVG",value:function(t,o){var n=e.splitAttributes(t),r=this.getAttributes(n.icon),a='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"';return o&&Object.keys(n.node).forEach((function(e){a+=" "+e+'="'+n.node[e]+'"'})),Object.keys(r.attributes).forEach((function(e){a+=" "+e+'="'+r.attributes[e]+'"'})),a+=' style="-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); transform: rotate(360deg);',Object.keys(r.style).forEach((function(e){a+=" "+e+": "+r.style[e]+";"})),t&&void 0!==t.style&&(a+=t.style),a+='">',a+=r.body+"</svg>"}}])&&i(t.prototype,o),n&&i(t,n),e}();function h(e,t){if("object"!==a(e.icon))return null;var o=p.splitAttributes(e),n=o.icon,i=o.node;delete i.icon,void 0===n.inline&&(n.inline=t);var u=new p(function(e){var t,o=Object.create(null);for(t in d)o[t]=d[t];for(t in e)o[t]=e[t];return void 0===o.inlineTop&&(o.inlineTop=o.top),void 0===o.inlineHeight&&(o.inlineHeight=o.height),void 0===o.verticalAlign&&(o.verticalAlign=o.height%7==0&&o.height%8!=0?-.143:-.125),o}(e.icon)).getAttributes(n),s={transform:"rotate(360deg)"};if(void 0!==u.style["vertical-align"]&&(s.verticalAlign=u.style["vertical-align"]),void 0!==e.style)for(var l in e.style)s[l]=e.style[l];var c,h={xmlns:"http://www.w3.org/2000/svg",focusable:!1,style:s};for(c in i)h[c]=i[c];for(c in u.attributes)h[c]=u.attributes[c];return h.dangerouslySetInnerHTML={__html:u.body},r.default.createElement("svg",h,null)}var f=function(e){return h(e,!1)};t.Icon=f;t.InlineIcon=function(e){return h(e,!0)};var m=f;t.default=m},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function o(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,o){var n=o(20);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&n(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,o){var n=o(21).default,r=o(0);e.exports=function(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return r(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){t.__esModule=!0,t.default={body:'<path d="M10 16.5v-9l6 4.5M12 2A10 10 0 0 0 2 12a10 10 0 0 0 10 10a10 10 0 0 0 10-10A10 10 0 0 0 12 2z" fill="currentColor"/>',width:24,height:24}},function(e,t){t.__esModule=!0,t.default={body:'<path d="M15 16h-2V8h2m-4 8H9V8h2m1-6A10 10 0 0 0 2 12a10 10 0 0 0 10 10a10 10 0 0 0 10-10A10 10 0 0 0 12 2z" fill="currentColor"/>',width:24,height:24}},function(e,t){t.__esModule=!0,t.default={body:'<path d="M6 18V6h2v12H6m3.5-6L18 6v12l-8.5-6z" fill="currentColor"/>',width:24,height:24}},function(e,t){t.__esModule=!0,t.default={body:'<path d="M16 18h2V6h-2M6 18l8.5-6L6 6v12z" fill="currentColor"/>',width:24,height:24}},function(e,t){t.__esModule=!0,t.default={body:'<path d="M13 6v12l8.5-6M4 18l8.5-6L4 6v12z" fill="currentColor"/>',width:24,height:24}},function(e,t){t.__esModule=!0,t.default={body:'<path d="M11.5 12l8.5 6V6m-9 12V6l-8.5 6l8.5 6z" fill="currentColor"/>',width:24,height:24}},function(e,t){t.__esModule=!0,t.default={body:'<path d="M14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.84-5 6.7v2.07c4-.91 7-4.49 7-8.77c0-4.28-3-7.86-7-8.77M16.5 12c0-1.77-1-3.29-2.5-4.03V16c1.5-.71 2.5-2.24 2.5-4M3 9v6h4l5 5V4L7 9H3z" fill="currentColor"/>',width:24,height:24}},function(e,t){t.__esModule=!0,t.default={body:'<path d="M3 9h4l5-5v16l-5-5H3V9m13.59 3L14 9.41L15.41 8L18 10.59L20.59 8L22 9.41L19.41 12L22 14.59L20.59 16L18 13.41L15.41 16L14 14.59L16.59 12z" fill="currentColor"/>',width:24,height:24}},function(e,t){t.__esModule=!0,t.default={body:'<path d="M17 17H7v-3l-4 4l4 4v-3h12v-6h-2M7 7h10v3l4-4l-4-4v3H5v6h2V7z" fill="currentColor"/>',width:24,height:24}},function(e,t){t.__esModule=!0,t.default={body:'<path d="M2 5.27L3.28 4L20 20.72L18.73 22l-3-3H7v3l-4-4l4-4v3h6.73L7 10.27V11H5V8.27l-3-3M17 13h2v4.18l-2-2V13m0-8V2l4 4l-4 4V7H8.82l-2-2H17z" fill="currentColor"/>',width:24,height:24}},function(e,t){function o(){return e.exports=o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,o.apply(this,arguments)}e.exports=o,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function o(t,n){return e.exports=o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,o(t,n)}e.exports=o,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function o(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=o=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=o=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),o(t)}e.exports=o,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,o){"use strict";o.r(t),o.d(t,"RHAP_UI",(function(){return te}));var n=o(5),r=o.n(n),a=o(6),i=o.n(a),u=o(0),s=o.n(u),l=o(7),c=o.n(l),d=o(8),p=o.n(d),h=o(3),f=o.n(h),m=o(1),v=o.n(m),g=o(2),y=o.n(g),w=o(4),b=o(9),E=o.n(b),M=o(10),_=o.n(M),T=o(11),A=o.n(T),L=o(12),C=o.n(L),O=o(13),P=o.n(O),k=o(14),x=o.n(k),S=o(15),D=o.n(S),R=o(16),V=o.n(R),N=o(17),U=o.n(N),I=o(18),F=o.n(I),j=o(19),B=o.n(j),W=function(e){switch(e){case"stacked":return"rhap_stacked";case"stacked-reverse":return"rhap_stacked-reverse";case"horizontal":return"rhap_horizontal";case"horizontal-reverse":return"rhap_horizontal-reverse";default:return"rhap_stacked"}},H=function(e){return e instanceof MouseEvent?e.clientX:e.touches[0].clientX},z=function(e){return e>9?e.toString():"0".concat(e)},J=function(e,t,o){if(!isFinite(e))return null;var n=Math.floor(e/60),r=z(n),a=z(Math.floor(e%60)),i=z(Math.floor(n%60)),u=Math.floor(n/60),s="".concat(r,":").concat(a),l="".concat(u,":").concat(i,":").concat(a);return"auto"===o?t>=3600?l:s:"mm:ss"===o?s:"hh:mm:ss"===o?l:void 0};function G(e,t){var o=!1;return function(n){o||(e(n),o=!0,setTimeout((function(){return o=!1}),t))}}function K(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var o,n=f()(e);if(t){var r=f()(this).constructor;o=Reflect.construct(n,arguments,r)}else o=n.apply(this,arguments);return p()(this,o)}}var Y=function(e){c()(o,e);var t=K(o);function o(){var e;r()(this,o);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return e=t.call.apply(t,[this].concat(a)),v()(s()(e),"audio",void 0),v()(s()(e),"timeOnMouseMove",0),v()(s()(e),"hasAddedAudioEventListener",!1),v()(s()(e),"downloadProgressAnimationTimer",void 0),v()(s()(e),"state",{isDraggingProgress:!1,currentTimePos:"0%",hasDownloadProgressAnimation:!1,downloadProgressArr:[],waitingForSeekCallback:!1}),v()(s()(e),"getCurrentProgress",(function(t){var o=e.props,n=o.audio,r=o.progressBar;if(0!==n.src.indexOf("blob:")&&void 0===e.props.srcDuration&&(!n.src||!isFinite(n.currentTime)||!r.current))return{currentTime:0,currentTimePos:"0%"};var a=r.current.getBoundingClientRect(),i=a.width,u=H(t)-a.left;return u<0?u=0:u>i&&(u=i),{currentTime:e.getDuration()*u/i,currentTimePos:"".concat((u/i*100).toFixed(2),"%")}})),v()(s()(e),"handleContextMenu",(function(e){e.preventDefault()})),v()(s()(e),"handleMouseDownOrTouchStartProgressBar",(function(t){t.stopPropagation();var o=e.getCurrentProgress(t.nativeEvent),n=o.currentTime,r=o.currentTimePos;isFinite(n)&&(e.timeOnMouseMove=n,e.setState({isDraggingProgress:!0,currentTimePos:r}),t.nativeEvent instanceof MouseEvent?(window.addEventListener("mousemove",e.handleWindowMouseOrTouchMove),window.addEventListener("mouseup",e.handleWindowMouseOrTouchUp)):(window.addEventListener("touchmove",e.handleWindowMouseOrTouchMove),window.addEventListener("touchend",e.handleWindowMouseOrTouchUp)))})),v()(s()(e),"handleWindowMouseOrTouchMove",(function(t){t instanceof MouseEvent&&t.preventDefault(),t.stopPropagation();var o=window.getSelection();if(o&&"Range"===o.type&&o.empty(),e.state.isDraggingProgress){var n=e.getCurrentProgress(t),r=n.currentTime,a=n.currentTimePos;e.timeOnMouseMove=r,e.setState({currentTimePos:a})}})),v()(s()(e),"handleWindowMouseOrTouchUp",(function(t){t.stopPropagation();var o=e.timeOnMouseMove,n=e.props,r=n.audio,a=n.onChangeCurrentTimeError,i=n.onSeek;if(i)e.setState({isDraggingProgress:!1,waitingForSeekCallback:!0},(function(){i(r,o).then((function(){return e.setState({waitingForSeekCallback:!1})}),(function(e){throw new Error(e)}))}));else{var u={isDraggingProgress:!1};r.readyState!==r.HAVE_NOTHING&&r.readyState!==r.HAVE_METADATA&&isFinite(o)?r.currentTime=o:(u.currentTimePos="0%",a&&a()),e.setState(u)}t instanceof MouseEvent?(window.removeEventListener("mousemove",e.handleWindowMouseOrTouchMove),window.removeEventListener("mouseup",e.handleWindowMouseOrTouchUp)):(window.removeEventListener("touchmove",e.handleWindowMouseOrTouchMove),window.removeEventListener("touchend",e.handleWindowMouseOrTouchUp))})),v()(s()(e),"handleAudioTimeUpdate",G((function(t){var o=e.state.isDraggingProgress,n=t.target;if(!o&&!0!==e.state.waitingForSeekCallback){var r=n.currentTime,a=e.getDuration();e.setState({currentTimePos:"".concat((r/a*100||0).toFixed(2),"%")})}}),e.props.progressUpdateInterval)),v()(s()(e),"handleAudioDownloadProgressUpdate",(function(t){for(var o=t.target,n=e.getDuration(),r=[],a=0;a<o.buffered.length;a++){var i=o.buffered.start(a),u=o.buffered.end(a);r.push({left:"".concat(Math.round(100/n*i)||0,"%"),width:"".concat(Math.round(100/n*(u-i))||0,"%")})}clearTimeout(e.downloadProgressAnimationTimer),e.setState({downloadProgressArr:r,hasDownloadProgressAnimation:!0}),e.downloadProgressAnimationTimer=setTimeout((function(){e.setState({hasDownloadProgressAnimation:!1})}),200)})),e}return i()(o,[{key:"getDuration",value:function(){var e=this.props,t=e.audio,o=e.srcDuration;return void 0===o?t.duration:o}},{key:"componentDidUpdate",value:function(){var e=this.props.audio;e&&!this.hasAddedAudioEventListener&&(this.audio=e,this.hasAddedAudioEventListener=!0,e.addEventListener("timeupdate",this.handleAudioTimeUpdate),e.addEventListener("progress",this.handleAudioDownloadProgressUpdate))}},{key:"componentWillUnmount",value:function(){this.audio&&this.hasAddedAudioEventListener&&(this.audio.removeEventListener("timeupdate",this.handleAudioTimeUpdate),this.audio.removeEventListener("progress",this.handleAudioDownloadProgressUpdate)),clearTimeout(this.downloadProgressAnimationTimer)}},{key:"render",value:function(){var e=this.props,t=e.showDownloadProgress,o=e.showFilledProgress,n=e.progressBar,r=e.i18nProgressBar,a=this.state,i=a.currentTimePos,u=a.downloadProgressArr,s=a.hasDownloadProgressAnimation;return y.a.createElement("div",{className:"rhap_progress-container",ref:n,"aria-label":r,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Number(i.split("%")[0]),tabIndex:0,onMouseDown:this.handleMouseDownOrTouchStartProgressBar,onTouchStart:this.handleMouseDownOrTouchStartProgressBar,onContextMenu:this.handleContextMenu},y.a.createElement("div",{className:"rhap_progress-bar ".concat(t?"rhap_progress-bar-show-download":"")},y.a.createElement("div",{className:"rhap_progress-indicator",style:{left:i}}),o&&y.a.createElement("div",{className:"rhap_progress-filled",style:{width:i}}),t&&u.map((function(e,t){var o=e.left,n=e.width;return y.a.createElement("div",{key:t,className:"rhap_download-progress",style:{left:o,width:n,transitionDuration:s?".2s":"0s"}})}))))}}]),o}(g.Component),q=Object(g.forwardRef)((function(e,t){return y.a.createElement(Y,B()({},e,{progressBar:t}))}));function X(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var o,n=f()(e);if(t){var r=f()(this).constructor;o=Reflect.construct(n,arguments,r)}else o=n.apply(this,arguments);return p()(this,o)}}var $=function(e){c()(o,e);var t=X(o);function o(e){var n;r()(this,o),n=t.call(this,e),v()(s()(n),"audio",void 0),v()(s()(n),"hasAddedAudioEventListener",!1),v()(s()(n),"state",{currentTime:n.props.defaultCurrentTime}),v()(s()(n),"handleAudioCurrentTimeChange",(function(e){var t=e.target,o=n.props,r=o.isLeftTime,a=o.timeFormat,i=o.defaultCurrentTime;n.setState({currentTime:J(r?t.duration-t.currentTime:t.currentTime,t.duration,a)||i})})),v()(s()(n),"addAudioEventListeners",(function(){var e=n.props.audio;e&&!n.hasAddedAudioEventListener&&(n.audio=e,n.hasAddedAudioEventListener=!0,e.addEventListener("timeupdate",n.handleAudioCurrentTimeChange),e.addEventListener("loadedmetadata",n.handleAudioCurrentTimeChange))}));var a=e.audio,i=e.defaultCurrentTime,u=e.isLeftTime,l=e.timeFormat,c=i;return a&&(c=J(u?a.duration-a.currentTime:a.currentTime,a.duration,l)),n.state={currentTime:c},n}return i()(o,[{key:"componentDidMount",value:function(){this.addAudioEventListeners()}},{key:"componentDidUpdate",value:function(){this.addAudioEventListeners()}},{key:"componentWillUnmount",value:function(){this.audio&&this.hasAddedAudioEventListener&&(this.audio.removeEventListener("timeupdate",this.handleAudioCurrentTimeChange),this.audio.removeEventListener("loadedmetadata",this.handleAudioCurrentTimeChange))}},{key:"render",value:function(){return this.state.currentTime}}]),o}(g.PureComponent);function Q(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var o,n=f()(e);if(t){var r=f()(this).constructor;o=Reflect.construct(n,arguments,r)}else o=n.apply(this,arguments);return p()(this,o)}}var Z=function(e){c()(o,e);var t=Q(o);function o(e){var n;r()(this,o),n=t.call(this,e),v()(s()(n),"audio",void 0),v()(s()(n),"hasAddedAudioEventListener",!1),v()(s()(n),"state",{duration:n.props.audio?J(n.props.audio.duration,n.props.audio.duration,n.props.timeFormat):n.props.defaultDuration}),v()(s()(n),"handleAudioDurationChange",(function(e){var t=e.target,o=n.props,r=o.timeFormat,a=o.defaultDuration;n.setState({duration:J(t.duration,t.duration,r)||a})})),v()(s()(n),"addAudioEventListeners",(function(){var e=n.props.audio;e&&!n.hasAddedAudioEventListener&&(n.audio=e,n.hasAddedAudioEventListener=!0,e.addEventListener("durationchange",n.handleAudioDurationChange),e.addEventListener("abort",n.handleAudioDurationChange))}));var a=e.audio,i=e.timeFormat,u=e.defaultDuration;return n.state={duration:a?J(a.duration,a.duration,i):u},n}return i()(o,[{key:"componentDidMount",value:function(){this.addAudioEventListeners()}},{key:"componentDidUpdate",value:function(){this.addAudioEventListeners()}},{key:"componentWillUnmount",value:function(){this.audio&&this.hasAddedAudioEventListener&&(this.audio.removeEventListener("durationchange",this.handleAudioDurationChange),this.audio.removeEventListener("abort",this.handleAudioDurationChange))}},{key:"render",value:function(){return this.state.duration}}]),o}(g.PureComponent);function ee(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var o,n=f()(e);if(t){var r=f()(this).constructor;o=Reflect.construct(n,arguments,r)}else o=n.apply(this,arguments);return p()(this,o)}}var te,oe=function(e){c()(o,e);var t=ee(o);function o(){var e;r()(this,o);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return e=t.call.apply(t,[this].concat(a)),v()(s()(e),"audio",void 0),v()(s()(e),"hasAddedAudioEventListener",!1),v()(s()(e),"volumeBar",Object(g.createRef)()),v()(s()(e),"volumeAnimationTimer",0),v()(s()(e),"lastVolume",e.props.volume),v()(s()(e),"state",{currentVolumePos:"".concat((e.lastVolume/1*100||0).toFixed(2),"%"),hasVolumeAnimation:!1,isDraggingVolume:!1}),v()(s()(e),"getCurrentVolume",(function(t){var o=e.props.audio;if(!e.volumeBar.current)return{currentVolume:o.volume,currentVolumePos:e.state.currentVolumePos};var n,r,a=e.volumeBar.current.getBoundingClientRect(),i=a.width,u=H(t)-a.left;return u<0?(n=0,r="0%"):u>a.width?(n=1,r="100%"):(n=u/i,r="".concat(u/i*100,"%")),{currentVolume:n,currentVolumePos:r}})),v()(s()(e),"handleContextMenu",(function(e){e.preventDefault()})),v()(s()(e),"handleClickVolumeButton",(function(){var t=e.props.audio;t.volume>0?(e.lastVolume=t.volume,t.volume=0):t.volume=e.lastVolume})),v()(s()(e),"handleVolumnControlMouseOrTouchDown",(function(t){t.stopPropagation();var o=e.props.audio,n=e.getCurrentVolume(t.nativeEvent),r=n.currentVolume,a=n.currentVolumePos;o.volume=r,e.setState({isDraggingVolume:!0,currentVolumePos:a}),t.nativeEvent instanceof MouseEvent?(window.addEventListener("mousemove",e.handleWindowMouseOrTouchMove),window.addEventListener("mouseup",e.handleWindowMouseOrTouchUp)):(window.addEventListener("touchmove",e.handleWindowMouseOrTouchMove),window.addEventListener("touchend",e.handleWindowMouseOrTouchUp))})),v()(s()(e),"handleWindowMouseOrTouchMove",(function(t){t instanceof MouseEvent&&t.preventDefault(),t.stopPropagation();var o=e.props.audio,n=window.getSelection();if(n&&"Range"===n.type&&n.empty(),e.state.isDraggingVolume){var r=e.getCurrentVolume(t),a=r.currentVolume,i=r.currentVolumePos;o.volume=a,e.setState({currentVolumePos:i})}})),v()(s()(e),"handleWindowMouseOrTouchUp",(function(t){t.stopPropagation(),e.setState({isDraggingVolume:!1}),t instanceof MouseEvent?(window.removeEventListener("mousemove",e.handleWindowMouseOrTouchMove),window.removeEventListener("mouseup",e.handleWindowMouseOrTouchUp)):(window.removeEventListener("touchmove",e.handleWindowMouseOrTouchMove),window.removeEventListener("touchend",e.handleWindowMouseOrTouchUp))})),v()(s()(e),"handleAudioVolumeChange",(function(t){var o=e.state.isDraggingVolume,n=t.target.volume;(e.lastVolume>0&&0===n||0===e.lastVolume&&n>0)&&e.props.onMuteChange(),e.lastVolume=n,o||(e.setState({hasVolumeAnimation:!0,currentVolumePos:"".concat((n/1*100||0).toFixed(2),"%")}),clearTimeout(e.volumeAnimationTimer),e.volumeAnimationTimer=setTimeout((function(){e.setState({hasVolumeAnimation:!1})}),100))})),e}return i()(o,[{key:"componentDidUpdate",value:function(){var e=this.props.audio;e&&!this.hasAddedAudioEventListener&&(this.audio=e,this.hasAddedAudioEventListener=!0,e.addEventListener("volumechange",this.handleAudioVolumeChange))}},{key:"componentWillUnmount",value:function(){this.audio&&this.hasAddedAudioEventListener&&this.audio.removeEventListener("volumechange",this.handleAudioVolumeChange),clearTimeout(this.volumeAnimationTimer)}},{key:"render",value:function(){var e=this.props,t=e.audio,o=e.showFilledVolume,n=e.i18nVolumeControl,r=this.state,a=r.currentVolumePos,i=r.hasVolumeAnimation,u=(t||{}).volume;return y.a.createElement("div",{ref:this.volumeBar,onMouseDown:this.handleVolumnControlMouseOrTouchDown,onTouchStart:this.handleVolumnControlMouseOrTouchDown,onContextMenu:this.handleContextMenu,role:"progressbar","aria-label":n,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Number((100*u).toFixed(0)),tabIndex:0,className:"rhap_volume-bar-area"},y.a.createElement("div",{className:"rhap_volume-bar"},y.a.createElement("div",{className:"rhap_volume-indicator",style:{left:a,transitionDuration:i?".1s":"0s"}}),o&&y.a.createElement("div",{className:"rhap_volume-filled",style:{width:a}})))}}]),o}(g.Component);function ne(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var o,n=f()(e);if(t){var r=f()(this).constructor;o=Reflect.construct(n,arguments,r)}else o=n.apply(this,arguments);return p()(this,o)}}!function(e){e.CURRENT_TIME="CURRENT_TIME",e.CURRENT_LEFT_TIME="CURRENT_LEFT_TIME",e.PROGRESS_BAR="PROGRESS_BAR",e.DURATION="DURATION",e.ADDITIONAL_CONTROLS="ADDITIONAL_CONTROLS",e.MAIN_CONTROLS="MAIN_CONTROLS",e.VOLUME_CONTROLS="VOLUME_CONTROLS",e.LOOP="LOOP",e.VOLUME="VOLUME"}(te||(te={}));var re=function(e){c()(o,e);var t=ne(o);function o(){var e;r()(this,o);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return e=t.call.apply(t,[this].concat(a)),v()(s()(e),"audio",Object(g.createRef)()),v()(s()(e),"progressBar",Object(g.createRef)()),v()(s()(e),"container",Object(g.createRef)()),v()(s()(e),"lastVolume",e.props.volume),v()(s()(e),"listenTracker",void 0),v()(s()(e),"volumeAnimationTimer",void 0),v()(s()(e),"downloadProgressAnimationTimer",void 0),v()(s()(e),"togglePlay",(function(t){t.stopPropagation();var o=e.audio.current;(o.paused||o.ended)&&o.src?e.playAudioPromise():o.paused||o.pause()})),v()(s()(e),"playAudioPromise",(function(){var t=e.audio.current.play();t?t.then(null).catch((function(t){var o=e.props.onPlayError;o&&o(new Error(t))})):e.forceUpdate()})),v()(s()(e),"isPlaying",(function(){var t=e.audio.current;return!!t&&(!t.paused&&!t.ended)})),v()(s()(e),"handlePlay",(function(t){e.forceUpdate(),e.props.onPlay&&e.props.onPlay(t)})),v()(s()(e),"handlePause",(function(t){e.audio&&(e.forceUpdate(),e.props.onPause&&e.props.onPause(t))})),v()(s()(e),"handleEnded",(function(t){e.audio&&(e.forceUpdate(),e.props.onEnded&&e.props.onEnded(t))})),v()(s()(e),"handleAbort",(function(t){e.props.onAbort&&e.props.onAbort(t)})),v()(s()(e),"handleClickVolumeButton",(function(){var t=e.audio.current;t.volume>0?(e.lastVolume=t.volume,t.volume=0):t.volume=e.lastVolume})),v()(s()(e),"handleMuteChange",(function(){e.forceUpdate()})),v()(s()(e),"handleClickLoopButton",(function(){e.audio.current.loop=!e.audio.current.loop,e.forceUpdate()})),v()(s()(e),"handleClickRewind",(function(){var t=e.props,o=t.progressJumpSteps,n=t.progressJumpStep,r=o.backward||n;e.setJumpTime(-r)})),v()(s()(e),"handleClickForward",(function(){var t=e.props,o=t.progressJumpSteps,n=t.progressJumpStep,r=o.forward||n;e.setJumpTime(r)})),v()(s()(e),"setJumpTime",(function(t){var o=e.audio.current,n=o.duration,r=o.currentTime;if(o.readyState===o.HAVE_NOTHING||o.readyState===o.HAVE_METADATA||!isFinite(n)||!isFinite(r))return e.props.onChangeCurrentTimeError&&e.props.onChangeCurrentTimeError();var a=r+t/1e3;a<0?(o.currentTime=0,a=0):a>n?(o.currentTime=n,a=n):o.currentTime=a})),v()(s()(e),"setJumpVolume",(function(t){var o=e.audio.current.volume+t;o<0?o=0:o>1&&(o=1),e.audio.current.volume=o})),v()(s()(e),"handleKeyDown",(function(t){if(e.props.hasDefaultKeyBindings)switch(t.key){case" ":t.target!==e.container.current&&t.target!==e.progressBar.current||(t.preventDefault(),e.togglePlay(t));break;case"ArrowLeft":e.handleClickRewind();break;case"ArrowRight":e.handleClickForward();break;case"ArrowUp":t.preventDefault(),e.setJumpVolume(e.props.volumeJumpStep);break;case"ArrowDown":t.preventDefault(),e.setJumpVolume(-e.props.volumeJumpStep);break;case"l":e.handleClickLoopButton();break;case"m":e.handleClickVolumeButton()}})),v()(s()(e),"renderUIModules",(function(t){return t.map((function(t,o){return e.renderUIModule(t,o)}))})),v()(s()(e),"renderUIModule",(function(t,o){var n=e.props,r=n.defaultCurrentTime,a=n.progressUpdateInterval,i=n.showDownloadProgress,u=n.showFilledProgress,s=n.showFilledVolume,l=n.defaultDuration,c=n.customIcons,d=n.showSkipControls,p=n.onClickPrevious,h=n.onClickNext,f=n.onChangeCurrentTimeError,m=n.showJumpControls,v=n.customAdditionalControls,b=n.customVolumeControls,M=n.muted,T=n.timeFormat,L=n.volume,O=n.loop,k=n.mse,S=n.i18nAriaLabels;switch(t){case te.CURRENT_TIME:return y.a.createElement("div",{key:o,id:"rhap_current-time",className:"rhap_time rhap_current-time"},y.a.createElement($,{audio:e.audio.current,isLeftTime:!1,defaultCurrentTime:r,timeFormat:T}));case te.CURRENT_LEFT_TIME:return y.a.createElement("div",{key:o,id:"rhap_current-left-time",className:"rhap_time rhap_current-left-time"},y.a.createElement($,{audio:e.audio.current,isLeftTime:!0,defaultCurrentTime:r,timeFormat:T}));case te.PROGRESS_BAR:return y.a.createElement(q,{key:o,ref:e.progressBar,audio:e.audio.current,progressUpdateInterval:a,showDownloadProgress:i,showFilledProgress:u,onSeek:k&&k.onSeek,onChangeCurrentTimeError:f,srcDuration:k&&k.srcDuration,i18nProgressBar:S.progressControl});case te.DURATION:return y.a.createElement("div",{key:o,className:"rhap_time rhap_total-time"},k&&k.srcDuration?J(k.srcDuration,k.srcDuration,e.props.timeFormat):y.a.createElement(Z,{audio:e.audio.current,defaultDuration:l,timeFormat:T}));case te.ADDITIONAL_CONTROLS:return y.a.createElement("div",{key:o,className:"rhap_additional-controls"},e.renderUIModules(v));case te.MAIN_CONTROLS:var R,N=e.isPlaying();return R=N?c.pause?c.pause:y.a.createElement(w.Icon,{icon:_.a}):c.play?c.play:y.a.createElement(w.Icon,{icon:E.a}),y.a.createElement("div",{key:o,className:"rhap_main-controls"},d&&y.a.createElement("button",{"aria-label":S.previous,className:"rhap_button-clear rhap_main-controls-button rhap_skip-button",type:"button",onClick:p},c.previous?c.previous:y.a.createElement(w.Icon,{icon:A.a})),m&&y.a.createElement("button",{"aria-label":S.rewind,className:"rhap_button-clear rhap_main-controls-button rhap_rewind-button",type:"button",onClick:e.handleClickRewind},c.rewind?c.rewind:y.a.createElement(w.Icon,{icon:x.a})),y.a.createElement("button",{"aria-label":N?S.pause:S.play,className:"rhap_button-clear rhap_main-controls-button rhap_play-pause-button",type:"button",onClick:e.togglePlay},R),m&&y.a.createElement("button",{"aria-label":"Forward",className:"rhap_button-clear rhap_main-controls-button rhap_forward-button",type:"button",onClick:e.handleClickForward},c.forward?c.forward:y.a.createElement(w.Icon,{icon:P.a})),d&&y.a.createElement("button",{"aria-label":"Skip",className:"rhap_button-clear rhap_main-controls-button rhap_skip-button",type:"button",onClick:h},c.next?c.next:y.a.createElement(w.Icon,{icon:C.a})));case te.VOLUME_CONTROLS:return y.a.createElement("div",{key:o,className:"rhap_volume-controls"},e.renderUIModules(b));case te.LOOP:var I,j=e.audio.current?e.audio.current.loop:O;return I=j?c.loop?c.loop:y.a.createElement(w.Icon,{icon:U.a}):c.loopOff?c.loopOff:y.a.createElement(w.Icon,{icon:F.a}),y.a.createElement("button",{key:o,"aria-label":j?S.loop:S.loopOff,className:"rhap_button-clear rhap_repeat-button",type:"button",onClick:e.handleClickLoopButton},I);case te.VOLUME:var B,W=(e.audio.current||{}).volume,H=void 0===W?M?0:L:W;return B=H?c.volume?c.volume:y.a.createElement(w.Icon,{icon:D.a}):c.volume?c.volumeMute:y.a.createElement(w.Icon,{icon:V.a}),y.a.createElement("div",{key:o,className:"rhap_volume-container"},y.a.createElement("button",{"aria-label":H?"Mute":"Unmute",onClick:e.handleClickVolumeButton,type:"button",className:"rhap_button-clear rhap_volume-button"},B),y.a.createElement(oe,{audio:e.audio.current,volume:H,onMuteChange:e.handleMuteChange,showFilledVolume:s,i18nVolumeControl:S.volumeControl}));default:return Object(g.isValidElement)(t)?t.key?t:Object(g.cloneElement)(t,{key:o}):null}})),e}return i()(o,[{key:"componentDidMount",value:function(){var e=this;this.forceUpdate();var t=this.audio.current;this.props.muted?t.volume=0:t.volume=this.lastVolume,t.addEventListener("error",(function(t){e.props.onError&&e.props.onError(t)})),t.addEventListener("canplay",(function(t){e.props.onCanPlay&&e.props.onCanPlay(t)})),t.addEventListener("canplaythrough",(function(t){e.props.onCanPlayThrough&&e.props.onCanPlayThrough(t)})),t.addEventListener("play",this.handlePlay),t.addEventListener("abort",this.handleAbort),t.addEventListener("ended",this.handleEnded),t.addEventListener("playing",(function(t){e.props.onPlaying&&e.props.onPlaying(t)})),t.addEventListener("seeking",(function(t){e.props.onSeeking&&e.props.onSeeking(t)})),t.addEventListener("seeked",(function(t){e.props.onSeeked&&e.props.onSeeked(t)})),t.addEventListener("waiting",(function(t){e.props.onWaiting&&e.props.onWaiting(t)})),t.addEventListener("emptied",(function(t){e.props.onEmptied&&e.props.onEmptied(t)})),t.addEventListener("stalled",(function(t){e.props.onStalled&&e.props.onStalled(t)})),t.addEventListener("suspend",(function(t){e.props.onSuspend&&e.props.onSuspend(t)})),t.addEventListener("loadstart",(function(t){e.props.onLoadStart&&e.props.onLoadStart(t)})),t.addEventListener("loadedmetadata",(function(t){e.props.onLoadedMetaData&&e.props.onLoadedMetaData(t)})),t.addEventListener("loadeddata",(function(t){e.props.onLoadedData&&e.props.onLoadedData(t)})),t.addEventListener("pause",this.handlePause),t.addEventListener("timeupdate",G((function(t){e.props.onListen&&e.props.onListen(t)}),this.props.listenInterval)),t.addEventListener("volumechange",(function(t){e.props.onVolumeChange&&e.props.onVolumeChange(t)})),t.addEventListener("encrypted",(function(t){var o=e.props.mse;o&&o.onEcrypted&&o.onEcrypted(t)}))}},{key:"componentDidUpdate",value:function(e){var t=this.props,o=t.src,n=t.autoPlayAfterSrcChange;e.src!==o&&(n?this.playAudioPromise():this.forceUpdate())}},{key:"componentWillUnmount",value:function(){var e=this.audio.current;e&&(e.removeEventListener("play",this.handlePlay),e.removeEventListener("pause",this.handlePause),e.removeEventListener("abort",this.handleAbort),e.removeAttribute("src"),e.load())}},{key:"render",value:function(){var e=this.props,t=e.className,o=e.src,n=e.loop,r=e.preload,a=e.autoPlay,i=e.crossOrigin,u=e.mediaGroup,s=e.header,l=e.footer,c=e.layout,d=e.customProgressBarSection,p=e.customControlsSection,h=e.children,f=e.style,m=e.i18nAriaLabels,v=this.audio.current?this.audio.current.loop:n,g=v?"rhap_loop--on":"rhap_loop--off",w=this.isPlaying()?"rhap_play-status--playing":"rhap_play-status--paused";return y.a.createElement("div",{role:"group",tabIndex:0,"aria-label":m.player,className:"rhap_container ".concat(g," ").concat(w," ").concat(t),onKeyDown:this.handleKeyDown,ref:this.container,style:f},y.a.createElement("audio",{src:o,controls:!1,loop:v,autoPlay:a,preload:r,crossOrigin:i,mediaGroup:u,ref:this.audio},h),s&&y.a.createElement("div",{className:"rhap_header"},s),y.a.createElement("div",{className:"rhap_main ".concat(W(c))},y.a.createElement("div",{className:"rhap_progress-section"},this.renderUIModules(d)),y.a.createElement("div",{className:"rhap_controls-section"},this.renderUIModules(p))),l&&y.a.createElement("div",{className:"rhap_footer"},l))}}]),o}(g.Component);v()(re,"defaultProps",{autoPlay:!1,autoPlayAfterSrcChange:!0,listenInterval:1e3,progressJumpStep:5e3,progressJumpSteps:{},volumeJumpStep:.1,loop:!1,muted:!1,preload:"auto",progressUpdateInterval:20,defaultCurrentTime:"--:--",defaultDuration:"--:--",timeFormat:"auto",volume:1,className:"",showJumpControls:!0,showSkipControls:!1,showDownloadProgress:!0,showFilledProgress:!0,showFilledVolume:!1,customIcons:{},customProgressBarSection:[te.CURRENT_TIME,te.PROGRESS_BAR,te.DURATION],customControlsSection:[te.ADDITIONAL_CONTROLS,te.MAIN_CONTROLS,te.VOLUME_CONTROLS],customAdditionalControls:[te.LOOP],customVolumeControls:[te.VOLUME],layout:"stacked",hasDefaultKeyBindings:!0,i18nAriaLabels:{player:"Audio player",progressControl:"Audio progress control",volumeControl:"Volume control",play:"Play",pause:"Pause",rewind:"Rewind",forward:"Forward",previous:"Previous",next:"Skip",loop:"Disable loop",loopOff:"Enable loop",volume:"Mute",volumeMute:"Unmute"}});t.default=re}])}));
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("React")):"function"==typeof define&&define.amd?define("ReactH5AudioPlayer",["React"],t):"object"==typeof exports?exports.ReactH5AudioPlayer=t(require("React")):e.ReactH5AudioPlayer=t(e.React)}(window,(function(e){return function(e){var t={};function o(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=e,o.c=t,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=22)}([function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(t,o){t.exports=e},function(e,t){function o(t){return e.exports=o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,o(t)}e.exports=o,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.InlineIcon=t.Icon=void 0;var n,r=(n=o(2))&&n.__esModule?n:{default:n};function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var u=0,s=/(-?[0-9.]*[0-9]+[0-9.]*)/g,l=/^-?[0-9.]*[0-9]+[0-9.]*$/g,c=["width","height","inline","hFlip","vFlip","flip","rotate","align","color","box"],d={left:0,top:0,width:16,height:16,rotate:0,hFlip:!1,vFlip:!1};var p=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._item=t}var t,o,n;return t=e,n=[{key:"splitAttributes",value:function(e){var t={icon:Object.create(null),node:Object.create(null)};return Object.keys(e).forEach((function(o){t[-1===c.indexOf(o)?"node":"icon"][o]=e[o]})),t}},{key:"calculateDimension",value:function(e,t,o){if(1===t)return e;if(o=void 0===o?100:o,"number"==typeof e)return Math.ceil(e*t*o)/o;var n=e.split(s);if(null===n||!n.length)return null;for(var r,a=[],i=n.shift(),u=l.test(i);;){if(u?(r=parseFloat(i),isNaN(r)?a.push(i):a.push(Math.ceil(r*t*o)/o)):a.push(i),void 0===(i=n.shift()))return a.join("");u=!u}}},{key:"replaceIDs",value:function(e){var t,o,n=/\sid="(\S+)"/g,r=[];function a(e,t,o){for(var n=0;-1!==(n=o.indexOf(e,n));)o=o.slice(0,n)+t+o.slice(n+e.length),n+=t.length;return o}for(;t=n.exec(e);)r.push(t[1]);return r.length?(o="IconifyId-"+Date.now().toString(16)+"-"+(16777216*Math.random()|0).toString(16)+"-",r.forEach((function(t){var n=o+u;u++,e=a('="'+t+'"','="'+n+'"',e),e=a('="#'+t+'"','="#'+n+'"',e),e=a("(#"+t+")","(#"+n+")",e)})),e):e}}],(o=[{key:"getAttributes",value:function(t){var o=this._item;"object"!==a(t)&&(t=Object.create(null));var n={horizontal:"center",vertical:"middle",slice:!1},r={rotate:o.rotate,hFlip:o.hFlip,vFlip:o.vFlip},i=Object.create(null),u=Object.create(null),s=!0===t.inline||"true"===t.inline||"1"===t.inline,l={left:o.left,top:s?o.inlineTop:o.top,width:o.width,height:s?o.inlineHeight:o.height};if(["hFlip","vFlip"].forEach((function(e){void 0===t[e]||!0!==t[e]&&"true"!==t[e]&&"1"!==t[e]||(r[e]=!r[e])})),void 0!==t.flip&&t.flip.toLowerCase().split(/[\s,]+/).forEach((function(e){switch(e){case"horizontal":r.hFlip=!r.hFlip;break;case"vertical":r.vFlip=!r.vFlip}})),void 0!==t.rotate){var c=t.rotate;if("number"==typeof c)r.rotate+=c;else if("string"==typeof c){var d=c.replace(/^-?[0-9.]*/,"");if(""===d)c=parseInt(c),isNaN(c)||(r.rotate+=c);else if(d!==c){var p=!1;switch(d){case"%":p=25;break;case"deg":p=90}p&&(c=parseInt(c.slice(0,c.length-d.length)),isNaN(c)||(r.rotate+=Math.round(c/p)))}}}var h,f=[];switch(r.hFlip?r.vFlip?r.rotate+=2:(f.push("translate("+(l.width+l.left)+" "+(0-l.top)+")"),f.push("scale(-1 1)"),l.top=l.left=0):r.vFlip&&(f.push("translate("+(0-l.left)+" "+(l.height+l.top)+")"),f.push("scale(1 -1)"),l.top=l.left=0),r.rotate%4){case 1:h=l.height/2+l.top,f.unshift("rotate(90 "+h+" "+h+")"),0===l.left&&0===l.top||(h=l.left,l.left=l.top,l.top=h),l.width!==l.height&&(h=l.width,l.width=l.height,l.height=h);break;case 2:f.unshift("rotate(180 "+(l.width/2+l.left)+" "+(l.height/2+l.top)+")");break;case 3:h=l.width/2+l.left,f.unshift("rotate(-90 "+h+" "+h+")"),0===l.left&&0===l.top||(h=l.left,l.left=l.top,l.top=h),l.width!==l.height&&(h=l.width,l.width=l.height,l.height=h)}var m,v,g=t.width?t.width:null,y=t.height?t.height:null;null===g&&null===y&&(y="1em"),null!==g&&null!==y?(m=g,v=y):null!==g?(m=g,v=e.calculateDimension(m,l.height/l.width)):(v=y,m=e.calculateDimension(v,l.width/l.height)),!1!==m&&(u.width="auto"===m?l.width:m),!1!==v&&(u.height="auto"===v?l.height:v),s&&0!==o.verticalAlign&&(i["vertical-align"]=o.verticalAlign+"em"),void 0!==t.align&&t.align.toLowerCase().split(/[\s,]+/).forEach((function(e){switch(e){case"left":case"right":case"center":n.horizontal=e;break;case"top":case"bottom":case"middle":n.vertical=e;break;case"crop":n.slice=!0;break;case"meet":n.slice=!1}})),u.preserveAspectRatio=function(e){var t;switch(e.horizontal){case"left":t="xMin";break;case"right":t="xMax";break;default:t="xMid"}switch(e.vertical){case"top":t+="YMin";break;case"bottom":t+="YMax";break;default:t+="YMid"}return t+=e.slice?" slice":" meet"}(n),u.viewBox=l.left+" "+l.top+" "+l.width+" "+l.height;var w=e.replaceIDs(o.body);return void 0!==t.color&&(w=w.replace(/currentColor/g,t.color)),f.length&&(w='<g transform="'+f.join(" ")+'">'+w+"</g>"),!0!==t.box&&"true"!==t.box&&"1"!==t.box||(w+='<rect x="'+l.left+'" y="'+l.top+'" width="'+l.width+'" height="'+l.height+'" fill="rgba(0, 0, 0, 0)" />'),{attributes:u,body:w,style:i}}},{key:"getSVG",value:function(t,o){var n=e.splitAttributes(t),r=this.getAttributes(n.icon),a='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"';return o&&Object.keys(n.node).forEach((function(e){a+=" "+e+'="'+n.node[e]+'"'})),Object.keys(r.attributes).forEach((function(e){a+=" "+e+'="'+r.attributes[e]+'"'})),a+=' style="-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); transform: rotate(360deg);',Object.keys(r.style).forEach((function(e){a+=" "+e+": "+r.style[e]+";"})),t&&void 0!==t.style&&(a+=t.style),a+='">',a+=r.body+"</svg>"}}])&&i(t.prototype,o),n&&i(t,n),e}();function h(e,t){if("object"!==a(e.icon))return null;var o=p.splitAttributes(e),n=o.icon,i=o.node;delete i.icon,void 0===n.inline&&(n.inline=t);var u=new p(function(e){var t,o=Object.create(null);for(t in d)o[t]=d[t];for(t in e)o[t]=e[t];return void 0===o.inlineTop&&(o.inlineTop=o.top),void 0===o.inlineHeight&&(o.inlineHeight=o.height),void 0===o.verticalAlign&&(o.verticalAlign=o.height%7==0&&o.height%8!=0?-.143:-.125),o}(e.icon)).getAttributes(n),s={transform:"rotate(360deg)"};if(void 0!==u.style["vertical-align"]&&(s.verticalAlign=u.style["vertical-align"]),void 0!==e.style)for(var l in e.style)s[l]=e.style[l];var c,h={xmlns:"http://www.w3.org/2000/svg",focusable:!1,style:s};for(c in i)h[c]=i[c];for(c in u.attributes)h[c]=u.attributes[c];return h.dangerouslySetInnerHTML={__html:u.body},r.default.createElement("svg",h,null)}var f=function(e){return h(e,!1)};t.Icon=f;t.InlineIcon=function(e){return h(e,!0)};var m=f;t.default=m},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function o(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,o){var n=o(20);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&n(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,o){var n=o(21).default,r=o(0);e.exports=function(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return r(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){t.__esModule=!0,t.default={body:'<path d="M10 16.5v-9l6 4.5M12 2A10 10 0 0 0 2 12a10 10 0 0 0 10 10a10 10 0 0 0 10-10A10 10 0 0 0 12 2z" fill="currentColor"/>',width:24,height:24}},function(e,t){t.__esModule=!0,t.default={body:'<path d="M15 16h-2V8h2m-4 8H9V8h2m1-6A10 10 0 0 0 2 12a10 10 0 0 0 10 10a10 10 0 0 0 10-10A10 10 0 0 0 12 2z" fill="currentColor"/>',width:24,height:24}},function(e,t){t.__esModule=!0,t.default={body:'<path d="M6 18V6h2v12H6m3.5-6L18 6v12l-8.5-6z" fill="currentColor"/>',width:24,height:24}},function(e,t){t.__esModule=!0,t.default={body:'<path d="M16 18h2V6h-2M6 18l8.5-6L6 6v12z" fill="currentColor"/>',width:24,height:24}},function(e,t){t.__esModule=!0,t.default={body:'<path d="M13 6v12l8.5-6M4 18l8.5-6L4 6v12z" fill="currentColor"/>',width:24,height:24}},function(e,t){t.__esModule=!0,t.default={body:'<path d="M11.5 12l8.5 6V6m-9 12V6l-8.5 6l8.5 6z" fill="currentColor"/>',width:24,height:24}},function(e,t){t.__esModule=!0,t.default={body:'<path d="M14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.84-5 6.7v2.07c4-.91 7-4.49 7-8.77c0-4.28-3-7.86-7-8.77M16.5 12c0-1.77-1-3.29-2.5-4.03V16c1.5-.71 2.5-2.24 2.5-4M3 9v6h4l5 5V4L7 9H3z" fill="currentColor"/>',width:24,height:24}},function(e,t){t.__esModule=!0,t.default={body:'<path d="M3 9h4l5-5v16l-5-5H3V9m13.59 3L14 9.41L15.41 8L18 10.59L20.59 8L22 9.41L19.41 12L22 14.59L20.59 16L18 13.41L15.41 16L14 14.59L16.59 12z" fill="currentColor"/>',width:24,height:24}},function(e,t){t.__esModule=!0,t.default={body:'<path d="M17 17H7v-3l-4 4l4 4v-3h12v-6h-2M7 7h10v3l4-4l-4-4v3H5v6h2V7z" fill="currentColor"/>',width:24,height:24}},function(e,t){t.__esModule=!0,t.default={body:'<path d="M2 5.27L3.28 4L20 20.72L18.73 22l-3-3H7v3l-4-4l4-4v3h6.73L7 10.27V11H5V8.27l-3-3M17 13h2v4.18l-2-2V13m0-8V2l4 4l-4 4V7H8.82l-2-2H17z" fill="currentColor"/>',width:24,height:24}},function(e,t){function o(){return e.exports=o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,o.apply(this,arguments)}e.exports=o,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function o(t,n){return e.exports=o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,o(t,n)}e.exports=o,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function o(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=o=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=o=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),o(t)}e.exports=o,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,o){"use strict";o.r(t),o.d(t,"RHAP_UI",(function(){return te}));var n=o(5),r=o.n(n),a=o(6),i=o.n(a),u=o(0),s=o.n(u),l=o(7),c=o.n(l),d=o(8),p=o.n(d),h=o(3),f=o.n(h),m=o(1),v=o.n(m),g=o(2),y=o.n(g),w=o(4),b=o(9),E=o.n(b),M=o(10),_=o.n(M),T=o(11),A=o.n(T),L=o(12),C=o.n(L),O=o(13),P=o.n(O),x=o(14),k=o.n(x),S=o(15),D=o.n(S),R=o(16),V=o.n(R),N=o(17),I=o.n(N),U=o(18),F=o.n(U),j=o(19),B=o.n(j),W=function(e){switch(e){case"stacked":return"rhap_stacked";case"stacked-reverse":return"rhap_stacked-reverse";case"horizontal":return"rhap_horizontal";case"horizontal-reverse":return"rhap_horizontal-reverse";default:return"rhap_stacked"}},H=function(e){return e instanceof MouseEvent?e.clientX:e.touches[0].clientX},z=function(e){return e>9?e.toString():"0".concat(e)},J=function(e,t,o){if(!isFinite(e))return null;var n=Math.floor(e/60),r=z(n),a=z(Math.floor(e%60)),i=z(Math.floor(n%60)),u=Math.floor(n/60),s="".concat(r,":").concat(a),l="".concat(u,":").concat(i,":").concat(a);return"auto"===o?t>=3600?l:s:"mm:ss"===o?s:"hh:mm:ss"===o?l:void 0};function G(e,t){var o=!1;return function(n){o||(e(n),o=!0,setTimeout((function(){return o=!1}),t))}}function K(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var o,n=f()(e);if(t){var r=f()(this).constructor;o=Reflect.construct(n,arguments,r)}else o=n.apply(this,arguments);return p()(this,o)}}var Y=function(e){c()(o,e);var t=K(o);function o(){var e;r()(this,o);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return e=t.call.apply(t,[this].concat(a)),v()(s()(e),"audio",void 0),v()(s()(e),"timeOnMouseMove",0),v()(s()(e),"hasAddedAudioEventListener",!1),v()(s()(e),"downloadProgressAnimationTimer",void 0),v()(s()(e),"state",{isDraggingProgress:!1,currentTimePos:"0%",hasDownloadProgressAnimation:!1,downloadProgressArr:[],waitingForSeekCallback:!1}),v()(s()(e),"getCurrentProgress",(function(t){var o=e.props,n=o.audio,r=o.progressBar;if(0!==n.src.indexOf("blob:")&&void 0===e.props.srcDuration&&(!n.src||!isFinite(n.currentTime)||!r.current))return{currentTime:0,currentTimePos:"0%"};var a=r.current.getBoundingClientRect(),i=a.width,u=H(t)-a.left;return u<0?u=0:u>i&&(u=i),{currentTime:e.getDuration()*u/i,currentTimePos:"".concat((u/i*100).toFixed(2),"%")}})),v()(s()(e),"handleContextMenu",(function(e){e.preventDefault()})),v()(s()(e),"handleMouseDownOrTouchStartProgressBar",(function(t){t.stopPropagation();var o=e.getCurrentProgress(t.nativeEvent),n=o.currentTime,r=o.currentTimePos;isFinite(n)&&(e.timeOnMouseMove=n,e.setState({isDraggingProgress:!0,currentTimePos:r}),t.nativeEvent instanceof MouseEvent?(window.addEventListener("mousemove",e.handleWindowMouseOrTouchMove),window.addEventListener("mouseup",e.handleWindowMouseOrTouchUp)):(window.addEventListener("touchmove",e.handleWindowMouseOrTouchMove),window.addEventListener("touchend",e.handleWindowMouseOrTouchUp)))})),v()(s()(e),"handleWindowMouseOrTouchMove",(function(t){t instanceof MouseEvent&&t.preventDefault(),t.stopPropagation();var o=window.getSelection();if(o&&"Range"===o.type&&o.empty(),e.state.isDraggingProgress){var n=e.getCurrentProgress(t),r=n.currentTime,a=n.currentTimePos;e.timeOnMouseMove=r,e.setState({currentTimePos:a})}})),v()(s()(e),"handleWindowMouseOrTouchUp",(function(t){t.stopPropagation();var o=e.timeOnMouseMove,n=e.props,r=n.audio,a=n.onChangeCurrentTimeError,i=n.onSeek;if(i)e.setState({isDraggingProgress:!1,waitingForSeekCallback:!0},(function(){i(r,o).then((function(){return e.setState({waitingForSeekCallback:!1})}),(function(e){throw new Error(e)}))}));else{var u={isDraggingProgress:!1};r.readyState!==r.HAVE_NOTHING&&r.readyState!==r.HAVE_METADATA&&isFinite(o)?r.currentTime=o:(u.currentTimePos="0%",a&&a()),e.setState(u)}t instanceof MouseEvent?(window.removeEventListener("mousemove",e.handleWindowMouseOrTouchMove),window.removeEventListener("mouseup",e.handleWindowMouseOrTouchUp)):(window.removeEventListener("touchmove",e.handleWindowMouseOrTouchMove),window.removeEventListener("touchend",e.handleWindowMouseOrTouchUp))})),v()(s()(e),"handleAudioTimeUpdate",G((function(t){var o=e.state.isDraggingProgress,n=t.target;if(!o&&!0!==e.state.waitingForSeekCallback){var r=n.currentTime,a=e.getDuration();e.setState({currentTimePos:"".concat((r/a*100||0).toFixed(2),"%")})}}),e.props.progressUpdateInterval)),v()(s()(e),"handleAudioDownloadProgressUpdate",(function(t){for(var o=t.target,n=e.getDuration(),r=[],a=0;a<o.buffered.length;a++){var i=o.buffered.start(a),u=o.buffered.end(a);r.push({left:"".concat(Math.round(100/n*i)||0,"%"),width:"".concat(Math.round(100/n*(u-i))||0,"%")})}clearTimeout(e.downloadProgressAnimationTimer),e.setState({downloadProgressArr:r,hasDownloadProgressAnimation:!0}),e.downloadProgressAnimationTimer=setTimeout((function(){e.setState({hasDownloadProgressAnimation:!1})}),200)})),e}return i()(o,[{key:"getDuration",value:function(){var e=this.props,t=e.audio,o=e.srcDuration;return void 0===o?t.duration:o}},{key:"componentDidUpdate",value:function(){var e=this.props.audio;e&&!this.hasAddedAudioEventListener&&(this.audio=e,this.hasAddedAudioEventListener=!0,e.addEventListener("timeupdate",this.handleAudioTimeUpdate),e.addEventListener("progress",this.handleAudioDownloadProgressUpdate))}},{key:"componentWillUnmount",value:function(){this.audio&&this.hasAddedAudioEventListener&&(this.audio.removeEventListener("timeupdate",this.handleAudioTimeUpdate),this.audio.removeEventListener("progress",this.handleAudioDownloadProgressUpdate)),clearTimeout(this.downloadProgressAnimationTimer)}},{key:"render",value:function(){var e=this.props,t=e.showDownloadProgress,o=e.showFilledProgress,n=e.progressBar,r=e.i18nProgressBar,a=this.state,i=a.currentTimePos,u=a.downloadProgressArr,s=a.hasDownloadProgressAnimation;return y.a.createElement("div",{className:"rhap_progress-container",ref:n,"aria-label":r,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Number(i.split("%")[0]),tabIndex:0,onMouseDown:this.handleMouseDownOrTouchStartProgressBar,onTouchStart:this.handleMouseDownOrTouchStartProgressBar,onContextMenu:this.handleContextMenu},y.a.createElement("div",{className:"rhap_progress-bar ".concat(t?"rhap_progress-bar-show-download":"")},y.a.createElement("div",{className:"rhap_progress-indicator",style:{left:i}}),o&&y.a.createElement("div",{className:"rhap_progress-filled",style:{width:i}}),t&&u.map((function(e,t){var o=e.left,n=e.width;return y.a.createElement("div",{key:t,className:"rhap_download-progress",style:{left:o,width:n,transitionDuration:s?".2s":"0s"}})}))))}}]),o}(g.Component),q=Object(g.forwardRef)((function(e,t){return y.a.createElement(Y,B()({},e,{progressBar:t}))}));function X(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var o,n=f()(e);if(t){var r=f()(this).constructor;o=Reflect.construct(n,arguments,r)}else o=n.apply(this,arguments);return p()(this,o)}}var $=function(e){c()(o,e);var t=X(o);function o(e){var n;r()(this,o),n=t.call(this,e),v()(s()(n),"audio",void 0),v()(s()(n),"hasAddedAudioEventListener",!1),v()(s()(n),"state",{currentTime:n.props.defaultCurrentTime}),v()(s()(n),"handleAudioCurrentTimeChange",(function(e){var t=e.target,o=n.props,r=o.isLeftTime,a=o.timeFormat,i=o.defaultCurrentTime;n.setState({currentTime:J(r?t.duration-t.currentTime:t.currentTime,t.duration,a)||i})})),v()(s()(n),"addAudioEventListeners",(function(){var e=n.props.audio;e&&!n.hasAddedAudioEventListener&&(n.audio=e,n.hasAddedAudioEventListener=!0,e.addEventListener("timeupdate",n.handleAudioCurrentTimeChange),e.addEventListener("loadedmetadata",n.handleAudioCurrentTimeChange))}));var a=e.audio,i=e.defaultCurrentTime,u=e.isLeftTime,l=e.timeFormat,c=i;return a&&(c=J(u?a.duration-a.currentTime:a.currentTime,a.duration,l)),n.state={currentTime:c},n}return i()(o,[{key:"componentDidMount",value:function(){this.addAudioEventListeners()}},{key:"componentDidUpdate",value:function(){this.addAudioEventListeners()}},{key:"componentWillUnmount",value:function(){this.audio&&this.hasAddedAudioEventListener&&(this.audio.removeEventListener("timeupdate",this.handleAudioCurrentTimeChange),this.audio.removeEventListener("loadedmetadata",this.handleAudioCurrentTimeChange))}},{key:"render",value:function(){return this.state.currentTime}}]),o}(g.PureComponent);function Q(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var o,n=f()(e);if(t){var r=f()(this).constructor;o=Reflect.construct(n,arguments,r)}else o=n.apply(this,arguments);return p()(this,o)}}var Z=function(e){c()(o,e);var t=Q(o);function o(e){var n;r()(this,o),n=t.call(this,e),v()(s()(n),"audio",void 0),v()(s()(n),"hasAddedAudioEventListener",!1),v()(s()(n),"state",{duration:n.props.audio?J(n.props.audio.duration,n.props.audio.duration,n.props.timeFormat):n.props.defaultDuration}),v()(s()(n),"handleAudioDurationChange",(function(e){var t=e.target,o=n.props,r=o.timeFormat,a=o.defaultDuration;n.setState({duration:J(t.duration,t.duration,r)||a})})),v()(s()(n),"addAudioEventListeners",(function(){var e=n.props.audio;e&&!n.hasAddedAudioEventListener&&(n.audio=e,n.hasAddedAudioEventListener=!0,e.addEventListener("durationchange",n.handleAudioDurationChange),e.addEventListener("abort",n.handleAudioDurationChange))}));var a=e.audio,i=e.timeFormat,u=e.defaultDuration;return n.state={duration:a?J(a.duration,a.duration,i):u},n}return i()(o,[{key:"componentDidMount",value:function(){this.addAudioEventListeners()}},{key:"componentDidUpdate",value:function(){this.addAudioEventListeners()}},{key:"componentWillUnmount",value:function(){this.audio&&this.hasAddedAudioEventListener&&(this.audio.removeEventListener("durationchange",this.handleAudioDurationChange),this.audio.removeEventListener("abort",this.handleAudioDurationChange))}},{key:"render",value:function(){return this.state.duration}}]),o}(g.PureComponent);function ee(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var o,n=f()(e);if(t){var r=f()(this).constructor;o=Reflect.construct(n,arguments,r)}else o=n.apply(this,arguments);return p()(this,o)}}var te,oe=function(e){c()(o,e);var t=ee(o);function o(){var e;r()(this,o);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return e=t.call.apply(t,[this].concat(a)),v()(s()(e),"audio",void 0),v()(s()(e),"hasAddedAudioEventListener",!1),v()(s()(e),"volumeBar",Object(g.createRef)()),v()(s()(e),"volumeAnimationTimer",0),v()(s()(e),"lastVolume",e.props.volume),v()(s()(e),"state",{currentVolumePos:"".concat((e.lastVolume/1*100||0).toFixed(2),"%"),hasVolumeAnimation:!1,isDraggingVolume:!1}),v()(s()(e),"getCurrentVolume",(function(t){var o=e.props.audio;if(!e.volumeBar.current)return{currentVolume:o.volume,currentVolumePos:e.state.currentVolumePos};var n,r,a=e.volumeBar.current.getBoundingClientRect(),i=a.width,u=H(t)-a.left;return u<0?(n=0,r="0%"):u>a.width?(n=1,r="100%"):(n=u/i,r="".concat(u/i*100,"%")),{currentVolume:n,currentVolumePos:r}})),v()(s()(e),"handleContextMenu",(function(e){e.preventDefault()})),v()(s()(e),"handleClickVolumeButton",(function(){var t=e.props.audio;t.volume>0?(e.lastVolume=t.volume,t.volume=0):t.volume=e.lastVolume})),v()(s()(e),"handleVolumnControlMouseOrTouchDown",(function(t){t.stopPropagation();var o=e.props.audio,n=e.getCurrentVolume(t.nativeEvent),r=n.currentVolume,a=n.currentVolumePos;o.volume=r,e.setState({isDraggingVolume:!0,currentVolumePos:a}),t.nativeEvent instanceof MouseEvent?(window.addEventListener("mousemove",e.handleWindowMouseOrTouchMove),window.addEventListener("mouseup",e.handleWindowMouseOrTouchUp)):(window.addEventListener("touchmove",e.handleWindowMouseOrTouchMove),window.addEventListener("touchend",e.handleWindowMouseOrTouchUp))})),v()(s()(e),"handleWindowMouseOrTouchMove",(function(t){t instanceof MouseEvent&&t.preventDefault(),t.stopPropagation();var o=e.props.audio,n=window.getSelection();if(n&&"Range"===n.type&&n.empty(),e.state.isDraggingVolume){var r=e.getCurrentVolume(t),a=r.currentVolume,i=r.currentVolumePos;o.volume=a,e.setState({currentVolumePos:i})}})),v()(s()(e),"handleWindowMouseOrTouchUp",(function(t){t.stopPropagation(),e.setState({isDraggingVolume:!1}),t instanceof MouseEvent?(window.removeEventListener("mousemove",e.handleWindowMouseOrTouchMove),window.removeEventListener("mouseup",e.handleWindowMouseOrTouchUp)):(window.removeEventListener("touchmove",e.handleWindowMouseOrTouchMove),window.removeEventListener("touchend",e.handleWindowMouseOrTouchUp))})),v()(s()(e),"handleAudioVolumeChange",(function(t){var o=e.state.isDraggingVolume,n=t.target.volume;(e.lastVolume>0&&0===n||0===e.lastVolume&&n>0)&&e.props.onMuteChange(),e.lastVolume=n,o||(e.setState({hasVolumeAnimation:!0,currentVolumePos:"".concat((n/1*100||0).toFixed(2),"%")}),clearTimeout(e.volumeAnimationTimer),e.volumeAnimationTimer=setTimeout((function(){e.setState({hasVolumeAnimation:!1})}),100))})),e}return i()(o,[{key:"componentDidUpdate",value:function(){var e=this.props.audio;e&&!this.hasAddedAudioEventListener&&(this.audio=e,this.hasAddedAudioEventListener=!0,e.addEventListener("volumechange",this.handleAudioVolumeChange))}},{key:"componentWillUnmount",value:function(){this.audio&&this.hasAddedAudioEventListener&&this.audio.removeEventListener("volumechange",this.handleAudioVolumeChange),clearTimeout(this.volumeAnimationTimer)}},{key:"render",value:function(){var e=this.props,t=e.audio,o=e.showFilledVolume,n=e.i18nVolumeControl,r=this.state,a=r.currentVolumePos,i=r.hasVolumeAnimation,u=(t||{}).volume;return y.a.createElement("div",{ref:this.volumeBar,onMouseDown:this.handleVolumnControlMouseOrTouchDown,onTouchStart:this.handleVolumnControlMouseOrTouchDown,onContextMenu:this.handleContextMenu,role:"progressbar","aria-label":n,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Number((100*u).toFixed(0)),tabIndex:0,className:"rhap_volume-bar-area"},y.a.createElement("div",{className:"rhap_volume-bar"},y.a.createElement("div",{className:"rhap_volume-indicator",style:{left:a,transitionDuration:i?".1s":"0s"}}),o&&y.a.createElement("div",{className:"rhap_volume-filled",style:{width:a}})))}}]),o}(g.Component);function ne(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var o,n=f()(e);if(t){var r=f()(this).constructor;o=Reflect.construct(n,arguments,r)}else o=n.apply(this,arguments);return p()(this,o)}}!function(e){e.CURRENT_TIME="CURRENT_TIME",e.CURRENT_LEFT_TIME="CURRENT_LEFT_TIME",e.PROGRESS_BAR="PROGRESS_BAR",e.DURATION="DURATION",e.ADDITIONAL_CONTROLS="ADDITIONAL_CONTROLS",e.MAIN_CONTROLS="MAIN_CONTROLS",e.VOLUME_CONTROLS="VOLUME_CONTROLS",e.LOOP="LOOP",e.VOLUME="VOLUME"}(te||(te={}));var re=function(e){c()(o,e);var t=ne(o);function o(){var e;r()(this,o);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return e=t.call.apply(t,[this].concat(a)),v()(s()(e),"audio",Object(g.createRef)()),v()(s()(e),"progressBar",Object(g.createRef)()),v()(s()(e),"container",Object(g.createRef)()),v()(s()(e),"lastVolume",e.props.volume),v()(s()(e),"listenTracker",void 0),v()(s()(e),"volumeAnimationTimer",void 0),v()(s()(e),"downloadProgressAnimationTimer",void 0),v()(s()(e),"togglePlay",(function(t){t.stopPropagation();var o=e.audio.current;(o.paused||o.ended)&&o.src?e.playAudioPromise():o.paused||o.pause()})),v()(s()(e),"playAudioPromise",(function(){var t=e.audio.current.play();t?t.then(null).catch((function(t){var o=e.props.onPlayError;o&&o(new Error(t))})):e.forceUpdate()})),v()(s()(e),"isPlaying",(function(){var t=e.audio.current;return!!t&&(!t.paused&&!t.ended)})),v()(s()(e),"handlePlay",(function(t){e.forceUpdate(),e.props.onPlay&&e.props.onPlay(t)})),v()(s()(e),"handlePause",(function(t){e.audio&&(e.forceUpdate(),e.props.onPause&&e.props.onPause(t))})),v()(s()(e),"handleEnded",(function(t){e.audio&&(e.forceUpdate(),e.props.onEnded&&e.props.onEnded(t))})),v()(s()(e),"handleAbort",(function(t){e.props.onAbort&&e.props.onAbort(t)})),v()(s()(e),"handleClickVolumeButton",(function(){var t=e.audio.current;t.volume>0?(e.lastVolume=t.volume,t.volume=0):t.volume=e.lastVolume})),v()(s()(e),"handleMuteChange",(function(){e.forceUpdate()})),v()(s()(e),"handleClickLoopButton",(function(){e.audio.current.loop=!e.audio.current.loop,e.forceUpdate()})),v()(s()(e),"handleClickRewind",(function(){var t=e.props,o=t.progressJumpSteps,n=t.progressJumpStep,r=o.backward||n;e.setJumpTime(-r)})),v()(s()(e),"handleClickForward",(function(){var t=e.props,o=t.progressJumpSteps,n=t.progressJumpStep,r=o.forward||n;e.setJumpTime(r)})),v()(s()(e),"setJumpTime",(function(t){var o=e.audio.current,n=o.duration,r=o.currentTime;if(o.readyState===o.HAVE_NOTHING||o.readyState===o.HAVE_METADATA||!isFinite(n)||!isFinite(r))return e.props.onChangeCurrentTimeError&&e.props.onChangeCurrentTimeError();var a=r+t/1e3;a<0?(o.currentTime=0,a=0):a>n?(o.currentTime=n,a=n):o.currentTime=a})),v()(s()(e),"setJumpVolume",(function(t){var o=e.audio.current.volume+t;o<0?o=0:o>1&&(o=1),e.audio.current.volume=o})),v()(s()(e),"handleKeyDown",(function(t){if(e.props.hasDefaultKeyBindings)switch(t.key){case" ":t.target!==e.container.current&&t.target!==e.progressBar.current||(t.preventDefault(),e.togglePlay(t));break;case"ArrowLeft":e.handleClickRewind();break;case"ArrowRight":e.handleClickForward();break;case"ArrowUp":t.preventDefault(),e.setJumpVolume(e.props.volumeJumpStep);break;case"ArrowDown":t.preventDefault(),e.setJumpVolume(-e.props.volumeJumpStep);break;case"l":e.handleClickLoopButton();break;case"m":e.handleClickVolumeButton()}})),v()(s()(e),"renderUIModules",(function(t){return t.map((function(t,o){return e.renderUIModule(t,o)}))})),v()(s()(e),"renderUIModule",(function(t,o){var n=e.props,r=n.defaultCurrentTime,a=n.progressUpdateInterval,i=n.showDownloadProgress,u=n.showFilledProgress,s=n.showFilledVolume,l=n.defaultDuration,c=n.customIcons,d=n.showSkipControls,p=n.onClickPrevious,h=n.onClickNext,f=n.onChangeCurrentTimeError,m=n.showJumpControls,v=n.customAdditionalControls,b=n.customVolumeControls,M=n.muted,T=n.timeFormat,L=n.volume,O=n.loop,x=n.mse,S=n.i18nAriaLabels;switch(t){case te.CURRENT_TIME:return y.a.createElement("div",{key:o,id:"rhap_current-time",className:"rhap_time rhap_current-time"},y.a.createElement($,{audio:e.audio.current,isLeftTime:!1,defaultCurrentTime:r,timeFormat:T}));case te.CURRENT_LEFT_TIME:return y.a.createElement("div",{key:o,id:"rhap_current-left-time",className:"rhap_time rhap_current-left-time"},y.a.createElement($,{audio:e.audio.current,isLeftTime:!0,defaultCurrentTime:r,timeFormat:T}));case te.PROGRESS_BAR:return y.a.createElement(q,{key:o,ref:e.progressBar,audio:e.audio.current,progressUpdateInterval:a,showDownloadProgress:i,showFilledProgress:u,onSeek:x&&x.onSeek,onChangeCurrentTimeError:f,srcDuration:x&&x.srcDuration,i18nProgressBar:S.progressControl});case te.DURATION:return y.a.createElement("div",{key:o,className:"rhap_time rhap_total-time"},x&&x.srcDuration?J(x.srcDuration,x.srcDuration,e.props.timeFormat):y.a.createElement(Z,{audio:e.audio.current,defaultDuration:l,timeFormat:T}));case te.ADDITIONAL_CONTROLS:return y.a.createElement("div",{key:o,className:"rhap_additional-controls"},e.renderUIModules(v));case te.MAIN_CONTROLS:var R,N=e.isPlaying();return R=N?c.pause?c.pause:y.a.createElement(w.Icon,{icon:_.a}):c.play?c.play:y.a.createElement(w.Icon,{icon:E.a}),y.a.createElement("div",{key:o,className:"rhap_main-controls"},d&&y.a.createElement("button",{"aria-label":S.previous,className:"rhap_button-clear rhap_main-controls-button rhap_skip-button",type:"button",onClick:p},c.previous?c.previous:y.a.createElement(w.Icon,{icon:A.a})),m&&y.a.createElement("button",{"aria-label":S.rewind,className:"rhap_button-clear rhap_main-controls-button rhap_rewind-button",type:"button",onClick:e.handleClickRewind},c.rewind?c.rewind:y.a.createElement(w.Icon,{icon:k.a})),y.a.createElement("button",{"aria-label":N?S.pause:S.play,className:"rhap_button-clear rhap_main-controls-button rhap_play-pause-button",type:"button",onClick:e.togglePlay},R),m&&y.a.createElement("button",{"aria-label":S.forward,className:"rhap_button-clear rhap_main-controls-button rhap_forward-button",type:"button",onClick:e.handleClickForward},c.forward?c.forward:y.a.createElement(w.Icon,{icon:P.a})),d&&y.a.createElement("button",{"aria-label":S.next,className:"rhap_button-clear rhap_main-controls-button rhap_skip-button",type:"button",onClick:h},c.next?c.next:y.a.createElement(w.Icon,{icon:C.a})));case te.VOLUME_CONTROLS:return y.a.createElement("div",{key:o,className:"rhap_volume-controls"},e.renderUIModules(b));case te.LOOP:var U,j=e.audio.current?e.audio.current.loop:O;return U=j?c.loop?c.loop:y.a.createElement(w.Icon,{icon:I.a}):c.loopOff?c.loopOff:y.a.createElement(w.Icon,{icon:F.a}),y.a.createElement("button",{key:o,"aria-label":j?S.loop:S.loopOff,className:"rhap_button-clear rhap_repeat-button",type:"button",onClick:e.handleClickLoopButton},U);case te.VOLUME:var B,W=(e.audio.current||{}).volume,H=void 0===W?M?0:L:W;return B=H?c.volume?c.volume:y.a.createElement(w.Icon,{icon:D.a}):c.volume?c.volumeMute:y.a.createElement(w.Icon,{icon:V.a}),y.a.createElement("div",{key:o,className:"rhap_volume-container"},y.a.createElement("button",{"aria-label":H?S.volume:S.volumeMute,onClick:e.handleClickVolumeButton,type:"button",className:"rhap_button-clear rhap_volume-button"},B),y.a.createElement(oe,{audio:e.audio.current,volume:H,onMuteChange:e.handleMuteChange,showFilledVolume:s,i18nVolumeControl:S.volumeControl}));default:return Object(g.isValidElement)(t)?t.key?t:Object(g.cloneElement)(t,{key:o}):null}})),e}return i()(o,[{key:"componentDidMount",value:function(){var e=this;this.forceUpdate();var t=this.audio.current;this.props.muted?t.volume=0:t.volume=this.lastVolume,t.addEventListener("error",(function(t){e.props.onError&&e.props.onError(t)})),t.addEventListener("canplay",(function(t){e.props.onCanPlay&&e.props.onCanPlay(t)})),t.addEventListener("canplaythrough",(function(t){e.props.onCanPlayThrough&&e.props.onCanPlayThrough(t)})),t.addEventListener("play",this.handlePlay),t.addEventListener("abort",this.handleAbort),t.addEventListener("ended",this.handleEnded),t.addEventListener("playing",(function(t){e.props.onPlaying&&e.props.onPlaying(t)})),t.addEventListener("seeking",(function(t){e.props.onSeeking&&e.props.onSeeking(t)})),t.addEventListener("seeked",(function(t){e.props.onSeeked&&e.props.onSeeked(t)})),t.addEventListener("waiting",(function(t){e.props.onWaiting&&e.props.onWaiting(t)})),t.addEventListener("emptied",(function(t){e.props.onEmptied&&e.props.onEmptied(t)})),t.addEventListener("stalled",(function(t){e.props.onStalled&&e.props.onStalled(t)})),t.addEventListener("suspend",(function(t){e.props.onSuspend&&e.props.onSuspend(t)})),t.addEventListener("loadstart",(function(t){e.props.onLoadStart&&e.props.onLoadStart(t)})),t.addEventListener("loadedmetadata",(function(t){e.props.onLoadedMetaData&&e.props.onLoadedMetaData(t)})),t.addEventListener("loadeddata",(function(t){e.props.onLoadedData&&e.props.onLoadedData(t)})),t.addEventListener("pause",this.handlePause),t.addEventListener("timeupdate",G((function(t){e.props.onListen&&e.props.onListen(t)}),this.props.listenInterval)),t.addEventListener("volumechange",(function(t){e.props.onVolumeChange&&e.props.onVolumeChange(t)})),t.addEventListener("encrypted",(function(t){var o=e.props.mse;o&&o.onEcrypted&&o.onEcrypted(t)}))}},{key:"componentDidUpdate",value:function(e){var t=this.props,o=t.src,n=t.autoPlayAfterSrcChange;e.src!==o&&(n?this.playAudioPromise():this.forceUpdate())}},{key:"componentWillUnmount",value:function(){var e=this.audio.current;e&&(e.removeEventListener("play",this.handlePlay),e.removeEventListener("pause",this.handlePause),e.removeEventListener("abort",this.handleAbort),e.removeAttribute("src"),e.load())}},{key:"render",value:function(){var e=this.props,t=e.className,o=e.src,n=e.loop,r=e.preload,a=e.autoPlay,i=e.crossOrigin,u=e.mediaGroup,s=e.header,l=e.footer,c=e.layout,d=e.customProgressBarSection,p=e.customControlsSection,h=e.children,f=e.style,m=e.i18nAriaLabels,v=this.audio.current?this.audio.current.loop:n,g=v?"rhap_loop--on":"rhap_loop--off",w=this.isPlaying()?"rhap_play-status--playing":"rhap_play-status--paused";return y.a.createElement("div",{role:"group",tabIndex:0,"aria-label":m.player,className:"rhap_container ".concat(g," ").concat(w," ").concat(t),onKeyDown:this.handleKeyDown,ref:this.container,style:f},y.a.createElement("audio",{src:o,controls:!1,loop:v,autoPlay:a,preload:r,crossOrigin:i,mediaGroup:u,ref:this.audio},h),s&&y.a.createElement("div",{className:"rhap_header"},s),y.a.createElement("div",{className:"rhap_main ".concat(W(c))},y.a.createElement("div",{className:"rhap_progress-section"},this.renderUIModules(d)),y.a.createElement("div",{className:"rhap_controls-section"},this.renderUIModules(p))),l&&y.a.createElement("div",{className:"rhap_footer"},l))}}]),o}(g.Component);v()(re,"defaultProps",{autoPlay:!1,autoPlayAfterSrcChange:!0,listenInterval:1e3,progressJumpStep:5e3,progressJumpSteps:{},volumeJumpStep:.1,loop:!1,muted:!1,preload:"auto",progressUpdateInterval:20,defaultCurrentTime:"--:--",defaultDuration:"--:--",timeFormat:"auto",volume:1,className:"",showJumpControls:!0,showSkipControls:!1,showDownloadProgress:!0,showFilledProgress:!0,showFilledVolume:!1,customIcons:{},customProgressBarSection:[te.CURRENT_TIME,te.PROGRESS_BAR,te.DURATION],customControlsSection:[te.ADDITIONAL_CONTROLS,te.MAIN_CONTROLS,te.VOLUME_CONTROLS],customAdditionalControls:[te.LOOP],customVolumeControls:[te.VOLUME],layout:"stacked",hasDefaultKeyBindings:!0,i18nAriaLabels:{player:"Audio player",progressControl:"Audio progress control",volumeControl:"Volume control",play:"Play",pause:"Pause",rewind:"Rewind",forward:"Forward",previous:"Previous",next:"Skip",loop:"Disable loop",loopOff:"Enable loop",volume:"Mute",volumeMute:"Unmute"}});t.default=re}])}));
{
"name": "react-h5-audio-player",
"version": "3.8.0",
"version": "3.8.1",
"description": "A customizable React audio player. Written in TypeScript. Mobile compatible. Keyboard friendly",

@@ -5,0 +5,0 @@ "main": "./lib/index.js",

@@ -123,3 +123,3 @@ <p align="center">

| customVolumeControls | [Array<string \|<br>ReactElement>](https://github.com/lhz516/react-h5-audio-player/blob/fa1a61eb7f77146e1ce4547a14181279be68ecfd/src/index.tsx#L94) | [VOLUME] | [Custom layout](https://static.hanzluo.com/react-h5-audio-player-storybook/index.html?path=/docs/layouts-advanced) of volume controls |
| i18nAriaLabels | Object | I18nAriaLabels | A configuration object to overwrite the default `aria-label` on the action buttons |
| i18nAriaLabels | [I18nAriaLabels](https://github.com/lhz516/react-h5-audio-player/blob/e67fe0cdd39d00490b7396ebdc46357815ecb227/src/index.tsx#L138)| [I18nAriaLabels](https://github.com/lhz516/react-h5-audio-player/blob/e67fe0cdd39d00490b7396ebdc46357815ecb227/src/index.tsx#L183) | A configuration object to overwrite the default `aria-label` on the action buttons |
| mse | Object | null | A configuration object so the player can play audio chunks, MSE streams and encrypted audio (See [section about Media Source Extensions](#media-source-extensions-and-encrypted-media-extensions) in this Readme) |

@@ -126,0 +126,0 @@ | mse.srcDuration | number | - | The complete duration of the MSE audio chunks together (this is a key of the _mse_ prop) |

Sorry, the diff of this file is not supported yet