{"size": 938, "ext": "js", "max_stars_repo_path": "modules/theme_inspector_common/js/progress-bar.js", "max_stars_repo_name": "Chi-teck/theme-inspector", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "modules/theme_inspector_common/js/progress-bar.js", "max_issues_repo_name": "Chi-teck/theme-inspector", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "modules/theme_inspector_common/js/progress-bar.js", "max_forks_repo_name": "Chi-teck/theme-inspector", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 32.3448275862, "max_line_length": 100, "alphanum_fraction": 0.6375266525}
((behaviors, once) => {

  'use strict';

  Drupal.behaviors.themeInspectorCommonProgressBar = {
    attach (context, settings) {
      const progressBarWrapper = once('ti-progress-bar', '[data-ti-progress-bar]', context).shift();
      if (!progressBarWrapper) {
        return;
      }

      const timeout = settings.themeInspector.progressBarTimeout;
      function updateCallback(progress, status, pb) {
        if (progress < 100) {
          let newProgress = Math.min(100, progress + Math.ceil(10 * Math.random()));
          let message = Math.random().toString(36).substr(2, 5);
          setTimeout(() => pb.setProgress(newProgress, message), timeout);
        }
      }

      const progressBar = new Drupal.ProgressBar('ti-progress-bar-demo', updateCallback);
      progressBar.setProgress(-1, 'Initial message', 'Example');
      progressBarWrapper.append(progressBar.element.get(0));

    }
  };

}) (Drupal, window.once);
