let n=!1,s=!1,i="* ";const g=800,v=r=>new Promise(e=>setTimeout(e,r)),u={plugin_hash:"B-Fw6sGF",vue_path:"vue.js"};function d(){return navigator.userAgent.indexOf("Safari")>-1&&navigator.userAgent.indexOf("Chrome")===-1}function h(r){if(r&&d())return!1;if(performance&&performance.getEntriesByType&&typeof performance.getEntriesByType=="function"){const e=performance.getEntriesByType("navigation");if(e&&e[0]&&e[0].type==="reload")return!0}return window.performance?.navigation?.type?window.performance.navigation.type===1:!1}u.reloaded=h;let l=0;async function y(r){if(n&&s){r(0,0);return}console.debug(!n&&!s?"•-• service worker: wait for service worker cache open and start...":n?"•-• service worker: wait for service worker cache open...":"•-• service worker: wait for service worker to start...");let e=await p("cache-open");r(e,l)}function k(r,e){if(n=!1,s=!1,"serviceWorker"in navigator)navigator.serviceWorker.getRegistrations().then(function(t){const a=t.length;if(a<1)r?f("•-• ",e,!1):e&&e();else{let o=0;for(let c of t)console.debug("•-• uninstall service worker",c),c.unregister().then(function(w){o++,console.log("  •-• unregister service worker done, result",w),r&&o===a?f("•-• ",e):e&&e()})}}).catch(function(t){console.debug("service worker registration failed: ",t),e&&e()});else{const t="* we are sorry, but service worker is not supported, you must use secure https:// on the server machine to use this page";console.error(t),alert(t),e&&e()}}u.removeServiceWorker=k;async function p(r){let e=performance&&performance.now&&performance.now()/1e3||-1;for(navigator.serviceWorker.controller||await navigator.serviceWorker.ready;!(n&&s)&&l<g;)l++,!s&&(l===1||l%250===0)&&navigator.serviceWorker.controller&&(console.log(i+`service worker, post message: %c'${r}'`,"font-weight: bold"),navigator.serviceWorker.controller.postMessage({type:r})),await v(0);return e=performance.now()/1e3-e,e}function m(){"serviceWorker"in navigator&&navigator.serviceWorker.addEventListener("message",function(r){r.data.type==="cache-open"?(s=r.data.result===!0,console.debug(`•-• service worker: cache-open message result: ${r.data.result}, loop: ${l}`)):r.data.type==="debug"?console.debug.apply(null,r.data.args):r.data.type==="warn"?console.warn.apply(null,r.data.args):r.data.type==="activate"?typeof r.data.result=="string"?console.debug(`•-• service worker install result: ${r.data.result}`):console.debug(`•-• service worker install result: ${JSON.stringify(r.data.result)}`):console.error("unknown event.data.type",r.data)})}m();function f(r,e,t){if(n){e&&e();return}if("serviceWorker"in navigator){i=r||"•-• ";let a="/sw.js";window.location.pathname.substring(0,4)==="/nw/"?a="/nw/sw.js":window.location.pathname.substring(0,4)==="/nc/"&&(a="/nc/sw.js"),r&&console.debug(t===!1?i+"service worker was not installed, install service worker...":i+"install service worker..."),navigator.serviceWorker.register(a).then(async o=>{await o.update(),n=!0,localStorage.getItem("nc-reloaded")?(localStorage.removeItem("nc-reloaded"),console.debug(i+"service worker has been reloaded, scope",o.scope)):((t||d())&&(s=!0),r&&(t?console.debug(i+"service worker was already installed, scope",o.scope):s?console.log("%c"+i+"service worker and cache have been installed, scope:","font-weight: bold",o.scope):(console.log("%c"+i+"service worker has been installed, scope:","font-weight: bold",o.scope),s=!0))),s||await p("cache-open"),e&&e()}).catch(function(o){const c=i+`service worker registration FAILED, error: ${o}`;console.error(c),alert(c),n=!0,e&&e()})}else{const o=`Service worker is not supported, you must use secure ${"https://"+window.location.host} or http://localhost on the server machine to use this page.`;console.error(o),alert(o),n=!0,e&&e()}}u.installServiceWorker=f;export{u as _,h as a,k as r,y as w};
// src/core/nc-start-dist.js
const start = performance && performance.now && performance.now() / 1e3
console.log('•• nc-app start ••')
import { _ } from '/assets/service-worker.DGZzV4eE.js'
_.reloaded(true) ? _.removeServiceWorker('install') : _.installServiceWorker('••• ')
import('/assets/nc-main.DEgIQeOo.js').then(m => {
	m._.runMain(start ? performance.now() / 1e3 - start : -1)
})
