// @svizzle/time_region_value v0.5.0 - © 2021 nestauk (https://www.nesta.org.uk/)
'use strict';

var format = require('./format-a62f401a.js');
var url = require('./url-66447f7e.js');

/* src/routes/index.svelte generated by Svelte v3.44.2 */

function add_css(target) {
	format.append_styles(target, "svelte-yz4j7q", ".time_region_value_Index.svelte-yz4j7q.svelte-yz4j7q{height:100%;width:100%;padding:var(--dimPadding) var(--dimPadding) 0 var(--dimPadding)}.time_region_value_Index.svelte-yz4j7q header.svelte-yz4j7q{height:var(--dimHeaderHeightShort)}.time_region_value_Index.svelte-yz4j7q .timedist.svelte-yz4j7q{height:calc(100% - var(--dimHeaderHeightShort));width:100%;overflow-y:auto}.group.svelte-yz4j7q.svelte-yz4j7q{margin-top:1rem}svg.svelte-yz4j7q .xref line.svelte-yz4j7q{stroke:var(--colorLightgrey);stroke-dasharray:2 2}svg.svelte-yz4j7q .xref text.svelte-yz4j7q{stroke:none;fill:var(--colorRef);dominant-baseline:hanging;text-anchor:middle;font-size:10px}svg.svelte-yz4j7q .indicatorsrange line.svelte-yz4j7q{stroke:var(--colorBlack);stroke-width:0.7;pointer-events:none}svg.svelte-yz4j7q .indicatorsrange text.svelte-yz4j7q{stroke:none;fill:var(--colorRef);dominant-baseline:middle;text-anchor:middle;pointer-events:none}svg.svelte-yz4j7q .indicatorsrange text.bkg.svelte-yz4j7q{stroke:var(--colorWhite);stroke-width:5}svg.svelte-yz4j7q .indicatorsrange circle.svelte-yz4j7q{fill-opacity:1;fill:var(--colorWhite);stroke:var(--colorBlack);stroke-width:1.5;cursor:pointer}");
}

function get_each_context(ctx, list, i) {
	const child_ctx = ctx.slice();
	child_ctx[12] = list[i].description;
	child_ctx[13] = list[i].indicators;
	child_ctx[14] = list[i].label;
	return child_ctx;
}

function get_each_context_1(ctx, list, i) {
	const child_ctx = ctx.slice();
	child_ctx[17] = list[i].availableYears;
	child_ctx[18] = list[i].title;
	child_ctx[19] = list[i].schema;
	child_ctx[20] = list[i].year_extent;
	child_ctx[22] = i;
	return child_ctx;
}

function get_each_context_2(ctx, list, i) {
	const child_ctx = ctx.slice();
	child_ctx[23] = list[i];
	return child_ctx;
}

function get_each_context_3(ctx, list, i) {
	const child_ctx = ctx.slice();
	child_ctx[23] = list[i];
	return child_ctx;
}

