@arcgis/map-components
Version:
ArcGIS Map Components
4 lines • 2.01 kB
JavaScript
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
v4.33.13 */
import{a as c,b as p}from"./KW27SA4Q.js";export default $arcgis.t(([b,{property:l,subclass:f},_])=>{var d=Object.defineProperty,m=Object.getOwnPropertyDescriptor,s=(t,r,e,o)=>{for(var i=o>1?void 0:o?m(r,e):r,a=t.length-1,u;a>=0;a--)(u=t[a])&&(i=(o?u(r,e,i):u(i))||i);return o&&i&&d(r,e,i),i};function v(t="Aborted"){return new _("AbortError",t)}function j(t,r="Aborted"){if(y(t))throw v(r)}function h(t){return t instanceof AbortSignal?t:t?.signal??void 0}function y(t){return h(t)?.aborted??!1}function x(t){return t?.name==="AbortError"}function g(t){return{ok:!0,value:t}}function A(t){return{ok:!1,error:t}}function C(t){return t?.ok?t.value:null}function w(t){return t!=null&&!t.ok?t.error:null}function k(t,r){let e=h(t);if(e==null)return;if(e.aborted){r();return}let o=()=>r();return e.addEventListener("abort",o,{once:!0}),{remove:()=>e.removeEventListener("abort",o)}}function L(t,r){return new n(t,r)}var n=class extends b{constructor(t,r){super({}),this._abortHandle=null,this.abort=()=>{this._abortController=c(this._abortController)},this.remove=this.abort,this._abortController=new AbortController;let{signal:e}=this._abortController;this.promise=t(e),this.promise.then(o=>{this._result=g(o),this._cleanup()},o=>{this._result=A(o),this._cleanup()}),this._abortHandle=k(r,this.abort)}get value(){return C(this._result)}get error(){return w(this._result)}get finished(){return this._result!=null}destroy(){this.abort()}_cleanup(){this._abortHandle=p(this._abortHandle),this._abortController=null}[Symbol.dispose](){this._cleanup()}};s([l()],n.prototype,"value",1);s([l()],n.prototype,"error",1);s([l()],n.prototype,"finished",1);s([l()],n.prototype,"promise",2);s([l()],n.prototype,"_result",2);n=s([f("esri.components.asyncUtils.ReactiveTask")],n);return{a:j,b:y,c:x,d:L}},"core/Accessor","core/accessorSupport/decorators","core/Error")