chunk-PHAKVYRM.js 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349
  1. import {
  2. e
  3. } from "./chunk-DMVKVC5I.js";
  4. import {
  5. rt
  6. } from "./chunk-JKFWEHNK.js";
  7. import {
  8. t as t2
  9. } from "./chunk-3IRT3YKJ.js";
  10. import {
  11. v
  12. } from "./chunk-RMDDCMKS.js";
  13. import {
  14. has
  15. } from "./chunk-SPWQ3AWG.js";
  16. import {
  17. f,
  18. i,
  19. r,
  20. t
  21. } from "./chunk-YXWMMD76.js";
  22. // node_modules/@arcgis/core/views/2d/layers/features/support/StaticBitSet.js
  23. var t3 = class {
  24. constructor(t4, e2) {
  25. this._mask = 0, this._buf = t4, this._mask = e2;
  26. }
  27. static fromBuffer(e2, s) {
  28. return new t3(e2, s);
  29. }
  30. static create(e2, s = 4294967295) {
  31. const r2 = new Uint32Array(Math.ceil(e2 / 32));
  32. return new t3(r2, s);
  33. }
  34. _getIndex(t4) {
  35. return Math.floor(t4 / 32);
  36. }
  37. has(t4) {
  38. const e2 = this._mask & t4;
  39. return !!(this._buf[this._getIndex(e2)] & 1 << e2 % 32);
  40. }
  41. hasRange(t4, e2) {
  42. let s = t4, r2 = e2;
  43. for (; s % 32 && s !== r2; ) {
  44. if (this.has(s))
  45. return true;
  46. s++;
  47. }
  48. for (; r2 % 32 && s !== r2; ) {
  49. if (this.has(s))
  50. return true;
  51. r2--;
  52. }
  53. if (s === r2)
  54. return false;
  55. for (let h2 = s / 32; h2 !== r2 / 32; h2++) {
  56. if (this._buf[h2])
  57. return true;
  58. }
  59. return false;
  60. }
  61. set(t4) {
  62. const e2 = this._mask & t4, s = this._getIndex(e2), r2 = 1 << e2 % 32;
  63. this._buf[s] |= r2;
  64. }
  65. setRange(t4, e2) {
  66. let s = t4, r2 = e2;
  67. for (; s % 32 && s !== r2; )
  68. this.set(s++);
  69. for (; r2 % 32 && s !== r2; )
  70. this.set(r2--);
  71. if (s !== r2)
  72. for (let h2 = s / 32; h2 !== r2 / 32; h2++)
  73. this._buf[h2] = 4294967295;
  74. }
  75. unset(t4) {
  76. const e2 = this._mask & t4, s = this._getIndex(e2), r2 = 1 << e2 % 32;
  77. this._buf[s] &= 4294967295 ^ r2;
  78. }
  79. resize(t4) {
  80. const e2 = this._buf, s = new Uint32Array(Math.ceil(t4 / 32));
  81. s.set(e2), this._buf = s;
  82. }
  83. or(t4) {
  84. for (let e2 = 0; e2 < this._buf.length; e2++)
  85. this._buf[e2] |= t4._buf[e2];
  86. return this;
  87. }
  88. and(t4) {
  89. for (let e2 = 0; e2 < this._buf.length; e2++)
  90. this._buf[e2] &= t4._buf[e2];
  91. return this;
  92. }
  93. xor(t4) {
  94. for (let e2 = 0; e2 < this._buf.length; e2++)
  95. this._buf[e2] ^= t4._buf[e2];
  96. return this;
  97. }
  98. ior(t4) {
  99. for (let e2 = 0; e2 < this._buf.length; e2++)
  100. this._buf[e2] |= ~t4._buf[e2];
  101. return this;
  102. }
  103. iand(t4) {
  104. for (let e2 = 0; e2 < this._buf.length; e2++)
  105. this._buf[e2] &= ~t4._buf[e2];
  106. return this;
  107. }
  108. ixor(t4) {
  109. for (let e2 = 0; e2 < this._buf.length; e2++)
  110. this._buf[e2] ^= ~t4._buf[e2];
  111. return this;
  112. }
  113. any() {
  114. for (let t4 = 0; t4 < this._buf.length; t4++)
  115. if (this._buf[t4])
  116. return true;
  117. return false;
  118. }
  119. copy(t4) {
  120. for (let e2 = 0; e2 < this._buf.length; e2++)
  121. this._buf[e2] = t4._buf[e2];
  122. return this;
  123. }
  124. clone() {
  125. return new t3(this._buf.slice(), this._mask);
  126. }
  127. clear() {
  128. for (let t4 = 0; t4 < this._buf.length; t4++)
  129. this._buf[t4] = 0;
  130. }
  131. forEachSet(t4) {
  132. for (let e2 = 0; e2 < this._buf.length; e2++) {
  133. let s = this._buf[e2], r2 = 32 * e2;
  134. if (s)
  135. for (; s; ) {
  136. 1 & s && t4(r2), s >>>= 1, r2++;
  137. }
  138. }
  139. }
  140. countSet() {
  141. let t4 = 0;
  142. return this.forEachSet((e2) => {
  143. t4++;
  144. }), t4;
  145. }
  146. };
  147. // node_modules/@arcgis/core/views/2d/layers/features/support/FeatureSetReader.js
  148. var h = 0;
  149. var _a;
  150. var u = (_a = has("featurelayer-simplify-thresholds")) != null ? _a : [0.5, 0.5, 0.5, 0.5];
  151. var l = u[0];
  152. var c = u[1];
  153. var m = u[2];
  154. var g = u[3];
  155. var _a2;
  156. var y = (_a2 = has("featurelayer-simplify-payload-size-factors")) != null ? _a2 : [1, 2, 4];
  157. var _ = y[0];
  158. var f2 = y[1];
  159. var p = y[2];
  160. var _a3;
  161. var x = (_a3 = has("featurelayer-simplify-mobile-factor")) != null ? _a3 : 2;
  162. var I = has("esri-mobile");
  163. var b = class {
  164. constructor(e2, t4) {
  165. this.type = "FeatureSetReader", this.arcadeDeclaredClass = "esri.arcade.Feature", this.seen = false, this.instance = 0, this._tx = 0, this._ty = 0, this._sx = 1, this._sy = 1, this._deleted = null, this._joined = [], this._objectIdToIndex = null, this._level = 0, this.instance = e2, this._layerSchema = t4;
  166. }
  167. static createInstance() {
  168. return h++, h = h > 65535 ? 0 : h, h;
  169. }
  170. get isEmpty() {
  171. return r(this._deleted) && this._deleted.countSet() === this.getSize();
  172. }
  173. set level(e2) {
  174. this._level = e2;
  175. }
  176. getAreaSimplificationThreshold(e2, t4) {
  177. let r2 = 1;
  178. const s = I ? x : 1;
  179. t4 > 4e6 ? r2 = p * s : t4 > 1e6 ? r2 = f2 * s : t4 > 5e5 ? r2 = _ * s : t4 > 1e5 && (r2 = s);
  180. let i2 = 0;
  181. e2 > 4e3 ? i2 = g * r2 : e2 > 2e3 ? i2 = m * r2 : e2 > 100 ? i2 = c : e2 > 15 && (i2 = l);
  182. let o = 8;
  183. return this._level < 4 ? o = 1 : this._level < 5 ? o = 2 : this._level < 6 && (o = 4), i2 * o;
  184. }
  185. createQuantizedExtrudedQuad(e2, t4) {
  186. return new t2([5], [e2 - 1, t4, 1, -1, 1, 1, -1, 1, -1, -1]);
  187. }
  188. setArcadeSpatialReference(e2) {
  189. this._arcadeSpatialReference = e2;
  190. }
  191. attachStorage(e2) {
  192. this._storage = e2;
  193. }
  194. getQuantizationTransform() {
  195. throw new Error("Unable to find transform for featureSet");
  196. }
  197. getStorage() {
  198. return this._storage;
  199. }
  200. getComputedNumeric(e2) {
  201. return this.getComputedNumericAtIndex(0);
  202. }
  203. setComputedNumeric(e2, t4) {
  204. return this.setComputedNumericAtIndex(t4, 0);
  205. }
  206. getComputedString(e2) {
  207. return this.getComputedStringAtIndex(0);
  208. }
  209. setComputedString(e2, t4) {
  210. return this.setComputedStringAtIndex(0, t4);
  211. }
  212. getComputedNumericAtIndex(e2) {
  213. return this._storage.getComputedNumericAtIndex(this.getDisplayId(), e2);
  214. }
  215. setComputedNumericAtIndex(e2, t4) {
  216. this._storage.setComputedNumericAtIndex(this.getDisplayId(), e2, t4);
  217. }
  218. getComputedStringAtIndex(e2) {
  219. return this._storage.getComputedStringAtIndex(this.getDisplayId(), e2);
  220. }
  221. setComputedStringAtIndex(e2, t4) {
  222. return this._storage.setComputedStringAtIndex(this.getDisplayId(), e2, t4);
  223. }
  224. transform(e2, t4, r2, s) {
  225. const i2 = this.copy();
  226. return i2._tx += e2, i2._ty += t4, i2._sx *= r2, i2._sy *= s, i2;
  227. }
  228. readAttribute(e2, t4 = false) {
  229. const r2 = this._readAttribute(e2, t4);
  230. if (void 0 !== r2)
  231. return r2;
  232. for (const s of this._joined) {
  233. s.setIndex(this.getIndex());
  234. const r3 = s._readAttribute(e2, t4);
  235. if (void 0 !== r3)
  236. return r3;
  237. }
  238. }
  239. readAttributes() {
  240. const e2 = this._readAttributes();
  241. for (const t4 of this._joined) {
  242. t4.setIndex(this.getIndex());
  243. const r2 = t4._readAttributes();
  244. for (const t5 of Object.keys(r2))
  245. e2[t5] = r2[t5];
  246. }
  247. return e2;
  248. }
  249. joinAttributes(e2) {
  250. this._joined.push(e2);
  251. }
  252. readArcadeFeature() {
  253. return this;
  254. }
  255. geometry() {
  256. const e2 = this.readHydratedGeometry(), t4 = rt(e2, this.geometryType, this.hasZ, this.hasM), r2 = v(t4);
  257. return r2 && (r2.spatialReference = this._arcadeSpatialReference), r2;
  258. }
  259. field(e2) {
  260. if (this.hasField(e2))
  261. return this.readAttribute(e2, true);
  262. for (const t4 of this._joined)
  263. if (t4.setIndex(this.getIndex()), t4.hasField(e2)) {
  264. return t4._readAttribute(e2, true);
  265. }
  266. throw new Error(`Field ${e2} does not exist`);
  267. }
  268. setField(e2, t4) {
  269. throw new Error("Unable to update feature attribute values, feature is readonly");
  270. }
  271. keys() {
  272. return this.getFieldNames();
  273. }
  274. castToText(e2 = false) {
  275. if (!e2)
  276. return JSON.stringify(this.readLegacyFeature());
  277. const t4 = this.readLegacyFeature();
  278. if (!t4)
  279. return JSON.stringify(null);
  280. const r2 = { geometry: t4.geometry, attributes: { ...t4.attributes ? t4.attributes : {} } };
  281. for (const s in r2.attributes) {
  282. const e3 = r2.attributes[s];
  283. e3 instanceof Date && (r2.attributes[s] = e3.getTime());
  284. }
  285. return JSON.stringify(r2);
  286. }
  287. gdbVersion() {
  288. return null;
  289. }
  290. fullSchema() {
  291. return this._layerSchema;
  292. }
  293. castAsJson(e2 = null) {
  294. return { attributes: this._readAttributes(), geometry: true === (e2 == null ? void 0 : e2.keepGeometryType) ? this.geometry() : this.geometry().toJSON() };
  295. }
  296. castAsJsonAsync(e2 = null, t4 = null) {
  297. return Promise.resolve(this.castAsJson(t4));
  298. }
  299. removeIds(e2) {
  300. if (t(this._objectIdToIndex)) {
  301. const e3 = /* @__PURE__ */ new Map(), t4 = this.getCursor();
  302. for (; t4.next(); ) {
  303. const s2 = f(t4.getObjectId());
  304. e3.set(s2, t4.getIndex());
  305. }
  306. this._objectIdToIndex = e3;
  307. }
  308. const s = this._objectIdToIndex;
  309. for (const t4 of e2)
  310. s.has(t4) && this.removeAtIndex(s.get(t4));
  311. }
  312. removeAtIndex(e2) {
  313. t(this._deleted) && (this._deleted = t3.create(this.getSize())), this._deleted.set(e2);
  314. }
  315. readGeometryForDisplay() {
  316. return this.readUnquantizedGeometry(true);
  317. }
  318. readLegacyGeometryForDisplay() {
  319. return this.readLegacyGeometry(true);
  320. }
  321. *features() {
  322. const e2 = this.getCursor();
  323. for (; e2.next(); )
  324. yield e2.readOptimizedFeature();
  325. }
  326. _getExists() {
  327. return t(this._deleted) || !this._deleted.has(this.getIndex());
  328. }
  329. _computeCentroid() {
  330. if ("esriGeometryPolygon" !== this.geometryType)
  331. return null;
  332. const e2 = this.readUnquantizedGeometry();
  333. if (!e2 || e2.hasIndeterminateRingOrder)
  334. return null;
  335. const t4 = i(this.getQuantizationTransform(), null);
  336. return e(new t2(), e2, this.hasM, this.hasZ, t4);
  337. }
  338. copyInto(e2) {
  339. e2.seen = this.seen, e2._storage = this._storage, e2._arcadeSpatialReference = this._arcadeSpatialReference, e2._joined = this._joined, e2._tx = this._tx, e2._ty = this._ty, e2._sx = this._sx, e2._sy = this._sy, e2._deleted = this._deleted, e2._objectIdToIndex = this._objectIdToIndex;
  340. }
  341. };
  342. export {
  343. t3 as t,
  344. b
  345. };
  346. //# sourceMappingURL=chunk-PHAKVYRM.js.map