var _self = self ; if ( ! _self . Promise ) { console . log ( "Compatibility: Loading polyfill for Promise API" ) ; importScripts ( "/assets/polyfills/bluebird.min.js" ) ; } if ( ! _self . TransformStream ) { console . log ( "Compatibility: Loading polyfill for Web Streams API" ) ; importScripts ( "/assets/polyfills/web-streams.js" ) ; _self . streamsPolyfill = true ; } if ( ! _self . TextDecoder ) { console . log ( "Compatibility: Loading polyfill for TextDecoder API" ) ; importScripts ( "/assets/polyfills/encoding-indexes.js" , "/assets/polyfills/encoding.js" ) ; } if ( ! Object . entries ) { console . log ( "Compatibility: Loading polyfill for Object.entries()" ) ; Object . entries = function ( obj ) { var ownProps = Object . keys ( obj ) , i = ownProps . length , resArray = new Array ( i ) ; while ( i -- ) resArray [ i ] = [ ownProps [ i ] , obj [ ownProps [ i ] ] ] ; return resArray ; } ; } if ( ! Array . prototype . find ) { console . log ( "Compatibility: Loading polyfill for Array.prototype.find()" ) ; Object . defineProperty ( Array . prototype , 'find' , { value : function ( predicate ) { if ( this == null ) { throw new TypeError ( '"this" is null or not defined' ) ; } var o = Object ( this ) ; var len = o . length >>> 0 ; if ( typeof predicate !== 'function' ) { throw new TypeError ( 'predicate must be a function' ) ; } var thisArg = arguments [ 1 ] ; var k = 0 ; while ( k < len ) { var kValue = o [ k ] ; if ( predicate . call ( thisArg , kValue , k , o ) ) { return kValue ; } k ++ ; } return undefined ; } , configurable : true , writable : true } ) ; }