chunk-QR6V6X5R.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. import {
  2. Ie,
  3. ae,
  4. fe,
  5. ie,
  6. te
  7. } from "./chunk-CRGY2SDS.js";
  8. import {
  9. I
  10. } from "./chunk-PQFTYGF5.js";
  11. import {
  12. t
  13. } from "./chunk-YXWMMD76.js";
  14. // node_modules/@arcgis/core/layers/graphics/sources/support/sourceUtils.js
  15. var l = class {
  16. constructor() {
  17. this.code = null, this.description = null;
  18. }
  19. };
  20. var u = class {
  21. constructor(e) {
  22. this.error = new l(), this.globalId = null, this.objectId = null, this.success = false, this.uniqueId = null, this.error.description = e;
  23. }
  24. };
  25. function a(e) {
  26. return new u(e);
  27. }
  28. var c = class {
  29. constructor(e) {
  30. this.globalId = null, this.success = true, this.objectId = this.uniqueId = e;
  31. }
  32. };
  33. function f(e) {
  34. return new c(e);
  35. }
  36. var d = /* @__PURE__ */ new Set();
  37. function m(e, t2, r, s = false, o) {
  38. var _a;
  39. d.clear();
  40. for (const l2 in r) {
  41. const u2 = e.get(l2);
  42. if (!u2)
  43. continue;
  44. const c2 = r[l2], f2 = p(u2, c2);
  45. if (f2 !== c2 && o && o.push({ name: "invalid-value-type", message: "attribute value was converted to match the field type", details: { field: u2, originalValue: c2, sanitizedValue: f2 } }), d.add(u2.name), u2 && (s || u2.editable)) {
  46. const e2 = fe(u2, f2);
  47. if (e2)
  48. return a(Ie(e2, u2, f2));
  49. t2[u2.name] = f2;
  50. }
  51. }
  52. for (const n of (_a = e == null ? void 0 : e.requiredFields) != null ? _a : [])
  53. if (!d.has(n.name))
  54. return a(`missing required field "${n.name}"`);
  55. return null;
  56. }
  57. function p(e, t2) {
  58. let n = t2;
  59. return "string" == typeof t2 && ie(e) ? n = parseFloat(t2) : null != t2 && te(e) && "string" != typeof t2 && (n = String(t2)), ae(n);
  60. }
  61. var h;
  62. function g(n, i) {
  63. if (!n || !I(i))
  64. return n;
  65. if ("rings" in n || "paths" in n) {
  66. if (t(h))
  67. throw new TypeError("geometry engine not loaded");
  68. return h.simplify(i, n);
  69. }
  70. return n;
  71. }
  72. async function y() {
  73. return t(h) && (h = await import("./geometryEngineJSON-CAFXKE3U.js")), h;
  74. }
  75. async function w(e, n) {
  76. !I(e) || "esriGeometryPolygon" !== n && "esriGeometryPolyline" !== n || await y();
  77. }
  78. export {
  79. a,
  80. f,
  81. m,
  82. g,
  83. w
  84. };
  85. //# sourceMappingURL=chunk-QR6V6X5R.js.map