{"version":3,"sources":["node_modules/@arcgis/core/core/asyncUtils.js"],"sourcesContent":["/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.31/esri/copyright.txt for details.\n*/\nimport { _ as r } from \"../chunks/tslib.es6.js\";\nimport t from \"./Accessor.js\";\nimport { abortMaybe as o, removeMaybe as e } from \"./maybe.js\";\nimport { eachAlways as n, throwIfAbortError as s, onAbort as l } from \"./promiseUtils.js\";\nimport { property as i } from \"./accessorSupport/decorators/property.js\";\nimport { subclass as u } from \"./accessorSupport/decorators/subclass.js\";\nfunction a(r, t, o) {\n return n(r.map((r, e) => t.apply(o, [r, e])));\n}\nasync function p(r, t, o) {\n return (await n(r.map((r, e) => t.apply(o, [r, e])))).map(r => r.value);\n}\nfunction c(r) {\n return {\n ok: !0,\n value: r\n };\n}\nfunction h(r) {\n return {\n ok: !1,\n error: r\n };\n}\nfunction m(r) {\n return null != r && !0 === r.ok ? r.value : null;\n}\nfunction f(r) {\n return null != r && !1 === r.ok ? r.error : null;\n}\nasync function _(r) {\n if (null == r) return {\n ok: !1,\n error: new Error(\"no promise provided\")\n };\n try {\n return c(await r);\n } catch (t) {\n return h(t);\n }\n}\nasync function b(r) {\n try {\n return c(await r);\n } catch (t) {\n return s(t), h(t);\n }\n}\nfunction y(r) {\n if (!0 === r.ok) return r.value;\n throw r.error;\n}\nfunction d(r, t) {\n return new v(r, t);\n}\nlet v = class extends t {\n get value() {\n return m(this._result);\n }\n get error() {\n return f(this._result);\n }\n get finished() {\n return null != this._result;\n }\n constructor(r, t) {\n super({}), this._result = null, this._abortHandle = null, this.abort = () => {\n this._abortController = o(this._abortController);\n }, this.remove = this.abort, this._abortController = new AbortController();\n const {\n signal: e\n } = this._abortController;\n this.promise = r(e), this.promise.then(r => {\n this._result = c(r), this._cleanup();\n }, r => {\n this._result = h(r), this._cleanup();\n }), this._abortHandle = l(t, this.abort);\n }\n normalizeCtorArgs() {\n return {};\n }\n destroy() {\n this.abort();\n }\n _cleanup() {\n this._abortHandle = e(this._abortHandle), this._abortController = null;\n }\n};\nr([i()], v.prototype, \"value\", null), r([i()], v.prototype, \"error\", null), r([i()], v.prototype, \"finished\", null), r([i()], v.prototype, \"promise\", void 0), r([i()], v.prototype, \"_result\", void 0), v = r([u(\"esri.core.asyncUtils.ReactiveTask\")], v);\nexport { y as assertResult, d as createTask, a as forEach, h as makeResultError, c as makeResultOk, p as map, _ as result, f as resultError, b as resultOrAbort, m as resultValue };"],"mappings":"4QAUA,SAASA,EAAE,EAAG,EAAGC,EAAG,CAClB,OAAOC,EAAE,EAAE,IAAI,CAACC,EAAGC,IAAM,EAAE,MAAMH,EAAG,CAACE,EAAGC,CAAC,CAAC,CAAC,CAAC,CAC9C,CACA,SAAeC,EAAE,EAAG,EAAGJ,EAAG,QAAAK,EAAA,sBACxB,OAAQ,MAAMJ,EAAE,EAAE,IAAI,CAACC,EAAGC,IAAM,EAAE,MAAMH,EAAG,CAACE,EAAGC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAID,GAAKA,EAAE,KAAK,CACxE,GACA,SAASI,EAAE,EAAG,CACZ,MAAO,CACL,GAAI,GACJ,MAAO,CACT,CACF,CACA,SAAS,EAAE,EAAG,CACZ,MAAO,CACL,GAAI,GACJ,MAAO,CACT,CACF,CACA,SAASC,EAAE,EAAG,CACZ,OAAe,GAAR,MAAoB,EAAE,KAAT,GAAc,EAAE,MAAQ,IAC9C,CACA,SAASC,EAAE,EAAG,CACZ,OAAe,GAAR,MAAoB,EAAE,KAAT,GAAc,EAAE,MAAQ,IAC9C,CACA,SAAeC,EAAE,EAAG,QAAAJ,EAAA,sBAClB,GAAY,GAAR,KAAW,MAAO,CACpB,GAAI,GACJ,MAAO,IAAI,MAAM,qBAAqB,CACxC,EACA,GAAI,CACF,OAAOC,EAAE,MAAM,CAAC,CAClB,OAAS,EAAG,CACV,OAAO,EAAE,CAAC,CACZ,CACF,GACA,SAAeI,EAAE,EAAG,QAAAL,EAAA,sBAClB,G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