@genome-spy/app 0.77.0 → 0.78.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12645,6 +12645,9 @@ var Sk = class {
12645
12645
  get scale() {
12646
12646
  return this.#e;
12647
12647
  }
12648
+ resetScale() {
12649
+ this.dispose(), this.#e = void 0;
12650
+ }
12648
12651
  getLocusGenome(e) {
12649
12652
  let t = this.#a?.();
12650
12653
  if (!t) throw Error("No genome has been defined!");
@@ -12848,11 +12851,19 @@ function Lk(e, { channel: t, dataType: n, isExplicitDomain: r, markTypes: i, has
12848
12851
  return c;
12849
12852
  }
12850
12853
  //#endregion
12854
+ //#region ../core/src/scales/domainExpressions.js
12855
+ function Rk(e, t) {
12856
+ return j(e) ? t.createExpression(e.expr)() : Array.isArray(e) ? e.map((e) => Rk(e, t)) : e;
12857
+ }
12858
+ function zk(e) {
12859
+ return j(e) ? [e] : Array.isArray(e) ? e.flatMap((e) => zk(e)) : [];
12860
+ }
12861
+ //#endregion
12851
12862
  //#region ../core/src/scales/scaleResolutionConstants.js
12852
- var Rk = "quantitative", zk = "ordinal", Bk = "nominal";
12863
+ var Bk = "quantitative", Vk = "ordinal", Hk = "nominal";
12853
12864
  //#endregion
12854
12865
  //#region ../core/src/scales/scaleRules.js
12855
- function Vk(e, t) {
12866
+ function Uk(e, t) {
12856
12867
  if (t == "index" || t == "locus") {
12857
12868
  if (rd(e)) return t;
12858
12869
  throw Error(e + " does not support " + t + " data type. Only positional channels do.");
@@ -12934,91 +12945,97 @@ function Vk(e, t) {
12934
12945
  void 0
12935
12946
  ]
12936
12947
  }, r = ["sample"].includes(e) ? "null" : n[e] ? n[e][[
12937
- Bk,
12938
- zk,
12939
- Rk
12948
+ Hk,
12949
+ Vk,
12950
+ Bk
12940
12951
  ].indexOf(t)] : t == "quantitative" ? "linear" : "ordinal";
12941
12952
  if (r === void 0) throw Error("Channel \"" + e + "\" is not compatible with \"" + t + "\" data type. Use of a proper scale may be needed.");
12942
12953
  return r;
12943
12954
  }
12944
- function Hk(e, t) {
12955
+ function Wk(e, t, n, r) {
12956
+ if (n) {
12957
+ if (["index", "locus"].includes(n) && !rd(e)) throw Error(`Index and locus scales are only supported on positional channels (x/y). Channel "${e}" resolves to scale type "${n}".`);
12958
+ if (["index", "locus"].includes(t) && n !== t || n === "locus" && n !== t) throw Error(`${r} "${n}" is incompatible with "${t}" data.`);
12959
+ }
12960
+ }
12961
+ function Gk(e, t) {
12945
12962
  id(t) && e.type !== "ordinal" && (e.range = [0, 1]), t == "opacity" && I(e.type) && e.clamp === void 0 && (e.clamp = !0);
12946
12963
  }
12947
12964
  //#endregion
12948
12965
  //#region ../core/src/scales/scalePropsResolver.js
12949
- function Uk({ channel: e, dataType: t, orderedMembers: n, isExplicitDomain: r, configScopes: i }) {
12950
- let a = n, o = a.map((e) => typeof e.view.getMarkType == "function" ? e.view.getMarkType() : void 0).filter((e) => !!e), s = Tk(a.map((e) => e.channelDef.scale).filter((e) => e !== void 0), "scale", ["domain"]);
12951
- if (s === null || s.type == "null") return { type: "null" };
12952
- let c = {
12953
- ...Lk(i, {
12966
+ function Kk({ channel: e, dataType: t, orderedMembers: n, viewLevelScaleConfig: r, isExplicitDomain: i, configScopes: a }) {
12967
+ let o = n, s = o.map((e) => typeof e.view.getMarkType == "function" ? e.view.getMarkType() : void 0).filter((e) => !!e), c = Tk(r ? [r.config] : o.map((e) => e.channelDef.scale).filter((e) => e !== void 0), "scale", ["domain"]);
12968
+ if (c === null || c.type == "null") return { type: "null" };
12969
+ let l = {
12970
+ ...Lk(a, {
12954
12971
  channel: e,
12955
12972
  dataType: t,
12956
- isExplicitDomain: r,
12957
- markTypes: o,
12958
- hasDomainMid: s.domainMid !== void 0
12973
+ isExplicitDomain: i,
12974
+ markTypes: s,
12975
+ hasDomainMid: c.domainMid !== void 0
12959
12976
  }),
12960
- ...s
12977
+ ...c
12961
12978
  };
12962
- if (c.type ||= Vk(e, t), typeof c.range == "string") {
12963
- if (!jk(c.range)) throw Error("Unknown named scale range \"" + c.range + "\". Supported names: shape, size, angle, heatmap, ramp, diverging.");
12964
- let t = Mk(i, c.range);
12965
- if (t === void 0) throw Error("Named scale range \"" + c.range + "\" is not configured in config.range.");
12966
- ud(e) && (typeof t == "string" || typeof t == "object" && t && !Array.isArray(t)) ? (c.scheme = t, delete c.range) : c.range = t;
12979
+ if (l.type ||= Uk(e, t), Wk(e, t, r ? l.type : void 0, `View-level scales.${e}.type`), typeof l.range == "string") {
12980
+ if (!jk(l.range)) throw Error("Unknown named scale range \"" + l.range + "\". Supported names: shape, size, angle, heatmap, ramp, diverging.");
12981
+ let t = Mk(a, l.range);
12982
+ if (t === void 0) throw Error("Named scale range \"" + l.range + "\" is not configured in config.range.");
12983
+ ud(e) && (typeof t == "string" || typeof t == "object" && t && !Array.isArray(t)) ? (l.scheme = t, delete l.range) : l.range = t;
12967
12984
  }
12968
- if (e == "y" && jf(c.type) && c.reverse == null && (c.reverse = !0), c.range && c.scheme && delete c.scheme, c.domainTransition === void 0 && (c.domainTransition = !a.some((e) => j(e.channelDef.scale?.domain))), Array.isArray(c.range) && c.range.some(j) && a.length > 0) {
12969
- let e = a.find((e) => e.channelDef.scale?.range !== void 0)?.view;
12970
- e && (c.__rangeExprScope = e);
12985
+ if (e == "y" && jf(l.type) && l.reverse == null && (l.reverse = !0), l.range && l.scheme && delete l.scheme, l.domainTransition === void 0 && (l.domainTransition = !(o.some((e) => zk(e.channelDef.scale?.domain).length > 0) || zk(r?.config.domain).length > 0)), Array.isArray(l.range) && l.range.some(j) && o.length > 0) {
12986
+ let e = r?.config.range === void 0 ? o.find((e) => e.channelDef.scale?.range !== void 0)?.view : r.view;
12987
+ e && (l.__rangeExprScope = e);
12971
12988
  }
12972
- if (!("zoom" in c)) {
12973
- let e = Fk(i, t);
12974
- e.zoom === void 0 ? ["index", "locus"].includes(c.type) && (c.zoom = !0) : c.zoom = e.zoom;
12989
+ if (!("zoom" in l)) {
12990
+ let e = Fk(a, t);
12991
+ e.zoom === void 0 ? ["index", "locus"].includes(l.type) && (l.zoom = !0) : l.zoom = e.zoom;
12975
12992
  }
12976
- return Hk(c, e), c;
12993
+ return Gk(l, e), l;
12977
12994
  }
12978
12995
  //#endregion
12979
12996
  //#region ../core/src/scales/indexLikeDomainUtils.js
12980
- function Wk(e) {
12997
+ function qk(e) {
12981
12998
  return e === "index" || e === "locus";
12982
12999
  }
12983
- function Gk(e, t) {
12984
- return Wk(e) ? Jk(t) : t;
13000
+ function Jk(e, t) {
13001
+ return qk(e) ? Zk(t) : t;
12985
13002
  }
12986
- function Kk(e, t) {
12987
- return Wk(e) ? Yk(t) : t;
13003
+ function Yk(e, t) {
13004
+ return qk(e) ? Qk(t) : t;
12988
13005
  }
12989
- function qk(e, t) {
12990
- return t && Wk(e) ? Jk(t) : t;
13006
+ function Xk(e, t) {
13007
+ return t && qk(e) ? Zk(t) : t;
12991
13008
  }
12992
- function Jk(e) {
12993
- return [e[0], e[1] + Xk(e)];
13009
+ function Zk(e) {
13010
+ return [e[0], e[1] + $k(e)];
12994
13011
  }
12995
- function Yk(e) {
12996
- return [e[0], e[1] - Xk(e)];
13012
+ function Qk(e) {
13013
+ return [e[0], e[1] - $k(e)];
12997
13014
  }
12998
- function Xk(e) {
13015
+ function $k(e) {
12999
13016
  return e[1] >= e[0] ? 1 : -1;
13000
13017
  }
13001
13018
  //#endregion
13002
13019
  //#region ../core/src/scales/selectionDomainUtils.js
13003
- function Zk(e, t) {
13020
+ function eA(e, t) {
13004
13021
  let n = e.findRuntimeForParam(t);
13005
13022
  if (!n) throw Error(`Selection domain parameter "${t}" was not found.`);
13006
13023
  return n;
13007
13024
  }
13008
- function Qk(e, t) {
13025
+ function tA(e, t) {
13009
13026
  if (e) {
13010
13027
  if (!xu(e)) throw Error(`Selection domain parameter "${t}" must be an interval selection.`);
13011
13028
  return e;
13012
13029
  }
13013
13030
  }
13014
- function $k(e, t, n) {
13015
- let r = e.paramRuntime.findRuntimeForParam ? Zk(e.paramRuntime, t) : e.paramRuntime;
13031
+ function nA(e, t, n) {
13032
+ let r = e.paramRuntime.findRuntimeForParam ? eA(e.paramRuntime, t) : e.paramRuntime;
13016
13033
  return {
13017
13034
  runtime: r,
13018
- selection: Qk(r.getValue ? r.getValue(t) : e.paramRuntime.findValue(t), t)
13035
+ selection: tA(r.getValue ? r.getValue(t) : e.paramRuntime.findValue(t), t)
13019
13036
  };
13020
13037
  }
13021
- function eA(e, t, n, r) {
13038
+ function rA(e, t, n, r) {
13022
13039
  let i = [];
13023
13040
  return e.visit((e) => {
13024
13041
  let a = e.paramRuntime?.paramConfigs?.get(n);
@@ -13030,7 +13047,7 @@ function eA(e, t, n, r) {
13030
13047
  });
13031
13048
  }), i;
13032
13049
  }
13033
- function tA(e, t, n, r) {
13050
+ function iA(e, t, n, r) {
13034
13051
  let i = /* @__PURE__ */ new Set(), a = [
13035
13052
  e.getLayoutAncestors?.(),
13036
13053
  e.getDataAncestors?.(),
@@ -13046,7 +13063,7 @@ function tA(e, t, n, r) {
13046
13063
  }
13047
13064
  return !1;
13048
13065
  }
13049
- function nA(e, t, n = {}) {
13066
+ function aA(e, t, n = {}) {
13050
13067
  if (!e || e.length !== 2) return;
13051
13068
  let r = Number(e[0]), i = Number(e[1]);
13052
13069
  if (!Number.isFinite(r) || !Number.isFinite(i)) return;
@@ -13055,7 +13072,7 @@ function nA(e, t, n = {}) {
13055
13072
  }
13056
13073
  //#endregion
13057
13074
  //#region ../core/src/utils/domainArray.js
13058
- var rA = class e extends Array {
13075
+ var oA = class e extends Array {
13059
13076
  constructor() {
13060
13077
  super(), this.type = void 0;
13061
13078
  }
@@ -13071,25 +13088,25 @@ var rA = class e extends Array {
13071
13088
  for (let n of e) this.extend(t(n));
13072
13089
  return this;
13073
13090
  }
13074
- }, iA = class extends rA {
13091
+ }, sA = class extends oA {
13075
13092
  constructor() {
13076
13093
  super(), this.type = "quantitative";
13077
13094
  }
13078
13095
  extend(e) {
13079
13096
  return e == null || Number.isNaN(e) ? this : (e = +e, this.length ? e < this[0] ? this[0] = e : e > this[1] && (this[1] = e) : (this.push(e), this.push(e)), this);
13080
13097
  }
13081
- }, aA = class extends rA {
13098
+ }, cA = class extends oA {
13082
13099
  constructor() {
13083
13100
  super(), this.type = "ordinal", this.uniqueValues = /* @__PURE__ */ new Set();
13084
13101
  }
13085
13102
  extend(e) {
13086
13103
  return e == null || Number.isNaN(e) || this.uniqueValues.has(e) || (this.uniqueValues.add(e), this.push(e)), this;
13087
13104
  }
13088
- }, oA = class extends aA {
13105
+ }, lA = class extends cA {
13089
13106
  constructor() {
13090
13107
  super(), this.type = "nominal";
13091
13108
  }
13092
- }, sA = class extends rA {
13109
+ }, uA = class extends oA {
13093
13110
  constructor(e) {
13094
13111
  super();
13095
13112
  let t = 0;
@@ -13101,29 +13118,29 @@ var rA = class e extends Array {
13101
13118
  if (this.includes(e)) return this;
13102
13119
  throw Error("Piecewise domains are immutable and cannot be unioned!");
13103
13120
  }
13104
- }, cA = {
13105
- quantitative: iA,
13106
- index: iA,
13107
- locus: iA,
13108
- nominal: oA,
13109
- ordinal: aA
13121
+ }, dA = {
13122
+ quantitative: sA,
13123
+ index: sA,
13124
+ locus: sA,
13125
+ nominal: lA,
13126
+ ordinal: cA
13110
13127
  };
13111
- function lA(e, t) {
13112
- if (e == "quantitative" && uA(t)) {
13113
- let n = new sA(t);
13128
+ function fA(e, t) {
13129
+ if (e == "quantitative" && pA(t)) {
13130
+ let n = new uA(t);
13114
13131
  return n.type = e, n;
13115
- } else if (cA[e]) {
13116
- let n = new cA[e]();
13132
+ } else if (dA[e]) {
13133
+ let n = new dA[e]();
13117
13134
  return n.type = e, t && n.extendAll(t), n;
13118
13135
  }
13119
13136
  throw Error("Unknown type: " + e);
13120
13137
  }
13121
- function uA(e) {
13138
+ function pA(e) {
13122
13139
  return e && e.length > 0 && e.length != 2 && e.every((e) => typeof e == "number");
13123
13140
  }
13124
13141
  //#endregion
13125
13142
  //#region ../core/src/scales/domainPlanner.js
13126
- var dA = class {
13143
+ var mA = class {
13127
13144
  #e;
13128
13145
  #t;
13129
13146
  #n;
@@ -13131,24 +13148,25 @@ var dA = class {
13131
13148
  #i;
13132
13149
  #a;
13133
13150
  #o;
13134
- #s = void 0;
13135
- #c = !0;
13136
- #l = /* @__PURE__ */ new Map();
13137
- #u = /* @__PURE__ */ new WeakMap();
13138
- constructor({ getActiveMembers: e, getAllMembers: t, getDataMembers: n, getType: r, getLocusExtent: i, fromComplexInterval: a }) {
13139
- this.#e = e, this.#t = t ?? e, this.#n = n ?? e, this.#r = r, this.#i = i, this.#a = a;
13151
+ #s;
13152
+ #c = void 0;
13153
+ #l = !0;
13154
+ #u = /* @__PURE__ */ new Map();
13155
+ #d = /* @__PURE__ */ new WeakMap();
13156
+ constructor({ getActiveMembers: e, getAllMembers: t, getDataMembers: n, getViewLevelConfiguredDomain: r, getType: i, getLocusExtent: a, fromComplexInterval: o }) {
13157
+ this.#e = e, this.#t = t ?? e, this.#n = n ?? e, this.#r = r, this.#i = i, this.#a = a, this.#o = o;
13140
13158
  }
13141
13159
  get initialDomainSnapshot() {
13142
- return this.#o;
13160
+ return this.#s;
13143
13161
  }
13144
13162
  hasConfiguredDomain(e = {}) {
13145
13163
  return !!this.getConfiguredDomain(e);
13146
13164
  }
13147
13165
  hasSelectionConfiguredDomain() {
13148
- return this.getSelectionConfiguredDomainBindingInfo(), !!this.#s;
13166
+ return this.getSelectionConfiguredDomainBindingInfo(), !!this.#c;
13149
13167
  }
13150
13168
  getSelectionConfiguredDomainBindingInfo() {
13151
- return this.#s || !this.#c || this.getConfiguredDomain(), this.#s;
13169
+ return this.#c || !this.#l || this.getConfiguredDomain(), this.#c;
13152
13170
  }
13153
13171
  getSelectionConfiguredDomainInfo() {
13154
13172
  let e = this.getSelectionConfiguredDomainBindingInfo();
@@ -13158,33 +13176,33 @@ var dA = class {
13158
13176
  };
13159
13177
  }
13160
13178
  invalidateConfiguredDomain() {
13161
- this.#c = !0, this.#s = void 0, this.#l.clear();
13179
+ this.#l = !0, this.#c = void 0, this.#u.clear();
13162
13180
  }
13163
13181
  getDefaultDomain(e = !1, t) {
13164
- let n = this.#r();
13165
- return CA(n, this.#i, e && n !== "locus" ? this.getDataDomain() : void 0, t);
13182
+ let n = this.#i();
13183
+ return DA(n, this.#a, e && n !== "locus" ? this.getDataDomain() : void 0, t);
13166
13184
  }
13167
13185
  getConfiguredOrDefaultDomain(e = !1, t, n = {}) {
13168
13186
  return this.getConfiguredDomain(n) ?? this.getDefaultDomain(e, t);
13169
13187
  }
13170
13188
  getConfiguredDomain(e = {}) {
13171
13189
  let t = e.includeSelectionInitial ?? !0;
13172
- if (!this.#c && this.#l.has(t)) return this.#l.get(t);
13173
- let n = fA(this.#e(), this.#a, t);
13174
- return yA(this.#t(), n.selectionRef), this.#s = n.selectionRef, this.#l.set(t, n.domain), this.#c = !1, n.domain;
13190
+ if (!this.#l && this.#u.has(t)) return this.#u.get(t);
13191
+ let n = hA(this.#e(), this.#r?.(), this.#o, t);
13192
+ return CA(this.#t(), n.selectionRef), this.#c = n.selectionRef, this.#u.set(t, n.domain), this.#l = !1, n.domain;
13175
13193
  }
13176
13194
  getDataDomain() {
13177
- return SA(this.#n(), this.#r, (e) => this.#d(e));
13195
+ return EA(this.#n(), this.#i, (e) => this.#f(e));
13178
13196
  }
13179
13197
  captureInitialDomain(e, t, n) {
13180
- if (!this.#o && I(e.type)) {
13198
+ if (!this.#s && I(e.type)) {
13181
13199
  let t = n ?? e.domain();
13182
- Rn(t) > 0 && (this.#o = t);
13200
+ Rn(t) > 0 && (this.#s = t);
13183
13201
  }
13184
- return t ? !1 : (this.#o = n ?? e.domain(), !0);
13202
+ return t ? !1 : (this.#s = n ?? e.domain(), !0);
13185
13203
  }
13186
- #d(e) {
13187
- let t = this.#u.get(e);
13204
+ #f(e) {
13205
+ let t = this.#d.get(e);
13188
13206
  if (t) return t;
13189
13207
  let n = e.view.mark.encoders;
13190
13208
  if (!n) return [];
@@ -13193,41 +13211,40 @@ var dA = class {
13193
13211
  let i = Hu(r);
13194
13212
  if (i.length === 0) return [];
13195
13213
  let a = i.filter(ju).filter((e) => !e.channelDef.domainInert);
13196
- return this.#u.set(e, a), a;
13214
+ return this.#d.set(e, a), a;
13197
13215
  }
13198
13216
  };
13199
- function fA(e, t, n) {
13200
- let r = Array.from(e).filter((e) => e.contributesToDomain).filter((e) => e.channelDef.scale?.domain), i = {
13217
+ function hA(e, t, n, r) {
13218
+ let i = Array.from(e).filter((e) => e.contributesToDomain).filter((e) => e.channelDef.scale?.domain), a = {
13201
13219
  domains: [],
13202
13220
  selectionRef: void 0,
13203
13221
  selectionRuntime: void 0,
13204
13222
  selectionDescription: void 0,
13205
13223
  hasLiteralDomain: !1
13206
13224
  };
13207
- for (let e of r) {
13208
- let r = pA(e, t, n);
13209
- if (r.kind === "selection") {
13210
- mA(i, r);
13211
- continue;
13212
- }
13213
- hA(i, r);
13214
- }
13215
- return gA(i);
13216
- }
13217
- function pA(e, t, n) {
13218
- let r = e.channelDef.scale.domain;
13219
- return xA(r) ? {
13225
+ t?.domain !== void 0 && gA(a, _A(t, n, r));
13226
+ for (let e of i) gA(a, _A({
13227
+ view: e.view,
13228
+ channel: e.channel,
13229
+ type: e.channelDef.type,
13230
+ domain: e.channelDef.scale.domain
13231
+ }, n, r));
13232
+ return bA(a);
13233
+ }
13234
+ function gA(e, t) {
13235
+ t.kind === "selection" ? vA(e, t) : yA(e, t);
13236
+ }
13237
+ function _A(e, t, n) {
13238
+ let r = e.domain;
13239
+ return TA(r) ? {
13220
13240
  kind: "selection",
13221
- ..._A(e, r, t, n)
13222
- } : j(r) ? {
13223
- kind: "literal",
13224
- domain: vA(e.channelDef.type, e.view.paramRuntime.createExpression(r.expr)(), t)
13241
+ ...xA(e, r, t, n)
13225
13242
  } : {
13226
13243
  kind: "literal",
13227
- domain: vA(e.channelDef.type, r, t)
13244
+ domain: SA(e.type, Rk(r, e.view?.paramRuntime), t)
13228
13245
  };
13229
13246
  }
13230
- function mA(e, t) {
13247
+ function vA(e, t) {
13231
13248
  if (e.hasLiteralDomain) throw Error("Cannot mix selection-driven and literal configured domains on a shared scale.");
13232
13249
  if (e.selectionRef && (e.selectionRef.runtime !== t.runtime || e.selectionRef.param !== t.param || e.selectionRef.encoding !== t.encoding)) throw Error("Conflicting selection domain references on a shared scale: " + e.selectionDescription + " vs " + t.description + ".");
13233
13250
  e.selectionRuntime = t.runtime, e.selectionDescription = t.description, e.selectionRef = {
@@ -13237,11 +13254,11 @@ function mA(e, t) {
13237
13254
  runtime: t.runtime
13238
13255
  }, t.domain && e.domains.push(t.domain);
13239
13256
  }
13240
- function hA(e, t) {
13257
+ function yA(e, t) {
13241
13258
  if (e.selectionRuntime) throw Error("Cannot mix literal configured domains with selection-driven domains on a shared scale.");
13242
13259
  e.hasLiteralDomain = !0, e.domains.push(t.domain);
13243
13260
  }
13244
- function gA(e) {
13261
+ function bA(e) {
13245
13262
  return e.domains.length > 0 ? {
13246
13263
  domain: e.domains.reduce((e, t) => e.extendAll(t)),
13247
13264
  selectionRef: e.selectionRef
@@ -13253,17 +13270,17 @@ function gA(e) {
13253
13270
  selectionRef: void 0
13254
13271
  };
13255
13272
  }
13256
- function _A(e, t, n, r) {
13257
- let i = t.param, a = bA(e.channel, t, i), o = $k(e.view, i, a), s = t.initial !== void 0, c = o.selection?.intervals[a], l = i + "." + a;
13273
+ function xA(e, t, n, r) {
13274
+ let i = t.param, a = wA(e.channel, t, i), o = nA(e.view, i, a), s = t.initial !== void 0, c = o.selection?.intervals[a], l = i + "." + a;
13258
13275
  return !c || c.length !== 2 ? {
13259
- domain: r && t.initial ? vA(e.channelDef.type, t.initial, n) : void 0,
13276
+ domain: r && t.initial ? SA(e.type, t.initial, n) : void 0,
13260
13277
  description: l,
13261
13278
  param: i,
13262
13279
  encoding: a,
13263
13280
  hasInitial: s,
13264
13281
  runtime: o.runtime
13265
13282
  } : {
13266
- domain: lA(e.channelDef.type, n(c)),
13283
+ domain: fA(e.type, n(c)),
13267
13284
  description: l,
13268
13285
  param: i,
13269
13286
  encoding: a,
@@ -13271,25 +13288,25 @@ function _A(e, t, n, r) {
13271
13288
  runtime: o.runtime
13272
13289
  };
13273
13290
  }
13274
- function vA(e, t, n) {
13291
+ function SA(e, t, n) {
13275
13292
  let r = n(t);
13276
- return lA(e, e === "locus" && qg(t) && !Jg(t) ? r : Gk(e, r));
13293
+ return fA(e, e === "locus" && qg(t) && !Jg(t) ? r : Jk(e, r));
13277
13294
  }
13278
- function yA(e, t) {
13279
- if (!t || e.size < 2 || !Array.from(e).some((e) => tA(e.view, t.runtime, t.param, t.encoding))) return;
13295
+ function CA(e, t) {
13296
+ if (!t || e.size < 2 || !Array.from(e).some((e) => iA(e.view, t.runtime, t.param, t.encoding))) return;
13280
13297
  let n = Array.from(new Set(Array.from(e).filter((e) => e.contributesToDomain).map((e) => e.view.getPathString?.() ?? e.view.name ?? "(unknown)")));
13281
13298
  throw Error(`Selection domain reference "${t.param}.${t.encoding}" cannot use a shared ${t.encoding} scale when the same interval selection is defined in that shared view group (${n.join(", ")}). This creates a feedback loop between brushing and the scale domain. Make the linked ${t.encoding} scale independent, for example with "resolve": { "scale": { "${t.encoding}": "independent" } } on the common ancestor.`);
13282
13299
  }
13283
- function bA(e, t, n) {
13300
+ function wA(e, t, n) {
13284
13301
  if (t.encoding) return t.encoding;
13285
13302
  let r = ld(e);
13286
13303
  if (r === "x" || r === "y") return r;
13287
13304
  throw Error(`Selection domain reference "${n}" on channel "${e}" requires an explicit "encoding" ("x" or "y").`);
13288
13305
  }
13289
- function xA(e) {
13306
+ function TA(e) {
13290
13307
  return typeof e == "object" && !!e && !Array.isArray(e) && typeof e.param == "string";
13291
13308
  }
13292
- function SA(e, t, n) {
13309
+ function EA(e, t, n) {
13293
13310
  let r = t(), i = /* @__PURE__ */ new Map();
13294
13311
  for (let t of e) {
13295
13312
  if (!t.contributesToDomain) continue;
@@ -13301,36 +13318,36 @@ function SA(e, t, n) {
13301
13318
  if (o || (o = /* @__PURE__ */ new Map(), i.set(n, o)), o.has(e)) continue;
13302
13319
  let s;
13303
13320
  if (a) s = a.getDomain(e, r, t);
13304
- else if (t.constant) s = lA(r), s.extend(t({}));
13321
+ else if (t.constant) s = fA(r), s.extend(t({}));
13305
13322
  else continue;
13306
13323
  o.set(e, s);
13307
13324
  }
13308
13325
  }
13309
13326
  if (i.size === 0) return;
13310
- let a = lA(r);
13327
+ let a = fA(r);
13311
13328
  for (let e of i.values()) for (let t of e.values()) a.extendAll(t);
13312
13329
  return a;
13313
13330
  }
13314
- function CA(e, t, n, r) {
13315
- return e == "locus" ? t(r) : e == "index" ? qk(e, n) ?? [] : n ?? [];
13331
+ function DA(e, t, n, r) {
13332
+ return e == "locus" ? t(r) : e == "index" ? Xk(e, n) ?? [] : n ?? [];
13316
13333
  }
13317
13334
  //#endregion
13318
13335
  //#region ../../node_modules/d3-ease/src/cubic.js
13319
- function wA(e) {
13336
+ function OA(e) {
13320
13337
  return ((e *= 2) <= 1 ? e * e * e : (e -= 2) * e * e + 2) / 2;
13321
13338
  }
13322
13339
  //#endregion
13323
13340
  //#region ../core/src/utils/eerp.js
13324
- function TA(e, t, n) {
13341
+ function kA(e, t, n) {
13325
13342
  return e * (t / e) ** +n;
13326
13343
  }
13327
13344
  //#endregion
13328
13345
  //#region ../core/src/utils/transition.js
13329
- var EA = (e) => new Promise((t) => setTimeout(t, e));
13330
- function DA() {
13346
+ var AA = (e) => new Promise((t) => setTimeout(t, e));
13347
+ function jA() {
13331
13348
  return { canceled: !1 };
13332
13349
  }
13333
- function OA(e) {
13350
+ function MA(e) {
13334
13351
  let t = e.requestAnimationFrame || window.requestAnimationFrame, n = e.signal, r = e.cancelToken, i = () => new Promise((i, a) => {
13335
13352
  if (r?.canceled) return i();
13336
13353
  if (n?.aborted) return a("aborted");
@@ -13343,11 +13360,11 @@ function OA(e) {
13343
13360
  };
13344
13361
  t(m);
13345
13362
  });
13346
- return e.delay ? r?.canceled ? Promise.resolve() : n?.aborted ? Promise.reject("aborted") : EA(e.delay).then(i) : i();
13363
+ return e.delay ? r?.canceled ? Promise.resolve() : n?.aborted ? Promise.reject("aborted") : AA(e.delay).then(i) : i();
13347
13364
  }
13348
13365
  //#endregion
13349
13366
  //#region ../core/src/scales/zoomDomainUtils.js
13350
- function kA(e, t, n, r, i = {}) {
13367
+ function NA(e, t, n, r, i = {}) {
13351
13368
  let a = i.onUnsupported ?? "throw";
13352
13369
  switch (e.type) {
13353
13370
  case "linear":
@@ -13364,7 +13381,7 @@ function kA(e, t, n, r, i = {}) {
13364
13381
  }
13365
13382
  //#endregion
13366
13383
  //#region ../core/src/scales/scaleInteractionController.js
13367
- var AA = class {
13384
+ var PA = class {
13368
13385
  #e;
13369
13386
  #t;
13370
13387
  #n;
@@ -13378,7 +13395,7 @@ var AA = class {
13378
13395
  }
13379
13396
  getZoomExtent() {
13380
13397
  let e = this.#e(), t = e.props.zoom;
13381
- return MA(e, t, this.#a, this.#o, this.#r);
13398
+ return IA(e, t, this.#a, this.#o, this.#r);
13382
13399
  }
13383
13400
  isZoomable() {
13384
13401
  return this.isZoomingSupported() && !!this.#e().props.zoom;
@@ -13395,24 +13412,24 @@ var AA = class {
13395
13412
  }
13396
13413
  zoom(e, t, n) {
13397
13414
  if (!this.isZoomingSupported()) return !1;
13398
- let r = this.#e(), i = r.domain(), a = NA(r, i, e, t, n), o = this.getZoomExtent();
13415
+ let r = this.#e(), i = r.domain(), a = LA(r, i, e, t, n), o = this.getZoomExtent();
13399
13416
  return a = Cn(a, o[0], o[1]), [0, 1].some((e) => a[e] != i[e]) ? (r.domain(a), !0) : !1;
13400
13417
  }
13401
13418
  async zoomTo(e, t = !1) {
13402
- let { duration: n, renderImmediately: r } = jA(t);
13419
+ let { duration: n, renderImmediately: r } = FA(t);
13403
13420
  if (!this.isZoomingSupported()) throw Error("Not a zoomable scale!");
13404
- let i = this.#e(), a = PA(i.type, e, this.#a), o = this.#t(), s = i.domain();
13421
+ let i = this.#e(), a = RA(i.type, e, this.#a), o = this.#t(), s = i.domain();
13405
13422
  if (n > 0 && s.length == 2) {
13406
13423
  if (r) throw Error("renderImmediately is not supported for animated zooms.");
13407
13424
  let e = s[1] - s[0], t = a[1] - a[0], c = s[0] + e / 2, l = a[0] + t / 2, u = s[0] == a[0], d = s[1] == a[1];
13408
13425
  this.#c();
13409
- let f = DA();
13426
+ let f = jA();
13410
13427
  this.#s = f, await o.transition({
13411
13428
  duration: n,
13412
- easingFunction: wA,
13429
+ easingFunction: OA,
13413
13430
  cancelToken: f,
13414
13431
  onUpdate: (n) => {
13415
- let r = TA(e, t, n), a = e == t ? n : (e - r) / (e - t), o = a * l + (1 - a) * c, f = [u ? s[0] : o - r / 2, d ? s[1] : o + r / 2];
13432
+ let r = kA(e, t, n), a = e == t ? n : (e - r) / (e - t), o = a * l + (1 - a) * c, f = [u ? s[0] : o - r / 2, d ? s[1] : o + r / 2];
13416
13433
  i.domain(f);
13417
13434
  }
13418
13435
  }), this.#s === f && (this.#s = null), i.domain(a);
@@ -13430,7 +13447,7 @@ var AA = class {
13430
13447
  return this.isZoomable() ? Rn(this.getZoomExtent()) / Rn(this.#e().domain()) : 1;
13431
13448
  }
13432
13449
  };
13433
- function jA(e) {
13450
+ function FA(e) {
13434
13451
  if (e === void 0) return {
13435
13452
  duration: 0,
13436
13453
  renderImmediately: !1
@@ -13449,10 +13466,10 @@ function jA(e) {
13449
13466
  renderImmediately: e.renderImmediately === !0
13450
13467
  };
13451
13468
  }
13452
- function MA(e, t, n, r, i) {
13453
- return FA(t) && S(t.extent) ? PA(e.props.type, t.extent, n) : t && e.props.type == "locus" ? r() : i();
13469
+ function IA(e, t, n, r, i) {
13470
+ return zA(t) && S(t.extent) ? RA(e.props.type, t.extent, n) : t && e.props.type == "locus" ? r() : i();
13454
13471
  }
13455
- function NA(e, t, n, r, i) {
13472
+ function LA(e, t, n, r, i) {
13456
13473
  let a = [...t], o = e.invert(r);
13457
13474
  switch (e.props.reverse && (i = -i), "align" in e && (o += e.align()), e.type) {
13458
13475
  case "linear":
@@ -13472,26 +13489,26 @@ function NA(e, t, n, r, i) {
13472
13489
  break;
13473
13490
  default: throw Error("Zooming is not implemented for: " + e.type);
13474
13491
  }
13475
- return kA(e, a, o, n);
13492
+ return NA(e, a, o, n);
13476
13493
  }
13477
- function PA(e, t, n) {
13494
+ function RA(e, t, n) {
13478
13495
  let r = e === "locus" ? n(t) : t;
13479
- return e === "locus" && qg(t) && !Jg(t) ? r : Gk(e, r);
13496
+ return e === "locus" && qg(t) && !Jg(t) ? r : Jk(e, r);
13480
13497
  }
13481
- function FA(e) {
13498
+ function zA(e) {
13482
13499
  return an(e);
13483
13500
  }
13484
13501
  //#endregion
13485
13502
  //#region ../core/src/scales/resolutionMemberOrder.js
13486
- function IA(e) {
13503
+ function BA(e) {
13487
13504
  let t = e.view.getPathString(), n = e.channel ?? "";
13488
13505
  return t + "|" + n;
13489
13506
  }
13490
- function LA(e) {
13491
- return Array.from(e).sort((e, t) => IA(e).localeCompare(IA(t)));
13507
+ function VA(e) {
13508
+ return Array.from(e).sort((e, t) => BA(e).localeCompare(BA(t)));
13492
13509
  }
13493
13510
  F("index", UO, ["continuous"]), F("locus", KO, ["continuous"]), F("null", DE, []);
13494
- var RA = class {
13511
+ var HA = class {
13495
13512
  #e = /* @__PURE__ */ new Set();
13496
13513
  #t = /* @__PURE__ */ new Set();
13497
13514
  #n;
@@ -13510,41 +13527,43 @@ var RA = class {
13510
13527
  #f = !1;
13511
13528
  #p = void 0;
13512
13529
  #m;
13513
- #h = 0;
13530
+ #h;
13514
13531
  #g = 0;
13515
- #_ = !1;
13532
+ #_ = 0;
13533
+ #v = !1;
13516
13534
  constructor(e, t) {
13517
- this.channel = e, this.type = null, this.name = void 0, this.#m = t, this.#a = new dA({
13518
- getActiveMembers: () => this.#b(),
13535
+ this.channel = e, this.type = null, this.name = void 0, this.#m = t, this.#a = new mA({
13536
+ getActiveMembers: () => this.#x(),
13519
13537
  getAllMembers: () => this.#e,
13520
- getDataMembers: () => this.#b(this.#t),
13538
+ getDataMembers: () => this.#x(this.#t),
13539
+ getViewLevelConfiguredDomain: () => this.#L(),
13521
13540
  getType: () => this.type,
13522
- getLocusExtent: (e) => this.#S(e),
13541
+ getLocusExtent: (e) => this.#C(e),
13523
13542
  fromComplexInterval: this.fromComplexInterval.bind(this)
13524
13543
  }), this.#i = new Sk({
13525
- getParamRuntime: () => this.#y.paramRuntime,
13526
- onRangeChange: () => this.#w("range"),
13527
- onDomainChange: () => this.#w("domain"),
13528
- getGenomeStore: () => this.#x.genomeStore
13529
- }), this.#o = new AA({
13544
+ getParamRuntime: () => this.#b.paramRuntime,
13545
+ onRangeChange: () => this.#T("range"),
13546
+ onDomainChange: () => this.#T("domain"),
13547
+ getGenomeStore: () => this.#S.genomeStore
13548
+ }), this.#o = new PA({
13530
13549
  getScale: () => this.getScale(),
13531
- getAnimator: () => this.#x.animator,
13532
- renderImmediately: () => this.#x.renderImmediately(),
13550
+ getAnimator: () => this.#S.animator,
13551
+ renderImmediately: () => this.#S.renderImmediately(),
13533
13552
  getInitialDomainSnapshot: () => this.#a.initialDomainSnapshot,
13534
- getResetDomain: () => this.#k(),
13553
+ getResetDomain: () => this.#A(),
13535
13554
  fromComplexInterval: this.fromComplexInterval.bind(this),
13536
- getGenomeExtent: () => this.#S()
13555
+ getGenomeExtent: () => this.#C()
13537
13556
  });
13538
13557
  }
13539
- get #v() {
13558
+ get #y() {
13540
13559
  let e = this.#e.values().next().value;
13541
13560
  if (!e) throw Error("ScaleResolution has no members!");
13542
13561
  return e.view;
13543
13562
  }
13544
- get #y() {
13545
- return this.#m ?? this.#v;
13563
+ get #b() {
13564
+ return this.#m ?? this.#y;
13546
13565
  }
13547
- #b(e = this.#e) {
13566
+ #x(e = this.#e) {
13548
13567
  let t = /* @__PURE__ */ new Set();
13549
13568
  for (let n of e) {
13550
13569
  let e = n.view;
@@ -13552,16 +13571,16 @@ var RA = class {
13552
13571
  }
13553
13572
  return t;
13554
13573
  }
13555
- get #x() {
13556
- return this.#y.context;
13574
+ get #S() {
13575
+ return this.#b.context;
13557
13576
  }
13558
13577
  get zoomExtent() {
13559
13578
  return (this.#i.scale && I(this.#i.scale.type) && this.#o.getZoomExtent()) ?? [-Infinity, Infinity];
13560
13579
  }
13561
- #S(e) {
13562
- return QO(this.#C(e));
13563
- }
13564
13580
  #C(e) {
13581
+ return QO(this.#w(e));
13582
+ }
13583
+ #w(e) {
13565
13584
  if (this.type === "locus") return this.#i.scale ?? this.#i.getLocusGenome(e);
13566
13585
  }
13567
13586
  addEventListener(e, t) {
@@ -13570,14 +13589,14 @@ var RA = class {
13570
13589
  removeEventListener(e, t) {
13571
13590
  this.#r[e].delete(t);
13572
13591
  }
13573
- #w(e) {
13592
+ #T(e) {
13574
13593
  e === "domain" && this.#u === 0 && this.syncLinkedSelectionFromDomain();
13575
13594
  for (let t of this.#r[e].values()) t({
13576
13595
  type: e,
13577
13596
  scaleResolution: this
13578
13597
  });
13579
13598
  }
13580
- #T(e) {
13599
+ #E(e) {
13581
13600
  this.#u += 1;
13582
13601
  try {
13583
13602
  e();
@@ -13588,12 +13607,12 @@ var RA = class {
13588
13607
  syncLinkedSelectionFromDomain() {
13589
13608
  let e = this.#a.getSelectionConfiguredDomainBindingInfo();
13590
13609
  if (!e || !this.isZoomable()) return;
13591
- let t = Qk(e.runtime.getValue(e.param), e.param);
13610
+ let t = tA(e.runtime.getValue(e.param), e.param);
13592
13611
  if (!t) return;
13593
- let n = this.#E(this.getScale().domain());
13612
+ let n = this.#D(this.getScale().domain());
13594
13613
  if (!n) return;
13595
- let r = this.#E(this.#a.getDefaultDomain(!0)), i = r && Kf(n, r) ? null : n;
13596
- zA(t.intervals[e.encoding] ?? null, i) || e.runtime.setValue(e.param, {
13614
+ let r = this.#D(this.#a.getDefaultDomain(!0)), i = r && Kf(n, r) ? null : n;
13615
+ UA(t.intervals[e.encoding] ?? null, i) || e.runtime.setValue(e.param, {
13597
13616
  ...t,
13598
13617
  type: "interval",
13599
13618
  intervals: {
@@ -13602,37 +13621,39 @@ var RA = class {
13602
13621
  }
13603
13622
  });
13604
13623
  }
13605
- #E(e) {
13606
- return nA(e, this.zoomExtent);
13624
+ #D(e) {
13625
+ return aA(e, this.zoomExtent);
13607
13626
  }
13608
- #D() {
13627
+ #O() {
13609
13628
  return this.#a.getSelectionConfiguredDomainBindingInfo();
13610
13629
  }
13611
- #O() {
13630
+ #k() {
13612
13631
  return !this.#f;
13613
13632
  }
13614
- #k(e = !1, t) {
13615
- return this.#a.getConfiguredOrDefaultDomain(e, t, { includeSelectionInitial: this.#O() });
13633
+ #A(e = !1, t) {
13634
+ return this.#a.getConfiguredOrDefaultDomain(e, t, { includeSelectionInitial: this.#k() });
13616
13635
  }
13617
- #A() {
13636
+ #j() {
13637
+ if (this.#h?.config.domain !== void 0) return !0;
13618
13638
  for (let e of this.#e) if (e.contributesToDomain && e.channelDef.scale?.domain !== void 0) return !0;
13619
13639
  return !1;
13620
13640
  }
13621
- #j(e) {
13622
- let t = Qk(e.runtime.getValue(e.param), e.param);
13641
+ #M(e) {
13642
+ let t = tA(e.runtime.getValue(e.param), e.param);
13623
13643
  if (!t) return null;
13624
13644
  let n = t.intervals[e.encoding];
13625
13645
  return n && n.length === 2 ? n : null;
13626
13646
  }
13627
- #M(e, t) {
13647
+ #N(e, t) {
13628
13648
  t ? this.#f = !1 : e && (this.#f = !0);
13629
13649
  }
13630
- #N(e) {
13631
- let t = BA(e), { channel: n, channelDef: r } = t, i = r.type == null && this.type;
13650
+ #P(e) {
13651
+ let t = WA(e), { channel: n, channelDef: r } = t;
13652
+ this.#R(t);
13653
+ let i = r.type == null && this.type;
13632
13654
  if (n != "sample" && !r.type && !sd(n) && !i) throw Error(`The "type" property must be defined in channel definition: "${n}": ${JSON.stringify(r)}. Must be one of: "quantitative", "ordinal", "nominal", "locus", "index"`);
13633
13655
  let a = n == "sample" ? "nominal" : r.type, o = r?.scale?.name, s = r.scale?.type ?? (a === "index" || a === "locus" ? a : void 0);
13634
- if (s && ["index", "locus"].includes(s) && !rd(this.channel)) throw Error(`Index and locus scales are only supported on positional channels (x/y). Channel "${this.channel}" resolves to scale type "${s}".`);
13635
- if (o) {
13656
+ if (Wk(this.channel, a, s, `encoding.${n}.scale.type`), o) {
13636
13657
  if (this.name !== void 0 && o != this.name) throw Error(`Shared scales have conflicting names: "${o}" vs. "${this.name}"!`);
13637
13658
  this.name = o;
13638
13659
  }
@@ -13642,61 +13663,96 @@ var RA = class {
13642
13663
  }
13643
13664
  return this.#e.add(t), t.contributesToDomain && this.#t.add(t), t;
13644
13665
  }
13645
- #P() {
13646
- this.#_ = !1, this.#U(), this.#G(), this.#R(), this.#z();
13647
- }
13648
13666
  #F() {
13649
- this.#g > 0 ? this.#_ = !0 : this.#P();
13667
+ this.#v = !1, this.#q(), this.#Y(), this.#H(), this.#U();
13668
+ }
13669
+ #I() {
13670
+ this.#_ > 0 ? this.#v = !0 : this.#F();
13650
13671
  }
13651
13672
  static registerInBatch(e, t) {
13652
13673
  let n = Array.from(e);
13653
- for (let e of n) e.#g++;
13674
+ for (let e of n) e.#_++;
13654
13675
  try {
13655
13676
  return t();
13656
13677
  } finally {
13657
- for (let e of n) e.#g--, e.#g === 0 && e.#_ && e.#P();
13678
+ for (let e of n) e.#_--, e.#_ === 0 && e.#v && e.#F();
13658
13679
  }
13659
13680
  }
13660
13681
  registerMember(e) {
13661
- let t = this.#N(e);
13662
- return this.#F(), () => {
13682
+ let t = this.#P(e);
13683
+ return this.#I(), () => {
13663
13684
  let e = this.#e.delete(t);
13664
- return e && (this.#t.delete(t), this.#F()), e && this.#e.size === 0;
13685
+ return e && (this.#t.delete(t), this.#I()), e && this.#e.size === 0;
13665
13686
  };
13666
13687
  }
13688
+ attachViewLevelScaleConfig(e, t) {
13689
+ if (this.#h && this.#h.view !== e) throw Error(`Multiple view-level scale configs target the same ${this.channel} scale resolution.`);
13690
+ for (let e of this.#e) this.#z(e);
13691
+ this.#h = {
13692
+ view: e,
13693
+ config: t
13694
+ }, this.#K(), this.#Y(), this.#H(), this.#U(), this.#i.scale && (this.#i.resetScale(), this.initializeScale());
13695
+ }
13696
+ clearViewLevelScaleConfig(e) {
13697
+ this.#h?.view === e && (this.#h = void 0, this.#K(), this.#Y(), this.#H(), this.#U(), this.#i.scale && (this.#i.resetScale(), this.initializeScale()));
13698
+ }
13699
+ getViewLevelScaleConfig() {
13700
+ return this.#h;
13701
+ }
13702
+ #L() {
13703
+ let e = this.#h;
13704
+ if (e) return {
13705
+ view: e.view,
13706
+ channel: this.channel,
13707
+ type: this.type,
13708
+ domain: e.config.domain
13709
+ };
13710
+ }
13711
+ #R(e) {
13712
+ this.#h && this.#z(e);
13713
+ }
13714
+ #z(e) {
13715
+ if (e.channelDef.scale !== void 0) throw Error(`Cannot mix view-level scales.${this.channel} with encoding.${e.channel}.scale in the same scale resolution.`);
13716
+ }
13667
13717
  dispose() {
13668
- this.#I(), this.#L(), this.#r.domain.clear(), this.#r.range.clear(), this.#i.dispose();
13718
+ this.#B(), this.#V(), this.#r.domain.clear(), this.#r.range.clear(), this.#i.dispose();
13669
13719
  }
13670
- #I() {
13720
+ #B() {
13671
13721
  for (let e of this.#l) e();
13672
13722
  this.#l = [], this.#p = void 0;
13673
13723
  }
13674
- #L() {
13724
+ #V() {
13675
13725
  for (let e of this.#d) e();
13676
13726
  this.#d = [];
13677
13727
  }
13678
- #R() {
13679
- if (this.#I(), this.#e.size === 0) return;
13680
- let e = this.#D();
13681
- e && (this.#p = this.#j(e), this.#l.push(e.runtime.subscribe(e.param, () => {
13682
- let t = this.#p, n = this.#j(e);
13683
- this.#M(t, n), this.#p = n, this.#G(), this.reconfigureDomain();
13728
+ #H() {
13729
+ if (this.#B(), this.#e.size === 0) return;
13730
+ let e = this.#O();
13731
+ e && (this.#p = this.#M(e), this.#l.push(e.runtime.subscribe(e.param, () => {
13732
+ let t = this.#p, n = this.#M(e);
13733
+ this.#N(t, n), this.#p = n, this.#Y(), this.reconfigureDomain();
13684
13734
  })));
13685
13735
  }
13686
- #z() {
13687
- if (this.#L(), this.#e.size === 0) return;
13736
+ #U() {
13737
+ if (this.#V(), this.#e.size === 0) return;
13688
13738
  let e = () => {
13689
- this.#G(), this.reconfigureDomain();
13739
+ this.#Y(), this.reconfigureDomain();
13690
13740
  };
13691
13741
  for (let t of this.#e) {
13692
13742
  if (!t.contributesToDomain) continue;
13693
- let n = t.channelDef.scale?.domain;
13694
- if (!j(n)) continue;
13695
- let r = t.view.paramRuntime.createExpression(n.expr).subscribe(e);
13696
- this.#d.push(r);
13743
+ let n = t.channelDef.scale?.domain, r = zk(n);
13744
+ if (r.length !== 0) for (let n of r) {
13745
+ let r = t.view.paramRuntime.createExpression(n.expr).subscribe(e);
13746
+ this.#d.push(r);
13747
+ }
13748
+ }
13749
+ let t = this.#h?.config.domain, n = zk(t);
13750
+ for (let t of n) {
13751
+ let n = this.#h.view.paramRuntime.createExpression(t.expr).subscribe(e);
13752
+ this.#d.push(n);
13697
13753
  }
13698
13754
  }
13699
- #B() {
13755
+ #W() {
13700
13756
  for (let e of this.#e) if (e.view.hasRendered()) return !0;
13701
13757
  return !1;
13702
13758
  }
@@ -13713,7 +13769,7 @@ var RA = class {
13713
13769
  };
13714
13770
  }
13715
13771
  isDomainDefinedExplicitly() {
13716
- return this.#A();
13772
+ return this.#j();
13717
13773
  }
13718
13774
  isDomainInitialized() {
13719
13775
  let e = this.#i.scale;
@@ -13721,38 +13777,39 @@ var RA = class {
13721
13777
  let t = e.domain();
13722
13778
  return I(e.type) ? t.length > 2 || t.length == 2 && (t[0] !== 0 || t[1] !== 0) : t.length > 0;
13723
13779
  }
13724
- #V() {
13780
+ #G() {
13725
13781
  return rr(this, "mergedScaleProps", () => {
13726
- let e = Uk({
13782
+ let e = Kk({
13727
13783
  channel: this.channel,
13728
13784
  dataType: this.type,
13729
- orderedMembers: this.#W(),
13785
+ orderedMembers: this.#J(),
13786
+ viewLevelScaleConfig: this.#h,
13730
13787
  isExplicitDomain: this.isDomainDefinedExplicitly(),
13731
- configScopes: this.#y.getConfigScopes()
13788
+ configScopes: this.#b.getConfigScopes()
13732
13789
  });
13733
- return this.#K(e), e;
13790
+ return this.#X(e), e;
13734
13791
  });
13735
13792
  }
13736
- #H() {
13793
+ #K() {
13737
13794
  ir(this, "mergedScaleProps");
13738
13795
  }
13739
- #U() {
13796
+ #q() {
13740
13797
  this.#n = void 0;
13741
13798
  }
13742
- #W() {
13743
- return this.#n ||= LA(this.#e), this.#n;
13799
+ #J() {
13800
+ return this.#n ||= VA(this.#e), this.#n;
13744
13801
  }
13745
- #G() {
13746
- this.#a.invalidateConfiguredDomain(), this.#H();
13802
+ #Y() {
13803
+ this.#a.invalidateConfiguredDomain(), this.#K();
13747
13804
  }
13748
- #K(e) {
13749
- let t = this.#D();
13805
+ #X(e) {
13806
+ let t = this.#O();
13750
13807
  if (!t || e === null || e.type === "null") return;
13751
13808
  let n = I(e.type) && !jf(e.type) && !!e.zoom;
13752
13809
  if (t.hasInitial && !n) throw Error(`Selection domain reference "${t.param}.${t.encoding}" cannot use "initial" with a non-zoomable ${this.channel} scale. Enable zoom on the linked scale or remove "initial".`);
13753
13810
  }
13754
13811
  getAssemblyRequirement() {
13755
- let e = this.#V();
13812
+ let e = this.#G();
13756
13813
  return e === null || e.type === "null" || e.type !== "locus" ? {
13757
13814
  assembly: void 0,
13758
13815
  needsDefaultAssembly: !1
@@ -13762,61 +13819,61 @@ var RA = class {
13762
13819
  };
13763
13820
  }
13764
13821
  getResolvedScaleType() {
13765
- let e = this.#V();
13822
+ let e = this.#G();
13766
13823
  if (!(e === null || e.type === "null")) return e.type;
13767
13824
  }
13768
- #q(e = !1) {
13769
- let t = this.#V();
13825
+ #Z(e = !1) {
13826
+ let t = this.#G();
13770
13827
  if (t === null || t.type == "null") return { type: "null" };
13771
13828
  let n = { ...t };
13772
- this.#h += 1;
13829
+ this.#g += 1;
13773
13830
  let r;
13774
13831
  try {
13775
- r = this.#k(e, n.type === "locus" ? n.assembly : void 0);
13832
+ r = this.#A(e, n.type === "locus" ? n.assembly : void 0);
13776
13833
  } finally {
13777
- --this.#h;
13834
+ --this.#g;
13778
13835
  }
13779
13836
  if (jf(n.type)) {
13780
- let t = this.isDomainDefinedExplicitly(), i = this.#J(t);
13837
+ let t = this.isDomainDefinedExplicitly(), i = this.#Q(t);
13781
13838
  if (r != null) {
13782
- if (t && i.domain().length > 0 && !Kf(i.domain(), r)) return this.#s = void 0, this.#q(e);
13839
+ if (t && i.domain().length > 0 && !Kf(i.domain(), r)) return this.#s = void 0, this.#Z(e);
13783
13840
  i.addAll(r);
13784
13841
  let a = new Set(r), o = i.domain().filter((e) => a.has(e));
13785
- n.domain = o.length > 0 ? o : new oA();
13842
+ n.domain = o.length > 0 ? o : new lA();
13786
13843
  } else {
13787
13844
  let e = i.domain();
13788
- n.domain = e.length > 0 ? e : new oA();
13845
+ n.domain = e.length > 0 ? e : new lA();
13789
13846
  }
13790
13847
  n.domainIndexer = i;
13791
13848
  } else r && r.length > 0 && (n.domain = r);
13792
13849
  return !n.domain && n.domainMid !== void 0 && (n.domain = [n.domainMin ?? 0, n.domainMax ?? 1]), n;
13793
13850
  }
13794
- #J(e) {
13851
+ #Q(e) {
13795
13852
  return (!this.#s || this.#c !== e) && (this.#s = MD(), this.#c = e), this.#s;
13796
13853
  }
13797
13854
  reconfigure() {
13798
- this.#T(() => {
13799
- this.#G();
13800
- let e = this.#Y(!0);
13801
- e && (this.#X(e, (e, t) => this.#i.reconfigureScale(t)), this.#Z(e));
13855
+ this.#E(() => {
13856
+ this.#Y();
13857
+ let e = this.#$(!0);
13858
+ e && (this.#ee(e, (e, t) => this.#i.reconfigureScale(t)), this.#te(e));
13802
13859
  });
13803
13860
  }
13804
13861
  reconfigureDomain() {
13805
- this.#T(() => {
13806
- let e = this.#Y(!0, !0);
13862
+ this.#E(() => {
13863
+ let e = this.#$(!0, !0);
13807
13864
  if (!e) return;
13808
13865
  let { domainConfig: t, targetDomain: n } = e, r = n != null && Kf(n, e.scale.domain());
13809
- n != null && !r && this.#X(e, (e) => {
13866
+ n != null && !r && this.#ee(e, (e) => {
13810
13867
  e.domain(n), t.applyOrdinalUnknown && e.unknown(t.ordinalUnknown);
13811
- }), this.#Z(e), this.syncLinkedSelectionFromDomain();
13868
+ }), this.#te(e), this.syncLinkedSelectionFromDomain();
13812
13869
  });
13813
13870
  }
13814
- #Y(e, t = !1) {
13871
+ #$(e, t = !1) {
13815
13872
  let n = this.#i.scale;
13816
13873
  if (!n || n.type == "null") return;
13817
13874
  let r = {
13818
13875
  scale: n,
13819
- props: this.#q(e),
13876
+ props: this.#Z(e),
13820
13877
  previousDomain: n.domain(),
13821
13878
  domainWasInitialized: this.isDomainInitialized(),
13822
13879
  hasSelectionConfiguredDomain: this.#a.hasSelectionConfiguredDomain()
@@ -13831,55 +13888,55 @@ var RA = class {
13831
13888
  }
13832
13889
  return r;
13833
13890
  }
13834
- #X(e, t) {
13891
+ #ee(e, t) {
13835
13892
  this.#i.withDomainNotificationsSuppressed(() => {
13836
13893
  t(e.scale, e.props);
13837
13894
  });
13838
13895
  }
13839
- #Z(e) {
13896
+ #te(e) {
13840
13897
  let { scale: t, previousDomain: n, domainWasInitialized: r, hasSelectionConfiguredDomain: i } = e, a = i ? this.#a.getDefaultDomain(!0) : void 0;
13841
13898
  if (this.#a.captureInitialDomain(t, r, a)) {
13842
- this.#w("domain");
13899
+ this.#T("domain");
13843
13900
  return;
13844
13901
  }
13845
13902
  if (t.props.domainTransition === !1) {
13846
- this.#w("domain");
13903
+ this.#T("domain");
13847
13904
  return;
13848
13905
  }
13849
13906
  let o = t.domain(), s = this.#o.getDomainChangeAction(n, o);
13850
- s === "restore" ? i ? this.#w("domain") : this.#i.withDomainNotificationsSuppressed(() => {
13907
+ s === "restore" ? i ? this.#T("domain") : this.#i.withDomainNotificationsSuppressed(() => {
13851
13908
  t.domain(n);
13852
- }) : s === "animate" ? i ? this.#w("domain") : this.#B() ? (this.#i.withDomainNotificationsSuppressed(() => {
13909
+ }) : s === "animate" ? i ? this.#T("domain") : this.#W() ? (this.#i.withDomainNotificationsSuppressed(() => {
13853
13910
  t.domain(n);
13854
- }), this.zoomTo(o, 500)) : this.#w("domain") : s === "notify" && this.#w("domain");
13911
+ }), this.zoomTo(o, 500)) : this.#T("domain") : s === "notify" && this.#T("domain");
13855
13912
  }
13856
13913
  get scale() {
13857
13914
  if (this.#i.scale) return this.#i.scale;
13858
13915
  throw Error("ScaleResolution.scale accessed before initialization. Call initializeScale().");
13859
13916
  }
13860
13917
  getScale() {
13861
- if (this.#h > 0) throw Error(`Scale resolution for channel "${this.channel}" cannot read its own scale while its domain is being resolved.`);
13918
+ if (this.#g > 0) throw Error(`Scale resolution for channel "${this.channel}" cannot read its own scale while its domain is being resolved.`);
13862
13919
  return this.#i.scale ?? this.initializeScale();
13863
13920
  }
13864
13921
  initializeScale() {
13865
13922
  if (this.#i.scale) return this.#i.scale;
13866
- let e = this.#q();
13923
+ let e = this.#Z();
13867
13924
  return this.#i.createScale(e);
13868
13925
  }
13869
13926
  getDomain() {
13870
- if (this.#h > 0) throw Error(`Scale resolution for channel "${this.channel}" cannot read its own domain while its domain is being resolved.`);
13927
+ if (this.#g > 0) throw Error(`Scale resolution for channel "${this.channel}" cannot read its own domain while its domain is being resolved.`);
13871
13928
  return this.getScale().domain();
13872
13929
  }
13873
13930
  getDataDomain() {
13874
13931
  return this.#a.getDataDomain();
13875
13932
  }
13876
13933
  getComplexDomain() {
13877
- return ZO(this.#C(), Kk(this.type, this.getDomain()));
13934
+ return ZO(this.#w(), Yk(this.type, this.getDomain()));
13878
13935
  }
13879
13936
  getLinkedSelectionDomainInfo() {
13880
- let e = this.#D();
13937
+ let e = this.#O();
13881
13938
  if (!e) return;
13882
- let t = this.#y.getLayoutAncestors().at(-1), n = t ? eA(t, e.runtime, e.param, e.encoding).some((e) => e.param.persist !== !1) : !1;
13939
+ let t = this.#b.getLayoutAncestors().at(-1), n = t ? rA(t, e.runtime, e.param, e.encoding).some((e) => e.param.persist !== !1) : !1;
13883
13940
  return {
13884
13941
  param: e.param,
13885
13942
  encoding: e.encoding,
@@ -13890,7 +13947,7 @@ var RA = class {
13890
13947
  return this.#o.isZoomed();
13891
13948
  }
13892
13949
  isZoomable() {
13893
- let e = this.#V();
13950
+ let e = this.#G();
13894
13951
  return e === null || e.type === "null" ? !1 : I(e.type) && !jf(e.type) && !!e.zoom;
13895
13952
  }
13896
13953
  zoom(e, t, n) {
@@ -13918,19 +13975,19 @@ var RA = class {
13918
13975
  } else throw Error("The scale does not support inverting!");
13919
13976
  }
13920
13977
  toComplex(e) {
13921
- return JO(this.#C(), e);
13978
+ return JO(this.#w(), e);
13922
13979
  }
13923
13980
  fromComplex(e) {
13924
- return YO(this.#C(), e);
13981
+ return YO(this.#w(), e);
13925
13982
  }
13926
13983
  fromComplexInterval(e) {
13927
- return this.type == "locus" ? XO(this.#C(), e) : e;
13984
+ return this.type == "locus" ? XO(this.#w(), e) : e;
13928
13985
  }
13929
13986
  };
13930
- function zA(e, t) {
13987
+ function UA(e, t) {
13931
13988
  return e === t ? !0 : !e || !t ? !1 : e.length === t.length && Kf(e, t);
13932
13989
  }
13933
- function BA(e) {
13990
+ function WA(e) {
13934
13991
  let t = e.channelDef.scale, n = t?.assembly;
13935
13992
  if (!t || !n || typeof n != "object" || !("url" in n)) return e;
13936
13993
  let r = _d(e.view.getBaseUrl(), n.url);
@@ -13950,12 +14007,12 @@ function BA(e) {
13950
14007
  }
13951
14008
  //#endregion
13952
14009
  //#region ../core/src/utils/coalesce.js
13953
- function VA(...e) {
14010
+ function GA(...e) {
13954
14011
  for (let t of e) if (t !== void 0) return t;
13955
14012
  }
13956
14013
  //#endregion
13957
14014
  //#region ../core/src/scales/axisResolution.js
13958
- var HA = class {
14015
+ var KA = class {
13959
14016
  #e = /* @__PURE__ */ new Set();
13960
14017
  constructor(e) {
13961
14018
  this.channel = e;
@@ -13978,7 +14035,7 @@ var HA = class {
13978
14035
  }
13979
14036
  getAxisProps() {
13980
14037
  return rr(this, "axisProps", () => {
13981
- let e = LA(this.#e).map((e) => {
14038
+ let e = VA(this.#e).map((e) => {
13982
14039
  let t = e.view.mark.encoding[e.channel];
13983
14040
  return "axis" in t && t.axis;
13984
14041
  });
@@ -13986,13 +14043,13 @@ var HA = class {
13986
14043
  });
13987
14044
  }
13988
14045
  getTitle() {
13989
- let e = LA(this.#e).map((e) => {
14046
+ let e = VA(this.#e).map((e) => {
13990
14047
  let t = Yu(e.view, e.channel);
13991
14048
  if (!M(t)) return {
13992
14049
  member: e,
13993
14050
  axisTitle: "axis" in t ? t.axis?.title : void 0,
13994
- explicitTitle: VA("axis" in t ? t.axis?.title : void 0, t.title),
13995
- implicitTitle: VA(Ku(t) ? t.field : void 0, Zu(t) ? t.expr : void 0)
14051
+ explicitTitle: GA("axis" in t ? t.axis?.title : void 0, t.title),
14052
+ implicitTitle: GA(Ku(t) ? t.field : void 0, Zu(t) ? t.expr : void 0)
13996
14053
  };
13997
14054
  }), t = e.map((e) => e.axisTitle).find((e) => e !== void 0);
13998
14055
  if (t !== void 0) return t;
@@ -14002,16 +14059,16 @@ var HA = class {
14002
14059
  return e.find((e) => e.member.view == t.member.view && e.member.channel == n)?.explicitTitle === void 0;
14003
14060
  }
14004
14061
  return !0;
14005
- }), r = new Set(n.map((e) => VA(e.explicitTitle, e.implicitTitle)).filter(w));
14062
+ }), r = new Set(n.map((e) => GA(e.explicitTitle, e.implicitTitle)).filter(w));
14006
14063
  return r.size ? [...r].join(", ") : null;
14007
14064
  }
14008
- }, UA = (e) => {
14065
+ }, qA = (e) => {
14009
14066
  if (N(e)) return e;
14010
14067
  if ($u(e)) {
14011
14068
  let t = e.condition;
14012
14069
  if (!Array.isArray(t) && N(t)) return t;
14013
14070
  }
14014
- }, WA = (e, t, n) => {
14071
+ }, JA = (e, t, n) => {
14015
14072
  let r = e;
14016
14073
  for (; (r.getConfiguredOrDefaultResolution(n, t) == "forced" || r.dataParent && [
14017
14074
  "shared",
@@ -14019,9 +14076,9 @@ var HA = class {
14019
14076
  "forced"
14020
14077
  ].includes(r.dataParent.getConfiguredOrDefaultResolution(n, t))) && r.getConfiguredOrDefaultResolution(n, t) != "excluded";) r = r.dataParent;
14021
14078
  return r;
14022
- }, GA = (e, t, n) => {
14079
+ }, YA = (e, t, n) => {
14023
14080
  if (!t.resolutions.scale[n]) {
14024
- let r = new RA(n, t);
14081
+ let r = new HA(n, t);
14025
14082
  t.resolutions.scale[n] = r;
14026
14083
  let i = (t) => {
14027
14084
  e.context.glHelper?.createRangeTexture(t.scaleResolution, !0);
@@ -14031,36 +14088,36 @@ var HA = class {
14031
14088
  });
14032
14089
  }
14033
14090
  return t.resolutions.scale[n];
14034
- }, KA = (e, t, n, r) => {
14035
- let i = UA(r);
14091
+ }, XA = (e, t, n, r) => {
14092
+ let i = qA(r);
14036
14093
  if (!i) return;
14037
14094
  let a = ld(i.resolutionChannel ?? n);
14038
14095
  if (fd(a) && !(t == "axis" && !id(a))) return {
14039
- view: WA(e, t, a),
14096
+ view: JA(e, t, a),
14040
14097
  channel: n,
14041
14098
  channelDef: i,
14042
14099
  targetChannel: a
14043
14100
  };
14044
- }, qA = (e, t) => {
14101
+ }, ZA = (e, t) => {
14045
14102
  for (let [n, r] of Object.entries(e.mark.encoding)) !r || Array.isArray(r) || t(n, r);
14046
- }, JA = (e) => {
14103
+ }, QA = (e) => {
14047
14104
  let t = [];
14048
- return qA(e, (n, r) => {
14049
- let i = KA(e, "axis", n, r);
14105
+ return ZA(e, (n, r) => {
14106
+ let i = XA(e, "axis", n, r);
14050
14107
  i && id(i.channel) && t.push(i);
14051
14108
  }), t;
14052
- }, YA = (e) => {
14109
+ }, $A = (e) => {
14053
14110
  let t = /* @__PURE__ */ new Map();
14054
- return qA(e, (n, r) => {
14055
- let i = KA(e, "scale", n, r);
14111
+ return ZA(e, (n, r) => {
14112
+ let i = XA(e, "scale", n, r);
14056
14113
  if (!i) return;
14057
- let a = GA(e, i.view, i.targetChannel), o = t.get(a);
14114
+ let a = YA(e, i.view, i.targetChannel), o = t.get(a);
14058
14115
  o ? o.push(i) : t.set(a, [i]);
14059
14116
  }), t;
14060
- }, XA = (e, t) => {
14117
+ }, ej = (e, t) => {
14061
14118
  for (let { view: n, channel: r, channelDef: i, targetChannel: a } of t) {
14062
14119
  if (!id(r) || !rd(a)) continue;
14063
- n.resolutions.axis[a] || (n.resolutions.axis[a] = new HA(a));
14120
+ n.resolutions.axis[a] || (n.resolutions.axis[a] = new KA(a));
14064
14121
  let t = n.resolutions.axis[a], o = t.registerMember({
14065
14122
  view: e,
14066
14123
  channel: r,
@@ -14070,8 +14127,8 @@ var HA = class {
14070
14127
  o() && n.resolutions.axis[a] === t && delete n.resolutions.axis[a];
14071
14128
  });
14072
14129
  }
14073
- }, ZA = (e, t) => {
14074
- RA.registerInBatch(t.keys(), () => {
14130
+ }, tj = (e, t) => {
14131
+ HA.registerInBatch(t.keys(), () => {
14075
14132
  for (let [n, r] of t) for (let { view: t, channel: i, channelDef: a, targetChannel: o } of r) {
14076
14133
  let r = o, s = !e.isDomainInert(), c = n.registerMember({
14077
14134
  view: e,
@@ -14084,26 +14141,26 @@ var HA = class {
14084
14141
  });
14085
14142
  }
14086
14143
  });
14087
- }, QA = (e, t) => {
14144
+ }, nj = (e, t) => {
14088
14145
  if (!t) {
14089
- QA(e, "scale"), QA(e, "axis");
14146
+ nj(e, "scale"), nj(e, "axis");
14090
14147
  return;
14091
14148
  }
14092
- t == "axis" ? XA(e, JA(e)) : ZA(e, YA(e));
14093
- }, $A = {
14149
+ t == "axis" ? ej(e, QA(e)) : tj(e, $A(e));
14150
+ }, rj = {
14094
14151
  point: hO,
14095
14152
  rect: cO,
14096
14153
  rule: xO,
14097
14154
  tick: xO,
14098
14155
  link: NO,
14099
14156
  text: zO
14100
- }, ej = class extends Rh {
14157
+ }, ij = class extends Rh {
14101
14158
  #e;
14102
14159
  #t = !1;
14103
14160
  #n = null;
14104
14161
  constructor(e, t, n, r, i, a) {
14105
14162
  super(e, t, n, r, i, a), this.spec = e;
14106
- let o = $A[this.getMarkType()];
14163
+ let o = rj[this.getMarkType()];
14107
14164
  if (o) this.mark = new o(this);
14108
14165
  else throw Error(`No such mark: ${this.getMarkType()}`);
14109
14166
  this.#e = this.paramRuntime.allocateSetter("zoomLevel", 1), this.resolve();
@@ -14163,7 +14220,7 @@ var HA = class {
14163
14220
  this.resolve("scale"), this.resolve("axis");
14164
14221
  return;
14165
14222
  }
14166
- QA(this, e);
14223
+ nj(this, e);
14167
14224
  }
14168
14225
  dispose() {
14169
14226
  super.dispose(), this.mark.dispose();
@@ -14196,7 +14253,7 @@ var HA = class {
14196
14253
  if (!ju(e)) continue;
14197
14254
  let t = this.getScaleResolution(e.scaleChannel);
14198
14255
  if (!t) throw Error("Missing scale resolution for channel: " + e.scaleChannel);
14199
- if (e.channelDef.domainInert || tj(e, t, n)) continue;
14256
+ if (e.channelDef.domainInert || aj(e, t, n)) continue;
14200
14257
  let i = r.get(t);
14201
14258
  i || (i = /* @__PURE__ */ new Set(), r.set(t, i)), i.add(e);
14202
14259
  }
@@ -14217,12 +14274,12 @@ var HA = class {
14217
14274
  return e == "x" ? "shared" : "independent";
14218
14275
  }
14219
14276
  };
14220
- function tj(e, t, n) {
14277
+ function aj(e, t, n) {
14221
14278
  return !t.isDomainDefinedExplicitly() && n.has(ld(e.scaleChannel));
14222
14279
  }
14223
14280
  //#endregion
14224
14281
  //#region ../core/src/view/viewUtils.js
14225
- function nj(e) {
14282
+ function oj(e) {
14226
14283
  let t = /* @__PURE__ */ new Set();
14227
14284
  e.visit((e) => {
14228
14285
  for (let n of Object.values(e.resolutions.scale)) {
@@ -14232,21 +14289,21 @@ function nj(e) {
14232
14289
  }
14233
14290
  });
14234
14291
  }
14235
- function rj(e) {
14292
+ function sj(e) {
14236
14293
  for (let t of ed) {
14237
14294
  let n = e.getScaleResolution(t);
14238
14295
  n && !n.name && n.isZoomable() && (n.name = `${t}_at_root`);
14239
14296
  }
14240
14297
  }
14241
- function ij(e, t = () => !0) {
14298
+ function cj(e, t = () => !0) {
14242
14299
  return Promise.allSettled(e).then((e) => {
14243
14300
  if (t()) for (let t of e) "value" in t ? t.value.finalizeGraphicsInitialization() : "reason" in t && console.error(t.reason);
14244
14301
  });
14245
14302
  }
14246
- function aj(e) {
14303
+ function lj(e) {
14247
14304
  let t = [];
14248
14305
  return e.visit((e) => {
14249
- if (e instanceof ej) {
14306
+ if (e instanceof ij) {
14250
14307
  let n = e.getEncoding(), r = (n, i) => {
14251
14308
  if (!(!i || typeof i != "object" || Array.isArray(i)) && (Ku(i) && "type" in i ? t.push({
14252
14309
  view: e,
@@ -14269,7 +14326,7 @@ function aj(e) {
14269
14326
  }
14270
14327
  }), t;
14271
14328
  }
14272
- async function oj(e, t, n) {
14329
+ async function uj(e, t, n) {
14273
14330
  let r = e.import;
14274
14331
  if (!("url" in r)) throw Error("Not an url import: " + JSON.stringify(r));
14275
14332
  let i = gd(t, r.url), a;
@@ -14281,7 +14338,7 @@ async function oj(e, t, n) {
14281
14338
  if (n.isViewSpec(a)) return a.baseUrl = gd(vd(r.url), a.baseUrl), a;
14282
14339
  throw Error(`The imported spec "${i}" is not a view spec: ${JSON.stringify(e)}`);
14283
14340
  }
14284
- function sj(e) {
14341
+ function dj(e) {
14285
14342
  let t = e.getSize(), n = e.getPadding(), r = (e, t) => e.grow > 0 ? void 0 : e.px + t;
14286
14343
  return {
14287
14344
  width: r(t.width, n.horizontalTotal),
@@ -14289,4 +14346,4 @@ function sj(e) {
14289
14346
  };
14290
14347
  }
14291
14348
  //#endregion
14292
- export { Jh as $, mi as $t, yy as A, ed as At, _v as B, mu as Bt, My as C, Ln as Cn, ld as Ct, Ey as D, Zu as Dt, Dy as E, jt as En, qu as Et, ey as F, xu as Ft, wg as G, su as Gt, Wg as H, j as Ht, Mv as I, Eu as It, xg as J, nu as Jt, Sg as K, ou as Kt, Nv as L, Tu as Lt, py as M, wu as Mt, dy as N, vu as Nt, xy as O, Ku as Ot, sy as P, Du as Pt, Yh as Q, D as Qt, Sv as R, bu as Rt, Ny as S, w as Sn, Uu as St, Ay as T, qt as Tn, Xu as Tt, Kg as U, lu as Ut, vv as V, fu as Vt, Ug as W, cu as Wt, Zh as X, tu as Xt, ig as Y, Ql as Yt, $h as Z, eu as Zt, EE as _, En as _n, Kf as _t, oj as a, wr as an, Fh as at, jy as b, C as bn, gd as bt, kA as c, ir as cn, Ph as ct, nA as d, qn as dn, lh as dt, Vr as en, qh as et, fO as f, Jn as fn, ch as ft, BE as g, Yt as gn, Jf as gt, VE as h, $n as hn, qf as ht, aj as i, Cr as in, eg as it, Sy as j, ku as jt, by as k, id as kt, OA as l, ar as ln, Oh as lt, IE as m, Gn as mn, L as mt, nj as n, Lr as nn, tg as nt, rj as o, _r as on, Ih as ot, YD as p, Kn as pn, Yf as pt, Cg as q, ru as qt, ij as r, Ir as rn, ag as rt, ej as s, ur as sn, Rh as st, sj as t, Rr as tn, ng as tt, lA as u, er as un, Ch as ut, uE as v, S as vn, I as vt, ky as w, en as wn, N as wt, Fy as x, an as xn, _d as xt, kC as y, Nn as yn, jf as yt, Cv as z, Ou as zt };
14349
+ export { Jh as $, mi as $t, yy as A, ed as At, _v as B, mu as Bt, My as C, Ln as Cn, ld as Ct, Ey as D, Zu as Dt, Dy as E, jt as En, qu as Et, ey as F, xu as Ft, wg as G, su as Gt, Wg as H, j as Ht, Mv as I, Eu as It, xg as J, nu as Jt, Sg as K, ou as Kt, Nv as L, Tu as Lt, py as M, wu as Mt, dy as N, vu as Nt, xy as O, Ku as Ot, sy as P, Du as Pt, Yh as Q, D as Qt, Sv as R, bu as Rt, Ny as S, w as Sn, Uu as St, Ay as T, qt as Tn, Xu as Tt, Kg as U, lu as Ut, vv as V, fu as Vt, Ug as W, cu as Wt, Zh as X, tu as Xt, ig as Y, Ql as Yt, $h as Z, eu as Zt, EE as _, En as _n, Kf as _t, uj as a, wr as an, Fh as at, jy as b, C as bn, gd as bt, NA as c, ir as cn, Ph as ct, aA as d, qn as dn, lh as dt, Vr as en, qh as et, fO as f, Jn as fn, ch as ft, BE as g, Yt as gn, Jf as gt, VE as h, $n as hn, qf as ht, lj as i, Cr as in, eg as it, Sy as j, ku as jt, by as k, id as kt, MA as l, ar as ln, Oh as lt, IE as m, Gn as mn, L as mt, oj as n, Lr as nn, tg as nt, sj as o, _r as on, Ih as ot, YD as p, Kn as pn, Yf as pt, Cg as q, ru as qt, cj as r, Ir as rn, ag as rt, ij as s, ur as sn, Rh as st, dj as t, Rr as tn, ng as tt, fA as u, er as un, Ch as ut, uE as v, S as vn, I as vt, ky as w, en as wn, N as wt, Fy as x, an as xn, _d as xt, kC as y, Nn as yn, jf as yt, Cv as z, Ou as zt };