text: /*!
   * OpenUI5
   * (c) Copyright 2009-2020 SAP SE or an SAP affiliate company.
   * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
   */
  sap.ui.define(["sap/ui/test/_OpaLogger","sap/ui/test/_ParameterValidator","sap/ui/test/autowaiter/_utils","sap/ui/thirdparty/jquery"],function(e,r,t,a){"use strict";var i=e.getLogger("sap.ui.test.autowaiter._promiseWaiter");var n=e.getLogger("sap.ui.test.autowaiter._promiseWaiter#hasPending");var o=new r({errorPrefix:"sap.ui.test.autowaiter._promiseCounter#extendConfig"});var u=1e3;var s={maxDelay:u};var c=[];function g(e){var r=Promise[e];Promise[e]=function(){var a=false;var n={func:e,args:t.argumentsToString(arguments),stack:t.resolveStackTrace()};var o=p(n);var u=setTimeout(function(){a=true;c.splice(c.indexOf(n),1);i.trace("Long-running promise is ignored:"+o)},s.maxDelay,"TIMEOUT_WAITER_IGNORE");var g=function(){if(a){return}c.splice(c.indexOf(n),1);i.trace("Promise complete:"+o);clearTimeout(u)};var f=r.apply(this,arguments);c.push(n);i.trace("New pending promise:"+o);f.then(g,g);return f}}g("resolve");g("all");g("race");g("reject");function p(e){return"\nPromise: Function: "+e.func+" Args: "+e.args+" Stack: "+e.stack}function f(){var e="There are "+c.length+" pending promises\n";c.forEach(function(r){e+=p(r)});n.debug(e)}return{hasPending:function(){var e=c.length>0;if(e){f()}return e},extendConfig:function(e){var r=e&&e.timeoutWaiter&&e.timeoutWaiter.maxDelay;e={maxDelay:r||u};o.validate({inputToValidate:e,validationInfo:{maxDelay:"numeric"}});a.extend(s,e)}}},true);