/* COPYRIGHT Esri - https://js.arcgis.com/5.0.18/LICENSE.txt */
import{__decorate as t}from"tslib";import e from"../../core/Accessor.js";import{watch as l,initial as i}from"../../core/reactiveUtils.js";import{property as s,subclass as r}from"../../core/accessorSupport/decorators.js";var o;let n=o=class extends e{constructor(t){super(t),this._activeFetchInfo={id:null,request:null},this.disabledFunction=null,this.layer=null,this.template=null,this.thumbnail=null}initialize(){this.addHandles(l(()=>{const{layer:t}=this;return[t&&"renderer"in t?t.renderer:null,this.template]},()=>{this._activeFetchInfo.id=null,this._activeFetchInfo.request=null,this._set("thumbnail",null)},i))}get description(){return this.template?.description}set description(t){this.template&&(this.template.description=t)}get disabled(){return this.disabledFunction?.(this)??!1}get label(){return this.template?.name}set label(t){this.template&&(this.template.name=t)}get id(){return`${this.label??""}–${this.layer?.id}`}get supportsUpload(){return"scene"===this.layer?.type}clone(){const t=null!=this.thumbnail?this.thumbnail.cloneNode(!0):null,e=new o({layer:this.layer,template:this.template});return e._set("thumbnail",t),e}};t([s()],n.prototype,"description",null),t([s()],n.prototype,"disabled",null),t([s()],n.prototype,"disabledFunction",void 0),t([s()],n.prototype,"label",null),t([s()],n.prototype,"layer",void 0),t([s()],n.prototype,"template",void 0),t([s()],n.prototype,"thumbnail",void 0),t([s()],n.prototype,"id",null),t([s()],n.prototype,"supportsUpload",null),n=o=t([r("esri.widgets.FeatureTemplates.TemplateItem")],n);const a=n;export{a as default};
