123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158 |
- import {
- F
- } from "./chunk-XYIYXU3I.js";
- import {
- e as e4
- } from "./chunk-T6DJ6UAT.js";
- import {
- h as h3
- } from "./chunk-WOGDHLUJ.js";
- import {
- i as i2
- } from "./chunk-YG7DNOY4.js";
- import {
- u as u2,
- y as y4
- } from "./chunk-KUAEOLV3.js";
- import {
- a as a2
- } from "./chunk-ZLQP3WDC.js";
- import {
- d as d2,
- s as s3
- } from "./chunk-TE2TRGVU.js";
- import {
- S
- } from "./chunk-XO5VJRK4.js";
- import {
- l as l4
- } from "./chunk-YFDOPEEZ.js";
- import {
- w as w3,
- y as y3
- } from "./chunk-JFSMKLAQ.js";
- import {
- b as b2,
- d,
- f,
- g as g3,
- m as m2
- } from "./chunk-LXOC7SMQ.js";
- import {
- u
- } from "./chunk-OUUXJOLT.js";
- import {
- l as l2
- } from "./chunk-QC7NCR5N.js";
- import {
- l as l3
- } from "./chunk-JQUWFKNU.js";
- import {
- x as x3
- } from "./chunk-NLLFSKB2.js";
- import {
- e as e3
- } from "./chunk-TFHLTN6F.js";
- import {
- o as o3
- } from "./chunk-OFTOCPN5.js";
- import {
- g as g2
- } from "./chunk-7C23ILQ4.js";
- import {
- x as x2
- } from "./chunk-WD4J43GZ.js";
- import {
- a,
- h,
- j as j3,
- l,
- w
- } from "./chunk-TJV6ODRM.js";
- import {
- g as g4
- } from "./chunk-GLSWDDR3.js";
- import {
- D as D2,
- O,
- T,
- W,
- h as h2,
- j as j4,
- v,
- w as w4,
- xe,
- z
- } from "./chunk-CRGY2SDS.js";
- import {
- i
- } from "./chunk-4T5ZGMEN.js";
- import {
- j as j2
- } from "./chunk-LBW34VZ2.js";
- import {
- _
- } from "./chunk-55RWC67C.js";
- import {
- o as o2,
- w2
- } from "./chunk-6T6G6LCQ.js";
- import {
- k2 as k
- } from "./chunk-PQFTYGF5.js";
- import {
- e,
- m,
- n5 as n,
- y3 as y2
- } from "./chunk-2Z2TG5CU.js";
- import {
- D,
- E,
- b,
- g,
- j,
- x
- } from "./chunk-V6P2MAQQ.js";
- import {
- s2 as s,
- s3 as s2
- } from "./chunk-E5O6P5I2.js";
- import {
- has,
- y
- } from "./chunk-SPWQ3AWG.js";
- import {
- e as e2,
- o,
- r,
- t
- } from "./chunk-YXWMMD76.js";
- // node_modules/@arcgis/core/AggregateGraphic.js
- var p = class extends g2 {
- constructor() {
- super(...arguments), this.isAggregate = true;
- }
- getEffectivePopupTemplate(e6 = false) {
- if (this.popupTemplate)
- return this.popupTemplate;
- const r3 = this.sourceLayer && this.sourceLayer.featureReduction;
- return r3 && "popupTemplate" in r3 && r3.popupEnabled ? r3.popupTemplate : null;
- }
- getObjectId() {
- return this.attributes.aggregateId;
- }
- };
- e([y2({ type: Boolean })], p.prototype, "isAggregate", void 0), p = e([n("esri.AggregateGraphic")], p);
- var s4 = p;
- // node_modules/@arcgis/core/layers/effects/FeatureEffectView.js
- var r2 = class extends m {
- constructor(e6) {
- super(e6), this._filter = null, this.duration = has("mapview-transitions-duration"), this._excludedEffectView = new a2(e6), this._includedEffectView = new a2(e6);
- }
- get excludedEffects() {
- return this._excludedEffectView.effects;
- }
- set featureEffect(e6) {
- this._get("featureEffect") !== e6 && this._transitionTo(e6);
- }
- get filter() {
- var _a;
- return this._filter || ((_a = e2(this.featureEffect)) == null ? void 0 : _a.filter) || null;
- }
- get hasEffects() {
- return this._excludedEffectView.hasEffects || this._includedEffectView.hasEffects;
- }
- get includedEffects() {
- return this._includedEffectView.effects;
- }
- set scale(e6) {
- this._set("scale", e6), this._excludedEffectView.scale = e6, this._includedEffectView.scale = e6;
- }
- get transitioning() {
- return this._excludedEffectView.transitioning || this._includedEffectView.transitioning;
- }
- transitionStep(e6, t2) {
- this._set("scale", t2), this.transitioning ? (this._includedEffectView.transitionStep(e6, t2), this._excludedEffectView.transitionStep(e6, t2), this.transitioning || (this._filter = null)) : (this._excludedEffectView.scale = t2, this._includedEffectView.scale = t2);
- }
- endTransitions() {
- this._includedEffectView.endTransitions(), this._excludedEffectView.endTransitions(), this._filter = null;
- }
- _transitionTo(e6) {
- const t2 = this._get("featureEffect"), s6 = e2(e6), f2 = e2(s6 == null ? void 0 : s6.includedEffect), c3 = e2(s6 == null ? void 0 : s6.excludedEffect), r3 = this._includedEffectView.canTransitionTo(f2) && this._excludedEffectView.canTransitionTo(c3);
- this._includedEffectView.effect = f2, this._excludedEffectView.effect = c3, this._set("featureEffect", s6), this._filter = (s6 == null ? void 0 : s6.filter) || (t2 == null ? void 0 : t2.filter) || null, r3 || this.endTransitions();
- }
- };
- e([y2()], r2.prototype, "_filter", void 0), e([y2()], r2.prototype, "_excludedEffectView", void 0), e([y2()], r2.prototype, "_includedEffectView", void 0), e([y2()], r2.prototype, "duration", void 0), e([y2()], r2.prototype, "excludedEffects", null), e([y2()], r2.prototype, "featureEffect", null), e([y2()], r2.prototype, "filter", null), e([y2()], r2.prototype, "hasEffects", null), e([y2()], r2.prototype, "includedEffects", null), e([y2({ value: 0 })], r2.prototype, "scale", null), e([y2()], r2.prototype, "transitioning", null), r2 = e([n("esri.layers.effects.FeatureEffectView")], r2);
- var o4 = r2;
- // node_modules/@arcgis/core/rest/support/AggregateFeatureSet.js
- var m3 = class extends x3 {
- constructor() {
- super(...arguments), this.features = [];
- }
- readFeatures(e6, o5) {
- var _a;
- const s6 = k.fromJSON(o5.spatialReference), a4 = [];
- for (let p2 = 0; p2 < e6.length; p2++) {
- const o6 = e6[p2], c3 = s4.fromJSON(o6), m4 = o6.geometry && o6.geometry.spatialReference;
- r(c3.geometry) && !m4 && (c3.geometry.spatialReference = s6);
- const i5 = o6.aggregateGeometries, f2 = c3.aggregateGeometries;
- if (i5 && r(f2))
- for (const e7 in f2) {
- const r3 = f2[e7], o7 = (_a = i5[e7]) == null ? void 0 : _a.spatialReference;
- r(r3) && !o7 && (r3.spatialReference = s6);
- }
- a4.push(c3);
- }
- return a4;
- }
- };
- e([y2({ type: [s4], json: { write: true } })], m3.prototype, "features", void 0), e([o2("features")], m3.prototype, "readFeatures", null), m3 = e([n("esri.rest.support.AggregateFeatureSet")], m3);
- var i3 = m3;
- // node_modules/@arcgis/core/views/2d/layers/features/tileRenderers.js
- async function e5(e6, r3) {
- if (!e6)
- return null;
- switch (e6.type) {
- case "symbol":
- return new (await import("./SymbolTileRenderer-4VQTMK6G.js")).default(r3);
- case "heatmap":
- return new (await import("./HeatmapTileRenderer-OVKMQRO5.js")).default(r3);
- }
- }
- // node_modules/@arcgis/core/views/2d/layers/support/FeatureCommandQueue.js
- function a3(e6) {
- return e6.some((e7) => e7.globalId);
- }
- function d3(e6) {
- return e6.filter((e7) => !e7.error).map((e7) => {
- var _a;
- return (_a = e7.objectId) != null ? _a : e7.globalId;
- });
- }
- function i4(e6, r3) {
- const s6 = new Set(e6);
- for (const t2 of r3.values())
- s6.add(t2);
- return s6;
- }
- function n2(e6, r3) {
- const s6 = new Set(e6);
- for (const t2 of r3.values())
- s6.delete(t2);
- return s6;
- }
- var c = class extends m {
- constructor(e6) {
- super(e6), this._hasGlobalIds = false;
- }
- normalizeCtorArgs(e6) {
- return this._queueProcessor = new l2({ concurrency: 1, process: e6.process }), {};
- }
- destroy() {
- this.clear();
- }
- get updating() {
- return this._queueProcessor.length > 0;
- }
- clear() {
- this._queueProcessor.clear();
- }
- push(e6) {
- const r3 = this._queueProcessor, s6 = r3.last();
- switch (e6.type) {
- case "update":
- case "refresh":
- if ((s6 == null ? void 0 : s6.type) === e6.type)
- return;
- r3.push(e6).finally(() => this.notifyChange("updating"));
- break;
- case "edit": {
- const t2 = "processed-edit" === (s6 == null ? void 0 : s6.type) ? s6 : null;
- t2 && r3.popLast();
- const o5 = this._mergeEdits(t2, e6);
- for (const e7 of o5)
- r3.push(e7).finally(() => this.notifyChange("updating"));
- break;
- }
- }
- this.notifyChange("updating");
- }
- _mergeEdits(e6, r3) {
- var _a, _b;
- const { addedFeatures: s6, deletedFeatures: t2, updatedFeatures: o5 } = r3.edits;
- if (this._hasGlobalIds = this._hasGlobalIds || a3(s6) || a3(o5) || a3(t2), this._hasGlobalIds) {
- return [e6, { type: "processed-edit", edits: { addOrModified: [...s6, ...o5], removed: t2 } }];
- }
- const c3 = new Set(d3((_a = e6 == null ? void 0 : e6.edits.addOrModified) != null ? _a : [])), u5 = new Set(d3((_b = e6 == null ? void 0 : e6.edits.removed) != null ? _b : [])), p2 = /* @__PURE__ */ new Set([...d3(s6), ...d3(o5)]), l7 = new Set(d3(t2));
- return [{ type: "processed-edit", edits: { addOrModified: Array.from(i4(n2(c3, l7), p2)).map((e7) => ({ objectId: e7 })), removed: Array.from(i4(n2(u5, p2), l7)).map((e7) => ({ objectId: e7 })) } }];
- }
- };
- e([y2({ readOnly: true })], c.prototype, "updating", null), c = e([n("esri.views.2d.layers.support.FeatureCommandQueue")], c);
- var u3 = c;
- // node_modules/@arcgis/core/views/2d/layers/support/FeatureLayerProxy.js
- function c2(e6) {
- return Array.isArray(e6);
- }
- var u4 = class extends _ {
- constructor(e6) {
- super(e6), this._startupResolver = D(), this.isReady = false;
- }
- initialize() {
- this._controller = new AbortController(), this.addResolvingPromise(this._startWorker(this._controller.signal));
- }
- destroy() {
- this._controller.abort(), this._connection && this._connection.close();
- }
- set tileRenderer(e6) {
- this.client.tileRenderer = e6;
- }
- get closed() {
- return this._connection.closed;
- }
- async startup(e6, t2, r3, s6) {
- await this.when();
- const o5 = this._controller.signal, i5 = c2(r3.source) ? { transferList: r3.source, signal: o5 } : void 0, n3 = { service: r3, config: t2, tileInfo: e6.tileInfo.toJSON(), tiles: s6 };
- await this._connection.invoke("startup", n3, i5), this._startupResolver.resolve(), this._set("isReady", true);
- }
- async updateTiles(e6) {
- return await this._startupResolver.promise, g(this._connection.invoke("updateTiles", e6));
- }
- async update(e6) {
- const t2 = { config: e6 };
- return await this._startupResolver.promise, this._connection.invoke("update", t2);
- }
- async applyUpdate(e6) {
- return await this._startupResolver.promise, this._connection.invoke("applyUpdate", e6);
- }
- async setHighlight(e6) {
- return await this._startupResolver.promise, g(this._connection.invoke("controller.setHighlight", e6));
- }
- async stop() {
- if (await this._startupResolver.promise, !this.closed)
- return g(this._connection.invoke("stop"));
- }
- async refresh(e6) {
- return await this._startupResolver.promise, g(this._connection.invoke("controller.refresh", e6));
- }
- async querySummaryStatistics(e6, t2, r3) {
- return await this._startupResolver.promise, this._connection.invoke("controller.querySummaryStatistics", { query: e6.toJSON(), params: t2 }, r3);
- }
- async queryAggregateSummaryStatistics(e6, t2, r3) {
- return await this._startupResolver.promise, this._connection.invoke("controller.queryAggregateSummaryStatistics", { query: e6.toJSON(), params: t2 }, r3);
- }
- async queryUniqueValues(e6, t2, r3) {
- return await this._startupResolver.promise, this._connection.invoke("controller.queryUniqueValues", { query: e6.toJSON(), params: t2 }, r3);
- }
- async queryAggregateUniqueValues(e6, t2, r3) {
- return await this._startupResolver.promise, this._connection.invoke("controller.queryAggregateUniqueValues", { query: e6.toJSON(), params: t2 }, r3);
- }
- async queryClassBreaks(e6, t2, r3) {
- return await this._startupResolver.promise, this._connection.invoke("controller.queryClassBreaks", { query: e6.toJSON(), params: t2 }, r3);
- }
- async queryAggregateClassBreaks(e6, t2, r3) {
- return await this._startupResolver.promise, this._connection.invoke("controller.queryAggregateClassBreaks", { query: e6.toJSON(), params: t2 }, r3);
- }
- async queryHistogram(e6, t2, r3) {
- return await this._startupResolver.promise, this._connection.invoke("controller.queryHistogram", { query: e6.toJSON(), params: t2 }, r3);
- }
- async queryAggregateHistogram(e6, t2, r3) {
- return await this._startupResolver.promise, this._connection.invoke("controller.queryAggregateHistogram", { query: e6.toJSON(), params: t2 }, r3);
- }
- async queryFeatures(e6, t2) {
- return await this._startupResolver.promise, this._connection.invoke("controller.queryFeatures", e6.toJSON(), t2);
- }
- async queryVisibleFeatures(e6, t2) {
- return await this._startupResolver.promise, this._connection.invoke("controller.queryVisibleFeatures", e6.toJSON(), t2);
- }
- async queryObjectIds(e6, t2) {
- return await this._startupResolver.promise, this._connection.invoke("controller.queryObjectIds", e6.toJSON(), t2);
- }
- async queryFeatureCount(e6, t2) {
- return await this._startupResolver.promise, this._connection.invoke("controller.queryFeatureCount", e6.toJSON(), t2);
- }
- async queryExtent(e6, t2) {
- return this._connection.invoke("controller.queryExtent", e6.toJSON(), t2);
- }
- async queryLatestObservations(e6, t2) {
- return await this._startupResolver.promise, this._connection.invoke("controller.queryLatestObservations", e6.toJSON(), t2);
- }
- async queryStatistics(e6) {
- return await this._startupResolver.promise, this._connection.invoke("controller.queryStatistics", e6);
- }
- async queryAggregates(e6, t2) {
- return await this._startupResolver.promise, this._connection.invoke("controller.queryAggregates", e6.toJSON(), t2);
- }
- async queryAggregateCount(e6, t2) {
- return await this._startupResolver.promise, this._connection.invoke("controller.queryAggregateCount", e6.toJSON(), t2);
- }
- async queryAggregateIds(e6, t2) {
- return await this._startupResolver.promise, this._connection.invoke("controller.queryAggregateIds", e6.toJSON(), t2);
- }
- async getObjectId(e6) {
- return await this._startupResolver.promise, this._connection.invoke("controller.getObjectId", e6);
- }
- async getDisplayId(e6) {
- return await this._startupResolver.promise, this._connection.invoke("controller.getDisplayId", e6);
- }
- async getFeatures(e6) {
- return await this._startupResolver.promise, this._connection.invoke("controller.getFeatures", e6);
- }
- async getAggregates() {
- return await this._startupResolver.promise, this._connection.invoke("controller.getAggregates");
- }
- async getAggregateValueRanges() {
- return await this._startupResolver.promise, this._connection.invoke("controller.getAggregateValueRanges");
- }
- async mapValidDisplayIds(e6) {
- return await this._startupResolver.promise, this._connection.invoke("controller.mapValidDisplayIds", e6);
- }
- async onEdits(e6) {
- return await this._startupResolver.promise, g(this._connection.invoke("controller.onEdits", e6));
- }
- async enableEvent(e6, t2) {
- return await this._startupResolver.promise, g(this._connection.invoke("controller.enableEvent", { name: e6, value: t2 }));
- }
- pauseStream() {
- return g(this._connection.invoke("controller.pauseStream"));
- }
- resumeStream() {
- return g(this._connection.invoke("controller.resumeStream"));
- }
- async _startWorker(e6) {
- try {
- this._connection = await u("Pipeline", { client: this.client, strategy: "dedicated", signal: e6 });
- } catch (t2) {
- b(t2);
- }
- }
- };
- e([y2()], u4.prototype, "isReady", void 0), e([y2({ constructOnly: true })], u4.prototype, "client", void 0), e([y2()], u4.prototype, "tileRenderer", null), u4 = e([n("esri.views.2d.layers.support.FeatureLayerProxy")], u4);
- var l5 = u4;
- // node_modules/@arcgis/core/views/2d/tiling/TileManager.js
- var s5 = 1e-6;
- var l6 = class {
- constructor(e6) {
- this._tiles = /* @__PURE__ */ new Map(), this.buffer = 0, this.acquireTile = e6.acquireTile, this.releaseTile = e6.releaseTile, this.tileInfoView = e6.tileInfoView, this.buffer = e6.buffer;
- }
- destroy() {
- }
- clear() {
- this._tiles.forEach((e6) => this._releaseTile(e6));
- }
- tileKeys() {
- const e6 = [];
- return this._tiles.forEach((i5, t2) => e6.push(t2)), e6;
- }
- update(e6) {
- const s6 = this.tileInfoView.getTileCoverage(e6.state, this.buffer, "closest"), { spans: l7, lodInfo: r3 } = s6, { level: a4 } = r3, o5 = [], d4 = [], h4 = /* @__PURE__ */ new Set(), n3 = /* @__PURE__ */ new Set();
- for (const { row: i5, colFrom: c3, colTo: f2 } of l7)
- for (let e7 = c3; e7 <= f2; e7++) {
- const s7 = e3.getId(a4, i5, r3.normalizeCol(e7), r3.getWorldForColumn(e7)), l8 = this._getOrAcquireTile(o5, s7);
- h4.add(s7), l8.isReady ? l8.visible = true : n3.add(l8.key);
- }
- n3.forEach((e7) => this._addPlaceholders(h4, e7)), this._tiles.forEach((e7) => {
- h4.has(e7.key.id) || (d4.push(e7.key.id), this._releaseTile(e7));
- }), l3.pool.release(s6);
- return { hasMissingTiles: n3.size > 0, added: o5, removed: d4 };
- }
- _getOrAcquireTile(e6, i5) {
- if (!this._tiles.has(i5)) {
- const s6 = this.acquireTile(new e3(i5));
- e6.push(i5), this._tiles.set(i5, s6), s6.visible = false;
- }
- return this._tiles.get(i5);
- }
- _getTile(e6) {
- return this._tiles.get(e6);
- }
- _releaseTile(e6) {
- this._tiles.delete(e6.key.id), this.releaseTile(e6);
- }
- _addPlaceholders(e6, i5) {
- const t2 = this._addPlaceholderChildren(e6, i5);
- if (!(Math.abs(1 - t2) < s5)) {
- if (!this._addPlaceholderParent(e6, i5)) {
- this._getTile(i5.id).visible = true;
- }
- }
- }
- _addPlaceholderChildren(e6, i5) {
- let t2 = 0;
- return this._tiles.forEach((s6) => {
- t2 += this._addPlaceholderChild(e6, s6, i5);
- }), t2;
- }
- _addPlaceholderChild(e6, i5, t2) {
- if (i5.key.level <= t2.level || !i5.hasData || !t2.contains(i5.key))
- return 0;
- i5.visible = true, e6.add(i5.key.id);
- return 1 / (1 << 2 * (i5.key.level - t2.level));
- }
- _addPlaceholderParent(i5, t2) {
- let s6 = t2.getParentKey(), l7 = 0, r3 = null;
- for (; r(s6); ) {
- if (i5.has(s6.id))
- return true;
- const e6 = this._getTile(s6.id);
- if (e6 == null ? void 0 : e6.isReady) {
- for (const e7 of i5) {
- const i6 = this._getTile(e7);
- s6.contains(i6.key) && (i6.visible = false);
- }
- return e6.visible = true, i5.add(e6.key.id), true;
- }
- (e6 == null ? void 0 : e6.hasData) && e6.patchCount > l7 && (l7 = e6.patchCount, r3 = e6), s6 = s6.getParentKey();
- }
- return !!r3 && (r3.visible = true, i5.add(r3.key.id), true);
- }
- };
- // node_modules/@arcgis/core/views/layers/FeatureLayerView.js
- var _2 = "esri.views.layers.FeatureLayerView";
- var O2 = s.getLogger(_2);
- var A = (r3) => {
- let A2 = class extends r3 {
- constructor(...e6) {
- super(...e6), this._updatingRequiredFieldsPromise = null, this.filter = null, this.timeExtent = null, this.layer = null, this.requiredFields = [], this.view = null;
- }
- initialize() {
- this.handles.add([l(() => {
- var _a;
- const e6 = this.layer;
- return [(_a = e6 == null ? void 0 : e6.elevationInfo) == null ? void 0 : _a.featureExpressionInfo, e6 && "displayField" in e6 ? e6.displayField : null, e6 == null ? void 0 : e6.timeInfo, e6 && "renderer" in e6 && e6.renderer, e6 && "labelingInfo" in e6 && e6.labelingInfo, e6 && "floorInfo" in e6 && e6.floorInfo, this.filter, this.featureEffect, this.timeExtent];
- }, () => this._handleRequiredFieldsChange(), w), a(() => {
- var _a;
- return (_a = this.view) == null ? void 0 : _a.floors;
- }, "change", () => this._handleRequiredFieldsChange()), a(() => {
- const e6 = this.layer;
- return e6 && "sublayers" in e6 && e6.sublayers;
- }, "change", () => this._handleRequiredFieldsChange())]);
- }
- get availableFields() {
- const { layer: e6, layer: { fieldsIndex: t2 }, requiredFields: r4 } = this;
- return "outFields" in e6 && e6.outFields ? T(t2, [...v(t2, e6.outFields), ...r4]) : T(t2, r4);
- }
- get featureEffect() {
- return this.layer && "featureEffect" in this.layer ? this.layer.featureEffect : null;
- }
- set featureEffect(e6) {
- this._override("featureEffect", e6);
- }
- get maximumNumberOfFeatures() {
- return 0;
- }
- set maximumNumberOfFeatures(e6) {
- O2.error("#maximumNumberOfFeatures=", "Setting maximum number of features is not supported");
- }
- get maximumNumberOfFeaturesExceeded() {
- return false;
- }
- highlight(e6) {
- throw new Error("missing implementation");
- }
- createQuery() {
- const e6 = { outFields: ["*"], returnGeometry: true, outSpatialReference: this.view.spatialReference }, t2 = r(this.filter) ? this.filter.createQuery(e6) : new x2(e6);
- if ("feature" === this.layer.type) {
- const e7 = o3(this);
- r(e7) && (t2.where = t2.where ? `(${t2.where}) AND (${e7})` : e7);
- }
- return r(this.timeExtent) && (t2.timeExtent = r(t2.timeExtent) ? t2.timeExtent.intersection(this.timeExtent) : this.timeExtent.clone()), t2;
- }
- createAggregateQuery() {
- const e6 = { outFields: ["*"], returnGeometry: true, outSpatialReference: this.view.spatialReference };
- return new x2(e6);
- }
- queryFeatures(e6, t2) {
- throw new Error("missing implementation");
- }
- queryObjectIds(e6, t2) {
- throw new Error("missing implementation");
- }
- queryFeatureCount(e6, t2) {
- throw new Error("missing implementation");
- }
- queryExtent(e6, t2) {
- throw new Error("missing implementation");
- }
- async fetchPopupFeatures(e6, t2) {
- const r4 = this.validateFetchPopupFeatures(t2);
- if (r4)
- throw r4;
- return this.fetchClientPopupFeatures(t2);
- }
- _loadArcadeModules(e6) {
- if (e6.get("expressionInfos.length") || Array.isArray(e6.content) && e6.content.some((e7) => "expression" === e7.type))
- return i();
- }
- _handleRequiredFieldsChange() {
- const e6 = this._updateRequiredFields();
- this._set("_updatingRequiredFieldsPromise", e6), e6.then(() => {
- this._updatingRequiredFieldsPromise === e6 && this._set("_updatingRequiredFieldsPromise", null);
- });
- }
- async _updateRequiredFields() {
- if (!this.layer || !this.view)
- return;
- const e6 = "3d" === this.view.type, { layer: t2, layer: { fieldsIndex: r4, objectIdField: s6 } } = this, n3 = "renderer" in t2 && t2.renderer, a4 = "orderBy" in t2 && t2.orderBy, l7 = "featureReduction" in t2 ? t2.featureReduction : null, u5 = /* @__PURE__ */ new Set(), p2 = await E([n3 ? n3.collectRequiredFields(u5, r4) : null, W(u5, t2), e6 ? D2(u5, t2) : null, r(this.filter) ? j4(u5, t2, this.filter) : null, r(this.featureEffect) ? j4(u5, t2, this.featureEffect.filter) : null, l7 ? O(u5, t2, l7) : null, a4 ? z(u5, t2, a4) : null]);
- if (t2.timeInfo && this.timeExtent && h2(u5, t2.fieldsIndex, [t2.timeInfo.startField, t2.timeInfo.endField]), "feature" === t2.type && (t2.floorInfo && h2(u5, t2.fieldsIndex, [t2.floorInfo.floorField]), e6 && r(t2.infoFor3D) && (null == t2.globalIdField && O2.error("globalIdField missing on 3DObjectFeatureLayer"), h2(u5, t2.fieldsIndex, [t2.globalIdField]))), "subtype-group" === t2.type) {
- w4(u5, r4, t2.subtypeField);
- const e7 = t2.sublayers.map((e8) => {
- var _a;
- return Promise.all([(_a = e8.renderer) == null ? void 0 : _a.collectRequiredFields(u5, r4), W(u5, e8)]);
- });
- await E(e7);
- }
- for (const i5 of p2)
- i5.error && O2.error(i5.error);
- w4(u5, r4, s6), e6 && "displayField" in t2 && t2.displayField && w4(u5, r4, t2.displayField);
- const d4 = Array.from(u5).sort();
- this._set("requiredFields", d4);
- }
- validateFetchPopupFeatures(e6) {
- if (t(e6))
- return null;
- for (const r4 of e6.clientGraphics) {
- const i5 = r4.layer;
- if ("popupEnabled" in i5 && !i5.popupEnabled)
- return new s2("featurelayerview:fetchPopupFeatures", "Popups are disabled", { layer: i5 });
- if (r4.isAggregate) {
- const e7 = "featureReduction" in i5 ? i5.featureReduction : null;
- if (!(e7 && "popupTemplate" in e7 && e7.popupEnabled && e7.popupTemplate))
- return new s2("featurelayerview:fetchPopupFeatures", "Popups are disabled", { layer: i5 });
- } else if ("popupTemplate" in i5) {
- if (!s3(i5, e6))
- return new s2("featurelayerview:fetchPopupFeatures", "Layer does not define a popup template", { layer: i5 });
- }
- }
- }
- async fetchClientPopupFeatures(e6) {
- const t2 = r(e6) ? e6.clientGraphics : null;
- if (!t2 || 0 === t2.length)
- return [];
- const r4 = new Array(t2.length), o5 = /* @__PURE__ */ new Map(), n3 = await this.createPopupQuery(e6);
- for (let i5 = 0; i5 < t2.length; i5++) {
- const a4 = t2[i5];
- if (a4.isAggregate) {
- r4[i5] = a4;
- continue;
- }
- const { layer: l7 } = a4;
- if (!("popupEnabled" in l7))
- continue;
- const u5 = v(this.layer.fieldsIndex, n3.outFields), p2 = s3(l7, e6);
- if (t(p2))
- continue;
- const d4 = await this._loadArcadeModules(p2);
- d4 && d4.arcadeUtils.hasGeometryOperations(p2) || !xe(u5, a4) ? o5.set(a4.getObjectId(), i5) : r4[i5] = a4;
- }
- if ("stream" === this.layer.type || 0 === o5.size)
- return r4.filter(Boolean);
- n3.objectIds = Array.from(o5.keys());
- try {
- const e7 = await this.layer.queryFeatures(n3);
- for (const t3 of e7.features) {
- r4[o5.get(t3.getObjectId())] = t3;
- }
- } catch {
- }
- return r4.filter(Boolean);
- }
- async createPopupQuery(e6) {
- const t2 = this.layer.createQuery(), r4 = /* @__PURE__ */ new Set();
- let o5 = false;
- const n3 = r(e6) && e6.clientGraphics ? e6.clientGraphics.map((e7) => e7.layer) : [this.layer];
- for (const i5 of n3) {
- if (!("popupEnabled" in i5))
- continue;
- const t3 = s3(i5, e6);
- if (t(t3))
- continue;
- const n4 = await this._loadArcadeModules(t3), a4 = n4 && n4.arcadeUtils.hasGeometryOperations(t3);
- o5 = !("point" !== this.layer.geometryType && !a4);
- const l7 = await d2(this.layer, t3);
- for (const e7 of l7)
- r4.add(e7);
- }
- if (t2.returnGeometry = o5, t2.returnZ = o5, t2.returnM = o5, t2.outFields = Array.from(r4), t2.outSpatialReference = this.view.spatialReference, "feature" === this.layer.type) {
- const e7 = o3(this);
- r(e7) && (t2.where = t2.where ? `(${t2.where}) AND (${e7})` : e7);
- }
- return t2;
- }
- canResume() {
- return !!super.canResume() && (!r(this.timeExtent) || !this.timeExtent.isEmpty);
- }
- };
- return e([y2()], A2.prototype, "_updatingRequiredFieldsPromise", void 0), e([y2({ readOnly: true })], A2.prototype, "availableFields", null), e([y2({ type: w3 })], A2.prototype, "featureEffect", null), e([y2({ type: y3 })], A2.prototype, "filter", void 0), e([y2(g4)], A2.prototype, "timeExtent", void 0), e([y2()], A2.prototype, "layer", void 0), e([y2({ type: Number })], A2.prototype, "maximumNumberOfFeatures", null), e([y2({ readOnly: true, type: Boolean })], A2.prototype, "maximumNumberOfFeaturesExceeded", null), e([y2({ readOnly: true })], A2.prototype, "requiredFields", void 0), e([y2()], A2.prototype, "suspended", void 0), e([y2()], A2.prototype, "view", void 0), A2 = e([n(_2)], A2), A2;
- };
- // node_modules/@arcgis/core/views/2d/layers/FeatureLayerView2D.js
- function J(e6) {
- return e6 && "openPorts" in e6;
- }
- var M = class extends A(i2(y4(u2))) {
- constructor() {
- super(...arguments), this._pipelineIsUpdating = true, this._commandsQueue = new u3({ process: (e6) => {
- switch (e6.type) {
- case "processed-edit":
- return this._doEdit(e6);
- case "refresh":
- return this._doRefresh(e6.dataChanged);
- case "update":
- return this._doUpdate();
- }
- } }), this._visibilityOverrides = /* @__PURE__ */ new Set(), this._highlightIds = /* @__PURE__ */ new Map(), this._updateHighlight = x(async () => this._proxy.setHighlight(Array.from(this._highlightIds.keys()))), this._uploadsLocked = false, this._needsClusterSizeUpdate = false, this.featureEffectView = new o4(), this._lastDefinitionExpression = null;
- }
- destroy() {
- var _a;
- o(this._updateClusterSizeTask, (e6) => e6.remove()), (_a = this._proxy) == null ? void 0 : _a.destroy(), this._commandsQueue.destroy();
- }
- initialize() {
- this.addResolvingPromise(Promise.all([this._initProxy(), this._initServiceOptions()])), this.handles.add([this.on("valueRangesChanged", (e6) => {
- this._set("_aggregateValueRanges", e6.valueRanges);
- }), l(() => this.featureEffect, (e6) => {
- this.featureEffectView.featureEffect = e6;
- }, w)]), this.featureEffectView.endTransitions();
- }
- async _initProxy() {
- const e6 = this.layer;
- if ("isTable" in e6 && e6.isTable)
- throw new s2("featurelayerview:table-not-supported", "table feature layer can't be displayed", { layer: this.layer });
- const t2 = "feature" === e6.type || "subtype-group" === e6.type, r3 = "capabilities" in e6 && e6.capabilities.operations.supportsQuery;
- if (t2 && !r3)
- throw new s2("featurelayerview:query-not-supported", "layer view requires a layer with query capability", { layer: e6 });
- this._proxy && this._proxy.destroy();
- const i5 = this._createClientOptions();
- return this._set("_proxy", new l5({ client: i5 })), this._proxy.when();
- }
- async _initServiceOptions() {
- return this._set("_serviceOptions", await this._createServiceOptions()), this._serviceOptions;
- }
- get orderByFields() {
- return "stream" !== this._serviceOptions.type && this._serviceOptions.orderByFields;
- }
- get labelsVisible() {
- const e6 = "subtype-group" === this.layer.type ? this.layer.sublayers.items : [this.layer];
- return !this.suspended && e6.some((e7) => e7.labelingInfo && e7.labelsVisible);
- }
- get queryMode() {
- return this._serviceOptions.type;
- }
- get renderingConfigHash() {
- var _a, _b;
- if (!this.layer)
- return null;
- const e6 = this.availableFields, t2 = this.layer, r3 = this.view.floors, { definitionExpression: i5 } = t2, s6 = "subtype-group" !== this.layer.type && this.layer.labelsVisible && this.layer.labelingInfo, a4 = "renderer" in t2 && t2.renderer, n3 = "gdbVersion" in t2 ? t2.gdbVersion : void 0, o5 = "historicMoment" in t2 ? (_a = t2.historicMoment) == null ? void 0 : _a.getTime() : void 0, { timeExtent: u5 } = this, h4 = "customParameters" in t2 ? JSON.stringify(t2.customParameters) : void 0, d4 = "apiKey" in t2 ? t2.apiKey : void 0, p2 = "stream" === t2.type ? `${JSON.stringify(t2.geometryDefinition)}${t2.definitionExpression}` : null, c3 = JSON.stringify(this.clips), y5 = "featureReduction" in t2 ? (_b = t2.featureReduction) == null ? void 0 : _b.toJSON() : null, g5 = "orderBy" in this.layer && JSON.stringify(this.layer.orderBy), f2 = "sublayers" in this.layer && this.layer.sublayers.items.reduce((e7, t3) => e7 + `${t3.visible ? 1 : 0}.${JSON.stringify(t3.renderer)}.${t3.labelsVisible}
- .${JSON.stringify(t3.labelingInfo)}`, ""), m4 = "subtypeCode" in this.layer && this.layer.subtypeCode;
- return JSON.stringify({ orderBy: g5, sublayerHash: f2, subtypeCode: m4, filterHash: r(this.filter) && this.filter.toJSON(), effectHash: r(this.featureEffect) && this.featureEffect.toJSON(), streamFilter: p2, gdbVersion: n3, definitionExpression: i5, historicMoment: o5, availableFields: e6, renderer: a4, labelingInfo: s6, timeExtent: u5, floors: r3, clipsHash: c3, featureReduction: y5, customParameters: h4, apiKey: d4 });
- }
- highlight(e6) {
- let t2;
- return e6 instanceof g2 ? t2 = [e6.getObjectId()] : "number" == typeof e6 || "string" == typeof e6 ? t2 = [e6] : j2.isCollection(e6) && e6.length > 0 ? t2 = e6.map((e7) => e7 == null ? void 0 : e7.getObjectId()).toArray() : Array.isArray(e6) && e6.length > 0 && (t2 = "number" == typeof e6[0] || "string" == typeof e6[0] ? e6 : e6.map((e7) => e7 == null ? void 0 : e7.getObjectId())), t2 = t2 == null ? void 0 : t2.filter((e7) => null != e7), t2 && t2.length ? (this._addHighlight(t2), { remove: () => this._removeHighlight(t2) }) : { remove: () => {
- } };
- }
- hasHighlight() {
- return !!this._highlightIds.size;
- }
- async hitTest(e6, i5) {
- if (!this.tileRenderer)
- return null;
- const s6 = await this.tileRenderer.hitTest(i5);
- if (0 === s6.length)
- return null;
- const { features: a4, aggregates: n3 } = await this._proxy.getFeatures(s6);
- return [...n3.map((r3) => this._createGraphicHit(e6, s4.fromJSON(r3))), ...a4.map((t2) => this._createGraphicHit(e6, g2.fromJSON(t2)))];
- }
- queryStatistics() {
- return this._proxy.queryStatistics();
- }
- async querySummaryStatistics(e6, t2, r3) {
- const i5 = { ...t2, scale: this.view.scale };
- return this._proxy.querySummaryStatistics(this._cleanUpQuery(e6), i5, r3);
- }
- async queryAggregateSummaryStatistics(e6, t2, r3) {
- const i5 = { ...t2, scale: this.view.scale };
- return this._proxy.queryAggregateSummaryStatistics(this._cleanUpAggregateQuery(e6), i5, r3);
- }
- async queryUniqueValues(e6, t2, r3) {
- const i5 = { ...t2, scale: this.view.scale };
- return this._proxy.queryUniqueValues(this._cleanUpQuery(e6), i5, r3);
- }
- async queryAggregateUniqueValues(e6, t2, r3) {
- const i5 = { ...t2, scale: this.view.scale };
- return this._proxy.queryAggregateUniqueValues(this._cleanUpAggregateQuery(e6), i5, r3);
- }
- async queryClassBreaks(e6, t2, r3) {
- const i5 = { ...t2, scale: this.view.scale };
- return this._proxy.queryClassBreaks(this._cleanUpQuery(e6), i5, r3);
- }
- async queryAggregateClassBreaks(e6, t2, r3) {
- const i5 = { ...t2, scale: this.view.scale };
- return this._proxy.queryAggregateClassBreaks(this._cleanUpAggregateQuery(e6), i5, r3);
- }
- async queryHistogram(e6, t2, r3) {
- const i5 = { ...t2, scale: this.view.scale };
- return this._proxy.queryHistogram(this._cleanUpQuery(e6), i5, r3);
- }
- async queryAggregateHistogram(e6, t2, r3) {
- const i5 = { ...t2, scale: this.view.scale };
- return this._proxy.queryAggregateHistogram(this._cleanUpAggregateQuery(e6), i5, r3);
- }
- queryFeatures(e6, t2) {
- return this.queryFeaturesJSON(e6, t2).then((e7) => {
- const t3 = x3.fromJSON(e7);
- return t3.features.forEach((e8) => this._setLayersForFeature(e8)), t3;
- });
- }
- queryVisibleFeatures(e6, t2) {
- return this._proxy.queryVisibleFeatures(this._cleanUpQuery(e6), t2).then((e7) => {
- const t3 = x3.fromJSON(e7);
- return t3.features.forEach((e8) => this._setLayersForFeature(e8)), t3;
- });
- }
- async queryAggregates(e6, t2) {
- const r3 = await this._proxy.queryAggregates(this._cleanUpAggregateQuery(e6), t2), i5 = i3.fromJSON(r3);
- return i5.features.forEach((e7) => this._setLayersForFeature(e7)), i5;
- }
- queryAggregateIds(e6, t2) {
- return this._proxy.queryAggregateIds(this._cleanUpAggregateQuery(e6), t2);
- }
- queryAggregateCount(e6, t2) {
- return this._proxy.queryAggregateCount(this._cleanUpAggregateQuery(e6), t2);
- }
- queryAggregateJSON(e6, t2) {
- return this._proxy.queryAggregates(this._cleanUpAggregateQuery(e6), t2);
- }
- queryFeaturesJSON(e6, t2) {
- return this._proxy.queryFeatures(this._cleanUpQuery(e6), t2);
- }
- queryObjectIds(e6, t2) {
- return this._proxy.queryObjectIds(this._cleanUpQuery(e6), t2);
- }
- queryFeatureCount(e6, t2) {
- return this._proxy.queryFeatureCount(this._cleanUpQuery(e6), t2);
- }
- queryExtent(e6, t2) {
- return this._proxy.queryExtent(this._cleanUpQuery(e6), t2).then((e7) => ({ count: e7.count, extent: w2.fromJSON(e7.extent) }));
- }
- setVisibility(e6, t2) {
- t2 ? this._visibilityOverrides.delete(e6) : this._visibilityOverrides.add(e6), this._update();
- }
- update(e6) {
- if (!this._tileStrategy || !this.tileRenderer)
- return;
- const { hasMissingTiles: t2, added: r3, removed: i5 } = this._tileStrategy.update(e6);
- (r3.length || i5.length) && this._proxy.updateTiles({ added: r3, removed: i5 }), t2 && this.requestUpdate(), this.notifyChange("updating");
- }
- attach() {
- this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`), this._tileStrategy = new l6({ acquireTile: (e6) => this._acquireTile(e6), releaseTile: (e6) => this._releaseTile(e6), tileInfoView: this.view.featuresTilingScheme, buffer: 0 }), this.handles.add(l(() => this.renderingConfigHash, () => this._update(), h), "attach"), "stream" !== this.layer.type && this.handles.add(this.layer.on("edits", (e6) => this._edit(e6)), "attach");
- }
- detach() {
- var _a;
- this._commandsQueue.clear(), (_a = this._proxy) == null ? void 0 : _a.stop(), this.container.removeAllChildren(), this.handles.remove("attach"), this.tileRenderer && (this.tileRenderer.uninstall(this.container), this.tileRenderer = null), this._tileStrategy && (this._tileStrategy.destroy(), this._tileStrategy = null), this._tileRendererHash = null;
- }
- moveStart() {
- this.requestUpdate();
- }
- viewChange() {
- this.requestUpdate();
- }
- moveEnd() {
- this.requestUpdate();
- }
- isUpdating() {
- var _a;
- const e6 = "renderer" in this.layer && null != this.layer.renderer, t2 = this._commandsQueue.updating, r3 = null != this._updatingRequiredFieldsPromise, i5 = !this._proxy || !this._proxy.isReady, s6 = this._pipelineIsUpdating, a4 = null == this.tileRenderer || ((_a = this.tileRenderer) == null ? void 0 : _a.updating), n3 = e6 && (t2 || r3 || i5 || s6 || a4);
- return has("esri-2d-log-updating") && console.log(`Updating FLV2D: ${n3}
- -> hasRenderer ${e6}
- -> hasPendingCommand ${t2}
- -> updatingRequiredFields ${r3}
- -> updatingProxy ${i5}
- -> updatingPipeline ${s6}
- -> updatingTileRenderer ${a4}
- `), n3;
- }
- _createClientOptions() {
- return { setUpdating: (e6) => {
- this._set("_pipelineIsUpdating", e6);
- }, emitEvent: (e6) => {
- this.emit(e6.name, e6.event);
- } };
- }
- async _detectQueryMode(e6) {
- var _a;
- const t2 = "path" in e6, r3 = "editingInfo" in this.layer && ((_a = this.layer.editingInfo) == null ? void 0 : _a.lastEditDate), i5 = !!this.layer.refreshInterval, s6 = !r3 && i5;
- if (t2 && ("feature" === this.layer.type || "subtype-group" === this.layer.type) && "point" === this.layer.geometryType && this.layer.capabilities.query.supportsPagination && !this.layer.capabilities.operations.supportsEditing && !s6 && has("featurelayer-snapshot-enabled"))
- try {
- const e7 = await this.layer.queryFeatureCount();
- if (e7 <= has("featurelayer-snapshot-point-min-threshold"))
- return { mode: "snapshot", featureCount: e7 };
- const t3 = has("featurelayer-snapshot-point-max-threshold"), r4 = has("featurelayer-snapshot-point-coverage"), i6 = this.view.extent, s7 = e2(this.layer.fullExtent), a4 = s7 == null ? void 0 : s7.clone().intersection(i6), n3 = r(a4) ? a4.width * a4.height : 0, o5 = (s7 == null ? void 0 : s7.width) * (s7 == null ? void 0 : s7.height), h4 = 0 === o5 ? 0 : n3 / o5;
- if (e7 <= t3 && h4 >= r4)
- return { mode: "snapshot", featureCount: e7 };
- } catch (a4) {
- s.getLogger(this.declaredClass).warn("mapview-feature-layer", "Encountered an error when querying for featureCount", { error: a4 });
- }
- return { mode: "on-demand" };
- }
- async _createServiceOptions() {
- var _a;
- const e6 = this.layer;
- if ("stream" === e6.type)
- return null;
- const { capabilities: t2, objectIdField: r3 } = e6, i5 = e6.fields.map((e7) => e7.toJSON()), s6 = r(e6.fullExtent) && e6.fullExtent.toJSON(), n3 = e4(e6.geometryType), o5 = e6.timeInfo && e6.timeInfo.toJSON() || null, u5 = e6.spatialReference ? e6.spatialReference.toJSON() : null, h4 = "feature" === e6.type ? e6.globalIdField : null;
- let d4;
- "ogc-feature" === e6.type ? d4 = e6.source.getSource() : J(e6.source) ? d4 = await e6.source.openPorts() : e6.parsedUrl && (d4 = y(e6.parsedUrl), "dynamicDataSource" in e6 && e6.dynamicDataSource && (d4.query = { layer: JSON.stringify({ source: e6.dynamicDataSource }) }));
- const p2 = "datesInUnknownTimezone" in this.layer && this.layer.datesInUnknownTimezone, c3 = (_a = "subtypeField" in this.layer && this.layer.subtypeField) != null ? _a : null, { mode: y5, featureCount: g5 } = await this._detectQueryMode(d4);
- let f2 = this.layer.objectIdField;
- if ("feature" === this.layer.type && r(this.layer.orderBy) && this.layer.orderBy.length) {
- const e7 = !this.layer.orderBy[0].valueExpression && this.layer.orderBy[0].field;
- e7 && (f2 = e7);
- }
- return { type: y5, timeReferenceUnknownClient: p2, subtypeField: c3, featureCount: g5, globalIdField: h4, maxRecordCount: t2.query.maxRecordCount, tileMaxRecordCount: t2.query.tileMaxRecordCount, capabilities: t2, fields: i5, fullExtent: s6, geometryType: n3, objectIdField: r3, source: d4, timeInfo: o5, spatialReference: u5, orderByFields: f2 };
- }
- async _createMemoryServiceOptions(e6) {
- const t2 = await e6.openPorts();
- return { ...this._createServiceOptions(), type: "memory", source: t2 };
- }
- _cleanUpQuery(e6) {
- const t2 = x2.from(e6) || this.createQuery();
- return t2.outSpatialReference || (t2.outSpatialReference = this.view.spatialReference), t2;
- }
- _cleanUpAggregateQuery(e6) {
- const t2 = x2.from(e6) || this.createAggregateQuery();
- return t2.outSpatialReference || (t2.outSpatialReference = this.view.spatialReference), t2;
- }
- async _update() {
- return this._commandsQueue.push({ type: "update" });
- }
- async _edit(e6) {
- if (this.suspended)
- return void this._clearTiles();
- return this._validateEdit(e6) ? this._commandsQueue.push({ type: "edit", edits: e6 }) : void 0;
- }
- async doRefresh(e6) {
- if (this.attached && this._tileStrategy.tileKeys().length)
- return this.suspended && e6 ? void this._clearTiles() : this._commandsQueue.push({ type: "refresh", dataChanged: e6 });
- }
- _clearTiles() {
- this._tileStrategy.tileKeys().length && (this._proxy.updateTiles({ added: [], removed: this._tileStrategy.tileKeys() }), this._tileStrategy.clear(), this.requestUpdate(), this._commandsQueue.clear(), this._update());
- }
- _validateEdit(e6) {
- const t2 = "globalIdField" in this.layer && this.layer.globalIdField, r3 = e6.deletedFeatures.some((e7) => -1 === e7.objectId || !e7.objectId), i5 = t2 && this.availableFields.includes(t2);
- return r3 && !i5 ? (s.getLogger(this.declaredClass).error(new s2("mapview-apply-edits", `Editing the specified service requires the layer's globalIdField, ${t2} to be included the layer's outFields for updates to be reflected on the map`)), null) : e6;
- }
- async _doUpdate() {
- try {
- if (this.destroyed || !this._hasRequiredSupport(this.layer) || !this._tileStrategy)
- return;
- const { featureEffectView: t2, filter: r3 } = this;
- await this._updateRequiredFields();
- const { renderer: i5 } = this._getEffectiveRenderer();
- this._set("_effectiveRenderer", i5);
- const s6 = this._createSchemaConfig(), a4 = this._createConfiguration(s6, r3, t2.filter), o5 = this._lastDefinitionExpression !== a4.schema.source.definitionExpression;
- this._lastDefinitionExpression = a4.schema.source.definitionExpression;
- const l7 = a4.schema.tileRenderer, u5 = this._createTileRendererHash(l7);
- if ("snapshot" === this._serviceOptions.type && (a4.schema.source.initialFeatureCount = this._serviceOptions.featureCount), u5 !== this._tileRendererHash) {
- await this._initTileRenderer(l7, i5);
- const e6 = this.layer, t3 = "stream" === e6.type ? await this._initServiceOptions() : this._serviceOptions;
- this.tileRenderer.onConfigUpdate(i5), "stream" !== e6.type && J(e6.source) && (t3.source = await e6.source.openPorts());
- const r4 = { added: this._tileStrategy.tileKeys(), removed: [] };
- await this._proxy.startup(this.view.featuresTilingScheme, a4, t3, r4), this.hasHighlight() && await this._proxy.setHighlight(Array.from(this._highlightIds.keys())), await this._onceTilesUpdated(), this.tileRenderer.onConfigUpdate(i5);
- } else {
- "snapshot" === this._serviceOptions.type && o5 && (a4.schema.source.changedFeatureCount = await this.layer.queryFeatureCount());
- const t3 = await this._proxy.update(a4);
- (t3.mesh || t3.targets.aggregate) && this._lockGPUUploads();
- try {
- await this._proxy.applyUpdate(t3);
- } catch (e6) {
- j(e6) || s.getLogger(this.declaredClass).error(e6);
- }
- (t3.mesh || t3.targets.aggregate) && this._unlockGPUUploads(), this.tileRenderer.onConfigUpdate(i5), this._updateClusterSizeVariable(), this._forceAttributeTextureUpload();
- }
- this._tileRendererHash = u5, this.tileRenderer.invalidateLabels(), this.requestUpdate();
- } catch (e6) {
- }
- }
- async _doEdit(e6) {
- try {
- await this._proxy.onEdits(e6);
- } catch (t2) {
- j(t2), 0;
- }
- }
- async _doRefresh(e6) {
- this._lockGPUUploads();
- try {
- let t3;
- e6 && "snapshot" === this.queryMode && "queryFeatureCount" in this.layer && (t3 = await this.layer.queryFeatureCount()), await this._proxy.refresh({ dataChanged: e6, featureCount: t3 });
- } catch (r3) {
- j(r3), 0;
- }
- this._unlockGPUUploads();
- const t2 = this.layer;
- t2 && "featureReduction" in t2 && t2.featureReduction && this._updateClusterSizeVariable();
- }
- _updateClusterSizeVariable() {
- this._needsClusterSizeUpdate && (this.tileRenderer.onConfigUpdate(this._effectiveRenderer), this._needsClusterSizeUpdate = false);
- }
- _createUpdateClusterSizeTask(e6, t2) {
- return l(() => this._aggregateValueRanges, (r3) => {
- this._updateClusterEffectiveRendererSizeVariable(e6, t2, r3), this._needsClusterSizeUpdate = true, this._uploadsLocked || this._updateClusterSizeVariable();
- });
- }
- async _updateClusterEffectiveRendererSizeVariable(e6, t2, r3) {
- if (e6.dynamicClusterSize && "visualVariables" in e6 && e6.visualVariables) {
- const i5 = f(e6.visualVariables);
- if (r(i5) && "cluster_count" === i5.field) {
- const s6 = e6.visualVariables.indexOf(i5);
- e6.visualVariables[s6] = b2(t2, r3);
- const a4 = e6.clone();
- a4.dynamicClusterSize = true, this._set("_effectiveRenderer", a4);
- }
- }
- }
- _getEffectiveRenderer() {
- var _a;
- const e6 = this.layer, t2 = "renderer" in e6 ? e6.renderer : null, r3 = "featureReduction" in e6 ? e6.featureReduction : null;
- if (r(this._updateClusterSizeTask) && (this._updateClusterSizeTask.remove(), this._updateClusterSizeTask = null), r3 && "renderer" in r3 && r3.renderer && !((_a = r3.renderer.authoringInfo) == null ? void 0 : _a.isAutoGenerated)) {
- const e7 = r3.fields;
- if ("cluster" === r3.type) {
- const { renderer: t3, didInject: i5 } = m2(r3.renderer, r3, this._aggregateValueRanges);
- return i5 && (o(this._updateClusterSizeTask, (e8) => e8.remove()), this._updateClusterSizeTask = this._createUpdateClusterSizeTask(t3, r3)), { renderer: t3, aggregateFields: e7, featureReduction: r3 };
- }
- return { renderer: r3.renderer, aggregateFields: e7, featureReduction: r3 };
- }
- if (r3 && "cluster" === r3.type && g3(t2)) {
- const e7 = r3, i5 = [], s6 = d(i5, t2, e7, this._aggregateValueRanges, true);
- return o(this._updateClusterSizeTask, (e8) => e8.remove()), this._updateClusterSizeTask = this._createUpdateClusterSizeTask(s6, e7), { renderer: s6, aggregateFields: i5, featureReduction: r3 };
- }
- return { renderer: t2, aggregateFields: [], featureReduction: null };
- }
- _acquireTile(e6) {
- const t2 = this.tileRenderer.acquireTile(e6);
- return t2.once("attach", () => {
- this.requestUpdate();
- }), t2;
- }
- _releaseTile(e6) {
- this.tileRenderer.releaseTile(e6);
- }
- async _initTileRenderer(e6, t2) {
- const r3 = await e5(e6, { layerView: this, tileInfoView: this.view.featuresTilingScheme, layer: this.layer });
- return this.tileRenderer && (this._tileStrategy.clear(), this.tileRenderer.uninstall(this.container), this.tileRenderer.destroy(), this.tileRenderer = null), this.destroyed ? null : (this._proxy.tileRenderer = r3, this._set("tileRenderer", r3), this.tileRenderer.install(this.container), this.tileRenderer.onConfigUpdate(t2), this.requestUpdate(), this.tileRenderer);
- }
- _createTileRendererHash(e6) {
- return `${e6.type}`;
- }
- get hasFilter() {
- const e6 = !!("floorInfo" in this.layer && this.layer.floorInfo && this.view.floors && this.view.floors.length);
- return !!this.filter || e6 || !!this._visibilityOverrides.size || !!this.timeExtent;
- }
- _injectOverrides(e6) {
- const t2 = r(e6) ? e6.timeExtent : null, r3 = r(this.timeExtent) && r(t2) ? this.timeExtent.intersection(t2) : this.timeExtent || t2;
- let i5 = null;
- const s6 = "floorInfo" in this.layer && this.layer.floorInfo;
- if (s6) {
- const t3 = r(e6) && e6.where;
- i5 = this._addFloorFilterClause(t3);
- }
- if (!this._visibilityOverrides.size && !r3 && !s6)
- return r(e6) ? e6.toJSON() : null;
- (e6 = r(e6) && e6.clone() || new y3()).timeExtent = r3, i5 && (e6.where = i5);
- const a4 = e6.toJSON();
- return a4.hiddenIds = Array.from(this._visibilityOverrides), a4;
- }
- _addFloorFilterClause(e6) {
- var _a;
- const t2 = this.layer;
- let r3 = e6 || "";
- if ("floorInfo" in t2 && t2.floorInfo) {
- let e7 = this.view.floors;
- if (!e7 || !e7.length)
- return r3;
- ((_a = t2.floorInfo.viewAllLevelIds) == null ? void 0 : _a.length) && (e7 = t2.floorInfo.viewAllLevelIds);
- const i5 = e7.filter((e8) => "" !== e8).map((e8) => "'" + e8 + "'");
- i5.push("''");
- const s6 = t2.floorInfo.floorField;
- let a4 = "(" + s6 + " IN ({ids}) OR " + s6 + " IS NULL)";
- if (a4 = a4.replace("{ids}", i5.join(", ")), r(r3) && r3.includes(s6)) {
- let e8 = new RegExp("AND \\(" + s6 + ".*NULL\\)", "g");
- r3 = r3.replace(e8, ""), e8 = new RegExp("\\(" + s6 + ".*NULL\\)", "g"), r3 = r3.replace(e8, ""), r3 = r3.replace(/\s+/g, " ").trim();
- }
- r3 = "" !== r3 ? "(" + r3 + ") AND " + a4 : a4;
- }
- return "" !== r3 ? r3 : null;
- }
- _createConfiguration(e6, t2, r3) {
- const i5 = "feature" === this.layer.type && this.layer.historicMoment ? this.layer.historicMoment.getTime() : void 0, s6 = "feature" === this.layer.type ? this.layer.gdbVersion : void 0, a4 = new Array(S), n3 = this._injectOverrides(t2);
- a4[0] = n3, a4[1] = r(r3) ? r3.toJSON() : null;
- const o5 = F(e6);
- if (t(o5))
- return null;
- const u5 = l4("2d");
- return { availableFields: this.availableFields, gdbVersion: s6, historicMoment: i5, devicePixelRatio: window.devicePixelRatio || 1, filters: a4, schema: o5, supportsTextureFloat: u5.supportsTextureFloat, maxTextureSize: u5.maxTextureSize };
- }
- _hasRequiredSupport(e6) {
- return !("renderer" in e6) || h3(e6.renderer);
- }
- _onceTilesUpdated() {
- return this.requestUpdate(), j3(() => !this._pipelineIsUpdating);
- }
- _lockGPUUploads() {
- this.tileRenderer && (this._uploadsLocked = true, this.tileRenderer.lockGPUUploads());
- }
- _unlockGPUUploads() {
- this.tileRenderer && (this._uploadsLocked = false, this.tileRenderer.unlockGPUUploads());
- }
- _forceAttributeTextureUpload() {
- this.tileRenderer && this.tileRenderer.forceAttributeTextureUpload();
- }
- _createSchemaConfig() {
- const e6 = this.layer;
- return { renderer: "renderer" in e6 ? e6.renderer : null, spatialReference: e6.spatialReference, timeExtent: e6.timeExtent, definitionExpression: e6.definitionExpression, featureReduction: "featureReduction" in e6 ? e6.featureReduction : null, fields: e6.fields, geometryType: e6.geometryType, historicMoment: "historicMoment" in e6 ? e6.historicMoment : null, labelsVisible: "labelsVisible" in e6 && e6.labelsVisible, labelingInfo: "labelingInfo" in e6 && e6.labelingInfo, availableFields: this.availableFields, featureEffect: this.featureEffect, filter: this.filter, gdbVersion: "gdbVersion" in e6 ? e6.gdbVersion : null, pixelBuffer: 0, orderBy: "orderBy" in e6 && e6.orderBy ? e6.orderBy : null, customParameters: { ..."customParameters" in e6 ? e6.customParameters : void 0, token: "apiKey" in e6 ? e6.apiKey : void 0 }, subtypeCode: "subtypeCode" in e6 ? e6.subtypeCode : void 0, subtypeField: "subtypeField" in e6 ? e6.subtypeField : void 0 };
- }
- _addHighlight(e6) {
- for (const t2 of e6)
- if (this._highlightIds.has(t2)) {
- const e7 = this._highlightIds.get(t2);
- this._highlightIds.set(t2, e7 + 1);
- } else
- this._highlightIds.set(t2, 1);
- this._updateHighlight().catch((e7) => {
- j(e7) || s.getLogger(this.declaredClass).error(e7);
- });
- }
- _removeHighlight(e6) {
- for (const t2 of e6)
- if (this._highlightIds.has(t2)) {
- const e7 = this._highlightIds.get(t2) - 1;
- 0 === e7 ? this._highlightIds.delete(t2) : this._highlightIds.set(t2, e7);
- }
- this._updateHighlight().catch((e7) => {
- j(e7) || s.getLogger(this.declaredClass).error(e7);
- });
- }
- _setLayersForFeature(e6) {
- const t2 = this.layer;
- e6.layer = t2, e6.sourceLayer = t2;
- }
- _createGraphicHit(e6, t2) {
- return this._setLayersForFeature(t2), r(t2.geometry) && (t2.geometry.spatialReference = this.view.spatialReference), { type: "graphic", graphic: t2, layer: this.layer, mapPoint: e6 };
- }
- };
- e([y2()], M.prototype, "_serviceOptions", void 0), e([y2()], M.prototype, "_proxy", void 0), e([y2()], M.prototype, "_pipelineIsUpdating", void 0), e([y2()], M.prototype, "_effectiveRenderer", void 0), e([y2()], M.prototype, "_aggregateValueRanges", void 0), e([y2()], M.prototype, "_commandsQueue", void 0), e([y2()], M.prototype, "featureEffectView", void 0), e([y2()], M.prototype, "labelsVisible", null), e([y2({ readOnly: true })], M.prototype, "queryMode", null), e([y2()], M.prototype, "renderingConfigHash", null), e([y2()], M.prototype, "tileRenderer", void 0), e([y2()], M.prototype, "updating", void 0), M = e([n("esri.views.2d.layers.FeatureLayerView2D")], M);
- var B = M;
- export {
- B
- };
- //# sourceMappingURL=chunk-NHCPFH5Y.js.map
|