importScripts("_static/jszip.js");var t,s=registration.scope,n=function(){var t=s.split("/"),n=t.length-1;return"readonlydocs-"+t[n-2]+"-"+t[n-1]}(),e=""+s+n+".zip";function i(){return t||(t=caches.open(n)),t}function r(t){var n=new URL(t.url);return n.hash||n.search?(n.hash="",n.search="",new Request(n.toString())):t}function a(t){var n=Object.values(t.files);return console.log("Installing",n.length,"files from zip"),Promise.all(n.map(o))}function o(a){return a.dir?Promise.resolve():a.async("blob").then(function(r){return i().then(function(t){var n=new Response(r,{headers:{"Content-Type":f(a.name)}}),e=u(a.name,"/");console.log("-> Caching",a.name);var i=s+a.name;return"index.html"===e?Promise.all([t.put(s+c(a.name,"/"),n.clone()),t.put(i,n)]):t.put(i,n)})})}function c(t,n){return t.substring(0,t.lastIndexOf(n)+1)}function u(t,n){return t.substring(t.lastIndexOf(n)+1)}function f(t){return p[u(t,".")]||l}addEventListener("install",function(t){return t.waitUntil(caches.delete(n).then(function(){return fetch(e)}).then(function(t){return 200===t.status?t.arrayBuffer():Promise.reject(new Error(t.statusText))}).then(JSZip.loadAsync).then(a).then(self.skipWaiting()))}),addEventListener("activate",function(t){return t.waitUntil(self.clients.claim())}),addEventListener("fetch",function(n){return n.respondWith(i().then(function(t){return t.match(r(n.request))}).then(function(t){return t||fetch(n.request)}))});var l="application/octet-stream",p={html:"text/html",css:"text/css",js:"application/javascript",txt:"text/plain",jpg:"image/jpeg",png:"image/png",gif:"image/gif",svg:"image/svg+xml",ttf:"application/x-font-ttf",eot:"application/vnd.ms-fontobject",woff:"application/font-woff",woff2:"application/font-woff2"};