// (56:5) {#if width || isServerSide}
function create_if_block(ctx) {
	let svg;
	let each0_anchor;
	let svg_height_value;
	let each_value_3 = /*$_yearRange*/ ctx[7];
	let each_blocks_1 = [];

	for (let i = 0; i < each_value_3.length; i += 1) {
		each_blocks_1[i] = create_each_block_3(get_each_context_3(ctx, each_value_3, i));
	}

	let each_value_1 = /*indicators*/ ctx[13];
	let each_blocks = [];

	for (let i = 0; i < each_value_1.length; i += 1) {
		each_blocks[i] = create_each_block_1(get_each_context_1(ctx, each_value_1, i));
	}

	return {
		c() {
			svg = format.svg_element("svg");

			for (let i = 0; i < each_blocks_1.length; i += 1) {
				each_blocks_1[i].c();
			}

			each0_anchor = format.empty();

			for (let i = 0; i < each_blocks.length; i += 1) {
				each_blocks[i].c();
			}

			format.attr(svg, "width", /*width*/ ctx[3]);
			format.attr(svg, "height", svg_height_value = 4 * gap + /*layout*/ ctx[2].fontSize + /*vStep*/ ctx[5] * /*indicators*/ ctx[13].length);
			format.attr(svg, "class", "svelte-yz4j7q");
		},
		m(target, anchor) {
			format.insert(target, svg, anchor);

			for (let i = 0; i < each_blocks_1.length; i += 1) {
				each_blocks_1[i].m(svg, null);
			}

			format.append(svg, each0_anchor);

			for (let i = 0; i < each_blocks.length; i += 1) {
				each_blocks[i].m(svg, null);
			}
		},
		p(ctx, dirty) {
			if (dirty & /*layout, $_yearRange, gap, vStep, $_groups, shortenYearFn*/ 244) {
				each_value_3 = /*$_yearRange*/ ctx[7];
				let i;

				for (i = 0; i < each_value_3.length; i += 1) {
					const child_ctx = get_each_context_3(ctx, each_value_3, i);

					if (each_blocks_1[i]) {
						each_blocks_1[i].p(child_ctx, dirty);
					} else {
						each_blocks_1[i] = create_each_block_3(child_ctx);
						each_blocks_1[i].c();
						each_blocks_1[i].m(svg, each0_anchor);
					}
				}

				for (; i < each_blocks_1.length; i += 1) {
					each_blocks_1[i].d(1);
				}

				each_blocks_1.length = each_value_3.length;
			}

			if (dirty & /*vStep, $_groups, makeURL, $_hrefBase, layout, gap*/ 356) {
				each_value_1 = /*indicators*/ ctx[13];
				let i;

				for (i = 0; i < each_value_1.length; i += 1) {
					const child_ctx = get_each_context_1(ctx, each_value_1, i);

					if (each_blocks[i]) {
						each_blocks[i].p(child_ctx, dirty);
					} else {
						each_blocks[i] = create_each_block_1(child_ctx);
						each_blocks[i].c();
						each_blocks[i].m(svg, null);
					}
				}

				for (; i < each_blocks.length; i += 1) {
					each_blocks[i].d(1);
				}

				each_blocks.length = each_value_1.length;
			}

			if (dirty & /*width*/ 8) {
				format.attr(svg, "width", /*width*/ ctx[3]);
			}

			if (dirty & /*layout, vStep, $_groups*/ 100 && svg_height_value !== (svg_height_value = 4 * gap + /*layout*/ ctx[2].fontSize + /*vStep*/ ctx[5] * /*indicators*/ ctx[13].length)) {
				format.attr(svg, "height", svg_height_value);
			}
		},
		d(detaching) {
			if (detaching) format.detach(svg);
			format.destroy_each(each_blocks_1, detaching);
			format.destroy_each(each_blocks, detaching);
		}
	};
}

// (69:9) {#if indicators.length > 1}
function create_if_block_1(ctx) {
	let line;
	let line_y__value;

	return {
		c() {
			line = format.svg_element("line");
			format.attr(line, "y1", gap);
			format.attr(line, "y2", line_y__value = gap + /*vStep*/ ctx[5] * /*indicators*/ ctx[13].length);
			format.attr(line, "class", "svelte-yz4j7q");
		},
		m(target, anchor) {
			format.insert(target, line, anchor);
		},
		p(ctx, dirty) {
			if (dirty & /*vStep, $_groups*/ 96 && line_y__value !== (line_y__value = gap + /*vStep*/ ctx[5] * /*indicators*/ ctx[13].length)) {
				format.attr(line, "y2", line_y__value);
			}
		},
		d(detaching) {
			if (detaching) format.detach(line);
		}
	};
}

