/*
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","../../TimeExtent","../../core/JSONSupport","../../core/lang","../../core/maybe","../../core/accessorSupport/decorators/property","../../core/accessorSupport/ensureType","../../core/accessorSupport/decorators/subclass","../../core/accessorSupport/decorators/writer","../../geometry/Point","../../geometry/support/jsonUtils","../../layers/support/MosaicRule","../../layers/support/RasterFunction"],(function(e,t,r,o,i,n,s,l,p,u,a,c,y,d){"use strict";var m;let _=m=function(t){function r(){var e;return(e=t.apply(this,arguments)||this).geometry=null,e.renderingRules=null,e.pixelSize=null,e.returnGeometry=!0,e.returnCatalogItems=!0,e.returnPixelValues=!0,e.maxItemCount=null,e.timeExtent=null,e.raster=void 0,e.viewId=void 0,e.processAsMultidimensional=!1,e}e._inheritsLoose(r,t);var o=r.prototype;return o.writeGeometry=function(e,t,r){null!=e&&(t.geometryType=c.getJsonType(e),t[r]=JSON.stringify(e.toJSON()))},o.writeMosaicRule=function(e,t,r){null!=e&&(t[r]=JSON.stringify(e.toJSON()))},o.writeRenderingRule=function(e,t,r){null!=e&&(t[r]=JSON.stringify(e.toJSON())),e.rasterFunctionDefinition&&(t[r]=JSON.stringify(e.rasterFunctionDefinition))},o.writeRenderingRules=function(e,t,r){null!=e&&(t[r]=JSON.stringify(e.map((e=>e.rasterFunctionDefinition||e.toJSON()))))},o.writePixelSize=function(e,t,r){null!=e&&(t[r]=JSON.stringify(e))},o.writeTimeExtent=function(e,t,r){if(null!=e){const o=n.isSome(e.start)?e.start.getTime():null,i=n.isSome(e.end)?e.end.getTime():null;t[r]=null!=o?null!=i?`${o},${i}`:`${o}`:null}},o.clone=function(){return new m(i.clone({geometry:this.geometry,mosaicRule:this.mosaicRule,renderingRule:this.renderingRule,pixelSize:this.pixelSize,returnGeometry:this.returnGeometry,returnCatalogItems:this.returnCatalogItems,returnPixelValues:this.returnPixelValues,maxItemCount:this.maxItemCount,processAsMultidimensional:this.processAsMultidimensional,raster:this.raster,viewId:this.viewId,timeExtent:this.timeExtent}))},e._createClass(r,[{key:"mosaicRule",set:function(e){let t=e;t&&t.mosaicMethod&&(t=y.fromJSON({...t.toJSON(),mosaicMethod:t.mosaicMethod,mosaicOperation:t.mosaicOperation})),this._set("mosaicRule",t)}},{key:"renderingRule",set:function(e){let t=e;t&&t.rasterFunction&&(t=d.fromJSON({...t.toJSON(),rasterFunction:t.rasterFunction,rasterFunctionArguments:t.rasterFunctionArguments})),this._set("renderingRule",t)}}]),r}(o.JSONSupport);t.__decorate([s.property({json:{write:!0}})],_.prototype,"geometry",void 0),t.__decorate([u.writer("geometry")],_.prototype,"writeGeometry",null),t.__decorate([s.property({type:y,json:{write:!0}})],_.prototype,"mosaicRule",null),t.__decorate([u.writer("mosaicRule")],_.prototype,"writeMosaicRule",null),t.__decorate([s.property({type:d,json:{write:!0}})],_.prototype,"renderingRule",null),t.__decorate([u.writer("renderingRule")],_.prototype,"writeRenderingRule",null),t.__decorate([s.property({type:[d],json:{write:!0}})],_.prototype,"renderingRules",void 0),t.__decorate([u.writer("renderingRules")],_.prototype,"writeRenderingRules",null),t.__decorate([s.property({type:a,json:{write:!0}})],_.prototype,"pixelSize",void 0),t.__decorate([u.writer("pixelSize")],_.prototype,"writePixelSize",null),t.__decorate([s.property({type:Boolean,json:{write:!0}})],_.prototype,"returnGeometry",void 0),t.__decorate([s.property({type:Boolean,json:{write:!0}})],_.prototype,"returnCatalogItems",void 0),t.__decorate([s.property({type:Boolean,json:{write:!0}})],_.prototype,"returnPixelValues",void 0),t.__decorate([s.property({type:Number,json:{write:!0}})],_.prototype,"maxItemCount",void 0),t.__decorate([s.property({type:r,json:{write:{target:"time"}}})],_.prototype,"timeExtent",void 0),t.__decorate([u.writer("timeExtent")],_.prototype,"writeTimeExtent",null),t.__decorate([s.property({json:{write:!0}})],_.prototype,"raster",void 0),t.__decorate([s.property({json:{write:!0}})],_.prototype,"viewId",void 0),t.__decorate([s.property({type:Boolean,json:{write:!0}})],_.prototype,"processAsMultidimensional",void 0),_=m=t.__decorate([p.subclass("esri.rest.support.ImageIdentifyParameters")],_);return _}));
