// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://js.arcgis.com/3.23/esri/copyright.txt for details.
//>>built
define("esri/dijit/geoenrichment/ReportPlayer/core/reportContainers/containerGridUtils/ContentLoadingEventManager",["dojo/_base/declare","dojo/Deferred","esri/dijit/geoenrichment/_Invoke"],function(b,c,d){return b(d,{_contentLoadingCount:0,_pendingTimeoutHandle:null,_totalTimeoutHandle:null,_loadDfd:null,_isDestroyed:!1,_pagesLoaded:!1,init:function(){if(!this._isDestroyed){var a=this;this._destroy();this._contentLoadingCount=0;this._loadDfd=new c;this._totalTimeoutHandle=setTimeout(function(){a._loadDfd&&
a._doReturn()},6E4)}},notifyPagesLoaded:function(){if(!this._isDestroyed){this._pagesLoaded=!0;var a=this;this._pendingTimeoutHandle=setTimeout(function(){a._contentLoadingCount||a._doReturn()},500)}},onContentLoadingStart:function(){this._contentLoadingCount++},onContentLoadingEnd:function(){this._contentLoadingCount=Math.max(0,--this._contentLoadingCount);this._isDestroyed||!this._contentLoadingCount&&this._pagesLoaded&&this.invoke("_doReturn",100)},_doReturn:function(){this._loadDfd.resolve();
this.destroy()},returnOnLoadEnd:function(){return this._isDestroyed?null:this._loadDfd.promise},destroy:function(){this._isDestroyed=!0;this._destroy()},_destroy:function(){this._invokeTimeoutIDs&&clearTimeout(this._invokeTimeoutIDs._doReturn);this._pendingTimeoutHandle&&clearTimeout(this._pendingTimeoutHandle);this._pendingTimeoutHandle=null;this._totalTimeoutHandle&&clearTimeout(this._totalTimeoutHandle);this._loadDfd=this._totalTimeoutHandle=null}})});