globalThis.debug = require('debug.coffee').default
require('headVue.coffee')


document.documentElement.classList.add('dark')

globalThis.initCount = 0
ic = ()->
    if initCount > 5
       window.location.reload()
    else if  not globalThis['appReady']
       initCount++
       setTimeout ic, 200
ic()


try
    init =  (event={})->
        debug.dir   globalThis['vueReady']
        debug.log "Init Start"
        if  not globalThis['appReady'] and globalThis['vueReady'] and globalThis['puochReady']
            debug.log 'init start ok'
            try
                require('vue/app/temp.coffee')
                globalThis['appReady'] = true
                debug.log "init is ok"
            catch err
                debug.dir err
        else if  not globalThis['appReady']
                debug.log 'pausedEvent appReady'
                setTimeout init, 200
    init()