// (63:7) {#each $_yearRange as year}
function create_each_block_3(ctx) {
	let g;
	let text_1;
	let t_value = /*shortenYearFn*/ ctx[4](/*year*/ ctx[23]) + "";
	let t;
	let text_1_font_size_value;
	let text_1_y_value;
	let g_transform_value;
	let if_block = /*indicators*/ ctx[13].length > 1 && create_if_block_1(ctx);

	return {
		c() {
			g = format.svg_element("g");
			if (if_block) if_block.c();
			text_1 = format.svg_element("text");
			t = format.text(t_value);
			format.attr(text_1, "font-size", text_1_font_size_value = /*layout*/ ctx[2].fontSize);
			format.attr(text_1, "y", text_1_y_value = 2 * gap + /*vStep*/ ctx[5] * /*indicators*/ ctx[13].length + /*layout*/ ctx[2].fontSize / 2);
			format.attr(text_1, "class", "svelte-yz4j7q");
			format.attr(g, "class", "xref");
			format.attr(g, "transform", g_transform_value = "translate(" + /*layout*/ ctx[2].scaleX(/*year*/ ctx[23]) + ",0)");
		},
		m(target, anchor) {
			format.insert(target, g, anchor);
			if (if_block) if_block.m(g, null);
			format.append(g, text_1);
			format.append(text_1, t);
		},
		p(ctx, dirty) {
			if (/*indicators*/ ctx[13].length > 1) {
				if (if_block) {
					if_block.p(ctx, dirty);
				} else {
					if_block = create_if_block_1(ctx);
					if_block.c();
					if_block.m(g, text_1);
				}
			} else if (if_block) {
				if_block.d(1);
				if_block = null;
			}

			if (dirty & /*shortenYearFn, $_yearRange*/ 144 && t_value !== (t_value = /*shortenYearFn*/ ctx[4](/*year*/ ctx[23]) + "")) format.set_data(t, t_value);

			if (dirty & /*layout*/ 4 && text_1_font_size_value !== (text_1_font_size_value = /*layout*/ ctx[2].fontSize)) {
				format.attr(text_1, "font-size", text_1_font_size_value);
			}

			if (dirty & /*vStep, $_groups, layout*/ 100 && text_1_y_value !== (text_1_y_value = 2 * gap + /*vStep*/ ctx[5] * /*indicators*/ ctx[13].length + /*layout*/ ctx[2].fontSize / 2)) {
				format.attr(text_1, "y", text_1_y_value);
			}

			if (dirty & /*layout, $_yearRange*/ 132 && g_transform_value !== (g_transform_value = "translate(" + /*layout*/ ctx[2].scaleX(/*year*/ ctx[23]) + ",0)")) {
				format.attr(g, "transform", g_transform_value);
			}
		},
		d(detaching) {
			if (detaching) format.detach(g);
			if (if_block) if_block.d();
		}
	};
}

// (112:9) {#each availableYears as year}
function create_each_block_2(ctx) {
	let a;
	let circle;
	let circle_cx_value;
	let circle_r_value;
	let a_aria_label_value;
	let a_href_value;

	return {
		c() {
			a = format.svg_element("a");
			circle = format.svg_element("circle");
			format.attr(circle, "cx", circle_cx_value = /*layout*/ ctx[2].scaleX(/*year*/ ctx[23]));
			format.attr(circle, "r", circle_r_value = /*layout*/ ctx[2].radius);
			format.attr(circle, "class", "svelte-yz4j7q");
			format.attr(a, "aria-label", a_aria_label_value = /*year*/ ctx[23]);
			format.attr(a, "href", a_href_value = url.makeURL(/*$_hrefBase*/ ctx[8], /*schema*/ ctx[19].value.id, /*year*/ ctx[23]));
			format.attr(a, "rel", "prefetch");
		},
		m(target, anchor) {
			format.insert(target, a, anchor);
			format.append(a, circle);
		},
		p(ctx, dirty) {
			if (dirty & /*layout, $_groups*/ 68 && circle_cx_value !== (circle_cx_value = /*layout*/ ctx[2].scaleX(/*year*/ ctx[23]))) {
				format.attr(circle, "cx", circle_cx_value);
			}

			if (dirty & /*layout*/ 4 && circle_r_value !== (circle_r_value = /*layout*/ ctx[2].radius)) {
				format.attr(circle, "r", circle_r_value);
			}

			if (dirty & /*$_groups*/ 64 && a_aria_label_value !== (a_aria_label_value = /*year*/ ctx[23])) {
				format.attr(a, "aria-label", a_aria_label_value);
			}

			if (dirty & /*$_hrefBase, $_groups*/ 320 && a_href_value !== (a_href_value = url.makeURL(/*$_hrefBase*/ ctx[8], /*schema*/ ctx[19].value.id, /*year*/ ctx[23]))) {
				format.attr(a, "href", a_href_value);
			}
		},
		d(detaching) {
			if (detaching) format.detach(a);
		}
	};
}

