typeofworkbox<"u"?(workbox.setConfig({debug:!1}),workbox.routing.registerRoute(({request:e})=>["image","style","script"].includes(e.destination),newworkbox.strategies.CacheFirst({cacheName:"static-resources",plugins:[newworkbox.expiration.ExpirationPlugin({maxEntries:50,maxAgeSeconds:720*60*60})]})),workbox.routing.registerRoute(/^https?.*/,newworkbox.strategies.NetworkFirst({cacheName:"http-calls",plugins:[newworkbox.expiration.ExpirationPlugin({maxEntries:50,maxAgeSeconds:720*60*60})]}))):console.warn("Workbox not loaded, PWA caching features disabled");self.addEventListener("install",e=>{console.log("[SW] Installing...")});self.addEventListener("activate",e=>{console.log("[SW] Activating...")});self.addEventListener("fetch",e=>{e.respondWith(fetch(e.request))});self.addEventListener("message",e=>{e.data&&e.data.type==="SKIP_WAITING"&&(console.log("[SW] Received SKIP_WAITING message"),self.skipWaiting())});self.addEventListener("push",e=>{varn;if(!e.data)return;lett={};try{t=e.data.json()}catch(o){console.error("Push event JSON parse error",o);return}consti={body:t.body||"You have a new message!",icon:t.icon||"/pwa-icon-512.png",badge:t.badge||"/pwa-icon-36.png",vibrate:[100,50,100],data:{url:((n=t.data)==null?void0:n.url)||"home",dateOfArrival:Date.now(),primaryKey:1}};e.waitUntil(self.registration.showNotification(t.title||"Notification",i))});self.addEventListener("notificationclick",e=>{vari;e.notification.close();constt=((i=e.notification.data)==null?void0:i.url)||"home";e.waitUntil((async()=>{constn=awaitclients.matchAll({type:"window",includeUncontrolled:!0});leto="https://nuxt.newinsta.ir";for(constaofn){if(a.url===t&&"focus"ina)returna.focus();o=newURL(a.url).origin}if(clients.openWindow)returnclients.openWindow(`${o}/${t}`)})())});