import { k2 as k } from "./chunk-MRJEICT6.js"; import { r } from "./chunk-GZT4BVFP.js"; // node_modules/@arcgis/core/support/arcadeOnDemand.js var t; function a() { return t || (t = (async () => { const e = await import("./arcadeUtils-2BWT2KOE.js"); return { arcade: e.arcade, arcadeUtils: e, Dictionary: e.Dictionary, Feature: e.arcadeFeature }; })()), t; } var s = (e, r2, t2) => o.create(e, r2, t2, null, ["$feature"]); var i = (e, r2, t2) => o.create(e, r2, t2, null, ["$feature", "$view"]); var n = (e, r2, t2, a2) => o.create(e, r2, t2, a2, ["$feature", "$view"]); var o = class { constructor(e, r2, t2, a2, s2, i2, c, n2) { this.script = e, this.evaluate = s2; const o2 = Array.isArray(c) ? c : c.fields; this.fields = o2, this._syntaxTree = a2, this._arcade = r2, this._arcadeDictionary = t2, this._arcadeFeature = i2, this._spatialReference = n2, this._referencesGeometry = r2.scriptTouchesGeometry(this._syntaxTree), this._referencesScale = this._arcade.referencesMember(this._syntaxTree, "scale"); } static async create(t2, s2, i2, c, n2, l) { const { arcade: u, Feature: p, Dictionary: y } = await a(), f = k.fromJSON(s2), m = u.parseScript(t2, l), h = n2.reduce((e, r2) => ({ ...e, [r2]: null }), {}); let d = null; r(c) && (d = new y(c), d.immutable = true, h.$config = null); const _ = u.scriptUsesGeometryEngine(m) && u.enableGeometrySupport(), F = u.scriptUsesFeatureSet(m) && u.enableFeatureSetSupport(), w = u.scriptIsAsync(m) && u.enableAsyncSupport(), S = { vars: h, spatialReference: f, useAsync: !!w }, b = new y(); b.immutable = false, b.setField("scale", 0); const $ = u.compileScript(m, S), x = (e) => ("$view" in e && e.$view && (b.setField("scale", e.$view.scale), e.$view = b), d && (e.$config = d), $({ vars: e, spatialReference: f })); return await Promise.all([_, F, w]), new o(t2, u, y, m, x, new p(), i2, f); } repurposeFeature(e) { return e.geometry && !e.geometry.spatialReference && (e.geometry.spatialReference = this._spatialReference), this._arcadeFeature.repurposeFromGraphicLikeObject(e.geometry, e.attributes, { fields: this.fields }), this._arcadeFeature; } createDictionary() { return new this._arcadeDictionary(); } referencesMember(e) { return this._arcade.referencesMember(this._syntaxTree, e); } referencesFunction(e) { return this._arcade.referencesFunction(this._syntaxTree, e); } referencesGeometry() { return this._referencesGeometry; } referencesScale() { return this._referencesScale; } extractFieldLiterals() { return this._arcade.extractExpectedFieldLiterals(this._syntaxTree); } }; export { a, s, i, n, o }; //# sourceMappingURL=chunk-LRDX4TO7.js.map