3161 lines
104 KiB
JavaScript
3161 lines
104 KiB
JavaScript
|
|
||
|
(function(l, r) { if (l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (window.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(window.document);
|
||
|
var app = (function () {
|
||
|
'use strict';
|
||
|
|
||
|
function noop() { }
|
||
|
const identity = x => x;
|
||
|
function assign(tar, src) {
|
||
|
// @ts-ignore
|
||
|
for (const k in src)
|
||
|
tar[k] = src[k];
|
||
|
return tar;
|
||
|
}
|
||
|
function add_location(element, file, line, column, char) {
|
||
|
element.__svelte_meta = {
|
||
|
loc: { file, line, column, char }
|
||
|
};
|
||
|
}
|
||
|
function run(fn) {
|
||
|
return fn();
|
||
|
}
|
||
|
function blank_object() {
|
||
|
return Object.create(null);
|
||
|
}
|
||
|
function run_all(fns) {
|
||
|
fns.forEach(run);
|
||
|
}
|
||
|
function is_function(thing) {
|
||
|
return typeof thing === 'function';
|
||
|
}
|
||
|
function safe_not_equal(a, b) {
|
||
|
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
|
||
|
}
|
||
|
function is_empty(obj) {
|
||
|
return Object.keys(obj).length === 0;
|
||
|
}
|
||
|
function subscribe(store, ...callbacks) {
|
||
|
if (store == null) {
|
||
|
return noop;
|
||
|
}
|
||
|
const unsub = store.subscribe(...callbacks);
|
||
|
return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;
|
||
|
}
|
||
|
|
||
|
const is_client = typeof window !== 'undefined';
|
||
|
let now = is_client
|
||
|
? () => window.performance.now()
|
||
|
: () => Date.now();
|
||
|
let raf = is_client ? cb => requestAnimationFrame(cb) : noop;
|
||
|
|
||
|
const tasks = new Set();
|
||
|
function run_tasks(now) {
|
||
|
tasks.forEach(task => {
|
||
|
if (!task.c(now)) {
|
||
|
tasks.delete(task);
|
||
|
task.f();
|
||
|
}
|
||
|
});
|
||
|
if (tasks.size !== 0)
|
||
|
raf(run_tasks);
|
||
|
}
|
||
|
/**
|
||
|
* Creates a new task that runs on each raf frame
|
||
|
* until it returns a falsy value or is aborted
|
||
|
*/
|
||
|
function loop(callback) {
|
||
|
let task;
|
||
|
if (tasks.size === 0)
|
||
|
raf(run_tasks);
|
||
|
return {
|
||
|
promise: new Promise(fulfill => {
|
||
|
tasks.add(task = { c: callback, f: fulfill });
|
||
|
}),
|
||
|
abort() {
|
||
|
tasks.delete(task);
|
||
|
}
|
||
|
};
|
||
|
}
|
||
|
|
||
|
function append(target, node) {
|
||
|
target.appendChild(node);
|
||
|
}
|
||
|
function insert(target, node, anchor) {
|
||
|
target.insertBefore(node, anchor || null);
|
||
|
}
|
||
|
function detach(node) {
|
||
|
node.parentNode.removeChild(node);
|
||
|
}
|
||
|
function element(name) {
|
||
|
return document.createElement(name);
|
||
|
}
|
||
|
function svg_element(name) {
|
||
|
return document.createElementNS('http://www.w3.org/2000/svg', name);
|
||
|
}
|
||
|
function text(data) {
|
||
|
return document.createTextNode(data);
|
||
|
}
|
||
|
function space() {
|
||
|
return text(' ');
|
||
|
}
|
||
|
function empty() {
|
||
|
return text('');
|
||
|
}
|
||
|
function attr(node, attribute, value) {
|
||
|
if (value == null)
|
||
|
node.removeAttribute(attribute);
|
||
|
else if (node.getAttribute(attribute) !== value)
|
||
|
node.setAttribute(attribute, value);
|
||
|
}
|
||
|
function children(element) {
|
||
|
return Array.from(element.childNodes);
|
||
|
}
|
||
|
function custom_event(type, detail) {
|
||
|
const e = document.createEvent('CustomEvent');
|
||
|
e.initCustomEvent(type, false, false, detail);
|
||
|
return e;
|
||
|
}
|
||
|
|
||
|
const active_docs = new Set();
|
||
|
let active = 0;
|
||
|
// https://github.com/darkskyapp/string-hash/blob/master/index.js
|
||
|
function hash(str) {
|
||
|
let hash = 5381;
|
||
|
let i = str.length;
|
||
|
while (i--)
|
||
|
hash = ((hash << 5) - hash) ^ str.charCodeAt(i);
|
||
|
return hash >>> 0;
|
||
|
}
|
||
|
function create_rule(node, a, b, duration, delay, ease, fn, uid = 0) {
|
||
|
const step = 16.666 / duration;
|
||
|
let keyframes = '{\n';
|
||
|
for (let p = 0; p <= 1; p += step) {
|
||
|
const t = a + (b - a) * ease(p);
|
||
|
keyframes += p * 100 + `%{${fn(t, 1 - t)}}\n`;
|
||
|
}
|
||
|
const rule = keyframes + `100% {${fn(b, 1 - b)}}\n}`;
|
||
|
const name = `__svelte_${hash(rule)}_${uid}`;
|
||
|
const doc = node.ownerDocument;
|
||
|
active_docs.add(doc);
|
||
|
const stylesheet = doc.__svelte_stylesheet || (doc.__svelte_stylesheet = doc.head.appendChild(element('style')).sheet);
|
||
|
const current_rules = doc.__svelte_rules || (doc.__svelte_rules = {});
|
||
|
if (!current_rules[name]) {
|
||
|
current_rules[name] = true;
|
||
|
stylesheet.insertRule(`@keyframes ${name} ${rule}`, stylesheet.cssRules.length);
|
||
|
}
|
||
|
const animation = node.style.animation || '';
|
||
|
node.style.animation = `${animation ? `${animation}, ` : ''}${name} ${duration}ms linear ${delay}ms 1 both`;
|
||
|
active += 1;
|
||
|
return name;
|
||
|
}
|
||
|
function delete_rule(node, name) {
|
||
|
const previous = (node.style.animation || '').split(', ');
|
||
|
const next = previous.filter(name
|
||
|
? anim => anim.indexOf(name) < 0 // remove specific animation
|
||
|
: anim => anim.indexOf('__svelte') === -1 // remove all Svelte animations
|
||
|
);
|
||
|
const deleted = previous.length - next.length;
|
||
|
if (deleted) {
|
||
|
node.style.animation = next.join(', ');
|
||
|
active -= deleted;
|
||
|
if (!active)
|
||
|
clear_rules();
|
||
|
}
|
||
|
}
|
||
|
function clear_rules() {
|
||
|
raf(() => {
|
||
|
if (active)
|
||
|
return;
|
||
|
active_docs.forEach(doc => {
|
||
|
const stylesheet = doc.__svelte_stylesheet;
|
||
|
let i = stylesheet.cssRules.length;
|
||
|
while (i--)
|
||
|
stylesheet.deleteRule(i);
|
||
|
doc.__svelte_rules = {};
|
||
|
});
|
||
|
active_docs.clear();
|
||
|
});
|
||
|
}
|
||
|
|
||
|
let current_component;
|
||
|
function set_current_component(component) {
|
||
|
current_component = component;
|
||
|
}
|
||
|
function get_current_component() {
|
||
|
if (!current_component)
|
||
|
throw new Error('Function called outside component initialization');
|
||
|
return current_component;
|
||
|
}
|
||
|
function afterUpdate(fn) {
|
||
|
get_current_component().$$.after_update.push(fn);
|
||
|
}
|
||
|
function onDestroy(fn) {
|
||
|
get_current_component().$$.on_destroy.push(fn);
|
||
|
}
|
||
|
function createEventDispatcher() {
|
||
|
const component = get_current_component();
|
||
|
return (type, detail) => {
|
||
|
const callbacks = component.$$.callbacks[type];
|
||
|
if (callbacks) {
|
||
|
// TODO are there situations where events could be dispatched
|
||
|
// in a server (non-DOM) environment?
|
||
|
const event = custom_event(type, detail);
|
||
|
callbacks.slice().forEach(fn => {
|
||
|
fn.call(component, event);
|
||
|
});
|
||
|
}
|
||
|
};
|
||
|
}
|
||
|
// TODO figure out if we still want to support
|
||
|
// shorthand events, or if we want to implement
|
||
|
// a real bubbling mechanism
|
||
|
function bubble(component, event) {
|
||
|
const callbacks = component.$$.callbacks[event.type];
|
||
|
if (callbacks) {
|
||
|
callbacks.slice().forEach(fn => fn(event));
|
||
|
}
|
||
|
}
|
||
|
|
||
|
const dirty_components = [];
|
||
|
const binding_callbacks = [];
|
||
|
const render_callbacks = [];
|
||
|
const flush_callbacks = [];
|
||
|
const resolved_promise = Promise.resolve();
|
||
|
let update_scheduled = false;
|
||
|
function schedule_update() {
|
||
|
if (!update_scheduled) {
|
||
|
update_scheduled = true;
|
||
|
resolved_promise.then(flush);
|
||
|
}
|
||
|
}
|
||
|
function tick() {
|
||
|
schedule_update();
|
||
|
return resolved_promise;
|
||
|
}
|
||
|
function add_render_callback(fn) {
|
||
|
render_callbacks.push(fn);
|
||
|
}
|
||
|
let flushing = false;
|
||
|
const seen_callbacks = new Set();
|
||
|
function flush() {
|
||
|
if (flushing)
|
||
|
return;
|
||
|
flushing = true;
|
||
|
do {
|
||
|
// first, call beforeUpdate functions
|
||
|
// and update components
|
||
|
for (let i = 0; i < dirty_components.length; i += 1) {
|
||
|
const component = dirty_components[i];
|
||
|
set_current_component(component);
|
||
|
update(component.$$);
|
||
|
}
|
||
|
set_current_component(null);
|
||
|
dirty_components.length = 0;
|
||
|
while (binding_callbacks.length)
|
||
|
binding_callbacks.pop()();
|
||
|
// then, once components are updated, call
|
||
|
// afterUpdate functions. This may cause
|
||
|
// subsequent updates...
|
||
|
for (let i = 0; i < render_callbacks.length; i += 1) {
|
||
|
const callback = render_callbacks[i];
|
||
|
if (!seen_callbacks.has(callback)) {
|
||
|
// ...so guard against infinite loops
|
||
|
seen_callbacks.add(callback);
|
||
|
callback();
|
||
|
}
|
||
|
}
|
||
|
render_callbacks.length = 0;
|
||
|
} while (dirty_components.length);
|
||
|
while (flush_callbacks.length) {
|
||
|
flush_callbacks.pop()();
|
||
|
}
|
||
|
update_scheduled = false;
|
||
|
flushing = false;
|
||
|
seen_callbacks.clear();
|
||
|
}
|
||
|
function update($$) {
|
||
|
if ($$.fragment !== null) {
|
||
|
$$.update();
|
||
|
run_all($$.before_update);
|
||
|
const dirty = $$.dirty;
|
||
|
$$.dirty = [-1];
|
||
|
$$.fragment && $$.fragment.p($$.ctx, dirty);
|
||
|
$$.after_update.forEach(add_render_callback);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
let promise;
|
||
|
function wait() {
|
||
|
if (!promise) {
|
||
|
promise = Promise.resolve();
|
||
|
promise.then(() => {
|
||
|
promise = null;
|
||
|
});
|
||
|
}
|
||
|
return promise;
|
||
|
}
|
||
|
function dispatch(node, direction, kind) {
|
||
|
node.dispatchEvent(custom_event(`${direction ? 'intro' : 'outro'}${kind}`));
|
||
|
}
|
||
|
const outroing = new Set();
|
||
|
let outros;
|
||
|
function group_outros() {
|
||
|
outros = {
|
||
|
r: 0,
|
||
|
c: [],
|
||
|
p: outros // parent group
|
||
|
};
|
||
|
}
|
||
|
function check_outros() {
|
||
|
if (!outros.r) {
|
||
|
run_all(outros.c);
|
||
|
}
|
||
|
outros = outros.p;
|
||
|
}
|
||
|
function transition_in(block, local) {
|
||
|
if (block && block.i) {
|
||
|
outroing.delete(block);
|
||
|
block.i(local);
|
||
|
}
|
||
|
}
|
||
|
function transition_out(block, local, detach, callback) {
|
||
|
if (block && block.o) {
|
||
|
if (outroing.has(block))
|
||
|
return;
|
||
|
outroing.add(block);
|
||
|
outros.c.push(() => {
|
||
|
outroing.delete(block);
|
||
|
if (callback) {
|
||
|
if (detach)
|
||
|
block.d(1);
|
||
|
callback();
|
||
|
}
|
||
|
});
|
||
|
block.o(local);
|
||
|
}
|
||
|
}
|
||
|
const null_transition = { duration: 0 };
|
||
|
function create_in_transition(node, fn, params) {
|
||
|
let config = fn(node, params);
|
||
|
let running = false;
|
||
|
let animation_name;
|
||
|
let task;
|
||
|
let uid = 0;
|
||
|
function cleanup() {
|
||
|
if (animation_name)
|
||
|
delete_rule(node, animation_name);
|
||
|
}
|
||
|
function go() {
|
||
|
const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;
|
||
|
if (css)
|
||
|
animation_name = create_rule(node, 0, 1, duration, delay, easing, css, uid++);
|
||
|
tick(0, 1);
|
||
|
const start_time = now() + delay;
|
||
|
const end_time = start_time + duration;
|
||
|
if (task)
|
||
|
task.abort();
|
||
|
running = true;
|
||
|
add_render_callback(() => dispatch(node, true, 'start'));
|
||
|
task = loop(now => {
|
||
|
if (running) {
|
||
|
if (now >= end_time) {
|
||
|
tick(1, 0);
|
||
|
dispatch(node, true, 'end');
|
||
|
cleanup();
|
||
|
return running = false;
|
||
|
}
|
||
|
if (now >= start_time) {
|
||
|
const t = easing((now - start_time) / duration);
|
||
|
tick(t, 1 - t);
|
||
|
}
|
||
|
}
|
||
|
return running;
|
||
|
});
|
||
|
}
|
||
|
let started = false;
|
||
|
return {
|
||
|
start() {
|
||
|
if (started)
|
||
|
return;
|
||
|
delete_rule(node);
|
||
|
if (is_function(config)) {
|
||
|
config = config();
|
||
|
wait().then(go);
|
||
|
}
|
||
|
else {
|
||
|
go();
|
||
|
}
|
||
|
},
|
||
|
invalidate() {
|
||
|
started = false;
|
||
|
},
|
||
|
end() {
|
||
|
if (running) {
|
||
|
cleanup();
|
||
|
running = false;
|
||
|
}
|
||
|
}
|
||
|
};
|
||
|
}
|
||
|
function create_out_transition(node, fn, params) {
|
||
|
let config = fn(node, params);
|
||
|
let running = true;
|
||
|
let animation_name;
|
||
|
const group = outros;
|
||
|
group.r += 1;
|
||
|
function go() {
|
||
|
const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;
|
||
|
if (css)
|
||
|
animation_name = create_rule(node, 1, 0, duration, delay, easing, css);
|
||
|
const start_time = now() + delay;
|
||
|
const end_time = start_time + duration;
|
||
|
add_render_callback(() => dispatch(node, false, 'start'));
|
||
|
loop(now => {
|
||
|
if (running) {
|
||
|
if (now >= end_time) {
|
||
|
tick(0, 1);
|
||
|
dispatch(node, false, 'end');
|
||
|
if (!--group.r) {
|
||
|
// this will result in `end()` being called,
|
||
|
// so we don't need to clean up here
|
||
|
run_all(group.c);
|
||
|
}
|
||
|
return false;
|
||
|
}
|
||
|
if (now >= start_time) {
|
||
|
const t = easing((now - start_time) / duration);
|
||
|
tick(1 - t, t);
|
||
|
}
|
||
|
}
|
||
|
return running;
|
||
|
});
|
||
|
}
|
||
|
if (is_function(config)) {
|
||
|
wait().then(() => {
|
||
|
// @ts-ignore
|
||
|
config = config();
|
||
|
go();
|
||
|
});
|
||
|
}
|
||
|
else {
|
||
|
go();
|
||
|
}
|
||
|
return {
|
||
|
end(reset) {
|
||
|
if (reset && config.tick) {
|
||
|
config.tick(1, 0);
|
||
|
}
|
||
|
if (running) {
|
||
|
if (animation_name)
|
||
|
delete_rule(node, animation_name);
|
||
|
running = false;
|
||
|
}
|
||
|
}
|
||
|
};
|
||
|
}
|
||
|
|
||
|
const globals = (typeof window !== 'undefined'
|
||
|
? window
|
||
|
: typeof globalThis !== 'undefined'
|
||
|
? globalThis
|
||
|
: global);
|
||
|
|
||
|
function get_spread_update(levels, updates) {
|
||
|
const update = {};
|
||
|
const to_null_out = {};
|
||
|
const accounted_for = { $$scope: 1 };
|
||
|
let i = levels.length;
|
||
|
while (i--) {
|
||
|
const o = levels[i];
|
||
|
const n = updates[i];
|
||
|
if (n) {
|
||
|
for (const key in o) {
|
||
|
if (!(key in n))
|
||
|
to_null_out[key] = 1;
|
||
|
}
|
||
|
for (const key in n) {
|
||
|
if (!accounted_for[key]) {
|
||
|
update[key] = n[key];
|
||
|
accounted_for[key] = 1;
|
||
|
}
|
||
|
}
|
||
|
levels[i] = n;
|
||
|
}
|
||
|
else {
|
||
|
for (const key in o) {
|
||
|
accounted_for[key] = 1;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
for (const key in to_null_out) {
|
||
|
if (!(key in update))
|
||
|
update[key] = undefined;
|
||
|
}
|
||
|
return update;
|
||
|
}
|
||
|
function get_spread_object(spread_props) {
|
||
|
return typeof spread_props === 'object' && spread_props !== null ? spread_props : {};
|
||
|
}
|
||
|
function create_component(block) {
|
||
|
block && block.c();
|
||
|
}
|
||
|
function mount_component(component, target, anchor, customElement) {
|
||
|
const { fragment, on_mount, on_destroy, after_update } = component.$$;
|
||
|
fragment && fragment.m(target, anchor);
|
||
|
if (!customElement) {
|
||
|
// onMount happens before the initial afterUpdate
|
||
|
add_render_callback(() => {
|
||
|
const new_on_destroy = on_mount.map(run).filter(is_function);
|
||
|
if (on_destroy) {
|
||
|
on_destroy.push(...new_on_destroy);
|
||
|
}
|
||
|
else {
|
||
|
// Edge case - component was destroyed immediately,
|
||
|
// most likely as a result of a binding initialising
|
||
|
run_all(new_on_destroy);
|
||
|
}
|
||
|
component.$$.on_mount = [];
|
||
|
});
|
||
|
}
|
||
|
after_update.forEach(add_render_callback);
|
||
|
}
|
||
|
function destroy_component(component, detaching) {
|
||
|
const $$ = component.$$;
|
||
|
if ($$.fragment !== null) {
|
||
|
run_all($$.on_destroy);
|
||
|
$$.fragment && $$.fragment.d(detaching);
|
||
|
// TODO null out other refs, including component.$$ (but need to
|
||
|
// preserve final state?)
|
||
|
$$.on_destroy = $$.fragment = null;
|
||
|
$$.ctx = [];
|
||
|
}
|
||
|
}
|
||
|
function make_dirty(component, i) {
|
||
|
if (component.$$.dirty[0] === -1) {
|
||
|
dirty_components.push(component);
|
||
|
schedule_update();
|
||
|
component.$$.dirty.fill(0);
|
||
|
}
|
||
|
component.$$.dirty[(i / 31) | 0] |= (1 << (i % 31));
|
||
|
}
|
||
|
function init(component, options, instance, create_fragment, not_equal, props, dirty = [-1]) {
|
||
|
const parent_component = current_component;
|
||
|
set_current_component(component);
|
||
|
const $$ = component.$$ = {
|
||
|
fragment: null,
|
||
|
ctx: null,
|
||
|
// state
|
||
|
props,
|
||
|
update: noop,
|
||
|
not_equal,
|
||
|
bound: blank_object(),
|
||
|
// lifecycle
|
||
|
on_mount: [],
|
||
|
on_destroy: [],
|
||
|
on_disconnect: [],
|
||
|
before_update: [],
|
||
|
after_update: [],
|
||
|
context: new Map(parent_component ? parent_component.$$.context : options.context || []),
|
||
|
// everything else
|
||
|
callbacks: blank_object(),
|
||
|
dirty,
|
||
|
skip_bound: false
|
||
|
};
|
||
|
let ready = false;
|
||
|
$$.ctx = instance
|
||
|
? instance(component, options.props || {}, (i, ret, ...rest) => {
|
||
|
const value = rest.length ? rest[0] : ret;
|
||
|
if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) {
|
||
|
if (!$$.skip_bound && $$.bound[i])
|
||
|
$$.bound[i](value);
|
||
|
if (ready)
|
||
|
make_dirty(component, i);
|
||
|
}
|
||
|
return ret;
|
||
|
})
|
||
|
: [];
|
||
|
$$.update();
|
||
|
ready = true;
|
||
|
run_all($$.before_update);
|
||
|
// `false` as a special case of no DOM component
|
||
|
$$.fragment = create_fragment ? create_fragment($$.ctx) : false;
|
||
|
if (options.target) {
|
||
|
if (options.hydrate) {
|
||
|
const nodes = children(options.target);
|
||
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||
|
$$.fragment && $$.fragment.l(nodes);
|
||
|
nodes.forEach(detach);
|
||
|
}
|
||
|
else {
|
||
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||
|
$$.fragment && $$.fragment.c();
|
||
|
}
|
||
|
if (options.intro)
|
||
|
transition_in(component.$$.fragment);
|
||
|
mount_component(component, options.target, options.anchor, options.customElement);
|
||
|
flush();
|
||
|
}
|
||
|
set_current_component(parent_component);
|
||
|
}
|
||
|
/**
|
||
|
* Base class for Svelte components. Used when dev=false.
|
||
|
*/
|
||
|
class SvelteComponent {
|
||
|
$destroy() {
|
||
|
destroy_component(this, 1);
|
||
|
this.$destroy = noop;
|
||
|
}
|
||
|
$on(type, callback) {
|
||
|
const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = []));
|
||
|
callbacks.push(callback);
|
||
|
return () => {
|
||
|
const index = callbacks.indexOf(callback);
|
||
|
if (index !== -1)
|
||
|
callbacks.splice(index, 1);
|
||
|
};
|
||
|
}
|
||
|
$set($$props) {
|
||
|
if (this.$$set && !is_empty($$props)) {
|
||
|
this.$$.skip_bound = true;
|
||
|
this.$$set($$props);
|
||
|
this.$$.skip_bound = false;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function dispatch_dev(type, detail) {
|
||
|
document.dispatchEvent(custom_event(type, Object.assign({ version: '3.37.0' }, detail)));
|
||
|
}
|
||
|
function append_dev(target, node) {
|
||
|
dispatch_dev('SvelteDOMInsert', { target, node });
|
||
|
append(target, node);
|
||
|
}
|
||
|
function insert_dev(target, node, anchor) {
|
||
|
dispatch_dev('SvelteDOMInsert', { target, node, anchor });
|
||
|
insert(target, node, anchor);
|
||
|
}
|
||
|
function detach_dev(node) {
|
||
|
dispatch_dev('SvelteDOMRemove', { node });
|
||
|
detach(node);
|
||
|
}
|
||
|
function attr_dev(node, attribute, value) {
|
||
|
attr(node, attribute, value);
|
||
|
if (value == null)
|
||
|
dispatch_dev('SvelteDOMRemoveAttribute', { node, attribute });
|
||
|
else
|
||
|
dispatch_dev('SvelteDOMSetAttribute', { node, attribute, value });
|
||
|
}
|
||
|
function validate_slots(name, slot, keys) {
|
||
|
for (const slot_key of Object.keys(slot)) {
|
||
|
if (!~keys.indexOf(slot_key)) {
|
||
|
console.warn(`<${name}> received an unexpected slot "${slot_key}".`);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
/**
|
||
|
* Base class for Svelte components with some minor dev-enhancements. Used when dev=true.
|
||
|
*/
|
||
|
class SvelteComponentDev extends SvelteComponent {
|
||
|
constructor(options) {
|
||
|
if (!options || (!options.target && !options.$$inline)) {
|
||
|
throw new Error("'target' is a required option");
|
||
|
}
|
||
|
super();
|
||
|
}
|
||
|
$destroy() {
|
||
|
super.$destroy();
|
||
|
this.$destroy = () => {
|
||
|
console.warn('Component was already destroyed'); // eslint-disable-line no-console
|
||
|
};
|
||
|
}
|
||
|
$capture_state() { }
|
||
|
$inject_state() { }
|
||
|
}
|
||
|
|
||
|
/* src/components/Navbar.svelte generated by Svelte v3.37.0 */
|
||
|
|
||
|
const file$5 = "src/components/Navbar.svelte";
|
||
|
|
||
|
function create_fragment$6(ctx) {
|
||
|
let div4;
|
||
|
let div0;
|
||
|
let span1;
|
||
|
let img;
|
||
|
let img_src_value;
|
||
|
let t0;
|
||
|
let span0;
|
||
|
let t2;
|
||
|
let t3;
|
||
|
let div2;
|
||
|
let div1;
|
||
|
let a0;
|
||
|
let svg0;
|
||
|
let path0;
|
||
|
let t4;
|
||
|
let t5;
|
||
|
let a1;
|
||
|
let svg1;
|
||
|
let path1;
|
||
|
let t6;
|
||
|
let t7;
|
||
|
let a2;
|
||
|
let svg2;
|
||
|
let path2;
|
||
|
let t8;
|
||
|
let t9;
|
||
|
let div3;
|
||
|
let button;
|
||
|
let svg3;
|
||
|
let path3;
|
||
|
|
||
|
const block = {
|
||
|
c: function create() {
|
||
|
div4 = element("div");
|
||
|
div0 = element("div");
|
||
|
span1 = element("span");
|
||
|
img = element("img");
|
||
|
t0 = space();
|
||
|
span0 = element("span");
|
||
|
span0.textContent = "Tangan";
|
||
|
t2 = text("Menolong");
|
||
|
t3 = space();
|
||
|
div2 = element("div");
|
||
|
div1 = element("div");
|
||
|
a0 = element("a");
|
||
|
svg0 = svg_element("svg");
|
||
|
path0 = svg_element("path");
|
||
|
t4 = text("\n\t\t\t\tHome");
|
||
|
t5 = space();
|
||
|
a1 = element("a");
|
||
|
svg1 = svg_element("svg");
|
||
|
path1 = svg_element("path");
|
||
|
t6 = text("\n\t\t\t\tBusinesses");
|
||
|
t7 = space();
|
||
|
a2 = element("a");
|
||
|
svg2 = svg_element("svg");
|
||
|
path2 = svg_element("path");
|
||
|
t8 = text("\n\t\t\t\tRegister");
|
||
|
t9 = space();
|
||
|
div3 = element("div");
|
||
|
button = element("button");
|
||
|
svg3 = svg_element("svg");
|
||
|
path3 = svg_element("path");
|
||
|
if (img.src !== (img_src_value = "/logo.png")) attr_dev(img, "src", img_src_value);
|
||
|
attr_dev(img, "alt", "");
|
||
|
attr_dev(img, "class", "w-14 h-14 mr-4");
|
||
|
add_location(img, file$5, 3, 3, 179);
|
||
|
attr_dev(span0, "class", "text-primary");
|
||
|
add_location(span0, file$5, 4, 3, 235);
|
||
|
attr_dev(span1, "class", "text-lg font-bold inline-flex items-center");
|
||
|
add_location(span1, file$5, 2, 2, 118);
|
||
|
attr_dev(div0, "class", "flex-1 px-2 mx-2");
|
||
|
add_location(div0, file$5, 1, 1, 85);
|
||
|
attr_dev(path0, "stroke-linecap", "round");
|
||
|
attr_dev(path0, "stroke-linejoin", "round");
|
||
|
attr_dev(path0, "stroke-width", "2");
|
||
|
attr_dev(path0, "d", "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6");
|
||
|
add_location(path0, file$5, 11, 5, 573);
|
||
|
attr_dev(svg0, "xmlns", "http://www.w3.org/2000/svg");
|
||
|
attr_dev(svg0, "fill", "none");
|
||
|
attr_dev(svg0, "viewBox", "0 0 24 24");
|
||
|
attr_dev(svg0, "class", "inline-block w-5 mr-2 stroke-current");
|
||
|
add_location(svg0, file$5, 10, 4, 450);
|
||
|
attr_dev(a0, "class", "btn btn-ghost btn-sm rounded-btn");
|
||
|
attr_dev(a0, "href", "/#/");
|
||
|
add_location(a0, file$5, 9, 3, 390);
|
||
|
attr_dev(path1, "stroke-linecap", "round");
|
||
|
attr_dev(path1, "stroke-linejoin", "round");
|
||
|
attr_dev(path1, "stroke-width", "2");
|
||
|
attr_dev(path1, "d", "M21 13.255A23.931 23.931 0 0112 15c-3.183 0-6.22-.62-9-1.745M16 6V4a2 2 0 00-2-2h-4a2 2 0 00-2 2v2m4 6h.01M5 20h14a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z");
|
||
|
add_location(path1, file$5, 17, 5, 1019);
|
||
|
attr_dev(svg1, "xmlns", "http://www.w3.org/2000/svg");
|
||
|
attr_dev(svg1, "fill", "none");
|
||
|
attr_dev(svg1, "viewBox", "0 0 24 24");
|
||
|
attr_dev(svg1, "class", "inline-block w-5 mr-2 stroke-current");
|
||
|
add_location(svg1, file$5, 16, 4, 896);
|
||
|
attr_dev(a1, "class", "btn btn-ghost btn-sm rounded-btn");
|
||
|
attr_dev(a1, "href", "/#/businesses");
|
||
|
add_location(a1, file$5, 15, 3, 826);
|
||
|
attr_dev(path2, "stroke-linecap", "round");
|
||
|
attr_dev(path2, "stroke-linejoin", "round");
|
||
|
attr_dev(path2, "stroke-width", "2");
|
||
|
attr_dev(path2, "d", "M12 9v3m0 0v3m0-3h3m-3 0H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z");
|
||
|
add_location(path2, file$5, 23, 5, 1497);
|
||
|
attr_dev(svg2, "xmlns", "http://www.w3.org/2000/svg");
|
||
|
attr_dev(svg2, "fill", "none");
|
||
|
attr_dev(svg2, "viewBox", "0 0 24 24");
|
||
|
attr_dev(svg2, "class", "inline-block w-5 mr-2 stroke-current");
|
||
|
add_location(svg2, file$5, 22, 4, 1374);
|
||
|
attr_dev(a2, "class", "btn btn-ghost btn-sm rounded-btn");
|
||
|
attr_dev(a2, "href", "/#/register");
|
||
|
add_location(a2, file$5, 21, 3, 1306);
|
||
|
attr_dev(div1, "class", "flex items-stretch");
|
||
|
add_location(div1, file$5, 8, 2, 354);
|
||
|
attr_dev(div2, "class", "flex-none hidden px-2 mx-2 lg:flex");
|
||
|
add_location(div2, file$5, 7, 1, 303);
|
||
|
attr_dev(path3, "stroke-linecap", "round");
|
||
|
attr_dev(path3, "stroke-linejoin", "round");
|
||
|
attr_dev(path3, "stroke-width", "2");
|
||
|
attr_dev(path3, "d", "M4 6h16M4 12h16M4 18h16");
|
||
|
add_location(path3, file$5, 32, 4, 1886);
|
||
|
attr_dev(svg3, "xmlns", "http://www.w3.org/2000/svg");
|
||
|
attr_dev(svg3, "fill", "none");
|
||
|
attr_dev(svg3, "viewBox", "0 0 24 24");
|
||
|
attr_dev(svg3, "class", "inline-block w-6 h-6 stroke-current");
|
||
|
add_location(svg3, file$5, 31, 3, 1765);
|
||
|
attr_dev(button, "class", "btn btn-square btn-ghost");
|
||
|
add_location(button, file$5, 30, 2, 1720);
|
||
|
attr_dev(div3, "class", "flex-none lg:hidden");
|
||
|
add_location(div3, file$5, 29, 1, 1684);
|
||
|
attr_dev(div4, "class", "navbar lg:rounded-box bg-neutral-focus text-neutral-content shadow-xl");
|
||
|
add_location(div4, file$5, 0, 0, 0);
|
||
|
},
|
||
|
l: function claim(nodes) {
|
||
|
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
|
||
|
},
|
||
|
m: function mount(target, anchor) {
|
||
|
insert_dev(target, div4, anchor);
|
||
|
append_dev(div4, div0);
|
||
|
append_dev(div0, span1);
|
||
|
append_dev(span1, img);
|
||
|
append_dev(span1, t0);
|
||
|
append_dev(span1, span0);
|
||
|
append_dev(span1, t2);
|
||
|
append_dev(div4, t3);
|
||
|
append_dev(div4, div2);
|
||
|
append_dev(div2, div1);
|
||
|
append_dev(div1, a0);
|
||
|
append_dev(a0, svg0);
|
||
|
append_dev(svg0, path0);
|
||
|
append_dev(a0, t4);
|
||
|
append_dev(div1, t5);
|
||
|
append_dev(div1, a1);
|
||
|
append_dev(a1, svg1);
|
||
|
append_dev(svg1, path1);
|
||
|
append_dev(a1, t6);
|
||
|
append_dev(div1, t7);
|
||
|
append_dev(div1, a2);
|
||
|
append_dev(a2, svg2);
|
||
|
append_dev(svg2, path2);
|
||
|
append_dev(a2, t8);
|
||
|
append_dev(div4, t9);
|
||
|
append_dev(div4, div3);
|
||
|
append_dev(div3, button);
|
||
|
append_dev(button, svg3);
|
||
|
append_dev(svg3, path3);
|
||
|
},
|
||
|
p: noop,
|
||
|
i: noop,
|
||
|
o: noop,
|
||
|
d: function destroy(detaching) {
|
||
|
if (detaching) detach_dev(div4);
|
||
|
}
|
||
|
};
|
||
|
|
||
|
dispatch_dev("SvelteRegisterBlock", {
|
||
|
block,
|
||
|
id: create_fragment$6.name,
|
||
|
type: "component",
|
||
|
source: "",
|
||
|
ctx
|
||
|
});
|
||
|
|
||
|
return block;
|
||
|
}
|
||
|
|
||
|
function instance$6($$self, $$props) {
|
||
|
let { $$slots: slots = {}, $$scope } = $$props;
|
||
|
validate_slots("Navbar", slots, []);
|
||
|
const writable_props = [];
|
||
|
|
||
|
Object.keys($$props).forEach(key => {
|
||
|
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(`<Navbar> was created with unknown prop '${key}'`);
|
||
|
});
|
||
|
|
||
|
return [];
|
||
|
}
|
||
|
|
||
|
class Navbar extends SvelteComponentDev {
|
||
|
constructor(options) {
|
||
|
super(options);
|
||
|
init(this, options, instance$6, create_fragment$6, safe_not_equal, {});
|
||
|
|
||
|
dispatch_dev("SvelteRegisterComponent", {
|
||
|
component: this,
|
||
|
tagName: "Navbar",
|
||
|
options,
|
||
|
id: create_fragment$6.name
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* src/components/Footer.svelte generated by Svelte v3.37.0 */
|
||
|
|
||
|
const file$4 = "src/components/Footer.svelte";
|
||
|
|
||
|
function create_fragment$5(ctx) {
|
||
|
let div4;
|
||
|
let div3;
|
||
|
let div0;
|
||
|
let img;
|
||
|
let img_src_value;
|
||
|
let t0;
|
||
|
let div1;
|
||
|
let a0;
|
||
|
let t2;
|
||
|
let a1;
|
||
|
let t4;
|
||
|
let a2;
|
||
|
let t6;
|
||
|
let a3;
|
||
|
let t8;
|
||
|
let div2;
|
||
|
let span;
|
||
|
let t10;
|
||
|
let a4;
|
||
|
|
||
|
const block = {
|
||
|
c: function create() {
|
||
|
div4 = element("div");
|
||
|
div3 = element("div");
|
||
|
div0 = element("div");
|
||
|
img = element("img");
|
||
|
t0 = space();
|
||
|
div1 = element("div");
|
||
|
a0 = element("a");
|
||
|
a0.textContent = "Link 1";
|
||
|
t2 = space();
|
||
|
a1 = element("a");
|
||
|
a1.textContent = "Link 2";
|
||
|
t4 = space();
|
||
|
a2 = element("a");
|
||
|
a2.textContent = "Link 3";
|
||
|
t6 = space();
|
||
|
a3 = element("a");
|
||
|
a3.textContent = "Link 4";
|
||
|
t8 = space();
|
||
|
div2 = element("div");
|
||
|
span = element("span");
|
||
|
span.textContent = "Created by";
|
||
|
t10 = space();
|
||
|
a4 = element("a");
|
||
|
a4.textContent = "Hamza ALI";
|
||
|
if (img.src !== (img_src_value = "/logo.png")) attr_dev(img, "src", img_src_value);
|
||
|
attr_dev(img, "alt", "");
|
||
|
attr_dev(img, "class", "w-14 h-14 mr-4");
|
||
|
add_location(img, file$4, 3, 3, 308);
|
||
|
attr_dev(div0, "class", "text-xl mb-2 lg:mb-0 font-title text-neutral-content lg:absolute lg:left-4 font-bold");
|
||
|
add_location(div0, file$4, 2, 2, 206);
|
||
|
attr_dev(a0, "class", "my-1 btn btn-ghost btn-xs");
|
||
|
attr_dev(a0, "target", "_blank");
|
||
|
attr_dev(a0, "rel", "noopener");
|
||
|
attr_dev(a0, "href", "#");
|
||
|
add_location(a0, file$4, 7, 3, 402);
|
||
|
attr_dev(a1, "class", "my-1 btn btn-ghost btn-xs");
|
||
|
attr_dev(a1, "target", "_blank");
|
||
|
attr_dev(a1, "rel", "noopener");
|
||
|
attr_dev(a1, "href", "#");
|
||
|
add_location(a1, file$4, 8, 3, 493);
|
||
|
attr_dev(a2, "class", "my-1 btn btn-ghost btn-xs");
|
||
|
attr_dev(a2, "target", "_blank");
|
||
|
attr_dev(a2, "rel", "noopener");
|
||
|
attr_dev(a2, "href", "#");
|
||
|
add_location(a2, file$4, 9, 3, 584);
|
||
|
attr_dev(a3, "class", "my-1 btn btn-ghost btn-xs");
|
||
|
attr_dev(a3, "target", "_blank");
|
||
|
attr_dev(a3, "rel", "noopener");
|
||
|
attr_dev(a3, "href", "#");
|
||
|
add_location(a3, file$4, 10, 3, 675);
|
||
|
attr_dev(div1, "class", "text-center");
|
||
|
add_location(div1, file$4, 6, 2, 373);
|
||
|
attr_dev(span, "class", "text-primary");
|
||
|
add_location(span, file$4, 14, 3, 865);
|
||
|
attr_dev(a4, "class", "my-1 btn btn-ghost btn-xs");
|
||
|
attr_dev(a4, "target", "_blank");
|
||
|
attr_dev(a4, "rel", "noopener");
|
||
|
attr_dev(a4, "href", "#");
|
||
|
add_location(a4, file$4, 15, 3, 913);
|
||
|
attr_dev(div2, "class", "text-sm font-title text-neutral-content lg:absolute lg:right-4 font-bold");
|
||
|
add_location(div2, file$4, 13, 2, 775);
|
||
|
attr_dev(div3, "class", "w-full max-w-6xl text-center hero-content flex flex-col lg:flex-row justify-cener items-center");
|
||
|
add_location(div3, file$4, 1, 1, 95);
|
||
|
attr_dev(div4, "class", "hero lg:rounded-box bg-neutral-focus text-neutral-content shadow-xl lg:relative");
|
||
|
add_location(div4, file$4, 0, 0, 0);
|
||
|
},
|
||
|
l: function claim(nodes) {
|
||
|
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
|
||
|
},
|
||
|
m: function mount(target, anchor) {
|
||
|
insert_dev(target, div4, anchor);
|
||
|
append_dev(div4, div3);
|
||
|
append_dev(div3, div0);
|
||
|
append_dev(div0, img);
|
||
|
append_dev(div3, t0);
|
||
|
append_dev(div3, div1);
|
||
|
append_dev(div1, a0);
|
||
|
append_dev(div1, t2);
|
||
|
append_dev(div1, a1);
|
||
|
append_dev(div1, t4);
|
||
|
append_dev(div1, a2);
|
||
|
append_dev(div1, t6);
|
||
|
append_dev(div1, a3);
|
||
|
append_dev(div3, t8);
|
||
|
append_dev(div3, div2);
|
||
|
append_dev(div2, span);
|
||
|
append_dev(div2, t10);
|
||
|
append_dev(div2, a4);
|
||
|
},
|
||
|
p: noop,
|
||
|
i: noop,
|
||
|
o: noop,
|
||
|
d: function destroy(detaching) {
|
||
|
if (detaching) detach_dev(div4);
|
||
|
}
|
||
|
};
|
||
|
|
||
|
dispatch_dev("SvelteRegisterBlock", {
|
||
|
block,
|
||
|
id: create_fragment$5.name,
|
||
|
type: "component",
|
||
|
source: "",
|
||
|
ctx
|
||
|
});
|
||
|
|
||
|
return block;
|
||
|
}
|
||
|
|
||
|
function instance$5($$self, $$props) {
|
||
|
let { $$slots: slots = {}, $$scope } = $$props;
|
||
|
validate_slots("Footer", slots, []);
|
||
|
const writable_props = [];
|
||
|
|
||
|
Object.keys($$props).forEach(key => {
|
||
|
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(`<Footer> was created with unknown prop '${key}'`);
|
||
|
});
|
||
|
|
||
|
return [];
|
||
|
}
|
||
|
|
||
|
class Footer extends SvelteComponentDev {
|
||
|
constructor(options) {
|
||
|
super(options);
|
||
|
init(this, options, instance$5, create_fragment$5, safe_not_equal, {});
|
||
|
|
||
|
dispatch_dev("SvelteRegisterComponent", {
|
||
|
component: this,
|
||
|
tagName: "Footer",
|
||
|
options,
|
||
|
id: create_fragment$5.name
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @typedef {Object} WrappedComponent Object returned by the `wrap` method
|
||
|
* @property {SvelteComponent} component - Component to load (this is always asynchronous)
|
||
|
* @property {RoutePrecondition[]} [conditions] - Route pre-conditions to validate
|
||
|
* @property {Object} [props] - Optional dictionary of static props
|
||
|
* @property {Object} [userData] - Optional user data dictionary
|
||
|
* @property {bool} _sveltesparouter - Internal flag; always set to true
|
||
|
*/
|
||
|
|
||
|
/**
|
||
|
* @callback AsyncSvelteComponent
|
||
|
* @returns {Promise<SvelteComponent>} Returns a Promise that resolves with a Svelte component
|
||
|
*/
|
||
|
|
||
|
/**
|
||
|
* @callback RoutePrecondition
|
||
|
* @param {RouteDetail} detail - Route detail object
|
||
|
* @returns {boolean|Promise<boolean>} If the callback returns a false-y value, it's interpreted as the precondition failed, so it aborts loading the component (and won't process other pre-condition callbacks)
|
||
|
*/
|
||
|
|
||
|
/**
|
||
|
* @typedef {Object} WrapOptions Options object for the call to `wrap`
|
||
|
* @property {SvelteComponent} [component] - Svelte component to load (this is incompatible with `asyncComponent`)
|
||
|
* @property {AsyncSvelteComponent} [asyncComponent] - Function that returns a Promise that fulfills with a Svelte component (e.g. `{asyncComponent: () => import('Foo.svelte')}`)
|
||
|
* @property {SvelteComponent} [loadingComponent] - Svelte component to be displayed while the async route is loading (as a placeholder); when unset or false-y, no component is shown while component
|
||
|
* @property {object} [loadingParams] - Optional dictionary passed to the `loadingComponent` component as params (for an exported prop called `params`)
|
||
|
* @property {object} [userData] - Optional object that will be passed to events such as `routeLoading`, `routeLoaded`, `conditionsFailed`
|
||
|
* @property {object} [props] - Optional key-value dictionary of static props that will be passed to the component. The props are expanded with {...props}, so the key in the dictionary becomes the name of the prop.
|
||
|
* @property {RoutePrecondition[]|RoutePrecondition} [conditions] - Route pre-conditions to add, which will be executed in order
|
||
|
*/
|
||
|
|
||
|
/**
|
||
|
* Wraps a component to enable multiple capabilities:
|
||
|
* 1. Using dynamically-imported component, with (e.g. `{asyncComponent: () => import('Foo.svelte')}`), which also allows bundlers to do code-splitting.
|
||
|
* 2. Adding route pre-conditions (e.g. `{conditions: [...]}`)
|
||
|
* 3. Adding static props that are passed to the component
|
||
|
* 4. Adding custom userData, which is passed to route events (e.g. route loaded events) or to route pre-conditions (e.g. `{userData: {foo: 'bar}}`)
|
||
|
*
|
||
|
* @param {WrapOptions} args - Arguments object
|
||
|
* @returns {WrappedComponent} Wrapped component
|
||
|
*/
|
||
|
function wrap$1(args) {
|
||
|
if (!args) {
|
||
|
throw Error('Parameter args is required')
|
||
|
}
|
||
|
|
||
|
// We need to have one and only one of component and asyncComponent
|
||
|
// This does a "XNOR"
|
||
|
if (!args.component == !args.asyncComponent) {
|
||
|
throw Error('One and only one of component and asyncComponent is required')
|
||
|
}
|
||
|
|
||
|
// If the component is not async, wrap it into a function returning a Promise
|
||
|
if (args.component) {
|
||
|
args.asyncComponent = () => Promise.resolve(args.component);
|
||
|
}
|
||
|
|
||
|
// Parameter asyncComponent and each item of conditions must be functions
|
||
|
if (typeof args.asyncComponent != 'function') {
|
||
|
throw Error('Parameter asyncComponent must be a function')
|
||
|
}
|
||
|
if (args.conditions) {
|
||
|
// Ensure it's an array
|
||
|
if (!Array.isArray(args.conditions)) {
|
||
|
args.conditions = [args.conditions];
|
||
|
}
|
||
|
for (let i = 0; i < args.conditions.length; i++) {
|
||
|
if (!args.conditions[i] || typeof args.conditions[i] != 'function') {
|
||
|
throw Error('Invalid parameter conditions[' + i + ']')
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// Check if we have a placeholder component
|
||
|
if (args.loadingComponent) {
|
||
|
args.asyncComponent.loading = args.loadingComponent;
|
||
|
args.asyncComponent.loadingParams = args.loadingParams || undefined;
|
||
|
}
|
||
|
|
||
|
// Returns an object that contains all the functions to execute too
|
||
|
// The _sveltesparouter flag is to confirm the object was created by this router
|
||
|
const obj = {
|
||
|
component: args.asyncComponent,
|
||
|
userData: args.userData,
|
||
|
conditions: (args.conditions && args.conditions.length) ? args.conditions : undefined,
|
||
|
props: (args.props && Object.keys(args.props).length) ? args.props : {},
|
||
|
_sveltesparouter: true
|
||
|
};
|
||
|
|
||
|
return obj
|
||
|
}
|
||
|
|
||
|
const subscriber_queue = [];
|
||
|
/**
|
||
|
* Creates a `Readable` store that allows reading by subscription.
|
||
|
* @param value initial value
|
||
|
* @param {StartStopNotifier}start start and stop notifications for subscriptions
|
||
|
*/
|
||
|
function readable(value, start) {
|
||
|
return {
|
||
|
subscribe: writable(value, start).subscribe
|
||
|
};
|
||
|
}
|
||
|
/**
|
||
|
* Create a `Writable` store that allows both updating and reading by subscription.
|
||
|
* @param {*=}value initial value
|
||
|
* @param {StartStopNotifier=}start start and stop notifications for subscriptions
|
||
|
*/
|
||
|
function writable(value, start = noop) {
|
||
|
let stop;
|
||
|
const subscribers = [];
|
||
|
function set(new_value) {
|
||
|
if (safe_not_equal(value, new_value)) {
|
||
|
value = new_value;
|
||
|
if (stop) { // store is ready
|
||
|
const run_queue = !subscriber_queue.length;
|
||
|
for (let i = 0; i < subscribers.length; i += 1) {
|
||
|
const s = subscribers[i];
|
||
|
s[1]();
|
||
|
subscriber_queue.push(s, value);
|
||
|
}
|
||
|
if (run_queue) {
|
||
|
for (let i = 0; i < subscriber_queue.length; i += 2) {
|
||
|
subscriber_queue[i][0](subscriber_queue[i + 1]);
|
||
|
}
|
||
|
subscriber_queue.length = 0;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
function update(fn) {
|
||
|
set(fn(value));
|
||
|
}
|
||
|
function subscribe(run, invalidate = noop) {
|
||
|
const subscriber = [run, invalidate];
|
||
|
subscribers.push(subscriber);
|
||
|
if (subscribers.length === 1) {
|
||
|
stop = start(set) || noop;
|
||
|
}
|
||
|
run(value);
|
||
|
return () => {
|
||
|
const index = subscribers.indexOf(subscriber);
|
||
|
if (index !== -1) {
|
||
|
subscribers.splice(index, 1);
|
||
|
}
|
||
|
if (subscribers.length === 0) {
|
||
|
stop();
|
||
|
stop = null;
|
||
|
}
|
||
|
};
|
||
|
}
|
||
|
return { set, update, subscribe };
|
||
|
}
|
||
|
function derived(stores, fn, initial_value) {
|
||
|
const single = !Array.isArray(stores);
|
||
|
const stores_array = single
|
||
|
? [stores]
|
||
|
: stores;
|
||
|
const auto = fn.length < 2;
|
||
|
return readable(initial_value, (set) => {
|
||
|
let inited = false;
|
||
|
const values = [];
|
||
|
let pending = 0;
|
||
|
let cleanup = noop;
|
||
|
const sync = () => {
|
||
|
if (pending) {
|
||
|
return;
|
||
|
}
|
||
|
cleanup();
|
||
|
const result = fn(single ? values[0] : values, set);
|
||
|
if (auto) {
|
||
|
set(result);
|
||
|
}
|
||
|
else {
|
||
|
cleanup = is_function(result) ? result : noop;
|
||
|
}
|
||
|
};
|
||
|
const unsubscribers = stores_array.map((store, i) => subscribe(store, (value) => {
|
||
|
values[i] = value;
|
||
|
pending &= ~(1 << i);
|
||
|
if (inited) {
|
||
|
sync();
|
||
|
}
|
||
|
}, () => {
|
||
|
pending |= (1 << i);
|
||
|
}));
|
||
|
inited = true;
|
||
|
sync();
|
||
|
return function stop() {
|
||
|
run_all(unsubscribers);
|
||
|
cleanup();
|
||
|
};
|
||
|
});
|
||
|
}
|
||
|
|
||
|
function parse(str, loose) {
|
||
|
if (str instanceof RegExp) return { keys:false, pattern:str };
|
||
|
var c, o, tmp, ext, keys=[], pattern='', arr = str.split('/');
|
||
|
arr[0] || arr.shift();
|
||
|
|
||
|
while (tmp = arr.shift()) {
|
||
|
c = tmp[0];
|
||
|
if (c === '*') {
|
||
|
keys.push('wild');
|
||
|
pattern += '/(.*)';
|
||
|
} else if (c === ':') {
|
||
|
o = tmp.indexOf('?', 1);
|
||
|
ext = tmp.indexOf('.', 1);
|
||
|
keys.push( tmp.substring(1, !!~o ? o : !!~ext ? ext : tmp.length) );
|
||
|
pattern += !!~o && !~ext ? '(?:/([^/]+?))?' : '/([^/]+?)';
|
||
|
if (!!~ext) pattern += (!!~o ? '?' : '') + '\\' + tmp.substring(ext);
|
||
|
} else {
|
||
|
pattern += '/' + tmp;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return {
|
||
|
keys: keys,
|
||
|
pattern: new RegExp('^' + pattern + (loose ? '(?=$|\/)' : '\/?$'), 'i')
|
||
|
};
|
||
|
}
|
||
|
|
||
|
/* node_modules/svelte-spa-router/Router.svelte generated by Svelte v3.37.0 */
|
||
|
|
||
|
const { Error: Error_1, Object: Object_1, console: console_1 } = globals;
|
||
|
|
||
|
// (251:0) {:else}
|
||
|
function create_else_block(ctx) {
|
||
|
let switch_instance;
|
||
|
let switch_instance_anchor;
|
||
|
let current;
|
||
|
const switch_instance_spread_levels = [/*props*/ ctx[2]];
|
||
|
var switch_value = /*component*/ ctx[0];
|
||
|
|
||
|
function switch_props(ctx) {
|
||
|
let switch_instance_props = {};
|
||
|
|
||
|
for (let i = 0; i < switch_instance_spread_levels.length; i += 1) {
|
||
|
switch_instance_props = assign(switch_instance_props, switch_instance_spread_levels[i]);
|
||
|
}
|
||
|
|
||
|
return {
|
||
|
props: switch_instance_props,
|
||
|
$$inline: true
|
||
|
};
|
||
|
}
|
||
|
|
||
|
if (switch_value) {
|
||
|
switch_instance = new switch_value(switch_props());
|
||
|
switch_instance.$on("routeEvent", /*routeEvent_handler_1*/ ctx[7]);
|
||
|
}
|
||
|
|
||
|
const block = {
|
||
|
c: function create() {
|
||
|
if (switch_instance) create_component(switch_instance.$$.fragment);
|
||
|
switch_instance_anchor = empty();
|
||
|
},
|
||
|
m: function mount(target, anchor) {
|
||
|
if (switch_instance) {
|
||
|
mount_component(switch_instance, target, anchor);
|
||
|
}
|
||
|
|
||
|
insert_dev(target, switch_instance_anchor, anchor);
|
||
|
current = true;
|
||
|
},
|
||
|
p: function update(ctx, dirty) {
|
||
|
const switch_instance_changes = (dirty & /*props*/ 4)
|
||
|
? get_spread_update(switch_instance_spread_levels, [get_spread_object(/*props*/ ctx[2])])
|
||
|
: {};
|
||
|
|
||
|
if (switch_value !== (switch_value = /*component*/ ctx[0])) {
|
||
|
if (switch_instance) {
|
||
|
group_outros();
|
||
|
const old_component = switch_instance;
|
||
|
|
||
|
transition_out(old_component.$$.fragment, 1, 0, () => {
|
||
|
destroy_component(old_component, 1);
|
||
|
});
|
||
|
|
||
|
check_outros();
|
||
|
}
|
||
|
|
||
|
if (switch_value) {
|
||
|
switch_instance = new switch_value(switch_props());
|
||
|
switch_instance.$on("routeEvent", /*routeEvent_handler_1*/ ctx[7]);
|
||
|
create_component(switch_instance.$$.fragment);
|
||
|
transition_in(switch_instance.$$.fragment, 1);
|
||
|
mount_component(switch_instance, switch_instance_anchor.parentNode, switch_instance_anchor);
|
||
|
} else {
|
||
|
switch_instance = null;
|
||
|
}
|
||
|
} else if (switch_value) {
|
||
|
switch_instance.$set(switch_instance_changes);
|
||
|
}
|
||
|
},
|
||
|
i: function intro(local) {
|
||
|
if (current) return;
|
||
|
if (switch_instance) transition_in(switch_instance.$$.fragment, local);
|
||
|
current = true;
|
||
|
},
|
||
|
o: function outro(local) {
|
||
|
if (switch_instance) transition_out(switch_instance.$$.fragment, local);
|
||
|
current = false;
|
||
|
},
|
||
|
d: function destroy(detaching) {
|
||
|
if (detaching) detach_dev(switch_instance_anchor);
|
||
|
if (switch_instance) destroy_component(switch_instance, detaching);
|
||
|
}
|
||
|
};
|
||
|
|
||
|
dispatch_dev("SvelteRegisterBlock", {
|
||
|
block,
|
||
|
id: create_else_block.name,
|
||
|
type: "else",
|
||
|
source: "(251:0) {:else}",
|
||
|
ctx
|
||
|
});
|
||
|
|
||
|
return block;
|
||
|
}
|
||
|
|
||
|
// (244:0) {#if componentParams}
|
||
|
function create_if_block(ctx) {
|
||
|
let switch_instance;
|
||
|
let switch_instance_anchor;
|
||
|
let current;
|
||
|
const switch_instance_spread_levels = [{ params: /*componentParams*/ ctx[1] }, /*props*/ ctx[2]];
|
||
|
var switch_value = /*component*/ ctx[0];
|
||
|
|
||
|
function switch_props(ctx) {
|
||
|
let switch_instance_props = {};
|
||
|
|
||
|
for (let i = 0; i < switch_instance_spread_levels.length; i += 1) {
|
||
|
switch_instance_props = assign(switch_instance_props, switch_instance_spread_levels[i]);
|
||
|
}
|
||
|
|
||
|
return {
|
||
|
props: switch_instance_props,
|
||
|
$$inline: true
|
||
|
};
|
||
|
}
|
||
|
|
||
|
if (switch_value) {
|
||
|
switch_instance = new switch_value(switch_props());
|
||
|
switch_instance.$on("routeEvent", /*routeEvent_handler*/ ctx[6]);
|
||
|
}
|
||
|
|
||
|
const block = {
|
||
|
c: function create() {
|
||
|
if (switch_instance) create_component(switch_instance.$$.fragment);
|
||
|
switch_instance_anchor = empty();
|
||
|
},
|
||
|
m: function mount(target, anchor) {
|
||
|
if (switch_instance) {
|
||
|
mount_component(switch_instance, target, anchor);
|
||
|
}
|
||
|
|
||
|
insert_dev(target, switch_instance_anchor, anchor);
|
||
|
current = true;
|
||
|
},
|
||
|
p: function update(ctx, dirty) {
|
||
|
const switch_instance_changes = (dirty & /*componentParams, props*/ 6)
|
||
|
? get_spread_update(switch_instance_spread_levels, [
|
||
|
dirty & /*componentParams*/ 2 && { params: /*componentParams*/ ctx[1] },
|
||
|
dirty & /*props*/ 4 && get_spread_object(/*props*/ ctx[2])
|
||
|
])
|
||
|
: {};
|
||
|
|
||
|
if (switch_value !== (switch_value = /*component*/ ctx[0])) {
|
||
|
if (switch_instance) {
|
||
|
group_outros();
|
||
|
const old_component = switch_instance;
|
||
|
|
||
|
transition_out(old_component.$$.fragment, 1, 0, () => {
|
||
|
destroy_component(old_component, 1);
|
||
|
});
|
||
|
|
||
|
check_outros();
|
||
|
}
|
||
|
|
||
|
if (switch_value) {
|
||
|
switch_instance = new switch_value(switch_props());
|
||
|
switch_instance.$on("routeEvent", /*routeEvent_handler*/ ctx[6]);
|
||
|
create_component(switch_instance.$$.fragment);
|
||
|
transition_in(switch_instance.$$.fragment, 1);
|
||
|
mount_component(switch_instance, switch_instance_anchor.parentNode, switch_instance_anchor);
|
||
|
} else {
|
||
|
switch_instance = null;
|
||
|
}
|
||
|
} else if (switch_value) {
|
||
|
switch_instance.$set(switch_instance_changes);
|
||
|
}
|
||
|
},
|
||
|
i: function intro(local) {
|
||
|
if (current) return;
|
||
|
if (switch_instance) transition_in(switch_instance.$$.fragment, local);
|
||
|
current = true;
|
||
|
},
|
||
|
o: function outro(local) {
|
||
|
if (switch_instance) transition_out(switch_instance.$$.fragment, local);
|
||
|
current = false;
|
||
|
},
|
||
|
d: function destroy(detaching) {
|
||
|
if (detaching) detach_dev(switch_instance_anchor);
|
||
|
if (switch_instance) destroy_component(switch_instance, detaching);
|
||
|
}
|
||
|
};
|
||
|
|
||
|
dispatch_dev("SvelteRegisterBlock", {
|
||
|
block,
|
||
|
id: create_if_block.name,
|
||
|
type: "if",
|
||
|
source: "(244:0) {#if componentParams}",
|
||
|
ctx
|
||
|
});
|
||
|
|
||
|
return block;
|
||
|
}
|
||
|
|
||
|
function create_fragment$4(ctx) {
|
||
|
let current_block_type_index;
|
||
|
let if_block;
|
||
|
let if_block_anchor;
|
||
|
let current;
|
||
|
const if_block_creators = [create_if_block, create_else_block];
|
||
|
const if_blocks = [];
|
||
|
|
||
|
function select_block_type(ctx, dirty) {
|
||
|
if (/*componentParams*/ ctx[1]) return 0;
|
||
|
return 1;
|
||
|
}
|
||
|
|
||
|
current_block_type_index = select_block_type(ctx);
|
||
|
if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
|
||
|
|
||
|
const block = {
|
||
|
c: function create() {
|
||
|
if_block.c();
|
||
|
if_block_anchor = empty();
|
||
|
},
|
||
|
l: function claim(nodes) {
|
||
|
throw new Error_1("options.hydrate only works if the component was compiled with the `hydratable: true` option");
|
||
|
},
|
||
|
m: function mount(target, anchor) {
|
||
|
if_blocks[current_block_type_index].m(target, anchor);
|
||
|
insert_dev(target, if_block_anchor, anchor);
|
||
|
current = true;
|
||
|
},
|
||
|
p: function update(ctx, [dirty]) {
|
||
|
let previous_block_index = current_block_type_index;
|
||
|
current_block_type_index = select_block_type(ctx);
|
||
|
|
||
|
if (current_block_type_index === previous_block_index) {
|
||
|
if_blocks[current_block_type_index].p(ctx, dirty);
|
||
|
} else {
|
||
|
group_outros();
|
||
|
|
||
|
transition_out(if_blocks[previous_block_index], 1, 1, () => {
|
||
|
if_blocks[previous_block_index] = null;
|
||
|
});
|
||
|
|
||
|
check_outros();
|
||
|
if_block = if_blocks[current_block_type_index];
|
||
|
|
||
|
if (!if_block) {
|
||
|
if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
|
||
|
if_block.c();
|
||
|
} else {
|
||
|
if_block.p(ctx, dirty);
|
||
|
}
|
||
|
|
||
|
transition_in(if_block, 1);
|
||
|
if_block.m(if_block_anchor.parentNode, if_block_anchor);
|
||
|
}
|
||
|
},
|
||
|
i: function intro(local) {
|
||
|
if (current) return;
|
||
|
transition_in(if_block);
|
||
|
current = true;
|
||
|
},
|
||
|
o: function outro(local) {
|
||
|
transition_out(if_block);
|
||
|
current = false;
|
||
|
},
|
||
|
d: function destroy(detaching) {
|
||
|
if_blocks[current_block_type_index].d(detaching);
|
||
|
if (detaching) detach_dev(if_block_anchor);
|
||
|
}
|
||
|
};
|
||
|
|
||
|
dispatch_dev("SvelteRegisterBlock", {
|
||
|
block,
|
||
|
id: create_fragment$4.name,
|
||
|
type: "component",
|
||
|
source: "",
|
||
|
ctx
|
||
|
});
|
||
|
|
||
|
return block;
|
||
|
}
|
||
|
|
||
|
function wrap(component, userData, ...conditions) {
|
||
|
// Use the new wrap method and show a deprecation warning
|
||
|
// eslint-disable-next-line no-console
|
||
|
console.warn("Method `wrap` from `svelte-spa-router` is deprecated and will be removed in a future version. Please use `svelte-spa-router/wrap` instead. See http://bit.ly/svelte-spa-router-upgrading");
|
||
|
|
||
|
return wrap$1({ component, userData, conditions });
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @typedef {Object} Location
|
||
|
* @property {string} location - Location (page/view), for example `/book`
|
||
|
* @property {string} [querystring] - Querystring from the hash, as a string not parsed
|
||
|
*/
|
||
|
/**
|
||
|
* Returns the current location from the hash.
|
||
|
*
|
||
|
* @returns {Location} Location object
|
||
|
* @private
|
||
|
*/
|
||
|
function getLocation() {
|
||
|
const hashPosition = window.location.href.indexOf("#/");
|
||
|
|
||
|
let location = hashPosition > -1
|
||
|
? window.location.href.substr(hashPosition + 1)
|
||
|
: "/";
|
||
|
|
||
|
// Check if there's a querystring
|
||
|
const qsPosition = location.indexOf("?");
|
||
|
|
||
|
let querystring = "";
|
||
|
|
||
|
if (qsPosition > -1) {
|
||
|
querystring = location.substr(qsPosition + 1);
|
||
|
location = location.substr(0, qsPosition);
|
||
|
}
|
||
|
|
||
|
return { location, querystring };
|
||
|
}
|
||
|
|
||
|
const loc = readable(null, // eslint-disable-next-line prefer-arrow-callback
|
||
|
function start(set) {
|
||
|
set(getLocation());
|
||
|
|
||
|
const update = () => {
|
||
|
set(getLocation());
|
||
|
};
|
||
|
|
||
|
window.addEventListener("hashchange", update, false);
|
||
|
|
||
|
return function stop() {
|
||
|
window.removeEventListener("hashchange", update, false);
|
||
|
};
|
||
|
});
|
||
|
|
||
|
const location = derived(loc, $loc => $loc.location);
|
||
|
const querystring = derived(loc, $loc => $loc.querystring);
|
||
|
const params = writable(undefined);
|
||
|
|
||
|
async function push(location) {
|
||
|
if (!location || location.length < 1 || location.charAt(0) != "/" && location.indexOf("#/") !== 0) {
|
||
|
throw Error("Invalid parameter location");
|
||
|
}
|
||
|
|
||
|
// Execute this code when the current call stack is complete
|
||
|
await tick();
|
||
|
|
||
|
// Note: this will include scroll state in history even when restoreScrollState is false
|
||
|
history.replaceState(
|
||
|
{
|
||
|
...history.state,
|
||
|
__svelte_spa_router_scrollX: window.scrollX,
|
||
|
__svelte_spa_router_scrollY: window.scrollY
|
||
|
},
|
||
|
undefined,
|
||
|
undefined
|
||
|
);
|
||
|
|
||
|
window.location.hash = (location.charAt(0) == "#" ? "" : "#") + location;
|
||
|
}
|
||
|
|
||
|
async function pop() {
|
||
|
// Execute this code when the current call stack is complete
|
||
|
await tick();
|
||
|
|
||
|
window.history.back();
|
||
|
}
|
||
|
|
||
|
async function replace(location) {
|
||
|
if (!location || location.length < 1 || location.charAt(0) != "/" && location.indexOf("#/") !== 0) {
|
||
|
throw Error("Invalid parameter location");
|
||
|
}
|
||
|
|
||
|
// Execute this code when the current call stack is complete
|
||
|
await tick();
|
||
|
|
||
|
const dest = (location.charAt(0) == "#" ? "" : "#") + location;
|
||
|
|
||
|
try {
|
||
|
const newState = { ...history.state };
|
||
|
delete newState["__svelte_spa_router_scrollX"];
|
||
|
delete newState["__svelte_spa_router_scrollY"];
|
||
|
window.history.replaceState(newState, undefined, dest);
|
||
|
} catch(e) {
|
||
|
// eslint-disable-next-line no-console
|
||
|
console.warn("Caught exception while replacing the current page. If you're running this in the Svelte REPL, please note that the `replace` method might not work in this environment.");
|
||
|
}
|
||
|
|
||
|
// The method above doesn't trigger the hashchange event, so let's do that manually
|
||
|
window.dispatchEvent(new Event("hashchange"));
|
||
|
}
|
||
|
|
||
|
function link(node, opts) {
|
||
|
opts = linkOpts(opts);
|
||
|
|
||
|
// Only apply to <a> tags
|
||
|
if (!node || !node.tagName || node.tagName.toLowerCase() != "a") {
|
||
|
throw Error("Action \"link\" can only be used with <a> tags");
|
||
|
}
|
||
|
|
||
|
updateLink(node, opts);
|
||
|
|
||
|
return {
|
||
|
update(updated) {
|
||
|
updated = linkOpts(updated);
|
||
|
updateLink(node, updated);
|
||
|
}
|
||
|
};
|
||
|
}
|
||
|
|
||
|
// Internal function used by the link function
|
||
|
function updateLink(node, opts) {
|
||
|
let href = opts.href || node.getAttribute("href");
|
||
|
|
||
|
// Destination must start with '/' or '#/'
|
||
|
if (href && href.charAt(0) == "/") {
|
||
|
// Add # to the href attribute
|
||
|
href = "#" + href;
|
||
|
} else if (!href || href.length < 2 || href.slice(0, 2) != "#/") {
|
||
|
throw Error("Invalid value for \"href\" attribute: " + href);
|
||
|
}
|
||
|
|
||
|
node.setAttribute("href", href);
|
||
|
|
||
|
node.addEventListener("click", event => {
|
||
|
// Prevent default anchor onclick behaviour
|
||
|
event.preventDefault();
|
||
|
|
||
|
if (!opts.disabled) {
|
||
|
scrollstateHistoryHandler(event.currentTarget.getAttribute("href"));
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
|
||
|
// Internal function that ensures the argument of the link action is always an object
|
||
|
function linkOpts(val) {
|
||
|
if (val && typeof val == "string") {
|
||
|
return { href: val };
|
||
|
} else {
|
||
|
return val || {};
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* The handler attached to an anchor tag responsible for updating the
|
||
|
* current history state with the current scroll state
|
||
|
*
|
||
|
* @param {string} href - Destination
|
||
|
*/
|
||
|
function scrollstateHistoryHandler(href) {
|
||
|
// Setting the url (3rd arg) to href will break clicking for reasons, so don't try to do that
|
||
|
history.replaceState(
|
||
|
{
|
||
|
...history.state,
|
||
|
__svelte_spa_router_scrollX: window.scrollX,
|
||
|
__svelte_spa_router_scrollY: window.scrollY
|
||
|
},
|
||
|
undefined,
|
||
|
undefined
|
||
|
);
|
||
|
|
||
|
// This will force an update as desired, but this time our scroll state will be attached
|
||
|
window.location.hash = href;
|
||
|
}
|
||
|
|
||
|
function instance$4($$self, $$props, $$invalidate) {
|
||
|
let { $$slots: slots = {}, $$scope } = $$props;
|
||
|
validate_slots("Router", slots, []);
|
||
|
let { routes = {} } = $$props;
|
||
|
let { prefix = "" } = $$props;
|
||
|
let { restoreScrollState = false } = $$props;
|
||
|
|
||
|
/**
|
||
|
* Container for a route: path, component
|
||
|
*/
|
||
|
class RouteItem {
|
||
|
/**
|
||
|
* Initializes the object and creates a regular expression from the path, using regexparam.
|
||
|
*
|
||
|
* @param {string} path - Path to the route (must start with '/' or '*')
|
||
|
* @param {SvelteComponent|WrappedComponent} component - Svelte component for the route, optionally wrapped
|
||
|
*/
|
||
|
constructor(path, component) {
|
||
|
if (!component || typeof component != "function" && (typeof component != "object" || component._sveltesparouter !== true)) {
|
||
|
throw Error("Invalid component object");
|
||
|
}
|
||
|
|
||
|
// Path must be a regular or expression, or a string starting with '/' or '*'
|
||
|
if (!path || typeof path == "string" && (path.length < 1 || path.charAt(0) != "/" && path.charAt(0) != "*") || typeof path == "object" && !(path instanceof RegExp)) {
|
||
|
throw Error("Invalid value for \"path\" argument - strings must start with / or *");
|
||
|
}
|
||
|
|
||
|
const { pattern, keys } = parse(path);
|
||
|
this.path = path;
|
||
|
|
||
|
// Check if the component is wrapped and we have conditions
|
||
|
if (typeof component == "object" && component._sveltesparouter === true) {
|
||
|
this.component = component.component;
|
||
|
this.conditions = component.conditions || [];
|
||
|
this.userData = component.userData;
|
||
|
this.props = component.props || {};
|
||
|
} else {
|
||
|
// Convert the component to a function that returns a Promise, to normalize it
|
||
|
this.component = () => Promise.resolve(component);
|
||
|
|
||
|
this.conditions = [];
|
||
|
this.props = {};
|
||
|
}
|
||
|
|
||
|
this._pattern = pattern;
|
||
|
this._keys = keys;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Checks if `path` matches the current route.
|
||
|
* If there's a match, will return the list of parameters from the URL (if any).
|
||
|
* In case of no match, the method will return `null`.
|
||
|
*
|
||
|
* @param {string} path - Path to test
|
||
|
* @returns {null|Object.<string, string>} List of paramters from the URL if there's a match, or `null` otherwise.
|
||
|
*/
|
||
|
match(path) {
|
||
|
// If there's a prefix, check if it matches the start of the path.
|
||
|
// If not, bail early, else remove it before we run the matching.
|
||
|
if (prefix) {
|
||
|
if (typeof prefix == "string") {
|
||
|
if (path.startsWith(prefix)) {
|
||
|
path = path.substr(prefix.length) || "/";
|
||
|
} else {
|
||
|
return null;
|
||
|
}
|
||
|
} else if (prefix instanceof RegExp) {
|
||
|
const match = path.match(prefix);
|
||
|
|
||
|
if (match && match[0]) {
|
||
|
path = path.substr(match[0].length) || "/";
|
||
|
} else {
|
||
|
return null;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// Check if the pattern matches
|
||
|
const matches = this._pattern.exec(path);
|
||
|
|
||
|
if (matches === null) {
|
||
|
return null;
|
||
|
}
|
||
|
|
||
|
// If the input was a regular expression, this._keys would be false, so return matches as is
|
||
|
if (this._keys === false) {
|
||
|
return matches;
|
||
|
}
|
||
|
|
||
|
const out = {};
|
||
|
let i = 0;
|
||
|
|
||
|
while (i < this._keys.length) {
|
||
|
// In the match parameters, URL-decode all values
|
||
|
try {
|
||
|
out[this._keys[i]] = decodeURIComponent(matches[i + 1] || "") || null;
|
||
|
} catch(e) {
|
||
|
out[this._keys[i]] = null;
|
||
|
}
|
||
|
|
||
|
i++;
|
||
|
}
|
||
|
|
||
|
return out;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Dictionary with route details passed to the pre-conditions functions, as well as the `routeLoading`, `routeLoaded` and `conditionsFailed` events
|
||
|
* @typedef {Object} RouteDetail
|
||
|
* @property {string|RegExp} route - Route matched as defined in the route definition (could be a string or a reguar expression object)
|
||
|
* @property {string} location - Location path
|
||
|
* @property {string} querystring - Querystring from the hash
|
||
|
* @property {object} [userData] - Custom data passed by the user
|
||
|
* @property {SvelteComponent} [component] - Svelte component (only in `routeLoaded` events)
|
||
|
* @property {string} [name] - Name of the Svelte component (only in `routeLoaded` events)
|
||
|
*/
|
||
|
/**
|
||
|
* Executes all conditions (if any) to control whether the route can be shown. Conditions are executed in the order they are defined, and if a condition fails, the following ones aren't executed.
|
||
|
*
|
||
|
* @param {RouteDetail} detail - Route detail
|
||
|
* @returns {boolean} Returns true if all the conditions succeeded
|
||
|
*/
|
||
|
async checkConditions(detail) {
|
||
|
for (let i = 0; i < this.conditions.length; i++) {
|
||
|
if (!await this.conditions[i](detail)) {
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return true;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// Set up all routes
|
||
|
const routesList = [];
|
||
|
|
||
|
if (routes instanceof Map) {
|
||
|
// If it's a map, iterate on it right away
|
||
|
routes.forEach((route, path) => {
|
||
|
routesList.push(new RouteItem(path, route));
|
||
|
});
|
||
|
} else {
|
||
|
// We have an object, so iterate on its own properties
|
||
|
Object.keys(routes).forEach(path => {
|
||
|
routesList.push(new RouteItem(path, routes[path]));
|
||
|
});
|
||
|
}
|
||
|
|
||
|
// Props for the component to render
|
||
|
let component = null;
|
||
|
|
||
|
let componentParams = null;
|
||
|
let props = {};
|
||
|
|
||
|
// Event dispatcher from Svelte
|
||
|
const dispatch = createEventDispatcher();
|
||
|
|
||
|
// Just like dispatch, but executes on the next iteration of the event loop
|
||
|
async function dispatchNextTick(name, detail) {
|
||
|
// Execute this code when the current call stack is complete
|
||
|
await tick();
|
||
|
|
||
|
dispatch(name, detail);
|
||
|
}
|
||
|
|
||
|
// If this is set, then that means we have popped into this var the state of our last scroll position
|
||
|
let previousScrollState = null;
|
||
|
|
||
|
let popStateChanged = null;
|
||
|
|
||
|
if (restoreScrollState) {
|
||
|
popStateChanged = event => {
|
||
|
// If this event was from our history.replaceState, event.state will contain
|
||
|
// our scroll history. Otherwise, event.state will be null (like on forward
|
||
|
// navigation)
|
||
|
if (event.state && event.state.__svelte_spa_router_scrollY) {
|
||
|
previousScrollState = event.state;
|
||
|
} else {
|
||
|
previousScrollState = null;
|
||
|
}
|
||
|
};
|
||
|
|
||
|
// This is removed in the destroy() invocation below
|
||
|
window.addEventListener("popstate", popStateChanged);
|
||
|
|
||
|
afterUpdate(() => {
|
||
|
// If this exists, then this is a back navigation: restore the scroll position
|
||
|
if (previousScrollState) {
|
||
|
window.scrollTo(previousScrollState.__svelte_spa_router_scrollX, previousScrollState.__svelte_spa_router_scrollY);
|
||
|
} else {
|
||
|
// Otherwise this is a forward navigation: scroll to top
|
||
|
window.scrollTo(0, 0);
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
|
||
|
// Always have the latest value of loc
|
||
|
let lastLoc = null;
|
||
|
|
||
|
// Current object of the component loaded
|
||
|
let componentObj = null;
|
||
|
|
||
|
// Handle hash change events
|
||
|
// Listen to changes in the $loc store and update the page
|
||
|
// Do not use the $: syntax because it gets triggered by too many things
|
||
|
const unsubscribeLoc = loc.subscribe(async newLoc => {
|
||
|
lastLoc = newLoc;
|
||
|
|
||
|
// Find a route matching the location
|
||
|
let i = 0;
|
||
|
|
||
|
while (i < routesList.length) {
|
||
|
const match = routesList[i].match(newLoc.location);
|
||
|
|
||
|
if (!match) {
|
||
|
i++;
|
||
|
continue;
|
||
|
}
|
||
|
|
||
|
const detail = {
|
||
|
route: routesList[i].path,
|
||
|
location: newLoc.location,
|
||
|
querystring: newLoc.querystring,
|
||
|
userData: routesList[i].userData,
|
||
|
params: match && typeof match == "object" && Object.keys(match).length
|
||
|
? match
|
||
|
: null
|
||
|
};
|
||
|
|
||
|
// Check if the route can be loaded - if all conditions succeed
|
||
|
if (!await routesList[i].checkConditions(detail)) {
|
||
|
// Don't display anything
|
||
|
$$invalidate(0, component = null);
|
||
|
|
||
|
componentObj = null;
|
||
|
|
||
|
// Trigger an event to notify the user, then exit
|
||
|
dispatchNextTick("conditionsFailed", detail);
|
||
|
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
// Trigger an event to alert that we're loading the route
|
||
|
// We need to clone the object on every event invocation so we don't risk the object to be modified in the next tick
|
||
|
dispatchNextTick("routeLoading", Object.assign({}, detail));
|
||
|
|
||
|
// If there's a component to show while we're loading the route, display it
|
||
|
const obj = routesList[i].component;
|
||
|
|
||
|
// Do not replace the component if we're loading the same one as before, to avoid the route being unmounted and re-mounted
|
||
|
if (componentObj != obj) {
|
||
|
if (obj.loading) {
|
||
|
$$invalidate(0, component = obj.loading);
|
||
|
componentObj = obj;
|
||
|
$$invalidate(1, componentParams = obj.loadingParams);
|
||
|
$$invalidate(2, props = {});
|
||
|
|
||
|
// Trigger the routeLoaded event for the loading component
|
||
|
// Create a copy of detail so we don't modify the object for the dynamic route (and the dynamic route doesn't modify our object too)
|
||
|
dispatchNextTick("routeLoaded", Object.assign({}, detail, {
|
||
|
component,
|
||
|
name: component.name,
|
||
|
params: componentParams
|
||
|
}));
|
||
|
} else {
|
||
|
$$invalidate(0, component = null);
|
||
|
componentObj = null;
|
||
|
}
|
||
|
|
||
|
// Invoke the Promise
|
||
|
const loaded = await obj();
|
||
|
|
||
|
// Now that we're here, after the promise resolved, check if we still want this component, as the user might have navigated to another page in the meanwhile
|
||
|
if (newLoc != lastLoc) {
|
||
|
// Don't update the component, just exit
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
// If there is a "default" property, which is used by async routes, then pick that
|
||
|
$$invalidate(0, component = loaded && loaded.default || loaded);
|
||
|
|
||
|
componentObj = obj;
|
||
|
}
|
||
|
|
||
|
// Set componentParams only if we have a match, to avoid a warning similar to `<Component> was created with unknown prop 'params'`
|
||
|
// Of course, this assumes that developers always add a "params" prop when they are expecting parameters
|
||
|
if (match && typeof match == "object" && Object.keys(match).length) {
|
||
|
$$invalidate(1, componentParams = match);
|
||
|
} else {
|
||
|
$$invalidate(1, componentParams = null);
|
||
|
}
|
||
|
|
||
|
// Set static props, if any
|
||
|
$$invalidate(2, props = routesList[i].props);
|
||
|
|
||
|
// Dispatch the routeLoaded event then exit
|
||
|
// We need to clone the object on every event invocation so we don't risk the object to be modified in the next tick
|
||
|
dispatchNextTick("routeLoaded", Object.assign({}, detail, {
|
||
|
component,
|
||
|
name: component.name,
|
||
|
params: componentParams
|
||
|
})).then(() => {
|
||
|
params.set(componentParams);
|
||
|
});
|
||
|
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
// If we're still here, there was no match, so show the empty component
|
||
|
$$invalidate(0, component = null);
|
||
|
|
||
|
componentObj = null;
|
||
|
params.set(undefined);
|
||
|
});
|
||
|
|
||
|
onDestroy(() => {
|
||
|
unsubscribeLoc();
|
||
|
popStateChanged && window.removeEventListener("popstate", popStateChanged);
|
||
|
});
|
||
|
|
||
|
const writable_props = ["routes", "prefix", "restoreScrollState"];
|
||
|
|
||
|
Object_1.keys($$props).forEach(key => {
|
||
|
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console_1.warn(`<Router> was created with unknown prop '${key}'`);
|
||
|
});
|
||
|
|
||
|
function routeEvent_handler(event) {
|
||
|
bubble($$self, event);
|
||
|
}
|
||
|
|
||
|
function routeEvent_handler_1(event) {
|
||
|
bubble($$self, event);
|
||
|
}
|
||
|
|
||
|
$$self.$$set = $$props => {
|
||
|
if ("routes" in $$props) $$invalidate(3, routes = $$props.routes);
|
||
|
if ("prefix" in $$props) $$invalidate(4, prefix = $$props.prefix);
|
||
|
if ("restoreScrollState" in $$props) $$invalidate(5, restoreScrollState = $$props.restoreScrollState);
|
||
|
};
|
||
|
|
||
|
$$self.$capture_state = () => ({
|
||
|
readable,
|
||
|
writable,
|
||
|
derived,
|
||
|
tick,
|
||
|
_wrap: wrap$1,
|
||
|
wrap,
|
||
|
getLocation,
|
||
|
loc,
|
||
|
location,
|
||
|
querystring,
|
||
|
params,
|
||
|
push,
|
||
|
pop,
|
||
|
replace,
|
||
|
link,
|
||
|
updateLink,
|
||
|
linkOpts,
|
||
|
scrollstateHistoryHandler,
|
||
|
onDestroy,
|
||
|
createEventDispatcher,
|
||
|
afterUpdate,
|
||
|
parse,
|
||
|
routes,
|
||
|
prefix,
|
||
|
restoreScrollState,
|
||
|
RouteItem,
|
||
|
routesList,
|
||
|
component,
|
||
|
componentParams,
|
||
|
props,
|
||
|
dispatch,
|
||
|
dispatchNextTick,
|
||
|
previousScrollState,
|
||
|
popStateChanged,
|
||
|
lastLoc,
|
||
|
componentObj,
|
||
|
unsubscribeLoc
|
||
|
});
|
||
|
|
||
|
$$self.$inject_state = $$props => {
|
||
|
if ("routes" in $$props) $$invalidate(3, routes = $$props.routes);
|
||
|
if ("prefix" in $$props) $$invalidate(4, prefix = $$props.prefix);
|
||
|
if ("restoreScrollState" in $$props) $$invalidate(5, restoreScrollState = $$props.restoreScrollState);
|
||
|
if ("component" in $$props) $$invalidate(0, component = $$props.component);
|
||
|
if ("componentParams" in $$props) $$invalidate(1, componentParams = $$props.componentParams);
|
||
|
if ("props" in $$props) $$invalidate(2, props = $$props.props);
|
||
|
if ("previousScrollState" in $$props) previousScrollState = $$props.previousScrollState;
|
||
|
if ("popStateChanged" in $$props) popStateChanged = $$props.popStateChanged;
|
||
|
if ("lastLoc" in $$props) lastLoc = $$props.lastLoc;
|
||
|
if ("componentObj" in $$props) componentObj = $$props.componentObj;
|
||
|
};
|
||
|
|
||
|
if ($$props && "$$inject" in $$props) {
|
||
|
$$self.$inject_state($$props.$$inject);
|
||
|
}
|
||
|
|
||
|
$$self.$$.update = () => {
|
||
|
if ($$self.$$.dirty & /*restoreScrollState*/ 32) {
|
||
|
// Update history.scrollRestoration depending on restoreScrollState
|
||
|
history.scrollRestoration = restoreScrollState ? "manual" : "auto";
|
||
|
}
|
||
|
};
|
||
|
|
||
|
return [
|
||
|
component,
|
||
|
componentParams,
|
||
|
props,
|
||
|
routes,
|
||
|
prefix,
|
||
|
restoreScrollState,
|
||
|
routeEvent_handler,
|
||
|
routeEvent_handler_1
|
||
|
];
|
||
|
}
|
||
|
|
||
|
class Router extends SvelteComponentDev {
|
||
|
constructor(options) {
|
||
|
super(options);
|
||
|
|
||
|
init(this, options, instance$4, create_fragment$4, safe_not_equal, {
|
||
|
routes: 3,
|
||
|
prefix: 4,
|
||
|
restoreScrollState: 5
|
||
|
});
|
||
|
|
||
|
dispatch_dev("SvelteRegisterComponent", {
|
||
|
component: this,
|
||
|
tagName: "Router",
|
||
|
options,
|
||
|
id: create_fragment$4.name
|
||
|
});
|
||
|
}
|
||
|
|
||
|
get routes() {
|
||
|
throw new Error_1("<Router>: Props cannot be read directly from the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'");
|
||
|
}
|
||
|
|
||
|
set routes(value) {
|
||
|
throw new Error_1("<Router>: Props cannot be set directly on the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'");
|
||
|
}
|
||
|
|
||
|
get prefix() {
|
||
|
throw new Error_1("<Router>: Props cannot be read directly from the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'");
|
||
|
}
|
||
|
|
||
|
set prefix(value) {
|
||
|
throw new Error_1("<Router>: Props cannot be set directly on the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'");
|
||
|
}
|
||
|
|
||
|
get restoreScrollState() {
|
||
|
throw new Error_1("<Router>: Props cannot be read directly from the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'");
|
||
|
}
|
||
|
|
||
|
set restoreScrollState(value) {
|
||
|
throw new Error_1("<Router>: Props cannot be set directly on the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'");
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function fade(node, { delay = 0, duration = 400, easing = identity } = {}) {
|
||
|
const o = +getComputedStyle(node).opacity;
|
||
|
return {
|
||
|
delay,
|
||
|
duration,
|
||
|
easing,
|
||
|
css: t => `opacity: ${t * o}`
|
||
|
};
|
||
|
}
|
||
|
|
||
|
/* src/pages/Home.svelte generated by Svelte v3.37.0 */
|
||
|
const file$3 = "src/pages/Home.svelte";
|
||
|
|
||
|
function create_fragment$3(ctx) {
|
||
|
let main;
|
||
|
let div1;
|
||
|
let img;
|
||
|
let img_src_value;
|
||
|
let t0;
|
||
|
let div0;
|
||
|
let h1;
|
||
|
let t2;
|
||
|
let button;
|
||
|
let t4;
|
||
|
let div2;
|
||
|
let h20;
|
||
|
let t6;
|
||
|
let p;
|
||
|
let t8;
|
||
|
let h4;
|
||
|
let t10;
|
||
|
let ol;
|
||
|
let li0;
|
||
|
let t12;
|
||
|
let li1;
|
||
|
let t14;
|
||
|
let li2;
|
||
|
let t16;
|
||
|
let li3;
|
||
|
let t18;
|
||
|
let div5;
|
||
|
let h21;
|
||
|
let t20;
|
||
|
let div4;
|
||
|
let div3;
|
||
|
let iframe;
|
||
|
let iframe_src_value;
|
||
|
let main_intro;
|
||
|
let main_outro;
|
||
|
let current;
|
||
|
|
||
|
const block = {
|
||
|
c: function create() {
|
||
|
main = element("main");
|
||
|
div1 = element("div");
|
||
|
img = element("img");
|
||
|
t0 = space();
|
||
|
div0 = element("div");
|
||
|
h1 = element("h1");
|
||
|
h1.textContent = "A Non-Profit initiative with the goal to\n increase online presence and collaboration within micro and\n small businesses in Indonesia.";
|
||
|
t2 = space();
|
||
|
button = element("button");
|
||
|
button.textContent = "Donate";
|
||
|
t4 = space();
|
||
|
div2 = element("div");
|
||
|
h20 = element("h2");
|
||
|
h20.textContent = "About Us";
|
||
|
t6 = space();
|
||
|
p = element("p");
|
||
|
p.textContent = "There are more than 60,000 street vendors, and uncountable more\n microbusinesses all around Indonesia. These businesses have no way to\n find financial or social support, and have little to no agency to climb\n out of the poverty cycle. Being able to support those in desperate need\n with funds to kickstart their businesses. This can potentially change the\n lives of Indonesians for the better.";
|
||
|
t8 = space();
|
||
|
h4 = element("h4");
|
||
|
h4.textContent = "Our Mission";
|
||
|
t10 = space();
|
||
|
ol = element("ol");
|
||
|
li0 = element("li");
|
||
|
li0.textContent = "Aid local businesses in connecting with potential investors";
|
||
|
t12 = space();
|
||
|
li1 = element("li");
|
||
|
li1.textContent = "Connect with business owners. Understand the situation.";
|
||
|
t14 = space();
|
||
|
li2 = element("li");
|
||
|
li2.textContent = "Create a profile. Promote the business, and give businesses the opportunity to get help.";
|
||
|
t16 = space();
|
||
|
li3 = element("li");
|
||
|
li3.textContent = "Help donors and community members get into contact with businsses.";
|
||
|
t18 = space();
|
||
|
div5 = element("div");
|
||
|
h21 = element("h2");
|
||
|
h21.textContent = "Learn More";
|
||
|
t20 = space();
|
||
|
div4 = element("div");
|
||
|
div3 = element("div");
|
||
|
iframe = element("iframe");
|
||
|
attr_dev(img, "class", "rounded-box");
|
||
|
if (img.src !== (img_src_value = "https://i.picsum.photos/id/188/1920/600.jpg?hmac=4nub7TUTUByAS9gjtFvgHkfLsJLtzUGmAEm3SxX1X9Y")) attr_dev(img, "src", img_src_value);
|
||
|
attr_dev(img, "alt", "");
|
||
|
add_location(img, file$3, 8, 4, 360);
|
||
|
attr_dev(h1, "class", "text-2xl font-bold w-9/12 text-center\n lg:text-left lg:w-8/12");
|
||
|
add_location(h1, file$3, 10, 6, 592);
|
||
|
attr_dev(button, "class", "btn btn-lg btn-primary btn-wide self-center");
|
||
|
add_location(button, file$3, 16, 6, 953);
|
||
|
attr_dev(div0, "class", "flex-1 flex flex-col lg:flex-row justify-center items-center gap-8 lg:gap-0");
|
||
|
add_location(div0, file$3, 9, 4, 496);
|
||
|
attr_dev(div1, "class", "h-[calc(90vh-96px)] lg:h-[calc(80vh-108px)]\n bg-primary-content shadow-xl rounded-box p-4 flex flex-col");
|
||
|
add_location(div1, file$3, 6, 2, 225);
|
||
|
attr_dev(h20, "class", "text-center text-3xl font-semibold mb-3");
|
||
|
add_location(h20, file$3, 21, 4, 1149);
|
||
|
attr_dev(p, "class", "md:max-w-2xl text-justify border-l-4 border-primary pl-4");
|
||
|
add_location(p, file$3, 22, 4, 1219);
|
||
|
attr_dev(h4, "class", "text-xl md:text-2xl font-semibold mt-5 mb-3");
|
||
|
add_location(h4, file$3, 30, 4, 1715);
|
||
|
attr_dev(li0, "class", "svelte-56bo99");
|
||
|
add_location(li0, file$3, 32, 6, 1855);
|
||
|
attr_dev(li1, "class", "svelte-56bo99");
|
||
|
add_location(li1, file$3, 33, 6, 1930);
|
||
|
attr_dev(li2, "class", "svelte-56bo99");
|
||
|
add_location(li2, file$3, 34, 6, 2001);
|
||
|
attr_dev(li3, "class", "svelte-56bo99");
|
||
|
add_location(li3, file$3, 35, 6, 2105);
|
||
|
attr_dev(ol, "class", "font-medium list-decimal text-md md:w-10/12");
|
||
|
add_location(ol, file$3, 31, 4, 1792);
|
||
|
attr_dev(div2, "class", "bg-primary-content shadow-xl items-center rounded-box px-12 py-4 flex flex-col");
|
||
|
add_location(div2, file$3, 20, 2, 1052);
|
||
|
attr_dev(h21, "class", "text-3xl font-semibold mb-4");
|
||
|
add_location(h21, file$3, 40, 4, 2285);
|
||
|
if (iframe.src !== (iframe_src_value = "https://www.youtube.com/embed/asdasdasjdlkq")) attr_dev(iframe, "src", iframe_src_value);
|
||
|
attr_dev(iframe, "title", "About");
|
||
|
attr_dev(iframe, "frameborder", "0");
|
||
|
attr_dev(iframe, "allow", "accelerometer; autoplay; clipboard-write;\n encrypted-media; gyroscope; picture-in-picture");
|
||
|
iframe.allowFullscreen = true;
|
||
|
add_location(iframe, file$3, 43, 8, 2427);
|
||
|
attr_dev(div3, "class", "aspect-w-16 aspect-h-9");
|
||
|
add_location(div3, file$3, 42, 6, 2382);
|
||
|
attr_dev(div4, "class", "w-10/12 md:w-1/2");
|
||
|
add_location(div4, file$3, 41, 4, 2345);
|
||
|
attr_dev(div5, "class", "bg-primary shadow-xl rounded-box flex flex-col items-center p-6");
|
||
|
add_location(div5, file$3, 39, 2, 2203);
|
||
|
attr_dev(main, "class", "flex flex-col gap-6 max-w-5xl mx-auto");
|
||
|
add_location(main, file$3, 5, 0, 101);
|
||
|
},
|
||
|
l: function claim(nodes) {
|
||
|
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
|
||
|
},
|
||
|
m: function mount(target, anchor) {
|
||
|
insert_dev(target, main, anchor);
|
||
|
append_dev(main, div1);
|
||
|
append_dev(div1, img);
|
||
|
append_dev(div1, t0);
|
||
|
append_dev(div1, div0);
|
||
|
append_dev(div0, h1);
|
||
|
append_dev(div0, t2);
|
||
|
append_dev(div0, button);
|
||
|
append_dev(main, t4);
|
||
|
append_dev(main, div2);
|
||
|
append_dev(div2, h20);
|
||
|
append_dev(div2, t6);
|
||
|
append_dev(div2, p);
|
||
|
append_dev(div2, t8);
|
||
|
append_dev(div2, h4);
|
||
|
append_dev(div2, t10);
|
||
|
append_dev(div2, ol);
|
||
|
append_dev(ol, li0);
|
||
|
append_dev(ol, t12);
|
||
|
append_dev(ol, li1);
|
||
|
append_dev(ol, t14);
|
||
|
append_dev(ol, li2);
|
||
|
append_dev(ol, t16);
|
||
|
append_dev(ol, li3);
|
||
|
append_dev(main, t18);
|
||
|
append_dev(main, div5);
|
||
|
append_dev(div5, h21);
|
||
|
append_dev(div5, t20);
|
||
|
append_dev(div5, div4);
|
||
|
append_dev(div4, div3);
|
||
|
append_dev(div3, iframe);
|
||
|
current = true;
|
||
|
},
|
||
|
p: noop,
|
||
|
i: function intro(local) {
|
||
|
if (current) return;
|
||
|
|
||
|
add_render_callback(() => {
|
||
|
if (main_outro) main_outro.end(1);
|
||
|
if (!main_intro) main_intro = create_in_transition(main, fade, { delay: 120, duration: 100 });
|
||
|
main_intro.start();
|
||
|
});
|
||
|
|
||
|
current = true;
|
||
|
},
|
||
|
o: function outro(local) {
|
||
|
if (main_intro) main_intro.invalidate();
|
||
|
main_outro = create_out_transition(main, fade, { duration: 100 });
|
||
|
current = false;
|
||
|
},
|
||
|
d: function destroy(detaching) {
|
||
|
if (detaching) detach_dev(main);
|
||
|
if (detaching && main_outro) main_outro.end();
|
||
|
}
|
||
|
};
|
||
|
|
||
|
dispatch_dev("SvelteRegisterBlock", {
|
||
|
block,
|
||
|
id: create_fragment$3.name,
|
||
|
type: "component",
|
||
|
source: "",
|
||
|
ctx
|
||
|
});
|
||
|
|
||
|
return block;
|
||
|
}
|
||
|
|
||
|
function instance$3($$self, $$props, $$invalidate) {
|
||
|
let { $$slots: slots = {}, $$scope } = $$props;
|
||
|
validate_slots("Home", slots, []);
|
||
|
const writable_props = [];
|
||
|
|
||
|
Object.keys($$props).forEach(key => {
|
||
|
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(`<Home> was created with unknown prop '${key}'`);
|
||
|
});
|
||
|
|
||
|
$$self.$capture_state = () => ({ fade, link });
|
||
|
return [];
|
||
|
}
|
||
|
|
||
|
class Home extends SvelteComponentDev {
|
||
|
constructor(options) {
|
||
|
super(options);
|
||
|
init(this, options, instance$3, create_fragment$3, safe_not_equal, {});
|
||
|
|
||
|
dispatch_dev("SvelteRegisterComponent", {
|
||
|
component: this,
|
||
|
tagName: "Home",
|
||
|
options,
|
||
|
id: create_fragment$3.name
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* src/pages/Businesses.svelte generated by Svelte v3.37.0 */
|
||
|
const file$2 = "src/pages/Businesses.svelte";
|
||
|
|
||
|
function create_fragment$2(ctx) {
|
||
|
let main;
|
||
|
let div12;
|
||
|
let div2;
|
||
|
let img0;
|
||
|
let img0_src_value;
|
||
|
let t0;
|
||
|
let div1;
|
||
|
let div0;
|
||
|
let p0;
|
||
|
let t1;
|
||
|
let br0;
|
||
|
let t2;
|
||
|
let t3;
|
||
|
let h20;
|
||
|
let t5;
|
||
|
let hr0;
|
||
|
let t6;
|
||
|
let h40;
|
||
|
let t8;
|
||
|
let h21;
|
||
|
let t10;
|
||
|
let div5;
|
||
|
let img1;
|
||
|
let img1_src_value;
|
||
|
let t11;
|
||
|
let div4;
|
||
|
let div3;
|
||
|
let p1;
|
||
|
let t12;
|
||
|
let br1;
|
||
|
let t13;
|
||
|
let t14;
|
||
|
let h22;
|
||
|
let t16;
|
||
|
let hr1;
|
||
|
let t17;
|
||
|
let h41;
|
||
|
let t19;
|
||
|
let h23;
|
||
|
let t21;
|
||
|
let div8;
|
||
|
let img2;
|
||
|
let img2_src_value;
|
||
|
let t22;
|
||
|
let div7;
|
||
|
let div6;
|
||
|
let p2;
|
||
|
let t23;
|
||
|
let br2;
|
||
|
let t24;
|
||
|
let t25;
|
||
|
let h24;
|
||
|
let t27;
|
||
|
let hr2;
|
||
|
let t28;
|
||
|
let h42;
|
||
|
let t30;
|
||
|
let h25;
|
||
|
let t32;
|
||
|
let div11;
|
||
|
let img3;
|
||
|
let img3_src_value;
|
||
|
let t33;
|
||
|
let div10;
|
||
|
let div9;
|
||
|
let p3;
|
||
|
let t34;
|
||
|
let br3;
|
||
|
let t35;
|
||
|
let t36;
|
||
|
let h26;
|
||
|
let t38;
|
||
|
let hr3;
|
||
|
let t39;
|
||
|
let h43;
|
||
|
let t41;
|
||
|
let h27;
|
||
|
let main_intro;
|
||
|
let main_outro;
|
||
|
let current;
|
||
|
|
||
|
const block = {
|
||
|
c: function create() {
|
||
|
main = element("main");
|
||
|
div12 = element("div");
|
||
|
div2 = element("div");
|
||
|
img0 = element("img");
|
||
|
t0 = space();
|
||
|
div1 = element("div");
|
||
|
div0 = element("div");
|
||
|
p0 = element("p");
|
||
|
t1 = text("Small description for the business.");
|
||
|
br0 = element("br");
|
||
|
t2 = text("Max 3 lines long.");
|
||
|
t3 = space();
|
||
|
h20 = element("h2");
|
||
|
h20.textContent = "Business Type";
|
||
|
t5 = space();
|
||
|
hr0 = element("hr");
|
||
|
t6 = space();
|
||
|
h40 = element("h4");
|
||
|
h40.textContent = "Learn More";
|
||
|
t8 = space();
|
||
|
h21 = element("h2");
|
||
|
h21.textContent = "Business Name";
|
||
|
t10 = space();
|
||
|
div5 = element("div");
|
||
|
img1 = element("img");
|
||
|
t11 = space();
|
||
|
div4 = element("div");
|
||
|
div3 = element("div");
|
||
|
p1 = element("p");
|
||
|
t12 = text("Small description for the business.");
|
||
|
br1 = element("br");
|
||
|
t13 = text("Max 3 lines long.");
|
||
|
t14 = space();
|
||
|
h22 = element("h2");
|
||
|
h22.textContent = "Business Type";
|
||
|
t16 = space();
|
||
|
hr1 = element("hr");
|
||
|
t17 = space();
|
||
|
h41 = element("h4");
|
||
|
h41.textContent = "Learn More";
|
||
|
t19 = space();
|
||
|
h23 = element("h2");
|
||
|
h23.textContent = "Business Name";
|
||
|
t21 = space();
|
||
|
div8 = element("div");
|
||
|
img2 = element("img");
|
||
|
t22 = space();
|
||
|
div7 = element("div");
|
||
|
div6 = element("div");
|
||
|
p2 = element("p");
|
||
|
t23 = text("Small description for the business.");
|
||
|
br2 = element("br");
|
||
|
t24 = text("Max 3 lines long.");
|
||
|
t25 = space();
|
||
|
h24 = element("h2");
|
||
|
h24.textContent = "Business Type";
|
||
|
t27 = space();
|
||
|
hr2 = element("hr");
|
||
|
t28 = space();
|
||
|
h42 = element("h4");
|
||
|
h42.textContent = "Learn More";
|
||
|
t30 = space();
|
||
|
h25 = element("h2");
|
||
|
h25.textContent = "Business Name";
|
||
|
t32 = space();
|
||
|
div11 = element("div");
|
||
|
img3 = element("img");
|
||
|
t33 = space();
|
||
|
div10 = element("div");
|
||
|
div9 = element("div");
|
||
|
p3 = element("p");
|
||
|
t34 = text("Small description for the business.");
|
||
|
br3 = element("br");
|
||
|
t35 = text("Max 3 lines long.");
|
||
|
t36 = space();
|
||
|
h26 = element("h2");
|
||
|
h26.textContent = "Business Type";
|
||
|
t38 = space();
|
||
|
hr3 = element("hr");
|
||
|
t39 = space();
|
||
|
h43 = element("h4");
|
||
|
h43.textContent = "Learn More";
|
||
|
t41 = space();
|
||
|
h27 = element("h2");
|
||
|
h27.textContent = "Business Name";
|
||
|
if (img0.src !== (img0_src_value = "https://picsum.photos/350/240")) attr_dev(img0, "src", img0_src_value);
|
||
|
attr_dev(img0, "class", "svelte-esyokm");
|
||
|
add_location(img0, file$2, 9, 6, 313);
|
||
|
add_location(br0, file$2, 12, 48, 466);
|
||
|
add_location(p0, file$2, 12, 10, 428);
|
||
|
attr_dev(h20, "class", "text-sm italic");
|
||
|
add_location(h20, file$2, 13, 10, 502);
|
||
|
attr_dev(hr0, "class", "mb-2 svelte-esyokm");
|
||
|
add_location(hr0, file$2, 14, 10, 558);
|
||
|
attr_dev(h40, "class", "text-md svelte-esyokm");
|
||
|
add_location(h40, file$2, 15, 10, 586);
|
||
|
attr_dev(div0, "class", "info svelte-esyokm");
|
||
|
add_location(div0, file$2, 11, 8, 399);
|
||
|
attr_dev(div1, "class", "info-container svelte-esyokm");
|
||
|
add_location(div1, file$2, 10, 6, 362);
|
||
|
attr_dev(h21, "class", "name svelte-esyokm");
|
||
|
add_location(h21, file$2, 18, 6, 656);
|
||
|
attr_dev(div2, "class", "entry relative svelte-esyokm");
|
||
|
add_location(div2, file$2, 8, 4, 278);
|
||
|
if (img1.src !== (img1_src_value = "https://picsum.photos/350/240")) attr_dev(img1, "src", img1_src_value);
|
||
|
attr_dev(img1, "class", "svelte-esyokm");
|
||
|
add_location(img1, file$2, 21, 6, 743);
|
||
|
add_location(br1, file$2, 24, 48, 896);
|
||
|
add_location(p1, file$2, 24, 10, 858);
|
||
|
attr_dev(h22, "class", "text-sm italic");
|
||
|
add_location(h22, file$2, 25, 10, 932);
|
||
|
attr_dev(hr1, "class", "mb-2 svelte-esyokm");
|
||
|
add_location(hr1, file$2, 26, 10, 988);
|
||
|
attr_dev(h41, "class", "text-md svelte-esyokm");
|
||
|
add_location(h41, file$2, 27, 10, 1016);
|
||
|
attr_dev(div3, "class", "info svelte-esyokm");
|
||
|
add_location(div3, file$2, 23, 8, 829);
|
||
|
attr_dev(div4, "class", "info-container svelte-esyokm");
|
||
|
add_location(div4, file$2, 22, 6, 792);
|
||
|
attr_dev(h23, "class", "name svelte-esyokm");
|
||
|
add_location(h23, file$2, 30, 6, 1086);
|
||
|
attr_dev(div5, "class", "entry relative svelte-esyokm");
|
||
|
add_location(div5, file$2, 20, 4, 708);
|
||
|
if (img2.src !== (img2_src_value = "https://picsum.photos/350/240")) attr_dev(img2, "src", img2_src_value);
|
||
|
attr_dev(img2, "class", "svelte-esyokm");
|
||
|
add_location(img2, file$2, 33, 6, 1173);
|
||
|
add_location(br2, file$2, 36, 48, 1326);
|
||
|
add_location(p2, file$2, 36, 10, 1288);
|
||
|
attr_dev(h24, "class", "text-sm italic");
|
||
|
add_location(h24, file$2, 37, 10, 1362);
|
||
|
attr_dev(hr2, "class", "mb-2 svelte-esyokm");
|
||
|
add_location(hr2, file$2, 38, 10, 1418);
|
||
|
attr_dev(h42, "class", "text-md svelte-esyokm");
|
||
|
add_location(h42, file$2, 39, 10, 1446);
|
||
|
attr_dev(div6, "class", "info svelte-esyokm");
|
||
|
add_location(div6, file$2, 35, 8, 1259);
|
||
|
attr_dev(div7, "class", "info-container svelte-esyokm");
|
||
|
add_location(div7, file$2, 34, 6, 1222);
|
||
|
attr_dev(h25, "class", "name svelte-esyokm");
|
||
|
add_location(h25, file$2, 42, 6, 1516);
|
||
|
attr_dev(div8, "class", "entry relative svelte-esyokm");
|
||
|
add_location(div8, file$2, 32, 4, 1138);
|
||
|
if (img3.src !== (img3_src_value = "https://picsum.photos/350/240")) attr_dev(img3, "src", img3_src_value);
|
||
|
attr_dev(img3, "class", "svelte-esyokm");
|
||
|
add_location(img3, file$2, 45, 6, 1603);
|
||
|
add_location(br3, file$2, 48, 48, 1756);
|
||
|
add_location(p3, file$2, 48, 10, 1718);
|
||
|
attr_dev(h26, "class", "text-sm italic");
|
||
|
add_location(h26, file$2, 49, 10, 1792);
|
||
|
attr_dev(hr3, "class", "mb-2 svelte-esyokm");
|
||
|
add_location(hr3, file$2, 50, 10, 1848);
|
||
|
attr_dev(h43, "class", "text-md svelte-esyokm");
|
||
|
add_location(h43, file$2, 51, 10, 1876);
|
||
|
attr_dev(div9, "class", "info svelte-esyokm");
|
||
|
add_location(div9, file$2, 47, 8, 1689);
|
||
|
attr_dev(div10, "class", "info-container svelte-esyokm");
|
||
|
add_location(div10, file$2, 46, 6, 1652);
|
||
|
attr_dev(h27, "class", "name svelte-esyokm");
|
||
|
add_location(h27, file$2, 54, 6, 1946);
|
||
|
attr_dev(div11, "class", "entry relative svelte-esyokm");
|
||
|
add_location(div11, file$2, 44, 4, 1568);
|
||
|
attr_dev(div12, "class", "flex flex-wrap gap-12 justify-center md:justify-start");
|
||
|
add_location(div12, file$2, 6, 2, 205);
|
||
|
attr_dev(main, "class", "max-w-6xl mx-auto svelte-esyokm");
|
||
|
add_location(main, file$2, 5, 0, 101);
|
||
|
},
|
||
|
l: function claim(nodes) {
|
||
|
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
|
||
|
},
|
||
|
m: function mount(target, anchor) {
|
||
|
insert_dev(target, main, anchor);
|
||
|
append_dev(main, div12);
|
||
|
append_dev(div12, div2);
|
||
|
append_dev(div2, img0);
|
||
|
append_dev(div2, t0);
|
||
|
append_dev(div2, div1);
|
||
|
append_dev(div1, div0);
|
||
|
append_dev(div0, p0);
|
||
|
append_dev(p0, t1);
|
||
|
append_dev(p0, br0);
|
||
|
append_dev(p0, t2);
|
||
|
append_dev(div0, t3);
|
||
|
append_dev(div0, h20);
|
||
|
append_dev(div0, t5);
|
||
|
append_dev(div0, hr0);
|
||
|
append_dev(div0, t6);
|
||
|
append_dev(div0, h40);
|
||
|
append_dev(div2, t8);
|
||
|
append_dev(div2, h21);
|
||
|
append_dev(div12, t10);
|
||
|
append_dev(div12, div5);
|
||
|
append_dev(div5, img1);
|
||
|
append_dev(div5, t11);
|
||
|
append_dev(div5, div4);
|
||
|
append_dev(div4, div3);
|
||
|
append_dev(div3, p1);
|
||
|
append_dev(p1, t12);
|
||
|
append_dev(p1, br1);
|
||
|
append_dev(p1, t13);
|
||
|
append_dev(div3, t14);
|
||
|
append_dev(div3, h22);
|
||
|
append_dev(div3, t16);
|
||
|
append_dev(div3, hr1);
|
||
|
append_dev(div3, t17);
|
||
|
append_dev(div3, h41);
|
||
|
append_dev(div5, t19);
|
||
|
append_dev(div5, h23);
|
||
|
append_dev(div12, t21);
|
||
|
append_dev(div12, div8);
|
||
|
append_dev(div8, img2);
|
||
|
append_dev(div8, t22);
|
||
|
append_dev(div8, div7);
|
||
|
append_dev(div7, div6);
|
||
|
append_dev(div6, p2);
|
||
|
append_dev(p2, t23);
|
||
|
append_dev(p2, br2);
|
||
|
append_dev(p2, t24);
|
||
|
append_dev(div6, t25);
|
||
|
append_dev(div6, h24);
|
||
|
append_dev(div6, t27);
|
||
|
append_dev(div6, hr2);
|
||
|
append_dev(div6, t28);
|
||
|
append_dev(div6, h42);
|
||
|
append_dev(div8, t30);
|
||
|
append_dev(div8, h25);
|
||
|
append_dev(div12, t32);
|
||
|
append_dev(div12, div11);
|
||
|
append_dev(div11, img3);
|
||
|
append_dev(div11, t33);
|
||
|
append_dev(div11, div10);
|
||
|
append_dev(div10, div9);
|
||
|
append_dev(div9, p3);
|
||
|
append_dev(p3, t34);
|
||
|
append_dev(p3, br3);
|
||
|
append_dev(p3, t35);
|
||
|
append_dev(div9, t36);
|
||
|
append_dev(div9, h26);
|
||
|
append_dev(div9, t38);
|
||
|
append_dev(div9, hr3);
|
||
|
append_dev(div9, t39);
|
||
|
append_dev(div9, h43);
|
||
|
append_dev(div11, t41);
|
||
|
append_dev(div11, h27);
|
||
|
current = true;
|
||
|
},
|
||
|
p: noop,
|
||
|
i: function intro(local) {
|
||
|
if (current) return;
|
||
|
|
||
|
add_render_callback(() => {
|
||
|
if (main_outro) main_outro.end(1);
|
||
|
if (!main_intro) main_intro = create_in_transition(main, fade, { delay: 120, duration: 100 });
|
||
|
main_intro.start();
|
||
|
});
|
||
|
|
||
|
current = true;
|
||
|
},
|
||
|
o: function outro(local) {
|
||
|
if (main_intro) main_intro.invalidate();
|
||
|
main_outro = create_out_transition(main, fade, { duration: 100 });
|
||
|
current = false;
|
||
|
},
|
||
|
d: function destroy(detaching) {
|
||
|
if (detaching) detach_dev(main);
|
||
|
if (detaching && main_outro) main_outro.end();
|
||
|
}
|
||
|
};
|
||
|
|
||
|
dispatch_dev("SvelteRegisterBlock", {
|
||
|
block,
|
||
|
id: create_fragment$2.name,
|
||
|
type: "component",
|
||
|
source: "",
|
||
|
ctx
|
||
|
});
|
||
|
|
||
|
return block;
|
||
|
}
|
||
|
|
||
|
function instance$2($$self, $$props, $$invalidate) {
|
||
|
let { $$slots: slots = {}, $$scope } = $$props;
|
||
|
validate_slots("Businesses", slots, []);
|
||
|
const writable_props = [];
|
||
|
|
||
|
Object.keys($$props).forEach(key => {
|
||
|
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(`<Businesses> was created with unknown prop '${key}'`);
|
||
|
});
|
||
|
|
||
|
$$self.$capture_state = () => ({ fade, link });
|
||
|
return [];
|
||
|
}
|
||
|
|
||
|
class Businesses extends SvelteComponentDev {
|
||
|
constructor(options) {
|
||
|
super(options);
|
||
|
init(this, options, instance$2, create_fragment$2, safe_not_equal, {});
|
||
|
|
||
|
dispatch_dev("SvelteRegisterComponent", {
|
||
|
component: this,
|
||
|
tagName: "Businesses",
|
||
|
options,
|
||
|
id: create_fragment$2.name
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* src/pages/Business.svelte generated by Svelte v3.37.0 */
|
||
|
const file$1 = "src/pages/Business.svelte";
|
||
|
|
||
|
function create_fragment$1(ctx) {
|
||
|
let main;
|
||
|
let div1;
|
||
|
let img;
|
||
|
let img_src_value;
|
||
|
let t0;
|
||
|
let div0;
|
||
|
let h40;
|
||
|
let t2;
|
||
|
let p0;
|
||
|
let t4;
|
||
|
let h41;
|
||
|
let t6;
|
||
|
let p1;
|
||
|
let t8;
|
||
|
let h42;
|
||
|
let t10;
|
||
|
let p2;
|
||
|
let t12;
|
||
|
let h43;
|
||
|
let t14;
|
||
|
let p3;
|
||
|
let t16;
|
||
|
let h44;
|
||
|
let t18;
|
||
|
let p4;
|
||
|
let t20;
|
||
|
let h45;
|
||
|
let t22;
|
||
|
let p5;
|
||
|
let main_intro;
|
||
|
let main_outro;
|
||
|
let current;
|
||
|
|
||
|
const block = {
|
||
|
c: function create() {
|
||
|
main = element("main");
|
||
|
div1 = element("div");
|
||
|
img = element("img");
|
||
|
t0 = space();
|
||
|
div0 = element("div");
|
||
|
h40 = element("h4");
|
||
|
h40.textContent = "Business Name";
|
||
|
t2 = space();
|
||
|
p0 = element("p");
|
||
|
p0.textContent = "Some Name";
|
||
|
t4 = space();
|
||
|
h41 = element("h4");
|
||
|
h41.textContent = "Business Name";
|
||
|
t6 = space();
|
||
|
p1 = element("p");
|
||
|
p1.textContent = "Some Name";
|
||
|
t8 = space();
|
||
|
h42 = element("h4");
|
||
|
h42.textContent = "Business Name";
|
||
|
t10 = space();
|
||
|
p2 = element("p");
|
||
|
p2.textContent = "Some Name";
|
||
|
t12 = space();
|
||
|
h43 = element("h4");
|
||
|
h43.textContent = "Business Name";
|
||
|
t14 = space();
|
||
|
p3 = element("p");
|
||
|
p3.textContent = "Some Name";
|
||
|
t16 = space();
|
||
|
h44 = element("h4");
|
||
|
h44.textContent = "Business Name";
|
||
|
t18 = space();
|
||
|
p4 = element("p");
|
||
|
p4.textContent = "Some Name";
|
||
|
t20 = space();
|
||
|
h45 = element("h4");
|
||
|
h45.textContent = "Business Name";
|
||
|
t22 = space();
|
||
|
p5 = element("p");
|
||
|
p5.textContent = "Some Name";
|
||
|
if (img.src !== (img_src_value = "https://picsum.photos/720/720")) attr_dev(img, "src", img_src_value);
|
||
|
attr_dev(img, "class", "md:max-w-[60%] xl:max-w-[75%]");
|
||
|
attr_dev(img, "alt", "");
|
||
|
add_location(img, file$1, 7, 4, 256);
|
||
|
attr_dev(h40, "class", "svelte-1gpg6ji");
|
||
|
add_location(h40, file$1, 9, 6, 374);
|
||
|
attr_dev(p0, "class", "svelte-1gpg6ji");
|
||
|
add_location(p0, file$1, 10, 6, 403);
|
||
|
attr_dev(h41, "class", "svelte-1gpg6ji");
|
||
|
add_location(h41, file$1, 11, 6, 426);
|
||
|
attr_dev(p1, "class", "svelte-1gpg6ji");
|
||
|
add_location(p1, file$1, 12, 6, 455);
|
||
|
attr_dev(h42, "class", "svelte-1gpg6ji");
|
||
|
add_location(h42, file$1, 13, 6, 478);
|
||
|
attr_dev(p2, "class", "svelte-1gpg6ji");
|
||
|
add_location(p2, file$1, 14, 6, 507);
|
||
|
attr_dev(h43, "class", "svelte-1gpg6ji");
|
||
|
add_location(h43, file$1, 15, 6, 530);
|
||
|
attr_dev(p3, "class", "svelte-1gpg6ji");
|
||
|
add_location(p3, file$1, 16, 6, 559);
|
||
|
attr_dev(h44, "class", "svelte-1gpg6ji");
|
||
|
add_location(h44, file$1, 17, 6, 582);
|
||
|
attr_dev(p4, "class", "svelte-1gpg6ji");
|
||
|
add_location(p4, file$1, 18, 6, 611);
|
||
|
attr_dev(h45, "class", "svelte-1gpg6ji");
|
||
|
add_location(h45, file$1, 19, 6, 634);
|
||
|
attr_dev(p5, "class", "svelte-1gpg6ji");
|
||
|
add_location(p5, file$1, 20, 6, 663);
|
||
|
attr_dev(div0, "class", "flex-1");
|
||
|
add_location(div0, file$1, 8, 4, 347);
|
||
|
attr_dev(div1, "class", "flex flex-col md:flex-row gap-10");
|
||
|
add_location(div1, file$1, 6, 2, 205);
|
||
|
attr_dev(main, "class", "max-w-6xl mx-auto svelte-1gpg6ji");
|
||
|
add_location(main, file$1, 5, 0, 101);
|
||
|
},
|
||
|
l: function claim(nodes) {
|
||
|
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
|
||
|
},
|
||
|
m: function mount(target, anchor) {
|
||
|
insert_dev(target, main, anchor);
|
||
|
append_dev(main, div1);
|
||
|
append_dev(div1, img);
|
||
|
append_dev(div1, t0);
|
||
|
append_dev(div1, div0);
|
||
|
append_dev(div0, h40);
|
||
|
append_dev(div0, t2);
|
||
|
append_dev(div0, p0);
|
||
|
append_dev(div0, t4);
|
||
|
append_dev(div0, h41);
|
||
|
append_dev(div0, t6);
|
||
|
append_dev(div0, p1);
|
||
|
append_dev(div0, t8);
|
||
|
append_dev(div0, h42);
|
||
|
append_dev(div0, t10);
|
||
|
append_dev(div0, p2);
|
||
|
append_dev(div0, t12);
|
||
|
append_dev(div0, h43);
|
||
|
append_dev(div0, t14);
|
||
|
append_dev(div0, p3);
|
||
|
append_dev(div0, t16);
|
||
|
append_dev(div0, h44);
|
||
|
append_dev(div0, t18);
|
||
|
append_dev(div0, p4);
|
||
|
append_dev(div0, t20);
|
||
|
append_dev(div0, h45);
|
||
|
append_dev(div0, t22);
|
||
|
append_dev(div0, p5);
|
||
|
current = true;
|
||
|
},
|
||
|
p: noop,
|
||
|
i: function intro(local) {
|
||
|
if (current) return;
|
||
|
|
||
|
add_render_callback(() => {
|
||
|
if (main_outro) main_outro.end(1);
|
||
|
if (!main_intro) main_intro = create_in_transition(main, fade, { delay: 120, duration: 100 });
|
||
|
main_intro.start();
|
||
|
});
|
||
|
|
||
|
current = true;
|
||
|
},
|
||
|
o: function outro(local) {
|
||
|
if (main_intro) main_intro.invalidate();
|
||
|
main_outro = create_out_transition(main, fade, { duration: 100 });
|
||
|
current = false;
|
||
|
},
|
||
|
d: function destroy(detaching) {
|
||
|
if (detaching) detach_dev(main);
|
||
|
if (detaching && main_outro) main_outro.end();
|
||
|
}
|
||
|
};
|
||
|
|
||
|
dispatch_dev("SvelteRegisterBlock", {
|
||
|
block,
|
||
|
id: create_fragment$1.name,
|
||
|
type: "component",
|
||
|
source: "",
|
||
|
ctx
|
||
|
});
|
||
|
|
||
|
return block;
|
||
|
}
|
||
|
|
||
|
function instance$1($$self, $$props, $$invalidate) {
|
||
|
let { $$slots: slots = {}, $$scope } = $$props;
|
||
|
validate_slots("Business", slots, []);
|
||
|
const writable_props = [];
|
||
|
|
||
|
Object.keys($$props).forEach(key => {
|
||
|
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(`<Business> was created with unknown prop '${key}'`);
|
||
|
});
|
||
|
|
||
|
$$self.$capture_state = () => ({ fade, link });
|
||
|
return [];
|
||
|
}
|
||
|
|
||
|
class Business extends SvelteComponentDev {
|
||
|
constructor(options) {
|
||
|
super(options);
|
||
|
init(this, options, instance$1, create_fragment$1, safe_not_equal, {});
|
||
|
|
||
|
dispatch_dev("SvelteRegisterComponent", {
|
||
|
component: this,
|
||
|
tagName: "Business",
|
||
|
options,
|
||
|
id: create_fragment$1.name
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// Components
|
||
|
|
||
|
// Routes
|
||
|
var routes = {
|
||
|
'/': Home,
|
||
|
'/businesses': Businesses,
|
||
|
'/business': Business,
|
||
|
|
||
|
// TODO: add a not found page.
|
||
|
'*': Home,
|
||
|
};
|
||
|
|
||
|
/* src/App.svelte generated by Svelte v3.37.0 */
|
||
|
const file = "src/App.svelte";
|
||
|
|
||
|
function create_fragment(ctx) {
|
||
|
let main;
|
||
|
let navbar;
|
||
|
let t0;
|
||
|
let div;
|
||
|
let router;
|
||
|
let t1;
|
||
|
let footer;
|
||
|
let current;
|
||
|
navbar = new Navbar({ $$inline: true });
|
||
|
router = new Router({ props: { routes }, $$inline: true });
|
||
|
footer = new Footer({ $$inline: true });
|
||
|
|
||
|
const block = {
|
||
|
c: function create() {
|
||
|
main = element("main");
|
||
|
create_component(navbar.$$.fragment);
|
||
|
t0 = space();
|
||
|
div = element("div");
|
||
|
create_component(router.$$.fragment);
|
||
|
t1 = space();
|
||
|
create_component(footer.$$.fragment);
|
||
|
attr_dev(div, "class", "container mx-auto px-2 py-8");
|
||
|
add_location(div, file, 9, 1, 249);
|
||
|
attr_dev(main, "class", "p-0 lg:p-4 bg-gray-200 min-h-screen");
|
||
|
add_location(main, file, 7, 0, 185);
|
||
|
},
|
||
|
l: function claim(nodes) {
|
||
|
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
|
||
|
},
|
||
|
m: function mount(target, anchor) {
|
||
|
insert_dev(target, main, anchor);
|
||
|
mount_component(navbar, main, null);
|
||
|
append_dev(main, t0);
|
||
|
append_dev(main, div);
|
||
|
mount_component(router, div, null);
|
||
|
append_dev(main, t1);
|
||
|
mount_component(footer, main, null);
|
||
|
current = true;
|
||
|
},
|
||
|
p: noop,
|
||
|
i: function intro(local) {
|
||
|
if (current) return;
|
||
|
transition_in(navbar.$$.fragment, local);
|
||
|
transition_in(router.$$.fragment, local);
|
||
|
transition_in(footer.$$.fragment, local);
|
||
|
current = true;
|
||
|
},
|
||
|
o: function outro(local) {
|
||
|
transition_out(navbar.$$.fragment, local);
|
||
|
transition_out(router.$$.fragment, local);
|
||
|
transition_out(footer.$$.fragment, local);
|
||
|
current = false;
|
||
|
},
|
||
|
d: function destroy(detaching) {
|
||
|
if (detaching) detach_dev(main);
|
||
|
destroy_component(navbar);
|
||
|
destroy_component(router);
|
||
|
destroy_component(footer);
|
||
|
}
|
||
|
};
|
||
|
|
||
|
dispatch_dev("SvelteRegisterBlock", {
|
||
|
block,
|
||
|
id: create_fragment.name,
|
||
|
type: "component",
|
||
|
source: "",
|
||
|
ctx
|
||
|
});
|
||
|
|
||
|
return block;
|
||
|
}
|
||
|
|
||
|
function instance($$self, $$props, $$invalidate) {
|
||
|
let { $$slots: slots = {}, $$scope } = $$props;
|
||
|
validate_slots("App", slots, []);
|
||
|
const writable_props = [];
|
||
|
|
||
|
Object.keys($$props).forEach(key => {
|
||
|
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(`<App> was created with unknown prop '${key}'`);
|
||
|
});
|
||
|
|
||
|
$$self.$capture_state = () => ({ Navbar, Footer, Router, routes });
|
||
|
return [];
|
||
|
}
|
||
|
|
||
|
class App extends SvelteComponentDev {
|
||
|
constructor(options) {
|
||
|
super(options);
|
||
|
init(this, options, instance, create_fragment, safe_not_equal, {});
|
||
|
|
||
|
dispatch_dev("SvelteRegisterComponent", {
|
||
|
component: this,
|
||
|
tagName: "App",
|
||
|
options,
|
||
|
id: create_fragment.name
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
|
||
|
const app = new App({
|
||
|
target: document.body
|
||
|
});
|
||
|
|
||
|
return app;
|
||
|
|
||
|
}());
|
||
|
//# sourceMappingURL=bundle.js.map
|