text: import{j as g,B as m,N as p,R as v,a as u,b as w,r as y,v as N,n as R,c as b,d as L}from"./vendor.5d9f2585.js";const x=function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const t of document.querySelectorAll('link[rel="modulepreload"]'))s(t);new MutationObserver(t=>{for(const r of t)if(r.type==="childList")for(const n of r.addedNodes)n.tagName==="LINK"&&n.rel==="modulepreload"&&s(n)}).observe(document,{childList:!0,subtree:!0});function l(t){const r={};return t.integrity&&(r.integrity=t.integrity),t.referrerpolicy&&(r.referrerPolicy=t.referrerpolicy),t.crossorigin==="use-credentials"?r.credentials="include":t.crossorigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function s(t){if(t.ep)return;t.ep=!0;const r=l(t);fetch(t.href,r)}};x();var j="/test-pwa-react-ghpages/img/logo.svg";const e=g.exports.jsx,c=g.exports.jsxs,S=g.exports.Fragment,E=()=>e(m,{basename:"/test-pwa-react-ghpages",children:c("div",{className:"main-layout",children:[c("nav",{children:[e("img",{src:j,alt:"React Logo"}),c("ul",{children:[e("li",{children:e(p,{to:"/",className:({isActive:a})=>a?"nav-active":"",children:"Home"})}),e("li",{children:e(p,{to:"/about",className:({isActive:a})=>a?"nav-active":"",children:"About"})}),e("li",{children:e(p,{to:"/users",className:({isActive:a})=>a?"nav-active":"",children:"Users"})})]})]}),c(v,{children:[e(u,{path:"users",element:e("h1",{children:"Users Page"})}),e(u,{path:"about",element:e("h1",{children:"About Page"})}),e(u,{path:"/",element:e("h1",{children:"Home Page"})}),e(u,{path:"/*",element:e(w,{to:"/",replace:!0})})]})]})});var P="/test-pwa-react-ghpages/img/loading.gif";const k=({registerSW:a})=>{const[o,l]=y.exports.useState(!1),s=a({onNeedRefresh(){l(!0)}});return c(S,{children:[e(E,{}),o&&c("button",{onClick:()=>s(o),children:["New content available, click here to update",e("img",{src:P,alt:"loading",width:"32"})]})]})};function O(a={}){const{immediate:o=!1,onNeedRefresh:l,onOfflineReady:s,onRegistered:t,onRegisterError:r}=a;let n,d;const h=async(i=!0)=>{i&&(n==null||n.addEventListener("controlling",f=>{f.isUpdate&&window.location.reload()})),d&&d.waiting&&await R(d.waiting,{type:"SKIP_WAITING"})};if("serviceWorker"in navigator){n=new N("/test-pwa-react-ghpages/sw.js",{scope:"/test-pwa-react-ghpages/"}),n.addEventListener("activated",i=>{i.isUpdate||s==null||s()});{const i=()=>{l==null||l()};n.addEventListener("waiting",i),n.addEventListener("externalwaiting",i)}n.register({immediate:o}).then(i=>{d=i,t==null||t(i)}).catch(i=>{r==null||r(i)})}return h}b.render(e(L.StrictMode,{children:e(k,{registerSW:O})}),document.getElementById("root"));
  