"use strict";
(self["webpackChunkspeechwidgets"] = self["webpackChunkspeechwidgets"] || []).push([["vendors-node_modules_react-audio-spectrogram-player_dist_react-audio-spectrogram-player_es_js"],{

/***/ "./node_modules/react-audio-spectrogram-player/dist/react-audio-spectrogram-player.es.js":
/*!***********************************************************************************************!*\
  !*** ./node_modules/react-audio-spectrogram-player/dist/react-audio-spectrogram-player.es.js ***!
  \***********************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ Gr)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("button{all:unset;border-radius:5px;font-family:monospace;text-align:center;padding:5px;cursor:pointer}button.light{background-color:#0001;color:#000}button.light:hover{background-color:#0003}button.dark{background-color:#fff2;color:#fff}button.dark:hover{background-color:#fff3}.gridcell{padding:5px;text-align:center}.gridcell:not(.header){cursor:pointer}.gridcell.light{background-color:#0001;color:#000}.gridcell.header.light{background-color:#0003}.gridcell.light:not(.header):not(.selected):hover{background-color:#0002}.gridcell.light.selected{background-color:#0003}.gridcell.dark{background-color:#fff1;color:#fff}.gridcell.header.dark{background-color:#fff3}.gridcell.dark:not(.header):not(.selected):hover{background-color:#fff2}.gridcell.dark.selected{background-color:#fff3}.slidecontainer{width:100%;display:flex;align-items:center}.slidervalue{padding:5px}.slider{-webkit-appearance:none;appearance:none;width:100%;height:25px;outline:none;opacity:.7;-webkit-transition:.2s;transition:opacity .2s}.slider:hover{opacity:1}.slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:25px;height:25px;cursor:pointer}.slider::-moz-range-thumb{width:25px;height:25px;cursor:pointer}.slidervalue.light{color:#000}.slider.light{background:#00000011}.slider.light::-webkit-slider-thumb{background:#00000044}.slider.light::-moz-range-thumb{background:#00000044}.slidervalue.dark{color:#fff}.slider.dark{background:#ffffff11}.slider.dark::-webkit-slider-thumb{background:#ffffff44}.slider.dark::-moz-range-thumb{background:#ffffff44}")),document.head.appendChild(e)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();

var o = {}, Rr = {
  get exports() {
    return o;
  },
  set exports(t) {
    o = t;
  }
}, G = {};
/**
 * @license React
 * react-jsx-runtime.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var Ye;
function Er() {
  if (Ye)
    return G;
  Ye = 1;
  var t = (react__WEBPACK_IMPORTED_MODULE_0___default()), g = Symbol.for("react.element"), m = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, R = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, v = { key: !0, ref: !0, __self: !0, __source: !0 };
  function h(x, c, s) {
    var d, f = {}, l = null, w = null;
    s !== void 0 && (l = "" + s), c.key !== void 0 && (l = "" + c.key), c.ref !== void 0 && (w = c.ref);
    for (d in c)
      i.call(c, d) && !v.hasOwnProperty(d) && (f[d] = c[d]);
    if (x && x.defaultProps)
      for (d in c = x.defaultProps, c)
        f[d] === void 0 && (f[d] = c[d]);
    return { $$typeof: g, type: x, key: l, ref: w, props: f, _owner: R.current };
  }
  return G.Fragment = m, G.jsx = h, G.jsxs = h, G;
}
var q = {};
/**
 * @license React
 * react-jsx-runtime.development.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var ze;
function wr() {
  return ze || (ze = 1,  true && function() {
    var t = (react__WEBPACK_IMPORTED_MODULE_0___default()), g = Symbol.for("react.element"), m = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), R = Symbol.for("react.strict_mode"), v = Symbol.for("react.profiler"), h = Symbol.for("react.provider"), x = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), s = Symbol.for("react.suspense"), d = Symbol.for("react.suspense_list"), f = Symbol.for("react.memo"), l = Symbol.for("react.lazy"), w = Symbol.for("react.offscreen"), _ = Symbol.iterator, j = "@@iterator";
    function E(e) {
      if (e === null || typeof e != "object")
        return null;
      var r = _ && e[_] || e[j];
      return typeof r == "function" ? r : null;
    }
    var u = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
    function a(e) {
      {
        for (var r = arguments.length, n = new Array(r > 1 ? r - 1 : 0), b = 1; b < r; b++)
          n[b - 1] = arguments[b];
        A("error", e, n);
      }
    }
    function A(e, r, n) {
      {
        var b = u.ReactDebugCurrentFrame, T = b.getStackAddendum();
        T !== "" && (r += "%s", n = n.concat([T]));
        var C = n.map(function(y) {
          return String(y);
        });
        C.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, C);
      }
    }
    var $ = !1, L = !1, B = !1, k = !1, oe = !1, J;
    J = Symbol.for("react.module.reference");
    function se(e) {
      return !!(typeof e == "string" || typeof e == "function" || e === i || e === v || oe || e === R || e === s || e === d || k || e === w || $ || L || B || typeof e == "object" && e !== null && (e.$$typeof === l || e.$$typeof === f || e.$$typeof === h || e.$$typeof === x || e.$$typeof === c || // This needs to include all possible module reference object
      // types supported by any Flight configuration anywhere since
      // we don't know which Flight build this will end up being used
      // with.
      e.$$typeof === J || e.getModuleId !== void 0));
    }
    function U(e, r, n) {
      var b = e.displayName;
      if (b)
        return b;
      var T = r.displayName || r.name || "";
      return T !== "" ? n + "(" + T + ")" : n;
    }
    function N(e) {
      return e.displayName || "Context";
    }
    function O(e) {
      if (e == null)
        return null;
      if (typeof e.tag == "number" && a("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
        return e.displayName || e.name || null;
      if (typeof e == "string")
        return e;
      switch (e) {
        case i:
          return "Fragment";
        case m:
          return "Portal";
        case v:
          return "Profiler";
        case R:
          return "StrictMode";
        case s:
          return "Suspense";
        case d:
          return "SuspenseList";
      }
      if (typeof e == "object")
        switch (e.$$typeof) {
          case x:
            var r = e;
            return N(r) + ".Consumer";
          case h:
            var n = e;
            return N(n._context) + ".Provider";
          case c:
            return U(e, e.render, "ForwardRef");
          case f:
            var b = e.displayName || null;
            return b !== null ? b : O(e.type) || "Memo";
          case l: {
            var T = e, C = T._payload, y = T._init;
            try {
              return O(y(C));
            } catch {
              return null;
            }
          }
        }
      return null;
    }
    var I = Object.assign, Y = 0, de, ye, Te, Re, Ee, we, _e;
    function Ce() {
    }
    Ce.__reactDisabledLog = !0;
    function qe() {
      {
        if (Y === 0) {
          de = console.log, ye = console.info, Te = console.warn, Re = console.error, Ee = console.group, we = console.groupCollapsed, _e = console.groupEnd;
          var e = {
            configurable: !0,
            enumerable: !0,
            value: Ce,
            writable: !0
          };
          Object.defineProperties(console, {
            info: e,
            log: e,
            warn: e,
            error: e,
            group: e,
            groupCollapsed: e,
            groupEnd: e
          });
        }
        Y++;
      }
    }
    function Je() {
      {
        if (Y--, Y === 0) {
          var e = {
            configurable: !0,
            enumerable: !0,
            writable: !0
          };
          Object.defineProperties(console, {
            log: I({}, e, {
              value: de
            }),
            info: I({}, e, {
              value: ye
            }),
            warn: I({}, e, {
              value: Te
            }),
            error: I({}, e, {
              value: Re
            }),
            group: I({}, e, {
              value: Ee
            }),
            groupCollapsed: I({}, e, {
              value: we
            }),
            groupEnd: I({}, e, {
              value: _e
            })
          });
        }
        Y < 0 && a("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
      }
    }
    var ce = u.ReactCurrentDispatcher, le;
    function K(e, r, n) {
      {
        if (le === void 0)
          try {
            throw Error();
          } catch (T) {
            var b = T.stack.trim().match(/\n( *(at )?)/);
            le = b && b[1] || "";
          }
        return `
` + le + e;
      }
    }
    var ue = !1, X;
    {
      var Ke = typeof WeakMap == "function" ? WeakMap : Map;
      X = new Ke();
    }
    function je(e, r) {
      if (!e || ue)
        return "";
      {
        var n = X.get(e);
        if (n !== void 0)
          return n;
      }
      var b;
      ue = !0;
      var T = Error.prepareStackTrace;
      Error.prepareStackTrace = void 0;
      var C;
      C = ce.current, ce.current = null, qe();
      try {
        if (r) {
          var y = function() {
            throw Error();
          };
          if (Object.defineProperty(y.prototype, "props", {
            set: function() {
              throw Error();
            }
          }), typeof Reflect == "object" && Reflect.construct) {
            try {
              Reflect.construct(y, []);
            } catch (W) {
              b = W;
            }
            Reflect.construct(e, [], y);
          } else {
            try {
              y.call();
            } catch (W) {
              b = W;
            }
            e.call(y.prototype);
          }
        } else {
          try {
            throw Error();
          } catch (W) {
            b = W;
          }
          e();
        }
      } catch (W) {
        if (W && b && typeof W.stack == "string") {
          for (var p = W.stack.split(`
`), D = b.stack.split(`
`), S = p.length - 1, P = D.length - 1; S >= 1 && P >= 0 && p[S] !== D[P]; )
            P--;
          for (; S >= 1 && P >= 0; S--, P--)
            if (p[S] !== D[P]) {
              if (S !== 1 || P !== 1)
                do
                  if (S--, P--, P < 0 || p[S] !== D[P]) {
                    var F = `
` + p[S].replace(" at new ", " at ");
                    return e.displayName && F.includes("<anonymous>") && (F = F.replace("<anonymous>", e.displayName)), typeof e == "function" && X.set(e, F), F;
                  }
                while (S >= 1 && P >= 0);
              break;
            }
        }
      } finally {
        ue = !1, ce.current = C, Je(), Error.prepareStackTrace = T;
      }
      var V = e ? e.displayName || e.name : "", Le = V ? K(V) : "";
      return typeof e == "function" && X.set(e, Le), Le;
    }
    function Xe(e, r, n) {
      return je(e, !1);
    }
    function Qe(e) {
      var r = e.prototype;
      return !!(r && r.isReactComponent);
    }
    function Q(e, r, n) {
      if (e == null)
        return "";
      if (typeof e == "function")
        return je(e, Qe(e));
      if (typeof e == "string")
        return K(e);
      switch (e) {
        case s:
          return K("Suspense");
        case d:
          return K("SuspenseList");
      }
      if (typeof e == "object")
        switch (e.$$typeof) {
          case c:
            return Xe(e.render);
          case f:
            return Q(e.type, r, n);
          case l: {
            var b = e, T = b._payload, C = b._init;
            try {
              return Q(C(T), r, n);
            } catch {
            }
          }
        }
      return "";
    }
    var ee = Object.prototype.hasOwnProperty, Se = {}, Pe = u.ReactDebugCurrentFrame;
    function re(e) {
      if (e) {
        var r = e._owner, n = Q(e.type, e._source, r ? r.type : null);
        Pe.setExtraStackFrame(n);
      } else
        Pe.setExtraStackFrame(null);
    }
    function er(e, r, n, b, T) {
      {
        var C = Function.call.bind(ee);
        for (var y in e)
          if (C(e, y)) {
            var p = void 0;
            try {
              if (typeof e[y] != "function") {
                var D = Error((b || "React class") + ": " + n + " type `" + y + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[y] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
                throw D.name = "Invariant Violation", D;
              }
              p = e[y](r, y, b, n, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
            } catch (S) {
              p = S;
            }
            p && !(p instanceof Error) && (re(T), a("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", b || "React class", n, y, typeof p), re(null)), p instanceof Error && !(p.message in Se) && (Se[p.message] = !0, re(T), a("Failed %s type: %s", n, p.message), re(null));
          }
      }
    }
    var rr = Array.isArray;
    function ge(e) {
      return rr(e);
    }
    function nr(e) {
      {
        var r = typeof Symbol == "function" && Symbol.toStringTag, n = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
        return n;
      }
    }
    function tr(e) {
      try {
        return ke(e), !1;
      } catch {
        return !0;
      }
    }
    function ke(e) {
      return "" + e;
    }
    function Oe(e) {
      if (tr(e))
        return a("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", nr(e)), ke(e);
    }
    var Z = u.ReactCurrentOwner, ir = {
      key: !0,
      ref: !0,
      __self: !0,
      __source: !0
    }, De, Ae, fe;
    fe = {};
    function ar(e) {
      if (ee.call(e, "ref")) {
        var r = Object.getOwnPropertyDescriptor(e, "ref").get;
        if (r && r.isReactWarning)
          return !1;
      }
      return e.ref !== void 0;
    }
    function or(e) {
      if (ee.call(e, "key")) {
        var r = Object.getOwnPropertyDescriptor(e, "key").get;
        if (r && r.isReactWarning)
          return !1;
      }
      return e.key !== void 0;
    }
    function sr(e, r) {
      if (typeof e.ref == "string" && Z.current && r && Z.current.stateNode !== r) {
        var n = O(Z.current.type);
        fe[n] || (a('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', O(Z.current.type), e.ref), fe[n] = !0);
      }
    }
    function dr(e, r) {
      {
        var n = function() {
          De || (De = !0, a("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
        };
        n.isReactWarning = !0, Object.defineProperty(e, "key", {
          get: n,
          configurable: !0
        });
      }
    }
    function cr(e, r) {
      {
        var n = function() {
          Ae || (Ae = !0, a("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
        };
        n.isReactWarning = !0, Object.defineProperty(e, "ref", {
          get: n,
          configurable: !0
        });
      }
    }
    var lr = function(e, r, n, b, T, C, y) {
      var p = {
        // This tag allows us to uniquely identify this as a React Element
        $$typeof: g,
        // Built-in properties that belong on the element
        type: e,
        key: r,
        ref: n,
        props: y,
        // Record the component responsible for creating this element.
        _owner: C
      };
      return p._store = {}, Object.defineProperty(p._store, "validated", {
        configurable: !1,
        enumerable: !1,
        writable: !0,
        value: !1
      }), Object.defineProperty(p, "_self", {
        configurable: !1,
        enumerable: !1,
        writable: !1,
        value: b
      }), Object.defineProperty(p, "_source", {
        configurable: !1,
        enumerable: !1,
        writable: !1,
        value: T
      }), Object.freeze && (Object.freeze(p.props), Object.freeze(p)), p;
    };
    function ur(e, r, n, b, T) {
      {
        var C, y = {}, p = null, D = null;
        n !== void 0 && (Oe(n), p = "" + n), or(r) && (Oe(r.key), p = "" + r.key), ar(r) && (D = r.ref, sr(r, T));
        for (C in r)
          ee.call(r, C) && !ir.hasOwnProperty(C) && (y[C] = r[C]);
        if (e && e.defaultProps) {
          var S = e.defaultProps;
          for (C in S)
            y[C] === void 0 && (y[C] = S[C]);
        }
        if (p || D) {
          var P = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
          p && dr(y, P), D && cr(y, P);
        }
        return lr(e, p, D, T, b, Z.current, y);
      }
    }
    var xe = u.ReactCurrentOwner, $e = u.ReactDebugCurrentFrame;
    function z(e) {
      if (e) {
        var r = e._owner, n = Q(e.type, e._source, r ? r.type : null);
        $e.setExtraStackFrame(n);
      } else
        $e.setExtraStackFrame(null);
    }
    var be;
    be = !1;
    function me(e) {
      return typeof e == "object" && e !== null && e.$$typeof === g;
    }
    function Fe() {
      {
        if (xe.current) {
          var e = O(xe.current.type);
          if (e)
            return `

Check the render method of \`` + e + "`.";
        }
        return "";
      }
    }
    function gr(e) {
      {
        if (e !== void 0) {
          var r = e.fileName.replace(/^.*[\\\/]/, ""), n = e.lineNumber;
          return `

Check your code at ` + r + ":" + n + ".";
        }
        return "";
      }
    }
    var Me = {};
    function fr(e) {
      {
        var r = Fe();
        if (!r) {
          var n = typeof e == "string" ? e : e.displayName || e.name;
          n && (r = `

Check the top-level render call using <` + n + ">.");
        }
        return r;
      }
    }
    function Ie(e, r) {
      {
        if (!e._store || e._store.validated || e.key != null)
          return;
        e._store.validated = !0;
        var n = fr(r);
        if (Me[n])
          return;
        Me[n] = !0;
        var b = "";
        e && e._owner && e._owner !== xe.current && (b = " It was passed a child from " + O(e._owner.type) + "."), z(e), a('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', n, b), z(null);
      }
    }
    function Ne(e, r) {
      {
        if (typeof e != "object")
          return;
        if (ge(e))
          for (var n = 0; n < e.length; n++) {
            var b = e[n];
            me(b) && Ie(b, r);
          }
        else if (me(e))
          e._store && (e._store.validated = !0);
        else if (e) {
          var T = E(e);
          if (typeof T == "function" && T !== e.entries)
            for (var C = T.call(e), y; !(y = C.next()).done; )
              me(y.value) && Ie(y.value, r);
        }
      }
    }
    function xr(e) {
      {
        var r = e.type;
        if (r == null || typeof r == "string")
          return;
        var n;
        if (typeof r == "function")
          n = r.propTypes;
        else if (typeof r == "object" && (r.$$typeof === c || // Note: Memo only checks outer props here.
        // Inner props are checked in the reconciler.
        r.$$typeof === f))
          n = r.propTypes;
        else
          return;
        if (n) {
          var b = O(r);
          er(n, e.props, "prop", b, e);
        } else if (r.PropTypes !== void 0 && !be) {
          be = !0;
          var T = O(r);
          a("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", T || "Unknown");
        }
        typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && a("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
      }
    }
    function br(e) {
      {
        for (var r = Object.keys(e.props), n = 0; n < r.length; n++) {
          var b = r[n];
          if (b !== "children" && b !== "key") {
            z(e), a("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", b), z(null);
            break;
          }
        }
        e.ref !== null && (z(e), a("Invalid attribute `ref` supplied to `React.Fragment`."), z(null));
      }
    }
    function We(e, r, n, b, T, C) {
      {
        var y = se(e);
        if (!y) {
          var p = "";
          (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (p += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
          var D = gr(T);
          D ? p += D : p += Fe();
          var S;
          e === null ? S = "null" : ge(e) ? S = "array" : e !== void 0 && e.$$typeof === g ? (S = "<" + (O(e.type) || "Unknown") + " />", p = " Did you accidentally export a JSX literal instead of a component?") : S = typeof e, a("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", S, p);
        }
        var P = ur(e, r, n, T, C);
        if (P == null)
          return P;
        if (y) {
          var F = r.children;
          if (F !== void 0)
            if (b)
              if (ge(F)) {
                for (var V = 0; V < F.length; V++)
                  Ne(F[V], e);
                Object.freeze && Object.freeze(F);
              } else
                a("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
            else
              Ne(F, e);
        }
        return e === i ? br(P) : xr(P), P;
      }
    }
    function mr(e, r, n) {
      return We(e, r, n, !0);
    }
    function hr(e, r, n) {
      return We(e, r, n, !1);
    }
    var vr = hr, pr = mr;
    q.Fragment = i, q.jsx = vr, q.jsxs = pr;
  }()), q;
}
(function(t) {
   false ? 0 : t.exports = wr();
})(Rr);
var _r = {
  jet: [{ index: 0, rgb: [0, 0, 131] }, { index: 0.125, rgb: [0, 60, 170] }, { index: 0.375, rgb: [5, 255, 255] }, { index: 0.625, rgb: [255, 255, 0] }, { index: 0.875, rgb: [250, 0, 0] }, { index: 1, rgb: [128, 0, 0] }],
  hsv: [{ index: 0, rgb: [255, 0, 0] }, { index: 0.169, rgb: [253, 255, 2] }, { index: 0.173, rgb: [247, 255, 2] }, { index: 0.337, rgb: [0, 252, 4] }, { index: 0.341, rgb: [0, 252, 10] }, { index: 0.506, rgb: [1, 249, 255] }, { index: 0.671, rgb: [2, 0, 253] }, { index: 0.675, rgb: [8, 0, 253] }, { index: 0.839, rgb: [255, 0, 251] }, { index: 0.843, rgb: [255, 0, 245] }, { index: 1, rgb: [255, 0, 6] }],
  hot: [{ index: 0, rgb: [0, 0, 0] }, { index: 0.3, rgb: [230, 0, 0] }, { index: 0.6, rgb: [255, 210, 0] }, { index: 1, rgb: [255, 255, 255] }],
  spring: [{ index: 0, rgb: [255, 0, 255] }, { index: 1, rgb: [255, 255, 0] }],
  summer: [{ index: 0, rgb: [0, 128, 102] }, { index: 1, rgb: [255, 255, 102] }],
  autumn: [{ index: 0, rgb: [255, 0, 0] }, { index: 1, rgb: [255, 255, 0] }],
  winter: [{ index: 0, rgb: [0, 0, 255] }, { index: 1, rgb: [0, 255, 128] }],
  bone: [{ index: 0, rgb: [0, 0, 0] }, { index: 0.376, rgb: [84, 84, 116] }, { index: 0.753, rgb: [169, 200, 200] }, { index: 1, rgb: [255, 255, 255] }],
  copper: [{ index: 0, rgb: [0, 0, 0] }, { index: 0.804, rgb: [255, 160, 102] }, { index: 1, rgb: [255, 199, 127] }],
  greys: [{ index: 0, rgb: [0, 0, 0] }, { index: 1, rgb: [255, 255, 255] }],
  yignbu: [{ index: 0, rgb: [8, 29, 88] }, { index: 0.125, rgb: [37, 52, 148] }, { index: 0.25, rgb: [34, 94, 168] }, { index: 0.375, rgb: [29, 145, 192] }, { index: 0.5, rgb: [65, 182, 196] }, { index: 0.625, rgb: [127, 205, 187] }, { index: 0.75, rgb: [199, 233, 180] }, { index: 0.875, rgb: [237, 248, 217] }, { index: 1, rgb: [255, 255, 217] }],
  greens: [{ index: 0, rgb: [0, 68, 27] }, { index: 0.125, rgb: [0, 109, 44] }, { index: 0.25, rgb: [35, 139, 69] }, { index: 0.375, rgb: [65, 171, 93] }, { index: 0.5, rgb: [116, 196, 118] }, { index: 0.625, rgb: [161, 217, 155] }, { index: 0.75, rgb: [199, 233, 192] }, { index: 0.875, rgb: [229, 245, 224] }, { index: 1, rgb: [247, 252, 245] }],
  yiorrd: [{ index: 0, rgb: [128, 0, 38] }, { index: 0.125, rgb: [189, 0, 38] }, { index: 0.25, rgb: [227, 26, 28] }, { index: 0.375, rgb: [252, 78, 42] }, { index: 0.5, rgb: [253, 141, 60] }, { index: 0.625, rgb: [254, 178, 76] }, { index: 0.75, rgb: [254, 217, 118] }, { index: 0.875, rgb: [255, 237, 160] }, { index: 1, rgb: [255, 255, 204] }],
  bluered: [{ index: 0, rgb: [0, 0, 255] }, { index: 1, rgb: [255, 0, 0] }],
  rdbu: [{ index: 0, rgb: [5, 10, 172] }, { index: 0.35, rgb: [106, 137, 247] }, { index: 0.5, rgb: [190, 190, 190] }, { index: 0.6, rgb: [220, 170, 132] }, { index: 0.7, rgb: [230, 145, 90] }, { index: 1, rgb: [178, 10, 28] }],
  picnic: [{ index: 0, rgb: [0, 0, 255] }, { index: 0.1, rgb: [51, 153, 255] }, { index: 0.2, rgb: [102, 204, 255] }, { index: 0.3, rgb: [153, 204, 255] }, { index: 0.4, rgb: [204, 204, 255] }, { index: 0.5, rgb: [255, 255, 255] }, { index: 0.6, rgb: [255, 204, 255] }, { index: 0.7, rgb: [255, 153, 255] }, { index: 0.8, rgb: [255, 102, 204] }, { index: 0.9, rgb: [255, 102, 102] }, { index: 1, rgb: [255, 0, 0] }],
  rainbow: [{ index: 0, rgb: [150, 0, 90] }, { index: 0.125, rgb: [0, 0, 200] }, { index: 0.25, rgb: [0, 25, 255] }, { index: 0.375, rgb: [0, 152, 255] }, { index: 0.5, rgb: [44, 255, 150] }, { index: 0.625, rgb: [151, 255, 0] }, { index: 0.75, rgb: [255, 234, 0] }, { index: 0.875, rgb: [255, 111, 0] }, { index: 1, rgb: [255, 0, 0] }],
  portland: [{ index: 0, rgb: [12, 51, 131] }, { index: 0.25, rgb: [10, 136, 186] }, { index: 0.5, rgb: [242, 211, 56] }, { index: 0.75, rgb: [242, 143, 56] }, { index: 1, rgb: [217, 30, 30] }],
  blackbody: [{ index: 0, rgb: [0, 0, 0] }, { index: 0.2, rgb: [230, 0, 0] }, { index: 0.4, rgb: [230, 210, 0] }, { index: 0.7, rgb: [255, 255, 255] }, { index: 1, rgb: [160, 200, 255] }],
  earth: [{ index: 0, rgb: [0, 0, 130] }, { index: 0.1, rgb: [0, 180, 180] }, { index: 0.2, rgb: [40, 210, 40] }, { index: 0.4, rgb: [230, 230, 50] }, { index: 0.6, rgb: [120, 70, 20] }, { index: 1, rgb: [255, 255, 255] }],
  electric: [{ index: 0, rgb: [0, 0, 0] }, { index: 0.15, rgb: [30, 0, 100] }, { index: 0.4, rgb: [120, 0, 100] }, { index: 0.6, rgb: [160, 90, 0] }, { index: 0.8, rgb: [230, 200, 0] }, { index: 1, rgb: [255, 250, 220] }],
  alpha: [{ index: 0, rgb: [255, 255, 255, 0] }, { index: 1, rgb: [255, 255, 255, 1] }],
  viridis: [{ index: 0, rgb: [68, 1, 84] }, { index: 0.13, rgb: [71, 44, 122] }, { index: 0.25, rgb: [59, 81, 139] }, { index: 0.38, rgb: [44, 113, 142] }, { index: 0.5, rgb: [33, 144, 141] }, { index: 0.63, rgb: [39, 173, 129] }, { index: 0.75, rgb: [92, 200, 99] }, { index: 0.88, rgb: [170, 220, 50] }, { index: 1, rgb: [253, 231, 37] }],
  inferno: [{ index: 0, rgb: [0, 0, 4] }, { index: 0.13, rgb: [31, 12, 72] }, { index: 0.25, rgb: [85, 15, 109] }, { index: 0.38, rgb: [136, 34, 106] }, { index: 0.5, rgb: [186, 54, 85] }, { index: 0.63, rgb: [227, 89, 51] }, { index: 0.75, rgb: [249, 140, 10] }, { index: 0.88, rgb: [249, 201, 50] }, { index: 1, rgb: [252, 255, 164] }],
  magma: [{ index: 0, rgb: [0, 0, 4] }, { index: 0.13, rgb: [28, 16, 68] }, { index: 0.25, rgb: [79, 18, 123] }, { index: 0.38, rgb: [129, 37, 129] }, { index: 0.5, rgb: [181, 54, 122] }, { index: 0.63, rgb: [229, 80, 100] }, { index: 0.75, rgb: [251, 135, 97] }, { index: 0.88, rgb: [254, 194, 135] }, { index: 1, rgb: [252, 253, 191] }],
  plasma: [{ index: 0, rgb: [13, 8, 135] }, { index: 0.13, rgb: [75, 3, 161] }, { index: 0.25, rgb: [125, 3, 168] }, { index: 0.38, rgb: [168, 34, 150] }, { index: 0.5, rgb: [203, 70, 121] }, { index: 0.63, rgb: [229, 107, 93] }, { index: 0.75, rgb: [248, 148, 65] }, { index: 0.88, rgb: [253, 195, 40] }, { index: 1, rgb: [240, 249, 33] }],
  warm: [{ index: 0, rgb: [125, 0, 179] }, { index: 0.13, rgb: [172, 0, 187] }, { index: 0.25, rgb: [219, 0, 170] }, { index: 0.38, rgb: [255, 0, 130] }, { index: 0.5, rgb: [255, 63, 74] }, { index: 0.63, rgb: [255, 123, 0] }, { index: 0.75, rgb: [234, 176, 0] }, { index: 0.88, rgb: [190, 228, 0] }, { index: 1, rgb: [147, 255, 0] }],
  cool: [{ index: 0, rgb: [125, 0, 179] }, { index: 0.13, rgb: [116, 0, 218] }, { index: 0.25, rgb: [98, 74, 237] }, { index: 0.38, rgb: [68, 146, 231] }, { index: 0.5, rgb: [0, 204, 197] }, { index: 0.63, rgb: [0, 247, 146] }, { index: 0.75, rgb: [0, 255, 88] }, { index: 0.88, rgb: [40, 255, 8] }, { index: 1, rgb: [147, 255, 0] }],
  "rainbow-soft": [{ index: 0, rgb: [125, 0, 179] }, { index: 0.1, rgb: [199, 0, 180] }, { index: 0.2, rgb: [255, 0, 121] }, { index: 0.3, rgb: [255, 108, 0] }, { index: 0.4, rgb: [222, 194, 0] }, { index: 0.5, rgb: [150, 255, 0] }, { index: 0.6, rgb: [0, 255, 55] }, { index: 0.7, rgb: [0, 246, 150] }, { index: 0.8, rgb: [50, 167, 222] }, { index: 0.9, rgb: [103, 51, 235] }, { index: 1, rgb: [124, 0, 186] }],
  bathymetry: [{ index: 0, rgb: [40, 26, 44] }, { index: 0.13, rgb: [59, 49, 90] }, { index: 0.25, rgb: [64, 76, 139] }, { index: 0.38, rgb: [63, 110, 151] }, { index: 0.5, rgb: [72, 142, 158] }, { index: 0.63, rgb: [85, 174, 163] }, { index: 0.75, rgb: [120, 206, 163] }, { index: 0.88, rgb: [187, 230, 172] }, { index: 1, rgb: [253, 254, 204] }],
  cdom: [{ index: 0, rgb: [47, 15, 62] }, { index: 0.13, rgb: [87, 23, 86] }, { index: 0.25, rgb: [130, 28, 99] }, { index: 0.38, rgb: [171, 41, 96] }, { index: 0.5, rgb: [206, 67, 86] }, { index: 0.63, rgb: [230, 106, 84] }, { index: 0.75, rgb: [242, 149, 103] }, { index: 0.88, rgb: [249, 193, 135] }, { index: 1, rgb: [254, 237, 176] }],
  chlorophyll: [{ index: 0, rgb: [18, 36, 20] }, { index: 0.13, rgb: [25, 63, 41] }, { index: 0.25, rgb: [24, 91, 59] }, { index: 0.38, rgb: [13, 119, 72] }, { index: 0.5, rgb: [18, 148, 80] }, { index: 0.63, rgb: [80, 173, 89] }, { index: 0.75, rgb: [132, 196, 122] }, { index: 0.88, rgb: [175, 221, 162] }, { index: 1, rgb: [215, 249, 208] }],
  density: [{ index: 0, rgb: [54, 14, 36] }, { index: 0.13, rgb: [89, 23, 80] }, { index: 0.25, rgb: [110, 45, 132] }, { index: 0.38, rgb: [120, 77, 178] }, { index: 0.5, rgb: [120, 113, 213] }, { index: 0.63, rgb: [115, 151, 228] }, { index: 0.75, rgb: [134, 185, 227] }, { index: 0.88, rgb: [177, 214, 227] }, { index: 1, rgb: [230, 241, 241] }],
  "freesurface-blue": [{ index: 0, rgb: [30, 4, 110] }, { index: 0.13, rgb: [47, 14, 176] }, { index: 0.25, rgb: [41, 45, 236] }, { index: 0.38, rgb: [25, 99, 212] }, { index: 0.5, rgb: [68, 131, 200] }, { index: 0.63, rgb: [114, 156, 197] }, { index: 0.75, rgb: [157, 181, 203] }, { index: 0.88, rgb: [200, 208, 216] }, { index: 1, rgb: [241, 237, 236] }],
  "freesurface-red": [{ index: 0, rgb: [60, 9, 18] }, { index: 0.13, rgb: [100, 17, 27] }, { index: 0.25, rgb: [142, 20, 29] }, { index: 0.38, rgb: [177, 43, 27] }, { index: 0.5, rgb: [192, 87, 63] }, { index: 0.63, rgb: [205, 125, 105] }, { index: 0.75, rgb: [216, 162, 148] }, { index: 0.88, rgb: [227, 199, 193] }, { index: 1, rgb: [241, 237, 236] }],
  oxygen: [{ index: 0, rgb: [64, 5, 5] }, { index: 0.13, rgb: [106, 6, 15] }, { index: 0.25, rgb: [144, 26, 7] }, { index: 0.38, rgb: [168, 64, 3] }, { index: 0.5, rgb: [188, 100, 4] }, { index: 0.63, rgb: [206, 136, 11] }, { index: 0.75, rgb: [220, 174, 25] }, { index: 0.88, rgb: [231, 215, 44] }, { index: 1, rgb: [248, 254, 105] }],
  par: [{ index: 0, rgb: [51, 20, 24] }, { index: 0.13, rgb: [90, 32, 35] }, { index: 0.25, rgb: [129, 44, 34] }, { index: 0.38, rgb: [159, 68, 25] }, { index: 0.5, rgb: [182, 99, 19] }, { index: 0.63, rgb: [199, 134, 22] }, { index: 0.75, rgb: [212, 171, 35] }, { index: 0.88, rgb: [221, 210, 54] }, { index: 1, rgb: [225, 253, 75] }],
  phase: [{ index: 0, rgb: [145, 105, 18] }, { index: 0.13, rgb: [184, 71, 38] }, { index: 0.25, rgb: [186, 58, 115] }, { index: 0.38, rgb: [160, 71, 185] }, { index: 0.5, rgb: [110, 97, 218] }, { index: 0.63, rgb: [50, 123, 164] }, { index: 0.75, rgb: [31, 131, 110] }, { index: 0.88, rgb: [77, 129, 34] }, { index: 1, rgb: [145, 105, 18] }],
  salinity: [{ index: 0, rgb: [42, 24, 108] }, { index: 0.13, rgb: [33, 50, 162] }, { index: 0.25, rgb: [15, 90, 145] }, { index: 0.38, rgb: [40, 118, 137] }, { index: 0.5, rgb: [59, 146, 135] }, { index: 0.63, rgb: [79, 175, 126] }, { index: 0.75, rgb: [120, 203, 104] }, { index: 0.88, rgb: [193, 221, 100] }, { index: 1, rgb: [253, 239, 154] }],
  temperature: [{ index: 0, rgb: [4, 35, 51] }, { index: 0.13, rgb: [23, 51, 122] }, { index: 0.25, rgb: [85, 59, 157] }, { index: 0.38, rgb: [129, 79, 143] }, { index: 0.5, rgb: [175, 95, 130] }, { index: 0.63, rgb: [222, 112, 101] }, { index: 0.75, rgb: [249, 146, 66] }, { index: 0.88, rgb: [249, 196, 65] }, { index: 1, rgb: [232, 250, 91] }],
  turbidity: [{ index: 0, rgb: [34, 31, 27] }, { index: 0.13, rgb: [65, 50, 41] }, { index: 0.25, rgb: [98, 69, 52] }, { index: 0.38, rgb: [131, 89, 57] }, { index: 0.5, rgb: [161, 112, 59] }, { index: 0.63, rgb: [185, 140, 66] }, { index: 0.75, rgb: [202, 174, 88] }, { index: 0.88, rgb: [216, 209, 126] }, { index: 1, rgb: [233, 246, 171] }],
  "velocity-blue": [{ index: 0, rgb: [17, 32, 64] }, { index: 0.13, rgb: [35, 52, 116] }, { index: 0.25, rgb: [29, 81, 156] }, { index: 0.38, rgb: [31, 113, 162] }, { index: 0.5, rgb: [50, 144, 169] }, { index: 0.63, rgb: [87, 173, 176] }, { index: 0.75, rgb: [149, 196, 189] }, { index: 0.88, rgb: [203, 221, 211] }, { index: 1, rgb: [254, 251, 230] }],
  "velocity-green": [{ index: 0, rgb: [23, 35, 19] }, { index: 0.13, rgb: [24, 64, 38] }, { index: 0.25, rgb: [11, 95, 45] }, { index: 0.38, rgb: [39, 123, 35] }, { index: 0.5, rgb: [95, 146, 12] }, { index: 0.63, rgb: [152, 165, 18] }, { index: 0.75, rgb: [201, 186, 69] }, { index: 0.88, rgb: [233, 216, 137] }, { index: 1, rgb: [255, 253, 205] }],
  cubehelix: [{ index: 0, rgb: [0, 0, 0] }, { index: 0.07, rgb: [22, 5, 59] }, { index: 0.13, rgb: [60, 4, 105] }, { index: 0.2, rgb: [109, 1, 135] }, { index: 0.27, rgb: [161, 0, 147] }, { index: 0.33, rgb: [210, 2, 142] }, { index: 0.4, rgb: [251, 11, 123] }, { index: 0.47, rgb: [255, 29, 97] }, { index: 0.53, rgb: [255, 54, 69] }, { index: 0.6, rgb: [255, 85, 46] }, { index: 0.67, rgb: [255, 120, 34] }, { index: 0.73, rgb: [255, 157, 37] }, { index: 0.8, rgb: [241, 191, 57] }, { index: 0.87, rgb: [224, 220, 93] }, { index: 0.93, rgb: [218, 241, 142] }, { index: 1, rgb: [227, 253, 198] }]
};
function Cr(t, g, m) {
  return t * (1 - m) + g * m;
}
var jr = Cr, Ve = _r, ne = jr, Sr = Pr;
function Pr(t) {
  var g, m, i, R, v, h, x, c, l, s, d;
  if (t || (t = {}), c = (t.nshades || 72) - 1, x = t.format || "hex", h = t.colormap, h || (h = "jet"), typeof h == "string") {
    if (h = h.toLowerCase(), !Ve[h])
      throw Error(h + " not a supported colorscale");
    v = Ve[h];
  } else if (Array.isArray(h))
    v = h.slice();
  else
    throw Error("unsupported colormap option", h);
  if (v.length > c + 1)
    throw new Error(
      h + " map requires nshades to be at least size " + v.length
    );
  Array.isArray(t.alpha) ? t.alpha.length !== 2 ? s = [1, 1] : s = t.alpha.slice() : typeof t.alpha == "number" ? s = [t.alpha, t.alpha] : s = [1, 1], g = v.map(function(j) {
    return Math.round(j.index * c);
  }), s[0] = Math.min(Math.max(s[0], 0), 1), s[1] = Math.min(Math.max(s[1], 0), 1);
  var f = v.map(function(j, E) {
    var u = v[E].index, a = v[E].rgb.slice();
    return a.length === 4 && a[3] >= 0 && a[3] <= 1 || (a[3] = s[0] + (s[1] - s[0]) * u), a;
  }), l = [];
  for (d = 0; d < g.length - 1; ++d) {
    R = g[d + 1] - g[d], m = f[d], i = f[d + 1];
    for (var w = 0; w < R; w++) {
      var _ = w / R;
      l.push([
        Math.round(ne(m[0], i[0], _)),
        Math.round(ne(m[1], i[1], _)),
        Math.round(ne(m[2], i[2], _)),
        ne(m[3], i[3], _)
      ]);
    }
  }
  return l.push(v[v.length - 1].rgb.concat(s[1])), x === "hex" ? l = l.map(Or) : x === "rgbaString" ? l = l.map(Dr) : x === "float" && (l = l.map(kr)), l;
}
function kr(t) {
  return [
    t[0] / 255,
    t[1] / 255,
    t[2] / 255,
    t[3]
  ];
}
function Or(t) {
  for (var g, m = "#", i = 0; i < 3; ++i)
    g = t[i], g = g.toString(16), m += ("00" + g).substr(g.length);
  return m;
}
function Dr(t) {
  return "rgba(" + t.join(",") + ")";
}
const Be = (0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)({ dark: !1 });
function pe() {
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(Be);
}
function Ar(t) {
  const { children: g, dark: m } = t;
  return /* @__PURE__ */ o.jsx(Be.Provider, { value: { dark: m }, children: g });
}
const Ze = (0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)({ duration: 1, currentTime: 0, playbackRate: 1, mode: "page", setDuration: () => {
}, setCurrentTime: () => {
}, setPlaybackRate: () => {
}, pause: () => {
} });
function ie() {
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(Ze);
}
const $r = 10;
function Fr(t) {
  const { children: g, src: m } = t, i = !!t.settings, [R, v] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(1), [h, x] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0), [c, s] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(1), [d, f] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)("page"), l = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null), [w, _] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1), { dark: j } = pe(), E = j ? "dark" : "light";
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    l.current !== null && (l.current.duration && v(l.current.duration), setInterval(function() {
      l.current && l.current.currentTime && x(l.current.currentTime);
    }, $r));
  }, [l.current]);
  const u = (k) => {
    l.current !== null && l.current.duration && v(l.current.duration);
  }, a = (k) => {
    l.current !== null && x(l.current.currentTime);
  }, A = (k) => {
    l.current !== null && l.current.duration && L(l.current.playbackRate);
  }, $ = (k) => {
    l.current !== null && (l.current.currentTime = k), x(k);
  }, L = (k) => {
    l.current !== null && (l.current.playbackRate = k), s(k);
  }, B = () => {
    l.current !== null && l.current.pause();
  };
  return /* @__PURE__ */ o.jsxs(Ze.Provider, { value: { duration: R, currentTime: h, playbackRate: c, mode: d, setDuration: v, setCurrentTime: $, setPlaybackRate: L, pause: B }, children: [
    g,
    /* @__PURE__ */ o.jsxs("div", { style: { display: "flex", flexDirection: "column", alignItems: "stretch", gap: 5, marginTop: 5 }, children: [
      /* @__PURE__ */ o.jsxs("div", { style: { width: "100%", display: "flex", flexDirection: "row", alignItems: "stretch", gap: 5 }, children: [
        /* @__PURE__ */ o.jsx("audio", { ref: l, controls: !0, style: { width: "100%" }, onTimeUpdate: a, onDurationChange: u, onRateChange: A, controlsList: "nodownload", children: /* @__PURE__ */ o.jsx("source", { src: m }) }),
        i && /* @__PURE__ */ o.jsx("button", { className: E, onClick: () => {
          _(!w);
        }, children: "Settings" })
      ] }),
      i && w && /* @__PURE__ */ o.jsxs("div", { style: { display: "grid", flexDirection: "row", fontFamily: "monospace", gridTemplateColumns: "1fr 3fr", columnGap: 5, rowGap: 5 }, children: [
        /* @__PURE__ */ o.jsx("div", { className: `gridcell header ${E}`, children: "Playback Speed" }),
        /* @__PURE__ */ o.jsx("div", { style: { display: "flex", flexDirection: "row", gap: 5 }, children: /* @__PURE__ */ o.jsxs("div", { className: `slidecontainer ${E}`, children: [
          /* @__PURE__ */ o.jsx("div", { className: `slidervalue ${E}`, children: `${c.toFixed(1)}x` }),
          /* @__PURE__ */ o.jsx("input", { type: "range", min: "0.1", max: "2.0", value: c, className: `slider ${E}`, id: "myRange", step: "0.1", onChange: (k) => {
            L(Number(k.target.value));
          } })
        ] }) }),
        /* @__PURE__ */ o.jsx("div", { className: `gridcell header ${E}`, children: "Playhead Mode" }),
        /* @__PURE__ */ o.jsxs("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr 1fr 1fr", gridTemplateRows: "1fr" }, children: [
          /* @__PURE__ */ o.jsx("div", { className: `gridcell ${E} ${d === "page" && "selected"}`, onClick: () => {
            f("page");
          }, children: "Page" }),
          /* @__PURE__ */ o.jsx("div", { className: `gridcell ${E} ${d === "stop" && "selected"}`, onClick: () => {
            f("stop");
          }, children: "Stop" }),
          /* @__PURE__ */ o.jsx("div", { className: `gridcell ${E} ${d === "loop" && "selected"}`, onClick: () => {
            f("loop");
          }, children: "Loop" }),
          /* @__PURE__ */ o.jsx("div", { className: `gridcell ${E} ${d === "continue" && "selected"}`, onClick: () => {
            f("continue");
          }, children: "Continue" })
        ] })
      ] })
    ] })
  ] });
}
const Ge = (0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)({ startTime: 0, endTime: 1, zoomedDuration: 1, isZoomed: !1, setStartTime: () => {
}, setEndTime: () => {
}, setCenterTime: () => {
}, zoomIn: () => {
}, zoomOut: () => {
} });
function ae() {
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(Ge);
}
function Mr(t) {
  const { children: g } = t, { duration: m, currentTime: i, mode: R, pause: v, setCurrentTime: h } = ie(), [x, c] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0), [s, d] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(m), f = s - x, l = (u) => {
    c(u - f / 2), d(u + f / 2);
  };
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    c(0), d(m);
  }, [m]), (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    if (R === "stop") {
      if (i >= s && i <= s + 0.1)
        v(), h(x);
      else if (i > s + 0.1) {
        const u = s, a = s + f;
        c(u), d(a);
      } else if (i < x - 0.1) {
        const u = x - f, a = x;
        c(u), d(a);
      }
    } else if (R === "loop") {
      if (i >= s && i <= s + 0.1)
        h(x);
      else if (i > s + 0.1) {
        const u = s, a = s + f;
        c(u), d(a);
      } else if (i < x - 0.1) {
        const u = x - f, a = x;
        c(u), d(a);
      }
    } else if (R === "page") {
      if (i >= s && i <= s + 0.1)
        j();
      else if (i > s + 0.1) {
        const u = s, a = s + f;
        c(u), d(a);
      } else if (i < x - 0.1) {
        const u = x - f, a = x;
        c(u), d(a);
      }
    }
  }, [i, R]);
  const w = () => {
    const u = Math.max(0, x + 0.2 * f), a = Math.min(m, s - 0.2 * f);
    c(u), d(a), h(u);
  }, _ = () => {
    const u = Math.max(0, x - 0.3333333333333333 * f), a = Math.min(m, s + 1 / 3 * f);
    c(u), d(a), h(u);
  }, j = () => {
    const u = Math.min(m, s + f), a = Math.max(0, u - f);
    c(a), d(u);
  }, E = x > 0 || s < m;
  return /* @__PURE__ */ o.jsx(Ge.Provider, { value: { startTime: x, endTime: s, zoomedDuration: f, isZoomed: E, setStartTime: c, setEndTime: d, setCenterTime: l, zoomIn: w, zoomOut: _ }, children: g });
}
function Ir(t) {
  const { children: g, height: m } = t, { duration: i, setCurrentTime: R } = ie(), v = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null), { startTime: h, endTime: x } = ae(), c = (s) => {
    var f;
    const d = (f = v.current) == null ? void 0 : f.getBoundingClientRect();
    if (d) {
      const { left: l, right: w } = d;
      let _ = h + (x - h) * (s.clientX - l) / (w - l);
      _ < 0 && (_ = 0), _ > i && (_ = i), R(_);
    }
  };
  return /* @__PURE__ */ o.jsx("svg", { ref: v, width: "100%", height: m, viewBox: `${h},0,${x - h},100`, cursor: "pointer", preserveAspectRatio: "none", onClick: c, children: g });
}
const Nr = 0.01;
function Wr(t) {
  const { children: g, height: m } = t, { duration: i, setCurrentTime: R } = ie(), { startTime: v, endTime: h, zoomedDuration: x, isZoomed: c, setStartTime: s, setEndTime: d, zoomIn: f, zoomOut: l, setCenterTime: w } = ae(), _ = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null), [j, E] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null), [u, a] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null), { dark: A } = pe(), $ = A ? "dark" : "light", L = !c && j && u, B = c && j, k = (U) => {
    var O;
    const N = (O = _.current) == null ? void 0 : O.getBoundingClientRect();
    if (N) {
      const { left: I, right: Y } = N;
      return i * (U.clientX - I) / (Y - I);
    }
    return null;
  }, oe = (U) => {
    E(k(U));
  }, J = (U) => {
    const N = k(U);
    if (a(N), N && B) {
      const O = Math.min(Math.max(x / 2, N), i - x / 2);
      w(O), R(O - x / 2);
    }
  }, se = (U) => {
    L && (u - j >= Nr ? (s(j), d(u), R(j)) : (s(0), d(i), R(0))), E(null), a(null);
  };
  return /* @__PURE__ */ o.jsxs("div", { style: { display: "flex", flexDirection: "row", gap: 5 }, children: [
    /* @__PURE__ */ o.jsx("button", { className: $, onClick: l, children: "Zoom Out" }),
    /* @__PURE__ */ o.jsxs("svg", { ref: _, width: "100%", height: m, viewBox: `0,0,${i},100`, cursor: c ? "grabbing" : "zoom-in", preserveAspectRatio: "none", onPointerDown: oe, onPointerUp: se, onPointerMove: J, children: [
      g,
      /* @__PURE__ */ o.jsx("rect", { x: 0, width: v, y: "0", height: "100", style: { fill: "white", opacity: 0.5 } }),
      /* @__PURE__ */ o.jsx("rect", { x: h, width: i - h, y: "0", height: "100", style: { fill: "white", opacity: 0.5 } }),
      L && u > j && /* @__PURE__ */ o.jsx("rect", { x: j, width: u - j, y: "0", height: "100", style: { fill: "red", opacity: 0.5 } })
    ] }),
    /* @__PURE__ */ o.jsx("button", { className: $, style: { fontFamily: "monospace" }, onClick: f, children: "Zoom In" })
  ] });
}
function Lr(t) {
  const { dataURL: g } = t, m = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null), { duration: i, currentTime: R } = ie(), { zoomedDuration: v } = ae();
  return /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
    /* @__PURE__ */ o.jsx(
      "image",
      {
        width: i,
        height: 100,
        x: 0,
        y: 0,
        href: g,
        preserveAspectRatio: "none",
        pointerEvents: "none"
      }
    ),
    /* @__PURE__ */ o.jsx(
      "line",
      {
        ref: m,
        stroke: "red",
        strokeWidth: 5e-3 * v,
        x1: R,
        x2: R,
        y1: 0,
        y2: 100
      }
    )
  ] });
}
const Ur = 20, Yr = 1;
function zr(t) {
  const { title: g, data: m } = t, i = t.height ? t.height : Ur, R = t.strokeWidth ? t.strokeWidth : Yr, v = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null), [h, x] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0);
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect)(() => {
    function u() {
      v.current && x(v.current.clientWidth);
    }
    u(), window.addEventListener("resize", u), setInterval(u, 500);
  }, []);
  const { startTime: c, endTime: s } = ae(), d = s - c, f = h !== 0 ? d / h * i : 0, { dark: l } = pe(), w = l ? "white" : "black", _ = f * 0.67, j = 1e-3 * R * d, E = f * 0.67;
  return /* @__PURE__ */ o.jsxs(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [
    /* @__PURE__ */ o.jsx("div", { style: { textAlign: "left", fontFamily: "monospace", color: w }, children: g }),
    /* @__PURE__ */ o.jsx("svg", { ref: v, width: "100%", height: i, viewBox: `${c},0,${d},${f}`, preserveAspectRatio: "none", children: m.map((u) => {
      const a = Number(u[0]), A = Number(u[1]), $ = String(u[2]);
      return /* @__PURE__ */ o.jsxs(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [
        /* @__PURE__ */ o.jsx("line", { stroke: w, strokeWidth: j, x1: a, x2: a, y1: 0, y2: f }),
        /* @__PURE__ */ o.jsxs("text", { fill: w, x: a, y: E, fontSize: _, fontFamily: "monospace", children: [
          " ",
          $
        ] }),
        /* @__PURE__ */ o.jsx("line", { stroke: w, strokeWidth: j, x1: A, x2: A, y1: 0, y2: f })
      ] }, a);
    }) })
  ] });
}
function Vr(t) {
  var g = t.map(function(i) {
    return Math.max.apply(Math, i);
  }), m = Math.max.apply(null, g);
  return m;
}
function Hr(t) {
  var g = t.map(function(i) {
    return Math.min.apply(Math, i);
  }), m = Math.min.apply(null, g);
  return m;
}
function Br(t) {
  const { sxx: g, annotations: m, specHeight: i, navigator: R, colormap: v, transparent: h } = t, x = t.navHeight ? t.navHeight : 0, c = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null), [s, d] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(""), f = Sr({
    colormap: v,
    nshades: 256,
    format: "rgba",
    alpha: 255
  });
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    if (c.current) {
      const w = c.current.getContext("2d");
      if (w) {
        const _ = Vr(g), j = Hr(g);
        if (typeof _ < "u" && typeof j < "u") {
          let E = new ImageData(g[0].length, g.length);
          for (let u = g.length - 1; u >= 0; u--)
            for (let a = 0; a < g[0].length; a++) {
              const A = Math.floor(255 * (g[u][a] - j) / (_ - j)), $ = ((g.length - u) * g[0].length + a) * 4;
              E.data[$] = f[A][0], E.data[$ + 1] = f[A][1], E.data[$ + 2] = f[A][2], E.data[$ + 3] = h ? A : 255;
            }
          w.putImageData(E, 0, 0), d(c.current.toDataURL());
        }
      }
    }
  }, [g, c, v, h]);
  const l = /* @__PURE__ */ o.jsx(Lr, { dataURL: s });
  return /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
    /* @__PURE__ */ o.jsx("canvas", { hidden: !0, ref: c, height: g.length, width: g[0].length }),
    /* @__PURE__ */ o.jsx(Mr, { children: /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
      /* @__PURE__ */ o.jsx(Ir, { height: i, children: l }),
      react__WEBPACK_IMPORTED_MODULE_0__.Children.toArray(
        m == null ? void 0 : m.map(({ title: w, data: _, height: j, strokeWidth: E }) => /* @__PURE__ */ o.jsx(zr, { title: w, height: j, data: _, strokeWidth: E }))
      ),
      R && /* @__PURE__ */ o.jsx(Wr, { height: x, children: l })
    ] }) })
  ] });
}
const Gr = (t) => {
  const { sxx: g, src: m } = t, i = t.specHeight ? t.specHeight : 200, R = t.navHeight ? t.navHeight : 50, v = !!t.navigator, h = !!t.settings, x = t.colormap ? t.colormap : "viridis", c = !!t.transparent, s = !!t.dark, d = t.annotations ? t.annotations : [];
  return /* @__PURE__ */ o.jsx("div", { style: { width: "100%" }, children: /* @__PURE__ */ o.jsx(Ar, { dark: s, children: /* @__PURE__ */ o.jsx(Fr, { src: m, settings: h, children: /* @__PURE__ */ o.jsx(
    Br,
    {
      sxx: g,
      annotations: d,
      specHeight: i,
      navHeight: R,
      colormap: x,
      transparent: c,
      navigator: v
    }
  ) }) }) });
};



/***/ })

}]);
//# sourceMappingURL=vendors-node_modules_react-audio-spectrogram-player_dist_react-audio-spectrogram-player_es_js.a74b02492f6a0f9f8992.js.map