1 | function noop() { }
|
2 | const identity = x => x;
|
3 | function assign(tar, src) {
|
4 |
|
5 | for (const k in src)
|
6 | tar[k] = src[k];
|
7 | return tar;
|
8 | }
|
9 | function is_promise(value) {
|
10 | return value && typeof value === 'object' && typeof value.then === 'function';
|
11 | }
|
12 | function add_location(element, file, line, column, char) {
|
13 | element.__svelte_meta = {
|
14 | loc: { file, line, column, char }
|
15 | };
|
16 | }
|
17 | function run(fn) {
|
18 | return fn();
|
19 | }
|
20 | function blank_object() {
|
21 | return Object.create(null);
|
22 | }
|
23 | function run_all(fns) {
|
24 | fns.forEach(run);
|
25 | }
|
26 | function is_function(thing) {
|
27 | return typeof thing === 'function';
|
28 | }
|
29 | function safe_not_equal(a, b) {
|
30 | return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
|
31 | }
|
32 | function not_equal(a, b) {
|
33 | return a != a ? b == b : a !== b;
|
34 | }
|
35 | function validate_store(store, name) {
|
36 | if (!store || typeof store.subscribe !== 'function') {
|
37 | throw new Error(`'${name}' is not a store with a 'subscribe' method`);
|
38 | }
|
39 | }
|
40 | function subscribe(component, store, callback) {
|
41 | const unsub = store.subscribe(callback);
|
42 | component.$$.on_destroy.push(unsub.unsubscribe
|
43 | ? () => unsub.unsubscribe()
|
44 | : unsub);
|
45 | }
|
46 | function create_slot(definition, ctx, fn) {
|
47 | if (definition) {
|
48 | const slot_ctx = get_slot_context(definition, ctx, fn);
|
49 | return definition[0](slot_ctx);
|
50 | }
|
51 | }
|
52 | function get_slot_context(definition, ctx, fn) {
|
53 | return definition[1]
|
54 | ? assign({}, assign(ctx.$$scope.ctx, definition[1](fn ? fn(ctx) : {})))
|
55 | : ctx.$$scope.ctx;
|
56 | }
|
57 | function get_slot_changes(definition, ctx, changed, fn) {
|
58 | return definition[1]
|
59 | ? assign({}, assign(ctx.$$scope.changed || {}, definition[1](fn ? fn(changed) : {})))
|
60 | : ctx.$$scope.changed || {};
|
61 | }
|
62 | function exclude_internal_props(props) {
|
63 | const result = {};
|
64 | for (const k in props)
|
65 | if (k[0] !== '$')
|
66 | result[k] = props[k];
|
67 | return result;
|
68 | }
|
69 | function once(fn) {
|
70 | let ran = false;
|
71 | return function (...args) {
|
72 | if (ran)
|
73 | return;
|
74 | ran = true;
|
75 | fn.call(this, ...args);
|
76 | };
|
77 | }
|
78 | const is_client = typeof window !== 'undefined';
|
79 | let now = is_client
|
80 | ? () => window.performance.now()
|
81 | : () => Date.now();
|
82 | let raf = is_client ? requestAnimationFrame : noop;
|
83 |
|
84 | function set_now(fn) {
|
85 | now = fn;
|
86 | }
|
87 | function set_raf(fn) {
|
88 | raf = fn;
|
89 | }
|
90 |
|
91 | const tasks = new Set();
|
92 | let running = false;
|
93 | function run_tasks() {
|
94 | tasks.forEach(task => {
|
95 | if (!task[0](now())) {
|
96 | tasks.delete(task);
|
97 | task[1]();
|
98 | }
|
99 | });
|
100 | running = tasks.size > 0;
|
101 | if (running)
|
102 | raf(run_tasks);
|
103 | }
|
104 | function clear_loops() {
|
105 |
|
106 | tasks.forEach(task => tasks.delete(task));
|
107 | running = false;
|
108 | }
|
109 | function loop(fn) {
|
110 | let task;
|
111 | if (!running) {
|
112 | running = true;
|
113 | raf(run_tasks);
|
114 | }
|
115 | return {
|
116 | promise: new Promise(fulfil => {
|
117 | tasks.add(task = [fn, fulfil]);
|
118 | }),
|
119 | abort() {
|
120 | tasks.delete(task);
|
121 | }
|
122 | };
|
123 | }
|
124 |
|
125 | function append(target, node) {
|
126 | target.appendChild(node);
|
127 | }
|
128 | function insert(target, node, anchor) {
|
129 | target.insertBefore(node, anchor || null);
|
130 | }
|
131 | function detach(node) {
|
132 | node.parentNode.removeChild(node);
|
133 | }
|
134 | function detach_between(before, after) {
|
135 | while (before.nextSibling && before.nextSibling !== after) {
|
136 | before.parentNode.removeChild(before.nextSibling);
|
137 | }
|
138 | }
|
139 | function detach_before(after) {
|
140 | while (after.previousSibling) {
|
141 | after.parentNode.removeChild(after.previousSibling);
|
142 | }
|
143 | }
|
144 | function detach_after(before) {
|
145 | while (before.nextSibling) {
|
146 | before.parentNode.removeChild(before.nextSibling);
|
147 | }
|
148 | }
|
149 | function destroy_each(iterations, detaching) {
|
150 | for (let i = 0; i < iterations.length; i += 1) {
|
151 | if (iterations[i])
|
152 | iterations[i].d(detaching);
|
153 | }
|
154 | }
|
155 | function element(name) {
|
156 | return document.createElement(name);
|
157 | }
|
158 | function object_without_properties(obj, exclude) {
|
159 |
|
160 | const target = {};
|
161 | for (const k in obj) {
|
162 | if (Object.prototype.hasOwnProperty.call(obj, k)
|
163 |
|
164 | && exclude.indexOf(k) === -1) {
|
165 |
|
166 | target[k] = obj[k];
|
167 | }
|
168 | }
|
169 | return target;
|
170 | }
|
171 | function svg_element(name) {
|
172 | return document.createElementNS('http://www.w3.org/2000/svg', name);
|
173 | }
|
174 | function text(data) {
|
175 | return document.createTextNode(data);
|
176 | }
|
177 | function space() {
|
178 | return text(' ');
|
179 | }
|
180 | function empty() {
|
181 | return text('');
|
182 | }
|
183 | function listen(node, event, handler, options) {
|
184 | node.addEventListener(event, handler, options);
|
185 | return () => node.removeEventListener(event, handler, options);
|
186 | }
|
187 | function prevent_default(fn) {
|
188 | return function (event) {
|
189 | event.preventDefault();
|
190 |
|
191 | return fn.call(this, event);
|
192 | };
|
193 | }
|
194 | function stop_propagation(fn) {
|
195 | return function (event) {
|
196 | event.stopPropagation();
|
197 |
|
198 | return fn.call(this, event);
|
199 | };
|
200 | }
|
201 | function attr(node, attribute, value) {
|
202 | if (value == null)
|
203 | node.removeAttribute(attribute);
|
204 | else
|
205 | node.setAttribute(attribute, value);
|
206 | }
|
207 | function set_attributes(node, attributes) {
|
208 | for (const key in attributes) {
|
209 | if (key === 'style') {
|
210 | node.style.cssText = attributes[key];
|
211 | }
|
212 | else if (key in node) {
|
213 | node[key] = attributes[key];
|
214 | }
|
215 | else {
|
216 | attr(node, key, attributes[key]);
|
217 | }
|
218 | }
|
219 | }
|
220 | function set_custom_element_data(node, prop, value) {
|
221 | if (prop in node) {
|
222 | node[prop] = value;
|
223 | }
|
224 | else {
|
225 | attr(node, prop, value);
|
226 | }
|
227 | }
|
228 | function xlink_attr(node, attribute, value) {
|
229 | node.setAttributeNS('http://www.w3.org/1999/xlink', attribute, value);
|
230 | }
|
231 | function get_binding_group_value(group) {
|
232 | const value = [];
|
233 | for (let i = 0; i < group.length; i += 1) {
|
234 | if (group[i].checked)
|
235 | value.push(group[i].__value);
|
236 | }
|
237 | return value;
|
238 | }
|
239 | function to_number(value) {
|
240 | return value === '' ? undefined : +value;
|
241 | }
|
242 | function time_ranges_to_array(ranges) {
|
243 | const array = [];
|
244 | for (let i = 0; i < ranges.length; i += 1) {
|
245 | array.push({ start: ranges.start(i), end: ranges.end(i) });
|
246 | }
|
247 | return array;
|
248 | }
|
249 | function children(element) {
|
250 | return Array.from(element.childNodes);
|
251 | }
|
252 | function claim_element(nodes, name, attributes, svg) {
|
253 | for (let i = 0; i < nodes.length; i += 1) {
|
254 | const node = nodes[i];
|
255 | if (node.nodeName === name) {
|
256 | for (let j = 0; j < node.attributes.length; j += 1) {
|
257 | const attribute = node.attributes[j];
|
258 | if (!attributes[attribute.name])
|
259 | node.removeAttribute(attribute.name);
|
260 | }
|
261 | return nodes.splice(i, 1)[0];
|
262 | }
|
263 | }
|
264 | return svg ? svg_element(name) : element(name);
|
265 | }
|
266 | function claim_text(nodes, data) {
|
267 | for (let i = 0; i < nodes.length; i += 1) {
|
268 | const node = nodes[i];
|
269 | if (node.nodeType === 3) {
|
270 | node.data = data;
|
271 | return nodes.splice(i, 1)[0];
|
272 | }
|
273 | }
|
274 | return text(data);
|
275 | }
|
276 | function set_data(text, data) {
|
277 | data = '' + data;
|
278 | if (text.data !== data)
|
279 | text.data = data;
|
280 | }
|
281 | function set_input_type(input, type) {
|
282 | try {
|
283 | input.type = type;
|
284 | }
|
285 | catch (e) {
|
286 |
|
287 | }
|
288 | }
|
289 | function set_style(node, key, value) {
|
290 | node.style.setProperty(key, value);
|
291 | }
|
292 | function select_option(select, value) {
|
293 | for (let i = 0; i < select.options.length; i += 1) {
|
294 | const option = select.options[i];
|
295 | if (option.__value === value) {
|
296 | option.selected = true;
|
297 | return;
|
298 | }
|
299 | }
|
300 | }
|
301 | function select_options(select, value) {
|
302 | for (let i = 0; i < select.options.length; i += 1) {
|
303 | const option = select.options[i];
|
304 | option.selected = ~value.indexOf(option.__value);
|
305 | }
|
306 | }
|
307 | function select_value(select) {
|
308 | const selected_option = select.querySelector(':checked') || select.options[0];
|
309 | return selected_option && selected_option.__value;
|
310 | }
|
311 | function select_multiple_value(select) {
|
312 | return [].map.call(select.querySelectorAll(':checked'), option => option.__value);
|
313 | }
|
314 | function add_resize_listener(element, fn) {
|
315 | if (getComputedStyle(element).position === 'static') {
|
316 | element.style.position = 'relative';
|
317 | }
|
318 | const object = document.createElement('object');
|
319 | object.setAttribute('style', 'display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1;');
|
320 | object.type = 'text/html';
|
321 | let win;
|
322 | object.onload = () => {
|
323 | win = object.contentDocument.defaultView;
|
324 | win.addEventListener('resize', fn);
|
325 | };
|
326 | if (/Trident/.test(navigator.userAgent)) {
|
327 | element.appendChild(object);
|
328 | object.data = 'about:blank';
|
329 | }
|
330 | else {
|
331 | object.data = 'about:blank';
|
332 | element.appendChild(object);
|
333 | }
|
334 | return {
|
335 | cancel: () => {
|
336 | win && win.removeEventListener && win.removeEventListener('resize', fn);
|
337 | element.removeChild(object);
|
338 | }
|
339 | };
|
340 | }
|
341 | function toggle_class(element, name, toggle) {
|
342 | element.classList[toggle ? 'add' : 'remove'](name);
|
343 | }
|
344 | function custom_event(type, detail) {
|
345 | const e = document.createEvent('CustomEvent');
|
346 | e.initCustomEvent(type, false, false, detail);
|
347 | return e;
|
348 | }
|
349 |
|
350 | let stylesheet;
|
351 | let active = 0;
|
352 | let current_rules = {};
|
353 |
|
354 | function hash(str) {
|
355 | let hash = 5381;
|
356 | let i = str.length;
|
357 | while (i--)
|
358 | hash = ((hash << 5) - hash) ^ str.charCodeAt(i);
|
359 | return hash >>> 0;
|
360 | }
|
361 | function create_rule(node, a, b, duration, delay, ease, fn, uid = 0) {
|
362 | const step = 16.666 / duration;
|
363 | let keyframes = '{\n';
|
364 | for (let p = 0; p <= 1; p += step) {
|
365 | const t = a + (b - a) * ease(p);
|
366 | keyframes += p * 100 + `%{${fn(t, 1 - t)}}\n`;
|
367 | }
|
368 | const rule = keyframes + `100% {${fn(b, 1 - b)}}\n}`;
|
369 | const name = `__svelte_${hash(rule)}_${uid}`;
|
370 | if (!current_rules[name]) {
|
371 | if (!stylesheet) {
|
372 | const style = element('style');
|
373 | document.head.appendChild(style);
|
374 | stylesheet = style.sheet;
|
375 | }
|
376 | current_rules[name] = true;
|
377 | stylesheet.insertRule(`@keyframes ${name} ${rule}`, stylesheet.cssRules.length);
|
378 | }
|
379 | const animation = node.style.animation || '';
|
380 | node.style.animation = `${animation ? `${animation}, ` : ``}${name} ${duration}ms linear ${delay}ms 1 both`;
|
381 | active += 1;
|
382 | return name;
|
383 | }
|
384 | function delete_rule(node, name) {
|
385 | node.style.animation = (node.style.animation || '')
|
386 | .split(', ')
|
387 | .filter(name
|
388 | ? anim => anim.indexOf(name) < 0
|
389 | : anim => anim.indexOf('__svelte') === -1
|
390 | )
|
391 | .join(', ');
|
392 | if (name && !--active)
|
393 | clear_rules();
|
394 | }
|
395 | function clear_rules() {
|
396 | raf(() => {
|
397 | if (active)
|
398 | return;
|
399 | let i = stylesheet.cssRules.length;
|
400 | while (i--)
|
401 | stylesheet.deleteRule(i);
|
402 | current_rules = {};
|
403 | });
|
404 | }
|
405 |
|
406 | function create_animation(node, from, fn, params) {
|
407 | if (!from)
|
408 | return noop;
|
409 | const to = node.getBoundingClientRect();
|
410 | if (from.left === to.left && from.right === to.right && from.top === to.top && from.bottom === to.bottom)
|
411 | return noop;
|
412 | const { delay = 0, duration = 300, easing = identity,
|
413 |
|
414 | start: start_time = now() + delay,
|
415 |
|
416 | end = start_time + duration, tick = noop, css } = fn(node, { from, to }, params);
|
417 | let running = true;
|
418 | let started = false;
|
419 | let name;
|
420 | function start() {
|
421 | if (css) {
|
422 | name = create_rule(node, 0, 1, duration, delay, easing, css);
|
423 | }
|
424 | if (!delay) {
|
425 | started = true;
|
426 | }
|
427 | }
|
428 | function stop() {
|
429 | if (css)
|
430 | delete_rule(node, name);
|
431 | running = false;
|
432 | }
|
433 | loop(now$$1 => {
|
434 | if (!started && now$$1 >= start_time) {
|
435 | started = true;
|
436 | }
|
437 | if (started && now$$1 >= end) {
|
438 | tick(1, 0);
|
439 | stop();
|
440 | }
|
441 | if (!running) {
|
442 | return false;
|
443 | }
|
444 | if (started) {
|
445 | const p = now$$1 - start_time;
|
446 | const t = 0 + 1 * easing(p / duration);
|
447 | tick(t, 1 - t);
|
448 | }
|
449 | return true;
|
450 | });
|
451 | start();
|
452 | tick(0, 1);
|
453 | return stop;
|
454 | }
|
455 | function fix_position(node) {
|
456 | const style = getComputedStyle(node);
|
457 | if (style.position !== 'absolute' && style.position !== 'fixed') {
|
458 | const { width, height } = style;
|
459 | const a = node.getBoundingClientRect();
|
460 | node.style.position = 'absolute';
|
461 | node.style.width = width;
|
462 | node.style.height = height;
|
463 | add_transform(node, a);
|
464 | }
|
465 | }
|
466 | function add_transform(node, a) {
|
467 | const b = node.getBoundingClientRect();
|
468 | if (a.left !== b.left || a.top !== b.top) {
|
469 | const style = getComputedStyle(node);
|
470 | const transform = style.transform === 'none' ? '' : style.transform;
|
471 | node.style.transform = `${transform} translate(${a.left - b.left}px, ${a.top - b.top}px)`;
|
472 | }
|
473 | }
|
474 |
|
475 | let current_component;
|
476 | function set_current_component(component) {
|
477 | current_component = component;
|
478 | }
|
479 | function get_current_component() {
|
480 | if (!current_component)
|
481 | throw new Error(`Function called outside component initialization`);
|
482 | return current_component;
|
483 | }
|
484 | function beforeUpdate(fn) {
|
485 | get_current_component().$$.before_render.push(fn);
|
486 | }
|
487 | function onMount(fn) {
|
488 | get_current_component().$$.on_mount.push(fn);
|
489 | }
|
490 | function afterUpdate(fn) {
|
491 | get_current_component().$$.after_render.push(fn);
|
492 | }
|
493 | function onDestroy(fn) {
|
494 | get_current_component().$$.on_destroy.push(fn);
|
495 | }
|
496 | function createEventDispatcher() {
|
497 | const component = current_component;
|
498 | return (type, detail) => {
|
499 | const callbacks = component.$$.callbacks[type];
|
500 | if (callbacks) {
|
501 |
|
502 |
|
503 | const event = custom_event(type, detail);
|
504 | callbacks.slice().forEach(fn => {
|
505 | fn.call(component, event);
|
506 | });
|
507 | }
|
508 | };
|
509 | }
|
510 | function setContext(key, context) {
|
511 | get_current_component().$$.context.set(key, context);
|
512 | }
|
513 | function getContext(key) {
|
514 | return get_current_component().$$.context.get(key);
|
515 | }
|
516 |
|
517 |
|
518 |
|
519 | function bubble(component, event) {
|
520 | const callbacks = component.$$.callbacks[event.type];
|
521 | if (callbacks) {
|
522 | callbacks.slice().forEach(fn => fn(event));
|
523 | }
|
524 | }
|
525 |
|
526 | const dirty_components = [];
|
527 | const intros = { enabled: false };
|
528 | const resolved_promise = Promise.resolve();
|
529 | let update_scheduled = false;
|
530 | const binding_callbacks = [];
|
531 | const render_callbacks = [];
|
532 | const flush_callbacks = [];
|
533 | function schedule_update() {
|
534 | if (!update_scheduled) {
|
535 | update_scheduled = true;
|
536 | resolved_promise.then(flush);
|
537 | }
|
538 | }
|
539 | function tick() {
|
540 | schedule_update();
|
541 | return resolved_promise;
|
542 | }
|
543 | function add_binding_callback(fn) {
|
544 | binding_callbacks.push(fn);
|
545 | }
|
546 | function add_render_callback(fn) {
|
547 | render_callbacks.push(fn);
|
548 | }
|
549 | function add_flush_callback(fn) {
|
550 | flush_callbacks.push(fn);
|
551 | }
|
552 | function flush() {
|
553 | const seen_callbacks = new Set();
|
554 | do {
|
555 |
|
556 |
|
557 | while (dirty_components.length) {
|
558 | const component = dirty_components.shift();
|
559 | set_current_component(component);
|
560 | update(component.$$);
|
561 | }
|
562 | while (binding_callbacks.length)
|
563 | binding_callbacks.shift()();
|
564 |
|
565 |
|
566 |
|
567 | while (render_callbacks.length) {
|
568 | const callback = render_callbacks.pop();
|
569 | if (!seen_callbacks.has(callback)) {
|
570 | callback();
|
571 |
|
572 | seen_callbacks.add(callback);
|
573 | }
|
574 | }
|
575 | } while (dirty_components.length);
|
576 | while (flush_callbacks.length) {
|
577 | flush_callbacks.pop()();
|
578 | }
|
579 | update_scheduled = false;
|
580 | }
|
581 | function update($$) {
|
582 | if ($$.fragment) {
|
583 | $$.update($$.dirty);
|
584 | run_all($$.before_render);
|
585 | $$.fragment.p($$.dirty, $$.ctx);
|
586 | $$.dirty = null;
|
587 | $$.after_render.forEach(add_render_callback);
|
588 | }
|
589 | }
|
590 |
|
591 | let promise;
|
592 | function wait() {
|
593 | if (!promise) {
|
594 | promise = Promise.resolve();
|
595 | promise.then(() => {
|
596 | promise = null;
|
597 | });
|
598 | }
|
599 | return promise;
|
600 | }
|
601 | function dispatch(node, direction, kind) {
|
602 | node.dispatchEvent(custom_event(`${direction ? 'intro' : 'outro'}${kind}`));
|
603 | }
|
604 | let outros;
|
605 | function group_outros() {
|
606 | outros = {
|
607 | remaining: 0,
|
608 | callbacks: []
|
609 | };
|
610 | }
|
611 | function check_outros() {
|
612 | if (!outros.remaining) {
|
613 | run_all(outros.callbacks);
|
614 | }
|
615 | }
|
616 | function on_outro(callback) {
|
617 | outros.callbacks.push(callback);
|
618 | }
|
619 | function create_in_transition(node, fn, params) {
|
620 | let config = fn(node, params);
|
621 | let running = false;
|
622 | let animation_name;
|
623 | let task;
|
624 | let uid = 0;
|
625 | function cleanup() {
|
626 | if (animation_name)
|
627 | delete_rule(node, animation_name);
|
628 | }
|
629 | function go() {
|
630 | const { delay = 0, duration = 300, easing = identity, tick: tick$$1 = noop, css } = config;
|
631 | if (css)
|
632 | animation_name = create_rule(node, 0, 1, duration, delay, easing, css, uid++);
|
633 | tick$$1(0, 1);
|
634 | const start_time = now() + delay;
|
635 | const end_time = start_time + duration;
|
636 | if (task)
|
637 | task.abort();
|
638 | running = true;
|
639 | add_render_callback(() => dispatch(node, true, 'start'));
|
640 | task = loop(now$$1 => {
|
641 | if (running) {
|
642 | if (now$$1 >= end_time) {
|
643 | tick$$1(1, 0);
|
644 | dispatch(node, true, 'end');
|
645 | cleanup();
|
646 | return running = false;
|
647 | }
|
648 | if (now$$1 >= start_time) {
|
649 | const t = easing((now$$1 - start_time) / duration);
|
650 | tick$$1(t, 1 - t);
|
651 | }
|
652 | }
|
653 | return running;
|
654 | });
|
655 | }
|
656 | let started = false;
|
657 | return {
|
658 | start() {
|
659 | if (started)
|
660 | return;
|
661 | delete_rule(node);
|
662 | if (is_function(config)) {
|
663 | config = config();
|
664 | wait().then(go);
|
665 | }
|
666 | else {
|
667 | go();
|
668 | }
|
669 | },
|
670 | invalidate() {
|
671 | started = false;
|
672 | },
|
673 | end() {
|
674 | if (running) {
|
675 | cleanup();
|
676 | running = false;
|
677 | }
|
678 | }
|
679 | };
|
680 | }
|
681 | function create_out_transition(node, fn, params) {
|
682 | let config = fn(node, params);
|
683 | let running = true;
|
684 | let animation_name;
|
685 | const group = outros;
|
686 | group.remaining += 1;
|
687 | function go() {
|
688 | const { delay = 0, duration = 300, easing = identity, tick: tick$$1 = noop, css } = config;
|
689 | if (css)
|
690 | animation_name = create_rule(node, 1, 0, duration, delay, easing, css);
|
691 | const start_time = now() + delay;
|
692 | const end_time = start_time + duration;
|
693 | add_render_callback(() => dispatch(node, false, 'start'));
|
694 | loop(now$$1 => {
|
695 | if (running) {
|
696 | if (now$$1 >= end_time) {
|
697 | tick$$1(0, 1);
|
698 | dispatch(node, false, 'end');
|
699 | if (!--group.remaining) {
|
700 |
|
701 |
|
702 | run_all(group.callbacks);
|
703 | }
|
704 | return false;
|
705 | }
|
706 | if (now$$1 >= start_time) {
|
707 | const t = easing((now$$1 - start_time) / duration);
|
708 | tick$$1(1 - t, t);
|
709 | }
|
710 | }
|
711 | return running;
|
712 | });
|
713 | }
|
714 | if (is_function(config)) {
|
715 | wait().then(() => {
|
716 |
|
717 | config = config();
|
718 | go();
|
719 | });
|
720 | }
|
721 | else {
|
722 | go();
|
723 | }
|
724 | return {
|
725 | end(reset) {
|
726 | if (reset && config.tick) {
|
727 | config.tick(1, 0);
|
728 | }
|
729 | if (running) {
|
730 | if (animation_name)
|
731 | delete_rule(node, animation_name);
|
732 | running = false;
|
733 | }
|
734 | }
|
735 | };
|
736 | }
|
737 | function create_bidirectional_transition(node, fn, params, intro) {
|
738 | let config = fn(node, params);
|
739 | let t = intro ? 0 : 1;
|
740 | let running_program = null;
|
741 | let pending_program = null;
|
742 | let animation_name = null;
|
743 | function clear_animation() {
|
744 | if (animation_name)
|
745 | delete_rule(node, animation_name);
|
746 | }
|
747 | function init(program, duration) {
|
748 | const d = program.b - t;
|
749 | duration *= Math.abs(d);
|
750 | return {
|
751 | a: t,
|
752 | b: program.b,
|
753 | d,
|
754 | duration,
|
755 | start: program.start,
|
756 | end: program.start + duration,
|
757 | group: program.group
|
758 | };
|
759 | }
|
760 | function go(b) {
|
761 | const { delay = 0, duration = 300, easing = identity, tick: tick$$1 = noop, css } = config;
|
762 | const program = {
|
763 | start: now() + delay,
|
764 | b
|
765 | };
|
766 | if (!b) {
|
767 |
|
768 | program.group = outros;
|
769 | outros.remaining += 1;
|
770 | }
|
771 | if (running_program) {
|
772 | pending_program = program;
|
773 | }
|
774 | else {
|
775 |
|
776 |
|
777 | if (css) {
|
778 | clear_animation();
|
779 | animation_name = create_rule(node, t, b, duration, delay, easing, css);
|
780 | }
|
781 | if (b)
|
782 | tick$$1(0, 1);
|
783 | running_program = init(program, duration);
|
784 | add_render_callback(() => dispatch(node, b, 'start'));
|
785 | loop(now$$1 => {
|
786 | if (pending_program && now$$1 > pending_program.start) {
|
787 | running_program = init(pending_program, duration);
|
788 | pending_program = null;
|
789 | dispatch(node, running_program.b, 'start');
|
790 | if (css) {
|
791 | clear_animation();
|
792 | animation_name = create_rule(node, t, running_program.b, running_program.duration, 0, easing, config.css);
|
793 | }
|
794 | }
|
795 | if (running_program) {
|
796 | if (now$$1 >= running_program.end) {
|
797 | tick$$1(t = running_program.b, 1 - t);
|
798 | dispatch(node, running_program.b, 'end');
|
799 | if (!pending_program) {
|
800 |
|
801 | if (running_program.b) {
|
802 |
|
803 | clear_animation();
|
804 | }
|
805 | else {
|
806 |
|
807 | if (!--running_program.group.remaining)
|
808 | run_all(running_program.group.callbacks);
|
809 | }
|
810 | }
|
811 | running_program = null;
|
812 | }
|
813 | else if (now$$1 >= running_program.start) {
|
814 | const p = now$$1 - running_program.start;
|
815 | t = running_program.a + running_program.d * easing(p / running_program.duration);
|
816 | tick$$1(t, 1 - t);
|
817 | }
|
818 | }
|
819 | return !!(running_program || pending_program);
|
820 | });
|
821 | }
|
822 | }
|
823 | return {
|
824 | run(b) {
|
825 | if (is_function(config)) {
|
826 | wait().then(() => {
|
827 |
|
828 | config = config();
|
829 | go(b);
|
830 | });
|
831 | }
|
832 | else {
|
833 | go(b);
|
834 | }
|
835 | },
|
836 | end() {
|
837 | clear_animation();
|
838 | running_program = pending_program = null;
|
839 | }
|
840 | };
|
841 | }
|
842 |
|
843 | function handle_promise(promise, info) {
|
844 | const token = info.token = {};
|
845 | function update(type, index, key, value) {
|
846 | if (info.token !== token)
|
847 | return;
|
848 | info.resolved = key && { [key]: value };
|
849 | const child_ctx = assign(assign({}, info.ctx), info.resolved);
|
850 | const block = type && (info.current = type)(child_ctx);
|
851 | if (info.block) {
|
852 | if (info.blocks) {
|
853 | info.blocks.forEach((block, i) => {
|
854 | if (i !== index && block) {
|
855 | group_outros();
|
856 | on_outro(() => {
|
857 | block.d(1);
|
858 | info.blocks[i] = null;
|
859 | });
|
860 | block.o(1);
|
861 | check_outros();
|
862 | }
|
863 | });
|
864 | }
|
865 | else {
|
866 | info.block.d(1);
|
867 | }
|
868 | block.c();
|
869 | if (block.i)
|
870 | block.i(1);
|
871 | block.m(info.mount(), info.anchor);
|
872 | flush();
|
873 | }
|
874 | info.block = block;
|
875 | if (info.blocks)
|
876 | info.blocks[index] = block;
|
877 | }
|
878 | if (is_promise(promise)) {
|
879 | promise.then(value => {
|
880 | update(info.then, 1, info.value, value);
|
881 | }, error => {
|
882 | update(info.catch, 2, info.error, error);
|
883 | });
|
884 |
|
885 | if (info.current !== info.pending) {
|
886 | update(info.pending, 0);
|
887 | return true;
|
888 | }
|
889 | }
|
890 | else {
|
891 | if (info.current !== info.then) {
|
892 | update(info.then, 1, info.value, promise);
|
893 | return true;
|
894 | }
|
895 | info.resolved = { [info.value]: promise };
|
896 | }
|
897 | }
|
898 |
|
899 | function destroy_block(block, lookup) {
|
900 | block.d(1);
|
901 | lookup.delete(block.key);
|
902 | }
|
903 | function outro_and_destroy_block(block, lookup) {
|
904 | on_outro(() => {
|
905 | destroy_block(block, lookup);
|
906 | });
|
907 | block.o(1);
|
908 | }
|
909 | function fix_and_destroy_block(block, lookup) {
|
910 | block.f();
|
911 | destroy_block(block, lookup);
|
912 | }
|
913 | function fix_and_outro_and_destroy_block(block, lookup) {
|
914 | block.f();
|
915 | outro_and_destroy_block(block, lookup);
|
916 | }
|
917 | function update_keyed_each(old_blocks, changed, get_key, dynamic, ctx, list, lookup, node, destroy, create_each_block, next, get_context) {
|
918 | let o = old_blocks.length;
|
919 | let n = list.length;
|
920 | let i = o;
|
921 | const old_indexes = {};
|
922 | while (i--)
|
923 | old_indexes[old_blocks[i].key] = i;
|
924 | const new_blocks = [];
|
925 | const new_lookup = new Map();
|
926 | const deltas = new Map();
|
927 | i = n;
|
928 | while (i--) {
|
929 | const child_ctx = get_context(ctx, list, i);
|
930 | const key = get_key(child_ctx);
|
931 | let block = lookup.get(key);
|
932 | if (!block) {
|
933 | block = create_each_block(key, child_ctx);
|
934 | block.c();
|
935 | }
|
936 | else if (dynamic) {
|
937 | block.p(changed, child_ctx);
|
938 | }
|
939 | new_lookup.set(key, new_blocks[i] = block);
|
940 | if (key in old_indexes)
|
941 | deltas.set(key, Math.abs(i - old_indexes[key]));
|
942 | }
|
943 | const will_move = new Set();
|
944 | const did_move = new Set();
|
945 | function insert(block) {
|
946 | if (block.i)
|
947 | block.i(1);
|
948 | block.m(node, next);
|
949 | lookup.set(block.key, block);
|
950 | next = block.first;
|
951 | n--;
|
952 | }
|
953 | while (o && n) {
|
954 | const new_block = new_blocks[n - 1];
|
955 | const old_block = old_blocks[o - 1];
|
956 | const new_key = new_block.key;
|
957 | const old_key = old_block.key;
|
958 | if (new_block === old_block) {
|
959 |
|
960 | next = new_block.first;
|
961 | o--;
|
962 | n--;
|
963 | }
|
964 | else if (!new_lookup.has(old_key)) {
|
965 |
|
966 | destroy(old_block, lookup);
|
967 | o--;
|
968 | }
|
969 | else if (!lookup.has(new_key) || will_move.has(new_key)) {
|
970 | insert(new_block);
|
971 | }
|
972 | else if (did_move.has(old_key)) {
|
973 | o--;
|
974 | }
|
975 | else if (deltas.get(new_key) > deltas.get(old_key)) {
|
976 | did_move.add(new_key);
|
977 | insert(new_block);
|
978 | }
|
979 | else {
|
980 | will_move.add(old_key);
|
981 | o--;
|
982 | }
|
983 | }
|
984 | while (o--) {
|
985 | const old_block = old_blocks[o];
|
986 | if (!new_lookup.has(old_block.key))
|
987 | destroy(old_block, lookup);
|
988 | }
|
989 | while (n)
|
990 | insert(new_blocks[n - 1]);
|
991 | return new_blocks;
|
992 | }
|
993 | function measure(blocks) {
|
994 | const rects = {};
|
995 | let i = blocks.length;
|
996 | while (i--)
|
997 | rects[blocks[i].key] = blocks[i].node.getBoundingClientRect();
|
998 | return rects;
|
999 | }
|
1000 |
|
1001 | function get_spread_update(levels, updates) {
|
1002 | const update = {};
|
1003 | const to_null_out = {};
|
1004 | const accounted_for = { $$scope: 1 };
|
1005 | let i = levels.length;
|
1006 | while (i--) {
|
1007 | const o = levels[i];
|
1008 | const n = updates[i];
|
1009 | if (n) {
|
1010 | for (const key in o) {
|
1011 | if (!(key in n))
|
1012 | to_null_out[key] = 1;
|
1013 | }
|
1014 | for (const key in n) {
|
1015 | if (!accounted_for[key]) {
|
1016 | update[key] = n[key];
|
1017 | accounted_for[key] = 1;
|
1018 | }
|
1019 | }
|
1020 | levels[i] = n;
|
1021 | }
|
1022 | else {
|
1023 | for (const key in o) {
|
1024 | accounted_for[key] = 1;
|
1025 | }
|
1026 | }
|
1027 | }
|
1028 | for (const key in to_null_out) {
|
1029 | if (!(key in update))
|
1030 | update[key] = undefined;
|
1031 | }
|
1032 | return update;
|
1033 | }
|
1034 |
|
1035 | const invalid_attribute_name_character = /[\s'">/=\u{FDD0}-\u{FDEF}\u{FFFE}\u{FFFF}\u{1FFFE}\u{1FFFF}\u{2FFFE}\u{2FFFF}\u{3FFFE}\u{3FFFF}\u{4FFFE}\u{4FFFF}\u{5FFFE}\u{5FFFF}\u{6FFFE}\u{6FFFF}\u{7FFFE}\u{7FFFF}\u{8FFFE}\u{8FFFF}\u{9FFFE}\u{9FFFF}\u{AFFFE}\u{AFFFF}\u{BFFFE}\u{BFFFF}\u{CFFFE}\u{CFFFF}\u{DFFFE}\u{DFFFF}\u{EFFFE}\u{EFFFF}\u{FFFFE}\u{FFFFF}\u{10FFFE}\u{10FFFF}]/u;
|
1036 |
|
1037 |
|
1038 | function spread(args) {
|
1039 | const attributes = Object.assign({}, ...args);
|
1040 | let str = '';
|
1041 | Object.keys(attributes).forEach(name => {
|
1042 | if (invalid_attribute_name_character.test(name))
|
1043 | return;
|
1044 | const value = attributes[name];
|
1045 | if (value === undefined)
|
1046 | return;
|
1047 | if (value === true)
|
1048 | str += " " + name;
|
1049 | const escaped = String(value)
|
1050 | .replace(/"/g, '"')
|
1051 | .replace(/'/g, ''');
|
1052 | str += " " + name + "=" + JSON.stringify(escaped);
|
1053 | });
|
1054 | return str;
|
1055 | }
|
1056 | const escaped = {
|
1057 | '"': '"',
|
1058 | "'": ''',
|
1059 | '&': '&',
|
1060 | '<': '<',
|
1061 | '>': '>'
|
1062 | };
|
1063 | function escape(html) {
|
1064 | return String(html).replace(/["'&<>]/g, match => escaped[match]);
|
1065 | }
|
1066 | function each(items, fn) {
|
1067 | let str = '';
|
1068 | for (let i = 0; i < items.length; i += 1) {
|
1069 | str += fn(items[i], i);
|
1070 | }
|
1071 | return str;
|
1072 | }
|
1073 | const missing_component = {
|
1074 | $$render: () => ''
|
1075 | };
|
1076 | function validate_component(component, name) {
|
1077 | if (!component || !component.$$render) {
|
1078 | if (name === 'svelte:component')
|
1079 | name += ' this={...}';
|
1080 | throw new Error(`<${name}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules`);
|
1081 | }
|
1082 | return component;
|
1083 | }
|
1084 | function debug(file, line, column, values) {
|
1085 | console.log(`{@debug} ${file ? file + ' ' : ''}(${line}:${column})`);
|
1086 | console.log(values);
|
1087 | return '';
|
1088 | }
|
1089 | let on_destroy;
|
1090 | function create_ssr_component(fn) {
|
1091 | function $$render(result, props, bindings, slots) {
|
1092 | const parent_component = current_component;
|
1093 | const $$ = {
|
1094 | on_destroy,
|
1095 | context: new Map(parent_component ? parent_component.$$.context : []),
|
1096 |
|
1097 | on_mount: [],
|
1098 | before_render: [],
|
1099 | after_render: [],
|
1100 | callbacks: blank_object()
|
1101 | };
|
1102 | set_current_component({ $$ });
|
1103 | const html = fn(result, props, bindings, slots);
|
1104 | set_current_component(parent_component);
|
1105 | return html;
|
1106 | }
|
1107 | return {
|
1108 | render: (props = {}, options = {}) => {
|
1109 | on_destroy = [];
|
1110 | const result = { head: '', css: new Set() };
|
1111 | const html = $$render(result, props, {}, options);
|
1112 | run_all(on_destroy);
|
1113 | return {
|
1114 | html,
|
1115 | css: {
|
1116 | code: Array.from(result.css).map(css => css.code).join('\n'),
|
1117 | map: null
|
1118 | },
|
1119 | head: result.head
|
1120 | };
|
1121 | },
|
1122 | $$render
|
1123 | };
|
1124 | }
|
1125 | function get_store_value(store) {
|
1126 | let value;
|
1127 | store.subscribe(_ => value = _)();
|
1128 | return value;
|
1129 | }
|
1130 |
|
1131 | function bind(component, name, callback) {
|
1132 | if (component.$$.props.indexOf(name) === -1)
|
1133 | return;
|
1134 | component.$$.bound[name] = callback;
|
1135 | callback(component.$$.ctx[name]);
|
1136 | }
|
1137 | function mount_component(component, target, anchor) {
|
1138 | const { fragment, on_mount, on_destroy, after_render } = component.$$;
|
1139 | fragment.m(target, anchor);
|
1140 |
|
1141 |
|
1142 |
|
1143 | add_render_callback(() => {
|
1144 | const new_on_destroy = on_mount.map(run).filter(is_function);
|
1145 | if (on_destroy) {
|
1146 | on_destroy.push(...new_on_destroy);
|
1147 | }
|
1148 | else {
|
1149 |
|
1150 |
|
1151 | run_all(new_on_destroy);
|
1152 | }
|
1153 | component.$$.on_mount = [];
|
1154 | });
|
1155 | after_render.forEach(add_render_callback);
|
1156 | }
|
1157 | function destroy(component, detaching) {
|
1158 | if (component.$$) {
|
1159 | run_all(component.$$.on_destroy);
|
1160 | component.$$.fragment.d(detaching);
|
1161 |
|
1162 |
|
1163 | component.$$.on_destroy = component.$$.fragment = null;
|
1164 | component.$$.ctx = {};
|
1165 | }
|
1166 | }
|
1167 | function make_dirty(component, key) {
|
1168 | if (!component.$$.dirty) {
|
1169 | dirty_components.push(component);
|
1170 | schedule_update();
|
1171 | component.$$.dirty = blank_object();
|
1172 | }
|
1173 | component.$$.dirty[key] = true;
|
1174 | }
|
1175 | function init(component, options, instance, create_fragment, not_equal$$1, prop_names) {
|
1176 | const parent_component = current_component;
|
1177 | set_current_component(component);
|
1178 | const props = options.props || {};
|
1179 | const $$ = component.$$ = {
|
1180 | fragment: null,
|
1181 | ctx: null,
|
1182 |
|
1183 | props: prop_names,
|
1184 | update: noop,
|
1185 | not_equal: not_equal$$1,
|
1186 | bound: blank_object(),
|
1187 |
|
1188 | on_mount: [],
|
1189 | on_destroy: [],
|
1190 | before_render: [],
|
1191 | after_render: [],
|
1192 | context: new Map(parent_component ? parent_component.$$.context : []),
|
1193 |
|
1194 | callbacks: blank_object(),
|
1195 | dirty: null
|
1196 | };
|
1197 | let ready = false;
|
1198 | $$.ctx = instance
|
1199 | ? instance(component, props, (key, value) => {
|
1200 | if ($$.ctx && not_equal$$1($$.ctx[key], $$.ctx[key] = value)) {
|
1201 | if ($$.bound[key])
|
1202 | $$.bound[key](value);
|
1203 | if (ready)
|
1204 | make_dirty(component, key);
|
1205 | }
|
1206 | })
|
1207 | : props;
|
1208 | $$.update();
|
1209 | ready = true;
|
1210 | run_all($$.before_render);
|
1211 | $$.fragment = create_fragment($$.ctx);
|
1212 | if (options.target) {
|
1213 | if (options.hydrate) {
|
1214 |
|
1215 | $$.fragment.l(children(options.target));
|
1216 | }
|
1217 | else {
|
1218 |
|
1219 | $$.fragment.c();
|
1220 | }
|
1221 | if (options.intro && component.$$.fragment.i)
|
1222 | component.$$.fragment.i();
|
1223 | mount_component(component, options.target, options.anchor);
|
1224 | flush();
|
1225 | }
|
1226 | set_current_component(parent_component);
|
1227 | }
|
1228 | let SvelteElement;
|
1229 | if (typeof HTMLElement !== 'undefined') {
|
1230 | SvelteElement = class extends HTMLElement {
|
1231 | constructor() {
|
1232 | super();
|
1233 | this.attachShadow({ mode: 'open' });
|
1234 | }
|
1235 | connectedCallback() {
|
1236 |
|
1237 | for (const key in this.$$.slotted) {
|
1238 |
|
1239 | this.appendChild(this.$$.slotted[key]);
|
1240 | }
|
1241 | }
|
1242 | attributeChangedCallback(attr$$1, _oldValue, newValue) {
|
1243 | this[attr$$1] = newValue;
|
1244 | }
|
1245 | $destroy() {
|
1246 | destroy(this, true);
|
1247 | this.$destroy = noop;
|
1248 | }
|
1249 | $on(type, callback) {
|
1250 |
|
1251 | const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = []));
|
1252 | callbacks.push(callback);
|
1253 | return () => {
|
1254 | const index = callbacks.indexOf(callback);
|
1255 | if (index !== -1)
|
1256 | callbacks.splice(index, 1);
|
1257 | };
|
1258 | }
|
1259 | $set() {
|
1260 |
|
1261 | }
|
1262 | };
|
1263 | }
|
1264 | class SvelteComponent {
|
1265 | $destroy() {
|
1266 | destroy(this, true);
|
1267 | this.$destroy = noop;
|
1268 | }
|
1269 | $on(type, callback) {
|
1270 | const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = []));
|
1271 | callbacks.push(callback);
|
1272 | return () => {
|
1273 | const index = callbacks.indexOf(callback);
|
1274 | if (index !== -1)
|
1275 | callbacks.splice(index, 1);
|
1276 | };
|
1277 | }
|
1278 | $set() {
|
1279 |
|
1280 | }
|
1281 | }
|
1282 | class SvelteComponentDev extends SvelteComponent {
|
1283 | constructor(options) {
|
1284 | if (!options || (!options.target && !options.$$inline)) {
|
1285 | throw new Error(`'target' is a required option`);
|
1286 | }
|
1287 | super();
|
1288 | }
|
1289 | $destroy() {
|
1290 | super.$destroy();
|
1291 | this.$destroy = () => {
|
1292 | console.warn(`Component was already destroyed`);
|
1293 | };
|
1294 | }
|
1295 | }
|
1296 |
|
1297 | export { create_animation, fix_position, add_transform, handle_promise, append, insert, detach, detach_between, detach_before, detach_after, destroy_each, element, object_without_properties, svg_element, text, space, empty, listen, prevent_default, stop_propagation, attr, set_attributes, set_custom_element_data, xlink_attr, get_binding_group_value, to_number, time_ranges_to_array, children, claim_element, claim_text, set_data, set_input_type, set_style, select_option, select_options, select_value, select_multiple_value, add_resize_listener, toggle_class, custom_event, destroy_block, outro_and_destroy_block, fix_and_destroy_block, fix_and_outro_and_destroy_block, update_keyed_each, measure, current_component, set_current_component, beforeUpdate, onMount, afterUpdate, onDestroy, createEventDispatcher, setContext, getContext, bubble, clear_loops, loop, dirty_components, intros, schedule_update, tick, add_binding_callback, add_render_callback, add_flush_callback, flush, get_spread_update, invalid_attribute_name_character, spread, escaped, escape, each, missing_component, validate_component, debug, create_ssr_component, get_store_value, group_outros, check_outros, on_outro, create_in_transition, create_out_transition, create_bidirectional_transition, noop, identity, assign, is_promise, add_location, run, blank_object, run_all, is_function, safe_not_equal, not_equal, validate_store, subscribe, create_slot, get_slot_context, get_slot_changes, exclude_internal_props, once, now, raf, set_now, set_raf, bind, mount_component, init, SvelteElement, SvelteComponent, SvelteComponentDev };
|