12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- import {
- e,
- m,
- n5 as n,
- y3 as y
- } from "./chunk-2Z2TG5CU.js";
- import {
- E,
- v,
- w
- } from "./chunk-V6P2MAQQ.js";
- import {
- h,
- p,
- r,
- t
- } from "./chunk-YXWMMD76.js";
- // node_modules/@arcgis/core/core/asyncUtils.js
- function c(r2, t2, o) {
- return E(r2.map((r3, e2) => t2.apply(o, [r3, e2])));
- }
- async function h2(r2, t2, o) {
- return (await E(r2.map((r3, e2) => t2.apply(o, [r3, e2])))).map((r3) => r3.value);
- }
- function m2(r2) {
- return { ok: true, value: r2 };
- }
- function f(r2) {
- return { ok: false, error: r2 };
- }
- function _(r2) {
- return r(r2) && true === r2.ok ? r2.value : null;
- }
- function y2(r2) {
- return r(r2) && false === r2.ok ? r2.error : null;
- }
- async function b(r2) {
- if (t(r2))
- return { ok: false, error: new Error("no promise provided") };
- try {
- return m2(await r2);
- } catch (t2) {
- return f(t2);
- }
- }
- async function d(r2) {
- try {
- return m2(await r2);
- } catch (t2) {
- return w(t2), f(t2);
- }
- }
- function j(r2, t2) {
- return new k(r2, t2);
- }
- var k = class extends m {
- constructor(r2, t2) {
- super({}), this._result = null, this._abortHandle = null, this.abort = () => {
- this._abortController = p(this._abortController);
- }, this.remove = this.abort, this._abortController = new AbortController();
- const { signal: o } = this._abortController;
- this.promise = r2(o), this.promise.then((r3) => {
- this._result = m2(r3), this._cleanup();
- }, (r3) => {
- this._result = f(r3), this._cleanup();
- }), this._abortHandle = v(t2, this.abort);
- }
- get value() {
- return _(this._result);
- }
- get error() {
- return y2(this._result);
- }
- get finished() {
- return r(this._result);
- }
- normalizeCtorArgs() {
- return {};
- }
- destroy() {
- this.abort();
- }
- _cleanup() {
- this._abortHandle = h(this._abortHandle), this._abortController = null;
- }
- };
- e([y()], k.prototype, "value", null), e([y()], k.prototype, "error", null), e([y()], k.prototype, "finished", null), e([y()], k.prototype, "promise", void 0), e([y()], k.prototype, "_result", void 0), k = e([n("esri.core.asyncUtils.ReactiveTask")], k);
- export {
- c,
- h2 as h,
- b,
- d,
- j
- };
- //# sourceMappingURL=chunk-2ZSOO377.js.map
|