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 is_empty(obj) {
|
36 | return Object.keys(obj).length === 0;
|
37 | }
|
38 | function validate_store(store, name) {
|
39 | if (store != null && typeof store.subscribe !== 'function') {
|
40 | throw new Error(`'${name}' is not a store with a 'subscribe' method`);
|
41 | }
|
42 | }
|
43 | function subscribe(store, ...callbacks) {
|
44 | if (store == null) {
|
45 | return noop;
|
46 | }
|
47 | const unsub = store.subscribe(...callbacks);
|
48 | return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;
|
49 | }
|
50 | function get_store_value(store) {
|
51 | let value;
|
52 | subscribe(store, _ => value = _)();
|
53 | return value;
|
54 | }
|
55 | function component_subscribe(component, store, callback) {
|
56 | component.$$.on_destroy.push(subscribe(store, callback));
|
57 | }
|
58 | function create_slot(definition, ctx, $$scope, fn) {
|
59 | if (definition) {
|
60 | const slot_ctx = get_slot_context(definition, ctx, $$scope, fn);
|
61 | return definition[0](slot_ctx);
|
62 | }
|
63 | }
|
64 | function get_slot_context(definition, ctx, $$scope, fn) {
|
65 | return definition[1] && fn
|
66 | ? assign($$scope.ctx.slice(), definition[1](fn(ctx)))
|
67 | : $$scope.ctx;
|
68 | }
|
69 | function get_slot_changes(definition, $$scope, dirty, fn) {
|
70 | if (definition[2] && fn) {
|
71 | const lets = definition[2](fn(dirty));
|
72 | if ($$scope.dirty === undefined) {
|
73 | return lets;
|
74 | }
|
75 | if (typeof lets === 'object') {
|
76 | const merged = [];
|
77 | const len = Math.max($$scope.dirty.length, lets.length);
|
78 | for (let i = 0; i < len; i += 1) {
|
79 | merged[i] = $$scope.dirty[i] | lets[i];
|
80 | }
|
81 | return merged;
|
82 | }
|
83 | return $$scope.dirty | lets;
|
84 | }
|
85 | return $$scope.dirty;
|
86 | }
|
87 | function update_slot(slot, slot_definition, ctx, $$scope, dirty, get_slot_changes_fn, get_slot_context_fn) {
|
88 | const slot_changes = get_slot_changes(slot_definition, $$scope, dirty, get_slot_changes_fn);
|
89 | if (slot_changes) {
|
90 | const slot_context = get_slot_context(slot_definition, ctx, $$scope, get_slot_context_fn);
|
91 | slot.p(slot_context, slot_changes);
|
92 | }
|
93 | }
|
94 | function exclude_internal_props(props) {
|
95 | const result = {};
|
96 | for (const k in props)
|
97 | if (k[0] !== '$')
|
98 | result[k] = props[k];
|
99 | return result;
|
100 | }
|
101 | function compute_rest_props(props, keys) {
|
102 | const rest = {};
|
103 | keys = new Set(keys);
|
104 | for (const k in props)
|
105 | if (!keys.has(k) && k[0] !== '$')
|
106 | rest[k] = props[k];
|
107 | return rest;
|
108 | }
|
109 | function once(fn) {
|
110 | let ran = false;
|
111 | return function (...args) {
|
112 | if (ran)
|
113 | return;
|
114 | ran = true;
|
115 | fn.call(this, ...args);
|
116 | };
|
117 | }
|
118 | function null_to_empty(value) {
|
119 | return value == null ? '' : value;
|
120 | }
|
121 | function set_store_value(store, ret, value = ret) {
|
122 | store.set(value);
|
123 | return ret;
|
124 | }
|
125 | const has_prop = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
|
126 | function action_destroyer(action_result) {
|
127 | return action_result && is_function(action_result.destroy) ? action_result.destroy : noop;
|
128 | }
|
129 |
|
130 | const is_client = typeof window !== 'undefined';
|
131 | let now = is_client
|
132 | ? () => window.performance.now()
|
133 | : () => Date.now();
|
134 | let raf = is_client ? cb => requestAnimationFrame(cb) : noop;
|
135 |
|
136 | function set_now(fn) {
|
137 | now = fn;
|
138 | }
|
139 | function set_raf(fn) {
|
140 | raf = fn;
|
141 | }
|
142 |
|
143 | const tasks = new Set();
|
144 | function run_tasks(now) {
|
145 | tasks.forEach(task => {
|
146 | if (!task.c(now)) {
|
147 | tasks.delete(task);
|
148 | task.f();
|
149 | }
|
150 | });
|
151 | if (tasks.size !== 0)
|
152 | raf(run_tasks);
|
153 | }
|
154 |
|
155 |
|
156 |
|
157 | function clear_loops() {
|
158 | tasks.clear();
|
159 | }
|
160 |
|
161 |
|
162 |
|
163 |
|
164 | function loop(callback) {
|
165 | let task;
|
166 | if (tasks.size === 0)
|
167 | raf(run_tasks);
|
168 | return {
|
169 | promise: new Promise(fulfill => {
|
170 | tasks.add(task = { c: callback, f: fulfill });
|
171 | }),
|
172 | abort() {
|
173 | tasks.delete(task);
|
174 | }
|
175 | };
|
176 | }
|
177 |
|
178 | function append(target, node) {
|
179 | target.appendChild(node);
|
180 | }
|
181 | function insert(target, node, anchor) {
|
182 | target.insertBefore(node, anchor || null);
|
183 | }
|
184 | function detach(node) {
|
185 | node.parentNode.removeChild(node);
|
186 | }
|
187 | function destroy_each(iterations, detaching) {
|
188 | for (let i = 0; i < iterations.length; i += 1) {
|
189 | if (iterations[i])
|
190 | iterations[i].d(detaching);
|
191 | }
|
192 | }
|
193 | function element(name) {
|
194 | return document.createElement(name);
|
195 | }
|
196 | function element_is(name, is) {
|
197 | return document.createElement(name, { is });
|
198 | }
|
199 | function object_without_properties(obj, exclude) {
|
200 | const target = {};
|
201 | for (const k in obj) {
|
202 | if (has_prop(obj, k)
|
203 |
|
204 | && exclude.indexOf(k) === -1) {
|
205 |
|
206 | target[k] = obj[k];
|
207 | }
|
208 | }
|
209 | return target;
|
210 | }
|
211 | function svg_element(name) {
|
212 | return document.createElementNS('http://www.w3.org/2000/svg', name);
|
213 | }
|
214 | function text(data) {
|
215 | return document.createTextNode(data);
|
216 | }
|
217 | function space() {
|
218 | return text(' ');
|
219 | }
|
220 | function empty() {
|
221 | return text('');
|
222 | }
|
223 | function listen(node, event, handler, options) {
|
224 | node.addEventListener(event, handler, options);
|
225 | return () => node.removeEventListener(event, handler, options);
|
226 | }
|
227 | function prevent_default(fn) {
|
228 | return function (event) {
|
229 | event.preventDefault();
|
230 |
|
231 | return fn.call(this, event);
|
232 | };
|
233 | }
|
234 | function stop_propagation(fn) {
|
235 | return function (event) {
|
236 | event.stopPropagation();
|
237 |
|
238 | return fn.call(this, event);
|
239 | };
|
240 | }
|
241 | function self(fn) {
|
242 | return function (event) {
|
243 |
|
244 | if (event.target === this)
|
245 | fn.call(this, event);
|
246 | };
|
247 | }
|
248 | function attr(node, attribute, value) {
|
249 | if (value == null)
|
250 | node.removeAttribute(attribute);
|
251 | else if (node.getAttribute(attribute) !== value)
|
252 | node.setAttribute(attribute, value);
|
253 | }
|
254 | function set_attributes(node, attributes) {
|
255 |
|
256 | const descriptors = Object.getOwnPropertyDescriptors(node.__proto__);
|
257 | for (const key in attributes) {
|
258 | if (attributes[key] == null) {
|
259 | node.removeAttribute(key);
|
260 | }
|
261 | else if (key === 'style') {
|
262 | node.style.cssText = attributes[key];
|
263 | }
|
264 | else if (key === '__value') {
|
265 | node.value = node[key] = attributes[key];
|
266 | }
|
267 | else if (descriptors[key] && descriptors[key].set) {
|
268 | node[key] = attributes[key];
|
269 | }
|
270 | else {
|
271 | attr(node, key, attributes[key]);
|
272 | }
|
273 | }
|
274 | }
|
275 | function set_svg_attributes(node, attributes) {
|
276 | for (const key in attributes) {
|
277 | attr(node, key, attributes[key]);
|
278 | }
|
279 | }
|
280 | function set_custom_element_data(node, prop, value) {
|
281 | if (prop in node) {
|
282 | node[prop] = value;
|
283 | }
|
284 | else {
|
285 | attr(node, prop, value);
|
286 | }
|
287 | }
|
288 | function xlink_attr(node, attribute, value) {
|
289 | node.setAttributeNS('http://www.w3.org/1999/xlink', attribute, value);
|
290 | }
|
291 | function get_binding_group_value(group, __value, checked) {
|
292 | const value = new Set();
|
293 | for (let i = 0; i < group.length; i += 1) {
|
294 | if (group[i].checked)
|
295 | value.add(group[i].__value);
|
296 | }
|
297 | if (!checked) {
|
298 | value.delete(__value);
|
299 | }
|
300 | return Array.from(value);
|
301 | }
|
302 | function to_number(value) {
|
303 | return value === '' ? undefined : +value;
|
304 | }
|
305 | function time_ranges_to_array(ranges) {
|
306 | const array = [];
|
307 | for (let i = 0; i < ranges.length; i += 1) {
|
308 | array.push({ start: ranges.start(i), end: ranges.end(i) });
|
309 | }
|
310 | return array;
|
311 | }
|
312 | function children(element) {
|
313 | return Array.from(element.childNodes);
|
314 | }
|
315 | function claim_element(nodes, name, attributes, svg) {
|
316 | for (let i = 0; i < nodes.length; i += 1) {
|
317 | const node = nodes[i];
|
318 | if (node.nodeName === name) {
|
319 | let j = 0;
|
320 | const remove = [];
|
321 | while (j < node.attributes.length) {
|
322 | const attribute = node.attributes[j++];
|
323 | if (!attributes[attribute.name]) {
|
324 | remove.push(attribute.name);
|
325 | }
|
326 | }
|
327 | for (let k = 0; k < remove.length; k++) {
|
328 | node.removeAttribute(remove[k]);
|
329 | }
|
330 | return nodes.splice(i, 1)[0];
|
331 | }
|
332 | }
|
333 | return svg ? svg_element(name) : element(name);
|
334 | }
|
335 | function claim_text(nodes, data) {
|
336 | for (let i = 0; i < nodes.length; i += 1) {
|
337 | const node = nodes[i];
|
338 | if (node.nodeType === 3) {
|
339 | node.data = '' + data;
|
340 | return nodes.splice(i, 1)[0];
|
341 | }
|
342 | }
|
343 | return text(data);
|
344 | }
|
345 | function claim_space(nodes) {
|
346 | return claim_text(nodes, ' ');
|
347 | }
|
348 | function set_data(text, data) {
|
349 | data = '' + data;
|
350 | if (text.wholeText !== data)
|
351 | text.data = data;
|
352 | }
|
353 | function set_input_value(input, value) {
|
354 | input.value = value == null ? '' : value;
|
355 | }
|
356 | function set_input_type(input, type) {
|
357 | try {
|
358 | input.type = type;
|
359 | }
|
360 | catch (e) {
|
361 |
|
362 | }
|
363 | }
|
364 | function set_style(node, key, value, important) {
|
365 | node.style.setProperty(key, value, important ? 'important' : '');
|
366 | }
|
367 | function select_option(select, value) {
|
368 | for (let i = 0; i < select.options.length; i += 1) {
|
369 | const option = select.options[i];
|
370 | if (option.__value === value) {
|
371 | option.selected = true;
|
372 | return;
|
373 | }
|
374 | }
|
375 | }
|
376 | function select_options(select, value) {
|
377 | for (let i = 0; i < select.options.length; i += 1) {
|
378 | const option = select.options[i];
|
379 | option.selected = ~value.indexOf(option.__value);
|
380 | }
|
381 | }
|
382 | function select_value(select) {
|
383 | const selected_option = select.querySelector(':checked') || select.options[0];
|
384 | return selected_option && selected_option.__value;
|
385 | }
|
386 | function select_multiple_value(select) {
|
387 | return [].map.call(select.querySelectorAll(':checked'), option => option.__value);
|
388 | }
|
389 |
|
390 |
|
391 | let crossorigin;
|
392 | function is_crossorigin() {
|
393 | if (crossorigin === undefined) {
|
394 | crossorigin = false;
|
395 | try {
|
396 | if (typeof window !== 'undefined' && window.parent) {
|
397 | void window.parent.document;
|
398 | }
|
399 | }
|
400 | catch (error) {
|
401 | crossorigin = true;
|
402 | }
|
403 | }
|
404 | return crossorigin;
|
405 | }
|
406 | function add_resize_listener(node, fn) {
|
407 | const computed_style = getComputedStyle(node);
|
408 | const z_index = (parseInt(computed_style.zIndex) || 0) - 1;
|
409 | if (computed_style.position === 'static') {
|
410 | node.style.position = 'relative';
|
411 | }
|
412 | const iframe = element('iframe');
|
413 | iframe.setAttribute('style', `display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; ` +
|
414 | `overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: ${z_index};`);
|
415 | iframe.setAttribute('aria-hidden', 'true');
|
416 | iframe.tabIndex = -1;
|
417 | const crossorigin = is_crossorigin();
|
418 | let unsubscribe;
|
419 | if (crossorigin) {
|
420 | iframe.src = `data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}</script>`;
|
421 | unsubscribe = listen(window, 'message', (event) => {
|
422 | if (event.source === iframe.contentWindow)
|
423 | fn();
|
424 | });
|
425 | }
|
426 | else {
|
427 | iframe.src = 'about:blank';
|
428 | iframe.onload = () => {
|
429 | unsubscribe = listen(iframe.contentWindow, 'resize', fn);
|
430 | };
|
431 | }
|
432 | append(node, iframe);
|
433 | return () => {
|
434 | if (crossorigin) {
|
435 | unsubscribe();
|
436 | }
|
437 | else if (unsubscribe && iframe.contentWindow) {
|
438 | unsubscribe();
|
439 | }
|
440 | detach(iframe);
|
441 | };
|
442 | }
|
443 | function toggle_class(element, name, toggle) {
|
444 | element.classList[toggle ? 'add' : 'remove'](name);
|
445 | }
|
446 | function custom_event(type, detail) {
|
447 | const e = document.createEvent('CustomEvent');
|
448 | e.initCustomEvent(type, false, false, detail);
|
449 | return e;
|
450 | }
|
451 | function query_selector_all(selector, parent = document.body) {
|
452 | return Array.from(parent.querySelectorAll(selector));
|
453 | }
|
454 | class HtmlTag {
|
455 | constructor(anchor = null) {
|
456 | this.a = anchor;
|
457 | this.e = this.n = null;
|
458 | }
|
459 | m(html, target, anchor = null) {
|
460 | if (!this.e) {
|
461 | this.e = element(target.nodeName);
|
462 | this.t = target;
|
463 | this.h(html);
|
464 | }
|
465 | this.i(anchor);
|
466 | }
|
467 | h(html) {
|
468 | this.e.innerHTML = html;
|
469 | this.n = Array.from(this.e.childNodes);
|
470 | }
|
471 | i(anchor) {
|
472 | for (let i = 0; i < this.n.length; i += 1) {
|
473 | insert(this.t, this.n[i], anchor);
|
474 | }
|
475 | }
|
476 | p(html) {
|
477 | this.d();
|
478 | this.h(html);
|
479 | this.i(this.a);
|
480 | }
|
481 | d() {
|
482 | this.n.forEach(detach);
|
483 | }
|
484 | }
|
485 |
|
486 | const active_docs = new Set();
|
487 | let active = 0;
|
488 |
|
489 | function hash(str) {
|
490 | let hash = 5381;
|
491 | let i = str.length;
|
492 | while (i--)
|
493 | hash = ((hash << 5) - hash) ^ str.charCodeAt(i);
|
494 | return hash >>> 0;
|
495 | }
|
496 | function create_rule(node, a, b, duration, delay, ease, fn, uid = 0) {
|
497 | const step = 16.666 / duration;
|
498 | let keyframes = '{\n';
|
499 | for (let p = 0; p <= 1; p += step) {
|
500 | const t = a + (b - a) * ease(p);
|
501 | keyframes += p * 100 + `%{${fn(t, 1 - t)}}\n`;
|
502 | }
|
503 | const rule = keyframes + `100% {${fn(b, 1 - b)}}\n}`;
|
504 | const name = `__svelte_${hash(rule)}_${uid}`;
|
505 | const doc = node.ownerDocument;
|
506 | active_docs.add(doc);
|
507 | const stylesheet = doc.__svelte_stylesheet || (doc.__svelte_stylesheet = doc.head.appendChild(element('style')).sheet);
|
508 | const current_rules = doc.__svelte_rules || (doc.__svelte_rules = {});
|
509 | if (!current_rules[name]) {
|
510 | current_rules[name] = true;
|
511 | stylesheet.insertRule(`@keyframes ${name} ${rule}`, stylesheet.cssRules.length);
|
512 | }
|
513 | const animation = node.style.animation || '';
|
514 | node.style.animation = `${animation ? `${animation}, ` : ``}${name} ${duration}ms linear ${delay}ms 1 both`;
|
515 | active += 1;
|
516 | return name;
|
517 | }
|
518 | function delete_rule(node, name) {
|
519 | const previous = (node.style.animation || '').split(', ');
|
520 | const next = previous.filter(name
|
521 | ? anim => anim.indexOf(name) < 0
|
522 | : anim => anim.indexOf('__svelte') === -1
|
523 | );
|
524 | const deleted = previous.length - next.length;
|
525 | if (deleted) {
|
526 | node.style.animation = next.join(', ');
|
527 | active -= deleted;
|
528 | if (!active)
|
529 | clear_rules();
|
530 | }
|
531 | }
|
532 | function clear_rules() {
|
533 | raf(() => {
|
534 | if (active)
|
535 | return;
|
536 | active_docs.forEach(doc => {
|
537 | const stylesheet = doc.__svelte_stylesheet;
|
538 | let i = stylesheet.cssRules.length;
|
539 | while (i--)
|
540 | stylesheet.deleteRule(i);
|
541 | doc.__svelte_rules = {};
|
542 | });
|
543 | active_docs.clear();
|
544 | });
|
545 | }
|
546 |
|
547 | function create_animation(node, from, fn, params) {
|
548 | if (!from)
|
549 | return noop;
|
550 | const to = node.getBoundingClientRect();
|
551 | if (from.left === to.left && from.right === to.right && from.top === to.top && from.bottom === to.bottom)
|
552 | return noop;
|
553 | const { delay = 0, duration = 300, easing = identity,
|
554 |
|
555 | start: start_time = now() + delay,
|
556 |
|
557 | end = start_time + duration, tick = noop, css } = fn(node, { from, to }, params);
|
558 | let running = true;
|
559 | let started = false;
|
560 | let name;
|
561 | function start() {
|
562 | if (css) {
|
563 | name = create_rule(node, 0, 1, duration, delay, easing, css);
|
564 | }
|
565 | if (!delay) {
|
566 | started = true;
|
567 | }
|
568 | }
|
569 | function stop() {
|
570 | if (css)
|
571 | delete_rule(node, name);
|
572 | running = false;
|
573 | }
|
574 | loop(now => {
|
575 | if (!started && now >= start_time) {
|
576 | started = true;
|
577 | }
|
578 | if (started && now >= end) {
|
579 | tick(1, 0);
|
580 | stop();
|
581 | }
|
582 | if (!running) {
|
583 | return false;
|
584 | }
|
585 | if (started) {
|
586 | const p = now - start_time;
|
587 | const t = 0 + 1 * easing(p / duration);
|
588 | tick(t, 1 - t);
|
589 | }
|
590 | return true;
|
591 | });
|
592 | start();
|
593 | tick(0, 1);
|
594 | return stop;
|
595 | }
|
596 | function fix_position(node) {
|
597 | const style = getComputedStyle(node);
|
598 | if (style.position !== 'absolute' && style.position !== 'fixed') {
|
599 | const { width, height } = style;
|
600 | const a = node.getBoundingClientRect();
|
601 | node.style.position = 'absolute';
|
602 | node.style.width = width;
|
603 | node.style.height = height;
|
604 | add_transform(node, a);
|
605 | }
|
606 | }
|
607 | function add_transform(node, a) {
|
608 | const b = node.getBoundingClientRect();
|
609 | if (a.left !== b.left || a.top !== b.top) {
|
610 | const style = getComputedStyle(node);
|
611 | const transform = style.transform === 'none' ? '' : style.transform;
|
612 | node.style.transform = `${transform} translate(${a.left - b.left}px, ${a.top - b.top}px)`;
|
613 | }
|
614 | }
|
615 |
|
616 | let current_component;
|
617 | function set_current_component(component) {
|
618 | current_component = component;
|
619 | }
|
620 | function get_current_component() {
|
621 | if (!current_component)
|
622 | throw new Error(`Function called outside component initialization`);
|
623 | return current_component;
|
624 | }
|
625 | function beforeUpdate(fn) {
|
626 | get_current_component().$$.before_update.push(fn);
|
627 | }
|
628 | function onMount(fn) {
|
629 | get_current_component().$$.on_mount.push(fn);
|
630 | }
|
631 | function afterUpdate(fn) {
|
632 | get_current_component().$$.after_update.push(fn);
|
633 | }
|
634 | function onDestroy(fn) {
|
635 | get_current_component().$$.on_destroy.push(fn);
|
636 | }
|
637 | function createEventDispatcher() {
|
638 | const component = get_current_component();
|
639 | return (type, detail) => {
|
640 | const callbacks = component.$$.callbacks[type];
|
641 | if (callbacks) {
|
642 |
|
643 |
|
644 | const event = custom_event(type, detail);
|
645 | callbacks.slice().forEach(fn => {
|
646 | fn.call(component, event);
|
647 | });
|
648 | }
|
649 | };
|
650 | }
|
651 | function setContext(key, context) {
|
652 | get_current_component().$$.context.set(key, context);
|
653 | }
|
654 | function getContext(key) {
|
655 | return get_current_component().$$.context.get(key);
|
656 | }
|
657 |
|
658 |
|
659 |
|
660 | function bubble(component, event) {
|
661 | const callbacks = component.$$.callbacks[event.type];
|
662 | if (callbacks) {
|
663 | callbacks.slice().forEach(fn => fn(event));
|
664 | }
|
665 | }
|
666 |
|
667 | const dirty_components = [];
|
668 | const intros = { enabled: false };
|
669 | const binding_callbacks = [];
|
670 | const render_callbacks = [];
|
671 | const flush_callbacks = [];
|
672 | const resolved_promise = Promise.resolve();
|
673 | let update_scheduled = false;
|
674 | function schedule_update() {
|
675 | if (!update_scheduled) {
|
676 | update_scheduled = true;
|
677 | resolved_promise.then(flush);
|
678 | }
|
679 | }
|
680 | function tick() {
|
681 | schedule_update();
|
682 | return resolved_promise;
|
683 | }
|
684 | function add_render_callback(fn) {
|
685 | render_callbacks.push(fn);
|
686 | }
|
687 | function add_flush_callback(fn) {
|
688 | flush_callbacks.push(fn);
|
689 | }
|
690 | let flushing = false;
|
691 | const seen_callbacks = new Set();
|
692 | function flush() {
|
693 | if (flushing)
|
694 | return;
|
695 | flushing = true;
|
696 | do {
|
697 |
|
698 |
|
699 | for (let i = 0; i < dirty_components.length; i += 1) {
|
700 | const component = dirty_components[i];
|
701 | set_current_component(component);
|
702 | update(component.$$);
|
703 | }
|
704 | dirty_components.length = 0;
|
705 | while (binding_callbacks.length)
|
706 | binding_callbacks.pop()();
|
707 |
|
708 |
|
709 |
|
710 | for (let i = 0; i < render_callbacks.length; i += 1) {
|
711 | const callback = render_callbacks[i];
|
712 | if (!seen_callbacks.has(callback)) {
|
713 |
|
714 | seen_callbacks.add(callback);
|
715 | callback();
|
716 | }
|
717 | }
|
718 | render_callbacks.length = 0;
|
719 | } while (dirty_components.length);
|
720 | while (flush_callbacks.length) {
|
721 | flush_callbacks.pop()();
|
722 | }
|
723 | update_scheduled = false;
|
724 | flushing = false;
|
725 | seen_callbacks.clear();
|
726 | }
|
727 | function update($$) {
|
728 | if ($$.fragment !== null) {
|
729 | $$.update();
|
730 | run_all($$.before_update);
|
731 | const dirty = $$.dirty;
|
732 | $$.dirty = [-1];
|
733 | $$.fragment && $$.fragment.p($$.ctx, dirty);
|
734 | $$.after_update.forEach(add_render_callback);
|
735 | }
|
736 | }
|
737 |
|
738 | let promise;
|
739 | function wait() {
|
740 | if (!promise) {
|
741 | promise = Promise.resolve();
|
742 | promise.then(() => {
|
743 | promise = null;
|
744 | });
|
745 | }
|
746 | return promise;
|
747 | }
|
748 | function dispatch(node, direction, kind) {
|
749 | node.dispatchEvent(custom_event(`${direction ? 'intro' : 'outro'}${kind}`));
|
750 | }
|
751 | const outroing = new Set();
|
752 | let outros;
|
753 | function group_outros() {
|
754 | outros = {
|
755 | r: 0,
|
756 | c: [],
|
757 | p: outros
|
758 | };
|
759 | }
|
760 | function check_outros() {
|
761 | if (!outros.r) {
|
762 | run_all(outros.c);
|
763 | }
|
764 | outros = outros.p;
|
765 | }
|
766 | function transition_in(block, local) {
|
767 | if (block && block.i) {
|
768 | outroing.delete(block);
|
769 | block.i(local);
|
770 | }
|
771 | }
|
772 | function transition_out(block, local, detach, callback) {
|
773 | if (block && block.o) {
|
774 | if (outroing.has(block))
|
775 | return;
|
776 | outroing.add(block);
|
777 | outros.c.push(() => {
|
778 | outroing.delete(block);
|
779 | if (callback) {
|
780 | if (detach)
|
781 | block.d(1);
|
782 | callback();
|
783 | }
|
784 | });
|
785 | block.o(local);
|
786 | }
|
787 | }
|
788 | const null_transition = { duration: 0 };
|
789 | function create_in_transition(node, fn, params) {
|
790 | let config = fn(node, params);
|
791 | let running = false;
|
792 | let animation_name;
|
793 | let task;
|
794 | let uid = 0;
|
795 | function cleanup() {
|
796 | if (animation_name)
|
797 | delete_rule(node, animation_name);
|
798 | }
|
799 | function go() {
|
800 | const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;
|
801 | if (css)
|
802 | animation_name = create_rule(node, 0, 1, duration, delay, easing, css, uid++);
|
803 | tick(0, 1);
|
804 | const start_time = now() + delay;
|
805 | const end_time = start_time + duration;
|
806 | if (task)
|
807 | task.abort();
|
808 | running = true;
|
809 | add_render_callback(() => dispatch(node, true, 'start'));
|
810 | task = loop(now => {
|
811 | if (running) {
|
812 | if (now >= end_time) {
|
813 | tick(1, 0);
|
814 | dispatch(node, true, 'end');
|
815 | cleanup();
|
816 | return running = false;
|
817 | }
|
818 | if (now >= start_time) {
|
819 | const t = easing((now - start_time) / duration);
|
820 | tick(t, 1 - t);
|
821 | }
|
822 | }
|
823 | return running;
|
824 | });
|
825 | }
|
826 | let started = false;
|
827 | return {
|
828 | start() {
|
829 | if (started)
|
830 | return;
|
831 | delete_rule(node);
|
832 | if (is_function(config)) {
|
833 | config = config();
|
834 | wait().then(go);
|
835 | }
|
836 | else {
|
837 | go();
|
838 | }
|
839 | },
|
840 | invalidate() {
|
841 | started = false;
|
842 | },
|
843 | end() {
|
844 | if (running) {
|
845 | cleanup();
|
846 | running = false;
|
847 | }
|
848 | }
|
849 | };
|
850 | }
|
851 | function create_out_transition(node, fn, params) {
|
852 | let config = fn(node, params);
|
853 | let running = true;
|
854 | let animation_name;
|
855 | const group = outros;
|
856 | group.r += 1;
|
857 | function go() {
|
858 | const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;
|
859 | if (css)
|
860 | animation_name = create_rule(node, 1, 0, duration, delay, easing, css);
|
861 | const start_time = now() + delay;
|
862 | const end_time = start_time + duration;
|
863 | add_render_callback(() => dispatch(node, false, 'start'));
|
864 | loop(now => {
|
865 | if (running) {
|
866 | if (now >= end_time) {
|
867 | tick(0, 1);
|
868 | dispatch(node, false, 'end');
|
869 | if (!--group.r) {
|
870 |
|
871 |
|
872 | run_all(group.c);
|
873 | }
|
874 | return false;
|
875 | }
|
876 | if (now >= start_time) {
|
877 | const t = easing((now - start_time) / duration);
|
878 | tick(1 - t, t);
|
879 | }
|
880 | }
|
881 | return running;
|
882 | });
|
883 | }
|
884 | if (is_function(config)) {
|
885 | wait().then(() => {
|
886 |
|
887 | config = config();
|
888 | go();
|
889 | });
|
890 | }
|
891 | else {
|
892 | go();
|
893 | }
|
894 | return {
|
895 | end(reset) {
|
896 | if (reset && config.tick) {
|
897 | config.tick(1, 0);
|
898 | }
|
899 | if (running) {
|
900 | if (animation_name)
|
901 | delete_rule(node, animation_name);
|
902 | running = false;
|
903 | }
|
904 | }
|
905 | };
|
906 | }
|
907 | function create_bidirectional_transition(node, fn, params, intro) {
|
908 | let config = fn(node, params);
|
909 | let t = intro ? 0 : 1;
|
910 | let running_program = null;
|
911 | let pending_program = null;
|
912 | let animation_name = null;
|
913 | function clear_animation() {
|
914 | if (animation_name)
|
915 | delete_rule(node, animation_name);
|
916 | }
|
917 | function init(program, duration) {
|
918 | const d = program.b - t;
|
919 | duration *= Math.abs(d);
|
920 | return {
|
921 | a: t,
|
922 | b: program.b,
|
923 | d,
|
924 | duration,
|
925 | start: program.start,
|
926 | end: program.start + duration,
|
927 | group: program.group
|
928 | };
|
929 | }
|
930 | function go(b) {
|
931 | const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;
|
932 | const program = {
|
933 | start: now() + delay,
|
934 | b
|
935 | };
|
936 | if (!b) {
|
937 |
|
938 | program.group = outros;
|
939 | outros.r += 1;
|
940 | }
|
941 | if (running_program) {
|
942 | pending_program = program;
|
943 | }
|
944 | else {
|
945 |
|
946 |
|
947 | if (css) {
|
948 | clear_animation();
|
949 | animation_name = create_rule(node, t, b, duration, delay, easing, css);
|
950 | }
|
951 | if (b)
|
952 | tick(0, 1);
|
953 | running_program = init(program, duration);
|
954 | add_render_callback(() => dispatch(node, b, 'start'));
|
955 | loop(now => {
|
956 | if (pending_program && now > pending_program.start) {
|
957 | running_program = init(pending_program, duration);
|
958 | pending_program = null;
|
959 | dispatch(node, running_program.b, 'start');
|
960 | if (css) {
|
961 | clear_animation();
|
962 | animation_name = create_rule(node, t, running_program.b, running_program.duration, 0, easing, config.css);
|
963 | }
|
964 | }
|
965 | if (running_program) {
|
966 | if (now >= running_program.end) {
|
967 | tick(t = running_program.b, 1 - t);
|
968 | dispatch(node, running_program.b, 'end');
|
969 | if (!pending_program) {
|
970 |
|
971 | if (running_program.b) {
|
972 |
|
973 | clear_animation();
|
974 | }
|
975 | else {
|
976 |
|
977 | if (!--running_program.group.r)
|
978 | run_all(running_program.group.c);
|
979 | }
|
980 | }
|
981 | running_program = null;
|
982 | }
|
983 | else if (now >= running_program.start) {
|
984 | const p = now - running_program.start;
|
985 | t = running_program.a + running_program.d * easing(p / running_program.duration);
|
986 | tick(t, 1 - t);
|
987 | }
|
988 | }
|
989 | return !!(running_program || pending_program);
|
990 | });
|
991 | }
|
992 | }
|
993 | return {
|
994 | run(b) {
|
995 | if (is_function(config)) {
|
996 | wait().then(() => {
|
997 |
|
998 | config = config();
|
999 | go(b);
|
1000 | });
|
1001 | }
|
1002 | else {
|
1003 | go(b);
|
1004 | }
|
1005 | },
|
1006 | end() {
|
1007 | clear_animation();
|
1008 | running_program = pending_program = null;
|
1009 | }
|
1010 | };
|
1011 | }
|
1012 |
|
1013 | function handle_promise(promise, info) {
|
1014 | const token = info.token = {};
|
1015 | function update(type, index, key, value) {
|
1016 | if (info.token !== token)
|
1017 | return;
|
1018 | info.resolved = value;
|
1019 | let child_ctx = info.ctx;
|
1020 | if (key !== undefined) {
|
1021 | child_ctx = child_ctx.slice();
|
1022 | child_ctx[key] = value;
|
1023 | }
|
1024 | const block = type && (info.current = type)(child_ctx);
|
1025 | let needs_flush = false;
|
1026 | if (info.block) {
|
1027 | if (info.blocks) {
|
1028 | info.blocks.forEach((block, i) => {
|
1029 | if (i !== index && block) {
|
1030 | group_outros();
|
1031 | transition_out(block, 1, 1, () => {
|
1032 | info.blocks[i] = null;
|
1033 | });
|
1034 | check_outros();
|
1035 | }
|
1036 | });
|
1037 | }
|
1038 | else {
|
1039 | info.block.d(1);
|
1040 | }
|
1041 | block.c();
|
1042 | transition_in(block, 1);
|
1043 | block.m(info.mount(), info.anchor);
|
1044 | needs_flush = true;
|
1045 | }
|
1046 | info.block = block;
|
1047 | if (info.blocks)
|
1048 | info.blocks[index] = block;
|
1049 | if (needs_flush) {
|
1050 | flush();
|
1051 | }
|
1052 | }
|
1053 | if (is_promise(promise)) {
|
1054 | const current_component = get_current_component();
|
1055 | promise.then(value => {
|
1056 | set_current_component(current_component);
|
1057 | update(info.then, 1, info.value, value);
|
1058 | set_current_component(null);
|
1059 | }, error => {
|
1060 | set_current_component(current_component);
|
1061 | update(info.catch, 2, info.error, error);
|
1062 | set_current_component(null);
|
1063 | });
|
1064 |
|
1065 | if (info.current !== info.pending) {
|
1066 | update(info.pending, 0);
|
1067 | return true;
|
1068 | }
|
1069 | }
|
1070 | else {
|
1071 | if (info.current !== info.then) {
|
1072 | update(info.then, 1, info.value, promise);
|
1073 | return true;
|
1074 | }
|
1075 | info.resolved = promise;
|
1076 | }
|
1077 | }
|
1078 |
|
1079 | const globals = (typeof window !== 'undefined'
|
1080 | ? window
|
1081 | : typeof globalThis !== 'undefined'
|
1082 | ? globalThis
|
1083 | : global);
|
1084 |
|
1085 | function destroy_block(block, lookup) {
|
1086 | block.d(1);
|
1087 | lookup.delete(block.key);
|
1088 | }
|
1089 | function outro_and_destroy_block(block, lookup) {
|
1090 | transition_out(block, 1, 1, () => {
|
1091 | lookup.delete(block.key);
|
1092 | });
|
1093 | }
|
1094 | function fix_and_destroy_block(block, lookup) {
|
1095 | block.f();
|
1096 | destroy_block(block, lookup);
|
1097 | }
|
1098 | function fix_and_outro_and_destroy_block(block, lookup) {
|
1099 | block.f();
|
1100 | outro_and_destroy_block(block, lookup);
|
1101 | }
|
1102 | function update_keyed_each(old_blocks, dirty, get_key, dynamic, ctx, list, lookup, node, destroy, create_each_block, next, get_context) {
|
1103 | let o = old_blocks.length;
|
1104 | let n = list.length;
|
1105 | let i = o;
|
1106 | const old_indexes = {};
|
1107 | while (i--)
|
1108 | old_indexes[old_blocks[i].key] = i;
|
1109 | const new_blocks = [];
|
1110 | const new_lookup = new Map();
|
1111 | const deltas = new Map();
|
1112 | i = n;
|
1113 | while (i--) {
|
1114 | const child_ctx = get_context(ctx, list, i);
|
1115 | const key = get_key(child_ctx);
|
1116 | let block = lookup.get(key);
|
1117 | if (!block) {
|
1118 | block = create_each_block(key, child_ctx);
|
1119 | block.c();
|
1120 | }
|
1121 | else if (dynamic) {
|
1122 | block.p(child_ctx, dirty);
|
1123 | }
|
1124 | new_lookup.set(key, new_blocks[i] = block);
|
1125 | if (key in old_indexes)
|
1126 | deltas.set(key, Math.abs(i - old_indexes[key]));
|
1127 | }
|
1128 | const will_move = new Set();
|
1129 | const did_move = new Set();
|
1130 | function insert(block) {
|
1131 | transition_in(block, 1);
|
1132 | block.m(node, next);
|
1133 | lookup.set(block.key, block);
|
1134 | next = block.first;
|
1135 | n--;
|
1136 | }
|
1137 | while (o && n) {
|
1138 | const new_block = new_blocks[n - 1];
|
1139 | const old_block = old_blocks[o - 1];
|
1140 | const new_key = new_block.key;
|
1141 | const old_key = old_block.key;
|
1142 | if (new_block === old_block) {
|
1143 |
|
1144 | next = new_block.first;
|
1145 | o--;
|
1146 | n--;
|
1147 | }
|
1148 | else if (!new_lookup.has(old_key)) {
|
1149 |
|
1150 | destroy(old_block, lookup);
|
1151 | o--;
|
1152 | }
|
1153 | else if (!lookup.has(new_key) || will_move.has(new_key)) {
|
1154 | insert(new_block);
|
1155 | }
|
1156 | else if (did_move.has(old_key)) {
|
1157 | o--;
|
1158 | }
|
1159 | else if (deltas.get(new_key) > deltas.get(old_key)) {
|
1160 | did_move.add(new_key);
|
1161 | insert(new_block);
|
1162 | }
|
1163 | else {
|
1164 | will_move.add(old_key);
|
1165 | o--;
|
1166 | }
|
1167 | }
|
1168 | while (o--) {
|
1169 | const old_block = old_blocks[o];
|
1170 | if (!new_lookup.has(old_block.key))
|
1171 | destroy(old_block, lookup);
|
1172 | }
|
1173 | while (n)
|
1174 | insert(new_blocks[n - 1]);
|
1175 | return new_blocks;
|
1176 | }
|
1177 | function validate_each_keys(ctx, list, get_context, get_key) {
|
1178 | const keys = new Set();
|
1179 | for (let i = 0; i < list.length; i++) {
|
1180 | const key = get_key(get_context(ctx, list, i));
|
1181 | if (keys.has(key)) {
|
1182 | throw new Error(`Cannot have duplicate keys in a keyed each`);
|
1183 | }
|
1184 | keys.add(key);
|
1185 | }
|
1186 | }
|
1187 |
|
1188 | function get_spread_update(levels, updates) {
|
1189 | const update = {};
|
1190 | const to_null_out = {};
|
1191 | const accounted_for = { $$scope: 1 };
|
1192 | let i = levels.length;
|
1193 | while (i--) {
|
1194 | const o = levels[i];
|
1195 | const n = updates[i];
|
1196 | if (n) {
|
1197 | for (const key in o) {
|
1198 | if (!(key in n))
|
1199 | to_null_out[key] = 1;
|
1200 | }
|
1201 | for (const key in n) {
|
1202 | if (!accounted_for[key]) {
|
1203 | update[key] = n[key];
|
1204 | accounted_for[key] = 1;
|
1205 | }
|
1206 | }
|
1207 | levels[i] = n;
|
1208 | }
|
1209 | else {
|
1210 | for (const key in o) {
|
1211 | accounted_for[key] = 1;
|
1212 | }
|
1213 | }
|
1214 | }
|
1215 | for (const key in to_null_out) {
|
1216 | if (!(key in update))
|
1217 | update[key] = undefined;
|
1218 | }
|
1219 | return update;
|
1220 | }
|
1221 | function get_spread_object(spread_props) {
|
1222 | return typeof spread_props === 'object' && spread_props !== null ? spread_props : {};
|
1223 | }
|
1224 |
|
1225 |
|
1226 | const boolean_attributes = new Set([
|
1227 | 'allowfullscreen',
|
1228 | 'allowpaymentrequest',
|
1229 | 'async',
|
1230 | 'autofocus',
|
1231 | 'autoplay',
|
1232 | 'checked',
|
1233 | 'controls',
|
1234 | 'default',
|
1235 | 'defer',
|
1236 | 'disabled',
|
1237 | 'formnovalidate',
|
1238 | 'hidden',
|
1239 | 'ismap',
|
1240 | 'loop',
|
1241 | 'multiple',
|
1242 | 'muted',
|
1243 | 'nomodule',
|
1244 | 'novalidate',
|
1245 | 'open',
|
1246 | 'playsinline',
|
1247 | 'readonly',
|
1248 | 'required',
|
1249 | 'reversed',
|
1250 | 'selected'
|
1251 | ]);
|
1252 |
|
1253 | 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;
|
1254 |
|
1255 |
|
1256 | function spread(args, classes_to_add) {
|
1257 | const attributes = Object.assign({}, ...args);
|
1258 | if (classes_to_add) {
|
1259 | if (attributes.class == null) {
|
1260 | attributes.class = classes_to_add;
|
1261 | }
|
1262 | else {
|
1263 | attributes.class += ' ' + classes_to_add;
|
1264 | }
|
1265 | }
|
1266 | let str = '';
|
1267 | Object.keys(attributes).forEach(name => {
|
1268 | if (invalid_attribute_name_character.test(name))
|
1269 | return;
|
1270 | const value = attributes[name];
|
1271 | if (value === true)
|
1272 | str += " " + name;
|
1273 | else if (boolean_attributes.has(name.toLowerCase())) {
|
1274 | if (value)
|
1275 | str += " " + name;
|
1276 | }
|
1277 | else if (value != null) {
|
1278 | str += ` ${name}="${String(value).replace(/"/g, '"').replace(/'/g, ''')}"`;
|
1279 | }
|
1280 | });
|
1281 | return str;
|
1282 | }
|
1283 | const escaped = {
|
1284 | '"': '"',
|
1285 | "'": ''',
|
1286 | '&': '&',
|
1287 | '<': '<',
|
1288 | '>': '>'
|
1289 | };
|
1290 | function escape(html) {
|
1291 | return String(html).replace(/["'&<>]/g, match => escaped[match]);
|
1292 | }
|
1293 | function each(items, fn) {
|
1294 | let str = '';
|
1295 | for (let i = 0; i < items.length; i += 1) {
|
1296 | str += fn(items[i], i);
|
1297 | }
|
1298 | return str;
|
1299 | }
|
1300 | const missing_component = {
|
1301 | $$render: () => ''
|
1302 | };
|
1303 | function validate_component(component, name) {
|
1304 | if (!component || !component.$$render) {
|
1305 | if (name === 'svelte:component')
|
1306 | name += ' this={...}';
|
1307 | 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`);
|
1308 | }
|
1309 | return component;
|
1310 | }
|
1311 | function debug(file, line, column, values) {
|
1312 | console.log(`{@debug} ${file ? file + ' ' : ''}(${line}:${column})`);
|
1313 | console.log(values);
|
1314 | return '';
|
1315 | }
|
1316 | let on_destroy;
|
1317 | function create_ssr_component(fn) {
|
1318 | function $$render(result, props, bindings, slots) {
|
1319 | const parent_component = current_component;
|
1320 | const $$ = {
|
1321 | on_destroy,
|
1322 | context: new Map(parent_component ? parent_component.$$.context : []),
|
1323 |
|
1324 | on_mount: [],
|
1325 | before_update: [],
|
1326 | after_update: [],
|
1327 | callbacks: blank_object()
|
1328 | };
|
1329 | set_current_component({ $$ });
|
1330 | const html = fn(result, props, bindings, slots);
|
1331 | set_current_component(parent_component);
|
1332 | return html;
|
1333 | }
|
1334 | return {
|
1335 | render: (props = {}, options = {}) => {
|
1336 | on_destroy = [];
|
1337 | const result = { title: '', head: '', css: new Set() };
|
1338 | const html = $$render(result, props, {}, options);
|
1339 | run_all(on_destroy);
|
1340 | return {
|
1341 | html,
|
1342 | css: {
|
1343 | code: Array.from(result.css).map(css => css.code).join('\n'),
|
1344 | map: null
|
1345 | },
|
1346 | head: result.title + result.head
|
1347 | };
|
1348 | },
|
1349 | $$render
|
1350 | };
|
1351 | }
|
1352 | function add_attribute(name, value, boolean) {
|
1353 | if (value == null || (boolean && !value))
|
1354 | return '';
|
1355 | return ` ${name}${value === true ? '' : `=${typeof value === 'string' ? JSON.stringify(escape(value)) : `"${value}"`}`}`;
|
1356 | }
|
1357 | function add_classes(classes) {
|
1358 | return classes ? ` class="${classes}"` : ``;
|
1359 | }
|
1360 |
|
1361 | function bind(component, name, callback) {
|
1362 | const index = component.$$.props[name];
|
1363 | if (index !== undefined) {
|
1364 | component.$$.bound[index] = callback;
|
1365 | callback(component.$$.ctx[index]);
|
1366 | }
|
1367 | }
|
1368 | function create_component(block) {
|
1369 | block && block.c();
|
1370 | }
|
1371 | function claim_component(block, parent_nodes) {
|
1372 | block && block.l(parent_nodes);
|
1373 | }
|
1374 | function mount_component(component, target, anchor) {
|
1375 | const { fragment, on_mount, on_destroy, after_update } = component.$$;
|
1376 | fragment && fragment.m(target, anchor);
|
1377 |
|
1378 | add_render_callback(() => {
|
1379 | const new_on_destroy = on_mount.map(run).filter(is_function);
|
1380 | if (on_destroy) {
|
1381 | on_destroy.push(...new_on_destroy);
|
1382 | }
|
1383 | else {
|
1384 |
|
1385 |
|
1386 | run_all(new_on_destroy);
|
1387 | }
|
1388 | component.$$.on_mount = [];
|
1389 | });
|
1390 | after_update.forEach(add_render_callback);
|
1391 | }
|
1392 | function destroy_component(component, detaching) {
|
1393 | const $$ = component.$$;
|
1394 | if ($$.fragment !== null) {
|
1395 | run_all($$.on_destroy);
|
1396 | $$.fragment && $$.fragment.d(detaching);
|
1397 |
|
1398 |
|
1399 | $$.on_destroy = $$.fragment = null;
|
1400 | $$.ctx = [];
|
1401 | }
|
1402 | }
|
1403 | function make_dirty(component, i) {
|
1404 | if (component.$$.dirty[0] === -1) {
|
1405 | dirty_components.push(component);
|
1406 | schedule_update();
|
1407 | component.$$.dirty.fill(0);
|
1408 | }
|
1409 | component.$$.dirty[(i / 31) | 0] |= (1 << (i % 31));
|
1410 | }
|
1411 | function init(component, options, instance, create_fragment, not_equal, props, dirty = [-1]) {
|
1412 | const parent_component = current_component;
|
1413 | set_current_component(component);
|
1414 | const prop_values = options.props || {};
|
1415 | const $$ = component.$$ = {
|
1416 | fragment: null,
|
1417 | ctx: null,
|
1418 |
|
1419 | props,
|
1420 | update: noop,
|
1421 | not_equal,
|
1422 | bound: blank_object(),
|
1423 |
|
1424 | on_mount: [],
|
1425 | on_destroy: [],
|
1426 | before_update: [],
|
1427 | after_update: [],
|
1428 | context: new Map(parent_component ? parent_component.$$.context : []),
|
1429 |
|
1430 | callbacks: blank_object(),
|
1431 | dirty,
|
1432 | skip_bound: false
|
1433 | };
|
1434 | let ready = false;
|
1435 | $$.ctx = instance
|
1436 | ? instance(component, prop_values, (i, ret, ...rest) => {
|
1437 | const value = rest.length ? rest[0] : ret;
|
1438 | if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) {
|
1439 | if (!$$.skip_bound && $$.bound[i])
|
1440 | $$.bound[i](value);
|
1441 | if (ready)
|
1442 | make_dirty(component, i);
|
1443 | }
|
1444 | return ret;
|
1445 | })
|
1446 | : [];
|
1447 | $$.update();
|
1448 | ready = true;
|
1449 | run_all($$.before_update);
|
1450 |
|
1451 | $$.fragment = create_fragment ? create_fragment($$.ctx) : false;
|
1452 | if (options.target) {
|
1453 | if (options.hydrate) {
|
1454 | const nodes = children(options.target);
|
1455 |
|
1456 | $$.fragment && $$.fragment.l(nodes);
|
1457 | nodes.forEach(detach);
|
1458 | }
|
1459 | else {
|
1460 |
|
1461 | $$.fragment && $$.fragment.c();
|
1462 | }
|
1463 | if (options.intro)
|
1464 | transition_in(component.$$.fragment);
|
1465 | mount_component(component, options.target, options.anchor);
|
1466 | flush();
|
1467 | }
|
1468 | set_current_component(parent_component);
|
1469 | }
|
1470 | let SvelteElement;
|
1471 | if (typeof HTMLElement === 'function') {
|
1472 | SvelteElement = class extends HTMLElement {
|
1473 | constructor() {
|
1474 | super();
|
1475 | this.attachShadow({ mode: 'open' });
|
1476 | }
|
1477 | connectedCallback() {
|
1478 |
|
1479 | for (const key in this.$$.slotted) {
|
1480 |
|
1481 | this.appendChild(this.$$.slotted[key]);
|
1482 | }
|
1483 | }
|
1484 | attributeChangedCallback(attr, _oldValue, newValue) {
|
1485 | this[attr] = newValue;
|
1486 | }
|
1487 | $destroy() {
|
1488 | destroy_component(this, 1);
|
1489 | this.$destroy = noop;
|
1490 | }
|
1491 | $on(type, callback) {
|
1492 |
|
1493 | const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = []));
|
1494 | callbacks.push(callback);
|
1495 | return () => {
|
1496 | const index = callbacks.indexOf(callback);
|
1497 | if (index !== -1)
|
1498 | callbacks.splice(index, 1);
|
1499 | };
|
1500 | }
|
1501 | $set($$props) {
|
1502 | if (this.$$set && !is_empty($$props)) {
|
1503 | this.$$.skip_bound = true;
|
1504 | this.$$set($$props);
|
1505 | this.$$.skip_bound = false;
|
1506 | }
|
1507 | }
|
1508 | };
|
1509 | }
|
1510 | class SvelteComponent {
|
1511 | $destroy() {
|
1512 | destroy_component(this, 1);
|
1513 | this.$destroy = noop;
|
1514 | }
|
1515 | $on(type, callback) {
|
1516 | const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = []));
|
1517 | callbacks.push(callback);
|
1518 | return () => {
|
1519 | const index = callbacks.indexOf(callback);
|
1520 | if (index !== -1)
|
1521 | callbacks.splice(index, 1);
|
1522 | };
|
1523 | }
|
1524 | $set($$props) {
|
1525 | if (this.$$set && !is_empty($$props)) {
|
1526 | this.$$.skip_bound = true;
|
1527 | this.$$set($$props);
|
1528 | this.$$.skip_bound = false;
|
1529 | }
|
1530 | }
|
1531 | }
|
1532 |
|
1533 | function dispatch_dev(type, detail) {
|
1534 | document.dispatchEvent(custom_event(type, Object.assign({ version: '3.24.1' }, detail)));
|
1535 | }
|
1536 | function append_dev(target, node) {
|
1537 | dispatch_dev("SvelteDOMInsert", { target, node });
|
1538 | append(target, node);
|
1539 | }
|
1540 | function insert_dev(target, node, anchor) {
|
1541 | dispatch_dev("SvelteDOMInsert", { target, node, anchor });
|
1542 | insert(target, node, anchor);
|
1543 | }
|
1544 | function detach_dev(node) {
|
1545 | dispatch_dev("SvelteDOMRemove", { node });
|
1546 | detach(node);
|
1547 | }
|
1548 | function detach_between_dev(before, after) {
|
1549 | while (before.nextSibling && before.nextSibling !== after) {
|
1550 | detach_dev(before.nextSibling);
|
1551 | }
|
1552 | }
|
1553 | function detach_before_dev(after) {
|
1554 | while (after.previousSibling) {
|
1555 | detach_dev(after.previousSibling);
|
1556 | }
|
1557 | }
|
1558 | function detach_after_dev(before) {
|
1559 | while (before.nextSibling) {
|
1560 | detach_dev(before.nextSibling);
|
1561 | }
|
1562 | }
|
1563 | function listen_dev(node, event, handler, options, has_prevent_default, has_stop_propagation) {
|
1564 | const modifiers = options === true ? ["capture"] : options ? Array.from(Object.keys(options)) : [];
|
1565 | if (has_prevent_default)
|
1566 | modifiers.push('preventDefault');
|
1567 | if (has_stop_propagation)
|
1568 | modifiers.push('stopPropagation');
|
1569 | dispatch_dev("SvelteDOMAddEventListener", { node, event, handler, modifiers });
|
1570 | const dispose = listen(node, event, handler, options);
|
1571 | return () => {
|
1572 | dispatch_dev("SvelteDOMRemoveEventListener", { node, event, handler, modifiers });
|
1573 | dispose();
|
1574 | };
|
1575 | }
|
1576 | function attr_dev(node, attribute, value) {
|
1577 | attr(node, attribute, value);
|
1578 | if (value == null)
|
1579 | dispatch_dev("SvelteDOMRemoveAttribute", { node, attribute });
|
1580 | else
|
1581 | dispatch_dev("SvelteDOMSetAttribute", { node, attribute, value });
|
1582 | }
|
1583 | function prop_dev(node, property, value) {
|
1584 | node[property] = value;
|
1585 | dispatch_dev("SvelteDOMSetProperty", { node, property, value });
|
1586 | }
|
1587 | function dataset_dev(node, property, value) {
|
1588 | node.dataset[property] = value;
|
1589 | dispatch_dev("SvelteDOMSetDataset", { node, property, value });
|
1590 | }
|
1591 | function set_data_dev(text, data) {
|
1592 | data = '' + data;
|
1593 | if (text.wholeText === data)
|
1594 | return;
|
1595 | dispatch_dev("SvelteDOMSetData", { node: text, data });
|
1596 | text.data = data;
|
1597 | }
|
1598 | function validate_each_argument(arg) {
|
1599 | if (typeof arg !== 'string' && !(arg && typeof arg === 'object' && 'length' in arg)) {
|
1600 | let msg = '{#each} only iterates over array-like objects.';
|
1601 | if (typeof Symbol === 'function' && arg && Symbol.iterator in arg) {
|
1602 | msg += ' You can use a spread to convert this iterable into an array.';
|
1603 | }
|
1604 | throw new Error(msg);
|
1605 | }
|
1606 | }
|
1607 | function validate_slots(name, slot, keys) {
|
1608 | for (const slot_key of Object.keys(slot)) {
|
1609 | if (!~keys.indexOf(slot_key)) {
|
1610 | console.warn(`<${name}> received an unexpected slot "${slot_key}".`);
|
1611 | }
|
1612 | }
|
1613 | }
|
1614 | class SvelteComponentDev extends SvelteComponent {
|
1615 | constructor(options) {
|
1616 | if (!options || (!options.target && !options.$$inline)) {
|
1617 | throw new Error(`'target' is a required option`);
|
1618 | }
|
1619 | super();
|
1620 | }
|
1621 | $destroy() {
|
1622 | super.$destroy();
|
1623 | this.$destroy = () => {
|
1624 | console.warn(`Component was already destroyed`);
|
1625 | };
|
1626 | }
|
1627 | $capture_state() { }
|
1628 | $inject_state() { }
|
1629 | }
|
1630 | function loop_guard(timeout) {
|
1631 | const start = Date.now();
|
1632 | return () => {
|
1633 | if (Date.now() - start > timeout) {
|
1634 | throw new Error(`Infinite loop detected`);
|
1635 | }
|
1636 | };
|
1637 | }
|
1638 |
|
1639 | export { HtmlTag, SvelteComponent, SvelteComponentDev, SvelteElement, action_destroyer, add_attribute, add_classes, add_flush_callback, add_location, add_render_callback, add_resize_listener, add_transform, afterUpdate, append, append_dev, assign, attr, attr_dev, beforeUpdate, bind, binding_callbacks, blank_object, bubble, check_outros, children, claim_component, claim_element, claim_space, claim_text, clear_loops, component_subscribe, compute_rest_props, createEventDispatcher, create_animation, create_bidirectional_transition, create_component, create_in_transition, create_out_transition, create_slot, create_ssr_component, current_component, custom_event, dataset_dev, debug, destroy_block, destroy_component, destroy_each, detach, detach_after_dev, detach_before_dev, detach_between_dev, detach_dev, dirty_components, dispatch_dev, each, element, element_is, empty, escape, escaped, exclude_internal_props, fix_and_destroy_block, fix_and_outro_and_destroy_block, fix_position, flush, getContext, get_binding_group_value, get_current_component, get_slot_changes, get_slot_context, get_spread_object, get_spread_update, get_store_value, globals, group_outros, handle_promise, has_prop, identity, init, insert, insert_dev, intros, invalid_attribute_name_character, is_client, is_crossorigin, is_empty, is_function, is_promise, listen, listen_dev, loop, loop_guard, missing_component, mount_component, noop, not_equal, now, null_to_empty, object_without_properties, onDestroy, onMount, once, outro_and_destroy_block, prevent_default, prop_dev, query_selector_all, raf, run, run_all, safe_not_equal, schedule_update, select_multiple_value, select_option, select_options, select_value, self, setContext, set_attributes, set_current_component, set_custom_element_data, set_data, set_data_dev, set_input_type, set_input_value, set_now, set_raf, set_store_value, set_style, set_svg_attributes, space, spread, stop_propagation, subscribe, svg_element, text, tick, time_ranges_to_array, to_number, toggle_class, transition_in, transition_out, update_keyed_each, update_slot, validate_component, validate_each_argument, validate_each_keys, validate_slots, validate_store, xlink_attr };
|