import e from "../noop.js";
import { CardinalClosed as t } from "./cardinalClosed.js";
import { point as n } from "./catmullRom.js";
//#region ../../node_modules/d3-shape/src/curve/catmullRomClosed.js
function r(e, t) {
	this._context = e, this._alpha = t;
}
r.prototype = {
	areaStart: e,
	areaEnd: e,
	lineStart: function() {
		this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN, this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0;
	},
	lineEnd: function() {
		switch (this._point) {
			case 1:
				this._context.moveTo(this._x3, this._y3), this._context.closePath();
				break;
			case 2:
				this._context.lineTo(this._x3, this._y3), this._context.closePath();
				break;
			case 3:
				this.point(this._x3, this._y3), this.point(this._x4, this._y4), this.point(this._x5, this._y5);
				break;
		}
	},
	point: function(e, t) {
		if (e = +e, t = +t, this._point) {
			var r = this._x2 - e, i = this._y2 - t;
			this._l23_a = Math.sqrt(this._l23_2a = (r * r + i * i) ** +this._alpha);
		}
		switch (this._point) {
			case 0:
				this._point = 1, this._x3 = e, this._y3 = t;
				break;
			case 1:
				this._point = 2, this._context.moveTo(this._x4 = e, this._y4 = t);
				break;
			case 2:
				this._point = 3, this._x5 = e, this._y5 = t;
				break;
			default:
				n(this, e, t);
				break;
		}
		this._l01_a = this._l12_a, this._l12_a = this._l23_a, this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a, this._x0 = this._x1, this._x1 = this._x2, this._x2 = e, this._y0 = this._y1, this._y1 = this._y2, this._y2 = t;
	}
};
var i = (function e(n) {
	function i(e) {
		return n ? new r(e, n) : new t(e, 0);
	}
	return i.alpha = function(t) {
		return e(+t);
	}, i;
})(.5);
//#endregion
export { i as default };
