<commit_before>/*
 * Angular bootstrapping
 */
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { decorateModuleRef } from './app/environment';
import { ApplicationRef } from '@angular/core';
import { bootloader } from '@angularclass/hmr';
/*
 * App Module
 * our top level module that holds all of our components
 */
import { AppModule } from './app';

// install service worker
const runtime = require('offline-plugin/runtime');

runtime.install({
  onUpdating: () => {
    console.log('SW Event:', 'onUpdating');
  },
  onUpdateReady: () => {
    console.log('SW Event:', 'onUpdateReady');
    // Tells to new SW to take control immediately
    runtime.applyUpdate();
  },
  onUpdated: () => {
    console.log('SW Event:', 'onUpdated');
    // Reload the webpage to load into the new version
    if (window.confirm(
      'Meditation+ has been updated to the new version. ' +
      'Would you like to refresh the page to apply the update now?'
    )) {
      window.location.href = '/updated';
    }
  },

  onUpdateFailed: () => {<commit_msg>feat(main.browser): adds information about app update (#258)<commit_after>/*
 * Angular bootstrapping
 */
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { decorateModuleRef } from './app/environment';
import { ApplicationRef } from '@angular/core';
import { bootloader } from '@angularclass/hmr';
/*
 * App Module
 * our top level module that holds all of our components
 */
import { AppModule } from './app';

// install service worker
const runtime = require('offline-plugin/runtime');

runtime.install({
  onUpdating: () => {
    console.log('SW Event:', 'onUpdating');
    let toolbar = document.querySelectorAll('md-toolbar-row>span.fill');
    if (toolbar.length > 0) {
      (<any>toolbar[1]).innerText = 'Downloading App Update...';
    }
  },
  onUpdateReady: () => {
    console.log('SW Event:', 'onUpdateReady');
    // Tells to new SW to take control immediately
    runtime.applyUpdate();
  },
  onUpdated: () => {
    console.log('SW Event:', 'onUpdated');
    let toolbar = document.querySelectorAll('md-toolbar-row>span.fill');
    if (toolbar.length > 0) {
      (<any>toolbar[1]).innerText = 'Downloaded App Update';
    }
    // Reload the webpage to load into the new version
    if (window.confirm(
      'Meditation+ has been updated to the new version. ' +
      'Would you like to refresh the page to apply the update now?'
    )) {
      window.location.href = '/updated';
    }
  },

  onUpdateFailed: () => {
{'fraction_non_alphanumeric': 0.14739317914543315, 'fraction_numerical': 0.0027440219521756176, 'mean_word_length': 3.407599309153713, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4850732', 'n_tokens_mistral': 748, 'n_tokens_neox': 733, 'n_words': 220}