text: /**
   * Copyright © INOVUA TRADING.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   */
  function throttle(func, wait, options = {}) {
      let context;
      let args;
      let result;
      let timeout = null;
      let previous = 0;
      const later = function () {
          previous = options.leading === false ? 0 : Date.now();
          timeout = null;
          result = func.apply(context, args);
          if (!timeout) {
              context = null;
              args = null;
          }
      };
      return function () {
          const now = Date.now();
          if (!previous && options.leading === false) {
              previous = now;
          }
          const remaining = wait - (now - previous);
          context = this;
          args = arguments;
          if (remaining <= 0 || remaining > wait) {
              if (timeout) {
                  clearTimeout(timeout);
                  timeout = null;
              }
              previous = now;
              result = func.apply(context, args);
              if (!timeout)
                  context = args = null;
          }
          else if (!timeout && options.trailing !== false) {
              timeout = setTimeout(later, remaining);
          }
          return result;
      };
  }
  export default throttle;
  