@popmenu/audio-player 0.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1043 @@
1
+ import * as React from 'react';
2
+ import React__default, { createElement, forwardRef, useRef, useState, useReducer, useEffect, useMemo } from 'react';
3
+ import { makeStyles, Typography as Typography$1, Link as Link$1, Paper as Paper$1, useTheme as useTheme$1, Box, Popper, Grow, Slider } from '@material-ui/core';
4
+ import '@material-ui/lab/Alert';
5
+ import '@material-ui/core/AppBar';
6
+ import MuiAvatar from '@material-ui/core/Avatar';
7
+ import { makeStyles as makeStyles$1, useTheme } from '@material-ui/core/styles';
8
+ import '@material-ui/core/Badge';
9
+ import MuiButton from '@material-ui/core/Button';
10
+ import CircularProgress from '@material-ui/core/CircularProgress';
11
+ import '@material-ui/core/ButtonGroup';
12
+ import '@material-ui/core/Card';
13
+ import '@material-ui/core/CardActionArea';
14
+ import '@material-ui/core/CardActions';
15
+ import '@material-ui/core/CardContent';
16
+ import '@material-ui/core/CardHeader';
17
+ import '@material-ui/core/CardMedia';
18
+ import MuiCheckbox from '@material-ui/core/Checkbox';
19
+ import FormControlLabel from '@material-ui/core/FormControlLabel';
20
+ import '@material-ui/core/Chip';
21
+ import '@material-ui/core/Collapse';
22
+ import '@material-ui/core/Dialog';
23
+ import '@material-ui/core/DialogActions';
24
+ import '@material-ui/core/DialogContent';
25
+ import '@material-ui/core/DialogTitle';
26
+ import '@material-ui/core/Drawer';
27
+ import '@material-ui/core/FormControl';
28
+ import '@material-ui/core/Grid';
29
+ import MuiIconButton from '@material-ui/core/IconButton';
30
+ import '@material-ui/core/InputAdornment';
31
+ import '@material-ui/core/LinearProgress';
32
+ import '@material-ui/core/List';
33
+ import '@material-ui/core/ListItem';
34
+ import '@material-ui/core/ListItemIcon';
35
+ import '@material-ui/core/ListItemSecondaryAction';
36
+ import '@material-ui/core/ListItemText';
37
+ import '@material-ui/core/Menu';
38
+ import '@material-ui/core/MenuItem';
39
+ import '@material-ui/core/MenuList';
40
+ import MuiRadio from '@material-ui/core/Radio';
41
+ import '@material-ui/core/TextField';
42
+ import MuiSwitch from '@material-ui/core/Switch';
43
+ import '@material-ui/core/Tab';
44
+ import '@material-ui/core/Tabs';
45
+ import MuiToggleButton from '@material-ui/lab/ToggleButton';
46
+ import MuiToggleButtonGroup from '@material-ui/lab/ToggleButtonGroup';
47
+ import MuiTooltip from '@material-ui/core/Tooltip';
48
+
49
+ /*! *****************************************************************************
50
+ Copyright (c) Microsoft Corporation.
51
+
52
+ Permission to use, copy, modify, and/or distribute this software for any
53
+ purpose with or without fee is hereby granted.
54
+
55
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
56
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
57
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
58
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
59
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
60
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
61
+ PERFORMANCE OF THIS SOFTWARE.
62
+ ***************************************************************************** */
63
+
64
+ var __assign$1 = function() {
65
+ __assign$1 = Object.assign || function __assign(t) {
66
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
67
+ s = arguments[i];
68
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
69
+ }
70
+ return t;
71
+ };
72
+ return __assign$1.apply(this, arguments);
73
+ };
74
+
75
+ var classnames$1 = {exports: {}};
76
+
77
+ /*!
78
+ Copyright (c) 2018 Jed Watson.
79
+ Licensed under the MIT License (MIT), see
80
+ http://jedwatson.github.io/classnames
81
+ */
82
+
83
+ (function (module) {
84
+ /* global define */
85
+
86
+ (function () {
87
+
88
+ var hasOwn = {}.hasOwnProperty;
89
+
90
+ function classNames() {
91
+ var classes = [];
92
+
93
+ for (var i = 0; i < arguments.length; i++) {
94
+ var arg = arguments[i];
95
+ if (!arg) continue;
96
+
97
+ var argType = typeof arg;
98
+
99
+ if (argType === 'string' || argType === 'number') {
100
+ classes.push(arg);
101
+ } else if (Array.isArray(arg)) {
102
+ if (arg.length) {
103
+ var inner = classNames.apply(null, arg);
104
+ if (inner) {
105
+ classes.push(inner);
106
+ }
107
+ }
108
+ } else if (argType === 'object') {
109
+ if (arg.toString === Object.prototype.toString) {
110
+ for (var key in arg) {
111
+ if (hasOwn.call(arg, key) && arg[key]) {
112
+ classes.push(key);
113
+ }
114
+ }
115
+ } else {
116
+ classes.push(arg.toString());
117
+ }
118
+ }
119
+ }
120
+
121
+ return classes.join(' ');
122
+ }
123
+
124
+ if (module.exports) {
125
+ classNames.default = classNames;
126
+ module.exports = classNames;
127
+ } else {
128
+ window.classNames = classNames;
129
+ }
130
+ }());
131
+ }(classnames$1));
132
+
133
+ var classNames$1 = classnames$1.exports;
134
+
135
+ var _path$1l;
136
+
137
+ function _extends$1p() { _extends$1p = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1p.apply(this, arguments); }
138
+
139
+ function SvgPause(props) {
140
+ return /*#__PURE__*/React.createElement("svg", _extends$1p({
141
+ viewBox: "0 0 16 16",
142
+ strokeLinecap: "round",
143
+ strokeLinejoin: "round",
144
+ stroke: "currentColor",
145
+ width: "1em",
146
+ height: "1em",
147
+ fill: "none"
148
+ }, props), _path$1l || (_path$1l = /*#__PURE__*/React.createElement("path", {
149
+ d: "M6.667 2.667H4v10.666h2.667V2.666zm5.333 0H9.333v10.666H12V2.666z"
150
+ })));
151
+ }
152
+
153
+ var _path$1j;
154
+
155
+ function _extends$1n() { _extends$1n = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1n.apply(this, arguments); }
156
+
157
+ function SvgPlay(props) {
158
+ return /*#__PURE__*/React.createElement("svg", _extends$1n({
159
+ viewBox: "0 0 16 16",
160
+ strokeLinecap: "round",
161
+ strokeLinejoin: "round",
162
+ stroke: "currentColor",
163
+ width: "1em",
164
+ height: "1em",
165
+ fill: "none"
166
+ }, props), _path$1j || (_path$1j = /*#__PURE__*/React.createElement("path", {
167
+ d: "M3.333 2l9.334 6-9.334 6V2z"
168
+ })));
169
+ }
170
+
171
+ var _path$16;
172
+
173
+ function _extends$1a() { _extends$1a = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1a.apply(this, arguments); }
174
+
175
+ function SvgVolumeDown(props) {
176
+ return /*#__PURE__*/React.createElement("svg", _extends$1a({
177
+ viewBox: "0 0 16 16",
178
+ strokeLinecap: "round",
179
+ strokeLinejoin: "round",
180
+ stroke: "currentColor",
181
+ width: "1em",
182
+ height: "1em",
183
+ fill: "none"
184
+ }, props), _path$16 || (_path$16 = /*#__PURE__*/React.createElement("path", {
185
+ d: "M8.999 3.333L5.665 6H3v4h2.666L9 12.667V3.333zm3.026 2.307a3.333 3.333 0 010 4.714"
186
+ })));
187
+ }
188
+
189
+ var _path$15;
190
+
191
+ function _extends$19() { _extends$19 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$19.apply(this, arguments); }
192
+
193
+ function SvgVolumeMute(props) {
194
+ return /*#__PURE__*/React.createElement("svg", _extends$19({
195
+ viewBox: "0 0 16 16",
196
+ strokeLinecap: "round",
197
+ strokeLinejoin: "round",
198
+ stroke: "currentColor",
199
+ width: "1em",
200
+ height: "1em",
201
+ fill: "none"
202
+ }, props), _path$15 || (_path$15 = /*#__PURE__*/React.createElement("path", {
203
+ d: "M7.333 3.333L4 6H1.333v4H4l3.333 2.667V3.333z"
204
+ })));
205
+ }
206
+
207
+ var _path$14;
208
+
209
+ function _extends$18() { _extends$18 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$18.apply(this, arguments); }
210
+
211
+ function SvgVolumeOff(props) {
212
+ return /*#__PURE__*/React.createElement("svg", _extends$18({
213
+ viewBox: "0 0 16 16",
214
+ strokeLinecap: "round",
215
+ strokeLinejoin: "round",
216
+ stroke: "currentColor",
217
+ width: "1em",
218
+ height: "1em",
219
+ fill: "none"
220
+ }, props), _path$14 || (_path$14 = /*#__PURE__*/React.createElement("path", {
221
+ d: "M7.333 3.333L4 6H1.333v4H4l3.333 2.667V3.333zm8 2.667l-4 4m0-4l4 4"
222
+ })));
223
+ }
224
+
225
+ var _path$13;
226
+
227
+ function _extends$17() { _extends$17 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$17.apply(this, arguments); }
228
+
229
+ function SvgVolumeUp(props) {
230
+ return /*#__PURE__*/React.createElement("svg", _extends$17({
231
+ viewBox: "0 0 16 16",
232
+ strokeLinecap: "round",
233
+ strokeLinejoin: "round",
234
+ stroke: "currentColor",
235
+ width: "1em",
236
+ height: "1em",
237
+ fill: "none"
238
+ }, props), _path$13 || (_path$13 = /*#__PURE__*/React.createElement("path", {
239
+ d: "M7.333 3.333L4 6H1.333v4H4l3.333 2.667V3.333zm5.38-.046a6.667 6.667 0 010 9.426M10.36 5.64a3.333 3.333 0 010 4.713"
240
+ })));
241
+ }
242
+
243
+ /*! *****************************************************************************
244
+ Copyright (c) Microsoft Corporation.
245
+
246
+ Permission to use, copy, modify, and/or distribute this software for any
247
+ purpose with or without fee is hereby granted.
248
+
249
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
250
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
251
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
252
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
253
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
254
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
255
+ PERFORMANCE OF THIS SOFTWARE.
256
+ ***************************************************************************** */
257
+
258
+ var __assign = function() {
259
+ __assign = Object.assign || function __assign(t) {
260
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
261
+ s = arguments[i];
262
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
263
+ }
264
+ return t;
265
+ };
266
+ return __assign.apply(this, arguments);
267
+ };
268
+
269
+ function __rest(s, e) {
270
+ var t = {};
271
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
272
+ t[p] = s[p];
273
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
274
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
275
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
276
+ t[p[i]] = s[p[i]];
277
+ }
278
+ return t;
279
+ }
280
+
281
+ var _path$2P;
282
+
283
+ function _extends$33() { _extends$33 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$33.apply(this, arguments); }
284
+
285
+ function SvgUser(props) {
286
+ return /*#__PURE__*/React.createElement("svg", _extends$33({
287
+ viewBox: "0 0 16 16",
288
+ strokeLinecap: "round",
289
+ strokeLinejoin: "round",
290
+ stroke: "currentColor",
291
+ width: "1em",
292
+ height: "1em",
293
+ fill: "none"
294
+ }, props), _path$2P || (_path$2P = /*#__PURE__*/React.createElement("path", {
295
+ d: "M13.333 14v-1.333A2.667 2.667 0 0010.667 10H5.333a2.667 2.667 0 00-2.666 2.667V14M8 7.333A2.667 2.667 0 108 2a2.667 2.667 0 000 5.333z"
296
+ })));
297
+ }
298
+
299
+ var useIconStyles = makeStyles(function (_a) {
300
+ var spacing = _a.spacing, palette = _a.palette;
301
+ var getFontSize = function (_a) {
302
+ var size = _a.size;
303
+ var sizes = {
304
+ inherit: 'inherit',
305
+ small: spacing(1.5),
306
+ medium: spacing(2),
307
+ large: spacing(2.5),
308
+ 'extra-large': spacing(3),
309
+ };
310
+ return size ? sizes[size] : 'inherit';
311
+ };
312
+ var getColor = function (props) {
313
+ var semanticColors = ['primary', 'secondary', 'info', 'success', 'warning', 'error'];
314
+ var value = 'inherit';
315
+ if (props.color) {
316
+ if (semanticColors.includes(props.color.split('.')[0])) {
317
+ var _a = props.color.split('.'), color = _a[0], _b = _a[1], variant = _b === void 0 ? 'main' : _b;
318
+ value = palette[color][variant];
319
+ }
320
+ else if (props.color.search(/^(rgb|hsla|#)/) !== -1) {
321
+ value = props.color;
322
+ }
323
+ }
324
+ return value;
325
+ };
326
+ return {
327
+ root: {
328
+ color: getColor,
329
+ fontSize: getFontSize,
330
+ strokeWidth: '1.3px',
331
+ },
332
+ };
333
+ });
334
+
335
+ var classnames = {exports: {}};
336
+
337
+ /*!
338
+ Copyright (c) 2018 Jed Watson.
339
+ Licensed under the MIT License (MIT), see
340
+ http://jedwatson.github.io/classnames
341
+ */
342
+
343
+ (function (module) {
344
+ /* global define */
345
+
346
+ (function () {
347
+
348
+ var hasOwn = {}.hasOwnProperty;
349
+
350
+ function classNames() {
351
+ var classes = [];
352
+
353
+ for (var i = 0; i < arguments.length; i++) {
354
+ var arg = arguments[i];
355
+ if (!arg) continue;
356
+
357
+ var argType = typeof arg;
358
+
359
+ if (argType === 'string' || argType === 'number') {
360
+ classes.push(arg);
361
+ } else if (Array.isArray(arg)) {
362
+ if (arg.length) {
363
+ var inner = classNames.apply(null, arg);
364
+ if (inner) {
365
+ classes.push(inner);
366
+ }
367
+ }
368
+ } else if (argType === 'object') {
369
+ if (arg.toString === Object.prototype.toString) {
370
+ for (var key in arg) {
371
+ if (hasOwn.call(arg, key) && arg[key]) {
372
+ classes.push(key);
373
+ }
374
+ }
375
+ } else {
376
+ classes.push(arg.toString());
377
+ }
378
+ }
379
+ }
380
+
381
+ return classes.join(' ');
382
+ }
383
+
384
+ if (module.exports) {
385
+ classNames.default = classNames;
386
+ module.exports = classNames;
387
+ } else {
388
+ window.classNames = classNames;
389
+ }
390
+ }());
391
+ }(classnames));
392
+
393
+ var classNames = classnames.exports;
394
+
395
+ var iconStaticClassName = 'pop-icon';
396
+ var Icon = function (props) {
397
+ var icon = props.icon, className = props.className, restProps = __rest(props, ["icon", "className"]);
398
+ var classes = useIconStyles(props);
399
+ var isValid = true;
400
+ if (!icon || (typeof icon === 'function' && icon({}) === undefined)) {
401
+ isValid = false;
402
+ }
403
+ return isValid
404
+ ? createElement(icon, __assign({ className: classNames([classes.root, iconStaticClassName, className]) }, restProps))
405
+ : null;
406
+ };
407
+ Icon.defaultProps = {
408
+ size: 'inherit',
409
+ color: 'inherit',
410
+ };
411
+ Icon.displayName = 'Icon';
412
+
413
+ var LoadingStatus;
414
+ (function (LoadingStatus) {
415
+ LoadingStatus["ERROR"] = "ERROR";
416
+ LoadingStatus["LOADED"] = "LOADED";
417
+ LoadingStatus["PENDING"] = "PENDING";
418
+ })(LoadingStatus || (LoadingStatus = {}));
419
+ var useImgProps = function (avatarProps) {
420
+ var _a = React__default.useState(LoadingStatus.PENDING), loaded = _a[0], setLoaded = _a[1];
421
+ var imgProps = __assign(__assign({}, avatarProps.imgProps), { onLoad: function (event) {
422
+ var _a, _b;
423
+ setLoaded(LoadingStatus.LOADED);
424
+ (_b = (_a = avatarProps.imgProps) === null || _a === void 0 ? void 0 : _a.onLoad) === null || _b === void 0 ? void 0 : _b.call(_a, event);
425
+ } });
426
+ return { imgProps: imgProps, loaded: loaded };
427
+ };
428
+
429
+ var getAvatarDimensions = function (theme, props) {
430
+ var factors = {
431
+ 'extra-small': 3,
432
+ small: 4,
433
+ medium: 5,
434
+ large: 6,
435
+ 'extra-large': 12.5,
436
+ };
437
+ var sizeFactor = factors[props.size || 'medium'];
438
+ return theme.spacing(sizeFactor);
439
+ };
440
+ var getAvatarFontSize = function (props) {
441
+ var fontSizes = {
442
+ 'extra-small': '0.75rem',
443
+ small: '1rem',
444
+ medium: '1rem',
445
+ large: '1.25rem',
446
+ 'extra-large': '3.5rem',
447
+ };
448
+ return fontSizes[props.size];
449
+ };
450
+ var useAvatarStyles = makeStyles$1(function (theme) { return ({
451
+ root: function (props) { return ({
452
+ width: getAvatarDimensions(theme, props),
453
+ height: getAvatarDimensions(theme, props),
454
+ fontSize: getAvatarFontSize(props),
455
+ backgroundColor: props.loaded === LoadingStatus.LOADED ? 'transparent' : props.background,
456
+ color: theme.palette.getContrastText(props.background),
457
+ objectFit: props.fit,
458
+ }); },
459
+ fallback: function (props) { return ({
460
+ fontSize: getAvatarDimensions(theme, props),
461
+ strokeWidth: 1,
462
+ }); },
463
+ }); });
464
+
465
+ var Avatar = forwardRef(function (props, ref) {
466
+ var children = props.children, src = props.src, alt = props.alt, fallback = props.fallback, muiProps = __rest(props, ["children", "src", "alt", "fallback"]);
467
+ var _a = useImgProps(props), imgProps = _a.imgProps, loaded = _a.loaded;
468
+ var classes = useAvatarStyles(__assign(__assign({}, props), { loaded: loaded }));
469
+ var displayAltTextFallback = src && alt;
470
+ var displayNoFallback = fallback === 'none';
471
+ var displayCustomFallback = fallback !== 'none' && typeof fallback !== 'undefined';
472
+ var Fallback;
473
+ if (displayAltTextFallback) {
474
+ Fallback = null;
475
+ }
476
+ else if (displayNoFallback) {
477
+ Fallback = ' ';
478
+ }
479
+ else if (displayCustomFallback) {
480
+ Fallback = fallback;
481
+ }
482
+ else {
483
+ Fallback = React__default.createElement(Icon, { icon: SvgUser, className: classes.fallback });
484
+ }
485
+ return (React__default.createElement(MuiAvatar, __assign({ ref: ref, classes: { root: classes.root }, src: src, alt: alt }, muiProps, { imgProps: imgProps }), children || Fallback));
486
+ });
487
+ Avatar.defaultProps = {
488
+ size: 'medium',
489
+ fit: 'cover',
490
+ background: '#E0E0E0',
491
+ };
492
+ Avatar.displayName = 'Avatar';
493
+
494
+ var useButtonStyles = makeStyles$1(function () { return ({
495
+ root: {
496
+ minWidth: 'unset',
497
+ },
498
+ label: {
499
+ textTransform: function (_a) {
500
+ var textTransform = _a.textTransform;
501
+ return textTransform;
502
+ },
503
+ },
504
+ }); });
505
+
506
+ var Button = forwardRef(function (props, ref) {
507
+ props.textTransform; var loading = props.loading, classesOverride = props.classes, className = props.className, muiProps = __rest(props, ["textTransform", "loading", "classes", "className"]);
508
+ props.classes; var styleProps = __rest(props, ["classes"]);
509
+ var classes = useButtonStyles(styleProps);
510
+ var typography = useTheme().typography;
511
+ var loadingIndicator = {
512
+ startIcon: React__default.createElement(CircularProgress, { color: "inherit", size: typography.button.fontSize }),
513
+ disabled: true,
514
+ };
515
+ return (React__default.createElement(MuiButton, __assign({ ref: ref, classes: __assign(__assign({}, classes), classesOverride), className: classNames([className, 'pm-button']) }, muiProps, (loading && loadingIndicator))));
516
+ });
517
+ Button.displayName = 'Button';
518
+
519
+ var Checkbox = forwardRef(function (props, ref) {
520
+ var label = props.label, disabled = props.disabled, LabelProps = props.LabelProps, muiProps = __rest(props, ["label", "disabled", "LabelProps"]);
521
+ var control = React__default.createElement(MuiCheckbox, __assign({ disabled: label ? undefined : disabled }, muiProps));
522
+ return label ? (React__default.createElement(FormControlLabel, __assign({ disabled: disabled, inputRef: ref, control: control, label: label }, LabelProps))) : (control);
523
+ });
524
+ Checkbox.displayName = 'Checkbox';
525
+
526
+ var useTypographyStyles = makeStyles$1(function () { return ({
527
+ root: function (_a) {
528
+ var _b;
529
+ var weight = _a.weight;
530
+ return (__assign((_b = {}, _b["& ." + iconStaticClassName] = {
531
+ position: 'relative',
532
+ top: '0.125em',
533
+ padding: '0 0.125em',
534
+ boxSizing: 'content-box',
535
+ }, _b), (weight && { fontWeight: (weight === 'semi-bold' && 600) || (weight === 'bold' && 700) || 400 })));
536
+ },
537
+ caption: {
538
+ display: 'inline',
539
+ },
540
+ overline: {
541
+ display: 'inline',
542
+ },
543
+ }); });
544
+
545
+ var Typography = forwardRef(function (props, ref) {
546
+ props.weight; var restProps = __rest(props, ["weight"]);
547
+ var classes = useTypographyStyles(props);
548
+ return React__default.createElement(Typography$1, __assign({ ref: ref, classes: classes }, restProps));
549
+ });
550
+ Typography.displayName = 'Typography';
551
+
552
+ var getFadeStop = function (_a, typographyVariant) {
553
+ var typography = _a.typography;
554
+ return !isNaN(Number(typography[typographyVariant].lineHeight))
555
+ ? typography[typographyVariant].lineHeight + "rem"
556
+ : typography[typographyVariant].lineHeight;
557
+ };
558
+ makeStyles(function (theme) { return ({
559
+ overlay: {
560
+ position: 'absolute',
561
+ top: 0,
562
+ left: 0,
563
+ height: '100%',
564
+ width: '100%',
565
+ background: function (props) { return "linear-gradient(to top, white, #FFF0 " + getFadeStop(theme, props.typographyVariant) + ")"; },
566
+ },
567
+ }); });
568
+
569
+ var SemanticColors;
570
+ (function (SemanticColors) {
571
+ SemanticColors["PRIMARY_MAIN"] = "primary.main";
572
+ SemanticColors["PRIMARY_DARK"] = "primary.dark";
573
+ SemanticColors["PRIMARY_LIGHT"] = "primary.light";
574
+ SemanticColors["SECONDARY_MAIN"] = "secondary.main";
575
+ SemanticColors["SECONDARY_DARK"] = "secondary.dark";
576
+ SemanticColors["SECONDARY_LIGHT"] = "secondary.light";
577
+ })(SemanticColors || (SemanticColors = {}));
578
+ makeStyles(function (theme) { return ({
579
+ dividerRoot: {
580
+ gap: theme.spacing(2),
581
+ },
582
+ textRoot: {
583
+ color: function (props) {
584
+ var textColor = props.textColor;
585
+ if (Object.values(SemanticColors).includes(textColor)) {
586
+ var _a = textColor.split('.'), semanticColor = _a[0], shade = _a[1];
587
+ return theme.palette[semanticColor][shade];
588
+ }
589
+ else if (textColor) {
590
+ return textColor;
591
+ }
592
+ else {
593
+ return 'black';
594
+ }
595
+ },
596
+ textTransform: function (props) { return props.textTransform; },
597
+ },
598
+ dividerLine: {
599
+ backgroundColor: function (props) {
600
+ var dividerColor = props.dividerColor;
601
+ if (Object.values(SemanticColors).includes(dividerColor)) {
602
+ var _a = dividerColor.split('.'), semanticColor = _a[0], shade = _a[1];
603
+ return theme.palette[semanticColor][shade];
604
+ }
605
+ else if (dividerColor) {
606
+ return dividerColor;
607
+ }
608
+ else {
609
+ return theme.palette.grey[500];
610
+ }
611
+ },
612
+ },
613
+ }); });
614
+
615
+ var IconButton = forwardRef(function (props, ref) {
616
+ return React__default.createElement(MuiIconButton, __assign({ ref: ref }, props));
617
+ });
618
+ IconButton.displayName = 'IconButton';
619
+ IconButton.defaultProps = {
620
+ color: 'secondary',
621
+ };
622
+
623
+ var useLinkStyles = makeStyles$1(function (theme) { return ({
624
+ root: function (props) {
625
+ var _a;
626
+ return (__assign(__assign({ display: 'flex' }, (props.color === undefined && { color: theme.palette.info.main })), (_a = {}, _a["& ." + iconStaticClassName] = {
627
+ alignSelf: 'center',
628
+ }, _a)));
629
+ },
630
+ }); });
631
+
632
+ var Link = forwardRef(function (props, ref) {
633
+ var children = props.children, muiProps = __rest(props, ["children"]);
634
+ var classes = useLinkStyles(props);
635
+ return (React__default.createElement(Link$1, __assign({ ref: ref, classes: { root: classes.root } }, muiProps), children));
636
+ });
637
+ Link.defaultProps = {
638
+ variant: 'body1',
639
+ };
640
+ Link.displayName = 'Link';
641
+
642
+ var useStyles = makeStyles(function (_a) {
643
+ var spacing = _a.spacing;
644
+ return ({
645
+ root: {
646
+ '&:last-child': {
647
+ marginBottom: 0,
648
+ },
649
+ marginBottom: spacing(4),
650
+ padding: spacing(4),
651
+ },
652
+ });
653
+ });
654
+ var Paper = forwardRef(function (props, ref) {
655
+ var legacyStyles = props.legacyStyles, restProps = __rest(props, ["legacyStyles"]);
656
+ var classes = useStyles(props);
657
+ return React__default.createElement(Paper$1, __assign({}, ref, { classes: __assign({}, (legacyStyles && classes)) }, restProps));
658
+ });
659
+ Paper.displayName = 'Paper';
660
+ Paper.defaultProps = {
661
+ legacyStyles: false,
662
+ };
663
+
664
+ var Radio = forwardRef(function (props, ref) {
665
+ var label = props.label, disabled = props.disabled, LabelProps = props.LabelProps, muiProps = __rest(props, ["label", "disabled", "LabelProps"]);
666
+ var control = React__default.createElement(MuiRadio, __assign({ disabled: label ? undefined : disabled }, muiProps));
667
+ return label ? (React__default.createElement(FormControlLabel, __assign({ disabled: disabled, inputRef: ref, control: control, label: label }, LabelProps))) : (control);
668
+ });
669
+ Radio.displayName = 'Radio';
670
+
671
+ makeStyles$1(function () { return ({
672
+ textfield: {
673
+ background: function (props) { return (props.backgroundTransparency ? '#FFFFFF44' : 'none'); },
674
+ borderTopLeftRadius: 4,
675
+ borderBottomLeftRadius: 4,
676
+ '& fieldset': {
677
+ borderRight: 'none',
678
+ borderTopRightRadius: 0,
679
+ borderBottomRightRadius: 0,
680
+ },
681
+ },
682
+ button: {
683
+ borderTopLeftRadius: 0,
684
+ borderBottomLeftRadius: 0,
685
+ alignSelf: 'stretch',
686
+ },
687
+ input: {
688
+ color: function (props) { return props.inputTextColor || 'inherit'; },
689
+ '&$focused fieldset': {
690
+ top: -4,
691
+ },
692
+ },
693
+ focused: {},
694
+ }); });
695
+
696
+ var useSwitchStyles = makeStyles$1(function (theme) { return ({
697
+ checked: {
698
+ '& $thumb': {
699
+ background: theme.palette.success.main,
700
+ },
701
+ '&& + $track': {
702
+ backgroundColor: theme.palette.success.main,
703
+ },
704
+ },
705
+ thumb: {},
706
+ track: {},
707
+ }); });
708
+
709
+ var Switch = forwardRef(function (props, ref) {
710
+ var label = props.label, disabled = props.disabled, LabelProps = props.LabelProps, muiProps = __rest(props, ["label", "disabled", "LabelProps"]);
711
+ var classes = useSwitchStyles(props);
712
+ var control = React__default.createElement(MuiSwitch, __assign({ classes: classes, disabled: label ? undefined : disabled }, muiProps));
713
+ return label ? (React__default.createElement(FormControlLabel, __assign({ disabled: disabled, inputRef: ref, control: control, label: label }, LabelProps))) : (control);
714
+ });
715
+ Switch.displayName = 'Switch';
716
+
717
+ var useToggleButtonStyles = makeStyles$1(function (theme) { return ({
718
+ root: {
719
+ color: theme.palette.text.primary,
720
+ },
721
+ selected: {
722
+ '&&': {
723
+ '&:hover': {
724
+ backgroundColor: function (props) { return theme.palette[props.color || 'primary'].dark; },
725
+ },
726
+ backgroundColor: function (props) { return theme.palette[props.color || 'primary'].main; },
727
+ color: 'white',
728
+ },
729
+ },
730
+ }); });
731
+
732
+ var ToggleButton = forwardRef(function (props, ref) {
733
+ var children = props.children, muiProps = __rest(props, ["children"]);
734
+ var classes = useToggleButtonStyles(props);
735
+ return (React__default.createElement(MuiToggleButton, __assign({ ref: ref, classes: {
736
+ root: classes.root,
737
+ selected: classes.selected,
738
+ } }, muiProps), children));
739
+ });
740
+ ToggleButton.defaultProps = {
741
+ color: 'primary',
742
+ };
743
+ ToggleButton.displayName = 'ToggleButton';
744
+
745
+ var useToggleButtonGroupStyles = makeStyles$1(function (theme) { return ({
746
+ root: {
747
+ '&&': {
748
+ backgroundColor: theme.palette.grey[300],
749
+ },
750
+ },
751
+ }); });
752
+
753
+ var ToggleButtonGroup = forwardRef(function (props, ref) {
754
+ var children = props.children, _a = props.color, color = _a === void 0 ? 'primary' : _a, muiProps = __rest(props, ["children", "color"]);
755
+ var classes = useToggleButtonGroupStyles(props);
756
+ var childrenWithProps = React__default.Children.map(children, function (child) {
757
+ if (!React__default.isValidElement(child)) {
758
+ return null;
759
+ }
760
+ return React__default.cloneElement(child, { color: color });
761
+ });
762
+ return (React__default.createElement(MuiToggleButtonGroup, __assign({ ref: ref, classes: { root: classes.root } }, muiProps), childrenWithProps));
763
+ });
764
+ ToggleButtonGroup.displayName = 'ToggleButtonGroup';
765
+
766
+ var useTooltipStyles = makeStyles$1(function (_a) {
767
+ var typography = _a.typography;
768
+ return ({
769
+ tooltip: {
770
+ fontSize: typography.pxToRem(16),
771
+ },
772
+ });
773
+ });
774
+
775
+ var Tooltip = forwardRef(function (props, ref) {
776
+ var classes = useTooltipStyles(props);
777
+ return React__default.createElement(MuiTooltip, __assign({ ref: ref, classes: classes }, props));
778
+ });
779
+ Tooltip.displayName = 'Tooltip';
780
+
781
+ makeStyles(function () { return ({
782
+ root: {
783
+ height: 56,
784
+ },
785
+ }); });
786
+ makeStyles(function (theme) { return ({
787
+ root: {
788
+ height: '100%',
789
+ width: 'min-content',
790
+ borderRadius: theme.spacing(1),
791
+ },
792
+ input: {
793
+ '&::-webkit-clear-button, &::-webkit-outer-spin-button, &::-webkit-inner-spin-button': {
794
+ display: 'none',
795
+ },
796
+ '-moz-appearance': 'textfield',
797
+ minWidth: 40,
798
+ padding: 0,
799
+ textAlign: 'center',
800
+ },
801
+ adornedStart: {
802
+ padding: 0,
803
+ },
804
+ adornedEnd: {
805
+ padding: 0,
806
+ },
807
+ }); });
808
+
809
+ var AUDIO_PLAYER_EVENT_TYPES;
810
+ (function (AUDIO_PLAYER_EVENT_TYPES) {
811
+ AUDIO_PLAYER_EVENT_TYPES["TOGGLE_PLAYBACK"] = "TOGGLE_PLAYBACK";
812
+ AUDIO_PLAYER_EVENT_TYPES["TOGGLE_VOLUME_CONTROL"] = "TOGGLE_VOLUME_CONTROL";
813
+ AUDIO_PLAYER_EVENT_TYPES["TOGGLE_MUTE"] = "TOGGLE_MUTE";
814
+ AUDIO_PLAYER_EVENT_TYPES["VOLUME_CHANGE"] = "VOLUME_CHANGE";
815
+ AUDIO_PLAYER_EVENT_TYPES["TIME_CHANGE"] = "TIME_CHANGE";
816
+ AUDIO_PLAYER_EVENT_TYPES["DURATION_CHANGE"] = "DURATION_CHANGE";
817
+ AUDIO_PLAYER_EVENT_TYPES["SET_TIME"] = "SET_TIME";
818
+ AUDIO_PLAYER_EVENT_TYPES["CAN_PLAY"] = "CAN_PLAY";
819
+ AUDIO_PLAYER_EVENT_TYPES["RESET"] = "RESET";
820
+ })(AUDIO_PLAYER_EVENT_TYPES || (AUDIO_PLAYER_EVENT_TYPES = {}));
821
+ var PLAYBACK_STATES;
822
+ (function (PLAYBACK_STATES) {
823
+ PLAYBACK_STATES["NONE"] = "NONE";
824
+ PLAYBACK_STATES["PAUSED"] = "PAUSED";
825
+ PLAYBACK_STATES["PLAYING"] = "PLAYING";
826
+ })(PLAYBACK_STATES || (PLAYBACK_STATES = {}));
827
+ var CONTROL_LABELS;
828
+ (function (CONTROL_LABELS) {
829
+ CONTROL_LABELS["PAUSE"] = "PAUSE";
830
+ CONTROL_LABELS["PLAY"] = "PLAY";
831
+ CONTROL_LABELS["MUTE"] = "MUTE";
832
+ CONTROL_LABELS["UNMUTE"] = "UNMUTE";
833
+ })(CONTROL_LABELS || (CONTROL_LABELS = {}));
834
+ var VOLUME_CONTROL_STATES;
835
+ (function (VOLUME_CONTROL_STATES) {
836
+ VOLUME_CONTROL_STATES["SHOW"] = "SHOW";
837
+ VOLUME_CONTROL_STATES["HIDE"] = "HIDE";
838
+ })(VOLUME_CONTROL_STATES || (VOLUME_CONTROL_STATES = {}));
839
+
840
+ var initialAudioPlayerState = {
841
+ playback: PLAYBACK_STATES.NONE,
842
+ volumeControls: VOLUME_CONTROL_STATES.HIDE,
843
+ context: {
844
+ volume: 100,
845
+ playbackButtonLabel: CONTROL_LABELS.PLAY,
846
+ volumeButtonLabel: CONTROL_LABELS.MUTE,
847
+ },
848
+ };
849
+ var getPlayback = function (_a) {
850
+ var audio = _a.current;
851
+ var playback = PLAYBACK_STATES.NONE;
852
+ if (audio) {
853
+ var paused = audio.paused, readyState = audio.readyState;
854
+ if (readyState === 0) {
855
+ playback = PLAYBACK_STATES.NONE;
856
+ }
857
+ else if (paused) {
858
+ playback = PLAYBACK_STATES.PAUSED;
859
+ }
860
+ else {
861
+ playback = PLAYBACK_STATES.PLAYING;
862
+ }
863
+ }
864
+ return playback;
865
+ };
866
+ var audioPlayerReducer = function (state, event) {
867
+ var _a, _b;
868
+ var audioRef = state.context.audioRef;
869
+ var nextState = __assign$1({}, state);
870
+ switch (state.playback) {
871
+ case PLAYBACK_STATES.NONE:
872
+ if (event.type === AUDIO_PLAYER_EVENT_TYPES.CAN_PLAY) {
873
+ nextState.playback = getPlayback(audioRef);
874
+ return nextState;
875
+ }
876
+ break;
877
+ case PLAYBACK_STATES.PAUSED:
878
+ if (event.type === AUDIO_PLAYER_EVENT_TYPES.TOGGLE_PLAYBACK) {
879
+ (_a = audioRef.current) === null || _a === void 0 ? void 0 : _a.play();
880
+ nextState.playback = getPlayback(audioRef);
881
+ nextState.context.playbackButtonLabel = CONTROL_LABELS.PAUSE;
882
+ return nextState;
883
+ }
884
+ break;
885
+ case PLAYBACK_STATES.PLAYING:
886
+ if (event.type === AUDIO_PLAYER_EVENT_TYPES.TOGGLE_PLAYBACK) {
887
+ (_b = audioRef.current) === null || _b === void 0 ? void 0 : _b.pause();
888
+ nextState.playback = getPlayback(audioRef);
889
+ nextState.context.playbackButtonLabel = CONTROL_LABELS.PLAY;
890
+ return nextState;
891
+ }
892
+ if (event.type === AUDIO_PLAYER_EVENT_TYPES.TIME_CHANGE) {
893
+ return nextState;
894
+ }
895
+ break;
896
+ }
897
+ switch (state.volumeControls) {
898
+ case VOLUME_CONTROL_STATES.SHOW:
899
+ if (event.type === AUDIO_PLAYER_EVENT_TYPES.TOGGLE_VOLUME_CONTROL) {
900
+ nextState.volumeControls = VOLUME_CONTROL_STATES.HIDE;
901
+ return nextState;
902
+ }
903
+ if (event.type === AUDIO_PLAYER_EVENT_TYPES.VOLUME_CHANGE) {
904
+ if (nextState.context.volume !== event.context.volume) {
905
+ nextState.context.volume = event.context.volume;
906
+ if (audioRef.current) {
907
+ audioRef.current.volume = event.context.volume;
908
+ }
909
+ return nextState;
910
+ }
911
+ }
912
+ break;
913
+ case VOLUME_CONTROL_STATES.HIDE:
914
+ if (event.type === AUDIO_PLAYER_EVENT_TYPES.TOGGLE_VOLUME_CONTROL) {
915
+ nextState.volumeControls = VOLUME_CONTROL_STATES.SHOW;
916
+ return nextState;
917
+ }
918
+ break;
919
+ }
920
+ switch (event.type) {
921
+ case AUDIO_PLAYER_EVENT_TYPES.TOGGLE_MUTE:
922
+ if (audioRef.current) {
923
+ audioRef.current.muted = !audioRef.current.muted;
924
+ return nextState;
925
+ }
926
+ break;
927
+ case AUDIO_PLAYER_EVENT_TYPES.SET_TIME:
928
+ if (audioRef.current) {
929
+ audioRef.current.currentTime = event.context.time;
930
+ return nextState;
931
+ }
932
+ break;
933
+ case AUDIO_PLAYER_EVENT_TYPES.RESET:
934
+ if (audioRef.current) {
935
+ audioRef.current.currentTime = 0;
936
+ nextState.playback = getPlayback(audioRef);
937
+ return nextState;
938
+ }
939
+ break;
940
+ }
941
+ return state;
942
+ };
943
+
944
+ var useVolumeIcon = function (state) {
945
+ var volumeIcon = SvgVolumeUp;
946
+ if (state.context.volume >= 0.5) {
947
+ volumeIcon = SvgVolumeUp;
948
+ }
949
+ else if (state.context.volume < 0.5 && state.context.volume > 0) {
950
+ volumeIcon = SvgVolumeDown;
951
+ }
952
+ else if (state.context.volume === 0) {
953
+ volumeIcon = SvgVolumeMute;
954
+ }
955
+ if (state.context.audioRef.current) {
956
+ if (state.context.audioRef.current.muted) {
957
+ volumeIcon = SvgVolumeOff;
958
+ }
959
+ }
960
+ return volumeIcon;
961
+ };
962
+
963
+ var appendZero = function (num) { return (num < 10 ? "0" + num : num); };
964
+ var formatTime = function (time, remaning) {
965
+ if (remaning === void 0) { remaning = false; }
966
+ var dateTime = new Date(0, 0, 0, 0, 0, time, 0);
967
+ var dateTimeH = appendZero(dateTime.getHours());
968
+ var dateTimeM = appendZero(dateTime.getMinutes());
969
+ var dateTimeS = appendZero(dateTime.getSeconds());
970
+ var minus = remaning ? '-' : '';
971
+ return dateTimeH > 0 ? "" + minus + dateTimeH + ":" + dateTimeM + ":" + dateTimeS : "" + minus + dateTimeM + ":" + dateTimeS;
972
+ };
973
+
974
+ var setupAudioRef = function (config) { return function () {
975
+ var _a, _b, _c, _d;
976
+ var audioRef = config.audioRef, send = config.send;
977
+ var handleDurationChange = function (event) {
978
+ var duration = event.target.duration;
979
+ send({ type: AUDIO_PLAYER_EVENT_TYPES.DURATION_CHANGE, context: { duration: duration } });
980
+ };
981
+ var handleTimeUpdate = function (event) {
982
+ var currentTime = event.target.currentTime;
983
+ send({ type: AUDIO_PLAYER_EVENT_TYPES.TIME_CHANGE, context: { currentTime: currentTime } });
984
+ };
985
+ var handleCanPlay = function () {
986
+ send({ type: AUDIO_PLAYER_EVENT_TYPES.CAN_PLAY });
987
+ };
988
+ var handleEnded = function () {
989
+ send({ type: AUDIO_PLAYER_EVENT_TYPES.RESET });
990
+ };
991
+ (_a = audioRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('durationchange', handleDurationChange);
992
+ (_b = audioRef.current) === null || _b === void 0 ? void 0 : _b.addEventListener('timeupdate', handleTimeUpdate);
993
+ (_c = audioRef.current) === null || _c === void 0 ? void 0 : _c.addEventListener('canplay', handleCanPlay);
994
+ (_d = audioRef.current) === null || _d === void 0 ? void 0 : _d.addEventListener('ended', handleEnded);
995
+ return function () {
996
+ var _a, _b, _c, _d;
997
+ (_a = audioRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('durationchange', handleDurationChange);
998
+ (_b = audioRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('timeupdate', handleTimeUpdate);
999
+ (_c = audioRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('canplay', handleCanPlay);
1000
+ (_d = audioRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('ended', handleEnded);
1001
+ };
1002
+ }; };
1003
+
1004
+ var AudioPlayer = function (props) {
1005
+ var _a, _b, _c, _d, _f;
1006
+ var src = props.src, _g = props.classes, classes = _g === void 0 ? {} : _g;
1007
+ var volumeRef = useRef(null);
1008
+ var audioRef = useRef(null);
1009
+ var spacing = useTheme$1().spacing;
1010
+ var _h = useState(false), disableRipple = _h[0], setDisableRipple = _h[1];
1011
+ var _j = useReducer(audioPlayerReducer, __assign$1(__assign$1({}, initialAudioPlayerState), { context: __assign$1(__assign$1({}, initialAudioPlayerState.context), { audioRef: audioRef }) })), state = _j[0], send = _j[1];
1012
+ useEffect(setupAudioRef({ audioRef: audioRef, send: send }), [audioRef]);
1013
+ var PlaybackIcon = state.playback !== PLAYBACK_STATES.PAUSED ? SvgPause : SvgPlay;
1014
+ var VolumeIcon = useMemo(function () { return useVolumeIcon(state); }, [state.context.volume, (_a = state.context.audioRef.current) === null || _a === void 0 ? void 0 : _a.muted]);
1015
+ var togglePlayback = function () { return send({ type: AUDIO_PLAYER_EVENT_TYPES.TOGGLE_PLAYBACK }); };
1016
+ var toggleVolumeControl = function () { return send({ type: AUDIO_PLAYER_EVENT_TYPES.TOGGLE_VOLUME_CONTROL }); };
1017
+ var toggleMute = function () { return send({ type: AUDIO_PLAYER_EVENT_TYPES.TOGGLE_MUTE }); };
1018
+ var setTime = function (_e, time) { return send({ type: AUDIO_PLAYER_EVENT_TYPES.SET_TIME, context: { time: time } }); };
1019
+ var setVolume = function (_e, volume) { return send({ type: AUDIO_PLAYER_EVENT_TYPES.VOLUME_CHANGE, context: { volume: volume } }); };
1020
+ return (React__default.createElement(Box, { display: "flex", alignItems: "center", gridGap: spacing(1), className: classNames$1([classes.root]) },
1021
+ React__default.createElement("audio", { ref: audioRef, src: src }),
1022
+ React__default.createElement(Box, null,
1023
+ React__default.createElement(IconButton, { classes: { root: classes.playbackToggle }, "aria-label": state.context.playbackButtonLabel, disabled: state.playback === PLAYBACK_STATES.NONE, onClick: togglePlayback },
1024
+ React__default.createElement(Icon, { icon: PlaybackIcon })),
1025
+ React__default.createElement(IconButton, { classes: { root: classes.volumeToggle }, "aria-label": state.context.volumeButtonLabel, ref: volumeRef, onClick: toggleMute, onMouseEnter: toggleVolumeControl, onMouseLeave: toggleVolumeControl, disableRipple: disableRipple },
1026
+ React__default.createElement(Icon, { icon: VolumeIcon }),
1027
+ React__default.createElement(Popper, { onClick: function (e) { return e.stopPropagation(); }, onMouseEnter: function () { return setDisableRipple(true); }, onMouseLeave: function () { return setDisableRipple(false); }, open: state.volumeControls === VOLUME_CONTROL_STATES.SHOW, anchorEl: function () { return volumeRef.current; }, transition: true, placement: "top", className: classNames$1([classes.volumeSlider]) }, function (_a) {
1028
+ var TransitionProps = _a.TransitionProps;
1029
+ return (React__default.createElement(Grow, __assign$1({}, TransitionProps),
1030
+ React__default.createElement(Paper, { elevation: 1 },
1031
+ React__default.createElement(Box, { py: 1, height: 80 },
1032
+ React__default.createElement(Slider, { color: "secondary", orientation: "vertical", value: state.context.volume, onChange: setVolume, max: 1, step: 0.01 })))));
1033
+ }))),
1034
+ React__default.createElement(Box, { display: "flex", flexGrow: 1, alignItems: "center", gridGap: spacing(1) },
1035
+ React__default.createElement(Box, { flexBasis: 60, flexShrink: 0 },
1036
+ React__default.createElement(Typography, { classes: { root: classes.playbackText } }, formatTime(((_b = state.context.audioRef.current) === null || _b === void 0 ? void 0 : _b.currentTime) || 0))),
1037
+ React__default.createElement(Slider, { classes: { root: classes.playbackSlider }, color: "secondary", value: ((_c = state.context.audioRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) || 0, max: ((_d = state.context.audioRef.current) === null || _d === void 0 ? void 0 : _d.duration) || 1, onChange: setTime, disabled: state.playback === PLAYBACK_STATES.NONE }),
1038
+ React__default.createElement(Box, { flexBasis: 60, flexShrink: 0, textAlign: "end" },
1039
+ React__default.createElement(Typography, { classes: { root: classes.lengthText } }, formatTime(((_f = state.context.audioRef.current) === null || _f === void 0 ? void 0 : _f.duration) || 0))))));
1040
+ };
1041
+
1042
+ export { AudioPlayer };
1043
+ //# sourceMappingURL=index.es.js.map