/*
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/jsonMap","../../core/JSONSupport","../../core/lang","../../core/accessorSupport/decorators/property","../../core/accessorSupport/decorators/cast","../../core/accessorSupport/decorators/reader","../../core/accessorSupport/decorators/subclass","../../core/accessorSupport/ensureType","../../geometry/Point","./DimensionalDefinition","./RasterFunction"],(function(e,t,r,o,i,s,n,a,c,l,p,d,u){"use strict";var y;const m=r.strict()({MT_FIRST:"first",MT_LAST:"last",MT_MIN:"min",MT_MAX:"max",MT_MEAN:"mean",MT_BLEND:"blend",MT_SUM:"sum"}),h=r.strict()({esriMosaicNone:"none",esriMosaicCenter:"center",esriMosaicNadir:"nadir",esriMosaicViewpoint:"viewpoint",esriMosaicAttribute:"attribute",esriMosaicLockRaster:"lock-raster",esriMosaicNorthwest:"northwest",esriMosaicSeamline:"seamline"});function _(e){let t;switch(e?e.toLowerCase().replace("esrimosaic",""):""){case"byattribute":case"attribute":t="esriMosaicAttribute";break;case"lockraster":t="esriMosaicLockRaster";break;case"center":t="esriMosaicCenter";break;case"northwest":t="esriMosaicNorthwest";break;case"nadir":t="esriMosaicNadir";break;case"viewpoint":t="esriMosaicViewpoint";break;case"seamline":t="esriMosaicSeamline";break;default:t="esriMosaicNone"}return h.fromJSON(t)}let M=y=function(t){function r(e){var r;return(r=t.call(this,e)||this).ascending=!0,r.itemRenderingRule=null,r.lockRasterIds=null,r.method=null,r.multidimensionalDefinition=null,r.objectIds=null,r.operation=null,r.sortField=null,r.sortValue=null,r.viewpoint=null,r.where=null,r}e._inheritsLoose(r,t);var o=r.prototype;return o.readAscending=function(e,t){return null!=t.ascending?t.ascending:null==t.sortAscending||t.sortAscending},o.readMethod=function(e,t){return _(t.mosaicMethod||t.defaultMosaicMethod)},o.readOperation=function(e,t){const r=t.mosaicOperation,o=t.mosaicOperator&&t.mosaicOperator.toLowerCase(),i=r||(o?m.toJSON(o):null);return m.fromJSON(i)||"first"},o.castSortValue=function(e){return null==e||"string"==typeof e||"number"==typeof e?e:`${e}`},o.clone=function(){return new y({ascending:this.ascending,itemRenderingRule:i.clone(this.itemRenderingRule),lockRasterIds:i.clone(this.lockRasterIds),method:this.method,multidimensionalDefinition:i.clone(this.multidimensionalDefinition),objectIds:i.clone(this.objectIds),operation:this.operation,sortField:this.sortField,sortValue:this.sortValue,viewpoint:i.clone(this.viewpoint),where:this.where})},r}(o.JSONSupport);t.__decorate([s.property({type:Boolean,json:{write:!0}})],M.prototype,"ascending",void 0),t.__decorate([a.reader("ascending",["ascending","sortAscending"])],M.prototype,"readAscending",null),t.__decorate([s.property({type:u,json:{write:!0}})],M.prototype,"itemRenderingRule",void 0),t.__decorate([s.property({type:[l.Integer],json:{write:{overridePolicy(){return{enabled:"lock-raster"===this.method}}}}})],M.prototype,"lockRasterIds",void 0),t.__decorate([s.property({type:String,json:{type:h.jsonValues,write:{target:"mosaicMethod",writer:h.write}}})],M.prototype,"method",void 0),t.__decorate([a.reader("method",["mosaicMethod","defaultMosaicMethod"])],M.prototype,"readMethod",null),t.__decorate([s.property({type:[d],json:{write:!0}})],M.prototype,"multidimensionalDefinition",void 0),t.__decorate([s.property({type:[l.Integer],json:{name:"fids",write:!0}})],M.prototype,"objectIds",void 0),t.__decorate([s.property({json:{type:m.jsonValues,read:{reader:m.read},write:{target:"mosaicOperation",writer:m.write}}})],M.prototype,"operation",void 0),t.__decorate([a.reader("operation",["mosaicOperation","mosaicOperator"])],M.prototype,"readOperation",null),t.__decorate([s.property({type:String,json:{write:{overridePolicy(){return{enabled:"attribute"===this.method}}}}})],M.prototype,"sortField",void 0),t.__decorate([s.property({type:[String,Number],json:{write:{allowNull:!0,overridePolicy(){return{enabled:"attribute"===this.method,allowNull:!0}}}}})],M.prototype,"sortValue",void 0),t.__decorate([n.cast("sortValue")],M.prototype,"castSortValue",null),t.__decorate([s.property({type:p,json:{write:!0}})],M.prototype,"viewpoint",void 0),t.__decorate([s.property({type:String,json:{write:!0}})],M.prototype,"where",void 0),M=y=t.__decorate([c.subclass("esri.layers.support.MosaicRule")],M);return M}));