// (87:7) {#each indicators as {availableYears, title, schema, year_extent}
function create_each_block_1(ctx) {
	let g;
	let text0;
	let t0_value = /*title*/ ctx[18] + "";
	let t0;
	let text0_x_value;
	let text0_dy_value;
	let text0_font_size_value;
	let text1;
	let t1_value = /*title*/ ctx[18] + "";
	let t1;
	let text1_x_value;
	let text1_dy_value;
	let text1_font_size_value;
	let line;
	let line_x__value;
	let line_x__value_1;
	let g_transform_value;
	let each_value_2 = /*availableYears*/ ctx[17];
	let each_blocks = [];

	for (let i = 0; i < each_value_2.length; i += 1) {
		each_blocks[i] = create_each_block_2(get_each_context_2(ctx, each_value_2, i));
	}

	return {
		c() {
			g = format.svg_element("g");
			text0 = format.svg_element("text");
			t0 = format.text(t0_value);
			text1 = format.svg_element("text");
			t1 = format.text(t1_value);
			line = format.svg_element("line");

			for (let i = 0; i < each_blocks.length; i += 1) {
				each_blocks[i].c();
			}

			format.attr(text0, "class", "bkg svelte-yz4j7q");
			format.attr(text0, "x", text0_x_value = (/*layout*/ ctx[2].scaleX(/*year_extent*/ ctx[20][0]) + /*layout*/ ctx[2].scaleX(/*year_extent*/ ctx[20][1])) / 2);
			format.attr(text0, "dy", text0_dy_value = -(/*layout*/ ctx[2].fontSize + gap));
			format.attr(text0, "font-size", text0_font_size_value = /*layout*/ ctx[2].fontSize);
			format.attr(text1, "x", text1_x_value = (/*layout*/ ctx[2].scaleX(/*year_extent*/ ctx[20][0]) + /*layout*/ ctx[2].scaleX(/*year_extent*/ ctx[20][1])) / 2);
			format.attr(text1, "dy", text1_dy_value = -(/*layout*/ ctx[2].fontSize + gap));
			format.attr(text1, "font-size", text1_font_size_value = /*layout*/ ctx[2].fontSize);
			format.attr(text1, "class", "svelte-yz4j7q");
			format.attr(line, "x1", line_x__value = /*layout*/ ctx[2].scaleX(/*year_extent*/ ctx[20][0]) + /*layout*/ ctx[2].radius);
			format.attr(line, "x2", line_x__value_1 = /*layout*/ ctx[2].scaleX(/*year_extent*/ ctx[20][1]) - /*layout*/ ctx[2].radius);
			format.attr(line, "class", "svelte-yz4j7q");
			format.attr(g, "class", "indicatorsrange");
			format.attr(g, "transform", g_transform_value = "translate(0," + /*vStep*/ ctx[5] * (/*y*/ ctx[22] + 1) + ")");
		},
		m(target, anchor) {
			format.insert(target, g, anchor);
			format.append(g, text0);
			format.append(text0, t0);
			format.append(g, text1);
			format.append(text1, t1);
			format.append(g, line);

			for (let i = 0; i < each_blocks.length; i += 1) {
				each_blocks[i].m(g, null);
			}
		},
		p(ctx, dirty) {
			if (dirty & /*$_groups*/ 64 && t0_value !== (t0_value = /*title*/ ctx[18] + "")) format.set_data(t0, t0_value);

			if (dirty & /*layout, $_groups*/ 68 && text0_x_value !== (text0_x_value = (/*layout*/ ctx[2].scaleX(/*year_extent*/ ctx[20][0]) + /*layout*/ ctx[2].scaleX(/*year_extent*/ ctx[20][1])) / 2)) {
				format.attr(text0, "x", text0_x_value);
			}

			if (dirty & /*layout*/ 4 && text0_dy_value !== (text0_dy_value = -(/*layout*/ ctx[2].fontSize + gap))) {
				format.attr(text0, "dy", text0_dy_value);
			}

			if (dirty & /*layout*/ 4 && text0_font_size_value !== (text0_font_size_value = /*layout*/ ctx[2].fontSize)) {
				format.attr(text0, "font-size", text0_font_size_value);
			}

			if (dirty & /*$_groups*/ 64 && t1_value !== (t1_value = /*title*/ ctx[18] + "")) format.set_data(t1, t1_value);

			if (dirty & /*layout, $_groups*/ 68 && text1_x_value !== (text1_x_value = (/*layout*/ ctx[2].scaleX(/*year_extent*/ ctx[20][0]) + /*layout*/ ctx[2].scaleX(/*year_extent*/ ctx[20][1])) / 2)) {
				format.attr(text1, "x", text1_x_value);
			}

			if (dirty & /*layout*/ 4 && text1_dy_value !== (text1_dy_value = -(/*layout*/ ctx[2].fontSize + gap))) {
				format.attr(text1, "dy", text1_dy_value);
			}

			if (dirty & /*layout*/ 4 && text1_font_size_value !== (text1_font_size_value = /*layout*/ ctx[2].fontSize)) {
				format.attr(text1, "font-size", text1_font_size_value);
			}

			if (dirty & /*layout, $_groups*/ 68 && line_x__value !== (line_x__value = /*layout*/ ctx[2].scaleX(/*year_extent*/ ctx[20][0]) + /*layout*/ ctx[2].radius)) {
				format.attr(line, "x1", line_x__value);
			}

			if (dirty & /*layout, $_groups*/ 68 && line_x__value_1 !== (line_x__value_1 = /*layout*/ ctx[2].scaleX(/*year_extent*/ ctx[20][1]) - /*layout*/ ctx[2].radius)) {
				format.attr(line, "x2", line_x__value_1);
			}

			if (dirty & /*$_groups, makeURL, $_hrefBase, layout*/ 324) {
				each_value_2 = /*availableYears*/ ctx[17];
				let i;

				for (i = 0; i < each_value_2.length; i += 1) {
					const child_ctx = get_each_context_2(ctx, each_value_2, i);

					if (each_blocks[i]) {
						each_blocks[i].p(child_ctx, dirty);
					} else {
						each_blocks[i] = create_each_block_2(child_ctx);
						each_blocks[i].c();
						each_blocks[i].m(g, null);
					}
				}

				for (; i < each_blocks.length; i += 1) {
					each_blocks[i].d(1);
				}

				each_blocks.length = each_value_2.length;
			}

			if (dirty & /*vStep*/ 32 && g_transform_value !== (g_transform_value = "translate(0," + /*vStep*/ ctx[5] * (/*y*/ ctx[22] + 1) + ")")) {
				format.attr(g, "transform", g_transform_value);
			}
		},
		d(detaching) {
			if (detaching) format.detach(g);
			format.destroy_each(each_blocks, detaching);
		}
	};
}

