LineOfSightLayer-PLNG76YC.js 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. import {
  2. w as w3
  3. } from "./chunk-BVMSF6QA.js";
  4. import "./chunk-BQ7UE3XL.js";
  5. import {
  6. un
  7. } from "./chunk-DH2OBAUC.js";
  8. import "./chunk-TNLRDNTC.js";
  9. import "./chunk-QY775BFA.js";
  10. import {
  11. a,
  12. l as l2
  13. } from "./chunk-3D3QEPRE.js";
  14. import {
  15. h,
  16. m,
  17. u as u2
  18. } from "./chunk-WNCU6BFU.js";
  19. import {
  20. l,
  21. w as w2
  22. } from "./chunk-YIS6BAC3.js";
  23. import {
  24. c
  25. } from "./chunk-FGKNEJKJ.js";
  26. import {
  27. x
  28. } from "./chunk-PSV473TI.js";
  29. import {
  30. O
  31. } from "./chunk-I3OBGWNS.js";
  32. import "./chunk-FONIFA5N.js";
  33. import "./chunk-EG5OI4V4.js";
  34. import "./chunk-65BYCSII.js";
  35. import "./chunk-WZQZRKNH.js";
  36. import "./chunk-LRDX4TO7.js";
  37. import "./chunk-6A4U74YA.js";
  38. import "./chunk-TERAW6FT.js";
  39. import "./chunk-N2663GRX.js";
  40. import "./chunk-O4FY3ITT.js";
  41. import {
  42. b
  43. } from "./chunk-4DDBH2K5.js";
  44. import {
  45. s
  46. } from "./chunk-7N4X6GF3.js";
  47. import "./chunk-UXF37FQ4.js";
  48. import "./chunk-ZOEK6QHJ.js";
  49. import "./chunk-XNLG7T2T.js";
  50. import "./chunk-IR4PV7VK.js";
  51. import "./chunk-2Z6LERTI.js";
  52. import "./chunk-OWVBLVP3.js";
  53. import {
  54. n as n2,
  55. t as t2
  56. } from "./chunk-AFZ7XSEW.js";
  57. import "./chunk-MXB2XLKV.js";
  58. import "./chunk-TBBTRX4O.js";
  59. import "./chunk-YBSUITLL.js";
  60. import {
  61. j as j2
  62. } from "./chunk-ALDCDSPV.js";
  63. import "./chunk-DT6EAZQ5.js";
  64. import "./chunk-HNOZUNJ4.js";
  65. import "./chunk-VNFRAYHO.js";
  66. import "./chunk-R5IG2D6H.js";
  67. import "./chunk-VBRY5KJM.js";
  68. import "./chunk-PDKDCAAD.js";
  69. import {
  70. j2 as j
  71. } from "./chunk-ECW2QABR.js";
  72. import "./chunk-GCDJLKH4.js";
  73. import "./chunk-MRJEICT6.js";
  74. import {
  75. d,
  76. e,
  77. n2 as n,
  78. u2 as u,
  79. y3 as y
  80. } from "./chunk-Y3WMVFTW.js";
  81. import "./chunk-SAS7RONY.js";
  82. import "./chunk-WSRBH7BF.js";
  83. import "./chunk-IHXECKQQ.js";
  84. import "./chunk-ULGDPLM2.js";
  85. import "./chunk-EMJ4ZSM2.js";
  86. import "./chunk-IKP3YN53.js";
  87. import {
  88. e as e2,
  89. o,
  90. r,
  91. t,
  92. w
  93. } from "./chunk-GZT4BVFP.js";
  94. import "./chunk-A5ICIBVI.js";
  95. // node_modules/@arcgis/core/analysis/Analysis.js
  96. var n3 = 0;
  97. var l3 = class extends u(l2(s(y))) {
  98. constructor(e3) {
  99. super(e3), this.id = `${Date.now().toString(16)}-analysis-${n3++}`, this.title = null;
  100. }
  101. get parent() {
  102. return this._get("parent");
  103. }
  104. set parent(e3) {
  105. const t4 = this.parent;
  106. if (r(t4))
  107. switch (t4.type) {
  108. case "line-of-sight":
  109. t4.removeAnalysis(this);
  110. break;
  111. case "2d":
  112. case "3d":
  113. t4.analyses.includes(this) && t4.analyses.remove(this);
  114. }
  115. this._set("parent", e3);
  116. }
  117. get isEditable() {
  118. return this.requiredPropertiesForEditing.every(r);
  119. }
  120. };
  121. e([d({ type: String, constructOnly: true, clonable: false })], l3.prototype, "id", void 0), e([d({ type: String })], l3.prototype, "title", void 0), e([d({ constructOnly: true })], l3.prototype, "type", void 0), e([d({ clonable: false, value: null })], l3.prototype, "parent", null), e([d({ readOnly: true })], l3.prototype, "extent", void 0), e([d({ readOnly: true })], l3.prototype, "isEditable", null), e([d({ readOnly: true })], l3.prototype, "requiredPropertiesForEditing", void 0), e([d({ readOnly: true })], l3.prototype, "nonEditableMessage", void 0), l3 = e([n("esri.analysis.Analysis")], l3);
  122. var c2 = l3;
  123. // node_modules/@arcgis/core/analysis/featureReferenceUtils.js
  124. function t3(e3, t4) {
  125. return l4(e3) === l4(t4);
  126. }
  127. function l4(t4) {
  128. if (t(t4))
  129. return null;
  130. const l6 = t4.layer != null ? t4.layer.id : "";
  131. let r5 = null;
  132. return r5 = t4.objectId != null ? t4.objectId : t4.layer != null && "objectIdField" in t4.layer && t4.layer.objectIdField != null && t4.attributes != null ? t4.attributes[t4.layer.objectIdField] : t4.uid, r5 == null ? null : `o-${l6}-${r5}`;
  133. }
  134. var r2 = { json: { write: { writer: n4, target: { "feature.layerId": { type: [Number, String] }, "feature.objectId": { type: [Number, String] } } }, origins: { "web-scene": { read: u3 } } } };
  135. function n4(t4, l6) {
  136. t(t4) || t4.layer?.objectIdField == null || t4.attributes == null || (l6.feature = { layerId: t4.layer.id, objectId: t4.attributes[t4.layer.objectIdField] });
  137. }
  138. function u3(e3) {
  139. if (e3.layerId != null && e3.objectId != null)
  140. return { uid: null, layer: { id: e3.layerId, objectIdField: "ObjectId" }, attributes: { ObjectId: e3.objectId } };
  141. }
  142. // node_modules/@arcgis/core/analysis/LineOfSightAnalysisObserver.js
  143. var f = class extends u(l2(y)) {
  144. constructor(o2) {
  145. super(o2), this.position = null, this.elevationInfo = null, this.feature = null;
  146. }
  147. equals(o2) {
  148. return w(this.position, o2.position) && w(this.elevationInfo, o2.elevationInfo) && t3(this.feature, o2.feature);
  149. }
  150. };
  151. e([d({ type: j }), w3()], f.prototype, "position", void 0), e([d({ type: x }), w3()], f.prototype, "elevationInfo", void 0), e([d(r2)], f.prototype, "feature", void 0), f = e([n("esri.analysis.LineOfSightAnalysisObserver")], f);
  152. var u4 = f;
  153. // node_modules/@arcgis/core/analysis/LineOfSightAnalysisTarget.js
  154. var l5 = class extends u(a) {
  155. constructor(o2) {
  156. super(o2), this.position = null, this.elevationInfo = null, this.feature = null;
  157. }
  158. equals(o2) {
  159. return w(this.position, o2.position) && w(this.elevationInfo, o2.elevationInfo) && t3(this.feature, o2.feature);
  160. }
  161. };
  162. e([d({ type: j }), w3()], l5.prototype, "position", void 0), e([d({ type: x }), w3()], l5.prototype, "elevationInfo", void 0), e([d(r2)], l5.prototype, "feature", void 0), l5 = e([n("esri.analysis.LineOfSightAnalysisTarget")], l5);
  163. var f2 = l5;
  164. // node_modules/@arcgis/core/support/elevationInfoUtils.js
  165. function r4(t4, n5) {
  166. return t(n5) || !n5.mode ? t4 ? "absolute-height" : "on-the-ground" : n5.mode;
  167. }
  168. function s2(e3, n5) {
  169. return r4(!!r(e3) && e3.hasZ, n5);
  170. }
  171. // node_modules/@arcgis/core/analysis/LineOfSightAnalysis.js
  172. var j3 = j2.ofType(f2);
  173. var x2 = class extends c2 {
  174. constructor(e3) {
  175. super(e3), this.type = "line-of-sight", this.observer = null, this.extent = null, this.nonEditableMessage = "Assign an observer location to the analysis to allow editing.";
  176. }
  177. initialize() {
  178. this.own(l(() => this._computeExtent(), (e3) => {
  179. (t(e3) || t(e3.pending)) && this._set("extent", r(e3) ? e3.extent : null);
  180. }, w2));
  181. }
  182. get targets() {
  183. return this._get("targets") || new j3();
  184. }
  185. set targets(e3) {
  186. this._set("targets", n2(e3, this.targets, j3));
  187. }
  188. get spatialReference() {
  189. return r(this.observer) && r(this.observer.position) ? this.observer.position.spatialReference : null;
  190. }
  191. get requiredPropertiesForEditing() {
  192. return [o(this.observer, (e3) => e3.position)];
  193. }
  194. async waitComputeExtent() {
  195. const e3 = this._computeExtent();
  196. return r(e3) ? e2(e3.pending) : null;
  197. }
  198. _computeExtent() {
  199. const e3 = this.spatialReference;
  200. if (t(this.observer) || t(this.observer.position) || t(e3))
  201. return null;
  202. const t4 = (e4) => s2(e4.position, e4.elevationInfo) === "absolute-height", o2 = this.observer.position, r5 = u2(o2.x, o2.y, o2.z, o2.x, o2.y, o2.z);
  203. for (const i of this.targets)
  204. if (r(i.position)) {
  205. const t5 = un(i.position, e3);
  206. if (r(t5.pending))
  207. return { pending: t5.pending, extent: null };
  208. if (r(t5.geometry)) {
  209. const { x: e4, y: o3, z: s4 } = t5.geometry;
  210. h(r5, [e4, o3, s4]);
  211. }
  212. }
  213. const s3 = m(r5, e3);
  214. return t4(this.observer) && this.targets.every(t4) || (s3.zmin = null, s3.zmax = null), { pending: null, extent: s3 };
  215. }
  216. clear() {
  217. this.observer = null, this.targets.removeAll();
  218. }
  219. };
  220. e([d({ type: ["line-of-sight"] })], x2.prototype, "type", void 0), e([d({ type: u4, json: { read: true, write: true } })], x2.prototype, "observer", void 0), e([d({ cast: t2, type: j3, nonNullable: true, json: { read: true, write: true } })], x2.prototype, "targets", null), e([d({ value: null, readOnly: true })], x2.prototype, "extent", void 0), e([d({ readOnly: true })], x2.prototype, "spatialReference", null), e([d({ readOnly: true })], x2.prototype, "requiredPropertiesForEditing", null), e([d({ readOnly: true })], x2.prototype, "nonEditableMessage", void 0), x2 = e([n("esri.analysis.LineOfSightAnalysis")], x2);
  221. var E = x2;
  222. // node_modules/@arcgis/core/layers/LineOfSightLayer.js
  223. var u5 = j2.ofType(f2);
  224. var d2 = class extends c(O(b)) {
  225. constructor(e3) {
  226. super(e3), this.type = "line-of-sight", this.operationalLayerType = "LineOfSightLayer", this.analysis = new E(), this.opacity = 1;
  227. }
  228. initialize() {
  229. this.own(l(() => this.analysis, (e3, t4) => {
  230. r(t4) && t4.parent === this && (t4.parent = null), r(e3) && (e3.parent = this);
  231. }, w2));
  232. }
  233. async load() {
  234. return r(this.analysis) && this.addResolvingPromise(this.analysis.waitComputeExtent()), this;
  235. }
  236. get observer() {
  237. return o(this.analysis, (e3) => e3.observer);
  238. }
  239. set observer(e3) {
  240. o(this.analysis, (t4) => t4.observer = e3);
  241. }
  242. get targets() {
  243. return r(this.analysis) ? this.analysis.targets : null;
  244. }
  245. set targets(e3) {
  246. o(this.analysis, (t4) => t4.targets = e3);
  247. }
  248. get fullExtent() {
  249. return r(this.analysis) ? this.analysis.extent : null;
  250. }
  251. get spatialReference() {
  252. return r(this.analysis) ? this.analysis.spatialReference : null;
  253. }
  254. removeAnalysis(e3) {
  255. this.analysis === e3 && (this.analysis = new E());
  256. }
  257. };
  258. e([d({ json: { read: false }, readOnly: true })], d2.prototype, "type", void 0), e([d({ type: ["LineOfSightLayer"] })], d2.prototype, "operationalLayerType", void 0), e([d({ type: u4, json: { read: true, write: { ignoreOrigin: true } } })], d2.prototype, "observer", null), e([d({ type: u5, json: { read: true, write: { ignoreOrigin: true } } })], d2.prototype, "targets", null), e([d({ nonNullable: true, json: { read: false, write: false } })], d2.prototype, "analysis", void 0), e([d({ readOnly: true })], d2.prototype, "fullExtent", null), e([d({ readOnly: true })], d2.prototype, "spatialReference", null), e([d({ readOnly: true, json: { read: false, write: false, origins: { service: { read: false, write: false }, "portal-item": { read: false, write: false }, "web-document": { read: false, write: false } } } })], d2.prototype, "opacity", void 0), e([d({ type: ["show", "hide"] })], d2.prototype, "listMode", void 0), d2 = e([n("esri.layers.LineOfSightLayer")], d2);
  259. var f3 = d2;
  260. export {
  261. f3 as default
  262. };
  263. //# sourceMappingURL=LineOfSightLayer-PLNG76YC.js.map