@genome-spy/app 0.83.0 → 0.83.1
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.
package/dist/agentApi.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as e, A as t, C as n, D as r, E as i, G as a, H as o, J as s, K as c, L as l, M as u, N as d, O as f, P as p, Q as m, R as h, S as g, T as _, U as v, W as y, X as b, Y as x, Z as S, _ as C, a as w, b as T, c as E, d as ee, et as te, f as D, g as ne, h as O, j as re, k as ie, l as ae, m as k, n as oe, o as se, p as ce, q as le, r as ue, s as A, t as de, u as fe, v as pe, w as me, x as he, y as ge, z as _e } from "./viewUtils-
|
|
1
|
+
import { $ as e, A as t, C as n, D as r, E as i, G as a, H as o, J as s, K as c, L as l, M as u, N as d, O as f, P as p, Q as m, R as h, S as g, T as _, U as v, W as y, X as b, Y as x, Z as S, _ as C, a as w, b as T, c as E, d as ee, et as te, f as D, g as ne, h as O, j as re, k as ie, l as ae, m as k, n as oe, o as se, p as ce, q as le, r as ue, s as A, t as de, u as fe, v as pe, w as me, x as he, y as ge, z as _e } from "./viewUtils-Cybv1tu-.js";
|
|
2
2
|
import { $t as ve, A as ye, An as be, Ar as xe, At as Se, Br as Ce, Bt as we, C as Te, Cr as Ee, D as De, Dn as Oe, Dr as ke, E as Ae, En as j, Er as je, Et as Me, F as Ne, Fn as Pe, Fr as Fe, Hn as Ie, I as M, In as Le, It as Re, Jt as ze, Kr as Be, L as Ve, Ln as He, Lr as Ue, M as We, Mn as Ge, Mr as Ke, Mt as qe, O as N, On as P, Or as Je, P as Ye, Pn as F, Pr as Xe, Pt as Ze, R as Qe, Rn as I, Rr as $e, Rt as et, S as tt, Sr as nt, St as rt, T as it, Tr as at, Vn as ot, Vt as st, Wt as ct, Xt as lt, Zn as ut, _ as dt, _r as ft, a as pt, an as mt, ar as ht, b as gt, br as _t, c as L, cr as vt, d as yt, en as bt, f as xt, fn as St, fr as Ct, g as wt, h as Tt, hn as Et, hr as Dt, i as Ot, in as kt, j as At, jn as jt, kn as Mt, l as R, ln as Nt, lr as Pt, m as Ft, mn as It, nr as Lt, o as Rt, or as zt, p as Bt, pn as Vt, pr as Ht, qt as Ut, r as Wt, rn as Gt, rt as Kt, sn as qt, sr as Jt, u as Yt, un as Xt, v as Zt, vr as Qt, w as $t, wr as en, wt as tn, x as nn, xr as z, yr as B, z as rn, zn as an, zr as on } from "./metadataChannels-fGQOmJj0.js";
|
|
3
3
|
import { a as V, i as sn, n as cn, r as ln } from "./lit-ByuJ0FJ4.js";
|
|
4
4
|
import { n as un } from "./esm-CGLz7idZ.js";
|
package/dist/agentShared.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as e } from "./rolldown-runtime-DF993M8W.js";
|
|
2
|
-
import { B as t, F as n, I as r, L as i, M as a, N as o, P as s, R as c, V as l, Z as u, et as d, i as f, s as p, tt as m } from "./viewUtils-
|
|
2
|
+
import { B as t, F as n, I as r, L as i, M as a, N as o, P as s, R as c, V as l, Z as u, et as d, i as f, s as p, tt as m } from "./viewUtils-Cybv1tu-.js";
|
|
3
3
|
import { a as h, h as g, it as _, k as v, n as y, s as b } from "./metadataChannels-fGQOmJj0.js";
|
|
4
4
|
import { n as x, t as S } from "./componentStyles-BzJWWojD.js";
|
|
5
5
|
//#region src/viewScopeUtils.js
|
package/dist/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as e, t } from "./rolldown-runtime-DF993M8W.js";
|
|
2
|
-
import { $ as n, $t as r, A as i, An as a, At as o, B as s, Bn as c, Bt as l, C as u, Cn as d, Ct as f, D as p, Dn as m, Dt as h, E as g, En as _, Et as v, F as y, Fn as b, Ft as x, G as S, Gt as C, H as w, Hn as T, Ht as E, I as D, In as O, It as k, J as A, Jt as ee, K as j, Kt as M, L as te, Ln as N, Lt as P, M as ne, Mn as F, Mt as re, N as ie, Nn as ae, Nt as oe, O as se, On as ce, Ot as le, P as ue, Pn as de, Pt as fe, Q as pe, Qt as me, R as he, Rn as ge, Rt as _e, S as ve, Sn as ye, St as be, T as xe, Tn as Se, Tt as Ce, U as we, Ut as Te, V as Ee, Vn as De, Vt as Oe, W as ke, Wt as Ae, X as je, Xt as Me, Y as Ne, Yt as Pe, Z as Fe, Zt as Ie, _ as Le, _n as Re, _t as ze, a as Be, an as Ve, at as He, b as Ue, bn as We, bt as Ge, c as Ke, cn as qe, ct as Je, d as Ye, dn as Xe, dt as Ze, en as Qe, et as $e, f as et, fn as tt, ft as nt, g as rt, gn as it, gt as at, h as ot, hn as st, ht as ct, i as lt, in as ut, it as dt, j as ft, jn as pt, jt as mt, k as ht, kn as gt, kt as _t, l as vt, ln as yt, lt as bt, m as xt, mt as St, n as Ct, nn as wt, nt as Tt, o as Et, on as Dt, ot as Ot, p as kt, pt as At, q as jt, qt as Mt, r as Nt, rn as Pt, rt as Ft, s as It, sn as Lt, st as Rt, tn as zt, tt as Bt, u as Vt, un as Ht, ut as Ut, v as Wt, vn as Gt, vt as Kt, w as qt, wn as Jt, wt as Yt, x as Xt, xn as Zt, xt as Qt, y as $t, yn as en, yt as tn, z as nn, zn as rn, zt as an } from "./agentApi-
|
|
2
|
+
import { $ as n, $t as r, A as i, An as a, At as o, B as s, Bn as c, Bt as l, C as u, Cn as d, Ct as f, D as p, Dn as m, Dt as h, E as g, En as _, Et as v, F as y, Fn as b, Ft as x, G as S, Gt as C, H as w, Hn as T, Ht as E, I as D, In as O, It as k, J as A, Jt as ee, K as j, Kt as M, L as te, Ln as N, Lt as P, M as ne, Mn as F, Mt as re, N as ie, Nn as ae, Nt as oe, O as se, On as ce, Ot as le, P as ue, Pn as de, Pt as fe, Q as pe, Qt as me, R as he, Rn as ge, Rt as _e, S as ve, Sn as ye, St as be, T as xe, Tn as Se, Tt as Ce, U as we, Ut as Te, V as Ee, Vn as De, Vt as Oe, W as ke, Wt as Ae, X as je, Xt as Me, Y as Ne, Yt as Pe, Z as Fe, Zt as Ie, _ as Le, _n as Re, _t as ze, a as Be, an as Ve, at as He, b as Ue, bn as We, bt as Ge, c as Ke, cn as qe, ct as Je, d as Ye, dn as Xe, dt as Ze, en as Qe, et as $e, f as et, fn as tt, ft as nt, g as rt, gn as it, gt as at, h as ot, hn as st, ht as ct, i as lt, in as ut, it as dt, j as ft, jn as pt, jt as mt, k as ht, kn as gt, kt as _t, l as vt, ln as yt, lt as bt, m as xt, mt as St, n as Ct, nn as wt, nt as Tt, o as Et, on as Dt, ot as Ot, p as kt, pt as At, q as jt, qt as Mt, r as Nt, rn as Pt, rt as Ft, s as It, sn as Lt, st as Rt, tn as zt, tt as Bt, u as Vt, un as Ht, ut as Ut, v as Wt, vn as Gt, vt as Kt, w as qt, wn as Jt, wt as Yt, x as Xt, xn as Zt, xt as Qt, y as $t, yn as en, yt as tn, z as nn, zn as rn, zt as an } from "./agentApi-AxdD95yY.js";
|
|
3
3
|
import { $t as on, A as sn, Br as cn, Dt as ln, F as un, Gr as dn, Gt as fn, I as pn, J as mn, Jt as hn, Ln as gn, Lr as _n, Lt as vn, N as yn, Ot as bn, Pt as xn, Qt as Sn, Rt as Cn, S as wn, St as Tn, Tn as En, U as Dn, Ut as On, V as kn, Vn as An, Wt as jn, Xt as Mn, Yt as Nn, Zr as Pn, Zt as Fn, _ as In, a as Ln, bt as Rn, c as zn, cn as Bn, d as Vn, f as Hn, g as Un, gr as Wn, k as Gn, l as Kn, mr as qn, n as Jn, nn as Yn, nt as Xn, o as Zn, qr as Qn, qt as $n, r as er, s as tr, sn as nr, tn as rr, tt as ir, v as ar, xt as or, y as sr, yn as cr } from "./viewIdentityRegistry-EH5-Noyz.js";
|
|
4
4
|
//#region ../../node_modules/d3-array/src/array.js
|
|
5
5
|
var lr = Array.prototype, ur = lr.slice;
|
|
@@ -12896,7 +12896,7 @@ var N_ = {
|
|
|
12896
12896
|
contributors: [],
|
|
12897
12897
|
license: "MIT",
|
|
12898
12898
|
homepage: "https://genomespy.app/",
|
|
12899
|
-
version: "0.83.
|
|
12899
|
+
version: "0.83.1",
|
|
12900
12900
|
main: "dist/index.js",
|
|
12901
12901
|
module: "dist/index.es.js",
|
|
12902
12902
|
type: "module",
|
|
@@ -12955,7 +12955,7 @@ var N_ = {
|
|
|
12955
12955
|
"@fortawesome/fontawesome-free": "^6.4.2",
|
|
12956
12956
|
"@fortawesome/fontawesome-svg-core": "^6.4.2",
|
|
12957
12957
|
"@fortawesome/free-solid-svg-icons": "^6.4.2",
|
|
12958
|
-
"@genome-spy/core": "^0.83.
|
|
12958
|
+
"@genome-spy/core": "^0.83.1",
|
|
12959
12959
|
"@reduxjs/toolkit": "^2.11.0",
|
|
12960
12960
|
"d3-color": "^3.1.0",
|
|
12961
12961
|
idb: "^7.1.1",
|
|
@@ -12968,10 +12968,10 @@ var N_ = {
|
|
|
12968
12968
|
zarrita: "^0.6.1"
|
|
12969
12969
|
},
|
|
12970
12970
|
devDependencies: {
|
|
12971
|
-
"@genome-spy/app-agent": "^0.83.
|
|
12972
|
-
"@genome-spy/inspector": "^0.83.
|
|
12971
|
+
"@genome-spy/app-agent": "^0.83.1",
|
|
12972
|
+
"@genome-spy/inspector": "^0.83.1"
|
|
12973
12973
|
},
|
|
12974
|
-
gitHead: "
|
|
12974
|
+
gitHead: "f880c82effa9550b5e979b5982770dd909d91b59"
|
|
12975
12975
|
};
|
|
12976
12976
|
//#endregion
|
|
12977
12977
|
//#region src/utils/version.js
|
|
@@ -21836,7 +21836,7 @@ var sC = class {
|
|
|
21836
21836
|
}, this.genomeSpy.viewFactory.addViewType(Om, ((e, t, n, r, i) => new Ig(e, t, n, r, i, this.provenance, this.intentExecutor, Sx(this)))), this.#o();
|
|
21837
21837
|
}
|
|
21838
21838
|
getAgentApi() {
|
|
21839
|
-
return this.#e ||= import("./agentApi-
|
|
21839
|
+
return this.#e ||= import("./agentApi-AxdD95yY.js").then((e) => e.t).then((e) => e.createAgentApi(this)), this.#e;
|
|
21840
21840
|
}
|
|
21841
21841
|
async getDebugModules() {
|
|
21842
21842
|
return import("./debug-DJKug_38.js");
|
package/dist/index.js
CHANGED
|
@@ -3155,7 +3155,7 @@ chr18 90702639
|
|
|
3155
3155
|
chr19 61431566
|
|
3156
3156
|
chrX 171031299
|
|
3157
3157
|
chrY 91744698
|
|
3158
|
-
chrM 16299`}}));function z_e(e){return $e(e).map(([e,t])=>({name:e,size:parseInt(t)}))}function Xz(e){return ap(e)&&`chrom`in e}function Zz(e){return e.every(Xz)}function Qz(e){return Zz(e)&&(e[1]??e[0]).pos!==void 0}function $z(e){return ap(e)&&(`name`in e||eB(e)||tB(e))}function eB(e){return $z(e)&&`url`in e}function tB(e){return $z(e)&&`contigs`in e}var nB,rB=n((()=>{ln(),tt(),z(),Kz(),Yz(),TS(),nB=class{constructor(e){if(this.config={name:`custom`,...e},`baseUrl`in e)throw Error("The `baseUrl` property in genome config has been removed in GenomeSpy v0.52.0. Use `url` instead. See https://genomespy.app/docs/grammar/genomic-coordinates/.");if(!$z(e))throw Error(`Not a genome configuration: `+JSON.stringify(e));if(this.chromosomes=[],this.cumulativeChromPositions=new Map,this.chromosomesByName=new Map,this.startByIndex=[],this.totalSize=0,tB(this.config))this.setChromSizes(this.config.contigs);else if(!eB(this.config)){let e=qz(this.config.name);if(e)this.setChromSizes(e);else throw Error(`Unknown genome: ${this.config.name}. Please provide contigs or a URL. See https://genomespy.app/docs/grammar/genomic-coordinates/.`)}}get name(){return this.config.name}async load(e){if(eB(this.config))try{let t=xS(e,this.config.url),n=await fetch(t);if(!n.ok)throw Error(`${n.status} ${n.statusText}`);this.setChromSizes(z_e(await n.text()))}catch(e){throw Error(`Could not load chrom sizes: ${this.config.url}. Reason: ${e.message}`,{cause:e})}}hasChrPrefix(){return this.chromosomes.some(e=>e.name.startsWith(`chr`))}setChromSizes(e){this.chromosomes=[],this.cumulativeChromPositions=new Map,this.chromosomesByName=new Map;let t=0;this.startByIndex=[0];for(let n=0;n<e.length;n++){this.startByIndex.push(t);let r=e[n].size,i={...e[n],continuousStart:t,continuousEnd:t+r,continuousInterval:[t,t+r],index:n,number:n+1,odd:!(n&1)};this.chromosomes.push(i);let a=i.name.replace(/^chr/i,``);for(let e of[`chr`+a,`CHR`+a,`Chr`+a,i.number,``+i.number,a,i.name])this.cumulativeChromPositions.set(e,t),this.chromosomesByName.set(e,i);t+=i.size}this.totalSize=t}getExtent(){return[0,this.totalSize]}toContinuous(e,t){let n=this.cumulativeChromPositions.get(e);if(n===void 0)throw Error(`Unknown chromosome/contig: `+e);return n+ +t}toChromosome(e){if(e>this.totalSize)return;e=Math.floor(e);let t=vt(this.startByIndex,e)-1;if(t>0&&t<=this.chromosomes.length)return this.chromosomes[t-1]}toChromosomal(e){let t=this.toChromosome(e);if(t)return{chrom:t.name,pos:Math.floor(e)-t.continuousStart}}getChromosome(e){return this.chromosomesByName.get(e)}formatInterval(e){return R_e(...this.toChromosomalInterval(e))}formatLocus(e){let t=this.toChromosomal(e);if(t)return Uz(t)}toChromosomalInterval(e){let t=this.toChromosomal(e[0]+.5),n=this.toChromosomal(e[1]-.5);return n.pos+=1,[t,n]}toContinuousInterval(e){let[t,n]=e;return n||=t,[this.toContinuous(t.chrom,t.pos??0),this.toContinuous(n.chrom,n.pos??this.chromosomesByName.get(n.chrom)?.size)]}toDiscreteChromosomeIntervals(e){let t=e[0],n=e[1],r=[];if(t.chrom===n.chrom)r.push({chrom:t.chrom,startPos:t.pos,endPos:n.pos});else{let e=this.chromosomes.findIndex(e=>e.name===t.chrom),i=this.chromosomes.findIndex(e=>e.name===n.chrom);r.push({chrom:t.chrom,startPos:t.pos,endPos:this.chromosomes[e].size});for(let t=e+1;t<i;t++)r.push({chrom:this.chromosomes[t].name,startPos:0,endPos:this.chromosomes[t].size});r.push({chrom:n.chrom,startPos:0,endPos:n.pos})}return r}continuousToDiscreteChromosomeIntervals(e){return this.toDiscreteChromosomeIntervals([this.toChromosomal(e[0]),this.toChromosomal(e[1])])}parseInterval(e){let t=e.match(/^(chr[0-9A-Z]+)(?::([0-9,]+)(?:-(?:(chr[0-9A-Z]+):)?([0-9,]+))?)?$/);if(t){let e=t[1];if(t.slice(2).every(e=>e===void 0)){let t=this.getChromosome(e);return t?[t.continuousStart,t.continuousEnd]:void 0}let n=t[3]||e,r=parseInt(t[2].replace(/,/g,``)),i=t[4]===void 0?r:parseInt(t[4].replace(/,/g,``));return[this.toContinuous(e,r-1),this.toContinuous(n,i)]}}}}));function B_e(){let e=Bz().numberingOffset(1),t;e.genome=function(n){return arguments.length?(t=n,e):t},e.ticks=n=>{if(!t)return[];let r=e.domain(),i=r[1]-r[0],a=e.numberingOffset(),o=t.toChromosome(Math.max(r[0],0)),s=t.toChromosome(Math.min(r[1],t.totalSize-1)),c=Math.max(1,Math.min(n??10,Math.floor(i))),l=Ht(r[0],r[1],c);l<aB&&(l=Ht(r[0],r[1],c*oB)),l=Math.max(1,l);let u=[];for(let e=o.index;e<=s.index;e++){let n=t.chromosomes[e],i=Math.max(n.continuousStart+l,r[0]-(r[0]-n.continuousStart)%l),o=Math.min(n.continuousEnd-l/4,r[1]+1);for(let e=i;e<=o;e+=l){let t=e-a;t>=r[0]&&t<r[1]&&u.push(t)}}return u},e.tickFormat=(n,r)=>{if(!t)return;if(r)throw Error(`Locus scale's tickFormat does not support a specifier!`);let i=e.domain(),a=i[1]-i[0],o=e.numberingOffset(),s=Ht(i[0],i[1],Math.max(1,Math.min(n??10,Math.floor(a))))<aB?Dn(`,`):Dn(`.3s`),c=e=>e-t.toChromosome(e).continuousStart;return e=>s(c(e)+o)};let n=e.copy;return e.copy=()=>{let e=n(),r=t;return e.genome=function(t){return arguments.length?(r=t,e):r},e.genome(t)},e}function V_e(e){return e.type==`locus`}function H_e(e,t){let n=iB(e);return n?n.toChromosomal(t):t}function U_e(e,t){let n=iB(e);return n&&Xz(t)?n.toContinuous(t.chrom,t.pos):t}function W_e(e,t){let n=iB(e);return n&&Zz(t)?n.toContinuousInterval(t):t}function G_e(e,t){let n=iB(e);return n?n.toChromosomalInterval(t):t}function K_e(e){let t=iB(e);if(!t)throw Error(`No genome has been defined!`);return t.getExtent()}function iB(e){if(e&&`toChromosomal`in e)return e;if(e&&`genome`in e)return e.genome()}var aB,oB,sB=n((()=>{ln(),Mn(),Hz(),rB(),aB=1e6,oB=.65}));function q_e(e,{onRangeChange:t,onDomainChange:n,range:r,domain:i}){typeof r==`function`&&(e.range=(function(e){if(arguments.length)r(e),t?.();else return r()})),typeof i==`function`&&(e.domain=(function(e){if(arguments.length)i(e),n?.();else return i()}))}function J_e({range:e,reverse:t,createExpression:n,registerExpr:r}){if(!e||!Ep(e))return null;let i=(e,t)=>t?e.slice().reverse():e;if(e.some(U)){let a;return{dynamic:!0,evaluate:()=>i(a.map(e=>e()),t),setup:t=>{a=e.map(e=>{if(U(e)){let i=n(e.expr);return i.subscribe(t),r(i),()=>i(null)}return()=>e})}}}return{dynamic:!1,values:i(e,t)}}var cB,Y_e=n((()=>{z(),xC(),W(),sB(),cB=class{#e;#t=new Set;#n;#r;#i;#a;#o=0;constructor({getParamRuntime:e,onRangeChange:t,onDomainChange:n,getGenomeStore:r}){this.#n=e,this.#r=t,this.#i=n,this.#a=r}get scale(){return this.#e}resetScale(){this.dispose(),this.#e=void 0}getLocusGenome(e){let t=this.#a?.();if(!t)throw Error(`No genome has been defined!`);return e?t.getGenome(e):t.getGenome()}createScale(e){let t=Fue({...this.#c(e),range:void 0});return t.props=e,`unknown`in t&&t.unknown(null),this.#e=t,this.#s(e),this.#l(),this.#u(),this.#e}#s(e){let t=this.#e;!t||!V_e(t)||t.genome(this.getLocusGenome(e.assembly))}reconfigureScale(e){let t=this.#e;!t||t.type==`null`||(Pue({...this.#c(e),range:void 0},t),t.props=e,this.#l())}withDomainNotificationsSuppressed(e){this.#o+=1;try{e()}finally{--this.#o}}#c(e){let{assembly:t,domainIndexer:n,__rangeExprScope:r,...i}=e;return i}#l(){let e=this.#e;if(!e)return;let t=e.props;this.#t.forEach(e=>e.invalidate()),this.#t.clear();let n=t.__rangeExprScope?.paramRuntime??this.#n(),r=J_e({range:t.range,reverse:t.reverse,createExpression:e=>n.createExpression(e),registerExpr:e=>this.#t.add(e)});if(!r)return;if(`values`in r){e.range(r.values);return}let i=()=>e.range(r.evaluate());r.setup(i),i()}#u(){let e=this.#e;if(!e)return;let t=e.range,n=e.domain,r=()=>this.#r?.();q_e(e,{onRangeChange:r,onDomainChange:()=>{this.#o>0||this.#i?.()},range:t,domain:n}),r()}dispose(){this.#t.forEach(e=>e.invalidate()),this.#t.clear()}}}));function lB(e,t,n){if(n||=[],e.some(e=>e===null)){if(e.every(e=>e===null))return null;throw console.warn(e),Error(`Cannot merge objects with nulls!`)}let r={},i=(e,t)=>e===t||uB(e)&&uB(t)||uB(e)&&t===!0||e===!0&&ap(t)||Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((e,n)=>e===t[n]),a=e=>{for(let a in e){let o=e[a];if(!n.includes(a)&&o!==void 0)if(r[a]!==void 0&&!i(r[a],o))console.warn(`Conflicting property ${a} of ${t}: (${JSON.stringify(r[a])} and ${JSON.stringify(e[a])}). Using ${JSON.stringify(r[a])}.`);else{let e=r[a];if(uB(e))uB(o)&&(r[a]=lB([e,o],a));else if(uB(o)){if(!(e===!0||e===void 0))throw Error(`Bug in merge! Target is: `+e);r[a]=lB([{},o],a)}else r[a]=o}}};for(let t of e)a(t);return r}function uB(e){return ap(e)&&!Array.isArray(e)}var dB=n((()=>{z()}));function fB(e){return typeof e==`string`||typeof e==`object`&&!!e}function pB(e){return vB.has(e)}function X_e(e,t){if(pB(t))return hB(e)[t]}function Z_e(e){if([`nominal`,`ordinal`,`quantitative`,`index`,`locus`].includes(e))return e}function Q_e(e){if(!e)return{};let t={...e};for(let e of[`nominal`,`ordinal`,`quantitative`,`index`,`locus`,`nominalColorScheme`,`ordinalColorScheme`,`quantitativeColorScheme`,`indexColorScheme`,`locusColorScheme`])delete t[e];return t}function mB(e,t){let n=Z_e(t);return NS(e.flatMap(e=>{let t=e.scale;return[t,t&&n?t[n]:void 0]}))}function hB(e){return NS(e.map(e=>e.range))}function $_e(e,{channel:t,dataType:n,isExplicitDomain:r,markTypes:i,hasDomainMid:a}){let o=mB(e,n),s=hB(e),c={...Q_e(o)};if(r?c.zero=!1:c.zero===void 0&&o.zero!==void 0&&(c.zero=o.zero),mm(t)&&c.nice===void 0&&(c.nice=o.nice===void 0?!r:o.nice),ym(t)&&c.scheme===void 0)if(n==`quantitative`){let e=a||o.domainMid!==void 0?s.diverging:i?.length&&i.every(e=>_B.has(e))?s.heatmap:s.ramp,t=fB(e)?e:o.quantitativeColorScheme;fB(t)&&(c.scheme=t)}else{let e=o[gB[n]??gB.quantitative];fB(e)&&(c.scheme=e)}else bm(t)&&c.range===void 0?t==`shape`?c.range=s.shape??[]:t==`direction`?c.range=[`forward`,`reverse`]:c.range=[]:t==`size`&&c.range===void 0?c.range=s.size:t==`angle`&&c.range===void 0&&(c.range=s.angle);return c}var gB,_B,vB,eve=n((()=>{km(),PS(),gB={nominal:`nominalColorScheme`,ordinal:`ordinalColorScheme`,quantitative:`quantitativeColorScheme`},_B=new Set([`rect`]),vB=new Set([`shape`,`size`,`angle`,`heatmap`,`ramp`,`diverging`])}));function yB(e,t){return U(e)?t.createExpression(e.expr)():Array.isArray(e)?e.map(e=>yB(e,t)):e}function bB(e){return U(e)?[e]:Array.isArray(e)?e.flatMap(e=>bB(e)):[]}var xB=n((()=>{W()})),SB,CB,wB,TB=n((()=>{SB=`quantitative`,CB=`ordinal`,wB=`nominal`}));function tve(e,t){if(t==`index`||t==`locus`){if(pm(e))return t;throw Error(e+` does not support `+t+` data type. Only positional channels do.`)}let n={x:[`band`,`band`,`linear`],y:[`band`,`band`,`linear`],xOffset:[`band`,`band`,`linear`],yOffset:[`band`,`band`,`linear`],size:[void 0,`point`,`linear`],opacity:[void 0,`point`,`linear`],fillOpacity:[void 0,`point`,`linear`],strokeOpacity:[void 0,`point`,`linear`],color:[`ordinal`,`ordinal`,`linear`],fill:[`ordinal`,`ordinal`,`linear`],stroke:[`ordinal`,`ordinal`,`linear`],strokeWidth:[void 0,void 0,`linear`],shape:[`ordinal`,`ordinal`,void 0],dx:[void 0,void 0,`null`],dy:[void 0,void 0,`null`],angle:[void 0,void 0,`linear`],sample:[`null`,void 0,void 0]},r=[`sample`].includes(e)?`null`:n[e]?n[e][[wB,CB,SB].indexOf(t)]:t==`quantitative`?`linear`:`ordinal`;if(r===void 0)throw Error(`Channel "`+e+`" is not compatible with "`+t+`" data type. Use of a proper scale may be needed.`);return r}function EB(e,t,n,r){if(n){if([`index`,`locus`].includes(n)&&!pm(e))throw Error(`Index and locus scales are only supported on positional channels (x/y). Channel "${e}" resolves to scale type "${n}".`);if([`index`,`locus`].includes(t)&&n!==t||n===`locus`&&n!==t)throw Error(`${r} "${n}" is incompatible with "${t}" data.`)}}function nve(e,t){mm(t)&&e.type!==`ordinal`&&(e.range=[0,1]),t==`opacity`&&kb(e.type)&&e.clamp===void 0&&(e.clamp=!0)}var DB=n((()=>{dx(),km(),TB()}));function rve({channel:e,dataType:t,orderedMembers:n,viewLevelScaleProps:r,isExplicitDomain:i,configScopes:a}){let o=n,s=o.map(e=>typeof e.view.getMarkType==`function`?e.view.getMarkType():void 0).filter(e=>!!e),c=lB(r?[r.props]:o.map(e=>e.channelDef.scale).filter(e=>e!==void 0),`scale`,[`domain`]);if(c===null||c.type==`null`)return{type:`null`};let l={...$_e(a,{channel:e,dataType:t,isExplicitDomain:i,markTypes:s,hasDomainMid:c.domainMid!==void 0}),...c};if(l.type||=tve(e,t),pm(e)&&o.some(t=>lm(t.view.getEncoding()[Goe(e)]))&&l.type==`band`&&l.padding===void 0&&(l.paddingInner??=.2,l.paddingOuter??=.2),EB(e,t,r?l.type:void 0,`View-level scales.${e}.type`),typeof l.range==`string`){if(!pB(l.range))throw Error(`Unknown named scale range "`+l.range+`". Supported names: shape, size, angle, heatmap, ramp, diverging.`);let t=X_e(a,l.range);if(t===void 0)throw Error(`Named scale range "`+l.range+`" is not configured in config.range.`);ym(e)&&(typeof t==`string`||typeof t==`object`&&t&&!Array.isArray(t))?(l.scheme=t,delete l.range):l.range=t}if(e==`y`&&Ab(l.type)&&l.reverse==null&&(l.reverse=!0),hm(e)&&Ab(l.type)&&!l.range){let t=e==`xOffset`?`x`:`y`,n=o[0]?.view,r=n?.getScaleResolution(t);r?.getResolvedScaleType()==`band`&&(r.getScale(),l.range=[0,{expr:`bandwidth("${t}") * ${t==`x`?`width`:`height`}`}],l.__rangeExprScope=n)}if(l.range&&l.scheme&&delete l.scheme,l.domainTransition===void 0&&(l.domainTransition=!(o.some(e=>bB(e.channelDef.scale?.domain).length>0)||bB(r?.props.domain).length>0)),Array.isArray(l.range)&&l.range.some(U)&&o.length>0){let e=r?.props.range===void 0?o.find(e=>e.channelDef.scale?.range!==void 0)?.view:r.view;e&&(l.__rangeExprScope=e)}if(!(`zoom`in l)){let e=mB(a,t);e.zoom===void 0?[`index`,`locus`].includes(l.type)&&(l.zoom=!0):l.zoom=e.zoom}return nve(l,e),l}var ive=n((()=>{dx(),km(),W(),dB(),eve(),xB(),DB(),TB()}));function OB(e){return e===`index`||e===`locus`}function kB(e,t){return OB(e)?jB(t):t}function ave(e,t){return OB(e)?ove(t):t}function AB(e,t){return t&&OB(e)?jB(t):t}function jB(e){return[e[0],e[1]+MB(e)]}function ove(e){return[e[0],e[1]-MB(e)]}function MB(e){return e[1]>=e[0]?1:-1}var NB=n((()=>{TB()}));function sve(e,t){let n=e.findRuntimeForParam(t);if(!n)throw Error(`Selection domain parameter "${t}" was not found.`);return n}function PB(e,t){if(e){if(!Og(e))throw Error(`Selection domain parameter "${t}" must be an interval selection.`);return e}}function cve(e,t,n){let r=e.paramRuntime.findRuntimeForParam?sve(e.paramRuntime,t):e.paramRuntime;return{runtime:r,selection:PB(r.getValue?r.getValue(t):e.paramRuntime.findValue(t),t)}}function lve(e,t,n,r){let i=[];return e.visit(e=>{let a=e.paramRuntime?.paramConfigs?.get(n);if(!a||!Vg(a))return;let o=jg(a.select);!Ng(o)||!o.encodings?.includes(r)||e.paramRuntime.findRuntimeForParam(n)===t&&i.push({view:e,param:a})}),i}function uve(e,t,n,r){let i=new Set,a=[e.getLayoutAncestors?.(),e.getDataAncestors?.(),[e]];for(let e of a)for(let a of e??[]){if(!a||i.has(a))continue;i.add(a);let e=a.paramRuntime?.paramConfigs?.get(n);if(!e||!Vg(e))continue;let o=jg(e.select);if(!(!Ng(o)||!o.encodings?.includes(r))&&a.paramRuntime.findRuntimeForParam?.(n)===t)return!0}return!1}function FB(e,t,n={}){if(!e||e.length!==2)return;let r=Number(e[0]),i=Number(e[1]);if(!Number.isFinite(r)||!Number.isFinite(i))return;let a=Math.min(r,i),o=Math.max(r,i);if(a=Math.max(t[0],a),o=Math.min(t[1],o),!(a>o)&&!(n.roundToIntegers&&(a=Math.ceil(a),o=Math.ceil(o),a=Math.max(t[0],a),o=Math.min(t[1],o),a>o)))return[a,o]}var IB=n((()=>{W(),Ig()}));function LB(e,t){if(e==`quantitative`&&dve(t)){let n=new HB(t);return n.type=e,n}else if(UB[e]){let n=new UB[e];return n.type=e,t&&n.extendAll(t),n}throw Error(`Unknown type: `+e)}function dve(e){return e&&e.length>0&&e.length!=2&&e.every(e=>typeof e==`number`)}var RB,zB,BB,VB,HB,UB,WB=n((()=>{RB=class e extends Array{constructor(){super(),this.type=void 0}extend(e){return this}extendAll(t){if(t instanceof e&&t.type!=this.type)throw Error(`Cannot combine different types of domains: ${this.type} and ${t.type}`);for(let e of t)this.extend(e);return this}extendAllWithAccessor(e,t){for(let n of e)this.extend(t(n));return this}},zB=class extends RB{constructor(){super(),this.type=`quantitative`}extend(e){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)}},BB=class extends RB{constructor(){super(),this.type=`ordinal`,this.uniqueValues=new Set}extend(e){return e==null||Number.isNaN(e)||this.uniqueValues.has(e)||(this.uniqueValues.add(e),this.push(e)),this}},VB=class extends BB{constructor(){super(),this.type=`nominal`}},HB=class extends RB{constructor(e){super();let t=0;for(let n=1;n<e.length;n++)t+=Math.sign(e[n]-e[n-1]);if(Math.abs(t)!=e.length-1)throw Error(`Piecewise domain must be strictly increasing or decreasing: `+JSON.stringify(e));e.forEach(e=>this.push(e))}extend(e){if(this.includes(e))return this;throw Error(`Piecewise domains are immutable and cannot be unioned!`)}},UB={quantitative:zB,index:zB,locus:zB,nominal:VB,ordinal:BB}}));function fve(e,t,n,r){let i=Array.from(e).filter(e=>e.contributesToDomain).filter(e=>e.channelDef.scale?.domain),a={domains:[],selectionRef:void 0,selectionRuntime:void 0,selectionDescription:void 0,hasLiteralDomain:!1};t?.domain!==void 0&&GB(a,KB(t,n,r));for(let e of i)GB(a,KB({view:e.view,channel:e.channel,type:e.channelDef.type,domain:e.channelDef.scale.domain},n,r));return hve(a)}function GB(e,t){t.kind===`selection`?pve(e,t):mve(e,t)}function KB(e,t,n){let r=e.domain;return yve(r)?{kind:`selection`,...gve(e,r,t,n)}:{kind:`literal`,domain:qB(e.type,yB(r,e.view?.paramRuntime),t)}}function pve(e,t){if(e.hasLiteralDomain)throw Error(`Cannot mix selection-driven and literal configured domains on a shared scale.`);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+`.`);e.selectionRuntime=t.runtime,e.selectionDescription=t.description,e.selectionRef={param:t.param,encoding:t.encoding,hasInitial:(e.selectionRef?.hasInitial??!1)||t.hasInitial,runtime:t.runtime},t.domain&&e.domains.push(t.domain)}function mve(e,t){if(e.selectionRuntime)throw Error(`Cannot mix literal configured domains with selection-driven domains on a shared scale.`);e.hasLiteralDomain=!0,e.domains.push(t.domain)}function hve(e){return e.domains.length>0?{domain:e.domains.reduce((e,t)=>e.extendAll(t)),selectionRef:e.selectionRef}:e.selectionRuntime?{domain:void 0,selectionRef:e.selectionRef}:{domain:void 0,selectionRef:void 0}}function gve(e,t,n,r){let i=t.param,a=vve(e.channel,t,i),o=cve(e.view,i,a),s=t.initial!==void 0,c=o.selection?.intervals[a],l=i+`.`+a;return!c||c.length!==2?{domain:r&&t.initial?qB(e.type,t.initial,n):void 0,description:l,param:i,encoding:a,hasInitial:s,runtime:o.runtime}:{domain:LB(e.type,n(c)),description:l,param:i,encoding:a,hasInitial:s,runtime:o.runtime}}function qB(e,t,n){let r=n(t);return LB(e,e===`locus`&&Zz(t)&&!Qz(t)?r:kB(e,r))}function _ve(e,t){if(!t||e.size<2||!Array.from(e).some(e=>uve(e.view,t.runtime,t.param,t.encoding)))return;let n=Array.from(new Set(Array.from(e).filter(e=>e.contributesToDomain).map(e=>e.view.getPathString?.()??e.view.name??`(unknown)`)));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.`)}function vve(e,t,n){if(t.encoding)return t.encoding;let r=vm(e);if(r===`x`||r===`y`)return r;throw Error(`Selection domain reference "${n}" on channel "${e}" requires an explicit "encoding" ("x" or "y").`)}function yve(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&typeof e.param==`string`}function bve(e,t,n){let r=t(),i=new Map;for(let t of e){if(!t.contributesToDomain)continue;let e=n(t);if(e.length===0)continue;let a=t.view.getCollector();for(let t of e){let e=Zp(t,r),n=a??null,o=i.get(n);if(o||(o=new Map,i.set(n,o)),o.has(e))continue;let s;if(a)s=a.getDomain(e,r,t);else if(t.constant)s=LB(r),s.extend(t({}));else continue;o.set(e,s)}}if(i.size===0)return;let a=LB(r);for(let e of i.values())for(let t of e.values())a.extendAll(t);return a}function xve(e,t,n,r){return e==`locus`?t(r):e==`index`?AB(e,n)??[]:n??[]}var JB,Sve=n((()=>{z(),dx(),TB(),NB(),IB(),WB(),xB(),em(),km(),rB(),JB=class{#e;#t;#n;#r;#i;#a;#o;#s;#c=void 0;#l=!0;#u=new Map;#d=new WeakMap;constructor({getActiveMembers:e,getAllMembers:t,getDataMembers:n,getViewLevelDomainSource:r,getType:i,getLocusExtent:a,fromComplexInterval:o}){this.#e=e,this.#t=t??e,this.#n=n??e,this.#r=r,this.#i=i,this.#a=a,this.#o=o}get initialDomainSnapshot(){return this.#s}hasConfiguredDomain(e={}){return!!this.getConfiguredDomain(e)}hasSelectionConfiguredDomain(){return this.getSelectionConfiguredDomainBindingInfo(),!!this.#c}getSelectionConfiguredDomainBindingInfo(){return this.#c||!this.#l||this.getConfiguredDomain(),this.#c}getSelectionConfiguredDomainInfo(){let e=this.getSelectionConfiguredDomainBindingInfo();if(e)return{param:e.param,encoding:e.encoding}}invalidateConfiguredDomain(){this.#l=!0,this.#c=void 0,this.#u.clear()}getDefaultDomain(e=!1,t){let n=this.#i();return xve(n,this.#a,e&&n!==`locus`?this.getDataDomain():void 0,t)}getConfiguredOrDefaultDomain(e=!1,t,n={}){return this.getConfiguredDomain(n)??this.getDefaultDomain(e,t)}getConfiguredDomain(e={}){let t=e.includeSelectionInitial??!0;if(!this.#l&&this.#u.has(t))return this.#u.get(t);let n=fve(this.#e(),this.#r?.(),this.#o,t);return _ve(this.#t(),n.selectionRef),this.#c=n.selectionRef,this.#u.set(t,n.domain),this.#l=!1,n.domain}getDataDomain(){return bve(this.#n(),this.#i,e=>this.#f(e))}getDataZoomExtent(){return AB(this.#i(),this.getDataDomain())}captureInitialDomain(e,t,n){if(!this.#s&&kb(e.type)){let t=n??e.domain();xp(t)>0&&(this.#s=t)}return t?!1:(this.#s=n??e.domain(),!0)}#f(e){let t=this.#d.get(e);if(t)return t;let n=e.view.mark.encoders;if(!n)return[];let r=n[e.channel];if(!r)return[];let i=tm(r);if(i.length===0)return[];let a=i.filter(Jp).filter(e=>!e.channelDef.domainInert);return this.#d.set(e,a),a}}}));function Cve(e){return((e*=2)<=1?e*e:--e*(2-e)+1)/2}var wve=n((()=>{}));function Tve(e){return--e*e*e+1}function Eve(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Dve=n((()=>{}));function Ove(e){return(2**(-10*e)-.0009765625)*1.0009775171065494}var kve=n((()=>{}));function Ave(e){return 1-Ove(e)}var jve=n((()=>{kve()})),YB=n((()=>{wve(),Dve(),jve()}));function Mve(e,t,n){return e*(t/e)**+n}var Nve=n((()=>{}));function XB(e,t,n,r,i={}){let a=i.onUnsupported??`throw`;switch(e.type){case`linear`:case`index`:case`locus`:return up(t,n,r);case`log`:return dp(t,n,r);case`pow`:case`sqrt`:return fp(t,n,r,e.exponent());case`symlog`:return pp(t,n,r,e.constant());default:if(a===`identity`)return t;throw Error(`Zooming is not implemented for: `+e.type)}}var ZB=n((()=>{z()}));function Pve(e){if(e===void 0)return{duration:0,renderImmediately:!1};if(_p(e))return{duration:e?700:0,renderImmediately:!1};if(typeof e==`number`)return{duration:e,renderImmediately:!1};let t=e.duration??0;return{duration:_p(t)?t?700:0:t,renderImmediately:e.renderImmediately===!0}}function Fve(e,t,n,r,i,a){if(Lve(t)){if(Ep(t.extent))return QB(e.props.type,t.extent,n);if(t.extent===`data`)return a()??i()??e.domain();if(t.extent===`unbounded`){if(e.props.type===`locus`)throw Error(`Zoom extent "unbounded" is not supported for locus scales.`);return[-1/0,1/0]}}return t&&e.props.type==`locus`?r():i()??e.domain()}function Ive(e,t,n,r,i){let a=[...t],o=e.invert(r);switch(e.props.reverse&&(i=-i),`align`in e&&(o+=e.align()),e.type){case`linear`:case`index`:case`locus`:a=Eoe(a,i||0);break;case`log`:a=Doe(a,i||0);break;case`pow`:case`sqrt`:a=Ooe(a,i||0,e.exponent());break;case`symlog`:if(i!==0)throw Error(`Panning is not implemented for: `+e.type);break;default:throw Error(`Zooming is not implemented for: `+e.type)}return XB(e,a,o,n)}function QB(e,t,n){let r=e===`locus`?n(t):t;return e===`locus`&&Zz(t)&&!Qz(t)?r:kB(e,r)}function Lve(e){return ap(e)}var $B,Rve=n((()=>{z(),dx(),YB(),Nve(),ep(),Ex(),ZB(),NB(),TB(),rB(),$B=class{#e;#t;#n;#r;#i;#a;#o;#s;#c=null;constructor({getScale:e,getAnimator:t,renderImmediately:n,getInitialDomainSnapshot:r,getDataZoomExtent:i,getResetDomain:a,fromComplexInterval:o,getGenomeExtent:s}){this.#e=e,this.#t=t,this.#n=n,this.#r=r,this.#i=i,this.#a=a,this.#o=o,this.#s=s}getZoomExtent(){let e=this.#e(),t=e.props.zoom;return Fve(e,t,this.#o,this.#s,this.#r,this.#i)}isZoomable(){return this.isZoomingSupported()&&!!this.#e().props.zoom}isZoomingSupported(){let e=this.#e().type;return kb(e)&&!Ab(e)}getDomainChangeAction(e,t){return Xf(t,e)?`none`:this.isZoomable()?`restore`:this.#e().type===`index`?`notify`:this.isZoomingSupported()?`animate`:`notify`}isZoomed(){return this.isZoomingSupported()&&!Xf(this.#a(),this.#e().domain())}zoom(e,t,n){if(!this.isZoomingSupported())return!1;let r=this.#e(),i=r.domain(),a=Ive(r,i,e,t,n),o=this.getZoomExtent();return a=koe(a,o[0],o[1]),[0,1].some(e=>a[e]!=i[e])?(r.domain(a),!0):!1}async zoomTo(e,t=!1){let{duration:n,renderImmediately:r}=Pve(t);if(!this.isZoomingSupported())throw Error(`Not a zoomable scale!`);let i=this.#e(),a=QB(i.type,e,this.#o),o=this.#t(),s=i.domain();if(n>0&&s.length==2){if(r)throw Error(`renderImmediately is not supported for animated zooms.`);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];this.#l();let f=xle();this.#c=f,await o.transition({duration:n,easingFunction:Eve,cancelToken:f,onUpdate:n=>{let r=Mve(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];i.domain(f)}}),this.#c===f&&(this.#c=null),i.domain(a)}else this.#l(),i.domain(a),r?this.#n():o?.requestRender()}#l(){this.#c&&=(this.#c.canceled=!0,null)}resetZoom(){if(!this.isZoomingSupported())throw Error(`Not a zoomable scale!`);let e=this.#e(),t=e.domain(),n=this.#a();return[0,1].some(e=>n[e]!=t[e])?(e.domain(n),!0):!1}getZoomLevel(){if(this.isZoomable()){let e=this.getZoomExtent();return xp(e.every(Number.isFinite)?e:this.#r()??this.#e().domain())/xp(this.#e().domain())}return 1}}}));function eV(e){let t=e.view.getPathString(),n=e.channel??``;return t+`|`+n}function tV(e){return Array.from(e).sort((e,t)=>eV(e).localeCompare(eV(t)))}var nV=n((()=>{}));function rV(e,t){return e===t||e.getDataAncestors().includes(t)?`incoming`:t.getDataAncestors().includes(e)?`current`:`conflict`}var iV=n((()=>{}));function zve(e,t){return e===t?!0:!e||!t?!1:e.length===t.length&&Xf(e,t)}function Bve(e){let t=e.view.mark.encoders?.[e.channel];return t?tm(t).filter(Jp):[]}function Vve(e){let t=e.channelDef.scale,n=t?.assembly;if(!t||!n||typeof n!=`object`||!(`url`in n))return e;let r=SS(e.view.getBaseUrl(),n.url);return r===n.url?e:{...e,channelDef:{...e.channelDef,scale:{...t,assembly:{...n,url:r}}}}}var aV,oV=n((()=>{sB(),Hz(),wL(),dx(),xC(),Y_e(),ive(),Sve(),Rve(),DB(),TB(),em(),km(),xB(),WB(),ep(),lR(),bS(),TS(),nV(),iV(),IB(),NB(),Db(`index`,Bz,[`continuous`]),Db(`locus`,B_e,[`continuous`]),Db(`null`,CL,[]),aV=class{#e=new Set;#t=new Set;#n=!1;#r;#i={domain:new Set,range:new Set};#a;#o;#s;#c;#l=!1;#u=[];#d=0;#f=[];#p=!1;#m=void 0;#h;#g;#_=0;#v=0;#y=!1;constructor(e,t){this.channel=e,this.type=null,this.name=void 0,this.#h=t,this.#o=new JB({getActiveMembers:()=>this.#S(),getAllMembers:()=>this.#e,getDataMembers:()=>this.#S(this.#t),getViewLevelDomainSource:()=>this.#z(),getType:()=>this.type,getLocusExtent:e=>this.#w(e),fromComplexInterval:this.fromComplexInterval.bind(this)}),this.#a=new cB({getParamRuntime:()=>this.#x.paramRuntime,onRangeChange:()=>this.#E(`range`),onDomainChange:()=>this.#E(`domain`),getGenomeStore:()=>this.#C.genomeStore}),this.#s=new $B({getScale:()=>this.getScale(),getAnimator:()=>this.#C.animator,renderImmediately:()=>this.#C.renderImmediately(),getInitialDomainSnapshot:()=>this.#o.initialDomainSnapshot,getDataZoomExtent:()=>this.#o.getDataZoomExtent(),getResetDomain:()=>this.#j(),fromComplexInterval:this.fromComplexInterval.bind(this),getGenomeExtent:()=>this.#w()})}get#b(){let e=this.#e.values().next().value;if(!e)throw Error(`ScaleResolution has no members!`);return e.view}get#x(){return this.#h??this.#b}#S(e=this.#e){let t=new Set;for(let n of e){let e=n.view;e.isConfiguredVisible()&&(!e.isDataInitialized()&&!n.channelDef?.scale?.domain||t.add(n))}return t}get#C(){return this.#x.context}get zoomExtent(){return(this.#a.scale&&kb(this.#a.scale.type)&&this.#s.getZoomExtent())??[-1/0,1/0]}#w(e){return K_e(this.#T(e))}#T(e){if(this.type===`locus`)return this.#a.scale??this.#a.getLocusGenome(e)}addEventListener(e,t){this.#i[e].add(t)}removeEventListener(e,t){this.#i[e].delete(t)}#E(e){e===`domain`&&this.#d===0&&this.syncLinkedSelectionFromDomain();for(let t of this.#i[e].values())t({type:e,scaleResolution:this})}#D(e){this.#d+=1;try{e()}finally{--this.#d}}syncLinkedSelectionFromDomain(){let e=this.#o.getSelectionConfiguredDomainBindingInfo();if(!e||!this.isZoomable())return;let t=PB(e.runtime.getValue(e.param),e.param);if(!t)return;let n=this.#O(this.getScale().domain());if(!n)return;let r=this.#O(this.#o.getDefaultDomain(!0)),i=r&&Xf(n,r)?null:n;zve(t.intervals[e.encoding]??null,i)||e.runtime.setValue(e.param,{...t,type:`interval`,intervals:{...t.intervals,[e.encoding]:i}})}#O(e){return FB(e,this.zoomExtent)}#k(){return this.#o.getSelectionConfiguredDomainBindingInfo()}#A(){return!this.#p}#j(e=!1,t){return this.#o.getConfiguredOrDefaultDomain(e,t,{includeSelectionInitial:this.#A()})}#M(){if(this.#g?.props.domain!==void 0)return!0;for(let e of this.#e)if(e.contributesToDomain&&e.channelDef.scale?.domain!==void 0)return!0;return!1}#N(e){let t=PB(e.runtime.getValue(e.param),e.param);if(!t)return null;let n=t.intervals[e.encoding];return n&&n.length===2?n:null}#P(e,t){t?this.#p=!1:e&&(this.#p=!0)}#F(e){let t=Vve(e),{channel:n,channelDef:r}=t;this.#B(t);let i=r.type==null&&this.type;if(n!=`sample`&&!r.type&&!gm(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"`);let a=n==`sample`?`nominal`:r.type,o=r?.scale?.name,s=r.scale?.type??(a===`index`||a===`locus`?a:void 0);if(EB(this.channel,a,s,`encoding.${n}.scale.type`),o){if(this.name!==void 0&&o!=this.name)throw Error(`Shared scales have conflicting names: "${o}" vs. "${this.name}"!`);this.name=o}if(!i){if(!this.type)this.type=a;else if(a!==this.type&&!gm(n))throw Error(`Can not use shared scale for different data types: ${this.type} vs. ${a}. Use "resolve: independent" for channel ${this.channel}`)}return this.#e.add(t),t.contributesToDomain&&(this.#t.add(t),this.#n=!1),t}#I(){this.#y=!1,this.#Z(),this.#ee(),this.#W(),this.#G()}#L(){this.#v>0?this.#y=!0:this.#I()}static registerInBatch(e,t){let n=Array.from(e);for(let e of n)e.#v++;try{return t()}finally{for(let e of n)e.#v--,e.#v===0&&e.#y&&e.#I()}}registerMember(e){let t=this.#F(e);return this.#L(),()=>{let e=this.#e.delete(t);return e&&(this.#t.delete(t),this.#L()),e&&this.#e.size===0}}attachViewLevelScaleProps(e,t){if(this.#g&&this.#g.view!==e){let t=rV(this.#g.view,e);if(t===`current`)return;if(t===`conflict`)throw Error(`Multiple view-level scale declarations target the same ${this.channel} scale resolution.`)}for(let e of this.#e)this.#V(e);this.#g={view:e,props:t},this.#X(),this.#ee(),this.#W(),this.#G(),this.#R()}clearViewLevelScaleProps(e){this.#g?.view===e&&(this.#g=void 0,this.#X(),this.#ee(),this.#W(),this.#G(),this.#R())}#R(){this.#a.scale&&(this.#a.resetScale(),this.initializeScale(),this.#E(`domain`))}getViewLevelScaleProps(){return this.#g}#z(){let e=this.#g;if(e)return{view:e.view,channel:this.channel,type:this.type,domain:e.props.domain}}#B(e){this.#g&&this.#V(e)}#V(e){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.`)}dispose(){this.#H(),this.#U(),this.#i.domain.clear(),this.#i.range.clear(),this.#a.dispose()}#H(){for(let e of this.#u)e();this.#u=[],this.#m=void 0}#U(){for(let e of this.#f)e();this.#f=[]}#W(){if(this.#H(),this.#e.size===0)return;let e=this.#k();e&&(this.#m=this.#N(e),this.#u.push(e.runtime.subscribe(e.param,()=>{let t=this.#m,n=this.#N(e);this.#P(t,n),this.#m=n,this.#ee(),this.reconfigureDomain()})))}#G(){if(this.#U(),this.#e.size===0)return;let e=()=>{this.#ee(),this.reconfigureDomain()};for(let t of this.#e){if(!t.contributesToDomain)continue;let n=t.channelDef.scale?.domain,r=bB(n);if(r.length!==0)for(let n of r){let r=t.view.paramRuntime.createExpression(n.expr).subscribe(e);this.#f.push(r)}}let t=this.#g?.props.domain,n=bB(t);for(let t of n){let n=this.#g.view.paramRuntime.createExpression(t.expr).subscribe(e);this.#f.push(n)}}#K(){for(let e of this.#e)if(e.view.hasRendered())return!0;return!1}#q(){if(this.#n)return!1;for(let e of this.#t){let t=e.view;if(t.isConfiguredVisible()){if(!t.isDataInitialized()){if(!e.channelDef.scale?.domain)return!1;continue}if(!this.#J(e))return!1}}return this.#n=!0,!0}#J(e){if(!e.view.mark.encoders?.[e.channel])return!1;let t=Bve(e).filter(e=>!e.constant&&!e.channelDef.domainInert);if(t.length===0)return!0;let n=e.view.getCollector();return!n||!n.completed?!1:t.some(e=>n.getDomain(Zp(e,this.type),this.type,e).length>0)}registerCollectorSubscriptions(e,t){let n=new Set;for(let e of t)e.channelDef.domainInert||n.add(Zp(e,this.type));if(n.size===0)return()=>void 0;let r=()=>{this.reconfigureDomain()},i=[];for(let t of n)i.push(e.subscribeDomainChanges(t,r));return()=>{for(let e of i)e()}}isDomainDefinedExplicitly(){return this.#M()}isDomainInitialized(){let e=this.#a.scale;if(!e)return!1;let t=e.domain();return kb(e.type)?t.length>2||t.length==2&&(t[0]!==0||t[1]!==0):t.length>0}#Y(){return mS(this,`mergedScaleProps`,()=>{let e=rve({channel:this.channel,dataType:this.type,orderedMembers:this.#Q(),viewLevelScaleProps:this.#g,isExplicitDomain:this.isDomainDefinedExplicitly(),configScopes:this.#x.getConfigScopes()});return this.#te(e),e})}#X(){hS(this,`mergedScaleProps`)}#Z(){this.#r=void 0}#Q(){return this.#r||=tV(this.#e),this.#r}getOrderedMembers(){return this.#Q().slice()}getDebugState(){let e=this.#a.scale,t=e&&typeof e.domain==`function`,n=e&&typeof e.range==`function`;return{kind:`scale`,channel:this.channel,hostView:this.#x,name:this.name,type:this.type,resolvedScaleType:this.getResolvedScaleType(),domain:t?this.getDomain():void 0,complexDomain:t?this.getComplexDomain():void 0,range:n?e.range():void 0,zoomable:this.isZoomable(),zoomed:this.isZoomable()?this.isZoomed():!1,members:this.#Q().map(e=>this.#$(e)),activeMemberCount:this.#S().size,dataDomainMemberCount:this.#t.size,viewLevelScaleProps:this.#g?{view:this.#g.view,props:structuredClone(this.#g.props)}:void 0}}#$(e){return{view:e.view,channel:e.channel,channelDef:structuredClone(e.channelDef),contributesToDomain:e.contributesToDomain,active:this.#S().has(e)}}#ee(){this.#o.invalidateConfiguredDomain(),this.#X()}#te(e){let t=this.#k();if(!t||e===null||e.type===`null`)return;let n=kb(e.type)&&!Ab(e.type)&&!!e.zoom;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".`)}getAssemblyRequirement(){let e=this.#Y();return e===null||e.type===`null`||e.type!==`locus`?{assembly:void 0,needsDefaultAssembly:!1}:{assembly:e.assembly,needsDefaultAssembly:e.assembly===void 0}}getResolvedScaleType(){let e=this.#Y();if(!(e===null||e.type===`null`))return e.type}#ne(e=!1){let t=this.#Y();if(t===null||t.type==`null`)return{type:`null`};let n={...t};this.#_+=1;let r;try{r=this.#j(e,n.type===`locus`?n.assembly:void 0)}finally{--this.#_}if(Ab(n.type)){let t=this.isDomainDefinedExplicitly(),i=this.#re(t);if(r!=null){if(t&&i.domain().length>0&&!Xf(i.domain(),r))return this.#c=void 0,this.#ne(e);i.addAll(r);let a=new Set(r),o=i.domain().filter(e=>a.has(e));n.domain=o.length>0?o:new VB}else{let e=i.domain();n.domain=e.length>0?e:new VB}n.domainIndexer=i}else r&&r.length>0&&(n.domain=r);return!n.domain&&n.domainMid!==void 0&&(n.domain=[n.domainMin??0,n.domainMax??1]),n}#re(e){return(!this.#c||this.#l!==e)&&(this.#c=cR(),this.#l=e),this.#c}reconfigure(){this.#D(()=>{this.#ee();let e=this.#ie(!0);e&&(this.#ae(e,(e,t)=>this.#a.reconfigureScale(t)),this.#oe(e))})}reconfigureDomain(){this.#D(()=>{let e=this.#ie(!0,!0);if(!e)return;let{domainConfig:t,targetDomain:n}=e,r=n!=null&&Xf(n,e.scale.domain());n!=null&&!r&&this.#ae(e,e=>{e.domain(n),t.applyOrdinalUnknown&&e.unknown(t.ordinalUnknown)}),this.#oe(e),this.syncLinkedSelectionFromDomain()})}#ie(e,t=!1){let n=this.#a.scale;if(!n||n.type==`null`)return;let r={scale:n,props:this.#ne(e),previousDomain:n.domain(),domainWasInitialized:this.isDomainInitialized(),hasSelectionConfiguredDomain:this.#o.hasSelectionConfiguredDomain()};if(t){let e=zue(n,r.props);return{...r,domainConfig:e,targetDomain:e.domain}}return r}#ae(e,t){this.#a.withDomainNotificationsSuppressed(()=>{t(e.scale,e.props)})}#oe(e){let{scale:t,previousDomain:n,domainWasInitialized:r,hasSelectionConfiguredDomain:i}=e,a=i?this.#o.getDefaultDomain(!0):void 0,o=this.#q();if(this.#n&&this.#o.captureInitialDomain(t,r,a)){this.#E(`domain`);return}if(!this.#n||o){this.#E(`domain`);return}if(t.props.domainTransition===!1){this.#E(`domain`);return}let s=t.domain(),c=this.#s.getDomainChangeAction(n,s);c===`restore`?i?this.#E(`domain`):this.#a.withDomainNotificationsSuppressed(()=>{t.domain(n)}):c===`animate`?i?this.#E(`domain`):this.#K()?(this.#a.withDomainNotificationsSuppressed(()=>{t.domain(n)}),this.zoomTo(s,500)):this.#E(`domain`):c===`notify`&&this.#E(`domain`)}get scale(){if(this.#a.scale)return this.#a.scale;throw Error(`ScaleResolution.scale accessed before initialization. Call initializeScale().`)}getScale(){if(this.#_>0)throw Error(`Scale resolution for channel "${this.channel}" cannot read its own scale while its domain is being resolved.`);return this.#a.scale??this.initializeScale()}initializeScale(){if(this.#a.scale)return this.#a.scale;let e=this.#ne();return this.#a.createScale(e)}getDomain(){if(this.#_>0)throw Error(`Scale resolution for channel "${this.channel}" cannot read its own domain while its domain is being resolved.`);return this.getScale().domain()}getDataDomain(){return this.#o.getDataDomain()}getComplexDomain(){return G_e(this.#T(),ave(this.type,this.getDomain()))}getLinkedSelectionDomainInfo(){let e=this.#k();if(!e)return;let t=this.#x.getLayoutAncestors().at(-1),n=t?lve(t,e.runtime,e.param,e.encoding).some(e=>e.param.persist!==!1):!1;return{param:e.param,encoding:e.encoding,persist:n}}isZoomed(){return this.#s.isZoomed()}isZoomable(){let e=this.#Y();return e===null||e.type===`null`?!1:kb(e.type)&&!Ab(e.type)&&!!e.zoom}zoom(e,t,n){return this.#s.zoom(e,t,n)}async zoomTo(e,t=!1){return this.#s.zoomTo(e,t)}resetZoom(){return this.#s.resetZoom()}getZoomLevel(){return this.#s.getZoomLevel()}getAxisLength(){if(this.channel!==`x`&&this.channel!==`y`)throw Error(`Axis length is only defined for x and y channels!`);let e=Array.from(this.#e).map(e=>e.view.coords?.[this.channel===`x`?`width`:`height`]).filter(e=>e>0);return e.length?e.reduce((e,t)=>Math.min(e,t),1e4):0}invertToComplex(e){let t=this.getScale();if(`invert`in t){let n=t.invert(e);return this.toComplex(n)}else throw Error(`The scale does not support inverting!`)}toComplex(e){return H_e(this.#T(),e)}fromComplex(e){return U_e(this.#T(),e)}fromComplexInterval(e){return this.type==`locus`?W_e(this.#T(),e):e}}}));function sV(...e){for(let t of e)if(t!==void 0)return t}var Hve=n((()=>{})),cV,Uve=n((()=>{z(),km(),Hve(),dB(),bS(),yC(),nV(),iV(),cV=class{#e=new Set;#t;constructor(e){this.channel=e}get scaleResolution(){return this.#e.values().next().value?.view.getScaleResolution(this.channel)}#n(e){let{view:t}=e,n=t.getScaleResolution(this.channel);if(!n)throw Error(`Cannot find a scale resolution!`);if(this.scaleResolution&&n!==this.scaleResolution)throw Error(`Shared axes must have a shared scale! Channel: ${this.channel}, existing views: [${Array.from(this.#e).map(e=>e.view.getPathString()).join(`, `)}], new view: ${t.getPathString()}.`);this.#e.add(e),hS(this,`axisProps`)}registerMember(e){return this.#a(e),this.#n(e),()=>this.removeMember(e)&&this.#e.size===0}removeMember(e){let t=this.#e.delete(e);return t&&hS(this,`axisProps`),t}hasVisibleNonChromeMember(){for(let e of this.#r())if(e.view.isVisible())return!0;return!1}getDebugState(){return{kind:`axis`,channel:this.channel,hostView:this.scaleResolution?.getDebugState().hostView??this.#t?.view??this.#e.values().next().value?.view,scaleResolution:this.scaleResolution,title:this.getTitle(),axisProps:this.getAxisProps(),hasVisibleNonChromeMember:this.hasVisibleNonChromeMember(),members:tV(this.#e).map(e=>({view:e.view,channel:e.channel,channelDef:structuredClone(e.channelDef)})),viewLevelAxisProps:this.#t?{view:this.#t.view,props:structuredClone(this.#t.props)}:void 0}}getAxisProps(){return mS(this,`axisProps`,()=>{let e;if(this.#t)e=[this.#t.props];else{let t=this.#r();if(!t.length)return null;e=t.map(e=>{let t=e.view.mark.encoding[e.channel];return`axis`in t&&t.axis})}return e.length>0&&e.some(e=>e===null)?null:lB(e.filter(e=>e!==void 0),`axis`,[`title`])})}getTitle(){if(this.#t?.props.title!==void 0)return this.#t.props.title;let e=this.#r().map(e=>{let t=Uoe(e.view,e.channel);if(!im(t))return{member:e,axisTitle:`axis`in t?t.axis?.title:void 0,explicitTitle:sV(`axis`in t?t.axis?.title:void 0,t.title),implicitTitle:sV(am(t)?t.field:void 0,dm(t)?t.expr:void 0)}}),t=e.map(e=>e.axisTitle).find(e=>e!==void 0);if(t!==void 0)return t;let n=e.filter(t=>{if(gm(t.member.channel)&&!t.explicitTitle){let n=vm(t.member.channel);return e.find(e=>e.member.view==t.member.view&&e.member.channel==n)?.explicitTitle===void 0}return!0}),r=new Set(n.map(e=>sV(e.explicitTitle,e.implicitTitle)).filter(yp));return r.size?[...r].join(`, `):null}attachViewLevelAxisProps(e,t){if(this.#t&&this.#t.view!==e){let t=rV(this.#t.view,e);if(t===`current`)return;if(t===`conflict`)throw Error(`Multiple view-level axis declarations target the same ${this.channel} axis resolution.`)}for(let e of this.#r()){let t=e.view.mark.encoding[e.channel];if(`axis`in t&&t.axis!==void 0)throw Error(`Cannot mix view-level axes.${this.channel} with encoding.${e.channel}.axis in the same axis resolution.`)}this.#t={view:e,props:t},hS(this,`axisProps`)}clearViewLevelAxisProps(e){this.#t?.view===e&&(this.#t=void 0,hS(this,`axisProps`))}getViewLevelAxisProps(){return this.#t}#r(){return tV(this.#e).filter(e=>!this.#i(e))}#i(e){return e.view.getLayoutAncestors().some(VS)}#a(e){if(!this.#t||this.#i(e))return;let t=e.view.mark.encoding[e.channel];if(`axis`in t&&t.axis!==void 0)throw Error(`Cannot mix view-level axes.${this.channel} with encoding.${e.channel}.axis in the same axis resolution.`)}}}));function lV(){let e=[];return{appendConfig(t,n){Wve(e,t,n)},appendStyle(t,n){uV(e,t,n)},merge(){return NS(e.map(e=>e.config))}}}function Wve(e,t,n){n&&(uV(e,t,Object.hasOwn(n,`style`)?n.style:void 0),e.push({kind:`config`,config:n}))}function uV(e,t,n){if(n===void 0)return;if(n===null){Gve(e);return}let r=ER(t,n);e.push({kind:`style`,config:r})}function Gve(e){for(let t=e.length-1;t>=0;t--)e[t].kind==`style`&&e.splice(t,1)}var dV=n((()=>{PS(),DR()}));function Kve(e,t,n={}){let r=e[0],i=e.slice(1),a=lV();qve(a,e,r,n.track);for(let[t,r]of i.entries()){let i=e.slice(0,t+2);fV(a,i,r,n.track),pV(a,i,r.legend)}return pV(a,e,t),a.merge()}function qve(e,t,n,r){let i=t.slice(0,1);pV(e,i,n?.legend),fV(e,i,n,r)}function fV(e,t,n,r){r&&pV(e,t,n?.legendTrack)}function pV(e,t,n){e.appendConfig(t,n)}var Jve=n((()=>{dV()}));function mV(e){let t=hV(e.channel,e.view);return!!(t&&`legend`in t&&t.legend!==void 0)}function Yve(e,t){let n=t.getMarkType();return e==`size`&&(n==`rule`||n==`link`)?`stroke`:`point`}function Xve(e){let t=hV(`x`,e),n=e.getScaleResolution(`x`)?.getResolvedScaleType();return t?.type==`index`||t?.type==`locus`||n==`index`||n==`locus`}function Zve(e,t){if([`opacity`,`fillOpacity`,`strokeOpacity`,`size`].includes(e)&&t.type==`quantitative`||(t.type===`nominal`||t.type===`ordinal`)&&vV.has(e))return`symbol`;if(t.type===`quantitative`&&yV.has(e))return`gradient`}function hV(e,t){return cm(t.getEncoding()[e])}function gV(e,t){let n=hV(e,t);return!!(n&&`legend`in n&&n.legend===null)}function _V(e,t,n){let r=hV(e,n),i=hV(t,n),a=n.getScaleResolution(e),o=n.getScaleResolution(t);return am(r)&&am(i)&&r.field===i.field&&a&&o&&Xf(a.getDomain(),o.getDomain())}function Qve(e,t){if(e!==`shape`||!am(hV(e,t)))return!1;for(let n of[`color`,`fill`,`stroke`])if(_V(n,e,t)&&!gV(n,t))return!0;return!1}function $ve(e,t){if(!ym(e))return{};let n=hV(e,t),r=hV(`shape`,t),i=t.getScaleResolution(`shape`);return am(n)&&am(r)&&i&&_V(e,`shape`,t)&&!gV(`shape`,t)?{shape:i.name??`shape`}:{}}var vV,yV,bV,eye=n((()=>{km(),Jve(),ep(),nV(),iV(),yC(),vV=new Set([`color`,`fill`,`stroke`,`opacity`,`fillOpacity`,`strokeOpacity`,`shape`,`size`]),yV=new Set([`color`,`fill`,`stroke`]),bV=class{#e=new Set;#t;constructor(e){this.channel=e}registerMember(e){return this.#r(e),this.#e.add(e),()=>this.removeMember(e)&&this.#e.size===0}removeMember(e){return this.#e.delete(e)}getLegendDefs(){let e=new Set,t=[];for(let n of tV(this.#e)){let r=this.#n(n);r&&!e.has(r.scaleResolution)&&(e.add(r.scaleResolution),t.push(r))}return t}#n(e){let{channel:t,view:n}=e;if(Qve(t,n))return;let r=hV(t,n);if(!r||im(r))return;let i=`legend`in r?r.legend:void 0;if(!this.#t&&i===null||`scale`in r&&r.scale===null)return;let a=this.#t?.props??i,o=a===void 0?void 0:{disable:!1,...a},s=n.getScaleResolution(t);if(!s)return;let c=Kve(n.getConfigScopes(),o,{track:Xve(n)});if(c.disable===!0)return;let l=Zve(t,r);if(!l)return;let u=`title`in r?r.title:void 0,d=c.title===void 0?u===void 0?am(r)?r.field:void 0:u:c.title,f=`format`in r?r.format:void 0,p=l==`symbol`?$ve(t,n):void 0,m=l==`symbol`?Yve(t,n):void 0;return{view:n,channel:t,field:am(r)?r.field:void 0,type:l,symbolChannels:p,symbolGeometry:m,legend:{...c,title:d},format:f,dataType:r.type,scaleResolution:s}}hasVisibleNonChromeMember(){for(let e of this.#e)if(e.view.isVisible()&&!e.view.getLayoutAncestors().some(VS))return!0;return!1}getDebugState(){let e=this.getLegendDefs();return{kind:`legend`,channel:this.channel,hostView:e[0]?.scaleResolution.getDebugState().hostView??this.#t?.view??this.#e.values().next().value?.view,legendDefs:e.map(e=>({...e,view:e.view,scaleResolution:e.scaleResolution,legend:structuredClone(e.legend)})),hasVisibleNonChromeMember:this.hasVisibleNonChromeMember(),members:tV(this.#e).map(e=>({view:e.view,channel:e.channel})),viewLevelLegendProps:this.#t?{view:this.#t.view,props:structuredClone(this.#t.props)}:void 0}}attachViewLevelLegendProps(e,t){if(this.#t&&this.#t.view!==e){let t=rV(this.#t.view,e);if(t===`current`)return;if(t===`conflict`)throw Error(`Multiple view-level legend declarations target the same ${this.channel} legend resolution.`)}let n=Array.from(this.#e).find(e=>mV(e));if(n)throw Error(`Cannot mix view-level legends.${this.channel} with encoding.${n.channel}.legend in the same legend resolution.`);this.#t={view:e,props:t}}clearViewLevelLegendProps(e){this.#t?.view===e&&(this.#t=void 0)}getViewLevelLegendProps(){return this.#t}#r(e){if(this.#t&&mV(e))throw Error(`Cannot mix view-level legends.${this.channel} with encoding.${e.channel}.legend in the same legend resolution.`)}}})),xV,SV,CV,wV,TV,EV,DV,OV,kV,AV,jV,tye=n((()=>{oV(),Uve(),eye(),km(),xV=(e,t,n)=>{let r=e;for(;(r.getConfiguredOrDefaultResolution(n,t)==`forced`||r.dataParent&&[`shared`,`excluded`,`forced`].includes(r.dataParent.getConfiguredOrDefaultResolution(n,t)))&&r.getConfiguredOrDefaultResolution(n,t)!=`excluded`;)r=r.dataParent;return r},SV=(e,t,n)=>{if(!t.resolutions.scale[n]){let r=new aV(n,t);t.resolutions.scale[n]=r;let i=t=>{e.context.glHelper?.createRangeTexture(t.scaleResolution,!0)};r.addEventListener(`range`,i),r.addEventListener(`domain`,i),e.registerDisposer(()=>{r.removeEventListener(`range`,i),r.removeEventListener(`domain`,i)})}return t.resolutions.scale[n]},CV=(e,t,n,r)=>{let i=cm(r);if(!i)return;let a=vm(i.resolutionChannel??n);if(xm(a)&&!(t==`axis`&&!mm(a))&&!(t==`legend`&&(mm(a)||hm(a)))&&!(t==`legend`&&e.getConfiguredOrDefaultResolution(a,t)==`excluded`))return{view:xV(e,t,a),channel:n,channelDef:i,targetChannel:a}},wV=(e,t)=>{for(let[n,r]of Object.entries(e.mark.encoding))!r||Array.isArray(r)||t(n,r)},TV=e=>{let t=[];return wV(e,(n,r)=>{let i=CV(e,`axis`,n,r);i&&mm(i.channel)&&t.push(i)}),t},EV=e=>{let t=[];for(let[n,r]of Object.entries(e.getEncoding())){if(!r||Array.isArray(r))continue;let i=CV(e,`legend`,n,r);i&&!mm(i.channel)&&t.push(i)}return t},DV=e=>{let t=new Map;return wV(e,(n,r)=>{let i=CV(e,`scale`,n,r);if(!i)return;let a=SV(e,i.view,i.targetChannel),o=t.get(a);o?o.push(i):t.set(a,[i])}),t},OV=(e,t)=>{for(let{view:n,channel:r,channelDef:i,targetChannel:a}of t){if(!mm(r)||!pm(a))continue;n.resolutions.axis[a]||(n.resolutions.axis[a]=new cV(a));let t=n.resolutions.axis[a],o=t.registerMember({view:e,channel:r,channelDef:i});e.registerDisposer(()=>{o()&&n.resolutions.axis[a]===t&&delete n.resolutions.axis[a]})}},kV=(e,t)=>{for(let{view:n,channel:r,targetChannel:i}of t){if(mm(r))continue;let t=i;n.resolutions.legend[t]||(n.resolutions.legend[t]=new bV(t));let a=n.resolutions.legend[t],o=a.registerMember({view:e,channel:r});e.registerDisposer(()=>{o()&&n.resolutions.legend[t]===a&&delete n.resolutions.legend[t]})}},AV=(e,t)=>{aV.registerInBatch(t.keys(),()=>{for(let[n,r]of t)for(let{view:t,channel:i,channelDef:a,targetChannel:o}of r){let r=o,s=!e.isDomainInert(),c=n.registerMember({view:e,channel:i,channelDef:a,contributesToDomain:s});e.registerDisposer(()=>{c()&&t.resolutions.scale[r]===n&&(n.dispose(),delete t.resolutions.scale[r])})}})},jV=(e,t)=>{if(!t){jV(e,`scale`),jV(e,`axis`);return}t==`axis`?OV(e,TV(e)):t==`legend`?kV(e,EV(e)):AV(e,DV(e))}}));function nye(e,t,n){return!t.isDomainDefinedExplicitly()&&n.has(vm(e.scaleChannel))}var MV,NV,PV=n((()=>{c_e(),v_e(),S_e(),k_e(),N_e(),L_e(),km(),em(),tC(),Ig(),zz(),Gp(),Cg(),Kp(),Rp(),tye(),MV={point:lz,rect:BR,arrow:tz,rule:vz,tick:vz,link:wz,text:Fz},NV=class extends $S{#e;#t=!1;#n=null;constructor(e,t,n,r,i,a){super(e,t,n,r,i,a),this.spec=e;let o=MV[this.getMarkType()];if(o)this.mark=new o(this);else throw Error(`No such mark: ${this.getMarkType()}`);this.#e=this.paramRuntime.allocateSetter(`zoomLevel`,1),this.resolve();for(let e of[`x`,`y`]){let t=this.getScaleResolution(e);if(t){let e=()=>{this.#e(Math.sqrt(this.getZoomLevel()))};t.addEventListener(`domain`,e),this.registerDisposer(()=>t.removeEventListener(`domain`,e))}}this.registerDisposer(this._addBroadcastHandler(`subtreeDataReady`,()=>{for(let e of Cm)this.getScaleResolution(e)?.syncLinkedSelectionFromDomain()})),this.needsAxes={x:!0,y:!0},this.#r()}#r(){for(let[e,t]of this.paramRuntime.paramConfigs){if(!(`select`in t))continue;let n=jg(t.select),r=n.on,i=n.clear;if(Mg(n)){let t=0,a=t=>{this.paramRuntime.setValue(e,t)},o=()=>{let e=this.context.getCurrentHover();return e?.mark?.unitView===this?e.datum:null},s=xg(r);if(this.addInteractionListener([`mouseover`,`pointerover`].includes(r.type)?`mousemove`:r.type,r=>{if(!s(r.proxiedMouseEvent))return;let i=o(),c=i?i[Vp]:0,l;n.toggle?r.mouseEvent.shiftKey?i&&(l=Lse(this.paramRuntime.getValue(e),{toggle:[i]})):l=Tg(i?[i]:null):c!=t&&(t=c,l=wg(i)),l!==void 0&&a(l)}),i){let e=xg(i);this.addInteractionListener(i.type,r=>{if(!e(r.proxiedMouseEvent))return;t=0;let i=n.toggle?Tg():wg(null);a(i)})}}}}render(e,t,n={}){super.render(e,t,n),this.isConfiguredVisible()&&(e.pushView(this,t),e.renderMark(this.mark,n),e.popView(this))}getMarkType(){return typeof this.spec.mark==`object`?this.spec.mark.type:this.spec.mark}getEncoding(){let e=super.getEncoding(),t=this.mark.getSupportedChannels();for(let n of Object.keys(e))n!==`key`&&(t.includes(n)||delete e[n]);return e}resolve(e){if(!e){this.resolve(`scale`),this.resolve(`axis`),this.resolve(`legend`);return}jV(this,e)}dispose(){super.dispose(),this.mark.dispose()}getDataAccessor(e){let t=this.mark.encoders;if(t)return t[e]?nm(t[e]):void 0}getSearchAccessors(){if(!this.#n){let e=Lz(this.getEncoding())??[];this.#n=e.map(e=>B(e))}return this.#n}getFacetAccessor(e){return this.getDataAccessor(`sample`)||super.getFacetAccessor(this)}getCollector(){return this.flowHandle?.collector}registerDomainSubscriptions(){if(this.#t||this.isDomainInert())return;let e=this.getCollector();if(!e)return;let t=this.mark.encoders;if(!t)throw Error(`Encoders are not initialized!`);this.#t=!0;let n=Noe(e),r=new Map;for(let e of Object.values(t)){if(!e)continue;let t=tm(e);if(t.length!==0)for(let e of t){if(!Jp(e))continue;let t=this.getScaleResolution(e.scaleChannel);if(!t)throw Error(`Missing scale resolution for channel: `+e.scaleChannel);if(e.channelDef.domainInert||nye(e,t,n))continue;let i=r.get(t);i||(i=new Set,r.set(t,i)),i.add(e)}}for(let[t,n]of r){if(n.size===0)continue;let r=t.registerCollectorSubscriptions(e,n);this.registerDisposer(r)}}getZoomLevel(){return Cm.map(e=>this.getScaleResolution(e)?.getZoomLevel()??1).reduce((e,t)=>e*t,1)}propagateInteraction(e){this.handleInteraction(e,!0),e.target=this,!e.stopped&&this.handleInteraction(e,!1)}getDefaultResolution(e,t){return e==`x`?`shared`:`independent`}}}));async function FV(e,t={}){let n;try{n=await fetch(e,{signal:t.signal})}catch(e){throw new IV(`network`,String(e))}if(!n.ok)throw new IV(`http`,String(n.status)+` `+n.statusText);try{return await n.json()}catch(e){throw new IV(`json`,String(e))}}var IV,LV=n((()=>{IV=class extends Error{constructor(e,t){super(t),this.kind=e}}}));function RV(e){let t=new Set;e.visit(e=>{for(let n of Object.values(e.resolutions.scale)){let e=n.name;if(e&&t.has(e))throw Error(`The same scale name "${e}" occurs in multiple scale resolutions!`);t.add(e)}})}function rye(e){for(let t of Cm){let n=e.getScaleResolution(t);n&&!n.name&&n.isZoomable()&&(n.name=`${t}_at_root`)}}function zV(e,t=()=>!0){return Promise.allSettled(e).then(e=>{if(t())for(let t of e)`value`in t?t.value.finalizeGraphicsInitialization():`reason`in t&&console.error(t.reason)})}function iye(e){let t=[];return e.visit(e=>{if(e instanceof NV){let n=e.getEncoding(),r=(n,i)=>{if(!(!i||typeof i!=`object`||Array.isArray(i))&&(am(i)&&`type`in i?t.push({view:e,channel:n,field:i.field,type:i.type}):am(i)&&n===`semanticScore`&&t.push({view:e,channel:n,field:i.field,type:`quantitative`}),`condition`in i)){let{condition:e}=i;if(Array.isArray(e))for(let t of e)r(n,t);else r(n,e)}};for(let[e,t]of Object.entries(n))r(e,t);return XS}}),t}async function aye(e,t,n){let r=e.import;if(!(`url`in r))throw Error(`Not an url import: `+JSON.stringify(r));let i=xS(t,r.url),a;try{a=await FV(i)}catch(e){throw Error(`Could not load imported view spec: ${i}. Reason: ${e.message}`,{cause:e})}if(n.isViewSpec(a))return a.baseUrl=xS(CS(r.url),a.baseUrl),a;throw Error(`The imported spec "${i}" is not a view spec: ${JSON.stringify(e)}`)}function oye(e){let t=e.getSize(),n=e.getPadding(),r=(e,t)=>e.grow>0?void 0:e.px+t;return{width:r(t.width,n.horizontalTotal),height:r(t.height,n.verticalTotal)}}var BV=n((()=>{z(),PV(),tC(),km(),TS(),LV()}));function*VV(e,t=[]){for(let[n,r]of e.entries())if(r instanceof Map)for(let e of VV(r,[...t,n]))yield e;else yield[[...t,n],r]}var HV=n((()=>{}));function sye(e){for(let t=1;t<e.length;t++)if(e[t]<e[t-1])return!1;return!0}function UV(e){let t=0;for(let n=0,r=e.length;n<r;n++)e[n]>t&&(t=e[n]);return Math.floor(Math.log2(t)/4)+1}function cye(e){let t=UV(e),n=Array.from({length:e.length},(e,t)=>t);if(sye(e))return n;let r=Array(e.length),i=Array(16);for(let a=0;a<t;a++){i.fill(0);let t=a*4,o=16**a,s=r=>{let i=e[n[r]];return a>=GV?i>WV?Math.floor(i/o)%16:0:i>>t&15};for(let t=0;t<e.length;t++)i[s(t)]++;for(let e=1;e<16;e++)i[e]+=i[e-1];for(let t=e.length-1;t>=0;t--)r[--i[s(t)]]=n[t];[n,r]=[r,n]}return n}var WV,GV,lye=n((()=>{WV=2147483647,GV=UV([WV])}));function KV(e,t){if(e===void 0)throw Error(`Key field "${t}" is undefined. Ensure all key fields are present in the data.`);if(e===null)throw Error(`Key field "${t}" is null. Ensure all key fields are present in the data.`);if(typeof e!=`string`&&typeof e!=`number`&&typeof e!=`boolean`)throw Error(`Key field "${t}" must be a scalar value (string, number, or boolean).`);return e}function uye(e){if(!(e.indexOf(YV)!==-1||e.indexOf(JV)!==-1))return e;let t=``;for(let n=0;n<e.length;n++){let r=e[n];(r===YV||r===JV)&&(t+=YV),t+=r}return t}function qV(e){return typeof e==`string`?uye(e):String(e)}var JV,YV,XV,dye=n((()=>{Kp(),JV=`|`,YV=`\\`,XV=class{#e=null;#t=null;#n=!1;invalidate(){this.#e=null,this.#t=null,this.#n=!1}findDatum(e,t,n){if(!e||e.length===0)return;let r=e.join(`, `);if(e.length!==t.length)throw Error(`Key tuple length ${t.length} does not match fields [${r}]`);(!this.#e||!this.#i(e))&&this.#r(e,n);let i=this.#t,a;if(this.#n){let e=``;for(let n=0;n<t.length;n++){n>0&&(e+=JV);let r=i[n],a=KV(t[n],r);e+=qV(a)}a=e}else{let e=i[0];a=KV(t[0],e)}return this.#e.get(a)}#r(e,t){let n=e.map(e=>B(e)),r=new Map,i=e.join(`, `),a=e.length!==1;if(a)for(let a of t)for(let t=0,o=a.length;t<o;t++){let o=a[t],s=``;for(let t=0;t<n.length;t++){t>0&&(s+=JV);let r=e[t],i=KV(n[t](o),r);s+=qV(i)}if(r.get(s)!==void 0){let e=n.map(e=>e(o));throw Error(`Duplicate key detected for fields [${i}]: ${JSON.stringify(e)}`)}r.set(s,o)}else{let a=n[0],o=e[0];for(let e of t)for(let t=0,n=e.length;t<n;t++){let n=e[t],s=KV(a(n),o);if(r.get(s)!==void 0)throw Error(`Duplicate key detected for fields [${i}]: ${JSON.stringify(s)}`);r.set(s,n)}}this.#e=r,this.#t=[...e],this.#n=a}#i(e){if(!this.#t||this.#t.length!==e.length)return!1;for(let t=0;t<e.length;t++)if(this.#t[t]!==e[t])return!1;return!0}}}));function fye(e){return{[Symbol.iterator]:function*(){for(let t of e)yield*t}}}function pye(e,t){return t.length>1?At(e,...t):mye(e,t[0])}function mye(e,t){let n=new Map;for(let r of e){let e=t(r),i=n.get(e);i||(i=[],n.set(e,i)),i.push(r)}return n}function hye(e){if(e?.field){let t=Zf(e.field);if(t.length==1&&!t[0].includes(`.`)){let n=Zf(e.order)[0]??`ascending`,r=JSON.stringify(t[0]);return Function(`a`,`b`,`return ${n===`ascending`?`a[${r}] - b[${r}]`:`b[${r}] - a[${r}]`};`)}return gp(e.field,e.order)}}var ZV,QV,$V=n((()=>{Dt(),ln(),z(),HV(),Rp(),Kp(),ep(),lye(),Gp(),WB(),dye(),ZV=class extends Lp{#e=[];#t=B(Vp);#n=[];#r=new XV;#i;#a;#o=new QV;get behavior(){return 4}get label(){return`collect`}constructor(e){super(),this.params=e??{type:`collect`},this.observers=new Set,this.facetBatches=new Et([],JSON.stringify),this.#a=hye(this.params?.sort),this.#s()}#s(){this.#e=[],this.#n=[],this.#r.invalidate(),this.facetBatches.clear(),this.facetBatches.set(void 0,this.#e)}reset(){super.reset(),this.#s()}handle(e){this.#e.push(e)}beginBatch(e){this.#r.invalidate(),Foe(e)&&(this.#e=[],this.facetBatches.set(Zf(e.facetId),this.#e))}complete(){if(this.#e=[],this.params.groupby?.length){let e=this.params.groupby.map(e=>B(e)),t=pye(this.facetBatches.size>1?fye(this.facetBatches.values()):this.facetBatches.get(void 0),e);this.facetBatches.clear();for(let[e,n]of VV(t))this.facetBatches.set(e,n)}if(this.#a)for(let e of this.facetBatches.values())e.sort(this.#a);this.#f(),this.#c(),super.complete(),this.#d(),this.#l()}observe(e){return this.observers.add(e),()=>{this.observers.delete(e)}}#c(){if(this.children.length)for(let[e,t]of this.facetBatches.entries()){if(e){let t={type:`facet`,facetId:e};for(let e of this.children)e.beginBatch(t)}for(let e=0,n=t.length;e<n;e++)this._propagate(t[e])}}repropagate(){for(let e of this.children)e.reset();this.#c();for(let e of this.children)e.complete();this.#d(),this.#l()}#l(){for(let e of this.observers)e(this)}getDomain(e,t,n){return this.#o.getDomain(e,()=>{let e=LB(t);if(n.constant)e.extend(n({}));else if(this.completed)for(let t of this.facetBatches.values())for(let r=0,i=t.length;r<i;r++)e.extend(n(t[r]));return e})}subscribeDomainChanges(e,t){return this.#o.subscribe(e,t)}getData(){switch(this.#u(),this.facetBatches.size){case 0:return[];case 1:return[...this.facetBatches.values()][0];default:{let e=this.facetBatches;return{[Symbol.iterator]:function*(){for(let t of e.values())yield*t}}}}}visitData(e){this.#u();for(let t of this.facetBatches.values())for(let n=0;n<t.length;n++)e(t[n])}getItemCount(){let e=0;for(let t of this.facetBatches.values())e+=t.length;return e}#u(){if(!this.completed)throw Error(`Data propagation is not completed! No data are available.`)}#d(){this.#o.hasCachedDomains()&&this.#o.clear(),this.#o.notify()}#f(){this.#i=[];let e=this.facetBatches.values().next().value?.[0];if(e==null||!(`_uniqueId`in e))return;let t=0,n=[],r=this.#t;for(let[e,i]of this.facetBatches){this.#i.push({start:t,stop:t+i.length,facetId:e}),t+=i.length;for(let e=0,t=i.length;e<t;e++)n.push(r(i[e]))}this.#n=cye(n)}findDatumByUniqueId(e){if(!this.#n.length)return;let t=pt(e=>e.start).right,n=this.#t,r=pt(e=>n(i(e))).left,i=e=>{let n=t(this.#i,e),r=this.#i[n-1];if(!(!r||e>=r.stop))return this.facetBatches.get(r.facetId)[e-r.start]},a=r(this.#n,e);if(a>=0){let t=i(this.#n[a]);if(t&&n(t)===e)return t}}findDatumByKey(e,t){return this.#u(),this.#r.findDatum(e,t,this.facetBatches.values())}},QV=class{#e=new Map;#t=new Map;hasCachedDomains(){return this.#e.size>0}clear(){this.#e.clear()}getDomain(e,t){let n=this.#e.get(e);if(n)return n;{let n=t();return this.#e.set(e,n),n}}subscribe(e,t){let n=this.#t.get(e);return n||(n=new Set,this.#t.set(e,n)),n.add(t),()=>{let n=this.#t.get(e);n&&(n.delete(t),n.size===0&&this.#t.delete(e))}}notify(){if(this.#t.size===0)return;let e=new Set;for(let t of this.#t.values())for(let n of t)e.add(n);for(let t of e)t()}}}));function gye(e,t={}){return tH(nH(e,t.copyFields?new Set(t.copyFields):void 0))}function eH(e={}){let t=e.copyFields?new Set(e.copyFields):void 0,n,r=(e=>(n||=tH(nH(e,t)),n(e)));return r.reset=()=>{n=void 0},r}function tH(e){let t=Function(`source`,`return { `+e.map(e=>JSON.stringify(e)).map(e=>`${e}: source[${e}]`).join(`,
|
|
3158
|
+
chrM 16299`}}));function z_e(e){return $e(e).map(([e,t])=>({name:e,size:parseInt(t)}))}function Xz(e){return ap(e)&&`chrom`in e}function Zz(e){return e.every(Xz)}function Qz(e){return Zz(e)&&(e[1]??e[0]).pos!==void 0}function $z(e){return ap(e)&&(`name`in e||eB(e)||tB(e))}function eB(e){return $z(e)&&`url`in e}function tB(e){return $z(e)&&`contigs`in e}var nB,rB=n((()=>{ln(),tt(),z(),Kz(),Yz(),TS(),nB=class{constructor(e){if(this.config={name:`custom`,...e},`baseUrl`in e)throw Error("The `baseUrl` property in genome config has been removed in GenomeSpy v0.52.0. Use `url` instead. See https://genomespy.app/docs/grammar/genomic-coordinates/.");if(!$z(e))throw Error(`Not a genome configuration: `+JSON.stringify(e));if(this.chromosomes=[],this.cumulativeChromPositions=new Map,this.chromosomesByName=new Map,this.startByIndex=[],this.totalSize=0,tB(this.config))this.setChromSizes(this.config.contigs);else if(!eB(this.config)){let e=qz(this.config.name);if(e)this.setChromSizes(e);else throw Error(`Unknown genome: ${this.config.name}. Please provide contigs or a URL. See https://genomespy.app/docs/grammar/genomic-coordinates/.`)}}get name(){return this.config.name}async load(e){if(eB(this.config))try{let t=xS(e,this.config.url),n=await fetch(t);if(!n.ok)throw Error(`${n.status} ${n.statusText}`);this.setChromSizes(z_e(await n.text()))}catch(e){throw Error(`Could not load chrom sizes: ${this.config.url}. Reason: ${e.message}`,{cause:e})}}hasChrPrefix(){return this.chromosomes.some(e=>e.name.startsWith(`chr`))}setChromSizes(e){this.chromosomes=[],this.cumulativeChromPositions=new Map,this.chromosomesByName=new Map;let t=0;this.startByIndex=[0];for(let n=0;n<e.length;n++){this.startByIndex.push(t);let r=e[n].size,i={...e[n],continuousStart:t,continuousEnd:t+r,continuousInterval:[t,t+r],index:n,number:n+1,odd:!(n&1)};this.chromosomes.push(i);let a=i.name.replace(/^chr/i,``);for(let e of[`chr`+a,`CHR`+a,`Chr`+a,i.number,``+i.number,a,i.name])this.cumulativeChromPositions.set(e,t),this.chromosomesByName.set(e,i);t+=i.size}this.totalSize=t}getExtent(){return[0,this.totalSize]}toContinuous(e,t){let n=this.cumulativeChromPositions.get(e);if(n===void 0)throw Error(`Unknown chromosome/contig: `+e);return n+ +t}toChromosome(e){if(e>this.totalSize)return;e=Math.floor(e);let t=vt(this.startByIndex,e)-1;if(t>0&&t<=this.chromosomes.length)return this.chromosomes[t-1]}toChromosomal(e){let t=this.toChromosome(e);if(t)return{chrom:t.name,pos:Math.floor(e)-t.continuousStart}}getChromosome(e){return this.chromosomesByName.get(e)}formatInterval(e){return R_e(...this.toChromosomalInterval(e))}formatLocus(e){let t=this.toChromosomal(e);if(t)return Uz(t)}toChromosomalInterval(e){let t=this.toChromosomal(e[0]+.5),n=this.toChromosomal(e[1]-.5);return n.pos+=1,[t,n]}toContinuousInterval(e){let[t,n]=e;return n||=t,[this.toContinuous(t.chrom,t.pos??0),this.toContinuous(n.chrom,n.pos??this.chromosomesByName.get(n.chrom)?.size)]}toDiscreteChromosomeIntervals(e){let t=e[0],n=e[1],r=[];if(t.chrom===n.chrom)r.push({chrom:t.chrom,startPos:t.pos,endPos:n.pos});else{let e=this.chromosomes.findIndex(e=>e.name===t.chrom),i=this.chromosomes.findIndex(e=>e.name===n.chrom);r.push({chrom:t.chrom,startPos:t.pos,endPos:this.chromosomes[e].size});for(let t=e+1;t<i;t++)r.push({chrom:this.chromosomes[t].name,startPos:0,endPos:this.chromosomes[t].size});r.push({chrom:n.chrom,startPos:0,endPos:n.pos})}return r}continuousToDiscreteChromosomeIntervals(e){return this.toDiscreteChromosomeIntervals([this.toChromosomal(e[0]),this.toChromosomal(e[1])])}parseInterval(e){let t=e.match(/^(chr[0-9A-Z]+)(?::([0-9,]+)(?:-(?:(chr[0-9A-Z]+):)?([0-9,]+))?)?$/);if(t){let e=t[1];if(t.slice(2).every(e=>e===void 0)){let t=this.getChromosome(e);return t?[t.continuousStart,t.continuousEnd]:void 0}let n=t[3]||e,r=parseInt(t[2].replace(/,/g,``)),i=t[4]===void 0?r:parseInt(t[4].replace(/,/g,``));return[this.toContinuous(e,r-1),this.toContinuous(n,i)]}}}}));function B_e(){let e=Bz().numberingOffset(1),t;e.genome=function(n){return arguments.length?(t=n,e):t},e.ticks=n=>{if(!t)return[];let r=e.domain(),i=r[1]-r[0],a=e.numberingOffset(),o=t.toChromosome(Math.max(r[0],0)),s=t.toChromosome(Math.min(r[1],t.totalSize-1)),c=Math.max(1,Math.min(n??10,Math.floor(i))),l=Ht(r[0],r[1],c);l<aB&&(l=Ht(r[0],r[1],c*oB)),l=Math.max(1,l);let u=[];for(let e=o.index;e<=s.index;e++){let n=t.chromosomes[e],i=Math.max(n.continuousStart+l,r[0]-(r[0]-n.continuousStart)%l),o=Math.min(n.continuousEnd-l/4,r[1]+1);for(let e=i;e<=o;e+=l){let t=e-a;t>=r[0]&&t<r[1]&&u.push(t)}}return u},e.tickFormat=(n,r)=>{if(!t)return;if(r)throw Error(`Locus scale's tickFormat does not support a specifier!`);let i=e.domain(),a=i[1]-i[0],o=e.numberingOffset(),s=Ht(i[0],i[1],Math.max(1,Math.min(n??10,Math.floor(a))))<aB?Dn(`,`):Dn(`.3s`),c=e=>e-t.toChromosome(e).continuousStart;return e=>s(c(e)+o)};let n=e.copy;return e.copy=()=>{let e=n(),r=t;return e.genome=function(t){return arguments.length?(r=t,e):r},e.genome(t)},e}function V_e(e){return e.type==`locus`}function H_e(e,t){let n=iB(e);return n?n.toChromosomal(t):t}function U_e(e,t){let n=iB(e);return n&&Xz(t)?n.toContinuous(t.chrom,t.pos):t}function W_e(e,t){let n=iB(e);return n&&Zz(t)?n.toContinuousInterval(t):t}function G_e(e,t){let n=iB(e);return n?n.toChromosomalInterval(t):t}function K_e(e){let t=iB(e);if(!t)throw Error(`No genome has been defined!`);return t.getExtent()}function iB(e){if(e&&`toChromosomal`in e)return e;if(e&&`genome`in e)return e.genome()}var aB,oB,sB=n((()=>{ln(),Mn(),Hz(),rB(),aB=1e6,oB=.65}));function q_e(e,{onRangeChange:t,onDomainChange:n,range:r,domain:i}){typeof r==`function`&&(e.range=(function(e){if(arguments.length)r(e),t?.();else return r()})),typeof i==`function`&&(e.domain=(function(e){if(arguments.length)i(e),n?.();else return i()}))}function J_e({range:e,reverse:t,createExpression:n,registerExpr:r}){if(!e||!Ep(e))return null;let i=(e,t)=>t?e.slice().reverse():e;if(e.some(U)){let a;return{dynamic:!0,evaluate:()=>i(a.map(e=>e()),t),setup:t=>{a=e.map(e=>{if(U(e)){let i=n(e.expr);return i.subscribe(t),r(i),()=>i(null)}return()=>e})}}}return{dynamic:!1,values:i(e,t)}}var cB,Y_e=n((()=>{z(),xC(),W(),sB(),cB=class{#e;#t=new Set;#n;#r;#i;#a;#o=0;constructor({getParamRuntime:e,onRangeChange:t,onDomainChange:n,getGenomeStore:r}){this.#n=e,this.#r=t,this.#i=n,this.#a=r}get scale(){return this.#e}resetScale(){this.dispose(),this.#e=void 0}getLocusGenome(e){let t=this.#a?.();if(!t)throw Error(`No genome has been defined!`);return e?t.getGenome(e):t.getGenome()}createScale(e){let t=Fue({...this.#c(e),range:void 0});return t.props=e,`unknown`in t&&t.unknown(null),this.#e=t,this.#s(e),this.#l(),this.#u(),this.#e}#s(e){let t=this.#e;!t||!V_e(t)||t.genome(this.getLocusGenome(e.assembly))}reconfigureScale(e){let t=this.#e;!t||t.type==`null`||(Pue({...this.#c(e),range:void 0},t),t.props=e,this.#l())}withDomainNotificationsSuppressed(e){this.#o+=1;try{e()}finally{--this.#o}}#c(e){let{assembly:t,domainIndexer:n,__rangeExprScope:r,...i}=e;return i}#l(){let e=this.#e;if(!e)return;let t=e.props;this.#t.forEach(e=>e.invalidate()),this.#t.clear();let n=t.__rangeExprScope?.paramRuntime??this.#n(),r=J_e({range:t.range,reverse:t.reverse,createExpression:e=>n.createExpression(e),registerExpr:e=>this.#t.add(e)});if(!r)return;if(`values`in r){e.range(r.values);return}let i=()=>e.range(r.evaluate());r.setup(i),i()}#u(){let e=this.#e;if(!e)return;let t=e.range,n=e.domain,r=()=>this.#r?.();q_e(e,{onRangeChange:r,onDomainChange:()=>{this.#o>0||this.#i?.()},range:t,domain:n}),r()}dispose(){this.#t.forEach(e=>e.invalidate()),this.#t.clear()}}}));function lB(e,t,n){if(n||=[],e.some(e=>e===null)){if(e.every(e=>e===null))return null;throw console.warn(e),Error(`Cannot merge objects with nulls!`)}let r={},i=(e,t)=>e===t||uB(e)&&uB(t)||uB(e)&&t===!0||e===!0&&ap(t)||Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((e,n)=>e===t[n]),a=e=>{for(let a in e){let o=e[a];if(!n.includes(a)&&o!==void 0)if(r[a]!==void 0&&!i(r[a],o))console.warn(`Conflicting property ${a} of ${t}: (${JSON.stringify(r[a])} and ${JSON.stringify(e[a])}). Using ${JSON.stringify(r[a])}.`);else{let e=r[a];if(uB(e))uB(o)&&(r[a]=lB([e,o],a));else if(uB(o)){if(!(e===!0||e===void 0))throw Error(`Bug in merge! Target is: `+e);r[a]=lB([{},o],a)}else r[a]=o}}};for(let t of e)a(t);return r}function uB(e){return ap(e)&&!Array.isArray(e)}var dB=n((()=>{z()}));function fB(e){return typeof e==`string`||typeof e==`object`&&!!e}function pB(e){return vB.has(e)}function X_e(e,t){if(pB(t))return hB(e)[t]}function Z_e(e){if([`nominal`,`ordinal`,`quantitative`,`index`,`locus`].includes(e))return e}function Q_e(e){if(!e)return{};let t={...e};for(let e of[`nominal`,`ordinal`,`quantitative`,`index`,`locus`,`nominalColorScheme`,`ordinalColorScheme`,`quantitativeColorScheme`,`indexColorScheme`,`locusColorScheme`])delete t[e];return t}function mB(e,t){let n=Z_e(t);return NS(e.flatMap(e=>{let t=e.scale;return[t,t&&n?t[n]:void 0]}))}function hB(e){return NS(e.map(e=>e.range))}function $_e(e,{channel:t,dataType:n,isExplicitDomain:r,markTypes:i,hasDomainMid:a}){let o=mB(e,n),s=hB(e),c={...Q_e(o)};if(r?c.zero=!1:c.zero===void 0&&o.zero!==void 0&&(c.zero=o.zero),mm(t)&&c.nice===void 0&&(c.nice=o.nice===void 0?!r:o.nice),ym(t)&&c.scheme===void 0)if(n==`quantitative`){let e=a||o.domainMid!==void 0?s.diverging:i?.length&&i.every(e=>_B.has(e))?s.heatmap:s.ramp,t=fB(e)?e:o.quantitativeColorScheme;fB(t)&&(c.scheme=t)}else{let e=o[gB[n]??gB.quantitative];fB(e)&&(c.scheme=e)}else bm(t)&&c.range===void 0?t==`shape`?c.range=s.shape??[]:t==`direction`?c.range=[`forward`,`reverse`]:c.range=[]:t==`size`&&c.range===void 0?c.range=s.size:t==`angle`&&c.range===void 0&&(c.range=s.angle);return c}var gB,_B,vB,eve=n((()=>{km(),PS(),gB={nominal:`nominalColorScheme`,ordinal:`ordinalColorScheme`,quantitative:`quantitativeColorScheme`},_B=new Set([`rect`]),vB=new Set([`shape`,`size`,`angle`,`heatmap`,`ramp`,`diverging`])}));function yB(e,t){return U(e)?t.createExpression(e.expr)():Array.isArray(e)?e.map(e=>yB(e,t)):e}function bB(e){return U(e)?[e]:Array.isArray(e)?e.flatMap(e=>bB(e)):[]}var xB=n((()=>{W()})),SB,CB,wB,TB=n((()=>{SB=`quantitative`,CB=`ordinal`,wB=`nominal`}));function tve(e,t){if(t==`index`||t==`locus`){if(pm(e))return t;throw Error(e+` does not support `+t+` data type. Only positional channels do.`)}let n={x:[`band`,`band`,`linear`],y:[`band`,`band`,`linear`],xOffset:[`band`,`band`,`linear`],yOffset:[`band`,`band`,`linear`],size:[void 0,`point`,`linear`],opacity:[void 0,`point`,`linear`],fillOpacity:[void 0,`point`,`linear`],strokeOpacity:[void 0,`point`,`linear`],color:[`ordinal`,`ordinal`,`linear`],fill:[`ordinal`,`ordinal`,`linear`],stroke:[`ordinal`,`ordinal`,`linear`],strokeWidth:[void 0,void 0,`linear`],shape:[`ordinal`,`ordinal`,void 0],dx:[void 0,void 0,`null`],dy:[void 0,void 0,`null`],angle:[void 0,void 0,`linear`],sample:[`null`,void 0,void 0]},r=[`sample`].includes(e)?`null`:n[e]?n[e][[wB,CB,SB].indexOf(t)]:t==`quantitative`?`linear`:`ordinal`;if(r===void 0)throw Error(`Channel "`+e+`" is not compatible with "`+t+`" data type. Use of a proper scale may be needed.`);return r}function EB(e,t,n,r){if(n){if([`index`,`locus`].includes(n)&&!pm(e))throw Error(`Index and locus scales are only supported on positional channels (x/y). Channel "${e}" resolves to scale type "${n}".`);if([`index`,`locus`].includes(t)&&n!==t||n===`locus`&&n!==t)throw Error(`${r} "${n}" is incompatible with "${t}" data.`)}}function nve(e,t){mm(t)&&e.type!==`ordinal`&&(e.range=[0,1]),t==`opacity`&&kb(e.type)&&e.clamp===void 0&&(e.clamp=!0)}var DB=n((()=>{dx(),km(),TB()}));function rve({channel:e,dataType:t,orderedMembers:n,viewLevelScaleProps:r,isExplicitDomain:i,configScopes:a}){let o=n,s=o.map(e=>typeof e.view.getMarkType==`function`?e.view.getMarkType():void 0).filter(e=>!!e),c=lB(r?[r.props]:o.map(e=>e.channelDef.scale).filter(e=>e!==void 0),`scale`,[`domain`]);if(c===null||c.type==`null`)return{type:`null`};let l={...$_e(a,{channel:e,dataType:t,isExplicitDomain:i,markTypes:s,hasDomainMid:c.domainMid!==void 0}),...c};if(l.type||=tve(e,t),pm(e)&&o.some(t=>lm(t.view.getEncoding()[Goe(e)]))&&l.type==`band`&&l.padding===void 0&&(l.paddingInner??=.2,l.paddingOuter??=.2),EB(e,t,r?l.type:void 0,`View-level scales.${e}.type`),typeof l.range==`string`){if(!pB(l.range))throw Error(`Unknown named scale range "`+l.range+`". Supported names: shape, size, angle, heatmap, ramp, diverging.`);let t=X_e(a,l.range);if(t===void 0)throw Error(`Named scale range "`+l.range+`" is not configured in config.range.`);ym(e)&&(typeof t==`string`||typeof t==`object`&&t&&!Array.isArray(t))?(l.scheme=t,delete l.range):l.range=t}if(e==`y`&&Ab(l.type)&&l.reverse==null&&(l.reverse=!0),hm(e)&&Ab(l.type)&&!l.range){let t=e==`xOffset`?`x`:`y`,n=o[0]?.view,r=n?.getScaleResolution(t);r?.getResolvedScaleType()==`band`&&(r.getScale(),l.range=[0,{expr:`bandwidth("${t}") * ${t==`x`?`width`:`height`}`}],l.__rangeExprScope=n)}if(l.range&&l.scheme&&delete l.scheme,l.domainTransition===void 0&&(l.domainTransition=!(o.some(e=>bB(e.channelDef.scale?.domain).length>0)||bB(r?.props.domain).length>0)),Array.isArray(l.range)&&l.range.some(U)&&o.length>0){let e=r?.props.range===void 0?o.find(e=>e.channelDef.scale?.range!==void 0)?.view:r.view;e&&(l.__rangeExprScope=e)}if(!(`zoom`in l)){let e=mB(a,t);e.zoom===void 0?[`index`,`locus`].includes(l.type)&&(l.zoom=!0):l.zoom=e.zoom}return nve(l,e),l}var ive=n((()=>{dx(),km(),W(),dB(),eve(),xB(),DB(),TB()}));function OB(e){return e===`index`||e===`locus`}function kB(e,t){return OB(e)?jB(t):t}function ave(e,t){return OB(e)?ove(t):t}function AB(e,t){return t&&OB(e)?jB(t):t}function jB(e){return[e[0],e[1]+MB(e)]}function ove(e){return[e[0],e[1]-MB(e)]}function MB(e){return e[1]>=e[0]?1:-1}var NB=n((()=>{TB()}));function sve(e,t){let n=e.findRuntimeForParam(t);if(!n)throw Error(`Selection domain parameter "${t}" was not found.`);return n}function PB(e,t){if(e){if(!Og(e))throw Error(`Selection domain parameter "${t}" must be an interval selection.`);return e}}function cve(e,t,n){let r=e.paramRuntime.findRuntimeForParam?sve(e.paramRuntime,t):e.paramRuntime;return{runtime:r,selection:PB(r.getValue?r.getValue(t):e.paramRuntime.findValue(t),t)}}function lve(e,t,n,r){let i=[];return e.visit(e=>{let a=e.paramRuntime?.paramConfigs?.get(n);if(!a||!Vg(a))return;let o=jg(a.select);!Ng(o)||!o.encodings?.includes(r)||e.paramRuntime.findRuntimeForParam(n)===t&&i.push({view:e,param:a})}),i}function uve(e,t,n,r){let i=new Set,a=[e.getLayoutAncestors?.(),e.getDataAncestors?.(),[e]];for(let e of a)for(let a of e??[]){if(!a||i.has(a))continue;i.add(a);let e=a.paramRuntime?.paramConfigs?.get(n);if(!e||!Vg(e))continue;let o=jg(e.select);if(!(!Ng(o)||!o.encodings?.includes(r))&&a.paramRuntime.findRuntimeForParam?.(n)===t)return!0}return!1}function FB(e,t,n={}){if(!e||e.length!==2)return;let r=Number(e[0]),i=Number(e[1]);if(!Number.isFinite(r)||!Number.isFinite(i))return;let a=Math.min(r,i),o=Math.max(r,i);if(a=Math.max(t[0],a),o=Math.min(t[1],o),!(a>o)&&!(n.roundToIntegers&&(a=Math.ceil(a),o=Math.ceil(o),a=Math.max(t[0],a),o=Math.min(t[1],o),a>o)))return[a,o]}var IB=n((()=>{W(),Ig()}));function LB(e,t){if(e==`quantitative`&&dve(t)){let n=new HB(t);return n.type=e,n}else if(UB[e]){let n=new UB[e];return n.type=e,t&&n.extendAll(t),n}throw Error(`Unknown type: `+e)}function dve(e){return e&&e.length>0&&e.length!=2&&e.every(e=>typeof e==`number`)}var RB,zB,BB,VB,HB,UB,WB=n((()=>{RB=class e extends Array{constructor(){super(),this.type=void 0}extend(e){return this}extendAll(t){if(t instanceof e&&t.type!=this.type)throw Error(`Cannot combine different types of domains: ${this.type} and ${t.type}`);for(let e of t)this.extend(e);return this}extendAllWithAccessor(e,t){for(let n of e)this.extend(t(n));return this}},zB=class extends RB{constructor(){super(),this.type=`quantitative`}extend(e){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)}},BB=class extends RB{constructor(){super(),this.type=`ordinal`,this.uniqueValues=new Set}extend(e){return e==null||Number.isNaN(e)||this.uniqueValues.has(e)||(this.uniqueValues.add(e),this.push(e)),this}},VB=class extends BB{constructor(){super(),this.type=`nominal`}},HB=class extends RB{constructor(e){super();let t=0;for(let n=1;n<e.length;n++)t+=Math.sign(e[n]-e[n-1]);if(Math.abs(t)!=e.length-1)throw Error(`Piecewise domain must be strictly increasing or decreasing: `+JSON.stringify(e));e.forEach(e=>this.push(e))}extend(e){if(this.includes(e))return this;throw Error(`Piecewise domains are immutable and cannot be unioned!`)}},UB={quantitative:zB,index:zB,locus:zB,nominal:VB,ordinal:BB}}));function fve(e,t,n,r){let i=Array.from(e).filter(e=>e.contributesToDomain).filter(e=>e.channelDef.scale?.domain),a={domains:[],selectionRef:void 0,selectionRuntime:void 0,selectionDescription:void 0,hasLiteralDomain:!1};t?.domain!==void 0&&GB(a,KB(t,n,r));for(let e of i)GB(a,KB({view:e.view,channel:e.channel,type:e.channelDef.type,domain:e.channelDef.scale.domain},n,r));return hve(a)}function GB(e,t){t.kind===`selection`?pve(e,t):mve(e,t)}function KB(e,t,n){let r=e.domain;return yve(r)?{kind:`selection`,...gve(e,r,t,n)}:{kind:`literal`,domain:qB(e.type,yB(r,e.view?.paramRuntime),t)}}function pve(e,t){if(e.hasLiteralDomain)throw Error(`Cannot mix selection-driven and literal configured domains on a shared scale.`);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+`.`);e.selectionRuntime=t.runtime,e.selectionDescription=t.description,e.selectionRef={param:t.param,encoding:t.encoding,hasInitial:(e.selectionRef?.hasInitial??!1)||t.hasInitial,runtime:t.runtime},t.domain&&e.domains.push(t.domain)}function mve(e,t){if(e.selectionRuntime)throw Error(`Cannot mix literal configured domains with selection-driven domains on a shared scale.`);e.hasLiteralDomain=!0,e.domains.push(t.domain)}function hve(e){return e.domains.length>0?{domain:e.domains.reduce((e,t)=>e.extendAll(t)),selectionRef:e.selectionRef}:e.selectionRuntime?{domain:void 0,selectionRef:e.selectionRef}:{domain:void 0,selectionRef:void 0}}function gve(e,t,n,r){let i=t.param,a=vve(e.channel,t,i),o=cve(e.view,i,a),s=t.initial!==void 0,c=o.selection?.intervals[a],l=i+`.`+a;return!c||c.length!==2?{domain:r&&t.initial?qB(e.type,t.initial,n):void 0,description:l,param:i,encoding:a,hasInitial:s,runtime:o.runtime}:{domain:LB(e.type,n(c)),description:l,param:i,encoding:a,hasInitial:s,runtime:o.runtime}}function qB(e,t,n){let r=n(t);return LB(e,e===`locus`&&Zz(t)&&!Qz(t)?r:kB(e,r))}function _ve(e,t){if(!t||e.size<2||!Array.from(e).some(e=>uve(e.view,t.runtime,t.param,t.encoding)))return;let n=Array.from(new Set(Array.from(e).filter(e=>e.contributesToDomain).map(e=>e.view.getPathString?.()??e.view.name??`(unknown)`)));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.`)}function vve(e,t,n){if(t.encoding)return t.encoding;let r=vm(e);if(r===`x`||r===`y`)return r;throw Error(`Selection domain reference "${n}" on channel "${e}" requires an explicit "encoding" ("x" or "y").`)}function yve(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&typeof e.param==`string`}function bve(e,t,n){let r=t(),i=new Map;for(let t of e){if(!t.contributesToDomain)continue;let e=n(t);if(e.length===0)continue;let a=t.view.getCollector();for(let t of e){let e=Zp(t,r),n=a??null,o=i.get(n);if(o||(o=new Map,i.set(n,o)),o.has(e))continue;let s;if(a)s=a.getDomain(e,r,t);else if(t.constant)s=LB(r),s.extend(t({}));else continue;o.set(e,s)}}if(i.size===0)return;let a=LB(r);for(let e of i.values())for(let t of e.values())a.extendAll(t);return a}function xve(e,t,n,r){return e==`locus`?t(r):e==`index`?AB(e,n)??[]:n??[]}var JB,Sve=n((()=>{z(),dx(),TB(),NB(),IB(),WB(),xB(),em(),km(),rB(),JB=class{#e;#t;#n;#r;#i;#a;#o;#s;#c=void 0;#l=!0;#u=new Map;#d=new WeakMap;constructor({getActiveMembers:e,getAllMembers:t,getDataMembers:n,getViewLevelDomainSource:r,getType:i,getLocusExtent:a,fromComplexInterval:o}){this.#e=e,this.#t=t??e,this.#n=n??e,this.#r=r,this.#i=i,this.#a=a,this.#o=o}get initialDomainSnapshot(){return this.#s}hasConfiguredDomain(e={}){return!!this.getConfiguredDomain(e)}hasSelectionConfiguredDomain(){return this.getSelectionConfiguredDomainBindingInfo(),!!this.#c}getSelectionConfiguredDomainBindingInfo(){return this.#c||!this.#l||this.getConfiguredDomain(),this.#c}getSelectionConfiguredDomainInfo(){let e=this.getSelectionConfiguredDomainBindingInfo();if(e)return{param:e.param,encoding:e.encoding}}invalidateConfiguredDomain(){this.#l=!0,this.#c=void 0,this.#u.clear()}getDefaultDomain(e=!1,t){let n=this.#i();return xve(n,this.#a,e&&n!==`locus`?this.getDataDomain():void 0,t)}getConfiguredOrDefaultDomain(e=!1,t,n={}){return this.getConfiguredDomain(n)??this.getDefaultDomain(e,t)}getConfiguredDomain(e={}){let t=e.includeSelectionInitial??!0;if(!this.#l&&this.#u.has(t))return this.#u.get(t);let n=fve(this.#e(),this.#r?.(),this.#o,t);return _ve(this.#t(),n.selectionRef),this.#c=n.selectionRef,this.#u.set(t,n.domain),this.#l=!1,n.domain}getDataDomain(){return bve(this.#n(),this.#i,e=>this.#f(e))}getDataZoomExtent(){return AB(this.#i(),this.getDataDomain())}captureInitialDomain(e,t,n){if(!this.#s&&kb(e.type)){let t=n??e.domain();xp(t)>0&&(this.#s=t)}return t?!1:(this.#s=n??e.domain(),!0)}#f(e){let t=this.#d.get(e);if(t)return t;let n=e.view.mark.encoders;if(!n)return[];let r=n[e.channel];if(!r)return[];let i=tm(r);if(i.length===0)return[];let a=i.filter(Jp).filter(e=>!e.channelDef.domainInert);return this.#d.set(e,a),a}}}));function Cve(e){return((e*=2)<=1?e*e:--e*(2-e)+1)/2}var wve=n((()=>{}));function Tve(e){return--e*e*e+1}function Eve(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Dve=n((()=>{}));function Ove(e){return(2**(-10*e)-.0009765625)*1.0009775171065494}var kve=n((()=>{}));function Ave(e){return 1-Ove(e)}var jve=n((()=>{kve()})),YB=n((()=>{wve(),Dve(),jve()}));function Mve(e,t,n){return e*(t/e)**+n}var Nve=n((()=>{}));function XB(e,t,n,r,i={}){let a=i.onUnsupported??`throw`;switch(e.type){case`linear`:case`index`:case`locus`:return up(t,n,r);case`log`:return dp(t,n,r);case`pow`:case`sqrt`:return fp(t,n,r,e.exponent());case`symlog`:return pp(t,n,r,e.constant());default:if(a===`identity`)return t;throw Error(`Zooming is not implemented for: `+e.type)}}var ZB=n((()=>{z()}));function Pve(e){if(e===void 0)return{duration:0,renderImmediately:!1};if(_p(e))return{duration:e?700:0,renderImmediately:!1};if(typeof e==`number`)return{duration:e,renderImmediately:!1};let t=e.duration??0;return{duration:_p(t)?t?700:0:t,renderImmediately:e.renderImmediately===!0}}function Fve(e,t,n,r,i,a){if(Lve(t)){if(Ep(t.extent))return QB(e.props.type,t.extent,n);if(t.extent===`data`)return a()??i()??e.domain();if(t.extent===`unbounded`){if(e.props.type===`locus`)throw Error(`Zoom extent "unbounded" is not supported for locus scales.`);return[-1/0,1/0]}}return t&&e.props.type==`locus`?r():i()??e.domain()}function Ive(e,t,n,r,i){let a=[...t],o=e.invert(r);switch(e.props.reverse&&(i=-i),`align`in e&&(o+=e.align()),e.type){case`linear`:case`index`:case`locus`:a=Eoe(a,i||0);break;case`log`:a=Doe(a,i||0);break;case`pow`:case`sqrt`:a=Ooe(a,i||0,e.exponent());break;case`symlog`:if(i!==0)throw Error(`Panning is not implemented for: `+e.type);break;default:throw Error(`Zooming is not implemented for: `+e.type)}return XB(e,a,o,n)}function QB(e,t,n){let r=e===`locus`?n(t):t;return e===`locus`&&Zz(t)&&!Qz(t)?r:kB(e,r)}function Lve(e){return ap(e)}var $B,Rve=n((()=>{z(),dx(),YB(),Nve(),ep(),Ex(),ZB(),NB(),TB(),rB(),$B=class{#e;#t;#n;#r;#i;#a;#o;#s;#c=null;constructor({getScale:e,getAnimator:t,renderImmediately:n,getInitialDomainSnapshot:r,getDataZoomExtent:i,getResetDomain:a,fromComplexInterval:o,getGenomeExtent:s}){this.#e=e,this.#t=t,this.#n=n,this.#r=r,this.#i=i,this.#a=a,this.#o=o,this.#s=s}getZoomExtent(){let e=this.#e(),t=e.props.zoom;return Fve(e,t,this.#o,this.#s,this.#r,this.#i)}isZoomable(){return this.isZoomingSupported()&&!!this.#e().props.zoom}isZoomingSupported(){let e=this.#e().type;return kb(e)&&!Ab(e)}getDomainChangeAction(e,t){return Xf(t,e)?`none`:this.isZoomable()?`restore`:this.#e().type===`index`?`notify`:this.isZoomingSupported()?`animate`:`notify`}isZoomed(){return this.isZoomingSupported()&&!Xf(this.#a(),this.#e().domain())}zoom(e,t,n){if(!this.isZoomingSupported())return!1;let r=this.#e(),i=r.domain(),a=Ive(r,i,e,t,n),o=this.getZoomExtent();return a=koe(a,o[0],o[1]),[0,1].some(e=>a[e]!=i[e])?(r.domain(a),!0):!1}async zoomTo(e,t=!1){let{duration:n,renderImmediately:r}=Pve(t);if(!this.isZoomingSupported())throw Error(`Not a zoomable scale!`);let i=this.#e(),a=QB(i.type,e,this.#o),o=this.#t(),s=i.domain();if(n>0&&s.length==2){if(r)throw Error(`renderImmediately is not supported for animated zooms.`);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];this.#l();let f=xle();this.#c=f,await o.transition({duration:n,easingFunction:Eve,cancelToken:f,onUpdate:n=>{let r=Mve(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];i.domain(f)}}),this.#c===f&&(this.#c=null),i.domain(a)}else this.#l(),i.domain(a),r?this.#n():o?.requestRender()}#l(){this.#c&&=(this.#c.canceled=!0,null)}resetZoom(){if(!this.isZoomingSupported())throw Error(`Not a zoomable scale!`);let e=this.#e(),t=e.domain(),n=this.#a();return[0,1].some(e=>n[e]!=t[e])?(e.domain(n),!0):!1}getZoomLevel(){if(this.isZoomable()){let e=this.getZoomExtent();return xp(e.every(Number.isFinite)?e:this.#r()??this.#e().domain())/xp(this.#e().domain())}return 1}}}));function eV(e){let t=e.view.getPathString(),n=e.channel??``;return t+`|`+n}function tV(e){return Array.from(e).sort((e,t)=>eV(e).localeCompare(eV(t)))}var nV=n((()=>{}));function rV(e,t){return e===t||e.getDataAncestors().includes(t)?`incoming`:t.getDataAncestors().includes(e)?`current`:`conflict`}var iV=n((()=>{}));function zve(e,t){return e===t?!0:!e||!t?!1:e.length===t.length&&Xf(e,t)}function Bve(e){let t=e.view.mark.encoders?.[e.channel];return t?tm(t).filter(Jp):[]}function Vve(e){let t=e.channelDef.scale,n=t?.assembly;if(!t||!n||typeof n!=`object`||!(`url`in n))return e;let r=SS(e.view.getBaseUrl(),n.url);return r===n.url?e:{...e,channelDef:{...e.channelDef,scale:{...t,assembly:{...n,url:r}}}}}var aV,oV=n((()=>{sB(),Hz(),wL(),dx(),xC(),Y_e(),ive(),Sve(),Rve(),DB(),TB(),em(),km(),xB(),WB(),ep(),lR(),bS(),TS(),nV(),iV(),IB(),NB(),Db(`index`,Bz,[`continuous`]),Db(`locus`,B_e,[`continuous`]),Db(`null`,CL,[]),aV=class{#e=new Set;#t=new Set;#n=!1;#r;#i={domain:new Set,range:new Set};#a;#o;#s;#c;#l=!1;#u=[];#d=0;#f=[];#p=!1;#m=void 0;#h;#g;#_=0;#v=0;#y=!1;constructor(e,t){this.channel=e,this.type=null,this.name=void 0,this.#h=t,this.#o=new JB({getActiveMembers:()=>this.#S(),getAllMembers:()=>this.#e,getDataMembers:()=>this.#S(this.#t),getViewLevelDomainSource:()=>this.#z(),getType:()=>this.type,getLocusExtent:e=>this.#w(e),fromComplexInterval:this.fromComplexInterval.bind(this)}),this.#a=new cB({getParamRuntime:()=>this.#x.paramRuntime,onRangeChange:()=>this.#E(`range`),onDomainChange:()=>this.#E(`domain`),getGenomeStore:()=>this.#C.genomeStore}),this.#s=new $B({getScale:()=>this.getScale(),getAnimator:()=>this.#C.animator,renderImmediately:()=>this.#C.renderImmediately(),getInitialDomainSnapshot:()=>this.#o.initialDomainSnapshot,getDataZoomExtent:()=>this.#o.getDataZoomExtent(),getResetDomain:()=>this.#j(),fromComplexInterval:this.fromComplexInterval.bind(this),getGenomeExtent:()=>this.#w()})}get#b(){let e=this.#e.values().next().value;if(!e)throw Error(`ScaleResolution has no members!`);return e.view}get#x(){return this.#h??this.#b}#S(e=this.#e){let t=new Set;for(let n of e){let e=n.view;e.isConfiguredVisible()&&(!e.isDataInitialized()&&!n.channelDef?.scale?.domain||t.add(n))}return t}get#C(){return this.#x.context}get zoomExtent(){return(this.#a.scale&&kb(this.#a.scale.type)&&this.#s.getZoomExtent())??[-1/0,1/0]}#w(e){return K_e(this.#T(e))}#T(e){if(this.type===`locus`)return this.#a.scale??this.#a.getLocusGenome(e)}addEventListener(e,t){this.#i[e].add(t)}removeEventListener(e,t){this.#i[e].delete(t)}#E(e){e===`domain`&&this.#d===0&&this.syncLinkedSelectionFromDomain();for(let t of this.#i[e].values())t({type:e,scaleResolution:this})}#D(e){this.#d+=1;try{e()}finally{--this.#d}}syncLinkedSelectionFromDomain(){let e=this.#o.getSelectionConfiguredDomainBindingInfo();if(!e||!this.isZoomable())return;let t=PB(e.runtime.getValue(e.param),e.param);if(!t)return;let n=this.#O(this.getScale().domain());if(!n)return;let r=this.#O(this.#o.getDefaultDomain(!0)),i=r&&Xf(n,r)?null:n;zve(t.intervals[e.encoding]??null,i)||e.runtime.setValue(e.param,{...t,type:`interval`,intervals:{...t.intervals,[e.encoding]:i}})}#O(e){return FB(e,this.zoomExtent)}#k(){return this.#o.getSelectionConfiguredDomainBindingInfo()}#A(){return!this.#p}#j(e=!1,t){return this.#o.getConfiguredOrDefaultDomain(e,t,{includeSelectionInitial:this.#A()})}#M(){if(this.#g?.props.domain!==void 0)return!0;for(let e of this.#e)if(e.contributesToDomain&&e.channelDef.scale?.domain!==void 0)return!0;return!1}#N(e){let t=PB(e.runtime.getValue(e.param),e.param);if(!t)return null;let n=t.intervals[e.encoding];return n&&n.length===2?n:null}#P(e,t){t?this.#p=!1:e&&(this.#p=!0)}#F(e){let t=Vve(e),{channel:n,channelDef:r}=t;this.#B(t);let i=r.type==null&&this.type;if(n!=`sample`&&!r.type&&!gm(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"`);let a=n==`sample`?`nominal`:r.type,o=r?.scale?.name,s=r.scale?.type??(a===`index`||a===`locus`?a:void 0);if(EB(this.channel,a,s,`encoding.${n}.scale.type`),o){if(this.name!==void 0&&o!=this.name)throw Error(`Shared scales have conflicting names: "${o}" vs. "${this.name}"!`);this.name=o}if(!i){if(!this.type)this.type=a;else if(a!==this.type&&!gm(n))throw Error(`Can not use shared scale for different data types: ${this.type} vs. ${a}. Use "resolve: independent" for channel ${this.channel}`)}return this.#e.add(t),t.contributesToDomain&&(this.#t.add(t),this.#n=!1),t}#I(){this.#y=!1,this.#Z(),this.#ee(),this.#W(),this.#G()}#L(){this.#v>0?this.#y=!0:this.#I()}static registerInBatch(e,t){let n=Array.from(e);for(let e of n)e.#v++;try{return t()}finally{for(let e of n)e.#v--,e.#v===0&&e.#y&&e.#I()}}registerMember(e){let t=this.#F(e);return this.#L(),()=>{let e=this.#e.delete(t);return e&&(this.#t.delete(t),this.#L()),e&&this.#e.size===0}}attachViewLevelScaleProps(e,t){if(this.#g&&this.#g.view!==e){let t=rV(this.#g.view,e);if(t===`current`)return;if(t===`conflict`)throw Error(`Multiple view-level scale declarations target the same ${this.channel} scale resolution.`)}for(let e of this.#e)this.#V(e);this.#g={view:e,props:t},this.#X(),this.#ee(),this.#W(),this.#G(),this.#R()}clearViewLevelScaleProps(e){this.#g?.view===e&&(this.#g=void 0,this.#X(),this.#ee(),this.#W(),this.#G(),this.#R())}#R(){this.#a.scale&&(this.#a.resetScale(),this.initializeScale(),this.#E(`domain`))}getViewLevelScaleProps(){return this.#g}#z(){let e=this.#g;if(e)return{view:e.view,channel:this.channel,type:this.type,domain:e.props.domain}}#B(e){this.#g&&this.#V(e)}#V(e){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.`)}dispose(){this.#H(),this.#U(),this.#i.domain.clear(),this.#i.range.clear(),this.#a.dispose()}#H(){for(let e of this.#u)e();this.#u=[],this.#m=void 0}#U(){for(let e of this.#f)e();this.#f=[]}#W(){if(this.#H(),this.#e.size===0)return;let e=this.#k();e&&(this.#m=this.#N(e),this.#u.push(e.runtime.subscribe(e.param,()=>{let t=this.#m,n=this.#N(e);this.#P(t,n),this.#m=n,this.#ee(),this.reconfigureDomain()})))}#G(){if(this.#U(),this.#e.size===0)return;let e=()=>{this.#ee(),this.reconfigureDomain()};for(let t of this.#e){if(!t.contributesToDomain)continue;let n=t.channelDef.scale?.domain,r=bB(n);if(r.length!==0)for(let n of r){let r=t.view.paramRuntime.createExpression(n.expr).subscribe(e);this.#f.push(r)}}let t=this.#g?.props.domain,n=bB(t);for(let t of n){let n=this.#g.view.paramRuntime.createExpression(t.expr).subscribe(e);this.#f.push(n)}}#K(){for(let e of this.#e)if(e.view.hasRendered())return!0;return!1}#q(){if(this.#n)return!1;for(let e of this.#t){let t=e.view;if(t.isConfiguredVisible()){if(!t.isDataInitialized()){if(!e.channelDef.scale?.domain)return!1;continue}if(!this.#J(e))return!1}}return this.#n=!0,!0}#J(e){if(!e.view.mark.encoders?.[e.channel])return!1;let t=Bve(e).filter(e=>!e.constant&&!e.channelDef.domainInert);if(t.length===0)return!0;let n=e.view.getCollector();return!n||!n.completed?!1:t.some(e=>n.getDomain(Zp(e,this.type),this.type,e).length>0)}registerCollectorSubscriptions(e,t){let n=new Set;for(let e of t)e.channelDef.domainInert||n.add(Zp(e,this.type));if(n.size===0)return()=>void 0;let r=()=>{this.reconfigureDomain()},i=[];for(let t of n)i.push(e.subscribeDomainChanges(t,r));return()=>{for(let e of i)e()}}isDomainDefinedExplicitly(){return this.#M()}isDomainInitialized(){let e=this.#a.scale;if(!e)return!1;let t=e.domain();return kb(e.type)?t.length>2||t.length==2&&(t[0]!==0||t[1]!==0):t.length>0}#Y(){return mS(this,`mergedScaleProps`,()=>{let e=rve({channel:this.channel,dataType:this.type,orderedMembers:this.#Q(),viewLevelScaleProps:this.#g,isExplicitDomain:this.isDomainDefinedExplicitly(),configScopes:this.#x.getConfigScopes()});return this.#te(e),e})}#X(){hS(this,`mergedScaleProps`)}#Z(){this.#r=void 0}#Q(){return this.#r||=tV(this.#e),this.#r}getOrderedMembers(){return this.#Q().slice()}getDebugState(){let e=this.#a.scale,t=e&&typeof e.domain==`function`,n=e&&typeof e.range==`function`;return{kind:`scale`,channel:this.channel,hostView:this.#x,name:this.name,type:this.type,resolvedScaleType:this.getResolvedScaleType(),domain:t?this.getDomain():void 0,complexDomain:t?this.getComplexDomain():void 0,range:n?e.range():void 0,zoomable:this.isZoomable(),zoomed:this.isZoomable()?this.isZoomed():!1,members:this.#Q().map(e=>this.#$(e)),activeMemberCount:this.#S().size,dataDomainMemberCount:this.#t.size,viewLevelScaleProps:this.#g?{view:this.#g.view,props:structuredClone(this.#g.props)}:void 0}}#$(e){return{view:e.view,channel:e.channel,channelDef:structuredClone(e.channelDef),contributesToDomain:e.contributesToDomain,active:this.#S().has(e)}}#ee(){this.#o.invalidateConfiguredDomain(),this.#X()}#te(e){let t=this.#k();if(!t||e===null||e.type===`null`)return;let n=kb(e.type)&&!Ab(e.type)&&!!e.zoom;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".`)}getAssemblyRequirement(){let e=this.#Y();return e===null||e.type===`null`||e.type!==`locus`?{assembly:void 0,needsDefaultAssembly:!1}:{assembly:e.assembly,needsDefaultAssembly:e.assembly===void 0}}getResolvedScaleType(){let e=this.#Y();if(!(e===null||e.type===`null`))return e.type}#ne(e=!1){let t=this.#Y();if(t===null||t.type==`null`)return{type:`null`};let n={...t};this.#_+=1;let r;try{r=this.#j(e,n.type===`locus`?n.assembly:void 0)}finally{--this.#_}if(Ab(n.type)){let t=this.isDomainDefinedExplicitly(),i=this.#re(t);if(r!=null){if(t&&i.domain().length>0&&!Xf(i.domain(),r))return this.#c=void 0,this.#ne(e);i.addAll(r);let a=new Set(r),o=i.domain().filter(e=>a.has(e));n.domain=o.length>0?o:new VB}else{let e=i.domain();n.domain=e.length>0?e:new VB}n.domainIndexer=i}else r&&r.length>0&&(n.domain=r);return!n.domain&&n.domainMid!==void 0&&(n.domain=[n.domainMin??0,n.domainMax??1]),n}#re(e){return(!this.#c||this.#l!==e)&&(this.#c=cR(),this.#l=e),this.#c}reconfigure(){this.#D(()=>{this.#ee();let e=this.#ie(!0);e&&(this.#ae(e,(e,t)=>this.#a.reconfigureScale(t)),this.#oe(e))})}reconfigureDomain(){this.#D(()=>{let e=this.#ie(!0,!0);if(!e)return;let{domainConfig:t,targetDomain:n}=e,r=n!=null&&Xf(n,e.scale.domain());n!=null&&!r&&this.#ae(e,e=>{e.domain(n),t.applyOrdinalUnknown&&e.unknown(t.ordinalUnknown)}),this.#oe(e),this.syncLinkedSelectionFromDomain()})}#ie(e,t=!1){let n=this.#a.scale;if(!n||n.type==`null`)return;let r={scale:n,props:this.#ne(e),previousDomain:n.domain(),domainWasInitialized:this.isDomainInitialized(),hasSelectionConfiguredDomain:this.#o.hasSelectionConfiguredDomain()};if(t){let e=zue(n,r.props);return{...r,domainConfig:e,targetDomain:e.domain}}return r}#ae(e,t){this.#a.withDomainNotificationsSuppressed(()=>{t(e.scale,e.props)})}#oe(e){let{scale:t,previousDomain:n,domainWasInitialized:r,hasSelectionConfiguredDomain:i}=e,a=i?this.#o.getDefaultDomain(!0):void 0,o=this.#q();if(this.#n&&this.#o.captureInitialDomain(t,r,a)){this.#E(`domain`);return}if(!this.#n||o){(!r||!Xf(n,t.domain()))&&this.#E(`domain`);return}if(t.props.domainTransition===!1){this.#E(`domain`);return}let s=t.domain(),c=this.#s.getDomainChangeAction(n,s);c===`restore`?i?this.#E(`domain`):this.#a.withDomainNotificationsSuppressed(()=>{t.domain(n)}):c===`animate`?i?this.#E(`domain`):this.#K()?(this.#a.withDomainNotificationsSuppressed(()=>{t.domain(n)}),this.zoomTo(s,500)):this.#E(`domain`):c===`notify`&&this.#E(`domain`)}get scale(){if(this.#a.scale)return this.#a.scale;throw Error(`ScaleResolution.scale accessed before initialization. Call initializeScale().`)}getScale(){if(this.#_>0)throw Error(`Scale resolution for channel "${this.channel}" cannot read its own scale while its domain is being resolved.`);return this.#a.scale??this.initializeScale()}initializeScale(){if(this.#a.scale)return this.#a.scale;let e=this.#ne();return this.#a.createScale(e)}getDomain(){if(this.#_>0)throw Error(`Scale resolution for channel "${this.channel}" cannot read its own domain while its domain is being resolved.`);return this.getScale().domain()}getDataDomain(){return this.#o.getDataDomain()}getComplexDomain(){return G_e(this.#T(),ave(this.type,this.getDomain()))}getLinkedSelectionDomainInfo(){let e=this.#k();if(!e)return;let t=this.#x.getLayoutAncestors().at(-1),n=t?lve(t,e.runtime,e.param,e.encoding).some(e=>e.param.persist!==!1):!1;return{param:e.param,encoding:e.encoding,persist:n}}isZoomed(){return this.#s.isZoomed()}isZoomable(){let e=this.#Y();return e===null||e.type===`null`?!1:kb(e.type)&&!Ab(e.type)&&!!e.zoom}zoom(e,t,n){return this.#s.zoom(e,t,n)}async zoomTo(e,t=!1){return this.#s.zoomTo(e,t)}resetZoom(){return this.#s.resetZoom()}getZoomLevel(){return this.#s.getZoomLevel()}getAxisLength(){if(this.channel!==`x`&&this.channel!==`y`)throw Error(`Axis length is only defined for x and y channels!`);let e=Array.from(this.#e).map(e=>e.view.coords?.[this.channel===`x`?`width`:`height`]).filter(e=>e>0);return e.length?e.reduce((e,t)=>Math.min(e,t),1e4):0}invertToComplex(e){let t=this.getScale();if(`invert`in t){let n=t.invert(e);return this.toComplex(n)}else throw Error(`The scale does not support inverting!`)}toComplex(e){return H_e(this.#T(),e)}fromComplex(e){return U_e(this.#T(),e)}fromComplexInterval(e){return this.type==`locus`?W_e(this.#T(),e):e}}}));function sV(...e){for(let t of e)if(t!==void 0)return t}var Hve=n((()=>{})),cV,Uve=n((()=>{z(),km(),Hve(),dB(),bS(),yC(),nV(),iV(),cV=class{#e=new Set;#t;constructor(e){this.channel=e}get scaleResolution(){return this.#e.values().next().value?.view.getScaleResolution(this.channel)}#n(e){let{view:t}=e,n=t.getScaleResolution(this.channel);if(!n)throw Error(`Cannot find a scale resolution!`);if(this.scaleResolution&&n!==this.scaleResolution)throw Error(`Shared axes must have a shared scale! Channel: ${this.channel}, existing views: [${Array.from(this.#e).map(e=>e.view.getPathString()).join(`, `)}], new view: ${t.getPathString()}.`);this.#e.add(e),hS(this,`axisProps`)}registerMember(e){return this.#a(e),this.#n(e),()=>this.removeMember(e)&&this.#e.size===0}removeMember(e){let t=this.#e.delete(e);return t&&hS(this,`axisProps`),t}hasVisibleNonChromeMember(){for(let e of this.#r())if(e.view.isVisible())return!0;return!1}getDebugState(){return{kind:`axis`,channel:this.channel,hostView:this.scaleResolution?.getDebugState().hostView??this.#t?.view??this.#e.values().next().value?.view,scaleResolution:this.scaleResolution,title:this.getTitle(),axisProps:this.getAxisProps(),hasVisibleNonChromeMember:this.hasVisibleNonChromeMember(),members:tV(this.#e).map(e=>({view:e.view,channel:e.channel,channelDef:structuredClone(e.channelDef)})),viewLevelAxisProps:this.#t?{view:this.#t.view,props:structuredClone(this.#t.props)}:void 0}}getAxisProps(){return mS(this,`axisProps`,()=>{let e;if(this.#t)e=[this.#t.props];else{let t=this.#r();if(!t.length)return null;e=t.map(e=>{let t=e.view.mark.encoding[e.channel];return`axis`in t&&t.axis})}return e.length>0&&e.some(e=>e===null)?null:lB(e.filter(e=>e!==void 0),`axis`,[`title`])})}getTitle(){if(this.#t?.props.title!==void 0)return this.#t.props.title;let e=this.#r().map(e=>{let t=Uoe(e.view,e.channel);if(!im(t))return{member:e,axisTitle:`axis`in t?t.axis?.title:void 0,explicitTitle:sV(`axis`in t?t.axis?.title:void 0,t.title),implicitTitle:sV(am(t)?t.field:void 0,dm(t)?t.expr:void 0)}}),t=e.map(e=>e.axisTitle).find(e=>e!==void 0);if(t!==void 0)return t;let n=e.filter(t=>{if(gm(t.member.channel)&&!t.explicitTitle){let n=vm(t.member.channel);return e.find(e=>e.member.view==t.member.view&&e.member.channel==n)?.explicitTitle===void 0}return!0}),r=new Set(n.map(e=>sV(e.explicitTitle,e.implicitTitle)).filter(yp));return r.size?[...r].join(`, `):null}attachViewLevelAxisProps(e,t){if(this.#t&&this.#t.view!==e){let t=rV(this.#t.view,e);if(t===`current`)return;if(t===`conflict`)throw Error(`Multiple view-level axis declarations target the same ${this.channel} axis resolution.`)}for(let e of this.#r()){let t=e.view.mark.encoding[e.channel];if(`axis`in t&&t.axis!==void 0)throw Error(`Cannot mix view-level axes.${this.channel} with encoding.${e.channel}.axis in the same axis resolution.`)}this.#t={view:e,props:t},hS(this,`axisProps`)}clearViewLevelAxisProps(e){this.#t?.view===e&&(this.#t=void 0,hS(this,`axisProps`))}getViewLevelAxisProps(){return this.#t}#r(){return tV(this.#e).filter(e=>!this.#i(e))}#i(e){return e.view.getLayoutAncestors().some(VS)}#a(e){if(!this.#t||this.#i(e))return;let t=e.view.mark.encoding[e.channel];if(`axis`in t&&t.axis!==void 0)throw Error(`Cannot mix view-level axes.${this.channel} with encoding.${e.channel}.axis in the same axis resolution.`)}}}));function lV(){let e=[];return{appendConfig(t,n){Wve(e,t,n)},appendStyle(t,n){uV(e,t,n)},merge(){return NS(e.map(e=>e.config))}}}function Wve(e,t,n){n&&(uV(e,t,Object.hasOwn(n,`style`)?n.style:void 0),e.push({kind:`config`,config:n}))}function uV(e,t,n){if(n===void 0)return;if(n===null){Gve(e);return}let r=ER(t,n);e.push({kind:`style`,config:r})}function Gve(e){for(let t=e.length-1;t>=0;t--)e[t].kind==`style`&&e.splice(t,1)}var dV=n((()=>{PS(),DR()}));function Kve(e,t,n={}){let r=e[0],i=e.slice(1),a=lV();qve(a,e,r,n.track);for(let[t,r]of i.entries()){let i=e.slice(0,t+2);fV(a,i,r,n.track),pV(a,i,r.legend)}return pV(a,e,t),a.merge()}function qve(e,t,n,r){let i=t.slice(0,1);pV(e,i,n?.legend),fV(e,i,n,r)}function fV(e,t,n,r){r&&pV(e,t,n?.legendTrack)}function pV(e,t,n){e.appendConfig(t,n)}var Jve=n((()=>{dV()}));function mV(e){let t=hV(e.channel,e.view);return!!(t&&`legend`in t&&t.legend!==void 0)}function Yve(e,t){let n=t.getMarkType();return e==`size`&&(n==`rule`||n==`link`)?`stroke`:`point`}function Xve(e){let t=hV(`x`,e),n=e.getScaleResolution(`x`)?.getResolvedScaleType();return t?.type==`index`||t?.type==`locus`||n==`index`||n==`locus`}function Zve(e,t){if([`opacity`,`fillOpacity`,`strokeOpacity`,`size`].includes(e)&&t.type==`quantitative`||(t.type===`nominal`||t.type===`ordinal`)&&vV.has(e))return`symbol`;if(t.type===`quantitative`&&yV.has(e))return`gradient`}function hV(e,t){return cm(t.getEncoding()[e])}function gV(e,t){let n=hV(e,t);return!!(n&&`legend`in n&&n.legend===null)}function _V(e,t,n){let r=hV(e,n),i=hV(t,n),a=n.getScaleResolution(e),o=n.getScaleResolution(t);return am(r)&&am(i)&&r.field===i.field&&a&&o&&Xf(a.getDomain(),o.getDomain())}function Qve(e,t){if(e!==`shape`||!am(hV(e,t)))return!1;for(let n of[`color`,`fill`,`stroke`])if(_V(n,e,t)&&!gV(n,t))return!0;return!1}function $ve(e,t){if(!ym(e))return{};let n=hV(e,t),r=hV(`shape`,t),i=t.getScaleResolution(`shape`);return am(n)&&am(r)&&i&&_V(e,`shape`,t)&&!gV(`shape`,t)?{shape:i.name??`shape`}:{}}var vV,yV,bV,eye=n((()=>{km(),Jve(),ep(),nV(),iV(),yC(),vV=new Set([`color`,`fill`,`stroke`,`opacity`,`fillOpacity`,`strokeOpacity`,`shape`,`size`]),yV=new Set([`color`,`fill`,`stroke`]),bV=class{#e=new Set;#t;constructor(e){this.channel=e}registerMember(e){return this.#r(e),this.#e.add(e),()=>this.removeMember(e)&&this.#e.size===0}removeMember(e){return this.#e.delete(e)}getLegendDefs(){let e=new Set,t=[];for(let n of tV(this.#e)){let r=this.#n(n);r&&!e.has(r.scaleResolution)&&(e.add(r.scaleResolution),t.push(r))}return t}#n(e){let{channel:t,view:n}=e;if(Qve(t,n))return;let r=hV(t,n);if(!r||im(r))return;let i=`legend`in r?r.legend:void 0;if(!this.#t&&i===null||`scale`in r&&r.scale===null)return;let a=this.#t?.props??i,o=a===void 0?void 0:{disable:!1,...a},s=n.getScaleResolution(t);if(!s)return;let c=Kve(n.getConfigScopes(),o,{track:Xve(n)});if(c.disable===!0)return;let l=Zve(t,r);if(!l)return;let u=`title`in r?r.title:void 0,d=c.title===void 0?u===void 0?am(r)?r.field:void 0:u:c.title,f=`format`in r?r.format:void 0,p=l==`symbol`?$ve(t,n):void 0,m=l==`symbol`?Yve(t,n):void 0;return{view:n,channel:t,field:am(r)?r.field:void 0,type:l,symbolChannels:p,symbolGeometry:m,legend:{...c,title:d},format:f,dataType:r.type,scaleResolution:s}}hasVisibleNonChromeMember(){for(let e of this.#e)if(e.view.isVisible()&&!e.view.getLayoutAncestors().some(VS))return!0;return!1}getDebugState(){let e=this.getLegendDefs();return{kind:`legend`,channel:this.channel,hostView:e[0]?.scaleResolution.getDebugState().hostView??this.#t?.view??this.#e.values().next().value?.view,legendDefs:e.map(e=>({...e,view:e.view,scaleResolution:e.scaleResolution,legend:structuredClone(e.legend)})),hasVisibleNonChromeMember:this.hasVisibleNonChromeMember(),members:tV(this.#e).map(e=>({view:e.view,channel:e.channel})),viewLevelLegendProps:this.#t?{view:this.#t.view,props:structuredClone(this.#t.props)}:void 0}}attachViewLevelLegendProps(e,t){if(this.#t&&this.#t.view!==e){let t=rV(this.#t.view,e);if(t===`current`)return;if(t===`conflict`)throw Error(`Multiple view-level legend declarations target the same ${this.channel} legend resolution.`)}let n=Array.from(this.#e).find(e=>mV(e));if(n)throw Error(`Cannot mix view-level legends.${this.channel} with encoding.${n.channel}.legend in the same legend resolution.`);this.#t={view:e,props:t}}clearViewLevelLegendProps(e){this.#t?.view===e&&(this.#t=void 0)}getViewLevelLegendProps(){return this.#t}#r(e){if(this.#t&&mV(e))throw Error(`Cannot mix view-level legends.${this.channel} with encoding.${e.channel}.legend in the same legend resolution.`)}}})),xV,SV,CV,wV,TV,EV,DV,OV,kV,AV,jV,tye=n((()=>{oV(),Uve(),eye(),km(),xV=(e,t,n)=>{let r=e;for(;(r.getConfiguredOrDefaultResolution(n,t)==`forced`||r.dataParent&&[`shared`,`excluded`,`forced`].includes(r.dataParent.getConfiguredOrDefaultResolution(n,t)))&&r.getConfiguredOrDefaultResolution(n,t)!=`excluded`;)r=r.dataParent;return r},SV=(e,t,n)=>{if(!t.resolutions.scale[n]){let r=new aV(n,t);t.resolutions.scale[n]=r;let i=t=>{e.context.glHelper?.createRangeTexture(t.scaleResolution,!0)};r.addEventListener(`range`,i),r.addEventListener(`domain`,i),e.registerDisposer(()=>{r.removeEventListener(`range`,i),r.removeEventListener(`domain`,i)})}return t.resolutions.scale[n]},CV=(e,t,n,r)=>{let i=cm(r);if(!i)return;let a=vm(i.resolutionChannel??n);if(xm(a)&&!(t==`axis`&&!mm(a))&&!(t==`legend`&&(mm(a)||hm(a)))&&!(t==`legend`&&e.getConfiguredOrDefaultResolution(a,t)==`excluded`))return{view:xV(e,t,a),channel:n,channelDef:i,targetChannel:a}},wV=(e,t)=>{for(let[n,r]of Object.entries(e.mark.encoding))!r||Array.isArray(r)||t(n,r)},TV=e=>{let t=[];return wV(e,(n,r)=>{let i=CV(e,`axis`,n,r);i&&mm(i.channel)&&t.push(i)}),t},EV=e=>{let t=[];for(let[n,r]of Object.entries(e.getEncoding())){if(!r||Array.isArray(r))continue;let i=CV(e,`legend`,n,r);i&&!mm(i.channel)&&t.push(i)}return t},DV=e=>{let t=new Map;return wV(e,(n,r)=>{let i=CV(e,`scale`,n,r);if(!i)return;let a=SV(e,i.view,i.targetChannel),o=t.get(a);o?o.push(i):t.set(a,[i])}),t},OV=(e,t)=>{for(let{view:n,channel:r,channelDef:i,targetChannel:a}of t){if(!mm(r)||!pm(a))continue;n.resolutions.axis[a]||(n.resolutions.axis[a]=new cV(a));let t=n.resolutions.axis[a],o=t.registerMember({view:e,channel:r,channelDef:i});e.registerDisposer(()=>{o()&&n.resolutions.axis[a]===t&&delete n.resolutions.axis[a]})}},kV=(e,t)=>{for(let{view:n,channel:r,targetChannel:i}of t){if(mm(r))continue;let t=i;n.resolutions.legend[t]||(n.resolutions.legend[t]=new bV(t));let a=n.resolutions.legend[t],o=a.registerMember({view:e,channel:r});e.registerDisposer(()=>{o()&&n.resolutions.legend[t]===a&&delete n.resolutions.legend[t]})}},AV=(e,t)=>{aV.registerInBatch(t.keys(),()=>{for(let[n,r]of t)for(let{view:t,channel:i,channelDef:a,targetChannel:o}of r){let r=o,s=!e.isDomainInert(),c=n.registerMember({view:e,channel:i,channelDef:a,contributesToDomain:s});e.registerDisposer(()=>{c()&&t.resolutions.scale[r]===n&&(n.dispose(),delete t.resolutions.scale[r])})}})},jV=(e,t)=>{if(!t){jV(e,`scale`),jV(e,`axis`);return}t==`axis`?OV(e,TV(e)):t==`legend`?kV(e,EV(e)):AV(e,DV(e))}}));function nye(e,t,n){return!t.isDomainDefinedExplicitly()&&n.has(vm(e.scaleChannel))}var MV,NV,PV=n((()=>{c_e(),v_e(),S_e(),k_e(),N_e(),L_e(),km(),em(),tC(),Ig(),zz(),Gp(),Cg(),Kp(),Rp(),tye(),MV={point:lz,rect:BR,arrow:tz,rule:vz,tick:vz,link:wz,text:Fz},NV=class extends $S{#e;#t=!1;#n=null;constructor(e,t,n,r,i,a){super(e,t,n,r,i,a),this.spec=e;let o=MV[this.getMarkType()];if(o)this.mark=new o(this);else throw Error(`No such mark: ${this.getMarkType()}`);this.#e=this.paramRuntime.allocateSetter(`zoomLevel`,1),this.resolve();for(let e of[`x`,`y`]){let t=this.getScaleResolution(e);if(t){let e=()=>{this.#e(Math.sqrt(this.getZoomLevel()))};t.addEventListener(`domain`,e),this.registerDisposer(()=>t.removeEventListener(`domain`,e))}}this.registerDisposer(this._addBroadcastHandler(`subtreeDataReady`,()=>{for(let e of Cm)this.getScaleResolution(e)?.syncLinkedSelectionFromDomain()})),this.needsAxes={x:!0,y:!0},this.#r()}#r(){for(let[e,t]of this.paramRuntime.paramConfigs){if(!(`select`in t))continue;let n=jg(t.select),r=n.on,i=n.clear;if(Mg(n)){let t=0,a=t=>{this.paramRuntime.setValue(e,t)},o=()=>{let e=this.context.getCurrentHover();return e?.mark?.unitView===this?e.datum:null},s=xg(r);if(this.addInteractionListener([`mouseover`,`pointerover`].includes(r.type)?`mousemove`:r.type,r=>{if(!s(r.proxiedMouseEvent))return;let i=o(),c=i?i[Vp]:0,l;n.toggle?r.mouseEvent.shiftKey?i&&(l=Lse(this.paramRuntime.getValue(e),{toggle:[i]})):l=Tg(i?[i]:null):c!=t&&(t=c,l=wg(i)),l!==void 0&&a(l)}),i){let e=xg(i);this.addInteractionListener(i.type,r=>{if(!e(r.proxiedMouseEvent))return;t=0;let i=n.toggle?Tg():wg(null);a(i)})}}}}render(e,t,n={}){super.render(e,t,n),this.isConfiguredVisible()&&(e.pushView(this,t),e.renderMark(this.mark,n),e.popView(this))}getMarkType(){return typeof this.spec.mark==`object`?this.spec.mark.type:this.spec.mark}getEncoding(){let e=super.getEncoding(),t=this.mark.getSupportedChannels();for(let n of Object.keys(e))n!==`key`&&(t.includes(n)||delete e[n]);return e}resolve(e){if(!e){this.resolve(`scale`),this.resolve(`axis`),this.resolve(`legend`);return}jV(this,e)}dispose(){super.dispose(),this.mark.dispose()}getDataAccessor(e){let t=this.mark.encoders;if(t)return t[e]?nm(t[e]):void 0}getSearchAccessors(){if(!this.#n){let e=Lz(this.getEncoding())??[];this.#n=e.map(e=>B(e))}return this.#n}getFacetAccessor(e){return this.getDataAccessor(`sample`)||super.getFacetAccessor(this)}getCollector(){return this.flowHandle?.collector}registerDomainSubscriptions(){if(this.#t||this.isDomainInert())return;let e=this.getCollector();if(!e)return;let t=this.mark.encoders;if(!t)throw Error(`Encoders are not initialized!`);this.#t=!0;let n=Noe(e),r=new Map;for(let e of Object.values(t)){if(!e)continue;let t=tm(e);if(t.length!==0)for(let e of t){if(!Jp(e))continue;let t=this.getScaleResolution(e.scaleChannel);if(!t)throw Error(`Missing scale resolution for channel: `+e.scaleChannel);if(e.channelDef.domainInert||nye(e,t,n))continue;let i=r.get(t);i||(i=new Set,r.set(t,i)),i.add(e)}}for(let[t,n]of r){if(n.size===0)continue;let r=t.registerCollectorSubscriptions(e,n);this.registerDisposer(r)}}getZoomLevel(){return Cm.map(e=>this.getScaleResolution(e)?.getZoomLevel()??1).reduce((e,t)=>e*t,1)}propagateInteraction(e){this.handleInteraction(e,!0),e.target=this,!e.stopped&&this.handleInteraction(e,!1)}getDefaultResolution(e,t){return e==`x`?`shared`:`independent`}}}));async function FV(e,t={}){let n;try{n=await fetch(e,{signal:t.signal})}catch(e){throw new IV(`network`,String(e))}if(!n.ok)throw new IV(`http`,String(n.status)+` `+n.statusText);try{return await n.json()}catch(e){throw new IV(`json`,String(e))}}var IV,LV=n((()=>{IV=class extends Error{constructor(e,t){super(t),this.kind=e}}}));function RV(e){let t=new Set;e.visit(e=>{for(let n of Object.values(e.resolutions.scale)){let e=n.name;if(e&&t.has(e))throw Error(`The same scale name "${e}" occurs in multiple scale resolutions!`);t.add(e)}})}function rye(e){for(let t of Cm){let n=e.getScaleResolution(t);n&&!n.name&&n.isZoomable()&&(n.name=`${t}_at_root`)}}function zV(e,t=()=>!0){return Promise.allSettled(e).then(e=>{if(t())for(let t of e)`value`in t?t.value.finalizeGraphicsInitialization():`reason`in t&&console.error(t.reason)})}function iye(e){let t=[];return e.visit(e=>{if(e instanceof NV){let n=e.getEncoding(),r=(n,i)=>{if(!(!i||typeof i!=`object`||Array.isArray(i))&&(am(i)&&`type`in i?t.push({view:e,channel:n,field:i.field,type:i.type}):am(i)&&n===`semanticScore`&&t.push({view:e,channel:n,field:i.field,type:`quantitative`}),`condition`in i)){let{condition:e}=i;if(Array.isArray(e))for(let t of e)r(n,t);else r(n,e)}};for(let[e,t]of Object.entries(n))r(e,t);return XS}}),t}async function aye(e,t,n){let r=e.import;if(!(`url`in r))throw Error(`Not an url import: `+JSON.stringify(r));let i=xS(t,r.url),a;try{a=await FV(i)}catch(e){throw Error(`Could not load imported view spec: ${i}. Reason: ${e.message}`,{cause:e})}if(n.isViewSpec(a))return a.baseUrl=xS(CS(r.url),a.baseUrl),a;throw Error(`The imported spec "${i}" is not a view spec: ${JSON.stringify(e)}`)}function oye(e){let t=e.getSize(),n=e.getPadding(),r=(e,t)=>e.grow>0?void 0:e.px+t;return{width:r(t.width,n.horizontalTotal),height:r(t.height,n.verticalTotal)}}var BV=n((()=>{z(),PV(),tC(),km(),TS(),LV()}));function*VV(e,t=[]){for(let[n,r]of e.entries())if(r instanceof Map)for(let e of VV(r,[...t,n]))yield e;else yield[[...t,n],r]}var HV=n((()=>{}));function sye(e){for(let t=1;t<e.length;t++)if(e[t]<e[t-1])return!1;return!0}function UV(e){let t=0;for(let n=0,r=e.length;n<r;n++)e[n]>t&&(t=e[n]);return Math.floor(Math.log2(t)/4)+1}function cye(e){let t=UV(e),n=Array.from({length:e.length},(e,t)=>t);if(sye(e))return n;let r=Array(e.length),i=Array(16);for(let a=0;a<t;a++){i.fill(0);let t=a*4,o=16**a,s=r=>{let i=e[n[r]];return a>=GV?i>WV?Math.floor(i/o)%16:0:i>>t&15};for(let t=0;t<e.length;t++)i[s(t)]++;for(let e=1;e<16;e++)i[e]+=i[e-1];for(let t=e.length-1;t>=0;t--)r[--i[s(t)]]=n[t];[n,r]=[r,n]}return n}var WV,GV,lye=n((()=>{WV=2147483647,GV=UV([WV])}));function KV(e,t){if(e===void 0)throw Error(`Key field "${t}" is undefined. Ensure all key fields are present in the data.`);if(e===null)throw Error(`Key field "${t}" is null. Ensure all key fields are present in the data.`);if(typeof e!=`string`&&typeof e!=`number`&&typeof e!=`boolean`)throw Error(`Key field "${t}" must be a scalar value (string, number, or boolean).`);return e}function uye(e){if(!(e.indexOf(YV)!==-1||e.indexOf(JV)!==-1))return e;let t=``;for(let n=0;n<e.length;n++){let r=e[n];(r===YV||r===JV)&&(t+=YV),t+=r}return t}function qV(e){return typeof e==`string`?uye(e):String(e)}var JV,YV,XV,dye=n((()=>{Kp(),JV=`|`,YV=`\\`,XV=class{#e=null;#t=null;#n=!1;invalidate(){this.#e=null,this.#t=null,this.#n=!1}findDatum(e,t,n){if(!e||e.length===0)return;let r=e.join(`, `);if(e.length!==t.length)throw Error(`Key tuple length ${t.length} does not match fields [${r}]`);(!this.#e||!this.#i(e))&&this.#r(e,n);let i=this.#t,a;if(this.#n){let e=``;for(let n=0;n<t.length;n++){n>0&&(e+=JV);let r=i[n],a=KV(t[n],r);e+=qV(a)}a=e}else{let e=i[0];a=KV(t[0],e)}return this.#e.get(a)}#r(e,t){let n=e.map(e=>B(e)),r=new Map,i=e.join(`, `),a=e.length!==1;if(a)for(let a of t)for(let t=0,o=a.length;t<o;t++){let o=a[t],s=``;for(let t=0;t<n.length;t++){t>0&&(s+=JV);let r=e[t],i=KV(n[t](o),r);s+=qV(i)}if(r.get(s)!==void 0){let e=n.map(e=>e(o));throw Error(`Duplicate key detected for fields [${i}]: ${JSON.stringify(e)}`)}r.set(s,o)}else{let a=n[0],o=e[0];for(let e of t)for(let t=0,n=e.length;t<n;t++){let n=e[t],s=KV(a(n),o);if(r.get(s)!==void 0)throw Error(`Duplicate key detected for fields [${i}]: ${JSON.stringify(s)}`);r.set(s,n)}}this.#e=r,this.#t=[...e],this.#n=a}#i(e){if(!this.#t||this.#t.length!==e.length)return!1;for(let t=0;t<e.length;t++)if(this.#t[t]!==e[t])return!1;return!0}}}));function fye(e){return{[Symbol.iterator]:function*(){for(let t of e)yield*t}}}function pye(e,t){return t.length>1?At(e,...t):mye(e,t[0])}function mye(e,t){let n=new Map;for(let r of e){let e=t(r),i=n.get(e);i||(i=[],n.set(e,i)),i.push(r)}return n}function hye(e){if(e?.field){let t=Zf(e.field);if(t.length==1&&!t[0].includes(`.`)){let n=Zf(e.order)[0]??`ascending`,r=JSON.stringify(t[0]);return Function(`a`,`b`,`return ${n===`ascending`?`a[${r}] - b[${r}]`:`b[${r}] - a[${r}]`};`)}return gp(e.field,e.order)}}var ZV,QV,$V=n((()=>{Dt(),ln(),z(),HV(),Rp(),Kp(),ep(),lye(),Gp(),WB(),dye(),ZV=class extends Lp{#e=[];#t=B(Vp);#n=[];#r=new XV;#i;#a;#o=new QV;get behavior(){return 4}get label(){return`collect`}constructor(e){super(),this.params=e??{type:`collect`},this.observers=new Set,this.facetBatches=new Et([],JSON.stringify),this.#a=hye(this.params?.sort),this.#s()}#s(){this.#e=[],this.#n=[],this.#r.invalidate(),this.facetBatches.clear(),this.facetBatches.set(void 0,this.#e)}reset(){super.reset(),this.#s()}handle(e){this.#e.push(e)}beginBatch(e){this.#r.invalidate(),Foe(e)&&(this.#e=[],this.facetBatches.set(Zf(e.facetId),this.#e))}complete(){if(this.#e=[],this.params.groupby?.length){let e=this.params.groupby.map(e=>B(e)),t=pye(this.facetBatches.size>1?fye(this.facetBatches.values()):this.facetBatches.get(void 0),e);this.facetBatches.clear();for(let[e,n]of VV(t))this.facetBatches.set(e,n)}if(this.#a)for(let e of this.facetBatches.values())e.sort(this.#a);this.#f(),this.#c(),super.complete(),this.#d(),this.#l()}observe(e){return this.observers.add(e),()=>{this.observers.delete(e)}}#c(){if(this.children.length)for(let[e,t]of this.facetBatches.entries()){if(e){let t={type:`facet`,facetId:e};for(let e of this.children)e.beginBatch(t)}for(let e=0,n=t.length;e<n;e++)this._propagate(t[e])}}repropagate(){for(let e of this.children)e.reset();this.#c();for(let e of this.children)e.complete();this.#d(),this.#l()}#l(){for(let e of this.observers)e(this)}getDomain(e,t,n){return this.#o.getDomain(e,()=>{let e=LB(t);if(n.constant)e.extend(n({}));else if(this.completed)for(let t of this.facetBatches.values())for(let r=0,i=t.length;r<i;r++)e.extend(n(t[r]));return e})}subscribeDomainChanges(e,t){return this.#o.subscribe(e,t)}getData(){switch(this.#u(),this.facetBatches.size){case 0:return[];case 1:return[...this.facetBatches.values()][0];default:{let e=this.facetBatches;return{[Symbol.iterator]:function*(){for(let t of e.values())yield*t}}}}}visitData(e){this.#u();for(let t of this.facetBatches.values())for(let n=0;n<t.length;n++)e(t[n])}getItemCount(){let e=0;for(let t of this.facetBatches.values())e+=t.length;return e}#u(){if(!this.completed)throw Error(`Data propagation is not completed! No data are available.`)}#d(){this.#o.hasCachedDomains()&&this.#o.clear(),this.#o.notify()}#f(){this.#i=[];let e=this.facetBatches.values().next().value?.[0];if(e==null||!(`_uniqueId`in e))return;let t=0,n=[],r=this.#t;for(let[e,i]of this.facetBatches){this.#i.push({start:t,stop:t+i.length,facetId:e}),t+=i.length;for(let e=0,t=i.length;e<t;e++)n.push(r(i[e]))}this.#n=cye(n)}findDatumByUniqueId(e){if(!this.#n.length)return;let t=pt(e=>e.start).right,n=this.#t,r=pt(e=>n(i(e))).left,i=e=>{let n=t(this.#i,e),r=this.#i[n-1];if(!(!r||e>=r.stop))return this.facetBatches.get(r.facetId)[e-r.start]},a=r(this.#n,e);if(a>=0){let t=i(this.#n[a]);if(t&&n(t)===e)return t}}findDatumByKey(e,t){return this.#u(),this.#r.findDatum(e,t,this.facetBatches.values())}},QV=class{#e=new Map;#t=new Map;hasCachedDomains(){return this.#e.size>0}clear(){this.#e.clear()}getDomain(e,t){let n=this.#e.get(e);if(n)return n;{let n=t();return this.#e.set(e,n),n}}subscribe(e,t){let n=this.#t.get(e);return n||(n=new Set,this.#t.set(e,n)),n.add(t),()=>{let n=this.#t.get(e);n&&(n.delete(t),n.size===0&&this.#t.delete(e))}}notify(){if(this.#t.size===0)return;let e=new Set;for(let t of this.#t.values())for(let n of t)e.add(n);for(let t of e)t()}}}));function gye(e,t={}){return tH(nH(e,t.copyFields?new Set(t.copyFields):void 0))}function eH(e={}){let t=e.copyFields?new Set(e.copyFields):void 0,n,r=(e=>(n||=tH(nH(e,t)),n(e)));return r.reset=()=>{n=void 0},r}function tH(e){let t=Function(`source`,`return { `+e.map(e=>JSON.stringify(e)).map(e=>`${e}: source[${e}]`).join(`,
|
|
3159
3159
|
`)+` };`);return t.properties=e,t}function nH(e,t){return rH(e).filter(e=>typeof e==`string`&&(!t||t.has(e)))}function rH(e){let t=[];do t=t.concat(Object.keys(e)),e=Object.getPrototypeOf(e);while(e&&e!==Object.prototype);return Array.from(new Set(t))}var iH=n((()=>{}));function aH(e){return e.type==`lookup`&&`source`in e.from&&e.from.source==`input`}function _ye(e){}function vye(e,t,n){let r=new Map;if(t.length===1){let i=t[0];for(let t of e){let e=i(t);if(r.has(e))throw Error(`Duplicate lookup key ${JSON.stringify([e])} in fields ${JSON.stringify(n)}.`);r.set(e,t)}}else for(let i of e){let e=r;for(let n=0;n<t.length-1;n++){let r=t[n](i),a=e.get(r);a||(a=new Map,e.set(r,a)),e=a}let a=t.at(-1)(i);if(e.has(a)){let e=t.map(e=>e(i));throw Error(`Duplicate lookup key ${JSON.stringify(e)} in fields ${JSON.stringify(n)}.`)}e.set(a,i)}return r}function yye(e,t){if(!e)return[];let n=Object.keys(e);if(t.filter(e=>!n.includes(e)).length)throw Error(`Omitting "values" requires top-level lookup key fields.`);return n.filter(e=>!t.includes(e))}function bye(e,t,n){let r=e.map(e=>JSON.stringify(e)),i=JSON.stringify(n),a=r.map((e,t)=>`output[${e}] = accessors[${t}](foreignDatum);`).join(`
|
|
3160
3160
|
`),o=r.map(e=>`output[${e}] = ${i};`).join(`
|
|
3161
3161
|
`);return Function(`accessors`,`return (output, foreignDatum) => {
|
|
@@ -6052,7 +6052,7 @@ ${t}</textarea
|
|
|
6052
6052
|
/>
|
|
6053
6053
|
${aFe([123],()=>this._getSearchHelp())}
|
|
6054
6054
|
</div>
|
|
6055
|
-
`}};customElements.define(`genome-spy-search-field`,oFe);function sFe(e,t){return new Promise(n=>{let r=0,i=700/e.length+30;function a(){t.value=e.substring(0,r),r>=e.length?setTimeout(n,500):(r++,setTimeout(a,Math.random()*i*2))}a()})}function cFe(e,t,n,r){for(let i of t){let t=i(e);if(t!=null&&r.compare(String(t),n)===0)return!0}return!1}function lFe(e,t,n){let r=new Set;for(let i of e)for(let e of az(n,t,i))if(e!=null&&r.add(String(e)),r.size>=n)return[...r];return[...r]}function R5(e){let t;return e.visit(e=>{for(let n of[`x`,`y`]){let r=e.resolutions.scale[n];if(r&&r.type==`locus`&&r.isZoomable())return t=r,ZS}}),t}var z5={name:`@genome-spy/app`,description:`GenomeSpy-based visualization tool for analyzing multiple biological samples.`,author:{name:`Kari Lavikka`,email:`kari.lavikka@helsinki.fi`},contributors:[],license:`MIT`,homepage:`https://genomespy.app/`,version:`0.83.
|
|
6055
|
+
`}};customElements.define(`genome-spy-search-field`,oFe);function sFe(e,t){return new Promise(n=>{let r=0,i=700/e.length+30;function a(){t.value=e.substring(0,r),r>=e.length?setTimeout(n,500):(r++,setTimeout(a,Math.random()*i*2))}a()})}function cFe(e,t,n,r){for(let i of t){let t=i(e);if(t!=null&&r.compare(String(t),n)===0)return!0}return!1}function lFe(e,t,n){let r=new Set;for(let i of e)for(let e of az(n,t,i))if(e!=null&&r.add(String(e)),r.size>=n)return[...r];return[...r]}function R5(e){let t;return e.visit(e=>{for(let n of[`x`,`y`]){let r=e.resolutions.scale[n];if(r&&r.type==`locus`&&r.isZoomable())return t=r,ZS}}),t}var z5={name:`@genome-spy/app`,description:`GenomeSpy-based visualization tool for analyzing multiple biological samples.`,author:{name:`Kari Lavikka`,email:`kari.lavikka@helsinki.fi`},contributors:[],license:`MIT`,homepage:`https://genomespy.app/`,version:`0.83.1`,main:`dist/index.js`,module:`dist/index.es.js`,type:`module`,types:`src/index.d.ts`,exports:{".":{types:`./src/index.d.ts`,development:`./src/index.js`,import:`./dist/index.es.js`,default:`./dist/index.js`},"./agentApi":{types:`./src/agentApi/index.d.ts`,development:`./src/agentApi/index.js`,import:`./dist/agentApi.es.js`,default:`./dist/agentApi.es.js`},"./agentShared":{types:`./src/agentShared/index.d.ts`,development:`./src/agentShared/index.js`,import:`./dist/agentShared.es.js`,default:`./dist/agentShared.es.js`},"./browser":{import:`./dist/index.es.js`,default:`./dist/index.js`},"./dialog":{types:`./src/dialog/index.d.ts`,development:`./src/dialog/index.js`,import:`./dist/dialog.es.js`,default:`./dist/dialog.es.js`},"./schema.json":`./dist/schema.json`,"./style.css":`./dist/style.css`},files:[`dist/`,`src/**/*.d.ts`],repository:{type:`git`,url:`github:genome-spy/genome-spy`,directory:`packages/app`},scripts:{dev:`node dev-server.mjs`,build:`rm -rf dist && mkdir -p dist && vite build && vite build --config vite.agent-subpaths.config.js && npm run build:schema`,"build:schema":`mkdir -p dist && ts-json-schema-generator --path 'src/spec/*.d.ts' --type AppRootSpec > dist/schema.json`,"test:tsc":`npm run test:tsc:src && npm run test:tsc:tests`,"test:tsc:src":`tsc -p tsconfig.json --noEmit`,"test:tsc:tests":`tsc -p tsconfig.tests.json --noEmit`,storybook:`storybook dev -p 6006`,"build-storybook":`storybook build`,prepublishOnly:`npm run build`},dependencies:{"@floating-ui/dom":`^1.6.1`,"@fortawesome/fontawesome-free":`^6.4.2`,"@fortawesome/fontawesome-svg-core":`^6.4.2`,"@fortawesome/free-solid-svg-icons":`^6.4.2`,"@genome-spy/core":`^0.83.1`,"@reduxjs/toolkit":`^2.11.0`,"d3-color":`^3.1.0`,idb:`^7.1.1`,lit:`^3.3.0`,"lz-string":`^1.4.4`,mapsort:`^1.0.5`,micromark:`^4.0.0`,"redux-undo":`^1.0.1`,"vega-util":`2.1.0`,zarrita:`^0.6.1`},devDependencies:{"@genome-spy/app-agent":`^0.83.1`,"@genome-spy/inspector":`^0.83.1`},gitHead:`f880c82effa9550b5e979b5982770dd909d91b59`};J();function B5(e){return K`<a
|
|
6056
6056
|
href="https://github.com/genome-spy/genome-spy/releases/tag/v${e}"
|
|
6057
6057
|
target="_blank"
|
|
6058
6058
|
>v${e}</a
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"contributors": [],
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"homepage": "https://genomespy.app/",
|
|
11
|
-
"version": "0.83.
|
|
11
|
+
"version": "0.83.1",
|
|
12
12
|
"main": "dist/index.js",
|
|
13
13
|
"module": "dist/index.es.js",
|
|
14
14
|
"type": "module",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"@fortawesome/fontawesome-free": "^6.4.2",
|
|
71
71
|
"@fortawesome/fontawesome-svg-core": "^6.4.2",
|
|
72
72
|
"@fortawesome/free-solid-svg-icons": "^6.4.2",
|
|
73
|
-
"@genome-spy/core": "^0.83.
|
|
73
|
+
"@genome-spy/core": "^0.83.1",
|
|
74
74
|
"@reduxjs/toolkit": "^2.11.0",
|
|
75
75
|
"d3-color": "^3.1.0",
|
|
76
76
|
"idb": "^7.1.1",
|
|
@@ -83,8 +83,8 @@
|
|
|
83
83
|
"zarrita": "^0.6.1"
|
|
84
84
|
},
|
|
85
85
|
"devDependencies": {
|
|
86
|
-
"@genome-spy/app-agent": "^0.83.
|
|
87
|
-
"@genome-spy/inspector": "^0.83.
|
|
86
|
+
"@genome-spy/app-agent": "^0.83.1",
|
|
87
|
+
"@genome-spy/inspector": "^0.83.1"
|
|
88
88
|
},
|
|
89
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "f880c82effa9550b5e979b5982770dd909d91b59"
|
|
90
90
|
}
|