/* PWP register */
( function() {
const PwpSwVersion = 'pwp-c3770c6c';
importScripts('https://www.iiht.com/wp-content/plugins/progressive-wp/assets/workbox-v3.4.1/workbox-sw.js');if(workbox){workbox.precaching.precache(["https:\/\/www.iiht.com","","https:\/\/www.iiht.com\/contact-us\/"]);workbox.routing.registerRoute(/wp-admin(.*)|(.*)preview=true(.*)/,workbox.strategies.networkOnly());workbox.routing.registerRoute(/(.*)fonts\.googleapis\.com(.*)/,workbox.strategies.staleWhileRevalidate({cacheName:PwpSwVersion+'-google-fonts'}));workbox.routing.registerRoute(/(.*)fonts\.gstatic\.com(.*)/,workbox.strategies.cacheFirst({cacheName:PwpSwVersion+'-google-fonts'}));workbox.routing.registerRoute(/(.*)secure\.gravatar\.com(.*)/,workbox.strategies.staleWhileRevalidate({cacheName:PwpSwVersion+'-gravatar'}));workbox.routing.registerRoute(new RegExp('https://www.iiht.com.*\.(woff|eot|woff2|ttf|svg)'),workbox.strategies.cacheFirst({cacheName:PwpSwVersion+'-fonts'}));workbox.routing.registerRoute(new RegExp('https://www.iiht.com.*\.(png|jpg|jpeg|gif|ico)'),workbox.strategies.cacheFirst({cacheName:PwpSwVersion+'-images'}));workbox.routing.registerRoute(new RegExp('https://www.iiht.com.*\.(css|js)'),workbox.strategies.staleWhileRevalidate({cacheName:PwpSwVersion+'-static'}));workbox.routing.registerRoute(new RegExp('https://www.iiht.com.*'),async(args)=>{try{const response=await workbox.strategies.networkFirst({cacheName:PwpSwVersion+'-default'}).handle(args);return response||await caches.match('https://www.iiht.com/contact-us/')}catch(error){console.log('catch:',error);return await caches.match('https://www.iiht.com/contact-us/')}})}
self.addEventListener('activate',(event)=>{event.waitUntil(caches.keys().then(keys=>{return Promise.all(keys.map(key=>{if(/^(workbox-precache)/.test(key)){}else if(/^(pwp-([a-zA-Z0-9]{8})-([a-z]*))/.test(key)){if(key.indexOf(PwpSwVersion)!==0){return caches.delete(key)}}}))}))})
} )();