/* generated by Svelte vX.Y.Z */
import { SvelteComponent as SvelteComponent_1, addListener, createElement, detachNode, flush, init, insert, run, run_all, safe_not_equal, setAttribute, toNumber } from "svelte/internal";

function create_fragment(component, ctx) {
	var input, current, dispose;

	return {
		c() {
			input = createElement("input");
			setAttribute(input, "type", "range");

			dispose = [
				addListener(input, "change", ctx.input_change_input_handler),
				addListener(input, "input", ctx.input_change_input_handler)
			];
		},

		m(target, anchor) {
			insert(target, input, anchor);

			input.value = ctx.value;

			current = true;
		},

		p(changed, ctx) {
			if (changed.value) input.value = ctx.value;
		},

		i(target, anchor) {
			if (current) return;
			this.m(target, anchor);
		},

		o: run,

		d(detach) {
			if (detach) {
				detachNode(input);
			}

			run_all(dispose);
		}
	};
}

function instance($$self, $$props, $$invalidate) {
	let { value } = $$props;

	function input_change_input_handler() {
		value = toNumber(this.value);
		$$invalidate('value', value);
	}

	$$self.$set = $$props => {
		if ('value' in $$props) $$invalidate('value', value = $$props.value);
	};

	return { value, input_change_input_handler };
}

class SvelteComponent extends SvelteComponent_1 {
	constructor(options) {
		super();
		init(this, options, instance, create_fragment, safe_not_equal);
	}

	get value() {
		return this.$$.ctx.value;
	}

	set value(value) {
		this.$set({ value });
		flush();
	}
}

export default SvelteComponent;