chunk-LRDX4TO7.js 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. import {
  2. k2 as k
  3. } from "./chunk-MRJEICT6.js";
  4. import {
  5. r
  6. } from "./chunk-GZT4BVFP.js";
  7. // node_modules/@arcgis/core/support/arcadeOnDemand.js
  8. var t;
  9. function a() {
  10. return t || (t = (async () => {
  11. const e = await import("./arcadeUtils-2BWT2KOE.js");
  12. return { arcade: e.arcade, arcadeUtils: e, Dictionary: e.Dictionary, Feature: e.arcadeFeature };
  13. })()), t;
  14. }
  15. var s = (e, r2, t2) => o.create(e, r2, t2, null, ["$feature"]);
  16. var i = (e, r2, t2) => o.create(e, r2, t2, null, ["$feature", "$view"]);
  17. var n = (e, r2, t2, a2) => o.create(e, r2, t2, a2, ["$feature", "$view"]);
  18. var o = class {
  19. constructor(e, r2, t2, a2, s2, i2, c, n2) {
  20. this.script = e, this.evaluate = s2;
  21. const o2 = Array.isArray(c) ? c : c.fields;
  22. 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");
  23. }
  24. static async create(t2, s2, i2, c, n2, l) {
  25. 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 }), {});
  26. let d = null;
  27. r(c) && (d = new y(c), d.immutable = true, h.$config = null);
  28. 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();
  29. b.immutable = false, b.setField("scale", 0);
  30. 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 }));
  31. return await Promise.all([_, F, w]), new o(t2, u, y, m, x, new p(), i2, f);
  32. }
  33. repurposeFeature(e) {
  34. return e.geometry && !e.geometry.spatialReference && (e.geometry.spatialReference = this._spatialReference), this._arcadeFeature.repurposeFromGraphicLikeObject(e.geometry, e.attributes, { fields: this.fields }), this._arcadeFeature;
  35. }
  36. createDictionary() {
  37. return new this._arcadeDictionary();
  38. }
  39. referencesMember(e) {
  40. return this._arcade.referencesMember(this._syntaxTree, e);
  41. }
  42. referencesFunction(e) {
  43. return this._arcade.referencesFunction(this._syntaxTree, e);
  44. }
  45. referencesGeometry() {
  46. return this._referencesGeometry;
  47. }
  48. referencesScale() {
  49. return this._referencesScale;
  50. }
  51. extractFieldLiterals() {
  52. return this._arcade.extractExpectedFieldLiterals(this._syntaxTree);
  53. }
  54. };
  55. export {
  56. a,
  57. s,
  58. i,
  59. n,
  60. o
  61. };
  62. //# sourceMappingURL=chunk-LRDX4TO7.js.map