import{o as p}from"./index-Bku7SJna.js";import"./vuetify-Ce4WN_Dg.js";import"./overlayscrollbars-CiKU261J.js";import"./echarts-DzoUeqWp.js";function _(o={}){const{immediate:c=!1,onNeedRefresh:u,onOfflineReady:a,onRegistered:r,onRegisteredSW:s,onRegisterError:t}=o;let i,n;const d=async(e=!0)=>{await n};async function l(){if("serviceWorker"in navigator){if(i=await p(async()=>{const{Workbox:e}=await import("./workbox-window.prod.es5-C7zTcMQ_.js");return{Workbox:e}},[]).then(({Workbox:e})=>new e("/sw.js",{scope:"/",type:"classic"})).catch(e=>{t==null||t(e)}),!i)return;i.addEventListener("activated",e=>{(e.isUpdate||e.isExternal)&&window.location.reload()}),i.addEventListener("installed",e=>{e.isUpdate||a==null||a()}),i.register({immediate:c}).then(e=>{s?s("/sw.js",e):r==null||r(e)}).catch(e=>{t==null||t(e)})}}return n=l(),d}export{_ as registerSW};
