"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 */ Hr)
/* 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 s = {}, Rr = {
  get exports() {
    return s;
  },
  set exports(n) {
    s = n;
  }
}, Z = {};
/**
 * @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 Le;
function Tr() {
  if (Le)
    return Z;
  Le = 1;
  var n = (react__WEBPACK_IMPORTED_MODULE_0___default()), c = Symbol.for("react.element"), b = Symbol.for("react.fragment"), o = Object.prototype.hasOwnProperty, R = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, p = { key: !0, ref: !0, __self: !0, __source: !0 };
  function m(l, u, a) {
    var d, g = {}, i = null, _ = null;
    a !== void 0 && (i = "" + a), u.key !== void 0 && (i = "" + u.key), u.ref !== void 0 && (_ = u.ref);
    for (d in u)
      o.call(u, d) && !p.hasOwnProperty(d) && (g[d] = u[d]);
    if (l && l.defaultProps)
      for (d in u = l.defaultProps, u)
        g[d] === void 0 && (g[d] = u[d]);
    return { $$typeof: c, type: l, key: i, ref: _, props: g, _owner: R.current };
  }
  return Z.Fragment = b, Z.jsx = m, Z.jsxs = m, Z;
}
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 Ue;
function Er() {
  return Ue || (Ue = 1,  true && function() {
    var n = (react__WEBPACK_IMPORTED_MODULE_0___default()), c = Symbol.for("react.element"), b = Symbol.for("react.portal"), o = Symbol.for("react.fragment"), R = Symbol.for("react.strict_mode"), p = Symbol.for("react.profiler"), m = Symbol.for("react.provider"), l = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), a = Symbol.for("react.suspense"), d = Symbol.for("react.suspense_list"), g = Symbol.for("react.memo"), i = Symbol.for("react.lazy"), _ = Symbol.for("react.offscreen"), w = Symbol.iterator, j = "@@iterator";
    function S(e) {
      if (e === null || typeof e != "object")
        return null;
      var r = w && e[w] || e[j];
      return typeof r == "function" ? r : null;
    }
    var h = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
    function f(e) {
      {
        for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), x = 1; x < r; x++)
          t[x - 1] = arguments[x];
        M("error", e, t);
      }
    }
    function M(e, r, t) {
      {
        var x = h.ReactDebugCurrentFrame, T = x.getStackAddendum();
        T !== "" && (r += "%s", t = t.concat([T]));
        var E = t.map(function(y) {
          return String(y);
        });
        E.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, E);
      }
    }
    var F = !1, A = !1, I = !1, k = !1, oe = !1, J;
    J = Symbol.for("react.module.reference");
    function se(e) {
      return !!(typeof e == "string" || typeof e == "function" || e === o || e === p || oe || e === R || e === a || e === d || k || e === _ || F || A || I || typeof e == "object" && e !== null && (e.$$typeof === i || e.$$typeof === g || e.$$typeof === m || e.$$typeof === l || e.$$typeof === u || // 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 Y(e, r, t) {
      var x = e.displayName;
      if (x)
        return x;
      var T = r.displayName || r.name || "";
      return T !== "" ? t + "(" + T + ")" : t;
    }
    function L(e) {
      return e.displayName || "Context";
    }
    function O(e) {
      if (e == null)
        return null;
      if (typeof e.tag == "number" && f("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 o:
          return "Fragment";
        case b:
          return "Portal";
        case p:
          return "Profiler";
        case R:
          return "StrictMode";
        case a:
          return "Suspense";
        case d:
          return "SuspenseList";
      }
      if (typeof e == "object")
        switch (e.$$typeof) {
          case l:
            var r = e;
            return L(r) + ".Consumer";
          case m:
            var t = e;
            return L(t._context) + ".Provider";
          case u:
            return Y(e, e.render, "ForwardRef");
          case g:
            var x = e.displayName || null;
            return x !== null ? x : O(e.type) || "Memo";
          case i: {
            var T = e, E = T._payload, y = T._init;
            try {
              return O(y(E));
            } catch {
              return null;
            }
          }
        }
      return null;
    }
    var W = Object.assign, z = 0, de, pe, ye, Re, Te, Ee, we;
    function _e() {
    }
    _e.__reactDisabledLog = !0;
    function Ge() {
      {
        if (z === 0) {
          de = console.log, pe = console.info, ye = console.warn, Re = console.error, Te = console.group, Ee = console.groupCollapsed, we = console.groupEnd;
          var e = {
            configurable: !0,
            enumerable: !0,
            value: _e,
            writable: !0
          };
          Object.defineProperties(console, {
            info: e,
            log: e,
            warn: e,
            error: e,
            group: e,
            groupCollapsed: e,
            groupEnd: e
          });
        }
        z++;
      }
    }
    function Je() {
      {
        if (z--, z === 0) {
          var e = {
            configurable: !0,
            enumerable: !0,
            writable: !0
          };
          Object.defineProperties(console, {
            log: W({}, e, {
              value: de
            }),
            info: W({}, e, {
              value: pe
            }),
            warn: W({}, e, {
              value: ye
            }),
            error: W({}, e, {
              value: Re
            }),
            group: W({}, e, {
              value: Te
            }),
            groupCollapsed: W({}, e, {
              value: Ee
            }),
            groupEnd: W({}, e, {
              value: we
            })
          });
        }
        z < 0 && f("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
      }
    }
    var ce = h.ReactCurrentDispatcher, le;
    function K(e, r, t) {
      {
        if (le === void 0)
          try {
            throw Error();
          } catch (T) {
            var x = T.stack.trim().match(/\n( *(at )?)/);
            le = x && x[1] || "";
          }
        return `
` + le + e;
      }
    }
    var ue = !1, X;
    {
      var Ke = typeof WeakMap == "function" ? WeakMap : Map;
      X = new Ke();
    }
    function Se(e, r) {
      if (!e || ue)
        return "";
      {
        var t = X.get(e);
        if (t !== void 0)
          return t;
      }
      var x;
      ue = !0;
      var T = Error.prepareStackTrace;
      Error.prepareStackTrace = void 0;
      var E;
      E = ce.current, ce.current = null, Ge();
      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 (U) {
              x = U;
            }
            Reflect.construct(e, [], y);
          } else {
            try {
              y.call();
            } catch (U) {
              x = U;
            }
            e.call(y.prototype);
          }
        } else {
          try {
            throw Error();
          } catch (U) {
            x = U;
          }
          e();
        }
      } catch (U) {
        if (U && x && typeof U.stack == "string") {
          for (var v = U.stack.split(`
`), D = x.stack.split(`
`), C = v.length - 1, P = D.length - 1; C >= 1 && P >= 0 && v[C] !== D[P]; )
            P--;
          for (; C >= 1 && P >= 0; C--, P--)
            if (v[C] !== D[P]) {
              if (C !== 1 || P !== 1)
                do
                  if (C--, P--, P < 0 || v[C] !== D[P]) {
                    var $ = `
` + v[C].replace(" at new ", " at ");
                    return e.displayName && $.includes("<anonymous>") && ($ = $.replace("<anonymous>", e.displayName)), typeof e == "function" && X.set(e, $), $;
                  }
                while (C >= 1 && P >= 0);
              break;
            }
        }
      } finally {
        ue = !1, ce.current = E, Je(), Error.prepareStackTrace = T;
      }
      var B = e ? e.displayName || e.name : "", Ne = B ? K(B) : "";
      return typeof e == "function" && X.set(e, Ne), Ne;
    }
    function Xe(e, r, t) {
      return Se(e, !1);
    }
    function Qe(e) {
      var r = e.prototype;
      return !!(r && r.isReactComponent);
    }
    function Q(e, r, t) {
      if (e == null)
        return "";
      if (typeof e == "function")
        return Se(e, Qe(e));
      if (typeof e == "string")
        return K(e);
      switch (e) {
        case a:
          return K("Suspense");
        case d:
          return K("SuspenseList");
      }
      if (typeof e == "object")
        switch (e.$$typeof) {
          case u:
            return Xe(e.render);
          case g:
            return Q(e.type, r, t);
          case i: {
            var x = e, T = x._payload, E = x._init;
            try {
              return Q(E(T), r, t);
            } catch {
            }
          }
        }
      return "";
    }
    var ee = Object.prototype.hasOwnProperty, Ce = {}, je = h.ReactDebugCurrentFrame;
    function re(e) {
      if (e) {
        var r = e._owner, t = Q(e.type, e._source, r ? r.type : null);
        je.setExtraStackFrame(t);
      } else
        je.setExtraStackFrame(null);
    }
    function er(e, r, t, x, T) {
      {
        var E = Function.call.bind(ee);
        for (var y in e)
          if (E(e, y)) {
            var v = void 0;
            try {
              if (typeof e[y] != "function") {
                var D = Error((x || "React class") + ": " + t + " 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;
              }
              v = e[y](r, y, x, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
            } catch (C) {
              v = C;
            }
            v && !(v instanceof Error) && (re(T), f("%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).", x || "React class", t, y, typeof v), re(null)), v instanceof Error && !(v.message in Ce) && (Ce[v.message] = !0, re(T), f("Failed %s type: %s", t, v.message), re(null));
          }
      }
    }
    var rr = Array.isArray;
    function ge(e) {
      return rr(e);
    }
    function nr(e) {
      {
        var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
        return t;
      }
    }
    function tr(e) {
      try {
        return ke(e), !1;
      } catch {
        return !0;
      }
    }
    function ke(e) {
      return "" + e;
    }
    function Pe(e) {
      if (tr(e))
        return f("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 H = h.ReactCurrentOwner, ir = {
      key: !0,
      ref: !0,
      __self: !0,
      __source: !0
    }, Oe, De, 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" && H.current && r && H.current.stateNode !== r) {
        var t = O(H.current.type);
        fe[t] || (f('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(H.current.type), e.ref), fe[t] = !0);
      }
    }
    function dr(e, r) {
      {
        var t = function() {
          Oe || (Oe = !0, f("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
        };
        t.isReactWarning = !0, Object.defineProperty(e, "key", {
          get: t,
          configurable: !0
        });
      }
    }
    function cr(e, r) {
      {
        var t = function() {
          De || (De = !0, f("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
        };
        t.isReactWarning = !0, Object.defineProperty(e, "ref", {
          get: t,
          configurable: !0
        });
      }
    }
    var lr = function(e, r, t, x, T, E, y) {
      var v = {
        // This tag allows us to uniquely identify this as a React Element
        $$typeof: c,
        // Built-in properties that belong on the element
        type: e,
        key: r,
        ref: t,
        props: y,
        // Record the component responsible for creating this element.
        _owner: E
      };
      return v._store = {}, Object.defineProperty(v._store, "validated", {
        configurable: !1,
        enumerable: !1,
        writable: !0,
        value: !1
      }), Object.defineProperty(v, "_self", {
        configurable: !1,
        enumerable: !1,
        writable: !1,
        value: x
      }), Object.defineProperty(v, "_source", {
        configurable: !1,
        enumerable: !1,
        writable: !1,
        value: T
      }), Object.freeze && (Object.freeze(v.props), Object.freeze(v)), v;
    };
    function ur(e, r, t, x, T) {
      {
        var E, y = {}, v = null, D = null;
        t !== void 0 && (Pe(t), v = "" + t), or(r) && (Pe(r.key), v = "" + r.key), ar(r) && (D = r.ref, sr(r, T));
        for (E in r)
          ee.call(r, E) && !ir.hasOwnProperty(E) && (y[E] = r[E]);
        if (e && e.defaultProps) {
          var C = e.defaultProps;
          for (E in C)
            y[E] === void 0 && (y[E] = C[E]);
        }
        if (v || D) {
          var P = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
          v && dr(y, P), D && cr(y, P);
        }
        return lr(e, v, D, T, x, H.current, y);
      }
    }
    var xe = h.ReactCurrentOwner, Ae = h.ReactDebugCurrentFrame;
    function V(e) {
      if (e) {
        var r = e._owner, t = Q(e.type, e._source, r ? r.type : null);
        Ae.setExtraStackFrame(t);
      } else
        Ae.setExtraStackFrame(null);
    }
    var be;
    be = !1;
    function me(e) {
      return typeof e == "object" && e !== null && e.$$typeof === c;
    }
    function $e() {
      {
        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(/^.*[\\\/]/, ""), t = e.lineNumber;
          return `

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

Check the top-level render call using <` + t + ">.");
        }
        return r;
      }
    }
    function Fe(e, r) {
      {
        if (!e._store || e._store.validated || e.key != null)
          return;
        e._store.validated = !0;
        var t = fr(r);
        if (Me[t])
          return;
        Me[t] = !0;
        var x = "";
        e && e._owner && e._owner !== xe.current && (x = " It was passed a child from " + O(e._owner.type) + "."), V(e), f('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, x), V(null);
      }
    }
    function Ie(e, r) {
      {
        if (typeof e != "object")
          return;
        if (ge(e))
          for (var t = 0; t < e.length; t++) {
            var x = e[t];
            me(x) && Fe(x, r);
          }
        else if (me(e))
          e._store && (e._store.validated = !0);
        else if (e) {
          var T = S(e);
          if (typeof T == "function" && T !== e.entries)
            for (var E = T.call(e), y; !(y = E.next()).done; )
              me(y.value) && Fe(y.value, r);
        }
      }
    }
    function xr(e) {
      {
        var r = e.type;
        if (r == null || typeof r == "string")
          return;
        var t;
        if (typeof r == "function")
          t = r.propTypes;
        else if (typeof r == "object" && (r.$$typeof === u || // Note: Memo only checks outer props here.
        // Inner props are checked in the reconciler.
        r.$$typeof === g))
          t = r.propTypes;
        else
          return;
        if (t) {
          var x = O(r);
          er(t, e.props, "prop", x, e);
        } else if (r.PropTypes !== void 0 && !be) {
          be = !0;
          var T = O(r);
          f("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", T || "Unknown");
        }
        typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && f("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), t = 0; t < r.length; t++) {
          var x = r[t];
          if (x !== "children" && x !== "key") {
            V(e), f("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", x), V(null);
            break;
          }
        }
        e.ref !== null && (V(e), f("Invalid attribute `ref` supplied to `React.Fragment`."), V(null));
      }
    }
    function We(e, r, t, x, T, E) {
      {
        var y = se(e);
        if (!y) {
          var v = "";
          (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (v += " 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 ? v += D : v += $e();
          var C;
          e === null ? C = "null" : ge(e) ? C = "array" : e !== void 0 && e.$$typeof === c ? (C = "<" + (O(e.type) || "Unknown") + " />", v = " Did you accidentally export a JSX literal instead of a component?") : C = typeof e, f("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", C, v);
        }
        var P = ur(e, r, t, T, E);
        if (P == null)
          return P;
        if (y) {
          var $ = r.children;
          if ($ !== void 0)
            if (x)
              if (ge($)) {
                for (var B = 0; B < $.length; B++)
                  Ie($[B], e);
                Object.freeze && Object.freeze($);
              } else
                f("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
              Ie($, e);
        }
        return e === o ? br(P) : xr(P), P;
      }
    }
    function mr(e, r, t) {
      return We(e, r, t, !0);
    }
    function hr(e, r, t) {
      return We(e, r, t, !1);
    }
    var vr = hr, pr = mr;
    q.Fragment = o, q.jsx = vr, q.jsxs = pr;
  }()), q;
}
(function(n) {
   false ? 0 : n.exports = Er();
})(Rr);
var wr = {
  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 _r(n, c, b) {
  return n * (1 - b) + c * b;
}
var Sr = _r, Ye = wr, ne = Sr, Cr = jr;
function jr(n) {
  var c, b, o, R, p, m, l, u, i, a, d;
  if (n || (n = {}), u = (n.nshades || 72) - 1, l = n.format || "hex", m = n.colormap, m || (m = "jet"), typeof m == "string") {
    if (m = m.toLowerCase(), !Ye[m])
      throw Error(m + " not a supported colorscale");
    p = Ye[m];
  } else if (Array.isArray(m))
    p = m.slice();
  else
    throw Error("unsupported colormap option", m);
  if (p.length > u + 1)
    throw new Error(
      m + " map requires nshades to be at least size " + p.length
    );
  Array.isArray(n.alpha) ? n.alpha.length !== 2 ? a = [1, 1] : a = n.alpha.slice() : typeof n.alpha == "number" ? a = [n.alpha, n.alpha] : a = [1, 1], c = p.map(function(j) {
    return Math.round(j.index * u);
  }), a[0] = Math.min(Math.max(a[0], 0), 1), a[1] = Math.min(Math.max(a[1], 0), 1);
  var g = p.map(function(j, S) {
    var h = p[S].index, f = p[S].rgb.slice();
    return f.length === 4 && f[3] >= 0 && f[3] <= 1 || (f[3] = a[0] + (a[1] - a[0]) * h), f;
  }), i = [];
  for (d = 0; d < c.length - 1; ++d) {
    R = c[d + 1] - c[d], b = g[d], o = g[d + 1];
    for (var _ = 0; _ < R; _++) {
      var w = _ / R;
      i.push([
        Math.round(ne(b[0], o[0], w)),
        Math.round(ne(b[1], o[1], w)),
        Math.round(ne(b[2], o[2], w)),
        ne(b[3], o[3], w)
      ]);
    }
  }
  return i.push(p[p.length - 1].rgb.concat(a[1])), l === "hex" ? i = i.map(Pr) : l === "rgbaString" ? i = i.map(Or) : l === "float" && (i = i.map(kr)), i;
}
function kr(n) {
  return [
    n[0] / 255,
    n[1] / 255,
    n[2] / 255,
    n[3]
  ];
}
function Pr(n) {
  for (var c, b = "#", o = 0; o < 3; ++o)
    c = n[o], c = c.toString(16), b += ("00" + c).substr(c.length);
  return b;
}
function Or(n) {
  return "rgba(" + n.join(",") + ")";
}
const Be = (0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)({ dark: !1 });
function He() {
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(Be);
}
function Dr(n) {
  const { children: c, dark: b } = n;
  return /* @__PURE__ */ s.jsx(Be.Provider, { value: { dark: b }, children: c });
}
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 Ar = 10;
function $r(n) {
  const { children: c, src: b } = n, o = !!n.settings, [R, p] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(1), [m, l] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0), [u, a] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(1), [d, g] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)("page"), i = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null), [_, w] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1), { dark: j } = He(), S = j ? "dark" : "light";
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    i.current !== null && (i.current.duration && p(i.current.duration), setInterval(function() {
      i.current && i.current.currentTime && l(i.current.currentTime);
    }, Ar));
  }, [i.current]);
  const h = (k) => {
    i.current !== null && i.current.duration && p(i.current.duration);
  }, f = (k) => {
    i.current !== null && l(i.current.currentTime);
  }, M = (k) => {
    i.current !== null && i.current.duration && A(i.current.playbackRate);
  }, F = (k) => {
    i.current !== null && (i.current.currentTime = k), l(k);
  }, A = (k) => {
    i.current !== null && (i.current.playbackRate = k), a(k);
  }, I = () => {
    i.current !== null && i.current.pause();
  };
  return /* @__PURE__ */ s.jsxs(Ze.Provider, { value: { duration: R, currentTime: m, playbackRate: u, mode: d, setDuration: p, setCurrentTime: F, setPlaybackRate: A, pause: I }, children: [
    c,
    /* @__PURE__ */ s.jsxs("div", { style: { display: "flex", flexDirection: "column", alignItems: "stretch", gap: 5, marginTop: 5 }, children: [
      /* @__PURE__ */ s.jsxs("div", { style: { width: "100%", display: "flex", flexDirection: "row", alignItems: "stretch", gap: 5 }, children: [
        /* @__PURE__ */ s.jsx("audio", { ref: i, controls: !0, style: { width: "100%" }, onTimeUpdate: f, onDurationChange: h, onRateChange: M, controlsList: "nodownload", children: /* @__PURE__ */ s.jsx("source", { src: b }) }),
        o && /* @__PURE__ */ s.jsx("button", { className: S, onClick: () => {
          w(!_);
        }, children: "Settings" })
      ] }),
      o && _ && /* @__PURE__ */ s.jsxs("div", { style: { display: "grid", flexDirection: "row", fontFamily: "monospace", gridTemplateColumns: "1fr 3fr", columnGap: 5, rowGap: 5 }, children: [
        /* @__PURE__ */ s.jsx("div", { className: `gridcell header ${S}`, children: "Playback Speed" }),
        /* @__PURE__ */ s.jsx("div", { style: { display: "flex", flexDirection: "row", gap: 5 }, children: /* @__PURE__ */ s.jsxs("div", { className: `slidecontainer ${S}`, children: [
          /* @__PURE__ */ s.jsx("div", { className: `slidervalue ${S}`, children: `${u.toFixed(1)}x` }),
          /* @__PURE__ */ s.jsx("input", { type: "range", min: "0.1", max: "2.0", value: u, className: `slider ${S}`, id: "myRange", step: "0.1", onChange: (k) => {
            A(Number(k.target.value));
          } })
        ] }) }),
        /* @__PURE__ */ s.jsx("div", { className: `gridcell header ${S}`, children: "Playhead Mode" }),
        /* @__PURE__ */ s.jsxs("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr 1fr 1fr", gridTemplateRows: "1fr" }, children: [
          /* @__PURE__ */ s.jsx("div", { className: `gridcell ${S} ${d === "page" && "selected"}`, onClick: () => {
            g("page");
          }, children: "Page" }),
          /* @__PURE__ */ s.jsx("div", { className: `gridcell ${S} ${d === "stop" && "selected"}`, onClick: () => {
            g("stop");
          }, children: "Stop" }),
          /* @__PURE__ */ s.jsx("div", { className: `gridcell ${S} ${d === "loop" && "selected"}`, onClick: () => {
            g("loop");
          }, children: "Loop" }),
          /* @__PURE__ */ s.jsx("div", { className: `gridcell ${S} ${d === "continue" && "selected"}`, onClick: () => {
            g("continue");
          }, children: "Continue" })
        ] })
      ] })
    ] })
  ] });
}
const qe = (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)(qe);
}
function Mr(n) {
  const { children: c } = n, { duration: b, currentTime: o, mode: R, pause: p, setCurrentTime: m } = ie(), [l, u] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0), [a, d] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(b), g = a - l, i = (h) => {
    u(h - g / 2), d(h + g / 2);
  };
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    u(0), d(b);
  }, [b]), (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    if (R === "stop") {
      if (o >= a && o <= a + 0.1)
        p(), m(l);
      else if (o > a + 0.1) {
        const h = a, f = a + g;
        u(h), d(f);
      } else if (o < l - 0.1) {
        const h = l - g, f = l;
        u(h), d(f);
      }
    } else if (R === "loop") {
      if (o >= a && o <= a + 0.1)
        m(l);
      else if (o > a + 0.1) {
        const h = a, f = a + g;
        u(h), d(f);
      } else if (o < l - 0.1) {
        const h = l - g, f = l;
        u(h), d(f);
      }
    } else if (R === "page") {
      if (o >= a && o <= a + 0.1)
        j();
      else if (o > a + 0.1) {
        const h = a, f = a + g;
        u(h), d(f);
      } else if (o < l - 0.1) {
        const h = l - g, f = l;
        u(h), d(f);
      }
    }
  }, [o, R]);
  const _ = () => {
    const h = Math.max(0, l + 0.2 * g), f = Math.min(b, a - 0.2 * g);
    u(h), d(f), m(h);
  }, w = () => {
    const h = Math.max(0, l - 0.3333333333333333 * g), f = Math.min(b, a + 1 / 3 * g);
    u(h), d(f), m(h);
  }, j = () => {
    const h = Math.min(b, a + g), f = Math.max(0, h - g);
    u(f), d(h);
  }, S = l > 0 || a < b;
  return /* @__PURE__ */ s.jsx(qe.Provider, { value: { startTime: l, endTime: a, zoomedDuration: g, isZoomed: S, setStartTime: u, setEndTime: d, setCenterTime: i, zoomIn: _, zoomOut: w }, children: c });
}
function Fr(n) {
  const { children: c, height: b } = n, { duration: o, setCurrentTime: R } = ie(), p = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null), { startTime: m, endTime: l } = ae(), u = (a) => {
    var g;
    const d = (g = p.current) == null ? void 0 : g.getBoundingClientRect();
    if (d) {
      const { left: i, right: _ } = d;
      let w = m + (l - m) * (a.clientX - i) / (_ - i);
      w < 0 && (w = 0), w > o && (w = o), R(w);
    }
  };
  return /* @__PURE__ */ s.jsx("svg", { ref: p, width: "100%", height: b, viewBox: `${m},0,${l - m},100`, cursor: "pointer", preserveAspectRatio: "none", onClick: u, children: c });
}
const Ir = 0.01;
function Wr(n) {
  const { children: c, height: b } = n, { duration: o, setCurrentTime: R } = ie(), { startTime: p, endTime: m, zoomedDuration: l, isZoomed: u, setStartTime: a, setEndTime: d, zoomIn: g, zoomOut: i, setCenterTime: _ } = ae(), w = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null), [j, S] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null), [h, f] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null), { dark: M } = He(), F = M ? "dark" : "light", A = !u && j && h, I = u && j, k = (Y) => {
    var O;
    const L = (O = w.current) == null ? void 0 : O.getBoundingClientRect();
    if (L) {
      const { left: W, right: z } = L;
      return o * (Y.clientX - W) / (z - W);
    }
    return null;
  }, oe = (Y) => {
    S(k(Y));
  }, J = (Y) => {
    const L = k(Y);
    if (f(L), L && I) {
      const O = Math.min(Math.max(l / 2, L), o - l / 2);
      _(O), R(O - l / 2);
    }
  }, se = (Y) => {
    A && (h - j >= Ir ? (a(j), d(h), R(j)) : (a(0), d(o), R(0))), S(null), f(null);
  };
  return /* @__PURE__ */ s.jsxs("div", { style: { display: "flex", flexDirection: "row", gap: 5 }, children: [
    /* @__PURE__ */ s.jsx("button", { className: F, onClick: i, children: "Zoom Out" }),
    /* @__PURE__ */ s.jsxs("svg", { ref: w, width: "100%", height: b, viewBox: `0,0,${o},100`, cursor: u ? "grabbing" : "zoom-in", preserveAspectRatio: "none", onPointerDown: oe, onPointerUp: se, onPointerMove: J, children: [
      c,
      /* @__PURE__ */ s.jsx("rect", { x: 0, width: p, y: "0", height: "100", style: { fill: "white", opacity: 0.5 } }),
      /* @__PURE__ */ s.jsx("rect", { x: m, width: o - m, y: "0", height: "100", style: { fill: "white", opacity: 0.5 } }),
      A && h > j && /* @__PURE__ */ s.jsx("rect", { x: j, width: h - j, y: "0", height: "100", style: { fill: "red", opacity: 0.5 } })
    ] }),
    /* @__PURE__ */ s.jsx("button", { className: F, style: { fontFamily: "monospace" }, onClick: g, children: "Zoom In" })
  ] });
}
function Nr(n) {
  const { dataURL: c } = n, b = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null), { duration: o, currentTime: R } = ie(), { zoomedDuration: p } = ae();
  return /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
    /* @__PURE__ */ s.jsx(
      "image",
      {
        width: o,
        height: 100,
        x: 0,
        y: 0,
        href: c,
        preserveAspectRatio: "none",
        pointerEvents: "none"
      }
    ),
    /* @__PURE__ */ s.jsx(
      "line",
      {
        ref: b,
        stroke: "red",
        strokeWidth: 5e-3 * p,
        x1: R,
        x2: R,
        y1: 0,
        y2: 100
      }
    )
  ] });
}
const Lr = 0.03, Ur = 1;
function ze(n) {
  const { annotations: c } = n, b = n.aspectRatio ? n.aspectRatio : Lr, o = n.strokeWidth ? n.strokeWidth : Ur, { startTime: R, endTime: p } = ae(), m = p - R, l = b * m, u = 1e-3 * o * m, a = 0.6 * b * m, d = l - a / 2;
  return /* @__PURE__ */ s.jsx("svg", { width: "100%", viewBox: `${R},0,${m},${l}`, preserveAspectRatio: "none", children: c.map((g) => {
    const i = Number(g[0]), _ = Number(g[1]), w = g[2];
    return /* @__PURE__ */ s.jsxs(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [
      /* @__PURE__ */ s.jsx("line", { stroke: "black", strokeWidth: u, x1: i, x2: i, y1: 0, y2: l }),
      /* @__PURE__ */ s.jsxs("text", { fill: "black", x: i, y: d, fontSize: a, children: [
        " ",
        w
      ] }),
      /* @__PURE__ */ s.jsx("line", { stroke: "black", strokeWidth: u, x1: _, x2: _, y1: 0, y2: l })
    ] }, i);
  }) });
}
function Yr(n) {
  var c = n.map(function(o) {
    return Math.max.apply(Math, o);
  }), b = Math.max.apply(null, c);
  return b;
}
function zr(n) {
  var c = n.map(function(o) {
    return Math.min.apply(Math, o);
  }), b = Math.min.apply(null, c);
  return b;
}
function Vr(n) {
  const { sxx: c, annotations: b, annotations2: o, specHeight: R, navigator: p, colormap: m, transparent: l } = n, u = n.annotationStrokeWidth ? n.annotationStrokeWidth : void 0, a = n.annotationAspectRatio ? n.annotationAspectRatio : void 0, d = n.navHeight ? n.navHeight : 0, g = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null), [i, _] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(""), w = Cr({
    colormap: m,
    nshades: 256,
    format: "rgba",
    alpha: 255
  });
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    if (g.current) {
      const S = g.current.getContext("2d");
      if (S) {
        const h = Yr(c), f = zr(c);
        if (typeof h < "u" && typeof f < "u") {
          let M = new ImageData(c[0].length, c.length);
          for (let F = c.length - 1; F >= 0; F--)
            for (let A = 0; A < c[0].length; A++) {
              const I = Math.floor(255 * (c[F][A] - f) / (h - f)), k = ((c.length - F) * c[0].length + A) * 4;
              M.data[k] = w[I][0], M.data[k + 1] = w[I][1], M.data[k + 2] = w[I][2], M.data[k + 3] = l ? I : 255;
            }
          S.putImageData(M, 0, 0), _(g.current.toDataURL());
        }
      }
    }
  }, [c, g, m, l]);
  const j = /* @__PURE__ */ s.jsx(Nr, { dataURL: i });
  return /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
    /* @__PURE__ */ s.jsx("canvas", { hidden: !0, ref: g, height: c.length, width: c[0].length }),
    /* @__PURE__ */ s.jsx(Mr, { children: /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
      /* @__PURE__ */ s.jsx(Fr, { height: R, children: j }),
      b && /* @__PURE__ */ s.jsx(ze, { annotations: b, strokeWidth: u, aspectRatio: a }),
      o && /* @__PURE__ */ s.jsx(ze, { annotations: o, strokeWidth: u, aspectRatio: a }),
      p && /* @__PURE__ */ s.jsx(Wr, { height: d, children: j })
    ] }) })
  ] });
}
const Hr = (n) => {
  const { sxx: c, src: b, specHeight: o, navHeight: R } = n, p = !!n.navigator, m = !!n.settings, l = n.colormap ? n.colormap : "viridis", u = !!n.transparent, a = !!n.dark, d = n.annotations ? n.annotations : null, g = n.annotations2 ? n.annotations2 : null, i = n.annotationStrokeWidth ? n.annotationStrokeWidth : void 0, _ = n.annotationAspectRatio ? n.annotationAspectRatio : void 0;
  return /* @__PURE__ */ s.jsx("div", { style: { width: "100%" }, children: /* @__PURE__ */ s.jsx(Dr, { dark: a, children: /* @__PURE__ */ s.jsx($r, { src: b, settings: m, children: /* @__PURE__ */ s.jsx(
    Vr,
    {
      sxx: c,
      annotations: d,
      annotations2: g,
      specHeight: o,
      navHeight: R,
      colormap: l,
      transparent: u,
      navigator: p,
      annotationStrokeWidth: i,
      annotationAspectRatio: _
    }
  ) }) }) });
};



/***/ })

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