{"version":3,"sources":["webpack:///./node_modules/register-service-worker/index.js"],"names":["__webpack_require__","d","__webpack_exports__","register","isLocalhost","Boolean","window","location","hostname","match","swUrl","hooks","emit","hook","args","len","arguments","length","apply","navigator","addEventListener","checkValidServiceWorker","serviceWorker","ready","then","registration","registerValidSW","waiting","onupdatefound","installingWorker","installing","onstatechange","state","controller","catch","error","fetch","response","status","headers","get","indexOf","Error","unregister","onLine"],"mappings":"6HAAAA,EAAAC,EAAAC,EAAA,sBAAAC,IAOA,IAAAC,EAAA,WAA+B,OAAAC,QAC/B,cAAAC,OAAAC,SAAAC,UAEA,UAAAF,OAAAC,SAAAC,UAEAF,OAAAC,SAAAC,SAAAC,MACA,4DAIO,SAAAN,EAAAO,EAAAC,GACP,IAAAC,EAAA,SAAAC,GACA,IAAAC,KAAAC,EAAAC,UAAAC,OAAA,EACA,MAAAF,KAAA,EAAAD,EAAAC,GAAAC,UAAAD,EAAA,GAEAJ,KAAAE,IACAF,EAAAE,GAAAK,MAAAP,EAAAG,IAIA,kBAAAK,WACAb,OAAAc,iBAAA,kBACAhB,KAEAiB,EAAAX,EAAAE,GACAO,UAAAG,cAAAC,MAAAC,KAAA,SAAAC,GACAb,EAAA,QAAAa,MAIAC,EAAAhB,EAAAE,KAMA,SAAAc,EAAAhB,EAAAE,GACAO,UAAAG,cACAnB,SAAAO,GACAc,KAAA,SAAAC,GACAb,EAAA,aAAAa,GACAA,EAAAE,QACAf,EAAA,UAAAa,GAGAA,EAAAG,cAAA,WACAhB,EAAA,cAAAa,GACA,IAAAI,EAAAJ,EAAAK,WACAD,EAAAE,cAAA,WACA,cAAAF,EAAAG,QACAb,UAAAG,cAAAW,WAKArB,EAAA,UAAAa,GAKAb,EAAA,SAAAa,QAMAS,MAAA,SAAAC,GACAvB,EAAA,QAAAuB,KAIA,SAAAd,EAAAX,EAAAE,GAEAwB,MAAA1B,GACAc,KAAA,SAAAa,GAGA,MAAAA,EAAAC,SACA,IAAAD,EAAAE,QAAAC,IAAA,gBAAAC,QAAA,eAGA7B,EAAA,YAAA8B,MAAA,+BAAAhC,IACAiC,KAGAjB,EAAAhB,EAAAE,KAGAsB,MAAA,SAAAC,GACAhB,UAAAyB,OAGAhC,EAAA,QAAAuB,GAFAvB,EAAA,aAOO,SAAA+B,IACP,kBAAAxB,WACAA,UAAAG,cAAAC,MAAAC,KAAA,SAAAC,GACAA,EAAAkB","file":"app/js/npm.register-service-worker.3f3c045a.js","sourcesContent":["// Register a service worker to serve assets from local cache.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on the \"N+1\" visit to a page, since previously\n// cached resources are updated in the background.\n\nvar isLocalhost = function () { return Boolean(\n window.location.hostname === 'localhost' ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === '[::1]' ||\n // 127.0.0.1/8 is considered localhost for IPv4.\n window.location.hostname.match(\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\n )\n); }\n\nexport function register (swUrl, hooks) {\n var emit = function (hook) {\n var args = [], len = arguments.length - 1;\n while ( len-- > 0 ) args[ len ] = arguments[ len + 1 ];\n\n if (hooks && hooks[hook]) {\n hooks[hook].apply(hooks, args)\n }\n }\n\n if ('serviceWorker' in navigator) {\n window.addEventListener('load', function () {\n if (isLocalhost()) {\n // This is running on localhost. Lets check if a service worker still exists or not.\n checkValidServiceWorker(swUrl, emit)\n navigator.serviceWorker.ready.then(function (registration) {\n emit('ready', registration)\n })\n } else {\n // Is not local host. Just register service worker\n registerValidSW(swUrl, emit)\n }\n })\n }\n}\n\nfunction registerValidSW (swUrl, emit) {\n navigator.serviceWorker\n .register(swUrl)\n .then(function (registration) {\n emit('registered', registration)\n if (registration.waiting) {\n emit('updated', registration)\n return\n }\n registration.onupdatefound = function () {\n emit('updatefound', registration)\n var installingWorker = registration.installing\n installingWorker.onstatechange = function () {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the old content will have been purged and\n // the fresh content will have been added to the cache.\n // It's the perfect time to display a \"New content is\n // available; please refresh.\" message in your web app.\n emit('updated', registration)\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n emit('cached', registration)\n }\n }\n }\n }\n })\n .catch(function (error) {\n emit('error', error)\n })\n}\n\nfunction checkValidServiceWorker (swUrl, emit) {\n // Check if the service worker can be found.\n fetch(swUrl)\n .then(function (response) {\n // Ensure service worker exists, and that we really are getting a JS file.\n if (\n response.status === 404 ||\n response.headers.get('content-type').indexOf('javascript') === -1\n ) {\n // No service worker found.\n emit('error', new Error((\"Service worker not found at \" + swUrl)))\n unregister()\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl, emit)\n }\n })\n .catch(function (error) {\n if (!navigator.onLine) {\n emit('offline')\n } else {\n emit('error', error)\n }\n })\n}\n\nexport function unregister () {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready.then(function (registration) {\n registration.unregister()\n })\n }\n}\n"],"sourceRoot":""}