// (51:3) {#each $_groups as {description, indicators, label}}
function create_each_block(ctx) {
	let li;
	let h2;
	let t0_value = /*label*/ ctx[14] + "";
	let t0;
	let t1;
	let p;
	let t2_value = /*description*/ ctx[12] + "";
	let t2;
	let t3;
	let t4;
	let if_block = (/*width*/ ctx[3] || format.isServerSide) && create_if_block(ctx);

	return {
		c() {
			li = format.element("li");
			h2 = format.element("h2");
			t0 = format.text(t0_value);
			t1 = format.space();
			p = format.element("p");
			t2 = format.text(t2_value);
			t3 = format.space();
			if (if_block) if_block.c();
			t4 = format.space();
			format.attr(li, "class", "group svelte-yz4j7q");
		},
		m(target, anchor) {
			format.insert(target, li, anchor);
			format.append(li, h2);
			format.append(h2, t0);
			format.append(li, t1);
			format.append(li, p);
			format.append(p, t2);
			format.append(li, t3);
			if (if_block) if_block.m(li, null);
			format.append(li, t4);
		},
		p(ctx, dirty) {
			if (dirty & /*$_groups*/ 64 && t0_value !== (t0_value = /*label*/ ctx[14] + "")) format.set_data(t0, t0_value);
			if (dirty & /*$_groups*/ 64 && t2_value !== (t2_value = /*description*/ ctx[12] + "")) format.set_data(t2, t2_value);

			if (/*width*/ ctx[3] || format.isServerSide) {
				if (if_block) {
					if_block.p(ctx, dirty);
				} else {
					if_block = create_if_block(ctx);
					if_block.c();
					if_block.m(li, t4);
				}
			} else if (if_block) {
				if_block.d(1);
				if_block = null;
			}
		},
		d(detaching) {
			if (detaching) format.detach(li);
			if (if_block) if_block.d();
		}
	};
}

