/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{__decorate as e}from"tslib";import{ClonableMixin as t}from"../../../core/Clonable.js";import{JSONSupport as o}from"../../../core/JSONSupport.js";import s from"../../../core/Logger.js";import{property as m,subclass as r}from"../../../core/accessorSupport/decorators.js";import p from"./AttachmentsColumnTemplate.js";import l from"./ColumnTemplate.js";import{isTemplateObjectWithType as n}from"./columnUtils.js";import a from"./FieldColumnTemplate.js";import i from"./GroupColumnTemplate.js";import u from"./RelationshipColumnTemplate.js";let c=class extends(t(o)){constructor(e){super(e),this.columnTemplates=[]}get columnTemplates(){return this._get("columnTemplates")}set columnTemplates(e){e&&Array.isArray(e)||(e=[]);const t=[];e.forEach(e=>{if(e instanceof a||e instanceof i||e instanceof l||e instanceof p||e instanceof u)t.push(e);else if(n(e)){const o=e.type;"field"===o?t.push(new a(e)):"group"===o?t.push(new i(e)):"column"===o?t.push(new l(e)):"attachment"===o?t.push(new p(e)):"relationship"===o&&t.push(new u(e))}else s.getLogger(this).warn("Property 'type' is missing from the provided template. Template removed from 'tableTemplate.columnTemplates'.")}),this._set("columnTemplates",t)}};e([m()],c.prototype,"columnTemplates",null),c=e([r("esri.widgets.FeatureTable.support.TableTemplate")],c);const f=c;export{f as default};
