import { c } from "./chunk-4D6PVVFX.js"; import "./chunk-WQJRLXWG.js"; import { p as p4 } from "./chunk-XKHC7KKF.js"; import { p as p3, p3 as p5, r as r2 } from "./chunk-HGDNY7J3.js"; import "./chunk-GD5TMIPM.js"; import { l as l2 } from "./chunk-ZRX5UNQH.js"; import { u } from "./chunk-VEAEIBHK.js"; import "./chunk-6SASJ6IM.js"; import "./chunk-3OHML7FO.js"; import { x as x2 } from "./chunk-2VFJVI2I.js"; import { a as a3 } from "./chunk-435DJNTD.js"; import "./chunk-T3EUPDKL.js"; import "./chunk-2SJEIKRW.js"; import "./chunk-PHRSJJ3U.js"; import { n as n4, p as p6 } from "./chunk-KN7TOKVN.js"; import { j as j2 } from "./chunk-RQJNTZAL.js"; import "./chunk-QTOOFNRV.js"; import "./chunk-7O56JPWQ.js"; import { o } from "./chunk-6B2LQBKM.js"; import { d as d3 } from "./chunk-MFI6BALW.js"; import { n as n3, p2 } from "./chunk-CIG5OHC7.js"; import "./chunk-FUD7XO3N.js"; import "./chunk-6EU7GFUT.js"; import "./chunk-MFUAILAT.js"; import "./chunk-HZJYXMI6.js"; import "./chunk-27P5ZSC7.js"; import "./chunk-UPD4MTCL.js"; import "./chunk-GRBROWI6.js"; import "./chunk-5NKYXKIA.js"; import "./chunk-MPWGHCZG.js"; import "./chunk-FTI5VP6T.js"; import "./chunk-RZFGRBD7.js"; import { B } from "./chunk-PUSPZYFZ.js"; import "./chunk-EN7YGJWG.js"; import "./chunk-VBNMTM7L.js"; import "./chunk-3D3QEPRE.js"; import "./chunk-JFNNSBWL.js"; import { b } from "./chunk-UD63WBG3.js"; import "./chunk-LY74KTXV.js"; import "./chunk-EWE6EXPY.js"; import "./chunk-KUXNUNAI.js"; import "./chunk-KMAHKQ2G.js"; import "./chunk-522WBHUO.js"; import "./chunk-WNCU6BFU.js"; import "./chunk-PIGRDDRG.js"; import { y } from "./chunk-BJHM4JNS.js"; import "./chunk-F6A2QQ26.js"; import "./chunk-XLV7RUSE.js"; import "./chunk-NTUXR253.js"; import "./chunk-EOSZHC5H.js"; import "./chunk-C43UE3Z5.js"; import "./chunk-H2KDMZTR.js"; import "./chunk-7XXXCK2A.js"; import "./chunk-7ZIDBK7B.js"; import { c as c3 } from "./chunk-FGKNEJKJ.js"; import { c as c2, d as d2, f, l, m as m2, p, v as v2, w } from "./chunk-PSV473TI.js"; import { O } from "./chunk-I3OBGWNS.js"; import "./chunk-FONIFA5N.js"; import "./chunk-EG5OI4V4.js"; import "./chunk-65BYCSII.js"; import { c as c4, m as m3 } from "./chunk-WZQZRKNH.js"; import "./chunk-LRDX4TO7.js"; import "./chunk-6A4U74YA.js"; import { n as n2 } from "./chunk-CYI7KFYB.js"; import { a as a2 } from "./chunk-5LXROFTA.js"; import "./chunk-GJXW4HL5.js"; import "./chunk-WJW5DUN6.js"; import { t as t2 } from "./chunk-W72F6AS3.js"; import "./chunk-PJ7ZQ4VD.js"; import "./chunk-WDLTDV2L.js"; import "./chunk-TERAW6FT.js"; import "./chunk-N2663GRX.js"; import "./chunk-O4FY3ITT.js"; import "./chunk-WEMIK25H.js"; import { b as b2 } from "./chunk-4DDBH2K5.js"; import "./chunk-7N4X6GF3.js"; import "./chunk-JXW4QTJA.js"; import "./chunk-UXF37FQ4.js"; import { i } from "./chunk-ZOEK6QHJ.js"; import "./chunk-XNLG7T2T.js"; import "./chunk-IR4PV7VK.js"; import "./chunk-2Z6LERTI.js"; import { v2 as v } from "./chunk-OWVBLVP3.js"; import "./chunk-AFZ7XSEW.js"; import "./chunk-4NKD334K.js"; import "./chunk-65K7LC56.js"; import "./chunk-ATPLLI5W.js"; import "./chunk-MXB2XLKV.js"; import "./chunk-XH7RUGVZ.js"; import { m } from "./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 { j } from "./chunk-VBRY5KJM.js"; import "./chunk-PDKDCAAD.js"; import { M2 as M } from "./chunk-ECW2QABR.js"; import "./chunk-GCDJLKH4.js"; import { k2 as k } from "./chunk-MRJEICT6.js"; import { d, e, n2 as n } from "./chunk-Y3WMVFTW.js"; import "./chunk-SAS7RONY.js"; import "./chunk-WSRBH7BF.js"; import "./chunk-IHXECKQQ.js"; import { x } from "./chunk-ULGDPLM2.js"; import { s, s3 as s2 } from "./chunk-EMJ4ZSM2.js"; import "./chunk-IKP3YN53.js"; import { a, r, t } from "./chunk-GZT4BVFP.js"; import "./chunk-A5ICIBVI.js"; // node_modules/@arcgis/core/layers/graphics/sources/GeoJSONSource.js var f2 = s.getLogger("esri.layers.graphics.sources.GeoJSONSource"); var g = class extends m { constructor() { super(...arguments), this.type = "geojson", this.refresh = x(async (e2) => { await this.load(); const { extent: t3, timeExtent: r3 } = await this._connection.invoke("refresh", e2); return this.sourceJSON.extent = t3, r3 && (this.sourceJSON.timeInfo.timeExtent = [r3.start, r3.end]), { dataChanged: true, updates: { extent: this.sourceJSON.extent, timeInfo: this.sourceJSON.timeInfo } }; }); } load(e2) { const t3 = r(e2) ? e2.signal : null; return this.addResolvingPromise(this._startWorker(t3)), Promise.resolve(this); } destroy() { this._connection?.close(), this._connection = null; } applyEdits(e2) { return this.load().then(() => this._applyEdits(e2)); } openPorts() { return this.load().then(() => this._connection.openPorts()); } queryFeatures(e2, t3 = {}) { return this.load(t3).then(() => this._connection.invoke("queryFeatures", e2 ? e2.toJSON() : null, t3)).then((e3) => x2.fromJSON(e3)); } queryFeaturesJSON(e2, t3 = {}) { return this.load(t3).then(() => this._connection.invoke("queryFeatures", e2 ? e2.toJSON() : null, t3)); } queryFeatureCount(e2, t3 = {}) { return this.load(t3).then(() => this._connection.invoke("queryFeatureCount", e2 ? e2.toJSON() : null, t3)); } queryObjectIds(e2, t3 = {}) { return this.load(t3).then(() => this._connection.invoke("queryObjectIds", e2 ? e2.toJSON() : null, t3)); } queryExtent(e2, t3 = {}) { return this.load(t3).then(() => this._connection.invoke("queryExtent", e2 ? e2.toJSON() : null, t3)).then((e3) => ({ count: e3.count, extent: M.fromJSON(e3.extent) })); } querySnapping(e2, t3 = {}) { return this.load(t3).then(() => this._connection.invoke("querySnapping", e2, t3)); } _applyEdits(e2) { if (!this._connection) throw new s2("geojson-layer-source:edit-failure", "Memory source not loaded"); const r3 = this.layer.objectIdField, o2 = [], s3 = [], i2 = []; if (e2.addFeatures) for (const t3 of e2.addFeatures) o2.push(this._serializeFeature(t3)); if (e2.deleteFeatures) for (const t3 of e2.deleteFeatures) "objectId" in t3 && t3.objectId != null ? s3.push(t3.objectId) : "attributes" in t3 && t3.attributes[r3] != null && s3.push(t3.attributes[r3]); if (e2.updateFeatures) for (const t3 of e2.updateFeatures) i2.push(this._serializeFeature(t3)); return this._connection.invoke("applyEdits", { adds: o2, updates: i2, deletes: s3 }).then(({ extent: e3, timeExtent: t3, featureEditResults: r4 }) => (this.sourceJSON.extent = e3, t3 && (this.sourceJSON.timeInfo.timeExtent = [t3.start, t3.end]), this._createEditsResult(r4))); } _createEditsResult(e2) { return { addFeatureResults: e2.addResults ? e2.addResults.map(this._createFeatureEditResult, this) : [], updateFeatureResults: e2.updateResults ? e2.updateResults.map(this._createFeatureEditResult, this) : [], deleteFeatureResults: e2.deleteResults ? e2.deleteResults.map(this._createFeatureEditResult, this) : [], addAttachmentResults: [], updateAttachmentResults: [], deleteAttachmentResults: [] }; } _createFeatureEditResult(e2) { const r3 = e2.success === true ? null : e2.error || { code: void 0, description: void 0 }; return { objectId: e2.objectId, globalId: e2.globalId, error: r3 ? new s2("geojson-layer-source:edit-failure", r3.description, { code: r3.code }) : null }; } _serializeFeature(e2) { const { attributes: t3 } = e2, r3 = this._geometryForSerialization(e2); return r3 ? { geometry: r3.toJSON(), attributes: t3 } : { attributes: t3 }; } _geometryForSerialization(e2) { const { geometry: t3 } = e2; return t(t3) ? null : t3.type === "mesh" || t3.type === "extent" ? v.fromExtent(t3.extent) : t3; } async _startWorker(e2) { this._connection = await u("GeoJSONSourceWorker", { strategy: a("feature-layers-workers") ? "dedicated" : "local", signal: e2 }); const { fields: t3, spatialReference: o2, hasZ: s3, geometryType: i2, objectIdField: n5, url: a4, timeInfo: l3, customParameters: c5 } = this.layer, p7 = this.layer.originOf("spatialReference") === "defaults", h = { url: a4, customParameters: c5, fields: t3 && t3.map((e3) => e3.toJSON()), geometryType: i.toJSON(i2), hasZ: s3, objectIdField: n5, timeInfo: l3 ? l3.toJSON() : null, spatialReference: p7 ? null : o2 && o2.toJSON() }, m4 = await this._connection.invoke("load", h, { signal: e2 }); for (const r3 of m4.warnings) f2.warn(r3.message, { layer: this.layer, warning: r3 }); m4.featureErrors.length && f2.warn(`Encountered ${m4.featureErrors.length} validation errors while loading features`, m4.featureErrors), this.sourceJSON = m4.layerDefinition, this.capabilities = c(this.sourceJSON.hasZ, true); } }; e([d()], g.prototype, "capabilities", void 0), e([d()], g.prototype, "type", void 0), e([d({ constructOnly: true })], g.prototype, "layer", void 0), e([d()], g.prototype, "sourceJSON", void 0), g = e([n("esri.layers.graphics.sources.GeoJSONSource")], g); // node_modules/@arcgis/core/layers/GeoJSONLayer.js var V = l2(); var B2 = class extends p4(o(p3(a2(a3(t2(n2(c3(O(b2))))))))) { constructor(e2) { super(e2), this.copyright = null, this.definitionExpression = null, this.displayField = null, this.editingEnabled = false, this.elevationInfo = null, this.featureReduction = null, this.fields = null, this.fieldsIndex = null, this.fullExtent = null, this.geometryType = null, this.hasZ = void 0, this.labelsVisible = true, this.labelingInfo = null, this.legendEnabled = true, this.objectIdField = null, this.operationalLayerType = "GeoJSON", this.popupEnabled = true, this.popupTemplate = null, this.screenSizePerspectiveEnabled = true, this.source = new g({ layer: this }), this.spatialReference = k.WGS84, this.templates = null, this.title = "GeoJSON", this.type = "geojson", this.typeIdField = null, this.types = null; } destroy() { this.source?.destroy(); } load(e2) { return this.addResolvingPromise(this.source.load(e2).then(() => { this.read(this.source.sourceJSON, { origin: "service", url: this.parsedUrl }), this.revert(["objectIdField", "fields", "timeInfo"], "service"), c4(this.renderer, this.fieldsIndex), m3(this.timeInfo, this.fieldsIndex); })), Promise.resolve(this); } get capabilities() { return this.source ? this.source.capabilities : null; } get createQueryVersion() { return this.commitProperty("definitionExpression"), this.commitProperty("timeExtent"), this.commitProperty("timeOffset"), this.commitProperty("geometryType"), this.commitProperty("capabilities"), (this._get("createQueryVersion") || 0) + 1; } get defaultPopupTemplate() { return this.createPopupTemplate(); } get isTable() { return this.loaded && this.geometryType == null; } get parsedUrl() { return this.url ? j(this.url) : null; } set renderer(e2) { c4(e2, this.fieldsIndex), this._set("renderer", e2); } set url(e2) { if (!e2) return void this._set("url", e2); const t3 = j(e2); this._set("url", t3.path), t3.query && (this.customParameters = { ...this.customParameters, ...t3.query }); } async applyEdits(e2, t3) { const r3 = await import("./editingSupport-KL4E3VVF.js"); await this.load(); const i2 = await r3.applyEdits(this, this.source, e2, t3); return this.read({ extent: this.source.sourceJSON.extent, timeInfo: this.source.sourceJSON.timeInfo }, { origin: "service", ignoreDefaults: true }), i2; } on(e2, t3) { return super.on(e2, t3); } createPopupTemplate(e2) { return d3(this, e2); } createQuery() { const e2 = new b(), t3 = this.get("capabilities.data"); e2.returnGeometry = true, t3 && t3.supportsZ && (e2.returnZ = true), e2.outFields = ["*"], e2.where = this.definitionExpression || "1=1"; const { timeOffset: r3, timeExtent: i2 } = this; return e2.timeExtent = r3 != null && i2 != null ? i2.offset(-r3.value, r3.unit) : i2 || null, e2; } getFieldDomain(e2, t3) { let r3, i2 = false; const o2 = t3 && t3.feature, s3 = o2 && o2.attributes, p7 = this.typeIdField && s3 && s3[this.typeIdField]; return p7 != null && this.types && (i2 = this.types.some((t4) => t4.id == p7 && (r3 = t4.domains && t4.domains[e2], r3 && r3.type === "inherited" && (r3 = this._getLayerDomain(e2)), true))), i2 || r3 || (r3 = this._getLayerDomain(e2)), r3; } getField(e2) { return this.fieldsIndex.get(e2); } queryFeatures(e2, t3) { return this.load().then(() => this.source.queryFeatures(b.from(e2) || this.createQuery(), t3)).then((e3) => { if (e3?.features) for (const t4 of e3.features) t4.layer = t4.sourceLayer = this; return e3; }); } queryObjectIds(e2, t3) { return this.load().then(() => this.source.queryObjectIds(b.from(e2) || this.createQuery(), t3)); } queryFeatureCount(e2, t3) { return this.load().then(() => this.source.queryFeatureCount(b.from(e2) || this.createQuery(), t3)); } queryExtent(e2, t3) { return this.load().then(() => this.source.queryExtent(b.from(e2) || this.createQuery(), t3)); } async hasDataChanged() { try { const { dataChanged: e2, updates: t3 } = await this.source.refresh(this.customParameters); return r(t3) && this.read(t3, { origin: "service", url: this.parsedUrl, ignoreDefaults: true }), e2; } catch { } return false; } _getLayerDomain(e2) { if (!this.fields) return null; let t3 = null; return this.fields.some((r3) => (r3.name === e2 && (t3 = r3.domain), !!t3)), t3; } }; e([d({ readOnly: true, json: { read: false, write: false } })], B2.prototype, "capabilities", null), e([d({ type: String })], B2.prototype, "copyright", void 0), e([d({ readOnly: true })], B2.prototype, "createQueryVersion", null), e([d({ readOnly: true })], B2.prototype, "defaultPopupTemplate", null), e([d({ type: String, json: { name: "layerDefinition.definitionExpression", write: { enabled: true, allowNull: true } } })], B2.prototype, "definitionExpression", void 0), e([d({ type: String })], B2.prototype, "displayField", void 0), e([d({ type: Boolean })], B2.prototype, "editingEnabled", void 0), e([d(d2)], B2.prototype, "elevationInfo", void 0), e([d(p5)], B2.prototype, "featureReduction", void 0), e([d({ type: [y], json: { name: "layerDefinition.fields", write: { ignoreOrigin: true, isRequired: true }, origins: { service: { name: "fields" } } } })], B2.prototype, "fields", void 0), e([d(V.fieldsIndex)], B2.prototype, "fieldsIndex", void 0), e([d({ type: M, json: { name: "extent" } })], B2.prototype, "fullExtent", void 0), e([d({ type: ["point", "polygon", "polyline", "multipoint"], json: { read: { reader: i.read } } })], B2.prototype, "geometryType", void 0), e([d({ type: Boolean })], B2.prototype, "hasZ", void 0), e([d(v2)], B2.prototype, "id", void 0), e([d({ type: Boolean, readOnly: true })], B2.prototype, "isTable", null), e([d(m2)], B2.prototype, "labelsVisible", void 0), e([d({ type: [j2], json: { name: "layerDefinition.drawingInfo.labelingInfo", read: { reader: r2 }, write: true } })], B2.prototype, "labelingInfo", void 0), e([d(c2)], B2.prototype, "legendEnabled", void 0), e([d({ type: ["show", "hide"] })], B2.prototype, "listMode", void 0), e([d({ type: String, json: { name: "layerDefinition.objectIdField", write: { ignoreOrigin: true, isRequired: true }, origins: { service: { name: "objectIdField" } } } })], B2.prototype, "objectIdField", void 0), e([d(w)], B2.prototype, "opacity", void 0), e([d({ type: ["GeoJSON"] })], B2.prototype, "operationalLayerType", void 0), e([d({ readOnly: true })], B2.prototype, "parsedUrl", null), e([d(p)], B2.prototype, "popupEnabled", void 0), e([d({ type: B, json: { name: "popupInfo", write: true } })], B2.prototype, "popupTemplate", void 0), e([d({ types: p2, json: { name: "layerDefinition.drawingInfo.renderer", write: true, origins: { service: { name: "drawingInfo.renderer" }, "web-scene": { types: n3 } } } })], B2.prototype, "renderer", null), e([d(l)], B2.prototype, "screenSizePerspectiveEnabled", void 0), e([d({ readOnly: true })], B2.prototype, "source", void 0), e([d({ type: k })], B2.prototype, "spatialReference", void 0), e([d({ type: [p6] })], B2.prototype, "templates", void 0), e([d()], B2.prototype, "title", void 0), e([d({ json: { read: false }, readOnly: true })], B2.prototype, "type", void 0), e([d({ type: String, readOnly: true })], B2.prototype, "typeIdField", void 0), e([d({ type: [n4] })], B2.prototype, "types", void 0), e([d(f)], B2.prototype, "url", null), B2 = e([n("esri.layers.GeoJSONLayer")], B2); var Z = B2; export { Z as default }; //# sourceMappingURL=GeoJSONLayer-G3YCJ5UG.js.map