import 'regenerator-runtime/runtime' ; /**
 * Steps to do while importing the initial entry.tsx
 * - On document load, import client handler
 * - Import client from project root
 * - Import router if any and do preloading
 */ let loadApplicationTimeout = 0 ; const loadApplication = async ( deadline ) => { let deadlineFallback = deadline ; if ( typeof deadline === 'undefined' ) { deadlineFallback = { didTimeout : false , timeRemaining ( ) { return Number . MAX_VALUE ; } , } ; } if ( ( deadlineFallback . timeRemaining ( ) > 0 || deadlineFallback . didTimeout ) ) { /**
         * - Import client handler async
         * - Import project client async
         * - Pass the project client to client handler
         * - Load the application
         */ const { default : ProjectClient } = await ( ( ) => import ( 'pawProjectClient' ) ) ( ) ; const { default : ProjectRoutes } = await ( ( ) => import ( 'pawProjectRoutes' ) ) ( ) ; const { default : ClientHandler } = await ( ( ) => import ( './handler' ) ) ( ) ; const { default : RouteHandler } = await ( ( ) => import ( '../router/handler' ) ) ( ) ; const env = JSON . parse ( process . env . pawConfig || '' ) ; const rHandler = new RouteHandler ( { env : { ... env } , } ) ; rHandler . addPlugin ( new ProjectRoutes ( { addPlugin : rHandler . addPlugin } ) ) ; const cHandler = new ClientHandler ( { env : { ... env } , } ) ; cHandler . addPlugin ( new ProjectClient ( { addPlugin : cHandler . addPlugin } ) ) ; rHandler . hooks . initRoutes . callAsync ( window . location . href , navigator . userAgent , ( err ) => { if ( err ) { console . log ( err ) ; return ; } cHandler . run ( { routeHandler : rHandler , } ) . catch ( ( ex ) => { console . log ( ex ) ; } ) ; } ) ; } else { if ( loadApplicationTimeout ) { window . cancelIdleCallback ( loadApplicationTimeout ) ; } loadApplicationTimeout = window . requestIdleCallback ( loadApplication , { timeout : 2000 } ) ; } } ; window . requestIdleCallback = window . requestIdleCallback || function requestIdleCallback ( cb , options ) { return setTimeout ( ( ) => { const start = Date . now ( ) ; cb ( { didTimeout : false , timeRemaining ( ) { return Math . max ( 0 , 50 - ( Date . now ( ) - start ) ) ; } , } ) ; } , typeof options !== 'undefined' ? options ?. timeout ?? 0 : 0 ) ; } ; window . cancelIdleCallback = window . cancelIdleCallback || function cancelIdleCallback ( id ) { clearTimeout ( id ) ; } ; if ( document . readyState !== 'loading' ) { loadApplicationTimeout = window . requestIdleCallback ( loadApplication , { timeout : 2000 } ) ; } else { document . addEventListener ( 'DOMContentLoaded' , ( ) => { loadApplicationTimeout = window . requestIdleCallback ( loadApplication , { timeout : 2000 } ) ; } ) ; } if ( module && module . hot && module . hot . accept ) { module . hot . accept ( ) ; }