/*
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/JSONSupport","../../core/lang","../../core/Logger","../../core/accessorSupport/decorators/property","../../core/accessorSupport/decorators/cast","../../core/accessorSupport/decorators/subclass","../../core/accessorSupport/ensureType","./MeshMaterial","./MeshMaterialMetallicRoughness","./MeshVertexAttributes"],(function(e,t,r,o,s,a,c,n,i,u,l,p){"use strict";var h;const d=s.getLogger("esri.geometry.support.MeshComponent");let g=h=function(t){function r(e){var r;return(r=t.call(this,e)||this).faces=null,r.material=null,r.shading="source",r.trustSourceNormals=!1,r}e._inheritsLoose(r,t),r.from=function(e){return i.ensureClass(h,e)};var s=r.prototype;return s.castFaces=function(e){const t={loggerTag:".faces=",stride:3};return p.castArray(e,Uint32Array,[Uint16Array],t,d)},s.castMaterial=function(e){return e&&"object"==typeof e&&("metallic"in e||"roughness"in e||"metallicRoughnessTexture"in e)?i.ensureClass(l,e):i.ensureClass(u,e)},s.clone=function(){return new h({faces:o.clone(this.faces),shading:this.shading,material:o.clone(this.material),trustSourceNormals:this.trustSourceNormals})},s.cloneWithDeduplication=function(e,t){const r={faces:o.clone(this.faces),shading:this.shading,material:this.material?this.material.cloneWithDeduplication(e,t):null,trustSourceNormals:this.trustSourceNormals};return new h(r)},r}(r.JSONSupport);t.__decorate([a.property({json:{write:!0}})],g.prototype,"faces",void 0),t.__decorate([c.cast("faces")],g.prototype,"castFaces",null),t.__decorate([a.property({type:u,json:{write:!0}})],g.prototype,"material",void 0),t.__decorate([c.cast("material")],g.prototype,"castMaterial",null),t.__decorate([a.property({type:String,json:{write:!0}})],g.prototype,"shading",void 0),t.__decorate([a.property({type:Boolean})],g.prototype,"trustSourceNormals",void 0),g=h=t.__decorate([n.subclass("esri.geometry.support.MeshComponent")],g);return g}));
