/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["../../../chunks/_rollupPluginBabelHelpers","../../../chunks/tslib.es6","../../../core/Logger","../../../core/promiseUtils","../../../core/accessorSupport/decorators/property","../../../core/arrayUtils","../../../core/has","../../../core/accessorSupport/ensureType","../../../core/accessorSupport/decorators/subclass","../engine/BitmapContainer","./LayerView2D","./support/ExportStrategy","../../layers/LayerView","../../layers/RefreshableLayerView"],(function(t,e,r,i,a,n,s,o,c,p,u,h,d,y){"use strict";const l=r.getLogger("esri.views.2d.layers.BaseDynamicLayerView2D");let f=function(e){function r(){return e.apply(this,arguments)||this}t._inheritsLoose(r,e);var a=r.prototype;return a.update=function(t){this.strategy.update(t).catch((t=>{i.isAbortError(t)||l.error(t)})),this.notifyChange("updating")},a.attach=function(){this._bitmapContainer=new p.BitmapContainer,this.container.addChild(this._bitmapContainer),this.strategy=new h({container:this._bitmapContainer,fetchSource:this.fetchBitmapData.bind(this),requestUpdate:this.requestUpdate.bind(this)})},a.detach=function(){this.strategy.destroy(),this.strategy=null,this.container.removeChild(this._bitmapContainer),this._bitmapContainer.removeAllChildren()},a.moveStart=function(){},a.viewChange=function(){},a.moveEnd=function(){this.requestUpdate()},a.fetchBitmapData=function(t,e,r){return this.layer.fetchImage(t,e,r)},a.doRefresh=function(){var e=t._asyncToGenerator((function*(){this.requestUpdate()}));function r(){return e.apply(this,arguments)}return r}(),a.isUpdating=function(){return this.strategy.updating||this.updateRequested},r}(y(u.LayerView2DMixin(d)));e.__decorate([a.property()],f.prototype,"strategy",void 0),e.__decorate([a.property()],f.prototype,"updating",void 0),f=e.__decorate([c.subclass("esri.views.2d.layers.BaseDynamicLayerView2D")],f);return f}));
