import { E, l, l2, t as t2, x } from "./chunk-PS4B3D6M.js"; import "./chunk-DO6JJUZG.js"; import "./chunk-54X4RLMR.js"; import { n as n2 } from "./chunk-MWIFVNKP.js"; import "./chunk-MIWGTTJJ.js"; import "./chunk-LL6JU3GU.js"; import "./chunk-LSDW2622.js"; import "./chunk-ZIWBDWEW.js"; import "./chunk-IQNZZCQJ.js"; import { p as p2 } from "./chunk-HWIURR7X.js"; import "./chunk-Q4LKAPDF.js"; import "./chunk-TODU7HVH.js"; import "./chunk-23ONSYIH.js"; import "./chunk-SRMDO2KR.js"; import "./chunk-PZKZIMMP.js"; import "./chunk-YLVXZ2PS.js"; import "./chunk-546QCRS4.js"; import "./chunk-QXZVBSBH.js"; import "./chunk-773XI6MQ.js"; import "./chunk-ILP23N26.js"; import { p } from "./chunk-BXIBTNXI.js"; import "./chunk-5NM43FFO.js"; import "./chunk-WFSV2B2I.js"; import "./chunk-J525NRN3.js"; import "./chunk-MI7HWWFL.js"; import "./chunk-Q34L5KZA.js"; import "./chunk-ZVHTCCQC.js"; import "./chunk-PCGDLSZ4.js"; import "./chunk-CAYFEZCR.js"; import "./chunk-MFFE4I2S.js"; import "./chunk-XBH7TGC2.js"; import "./chunk-K3NA3LQS.js"; import "./chunk-LMCIAW5S.js"; import "./chunk-OTS3UE5B.js"; import "./chunk-6RAL4JPQ.js"; import "./chunk-TRK7CKWP.js"; import "./chunk-LGW7TID4.js"; import "./chunk-3OHML7FO.js"; import "./chunk-H6ETEALK.js"; import "./chunk-FIYKFRB2.js"; import "./chunk-FYNVVMWY.js"; import "./chunk-Q52DVFYK.js"; import "./chunk-HBMVUVZX.js"; import "./chunk-6P6NA7JB.js"; import "./chunk-UPD4MTCL.js"; import "./chunk-FTI5VP6T.js"; import { a, m } from "./chunk-LY74KTXV.js"; import "./chunk-EWE6EXPY.js"; import "./chunk-KUXNUNAI.js"; import "./chunk-522WBHUO.js"; import "./chunk-RMX2AZ4P.js"; import "./chunk-NE3ESGA6.js"; import "./chunk-YIS6BAC3.js"; import "./chunk-7XXXCK2A.js"; import "./chunk-65BYCSII.js"; import "./chunk-LRDX4TO7.js"; import "./chunk-N2663GRX.js"; import "./chunk-WEMIK25H.js"; import "./chunk-JXW4QTJA.js"; import "./chunk-UXF37FQ4.js"; import "./chunk-ZOEK6QHJ.js"; import "./chunk-XNLG7T2T.js"; import "./chunk-IR4PV7VK.js"; import "./chunk-2Z6LERTI.js"; import "./chunk-OWVBLVP3.js"; import "./chunk-4NKD334K.js"; import "./chunk-65K7LC56.js"; import "./chunk-ATPLLI5W.js"; import "./chunk-MXB2XLKV.js"; import "./chunk-XH7RUGVZ.js"; import "./chunk-TBBTRX4O.js"; import "./chunk-YBSUITLL.js"; import "./chunk-ALDCDSPV.js"; import "./chunk-DT6EAZQ5.js"; import "./chunk-HNOZUNJ4.js"; import "./chunk-VNFRAYHO.js"; import "./chunk-R5IG2D6H.js"; import "./chunk-VBRY5KJM.js"; import "./chunk-PDKDCAAD.js"; import "./chunk-ECW2QABR.js"; import "./chunk-GCDJLKH4.js"; import { k2 as k } from "./chunk-MRJEICT6.js"; import { e, n2 as n } from "./chunk-Y3WMVFTW.js"; import "./chunk-SAS7RONY.js"; import "./chunk-WSRBH7BF.js"; import "./chunk-IHXECKQQ.js"; import { f as f2, g } from "./chunk-ULGDPLM2.js"; import { s } from "./chunk-EMJ4ZSM2.js"; import "./chunk-IKP3YN53.js"; import { e as e2, f, o, r, t } from "./chunk-GZT4BVFP.js"; import "./chunk-A5ICIBVI.js"; // node_modules/@arcgis/core/views/2d/layers/features/support/ResourceManagerProxy.js var t3 = class { constructor(e3) { this._remoteClient = e3, this._resourceMap = new Map(), this._inFlightResourceMap = new Map(), this.geometryEngine = null; } destroy() { } async fetchResource(t4, r2) { const s2 = this._resourceMap, i = s2.get(t4); if (i) return i; let n3 = this._inFlightResourceMap.get(t4); if (n3) return n3; try { n3 = this._remoteClient.invoke("tileRenderer.fetchResource", { url: t4 }, { ...r2 }), this._inFlightResourceMap.set(t4, n3), n3.then((e3) => (this._inFlightResourceMap.delete(t4), s2.set(t4, e3), e3)); } catch (o2) { return g(o2) ? null : { width: 0, height: 0 }; } return n3; } getResource(e3) { return this._resourceMap.get(e3) ?? null; } }; // node_modules/@arcgis/core/views/2d/layers/features/processors/SymbolProcessor.js function I(e3, t4) { return (!e3.minScale || e3.minScale >= t4) && (!e3.maxScale || e3.maxScale <= t4); } function v(e3) { const t4 = e3.message, s2 = { message: { data: {}, tileKey: t4.tileKey, tileKeyOrigin: t4.tileKeyOrigin, version: t4.version }, transferList: new Array() }; for (const i in t4.data) { const e4 = t4.data[i]; if (s2.message.data[i] = null, r(e4)) { const t5 = e4.stride, a2 = e4.indices.slice(0), o2 = e4.vertices.slice(0), n3 = e4.records.slice(0), l3 = { stride: t5, indices: a2, vertices: o2, records: n3, metrics: o(e4.metrics, (e5) => e5.slice(0)) }; s2.transferList.push(a2, o2, n3), s2.message.data[i] = l3; } } return s2; } s.getLogger("esri.views.2d.layers.features.processors.SymbolProcessor"); var M = class extends p { constructor() { super(...arguments), this.type = "symbol", this._matchers = { feature: null, aggregate: null }, this._bufferData = new Map(), this._bufferIds = new Map(); } initialize() { this.handles.add([this.tileStore.on("update", this.onTileUpdate.bind(this))]), this._resourceManagerProxy = new t3(this.remoteClient); } destroy() { this._resourceManagerProxy.destroy(); } get supportsTileUpdates() { return true; } forEachBufferId(e3) { this._bufferIds.forEach((t4) => { t4.forEach(e3); }); } async update(e3, t4) { const s2 = t4.schema.processors[0]; if (s2.type !== "symbol") return; const r2 = m(this._schema, s2); a(r2, "mesh") && (e3.mesh = true, e3.why.mesh.push("Symbology changed"), this._schema = s2, this._factory = this._createFactory(s2), this._factory.update(s2, this.tileStore.tileScheme.tileInfo)); } onTileMessage(e3, t4, s2, r2) { return f2(r2), this._onTileData(e3, t4, s2, r2); } onTileClear(e3) { const t4 = { clear: true }; return this._bufferData.delete(e3.key.id), this._bufferIds.delete(e3.key.id), this.remoteClient.invoke("tileRenderer.onTileData", { tileKey: e3.id, data: t4 }); } onTileError(e3, t4, s2) { const r2 = s2.signal, i = { tileKey: e3.id, error: t4 }; return this.remoteClient.invoke("tileRenderer.onTileError", i, { signal: r2 }); } onTileUpdate(e3) { for (const t4 of e3.removed) this._bufferData.has(t4.key.id) && this._bufferData.delete(t4.key.id), this._bufferIds.has(t4.key.id) && this._bufferIds.delete(t4.key.id); for (const t4 of e3.added) this._bufferData.forEach((e4) => { for (const s2 of e4) s2.message.tileKey === t4.id && this._updateTileMesh("append", t4, v(s2), [], false, false, null); }); } _addBufferData(e3, t4) { this._bufferData.has(e3) || this._bufferData.set(e3, []), this._bufferData.get(e3).push(v(t4)); } _createFactory(e3) { const { geometryType: t4, objectIdField: s2, fields: i } = this.service, a2 = (e4, t5) => this.remoteClient.invoke("tileRenderer.getMaterialItems", e4, t5), o2 = { geometryType: t4, fields: i, spatialReference: k.fromJSON(this.spatialReference) }, n3 = new x(a2, this.tileStore.tileScheme.tileInfo), { matcher: l3, aggregateMatcher: c } = e3.mesh; return this._store = n3, this._matchers.feature = l2(l3, n3, o2, this._resourceManagerProxy), this._matchers.aggregate = o(c, (e4) => l2(e4, n3, o2, this._resourceManagerProxy)), new l(t4, s2, n3); } async _onTileData(e3, t4, s2, r2) { f2(r2); const { type: o2, addOrUpdate: n3, remove: c, clear: d, end: h } = t4, f3 = !!this._schema.mesh.sortKey; if (!n3) { const t5 = { type: o2, addOrUpdate: null, remove: c, clear: d, end: h, sort: f3 }; return this.remoteClient.invoke("tileRenderer.onTileData", { tileKey: e3.id, data: t5 }, r2); } const m2 = this._processFeatures(e3, n3, s2, r2, t4.status.version); try { const s3 = await m2; if (t(s3)) { const t5 = { type: o2, addOrUpdate: null, remove: c, clear: d, end: h, sort: f3 }; return this.remoteClient.invoke("tileRenderer.onTileData", { tileKey: e3.id, data: t5 }, r2); } const n4 = []; for (const t5 of s3) { let s4 = false; const r3 = t5.message.bufferIds, i = e3.key.id, o3 = t5.message.tileKey; if (i !== o3 && r(r3)) { if (!this.tileStore.get(o3)) { this._addBufferData(i, t5), n4.push(t5); continue; } let e4 = this._bufferIds.get(o3); e4 || (e4 = new Set(), this._bufferIds.set(o3, e4)); const a2 = Array.from(r3); for (const t6 of a2) { if (e4.has(t6)) { s4 = true; break; } e4.add(t6); } } s4 || (this._addBufferData(i, t5), n4.push(t5)); } await Promise.all(n4.map((s4) => { const i = e3.key.id === s4.message.tileKey, a2 = i ? t4.remove : [], n5 = i && t4.end; return this._updateTileMesh(o2, e3, s4, a2, n5, t4.clear, r2.signal); })); } catch (u) { this._handleError(e3, u, r2); } } async _updateTileMesh(e3, t4, s2, i, a2, o2, c) { const d = e3, h = s2.message.tileKey, f3 = !!this._schema.mesh.sortKey; h !== t4.key.id && (a2 = false); const m2 = o(s2, (e4) => e4.message), u = o(s2, (e4) => e4.transferList) || [], p3 = { type: d, addOrUpdate: m2, remove: i, clear: o2, end: a2, sort: f3 }, g2 = { transferList: e2(u) || [], signal: c }; return f2(g2), this.remoteClient.invoke("tileRenderer.onTileData", { tileKey: h, data: p3 }, g2); } async _processFeatures(e3, t4, s2, r2, a2) { if (t(t4) || !t4.hasFeatures) return null; const o2 = { transform: e3.transform, hasZ: false, hasM: false }, n3 = this._factory, c = { viewingMode: "", scale: e3.scale }, d = await this._matchers.feature, h = await this._matchers.aggregate; f2(r2); const f3 = this._getLabelInfos(e3, t4); return await n3.analyze(t4.getCursor(), this._resourceManagerProxy, d, h, o2, c), f2(r2), this._writeFeatureSet(e3, t4, o2, f3, n3, s2, a2); } _writeFeatureSet(e3, t4, s2, r2, i, o2, n3) { const l3 = t4.getSize(), c = new E(e3.key.id, { features: l3, records: l3, metrics: 0 }, this._schema.mesh.matcher.symbologyType, o2, true, n3), d = { viewingMode: "", scale: e3.scale }, h = t4.getCursor(); for (; h.next(); ) try { const t5 = h.getDisplayId(), o3 = r(r2) ? r2.get(t5) : null; i.writeCursor(c, h, s2, d, e3.level, o3, this._resourceManagerProxy); } catch (m2) { } const f3 = e3.tileInfoView.tileInfo.isWrappable; return c.serialize(f3); } _handleError(e3, t4, s2) { if (!g(t4)) { const r2 = { tileKey: e3.id, error: t4.message }; return this.remoteClient.invoke("tileRenderer.onTileError", r2, { signal: s2.signal }); } } _getLabelingSchemaForScale(e3) { const t4 = this._schema.mesh.labels; if (t(t4)) return null; if (t4.type === "subtype") { const s3 = { type: "subtype", classes: {} }; let r2 = false; for (const i in t4.classes) { const a2 = t4.classes[i].filter((t5) => I(t5, e3.scale)); r2 = r2 || !!a2.length, s3.classes[i] = a2; } return r2 ? s3 : null; } const s2 = t4.classes.filter((t5) => I(t5, e3.scale)); return s2.length ? { type: "simple", classes: s2 } : null; } _getLabels(e3, t4) { if (t4.type === "subtype") { const s2 = this.service.subtypeField, r2 = f(s2, "Expected to find subtype Field"), i = e3.readAttribute(r2); return i == null ? [] : t4.classes[i] ?? []; } return t4.classes; } _getLabelInfos(e3, s2) { const r2 = this._getLabelingSchemaForScale(e3); if (t(r2)) return null; const a2 = new Map(), o2 = s2.getCursor(); for (; o2.next(); ) { const e4 = o2.getDisplayId(), s3 = [], i = p2(e4), n3 = i && o2.readAttribute("cluster_count") !== 1 ? "aggregate" : "feature", l3 = this._getLabels(o2, r2); for (const r3 of l3) { if (r3.target !== n3) continue; const a3 = o2.getStorage(), l4 = i && n3 === "feature" ? a3.getComputedStringAtIndex(o2.readAttribute("referenceId"), r3.fieldIndex) : a3.getComputedStringAtIndex(e4, r3.fieldIndex); if (!l4) continue; const c = n2(l4.toString()), d = c[0], h = c[1]; this._store.getMosaicItem(r3.symbol, t2(d)).then((e5) => { s3[r3.index] = { glyphs: e5.glyphMosaicItems, rtl: h, index: r3.index }; }); } a2.set(e4, s3); } return a2; } }; M = e([n("esri.views.2d.layers.features.processors.SymbolProcessor")], M); var x2 = M; export { x2 as default }; //# sourceMappingURL=SymbolProcessor-QOW6BODF.js.map