//#region ../../node_modules/d3-zoom/src/transform.js
function e(e, t, n) {
	this.k = e, this.x = t, this.y = n;
}
e.prototype = {
	constructor: e,
	scale: function(t) {
		return t === 1 ? this : new e(this.k * t, this.x, this.y);
	},
	translate: function(t, n) {
		return t === 0 & n === 0 ? this : new e(this.k, this.x + this.k * t, this.y + this.k * n);
	},
	apply: function(e) {
		return [e[0] * this.k + this.x, e[1] * this.k + this.y];
	},
	applyX: function(e) {
		return e * this.k + this.x;
	},
	applyY: function(e) {
		return e * this.k + this.y;
	},
	invert: function(e) {
		return [(e[0] - this.x) / this.k, (e[1] - this.y) / this.k];
	},
	invertX: function(e) {
		return (e - this.x) / this.k;
	},
	invertY: function(e) {
		return (e - this.y) / this.k;
	},
	rescaleX: function(e) {
		return e.copy().domain(e.range().map(this.invertX, this).map(e.invert, e));
	},
	rescaleY: function(e) {
		return e.copy().domain(e.range().map(this.invertY, this).map(e.invert, e));
	},
	toString: function() {
		return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")";
	}
};
var t = new e(1, 0, 0);
n.prototype = e.prototype;
function n(e) {
	for (; !e.__zoom;) if (!(e = e.parentNode)) return t;
	return e.__zoom;
}
//#endregion
export { e as Transform, n as default, t as identity };
