123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499 |
- import {
- a
- } from "./chunk-T2SKWJGU.js";
- import {
- r as r2,
- s as s3
- } from "./chunk-XO5VJRK4.js";
- import {
- U
- } from "./chunk-3WXSWAUV.js";
- import {
- E,
- S
- } from "./chunk-EQNT4A7P.js";
- import {
- C
- } from "./chunk-3OFVLRSL.js";
- import {
- e as e3
- } from "./chunk-IQBIGNPU.js";
- import {
- u as u2
- } from "./chunk-PJNBFKPF.js";
- import {
- d,
- e as e2,
- n as n3
- } from "./chunk-3WQOA5CB.js";
- import {
- u
- } from "./chunk-UVVU4UUO.js";
- import {
- l
- } from "./chunk-X4SA4ELJ.js";
- import {
- n as n2
- } from "./chunk-IM3LVQXV.js";
- import {
- e,
- m,
- n5 as n,
- y3 as y2
- } from "./chunk-2Z2TG5CU.js";
- import {
- D
- } from "./chunk-V6P2MAQQ.js";
- import {
- s2 as s,
- s3 as s2
- } from "./chunk-E5O6P5I2.js";
- import {
- has,
- y
- } from "./chunk-SPWQ3AWG.js";
- import {
- r,
- t
- } from "./chunk-YXWMMD76.js";
- // node_modules/@arcgis/core/layers/effects/EffectView.js
- var l2 = -1;
- var a2 = class extends m {
- constructor(t2) {
- super(t2), this._from = null, this._to = null, this._final = null, this._current = [], this._time = 0, this.duration = has("mapview-transitions-duration"), this.effects = [];
- }
- set effect(t2) {
- if (this._get("effect") !== (t2 = t2 || "")) {
- this._set("effect", t2);
- try {
- this._transitionTo(h(t2));
- } catch (e5) {
- this._transitionTo([]), s.getLogger(this.declaredClass).warn("Invalid Effect", { effect: t2, error: e5 });
- }
- }
- }
- get hasEffects() {
- return this.transitioning || !!this.effects.length;
- }
- set scale(t2) {
- this._updateForScale(t2);
- }
- get transitioning() {
- return null !== this._to;
- }
- canTransitionTo(t2) {
- try {
- return this.scale > 0 && u3(this._current, h(t2), this.scale);
- } catch {
- return false;
- }
- }
- transitionStep(t2, e5) {
- this._applyTimeTransition(t2), this._updateForScale(e5);
- }
- endTransitions() {
- this._applyTimeTransition(this.duration);
- }
- _transitionTo(t2) {
- this.scale > 0 && u3(this._current, t2, this.scale) ? (this._final = t2, this._to = y(t2), _(this._current, this._to, this.scale), this._from = y(this._current), this._time = 0) : (this._from = this._to = this._final = null, this._current = t2), this._set("effects", this._current[0] ? y(this._current[0].effects) : []);
- }
- _applyTimeTransition(t2) {
- if (!(this._to && this._from && this._current && this._final))
- return;
- this._time += t2;
- const e5 = Math.min(1, this._time / this.duration);
- for (let s5 = 0; s5 < this._current.length; s5++) {
- const t3 = this._current[s5], r4 = this._from[s5], i3 = this._to[s5];
- t3.scale = p(r4.scale, i3.scale, e5);
- for (let s6 = 0; s6 < t3.effects.length; s6++) {
- const n6 = t3.effects[s6], c2 = r4.effects[s6], o = i3.effects[s6];
- n6.interpolate(c2, o, e5);
- }
- }
- 1 === e5 && (this._current = this._final, this._set("effects", this._current[0] ? y(this._current[0].effects) : []), this._from = this._to = this._final = null);
- }
- _updateForScale(t2) {
- if (this._set("scale", t2), 0 === this._current.length)
- return;
- const e5 = this._current, s5 = this._current.length - 1;
- let r4, i3, n6 = 1;
- if (1 === e5.length || t2 >= e5[0].scale)
- i3 = r4 = e5[0].effects;
- else if (t2 <= e5[s5].scale)
- i3 = r4 = e5[s5].effects;
- else
- for (let c2 = 0; c2 < s5; c2++) {
- const s6 = e5[c2], o = e5[c2 + 1];
- if (s6.scale >= t2 && o.scale <= t2) {
- n6 = (t2 - s6.scale) / (o.scale - s6.scale), r4 = s6.effects, i3 = o.effects;
- break;
- }
- }
- for (let c2 = 0; c2 < this.effects.length; c2++) {
- this.effects[c2].interpolate(r4[c2], i3[c2], n6);
- }
- }
- };
- function h(t2) {
- const e5 = d(t2) || [];
- return m2(e5) ? [{ scale: l2, effects: e5 }] : e5;
- }
- function u3(t2, e5, s5) {
- var _a, _b, _c, _d;
- if (!((_a = t2[0]) == null ? void 0 : _a.effects) || !((_b = e5[0]) == null ? void 0 : _b.effects))
- return true;
- return !((((_c = t2[0]) == null ? void 0 : _c.scale) === l2 || ((_d = e5[0]) == null ? void 0 : _d.scale) === l2) && (t2.length > 1 || e5.length > 1) && s5 <= 0) && n3(t2[0].effects, e5[0].effects);
- }
- function _(t2, e5, s5) {
- var _a, _b;
- const r4 = t2.length > e5.length ? t2 : e5, i3 = t2.length > e5.length ? e5 : t2, n6 = i3[i3.length - 1], c2 = (_a = n6 == null ? void 0 : n6.scale) != null ? _a : s5, o = (_b = n6 == null ? void 0 : n6.effects) != null ? _b : [];
- for (let f = i3.length; f < r4.length; f++)
- i3.push({ scale: c2, effects: [...o] });
- for (let a3 = 0; a3 < r4.length; a3++)
- i3[a3].scale = i3[a3].scale === l2 ? s5 : i3[a3].scale, r4[a3].scale = r4[a3].scale === l2 ? s5 : r4[a3].scale, e2(i3[a3].effects, r4[a3].effects);
- }
- function p(t2, e5, s5) {
- return t2 + (e5 - t2) * s5;
- }
- function m2(t2) {
- const e5 = t2[0];
- return !!e5 && "type" in e5;
- }
- e([y2()], a2.prototype, "_to", void 0), e([y2()], a2.prototype, "duration", void 0), e([y2({ value: "" })], a2.prototype, "effect", null), e([y2({ readOnly: true })], a2.prototype, "effects", void 0), e([y2({ readOnly: true })], a2.prototype, "hasEffects", null), e([y2({ value: 0 })], a2.prototype, "scale", null), e([y2({ readOnly: true })], a2.prototype, "transitioning", null), a2 = e([n("esri.layers.effects.EffectView")], a2);
- // node_modules/@arcgis/core/views/2d/engine/DisplayObject.js
- var i = 1 / has("mapview-transitions-duration");
- var r3 = class extends n2 {
- constructor() {
- super(...arguments), this._fadeOutResolver = null, this._fadeInResolver = null, this._clips = null, this.computedVisible = true, this.computedOpacity = 1, this.fadeTransitionEnabled = false, this.inFadeTransition = false, this._isReady = false, this._opacity = 1, this._stage = null, this._visible = true;
- }
- get clips() {
- return this._clips;
- }
- set clips(e5) {
- this._clips = e5, this.requestRender();
- }
- get isReady() {
- return this._isReady;
- }
- get opacity() {
- return this._opacity;
- }
- set opacity(e5) {
- this._opacity !== e5 && (this._opacity = Math.min(1, Math.max(e5, 0)), this.requestRender());
- }
- get stage() {
- return this._stage;
- }
- set stage(e5) {
- if (this._stage === e5)
- return;
- const t2 = this._stage;
- this._stage = e5, e5 ? this._stage.untrashDisplayObject(this) || (this.onAttach(), this.emit("attach")) : t2.trashDisplayObject(this);
- }
- get transforms() {
- return this._getTransforms();
- }
- _getTransforms() {
- return t(this._transforms) && (this._transforms = this._createTransforms()), this._transforms;
- }
- get visible() {
- return this._visible;
- }
- set visible(e5) {
- this._visible !== e5 && (this._visible = e5, this.requestRender());
- }
- fadeIn() {
- return this._fadeInResolver || (this._fadeOutResolver && (this._fadeOutResolver(), this._fadeOutResolver = null), this.opacity = 1, this.computedOpacity = 0, this.fadeTransitionEnabled = true, this._fadeInResolver = D(), this.requestRender()), this._fadeInResolver.promise;
- }
- fadeOut() {
- return this._fadeOutResolver || (this.opacity = 0, this._fadeInResolver && (this._fadeInResolver(), this._fadeInResolver = null), this.fadeTransitionEnabled = true, this._fadeOutResolver = D(), this.requestRender()), this._fadeOutResolver.promise;
- }
- endTransitions() {
- var _a, _b;
- (_a = this._fadeInResolver) == null ? void 0 : _a.call(this), this._fadeInResolver = null, (_b = this._fadeOutResolver) == null ? void 0 : _b.call(this), this._fadeOutResolver = null, this.computedOpacity = this.visible ? this.opacity : 0, this.requestRender();
- }
- beforeRender(e5) {
- this.updateTransitionProperties(e5.deltaTime, e5.state.scale);
- }
- afterRender(e5) {
- this._fadeInResolver && this.computedOpacity === this.opacity ? (this._fadeInResolver(), this._fadeInResolver = null) : this._fadeOutResolver && 0 === this.computedOpacity && (this._fadeOutResolver(), this._fadeOutResolver = null);
- }
- remove() {
- var _a;
- (_a = this.parent) == null ? void 0 : _a.removeChild(this);
- }
- setTransform(e5) {
- }
- processRender(e5) {
- this.stage && this.computedVisible && this.doRender(e5);
- }
- requestRender() {
- this.stage && this.stage.requestRender();
- }
- processDetach() {
- this._fadeInResolver && (this._fadeInResolver(), this._fadeInResolver = null), this._fadeOutResolver && (this._fadeOutResolver(), this._fadeOutResolver = null), this.onDetach(), this.emit("detach");
- }
- updateTransitionProperties(e5, t2) {
- if (this.fadeTransitionEnabled) {
- const t3 = this._fadeOutResolver || !this.visible ? 0 : this.opacity, s5 = this.computedOpacity;
- if (s5 === t3)
- this.computedVisible = this.visible;
- else {
- const r4 = e5 * i;
- this.computedOpacity = s5 > t3 ? Math.max(t3, s5 - r4) : Math.min(t3, s5 + r4), this.computedVisible = this.computedOpacity > 0;
- const a3 = t3 === this.computedOpacity;
- this.inFadeTransition = !a3, a3 || this.requestRender();
- }
- } else
- this.computedOpacity = this.opacity, this.computedVisible = this.visible;
- }
- onAttach() {
- }
- onDetach() {
- }
- doRender(e5) {
- }
- ready() {
- this._isReady || (this._isReady = true, this.emit("isReady"), this.requestRender());
- }
- };
- // node_modules/@arcgis/core/views/2d/engine/Container.js
- var i2 = class extends r3 {
- constructor() {
- super(...arguments), this._childrenSet = /* @__PURE__ */ new Set(), this._needsSort = false, this.children = [], this._effectView = null;
- }
- get blendMode() {
- return this._blendMode;
- }
- set blendMode(e5) {
- this._blendMode = e5, this.requestRender();
- }
- get clips() {
- return this._clips;
- }
- set clips(e5) {
- this._clips = e5, this.children.forEach((t2) => t2.clips = e5);
- }
- get computedEffects() {
- var _a, _b;
- return (_b = (_a = this._effectView) == null ? void 0 : _a.effects) != null ? _b : null;
- }
- get effect() {
- var _a, _b;
- return (_b = (_a = this._effectView) == null ? void 0 : _a.effect) != null ? _b : "";
- }
- set effect(e5) {
- (this._effectView || e5) && (this._effectView || (this._effectView = new a2()), this._effectView.effect = e5, this.requestRender());
- }
- updateTransitionProperties(e5, t2) {
- super.updateTransitionProperties(e5, t2), this._effectView && (this._effectView.transitionStep(e5, t2), this._effectView.transitioning && this.requestRender());
- }
- doRender(e5) {
- const t2 = this.createRenderParams(e5);
- this.renderChildren(t2);
- }
- addChild(e5) {
- return this.addChildAt(e5, this.children.length);
- }
- addChildAt(e5, t2 = this.children.length) {
- if (!e5)
- return e5;
- if (this.contains(e5))
- return e5;
- this._needsSort = true;
- const s5 = e5.parent;
- return s5 && s5 !== this && s5.removeChild(e5), t2 >= this.children.length ? this.children.push(e5) : this.children.splice(t2, 0, e5), this._childrenSet.add(e5), e5.parent = this, e5.stage = this.stage, this !== this.stage && (e5.clips = this.clips), this.requestRender(), e5;
- }
- contains(e5) {
- return this._childrenSet.has(e5);
- }
- endTransitions() {
- super.endTransitions(), this._effectView && (this._effectView.endTransitions(), this.requestRender());
- }
- removeAllChildren() {
- this._childrenSet.clear(), this._needsSort = true;
- for (const e5 of this.children)
- this !== this.stage && (e5.clips = null), e5.stage = null, e5.parent = null;
- this.children.length = 0;
- }
- removeChild(e5) {
- return this.contains(e5) ? this.removeChildAt(this.children.indexOf(e5)) : e5;
- }
- removeChildAt(e5) {
- if (e5 < 0 || e5 >= this.children.length)
- return null;
- this._needsSort = true;
- const t2 = this.children.splice(e5, 1)[0];
- return this._childrenSet.delete(t2), this !== this.stage && (t2.clips = null), t2.stage = null, t2.parent = null, t2;
- }
- sortChildren(e5) {
- this._needsSort && (this.children.sort(e5), this._needsSort = false);
- }
- beforeRender(e5) {
- super.beforeRender(e5);
- for (const t2 of this.children)
- t2.beforeRender(e5);
- }
- afterRender(e5) {
- super.afterRender(e5);
- for (const t2 of this.children)
- t2.afterRender(e5);
- }
- _createTransforms() {
- return { dvs: e3() };
- }
- onAttach() {
- super.onAttach();
- const e5 = this.stage;
- for (const t2 of this.children)
- t2.stage = e5;
- }
- onDetach() {
- super.onDetach();
- for (const e5 of this.children)
- e5.stage = null;
- }
- renderChildren(e5) {
- for (const t2 of this.children)
- t2.processRender(e5);
- }
- createRenderParams(e5) {
- return { ...e5, blendMode: this.blendMode, effects: this.computedEffects, globalOpacity: e5.globalOpacity * this.computedOpacity, inFadeTransition: this.inFadeTransition };
- }
- };
- // node_modules/@arcgis/core/views/2d/engine/webgl/techniques/Technique.js
- var e4 = class {
- static getStorageSpec(t2) {
- return null;
- }
- static createOrUpdateRendererSchema(e5, r4) {
- return r(e5) && "default" === e5.type ? e5 : { type: "default" };
- }
- static getVariation(t2) {
- return {};
- }
- static getVariationHash(t2) {
- return 0;
- }
- };
- e4.type = "default", e4.programSpec = null;
- // node_modules/@arcgis/core/views/2d/engine/webgl/techniques/dotDensity/TechniqueDotDensity.js
- var n4 = class extends e4 {
- static getStorageSpec({ attributes: e5 }) {
- return { visualVariables: false, attributes: e5 != null ? e5 : null };
- }
- static _createRendererSchema() {
- return { type: "dot-density", colors: new Float32Array(32), dotValue: -1, dotSize: -1, dotScale: -1, dotBlending: false, backgroundColor: new Float32Array(4), activeDots: new Float32Array(8), seed: -1 };
- }
- static createOrUpdateRendererSchema(r4, a3) {
- const { attributes: n6, dotValue: i3, referenceScale: d2, dotSize: l4, dotBlendingEnabled: s5, seed: c2, backgroundColor: u4 } = a3, m3 = r(r4) && "dot-density" === r4.type ? r4 : this._createRendererSchema();
- m3.dotValue = i3, m3.dotSize = l4, m3.dotScale = d2, m3.dotBlending = s5, m3.seed = c2;
- const { colors: g, activeDots: p3, backgroundColor: y3 } = m3;
- for (let e5 = 0; e5 < r2; e5++) {
- const o = e5 >= n6.length ? null : n6[e5].color;
- a(g, o, 4 * e5);
- }
- for (let e5 = 0; e5 < 8; e5++)
- p3[e5] = e5 < a3.attributes.length ? 1 : 0;
- return a(y3, u4), m3;
- }
- static getVariation(e5) {
- return { ddDotBlending: e5.dotBlending };
- }
- static getVariationHash(e5) {
- return e5.dotBlending ? 1 : 0;
- }
- };
- n4.type = "dot-density", n4.programSpec = { shader: "materials/fill", vertexLayout: { geometry: [{ location: 0, name: "a_pos", count: 2, type: C.SHORT }, { location: 1, name: "a_id", count: 3, type: C.UNSIGNED_BYTE }, { location: 2, name: "a_bitset", count: 1, type: C.UNSIGNED_BYTE }, { location: 3, name: "a_inverseArea", count: 1, type: C.FLOAT }] } };
- // node_modules/@arcgis/core/views/2d/engine/webgl/techniques/heatmap/TechniqueHeatmap.js
- var n5 = class extends e4 {
- static getStorageSpec({ field: e5, valueExpression: t2 }) {
- return { visualVariables: false, attributes: e5 || t2 ? [{ field: e5, valueExpression: t2 }] : null };
- }
- static _createRendererSchema() {
- return { type: "heatmap", radius: -1, referenceScale: -1, isFieldActive: 0, minDensity: -1, densityRange: -1, kernel: null, gradient: null, gradientHash: "invalid" };
- }
- static createOrUpdateRendererSchema(a3, i3) {
- const { radius: n6, minDensity: s5, maxDensity: o, referenceScale: c2, field: l4, valueExpression: m3, colorStops: p3 } = i3, d2 = o - s5, u4 = l4 || m3 ? 1 : 0, y3 = p3.map(({ color: e5, ratio: t2 }) => `${t2}:${e5.toString()}`).join();
- let h2, S2 = true;
- return r(a3) && "heatmap" === a3.type ? (h2 = a3, S2 = y3 !== a3.gradientHash) : h2 = this._createRendererSchema(), h2.radius = u(n6), h2.minDensity = s5, h2.densityRange = d2, h2.referenceScale = c2, h2.isFieldActive = u4, S2 && (h2.gradient = u2(p3), h2.gradientHash = y3), h2;
- }
- };
- n5.type = "heatmap", n5.programSpec = { shader: "materials/icon/heatmapAccumulate", vertexLayout: { geometry: [{ location: 0, name: "a_pos", count: 2, type: C.SHORT }, { location: 1, name: "a_vertexOffset", count: 2, type: C.SHORT }, { location: 4, name: "a_id", count: 4, type: C.UNSIGNED_BYTE }] } };
- // node_modules/@arcgis/core/views/2d/engine/webgl/techniques/pieChart/TechniquePieChart.js
- var l3 = class extends e4 {
- static getStorageSpec({ attributes: e5 }) {
- return { visualVariables: true, attributes: e5 != null ? e5 : null };
- }
- static _createRendererSchema() {
- return { type: "pie-chart", colors: new Float32Array(4 * s3), defaultColor: new Float32Array(4), othersColor: new Float32Array(4), outlineColor: new Float32Array(4), holePercentage: 0, sectorThreshold: 0, outlineWidth: 1, numberOfFields: 10 };
- }
- static createOrUpdateRendererSchema(n6, i3) {
- const { attributes: l4, defaultColor: s5, holePercentage: c2, othersCategory: m3, outline: u4 } = i3, d2 = r(n6) && "pie-chart" === n6.type ? n6 : this._createRendererSchema();
- for (let t2 = 0; t2 < s3; t2++) {
- const o = t2 >= l4.length ? new l([0, 0, 0, 0]) : l4[t2].color;
- a(d2.colors, o, 4 * t2);
- }
- return a(d2.defaultColor, s5), a(d2.othersColor, m3 == null ? void 0 : m3.color), a(d2.outlineColor, u4 == null ? void 0 : u4.color), d2.outlineWidth = u((u4 == null ? void 0 : u4.width) || 0), d2.holePercentage = c2, d2.sectorThreshold = (m3 == null ? void 0 : m3.threshold) || 0, d2.numberOfFields = l4.length, d2;
- }
- static getVariation(e5) {
- return { numberOfFields: e5.numberOfFields };
- }
- static getVariationHash(e5) {
- return e5.numberOfFields;
- }
- };
- l3.type = "pie-chart", l3.programSpec = { shader: "materials/pie", vertexLayout: { geometry: [{ location: 0, name: "a_pos", count: 2, type: C.SHORT }, { location: 1, name: "a_vertexOffset", count: 2, type: C.SHORT }, { location: 2, name: "a_texCoords", count: 2, type: C.UNSIGNED_SHORT }, { location: 3, name: "a_bitSetAndDistRatio", count: 2, type: C.UNSIGNED_SHORT }, { location: 4, name: "a_id", count: 4, type: C.UNSIGNED_BYTE }, { location: 5, name: "a_color", count: 4, type: C.UNSIGNED_BYTE, normalized: true }, { location: 6, name: "a_outlineColor", count: 4, type: C.UNSIGNED_BYTE, normalized: true }, { location: 7, name: "a_sizeAndOutlineWidth", count: 4, type: C.UNSIGNED_BYTE }, { location: 8, name: "a_zoomRange", count: 2, type: C.UNSIGNED_SHORT }] }, hittestAttributes: ["a_vertexOffset", "a_texCoords"] };
- // node_modules/@arcgis/core/views/2d/engine/webgl/techniques/utils.js
- function s4(r4, t2) {
- if (r4.type !== t2)
- throw new s2("material-view-model:unexpected-renderer-schema", `expected to find renderer schema of type "${t2}" but found type "${r4.type}"`);
- }
- function c(e5) {
- switch (e5 == null ? void 0 : e5.type) {
- case "dot-density":
- return n4;
- case "heatmap":
- return n5;
- case "pie-chart":
- return l3;
- default:
- return e4;
- }
- }
- function p2(e5) {
- const { geometryType: s5, symbologyType: c2 } = U.load(e5);
- switch (s5) {
- case E.FILL:
- if (c2 === S.DOT_DENSITY)
- return n4;
- break;
- case E.MARKER:
- switch (c2) {
- case S.HEATMAP:
- return n5;
- case S.PIE_CHART:
- return l3;
- }
- }
- return e4;
- }
- export {
- a2 as a,
- r3 as r,
- i2 as i,
- e4 as e,
- s4 as s,
- c,
- p2 as p
- };
- //# sourceMappingURL=chunk-ZLQP3WDC.js.map
|