// All material copyright Esri, All Rights Reserved, unless otherwise specified. // See https://js.arcgis.com/4.30/esri/copyright.txt for details. //>>built define("require ../chunks/tslib.es6 ../core/Logger ../core/promiseUtils ../core/accessorSupport/decorators/property ../core/has ../core/RandomLCG ../core/accessorSupport/decorators/enumeration ../core/accessorSupport/decorators/subclass ../portal/Portal ../chunks/persistableUrlUtils ./Symbol ./support/Thumbnail".split(" "),function(p,d,q,r,e,c,y,t,u,m,n,v,w){var h;c=h=class extends v{constructor(a){super(a);this.name=this.thumbnail=this.styleUrl=this.portal=this.styleName=this.color=null;this.type= "web-style"}get _fetchCacheKey(){const a=null!=this.portal?this.portal:m.getDefault();return`${this.styleName}:${this.styleUrl}:${this.name}:${a.user?a.user.username:null}:${a.url}`}read(a,b){this.portal=b?.portal;super.read(a,b)}clone(){return new h({name:this.name,styleUrl:this.styleUrl,styleName:this.styleName,portal:this.portal})}fetchSymbol(a){return this._fetchSymbol("webRef",a)}fetchCIMSymbol(a){return this._fetchSymbol("cimRef",a)}async _fetchSymbol(a,b){const f=null!=b?b.cache:null,k=f?this._fetchCacheKey: null;if(null!=f){var g=k&&f.get(k);if(g)return g.clone()}({resolveWebStyleSymbol:g}=await new Promise((l,x)=>p(["./support/webStyleSymbolUtils"],l,x)));r.throwIfAborted(b);b=g(this,{portal:this.portal},a,b);b.catch(l=>{q.getLogger(this).error("#fetchSymbol()","Failed to create symbol from style",l)});b=await b;if(!("webRef"===a&&"point-3d"===b.type||"cimRef"===a&&"cim"===b.type))return null;null!=f&&f.set(k,b.clone());return b}};d.__decorate([e.property({json:{write:!1}})],c.prototype,"color",void 0); d.__decorate([e.property({type:String,json:{write:!0}})],c.prototype,"styleName",void 0);d.__decorate([e.property({type:m,json:{write:!1}})],c.prototype,"portal",void 0);d.__decorate([e.property({type:String,json:{read:n.read,write:n.write}})],c.prototype,"styleUrl",void 0);d.__decorate([e.property({type:w.Thumbnail,json:{read:!1}})],c.prototype,"thumbnail",void 0);d.__decorate([e.property({type:String,json:{write:!0}})],c.prototype,"name",void 0);d.__decorate([t.enumeration({styleSymbolReference:"web-style"}, {readOnly:!0})],c.prototype,"type",void 0);d.__decorate([e.property()],c.prototype,"_fetchCacheKey",null);return c=h=d.__decorate([u.subclass("esri.symbols.WebStyleSymbol")],c)});