import noop_default from "../noop.js";
import { point } from "./cardinal.js";
function CardinalClosed(e, t) {
	this._context = e, this._k = (1 - t) / 6;
}
CardinalClosed.prototype = {
	areaStart: noop_default,
	areaEnd: noop_default,
	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._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, n) {
		switch (e = +e, n = +n, this._point) {
			case 0:
				this._point = 1, this._x3 = e, this._y3 = n;
				break;
			case 1:
				this._point = 2, this._context.moveTo(this._x4 = e, this._y4 = n);
				break;
			case 2:
				this._point = 3, this._x5 = e, this._y5 = n;
				break;
			default:
				point(this, e, n);
				break;
		}
		this._x0 = this._x1, this._x1 = this._x2, this._x2 = e, this._y0 = this._y1, this._y1 = this._y2, this._y2 = n;
	}
};
var cardinalClosed_default = (function e(t) {
	function r(e) {
		return new CardinalClosed(e, t);
	}
	return r.tension = function(t) {
		return e(+t);
	}, r;
})(0);
export { CardinalClosed, cardinalClosed_default as default };
