chunk-RQJNTZAL.js 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. import {
  2. y
  3. } from "./chunk-QTOOFNRV.js";
  4. import {
  5. _,
  6. f,
  7. g,
  8. u,
  9. w,
  10. x
  11. } from "./chunk-7O56JPWQ.js";
  12. import {
  13. b
  14. } from "./chunk-27P5ZSC7.js";
  15. import {
  16. F,
  17. P
  18. } from "./chunk-EN7YGJWG.js";
  19. import {
  20. o as o2
  21. } from "./chunk-WEMIK25H.js";
  22. import {
  23. s
  24. } from "./chunk-PDKDCAAD.js";
  25. import {
  26. o
  27. } from "./chunk-ECW2QABR.js";
  28. import {
  29. r
  30. } from "./chunk-MRJEICT6.js";
  31. import {
  32. d,
  33. e,
  34. l3 as l,
  35. n2 as n
  36. } from "./chunk-Y3WMVFTW.js";
  37. import {
  38. m
  39. } from "./chunk-IKP3YN53.js";
  40. // node_modules/@arcgis/core/layers/support/LabelExpressionInfo.js
  41. var l2;
  42. var n2 = l2 = class extends l {
  43. constructor() {
  44. super(...arguments), this.expression = null, this.title = null, this.value = null;
  45. }
  46. readExpression(r2, e2) {
  47. return e2.value ? w(e2.value) : r2;
  48. }
  49. writeExpression(r2, e2, s2) {
  50. this.value != null && (r2 = w(this.value)), r2 != null && (e2[s2] = r2);
  51. }
  52. clone() {
  53. return new l2({ expression: this.expression, title: this.title, value: this.value });
  54. }
  55. };
  56. e([d({ type: String, json: { write: { writerEnsuresNonNull: true } } })], n2.prototype, "expression", void 0), e([o("expression", ["expression", "value"])], n2.prototype, "readExpression", null), e([r("expression")], n2.prototype, "writeExpression", null), e([d({ type: String, json: { write: true, origins: { "web-scene": { write: false } } } })], n2.prototype, "title", void 0), e([d({ json: { read: false, write: false } })], n2.prototype, "value", void 0), n2 = l2 = e([n("esri.layers.support.LabelExpressionInfo")], n2);
  57. var a = n2;
  58. // node_modules/@arcgis/core/layers/support/LabelClass.js
  59. var y2;
  60. var d2 = new s({ esriServerPointLabelPlacementAboveCenter: "above-center", esriServerPointLabelPlacementAboveLeft: "above-left", esriServerPointLabelPlacementAboveRight: "above-right", esriServerPointLabelPlacementBelowCenter: "below-center", esriServerPointLabelPlacementBelowLeft: "below-left", esriServerPointLabelPlacementBelowRight: "below-right", esriServerPointLabelPlacementCenterCenter: "center-center", esriServerPointLabelPlacementCenterLeft: "center-left", esriServerPointLabelPlacementCenterRight: "center-right", esriServerLinePlacementAboveAfter: "above-after", esriServerLinePlacementAboveAlong: "above-along", esriServerLinePlacementAboveBefore: "above-before", esriServerLinePlacementAboveStart: "above-start", esriServerLinePlacementAboveEnd: "above-end", esriServerLinePlacementBelowAfter: "below-after", esriServerLinePlacementBelowAlong: "below-along", esriServerLinePlacementBelowBefore: "below-before", esriServerLinePlacementBelowStart: "below-start", esriServerLinePlacementBelowEnd: "below-end", esriServerLinePlacementCenterAfter: "center-after", esriServerLinePlacementCenterAlong: "center-along", esriServerLinePlacementCenterBefore: "center-before", esriServerLinePlacementCenterStart: "center-start", esriServerLinePlacementCenterEnd: "center-end", esriServerPolygonPlacementAlwaysHorizontal: "always-horizontal" }, { ignoreUnknown: true });
  61. function x2(e2) {
  62. return !e2 || e2.origin !== "service" && !(e2.layer?.type === "map-image");
  63. }
  64. function L(e2) {
  65. return e2?.type === "map-image";
  66. }
  67. function P2(e2) {
  68. return !!L(e2) && !!e2.capabilities?.exportMap?.supportsArcadeExpressionForLabeling;
  69. }
  70. function g2(e2) {
  71. return x2(e2) || P2(e2.layer);
  72. }
  73. var E = y2 = class extends l {
  74. constructor(e2) {
  75. super(e2), this.type = "label", this.name = null, this.allowOverrun = false, this.deconflictionStrategy = "static", this.labelExpression = null, this.labelExpressionInfo = null, this.labelPlacement = null, this.labelPosition = "curved", this.maxScale = 0, this.minScale = 0, this.repeatLabel = true, this.repeatLabelDistance = null, this.symbol = y, this.useCodedValues = void 0, this.where = null;
  76. }
  77. static evaluateWhere(e2, r2) {
  78. const t = (e3, r3, t2) => {
  79. switch (r3) {
  80. case "=":
  81. return e3 == t2;
  82. case "<>":
  83. return e3 != t2;
  84. case ">":
  85. return e3 > t2;
  86. case ">=":
  87. return e3 >= t2;
  88. case "<":
  89. return e3 < t2;
  90. case "<=":
  91. return e3 <= t2;
  92. }
  93. return false;
  94. };
  95. try {
  96. if (e2 == null)
  97. return true;
  98. const o3 = e2.split(" ");
  99. if (o3.length === 3)
  100. return t(r2[o3[0]], o3[1], o3[2]);
  101. if (o3.length === 7) {
  102. const e3 = t(r2[o3[0]], o3[1], o3[2]), n3 = o3[3], s2 = t(r2[o3[4]], o3[5], o3[6]);
  103. switch (n3) {
  104. case "AND":
  105. return e3 && s2;
  106. case "OR":
  107. return e3 || s2;
  108. }
  109. }
  110. return false;
  111. } catch (o3) {
  112. console.log("Error.: can't parse = " + e2);
  113. }
  114. }
  115. readLabelExpression(e2, r2) {
  116. const t = r2.labelExpressionInfo;
  117. if (!t || !t.value && !t.expression)
  118. return e2;
  119. }
  120. writeLabelExpression(e2, r2, t) {
  121. if (this.labelExpressionInfo) {
  122. if (this.labelExpressionInfo.value != null)
  123. e2 = u(this.labelExpressionInfo.value);
  124. else if (this.labelExpressionInfo.expression != null) {
  125. const r3 = _(this.labelExpressionInfo.expression);
  126. r3 && (e2 = "[" + r3 + "]");
  127. }
  128. }
  129. e2 != null && (r2[t] = e2);
  130. }
  131. writeLabelExpressionInfo(e2, r2, t, o3) {
  132. if (e2 == null && this.labelExpression != null && x2(o3))
  133. e2 = new a({ expression: this.getLabelExpressionArcade() });
  134. else if (!e2)
  135. return;
  136. const n3 = e2.toJSON(o3);
  137. n3.expression && (r2[t] = n3);
  138. }
  139. writeMaxScale(e2, r2) {
  140. (e2 || this.minScale) && (r2.maxScale = e2);
  141. }
  142. writeMinScale(e2, r2) {
  143. (e2 || this.maxScale) && (r2.minScale = e2);
  144. }
  145. getLabelExpression() {
  146. return x(this);
  147. }
  148. getLabelExpressionArcade() {
  149. return f(this);
  150. }
  151. getLabelExpressionSingleField() {
  152. return g(this);
  153. }
  154. hash() {
  155. return JSON.stringify(this);
  156. }
  157. clone() {
  158. return new y2({ allowOverrun: this.allowOverrun, deconflictionStrategy: this.deconflictionStrategy, labelExpression: this.labelExpression, labelExpressionInfo: m(this.labelExpressionInfo), labelPosition: this.labelPosition, labelPlacement: this.labelPlacement, maxScale: this.maxScale, minScale: this.minScale, name: this.name, repeatLabel: this.repeatLabel, repeatLabelDistance: this.repeatLabelDistance, symbol: m(this.symbol), where: this.where, useCodedValues: this.useCodedValues });
  159. }
  160. };
  161. e([d({ type: String, json: { write: true } })], E.prototype, "name", void 0), e([d({ type: Boolean, json: { write: true, default: false, origins: { "web-scene": { write: false } } } })], E.prototype, "allowOverrun", void 0), e([d({ type: String, json: { write: true, default: "static", origins: { "web-scene": { write: false } } } })], E.prototype, "deconflictionStrategy", void 0), e([d({ type: String, json: { write: { overridePolicy(e2, r2, t) {
  162. return this.labelExpressionInfo && t?.origin === "service" && P2(t.layer) ? { enabled: false } : { allowNull: true };
  163. } } } })], E.prototype, "labelExpression", void 0), e([o("labelExpression")], E.prototype, "readLabelExpression", null), e([r("labelExpression")], E.prototype, "writeLabelExpression", null), e([d({ type: a, json: { write: { overridePolicy: (e2, r2, t) => g2(t) ? { allowNull: true } : { enabled: false } } } })], E.prototype, "labelExpressionInfo", void 0), e([r("labelExpressionInfo")], E.prototype, "writeLabelExpressionInfo", null), e([d({ type: d2.apiValues, json: { type: d2.jsonValues, read: d2.read, write: d2.write } })], E.prototype, "labelPlacement", void 0), e([d({ type: ["curved", "parallel"], json: { write: true, origins: { "web-map": { write: false }, "web-scene": { write: false }, "portal-item": { write: false } } } })], E.prototype, "labelPosition", void 0), e([d({ type: Number })], E.prototype, "maxScale", void 0), e([r("maxScale")], E.prototype, "writeMaxScale", null), e([d({ type: Number })], E.prototype, "minScale", void 0), e([r("minScale")], E.prototype, "writeMinScale", null), e([d({ type: Boolean, json: { write: true, origins: { "web-scene": { write: false }, "portal-item": { write: false } } } })], E.prototype, "repeatLabel", void 0), e([d({ type: Number, cast: o2, json: { write: true, origins: { "web-scene": { write: false } } } })], E.prototype, "repeatLabelDistance", void 0), e([d({ types: P, json: { origins: { "web-scene": { types: F, write: b, default: null } }, write: b, default: null } })], E.prototype, "symbol", void 0), e([d({ type: Boolean, json: { write: true } })], E.prototype, "useCodedValues", void 0), e([d({ type: String, json: { write: true } })], E.prototype, "where", void 0), E = y2 = e([n("esri.layers.support.LabelClass")], E);
  164. var j = E;
  165. export {
  166. j
  167. };
  168. //# sourceMappingURL=chunk-RQJNTZAL.js.map