/**
 * Copyright (c) Ladifire, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */ import * as React from "react" ; import * as ReactDOM from "react-dom" ; import App from './App' ; function renderRootComponent ( ) { ReactDOM . render ( ( < App />), document.getElementById('root')); } function preRenderSetup ( callwhendone ) { window . onerror = ( msg , url , line , column , stack ) => { if ( msg === 'ResizeObserver loop limit exceeded' ) { return ; } var l = { } ; l . level = 'ERROR' ; l . message = 'msg: ' + msg + ' row: ' + line + ' col: ' + column + ' stack: ' + stack + ' url: ' + url ; const req = new XMLHttpRequest ( ) ; req . open ( 'POST' , '/api/v1/logs' ) ; req . setRequestHeader ( 'Content-Type' , 'application/json' ) ; req . send ( JSON . stringify ( l ) ) ; } ; callwhendone ( ) ; } param { function } fn function appendOnLoadEvent ( fn ) { if ( window . attachEvent ) { window . attachEvent ( 'onload' , fn ) ; } else if ( window . onload ) { const curronload = window . onload ; window . onload = ( evt ) => { curronload ( evt ) ; fn ( evt ) ; } ; } else { window . onload = fn ; } } appendOnLoadEvent ( ( ) => { preRenderSetup ( renderRootComponent ) ; } ) ;