function create_fragment(ctx) {
	let div1;
	let header;
	let t1;
	let div0;
	let ul;
	let div0_resize_listener;
	let each_value = /*$_groups*/ ctx[6];
	let each_blocks = [];

	for (let i = 0; i < each_value.length; i += 1) {
		each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i));
	}

	return {
		c() {
			div1 = format.element("div");
			header = format.element("header");
			header.innerHTML = `<h1>Indicators</h1>`;
			t1 = format.space();
			div0 = format.element("div");
			ul = format.element("ul");

			for (let i = 0; i < each_blocks.length; i += 1) {
				each_blocks[i].c();
			}

			format.attr(header, "class", "svelte-yz4j7q");
			format.attr(div0, "class", "timedist svelte-yz4j7q");
			format.add_render_callback(() => /*div0_elementresize_handler*/ ctx[11].call(div0));
			format.attr(div1, "class", "time_region_value_Index svelte-yz4j7q");
		},
		m(target, anchor) {
			format.insert(target, div1, anchor);
			format.append(div1, header);
			format.append(div1, t1);
			format.append(div1, div0);
			format.append(div0, ul);

			for (let i = 0; i < each_blocks.length; i += 1) {
				each_blocks[i].m(ul, null);
			}

			div0_resize_listener = format.add_resize_listener(div0, /*div0_elementresize_handler*/ ctx[11].bind(div0));
		},
		p(ctx, [dirty]) {
			if (dirty & /*width, gap, layout, vStep, $_groups, makeURL, $_hrefBase, $_yearRange, shortenYearFn, isServerSide*/ 508) {
				each_value = /*$_groups*/ ctx[6];
				let i;

				for (i = 0; i < each_value.length; i += 1) {
					const child_ctx = get_each_context(ctx, each_value, i);

					if (each_blocks[i]) {
						each_blocks[i].p(child_ctx, dirty);
					} else {
						each_blocks[i] = create_each_block(child_ctx);
						each_blocks[i].c();
						each_blocks[i].m(ul, null);
					}
				}

				for (; i < each_blocks.length; i += 1) {
					each_blocks[i].d(1);
				}

				each_blocks.length = each_value.length;
			}
		},
		i: format.noop,
		o: format.noop,
		d(detaching) {
			if (detaching) format.detach(div1);
			format.destroy_each(each_blocks, detaching);
			div0_resize_listener();
		}
	};
}

const gap = 7;

function instance($$self, $$props, $$invalidate) {
	let layout;
	let vStep;
	let shortenYearFn;
	let $_isSmallScreen;
	let $_timelineLayout;

	let $_groups,
		$$unsubscribe__groups = format.noop,
		$$subscribe__groups = () => ($$unsubscribe__groups(), $$unsubscribe__groups = format.subscribe(_groups, $$value => $$invalidate(6, $_groups = $$value)), _groups);

	let $_yearRange,
		$$unsubscribe__yearRange = format.noop,
		$$subscribe__yearRange = () => ($$unsubscribe__yearRange(), $$unsubscribe__yearRange = format.subscribe(_yearRange, $$value => $$invalidate(7, $_yearRange = $$value)), _yearRange);

	let $_hrefBase;
	format.component_subscribe($$self, format._isSmallScreen, $$value => $$invalidate(9, $_isSmallScreen = $$value));
	format.component_subscribe($$self, format._timelineLayout, $$value => $$invalidate(10, $_timelineLayout = $$value));
	format.component_subscribe($$self, format._hrefBase, $$value => $$invalidate(8, $_hrefBase = $$value));
	$$self.$$.on_destroy.push(() => $$unsubscribe__groups());
	$$self.$$.on_destroy.push(() => $$unsubscribe__yearRange());
	let { _groups = null } = $$props;
	$$subscribe__groups();
	let { _yearRange = null } = $$props;
	$$subscribe__yearRange();

	/* init */
	format.onMount(() => {
		format.resetSelectedYear();
		format.setRoute('Index');
		format.showView('distribution');
	});

	/* local vars */
	// bound
	let width;

	function div0_elementresize_handler() {
		width = this.clientWidth;
		$$invalidate(3, width);
	}

	$$self.$$set = $$props => {
		if ('_groups' in $$props) $$subscribe__groups($$invalidate(0, _groups = $$props._groups));
		if ('_yearRange' in $$props) $$subscribe__yearRange($$invalidate(1, _yearRange = $$props._yearRange));
	};

	$$self.$$.update = () => {
		if ($$self.$$.dirty & /*$_timelineLayout*/ 1024) {
			$$invalidate(2, layout = $_timelineLayout);
		}

		if ($$self.$$.dirty & /*layout*/ 4) {
			$$invalidate(5, vStep = 2 * layout.radius + 3 * gap + layout.fontSize);
		}

		if ($$self.$$.dirty & /*$_isSmallScreen*/ 512) {
			$$invalidate(4, shortenYearFn = $_isSmallScreen ? format.shortenYear : format.identity);
		}
	};

	return [
		_groups,
		_yearRange,
		layout,
		width,
		shortenYearFn,
		vStep,
		$_groups,
		$_yearRange,
		$_hrefBase,
		$_isSmallScreen,
		$_timelineLayout,
		div0_elementresize_handler
	];
}

class Routes extends format.SvelteComponent {
	constructor(options) {
		super();
		format.init(this, options, instance, create_fragment, format.safe_not_equal, { _groups: 0, _yearRange: 1 }, add_css);
	}
}

module.exports = Routes;
