{"version":3,"sources":["node_modules/@arcgis/core/core/Promise.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 s } from \"../chunks/tslib.es6.js\";\nimport e from \"./Accessor.js\";\nimport { createResolver as r, createAbortError as i, isAbortError as t } from \"./promiseUtils.js\";\nimport { subclass as o } from \"./accessorSupport/decorators/subclass.js\";\nvar l;\n!function (s) {\n s[s.PENDING = 0] = \"PENDING\", s[s.RESOLVED = 1] = \"RESOLVED\", s[s.REJECTED = 2] = \"REJECTED\";\n}(l || (l = {}));\nclass h {\n constructor() {\n this._resolver = r(), this._status = l.PENDING, this._resolvingPromises = [], this._resolver.promise.then(() => {\n this._status = l.RESOLVED, this._cleanUp();\n }, () => {\n this._status = l.REJECTED, this._cleanUp();\n }), this.promise = this._resolver.promise;\n }\n destroy() {\n this._cleanUp();\n }\n addResolvingPromise(s) {\n this._resolvingPromises.push(s), this._tryResolve();\n }\n isResolved() {\n return this._status === l.RESOLVED;\n }\n isRejected() {\n return this._status === l.REJECTED;\n }\n isFulfilled() {\n return this._status !== l.PENDING;\n }\n abort() {\n this._resolver.reject(i());\n }\n _cleanUp() {\n this._allPromise = null, this._resolvingPromises = null;\n }\n _tryResolve() {\n if (this.isFulfilled()) return;\n const s = r(),\n e = [...this._resolvingPromises, s.promise],\n i = this._allPromise = Promise.all(e);\n i.then(() => {\n this.isFulfilled() || this._allPromise !== i || this._resolver.resolve();\n }, s => {\n this.isFulfilled() || this._allPromise !== i || t(s) || this._resolver.reject(s);\n }), s.resolve();\n }\n}\nconst n = e => {\n let r = class extends e {\n constructor(...s) {\n super(...s), this._promiseProps = new h(), this.addResolvingPromise(Promise.resolve());\n }\n destroy() {\n this._promiseProps.destroy();\n }\n isResolved() {\n return this._promiseProps.isResolved();\n }\n isRejected() {\n return this._promiseProps.isRejected();\n }\n isFulfilled() {\n return this._promiseProps.isFulfilled();\n }\n when(s, e) {\n return this._promiseProps.promise.then(() => this).then(s, e);\n }\n catch(s) {\n return this.when(null, s);\n }\n addResolvingPromise(s) {\n s && !this._promiseProps.isFulfilled() && this._promiseProps.addResolvingPromise(\"_promiseProps\" in s ? s.when() : s);\n }\n };\n return r = s([o(\"esri.core.Promise\")], r), r;\n};\nlet m = class extends n(e) {};\nm = s([o(\"esri.core.Promise\")], m);\nexport { m as EsriPromise, n as EsriPromiseMixin };"],"mappings":"8KAQA,IAAIA,GACH,SAAUC,EAAG,CACZA,EAAEA,EAAE,QAAU,CAAC,EAAI,UAAWA,EAAEA,EAAE,SAAW,CAAC,EAAI,WAAYA,EAAEA,EAAE,SAAW,CAAC,EAAI,UACpF,GAAED,IAAMA,EAAI,CAAC,EAAE,EACf,IAAME,EAAN,KAAQ,CACN,aAAc,CACZ,KAAK,UAAYC,EAAE,EAAG,KAAK,QAAUH,EAAE,QAAS,KAAK,mBAAqB,CAAC,EAAG,KAAK,UAAU,QAAQ,KAAK,IAAM,CAC9G,KAAK,QAAUA,EAAE,SAAU,KAAK,SAAS,CAC3C,EAAG,IAAM,CACP,KAAK,QAAUA,EAAE,SAAU,KAAK,SAAS,CAC3C,CAAC,EAAG,KAAK,QAAU,KAAK,UAAU,OACpC,CACA,SAAU,CACR,KAAK,SAAS,CAChB,CACA,oBAAoBC,EAAG,CACrB,KAAK,mBAAmB,KAAKA,CAAC,EAAG,KAAK,YAAY,CACpD,CACA,YAAa,CACX,OAAO,KAAK,UAAYD,EAAE,QAC5B,CACA,YAAa,CACX,OAAO,KAAK,UAAYA,EAAE,QAC5B,CACA,aAAc,CACZ,OAAO,KAAK,UAAYA,EAAE,OAC5B,CACA,OAAQ,CACN,KAAK,UAAU,OAAOI,EAAE,CAAC,CAC3B,CACA,UAAW,CACT,KAAK,YAAc,KAAM,KAAK,mBAAqB,IACrD,CACA,aAAc,CACZ,GAAI,KAAK,YAAY,EAAG,OACxB,IAAMH,EAAIE,EAAE,EACVE,EAAI,CAAC,GAAG,KAAK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