import { n as n2 } from "./chunk-AMQJEM7V.js"; import { i } from "./chunk-MD4XYAEQ.js"; import { t } from "./chunk-S7R5EXHN.js"; import { a } from "./chunk-RMX2AZ4P.js"; import { g } from "./chunk-PSV473TI.js"; import { d, e, n2 as n, y3 as y } from "./chunk-Y3WMVFTW.js"; import { r } from "./chunk-GZT4BVFP.js"; // node_modules/@arcgis/core/layers/support/ExportImageParameters.js var m = { visible: "visibleSublayers", definitionExpression: "layerDefs", labelingInfo: "hasDynamicLayers", labelsVisible: "hasDynamicLayers", opacity: "hasDynamicLayers", minScale: "visibleSublayers", maxScale: "visibleSublayers", renderer: "hasDynamicLayers", source: "hasDynamicLayers" }; var c = class extends a(y) { constructor(e2) { super(e2), this.floors = null, this.scale = 0; } destroy() { this.layer = null; } get dynamicLayers() { if (!this.hasDynamicLayers) return null; const e2 = this.visibleSublayers.map((e3) => { const r2 = n2(this.floors, e3); return e3.toExportImageJSON(r2); }); return e2.length ? JSON.stringify(e2) : null; } get hasDynamicLayers() { return this.layer && i(this.visibleSublayers, this.layer.serviceSublayers, this.layer.gdbVersion); } set layer(e2) { this._get("layer") !== e2 && (this._set("layer", e2), this.handles.remove("layer"), e2 && this.handles.add([e2.allSublayers.on("change", () => this.notifyChange("visibleSublayers")), e2.on("sublayer-update", (e3) => this.notifyChange(m[e3.propertyName]))], "layer")); } get layers() { const e2 = this.visibleSublayers; return e2 ? e2.length ? "show:" + e2.map((e3) => e3.id).join(",") : "show:-1" : null; } get layerDefs() { const e2 = !!this.floors?.length, r2 = this.visibleSublayers.filter((r3) => r3.definitionExpression != null || e2 && r3.floorInfo != null); return r2.length ? JSON.stringify(r2.reduce((e3, r3) => { const s = n2(this.floors, r3), o = t(s, r3.definitionExpression); return r(o) && (e3[r3.id] = o), e3; }, {})) : null; } get version() { this.commitProperty("layers"), this.commitProperty("layerDefs"), this.commitProperty("dynamicLayers"), this.commitProperty("timeExtent"); const e2 = this.layer; return e2 && (e2.commitProperty("dpi"), e2.commitProperty("imageFormat"), e2.commitProperty("imageTransparency"), e2.commitProperty("gdbVersion")), (this._get("version") || 0) + 1; } get visibleSublayers() { const e2 = []; if (!this.layer) return e2; const r2 = this.layer.sublayers, s = (r3) => { const t3 = this.scale, i2 = t3 === 0, o = r3.minScale === 0 || t3 <= r3.minScale, a2 = r3.maxScale === 0 || t3 >= r3.maxScale; r3.visible && (i2 || o && a2) && (r3.sublayers ? r3.sublayers.forEach(s) : e2.unshift(r3)); }; r2 && r2.forEach(s); const t2 = this._get("visibleSublayers"); return !t2 || t2.length !== e2.length || t2.some((r3, s2) => e2[s2] !== r3) ? e2 : t2; } toJSON() { const e2 = this.layer; let r2 = { dpi: e2.dpi, format: e2.imageFormat, transparent: e2.imageTransparency, gdbVersion: e2.gdbVersion || null }; return this.hasDynamicLayers && this.dynamicLayers ? r2.dynamicLayers = this.dynamicLayers : r2 = { ...r2, layers: this.layers, layerDefs: this.layerDefs }, r2; } }; e([d({ readOnly: true })], c.prototype, "dynamicLayers", null), e([d()], c.prototype, "floors", void 0), e([d({ readOnly: true })], c.prototype, "hasDynamicLayers", null), e([d()], c.prototype, "layer", null), e([d({ readOnly: true })], c.prototype, "layers", null), e([d({ readOnly: true })], c.prototype, "layerDefs", null), e([d({ type: Number })], c.prototype, "scale", void 0), e([d(g)], c.prototype, "timeExtent", void 0), e([d({ readOnly: true })], c.prototype, "version", null), e([d({ readOnly: true })], c.prototype, "visibleSublayers", null), c = e([n("esri.layers.mixins.ExportImageParameters")], c); export { c }; //# sourceMappingURL=chunk-TD4DLRQ7.js.map