SceneLayer-IBSV3FAY.js 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620
  1. import {
  2. g as g2
  3. } from "./chunk-IN44RUPP.js";
  4. import {
  5. l as l4,
  6. t as t8,
  7. ye
  8. } from "./chunk-F2ZAJBUD.js";
  9. import {
  10. d as d2,
  11. s as s5
  12. } from "./chunk-TE2TRGVU.js";
  13. import {
  14. l as l3,
  15. m as m2,
  16. s as s4,
  17. u as u2
  18. } from "./chunk-NXF22CVW.js";
  19. import {
  20. L,
  21. N
  22. } from "./chunk-DRPR56GA.js";
  23. import "./chunk-L5R6EFI6.js";
  24. import "./chunk-RMZNH22Z.js";
  25. import "./chunk-A22ACVMF.js";
  26. import "./chunk-X4WJNVEM.js";
  27. import "./chunk-ZNJHHCMJ.js";
  28. import "./chunk-LX2NI53X.js";
  29. import "./chunk-IZUZZJS7.js";
  30. import "./chunk-RUM3DXFX.js";
  31. import "./chunk-W3XAGTM6.js";
  32. import "./chunk-44FMXGSC.js";
  33. import "./chunk-XFDO4CMR.js";
  34. import "./chunk-GHN7C53L.js";
  35. import "./chunk-56OWH4DC.js";
  36. import "./chunk-ZCAE6QVH.js";
  37. import "./chunk-K7B6OWCU.js";
  38. import "./chunk-WM52QDLS.js";
  39. import "./chunk-MEZ7BUMM.js";
  40. import "./chunk-7B57NUGF.js";
  41. import "./chunk-AOQ55JXI.js";
  42. import {
  43. p2 as p3,
  44. t as t6
  45. } from "./chunk-X42TFXOU.js";
  46. import "./chunk-JFSMKLAQ.js";
  47. import "./chunk-LXOC7SMQ.js";
  48. import {
  49. s as s3
  50. } from "./chunk-DN6W4TJU.js";
  51. import "./chunk-OUUXJOLT.js";
  52. import "./chunk-PLQUCCQV.js";
  53. import "./chunk-JZAS4TIG.js";
  54. import "./chunk-VBR5BOXI.js";
  55. import "./chunk-NBKUI76A.js";
  56. import "./chunk-6334AFGG.js";
  57. import "./chunk-NLLFSKB2.js";
  58. import {
  59. a as a2
  60. } from "./chunk-LC3GBQ56.js";
  61. import {
  62. t as t7
  63. } from "./chunk-5GYJGY4C.js";
  64. import "./chunk-O3JQY77G.js";
  65. import "./chunk-OXF7W4BJ.js";
  66. import {
  67. An,
  68. mn
  69. } from "./chunk-P24XEEHY.js";
  70. import "./chunk-SAJAEMIJ.js";
  71. import "./chunk-S6EFEKAU.js";
  72. import "./chunk-I4RYNNL6.js";
  73. import "./chunk-2RHPWGZL.js";
  74. import "./chunk-XEQ4FTFC.js";
  75. import "./chunk-JM5OVQAD.js";
  76. import "./chunk-OJ2HHY2O.js";
  77. import {
  78. p as p2
  79. } from "./chunk-S3GK7VUF.js";
  80. import "./chunk-TU7WVKU4.js";
  81. import {
  82. i
  83. } from "./chunk-WWXZOC2Y.js";
  84. import {
  85. p
  86. } from "./chunk-ZOKNWEG3.js";
  87. import "./chunk-NQA5XJGK.js";
  88. import "./chunk-EKYSPJO6.js";
  89. import {
  90. i as i2,
  91. j2 as j4
  92. } from "./chunk-JAUFBT5U.js";
  93. import "./chunk-W6U6FKJ3.js";
  94. import {
  95. p as p4
  96. } from "./chunk-7C2KDOAI.js";
  97. import {
  98. n as n2
  99. } from "./chunk-RHFU6KWO.js";
  100. import "./chunk-3FNKD2EB.js";
  101. import "./chunk-ZOO4I2U4.js";
  102. import "./chunk-JPUFJK2B.js";
  103. import "./chunk-HZ2WKB3G.js";
  104. import "./chunk-3HCJD762.js";
  105. import "./chunk-RVCE264D.js";
  106. import {
  107. t as t5
  108. } from "./chunk-HKJ7X3BD.js";
  109. import "./chunk-Y74D3LKQ.js";
  110. import "./chunk-PK4W65H4.js";
  111. import {
  112. g
  113. } from "./chunk-7C23ILQ4.js";
  114. import {
  115. k
  116. } from "./chunk-P6VVVEX6.js";
  117. import "./chunk-3Z755LKF.js";
  118. import "./chunk-LTZ5XXDV.js";
  119. import "./chunk-IEU3AM37.js";
  120. import "./chunk-SKKBVHTF.js";
  121. import "./chunk-DLMAGHHC.js";
  122. import {
  123. x
  124. } from "./chunk-WD4J43GZ.js";
  125. import "./chunk-JOYXMSKE.js";
  126. import "./chunk-SZFMKPVM.js";
  127. import "./chunk-YZVAB3DF.js";
  128. import "./chunk-JLYTER4T.js";
  129. import "./chunk-CRHRHOXH.js";
  130. import "./chunk-ZSW35JPD.js";
  131. import {
  132. r as r3
  133. } from "./chunk-JLSNMUQJ.js";
  134. import "./chunk-ECY35CJI.js";
  135. import "./chunk-PT62335L.js";
  136. import "./chunk-JGBXYDGB.js";
  137. import "./chunk-QEWF7QPH.js";
  138. import "./chunk-PJNBFKPF.js";
  139. import "./chunk-C7742RNZ.js";
  140. import "./chunk-FNA5GLRW.js";
  141. import "./chunk-MCWCB5IY.js";
  142. import "./chunk-TV3CFJQR.js";
  143. import {
  144. U,
  145. a,
  146. j as j3
  147. } from "./chunk-TJV6ODRM.js";
  148. import {
  149. v as v2
  150. } from "./chunk-JUWKPBLS.js";
  151. import {
  152. c as c3
  153. } from "./chunk-WLSB4F4I.js";
  154. import {
  155. c as c2,
  156. d,
  157. l as l2,
  158. m,
  159. p as p5
  160. } from "./chunk-GLSWDDR3.js";
  161. import {
  162. O
  163. } from "./chunk-MIQGEDET.js";
  164. import "./chunk-DUEMJ5XS.js";
  165. import "./chunk-VRLXUHP2.js";
  166. import "./chunk-3LVSQLWJ.js";
  167. import {
  168. c
  169. } from "./chunk-4ONPMX2F.js";
  170. import {
  171. F,
  172. v as v3
  173. } from "./chunk-CRGY2SDS.js";
  174. import "./chunk-4T5ZGMEN.js";
  175. import "./chunk-GN35O2ZO.js";
  176. import "./chunk-XTVKPAWY.js";
  177. import "./chunk-3OSQ6GXO.js";
  178. import "./chunk-3WQOA5CB.js";
  179. import {
  180. t as t4
  181. } from "./chunk-PLWDAYK7.js";
  182. import "./chunk-FZQZIM7U.js";
  183. import "./chunk-CZBRZ6SU.js";
  184. import "./chunk-VGWC3IKZ.js";
  185. import "./chunk-2H5MD622.js";
  186. import "./chunk-3RSFVUKZ.js";
  187. import "./chunk-UVVU4UUO.js";
  188. import "./chunk-HWSWTWZD.js";
  189. import "./chunk-O6VYMEIX.js";
  190. import "./chunk-X4SA4ELJ.js";
  191. import "./chunk-5N7JLUJJ.js";
  192. import "./chunk-ZAY3CMAZ.js";
  193. import {
  194. r as r4
  195. } from "./chunk-P3XKUGLS.js";
  196. import "./chunk-2ZSOO377.js";
  197. import "./chunk-YUA3AHKR.js";
  198. import "./chunk-LU5IJZB4.js";
  199. import "./chunk-7IBV2TRE.js";
  200. import "./chunk-ZLNEXZAN.js";
  201. import "./chunk-5UVJ64RB.js";
  202. import "./chunk-SFEFRQCL.js";
  203. import {
  204. b
  205. } from "./chunk-DXVOOCG4.js";
  206. import "./chunk-3GZSQU56.js";
  207. import "./chunk-ZYRIJWLX.js";
  208. import "./chunk-RYY6632W.js";
  209. import "./chunk-DW42UVIT.js";
  210. import "./chunk-YAEIHDJH.js";
  211. import "./chunk-TJNOJH33.js";
  212. import "./chunk-OSHI574D.js";
  213. import "./chunk-ETGAZ7LF.js";
  214. import "./chunk-75U5LM2V.js";
  215. import "./chunk-RMDDCMKS.js";
  216. import {
  217. v2 as v
  218. } from "./chunk-VCH45Q2I.js";
  219. import {
  220. j as j2
  221. } from "./chunk-LBW34VZ2.js";
  222. import "./chunk-GSSTTHIT.js";
  223. import "./chunk-YFSLJIO4.js";
  224. import "./chunk-IM3LVQXV.js";
  225. import "./chunk-55RWC67C.js";
  226. import "./chunk-HZRKBTHJ.js";
  227. import {
  228. U as U2
  229. } from "./chunk-DVUG3KID.js";
  230. import "./chunk-FWSQEIAR.js";
  231. import {
  232. G
  233. } from "./chunk-VEGAOVMY.js";
  234. import {
  235. o
  236. } from "./chunk-6T6G6LCQ.js";
  237. import "./chunk-YEJL5NEF.js";
  238. import "./chunk-PQFTYGF5.js";
  239. import {
  240. e,
  241. e2,
  242. l3 as l,
  243. n5 as n,
  244. r2,
  245. t2,
  246. t5 as t3,
  247. u2 as u,
  248. y3 as y2
  249. } from "./chunk-2Z2TG5CU.js";
  250. import "./chunk-6KZ2LTDA.js";
  251. import "./chunk-U2XHEJM7.js";
  252. import "./chunk-SQOPWYIT.js";
  253. import {
  254. j,
  255. w
  256. } from "./chunk-V6P2MAQQ.js";
  257. import {
  258. s2 as s,
  259. s3 as s2
  260. } from "./chunk-E5O6P5I2.js";
  261. import {
  262. y
  263. } from "./chunk-SPWQ3AWG.js";
  264. import "./chunk-2TIUKVZN.js";
  265. import {
  266. q,
  267. r,
  268. t
  269. } from "./chunk-YXWMMD76.js";
  270. import "./chunk-S5KM4IGW.js";
  271. // node_modules/@arcgis/core/layers/support/RangeInfo.js
  272. var s6 = class extends l {
  273. constructor() {
  274. super(...arguments), this.name = null, this.field = null, this.currentRangeExtent = null, this.fullRangeExtent = null, this.type = "rangeInfo";
  275. }
  276. };
  277. e([y2({ type: String, json: { read: true, write: true } })], s6.prototype, "name", void 0), e([y2({ type: String, json: { read: true, write: true } })], s6.prototype, "field", void 0), e([y2({ type: [Number], json: { read: true, write: true } })], s6.prototype, "currentRangeExtent", void 0), e([y2({ type: [Number], json: { read: true, write: true } })], s6.prototype, "fullRangeExtent", void 0), e([y2({ type: ["rangeInfo"], readOnly: true, json: { read: false, write: true } })], s6.prototype, "type", void 0), s6 = e([n("esri.layers.support.RangeInfo")], s6);
  278. // node_modules/@arcgis/core/layers/support/PolygonCollection.js
  279. var c4;
  280. var p6 = c4 = class extends u(j2.ofType(v)) {
  281. constructor(e3) {
  282. super(e3);
  283. }
  284. clone() {
  285. return new c4(this.items.map((e3) => e3.clone()));
  286. }
  287. write(e3, r5) {
  288. return this.toJSON(r5);
  289. }
  290. toJSON(e3) {
  291. var _a;
  292. const r5 = (_a = e3 == null ? void 0 : e3.layer) == null ? void 0 : _a.spatialReference;
  293. return r5 ? this.toArray().map((t9) => {
  294. if (!r5.equals(t9.spatialReference)) {
  295. if (!An(t9.spatialReference, r5))
  296. return e3 && e3.messages && e3.messages.push(new t3("scenefilter:unsupported", "Scene filters with incompatible spatial references are not supported", { modification: this, spatialReference: e3.layer.spatialReference, context: e3 })), null;
  297. const s8 = new v();
  298. mn(t9, s8, r5), t9 = s8;
  299. }
  300. const s7 = t9.toJSON(e3);
  301. return delete s7.spatialReference, s7;
  302. }).filter((e4) => null != e4) : ((e3 == null ? void 0 : e3.messages) && e3.messages.push(new t3("scenefilter:unsupported", "Writing Scene filters without context layer is not supported", { modification: this, spatialReference: e3.layer.spatialReference, context: e3 })), this.toArray().map((r6) => r6.toJSON(e3)));
  303. }
  304. static fromJSON(e3, r5) {
  305. const t9 = new c4();
  306. return e3.forEach((e4) => t9.add(v.fromJSON(e4, r5))), t9;
  307. }
  308. };
  309. p6 = c4 = e([n("esri.layers.support.PolygonCollection")], p6);
  310. var l5 = p6;
  311. // node_modules/@arcgis/core/layers/support/SceneFilter.js
  312. var g3;
  313. var f = g3 = class extends l {
  314. constructor(e3) {
  315. super(e3), this.spatialRelationship = "disjoint", this.geometries = new l5(), this._geometriesSource = null, this._handles = new t2();
  316. }
  317. initialize() {
  318. this._handles.add(a(() => this.geometries, "after-changes", () => this.geometries = this.geometries, U));
  319. }
  320. destroy() {
  321. this._handles.destroy();
  322. }
  323. readGeometries(e3, o2, r5) {
  324. this._geometriesSource = { url: c(e3, r5), context: r5 };
  325. }
  326. async loadGeometries(e3, r5) {
  327. if (t(this._geometriesSource))
  328. return;
  329. const { url: s7, context: t9 } = this._geometriesSource, p7 = await U2(s7, { responseType: "json", signal: q(r5, "signal") }), n3 = e3.toJSON(), c5 = p7.data.map((e4) => ({ ...e4, spatialReference: n3 }));
  330. this.geometries = l5.fromJSON(c5, t9), this._geometriesSource = null;
  331. }
  332. clone() {
  333. return new g3({ geometries: y(this.geometries), spatialRelationship: this.spatialRelationship });
  334. }
  335. };
  336. e([y2({ type: ["disjoint", "contains"], nonNullable: true, json: { write: true } })], f.prototype, "spatialRelationship", void 0), e([y2({ type: l5, nonNullable: true, json: { write: true } }), g2({ origins: ["web-scene", "portal-item"], type: "resource", prefix: "geometries" })], f.prototype, "geometries", void 0), e([o(["web-scene", "portal-item"], "geometries")], f.prototype, "readGeometries", null), f = g3 = e([n("esri.layers.support.SceneFilter")], f);
  337. var j5 = f;
  338. // node_modules/@arcgis/core/layers/SceneLayer.js
  339. var oe = ["3DObject", "Point"];
  340. var ae = s3();
  341. var ne = class extends a2(N(p(c3(v2(t4(O(i(b)))))))) {
  342. constructor(...e3) {
  343. super(...e3), this.featureReduction = null, this.rangeInfos = null, this.operationalLayerType = "ArcGISSceneServiceLayer", this.type = "scene", this.fields = null, this.floorInfo = null, this.outFields = null, this.nodePages = null, this.materialDefinitions = null, this.textureSetDefinitions = null, this.geometryDefinitions = null, this.serviceUpdateTimeStamp = null, this.excludeObjectIds = new j2(), this.definitionExpression = null, this.filter = null, this.path = null, this.labelsVisible = true, this.labelingInfo = null, this.legendEnabled = true, this.priority = null, this.semantic = null, this.cachedDrawingInfo = { color: false }, this.popupEnabled = true, this.popupTemplate = null, this.objectIdField = null, this.globalIdField = null, this._fieldUsageInfo = {}, this.screenSizePerspectiveEnabled = true;
  344. }
  345. normalizeCtorArgs(e3, t9) {
  346. return "string" == typeof e3 ? { url: e3, ...t9 } : e3;
  347. }
  348. getField(e3) {
  349. return this.fieldsIndex.get(e3);
  350. }
  351. getFieldDomain(e3, t9) {
  352. var _a, _b, _c, _d;
  353. const r5 = (_b = (_a = this.getFeatureType(t9 == null ? void 0 : t9.feature)) == null ? void 0 : _a.domains) == null ? void 0 : _b[e3];
  354. return r5 && "inherited" !== r5.type ? r5 : (_d = (_c = this.getField(e3)) == null ? void 0 : _c.domain) != null ? _d : null;
  355. }
  356. getFeatureType(e3) {
  357. return null != e3 && r(this.associatedLayer) ? this.associatedLayer.getFeatureType(e3) : null;
  358. }
  359. get types() {
  360. var _a;
  361. return r(this.associatedLayer) ? (_a = this.associatedLayer.types) != null ? _a : [] : [];
  362. }
  363. get typeIdField() {
  364. return r(this.associatedLayer) ? this.associatedLayer.typeIdField : null;
  365. }
  366. get formTemplate() {
  367. return r(this.associatedLayer) ? this.associatedLayer.formTemplate : null;
  368. }
  369. get fieldsIndex() {
  370. return new r3(this.fields);
  371. }
  372. readNodePages(e3, t9, r5) {
  373. return "Point" === t9.layerType && (e3 = t9.pointNodePages), null == e3 || "object" != typeof e3 ? null : s4.fromJSON(e3, r5);
  374. }
  375. set elevationInfo(e3) {
  376. this._set("elevationInfo", e3), this.loaded && this._validateElevationInfo();
  377. }
  378. get geometryType() {
  379. return le[this.profile] || "mesh";
  380. }
  381. set renderer(e3) {
  382. F(e3, this.fieldsIndex), this._set("renderer", e3);
  383. }
  384. readCachedDrawingInfo(e3) {
  385. return null != e3 && "object" == typeof e3 || (e3 = {}), null == e3.color && (e3.color = false), e3;
  386. }
  387. get capabilities() {
  388. const e3 = r(this.associatedLayer) && this.associatedLayer.capabilities ? this.associatedLayer.capabilities : t8, { query: t9, editing: { supportsGlobalId: r5, supportsRollbackOnFailure: s7, supportsUploadWithItemId: i3, supportsReturnServiceEditsInSourceSpatialReference: o2 }, data: { supportsZ: a3, supportsM: n3, isVersioned: l6, supportsAttachment: d3 }, operations: { supportsEditing: y3, supportsAdd: u3, supportsUpdate: c5, supportsDelete: f2, supportsQuery: h, supportsQueryAttachments: m3 } } = e3, g4 = e3.operations.supportsChangeTracking, v4 = t5();
  389. return { query: t9, editing: { supportsGlobalId: r5, supportsReturnServiceEditsInSourceSpatialReference: o2, supportsRollbackOnFailure: s7, supportsGeometryUpdate: false, supportsUploadWithItemId: i3 }, data: { supportsAttachment: d3, supportsZ: a3, supportsM: n3, isVersioned: l6 }, operations: { supportsQuery: h, supportsQueryAttachments: m3, supportsEditing: y3 && g4, supportsAdd: v4 && u3 && g4, supportsDelete: v4 && f2 && g4, supportsUpdate: c5 && g4 } };
  390. }
  391. get editingEnabled() {
  392. return this._isOverridden("editingEnabled") ? this._get("editingEnabled") : this.userHasEditingPrivileges;
  393. }
  394. set editingEnabled(e3) {
  395. this._overrideIfSome("editingEnabled", e3);
  396. }
  397. get infoFor3D() {
  398. return r(this.associatedLayer) ? this.associatedLayer.infoFor3D : null;
  399. }
  400. get defaultPopupTemplate() {
  401. return r(this.associatedLayer) || this.attributeStorageInfo ? this.createPopupTemplate() : null;
  402. }
  403. readObjectIdField(e3, t9) {
  404. return !e3 && t9.fields && t9.fields.some((t10) => ("esriFieldTypeOID" === t10.type && (e3 = t10.name), !!e3)), e3 || void 0;
  405. }
  406. readGlobalIdField(e3, t9) {
  407. return !e3 && t9.fields && t9.fields.some((t10) => ("esriFieldTypeGlobalID" === t10.type && (e3 = t10.name), !!e3)), e3 || void 0;
  408. }
  409. get displayField() {
  410. return r(this.associatedLayer) ? this.associatedLayer.displayField : null;
  411. }
  412. readProfile(e3, t9) {
  413. const r5 = t9.store.profile;
  414. return null != r5 && pe[r5] ? pe[r5] : (s.getLogger(this.declaredClass).error("Unknown or missing profile", { profile: r5, layer: this }), "mesh-pyramids");
  415. }
  416. load(e3) {
  417. const t9 = r(e3) ? e3.signal : null, r5 = this.loadFromPortal({ supportedTypes: ["Scene Service"] }, e3).catch(w).then(() => this._fetchService(t9)).then(() => Promise.all([this._fetchIndexAndUpdateExtent(this.nodePages, t9), this._setAssociatedFeatureLayer(t9), r(this.filter) ? this.filter.loadGeometries(this.spatialReference) : null])).then(() => this._validateElevationInfo()).then(() => this._applyAssociatedLayerOverrides()).then(() => this._populateFieldUsageInfo()).then(() => t7(this, { origin: "service" }, t9)).then(() => F(this.renderer, this.fieldsIndex)).then(() => this.finishLoadEditablePortalLayer(e3));
  418. return this.addResolvingPromise(r5), Promise.resolve(this);
  419. }
  420. async beforeSave() {
  421. r(this.filter) && await this.load();
  422. }
  423. createQuery() {
  424. const e3 = new x();
  425. return "mesh" !== this.geometryType && (e3.returnGeometry = true, e3.returnZ = true), e3.where = this.definitionExpression || "1=1", e3.sqlFormat = "standard", e3;
  426. }
  427. queryExtent(e3, t9) {
  428. return this._getAssociatedLayerForQuery().then((r5) => r5.queryExtent(e3 || this.createQuery(), t9));
  429. }
  430. queryFeatureCount(e3, t9) {
  431. return this._getAssociatedLayerForQuery().then((r5) => r5.queryFeatureCount(e3 || this.createQuery(), t9));
  432. }
  433. queryFeatures(e3, t9) {
  434. return this._getAssociatedLayerForQuery().then((r5) => r5.queryFeatures(e3 || this.createQuery(), t9)).then((e4) => {
  435. if (e4 == null ? void 0 : e4.features)
  436. for (const t10 of e4.features)
  437. t10.layer = this, t10.sourceLayer = this;
  438. return e4;
  439. });
  440. }
  441. async queryCachedAttributes(e3, t9) {
  442. const r5 = v3(this.fieldsIndex, await d2(this, s5(this)));
  443. return ye(this.parsedUrl.path, this.attributeStorageInfo, e3, t9, r5);
  444. }
  445. async queryCachedFeature(e3, r5) {
  446. const s7 = await this.queryCachedAttributes(e3, [r5]);
  447. if (!s7 || 0 === s7.length)
  448. throw new s2("scenelayer:feature-not-in-cached-data", "Feature not found in cached data");
  449. const i3 = new g();
  450. return i3.attributes = s7[0], i3.layer = this, i3.sourceLayer = this, i3;
  451. }
  452. queryObjectIds(e3, t9) {
  453. return this._getAssociatedLayerForQuery().then((r5) => r5.queryObjectIds(e3 || this.createQuery(), t9));
  454. }
  455. queryAttachments(e3, t9) {
  456. return this._getAssociatedLayerForQuery().then((r5) => r5.queryAttachments(e3, t9));
  457. }
  458. getFieldUsageInfo(e3) {
  459. const t9 = { supportsLabelingInfo: false, supportsRenderer: false, supportsPopupTemplate: false, supportsLayerQuery: false };
  460. return this.loaded ? this._fieldUsageInfo[e3] || t9 : (s.getLogger(this.declaredClass).error("#getFieldUsageInfo()", "Unavailable until layer is loaded"), t9);
  461. }
  462. createPopupTemplate(e3) {
  463. return p4(this, e3);
  464. }
  465. _getAssociatedLayerForQuery() {
  466. const e3 = this.associatedLayer;
  467. return r(e3) && e3.loaded ? Promise.resolve(e3) : this._loadAssociatedLayerForQuery();
  468. }
  469. async _loadAssociatedLayerForQuery() {
  470. if (await this.load(), t(this.associatedLayer))
  471. throw new s2("scenelayer:query-not-available", "SceneLayer queries are not available without an associated feature layer", { layer: this });
  472. try {
  473. await this.associatedLayer.load();
  474. } catch (e3) {
  475. throw new s2("scenelayer:query-not-available", "SceneLayer associated feature layer could not be loaded", { layer: this, error: e3 });
  476. }
  477. return this.associatedLayer;
  478. }
  479. hasCachedStatistics(e3) {
  480. return null != this.statisticsInfo && this.statisticsInfo.some((t9) => t9.name === e3);
  481. }
  482. async queryCachedStatistics(e3, t9) {
  483. if (await this.load(t9), !this.statisticsInfo)
  484. throw new s2("scenelayer:no-cached-statistics", "Cached statistics are not available for this layer");
  485. const r5 = this.fieldsIndex.get(e3);
  486. if (!r5)
  487. throw new s2("scenelayer:field-unexisting", `Field '${e3}' does not exist on the layer`);
  488. for (const s7 of this.statisticsInfo)
  489. if (s7.name === r5.name) {
  490. const e4 = G(this.parsedUrl.path, s7.href);
  491. return U2(e4, { query: { f: "json", token: this.apiKey }, responseType: "json", signal: t9 ? t9.signal : null }).then((e5) => e5.data);
  492. }
  493. throw new s2("scenelayer:no-cached-statistics", "Cached statistics for this attribute are not available");
  494. }
  495. async saveAs(e3, t9) {
  496. return this._debouncedSaveOperations(L.SAVE_AS, { ...t9, getTypeKeywords: () => this._getTypeKeywords(), portalItemLayerType: "scene" }, e3);
  497. }
  498. async save() {
  499. const e3 = { getTypeKeywords: () => this._getTypeKeywords(), portalItemLayerType: "scene" };
  500. return this._debouncedSaveOperations(L.SAVE, e3);
  501. }
  502. async applyEdits(e3, t9) {
  503. const r5 = await import("./editingSupport-YMIKJKVG.js");
  504. if (await this.load(), t(this.associatedLayer))
  505. throw new s2(`${this.type}-layer:not-editable`, "Service is not editable");
  506. return await this.associatedLayer.load(), r5.applyEdits(this, this.associatedLayer.source, e3, t9);
  507. }
  508. on(e3, t9) {
  509. return super.on(e3, t9);
  510. }
  511. validateLayer(e3) {
  512. if (e3.layerType && !oe.includes(e3.layerType))
  513. throw new s2("scenelayer:layer-type-not-supported", "SceneLayer does not support this layer type", { layerType: e3.layerType });
  514. if (isNaN(this.version.major) || isNaN(this.version.minor))
  515. throw new s2("layer:service-version-not-supported", "Service version is not supported.", { serviceVersion: this.version.versionString, supportedVersions: "1.x, 2.x" });
  516. if (this.version.major > 2)
  517. throw new s2("layer:service-version-too-new", "Service version is too new.", { serviceVersion: this.version.versionString, supportedVersions: "1.x, 2.x" });
  518. function t9(e4, t10) {
  519. let r5 = false, s7 = false;
  520. if (null == e4)
  521. r5 = true, s7 = true;
  522. else {
  523. const i3 = t10 && t10.isGeographic;
  524. switch (e4) {
  525. case "east-north-up":
  526. case "earth-centered":
  527. r5 = true, s7 = i3;
  528. break;
  529. case "vertex-reference-frame":
  530. r5 = true, s7 = !i3;
  531. break;
  532. default:
  533. r5 = false;
  534. }
  535. }
  536. if (!r5)
  537. throw new s2("scenelayer:unsupported-normal-reference-frame", "Normal reference frame is invalid.");
  538. if (!s7)
  539. throw new s2("scenelayer:incompatible-normal-reference-frame", "Normal reference frame is incompatible with layer spatial reference.");
  540. }
  541. t9(this.normalReferenceFrame, this.spatialReference);
  542. }
  543. _getTypeKeywords() {
  544. const e3 = [];
  545. if ("points" === this.profile)
  546. e3.push("Point");
  547. else {
  548. if ("mesh-pyramids" !== this.profile)
  549. throw new s2("scenelayer:unknown-profile", "SceneLayer:save() encountered an unknown SceneLayer profile: " + this.profile);
  550. e3.push("3DObject");
  551. }
  552. return e3;
  553. }
  554. _populateFieldUsageInfo() {
  555. if (this._fieldUsageInfo = {}, this.fields)
  556. for (const e3 of this.fields) {
  557. const t9 = !(!this.attributeStorageInfo || !this.attributeStorageInfo.some((t10) => t10.name === e3.name)), r5 = !!(r(this.associatedLayer) && this.associatedLayer.fields && this.associatedLayer.fields.some((t10) => t10 && e3.name === t10.name)), s7 = { supportsLabelingInfo: t9, supportsRenderer: t9, supportsPopupTemplate: t9 || r5, supportsLayerQuery: r5 };
  558. this._fieldUsageInfo[e3.name] = s7;
  559. }
  560. }
  561. _applyAssociatedLayerOverrides() {
  562. this._applyAssociatedLayerFieldsOverrides(), this._applyAssociatedLayerPopupOverrides();
  563. }
  564. _applyAssociatedLayerFieldsOverrides() {
  565. if (t(this.associatedLayer) || !this.associatedLayer.fields)
  566. return;
  567. let e3 = null;
  568. for (const t9 of this.associatedLayer.fields) {
  569. const r5 = this.getField(t9.name);
  570. r5 ? (!r5.domain && t9.domain && (r5.domain = t9.domain.clone()), r5.editable = t9.editable, r5.nullable = t9.nullable, r5.length = t9.length) : (e3 || (e3 = this.fields ? this.fields.slice() : []), e3.push(t9.clone()));
  571. }
  572. e3 && this._set("fields", e3);
  573. }
  574. _applyAssociatedLayerPopupOverrides() {
  575. if (t(this.associatedLayer))
  576. return;
  577. const e3 = ["popupTemplate", "popupEnabled"], t9 = e2(this);
  578. for (let r5 = 0; r5 < e3.length; r5++) {
  579. const s7 = e3[r5], i3 = this.originIdOf(s7), o2 = this.associatedLayer.originIdOf(s7);
  580. i3 < o2 && (o2 === r2.SERVICE || o2 === r2.PORTAL_ITEM) && t9.setAtOrigin(s7, this.associatedLayer[s7], o2);
  581. }
  582. }
  583. async _setAssociatedFeatureLayer(e3) {
  584. if (!["mesh-pyramids", "points"].includes(this.profile))
  585. return;
  586. const t9 = new l4(this.parsedUrl, this.portalItem, this.apiKey, e3);
  587. try {
  588. this.associatedLayer = await t9.fetch();
  589. } catch (r5) {
  590. j(r5) || this._logWarningOnPopupEnabled();
  591. }
  592. }
  593. async _logWarningOnPopupEnabled() {
  594. await j3(() => this.popupEnabled && null != this.popupTemplate);
  595. const e3 = `this SceneLayer: ${this.title}`;
  596. null == this.attributeStorageInfo ? s.getLogger(this.declaredClass).warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${e3}`) : s.getLogger(this.declaredClass).info(`Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on ${e3}`);
  597. }
  598. _validateElevationInfo() {
  599. const e3 = this.elevationInfo;
  600. e3 && ("mesh-pyramids" === this.profile && "relative-to-scene" === e3.mode && s.getLogger(this.declaredClass).warn(".elevationInfo=", "Mesh scene layers don't support relative-to-scene elevation mode"), e3.featureExpressionInfo && "0" !== e3.featureExpressionInfo.expression && s.getLogger(this.declaredClass).warn(".elevationInfo=", "Scene layers do not support featureExpressionInfo"));
  601. }
  602. };
  603. e([y2({ types: { key: "type", base: t6, typeMap: { selection: p3 } }, json: { origins: { "web-scene": { name: "layerDefinition.featureReduction", write: true }, "portal-item": { name: "layerDefinition.featureReduction", write: true } } } })], ne.prototype, "featureReduction", void 0), e([y2({ type: [s6], json: { read: false, origins: { "web-scene": { name: "layerDefinition.rangeInfos", write: true }, "portal-item": { name: "layerDefinition.rangeInfos", write: true } } } })], ne.prototype, "rangeInfos", void 0), e([y2({ json: { read: false } })], ne.prototype, "associatedLayer", void 0), e([y2({ type: ["show", "hide"] })], ne.prototype, "listMode", void 0), e([y2({ type: ["ArcGISSceneServiceLayer"] })], ne.prototype, "operationalLayerType", void 0), e([y2({ json: { read: false }, readOnly: true })], ne.prototype, "type", void 0), e([y2({ ...ae.fields, readOnly: true, json: { read: false, origins: { service: { read: true } } } })], ne.prototype, "fields", void 0), e([y2()], ne.prototype, "types", null), e([y2()], ne.prototype, "typeIdField", null), e([y2()], ne.prototype, "formTemplate", null), e([y2({ readOnly: true })], ne.prototype, "fieldsIndex", null), e([y2({ type: p2, json: { read: { source: "layerDefinition.floorInfo" }, write: { target: "layerDefinition.floorInfo" } } })], ne.prototype, "floorInfo", void 0), e([y2(ae.outFields)], ne.prototype, "outFields", void 0), e([y2({ type: s4, readOnly: true, json: { read: false } })], ne.prototype, "nodePages", void 0), e([o("service", "nodePages", ["nodePages", "pointNodePages"])], ne.prototype, "readNodePages", null), e([y2({ type: [l3], readOnly: true })], ne.prototype, "materialDefinitions", void 0), e([y2({ type: [u2], readOnly: true })], ne.prototype, "textureSetDefinitions", void 0), e([y2({ type: [m2], readOnly: true })], ne.prototype, "geometryDefinitions", void 0), e([y2({ readOnly: true })], ne.prototype, "serviceUpdateTimeStamp", void 0), e([y2({ readOnly: true })], ne.prototype, "attributeStorageInfo", void 0), e([y2({ readOnly: true })], ne.prototype, "statisticsInfo", void 0), e([y2({ type: j2.ofType(Number), nonNullable: true, json: { origins: { service: { read: false, write: false } }, name: "layerDefinition.excludeObjectIds", write: { enabled: true } } })], ne.prototype, "excludeObjectIds", void 0), e([y2({ type: String, json: { origins: { service: { read: false, write: false } }, name: "layerDefinition.definitionExpression", write: { enabled: true, allowNull: true } } })], ne.prototype, "definitionExpression", void 0), e([y2({ type: j5, json: { name: "layerDefinition.polygonFilter", write: { enabled: true, allowNull: true }, origins: { service: { read: false, write: false } } } })], ne.prototype, "filter", void 0), e([y2({ type: String, json: { origins: { "web-scene": { read: true, write: true } }, read: false } })], ne.prototype, "path", void 0), e([y2(d)], ne.prototype, "elevationInfo", null), e([y2({ type: String })], ne.prototype, "geometryType", null), e([y2(m)], ne.prototype, "labelsVisible", void 0), e([y2({ type: [j4], json: { origins: { service: { name: "drawingInfo.labelingInfo", read: { reader: i2 }, write: false } }, name: "layerDefinition.drawingInfo.labelingInfo", read: { reader: i2 }, write: true } })], ne.prototype, "labelingInfo", void 0), e([y2(c2)], ne.prototype, "legendEnabled", void 0), e([y2({ type: Number, json: { origins: { "web-document": { default: 1, write: { enabled: true, target: { opacity: { type: Number }, "layerDefinition.drawingInfo.transparency": { type: Number } } }, read: { source: ["opacity", "layerDefinition.drawingInfo.transparency"], reader(e3, t9) {
  604. var _a, _b;
  605. if ("number" == typeof e3 && e3 >= 0 && e3 <= 1)
  606. return e3;
  607. const r5 = (_b = (_a = t9.layerDefinition) == null ? void 0 : _a.drawingInfo) == null ? void 0 : _b.transparency;
  608. return void 0 !== r5 ? r4(r5) : void 0;
  609. } } }, "portal-item": { write: true }, service: { read: false } } } })], ne.prototype, "opacity", void 0), e([y2({ type: ["Low", "High"], readOnly: true, json: { read: false, origins: { service: { read: true } } } })], ne.prototype, "priority", void 0), e([y2({ type: ["Labels"], readOnly: true, json: { read: false, origins: { service: { read: true } } } })], ne.prototype, "semantic", void 0), e([y2({ types: n2, json: { origins: { service: { read: { source: "drawingInfo.renderer" } } }, name: "layerDefinition.drawingInfo.renderer", write: true }, value: null })], ne.prototype, "renderer", null), e([y2({ json: { read: false } })], ne.prototype, "cachedDrawingInfo", void 0), e([o("service", "cachedDrawingInfo")], ne.prototype, "readCachedDrawingInfo", null), e([y2({ readOnly: true, json: { read: false } })], ne.prototype, "capabilities", null), e([y2({ type: Boolean, json: { read: false } })], ne.prototype, "editingEnabled", null), e([y2({ readOnly: true, json: { write: false, read: false } })], ne.prototype, "infoFor3D", null), e([y2(p5)], ne.prototype, "popupEnabled", void 0), e([y2({ type: k, json: { name: "popupInfo", write: true } })], ne.prototype, "popupTemplate", void 0), e([y2({ readOnly: true, json: { read: false } })], ne.prototype, "defaultPopupTemplate", null), e([y2({ type: String, json: { read: false } })], ne.prototype, "objectIdField", void 0), e([o("service", "objectIdField", ["objectIdField", "fields"])], ne.prototype, "readObjectIdField", null), e([y2({ type: String, json: { read: false } })], ne.prototype, "globalIdField", void 0), e([o("service", "globalIdField", ["globalIdField", "fields"])], ne.prototype, "readGlobalIdField", null), e([y2({ readOnly: true, type: String, json: { read: false } })], ne.prototype, "displayField", null), e([y2({ type: String, json: { read: false } })], ne.prototype, "profile", void 0), e([o("service", "profile", ["store.profile"])], ne.prototype, "readProfile", null), e([y2({ readOnly: true, type: String, json: { origins: { service: { read: { source: "store.normalReferenceFrame" } } }, read: false } })], ne.prototype, "normalReferenceFrame", void 0), e([y2(l2)], ne.prototype, "screenSizePerspectiveEnabled", void 0), ne = e([n("esri.layers.SceneLayer")], ne);
  610. var pe = { "mesh-pyramids": "mesh-pyramids", meshpyramids: "mesh-pyramids", "features-meshes": "mesh-pyramids", points: "points", "features-points": "points", lines: "lines", "features-lines": "lines", polygons: "polygons", "features-polygons": "polygons" };
  611. var le = { "mesh-pyramids": "mesh", points: "point", lines: "polyline", polygons: "polygon" };
  612. var de = ne;
  613. export {
  614. de as default
  615. };
  616. //# sourceMappingURL=SceneLayer-IBSV3FAY.js.map