Interim update
This commit is contained in:
229
Server/public/js/components/auth-component.js
Normal file
229
Server/public/js/components/auth-component.js
Normal file
@@ -0,0 +1,229 @@
|
||||
|
||||
(function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
|
||||
import { S as SvelteElement, i as init, a as attribute_to_object, b as insert_dev, s as safe_not_equal, d as dispatch_dev, v as validate_slots, c as setContext, o as onMount, g as getContext, e as globals, f as element, h as space, n as noop, j as add_location, k as attr_dev, l as append_dev, m as listen_dev, p as detach_dev, r as run_all, q as binding_callbacks } from './index-998178c7.js';
|
||||
import { sendText } from '../../../../../../../../../js/libraries/serverTools.js';
|
||||
import * as AuthTools from '../../../../../../../../../js/libraries/authTools.js';
|
||||
import '../../../../../../../../../js/components/login-component.js';
|
||||
import '../../../../../../../../../js/components/signup-component.js';
|
||||
|
||||
/* src\auth\auth-component.svelte generated by Svelte v3.52.0 */
|
||||
|
||||
const { console: console_1 } = globals;
|
||||
const file = "src\\auth\\auth-component.svelte";
|
||||
|
||||
function create_fragment(ctx) {
|
||||
let div2;
|
||||
let div0;
|
||||
let login_component;
|
||||
let t0;
|
||||
let signup_component;
|
||||
let t1;
|
||||
let div1;
|
||||
let span;
|
||||
let mounted;
|
||||
let dispose;
|
||||
|
||||
const block = {
|
||||
c: function create() {
|
||||
div2 = element("div");
|
||||
div0 = element("div");
|
||||
login_component = element("login-component");
|
||||
t0 = space();
|
||||
signup_component = element("signup-component");
|
||||
t1 = space();
|
||||
div1 = element("div");
|
||||
span = element("span");
|
||||
span.textContent = "OR";
|
||||
this.c = noop;
|
||||
add_location(login_component, file, 59, 8, 1652);
|
||||
add_location(signup_component, file, 60, 8, 1791);
|
||||
attr_dev(div0, "id", "auth-grid-group");
|
||||
add_location(div0, file, 58, 4, 1616);
|
||||
add_location(span, file, 63, 8, 1983);
|
||||
attr_dev(div1, "id", "auth-or");
|
||||
attr_dev(div1, "class", "pane");
|
||||
add_location(div1, file, 62, 4, 1942);
|
||||
attr_dev(div2, "id", "auth-group");
|
||||
add_location(div2, file, 57, 0, 1589);
|
||||
},
|
||||
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, div2, anchor);
|
||||
append_dev(div2, div0);
|
||||
append_dev(div0, login_component);
|
||||
/*login_component_binding*/ ctx[3](login_component);
|
||||
append_dev(div0, t0);
|
||||
append_dev(div0, signup_component);
|
||||
/*signup_component_binding*/ ctx[5](signup_component);
|
||||
append_dev(div2, t1);
|
||||
append_dev(div2, div1);
|
||||
append_dev(div1, span);
|
||||
|
||||
if (!mounted) {
|
||||
dispose = [
|
||||
listen_dev(login_component, "click", /*click_handler*/ ctx[4], false, false, false),
|
||||
listen_dev(login_component, "keydown", keydown_handler, false, false, false),
|
||||
listen_dev(signup_component, "click", /*click_handler_1*/ ctx[6], false, false, false),
|
||||
listen_dev(signup_component, "keydown", keydown_handler_1, false, false, false)
|
||||
];
|
||||
|
||||
mounted = true;
|
||||
}
|
||||
},
|
||||
p: noop,
|
||||
i: noop,
|
||||
o: noop,
|
||||
d: function destroy(detaching) {
|
||||
if (detaching) detach_dev(div2);
|
||||
/*login_component_binding*/ ctx[3](null);
|
||||
/*signup_component_binding*/ ctx[5](null);
|
||||
mounted = false;
|
||||
run_all(dispose);
|
||||
}
|
||||
};
|
||||
|
||||
dispatch_dev("SvelteRegisterBlock", {
|
||||
block,
|
||||
id: create_fragment.name,
|
||||
type: "component",
|
||||
source: "",
|
||||
ctx
|
||||
});
|
||||
|
||||
return block;
|
||||
}
|
||||
|
||||
const keydown_handler = () => "";
|
||||
const keydown_handler_1 = () => "";
|
||||
|
||||
function instance($$self, $$props, $$invalidate) {
|
||||
let { $$slots: slots = {}, $$scope } = $$props;
|
||||
validate_slots('auth-component', slots, []);
|
||||
AuthTools.redirectLogged();
|
||||
let loginComponent;
|
||||
let signupComponent;
|
||||
let context = { googleInit: false };
|
||||
setContext("auth", context);
|
||||
|
||||
function switchFocus(component) {
|
||||
if (component == loginComponent) {
|
||||
$$invalidate(0, loginComponent.focused = true, loginComponent);
|
||||
$$invalidate(1, signupComponent.focused = false, signupComponent);
|
||||
} else {
|
||||
$$invalidate(0, loginComponent.focused = false, loginComponent);
|
||||
$$invalidate(1, signupComponent.focused = true, signupComponent);
|
||||
}
|
||||
}
|
||||
|
||||
function callbackGoogle(data) {
|
||||
console.log(data);
|
||||
sendText("/signup-google", data.credential, response => AuthTools.processLoginResponse(response, context.msgs, context.remember.checked));
|
||||
}
|
||||
|
||||
function initGoogle() {
|
||||
if (typeof google != 'undefined') {
|
||||
google.accounts.id.initialize({
|
||||
client_id: '93612176787-sr8qjqem4e3kok4msrnj8s1illt85a9g.apps.googleusercontent.com',
|
||||
callback: callbackGoogle,
|
||||
auto_select: true,
|
||||
context: "signin"
|
||||
});
|
||||
|
||||
context.googleInit = true;
|
||||
} else {
|
||||
setTimeout(initGoogle, 100);
|
||||
}
|
||||
}
|
||||
|
||||
initGoogle();
|
||||
const writable_props = [];
|
||||
|
||||
Object.keys($$props).forEach(key => {
|
||||
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console_1.warn(`<auth-component> was created with unknown prop '${key}'`);
|
||||
});
|
||||
|
||||
function login_component_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
loginComponent = $$value;
|
||||
$$invalidate(0, loginComponent);
|
||||
});
|
||||
}
|
||||
|
||||
const click_handler = () => switchFocus(loginComponent);
|
||||
|
||||
function signup_component_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
signupComponent = $$value;
|
||||
$$invalidate(1, signupComponent);
|
||||
});
|
||||
}
|
||||
|
||||
const click_handler_1 = () => switchFocus(signupComponent);
|
||||
|
||||
$$self.$capture_state = () => ({
|
||||
onMount,
|
||||
setContext,
|
||||
getContext,
|
||||
sendText,
|
||||
AuthTools,
|
||||
loginComponent,
|
||||
signupComponent,
|
||||
context,
|
||||
switchFocus,
|
||||
callbackGoogle,
|
||||
initGoogle
|
||||
});
|
||||
|
||||
$$self.$inject_state = $$props => {
|
||||
if ('loginComponent' in $$props) $$invalidate(0, loginComponent = $$props.loginComponent);
|
||||
if ('signupComponent' in $$props) $$invalidate(1, signupComponent = $$props.signupComponent);
|
||||
if ('context' in $$props) context = $$props.context;
|
||||
};
|
||||
|
||||
if ($$props && "$$inject" in $$props) {
|
||||
$$self.$inject_state($$props.$$inject);
|
||||
}
|
||||
|
||||
return [
|
||||
loginComponent,
|
||||
signupComponent,
|
||||
switchFocus,
|
||||
login_component_binding,
|
||||
click_handler,
|
||||
signup_component_binding,
|
||||
click_handler_1
|
||||
];
|
||||
}
|
||||
|
||||
class Auth_component extends SvelteElement {
|
||||
constructor(options) {
|
||||
super();
|
||||
this.shadowRoot.innerHTML = `<style>@import '/css/common.css';span{font-size:1.4rem;font-family:var(--sans-serif,sans-serif)}#auth-group{margin:auto;width:auto;margin-bottom:3rem}#auth-grid-group{display:grid;grid-template-columns:30rem 30rem;justify-content:center;gap:1.37rem;width:100%}#auth-or{display:flex;position:absolute;margin:auto;top:40%;left:50%;transform:translate(-50%, -50%);width:5.4rem;height:5.4rem;border-radius:6.8rem;background-color:white;align-items:center;justify-content:center;font-family:var(--sans-serif,sans-serif);font-weight:500}@media only screen and (max-width: 1200px){#auth-grid-group{display:grid;grid-template-columns:30rem;grid-template-rows:auto auto;justify-content:center;gap:1.37rem;width:100%}#auth-or{top:46.4rem}#auth-group{margin-top:2rem;margin-bottom:3rem}}</style>`;
|
||||
|
||||
init(
|
||||
this,
|
||||
{
|
||||
target: this.shadowRoot,
|
||||
props: attribute_to_object(this.attributes),
|
||||
customElement: true
|
||||
},
|
||||
instance,
|
||||
create_fragment,
|
||||
safe_not_equal,
|
||||
{},
|
||||
null
|
||||
);
|
||||
|
||||
if (options) {
|
||||
if (options.target) {
|
||||
insert_dev(options.target, this, options.anchor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define("auth-component", Auth_component);
|
||||
|
||||
export { Auth_component as default };
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
361
Server/public/js/components/confirmation-component.js
Normal file
361
Server/public/js/components/confirmation-component.js
Normal file
@@ -0,0 +1,361 @@
|
||||
|
||||
(function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
|
||||
import { S as SvelteElement, i as init, a as attribute_to_object, b as insert_dev, s as safe_not_equal, d as dispatch_dev, v as validate_slots, o as onMount, f as element, h as space, n as noop, k as attr_dev, j as add_location, l as append_dev, m as listen_dev, p as detach_dev, r as run_all, q as binding_callbacks } from './index-998178c7.js';
|
||||
import * as AuthTools from '../../../../../../../../../js/libraries/authTools.js';
|
||||
|
||||
/* src\auth\confirmation-component.svelte generated by Svelte v3.52.0 */
|
||||
const file = "src\\auth\\confirmation-component.svelte";
|
||||
|
||||
function create_fragment(ctx) {
|
||||
let div1;
|
||||
let h2;
|
||||
let t1;
|
||||
let div0;
|
||||
let input0;
|
||||
let span0;
|
||||
let t3;
|
||||
let input1;
|
||||
let span1;
|
||||
let t5;
|
||||
let input2;
|
||||
let span2;
|
||||
let t7;
|
||||
let input3;
|
||||
let span3;
|
||||
let t9;
|
||||
let input4;
|
||||
let t10;
|
||||
let span4;
|
||||
let t11;
|
||||
let button;
|
||||
let mounted;
|
||||
let dispose;
|
||||
|
||||
const block = {
|
||||
c: function create() {
|
||||
div1 = element("div");
|
||||
h2 = element("h2");
|
||||
h2.textContent = "CONFIRMATION CODE";
|
||||
t1 = space();
|
||||
div0 = element("div");
|
||||
input0 = element("input");
|
||||
span0 = element("span");
|
||||
span0.textContent = "-";
|
||||
t3 = space();
|
||||
input1 = element("input");
|
||||
span1 = element("span");
|
||||
span1.textContent = "-";
|
||||
t5 = space();
|
||||
input2 = element("input");
|
||||
span2 = element("span");
|
||||
span2.textContent = "-";
|
||||
t7 = space();
|
||||
input3 = element("input");
|
||||
span3 = element("span");
|
||||
span3.textContent = "-";
|
||||
t9 = space();
|
||||
input4 = element("input");
|
||||
t10 = space();
|
||||
span4 = element("span");
|
||||
t11 = space();
|
||||
button = element("button");
|
||||
button.textContent = "Confirm";
|
||||
this.c = noop;
|
||||
attr_dev(h2, "class", "auth-title title-highlight");
|
||||
add_location(h2, file, 55, 4, 1288);
|
||||
attr_dev(input0, "class", "authConfirmationInput");
|
||||
attr_dev(input0, "type", "text");
|
||||
attr_dev(input0, "maxlength", "1");
|
||||
add_location(input0, file, 57, 8, 1394);
|
||||
attr_dev(span0, "class", "dash");
|
||||
add_location(span0, file, 57, 146, 1532);
|
||||
attr_dev(input1, "class", "authConfirmationInput");
|
||||
attr_dev(input1, "type", "text");
|
||||
attr_dev(input1, "maxlength", "1");
|
||||
add_location(input1, file, 58, 8, 1569);
|
||||
attr_dev(span1, "class", "dash");
|
||||
add_location(span1, file, 58, 146, 1707);
|
||||
attr_dev(input2, "class", "authConfirmationInput");
|
||||
attr_dev(input2, "type", "text");
|
||||
attr_dev(input2, "maxlength", "1");
|
||||
add_location(input2, file, 59, 8, 1744);
|
||||
attr_dev(span2, "class", "dash");
|
||||
add_location(span2, file, 59, 146, 1882);
|
||||
attr_dev(input3, "class", "authConfirmationInput");
|
||||
attr_dev(input3, "type", "text");
|
||||
attr_dev(input3, "maxlength", "1");
|
||||
add_location(input3, file, 60, 8, 1919);
|
||||
attr_dev(span3, "class", "dash");
|
||||
add_location(span3, file, 60, 146, 2057);
|
||||
attr_dev(input4, "class", "authConfirmationInput");
|
||||
attr_dev(input4, "type", "text");
|
||||
attr_dev(input4, "maxlength", "1");
|
||||
add_location(input4, file, 61, 8, 2094);
|
||||
attr_dev(div0, "id", "confirmationInputs");
|
||||
add_location(div0, file, 56, 4, 1355);
|
||||
attr_dev(span4, "id", "confirmation-msg");
|
||||
add_location(span4, file, 63, 4, 2250);
|
||||
attr_dev(button, "class", "auth-button");
|
||||
add_location(button, file, 64, 4, 2319);
|
||||
attr_dev(div1, "class", "pane auth-pane");
|
||||
add_location(div1, file, 54, 0, 1254);
|
||||
},
|
||||
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, div1, anchor);
|
||||
append_dev(div1, h2);
|
||||
append_dev(div1, t1);
|
||||
append_dev(div1, div0);
|
||||
append_dev(div0, input0);
|
||||
/*input0_binding*/ ctx[6](input0);
|
||||
append_dev(div0, span0);
|
||||
append_dev(div0, t3);
|
||||
append_dev(div0, input1);
|
||||
/*input1_binding*/ ctx[8](input1);
|
||||
append_dev(div0, span1);
|
||||
append_dev(div0, t5);
|
||||
append_dev(div0, input2);
|
||||
/*input2_binding*/ ctx[10](input2);
|
||||
append_dev(div0, span2);
|
||||
append_dev(div0, t7);
|
||||
append_dev(div0, input3);
|
||||
/*input3_binding*/ ctx[12](input3);
|
||||
append_dev(div0, span3);
|
||||
append_dev(div0, t9);
|
||||
append_dev(div0, input4);
|
||||
/*input4_binding*/ ctx[14](input4);
|
||||
append_dev(div1, t10);
|
||||
append_dev(div1, span4);
|
||||
/*span4_binding*/ ctx[16](span4);
|
||||
append_dev(div1, t11);
|
||||
append_dev(div1, button);
|
||||
/*button_binding*/ ctx[17](button);
|
||||
|
||||
if (!mounted) {
|
||||
dispose = [
|
||||
listen_dev(input0, "input", /*input_handler*/ ctx[7], false, false, false),
|
||||
listen_dev(input1, "input", /*input_handler_1*/ ctx[9], false, false, false),
|
||||
listen_dev(input2, "input", /*input_handler_2*/ ctx[11], false, false, false),
|
||||
listen_dev(input3, "input", /*input_handler_3*/ ctx[13], false, false, false),
|
||||
listen_dev(input4, "input", /*input_handler_4*/ ctx[15], false, false, false),
|
||||
listen_dev(button, "click", /*click_handler*/ ctx[18], false, false, false)
|
||||
];
|
||||
|
||||
mounted = true;
|
||||
}
|
||||
},
|
||||
p: noop,
|
||||
i: noop,
|
||||
o: noop,
|
||||
d: function destroy(detaching) {
|
||||
if (detaching) detach_dev(div1);
|
||||
/*input0_binding*/ ctx[6](null);
|
||||
/*input1_binding*/ ctx[8](null);
|
||||
/*input2_binding*/ ctx[10](null);
|
||||
/*input3_binding*/ ctx[12](null);
|
||||
/*input4_binding*/ ctx[14](null);
|
||||
/*span4_binding*/ ctx[16](null);
|
||||
/*button_binding*/ ctx[17](null);
|
||||
mounted = false;
|
||||
run_all(dispose);
|
||||
}
|
||||
};
|
||||
|
||||
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('confirmation-component', slots, []);
|
||||
let confirmationInputs = [];
|
||||
let confirmationMsg;
|
||||
let confirmationButton;
|
||||
|
||||
function onlyNumberKey(ind, evt) {
|
||||
// Only ASCII character in that range allowed
|
||||
var value = evt.data;
|
||||
|
||||
if (value in ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]) {
|
||||
if (ind < 4) {
|
||||
confirmationInputs[ind + 1].focus();
|
||||
} else {
|
||||
AuthTools.confirmEmail(confirmationMsg, getCode(), callback);
|
||||
}
|
||||
} else {
|
||||
$$invalidate(0, confirmationInputs[ind].value = "", confirmationInputs);
|
||||
}
|
||||
}
|
||||
|
||||
function getCode() {
|
||||
let code = "";
|
||||
|
||||
for (let input of confirmationInputs) {
|
||||
code += input.value;
|
||||
}
|
||||
|
||||
return parseInt(code);
|
||||
}
|
||||
|
||||
function callback(response) {
|
||||
if (response == "true") {
|
||||
AuthTools.toDashboard();
|
||||
} else {
|
||||
$$invalidate(1, confirmationMsg.innerHTML = "Wrong code", confirmationMsg);
|
||||
}
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
|
||||
});
|
||||
|
||||
const writable_props = [];
|
||||
|
||||
Object.keys($$props).forEach(key => {
|
||||
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(`<confirmation-component> was created with unknown prop '${key}'`);
|
||||
});
|
||||
|
||||
function input0_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
confirmationInputs[0] = $$value;
|
||||
$$invalidate(0, confirmationInputs);
|
||||
});
|
||||
}
|
||||
|
||||
const input_handler = evt => onlyNumberKey(0, evt);
|
||||
|
||||
function input1_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
confirmationInputs[1] = $$value;
|
||||
$$invalidate(0, confirmationInputs);
|
||||
});
|
||||
}
|
||||
|
||||
const input_handler_1 = evt => onlyNumberKey(1, evt);
|
||||
|
||||
function input2_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
confirmationInputs[2] = $$value;
|
||||
$$invalidate(0, confirmationInputs);
|
||||
});
|
||||
}
|
||||
|
||||
const input_handler_2 = evt => onlyNumberKey(2, evt);
|
||||
|
||||
function input3_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
confirmationInputs[3] = $$value;
|
||||
$$invalidate(0, confirmationInputs);
|
||||
});
|
||||
}
|
||||
|
||||
const input_handler_3 = evt => onlyNumberKey(3, evt);
|
||||
|
||||
function input4_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
confirmationInputs[4] = $$value;
|
||||
$$invalidate(0, confirmationInputs);
|
||||
});
|
||||
}
|
||||
|
||||
const input_handler_4 = evt => onlyNumberKey(4, evt);
|
||||
|
||||
function span4_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
confirmationMsg = $$value;
|
||||
$$invalidate(1, confirmationMsg);
|
||||
});
|
||||
}
|
||||
|
||||
function button_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
confirmationButton = $$value;
|
||||
$$invalidate(2, confirmationButton);
|
||||
});
|
||||
}
|
||||
|
||||
const click_handler = () => AuthTools.confirmEmail(confirmationMsg, getCode(), callback);
|
||||
|
||||
$$self.$capture_state = () => ({
|
||||
onMount,
|
||||
AuthTools,
|
||||
confirmationInputs,
|
||||
confirmationMsg,
|
||||
confirmationButton,
|
||||
onlyNumberKey,
|
||||
getCode,
|
||||
callback
|
||||
});
|
||||
|
||||
$$self.$inject_state = $$props => {
|
||||
if ('confirmationInputs' in $$props) $$invalidate(0, confirmationInputs = $$props.confirmationInputs);
|
||||
if ('confirmationMsg' in $$props) $$invalidate(1, confirmationMsg = $$props.confirmationMsg);
|
||||
if ('confirmationButton' in $$props) $$invalidate(2, confirmationButton = $$props.confirmationButton);
|
||||
};
|
||||
|
||||
if ($$props && "$$inject" in $$props) {
|
||||
$$self.$inject_state($$props.$$inject);
|
||||
}
|
||||
|
||||
return [
|
||||
confirmationInputs,
|
||||
confirmationMsg,
|
||||
confirmationButton,
|
||||
onlyNumberKey,
|
||||
getCode,
|
||||
callback,
|
||||
input0_binding,
|
||||
input_handler,
|
||||
input1_binding,
|
||||
input_handler_1,
|
||||
input2_binding,
|
||||
input_handler_2,
|
||||
input3_binding,
|
||||
input_handler_3,
|
||||
input4_binding,
|
||||
input_handler_4,
|
||||
span4_binding,
|
||||
button_binding,
|
||||
click_handler
|
||||
];
|
||||
}
|
||||
|
||||
class Confirmation_component extends SvelteElement {
|
||||
constructor(options) {
|
||||
super();
|
||||
this.shadowRoot.innerHTML = `<style>@import '/css/common.css';.auth-pane{position:relative;padding:3.4rem;padding-top:5.5rem;padding-bottom:5.5rem;width:33rem;height:auto;margin:auto}.auth-title{position:relative;left:0.7rem;top:0.2rem;margin-bottom:1.4rem}.authConfirmationInput{position:relative;width:3.16rem;font-family:var(--serif,serif);font-size:3rem;border-radius:0.34rem;margin-bottom:0.7rem;text-align:center;padding-left:0;padding-bottom:0.3 rem}.dash{display:block;font-size:3rem;font-family:var(--serif,serif)}#confirmationInputs{margin:auto;display:grid;justify-content:space-between;grid-auto-flow:column}.auth-button{margin-top:1.4rem;height:3.4rem;width:100%;font-family:var(--sans-serif,sans-serif);font-size:1.6rem;color:white;background-color:var(--pink);border-color:var(--pink);border-radius:0.5rem;filter:drop-shadow(0.07rem 0.14rem 0.07rem rgb(0 0 0 / 0.4))}#confirmation-msg{display:inline;color:red}</style>`;
|
||||
|
||||
init(
|
||||
this,
|
||||
{
|
||||
target: this.shadowRoot,
|
||||
props: attribute_to_object(this.attributes),
|
||||
customElement: true
|
||||
},
|
||||
instance,
|
||||
create_fragment,
|
||||
safe_not_equal,
|
||||
{},
|
||||
null
|
||||
);
|
||||
|
||||
if (options) {
|
||||
if (options.target) {
|
||||
insert_dev(options.target, this, options.anchor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define("confirmation-component", Confirmation_component);
|
||||
|
||||
export { Confirmation_component as default };
|
@@ -1 +1,99 @@
|
||||
import{S as e,i as s,a as t,b as o,s as i,g as a,n as r,j as n,d as c,o as d}from"./index-8c09578c.js";function p(e){let s;return{c(){s=a("div"),s.innerHTML="<div><p>We use cookies to improve your experience, personalise your content and analyse site usage. By clicking “OK”, you agree to the use of cookies.</p></div>",this.c=r,n(s,"id","wrapper")},m(e,t){o(e,s,t)},p:r,i:r,o:r,d(e){e&&c(s)}}}function u(e){return d((()=>{})),[]}class h extends e{constructor(e){super(),this.shadowRoot.innerHTML="<style>@import '/css/common.css';#wrapper{display:none;position:relative;height:5rem;width:100%;background:white;box-shadow:0 0 0.314rem rgb(187, 187, 187);;}</style>",s(this,{target:this.shadowRoot,props:t(this.attributes),customElement:!0},u,p,i,{},null),e&&e.target&&o(e.target,this,e.anchor)}}customElements.define("cookies-dialog",h);export{h as default};
|
||||
|
||||
(function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
|
||||
import { S as SvelteElement, i as init, a as attribute_to_object, b as insert_dev, s as safe_not_equal, d as dispatch_dev, v as validate_slots, o as onMount, f as element, n as noop, j as add_location, k as attr_dev, l as append_dev, p as detach_dev } from './index-998178c7.js';
|
||||
|
||||
/* src\components\cookies-dialog.svelte generated by Svelte v3.52.0 */
|
||||
const file = "src\\components\\cookies-dialog.svelte";
|
||||
|
||||
function create_fragment(ctx) {
|
||||
let div1;
|
||||
let div0;
|
||||
let p;
|
||||
|
||||
const block = {
|
||||
c: function create() {
|
||||
div1 = element("div");
|
||||
div0 = element("div");
|
||||
p = element("p");
|
||||
p.textContent = "We use cookies to improve your experience, personalise your content and analyse site usage. By clicking “OK”, you agree to the use of cookies.";
|
||||
this.c = noop;
|
||||
add_location(p, file, 19, 8, 248);
|
||||
add_location(div0, file, 18, 4, 233);
|
||||
attr_dev(div1, "id", "wrapper");
|
||||
add_location(div1, file, 17, 0, 209);
|
||||
},
|
||||
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, div1, anchor);
|
||||
append_dev(div1, div0);
|
||||
append_dev(div0, p);
|
||||
},
|
||||
p: noop,
|
||||
i: noop,
|
||||
o: noop,
|
||||
d: function destroy(detaching) {
|
||||
if (detaching) detach_dev(div1);
|
||||
}
|
||||
};
|
||||
|
||||
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('cookies-dialog', slots, []);
|
||||
|
||||
onMount(() => {
|
||||
|
||||
});
|
||||
|
||||
const writable_props = [];
|
||||
|
||||
Object.keys($$props).forEach(key => {
|
||||
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(`<cookies-dialog> was created with unknown prop '${key}'`);
|
||||
});
|
||||
|
||||
$$self.$capture_state = () => ({ onMount });
|
||||
return [];
|
||||
}
|
||||
|
||||
class Cookies_dialog extends SvelteElement {
|
||||
constructor(options) {
|
||||
super();
|
||||
this.shadowRoot.innerHTML = `<style>@import '/css/common.css';#wrapper{display:none;position:relative;height:5rem;width:100%;background:white;box-shadow:0 0 0.314rem rgb(187, 187, 187);;}</style>`;
|
||||
|
||||
init(
|
||||
this,
|
||||
{
|
||||
target: this.shadowRoot,
|
||||
props: attribute_to_object(this.attributes),
|
||||
customElement: true
|
||||
},
|
||||
instance,
|
||||
create_fragment,
|
||||
safe_not_equal,
|
||||
{},
|
||||
null
|
||||
);
|
||||
|
||||
if (options) {
|
||||
if (options.target) {
|
||||
insert_dev(options.target, this, options.anchor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define("cookies-dialog", Cookies_dialog);
|
||||
|
||||
export { Cookies_dialog as default };
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1,347 @@
|
||||
import{S as t,i as e,a as o,b as r,s as a,e as i,n,d as s,c as m,g as c,t as f,h as d,j as l,w as g,m as p,p as h,q as u}from"./index-8c09578c.js";import{w}from"./index-77787e10.js";import{loadLocaleContent as b}from"../../../../../../../../../js/libraries/serverTools.js";function v(t){let e,o,a,i,n,m,w,b,v,k,y,x,L,j,z,U,_,C,T,B,H,M,R=t[1].contactUs+"",A=t[1].inviteLink+"",D=t[1].inviteLink+"";return{c(){e=c("footer"),o=c("div"),a=c("div"),i=c("div"),n=c("h2"),m=f(R),w=d(),b=c("p"),v=f("Discord: "),k=c("a"),y=f(A),x=d(),L=c("p"),j=f("WhatsApp: "),z=c("a"),U=f(D),_=d(),C=c("button"),C.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="42.545" height="72.601" viewBox="0 0 42.545 72.601"><g id="Group_268" data-name="Group 268" transform="translate(-6.177 -2.399)"><rect id="Rectangle_146" data-name="Rectangle 146" width="11" height="51" rx="5.5" transform="translate(22 24)" fill="#cb1816"></rect><path id="Path_1145" data-name="Path 1145" d="M23.814,4.021a5,5,0,0,1,7.372,0l16.134,17.6c2.94,3.207,1.046,10.4-3.686,8.379S28.02,14.081,28.391,13.524,16.544,27.976,11.366,30,4.741,24.828,7.68,21.621Z" fill="#DD1C1A"></path></g></svg>',T=d(),B=c("p"),B.innerHTML='Licensed under a Creative Commons <a href="https://creativecommons.org/licenses/by/4.0/legalcode " target="_blank" rel="noreferrer">CC BY 4.0 license</a>',l(k,"href","https://discord.gg/Qk8KUk787z"),l(k,"target","_blank"),l(k,"rel","noreferrer"),g(k,"margin-left","1.8rem"),l(z,"href","https://chat.whatsapp.com/BhnmUNljUxJ2AjeHUwyTKh"),l(z,"target","_blank"),l(z,"rel","noreferrer"),g(z,"margin-left","0.5rem"),l(i,"id","contact-us-container"),l(a,"id","footer-grid-content-container"),l(a,"class","logged"),l(C,"id","footer-up"),l(C,"aria-label","go up"),l(B,"id","footer-copyright"),l(o,"id","footer-content-container")},m(s,c){r(s,e,c),p(e,o),p(o,a),p(a,i),p(i,n),p(n,m),p(i,w),p(i,b),p(b,v),p(b,k),p(k,y),p(i,x),p(i,L),p(L,j),p(L,z),p(z,U),p(o,_),p(o,C),p(o,T),p(o,B),H||(M=h(C,"click",t[4]),H=!0)},p(t,e){2&e&&R!==(R=t[1].contactUs+"")&&u(m,R),2&e&&A!==(A=t[1].inviteLink+"")&&u(y,A),2&e&&D!==(D=t[1].inviteLink+"")&&u(U,D)},d(t){t&&s(e),H=!1,M()}}}function k(t){let e,o=2==t[0]&&v(t);return{c(){o&&o.c(),e=i()},m(t,a){o&&o.m(t,a),r(t,e,a)},p(t,r){2==t[0]?o?o.p(t,r):(o=v(t),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null)},d(t){o&&o.d(t),t&&s(e)}}}function y(t){let e,o=t[0],m=k(t);return{c(){m.c(),e=i(),this.c=n},m(t,o){m.m(t,o),r(t,e,o)},p(t,[r]){1&r&&a(o,o=t[0])?(m.d(1),m=k(t),m.c(),m.m(e.parentNode,e)):m.p(t,r)},i:n,o:n,d(t){t&&s(e),m.d(t)}}}function x(t,e,o){let r,a,i=w(0);m(t,i,(t=>o(0,r=t)));let n=w({});m(t,n,(t=>o(1,a=t))),b(n,"countries",i),b(n,"footer-component",i);return[r,a,i,n,()=>{location.href="#"}]}class L extends t{constructor(t){super(),this.shadowRoot.innerHTML="<style>@import '/css/common.css';footer{position:relative;bottom:0;width:100%;height:auto;background:#5B6970;border-top:#cb1816 solid 0.5rem}footer p,footer a{font-family:var(--sans-serif)}#footer-content-container{position:relative;margin:auto;padding-top:2rem;max-width:116rem;width:97vw}#footer-grid-content-container{display:grid;margin-left:2rem;margin-right:2rem;margin-bottom:1rem}.logged{grid-template-columns:auto auto 2rem}footer h2{color:#ffffff;font-size:1.3rem;margin-bottom:0.5rem}#footer-copyright{position:relative;margin:auto;width:100%;bottom:0rem;height:3rem;top:0rem;margin-bottom:0;font-size:1rem;text-align:center}#footer-copyright *{font-size:1rem}footer a{font-size:1.1rem;color:#ffffff}footer p{display:block;font-size:1.1rem;color:#d8d8d8;font-family:var(--sans-serif,sans-serif);margin-bottom:0.5rem}#contact-us-container{width:16rem}#footer-up{position:absolute;width:4.8rem;height:4.8rem;border-radius:3.4rem;top:4rem;right:2rem;background:#ffffff}#footer-up svg{width:40%;height:auto}@media only screen and (max-width: 1170px){.logged{grid-template-rows:auto auto auto;grid-template-columns:auto;row-gap:2rem}#footer-copyright{height:1rem;top:-2rem}}</style>",e(this,{target:this.shadowRoot,props:o(this.attributes),customElement:!0},x,y,a,{},null),t&&t.target&&r(t.target,this,t.anchor)}}customElements.define("footer-component",L);export{L as default};
|
||||
|
||||
(function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
|
||||
import { S as SvelteElement, i as init, a as attribute_to_object, b as insert_dev, s as safe_not_equal, d as dispatch_dev, v as validate_slots, w as validate_store, x as component_subscribe, y as empty, n as noop, p as detach_dev, f as element, B as text, h as space, G as svg_element, j as add_location, k as attr_dev, F as set_style, l as append_dev, m as listen_dev, C as set_data_dev } from './index-998178c7.js';
|
||||
import { w as writable } from './index-f9998ce7.js';
|
||||
import { loadLocaleContent } from '../../../../../../../../../js/libraries/serverTools.js';
|
||||
|
||||
/* src\footer\footer-component.svelte generated by Svelte v3.52.0 */
|
||||
const file = "src\\footer\\footer-component.svelte";
|
||||
|
||||
// (21:4) {#if $loaded==2}
|
||||
function create_if_block(ctx) {
|
||||
let footer;
|
||||
let div2;
|
||||
let div1;
|
||||
let div0;
|
||||
let h2;
|
||||
let t0_value = /*$content*/ ctx[1].contactUs + "";
|
||||
let t0;
|
||||
let t1;
|
||||
let p0;
|
||||
let t2;
|
||||
let a0;
|
||||
let t3_value = /*$content*/ ctx[1].inviteLink + "";
|
||||
let t3;
|
||||
let t4;
|
||||
let p1;
|
||||
let t5;
|
||||
let a1;
|
||||
let t6_value = /*$content*/ ctx[1].inviteLink + "";
|
||||
let t6;
|
||||
let t7;
|
||||
let button;
|
||||
let svg;
|
||||
let g;
|
||||
let rect;
|
||||
let path;
|
||||
let t8;
|
||||
let p2;
|
||||
let t9;
|
||||
let a2;
|
||||
let mounted;
|
||||
let dispose;
|
||||
|
||||
const block = {
|
||||
c: function create() {
|
||||
footer = element("footer");
|
||||
div2 = element("div");
|
||||
div1 = element("div");
|
||||
div0 = element("div");
|
||||
h2 = element("h2");
|
||||
t0 = text(t0_value);
|
||||
t1 = space();
|
||||
p0 = element("p");
|
||||
t2 = text("Discord: ");
|
||||
a0 = element("a");
|
||||
t3 = text(t3_value);
|
||||
t4 = space();
|
||||
p1 = element("p");
|
||||
t5 = text("WhatsApp: ");
|
||||
a1 = element("a");
|
||||
t6 = text(t6_value);
|
||||
t7 = space();
|
||||
button = element("button");
|
||||
svg = svg_element("svg");
|
||||
g = svg_element("g");
|
||||
rect = svg_element("rect");
|
||||
path = svg_element("path");
|
||||
t8 = space();
|
||||
p2 = element("p");
|
||||
t9 = text("Licensed under a Creative Commons ");
|
||||
a2 = element("a");
|
||||
a2.textContent = "CC BY 4.0 license";
|
||||
add_location(h2, file, 25, 24, 692);
|
||||
attr_dev(a0, "href", "https://discord.gg/Qk8KUk787z");
|
||||
attr_dev(a0, "target", "_blank");
|
||||
attr_dev(a0, "rel", "noreferrer");
|
||||
set_style(a0, "margin-left", "1.8rem");
|
||||
add_location(a0, file, 27, 36, 858);
|
||||
add_location(p0, file, 27, 24, 846);
|
||||
attr_dev(a1, "href", "https://chat.whatsapp.com/BhnmUNljUxJ2AjeHUwyTKh");
|
||||
attr_dev(a1, "target", "_blank");
|
||||
attr_dev(a1, "rel", "noreferrer");
|
||||
set_style(a1, "margin-left", "0.5rem");
|
||||
add_location(a1, file, 28, 37, 1026);
|
||||
add_location(p1, file, 28, 24, 1013);
|
||||
attr_dev(div0, "id", "contact-us-container");
|
||||
add_location(div0, file, 24, 20, 635);
|
||||
attr_dev(div1, "id", "footer-grid-content-container");
|
||||
attr_dev(div1, "class", "logged");
|
||||
add_location(div1, file, 23, 16, 558);
|
||||
attr_dev(rect, "id", "Rectangle_146");
|
||||
attr_dev(rect, "data-name", "Rectangle 146");
|
||||
attr_dev(rect, "width", "11");
|
||||
attr_dev(rect, "height", "51");
|
||||
attr_dev(rect, "rx", "5.5");
|
||||
attr_dev(rect, "transform", "translate(22 24)");
|
||||
attr_dev(rect, "fill", "var(--red)");
|
||||
add_location(rect, file, 34, 24, 1573);
|
||||
attr_dev(path, "id", "Path_1145");
|
||||
attr_dev(path, "data-name", "Path 1145");
|
||||
attr_dev(path, "d", "M23.814,4.021a5,5,0,0,1,7.372,0l16.134,17.6c2.94,3.207,1.046,10.4-3.686,8.379S28.02,14.081,28.391,13.524,16.544,27.976,11.366,30,4.741,24.828,7.68,21.621Z");
|
||||
attr_dev(path, "fill", "var(--red)");
|
||||
add_location(path, file, 35, 24, 1730);
|
||||
attr_dev(g, "id", "Group_268");
|
||||
attr_dev(g, "data-name", "Group 268");
|
||||
attr_dev(g, "transform", "translate(-6.177 -2.399)");
|
||||
add_location(g, file, 33, 24, 1470);
|
||||
attr_dev(svg, "xmlns", "http://www.w3.org/2000/svg");
|
||||
attr_dev(svg, "width", "42.545");
|
||||
attr_dev(svg, "height", "72.601");
|
||||
attr_dev(svg, "viewBox", "0 0 42.545 72.601");
|
||||
add_location(svg, file, 32, 20, 1345);
|
||||
attr_dev(button, "id", "footer-up");
|
||||
attr_dev(button, "aria-label", "go up");
|
||||
add_location(button, file, 31, 16, 1244);
|
||||
attr_dev(a2, "href", "https://creativecommons.org/licenses/by/4.0/legalcode ");
|
||||
attr_dev(a2, "target", "_blank");
|
||||
attr_dev(a2, "rel", "noreferrer");
|
||||
add_location(a2, file, 39, 75, 2143);
|
||||
attr_dev(p2, "id", "footer-copyright");
|
||||
add_location(p2, file, 39, 16, 2084);
|
||||
attr_dev(div2, "id", "footer-content-container");
|
||||
add_location(div2, file, 22, 12, 505);
|
||||
add_location(footer, file, 21, 8, 483);
|
||||
},
|
||||
m: function mount(target, anchor) {
|
||||
insert_dev(target, footer, anchor);
|
||||
append_dev(footer, div2);
|
||||
append_dev(div2, div1);
|
||||
append_dev(div1, div0);
|
||||
append_dev(div0, h2);
|
||||
append_dev(h2, t0);
|
||||
append_dev(div0, t1);
|
||||
append_dev(div0, p0);
|
||||
append_dev(p0, t2);
|
||||
append_dev(p0, a0);
|
||||
append_dev(a0, t3);
|
||||
append_dev(div0, t4);
|
||||
append_dev(div0, p1);
|
||||
append_dev(p1, t5);
|
||||
append_dev(p1, a1);
|
||||
append_dev(a1, t6);
|
||||
append_dev(div2, t7);
|
||||
append_dev(div2, button);
|
||||
append_dev(button, svg);
|
||||
append_dev(svg, g);
|
||||
append_dev(g, rect);
|
||||
append_dev(g, path);
|
||||
append_dev(div2, t8);
|
||||
append_dev(div2, p2);
|
||||
append_dev(p2, t9);
|
||||
append_dev(p2, a2);
|
||||
|
||||
if (!mounted) {
|
||||
dispose = listen_dev(button, "click", /*click_handler*/ ctx[4], false, false, false);
|
||||
mounted = true;
|
||||
}
|
||||
},
|
||||
p: function update(ctx, dirty) {
|
||||
if (dirty & /*$content*/ 2 && t0_value !== (t0_value = /*$content*/ ctx[1].contactUs + "")) set_data_dev(t0, t0_value);
|
||||
if (dirty & /*$content*/ 2 && t3_value !== (t3_value = /*$content*/ ctx[1].inviteLink + "")) set_data_dev(t3, t3_value);
|
||||
if (dirty & /*$content*/ 2 && t6_value !== (t6_value = /*$content*/ ctx[1].inviteLink + "")) set_data_dev(t6, t6_value);
|
||||
},
|
||||
d: function destroy(detaching) {
|
||||
if (detaching) detach_dev(footer);
|
||||
mounted = false;
|
||||
dispose();
|
||||
}
|
||||
};
|
||||
|
||||
dispatch_dev("SvelteRegisterBlock", {
|
||||
block,
|
||||
id: create_if_block.name,
|
||||
type: "if",
|
||||
source: "(21:4) {#if $loaded==2}",
|
||||
ctx
|
||||
});
|
||||
|
||||
return block;
|
||||
}
|
||||
|
||||
// (20:0) {#key $loaded}
|
||||
function create_key_block(ctx) {
|
||||
let if_block_anchor;
|
||||
let if_block = /*$loaded*/ ctx[0] == 2 && create_if_block(ctx);
|
||||
|
||||
const block = {
|
||||
c: function create() {
|
||||
if (if_block) if_block.c();
|
||||
if_block_anchor = empty();
|
||||
},
|
||||
m: function mount(target, anchor) {
|
||||
if (if_block) if_block.m(target, anchor);
|
||||
insert_dev(target, if_block_anchor, anchor);
|
||||
},
|
||||
p: function update(ctx, dirty) {
|
||||
if (/*$loaded*/ ctx[0] == 2) {
|
||||
if (if_block) {
|
||||
if_block.p(ctx, dirty);
|
||||
} else {
|
||||
if_block = create_if_block(ctx);
|
||||
if_block.c();
|
||||
if_block.m(if_block_anchor.parentNode, if_block_anchor);
|
||||
}
|
||||
} else if (if_block) {
|
||||
if_block.d(1);
|
||||
if_block = null;
|
||||
}
|
||||
},
|
||||
d: function destroy(detaching) {
|
||||
if (if_block) if_block.d(detaching);
|
||||
if (detaching) detach_dev(if_block_anchor);
|
||||
}
|
||||
};
|
||||
|
||||
dispatch_dev("SvelteRegisterBlock", {
|
||||
block,
|
||||
id: create_key_block.name,
|
||||
type: "key",
|
||||
source: "(20:0) {#key $loaded}",
|
||||
ctx
|
||||
});
|
||||
|
||||
return block;
|
||||
}
|
||||
|
||||
function create_fragment(ctx) {
|
||||
let previous_key = /*$loaded*/ ctx[0];
|
||||
let key_block_anchor;
|
||||
let key_block = create_key_block(ctx);
|
||||
|
||||
const block = {
|
||||
c: function create() {
|
||||
key_block.c();
|
||||
key_block_anchor = empty();
|
||||
this.c = noop;
|
||||
},
|
||||
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) {
|
||||
key_block.m(target, anchor);
|
||||
insert_dev(target, key_block_anchor, anchor);
|
||||
},
|
||||
p: function update(ctx, [dirty]) {
|
||||
if (dirty & /*$loaded*/ 1 && safe_not_equal(previous_key, previous_key = /*$loaded*/ ctx[0])) {
|
||||
key_block.d(1);
|
||||
key_block = create_key_block(ctx);
|
||||
key_block.c();
|
||||
key_block.m(key_block_anchor.parentNode, key_block_anchor);
|
||||
} else {
|
||||
key_block.p(ctx, dirty);
|
||||
}
|
||||
},
|
||||
i: noop,
|
||||
o: noop,
|
||||
d: function destroy(detaching) {
|
||||
if (detaching) detach_dev(key_block_anchor);
|
||||
key_block.d(detaching);
|
||||
}
|
||||
};
|
||||
|
||||
dispatch_dev("SvelteRegisterBlock", {
|
||||
block,
|
||||
id: create_fragment.name,
|
||||
type: "component",
|
||||
source: "",
|
||||
ctx
|
||||
});
|
||||
|
||||
return block;
|
||||
}
|
||||
|
||||
function instance($$self, $$props, $$invalidate) {
|
||||
let $loaded;
|
||||
let $content;
|
||||
let { $$slots: slots = {}, $$scope } = $$props;
|
||||
validate_slots('footer-component', slots, []);
|
||||
let loaded = writable(0);
|
||||
validate_store(loaded, 'loaded');
|
||||
component_subscribe($$self, loaded, value => $$invalidate(0, $loaded = value));
|
||||
let content = writable({});
|
||||
validate_store(content, 'content');
|
||||
component_subscribe($$self, content, value => $$invalidate(1, $content = value));
|
||||
loadLocaleContent(content, "countries", loaded);
|
||||
loadLocaleContent(content, "footer-component", loaded);
|
||||
const writable_props = [];
|
||||
|
||||
Object.keys($$props).forEach(key => {
|
||||
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(`<footer-component> was created with unknown prop '${key}'`);
|
||||
});
|
||||
|
||||
const click_handler = () => {
|
||||
location.href = '#';
|
||||
};
|
||||
|
||||
$$self.$capture_state = () => ({
|
||||
writable,
|
||||
loadLocaleContent,
|
||||
loaded,
|
||||
content,
|
||||
$loaded,
|
||||
$content
|
||||
});
|
||||
|
||||
$$self.$inject_state = $$props => {
|
||||
if ('loaded' in $$props) $$invalidate(2, loaded = $$props.loaded);
|
||||
if ('content' in $$props) $$invalidate(3, content = $$props.content);
|
||||
};
|
||||
|
||||
if ($$props && "$$inject" in $$props) {
|
||||
$$self.$inject_state($$props.$$inject);
|
||||
}
|
||||
|
||||
return [$loaded, $content, loaded, content, click_handler];
|
||||
}
|
||||
|
||||
class Footer_component extends SvelteElement {
|
||||
constructor(options) {
|
||||
super();
|
||||
this.shadowRoot.innerHTML = `<style>@import '/css/common.css';footer{position:relative;bottom:0;width:100%;height:auto;background:var(--gray);border-top:var(--red) solid 0.5rem}footer p,footer a{font-family:var(--sans-serif)}#footer-content-container{position:relative;margin:auto;padding-top:2rem;max-width:116rem;width:97vw}#footer-grid-content-container{display:grid;margin-left:2rem;margin-right:2rem;margin-bottom:1rem}.logged{grid-template-columns:auto auto 2rem}footer h2{color:#ffffff;font-size:1.3rem;margin-bottom:0.5rem}#footer-copyright{position:relative;margin:auto;width:100%;bottom:0rem;height:3rem;top:0rem;margin-bottom:0;font-size:1rem;text-align:center}#footer-copyright *{font-size:1rem}footer a{font-size:1.1rem;color:#ffffff}footer p{display:block;font-size:1.1rem;color:#d8d8d8;font-family:var(--sans-serif,sans-serif);margin-bottom:0.5rem}#contact-us-container{width:16rem}#footer-up{position:absolute;width:4.8rem;height:4.8rem;border-radius:3.4rem;top:4rem;right:2rem;background:#ffffff}#footer-up svg{width:40%;height:auto}@media only screen and (max-width: 1170px){.logged{grid-template-rows:auto auto auto;grid-template-columns:auto;row-gap:2rem}#footer-copyright{height:1rem;top:-2rem}}</style>`;
|
||||
|
||||
init(
|
||||
this,
|
||||
{
|
||||
target: this.shadowRoot,
|
||||
props: attribute_to_object(this.attributes),
|
||||
customElement: true
|
||||
},
|
||||
instance,
|
||||
create_fragment,
|
||||
safe_not_equal,
|
||||
{},
|
||||
null
|
||||
);
|
||||
|
||||
if (options) {
|
||||
if (options.target) {
|
||||
insert_dev(options.target, this, options.anchor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define("footer-component", Footer_component);
|
||||
|
||||
export { Footer_component as default };
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
513
Server/public/js/components/index-122ecbb4.js
Normal file
513
Server/public/js/components/index-122ecbb4.js
Normal file
@@ -0,0 +1,513 @@
|
||||
|
||||
(function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
|
||||
function noop() { }
|
||||
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');
|
||||
}
|
||||
let src_url_equal_anchor;
|
||||
function src_url_equal(element_src, url) {
|
||||
if (!src_url_equal_anchor) {
|
||||
src_url_equal_anchor = document.createElement('a');
|
||||
}
|
||||
src_url_equal_anchor.href = url;
|
||||
return element_src === src_url_equal_anchor.href;
|
||||
}
|
||||
function is_empty(obj) {
|
||||
return Object.keys(obj).length === 0;
|
||||
}
|
||||
function validate_store(store, name) {
|
||||
if (store != null && typeof store.subscribe !== 'function') {
|
||||
throw new Error(`'${name}' is not a store with a 'subscribe' method`);
|
||||
}
|
||||
}
|
||||
function subscribe(store, ...callbacks) {
|
||||
if (store == null) {
|
||||
return noop;
|
||||
}
|
||||
const unsub = store.subscribe(...callbacks);
|
||||
return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;
|
||||
}
|
||||
function component_subscribe(component, store, callback) {
|
||||
component.$$.on_destroy.push(subscribe(store, callback));
|
||||
}
|
||||
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 destroy_each(iterations, detaching) {
|
||||
for (let i = 0; i < iterations.length; i += 1) {
|
||||
if (iterations[i])
|
||||
iterations[i].d(detaching);
|
||||
}
|
||||
}
|
||||
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 listen(node, event, handler, options) {
|
||||
node.addEventListener(event, handler, options);
|
||||
return () => node.removeEventListener(event, handler, options);
|
||||
}
|
||||
function attr(node, attribute, value) {
|
||||
if (value == null)
|
||||
node.removeAttribute(attribute);
|
||||
else if (node.getAttribute(attribute) !== value)
|
||||
node.setAttribute(attribute, value);
|
||||
}
|
||||
function set_custom_element_data(node, prop, value) {
|
||||
if (prop in node) {
|
||||
node[prop] = typeof node[prop] === 'boolean' && value === '' ? true : value;
|
||||
}
|
||||
else {
|
||||
attr(node, prop, value);
|
||||
}
|
||||
}
|
||||
function children(element) {
|
||||
return Array.from(element.childNodes);
|
||||
}
|
||||
function set_style(node, key, value, important) {
|
||||
if (value === null) {
|
||||
node.style.removeProperty(key);
|
||||
}
|
||||
else {
|
||||
node.style.setProperty(key, value, important ? 'important' : '');
|
||||
}
|
||||
}
|
||||
function custom_event(type, detail, { bubbles = false, cancelable = false } = {}) {
|
||||
const e = document.createEvent('CustomEvent');
|
||||
e.initCustomEvent(type, bubbles, cancelable, detail);
|
||||
return e;
|
||||
}
|
||||
class HtmlTag {
|
||||
constructor(is_svg = false) {
|
||||
this.is_svg = false;
|
||||
this.is_svg = is_svg;
|
||||
this.e = this.n = null;
|
||||
}
|
||||
c(html) {
|
||||
this.h(html);
|
||||
}
|
||||
m(html, target, anchor = null) {
|
||||
if (!this.e) {
|
||||
if (this.is_svg)
|
||||
this.e = svg_element(target.nodeName);
|
||||
else
|
||||
this.e = element(target.nodeName);
|
||||
this.t = target;
|
||||
this.c(html);
|
||||
}
|
||||
this.i(anchor);
|
||||
}
|
||||
h(html) {
|
||||
this.e.innerHTML = html;
|
||||
this.n = Array.from(this.e.childNodes);
|
||||
}
|
||||
i(anchor) {
|
||||
for (let i = 0; i < this.n.length; i += 1) {
|
||||
insert(this.t, this.n[i], anchor);
|
||||
}
|
||||
}
|
||||
p(html) {
|
||||
this.d();
|
||||
this.h(html);
|
||||
this.i(this.a);
|
||||
}
|
||||
d() {
|
||||
this.n.forEach(detach);
|
||||
}
|
||||
}
|
||||
function attribute_to_object(attributes) {
|
||||
const result = {};
|
||||
for (const attribute of attributes) {
|
||||
result[attribute.name] = attribute.value;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
/**
|
||||
* The `onMount` function schedules a callback to run as soon as the component has been mounted to the DOM.
|
||||
* It must be called during the component's initialisation (but doesn't need to live *inside* the component;
|
||||
* it can be called from an external module).
|
||||
*
|
||||
* `onMount` does not run inside a [server-side component](/docs#run-time-server-side-component-api).
|
||||
*
|
||||
* https://svelte.dev/docs#run-time-svelte-onmount
|
||||
*/
|
||||
function onMount(fn) {
|
||||
get_current_component().$$.on_mount.push(fn);
|
||||
}
|
||||
/**
|
||||
* Associates an arbitrary `context` object with the current component and the specified `key`
|
||||
* and returns that object. The context is then available to children of the component
|
||||
* (including slotted content) with `getContext`.
|
||||
*
|
||||
* Like lifecycle functions, this must be called during component initialisation.
|
||||
*
|
||||
* https://svelte.dev/docs#run-time-svelte-setcontext
|
||||
*/
|
||||
function setContext(key, context) {
|
||||
get_current_component().$$.context.set(key, context);
|
||||
return context;
|
||||
}
|
||||
/**
|
||||
* Retrieves the context that belongs to the closest parent component with the specified `key`.
|
||||
* Must be called during component initialisation.
|
||||
*
|
||||
* https://svelte.dev/docs#run-time-svelte-getcontext
|
||||
*/
|
||||
function getContext(key) {
|
||||
return get_current_component().$$.context.get(key);
|
||||
}
|
||||
|
||||
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 add_render_callback(fn) {
|
||||
render_callbacks.push(fn);
|
||||
}
|
||||
// flush() calls callbacks in this order:
|
||||
// 1. All beforeUpdate callbacks, in order: parents before children
|
||||
// 2. All bind:this callbacks, in reverse order: children before parents.
|
||||
// 3. All afterUpdate callbacks, in order: parents before children. EXCEPT
|
||||
// for afterUpdates called during the initial onMount, which are called in
|
||||
// reverse order: children before parents.
|
||||
// Since callbacks might update component values, which could trigger another
|
||||
// call to flush(), the following steps guard against this:
|
||||
// 1. During beforeUpdate, any updated components will be added to the
|
||||
// dirty_components array and will cause a reentrant call to flush(). Because
|
||||
// the flush index is kept outside the function, the reentrant call will pick
|
||||
// up where the earlier call left off and go through all dirty components. The
|
||||
// current_component value is saved and restored so that the reentrant call will
|
||||
// not interfere with the "parent" flush() call.
|
||||
// 2. bind:this callbacks cannot trigger new flush() calls.
|
||||
// 3. During afterUpdate, any updated components will NOT have their afterUpdate
|
||||
// callback called a second time; the seen_callbacks set, outside the flush()
|
||||
// function, guarantees this behavior.
|
||||
const seen_callbacks = new Set();
|
||||
let flushidx = 0; // Do *not* move this inside the flush() function
|
||||
function flush() {
|
||||
const saved_component = current_component;
|
||||
do {
|
||||
// first, call beforeUpdate functions
|
||||
// and update components
|
||||
while (flushidx < dirty_components.length) {
|
||||
const component = dirty_components[flushidx];
|
||||
flushidx++;
|
||||
set_current_component(component);
|
||||
update(component.$$);
|
||||
}
|
||||
set_current_component(null);
|
||||
dirty_components.length = 0;
|
||||
flushidx = 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;
|
||||
seen_callbacks.clear();
|
||||
set_current_component(saved_component);
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
const outroing = new Set();
|
||||
function transition_in(block, local) {
|
||||
if (block && block.i) {
|
||||
outroing.delete(block);
|
||||
block.i(local);
|
||||
}
|
||||
}
|
||||
|
||||
const globals = (typeof window !== 'undefined'
|
||||
? window
|
||||
: typeof globalThis !== 'undefined'
|
||||
? globalThis
|
||||
: global);
|
||||
function mount_component(component, target, anchor, customElement) {
|
||||
const { fragment, after_update } = component.$$;
|
||||
fragment && fragment.m(target, anchor);
|
||||
if (!customElement) {
|
||||
// onMount happens before the initial afterUpdate
|
||||
add_render_callback(() => {
|
||||
const new_on_destroy = component.$$.on_mount.map(run).filter(is_function);
|
||||
// if the component was destroyed immediately
|
||||
// it will update the `$$.on_destroy` reference to `null`.
|
||||
// the destructured on_destroy may still reference to the old array
|
||||
if (component.$$.on_destroy) {
|
||||
component.$$.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, append_styles, dirty = [-1]) {
|
||||
const parent_component = current_component;
|
||||
set_current_component(component);
|
||||
const $$ = component.$$ = {
|
||||
fragment: null,
|
||||
ctx: [],
|
||||
// state
|
||||
props,
|
||||
update: noop,
|
||||
not_equal,
|
||||
bound: blank_object(),
|
||||
// lifecycle
|
||||
on_mount: [],
|
||||
on_destroy: [],
|
||||
on_disconnect: [],
|
||||
before_update: [],
|
||||
after_update: [],
|
||||
context: new Map(options.context || (parent_component ? parent_component.$$.context : [])),
|
||||
// everything else
|
||||
callbacks: blank_object(),
|
||||
dirty,
|
||||
skip_bound: false,
|
||||
root: options.target || parent_component.$$.root
|
||||
};
|
||||
append_styles && append_styles($$.root);
|
||||
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);
|
||||
}
|
||||
let SvelteElement;
|
||||
if (typeof HTMLElement === 'function') {
|
||||
SvelteElement = class extends HTMLElement {
|
||||
constructor() {
|
||||
super();
|
||||
this.attachShadow({ mode: 'open' });
|
||||
}
|
||||
connectedCallback() {
|
||||
const { on_mount } = this.$$;
|
||||
this.$$.on_disconnect = on_mount.map(run).filter(is_function);
|
||||
// @ts-ignore todo: improve typings
|
||||
for (const key in this.$$.slotted) {
|
||||
// @ts-ignore todo: improve typings
|
||||
this.appendChild(this.$$.slotted[key]);
|
||||
}
|
||||
}
|
||||
attributeChangedCallback(attr, _oldValue, newValue) {
|
||||
this[attr] = newValue;
|
||||
}
|
||||
disconnectedCallback() {
|
||||
run_all(this.$$.on_disconnect);
|
||||
}
|
||||
$destroy() {
|
||||
destroy_component(this, 1);
|
||||
this.$destroy = noop;
|
||||
}
|
||||
$on(type, callback) {
|
||||
// TODO should this delegate to addEventListener?
|
||||
if (!is_function(callback)) {
|
||||
return noop;
|
||||
}
|
||||
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.52.0' }, detail), { bubbles: true }));
|
||||
}
|
||||
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 listen_dev(node, event, handler, options, has_prevent_default, has_stop_propagation) {
|
||||
const modifiers = options === true ? ['capture'] : options ? Array.from(Object.keys(options)) : [];
|
||||
if (has_prevent_default)
|
||||
modifiers.push('preventDefault');
|
||||
if (has_stop_propagation)
|
||||
modifiers.push('stopPropagation');
|
||||
dispatch_dev('SvelteDOMAddEventListener', { node, event, handler, modifiers });
|
||||
const dispose = listen(node, event, handler, options);
|
||||
return () => {
|
||||
dispatch_dev('SvelteDOMRemoveEventListener', { node, event, handler, modifiers });
|
||||
dispose();
|
||||
};
|
||||
}
|
||||
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 prop_dev(node, property, value) {
|
||||
node[property] = value;
|
||||
dispatch_dev('SvelteDOMSetProperty', { node, property, value });
|
||||
}
|
||||
function set_data_dev(text, data) {
|
||||
data = '' + data;
|
||||
if (text.wholeText === data)
|
||||
return;
|
||||
dispatch_dev('SvelteDOMSetData', { node: text, data });
|
||||
text.data = data;
|
||||
}
|
||||
function validate_each_argument(arg) {
|
||||
if (typeof arg !== 'string' && !(arg && typeof arg === 'object' && 'length' in arg)) {
|
||||
let msg = '{#each} only iterates over array-like objects.';
|
||||
if (typeof Symbol === 'function' && arg && Symbol.iterator in arg) {
|
||||
msg += ' You can use a spread to convert this iterable into an array.';
|
||||
}
|
||||
throw new Error(msg);
|
||||
}
|
||||
}
|
||||
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}".`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export { validate_each_argument as A, text as B, set_data_dev as C, destroy_each as D, prop_dev as E, set_style as F, svg_element as G, is_function as H, HtmlTag as I, SvelteElement as S, attribute_to_object as a, insert_dev as b, setContext as c, dispatch_dev as d, globals as e, element as f, getContext as g, space as h, init as i, add_location as j, attr_dev as k, append_dev as l, listen_dev as m, noop as n, onMount as o, detach_dev as p, binding_callbacks as q, run_all as r, safe_not_equal as s, flush as t, src_url_equal as u, validate_slots as v, validate_store as w, component_subscribe as x, empty as y, set_custom_element_data as z };
|
521
Server/public/js/components/index-6b4fe380.js
Normal file
521
Server/public/js/components/index-6b4fe380.js
Normal file
@@ -0,0 +1,521 @@
|
||||
|
||||
(function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
|
||||
function noop() { }
|
||||
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');
|
||||
}
|
||||
let src_url_equal_anchor;
|
||||
function src_url_equal(element_src, url) {
|
||||
if (!src_url_equal_anchor) {
|
||||
src_url_equal_anchor = document.createElement('a');
|
||||
}
|
||||
src_url_equal_anchor.href = url;
|
||||
return element_src === src_url_equal_anchor.href;
|
||||
}
|
||||
function is_empty(obj) {
|
||||
return Object.keys(obj).length === 0;
|
||||
}
|
||||
function validate_store(store, name) {
|
||||
if (store != null && typeof store.subscribe !== 'function') {
|
||||
throw new Error(`'${name}' is not a store with a 'subscribe' method`);
|
||||
}
|
||||
}
|
||||
function subscribe(store, ...callbacks) {
|
||||
if (store == null) {
|
||||
return noop;
|
||||
}
|
||||
const unsub = store.subscribe(...callbacks);
|
||||
return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;
|
||||
}
|
||||
function component_subscribe(component, store, callback) {
|
||||
component.$$.on_destroy.push(subscribe(store, callback));
|
||||
}
|
||||
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 destroy_each(iterations, detaching) {
|
||||
for (let i = 0; i < iterations.length; i += 1) {
|
||||
if (iterations[i])
|
||||
iterations[i].d(detaching);
|
||||
}
|
||||
}
|
||||
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 listen(node, event, handler, options) {
|
||||
node.addEventListener(event, handler, options);
|
||||
return () => node.removeEventListener(event, handler, options);
|
||||
}
|
||||
function attr(node, attribute, value) {
|
||||
if (value == null)
|
||||
node.removeAttribute(attribute);
|
||||
else if (node.getAttribute(attribute) !== value)
|
||||
node.setAttribute(attribute, value);
|
||||
}
|
||||
function set_custom_element_data(node, prop, value) {
|
||||
if (prop in node) {
|
||||
node[prop] = typeof node[prop] === 'boolean' && value === '' ? true : value;
|
||||
}
|
||||
else {
|
||||
attr(node, prop, value);
|
||||
}
|
||||
}
|
||||
function children(element) {
|
||||
return Array.from(element.childNodes);
|
||||
}
|
||||
function set_style(node, key, value, important) {
|
||||
if (value === null) {
|
||||
node.style.removeProperty(key);
|
||||
}
|
||||
else {
|
||||
node.style.setProperty(key, value, important ? 'important' : '');
|
||||
}
|
||||
}
|
||||
function custom_event(type, detail, { bubbles = false, cancelable = false } = {}) {
|
||||
const e = document.createEvent('CustomEvent');
|
||||
e.initCustomEvent(type, bubbles, cancelable, detail);
|
||||
return e;
|
||||
}
|
||||
class HtmlTag {
|
||||
constructor(is_svg = false) {
|
||||
this.is_svg = false;
|
||||
this.is_svg = is_svg;
|
||||
this.e = this.n = null;
|
||||
}
|
||||
c(html) {
|
||||
this.h(html);
|
||||
}
|
||||
m(html, target, anchor = null) {
|
||||
if (!this.e) {
|
||||
if (this.is_svg)
|
||||
this.e = svg_element(target.nodeName);
|
||||
else
|
||||
this.e = element(target.nodeName);
|
||||
this.t = target;
|
||||
this.c(html);
|
||||
}
|
||||
this.i(anchor);
|
||||
}
|
||||
h(html) {
|
||||
this.e.innerHTML = html;
|
||||
this.n = Array.from(this.e.childNodes);
|
||||
}
|
||||
i(anchor) {
|
||||
for (let i = 0; i < this.n.length; i += 1) {
|
||||
insert(this.t, this.n[i], anchor);
|
||||
}
|
||||
}
|
||||
p(html) {
|
||||
this.d();
|
||||
this.h(html);
|
||||
this.i(this.a);
|
||||
}
|
||||
d() {
|
||||
this.n.forEach(detach);
|
||||
}
|
||||
}
|
||||
function attribute_to_object(attributes) {
|
||||
const result = {};
|
||||
for (const attribute of attributes) {
|
||||
result[attribute.name] = attribute.value;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
/**
|
||||
* The `onMount` function schedules a callback to run as soon as the component has been mounted to the DOM.
|
||||
* It must be called during the component's initialisation (but doesn't need to live *inside* the component;
|
||||
* it can be called from an external module).
|
||||
*
|
||||
* `onMount` does not run inside a [server-side component](/docs#run-time-server-side-component-api).
|
||||
*
|
||||
* https://svelte.dev/docs#run-time-svelte-onmount
|
||||
*/
|
||||
function onMount(fn) {
|
||||
get_current_component().$$.on_mount.push(fn);
|
||||
}
|
||||
/**
|
||||
* Schedules a callback to run immediately after the component has been updated.
|
||||
*
|
||||
* The first time the callback runs will be after the initial `onMount`
|
||||
*/
|
||||
function afterUpdate(fn) {
|
||||
get_current_component().$$.after_update.push(fn);
|
||||
}
|
||||
/**
|
||||
* Associates an arbitrary `context` object with the current component and the specified `key`
|
||||
* and returns that object. The context is then available to children of the component
|
||||
* (including slotted content) with `getContext`.
|
||||
*
|
||||
* Like lifecycle functions, this must be called during component initialisation.
|
||||
*
|
||||
* https://svelte.dev/docs#run-time-svelte-setcontext
|
||||
*/
|
||||
function setContext(key, context) {
|
||||
get_current_component().$$.context.set(key, context);
|
||||
return context;
|
||||
}
|
||||
/**
|
||||
* Retrieves the context that belongs to the closest parent component with the specified `key`.
|
||||
* Must be called during component initialisation.
|
||||
*
|
||||
* https://svelte.dev/docs#run-time-svelte-getcontext
|
||||
*/
|
||||
function getContext(key) {
|
||||
return get_current_component().$$.context.get(key);
|
||||
}
|
||||
|
||||
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 add_render_callback(fn) {
|
||||
render_callbacks.push(fn);
|
||||
}
|
||||
// flush() calls callbacks in this order:
|
||||
// 1. All beforeUpdate callbacks, in order: parents before children
|
||||
// 2. All bind:this callbacks, in reverse order: children before parents.
|
||||
// 3. All afterUpdate callbacks, in order: parents before children. EXCEPT
|
||||
// for afterUpdates called during the initial onMount, which are called in
|
||||
// reverse order: children before parents.
|
||||
// Since callbacks might update component values, which could trigger another
|
||||
// call to flush(), the following steps guard against this:
|
||||
// 1. During beforeUpdate, any updated components will be added to the
|
||||
// dirty_components array and will cause a reentrant call to flush(). Because
|
||||
// the flush index is kept outside the function, the reentrant call will pick
|
||||
// up where the earlier call left off and go through all dirty components. The
|
||||
// current_component value is saved and restored so that the reentrant call will
|
||||
// not interfere with the "parent" flush() call.
|
||||
// 2. bind:this callbacks cannot trigger new flush() calls.
|
||||
// 3. During afterUpdate, any updated components will NOT have their afterUpdate
|
||||
// callback called a second time; the seen_callbacks set, outside the flush()
|
||||
// function, guarantees this behavior.
|
||||
const seen_callbacks = new Set();
|
||||
let flushidx = 0; // Do *not* move this inside the flush() function
|
||||
function flush() {
|
||||
const saved_component = current_component;
|
||||
do {
|
||||
// first, call beforeUpdate functions
|
||||
// and update components
|
||||
while (flushidx < dirty_components.length) {
|
||||
const component = dirty_components[flushidx];
|
||||
flushidx++;
|
||||
set_current_component(component);
|
||||
update(component.$$);
|
||||
}
|
||||
set_current_component(null);
|
||||
dirty_components.length = 0;
|
||||
flushidx = 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;
|
||||
seen_callbacks.clear();
|
||||
set_current_component(saved_component);
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
const outroing = new Set();
|
||||
function transition_in(block, local) {
|
||||
if (block && block.i) {
|
||||
outroing.delete(block);
|
||||
block.i(local);
|
||||
}
|
||||
}
|
||||
|
||||
const globals = (typeof window !== 'undefined'
|
||||
? window
|
||||
: typeof globalThis !== 'undefined'
|
||||
? globalThis
|
||||
: global);
|
||||
function mount_component(component, target, anchor, customElement) {
|
||||
const { fragment, after_update } = component.$$;
|
||||
fragment && fragment.m(target, anchor);
|
||||
if (!customElement) {
|
||||
// onMount happens before the initial afterUpdate
|
||||
add_render_callback(() => {
|
||||
const new_on_destroy = component.$$.on_mount.map(run).filter(is_function);
|
||||
// if the component was destroyed immediately
|
||||
// it will update the `$$.on_destroy` reference to `null`.
|
||||
// the destructured on_destroy may still reference to the old array
|
||||
if (component.$$.on_destroy) {
|
||||
component.$$.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, append_styles, dirty = [-1]) {
|
||||
const parent_component = current_component;
|
||||
set_current_component(component);
|
||||
const $$ = component.$$ = {
|
||||
fragment: null,
|
||||
ctx: [],
|
||||
// state
|
||||
props,
|
||||
update: noop,
|
||||
not_equal,
|
||||
bound: blank_object(),
|
||||
// lifecycle
|
||||
on_mount: [],
|
||||
on_destroy: [],
|
||||
on_disconnect: [],
|
||||
before_update: [],
|
||||
after_update: [],
|
||||
context: new Map(options.context || (parent_component ? parent_component.$$.context : [])),
|
||||
// everything else
|
||||
callbacks: blank_object(),
|
||||
dirty,
|
||||
skip_bound: false,
|
||||
root: options.target || parent_component.$$.root
|
||||
};
|
||||
append_styles && append_styles($$.root);
|
||||
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);
|
||||
}
|
||||
let SvelteElement;
|
||||
if (typeof HTMLElement === 'function') {
|
||||
SvelteElement = class extends HTMLElement {
|
||||
constructor() {
|
||||
super();
|
||||
this.attachShadow({ mode: 'open' });
|
||||
}
|
||||
connectedCallback() {
|
||||
const { on_mount } = this.$$;
|
||||
this.$$.on_disconnect = on_mount.map(run).filter(is_function);
|
||||
// @ts-ignore todo: improve typings
|
||||
for (const key in this.$$.slotted) {
|
||||
// @ts-ignore todo: improve typings
|
||||
this.appendChild(this.$$.slotted[key]);
|
||||
}
|
||||
}
|
||||
attributeChangedCallback(attr, _oldValue, newValue) {
|
||||
this[attr] = newValue;
|
||||
}
|
||||
disconnectedCallback() {
|
||||
run_all(this.$$.on_disconnect);
|
||||
}
|
||||
$destroy() {
|
||||
destroy_component(this, 1);
|
||||
this.$destroy = noop;
|
||||
}
|
||||
$on(type, callback) {
|
||||
// TODO should this delegate to addEventListener?
|
||||
if (!is_function(callback)) {
|
||||
return noop;
|
||||
}
|
||||
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.52.0' }, detail), { bubbles: true }));
|
||||
}
|
||||
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 listen_dev(node, event, handler, options, has_prevent_default, has_stop_propagation) {
|
||||
const modifiers = options === true ? ['capture'] : options ? Array.from(Object.keys(options)) : [];
|
||||
if (has_prevent_default)
|
||||
modifiers.push('preventDefault');
|
||||
if (has_stop_propagation)
|
||||
modifiers.push('stopPropagation');
|
||||
dispatch_dev('SvelteDOMAddEventListener', { node, event, handler, modifiers });
|
||||
const dispose = listen(node, event, handler, options);
|
||||
return () => {
|
||||
dispatch_dev('SvelteDOMRemoveEventListener', { node, event, handler, modifiers });
|
||||
dispose();
|
||||
};
|
||||
}
|
||||
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 prop_dev(node, property, value) {
|
||||
node[property] = value;
|
||||
dispatch_dev('SvelteDOMSetProperty', { node, property, value });
|
||||
}
|
||||
function set_data_dev(text, data) {
|
||||
data = '' + data;
|
||||
if (text.wholeText === data)
|
||||
return;
|
||||
dispatch_dev('SvelteDOMSetData', { node: text, data });
|
||||
text.data = data;
|
||||
}
|
||||
function validate_each_argument(arg) {
|
||||
if (typeof arg !== 'string' && !(arg && typeof arg === 'object' && 'length' in arg)) {
|
||||
let msg = '{#each} only iterates over array-like objects.';
|
||||
if (typeof Symbol === 'function' && arg && Symbol.iterator in arg) {
|
||||
msg += ' You can use a spread to convert this iterable into an array.';
|
||||
}
|
||||
throw new Error(msg);
|
||||
}
|
||||
}
|
||||
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}".`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export { validate_each_argument as A, text as B, set_data_dev as C, destroy_each as D, prop_dev as E, set_style as F, svg_element as G, is_function as H, HtmlTag as I, afterUpdate as J, SvelteElement as S, attribute_to_object as a, insert_dev as b, setContext as c, dispatch_dev as d, globals as e, element as f, getContext as g, space as h, init as i, add_location as j, attr_dev as k, append_dev as l, listen_dev as m, noop as n, onMount as o, detach_dev as p, binding_callbacks as q, run_all as r, safe_not_equal as s, flush as t, src_url_equal as u, validate_slots as v, validate_store as w, component_subscribe as x, empty as y, set_custom_element_data as z };
|
524
Server/public/js/components/index-998178c7.js
Normal file
524
Server/public/js/components/index-998178c7.js
Normal file
@@ -0,0 +1,524 @@
|
||||
|
||||
(function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
|
||||
function noop() { }
|
||||
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');
|
||||
}
|
||||
let src_url_equal_anchor;
|
||||
function src_url_equal(element_src, url) {
|
||||
if (!src_url_equal_anchor) {
|
||||
src_url_equal_anchor = document.createElement('a');
|
||||
}
|
||||
src_url_equal_anchor.href = url;
|
||||
return element_src === src_url_equal_anchor.href;
|
||||
}
|
||||
function is_empty(obj) {
|
||||
return Object.keys(obj).length === 0;
|
||||
}
|
||||
function validate_store(store, name) {
|
||||
if (store != null && typeof store.subscribe !== 'function') {
|
||||
throw new Error(`'${name}' is not a store with a 'subscribe' method`);
|
||||
}
|
||||
}
|
||||
function subscribe(store, ...callbacks) {
|
||||
if (store == null) {
|
||||
return noop;
|
||||
}
|
||||
const unsub = store.subscribe(...callbacks);
|
||||
return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;
|
||||
}
|
||||
function component_subscribe(component, store, callback) {
|
||||
component.$$.on_destroy.push(subscribe(store, callback));
|
||||
}
|
||||
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 destroy_each(iterations, detaching) {
|
||||
for (let i = 0; i < iterations.length; i += 1) {
|
||||
if (iterations[i])
|
||||
iterations[i].d(detaching);
|
||||
}
|
||||
}
|
||||
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 listen(node, event, handler, options) {
|
||||
node.addEventListener(event, handler, options);
|
||||
return () => node.removeEventListener(event, handler, options);
|
||||
}
|
||||
function attr(node, attribute, value) {
|
||||
if (value == null)
|
||||
node.removeAttribute(attribute);
|
||||
else if (node.getAttribute(attribute) !== value)
|
||||
node.setAttribute(attribute, value);
|
||||
}
|
||||
function set_custom_element_data(node, prop, value) {
|
||||
if (prop in node) {
|
||||
node[prop] = typeof node[prop] === 'boolean' && value === '' ? true : value;
|
||||
}
|
||||
else {
|
||||
attr(node, prop, value);
|
||||
}
|
||||
}
|
||||
function children(element) {
|
||||
return Array.from(element.childNodes);
|
||||
}
|
||||
function set_input_value(input, value) {
|
||||
input.value = value == null ? '' : value;
|
||||
}
|
||||
function set_style(node, key, value, important) {
|
||||
if (value === null) {
|
||||
node.style.removeProperty(key);
|
||||
}
|
||||
else {
|
||||
node.style.setProperty(key, value, important ? 'important' : '');
|
||||
}
|
||||
}
|
||||
function custom_event(type, detail, { bubbles = false, cancelable = false } = {}) {
|
||||
const e = document.createEvent('CustomEvent');
|
||||
e.initCustomEvent(type, bubbles, cancelable, detail);
|
||||
return e;
|
||||
}
|
||||
class HtmlTag {
|
||||
constructor(is_svg = false) {
|
||||
this.is_svg = false;
|
||||
this.is_svg = is_svg;
|
||||
this.e = this.n = null;
|
||||
}
|
||||
c(html) {
|
||||
this.h(html);
|
||||
}
|
||||
m(html, target, anchor = null) {
|
||||
if (!this.e) {
|
||||
if (this.is_svg)
|
||||
this.e = svg_element(target.nodeName);
|
||||
else
|
||||
this.e = element(target.nodeName);
|
||||
this.t = target;
|
||||
this.c(html);
|
||||
}
|
||||
this.i(anchor);
|
||||
}
|
||||
h(html) {
|
||||
this.e.innerHTML = html;
|
||||
this.n = Array.from(this.e.childNodes);
|
||||
}
|
||||
i(anchor) {
|
||||
for (let i = 0; i < this.n.length; i += 1) {
|
||||
insert(this.t, this.n[i], anchor);
|
||||
}
|
||||
}
|
||||
p(html) {
|
||||
this.d();
|
||||
this.h(html);
|
||||
this.i(this.a);
|
||||
}
|
||||
d() {
|
||||
this.n.forEach(detach);
|
||||
}
|
||||
}
|
||||
function attribute_to_object(attributes) {
|
||||
const result = {};
|
||||
for (const attribute of attributes) {
|
||||
result[attribute.name] = attribute.value;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
/**
|
||||
* The `onMount` function schedules a callback to run as soon as the component has been mounted to the DOM.
|
||||
* It must be called during the component's initialisation (but doesn't need to live *inside* the component;
|
||||
* it can be called from an external module).
|
||||
*
|
||||
* `onMount` does not run inside a [server-side component](/docs#run-time-server-side-component-api).
|
||||
*
|
||||
* https://svelte.dev/docs#run-time-svelte-onmount
|
||||
*/
|
||||
function onMount(fn) {
|
||||
get_current_component().$$.on_mount.push(fn);
|
||||
}
|
||||
/**
|
||||
* Schedules a callback to run immediately after the component has been updated.
|
||||
*
|
||||
* The first time the callback runs will be after the initial `onMount`
|
||||
*/
|
||||
function afterUpdate(fn) {
|
||||
get_current_component().$$.after_update.push(fn);
|
||||
}
|
||||
/**
|
||||
* Associates an arbitrary `context` object with the current component and the specified `key`
|
||||
* and returns that object. The context is then available to children of the component
|
||||
* (including slotted content) with `getContext`.
|
||||
*
|
||||
* Like lifecycle functions, this must be called during component initialisation.
|
||||
*
|
||||
* https://svelte.dev/docs#run-time-svelte-setcontext
|
||||
*/
|
||||
function setContext(key, context) {
|
||||
get_current_component().$$.context.set(key, context);
|
||||
return context;
|
||||
}
|
||||
/**
|
||||
* Retrieves the context that belongs to the closest parent component with the specified `key`.
|
||||
* Must be called during component initialisation.
|
||||
*
|
||||
* https://svelte.dev/docs#run-time-svelte-getcontext
|
||||
*/
|
||||
function getContext(key) {
|
||||
return get_current_component().$$.context.get(key);
|
||||
}
|
||||
|
||||
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 add_render_callback(fn) {
|
||||
render_callbacks.push(fn);
|
||||
}
|
||||
// flush() calls callbacks in this order:
|
||||
// 1. All beforeUpdate callbacks, in order: parents before children
|
||||
// 2. All bind:this callbacks, in reverse order: children before parents.
|
||||
// 3. All afterUpdate callbacks, in order: parents before children. EXCEPT
|
||||
// for afterUpdates called during the initial onMount, which are called in
|
||||
// reverse order: children before parents.
|
||||
// Since callbacks might update component values, which could trigger another
|
||||
// call to flush(), the following steps guard against this:
|
||||
// 1. During beforeUpdate, any updated components will be added to the
|
||||
// dirty_components array and will cause a reentrant call to flush(). Because
|
||||
// the flush index is kept outside the function, the reentrant call will pick
|
||||
// up where the earlier call left off and go through all dirty components. The
|
||||
// current_component value is saved and restored so that the reentrant call will
|
||||
// not interfere with the "parent" flush() call.
|
||||
// 2. bind:this callbacks cannot trigger new flush() calls.
|
||||
// 3. During afterUpdate, any updated components will NOT have their afterUpdate
|
||||
// callback called a second time; the seen_callbacks set, outside the flush()
|
||||
// function, guarantees this behavior.
|
||||
const seen_callbacks = new Set();
|
||||
let flushidx = 0; // Do *not* move this inside the flush() function
|
||||
function flush() {
|
||||
const saved_component = current_component;
|
||||
do {
|
||||
// first, call beforeUpdate functions
|
||||
// and update components
|
||||
while (flushidx < dirty_components.length) {
|
||||
const component = dirty_components[flushidx];
|
||||
flushidx++;
|
||||
set_current_component(component);
|
||||
update(component.$$);
|
||||
}
|
||||
set_current_component(null);
|
||||
dirty_components.length = 0;
|
||||
flushidx = 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;
|
||||
seen_callbacks.clear();
|
||||
set_current_component(saved_component);
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
const outroing = new Set();
|
||||
function transition_in(block, local) {
|
||||
if (block && block.i) {
|
||||
outroing.delete(block);
|
||||
block.i(local);
|
||||
}
|
||||
}
|
||||
|
||||
const globals = (typeof window !== 'undefined'
|
||||
? window
|
||||
: typeof globalThis !== 'undefined'
|
||||
? globalThis
|
||||
: global);
|
||||
function mount_component(component, target, anchor, customElement) {
|
||||
const { fragment, after_update } = component.$$;
|
||||
fragment && fragment.m(target, anchor);
|
||||
if (!customElement) {
|
||||
// onMount happens before the initial afterUpdate
|
||||
add_render_callback(() => {
|
||||
const new_on_destroy = component.$$.on_mount.map(run).filter(is_function);
|
||||
// if the component was destroyed immediately
|
||||
// it will update the `$$.on_destroy` reference to `null`.
|
||||
// the destructured on_destroy may still reference to the old array
|
||||
if (component.$$.on_destroy) {
|
||||
component.$$.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, append_styles, dirty = [-1]) {
|
||||
const parent_component = current_component;
|
||||
set_current_component(component);
|
||||
const $$ = component.$$ = {
|
||||
fragment: null,
|
||||
ctx: [],
|
||||
// state
|
||||
props,
|
||||
update: noop,
|
||||
not_equal,
|
||||
bound: blank_object(),
|
||||
// lifecycle
|
||||
on_mount: [],
|
||||
on_destroy: [],
|
||||
on_disconnect: [],
|
||||
before_update: [],
|
||||
after_update: [],
|
||||
context: new Map(options.context || (parent_component ? parent_component.$$.context : [])),
|
||||
// everything else
|
||||
callbacks: blank_object(),
|
||||
dirty,
|
||||
skip_bound: false,
|
||||
root: options.target || parent_component.$$.root
|
||||
};
|
||||
append_styles && append_styles($$.root);
|
||||
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);
|
||||
}
|
||||
let SvelteElement;
|
||||
if (typeof HTMLElement === 'function') {
|
||||
SvelteElement = class extends HTMLElement {
|
||||
constructor() {
|
||||
super();
|
||||
this.attachShadow({ mode: 'open' });
|
||||
}
|
||||
connectedCallback() {
|
||||
const { on_mount } = this.$$;
|
||||
this.$$.on_disconnect = on_mount.map(run).filter(is_function);
|
||||
// @ts-ignore todo: improve typings
|
||||
for (const key in this.$$.slotted) {
|
||||
// @ts-ignore todo: improve typings
|
||||
this.appendChild(this.$$.slotted[key]);
|
||||
}
|
||||
}
|
||||
attributeChangedCallback(attr, _oldValue, newValue) {
|
||||
this[attr] = newValue;
|
||||
}
|
||||
disconnectedCallback() {
|
||||
run_all(this.$$.on_disconnect);
|
||||
}
|
||||
$destroy() {
|
||||
destroy_component(this, 1);
|
||||
this.$destroy = noop;
|
||||
}
|
||||
$on(type, callback) {
|
||||
// TODO should this delegate to addEventListener?
|
||||
if (!is_function(callback)) {
|
||||
return noop;
|
||||
}
|
||||
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.52.0' }, detail), { bubbles: true }));
|
||||
}
|
||||
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 listen_dev(node, event, handler, options, has_prevent_default, has_stop_propagation) {
|
||||
const modifiers = options === true ? ['capture'] : options ? Array.from(Object.keys(options)) : [];
|
||||
if (has_prevent_default)
|
||||
modifiers.push('preventDefault');
|
||||
if (has_stop_propagation)
|
||||
modifiers.push('stopPropagation');
|
||||
dispatch_dev('SvelteDOMAddEventListener', { node, event, handler, modifiers });
|
||||
const dispose = listen(node, event, handler, options);
|
||||
return () => {
|
||||
dispatch_dev('SvelteDOMRemoveEventListener', { node, event, handler, modifiers });
|
||||
dispose();
|
||||
};
|
||||
}
|
||||
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 prop_dev(node, property, value) {
|
||||
node[property] = value;
|
||||
dispatch_dev('SvelteDOMSetProperty', { node, property, value });
|
||||
}
|
||||
function set_data_dev(text, data) {
|
||||
data = '' + data;
|
||||
if (text.wholeText === data)
|
||||
return;
|
||||
dispatch_dev('SvelteDOMSetData', { node: text, data });
|
||||
text.data = data;
|
||||
}
|
||||
function validate_each_argument(arg) {
|
||||
if (typeof arg !== 'string' && !(arg && typeof arg === 'object' && 'length' in arg)) {
|
||||
let msg = '{#each} only iterates over array-like objects.';
|
||||
if (typeof Symbol === 'function' && arg && Symbol.iterator in arg) {
|
||||
msg += ' You can use a spread to convert this iterable into an array.';
|
||||
}
|
||||
throw new Error(msg);
|
||||
}
|
||||
}
|
||||
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}".`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export { validate_each_argument as A, text as B, set_data_dev as C, destroy_each as D, prop_dev as E, set_style as F, svg_element as G, is_function as H, HtmlTag as I, afterUpdate as J, set_input_value as K, SvelteElement as S, attribute_to_object as a, insert_dev as b, setContext as c, dispatch_dev as d, globals as e, element as f, getContext as g, space as h, init as i, add_location as j, attr_dev as k, append_dev as l, listen_dev as m, noop as n, onMount as o, detach_dev as p, binding_callbacks as q, run_all as r, safe_not_equal as s, flush as t, src_url_equal as u, validate_slots as v, validate_store as w, component_subscribe as x, empty as y, set_custom_element_data as z };
|
53
Server/public/js/components/index-ee911aff.js
Normal file
53
Server/public/js/components/index-ee911aff.js
Normal file
@@ -0,0 +1,53 @@
|
||||
|
||||
(function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
|
||||
import { n as noop, s as safe_not_equal } from './index-6b4fe380.js';
|
||||
|
||||
const subscriber_queue = [];
|
||||
/**
|
||||
* 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 = new Set();
|
||||
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 (const subscriber of subscribers) {
|
||||
subscriber[1]();
|
||||
subscriber_queue.push(subscriber, 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.add(subscriber);
|
||||
if (subscribers.size === 1) {
|
||||
stop = start(set) || noop;
|
||||
}
|
||||
run(value);
|
||||
return () => {
|
||||
subscribers.delete(subscriber);
|
||||
if (subscribers.size === 0) {
|
||||
stop();
|
||||
stop = null;
|
||||
}
|
||||
};
|
||||
}
|
||||
return { set, update, subscribe };
|
||||
}
|
||||
|
||||
export { writable as w };
|
53
Server/public/js/components/index-f9998ce7.js
Normal file
53
Server/public/js/components/index-f9998ce7.js
Normal file
@@ -0,0 +1,53 @@
|
||||
|
||||
(function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
|
||||
import { n as noop, s as safe_not_equal } from './index-998178c7.js';
|
||||
|
||||
const subscriber_queue = [];
|
||||
/**
|
||||
* 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 = new Set();
|
||||
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 (const subscriber of subscribers) {
|
||||
subscriber[1]();
|
||||
subscriber_queue.push(subscriber, 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.add(subscriber);
|
||||
if (subscribers.size === 1) {
|
||||
stop = start(set) || noop;
|
||||
}
|
||||
run(value);
|
||||
return () => {
|
||||
subscribers.delete(subscriber);
|
||||
if (subscribers.size === 0) {
|
||||
stop();
|
||||
stop = null;
|
||||
}
|
||||
};
|
||||
}
|
||||
return { set, update, subscribe };
|
||||
}
|
||||
|
||||
export { writable as w };
|
53
Server/public/js/components/index-fb9750f3.js
Normal file
53
Server/public/js/components/index-fb9750f3.js
Normal file
@@ -0,0 +1,53 @@
|
||||
|
||||
(function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
|
||||
import { n as noop, s as safe_not_equal } from './index-122ecbb4.js';
|
||||
|
||||
const subscriber_queue = [];
|
||||
/**
|
||||
* 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 = new Set();
|
||||
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 (const subscriber of subscribers) {
|
||||
subscriber[1]();
|
||||
subscriber_queue.push(subscriber, 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.add(subscriber);
|
||||
if (subscribers.size === 1) {
|
||||
stop = start(set) || noop;
|
||||
}
|
||||
run(value);
|
||||
return () => {
|
||||
subscribers.delete(subscriber);
|
||||
if (subscribers.size === 0) {
|
||||
stop();
|
||||
stop = null;
|
||||
}
|
||||
};
|
||||
}
|
||||
return { set, update, subscribe };
|
||||
}
|
||||
|
||||
export { writable as w };
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1,362 @@
|
||||
import{S as t,i as e,a as s,b as o,v as n,s as r,g as i,n as a,j as l,d as c,u as p,o as u,h,t as d,w as m,m as f,p as g,q as y,f as $}from"./index-8c09578c.js";import{pullLegendData as b}from"../../../../../../../../../js/predict/charts.js";function w(t,e,s){const o=t.slice();return o[10]=e[s],o[11]=e,o[12]=s,o}function x(t){let e,s,n,r,a,p,u,$,b=t[10].name+"",w=t[12];const x=()=>t[6](e,w),k=()=>t[6](null,w);function j(){return t[7](t[12])}return{c(){e=i("button"),s=i("div"),n=h(),r=i("span"),a=d(b),p=h(),l(s,"class","marker"),m(s,"background-color",t[10].color)},m(t,i){o(t,e,i),f(e,s),f(e,n),f(e,r),f(r,a),f(e,p),x(),u||($=g(e,"click",j),u=!0)},p(e,o){t=e,1&o&&m(s,"background-color",t[10].color),1&o&&b!==(b=t[10].name+"")&&y(a,b),w!==t[12]&&(k(),w=t[12],x())},d(t){t&&c(e),k(),u=!1,$()}}}function k(t){let e,s=t[0],n=[];for(let e=0;e<s.length;e+=1)n[e]=x(w(t,s,e));return{c(){e=i("div");for(let t=0;t<n.length;t+=1)n[t].c();this.c=a,l(e,"class","legend")},m(t,s){o(t,e,s);for(let t=0;t<n.length;t+=1)n[t].m(e,null)},p(t,[o]){if(7&o){let r;for(s=t[0],r=0;r<s.length;r+=1){const i=w(t,s,r);n[r]?n[r].p(i,o):(n[r]=x(i),n[r].c(),n[r].m(e,null))}for(;r<n.length;r+=1)n[r].d(1);n.length=s.length}},i:a,o:a,d(t){t&&c(e),p(n,t)}}}function j(t,e,s){let o,{option:n=null}=e,{chart:r=null}=e,{data:i={}}=e,a=[],l=[];function c(){if(null==n||null==n||null==r||null==r)setTimeout(c,100);else{s(0,a=b(a,n));for(let t of a)s(3,i[t.name]=!0,i);o=Object.keys(i)}}function p(t){s(3,i[o[t]]=!i[o[t]],i);let e=[],a=n.series.map((t=>t._id)),c=a[t];for(let t=0;t<a.length;t++)a[t]==c&&e.push(t);for(let t of e){let o=n.series[t];o.tooltip.show?(o.lineStyle.opacity=0,o.itemStyle.opacity=0,o.tooltip.show=!1,s(1,l[e[0]].style.opacity=.5,l)):(o.lineStyle.opacity=1,o.itemStyle.opacity=1,o.tooltip.show=!0,s(1,l[e[0]].style.opacity=1,l))}r.setOption(n)}u((()=>{c()}));return t.$$set=t=>{"option"in t&&s(4,n=t.option),"chart"in t&&s(5,r=t.chart),"data"in t&&s(3,i=t.data)},[a,l,p,i,n,r,function(t,e){$[t?"unshift":"push"]((()=>{l[e]=t,s(1,l)}))},t=>p(t)]}class v extends t{constructor(t){super(),this.shadowRoot.innerHTML="<style>@import '/css/common.css';@import '/css/test-basic.css';button{cursor:pointer}.legend{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:1rem}.legend *{font-family:var(--sans-serif)}.marker{position:relative;display:inline-block;margin-right:0.5rem;top:0.1rem;width:1rem;height:1rem;border-radius:1rem}</style>",e(this,{target:this.shadowRoot,props:s(this.attributes),customElement:!0},j,k,r,{option:4,chart:5,data:3},null),t&&(t.target&&o(t.target,this,t.anchor),t.props&&(this.$set(t.props),n()))}static get observedAttributes(){return["option","chart","data"]}get option(){return this.$$.ctx[4]}set option(t){this.$$set({option:t}),n()}get chart(){return this.$$.ctx[5]}set chart(t){this.$$set({chart:t}),n()}get data(){return this.$$.ctx[3]}set data(t){this.$$set({data:t}),n()}}customElements.define("legend-component",v);export{v as default};
|
||||
|
||||
(function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
|
||||
import { S as SvelteElement, i as init, a as attribute_to_object, b as insert_dev, t as flush, s as safe_not_equal, A as validate_each_argument, d as dispatch_dev, v as validate_slots, o as onMount, e as globals, f as element, n as noop, k as attr_dev, j as add_location, p as detach_dev, D as destroy_each, q as binding_callbacks, h as space, B as text, F as set_style, l as append_dev, m as listen_dev, C as set_data_dev } from './index-998178c7.js';
|
||||
import { pullLegendData } from '../../../../../../../../../js/predict/charts.js';
|
||||
|
||||
/* src\components\legend-component.svelte generated by Svelte v3.52.0 */
|
||||
|
||||
const { Object: Object_1 } = globals;
|
||||
const file = "src\\components\\legend-component.svelte";
|
||||
|
||||
function get_each_context(ctx, list, i) {
|
||||
const child_ctx = ctx.slice();
|
||||
child_ctx[10] = list[i];
|
||||
child_ctx[11] = list;
|
||||
child_ctx[12] = i;
|
||||
return child_ctx;
|
||||
}
|
||||
|
||||
// (69:4) {#each legendData as item, i}
|
||||
function create_each_block(ctx) {
|
||||
let button;
|
||||
let div;
|
||||
let t0;
|
||||
let span;
|
||||
let t1_value = /*item*/ ctx[10].name + "";
|
||||
let t1;
|
||||
let t2;
|
||||
let i = /*i*/ ctx[12];
|
||||
let mounted;
|
||||
let dispose;
|
||||
const assign_button = () => /*button_binding*/ ctx[6](button, i);
|
||||
const unassign_button = () => /*button_binding*/ ctx[6](null, i);
|
||||
|
||||
function click_handler() {
|
||||
return /*click_handler*/ ctx[7](/*i*/ ctx[12]);
|
||||
}
|
||||
|
||||
const block = {
|
||||
c: function create() {
|
||||
button = element("button");
|
||||
div = element("div");
|
||||
t0 = space();
|
||||
span = element("span");
|
||||
t1 = text(t1_value);
|
||||
t2 = space();
|
||||
attr_dev(div, "class", "marker");
|
||||
set_style(div, "background-color", /*item*/ ctx[10].color);
|
||||
add_location(div, file, 70, 12, 1892);
|
||||
add_location(span, file, 71, 12, 1971);
|
||||
add_location(button, file, 69, 8, 1814);
|
||||
},
|
||||
m: function mount(target, anchor) {
|
||||
insert_dev(target, button, anchor);
|
||||
append_dev(button, div);
|
||||
append_dev(button, t0);
|
||||
append_dev(button, span);
|
||||
append_dev(span, t1);
|
||||
append_dev(button, t2);
|
||||
assign_button();
|
||||
|
||||
if (!mounted) {
|
||||
dispose = listen_dev(button, "click", click_handler, false, false, false);
|
||||
mounted = true;
|
||||
}
|
||||
},
|
||||
p: function update(new_ctx, dirty) {
|
||||
ctx = new_ctx;
|
||||
|
||||
if (dirty & /*legendData*/ 1) {
|
||||
set_style(div, "background-color", /*item*/ ctx[10].color);
|
||||
}
|
||||
|
||||
if (dirty & /*legendData*/ 1 && t1_value !== (t1_value = /*item*/ ctx[10].name + "")) set_data_dev(t1, t1_value);
|
||||
|
||||
if (i !== /*i*/ ctx[12]) {
|
||||
unassign_button();
|
||||
i = /*i*/ ctx[12];
|
||||
assign_button();
|
||||
}
|
||||
},
|
||||
d: function destroy(detaching) {
|
||||
if (detaching) detach_dev(button);
|
||||
unassign_button();
|
||||
mounted = false;
|
||||
dispose();
|
||||
}
|
||||
};
|
||||
|
||||
dispatch_dev("SvelteRegisterBlock", {
|
||||
block,
|
||||
id: create_each_block.name,
|
||||
type: "each",
|
||||
source: "(69:4) {#each legendData as item, i}",
|
||||
ctx
|
||||
});
|
||||
|
||||
return block;
|
||||
}
|
||||
|
||||
function create_fragment(ctx) {
|
||||
let div;
|
||||
let each_value = /*legendData*/ ctx[0];
|
||||
validate_each_argument(each_value);
|
||||
let each_blocks = [];
|
||||
|
||||
for (let i = 0; i < each_value.length; i += 1) {
|
||||
each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i));
|
||||
}
|
||||
|
||||
const block = {
|
||||
c: function create() {
|
||||
div = element("div");
|
||||
|
||||
for (let i = 0; i < each_blocks.length; i += 1) {
|
||||
each_blocks[i].c();
|
||||
}
|
||||
|
||||
this.c = noop;
|
||||
attr_dev(div, "class", "legend");
|
||||
add_location(div, file, 67, 0, 1749);
|
||||
},
|
||||
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, div, anchor);
|
||||
|
||||
for (let i = 0; i < each_blocks.length; i += 1) {
|
||||
each_blocks[i].m(div, null);
|
||||
}
|
||||
},
|
||||
p: function update(ctx, [dirty]) {
|
||||
if (dirty & /*buttons, toggleSeries, legendData*/ 7) {
|
||||
each_value = /*legendData*/ ctx[0];
|
||||
validate_each_argument(each_value);
|
||||
let i;
|
||||
|
||||
for (i = 0; i < each_value.length; i += 1) {
|
||||
const child_ctx = get_each_context(ctx, each_value, i);
|
||||
|
||||
if (each_blocks[i]) {
|
||||
each_blocks[i].p(child_ctx, dirty);
|
||||
} else {
|
||||
each_blocks[i] = create_each_block(child_ctx);
|
||||
each_blocks[i].c();
|
||||
each_blocks[i].m(div, null);
|
||||
}
|
||||
}
|
||||
|
||||
for (; i < each_blocks.length; i += 1) {
|
||||
each_blocks[i].d(1);
|
||||
}
|
||||
|
||||
each_blocks.length = each_value.length;
|
||||
}
|
||||
},
|
||||
i: noop,
|
||||
o: noop,
|
||||
d: function destroy(detaching) {
|
||||
if (detaching) detach_dev(div);
|
||||
destroy_each(each_blocks, detaching);
|
||||
}
|
||||
};
|
||||
|
||||
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('legend-component', slots, []);
|
||||
let { option = null } = $$props;
|
||||
let { chart = null } = $$props;
|
||||
let { data = {} } = $$props;
|
||||
|
||||
// Main code
|
||||
let legendData = [];
|
||||
|
||||
let buttons = [];
|
||||
let dataKeys;
|
||||
|
||||
function init() {
|
||||
if (option == null || option == undefined || chart == null || chart == undefined) {
|
||||
setTimeout(init, 100);
|
||||
} else {
|
||||
$$invalidate(0, legendData = pullLegendData(legendData, option));
|
||||
|
||||
for (let obj of legendData) {
|
||||
$$invalidate(3, data[obj.name] = true, data);
|
||||
}
|
||||
|
||||
dataKeys = Object.keys(data);
|
||||
}
|
||||
}
|
||||
|
||||
function toggleSeries(i) {
|
||||
$$invalidate(3, data[dataKeys[i]] = !data[dataKeys[i]], data);
|
||||
let inds = [];
|
||||
let ids = option.series.map(x => x._id);
|
||||
let id = ids[i];
|
||||
|
||||
for (let j = 0; j < ids.length; j++) {
|
||||
if (ids[j] == id) {
|
||||
inds.push(j);
|
||||
}
|
||||
}
|
||||
|
||||
for (let i of inds) {
|
||||
let series = option.series[i];
|
||||
|
||||
if (!series.tooltip.show) {
|
||||
series.lineStyle.opacity = 1;
|
||||
series.itemStyle.opacity = 1;
|
||||
series.tooltip.show = true;
|
||||
$$invalidate(1, buttons[inds[0]].style.opacity = 1, buttons);
|
||||
} else {
|
||||
series.lineStyle.opacity = 0;
|
||||
series.itemStyle.opacity = 0;
|
||||
series.tooltip.show = false;
|
||||
$$invalidate(1, buttons[inds[0]].style.opacity = 0.5, buttons);
|
||||
}
|
||||
}
|
||||
|
||||
chart.setOption(option);
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
init();
|
||||
});
|
||||
|
||||
const writable_props = ['option', 'chart', 'data'];
|
||||
|
||||
Object_1.keys($$props).forEach(key => {
|
||||
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(`<legend-component> was created with unknown prop '${key}'`);
|
||||
});
|
||||
|
||||
function button_binding($$value, i) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
buttons[i] = $$value;
|
||||
$$invalidate(1, buttons);
|
||||
});
|
||||
}
|
||||
|
||||
const click_handler = i => toggleSeries(i);
|
||||
|
||||
$$self.$$set = $$props => {
|
||||
if ('option' in $$props) $$invalidate(4, option = $$props.option);
|
||||
if ('chart' in $$props) $$invalidate(5, chart = $$props.chart);
|
||||
if ('data' in $$props) $$invalidate(3, data = $$props.data);
|
||||
};
|
||||
|
||||
$$self.$capture_state = () => ({
|
||||
onMount,
|
||||
pullLegendData,
|
||||
option,
|
||||
chart,
|
||||
data,
|
||||
legendData,
|
||||
buttons,
|
||||
dataKeys,
|
||||
init,
|
||||
toggleSeries
|
||||
});
|
||||
|
||||
$$self.$inject_state = $$props => {
|
||||
if ('option' in $$props) $$invalidate(4, option = $$props.option);
|
||||
if ('chart' in $$props) $$invalidate(5, chart = $$props.chart);
|
||||
if ('data' in $$props) $$invalidate(3, data = $$props.data);
|
||||
if ('legendData' in $$props) $$invalidate(0, legendData = $$props.legendData);
|
||||
if ('buttons' in $$props) $$invalidate(1, buttons = $$props.buttons);
|
||||
if ('dataKeys' in $$props) dataKeys = $$props.dataKeys;
|
||||
};
|
||||
|
||||
if ($$props && "$$inject" in $$props) {
|
||||
$$self.$inject_state($$props.$$inject);
|
||||
}
|
||||
|
||||
return [
|
||||
legendData,
|
||||
buttons,
|
||||
toggleSeries,
|
||||
data,
|
||||
option,
|
||||
chart,
|
||||
button_binding,
|
||||
click_handler
|
||||
];
|
||||
}
|
||||
|
||||
class Legend_component extends SvelteElement {
|
||||
constructor(options) {
|
||||
super();
|
||||
this.shadowRoot.innerHTML = `<style>@import '/css/common.css';@import '/css/test-basic.css';button{cursor:pointer}.legend{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:1rem}.legend *{font-family:var(--sans-serif)}.marker{position:relative;display:inline-block;margin-right:0.5rem;top:0.1rem;width:1rem;height:1rem;border-radius:1rem}</style>`;
|
||||
|
||||
init(
|
||||
this,
|
||||
{
|
||||
target: this.shadowRoot,
|
||||
props: attribute_to_object(this.attributes),
|
||||
customElement: true
|
||||
},
|
||||
instance,
|
||||
create_fragment,
|
||||
safe_not_equal,
|
||||
{ option: 4, chart: 5, data: 3 },
|
||||
null
|
||||
);
|
||||
|
||||
if (options) {
|
||||
if (options.target) {
|
||||
insert_dev(options.target, this, options.anchor);
|
||||
}
|
||||
|
||||
if (options.props) {
|
||||
this.$set(options.props);
|
||||
flush();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static get observedAttributes() {
|
||||
return ["option", "chart", "data"];
|
||||
}
|
||||
|
||||
get option() {
|
||||
return this.$$.ctx[4];
|
||||
}
|
||||
|
||||
set option(option) {
|
||||
this.$$set({ option });
|
||||
flush();
|
||||
}
|
||||
|
||||
get chart() {
|
||||
return this.$$.ctx[5];
|
||||
}
|
||||
|
||||
set chart(chart) {
|
||||
this.$$set({ chart });
|
||||
flush();
|
||||
}
|
||||
|
||||
get data() {
|
||||
return this.$$.ctx[3];
|
||||
}
|
||||
|
||||
set data(data) {
|
||||
this.$$set({ data });
|
||||
flush();
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define("legend-component", Legend_component);
|
||||
|
||||
export { Legend_component as default };
|
||||
|
@@ -1 +1,115 @@
|
||||
import{S as t,i as s,a as e,b as n,s as o,g as a,n as i,j as r,w as d,d as c,o as u,f as l}from"./index-8c09578c.js";function h(t){let s;return{c(){s=a("div"),this.c=i,r(s,"id","loadscreen"),d(s,"width","100%"),d(s,"height","100%"),d(s,"background","white"),d(s,"position","absolute"),d(s,"z-index","100000")},m(e,o){n(e,s,o),t[1](s)},p:i,i:i,o:i,d(e){e&&c(s),t[1](null)}}}function p(t,s,e){let n;return u((()=>{window.addEventListener("load",(function(){e(0,n.parentNode.host.style.display="none",n)}))})),[n,function(t){l[t?"unshift":"push"]((()=>{n=t,e(0,n)}))}]}class f extends t{constructor(t){super(),s(this,{target:this.shadowRoot,props:e(this.attributes),customElement:!0},p,h,o,{},null),t&&t.target&&n(t.target,this,t.anchor)}}customElements.define("loadscreen-component",f);export{f as default};
|
||||
|
||||
(function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
|
||||
import { S as SvelteElement, i as init, a as attribute_to_object, b as insert_dev, s as safe_not_equal, d as dispatch_dev, v as validate_slots, o as onMount, f as element, n as noop, k as attr_dev, F as set_style, j as add_location, p as detach_dev, q as binding_callbacks } from './index-998178c7.js';
|
||||
|
||||
/* src\components\loadscreen-component.svelte generated by Svelte v3.52.0 */
|
||||
const file = "src\\components\\loadscreen-component.svelte";
|
||||
|
||||
function create_fragment(ctx) {
|
||||
let div;
|
||||
|
||||
const block = {
|
||||
c: function create() {
|
||||
div = element("div");
|
||||
this.c = noop;
|
||||
attr_dev(div, "id", "loadscreen");
|
||||
set_style(div, "width", "100%");
|
||||
set_style(div, "height", "100%");
|
||||
set_style(div, "background", "white");
|
||||
set_style(div, "position", "absolute");
|
||||
set_style(div, "z-index", "100000");
|
||||
add_location(div, file, 20, 0, 366);
|
||||
},
|
||||
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, div, anchor);
|
||||
/*div_binding*/ ctx[1](div);
|
||||
},
|
||||
p: noop,
|
||||
i: noop,
|
||||
o: noop,
|
||||
d: function destroy(detaching) {
|
||||
if (detaching) detach_dev(div);
|
||||
/*div_binding*/ ctx[1](null);
|
||||
}
|
||||
};
|
||||
|
||||
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('loadscreen-component', slots, []);
|
||||
let loadscreen;
|
||||
|
||||
onMount(() => {
|
||||
window.addEventListener('load', function () {
|
||||
$$invalidate(0, loadscreen.parentNode.host.style.display = "none", loadscreen);
|
||||
});
|
||||
});
|
||||
|
||||
const writable_props = [];
|
||||
|
||||
Object.keys($$props).forEach(key => {
|
||||
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(`<loadscreen-component> was created with unknown prop '${key}'`);
|
||||
});
|
||||
|
||||
function div_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
loadscreen = $$value;
|
||||
$$invalidate(0, loadscreen);
|
||||
});
|
||||
}
|
||||
|
||||
$$self.$capture_state = () => ({ onMount, loadscreen });
|
||||
|
||||
$$self.$inject_state = $$props => {
|
||||
if ('loadscreen' in $$props) $$invalidate(0, loadscreen = $$props.loadscreen);
|
||||
};
|
||||
|
||||
if ($$props && "$$inject" in $$props) {
|
||||
$$self.$inject_state($$props.$$inject);
|
||||
}
|
||||
|
||||
return [loadscreen, div_binding];
|
||||
}
|
||||
|
||||
class Loadscreen_component extends SvelteElement {
|
||||
constructor(options) {
|
||||
super();
|
||||
|
||||
init(
|
||||
this,
|
||||
{
|
||||
target: this.shadowRoot,
|
||||
props: attribute_to_object(this.attributes),
|
||||
customElement: true
|
||||
},
|
||||
instance,
|
||||
create_fragment,
|
||||
safe_not_equal,
|
||||
{},
|
||||
null
|
||||
);
|
||||
|
||||
if (options) {
|
||||
if (options.target) {
|
||||
insert_dev(options.target, this, options.anchor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define("loadscreen-component", Loadscreen_component);
|
||||
|
||||
export { Loadscreen_component as default };
|
||||
|
448
Server/public/js/components/login-component.js
Normal file
448
Server/public/js/components/login-component.js
Normal file
@@ -0,0 +1,448 @@
|
||||
|
||||
(function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
|
||||
import { S as SvelteElement, i as init, a as attribute_to_object, b as insert_dev, t as flush, s as safe_not_equal, d as dispatch_dev, v as validate_slots, g as getContext, o as onMount, f as element, h as space, n as noop, k as attr_dev, j as add_location, u as src_url_equal, l as append_dev, m as listen_dev, p as detach_dev, r as run_all, q as binding_callbacks } from './index-998178c7.js';
|
||||
import * as AuthTools from '../../../../../../../../../js/libraries/authTools.js';
|
||||
|
||||
/* src\auth\login-component.svelte generated by Svelte v3.52.0 */
|
||||
const file = "src\\auth\\login-component.svelte";
|
||||
|
||||
function create_fragment(ctx) {
|
||||
let div5;
|
||||
let h2;
|
||||
let t1;
|
||||
let label0;
|
||||
let span0;
|
||||
let t3;
|
||||
let input0;
|
||||
let t4;
|
||||
let div0;
|
||||
let label1;
|
||||
let span1;
|
||||
let t6;
|
||||
let input1;
|
||||
let t7;
|
||||
let button0;
|
||||
let object;
|
||||
let t8;
|
||||
let div1;
|
||||
let input2;
|
||||
let label2;
|
||||
let t10;
|
||||
let button1;
|
||||
let t12;
|
||||
let a;
|
||||
let t14;
|
||||
let hr;
|
||||
let t15;
|
||||
let div4;
|
||||
let div3;
|
||||
let div2;
|
||||
let t16;
|
||||
let img;
|
||||
let img_src_value;
|
||||
let mounted;
|
||||
let dispose;
|
||||
|
||||
const block = {
|
||||
c: function create() {
|
||||
div5 = element("div");
|
||||
h2 = element("h2");
|
||||
h2.textContent = "LOG IN";
|
||||
t1 = space();
|
||||
label0 = element("label");
|
||||
label0.textContent = "Email ";
|
||||
span0 = element("span");
|
||||
t3 = space();
|
||||
input0 = element("input");
|
||||
t4 = space();
|
||||
div0 = element("div");
|
||||
label1 = element("label");
|
||||
label1.textContent = "Password ";
|
||||
span1 = element("span");
|
||||
t6 = space();
|
||||
input1 = element("input");
|
||||
t7 = space();
|
||||
button0 = element("button");
|
||||
object = element("object");
|
||||
t8 = space();
|
||||
div1 = element("div");
|
||||
input2 = element("input");
|
||||
label2 = element("label");
|
||||
label2.textContent = "remember me";
|
||||
t10 = space();
|
||||
button1 = element("button");
|
||||
button1.textContent = "Log in";
|
||||
t12 = space();
|
||||
a = element("a");
|
||||
a.textContent = "Forgot password?";
|
||||
t14 = space();
|
||||
hr = element("hr");
|
||||
t15 = space();
|
||||
div4 = element("div");
|
||||
div3 = element("div");
|
||||
div2 = element("div");
|
||||
t16 = space();
|
||||
img = element("img");
|
||||
this.c = noop;
|
||||
attr_dev(h2, "class", "auth-title");
|
||||
add_location(h2, file, 68, 4, 1639);
|
||||
attr_dev(label0, "class", "auth-label");
|
||||
attr_dev(label0, "for", "emailInput");
|
||||
add_location(label0, file, 69, 4, 1679);
|
||||
attr_dev(span0, "id", "email-msg");
|
||||
add_location(span0, file, 69, 66, 1741);
|
||||
attr_dev(input0, "id", "emailInput");
|
||||
attr_dev(input0, "class", "authEmailInput");
|
||||
attr_dev(input0, "type", "email");
|
||||
add_location(input0, file, 70, 4, 1796);
|
||||
attr_dev(label1, "class", "auth-label");
|
||||
attr_dev(label1, "for", "passwordInput");
|
||||
add_location(label1, file, 72, 8, 1922);
|
||||
attr_dev(span1, "id", "password-msg");
|
||||
add_location(span1, file, 72, 76, 1990);
|
||||
attr_dev(input1, "id", "passwordInput");
|
||||
attr_dev(input1, "class", "authPasswordInput");
|
||||
attr_dev(input1, "type", "password");
|
||||
add_location(input1, file, 73, 8, 2055);
|
||||
attr_dev(object, "type", "image/svg+xml");
|
||||
attr_dev(object, "data", "/img/auth/eye_icon.svg");
|
||||
attr_dev(object, "title", "eye icon");
|
||||
add_location(object, file, 75, 12, 2316);
|
||||
attr_dev(button0, "class", "eye-icon");
|
||||
add_location(button0, file, 74, 8, 2160);
|
||||
attr_dev(div0, "class", "password-field");
|
||||
add_location(div0, file, 71, 4, 1884);
|
||||
attr_dev(input2, "type", "checkbox");
|
||||
attr_dev(input2, "id", "remember-me-checkbox");
|
||||
add_location(input2, file, 79, 8, 2470);
|
||||
attr_dev(label2, "id", "remember-me-label");
|
||||
attr_dev(label2, "for", "passwordInput");
|
||||
add_location(label2, file, 79, 80, 2542);
|
||||
attr_dev(div1, "id", "remember-me");
|
||||
add_location(div1, file, 78, 4, 2438);
|
||||
attr_dev(button1, "class", "auth-button");
|
||||
add_location(button1, file, 81, 4, 2629);
|
||||
attr_dev(a, "id", "forgot-password");
|
||||
attr_dev(a, "href", "forgot-password");
|
||||
add_location(a, file, 82, 4, 2726);
|
||||
attr_dev(hr, "class", "auth-line");
|
||||
add_location(hr, file, 83, 4, 2799);
|
||||
attr_dev(div2, "id", "google-btn");
|
||||
add_location(div2, file, 86, 12, 2912);
|
||||
if (!src_url_equal(img.src, img_src_value = "/img/auth/google_icon.svg")) attr_dev(img, "src", img_src_value);
|
||||
attr_dev(img, "id", "google-logo");
|
||||
attr_dev(img, "alt", "google icon");
|
||||
add_location(img, file, 87, 12, 2978);
|
||||
attr_dev(div3, "id", "google-btn-wrapper");
|
||||
add_location(div3, file, 85, 8, 2869);
|
||||
attr_dev(div4, "class", "auth-methods-group");
|
||||
add_location(div4, file, 84, 4, 2827);
|
||||
attr_dev(div5, "id", "login-group");
|
||||
attr_dev(div5, "class", "pane auth-pane");
|
||||
add_location(div5, file, 67, 0, 1589);
|
||||
},
|
||||
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, div5, anchor);
|
||||
append_dev(div5, h2);
|
||||
append_dev(div5, t1);
|
||||
append_dev(div5, label0);
|
||||
append_dev(div5, span0);
|
||||
/*span0_binding*/ ctx[10](span0);
|
||||
append_dev(div5, t3);
|
||||
append_dev(div5, input0);
|
||||
/*input0_binding*/ ctx[11](input0);
|
||||
append_dev(div5, t4);
|
||||
append_dev(div5, div0);
|
||||
append_dev(div0, label1);
|
||||
append_dev(div0, span1);
|
||||
/*span1_binding*/ ctx[12](span1);
|
||||
append_dev(div0, t6);
|
||||
append_dev(div0, input1);
|
||||
/*input1_binding*/ ctx[13](input1);
|
||||
append_dev(div0, t7);
|
||||
append_dev(div0, button0);
|
||||
append_dev(button0, object);
|
||||
/*button0_binding*/ ctx[14](button0);
|
||||
append_dev(div5, t8);
|
||||
append_dev(div5, div1);
|
||||
append_dev(div1, input2);
|
||||
/*input2_binding*/ ctx[16](input2);
|
||||
append_dev(div1, label2);
|
||||
append_dev(div5, t10);
|
||||
append_dev(div5, button1);
|
||||
append_dev(div5, t12);
|
||||
append_dev(div5, a);
|
||||
append_dev(div5, t14);
|
||||
append_dev(div5, hr);
|
||||
append_dev(div5, t15);
|
||||
append_dev(div5, div4);
|
||||
append_dev(div4, div3);
|
||||
append_dev(div3, div2);
|
||||
/*div2_binding*/ ctx[18](div2);
|
||||
append_dev(div3, t16);
|
||||
append_dev(div3, img);
|
||||
|
||||
if (!mounted) {
|
||||
dispose = [
|
||||
listen_dev(button0, "click", /*click_handler*/ ctx[15], false, false, false),
|
||||
listen_dev(button1, "click", /*click_handler_1*/ ctx[17], false, false, false)
|
||||
];
|
||||
|
||||
mounted = true;
|
||||
}
|
||||
},
|
||||
p: noop,
|
||||
i: noop,
|
||||
o: noop,
|
||||
d: function destroy(detaching) {
|
||||
if (detaching) detach_dev(div5);
|
||||
/*span0_binding*/ ctx[10](null);
|
||||
/*input0_binding*/ ctx[11](null);
|
||||
/*span1_binding*/ ctx[12](null);
|
||||
/*input1_binding*/ ctx[13](null);
|
||||
/*button0_binding*/ ctx[14](null);
|
||||
/*input2_binding*/ ctx[16](null);
|
||||
/*div2_binding*/ ctx[18](null);
|
||||
mounted = false;
|
||||
run_all(dispose);
|
||||
}
|
||||
};
|
||||
|
||||
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('login-component', slots, []);
|
||||
let { focused = false } = $$props;
|
||||
|
||||
// Main code
|
||||
let emailInput;
|
||||
|
||||
let passwordInput;
|
||||
let inputs;
|
||||
let passwordVisibilityButton;
|
||||
let emailMsg;
|
||||
let passwordMsg;
|
||||
let msgs;
|
||||
let rememberMe;
|
||||
let googleButton;
|
||||
let parentProps = getContext("auth");
|
||||
|
||||
function renderGoogle() {
|
||||
if (parentProps.googleInit) {
|
||||
google.accounts.id.renderButton(googleButton, { theme: 'outline', size: 'large' });
|
||||
let iframe = googleButton.getElementsByTagName('iframe')[0];
|
||||
iframe.style.height = "5rem";
|
||||
iframe.style.width = "5rem";
|
||||
} else {
|
||||
setTimeout(renderGoogle, 100);
|
||||
}
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
$$invalidate(7, rememberMe.checked = true, rememberMe);
|
||||
|
||||
$$invalidate(2, inputs = {
|
||||
email: emailInput,
|
||||
password: passwordInput,
|
||||
remember: rememberMe
|
||||
});
|
||||
|
||||
$$invalidate(6, msgs = { email: emailMsg, password: passwordMsg });
|
||||
parentProps.msgs = msgs;
|
||||
parentProps.remember = rememberMe;
|
||||
parentProps.loginGoogle = googleButton;
|
||||
|
||||
document.addEventListener("keypress", function (event) {
|
||||
if (event.code == "Enter") {
|
||||
if (focused) {
|
||||
AuthTools.login(msgs, inputs);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
renderGoogle();
|
||||
});
|
||||
|
||||
const writable_props = ['focused'];
|
||||
|
||||
Object.keys($$props).forEach(key => {
|
||||
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(`<login-component> was created with unknown prop '${key}'`);
|
||||
});
|
||||
|
||||
function span0_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
emailMsg = $$value;
|
||||
$$invalidate(4, emailMsg);
|
||||
});
|
||||
}
|
||||
|
||||
function input0_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
emailInput = $$value;
|
||||
$$invalidate(0, emailInput);
|
||||
});
|
||||
}
|
||||
|
||||
function span1_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
passwordMsg = $$value;
|
||||
$$invalidate(5, passwordMsg);
|
||||
});
|
||||
}
|
||||
|
||||
function input1_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
passwordInput = $$value;
|
||||
$$invalidate(1, passwordInput);
|
||||
});
|
||||
}
|
||||
|
||||
function button0_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
passwordVisibilityButton = $$value;
|
||||
$$invalidate(3, passwordVisibilityButton);
|
||||
});
|
||||
}
|
||||
|
||||
const click_handler = () => AuthTools.changePasswordVisibility(passwordVisibilityButton);
|
||||
|
||||
function input2_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
rememberMe = $$value;
|
||||
$$invalidate(7, rememberMe);
|
||||
});
|
||||
}
|
||||
|
||||
const click_handler_1 = () => AuthTools.login(msgs, inputs);
|
||||
|
||||
function div2_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
googleButton = $$value;
|
||||
$$invalidate(8, googleButton);
|
||||
});
|
||||
}
|
||||
|
||||
$$self.$$set = $$props => {
|
||||
if ('focused' in $$props) $$invalidate(9, focused = $$props.focused);
|
||||
};
|
||||
|
||||
$$self.$capture_state = () => ({
|
||||
onMount,
|
||||
getContext,
|
||||
AuthTools,
|
||||
focused,
|
||||
emailInput,
|
||||
passwordInput,
|
||||
inputs,
|
||||
passwordVisibilityButton,
|
||||
emailMsg,
|
||||
passwordMsg,
|
||||
msgs,
|
||||
rememberMe,
|
||||
googleButton,
|
||||
parentProps,
|
||||
renderGoogle
|
||||
});
|
||||
|
||||
$$self.$inject_state = $$props => {
|
||||
if ('focused' in $$props) $$invalidate(9, focused = $$props.focused);
|
||||
if ('emailInput' in $$props) $$invalidate(0, emailInput = $$props.emailInput);
|
||||
if ('passwordInput' in $$props) $$invalidate(1, passwordInput = $$props.passwordInput);
|
||||
if ('inputs' in $$props) $$invalidate(2, inputs = $$props.inputs);
|
||||
if ('passwordVisibilityButton' in $$props) $$invalidate(3, passwordVisibilityButton = $$props.passwordVisibilityButton);
|
||||
if ('emailMsg' in $$props) $$invalidate(4, emailMsg = $$props.emailMsg);
|
||||
if ('passwordMsg' in $$props) $$invalidate(5, passwordMsg = $$props.passwordMsg);
|
||||
if ('msgs' in $$props) $$invalidate(6, msgs = $$props.msgs);
|
||||
if ('rememberMe' in $$props) $$invalidate(7, rememberMe = $$props.rememberMe);
|
||||
if ('googleButton' in $$props) $$invalidate(8, googleButton = $$props.googleButton);
|
||||
if ('parentProps' in $$props) parentProps = $$props.parentProps;
|
||||
};
|
||||
|
||||
if ($$props && "$$inject" in $$props) {
|
||||
$$self.$inject_state($$props.$$inject);
|
||||
}
|
||||
|
||||
return [
|
||||
emailInput,
|
||||
passwordInput,
|
||||
inputs,
|
||||
passwordVisibilityButton,
|
||||
emailMsg,
|
||||
passwordMsg,
|
||||
msgs,
|
||||
rememberMe,
|
||||
googleButton,
|
||||
focused,
|
||||
span0_binding,
|
||||
input0_binding,
|
||||
span1_binding,
|
||||
input1_binding,
|
||||
button0_binding,
|
||||
click_handler,
|
||||
input2_binding,
|
||||
click_handler_1,
|
||||
div2_binding
|
||||
];
|
||||
}
|
||||
|
||||
class Login_component extends SvelteElement {
|
||||
constructor(options) {
|
||||
super();
|
||||
this.shadowRoot.innerHTML = `<style>@import '/css/common.css';@import '/css/auth.css';</style>`;
|
||||
|
||||
init(
|
||||
this,
|
||||
{
|
||||
target: this.shadowRoot,
|
||||
props: attribute_to_object(this.attributes),
|
||||
customElement: true
|
||||
},
|
||||
instance,
|
||||
create_fragment,
|
||||
safe_not_equal,
|
||||
{ focused: 9 },
|
||||
null
|
||||
);
|
||||
|
||||
if (options) {
|
||||
if (options.target) {
|
||||
insert_dev(options.target, this, options.anchor);
|
||||
}
|
||||
|
||||
if (options.props) {
|
||||
this.$set(options.props);
|
||||
flush();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static get observedAttributes() {
|
||||
return ["focused"];
|
||||
}
|
||||
|
||||
get focused() {
|
||||
return this.$$.ctx[9];
|
||||
}
|
||||
|
||||
set focused(focused) {
|
||||
this.$$set({ focused });
|
||||
flush();
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define("login-component", Login_component);
|
||||
|
||||
export { Login_component as default };
|
File diff suppressed because one or more lines are too long
@@ -1 +1,175 @@
|
||||
import{S as t,i as e,a as o,b as s,v as a,s as r,g as l,n as i,j as n,d as c,o as m,f as p}from"./index-8c09578c.js";function h(t){let e;return{c(){e=l("div"),this.c=i,n(e,"id","map")},m(o,a){s(o,e,a),t[3](e)},p:i,i:i,o:i,d(o){o&&c(e),t[3](null)}}}function u(t,e,o){let s,{callback:a=null}=e,{colors:r=null}=e;function l(t,e){let o=L.map(s,{center:t,zoom:e});return L.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',minNativeZoom:2,minZoom:2,maxNativeZoom:14,maxZoom:14}).addTo(o),o}return m((()=>{if(a(l),null!=r){let t=s.getElementsByClassName("leaflet-control-layers-overlays")[0].children;for(let e=0;e<t.length;e++)t[e].children[0].children[0].style.accentColor=r[e]}})),t.$$set=t=>{"callback"in t&&o(1,a=t.callback),"colors"in t&&o(2,r=t.colors)},[s,a,r,function(t){p[t?"unshift":"push"]((()=>{s=t,o(0,s)}))}]}class d extends t{constructor(t){super(),this.shadowRoot.innerHTML="<style>@import 'https://unpkg.com/leaflet@1.9.4/dist/leaflet.css';#map{height:var(--height);width:var(--width,100%);margin-top:var(--margin-top,0);margin-bottom:var(--margin-bottom,0);position:relative;z-index:0}</style>",e(this,{target:this.shadowRoot,props:o(this.attributes),customElement:!0},u,h,r,{callback:1,colors:2},null),t&&(t.target&&s(t.target,this,t.anchor),t.props&&(this.$set(t.props),a()))}static get observedAttributes(){return["callback","colors"]}get callback(){return this.$$.ctx[1]}set callback(t){this.$$set({callback:t}),a()}get colors(){return this.$$.ctx[2]}set colors(t){this.$$set({colors:t}),a()}}customElements.define("map-component",d);export{d as default};
|
||||
|
||||
(function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
|
||||
import { S as SvelteElement, i as init, a as attribute_to_object, b as insert_dev, t as flush, s as safe_not_equal, d as dispatch_dev, v as validate_slots, o as onMount, f as element, n as noop, k as attr_dev, j as add_location, p as detach_dev, q as binding_callbacks } from './index-998178c7.js';
|
||||
|
||||
/* src\components\map-component.svelte generated by Svelte v3.52.0 */
|
||||
const file = "src\\components\\map-component.svelte";
|
||||
|
||||
function create_fragment(ctx) {
|
||||
let div;
|
||||
|
||||
const block = {
|
||||
c: function create() {
|
||||
div = element("div");
|
||||
this.c = noop;
|
||||
attr_dev(div, "id", "map");
|
||||
add_location(div, file, 41, 0, 1151);
|
||||
},
|
||||
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, div, anchor);
|
||||
/*div_binding*/ ctx[3](div);
|
||||
},
|
||||
p: noop,
|
||||
i: noop,
|
||||
o: noop,
|
||||
d: function destroy(detaching) {
|
||||
if (detaching) detach_dev(div);
|
||||
/*div_binding*/ ctx[3](null);
|
||||
}
|
||||
};
|
||||
|
||||
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('map-component', slots, []);
|
||||
let { callback = null } = $$props;
|
||||
let { colors = null } = $$props;
|
||||
|
||||
// Main code
|
||||
let mapContainer;
|
||||
|
||||
function createMap(center, zoom) {
|
||||
let map = L.map(mapContainer, { center, zoom });
|
||||
|
||||
L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
||||
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
|
||||
minNativeZoom: 2,
|
||||
minZoom: 2,
|
||||
maxNativeZoom: 14,
|
||||
maxZoom: 14
|
||||
}).addTo(map);
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
callback(createMap);
|
||||
|
||||
if (colors != null) {
|
||||
let els = mapContainer.getElementsByClassName("leaflet-control-layers-overlays")[0].children;
|
||||
|
||||
for (let i = 0; i < els.length; i++) {
|
||||
els[i].children[0].children[0].style.accentColor = colors[i];
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const writable_props = ['callback', 'colors'];
|
||||
|
||||
Object.keys($$props).forEach(key => {
|
||||
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(`<map-component> was created with unknown prop '${key}'`);
|
||||
});
|
||||
|
||||
function div_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
mapContainer = $$value;
|
||||
$$invalidate(0, mapContainer);
|
||||
});
|
||||
}
|
||||
|
||||
$$self.$$set = $$props => {
|
||||
if ('callback' in $$props) $$invalidate(1, callback = $$props.callback);
|
||||
if ('colors' in $$props) $$invalidate(2, colors = $$props.colors);
|
||||
};
|
||||
|
||||
$$self.$capture_state = () => ({
|
||||
onMount,
|
||||
callback,
|
||||
colors,
|
||||
mapContainer,
|
||||
createMap
|
||||
});
|
||||
|
||||
$$self.$inject_state = $$props => {
|
||||
if ('callback' in $$props) $$invalidate(1, callback = $$props.callback);
|
||||
if ('colors' in $$props) $$invalidate(2, colors = $$props.colors);
|
||||
if ('mapContainer' in $$props) $$invalidate(0, mapContainer = $$props.mapContainer);
|
||||
};
|
||||
|
||||
if ($$props && "$$inject" in $$props) {
|
||||
$$self.$inject_state($$props.$$inject);
|
||||
}
|
||||
|
||||
return [mapContainer, callback, colors, div_binding];
|
||||
}
|
||||
|
||||
class Map_component extends SvelteElement {
|
||||
constructor(options) {
|
||||
super();
|
||||
this.shadowRoot.innerHTML = `<style>@import 'https://unpkg.com/leaflet@1.9.4/dist/leaflet.css';#map{height:var(--height);width:var(--width,100%);margin-top:var(--margin-top,0);margin-bottom:var(--margin-bottom,0);position:relative;z-index:0}</style>`;
|
||||
|
||||
init(
|
||||
this,
|
||||
{
|
||||
target: this.shadowRoot,
|
||||
props: attribute_to_object(this.attributes),
|
||||
customElement: true
|
||||
},
|
||||
instance,
|
||||
create_fragment,
|
||||
safe_not_equal,
|
||||
{ callback: 1, colors: 2 },
|
||||
null
|
||||
);
|
||||
|
||||
if (options) {
|
||||
if (options.target) {
|
||||
insert_dev(options.target, this, options.anchor);
|
||||
}
|
||||
|
||||
if (options.props) {
|
||||
this.$set(options.props);
|
||||
flush();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static get observedAttributes() {
|
||||
return ["callback", "colors"];
|
||||
}
|
||||
|
||||
get callback() {
|
||||
return this.$$.ctx[1];
|
||||
}
|
||||
|
||||
set callback(callback) {
|
||||
this.$$set({ callback });
|
||||
flush();
|
||||
}
|
||||
|
||||
get colors() {
|
||||
return this.$$.ctx[2];
|
||||
}
|
||||
|
||||
set colors(colors) {
|
||||
this.$$set({ colors });
|
||||
flush();
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define("map-component", Map_component);
|
||||
|
||||
export { Map_component as default };
|
||||
|
File diff suppressed because one or more lines are too long
687
Server/public/js/components/navbar-logged.js
Normal file
687
Server/public/js/components/navbar-logged.js
Normal file
@@ -0,0 +1,687 @@
|
||||
|
||||
(function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
|
||||
import { S as SvelteElement, i as init, a as attribute_to_object, b as insert_dev, s as safe_not_equal, d as dispatch_dev, v as validate_slots, w as validate_store, x as component_subscribe, o as onMount, g as getContext, e as globals, A as validate_each_argument, y as empty, n as noop, p as detach_dev, q as binding_callbacks, f as element, h as space, B as text, k as attr_dev, j as add_location, u as src_url_equal, l as append_dev, m as listen_dev, C as set_data_dev, D as destroy_each, r as run_all } from './index-998178c7.js';
|
||||
import { w as writable } from './index-f9998ce7.js';
|
||||
import { loadLocaleContent, locales } from '../../../../../../../../../js/libraries/serverTools.js';
|
||||
|
||||
/* src\navbar\navbar-logged.svelte generated by Svelte v3.52.0 */
|
||||
|
||||
const { Object: Object_1 } = globals;
|
||||
const file = "src\\navbar\\navbar-logged.svelte";
|
||||
|
||||
function get_each_context(ctx, list, i) {
|
||||
const child_ctx = ctx.slice();
|
||||
child_ctx[23] = list[i][0];
|
||||
child_ctx[24] = list[i][1];
|
||||
return child_ctx;
|
||||
}
|
||||
|
||||
// (97:4) {#if Object.keys($content).length!=0}
|
||||
function create_if_block(ctx) {
|
||||
let header;
|
||||
let input;
|
||||
let t0;
|
||||
let label;
|
||||
let span0;
|
||||
let t1;
|
||||
let a0;
|
||||
let img0;
|
||||
let img0_src_value;
|
||||
let t2;
|
||||
let span1;
|
||||
let raw_value = /*$content*/ ctx[5].orgName + "";
|
||||
let t3;
|
||||
let nav;
|
||||
let ul;
|
||||
let li0;
|
||||
let a1;
|
||||
let t4_value = /*$content*/ ctx[5].joinUs + "";
|
||||
let t4;
|
||||
let t5;
|
||||
let li1;
|
||||
let a2;
|
||||
let t6_value = /*$content*/ ctx[5].manifesto + "";
|
||||
let t6;
|
||||
let t7;
|
||||
let li2;
|
||||
let button0;
|
||||
let t8_value = /*$content*/ ctx[5].initiatives + "";
|
||||
let t8;
|
||||
let t9;
|
||||
let div0;
|
||||
let a3;
|
||||
let t10_value = /*$content*/ ctx[5].groups + "";
|
||||
let t10;
|
||||
let t11;
|
||||
let a4;
|
||||
let t12_value = /*$content*/ ctx[5].communes + "";
|
||||
let t12;
|
||||
let t13;
|
||||
let a5;
|
||||
let t14_value = /*$content*/ ctx[5].cooperatives + "";
|
||||
let t14;
|
||||
let t15;
|
||||
let a6;
|
||||
let t16_value = /*$content*/ ctx[5].parties + "";
|
||||
let t16;
|
||||
let t17;
|
||||
let a7;
|
||||
let t18_value = /*$content*/ ctx[5].partners + "";
|
||||
let t18;
|
||||
let t19;
|
||||
let li3;
|
||||
let a8;
|
||||
let t20_value = /*$content*/ ctx[5].profile + "";
|
||||
let t20;
|
||||
let t21;
|
||||
let li4;
|
||||
let button1;
|
||||
let picture;
|
||||
let source0;
|
||||
let t22;
|
||||
let source1;
|
||||
let t23;
|
||||
let img1;
|
||||
let t24;
|
||||
let div1;
|
||||
let mounted;
|
||||
let dispose;
|
||||
let each_value = Object.entries(locales);
|
||||
validate_each_argument(each_value);
|
||||
let each_blocks = [];
|
||||
|
||||
for (let i = 0; i < each_value.length; i += 1) {
|
||||
each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i));
|
||||
}
|
||||
|
||||
const block = {
|
||||
c: function create() {
|
||||
header = element("header");
|
||||
input = element("input");
|
||||
t0 = space();
|
||||
label = element("label");
|
||||
span0 = element("span");
|
||||
t1 = space();
|
||||
a0 = element("a");
|
||||
img0 = element("img");
|
||||
t2 = space();
|
||||
span1 = element("span");
|
||||
t3 = space();
|
||||
nav = element("nav");
|
||||
ul = element("ul");
|
||||
li0 = element("li");
|
||||
a1 = element("a");
|
||||
t4 = text(t4_value);
|
||||
t5 = space();
|
||||
li1 = element("li");
|
||||
a2 = element("a");
|
||||
t6 = text(t6_value);
|
||||
t7 = space();
|
||||
li2 = element("li");
|
||||
button0 = element("button");
|
||||
t8 = text(t8_value);
|
||||
t9 = space();
|
||||
div0 = element("div");
|
||||
a3 = element("a");
|
||||
t10 = text(t10_value);
|
||||
t11 = space();
|
||||
a4 = element("a");
|
||||
t12 = text(t12_value);
|
||||
t13 = space();
|
||||
a5 = element("a");
|
||||
t14 = text(t14_value);
|
||||
t15 = space();
|
||||
a6 = element("a");
|
||||
t16 = text(t16_value);
|
||||
t17 = space();
|
||||
a7 = element("a");
|
||||
t18 = text(t18_value);
|
||||
t19 = space();
|
||||
li3 = element("li");
|
||||
a8 = element("a");
|
||||
t20 = text(t20_value);
|
||||
t21 = space();
|
||||
li4 = element("li");
|
||||
button1 = element("button");
|
||||
picture = element("picture");
|
||||
source0 = element("source");
|
||||
t22 = space();
|
||||
source1 = element("source");
|
||||
t23 = space();
|
||||
img1 = element("img");
|
||||
t24 = space();
|
||||
div1 = element("div");
|
||||
|
||||
for (let i = 0; i < each_blocks.length; i += 1) {
|
||||
each_blocks[i].c();
|
||||
}
|
||||
|
||||
attr_dev(input, "type", "checkbox");
|
||||
attr_dev(input, "id", "side-menu");
|
||||
add_location(input, file, 99, 12, 3167);
|
||||
attr_dev(span0, "id", "hamb-line");
|
||||
add_location(span0, file, 100, 45, 3298);
|
||||
attr_dev(label, "id", "hamb");
|
||||
attr_dev(label, "for", "side-menu");
|
||||
add_location(label, file, 100, 12, 3265);
|
||||
if (!src_url_equal(img0.src, img0_src_value = "/img/common/flag.png")) attr_dev(img0, "src", img0_src_value);
|
||||
attr_dev(img0, "id", "navbar-logo");
|
||||
attr_dev(img0, "alt", "logo");
|
||||
add_location(img0, file, 103, 16, 3440);
|
||||
attr_dev(span1, "id", "navbar-logo-text");
|
||||
add_location(span1, file, 104, 16, 3518);
|
||||
attr_dev(a0, "id", "logo-container");
|
||||
attr_dev(a0, "href", "/" + /*locale*/ ctx[8] + "/");
|
||||
add_location(a0, file, 102, 12, 3375);
|
||||
attr_dev(a1, "href", "/" + /*locale*/ ctx[8] + "/join-us");
|
||||
add_location(a1, file, 109, 24, 3730);
|
||||
add_location(li0, file, 109, 20, 3726);
|
||||
attr_dev(a2, "href", "/" + /*locale*/ ctx[8] + "/manifesto");
|
||||
add_location(a2, file, 110, 24, 3814);
|
||||
add_location(li1, file, 110, 20, 3810);
|
||||
attr_dev(button0, "class", "options-button");
|
||||
add_location(button0, file, 114, 24, 4126);
|
||||
attr_dev(a3, "href", "/" + /*locale*/ ctx[8] + "/groups");
|
||||
add_location(a3, file, 116, 28, 4403);
|
||||
attr_dev(a4, "href", "/" + /*locale*/ ctx[8] + "/communes");
|
||||
add_location(a4, file, 117, 28, 4485);
|
||||
attr_dev(a5, "href", "/" + /*locale*/ ctx[8] + "/cooperatives");
|
||||
add_location(a5, file, 118, 28, 4571);
|
||||
attr_dev(a6, "href", "/" + /*locale*/ ctx[8] + "/parties");
|
||||
add_location(a6, file, 119, 28, 4665);
|
||||
attr_dev(a7, "href", "/" + /*locale*/ ctx[8] + "/partners");
|
||||
add_location(a7, file, 120, 28, 4749);
|
||||
attr_dev(div0, "class", "options-dropdown");
|
||||
add_location(div0, file, 115, 24, 4311);
|
||||
attr_dev(li2, "id", "options-container");
|
||||
add_location(li2, file, 113, 20, 4073);
|
||||
attr_dev(a8, "href", "/" + /*locale*/ ctx[8] + "/profile");
|
||||
add_location(a8, file, 123, 24, 4890);
|
||||
add_location(li3, file, 123, 20, 4886);
|
||||
attr_dev(source0, "srcset", "/img/common/globe.webp");
|
||||
add_location(source0, file, 127, 32, 5184);
|
||||
attr_dev(source1, "srcset", "/img/common/globe.png");
|
||||
add_location(source1, file, 128, 32, 5258);
|
||||
attr_dev(img1, "id", "locales-img");
|
||||
attr_dev(img1, "alt", "globe");
|
||||
add_location(img1, file, 129, 32, 5331);
|
||||
add_location(picture, file, 126, 28, 5141);
|
||||
add_location(button1, file, 125, 24, 5014);
|
||||
attr_dev(li4, "id", "locales");
|
||||
add_location(li4, file, 124, 20, 4971);
|
||||
attr_dev(div1, "class", "options-dropdown");
|
||||
add_location(div1, file, 133, 20, 5489);
|
||||
attr_dev(ul, "id", "menu");
|
||||
add_location(ul, file, 108, 16, 3690);
|
||||
attr_dev(nav, "id", "nav");
|
||||
add_location(nav, file, 107, 12, 3658);
|
||||
attr_dev(header, "id", "navbar");
|
||||
add_location(header, file, 97, 8, 3077);
|
||||
},
|
||||
m: function mount(target, anchor) {
|
||||
insert_dev(target, header, anchor);
|
||||
append_dev(header, input);
|
||||
/*input_binding*/ ctx[12](input);
|
||||
append_dev(header, t0);
|
||||
append_dev(header, label);
|
||||
append_dev(label, span0);
|
||||
append_dev(header, t1);
|
||||
append_dev(header, a0);
|
||||
append_dev(a0, img0);
|
||||
append_dev(a0, t2);
|
||||
append_dev(a0, span1);
|
||||
span1.innerHTML = raw_value;
|
||||
/*span1_binding*/ ctx[13](span1);
|
||||
append_dev(header, t3);
|
||||
append_dev(header, nav);
|
||||
append_dev(nav, ul);
|
||||
append_dev(ul, li0);
|
||||
append_dev(li0, a1);
|
||||
append_dev(a1, t4);
|
||||
append_dev(ul, t5);
|
||||
append_dev(ul, li1);
|
||||
append_dev(li1, a2);
|
||||
append_dev(a2, t6);
|
||||
append_dev(ul, t7);
|
||||
append_dev(ul, li2);
|
||||
append_dev(li2, button0);
|
||||
append_dev(button0, t8);
|
||||
append_dev(li2, t9);
|
||||
append_dev(li2, div0);
|
||||
append_dev(div0, a3);
|
||||
append_dev(a3, t10);
|
||||
append_dev(div0, t11);
|
||||
append_dev(div0, a4);
|
||||
append_dev(a4, t12);
|
||||
append_dev(div0, t13);
|
||||
append_dev(div0, a5);
|
||||
append_dev(a5, t14);
|
||||
append_dev(div0, t15);
|
||||
append_dev(div0, a6);
|
||||
append_dev(a6, t16);
|
||||
append_dev(div0, t17);
|
||||
append_dev(div0, a7);
|
||||
append_dev(a7, t18);
|
||||
/*div0_binding*/ ctx[16](div0);
|
||||
append_dev(ul, t19);
|
||||
append_dev(ul, li3);
|
||||
append_dev(li3, a8);
|
||||
append_dev(a8, t20);
|
||||
append_dev(ul, t21);
|
||||
append_dev(ul, li4);
|
||||
append_dev(li4, button1);
|
||||
append_dev(button1, picture);
|
||||
append_dev(picture, source0);
|
||||
append_dev(picture, t22);
|
||||
append_dev(picture, source1);
|
||||
append_dev(picture, t23);
|
||||
append_dev(picture, img1);
|
||||
append_dev(ul, t24);
|
||||
append_dev(ul, div1);
|
||||
|
||||
for (let i = 0; i < each_blocks.length; i += 1) {
|
||||
each_blocks[i].m(div1, null);
|
||||
}
|
||||
|
||||
/*div1_binding*/ ctx[20](div1);
|
||||
/*header_binding*/ ctx[21](header);
|
||||
|
||||
if (!mounted) {
|
||||
dispose = [
|
||||
listen_dev(input, "click", /*changeNavbar*/ ctx[9], false, false, false),
|
||||
listen_dev(button0, "click", /*click_handler*/ ctx[14], false, false, false),
|
||||
listen_dev(button0, "focusout", /*focusout_handler*/ ctx[15], false, false, false),
|
||||
listen_dev(button1, "click", /*click_handler_1*/ ctx[17], false, false, false),
|
||||
listen_dev(button1, "focusout", /*focusout_handler_1*/ ctx[18], false, false, false)
|
||||
];
|
||||
|
||||
mounted = true;
|
||||
}
|
||||
},
|
||||
p: function update(ctx, dirty) {
|
||||
if (dirty & /*$content*/ 32 && raw_value !== (raw_value = /*$content*/ ctx[5].orgName + "")) span1.innerHTML = raw_value; if (dirty & /*$content*/ 32 && t4_value !== (t4_value = /*$content*/ ctx[5].joinUs + "")) set_data_dev(t4, t4_value);
|
||||
if (dirty & /*$content*/ 32 && t6_value !== (t6_value = /*$content*/ ctx[5].manifesto + "")) set_data_dev(t6, t6_value);
|
||||
if (dirty & /*$content*/ 32 && t8_value !== (t8_value = /*$content*/ ctx[5].initiatives + "")) set_data_dev(t8, t8_value);
|
||||
if (dirty & /*$content*/ 32 && t10_value !== (t10_value = /*$content*/ ctx[5].groups + "")) set_data_dev(t10, t10_value);
|
||||
if (dirty & /*$content*/ 32 && t12_value !== (t12_value = /*$content*/ ctx[5].communes + "")) set_data_dev(t12, t12_value);
|
||||
if (dirty & /*$content*/ 32 && t14_value !== (t14_value = /*$content*/ ctx[5].cooperatives + "")) set_data_dev(t14, t14_value);
|
||||
if (dirty & /*$content*/ 32 && t16_value !== (t16_value = /*$content*/ ctx[5].parties + "")) set_data_dev(t16, t16_value);
|
||||
if (dirty & /*$content*/ 32 && t18_value !== (t18_value = /*$content*/ ctx[5].partners + "")) set_data_dev(t18, t18_value);
|
||||
if (dirty & /*$content*/ 32 && t20_value !== (t20_value = /*$content*/ ctx[5].profile + "")) set_data_dev(t20, t20_value);
|
||||
|
||||
if (dirty & /*changeLocale, Object, locales*/ 2048) {
|
||||
each_value = Object.entries(locales);
|
||||
validate_each_argument(each_value);
|
||||
let i;
|
||||
|
||||
for (i = 0; i < each_value.length; i += 1) {
|
||||
const child_ctx = get_each_context(ctx, each_value, i);
|
||||
|
||||
if (each_blocks[i]) {
|
||||
each_blocks[i].p(child_ctx, dirty);
|
||||
} else {
|
||||
each_blocks[i] = create_each_block(child_ctx);
|
||||
each_blocks[i].c();
|
||||
each_blocks[i].m(div1, null);
|
||||
}
|
||||
}
|
||||
|
||||
for (; i < each_blocks.length; i += 1) {
|
||||
each_blocks[i].d(1);
|
||||
}
|
||||
|
||||
each_blocks.length = each_value.length;
|
||||
}
|
||||
},
|
||||
d: function destroy(detaching) {
|
||||
if (detaching) detach_dev(header);
|
||||
/*input_binding*/ ctx[12](null);
|
||||
/*span1_binding*/ ctx[13](null);
|
||||
/*div0_binding*/ ctx[16](null);
|
||||
destroy_each(each_blocks, detaching);
|
||||
/*div1_binding*/ ctx[20](null);
|
||||
/*header_binding*/ ctx[21](null);
|
||||
mounted = false;
|
||||
run_all(dispose);
|
||||
}
|
||||
};
|
||||
|
||||
dispatch_dev("SvelteRegisterBlock", {
|
||||
block,
|
||||
id: create_if_block.name,
|
||||
type: "if",
|
||||
source: "(97:4) {#if Object.keys($content).length!=0}",
|
||||
ctx
|
||||
});
|
||||
|
||||
return block;
|
||||
}
|
||||
|
||||
// (135:24) {#each Object.entries(locales) as [loc,name]}
|
||||
function create_each_block(ctx) {
|
||||
let button;
|
||||
let t_value = /*name*/ ctx[24] + "";
|
||||
let t;
|
||||
let mounted;
|
||||
let dispose;
|
||||
|
||||
function click_handler_2() {
|
||||
return /*click_handler_2*/ ctx[19](/*loc*/ ctx[23]);
|
||||
}
|
||||
|
||||
const block = {
|
||||
c: function create() {
|
||||
button = element("button");
|
||||
t = text(t_value);
|
||||
add_location(button, file, 135, 28, 5648);
|
||||
},
|
||||
m: function mount(target, anchor) {
|
||||
insert_dev(target, button, anchor);
|
||||
append_dev(button, t);
|
||||
|
||||
if (!mounted) {
|
||||
dispose = listen_dev(button, "click", click_handler_2, false, false, false);
|
||||
mounted = true;
|
||||
}
|
||||
},
|
||||
p: function update(new_ctx, dirty) {
|
||||
ctx = new_ctx;
|
||||
},
|
||||
d: function destroy(detaching) {
|
||||
if (detaching) detach_dev(button);
|
||||
mounted = false;
|
||||
dispose();
|
||||
}
|
||||
};
|
||||
|
||||
dispatch_dev("SvelteRegisterBlock", {
|
||||
block,
|
||||
id: create_each_block.name,
|
||||
type: "each",
|
||||
source: "(135:24) {#each Object.entries(locales) as [loc,name]}",
|
||||
ctx
|
||||
});
|
||||
|
||||
return block;
|
||||
}
|
||||
|
||||
function create_fragment(ctx) {
|
||||
let show_if = Object.keys(/*$content*/ ctx[5]).length != 0;
|
||||
let if_block_anchor;
|
||||
let if_block = show_if && create_if_block(ctx);
|
||||
|
||||
const block = {
|
||||
c: function create() {
|
||||
if (if_block) if_block.c();
|
||||
if_block_anchor = empty();
|
||||
this.c = noop;
|
||||
},
|
||||
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) {
|
||||
if (if_block) if_block.m(target, anchor);
|
||||
insert_dev(target, if_block_anchor, anchor);
|
||||
},
|
||||
p: function update(ctx, [dirty]) {
|
||||
if (dirty & /*$content*/ 32) show_if = Object.keys(/*$content*/ ctx[5]).length != 0;
|
||||
|
||||
if (show_if) {
|
||||
if (if_block) {
|
||||
if_block.p(ctx, dirty);
|
||||
} else {
|
||||
if_block = create_if_block(ctx);
|
||||
if_block.c();
|
||||
if_block.m(if_block_anchor.parentNode, if_block_anchor);
|
||||
}
|
||||
} else if (if_block) {
|
||||
if_block.d(1);
|
||||
if_block = null;
|
||||
}
|
||||
},
|
||||
i: noop,
|
||||
o: noop,
|
||||
d: function destroy(detaching) {
|
||||
if (if_block) if_block.d(detaching);
|
||||
if (detaching) detach_dev(if_block_anchor);
|
||||
}
|
||||
};
|
||||
|
||||
dispatch_dev("SvelteRegisterBlock", {
|
||||
block,
|
||||
id: create_fragment.name,
|
||||
type: "component",
|
||||
source: "",
|
||||
ctx
|
||||
});
|
||||
|
||||
return block;
|
||||
}
|
||||
|
||||
function hide(dropdown) {
|
||||
let callback = () => {
|
||||
dropdown.style.display = "none";
|
||||
};
|
||||
|
||||
setTimeout(callback, 100);
|
||||
}
|
||||
|
||||
function instance($$self, $$props, $$invalidate) {
|
||||
let $content;
|
||||
let { $$slots: slots = {}, $$scope } = $$props;
|
||||
validate_slots('navbar-logged', slots, []);
|
||||
let hambInput;
|
||||
let navbar;
|
||||
let localesDropdown;
|
||||
let initiativesDropdown;
|
||||
let loaded = writable(0);
|
||||
let content = writable({});
|
||||
validate_store(content, 'content');
|
||||
component_subscribe($$self, content, value => $$invalidate(5, $content = value));
|
||||
let logoText;
|
||||
let locale = loadLocaleContent(content, "navbar-component", loaded);
|
||||
|
||||
function changeNavbar() {
|
||||
if (hambInput.checked) {
|
||||
$$invalidate(1, navbar.style.background = "white", navbar);
|
||||
} else {
|
||||
setTimeout(
|
||||
() => {
|
||||
$$invalidate(1, navbar.style.position = "relative", navbar);
|
||||
$$invalidate(1, navbar.style.background = "", navbar);
|
||||
$$invalidate(1, navbar.style.boxShadow = "", navbar);
|
||||
},
|
||||
510
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function showDropdown(dropdown) {
|
||||
let state = dropdown.style.display;
|
||||
$$invalidate(3, initiativesDropdown.style.display = "none", initiativesDropdown);
|
||||
$$invalidate(2, localesDropdown.style.display = "none", localesDropdown);
|
||||
|
||||
if (state == "block") {
|
||||
dropdown.style.display = "none";
|
||||
} else {
|
||||
dropdown.style.display = "block";
|
||||
}
|
||||
}
|
||||
|
||||
function changeLocale(lang) {
|
||||
localStorage.setItem("locale", lang);
|
||||
let locSplit = location.href.split("/");
|
||||
let localesSymbols = Object.keys(locales);
|
||||
locSplit = locSplit.filter(x => !localesSymbols.includes(x));
|
||||
let loc = locSplit.slice(0, locSplit.length - 1).join("/") + "/" + lang + "/" + locSplit[locSplit.length - 1];
|
||||
location.href = loc;
|
||||
}
|
||||
|
||||
function fixHeading() {
|
||||
if (locale == "ru") {
|
||||
let func = () => {
|
||||
if (logoText == undefined) {
|
||||
setTimeout(func, 100);
|
||||
} else {
|
||||
if ((window.innerWidth < 1700 && window.innerWidth > 1400 || window.innerWidth < 400) && logoText.style.lineHeight != "100%") {
|
||||
$$invalidate(4, logoText.style.lineHeight = "120%", logoText);
|
||||
$$invalidate(4, logoText.style.top = "1rem", logoText);
|
||||
$$invalidate(4, logoText.style.width = "16rem", logoText);
|
||||
} else if ((window.innerWidth > 1700 || window.innerWidth > 400 && window.innerWidth < 1400) && logoText.style.lineHeight != "400%") {
|
||||
$$invalidate(4, logoText.style.lineHeight = "400%", logoText);
|
||||
$$invalidate(4, logoText.style.top = "0rem", logoText);
|
||||
$$invalidate(4, logoText.style.width = "auto", logoText);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
func();
|
||||
addEventListener("resize", func);
|
||||
}
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
fixHeading();
|
||||
});
|
||||
|
||||
const writable_props = [];
|
||||
|
||||
Object_1.keys($$props).forEach(key => {
|
||||
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(`<navbar-logged> was created with unknown prop '${key}'`);
|
||||
});
|
||||
|
||||
function input_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
hambInput = $$value;
|
||||
$$invalidate(0, hambInput);
|
||||
});
|
||||
}
|
||||
|
||||
function span1_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
logoText = $$value;
|
||||
$$invalidate(4, logoText);
|
||||
});
|
||||
}
|
||||
|
||||
const click_handler = () => showDropdown(initiativesDropdown);
|
||||
const focusout_handler = () => hide(initiativesDropdown);
|
||||
|
||||
function div0_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
initiativesDropdown = $$value;
|
||||
$$invalidate(3, initiativesDropdown);
|
||||
});
|
||||
}
|
||||
|
||||
const click_handler_1 = () => showDropdown(localesDropdown);
|
||||
const focusout_handler_1 = () => hide(localesDropdown);
|
||||
const click_handler_2 = loc => changeLocale(loc);
|
||||
|
||||
function div1_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
localesDropdown = $$value;
|
||||
$$invalidate(2, localesDropdown);
|
||||
});
|
||||
}
|
||||
|
||||
function header_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
navbar = $$value;
|
||||
$$invalidate(1, navbar);
|
||||
});
|
||||
}
|
||||
|
||||
$$self.$capture_state = () => ({
|
||||
onMount,
|
||||
getContext,
|
||||
writable,
|
||||
loadLocaleContent,
|
||||
locales,
|
||||
hambInput,
|
||||
navbar,
|
||||
localesDropdown,
|
||||
initiativesDropdown,
|
||||
loaded,
|
||||
content,
|
||||
logoText,
|
||||
locale,
|
||||
changeNavbar,
|
||||
showDropdown,
|
||||
changeLocale,
|
||||
fixHeading,
|
||||
hide,
|
||||
$content
|
||||
});
|
||||
|
||||
$$self.$inject_state = $$props => {
|
||||
if ('hambInput' in $$props) $$invalidate(0, hambInput = $$props.hambInput);
|
||||
if ('navbar' in $$props) $$invalidate(1, navbar = $$props.navbar);
|
||||
if ('localesDropdown' in $$props) $$invalidate(2, localesDropdown = $$props.localesDropdown);
|
||||
if ('initiativesDropdown' in $$props) $$invalidate(3, initiativesDropdown = $$props.initiativesDropdown);
|
||||
if ('loaded' in $$props) $$invalidate(6, loaded = $$props.loaded);
|
||||
if ('content' in $$props) $$invalidate(7, content = $$props.content);
|
||||
if ('logoText' in $$props) $$invalidate(4, logoText = $$props.logoText);
|
||||
if ('locale' in $$props) $$invalidate(8, locale = $$props.locale);
|
||||
};
|
||||
|
||||
if ($$props && "$$inject" in $$props) {
|
||||
$$self.$inject_state($$props.$$inject);
|
||||
}
|
||||
|
||||
return [
|
||||
hambInput,
|
||||
navbar,
|
||||
localesDropdown,
|
||||
initiativesDropdown,
|
||||
logoText,
|
||||
$content,
|
||||
loaded,
|
||||
content,
|
||||
locale,
|
||||
changeNavbar,
|
||||
showDropdown,
|
||||
changeLocale,
|
||||
input_binding,
|
||||
span1_binding,
|
||||
click_handler,
|
||||
focusout_handler,
|
||||
div0_binding,
|
||||
click_handler_1,
|
||||
focusout_handler_1,
|
||||
click_handler_2,
|
||||
div1_binding,
|
||||
header_binding
|
||||
];
|
||||
}
|
||||
|
||||
class Navbar_logged extends SvelteElement {
|
||||
constructor(options) {
|
||||
super();
|
||||
this.shadowRoot.innerHTML = `<style>@import '/css/common.css';#navbar{position:relative;top:0;width:min(100%,116rem);z-index:1000000000;height:5.26rem;padding-left:0rem;padding-right:0rem}#navbar *{font-family:var(--sans-serif, sans-serif)}#logo-container{display:flex;position:absolute;margin-left:1rem;height:100%;max-height:5.26rem;color:black;z-index:1;flex-direction:row;flex-wrap:nowrap;align-items:center}#navbar-logo{height:3.5rem;width:3.5rem;object-fit:contain;border-radius:10rem}#navbar-logo-text{position:relative;word-wrap:normal;height:100%;line-height:400%;font-size:1.4rem;color:#292222;font-family:var(--sans-serif, sans-serif);font-weight:400;padding-left:1.2rem}#nav{position:fixed;width:100%;height:100%;background-color:white;overflow:hidden;z-index:0}#menu>li>a,.options-button{display:block;padding:1.2rem;padding-top:1rem;padding-bottom:1rem;color:black;font-size:1.4rem}#menu>li>a:active{background-color:#f7aec0}#menu li{list-style-type:none}#nav{max-height:0}#hamb{position:absolute;cursor:pointer;right:0rem;padding:2.8rem 2rem;z-index:9999}#hamb-line{background:black;display:block;height:2px;position:relative;width:24px}#hamb-line::before,#hamb-line::after{background:black;content:'';display:block;height:100%;position:absolute;transition:all .2s ease-out;width:100%}#hamb-line::before{top:5px}#hamb-line::after{top:-5px}#side-menu{display:none}#side-menu:checked~nav{display:block;max-height:100%;padding-top:5.625rem}#side-menu:checked~#logo-container{position:fixed}#side-menu:checked~#hamb{position:fixed}#side-menu:checked~#logo-container{position:fixed}#side-menu:checked~#hamb #hamb-line{background:transparent}#side-menu:checked~#hamb #hamb-line::before{transform:rotate(-45deg);top:0}#side-menu:checked~#hamb #hamb-line::after{transform:rotate(45deg);top:0}.options-dropdown{position:absolute;display:none;top:5.6rem;right:1.8rem;border:#404040 solid 0.1rem;background-color:white;z-index:10}.options-dropdown button,.options-dropdown a{display:block;font-family:var(--sans-serif,sans-serif);font-size:1.2rem;width:100%;padding:1rem;text-align:left}.options-dropdown button:hover,.options-dropdown a:hover{background-color:var(--red);color:white}.options-button{width:100%;text-align:left}#locales{position:relative}#locales button{width:100%;text-align:left;height:4rem}#locales button:hover{opacity:0.5}#locales-img{position:relative;top:0rem;height:2rem;margin-left:1.2rem}@media only screen and (min-width: 1200px){#navbar{position:relative;width:min(100%,116rem);left:50%;transform:translateX(-50%);padding-right:4rem;padding-left:4rem}#nav{max-height:none;top:0;position:relative;float:right;width:fit-content;background-color:transparent;overflow:visible}#side-menu:checked~nav{padding-top:0}#menu li{float:left}#menu>li>a:hover,.options-button:hover,#navbar-logo-text:hover{color:rgb(127, 127, 127)}#menu>li>a,.options-button{padding:0.9rem;padding-top:1.9rem;padding-bottom:1.9rem}#hamb{display:none}#locales{position:relative;margin-right:1.8rem}#locales-img{top:0.9rem}}</style>`;
|
||||
|
||||
init(
|
||||
this,
|
||||
{
|
||||
target: this.shadowRoot,
|
||||
props: attribute_to_object(this.attributes),
|
||||
customElement: true
|
||||
},
|
||||
instance,
|
||||
create_fragment,
|
||||
safe_not_equal,
|
||||
{},
|
||||
null
|
||||
);
|
||||
|
||||
if (options) {
|
||||
if (options.target) {
|
||||
insert_dev(options.target, this, options.anchor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define("navbar-logged", Navbar_logged);
|
||||
|
||||
export { Navbar_logged as default };
|
687
Server/public/js/components/navbar-not-logged.js
Normal file
687
Server/public/js/components/navbar-not-logged.js
Normal file
@@ -0,0 +1,687 @@
|
||||
|
||||
(function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
|
||||
import { S as SvelteElement, i as init, a as attribute_to_object, b as insert_dev, s as safe_not_equal, d as dispatch_dev, v as validate_slots, w as validate_store, x as component_subscribe, o as onMount, g as getContext, e as globals, A as validate_each_argument, y as empty, n as noop, p as detach_dev, q as binding_callbacks, f as element, h as space, B as text, k as attr_dev, j as add_location, u as src_url_equal, l as append_dev, m as listen_dev, C as set_data_dev, D as destroy_each, r as run_all } from './index-998178c7.js';
|
||||
import { w as writable } from './index-f9998ce7.js';
|
||||
import { loadLocaleContent, locales } from '../../../../../../../../../js/libraries/serverTools.js';
|
||||
|
||||
/* src\navbar\navbar-not-logged.svelte generated by Svelte v3.52.0 */
|
||||
|
||||
const { Object: Object_1 } = globals;
|
||||
const file = "src\\navbar\\navbar-not-logged.svelte";
|
||||
|
||||
function get_each_context(ctx, list, i) {
|
||||
const child_ctx = ctx.slice();
|
||||
child_ctx[23] = list[i][0];
|
||||
child_ctx[24] = list[i][1];
|
||||
return child_ctx;
|
||||
}
|
||||
|
||||
// (97:4) {#if Object.keys($content).length!=0}
|
||||
function create_if_block(ctx) {
|
||||
let header;
|
||||
let input;
|
||||
let t0;
|
||||
let label;
|
||||
let span0;
|
||||
let t1;
|
||||
let a0;
|
||||
let img0;
|
||||
let img0_src_value;
|
||||
let t2;
|
||||
let span1;
|
||||
let raw_value = /*$content*/ ctx[5].orgName + "";
|
||||
let t3;
|
||||
let nav;
|
||||
let ul;
|
||||
let li0;
|
||||
let a1;
|
||||
let t4_value = /*$content*/ ctx[5].joinUs + "";
|
||||
let t4;
|
||||
let t5;
|
||||
let li1;
|
||||
let a2;
|
||||
let t6_value = /*$content*/ ctx[5].manifesto + "";
|
||||
let t6;
|
||||
let t7;
|
||||
let li2;
|
||||
let button0;
|
||||
let t8_value = /*$content*/ ctx[5].initiatives + "";
|
||||
let t8;
|
||||
let t9;
|
||||
let div0;
|
||||
let a3;
|
||||
let t10_value = /*$content*/ ctx[5].groups + "";
|
||||
let t10;
|
||||
let t11;
|
||||
let a4;
|
||||
let t12_value = /*$content*/ ctx[5].communes + "";
|
||||
let t12;
|
||||
let t13;
|
||||
let a5;
|
||||
let t14_value = /*$content*/ ctx[5].cooperatives + "";
|
||||
let t14;
|
||||
let t15;
|
||||
let a6;
|
||||
let t16_value = /*$content*/ ctx[5].parties + "";
|
||||
let t16;
|
||||
let t17;
|
||||
let a7;
|
||||
let t18_value = /*$content*/ ctx[5].partners + "";
|
||||
let t18;
|
||||
let t19;
|
||||
let li3;
|
||||
let a8;
|
||||
let t20_value = /*$content*/ ctx[5].login + "";
|
||||
let t20;
|
||||
let t21;
|
||||
let li4;
|
||||
let button1;
|
||||
let picture;
|
||||
let source0;
|
||||
let t22;
|
||||
let source1;
|
||||
let t23;
|
||||
let img1;
|
||||
let t24;
|
||||
let div1;
|
||||
let mounted;
|
||||
let dispose;
|
||||
let each_value = Object.entries(locales);
|
||||
validate_each_argument(each_value);
|
||||
let each_blocks = [];
|
||||
|
||||
for (let i = 0; i < each_value.length; i += 1) {
|
||||
each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i));
|
||||
}
|
||||
|
||||
const block = {
|
||||
c: function create() {
|
||||
header = element("header");
|
||||
input = element("input");
|
||||
t0 = space();
|
||||
label = element("label");
|
||||
span0 = element("span");
|
||||
t1 = space();
|
||||
a0 = element("a");
|
||||
img0 = element("img");
|
||||
t2 = space();
|
||||
span1 = element("span");
|
||||
t3 = space();
|
||||
nav = element("nav");
|
||||
ul = element("ul");
|
||||
li0 = element("li");
|
||||
a1 = element("a");
|
||||
t4 = text(t4_value);
|
||||
t5 = space();
|
||||
li1 = element("li");
|
||||
a2 = element("a");
|
||||
t6 = text(t6_value);
|
||||
t7 = space();
|
||||
li2 = element("li");
|
||||
button0 = element("button");
|
||||
t8 = text(t8_value);
|
||||
t9 = space();
|
||||
div0 = element("div");
|
||||
a3 = element("a");
|
||||
t10 = text(t10_value);
|
||||
t11 = space();
|
||||
a4 = element("a");
|
||||
t12 = text(t12_value);
|
||||
t13 = space();
|
||||
a5 = element("a");
|
||||
t14 = text(t14_value);
|
||||
t15 = space();
|
||||
a6 = element("a");
|
||||
t16 = text(t16_value);
|
||||
t17 = space();
|
||||
a7 = element("a");
|
||||
t18 = text(t18_value);
|
||||
t19 = space();
|
||||
li3 = element("li");
|
||||
a8 = element("a");
|
||||
t20 = text(t20_value);
|
||||
t21 = space();
|
||||
li4 = element("li");
|
||||
button1 = element("button");
|
||||
picture = element("picture");
|
||||
source0 = element("source");
|
||||
t22 = space();
|
||||
source1 = element("source");
|
||||
t23 = space();
|
||||
img1 = element("img");
|
||||
t24 = space();
|
||||
div1 = element("div");
|
||||
|
||||
for (let i = 0; i < each_blocks.length; i += 1) {
|
||||
each_blocks[i].c();
|
||||
}
|
||||
|
||||
attr_dev(input, "type", "checkbox");
|
||||
attr_dev(input, "id", "side-menu");
|
||||
add_location(input, file, 99, 12, 3171);
|
||||
attr_dev(span0, "id", "hamb-line");
|
||||
add_location(span0, file, 100, 45, 3302);
|
||||
attr_dev(label, "id", "hamb");
|
||||
attr_dev(label, "for", "side-menu");
|
||||
add_location(label, file, 100, 12, 3269);
|
||||
if (!src_url_equal(img0.src, img0_src_value = "/img/common/flag.png")) attr_dev(img0, "src", img0_src_value);
|
||||
attr_dev(img0, "id", "navbar-logo");
|
||||
attr_dev(img0, "alt", "logo");
|
||||
add_location(img0, file, 103, 16, 3444);
|
||||
attr_dev(span1, "id", "navbar-logo-text");
|
||||
add_location(span1, file, 104, 16, 3522);
|
||||
attr_dev(a0, "id", "logo-container");
|
||||
attr_dev(a0, "href", "/" + /*locale*/ ctx[8] + "/");
|
||||
add_location(a0, file, 102, 12, 3379);
|
||||
attr_dev(a1, "href", "/" + /*locale*/ ctx[8] + "/join-us");
|
||||
add_location(a1, file, 109, 24, 3734);
|
||||
add_location(li0, file, 109, 20, 3730);
|
||||
attr_dev(a2, "href", "/" + /*locale*/ ctx[8] + "/manifesto");
|
||||
add_location(a2, file, 110, 24, 3818);
|
||||
add_location(li1, file, 110, 20, 3814);
|
||||
attr_dev(button0, "class", "options-button");
|
||||
add_location(button0, file, 114, 24, 4130);
|
||||
attr_dev(a3, "href", "/" + /*locale*/ ctx[8] + "/groups");
|
||||
add_location(a3, file, 116, 28, 4407);
|
||||
attr_dev(a4, "href", "/" + /*locale*/ ctx[8] + "/communes");
|
||||
add_location(a4, file, 117, 28, 4489);
|
||||
attr_dev(a5, "href", "/" + /*locale*/ ctx[8] + "/cooperatives");
|
||||
add_location(a5, file, 118, 28, 4575);
|
||||
attr_dev(a6, "href", "/" + /*locale*/ ctx[8] + "/parties");
|
||||
add_location(a6, file, 119, 28, 4669);
|
||||
attr_dev(a7, "href", "/" + /*locale*/ ctx[8] + "/partners");
|
||||
add_location(a7, file, 120, 28, 4753);
|
||||
attr_dev(div0, "class", "options-dropdown");
|
||||
add_location(div0, file, 115, 24, 4315);
|
||||
attr_dev(li2, "id", "options-container");
|
||||
add_location(li2, file, 113, 20, 4077);
|
||||
attr_dev(a8, "href", "/" + /*locale*/ ctx[8] + "/auth");
|
||||
add_location(a8, file, 123, 24, 4894);
|
||||
add_location(li3, file, 123, 20, 4890);
|
||||
attr_dev(source0, "srcset", "/img/common/globe.webp");
|
||||
add_location(source0, file, 127, 32, 5183);
|
||||
attr_dev(source1, "srcset", "/img/common/globe.png");
|
||||
add_location(source1, file, 128, 32, 5257);
|
||||
attr_dev(img1, "id", "locales-img");
|
||||
attr_dev(img1, "alt", "globe");
|
||||
add_location(img1, file, 129, 32, 5330);
|
||||
add_location(picture, file, 126, 28, 5140);
|
||||
add_location(button1, file, 125, 24, 5013);
|
||||
attr_dev(li4, "id", "locales");
|
||||
add_location(li4, file, 124, 20, 4970);
|
||||
attr_dev(div1, "class", "options-dropdown");
|
||||
add_location(div1, file, 133, 20, 5488);
|
||||
attr_dev(ul, "id", "menu");
|
||||
add_location(ul, file, 108, 16, 3694);
|
||||
attr_dev(nav, "id", "nav");
|
||||
add_location(nav, file, 107, 12, 3662);
|
||||
attr_dev(header, "id", "navbar");
|
||||
add_location(header, file, 97, 8, 3081);
|
||||
},
|
||||
m: function mount(target, anchor) {
|
||||
insert_dev(target, header, anchor);
|
||||
append_dev(header, input);
|
||||
/*input_binding*/ ctx[12](input);
|
||||
append_dev(header, t0);
|
||||
append_dev(header, label);
|
||||
append_dev(label, span0);
|
||||
append_dev(header, t1);
|
||||
append_dev(header, a0);
|
||||
append_dev(a0, img0);
|
||||
append_dev(a0, t2);
|
||||
append_dev(a0, span1);
|
||||
span1.innerHTML = raw_value;
|
||||
/*span1_binding*/ ctx[13](span1);
|
||||
append_dev(header, t3);
|
||||
append_dev(header, nav);
|
||||
append_dev(nav, ul);
|
||||
append_dev(ul, li0);
|
||||
append_dev(li0, a1);
|
||||
append_dev(a1, t4);
|
||||
append_dev(ul, t5);
|
||||
append_dev(ul, li1);
|
||||
append_dev(li1, a2);
|
||||
append_dev(a2, t6);
|
||||
append_dev(ul, t7);
|
||||
append_dev(ul, li2);
|
||||
append_dev(li2, button0);
|
||||
append_dev(button0, t8);
|
||||
append_dev(li2, t9);
|
||||
append_dev(li2, div0);
|
||||
append_dev(div0, a3);
|
||||
append_dev(a3, t10);
|
||||
append_dev(div0, t11);
|
||||
append_dev(div0, a4);
|
||||
append_dev(a4, t12);
|
||||
append_dev(div0, t13);
|
||||
append_dev(div0, a5);
|
||||
append_dev(a5, t14);
|
||||
append_dev(div0, t15);
|
||||
append_dev(div0, a6);
|
||||
append_dev(a6, t16);
|
||||
append_dev(div0, t17);
|
||||
append_dev(div0, a7);
|
||||
append_dev(a7, t18);
|
||||
/*div0_binding*/ ctx[16](div0);
|
||||
append_dev(ul, t19);
|
||||
append_dev(ul, li3);
|
||||
append_dev(li3, a8);
|
||||
append_dev(a8, t20);
|
||||
append_dev(ul, t21);
|
||||
append_dev(ul, li4);
|
||||
append_dev(li4, button1);
|
||||
append_dev(button1, picture);
|
||||
append_dev(picture, source0);
|
||||
append_dev(picture, t22);
|
||||
append_dev(picture, source1);
|
||||
append_dev(picture, t23);
|
||||
append_dev(picture, img1);
|
||||
append_dev(ul, t24);
|
||||
append_dev(ul, div1);
|
||||
|
||||
for (let i = 0; i < each_blocks.length; i += 1) {
|
||||
each_blocks[i].m(div1, null);
|
||||
}
|
||||
|
||||
/*div1_binding*/ ctx[20](div1);
|
||||
/*header_binding*/ ctx[21](header);
|
||||
|
||||
if (!mounted) {
|
||||
dispose = [
|
||||
listen_dev(input, "click", /*changeNavbar*/ ctx[9], false, false, false),
|
||||
listen_dev(button0, "click", /*click_handler*/ ctx[14], false, false, false),
|
||||
listen_dev(button0, "focusout", /*focusout_handler*/ ctx[15], false, false, false),
|
||||
listen_dev(button1, "click", /*click_handler_1*/ ctx[17], false, false, false),
|
||||
listen_dev(button1, "focusout", /*focusout_handler_1*/ ctx[18], false, false, false)
|
||||
];
|
||||
|
||||
mounted = true;
|
||||
}
|
||||
},
|
||||
p: function update(ctx, dirty) {
|
||||
if (dirty & /*$content*/ 32 && raw_value !== (raw_value = /*$content*/ ctx[5].orgName + "")) span1.innerHTML = raw_value; if (dirty & /*$content*/ 32 && t4_value !== (t4_value = /*$content*/ ctx[5].joinUs + "")) set_data_dev(t4, t4_value);
|
||||
if (dirty & /*$content*/ 32 && t6_value !== (t6_value = /*$content*/ ctx[5].manifesto + "")) set_data_dev(t6, t6_value);
|
||||
if (dirty & /*$content*/ 32 && t8_value !== (t8_value = /*$content*/ ctx[5].initiatives + "")) set_data_dev(t8, t8_value);
|
||||
if (dirty & /*$content*/ 32 && t10_value !== (t10_value = /*$content*/ ctx[5].groups + "")) set_data_dev(t10, t10_value);
|
||||
if (dirty & /*$content*/ 32 && t12_value !== (t12_value = /*$content*/ ctx[5].communes + "")) set_data_dev(t12, t12_value);
|
||||
if (dirty & /*$content*/ 32 && t14_value !== (t14_value = /*$content*/ ctx[5].cooperatives + "")) set_data_dev(t14, t14_value);
|
||||
if (dirty & /*$content*/ 32 && t16_value !== (t16_value = /*$content*/ ctx[5].parties + "")) set_data_dev(t16, t16_value);
|
||||
if (dirty & /*$content*/ 32 && t18_value !== (t18_value = /*$content*/ ctx[5].partners + "")) set_data_dev(t18, t18_value);
|
||||
if (dirty & /*$content*/ 32 && t20_value !== (t20_value = /*$content*/ ctx[5].login + "")) set_data_dev(t20, t20_value);
|
||||
|
||||
if (dirty & /*changeLocale, Object, locales*/ 2048) {
|
||||
each_value = Object.entries(locales);
|
||||
validate_each_argument(each_value);
|
||||
let i;
|
||||
|
||||
for (i = 0; i < each_value.length; i += 1) {
|
||||
const child_ctx = get_each_context(ctx, each_value, i);
|
||||
|
||||
if (each_blocks[i]) {
|
||||
each_blocks[i].p(child_ctx, dirty);
|
||||
} else {
|
||||
each_blocks[i] = create_each_block(child_ctx);
|
||||
each_blocks[i].c();
|
||||
each_blocks[i].m(div1, null);
|
||||
}
|
||||
}
|
||||
|
||||
for (; i < each_blocks.length; i += 1) {
|
||||
each_blocks[i].d(1);
|
||||
}
|
||||
|
||||
each_blocks.length = each_value.length;
|
||||
}
|
||||
},
|
||||
d: function destroy(detaching) {
|
||||
if (detaching) detach_dev(header);
|
||||
/*input_binding*/ ctx[12](null);
|
||||
/*span1_binding*/ ctx[13](null);
|
||||
/*div0_binding*/ ctx[16](null);
|
||||
destroy_each(each_blocks, detaching);
|
||||
/*div1_binding*/ ctx[20](null);
|
||||
/*header_binding*/ ctx[21](null);
|
||||
mounted = false;
|
||||
run_all(dispose);
|
||||
}
|
||||
};
|
||||
|
||||
dispatch_dev("SvelteRegisterBlock", {
|
||||
block,
|
||||
id: create_if_block.name,
|
||||
type: "if",
|
||||
source: "(97:4) {#if Object.keys($content).length!=0}",
|
||||
ctx
|
||||
});
|
||||
|
||||
return block;
|
||||
}
|
||||
|
||||
// (135:24) {#each Object.entries(locales) as [loc,name]}
|
||||
function create_each_block(ctx) {
|
||||
let button;
|
||||
let t_value = /*name*/ ctx[24] + "";
|
||||
let t;
|
||||
let mounted;
|
||||
let dispose;
|
||||
|
||||
function click_handler_2() {
|
||||
return /*click_handler_2*/ ctx[19](/*loc*/ ctx[23]);
|
||||
}
|
||||
|
||||
const block = {
|
||||
c: function create() {
|
||||
button = element("button");
|
||||
t = text(t_value);
|
||||
add_location(button, file, 135, 28, 5647);
|
||||
},
|
||||
m: function mount(target, anchor) {
|
||||
insert_dev(target, button, anchor);
|
||||
append_dev(button, t);
|
||||
|
||||
if (!mounted) {
|
||||
dispose = listen_dev(button, "click", click_handler_2, false, false, false);
|
||||
mounted = true;
|
||||
}
|
||||
},
|
||||
p: function update(new_ctx, dirty) {
|
||||
ctx = new_ctx;
|
||||
},
|
||||
d: function destroy(detaching) {
|
||||
if (detaching) detach_dev(button);
|
||||
mounted = false;
|
||||
dispose();
|
||||
}
|
||||
};
|
||||
|
||||
dispatch_dev("SvelteRegisterBlock", {
|
||||
block,
|
||||
id: create_each_block.name,
|
||||
type: "each",
|
||||
source: "(135:24) {#each Object.entries(locales) as [loc,name]}",
|
||||
ctx
|
||||
});
|
||||
|
||||
return block;
|
||||
}
|
||||
|
||||
function create_fragment(ctx) {
|
||||
let show_if = Object.keys(/*$content*/ ctx[5]).length != 0;
|
||||
let if_block_anchor;
|
||||
let if_block = show_if && create_if_block(ctx);
|
||||
|
||||
const block = {
|
||||
c: function create() {
|
||||
if (if_block) if_block.c();
|
||||
if_block_anchor = empty();
|
||||
this.c = noop;
|
||||
},
|
||||
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) {
|
||||
if (if_block) if_block.m(target, anchor);
|
||||
insert_dev(target, if_block_anchor, anchor);
|
||||
},
|
||||
p: function update(ctx, [dirty]) {
|
||||
if (dirty & /*$content*/ 32) show_if = Object.keys(/*$content*/ ctx[5]).length != 0;
|
||||
|
||||
if (show_if) {
|
||||
if (if_block) {
|
||||
if_block.p(ctx, dirty);
|
||||
} else {
|
||||
if_block = create_if_block(ctx);
|
||||
if_block.c();
|
||||
if_block.m(if_block_anchor.parentNode, if_block_anchor);
|
||||
}
|
||||
} else if (if_block) {
|
||||
if_block.d(1);
|
||||
if_block = null;
|
||||
}
|
||||
},
|
||||
i: noop,
|
||||
o: noop,
|
||||
d: function destroy(detaching) {
|
||||
if (if_block) if_block.d(detaching);
|
||||
if (detaching) detach_dev(if_block_anchor);
|
||||
}
|
||||
};
|
||||
|
||||
dispatch_dev("SvelteRegisterBlock", {
|
||||
block,
|
||||
id: create_fragment.name,
|
||||
type: "component",
|
||||
source: "",
|
||||
ctx
|
||||
});
|
||||
|
||||
return block;
|
||||
}
|
||||
|
||||
function hide(dropdown) {
|
||||
let callback = () => {
|
||||
dropdown.style.display = "none";
|
||||
};
|
||||
|
||||
setTimeout(callback, 100);
|
||||
}
|
||||
|
||||
function instance($$self, $$props, $$invalidate) {
|
||||
let $content;
|
||||
let { $$slots: slots = {}, $$scope } = $$props;
|
||||
validate_slots('navbar-not-logged', slots, []);
|
||||
let hambInput;
|
||||
let navbar;
|
||||
let localesDropdown;
|
||||
let initiativesDropdown;
|
||||
let loaded = writable(0);
|
||||
let content = writable({});
|
||||
validate_store(content, 'content');
|
||||
component_subscribe($$self, content, value => $$invalidate(5, $content = value));
|
||||
let logoText;
|
||||
let locale = loadLocaleContent(content, "navbar-component", loaded);
|
||||
|
||||
function changeNavbar() {
|
||||
if (hambInput.checked) {
|
||||
$$invalidate(1, navbar.style.background = "white", navbar);
|
||||
} else {
|
||||
setTimeout(
|
||||
() => {
|
||||
$$invalidate(1, navbar.style.position = "relative", navbar);
|
||||
$$invalidate(1, navbar.style.background = "", navbar);
|
||||
$$invalidate(1, navbar.style.boxShadow = "", navbar);
|
||||
},
|
||||
510
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function showDropdown(dropdown) {
|
||||
let state = dropdown.style.display;
|
||||
$$invalidate(3, initiativesDropdown.style.display = "none", initiativesDropdown);
|
||||
$$invalidate(2, localesDropdown.style.display = "none", localesDropdown);
|
||||
|
||||
if (state == "block") {
|
||||
dropdown.style.display = "none";
|
||||
} else {
|
||||
dropdown.style.display = "block";
|
||||
}
|
||||
}
|
||||
|
||||
function changeLocale(lang) {
|
||||
localStorage.setItem("locale", lang);
|
||||
let locSplit = location.href.split("/");
|
||||
let localesSymbols = Object.keys(locales);
|
||||
locSplit = locSplit.filter(x => !localesSymbols.includes(x));
|
||||
let loc = locSplit.slice(0, locSplit.length - 1).join("/") + "/" + lang + "/" + locSplit[locSplit.length - 1];
|
||||
location.href = loc;
|
||||
}
|
||||
|
||||
function fixHeading() {
|
||||
if (locale == "ru") {
|
||||
let func = () => {
|
||||
if (logoText == undefined) {
|
||||
setTimeout(func, 100);
|
||||
} else {
|
||||
if ((window.innerWidth < 1700 && window.innerWidth > 1400 || window.innerWidth < 400) && logoText.style.lineHeight != "100%") {
|
||||
$$invalidate(4, logoText.style.lineHeight = "120%", logoText);
|
||||
$$invalidate(4, logoText.style.top = "1rem", logoText);
|
||||
$$invalidate(4, logoText.style.width = "16rem", logoText);
|
||||
} else if ((window.innerWidth > 1700 || window.innerWidth > 400 && window.innerWidth < 1400) && logoText.style.lineHeight != "400%") {
|
||||
$$invalidate(4, logoText.style.lineHeight = "400%", logoText);
|
||||
$$invalidate(4, logoText.style.top = "0rem", logoText);
|
||||
$$invalidate(4, logoText.style.width = "auto", logoText);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
func();
|
||||
addEventListener("resize", func);
|
||||
}
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
fixHeading();
|
||||
});
|
||||
|
||||
const writable_props = [];
|
||||
|
||||
Object_1.keys($$props).forEach(key => {
|
||||
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(`<navbar-not-logged> was created with unknown prop '${key}'`);
|
||||
});
|
||||
|
||||
function input_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
hambInput = $$value;
|
||||
$$invalidate(0, hambInput);
|
||||
});
|
||||
}
|
||||
|
||||
function span1_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
logoText = $$value;
|
||||
$$invalidate(4, logoText);
|
||||
});
|
||||
}
|
||||
|
||||
const click_handler = () => showDropdown(initiativesDropdown);
|
||||
const focusout_handler = () => hide(initiativesDropdown);
|
||||
|
||||
function div0_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
initiativesDropdown = $$value;
|
||||
$$invalidate(3, initiativesDropdown);
|
||||
});
|
||||
}
|
||||
|
||||
const click_handler_1 = () => showDropdown(localesDropdown);
|
||||
const focusout_handler_1 = () => hide(localesDropdown);
|
||||
const click_handler_2 = loc => changeLocale(loc);
|
||||
|
||||
function div1_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
localesDropdown = $$value;
|
||||
$$invalidate(2, localesDropdown);
|
||||
});
|
||||
}
|
||||
|
||||
function header_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
navbar = $$value;
|
||||
$$invalidate(1, navbar);
|
||||
});
|
||||
}
|
||||
|
||||
$$self.$capture_state = () => ({
|
||||
onMount,
|
||||
getContext,
|
||||
writable,
|
||||
loadLocaleContent,
|
||||
locales,
|
||||
hambInput,
|
||||
navbar,
|
||||
localesDropdown,
|
||||
initiativesDropdown,
|
||||
loaded,
|
||||
content,
|
||||
logoText,
|
||||
locale,
|
||||
changeNavbar,
|
||||
showDropdown,
|
||||
changeLocale,
|
||||
fixHeading,
|
||||
hide,
|
||||
$content
|
||||
});
|
||||
|
||||
$$self.$inject_state = $$props => {
|
||||
if ('hambInput' in $$props) $$invalidate(0, hambInput = $$props.hambInput);
|
||||
if ('navbar' in $$props) $$invalidate(1, navbar = $$props.navbar);
|
||||
if ('localesDropdown' in $$props) $$invalidate(2, localesDropdown = $$props.localesDropdown);
|
||||
if ('initiativesDropdown' in $$props) $$invalidate(3, initiativesDropdown = $$props.initiativesDropdown);
|
||||
if ('loaded' in $$props) $$invalidate(6, loaded = $$props.loaded);
|
||||
if ('content' in $$props) $$invalidate(7, content = $$props.content);
|
||||
if ('logoText' in $$props) $$invalidate(4, logoText = $$props.logoText);
|
||||
if ('locale' in $$props) $$invalidate(8, locale = $$props.locale);
|
||||
};
|
||||
|
||||
if ($$props && "$$inject" in $$props) {
|
||||
$$self.$inject_state($$props.$$inject);
|
||||
}
|
||||
|
||||
return [
|
||||
hambInput,
|
||||
navbar,
|
||||
localesDropdown,
|
||||
initiativesDropdown,
|
||||
logoText,
|
||||
$content,
|
||||
loaded,
|
||||
content,
|
||||
locale,
|
||||
changeNavbar,
|
||||
showDropdown,
|
||||
changeLocale,
|
||||
input_binding,
|
||||
span1_binding,
|
||||
click_handler,
|
||||
focusout_handler,
|
||||
div0_binding,
|
||||
click_handler_1,
|
||||
focusout_handler_1,
|
||||
click_handler_2,
|
||||
div1_binding,
|
||||
header_binding
|
||||
];
|
||||
}
|
||||
|
||||
class Navbar_not_logged extends SvelteElement {
|
||||
constructor(options) {
|
||||
super();
|
||||
this.shadowRoot.innerHTML = `<style>@import '/css/common.css';#navbar{position:relative;top:0;width:min(100%,116rem);z-index:1000000000;height:5.26rem;padding-left:0rem;padding-right:0rem}#navbar *{font-family:var(--sans-serif, sans-serif)}#logo-container{display:flex;position:absolute;margin-left:1rem;height:100%;max-height:5.26rem;color:black;z-index:1;flex-direction:row;flex-wrap:nowrap;align-items:center}#navbar-logo{height:3.5rem;width:3.5rem;object-fit:contain;border-radius:10rem}#navbar-logo-text{position:relative;word-wrap:normal;height:100%;line-height:400%;font-size:1.4rem;color:#292222;font-family:var(--sans-serif, sans-serif);font-weight:400;padding-left:1.2rem}#nav{position:fixed;width:100%;height:100%;background-color:white;overflow:hidden;z-index:0}#menu>li>a,.options-button{display:block;padding:1.2rem;padding-top:1rem;padding-bottom:1rem;color:black;font-size:1.4rem}#menu>li>a:active{background-color:#f7aec0}#menu li{list-style-type:none}#nav{max-height:0}#hamb{position:absolute;cursor:pointer;right:0rem;padding:2.8rem 2rem;z-index:9999}#hamb-line{background:black;display:block;height:2px;position:relative;width:24px}#hamb-line::before,#hamb-line::after{background:black;content:'';display:block;height:100%;position:absolute;transition:all .2s ease-out;width:100%}#hamb-line::before{top:5px}#hamb-line::after{top:-5px}#side-menu{display:none}#side-menu:checked~nav{display:block;max-height:100%;padding-top:5.625rem}#side-menu:checked~#logo-container{position:fixed}#side-menu:checked~#hamb{position:fixed}#side-menu:checked~#logo-container{position:fixed}#side-menu:checked~#hamb #hamb-line{background:transparent}#side-menu:checked~#hamb #hamb-line::before{transform:rotate(-45deg);top:0}#side-menu:checked~#hamb #hamb-line::after{transform:rotate(45deg);top:0}.options-dropdown{position:absolute;display:none;top:5.6rem;right:1.8rem;border:#404040 solid 0.1rem;background-color:white;z-index:10}.options-dropdown button,.options-dropdown a{display:block;font-family:var(--sans-serif,sans-serif);font-size:1.2rem;width:100%;padding:1rem;text-align:left}.options-dropdown button:hover,.options-dropdown a:hover{background-color:var(--red);color:white}.options-button{width:100%;text-align:left}#locales{position:relative}#locales button{width:100%;text-align:left;height:4rem}#locales button:hover{opacity:0.5}#locales-img{position:relative;top:0rem;height:2rem;margin-left:1.2rem}@media only screen and (min-width: 1200px){#navbar{position:relative;width:min(100%,116rem);left:50%;transform:translateX(-50%);padding-right:4rem;padding-left:4rem}#nav{max-height:none;top:0;position:relative;float:right;width:fit-content;background-color:transparent;overflow:visible}#side-menu:checked~nav{padding-top:0}#menu li{float:left}#menu>li>a:hover,.options-button:hover,#navbar-logo-text:hover{color:rgb(127, 127, 127)}#menu>li>a,.options-button{padding:0.9rem;padding-top:1.9rem;padding-bottom:1.9rem}#hamb{display:none}#locales{position:relative;margin-right:1.8rem}#locales-img{top:0.9rem}}</style>`;
|
||||
|
||||
init(
|
||||
this,
|
||||
{
|
||||
target: this.shadowRoot,
|
||||
props: attribute_to_object(this.attributes),
|
||||
customElement: true
|
||||
},
|
||||
instance,
|
||||
create_fragment,
|
||||
safe_not_equal,
|
||||
{},
|
||||
null
|
||||
);
|
||||
|
||||
if (options) {
|
||||
if (options.target) {
|
||||
insert_dev(options.target, this, options.anchor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define("navbar-not-logged", Navbar_not_logged);
|
||||
|
||||
export { Navbar_not_logged as default };
|
@@ -1 +1,301 @@
|
||||
import{S as i,i as e,a,b as t,s as n,g as r,h as s,n as d,j as o,m as l,d as m,x as p,o as h,f as g}from"./index-8c09578c.js";import{debounce as c}from"../../../../../../../../../js/libraries/miscTools.js";function f(i){let e,a,n,p,h,g,c,f,u,b;return{c(){e=r("div"),a=r("div"),n=r("div"),p=r("div"),p.innerHTML='<slot name="sidebar-left"></slot>',h=s(),g=r("div"),g.innerHTML='<slot name="sidebar-left2"></slot>',c=s(),f=r("div"),f.innerHTML='<slot name="sidebar-right"></slot>',u=s(),b=r("div"),b.innerHTML='<slot name="main" id="main-slot"></slot>',this.c=d,o(p,"id","sidebar-left"),o(p,"class","pane"),o(g,"id","sidebar-left2"),o(g,"class","pane"),o(n,"id","sidebars-left"),o(n,"class","sidebar"),o(f,"id","sidebar-right"),o(f,"class","pane sidebar"),o(b,"id","main-pane"),o(b,"class","pane"),o(a,"class","pane-container"),o(e,"id","root"),o(e,"class","pane-centering")},m(r,s){t(r,e,s),l(e,a),l(a,n),l(n,p),i[5](p),l(n,h),l(n,g),i[6](g),l(a,c),l(a,f),i[7](f),l(a,u),l(a,b),i[8](b),i[9](e)},p:d,i:d,o:d,d(a){a&&m(e),i[5](null),i[6](null),i[7](null),i[8](null),i[9](null)}}}function u(i,e,a){let t,n,r,s,d,o=null!=p("alignerParent")?p("alignerParent").switchView:void 0,l=!1,m=!1,f=!1;function u(){if(null!=t.parentNode){let i=t.parentNode.host.childNodes;if(0==i.length)setTimeout(u,50);else{let e=!1,n=t.parentNode.innerHTML;for(let a of i)"sidebar-left"!=a.slot||l?"sidebar-left2"!=a.slot||m?"sidebar-right"!=a.slot||f||(n=n.replace("#sidebar-right{display:none;","#sidebar-right{"),f=!0,e=!0):(n=n.replace("#sidebar-left2{display:none}",""),m=!0,e=!0):(n=n.replace("#sidebar-left{display:none}",""),l=!0,e=!0);null!=o&&(n=n.replace("1880px",o),e=!0),e&&a(0,t.parentNode.innerHTML=n,t)}}}return window.addEventListener("resize",c(u,100)),h((()=>{u()})),[t,n,r,s,d,function(i){g[i?"unshift":"push"]((()=>{r=i,a(2,r)}))},function(i){g[i?"unshift":"push"]((()=>{s=i,a(3,s)}))},function(i){g[i?"unshift":"push"]((()=>{d=i,a(4,d)}))},function(i){g[i?"unshift":"push"]((()=>{n=i,a(1,n)}))},function(i){g[i?"unshift":"push"]((()=>{t=i,a(0,t)}))}]}class b extends i{constructor(i){super(),this.shadowRoot.innerHTML="<style>@import '/css/common.css';.pane-container{display:block;margin-left:var(--total-margin-left,0rem)}#root{min-height:var(--min-height,auto)}#main-pane{position:relative;padding-left:var(--padding-left,0rem);padding-right:var(--padding-right,0rem);padding-top:var(--padding-top,0rem);padding-bottom:var(--padding-bottom,0rem);text-align:justify;background:var(--background,white);box-shadow:var(--box-shadow,0 0 0.314rem rgb(187, 187, 187));margin:auto;height:min-content;max-width:var(--width-main,66rem);width:var(--width-main,66rem);z-index:1;overflow-x:var(--overflow-x,hidden)}.sidebar{position:absolute}#sidebars-left{display:flex;flex-direction:column;gap:1rem;margin-left:calc(-1*var(--width-left,22.5rem) - 1rem - 4rem);width:calc(var(--width-left,22.5rem) + 4rem)}#sidebar-left,#sidebar-left2{position:relative;background-color:white;padding:2rem 2rem}#sidebar-left{display:none}#sidebar-left2{display:none}#sidebar-right{display:none;margin-left:calc(var(--width-main,66rem) + 1rem);width:var(--width-right,auto);background-color:white;padding:2rem 2rem}@media only screen and (max-width: 1880px){#main-pane{max-width:initial;width:100%;max-width:var(--width-main,66rem);padding-left:var(--padding-left-mobile,1.8rem);padding-right:var(--padding-right-mobile,1.8rem);padding-top:var(--padding-top-mobile,1.8rem);padding-bottom:var(--padding-bottom-mobile,1.8rem)}#sidebars-left,#sidebar-right{position:relative;margin:auto;margin-top:1rem;margin-bottom:1rem;max-width:var(--width-main,66rem);width:100%}.pane-container{width:95%;justify-items:center;grid-auto-flow:row;margin-left:0}}</style>",e(this,{target:this.shadowRoot,props:a(this.attributes),customElement:!0},u,f,n,{},null),i&&i.target&&t(i.target,this,i.anchor)}}customElements.define("pane-aligner",b);export{b as default};
|
||||
|
||||
(function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
|
||||
import { S as SvelteElement, i as init, a as attribute_to_object, b as insert_dev, s as safe_not_equal, d as dispatch_dev, v as validate_slots, g as getContext, o as onMount, c as setContext, f as element, h as space, n as noop, k as attr_dev, j as add_location, l as append_dev, p as detach_dev, q as binding_callbacks } from './index-998178c7.js';
|
||||
import { debounce } from '../../../../../../../../../js/libraries/miscTools.js';
|
||||
|
||||
/* src\components\pane-aligner.svelte generated by Svelte v3.52.0 */
|
||||
const file = "src\\components\\pane-aligner.svelte";
|
||||
|
||||
function create_fragment(ctx) {
|
||||
let div6;
|
||||
let div5;
|
||||
let div2;
|
||||
let div0;
|
||||
let slot0;
|
||||
let t0;
|
||||
let div1;
|
||||
let slot1;
|
||||
let t1;
|
||||
let div3;
|
||||
let slot2;
|
||||
let t2;
|
||||
let div4;
|
||||
let slot3;
|
||||
|
||||
const block = {
|
||||
c: function create() {
|
||||
div6 = element("div");
|
||||
div5 = element("div");
|
||||
div2 = element("div");
|
||||
div0 = element("div");
|
||||
slot0 = element("slot");
|
||||
t0 = space();
|
||||
div1 = element("div");
|
||||
slot1 = element("slot");
|
||||
t1 = space();
|
||||
div3 = element("div");
|
||||
slot2 = element("slot");
|
||||
t2 = space();
|
||||
div4 = element("div");
|
||||
slot3 = element("slot");
|
||||
this.c = noop;
|
||||
attr_dev(slot0, "name", "sidebar-left");
|
||||
add_location(slot0, file, 74, 16, 2554);
|
||||
attr_dev(div0, "id", "sidebar-left");
|
||||
add_location(div0, file, 73, 12, 2489);
|
||||
attr_dev(slot1, "name", "sidebar-left2");
|
||||
add_location(slot1, file, 77, 16, 2688);
|
||||
attr_dev(div1, "id", "sidebar-left2");
|
||||
add_location(div1, file, 76, 12, 2621);
|
||||
attr_dev(div2, "id", "sidebars-left");
|
||||
attr_dev(div2, "class", "sidebar");
|
||||
add_location(div2, file, 72, 8, 2435);
|
||||
attr_dev(slot2, "name", "sidebar-right");
|
||||
add_location(slot2, file, 81, 12, 2853);
|
||||
attr_dev(div3, "id", "sidebar-right");
|
||||
attr_dev(div3, "class", "pane sidebar");
|
||||
add_location(div3, file, 80, 8, 2768);
|
||||
attr_dev(slot3, "name", "main");
|
||||
attr_dev(slot3, "id", "main-slot");
|
||||
add_location(slot3, file, 84, 12, 2968);
|
||||
attr_dev(div4, "id", "main-pane");
|
||||
add_location(div4, file, 83, 8, 2913);
|
||||
attr_dev(div5, "class", "pane-container");
|
||||
add_location(div5, file, 71, 4, 2397);
|
||||
attr_dev(div6, "id", "root");
|
||||
attr_dev(div6, "class", "pane-centering");
|
||||
add_location(div6, file, 70, 0, 2336);
|
||||
},
|
||||
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, div6, anchor);
|
||||
append_dev(div6, div5);
|
||||
append_dev(div5, div2);
|
||||
append_dev(div2, div0);
|
||||
append_dev(div0, slot0);
|
||||
/*div0_binding*/ ctx[5](div0);
|
||||
append_dev(div2, t0);
|
||||
append_dev(div2, div1);
|
||||
append_dev(div1, slot1);
|
||||
/*div1_binding*/ ctx[6](div1);
|
||||
append_dev(div5, t1);
|
||||
append_dev(div5, div3);
|
||||
append_dev(div3, slot2);
|
||||
/*div3_binding*/ ctx[7](div3);
|
||||
append_dev(div5, t2);
|
||||
append_dev(div5, div4);
|
||||
append_dev(div4, slot3);
|
||||
/*div4_binding*/ ctx[8](div4);
|
||||
/*div6_binding*/ ctx[9](div6);
|
||||
},
|
||||
p: noop,
|
||||
i: noop,
|
||||
o: noop,
|
||||
d: function destroy(detaching) {
|
||||
if (detaching) detach_dev(div6);
|
||||
/*div0_binding*/ ctx[5](null);
|
||||
/*div1_binding*/ ctx[6](null);
|
||||
/*div3_binding*/ ctx[7](null);
|
||||
/*div4_binding*/ ctx[8](null);
|
||||
/*div6_binding*/ ctx[9](null);
|
||||
}
|
||||
};
|
||||
|
||||
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('pane-aligner', slots, []);
|
||||
let root;
|
||||
let mainPane;
|
||||
let sidebarLeft;
|
||||
let sidebarLeft2;
|
||||
let sidebarRight;
|
||||
let parentProps = getContext("alignerParent");
|
||||
|
||||
let switchView = parentProps != undefined
|
||||
? getContext("alignerParent").switchView
|
||||
: undefined;
|
||||
|
||||
let leftReplaced = false;
|
||||
let left2Replaced = false;
|
||||
let rightReplaced = false;
|
||||
let switchViewReplaced = false;
|
||||
|
||||
function adjustSlotted() {
|
||||
if (root.parentNode != null) {
|
||||
let slotted = root.parentNode.host.childNodes;
|
||||
|
||||
if (slotted.length == 0) {
|
||||
setTimeout(adjustSlotted, 50);
|
||||
} else {
|
||||
let changed = false;
|
||||
let html = root.parentNode.innerHTML;
|
||||
|
||||
for (let item of slotted) {
|
||||
if (item.slot == "sidebar-left" && !leftReplaced) {
|
||||
html = html.replace("#sidebar-left{display:none}", "");
|
||||
leftReplaced = true;
|
||||
changed = true;
|
||||
} else if (item.slot == "sidebar-left2" && !left2Replaced) {
|
||||
html = html.replace("#sidebar-left2{display:none}", "");
|
||||
left2Replaced = true;
|
||||
changed = true;
|
||||
} else if (item.slot == "sidebar-right" && !rightReplaced) {
|
||||
html = html.replace("#sidebar-right{display:none;", "#sidebar-right{");
|
||||
rightReplaced = true;
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (switchView != undefined && !switchViewReplaced) {
|
||||
html = html.replace("1880px", switchView);
|
||||
changed = true;
|
||||
}
|
||||
|
||||
if (changed) {
|
||||
$$invalidate(0, root.parentNode.innerHTML = html, root);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
window.addEventListener("resize", debounce(adjustSlotted, 100));
|
||||
|
||||
onMount(() => {
|
||||
adjustSlotted();
|
||||
});
|
||||
|
||||
const writable_props = [];
|
||||
|
||||
Object.keys($$props).forEach(key => {
|
||||
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(`<pane-aligner> was created with unknown prop '${key}'`);
|
||||
});
|
||||
|
||||
function div0_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
sidebarLeft = $$value;
|
||||
$$invalidate(2, sidebarLeft);
|
||||
});
|
||||
}
|
||||
|
||||
function div1_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
sidebarLeft2 = $$value;
|
||||
$$invalidate(3, sidebarLeft2);
|
||||
});
|
||||
}
|
||||
|
||||
function div3_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
sidebarRight = $$value;
|
||||
$$invalidate(4, sidebarRight);
|
||||
});
|
||||
}
|
||||
|
||||
function div4_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
mainPane = $$value;
|
||||
$$invalidate(1, mainPane);
|
||||
});
|
||||
}
|
||||
|
||||
function div6_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
root = $$value;
|
||||
$$invalidate(0, root);
|
||||
});
|
||||
}
|
||||
|
||||
$$self.$capture_state = () => ({
|
||||
getContext,
|
||||
setContext,
|
||||
onMount,
|
||||
debounce,
|
||||
root,
|
||||
mainPane,
|
||||
sidebarLeft,
|
||||
sidebarLeft2,
|
||||
sidebarRight,
|
||||
parentProps,
|
||||
switchView,
|
||||
leftReplaced,
|
||||
left2Replaced,
|
||||
rightReplaced,
|
||||
switchViewReplaced,
|
||||
adjustSlotted
|
||||
});
|
||||
|
||||
$$self.$inject_state = $$props => {
|
||||
if ('root' in $$props) $$invalidate(0, root = $$props.root);
|
||||
if ('mainPane' in $$props) $$invalidate(1, mainPane = $$props.mainPane);
|
||||
if ('sidebarLeft' in $$props) $$invalidate(2, sidebarLeft = $$props.sidebarLeft);
|
||||
if ('sidebarLeft2' in $$props) $$invalidate(3, sidebarLeft2 = $$props.sidebarLeft2);
|
||||
if ('sidebarRight' in $$props) $$invalidate(4, sidebarRight = $$props.sidebarRight);
|
||||
if ('parentProps' in $$props) parentProps = $$props.parentProps;
|
||||
if ('switchView' in $$props) switchView = $$props.switchView;
|
||||
if ('leftReplaced' in $$props) leftReplaced = $$props.leftReplaced;
|
||||
if ('left2Replaced' in $$props) left2Replaced = $$props.left2Replaced;
|
||||
if ('rightReplaced' in $$props) rightReplaced = $$props.rightReplaced;
|
||||
if ('switchViewReplaced' in $$props) switchViewReplaced = $$props.switchViewReplaced;
|
||||
};
|
||||
|
||||
if ($$props && "$$inject" in $$props) {
|
||||
$$self.$inject_state($$props.$$inject);
|
||||
}
|
||||
|
||||
return [
|
||||
root,
|
||||
mainPane,
|
||||
sidebarLeft,
|
||||
sidebarLeft2,
|
||||
sidebarRight,
|
||||
div0_binding,
|
||||
div1_binding,
|
||||
div3_binding,
|
||||
div4_binding,
|
||||
div6_binding
|
||||
];
|
||||
}
|
||||
|
||||
class Pane_aligner extends SvelteElement {
|
||||
constructor(options) {
|
||||
super();
|
||||
this.shadowRoot.innerHTML = `<style>@import '/css/common.css';.pane-container{display:block;margin-left:var(--total-margin-left,0rem)}#root{position:relative;margin-top:auto;min-height:var(--min-height,auto);height:100%}#main-pane{position:relative;padding-left:var(--padding-left,0rem);padding-right:var(--padding-right,0rem);padding-top:var(--padding-top,0rem);padding-bottom:var(--padding-bottom,0rem);text-align:justify;margin:auto;height:100%;max-width:var(--width-main,66rem);width:var(--width-main,66rem);z-index:1;overflow-x:var(--overflow-x,hidden)}.sidebar{position:absolute}#sidebars-left{display:flex;flex-direction:column;gap:1rem;margin-left:calc(-1*var(--width-left,22.5rem) - 1rem - 4rem);width:max-content;max-width:30rem}#sidebar-left,#sidebar-left2{position:relative;background-color:white;padding:0rem 0rem}#sidebar-left{display:none}#sidebar-left2{display:none}#sidebar-right{display:none;margin-left:calc(var(--width-main,66rem) + 1rem);width:var(--width-right,auto);background-color:white;padding:2rem 2rem}@media only screen and (max-width: 1340px){#main-pane{max-width:initial;width:100%;max-width:var(--width-main,66rem);padding-left:var(--padding-left-mobile,0rem);padding-right:var(--padding-right-mobile,0rem);padding-top:var(--padding-top-mobile,0rem);padding-bottom:var(--padding-bottom-mobile,0rem)}#sidebars-left,#sidebar-right{position:relative;margin:auto;margin-top:1rem;margin-bottom:1rem;max-width:var(--width-main,66rem);width:100%}.pane-container{width:95%;justify-items:center;grid-auto-flow:row;margin-left:0}}</style>`;
|
||||
|
||||
init(
|
||||
this,
|
||||
{
|
||||
target: this.shadowRoot,
|
||||
props: attribute_to_object(this.attributes),
|
||||
customElement: true
|
||||
},
|
||||
instance,
|
||||
create_fragment,
|
||||
safe_not_equal,
|
||||
{},
|
||||
null
|
||||
);
|
||||
|
||||
if (options) {
|
||||
if (options.target) {
|
||||
insert_dev(options.target, this, options.anchor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define("pane-aligner", Pane_aligner);
|
||||
|
||||
export { Pane_aligner as default };
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
598
Server/public/js/components/profile-component.js
Normal file
598
Server/public/js/components/profile-component.js
Normal file
@@ -0,0 +1,598 @@
|
||||
|
||||
(function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
|
||||
import { S as SvelteElement, i as init, a as attribute_to_object, b as insert_dev, s as safe_not_equal, d as dispatch_dev, v as validate_slots, c as setContext, o as onMount, J as afterUpdate, e as globals, f as element, h as space, n as noop, j as add_location, k as attr_dev, F as set_style, l as append_dev, m as listen_dev, p as detach_dev, r as run_all, q as binding_callbacks } from './index-998178c7.js';
|
||||
import * as AuthTools from '../../../../../../../../../js/libraries/authTools.js';
|
||||
import { svgFromObject } from '../../../../../../../../../js/libraries/miscTools.js';
|
||||
import '../../../../../../../../../js/components/pane-aligner.js';
|
||||
import '../../../../../../../../../js/components/profile-general.js';
|
||||
import '../../../../../../../../../js/components/profile-groups.js';
|
||||
|
||||
/* src\profile\profile-component.svelte generated by Svelte v3.52.0 */
|
||||
|
||||
const { Object: Object_1 } = globals;
|
||||
const file = "src\\profile\\profile-component.svelte";
|
||||
|
||||
function create_fragment(ctx) {
|
||||
let div1;
|
||||
let div0;
|
||||
let p;
|
||||
let t1;
|
||||
let button0;
|
||||
let t2;
|
||||
let pane_aligner;
|
||||
let div2;
|
||||
let button1;
|
||||
let object0;
|
||||
let t3;
|
||||
let span0;
|
||||
let t5;
|
||||
let button2;
|
||||
let object1;
|
||||
let t6;
|
||||
let span1;
|
||||
let t8;
|
||||
let button3;
|
||||
let object2;
|
||||
let t9;
|
||||
let span2;
|
||||
let t11;
|
||||
let button4;
|
||||
let object3;
|
||||
let t12;
|
||||
let span3;
|
||||
let t14;
|
||||
let button5;
|
||||
let object4;
|
||||
let t15;
|
||||
let span4;
|
||||
let t17;
|
||||
let button6;
|
||||
let object5;
|
||||
let t18;
|
||||
let span5;
|
||||
let t20;
|
||||
let div3;
|
||||
let profile_general;
|
||||
let t21;
|
||||
let profile_groups;
|
||||
let t22;
|
||||
let profile_communes;
|
||||
let t23;
|
||||
let profile_coops;
|
||||
let t24;
|
||||
let profile_parties;
|
||||
let mounted;
|
||||
let dispose;
|
||||
|
||||
const block = {
|
||||
c: function create() {
|
||||
div1 = element("div");
|
||||
div0 = element("div");
|
||||
p = element("p");
|
||||
p.textContent = "wegwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww";
|
||||
t1 = space();
|
||||
button0 = element("button");
|
||||
t2 = space();
|
||||
pane_aligner = element("pane-aligner");
|
||||
div2 = element("div");
|
||||
button1 = element("button");
|
||||
object0 = element("object");
|
||||
t3 = space();
|
||||
span0 = element("span");
|
||||
span0.textContent = "general";
|
||||
t5 = space();
|
||||
button2 = element("button");
|
||||
object1 = element("object");
|
||||
t6 = space();
|
||||
span1 = element("span");
|
||||
span1.textContent = "groups";
|
||||
t8 = space();
|
||||
button3 = element("button");
|
||||
object2 = element("object");
|
||||
t9 = space();
|
||||
span2 = element("span");
|
||||
span2.textContent = "communes";
|
||||
t11 = space();
|
||||
button4 = element("button");
|
||||
object3 = element("object");
|
||||
t12 = space();
|
||||
span3 = element("span");
|
||||
span3.textContent = "cooperatives";
|
||||
t14 = space();
|
||||
button5 = element("button");
|
||||
object4 = element("object");
|
||||
t15 = space();
|
||||
span4 = element("span");
|
||||
span4.textContent = "parties";
|
||||
t17 = space();
|
||||
button6 = element("button");
|
||||
object5 = element("object");
|
||||
t18 = space();
|
||||
span5 = element("span");
|
||||
span5.textContent = "logout";
|
||||
t20 = space();
|
||||
div3 = element("div");
|
||||
profile_general = element("profile-general");
|
||||
t21 = space();
|
||||
profile_groups = element("profile-groups");
|
||||
t22 = space();
|
||||
profile_communes = element("profile-communes");
|
||||
t23 = space();
|
||||
profile_coops = element("profile-coops");
|
||||
t24 = space();
|
||||
profile_parties = element("profile-parties");
|
||||
this.c = noop;
|
||||
add_location(p, file, 87, 8, 2264);
|
||||
attr_dev(div0, "id", "location-overlay-content");
|
||||
add_location(div0, file, 86, 4, 2219);
|
||||
attr_dev(button0, "class", "overlay-button");
|
||||
add_location(button0, file, 89, 4, 2326);
|
||||
attr_dev(div1, "class", "overlay");
|
||||
set_style(div1, "display", "none");
|
||||
add_location(div1, file, 85, 0, 2144);
|
||||
attr_dev(object0, "id", "general-img");
|
||||
attr_dev(object0, "class", "icons");
|
||||
attr_dev(object0, "type", "image/svg+xml");
|
||||
attr_dev(object0, "data", "/img/profile/icons/general.svg");
|
||||
attr_dev(object0, "title", "general");
|
||||
add_location(object0, file, 95, 12, 2633);
|
||||
add_location(span0, file, 96, 12, 2770);
|
||||
add_location(button1, file, 94, 8, 2534);
|
||||
attr_dev(object1, "id", "groups-img");
|
||||
attr_dev(object1, "class", "icons");
|
||||
attr_dev(object1, "type", "image/svg+xml");
|
||||
attr_dev(object1, "data", "/img/common/groups.svg");
|
||||
attr_dev(object1, "title", "groups");
|
||||
add_location(object1, file, 99, 12, 2915);
|
||||
add_location(span1, file, 100, 12, 3054);
|
||||
add_location(button2, file, 98, 8, 2819);
|
||||
attr_dev(object2, "id", "communes-img");
|
||||
attr_dev(object2, "class", "icons");
|
||||
attr_dev(object2, "type", "image/svg+xml");
|
||||
attr_dev(object2, "data", "/img/common/communes.svg");
|
||||
attr_dev(object2, "title", "communes");
|
||||
add_location(object2, file, 103, 12, 3204);
|
||||
add_location(span2, file, 104, 12, 3349);
|
||||
add_location(button3, file, 102, 8, 3102);
|
||||
attr_dev(object3, "id", "coops-img");
|
||||
attr_dev(object3, "class", "icons");
|
||||
attr_dev(object3, "type", "image/svg+xml");
|
||||
attr_dev(object3, "data", "/img/common/coops.svg");
|
||||
attr_dev(object3, "title", "coops");
|
||||
add_location(object3, file, 107, 12, 3492);
|
||||
add_location(span3, file, 108, 12, 3628);
|
||||
add_location(button4, file, 106, 8, 3399);
|
||||
attr_dev(object4, "id", "parties-img");
|
||||
attr_dev(object4, "class", "icons");
|
||||
attr_dev(object4, "type", "image/svg+xml");
|
||||
attr_dev(object4, "data", "/img/common/parties.svg");
|
||||
attr_dev(object4, "title", "parties");
|
||||
add_location(object4, file, 111, 12, 3781);
|
||||
add_location(span4, file, 112, 12, 3923);
|
||||
add_location(button5, file, 110, 8, 3682);
|
||||
attr_dev(object5, "id", "logout-img");
|
||||
attr_dev(object5, "class", "icons");
|
||||
attr_dev(object5, "type", "image/svg+xml");
|
||||
attr_dev(object5, "data", "/img/profile/icons/logout.svg");
|
||||
attr_dev(object5, "title", "");
|
||||
add_location(object5, file, 115, 12, 4041);
|
||||
add_location(span5, file, 116, 12, 4181);
|
||||
attr_dev(button6, "id", "logout-button");
|
||||
add_location(button6, file, 114, 8, 3972);
|
||||
attr_dev(div2, "id", "left-column");
|
||||
attr_dev(div2, "class", "pane");
|
||||
attr_dev(div2, "slot", "sidebar-left");
|
||||
add_location(div2, file, 93, 4, 2452);
|
||||
set_style(profile_general, "display", "none");
|
||||
add_location(profile_general, file, 120, 8, 4281);
|
||||
set_style(profile_groups, "display", "none");
|
||||
add_location(profile_groups, file, 121, 8, 4369);
|
||||
set_style(profile_communes, "display", "none");
|
||||
add_location(profile_communes, file, 122, 8, 4455);
|
||||
set_style(profile_coops, "display", "none");
|
||||
add_location(profile_coops, file, 123, 8, 4547);
|
||||
set_style(profile_parties, "display", "none");
|
||||
add_location(profile_parties, file, 124, 8, 4630);
|
||||
attr_dev(div3, "id", "main-column");
|
||||
attr_dev(div3, "slot", "main");
|
||||
add_location(div3, file, 119, 4, 4237);
|
||||
add_location(pane_aligner, file, 92, 0, 2432);
|
||||
},
|
||||
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, div1, anchor);
|
||||
append_dev(div1, div0);
|
||||
append_dev(div0, p);
|
||||
append_dev(div1, t1);
|
||||
append_dev(div1, button0);
|
||||
/*div1_binding*/ ctx[14](div1);
|
||||
insert_dev(target, t2, anchor);
|
||||
insert_dev(target, pane_aligner, anchor);
|
||||
append_dev(pane_aligner, div2);
|
||||
append_dev(div2, button1);
|
||||
append_dev(button1, object0);
|
||||
append_dev(button1, t3);
|
||||
append_dev(button1, span0);
|
||||
/*button1_binding*/ ctx[15](button1);
|
||||
append_dev(div2, t5);
|
||||
append_dev(div2, button2);
|
||||
append_dev(button2, object1);
|
||||
append_dev(button2, t6);
|
||||
append_dev(button2, span1);
|
||||
/*button2_binding*/ ctx[17](button2);
|
||||
append_dev(div2, t8);
|
||||
append_dev(div2, button3);
|
||||
append_dev(button3, object2);
|
||||
append_dev(button3, t9);
|
||||
append_dev(button3, span2);
|
||||
/*button3_binding*/ ctx[19](button3);
|
||||
append_dev(div2, t11);
|
||||
append_dev(div2, button4);
|
||||
append_dev(button4, object3);
|
||||
append_dev(button4, t12);
|
||||
append_dev(button4, span3);
|
||||
/*button4_binding*/ ctx[21](button4);
|
||||
append_dev(div2, t14);
|
||||
append_dev(div2, button5);
|
||||
append_dev(button5, object4);
|
||||
append_dev(button5, t15);
|
||||
append_dev(button5, span4);
|
||||
/*button5_binding*/ ctx[23](button5);
|
||||
append_dev(div2, t17);
|
||||
append_dev(div2, button6);
|
||||
append_dev(button6, object5);
|
||||
append_dev(button6, t18);
|
||||
append_dev(button6, span5);
|
||||
/*div2_binding*/ ctx[25](div2);
|
||||
append_dev(pane_aligner, t20);
|
||||
append_dev(pane_aligner, div3);
|
||||
append_dev(div3, profile_general);
|
||||
/*profile_general_binding*/ ctx[26](profile_general);
|
||||
append_dev(div3, t21);
|
||||
append_dev(div3, profile_groups);
|
||||
/*profile_groups_binding*/ ctx[27](profile_groups);
|
||||
append_dev(div3, t22);
|
||||
append_dev(div3, profile_communes);
|
||||
/*profile_communes_binding*/ ctx[28](profile_communes);
|
||||
append_dev(div3, t23);
|
||||
append_dev(div3, profile_coops);
|
||||
/*profile_coops_binding*/ ctx[29](profile_coops);
|
||||
append_dev(div3, t24);
|
||||
append_dev(div3, profile_parties);
|
||||
/*profile_parties_binding*/ ctx[30](profile_parties);
|
||||
|
||||
if (!mounted) {
|
||||
dispose = [
|
||||
listen_dev(button0, "click", /*click_handler*/ ctx[13], false, false, false),
|
||||
listen_dev(button1, "click", /*click_handler_1*/ ctx[16], false, false, false),
|
||||
listen_dev(button2, "click", /*click_handler_2*/ ctx[18], false, false, false),
|
||||
listen_dev(button3, "click", /*click_handler_3*/ ctx[20], false, false, false),
|
||||
listen_dev(button4, "click", /*click_handler_4*/ ctx[22], false, false, false),
|
||||
listen_dev(button5, "click", /*click_handler_5*/ ctx[24], false, false, false),
|
||||
listen_dev(button6, "click", AuthTools.logout, false, false, false)
|
||||
];
|
||||
|
||||
mounted = true;
|
||||
}
|
||||
},
|
||||
p: noop,
|
||||
i: noop,
|
||||
o: noop,
|
||||
d: function destroy(detaching) {
|
||||
if (detaching) detach_dev(div1);
|
||||
/*div1_binding*/ ctx[14](null);
|
||||
if (detaching) detach_dev(t2);
|
||||
if (detaching) detach_dev(pane_aligner);
|
||||
/*button1_binding*/ ctx[15](null);
|
||||
/*button2_binding*/ ctx[17](null);
|
||||
/*button3_binding*/ ctx[19](null);
|
||||
/*button4_binding*/ ctx[21](null);
|
||||
/*button5_binding*/ ctx[23](null);
|
||||
/*div2_binding*/ ctx[25](null);
|
||||
/*profile_general_binding*/ ctx[26](null);
|
||||
/*profile_groups_binding*/ ctx[27](null);
|
||||
/*profile_communes_binding*/ ctx[28](null);
|
||||
/*profile_coops_binding*/ ctx[29](null);
|
||||
/*profile_parties_binding*/ ctx[30](null);
|
||||
mounted = false;
|
||||
run_all(dispose);
|
||||
}
|
||||
};
|
||||
|
||||
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('profile-component', slots, []);
|
||||
AuthTools.redirectNotLogged();
|
||||
let root;
|
||||
let general;
|
||||
let groups;
|
||||
let communes;
|
||||
let coops;
|
||||
let parties;
|
||||
let panes;
|
||||
let generalButton;
|
||||
let groupsButton;
|
||||
let communesButton;
|
||||
let coopsButton;
|
||||
let partiesButton;
|
||||
let buttons;
|
||||
let locationPopup;
|
||||
let user = {};
|
||||
AuthTools.getUser(user);
|
||||
|
||||
function changePane(pane, button) {
|
||||
for (let p of panes) {
|
||||
p.style.display = "none";
|
||||
}
|
||||
|
||||
for (let b of buttons) {
|
||||
styleField(b, 400, "#636363");
|
||||
}
|
||||
|
||||
pane.style.display = "initial";
|
||||
styleField(button, 500, "#c52a28");
|
||||
}
|
||||
|
||||
function styleField(div, weight, color) {
|
||||
div.style.fontWeight = weight;
|
||||
let svgObject = div.querySelector("object");
|
||||
let svgItem = svgFromObject(svgObject);
|
||||
svgItem.setAttribute("fill", color);
|
||||
}
|
||||
|
||||
function fillFields() {
|
||||
if (Object.keys(user).length != 0 && root != undefined) {
|
||||
for (let b of buttons) {
|
||||
styleField(b, 400, "#636363");
|
||||
}
|
||||
|
||||
styleField(generalButton, 500, "#c52a28");
|
||||
} else {
|
||||
setTimeout(fillFields, 100);
|
||||
}
|
||||
}
|
||||
|
||||
function showLocationOverlay() {
|
||||
$$invalidate(11, locationPopup.style.display = "block", locationPopup);
|
||||
}
|
||||
|
||||
setContext("profile-component", showLocationOverlay);
|
||||
|
||||
onMount(() => {
|
||||
$$invalidate(1, general.user = user, general);
|
||||
panes = [general, groups, communes, coops, parties];
|
||||
buttons = [generalButton, groupsButton, communesButton, coopsButton, partiesButton];
|
||||
fillFields();
|
||||
$$invalidate(1, general.style.display = "initial", general);
|
||||
});
|
||||
|
||||
const writable_props = [];
|
||||
|
||||
Object_1.keys($$props).forEach(key => {
|
||||
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(`<profile-component> was created with unknown prop '${key}'`);
|
||||
});
|
||||
|
||||
const click_handler = () => $$invalidate(11, locationPopup.style.display = "none", locationPopup);
|
||||
|
||||
function div1_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
locationPopup = $$value;
|
||||
$$invalidate(11, locationPopup);
|
||||
});
|
||||
}
|
||||
|
||||
function button1_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
generalButton = $$value;
|
||||
$$invalidate(6, generalButton);
|
||||
});
|
||||
}
|
||||
|
||||
const click_handler_1 = () => changePane(general, generalButton);
|
||||
|
||||
function button2_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
groupsButton = $$value;
|
||||
$$invalidate(7, groupsButton);
|
||||
});
|
||||
}
|
||||
|
||||
const click_handler_2 = () => changePane(groups, groupsButton);
|
||||
|
||||
function button3_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
communesButton = $$value;
|
||||
$$invalidate(8, communesButton);
|
||||
});
|
||||
}
|
||||
|
||||
const click_handler_3 = () => changePane(communes, communesButton);
|
||||
|
||||
function button4_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
coopsButton = $$value;
|
||||
$$invalidate(9, coopsButton);
|
||||
});
|
||||
}
|
||||
|
||||
const click_handler_4 = () => changePane(coops, coopsButton);
|
||||
|
||||
function button5_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
partiesButton = $$value;
|
||||
$$invalidate(10, partiesButton);
|
||||
});
|
||||
}
|
||||
|
||||
const click_handler_5 = () => changePane(parties, partiesButton);
|
||||
|
||||
function div2_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
root = $$value;
|
||||
$$invalidate(0, root);
|
||||
});
|
||||
}
|
||||
|
||||
function profile_general_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
general = $$value;
|
||||
$$invalidate(1, general);
|
||||
});
|
||||
}
|
||||
|
||||
function profile_groups_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
groups = $$value;
|
||||
$$invalidate(2, groups);
|
||||
});
|
||||
}
|
||||
|
||||
function profile_communes_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
communes = $$value;
|
||||
$$invalidate(3, communes);
|
||||
});
|
||||
}
|
||||
|
||||
function profile_coops_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
coops = $$value;
|
||||
$$invalidate(4, coops);
|
||||
});
|
||||
}
|
||||
|
||||
function profile_parties_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
parties = $$value;
|
||||
$$invalidate(5, parties);
|
||||
});
|
||||
}
|
||||
|
||||
$$self.$capture_state = () => ({
|
||||
onMount,
|
||||
afterUpdate,
|
||||
setContext,
|
||||
AuthTools,
|
||||
svgFromObject,
|
||||
root,
|
||||
general,
|
||||
groups,
|
||||
communes,
|
||||
coops,
|
||||
parties,
|
||||
panes,
|
||||
generalButton,
|
||||
groupsButton,
|
||||
communesButton,
|
||||
coopsButton,
|
||||
partiesButton,
|
||||
buttons,
|
||||
locationPopup,
|
||||
user,
|
||||
changePane,
|
||||
styleField,
|
||||
fillFields,
|
||||
showLocationOverlay
|
||||
});
|
||||
|
||||
$$self.$inject_state = $$props => {
|
||||
if ('root' in $$props) $$invalidate(0, root = $$props.root);
|
||||
if ('general' in $$props) $$invalidate(1, general = $$props.general);
|
||||
if ('groups' in $$props) $$invalidate(2, groups = $$props.groups);
|
||||
if ('communes' in $$props) $$invalidate(3, communes = $$props.communes);
|
||||
if ('coops' in $$props) $$invalidate(4, coops = $$props.coops);
|
||||
if ('parties' in $$props) $$invalidate(5, parties = $$props.parties);
|
||||
if ('panes' in $$props) panes = $$props.panes;
|
||||
if ('generalButton' in $$props) $$invalidate(6, generalButton = $$props.generalButton);
|
||||
if ('groupsButton' in $$props) $$invalidate(7, groupsButton = $$props.groupsButton);
|
||||
if ('communesButton' in $$props) $$invalidate(8, communesButton = $$props.communesButton);
|
||||
if ('coopsButton' in $$props) $$invalidate(9, coopsButton = $$props.coopsButton);
|
||||
if ('partiesButton' in $$props) $$invalidate(10, partiesButton = $$props.partiesButton);
|
||||
if ('buttons' in $$props) buttons = $$props.buttons;
|
||||
if ('locationPopup' in $$props) $$invalidate(11, locationPopup = $$props.locationPopup);
|
||||
if ('user' in $$props) user = $$props.user;
|
||||
};
|
||||
|
||||
if ($$props && "$$inject" in $$props) {
|
||||
$$self.$inject_state($$props.$$inject);
|
||||
}
|
||||
|
||||
return [
|
||||
root,
|
||||
general,
|
||||
groups,
|
||||
communes,
|
||||
coops,
|
||||
parties,
|
||||
generalButton,
|
||||
groupsButton,
|
||||
communesButton,
|
||||
coopsButton,
|
||||
partiesButton,
|
||||
locationPopup,
|
||||
changePane,
|
||||
click_handler,
|
||||
div1_binding,
|
||||
button1_binding,
|
||||
click_handler_1,
|
||||
button2_binding,
|
||||
click_handler_2,
|
||||
button3_binding,
|
||||
click_handler_3,
|
||||
button4_binding,
|
||||
click_handler_4,
|
||||
button5_binding,
|
||||
click_handler_5,
|
||||
div2_binding,
|
||||
profile_general_binding,
|
||||
profile_groups_binding,
|
||||
profile_communes_binding,
|
||||
profile_coops_binding,
|
||||
profile_parties_binding
|
||||
];
|
||||
}
|
||||
|
||||
class Profile_component extends SvelteElement {
|
||||
constructor(options) {
|
||||
super();
|
||||
this.shadowRoot.innerHTML = `<style>@import '/css/common.css';#location-overlay-content{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:40rem;width:40rem;background:white;z-index:10000}.overlay{top:0;position:absolute;width:100%;height:100%;z-index:10000}.overlay-button{position:absolute;background:gray;opacity:0.5;width:100vw;height:100vh;z-index:1000}#general-img{top:0rem}#groups-img{top:0.3rem}#coops-img{top:0rem}#parties-img{top:0rem}#logout-img{width:1.5rem}#logout-button{padding-top:1rem;padding-left:0.1rem}#left-column{position:relative;display:flex;flex-direction:column;width:15.2rem;padding:2rem;border-radius:0.64rem 0.64rem 0.64rem 0.64rem;gap:1rem}.icons{position:relative;width:1.8rem}#left-column button span{position:absolute;padding-left:3.4rem;margin-top:0rem;font-family:var(--sans-serif,sans-serif)}#left-column button{display:flex;flex-direction:row}#main-column{padding:1rem 2rem 1rem 2rem;height:100%;width:100%;border-radius:0 0.64rem 0.64rem 0;flex-grow:1;flex-shrink:1;min-height:20rem}pane-aligner{--width-main:800px;--width-left:10.5rem}@media only screen and (max-width: 1340px){#left-column{position:relative;margin-left:0rem;width:100%;border-radius:0.64rem 0.64rem 0rem 0}#main-column{border-radius:0.64rem;padding:3rem 0.5rem;padding-bottom:1.5rem;border-radius:0rem 0rem 0.64rem 0.64rem;width:100%}#logout-button{position:relative;bottom:0}#left-column button{margin-left:auto;margin-right:auto;width:10rem}#logout-button{padding-top:1rem;margin-bottom:0rem}}</style>`;
|
||||
|
||||
init(
|
||||
this,
|
||||
{
|
||||
target: this.shadowRoot,
|
||||
props: attribute_to_object(this.attributes),
|
||||
customElement: true
|
||||
},
|
||||
instance,
|
||||
create_fragment,
|
||||
safe_not_equal,
|
||||
{},
|
||||
null,
|
||||
[-1, -1]
|
||||
);
|
||||
|
||||
if (options) {
|
||||
if (options.target) {
|
||||
insert_dev(options.target, this, options.anchor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define("profile-component", Profile_component);
|
||||
|
||||
export { Profile_component as default };
|
661
Server/public/js/components/profile-general.js
Normal file
661
Server/public/js/components/profile-general.js
Normal file
@@ -0,0 +1,661 @@
|
||||
|
||||
(function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
|
||||
import { S as SvelteElement, i as init, a as attribute_to_object, b as insert_dev, t as flush, s as safe_not_equal, d as dispatch_dev, v as validate_slots, o as onMount, c as setContext, e as globals, f as element, h as space, B as text, n as noop, k as attr_dev, j as add_location, l as append_dev, m as listen_dev, p as detach_dev, r as run_all, q as binding_callbacks, H as is_function } from './index-998178c7.js';
|
||||
import * as AuthTools from '../../../../../../../../../js/libraries/authTools.js';
|
||||
import '../../../../../../../../../js/components/select-component.js';
|
||||
import '../../../../../../../../../js/components/switch-component.js';
|
||||
|
||||
/* src\profile\profile-general.svelte generated by Svelte v3.52.0 */
|
||||
|
||||
const { Object: Object_1 } = globals;
|
||||
const file = "src\\profile\\profile-general.svelte";
|
||||
|
||||
function create_fragment(ctx) {
|
||||
let section_1;
|
||||
let h2;
|
||||
let t1;
|
||||
let div4;
|
||||
let div0;
|
||||
let span0;
|
||||
let t3;
|
||||
let span1;
|
||||
let t4;
|
||||
let div3;
|
||||
let button0;
|
||||
let t6;
|
||||
let div2;
|
||||
let input0;
|
||||
let t7;
|
||||
let div1;
|
||||
let t8;
|
||||
let div9;
|
||||
let div7;
|
||||
let div5;
|
||||
let span2;
|
||||
let t10;
|
||||
let span3;
|
||||
let t11;
|
||||
let div6;
|
||||
let button1;
|
||||
let t12;
|
||||
let object0;
|
||||
let t13;
|
||||
let div8;
|
||||
let button2;
|
||||
let t15;
|
||||
let input1;
|
||||
let t16;
|
||||
let button3;
|
||||
let object1;
|
||||
let mounted;
|
||||
let dispose;
|
||||
|
||||
const block = {
|
||||
c: function create() {
|
||||
section_1 = element("section");
|
||||
h2 = element("h2");
|
||||
h2.textContent = "General";
|
||||
t1 = space();
|
||||
div4 = element("div");
|
||||
div0 = element("div");
|
||||
span0 = element("span");
|
||||
span0.textContent = "Email:";
|
||||
t3 = space();
|
||||
span1 = element("span");
|
||||
t4 = space();
|
||||
div3 = element("div");
|
||||
button0 = element("button");
|
||||
button0.textContent = "save";
|
||||
t6 = space();
|
||||
div2 = element("div");
|
||||
input0 = element("input");
|
||||
t7 = space();
|
||||
div1 = element("div");
|
||||
t8 = space();
|
||||
div9 = element("div");
|
||||
div7 = element("div");
|
||||
div5 = element("div");
|
||||
span2 = element("span");
|
||||
span2.textContent = "Password:";
|
||||
t10 = space();
|
||||
span3 = element("span");
|
||||
t11 = space();
|
||||
div6 = element("div");
|
||||
button1 = element("button");
|
||||
t12 = text("change\r\n ");
|
||||
object0 = element("object");
|
||||
t13 = space();
|
||||
div8 = element("div");
|
||||
button2 = element("button");
|
||||
button2.textContent = "save";
|
||||
t15 = space();
|
||||
input1 = element("input");
|
||||
t16 = space();
|
||||
button3 = element("button");
|
||||
object1 = element("object");
|
||||
this.c = noop;
|
||||
attr_dev(h2, "class", "title-highlight");
|
||||
add_location(h2, file, 133, 4, 3608);
|
||||
add_location(span0, file, 136, 12, 3804);
|
||||
attr_dev(span1, "id", "signup-email-msg");
|
||||
add_location(span1, file, 137, 12, 3837);
|
||||
attr_dev(div0, "class", "title-msg");
|
||||
add_location(div0, file, 135, 8, 3767);
|
||||
attr_dev(button0, "id", "save-email");
|
||||
attr_dev(button0, "class", "save-button");
|
||||
add_location(button0, file, 140, 12, 3983);
|
||||
attr_dev(input0, "id", "emailInput");
|
||||
attr_dev(input0, "class", "text-input");
|
||||
attr_dev(input0, "type", "text");
|
||||
add_location(input0, file, 142, 16, 4148);
|
||||
attr_dev(div1, "class", "ghost-input");
|
||||
add_location(div1, file, 143, 16, 4334);
|
||||
attr_dev(div2, "class", "input-wrapper");
|
||||
add_location(div2, file, 141, 12, 4103);
|
||||
attr_dev(div3, "id", "emailInputDiv");
|
||||
add_location(div3, file, 139, 8, 3919);
|
||||
add_location(div4, file, 134, 4, 3654);
|
||||
add_location(span2, file, 150, 16, 4661);
|
||||
attr_dev(span3, "id", "signup-password-msg");
|
||||
add_location(span3, file, 151, 16, 4701);
|
||||
attr_dev(div5, "class", "title-msg");
|
||||
add_location(div5, file, 149, 12, 4620);
|
||||
attr_dev(object0, "type", "image/svg+xml");
|
||||
attr_dev(object0, "data", "/img/profile/icons/pencil.svg");
|
||||
attr_dev(object0, "title", "pencil-icon");
|
||||
add_location(object0, file, 156, 20, 4984);
|
||||
attr_dev(button1, "id", "change-password");
|
||||
add_location(button1, file, 155, 16, 4895);
|
||||
attr_dev(div6, "id", "change-password-div");
|
||||
add_location(div6, file, 154, 12, 4817);
|
||||
attr_dev(div7, "id", "change-password-line");
|
||||
add_location(div7, file, 148, 8, 4575);
|
||||
attr_dev(button2, "id", "save-password");
|
||||
attr_dev(button2, "class", "save-button");
|
||||
add_location(button2, file, 161, 12, 5237);
|
||||
attr_dev(input1, "id", "passwordInput");
|
||||
attr_dev(input1, "class", "text-input");
|
||||
attr_dev(input1, "type", "password");
|
||||
add_location(input1, file, 162, 12, 5366);
|
||||
attr_dev(object1, "type", "image/svg+xml");
|
||||
attr_dev(object1, "data", "/img/auth/eye_icon.svg");
|
||||
attr_dev(object1, "title", "eye icon");
|
||||
add_location(object1, file, 164, 16, 5627);
|
||||
attr_dev(button3, "class", "eye-icon");
|
||||
add_location(button3, file, 163, 12, 5467);
|
||||
attr_dev(div8, "id", "change-password-input-div");
|
||||
add_location(div8, file, 160, 8, 5152);
|
||||
attr_dev(div9, "id", "change-password-line-wrapper");
|
||||
add_location(div9, file, 147, 4, 4419);
|
||||
attr_dev(section_1, "id", "general-section");
|
||||
add_location(section_1, file, 132, 0, 3552);
|
||||
},
|
||||
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, section_1, anchor);
|
||||
append_dev(section_1, h2);
|
||||
append_dev(section_1, t1);
|
||||
append_dev(section_1, div4);
|
||||
append_dev(div4, div0);
|
||||
append_dev(div0, span0);
|
||||
append_dev(div0, t3);
|
||||
append_dev(div0, span1);
|
||||
/*span1_binding*/ ctx[18](span1);
|
||||
append_dev(div4, t4);
|
||||
append_dev(div4, div3);
|
||||
append_dev(div3, button0);
|
||||
/*button0_binding*/ ctx[19](button0);
|
||||
append_dev(div3, t6);
|
||||
append_dev(div3, div2);
|
||||
append_dev(div2, input0);
|
||||
/*input0_binding*/ ctx[20](input0);
|
||||
append_dev(div2, t7);
|
||||
append_dev(div2, div1);
|
||||
/*div3_binding*/ ctx[23](div3);
|
||||
/*div4_binding*/ ctx[24](div4);
|
||||
append_dev(section_1, t8);
|
||||
append_dev(section_1, div9);
|
||||
append_dev(div9, div7);
|
||||
append_dev(div7, div5);
|
||||
append_dev(div5, span2);
|
||||
append_dev(div5, t10);
|
||||
append_dev(div5, span3);
|
||||
/*span3_binding*/ ctx[25](span3);
|
||||
append_dev(div7, t11);
|
||||
append_dev(div7, div6);
|
||||
append_dev(div6, button1);
|
||||
append_dev(button1, t12);
|
||||
append_dev(button1, object0);
|
||||
/*div6_binding*/ ctx[26](div6);
|
||||
append_dev(div9, t13);
|
||||
append_dev(div9, div8);
|
||||
append_dev(div8, button2);
|
||||
/*button2_binding*/ ctx[27](button2);
|
||||
append_dev(div8, t15);
|
||||
append_dev(div8, input1);
|
||||
/*input1_binding*/ ctx[28](input1);
|
||||
append_dev(div8, t16);
|
||||
append_dev(div8, button3);
|
||||
append_dev(button3, object1);
|
||||
/*button3_binding*/ ctx[29](button3);
|
||||
/*div8_binding*/ ctx[31](div8);
|
||||
/*div9_binding*/ ctx[32](div9);
|
||||
/*section_1_binding*/ ctx[33](section_1);
|
||||
|
||||
if (!mounted) {
|
||||
dispose = [
|
||||
listen_dev(button0, "click", /*saveEmail*/ ctx[14], false, false, false),
|
||||
listen_dev(input0, "click", /*click_handler*/ ctx[21], false, false, false),
|
||||
listen_dev(input0, "input", /*input_handler*/ ctx[22], false, false, false),
|
||||
listen_dev(
|
||||
div4,
|
||||
"mouseenter",
|
||||
function () {
|
||||
if (is_function(/*emailDiv*/ ctx[11].focused = true)) (/*emailDiv*/ ctx[11].focused = true).apply(this, arguments);
|
||||
},
|
||||
false,
|
||||
false,
|
||||
false
|
||||
),
|
||||
listen_dev(
|
||||
div4,
|
||||
"mouseleave",
|
||||
function () {
|
||||
if (is_function(/*emailDiv*/ ctx[11].focused = false)) (/*emailDiv*/ ctx[11].focused = false).apply(this, arguments);
|
||||
},
|
||||
false,
|
||||
false,
|
||||
false
|
||||
),
|
||||
listen_dev(button1, "click", /*launchChangePassword*/ ctx[15], false, false, false),
|
||||
listen_dev(button2, "click", /*savePassword*/ ctx[16], false, false, false),
|
||||
listen_dev(button3, "click", /*click_handler_1*/ ctx[30], false, false, false),
|
||||
listen_dev(
|
||||
div9,
|
||||
"mouseenter",
|
||||
function () {
|
||||
if (is_function(/*passwordDiv*/ ctx[10].focused = true)) (/*passwordDiv*/ ctx[10].focused = true).apply(this, arguments);
|
||||
},
|
||||
false,
|
||||
false,
|
||||
false
|
||||
),
|
||||
listen_dev(
|
||||
div9,
|
||||
"mouseleave",
|
||||
function () {
|
||||
if (is_function(/*passwordDiv*/ ctx[10].focused = false)) (/*passwordDiv*/ ctx[10].focused = false).apply(this, arguments);
|
||||
},
|
||||
false,
|
||||
false,
|
||||
false
|
||||
)
|
||||
];
|
||||
|
||||
mounted = true;
|
||||
}
|
||||
},
|
||||
p: function update(new_ctx, dirty) {
|
||||
ctx = new_ctx;
|
||||
},
|
||||
i: noop,
|
||||
o: noop,
|
||||
d: function destroy(detaching) {
|
||||
if (detaching) detach_dev(section_1);
|
||||
/*span1_binding*/ ctx[18](null);
|
||||
/*button0_binding*/ ctx[19](null);
|
||||
/*input0_binding*/ ctx[20](null);
|
||||
/*div3_binding*/ ctx[23](null);
|
||||
/*div4_binding*/ ctx[24](null);
|
||||
/*span3_binding*/ ctx[25](null);
|
||||
/*div6_binding*/ ctx[26](null);
|
||||
/*button2_binding*/ ctx[27](null);
|
||||
/*input1_binding*/ ctx[28](null);
|
||||
/*button3_binding*/ ctx[29](null);
|
||||
/*div8_binding*/ ctx[31](null);
|
||||
/*div9_binding*/ ctx[32](null);
|
||||
/*section_1_binding*/ ctx[33](null);
|
||||
mounted = false;
|
||||
run_all(dispose);
|
||||
}
|
||||
};
|
||||
|
||||
dispatch_dev("SvelteRegisterBlock", {
|
||||
block,
|
||||
id: create_fragment.name,
|
||||
type: "component",
|
||||
source: "",
|
||||
ctx
|
||||
});
|
||||
|
||||
return block;
|
||||
}
|
||||
|
||||
function resizeInput(el) {
|
||||
el.nextElementSibling.innerHTML = el.value;
|
||||
}
|
||||
|
||||
function instance($$self, $$props, $$invalidate) {
|
||||
let { $$slots: slots = {}, $$scope } = $$props;
|
||||
validate_slots('profile-general', slots, []);
|
||||
let { user = null } = $$props;
|
||||
|
||||
// Main code
|
||||
let emailInput;
|
||||
|
||||
let section;
|
||||
let saveEmailButton;
|
||||
let changePasswordInputDiv;
|
||||
let changePasswordMsg;
|
||||
let savePasswordButton;
|
||||
let passwordInput;
|
||||
let changePasswordDiv;
|
||||
let passwordVisibilityButton;
|
||||
let emailMsg;
|
||||
let passwordDiv;
|
||||
let emailDiv;
|
||||
let emailInputDiv;
|
||||
let prevEmail;
|
||||
|
||||
function showSaveButton(button) {
|
||||
prevEmail = emailInput.value;
|
||||
button.style.display = "initial";
|
||||
$$invalidate(9, emailMsg.style.display = "inline", emailMsg);
|
||||
let windowWidth = window.innerWidth;
|
||||
|
||||
if (windowWidth < 1100) {
|
||||
$$invalidate(12, emailInputDiv.style.marginTop = "1rem", emailInputDiv);
|
||||
$$invalidate(11, emailDiv.style.flexDirection = "column", emailDiv);
|
||||
} //emailInput.style.width = "19rem"
|
||||
}
|
||||
|
||||
function saveEmail() {
|
||||
let email = emailInput.value;
|
||||
|
||||
if (AuthTools.checkEmail(email, emailMsg)) {
|
||||
if (email != user.email) {
|
||||
AuthTools.changeUser("email", email, user);
|
||||
}
|
||||
|
||||
resetEmailField();
|
||||
}
|
||||
}
|
||||
|
||||
function resetEmailField() {
|
||||
if (prevEmail != undefined) {
|
||||
$$invalidate(0, emailInput.value = prevEmail, emailInput);
|
||||
}
|
||||
|
||||
$$invalidate(0, emailInput.style.width = "100%", emailInput);
|
||||
$$invalidate(9, emailMsg.style.display = "none", emailMsg);
|
||||
$$invalidate(11, emailDiv.style.flexDirection = "row", emailDiv);
|
||||
$$invalidate(12, emailInputDiv.style.marginTop = "0rem", emailInputDiv);
|
||||
$$invalidate(2, saveEmailButton.style.display = "none", saveEmailButton);
|
||||
$$invalidate(9, emailMsg.innerHTML = "", emailMsg);
|
||||
}
|
||||
|
||||
function launchChangePassword() {
|
||||
let windowWidth = window.innerWidth;
|
||||
|
||||
if (windowWidth < 1100) {
|
||||
$$invalidate(3, changePasswordInputDiv.style.display = "flex", changePasswordInputDiv);
|
||||
} else {
|
||||
$$invalidate(3, changePasswordInputDiv.style.display = "initial", changePasswordInputDiv);
|
||||
}
|
||||
|
||||
$$invalidate(7, changePasswordDiv.style.display = "none", changePasswordDiv);
|
||||
passwordInput.focus();
|
||||
}
|
||||
|
||||
function savePassword() {
|
||||
let password = passwordInput.value;
|
||||
|
||||
if (AuthTools.checkPassword(password, changePasswordMsg)) {
|
||||
if (password != user.password) {
|
||||
AuthTools.changeUser("password", password, user);
|
||||
}
|
||||
|
||||
$$invalidate(4, changePasswordMsg.innerHTML = "", changePasswordMsg);
|
||||
resetPasswordField();
|
||||
}
|
||||
}
|
||||
|
||||
function resetPasswordField() {
|
||||
$$invalidate(3, changePasswordInputDiv.style.display = "none", changePasswordInputDiv);
|
||||
$$invalidate(7, changePasswordDiv.style.display = "initial", changePasswordDiv);
|
||||
$$invalidate(4, changePasswordMsg.innerHTML = "", changePasswordMsg);
|
||||
}
|
||||
|
||||
function fillFields() {
|
||||
if (user != null && Object.keys(user).length != 0 && section != undefined) {
|
||||
$$invalidate(0, emailInput.value = user.email, emailInput);
|
||||
} else {
|
||||
setTimeout(fillFields, 10);
|
||||
}
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
fillFields();
|
||||
|
||||
document.addEventListener("click", function (event) {
|
||||
if (passwordDiv.focused) {
|
||||
resetEmailField();
|
||||
} else if (emailDiv.focused) {
|
||||
resetPasswordField();
|
||||
} else {
|
||||
resetEmailField();
|
||||
resetPasswordField();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
const writable_props = ['user'];
|
||||
|
||||
Object_1.keys($$props).forEach(key => {
|
||||
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(`<profile-general> was created with unknown prop '${key}'`);
|
||||
});
|
||||
|
||||
function span1_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
emailMsg = $$value;
|
||||
$$invalidate(9, emailMsg);
|
||||
});
|
||||
}
|
||||
|
||||
function button0_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
saveEmailButton = $$value;
|
||||
$$invalidate(2, saveEmailButton);
|
||||
});
|
||||
}
|
||||
|
||||
function input0_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
emailInput = $$value;
|
||||
$$invalidate(0, emailInput);
|
||||
});
|
||||
}
|
||||
|
||||
const click_handler = () => showSaveButton(saveEmailButton);
|
||||
const input_handler = () => resizeInput(emailInput);
|
||||
|
||||
function div3_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
emailInputDiv = $$value;
|
||||
$$invalidate(12, emailInputDiv);
|
||||
});
|
||||
}
|
||||
|
||||
function div4_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
emailDiv = $$value;
|
||||
$$invalidate(11, emailDiv);
|
||||
});
|
||||
}
|
||||
|
||||
function span3_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
changePasswordMsg = $$value;
|
||||
$$invalidate(4, changePasswordMsg);
|
||||
});
|
||||
}
|
||||
|
||||
function div6_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
changePasswordDiv = $$value;
|
||||
$$invalidate(7, changePasswordDiv);
|
||||
});
|
||||
}
|
||||
|
||||
function button2_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
savePasswordButton = $$value;
|
||||
$$invalidate(5, savePasswordButton);
|
||||
});
|
||||
}
|
||||
|
||||
function input1_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
passwordInput = $$value;
|
||||
$$invalidate(6, passwordInput);
|
||||
});
|
||||
}
|
||||
|
||||
function button3_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
passwordVisibilityButton = $$value;
|
||||
$$invalidate(8, passwordVisibilityButton);
|
||||
});
|
||||
}
|
||||
|
||||
const click_handler_1 = () => AuthTools.changePasswordVisibility(passwordVisibilityButton);
|
||||
|
||||
function div8_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
changePasswordInputDiv = $$value;
|
||||
$$invalidate(3, changePasswordInputDiv);
|
||||
});
|
||||
}
|
||||
|
||||
function div9_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
passwordDiv = $$value;
|
||||
$$invalidate(10, passwordDiv);
|
||||
});
|
||||
}
|
||||
|
||||
function section_1_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
section = $$value;
|
||||
$$invalidate(1, section);
|
||||
});
|
||||
}
|
||||
|
||||
$$self.$$set = $$props => {
|
||||
if ('user' in $$props) $$invalidate(17, user = $$props.user);
|
||||
};
|
||||
|
||||
$$self.$capture_state = () => ({
|
||||
onMount,
|
||||
setContext,
|
||||
AuthTools,
|
||||
user,
|
||||
emailInput,
|
||||
section,
|
||||
saveEmailButton,
|
||||
changePasswordInputDiv,
|
||||
changePasswordMsg,
|
||||
savePasswordButton,
|
||||
passwordInput,
|
||||
changePasswordDiv,
|
||||
passwordVisibilityButton,
|
||||
emailMsg,
|
||||
passwordDiv,
|
||||
emailDiv,
|
||||
emailInputDiv,
|
||||
prevEmail,
|
||||
showSaveButton,
|
||||
saveEmail,
|
||||
resetEmailField,
|
||||
launchChangePassword,
|
||||
savePassword,
|
||||
resetPasswordField,
|
||||
fillFields,
|
||||
resizeInput
|
||||
});
|
||||
|
||||
$$self.$inject_state = $$props => {
|
||||
if ('user' in $$props) $$invalidate(17, user = $$props.user);
|
||||
if ('emailInput' in $$props) $$invalidate(0, emailInput = $$props.emailInput);
|
||||
if ('section' in $$props) $$invalidate(1, section = $$props.section);
|
||||
if ('saveEmailButton' in $$props) $$invalidate(2, saveEmailButton = $$props.saveEmailButton);
|
||||
if ('changePasswordInputDiv' in $$props) $$invalidate(3, changePasswordInputDiv = $$props.changePasswordInputDiv);
|
||||
if ('changePasswordMsg' in $$props) $$invalidate(4, changePasswordMsg = $$props.changePasswordMsg);
|
||||
if ('savePasswordButton' in $$props) $$invalidate(5, savePasswordButton = $$props.savePasswordButton);
|
||||
if ('passwordInput' in $$props) $$invalidate(6, passwordInput = $$props.passwordInput);
|
||||
if ('changePasswordDiv' in $$props) $$invalidate(7, changePasswordDiv = $$props.changePasswordDiv);
|
||||
if ('passwordVisibilityButton' in $$props) $$invalidate(8, passwordVisibilityButton = $$props.passwordVisibilityButton);
|
||||
if ('emailMsg' in $$props) $$invalidate(9, emailMsg = $$props.emailMsg);
|
||||
if ('passwordDiv' in $$props) $$invalidate(10, passwordDiv = $$props.passwordDiv);
|
||||
if ('emailDiv' in $$props) $$invalidate(11, emailDiv = $$props.emailDiv);
|
||||
if ('emailInputDiv' in $$props) $$invalidate(12, emailInputDiv = $$props.emailInputDiv);
|
||||
if ('prevEmail' in $$props) prevEmail = $$props.prevEmail;
|
||||
};
|
||||
|
||||
if ($$props && "$$inject" in $$props) {
|
||||
$$self.$inject_state($$props.$$inject);
|
||||
}
|
||||
|
||||
return [
|
||||
emailInput,
|
||||
section,
|
||||
saveEmailButton,
|
||||
changePasswordInputDiv,
|
||||
changePasswordMsg,
|
||||
savePasswordButton,
|
||||
passwordInput,
|
||||
changePasswordDiv,
|
||||
passwordVisibilityButton,
|
||||
emailMsg,
|
||||
passwordDiv,
|
||||
emailDiv,
|
||||
emailInputDiv,
|
||||
showSaveButton,
|
||||
saveEmail,
|
||||
launchChangePassword,
|
||||
savePassword,
|
||||
user,
|
||||
span1_binding,
|
||||
button0_binding,
|
||||
input0_binding,
|
||||
click_handler,
|
||||
input_handler,
|
||||
div3_binding,
|
||||
div4_binding,
|
||||
span3_binding,
|
||||
div6_binding,
|
||||
button2_binding,
|
||||
input1_binding,
|
||||
button3_binding,
|
||||
click_handler_1,
|
||||
div8_binding,
|
||||
div9_binding,
|
||||
section_1_binding
|
||||
];
|
||||
}
|
||||
|
||||
class Profile_general extends SvelteElement {
|
||||
constructor(options) {
|
||||
super();
|
||||
|
||||
this.shadowRoot.innerHTML = `<style>@import '/css/common.css';.ghost-input{display:block;visibility:hidden;height:0;padding-left:0.5rem;padding-right:0.5rem}.input-wrapper{display:inline-block;max-width:calc(100% - 10rem);min-width:0rem;height:2.5rem;position:relative;right:0
|
||||
}span{font-family:var(--sans-serif,sans-serif);font-size:1.15rem}#general-section{display:flex;flex-direction:column}#general-section h2{margin:auto;margin-top:0;margin-bottom:0}#general-section>div{height:3.5rem;padding-bottom:0.75rem;padding-top:0.75rem;border-bottom:0.14rem solid;border-color:#cdcdcd}#general-section>div>:first-child{font-family:var(--sans-serif,sans-serif)}#general-section>div:last-child{padding-bottom:0.75rem;padding-top:0.75rem;border-bottom:0}#general-section>div div,#general-section>div input,#general-section>div :not(:first-child) input{font-weight:500;font-size:1.15rem;font-family:var(--sans-serif,sans-serif);color:#292222;border:0}#general-section>div>:last-child{padding-right:1.35rem}.text-input{position:relative;width:20.475rem;direction:rtl;border:0;outline:none;bottom:0.341rem}#emailInput{position:relative;right:0;top:0.1rem;width:100%}#save-email{display:none;margin-top:0.5rem}#signup-email-msg,#signup-password-msg{position:relative;display:inline-block;color:red;font-weight:400;white-space:nowrap}#signup-email-msg{display:none}#general-section>div:nth-child(2){display:flex;flex-direction:row}#emailInputDiv{display:flex;flex-direction:row;justify-content:right;align-items:center;height:2rem;width:100%}.title-msg{display:flex;gap:0.5rem}.title-msg *{text-align:left}#change-password-line{display:flex;justify-content:space-between}#change-password-div{width:9.3rem;left:0}#change-password{position:absolute;cursor:pointer;width:8rem;height:2.73rem;font-size:1.15rem;font-family:var(--sans-serif,sans-serif);font-weight:500;text-align:right;padding-right:2rem;margin-top:-0.55rem;background-color:transparent}#change-password>object{pointer-events:none;position:absolute;width:1.5rem;right:0.0rem}#change-password-input-div{display:none;float:right;position:relative;margin-top:-1.7rem}#passwordInput{width:15rem;right:0.65rem;margin-left:1.5rem}.save-button{position:relative;bottom:0.34rem;margin-right:0.6rem;height:2.73rem;width:4.778rem;font-family:var(--sans-serif,sans-serif);font-size:1.15rem;color:white;background-color:var(--red);border-color:var(--red);border-radius:0.512rem}#save-password{bottom:0.6rem
|
||||
}.eye-icon{display:inline-block;position:relative;cursor:pointer;opacity:0.25;height:2.2rem;width:1.7rem}.eye-icon *{pointer-events:none}@media only screen and (max-width: 1100px){#change-password-line-wrapper{display:flex;flex-direction:column;height:auto;min-height:4rem}#change-password-input-div{margin-top:1rem;justify-content:flex-end}#general-section>div:nth-child(2){height:auto;min-height:4rem;position:relative}#passwordInput{width:100%;bottom:0}#emailInput{width:100%}#save-password{bottom:0rem
|
||||
}}</style>`;
|
||||
|
||||
init(
|
||||
this,
|
||||
{
|
||||
target: this.shadowRoot,
|
||||
props: attribute_to_object(this.attributes),
|
||||
customElement: true
|
||||
},
|
||||
instance,
|
||||
create_fragment,
|
||||
safe_not_equal,
|
||||
{ user: 17 },
|
||||
null,
|
||||
[-1, -1]
|
||||
);
|
||||
|
||||
if (options) {
|
||||
if (options.target) {
|
||||
insert_dev(options.target, this, options.anchor);
|
||||
}
|
||||
|
||||
if (options.props) {
|
||||
this.$set(options.props);
|
||||
flush();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static get observedAttributes() {
|
||||
return ["user"];
|
||||
}
|
||||
|
||||
get user() {
|
||||
return this.$$.ctx[17];
|
||||
}
|
||||
|
||||
set user(user) {
|
||||
this.$$set({ user });
|
||||
flush();
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define("profile-general", Profile_general);
|
||||
|
||||
export { Profile_general as default };
|
80
Server/public/js/components/profile-group.js
Normal file
80
Server/public/js/components/profile-group.js
Normal file
@@ -0,0 +1,80 @@
|
||||
|
||||
(function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
|
||||
import { S as SvelteElement, i as init, a as attribute_to_object, b as insert_dev, s as safe_not_equal, d as dispatch_dev, v as validate_slots, o as onMount, n as noop } from './index-6b4fe380.js';
|
||||
import * as AuthTools from '../../../../../../../../../js/libraries/authTools.js';
|
||||
|
||||
/* src\profile\profile-group.svelte generated by Svelte v3.52.0 */
|
||||
|
||||
function create_fragment(ctx) {
|
||||
const block = {
|
||||
c: function create() {
|
||||
this.c = noop;
|
||||
},
|
||||
l: function claim(nodes) {
|
||||
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
|
||||
},
|
||||
m: noop,
|
||||
p: noop,
|
||||
i: noop,
|
||||
o: noop,
|
||||
d: noop
|
||||
};
|
||||
|
||||
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('profile-group', slots, []);
|
||||
|
||||
onMount(() => {
|
||||
|
||||
});
|
||||
|
||||
const writable_props = [];
|
||||
|
||||
Object.keys($$props).forEach(key => {
|
||||
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(`<profile-group> was created with unknown prop '${key}'`);
|
||||
});
|
||||
|
||||
$$self.$capture_state = () => ({ onMount, AuthTools });
|
||||
return [];
|
||||
}
|
||||
|
||||
class Profile_group extends SvelteElement {
|
||||
constructor(options) {
|
||||
super();
|
||||
|
||||
init(
|
||||
this,
|
||||
{
|
||||
target: this.shadowRoot,
|
||||
props: attribute_to_object(this.attributes),
|
||||
customElement: true
|
||||
},
|
||||
instance,
|
||||
create_fragment,
|
||||
safe_not_equal,
|
||||
{},
|
||||
null
|
||||
);
|
||||
|
||||
if (options) {
|
||||
if (options.target) {
|
||||
insert_dev(options.target, this, options.anchor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define("profile-group", Profile_group);
|
||||
|
||||
export { Profile_group as default };
|
704
Server/public/js/components/profile-groups.js
Normal file
704
Server/public/js/components/profile-groups.js
Normal file
@@ -0,0 +1,704 @@
|
||||
|
||||
(function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
|
||||
import { S as SvelteElement, i as init, a as attribute_to_object, b as insert_dev, t as flush, s as safe_not_equal, d as dispatch_dev, v as validate_slots, w as validate_store, x as component_subscribe, g as getContext, o as onMount, y as empty, n as noop, p as detach_dev, q as binding_callbacks, f as element, h as space, B as text, j as add_location, k as attr_dev, l as append_dev, K as set_input_value, m as listen_dev, C as set_data_dev, r as run_all } from './index-998178c7.js';
|
||||
import { w as writable } from './index-f9998ce7.js';
|
||||
import { getData } from '../../../../../../../../../js/libraries/serverTools.js';
|
||||
import '../../../../../../../../../js/components/select-component.js';
|
||||
import '../../../../../../../../../js/components/switch-component.js';
|
||||
|
||||
/* src\profile\profile-groups.svelte generated by Svelte v3.52.0 */
|
||||
const file = "src\\profile\\profile-groups.svelte";
|
||||
|
||||
// (115:4) {#if $loaded==1}
|
||||
function create_if_block(ctx) {
|
||||
let h2;
|
||||
let t1;
|
||||
let h30;
|
||||
let t3;
|
||||
let section0;
|
||||
let div2;
|
||||
let div1;
|
||||
let span0;
|
||||
let t5;
|
||||
let div0;
|
||||
let button0;
|
||||
let t6_value = /*getAddress*/ ctx[13](/*user_groups*/ ctx[1][0]) + "";
|
||||
let t6;
|
||||
let t7;
|
||||
let object0;
|
||||
let t8;
|
||||
let div5;
|
||||
let div4;
|
||||
let span1;
|
||||
let t10;
|
||||
let div3;
|
||||
let button1;
|
||||
let t12;
|
||||
let input0;
|
||||
let t13;
|
||||
let button2;
|
||||
let object1;
|
||||
let t14;
|
||||
let div8;
|
||||
let div7;
|
||||
let span2;
|
||||
let t16;
|
||||
let div6;
|
||||
let button3;
|
||||
let t18;
|
||||
let input1;
|
||||
let t19;
|
||||
let button4;
|
||||
let object2;
|
||||
let t20;
|
||||
let h31;
|
||||
let t22;
|
||||
let section1;
|
||||
let mounted;
|
||||
let dispose;
|
||||
|
||||
const block = {
|
||||
c: function create() {
|
||||
h2 = element("h2");
|
||||
h2.textContent = "Groups";
|
||||
t1 = space();
|
||||
h30 = element("h3");
|
||||
h30.textContent = "My group";
|
||||
t3 = space();
|
||||
section0 = element("section");
|
||||
div2 = element("div");
|
||||
div1 = element("div");
|
||||
span0 = element("span");
|
||||
span0.textContent = "Location:";
|
||||
t5 = space();
|
||||
div0 = element("div");
|
||||
button0 = element("button");
|
||||
t6 = text(t6_value);
|
||||
t7 = space();
|
||||
object0 = element("object");
|
||||
t8 = space();
|
||||
div5 = element("div");
|
||||
div4 = element("div");
|
||||
span1 = element("span");
|
||||
span1.textContent = "Members:";
|
||||
t10 = space();
|
||||
div3 = element("div");
|
||||
button1 = element("button");
|
||||
button1.textContent = "save";
|
||||
t12 = space();
|
||||
input0 = element("input");
|
||||
t13 = space();
|
||||
button2 = element("button");
|
||||
object1 = element("object");
|
||||
t14 = space();
|
||||
div8 = element("div");
|
||||
div7 = element("div");
|
||||
span2 = element("span");
|
||||
span2.textContent = "Contact:";
|
||||
t16 = space();
|
||||
div6 = element("div");
|
||||
button3 = element("button");
|
||||
button3.textContent = "save";
|
||||
t18 = space();
|
||||
input1 = element("input");
|
||||
t19 = space();
|
||||
button4 = element("button");
|
||||
object2 = element("object");
|
||||
t20 = space();
|
||||
h31 = element("h3");
|
||||
h31.textContent = "Requests";
|
||||
t22 = space();
|
||||
section1 = element("section");
|
||||
add_location(h2, file, 116, 8, 2738);
|
||||
add_location(h30, file, 117, 8, 2763);
|
||||
add_location(span0, file, 121, 20, 2933);
|
||||
attr_dev(object0, "type", "image/svg+xml");
|
||||
attr_dev(object0, "data", "/img/profile/icons/pencil.svg");
|
||||
attr_dev(object0, "title", "pencil-icon");
|
||||
attr_dev(object0, "class", "pencil");
|
||||
add_location(object0, file, 124, 28, 3159);
|
||||
attr_dev(button0, "class", "change-field-button");
|
||||
add_location(button0, file, 123, 24, 3033);
|
||||
attr_dev(div0, "class", "change-field-div");
|
||||
add_location(div0, file, 122, 20, 2977);
|
||||
attr_dev(div1, "class", "change-field-line");
|
||||
add_location(div1, file, 120, 16, 2880);
|
||||
add_location(div2, file, 119, 12, 2857);
|
||||
add_location(span1, file, 131, 20, 3466);
|
||||
attr_dev(button1, "class", "save-button");
|
||||
add_location(button1, file, 133, 24, 3606);
|
||||
attr_dev(input0, "id", "membersInput");
|
||||
attr_dev(input0, "class", "text-input");
|
||||
attr_dev(input0, "type", "text");
|
||||
add_location(input0, file, 134, 24, 3726);
|
||||
attr_dev(object1, "type", "image/svg+xml");
|
||||
attr_dev(object1, "data", "/img/profile/icons/pencil.svg");
|
||||
attr_dev(object1, "title", "pencil-icon");
|
||||
attr_dev(object1, "class", "pencil");
|
||||
add_location(object1, file, 136, 28, 4019);
|
||||
attr_dev(button2, "class", "text-input-pencil-button");
|
||||
add_location(button2, file, 135, 24, 3910);
|
||||
attr_dev(div3, "class", "change-field-div input-pencil");
|
||||
add_location(div3, file, 132, 20, 3509);
|
||||
attr_dev(div4, "class", "change-field-line");
|
||||
add_location(div4, file, 130, 16, 3413);
|
||||
add_location(div5, file, 129, 12, 3390);
|
||||
add_location(span2, file, 143, 20, 4326);
|
||||
attr_dev(button3, "class", "save-button");
|
||||
add_location(button3, file, 145, 24, 4466);
|
||||
attr_dev(input1, "id", "contactInput");
|
||||
attr_dev(input1, "class", "text-input");
|
||||
attr_dev(input1, "type", "text");
|
||||
add_location(input1, file, 146, 24, 4586);
|
||||
attr_dev(object2, "type", "image/svg+xml");
|
||||
attr_dev(object2, "data", "/img/profile/icons/pencil.svg");
|
||||
attr_dev(object2, "title", "pencil-icon");
|
||||
attr_dev(object2, "class", "pencil");
|
||||
add_location(object2, file, 148, 28, 4879);
|
||||
attr_dev(button4, "class", "text-input-pencil-button");
|
||||
add_location(button4, file, 147, 24, 4770);
|
||||
attr_dev(div6, "class", "change-field-div input-pencil");
|
||||
add_location(div6, file, 144, 20, 4369);
|
||||
attr_dev(div7, "class", "change-field-line");
|
||||
add_location(div7, file, 142, 16, 4273);
|
||||
add_location(div8, file, 141, 12, 4250);
|
||||
attr_dev(section0, "class", "entries-section");
|
||||
add_location(section0, file, 118, 8, 2790);
|
||||
add_location(h31, file, 154, 8, 5126);
|
||||
attr_dev(section1, "class", "entries-section");
|
||||
add_location(section1, file, 155, 8, 5153);
|
||||
},
|
||||
m: function mount(target, anchor) {
|
||||
insert_dev(target, h2, anchor);
|
||||
insert_dev(target, t1, anchor);
|
||||
insert_dev(target, h30, anchor);
|
||||
insert_dev(target, t3, anchor);
|
||||
insert_dev(target, section0, anchor);
|
||||
append_dev(section0, div2);
|
||||
append_dev(div2, div1);
|
||||
append_dev(div1, span0);
|
||||
append_dev(div1, t5);
|
||||
append_dev(div1, div0);
|
||||
append_dev(div0, button0);
|
||||
append_dev(button0, t6);
|
||||
append_dev(button0, t7);
|
||||
append_dev(button0, object0);
|
||||
append_dev(section0, t8);
|
||||
append_dev(section0, div5);
|
||||
append_dev(div5, div4);
|
||||
append_dev(div4, span1);
|
||||
append_dev(div4, t10);
|
||||
append_dev(div4, div3);
|
||||
append_dev(div3, button1);
|
||||
/*button1_binding*/ ctx[17](button1);
|
||||
append_dev(div3, t12);
|
||||
append_dev(div3, input0);
|
||||
/*input0_binding*/ ctx[18](input0);
|
||||
set_input_value(input0, /*inputMembers*/ ctx[9]);
|
||||
append_dev(div3, t13);
|
||||
append_dev(div3, button2);
|
||||
append_dev(button2, object1);
|
||||
/*div3_binding*/ ctx[22](div3);
|
||||
append_dev(section0, t14);
|
||||
append_dev(section0, div8);
|
||||
append_dev(div8, div7);
|
||||
append_dev(div7, span2);
|
||||
append_dev(div7, t16);
|
||||
append_dev(div7, div6);
|
||||
append_dev(div6, button3);
|
||||
/*button3_binding*/ ctx[23](button3);
|
||||
append_dev(div6, t18);
|
||||
append_dev(div6, input1);
|
||||
/*input1_binding*/ ctx[24](input1);
|
||||
set_input_value(input1, /*inputContact*/ ctx[8]);
|
||||
append_dev(div6, t19);
|
||||
append_dev(div6, button4);
|
||||
append_dev(button4, object2);
|
||||
/*div6_binding*/ ctx[28](div6);
|
||||
/*section0_binding*/ ctx[29](section0);
|
||||
insert_dev(target, t20, anchor);
|
||||
insert_dev(target, h31, anchor);
|
||||
insert_dev(target, t22, anchor);
|
||||
insert_dev(target, section1, anchor);
|
||||
/*section1_binding*/ ctx[30](section1);
|
||||
|
||||
if (!mounted) {
|
||||
dispose = [
|
||||
listen_dev(button0, "click", /*launchChangeLocation*/ ctx[14], false, false, false),
|
||||
listen_dev(button1, "click", /*saveMembers*/ ctx[15], false, false, false),
|
||||
listen_dev(input0, "input", /*input0_input_handler*/ ctx[19]),
|
||||
listen_dev(input0, "click", /*click_handler*/ ctx[20], false, false, false),
|
||||
listen_dev(button2, "click", /*click_handler_1*/ ctx[21], false, false, false),
|
||||
listen_dev(button3, "click", saveContact, false, false, false),
|
||||
listen_dev(input1, "input", /*input1_input_handler*/ ctx[25]),
|
||||
listen_dev(input1, "click", /*click_handler_2*/ ctx[26], false, false, false),
|
||||
listen_dev(button4, "click", /*click_handler_3*/ ctx[27], false, false, false)
|
||||
];
|
||||
|
||||
mounted = true;
|
||||
}
|
||||
},
|
||||
p: function update(ctx, dirty) {
|
||||
if (dirty[0] & /*user_groups*/ 2 && t6_value !== (t6_value = /*getAddress*/ ctx[13](/*user_groups*/ ctx[1][0]) + "")) set_data_dev(t6, t6_value);
|
||||
|
||||
if (dirty[0] & /*inputMembers*/ 512 && input0.value !== /*inputMembers*/ ctx[9]) {
|
||||
set_input_value(input0, /*inputMembers*/ ctx[9]);
|
||||
}
|
||||
|
||||
if (dirty[0] & /*inputContact*/ 256 && input1.value !== /*inputContact*/ ctx[8]) {
|
||||
set_input_value(input1, /*inputContact*/ ctx[8]);
|
||||
}
|
||||
},
|
||||
d: function destroy(detaching) {
|
||||
if (detaching) detach_dev(h2);
|
||||
if (detaching) detach_dev(t1);
|
||||
if (detaching) detach_dev(h30);
|
||||
if (detaching) detach_dev(t3);
|
||||
if (detaching) detach_dev(section0);
|
||||
/*button1_binding*/ ctx[17](null);
|
||||
/*input0_binding*/ ctx[18](null);
|
||||
/*div3_binding*/ ctx[22](null);
|
||||
/*button3_binding*/ ctx[23](null);
|
||||
/*input1_binding*/ ctx[24](null);
|
||||
/*div6_binding*/ ctx[28](null);
|
||||
/*section0_binding*/ ctx[29](null);
|
||||
if (detaching) detach_dev(t20);
|
||||
if (detaching) detach_dev(h31);
|
||||
if (detaching) detach_dev(t22);
|
||||
if (detaching) detach_dev(section1);
|
||||
/*section1_binding*/ ctx[30](null);
|
||||
mounted = false;
|
||||
run_all(dispose);
|
||||
}
|
||||
};
|
||||
|
||||
dispatch_dev("SvelteRegisterBlock", {
|
||||
block,
|
||||
id: create_if_block.name,
|
||||
type: "if",
|
||||
source: "(115:4) {#if $loaded==1}",
|
||||
ctx
|
||||
});
|
||||
|
||||
return block;
|
||||
}
|
||||
|
||||
// (114:0) {#key $loaded}
|
||||
function create_key_block(ctx) {
|
||||
let if_block_anchor;
|
||||
let if_block = /*$loaded*/ ctx[10] == 1 && create_if_block(ctx);
|
||||
|
||||
const block = {
|
||||
c: function create() {
|
||||
if (if_block) if_block.c();
|
||||
if_block_anchor = empty();
|
||||
},
|
||||
m: function mount(target, anchor) {
|
||||
if (if_block) if_block.m(target, anchor);
|
||||
insert_dev(target, if_block_anchor, anchor);
|
||||
},
|
||||
p: function update(ctx, dirty) {
|
||||
if (/*$loaded*/ ctx[10] == 1) {
|
||||
if (if_block) {
|
||||
if_block.p(ctx, dirty);
|
||||
} else {
|
||||
if_block = create_if_block(ctx);
|
||||
if_block.c();
|
||||
if_block.m(if_block_anchor.parentNode, if_block_anchor);
|
||||
}
|
||||
} else if (if_block) {
|
||||
if_block.d(1);
|
||||
if_block = null;
|
||||
}
|
||||
},
|
||||
d: function destroy(detaching) {
|
||||
if (if_block) if_block.d(detaching);
|
||||
if (detaching) detach_dev(if_block_anchor);
|
||||
}
|
||||
};
|
||||
|
||||
dispatch_dev("SvelteRegisterBlock", {
|
||||
block,
|
||||
id: create_key_block.name,
|
||||
type: "key",
|
||||
source: "(114:0) {#key $loaded}",
|
||||
ctx
|
||||
});
|
||||
|
||||
return block;
|
||||
}
|
||||
|
||||
function create_fragment(ctx) {
|
||||
let previous_key = /*$loaded*/ ctx[10];
|
||||
let key_block_anchor;
|
||||
let key_block = create_key_block(ctx);
|
||||
|
||||
const block = {
|
||||
c: function create() {
|
||||
key_block.c();
|
||||
key_block_anchor = empty();
|
||||
this.c = noop;
|
||||
},
|
||||
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) {
|
||||
key_block.m(target, anchor);
|
||||
insert_dev(target, key_block_anchor, anchor);
|
||||
},
|
||||
p: function update(ctx, dirty) {
|
||||
if (dirty[0] & /*$loaded*/ 1024 && safe_not_equal(previous_key, previous_key = /*$loaded*/ ctx[10])) {
|
||||
key_block.d(1);
|
||||
key_block = create_key_block(ctx);
|
||||
key_block.c();
|
||||
key_block.m(key_block_anchor.parentNode, key_block_anchor);
|
||||
} else {
|
||||
key_block.p(ctx, dirty);
|
||||
}
|
||||
},
|
||||
i: noop,
|
||||
o: noop,
|
||||
d: function destroy(detaching) {
|
||||
if (detaching) detach_dev(key_block_anchor);
|
||||
key_block.d(detaching);
|
||||
}
|
||||
};
|
||||
|
||||
dispatch_dev("SvelteRegisterBlock", {
|
||||
block,
|
||||
id: create_fragment.name,
|
||||
type: "component",
|
||||
source: "",
|
||||
ctx
|
||||
});
|
||||
|
||||
return block;
|
||||
}
|
||||
|
||||
function getContact(c) {
|
||||
if (c == null) {
|
||||
return "https://discord.gg/Qk8KUk787z";
|
||||
} else {
|
||||
return c;
|
||||
}
|
||||
}
|
||||
|
||||
function launchChangeMembers() {
|
||||
|
||||
}
|
||||
|
||||
function showSaveButton(button) {
|
||||
button.style.display = "initial";
|
||||
}
|
||||
|
||||
function saveContact() {
|
||||
|
||||
}
|
||||
|
||||
function instance($$self, $$props, $$invalidate) {
|
||||
let $content;
|
||||
let $loaded;
|
||||
let { $$slots: slots = {}, $$scope } = $$props;
|
||||
validate_slots('profile-groups', slots, []);
|
||||
let { groups = null } = $$props;
|
||||
|
||||
// Main code
|
||||
let section;
|
||||
|
||||
let user_groups;
|
||||
let content = writable({});
|
||||
validate_store(content, 'content');
|
||||
component_subscribe($$self, content, value => $$invalidate(31, $content = value));
|
||||
let loaded = writable(0);
|
||||
validate_store(loaded, 'loaded');
|
||||
component_subscribe($$self, loaded, value => $$invalidate(10, $loaded = value));
|
||||
let membersInput;
|
||||
let saveMembersButton;
|
||||
let membersInputDiv;
|
||||
let contactInput;
|
||||
let saveContactButton;
|
||||
let contactInputDiv;
|
||||
let locale = "en";
|
||||
let inputContact;
|
||||
let inputMembers;
|
||||
|
||||
function groups_callback(response) {
|
||||
$$invalidate(1, user_groups = JSON.parse(response));
|
||||
$$invalidate(8, inputContact = getContact(user_groups[0].contact));
|
||||
$$invalidate(9, inputMembers = user_groups[0].members);
|
||||
|
||||
loaded.update(val => {
|
||||
return val + 1;
|
||||
});
|
||||
}
|
||||
|
||||
getData("/xx/get_user_groups", groups_callback);
|
||||
|
||||
function getAddress(g) {
|
||||
let location = [g.country, g.state, g.town].filter(x => x != null);
|
||||
return location.map(x => locale == "en" ? x : translate($content, x)).join(", ");
|
||||
}
|
||||
|
||||
function launchChangeLocation() {
|
||||
showLocationOverlay();
|
||||
}
|
||||
|
||||
function resetMembersField() {
|
||||
$$invalidate(3, saveMembersButton.style.display = "none", saveMembersButton);
|
||||
}
|
||||
|
||||
function resetContactField() {
|
||||
$$invalidate(6, saveContactButton.style.display = "none", saveContactButton);
|
||||
}
|
||||
|
||||
function saveMembers() {
|
||||
let email = emailInput.value;
|
||||
|
||||
if (AuthTools.checkEmail(email, emailMsg)) {
|
||||
if (email != user.email) {
|
||||
AuthTools.changeUser("email", email, user);
|
||||
}
|
||||
|
||||
resetMembersField();
|
||||
}
|
||||
}
|
||||
|
||||
let showLocationOverlay = getContext("profile-component");
|
||||
|
||||
onMount(() => {
|
||||
document.addEventListener("click", function (event) {
|
||||
if (membersInputDiv.focused) {
|
||||
resetContactField();
|
||||
} else if (contactInputDiv.focused) {
|
||||
resetMembersField();
|
||||
} else {
|
||||
resetMembersField();
|
||||
resetContactField();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
const writable_props = ['groups'];
|
||||
|
||||
Object.keys($$props).forEach(key => {
|
||||
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(`<profile-groups> was created with unknown prop '${key}'`);
|
||||
});
|
||||
|
||||
function button1_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
saveMembersButton = $$value;
|
||||
$$invalidate(3, saveMembersButton);
|
||||
});
|
||||
}
|
||||
|
||||
function input0_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
membersInput = $$value;
|
||||
$$invalidate(2, membersInput);
|
||||
});
|
||||
}
|
||||
|
||||
function input0_input_handler() {
|
||||
inputMembers = this.value;
|
||||
$$invalidate(9, inputMembers);
|
||||
}
|
||||
|
||||
const click_handler = () => showSaveButton(saveMembersButton);
|
||||
const click_handler_1 = () => membersInput.focus();
|
||||
|
||||
function div3_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
membersInputDiv = $$value;
|
||||
$$invalidate(4, membersInputDiv);
|
||||
});
|
||||
}
|
||||
|
||||
function button3_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
saveContactButton = $$value;
|
||||
$$invalidate(6, saveContactButton);
|
||||
});
|
||||
}
|
||||
|
||||
function input1_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
contactInput = $$value;
|
||||
$$invalidate(5, contactInput);
|
||||
});
|
||||
}
|
||||
|
||||
function input1_input_handler() {
|
||||
inputContact = this.value;
|
||||
$$invalidate(8, inputContact);
|
||||
}
|
||||
|
||||
const click_handler_2 = () => showSaveButton(saveContactButton);
|
||||
const click_handler_3 = () => contactInput.focus();
|
||||
|
||||
function div6_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
contactInputDiv = $$value;
|
||||
$$invalidate(7, contactInputDiv);
|
||||
});
|
||||
}
|
||||
|
||||
function section0_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
section = $$value;
|
||||
$$invalidate(0, section);
|
||||
});
|
||||
}
|
||||
|
||||
function section1_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
section = $$value;
|
||||
$$invalidate(0, section);
|
||||
});
|
||||
}
|
||||
|
||||
$$self.$$set = $$props => {
|
||||
if ('groups' in $$props) $$invalidate(16, groups = $$props.groups);
|
||||
};
|
||||
|
||||
$$self.$capture_state = () => ({
|
||||
onMount,
|
||||
getContext,
|
||||
writable,
|
||||
getData,
|
||||
groups,
|
||||
section,
|
||||
user_groups,
|
||||
content,
|
||||
loaded,
|
||||
membersInput,
|
||||
saveMembersButton,
|
||||
membersInputDiv,
|
||||
contactInput,
|
||||
saveContactButton,
|
||||
contactInputDiv,
|
||||
locale,
|
||||
inputContact,
|
||||
inputMembers,
|
||||
groups_callback,
|
||||
getAddress,
|
||||
getContact,
|
||||
launchChangeLocation,
|
||||
launchChangeMembers,
|
||||
showSaveButton,
|
||||
resetMembersField,
|
||||
resetContactField,
|
||||
saveMembers,
|
||||
saveContact,
|
||||
showLocationOverlay,
|
||||
$content,
|
||||
$loaded
|
||||
});
|
||||
|
||||
$$self.$inject_state = $$props => {
|
||||
if ('groups' in $$props) $$invalidate(16, groups = $$props.groups);
|
||||
if ('section' in $$props) $$invalidate(0, section = $$props.section);
|
||||
if ('user_groups' in $$props) $$invalidate(1, user_groups = $$props.user_groups);
|
||||
if ('content' in $$props) $$invalidate(11, content = $$props.content);
|
||||
if ('loaded' in $$props) $$invalidate(12, loaded = $$props.loaded);
|
||||
if ('membersInput' in $$props) $$invalidate(2, membersInput = $$props.membersInput);
|
||||
if ('saveMembersButton' in $$props) $$invalidate(3, saveMembersButton = $$props.saveMembersButton);
|
||||
if ('membersInputDiv' in $$props) $$invalidate(4, membersInputDiv = $$props.membersInputDiv);
|
||||
if ('contactInput' in $$props) $$invalidate(5, contactInput = $$props.contactInput);
|
||||
if ('saveContactButton' in $$props) $$invalidate(6, saveContactButton = $$props.saveContactButton);
|
||||
if ('contactInputDiv' in $$props) $$invalidate(7, contactInputDiv = $$props.contactInputDiv);
|
||||
if ('locale' in $$props) locale = $$props.locale;
|
||||
if ('inputContact' in $$props) $$invalidate(8, inputContact = $$props.inputContact);
|
||||
if ('inputMembers' in $$props) $$invalidate(9, inputMembers = $$props.inputMembers);
|
||||
if ('showLocationOverlay' in $$props) showLocationOverlay = $$props.showLocationOverlay;
|
||||
};
|
||||
|
||||
if ($$props && "$$inject" in $$props) {
|
||||
$$self.$inject_state($$props.$$inject);
|
||||
}
|
||||
|
||||
return [
|
||||
section,
|
||||
user_groups,
|
||||
membersInput,
|
||||
saveMembersButton,
|
||||
membersInputDiv,
|
||||
contactInput,
|
||||
saveContactButton,
|
||||
contactInputDiv,
|
||||
inputContact,
|
||||
inputMembers,
|
||||
$loaded,
|
||||
content,
|
||||
loaded,
|
||||
getAddress,
|
||||
launchChangeLocation,
|
||||
saveMembers,
|
||||
groups,
|
||||
button1_binding,
|
||||
input0_binding,
|
||||
input0_input_handler,
|
||||
click_handler,
|
||||
click_handler_1,
|
||||
div3_binding,
|
||||
button3_binding,
|
||||
input1_binding,
|
||||
input1_input_handler,
|
||||
click_handler_2,
|
||||
click_handler_3,
|
||||
div6_binding,
|
||||
section0_binding,
|
||||
section1_binding
|
||||
];
|
||||
}
|
||||
|
||||
class Profile_groups extends SvelteElement {
|
||||
constructor(options) {
|
||||
super();
|
||||
|
||||
this.shadowRoot.innerHTML = `<style>@import '/css/common.css';.text-input-pencil-button{display:inline-block;position:relative;height:2.3rem;width:2rem}.text-input-pencil-button object{top:0rem}.pencil{pointer-events:none;position:absolute;width:1.5rem;right:0.0rem}.change-field-div input.text-input{position:relative;width:20.475rem;direction:rtl;border:0;outline:none;bottom:0.341rem;position:relative;top:0.1rem;font-style:var(--sans-serif,sans-serif)
|
||||
}#membersInput{width:5rem}#contactInput{max-width:18rem}.save-button{position:relative;bottom:0.34rem;margin-right:0.6rem;height:2.73rem;width:4.778rem;font-family:var(--sans-serif,sans-serif);font-size:1.15rem;color:white;background-color:var(--red);border-color:var(--red);border-radius:0.512rem}h2{text-align:center;margin-bottom:0.5rem}.entries-section{margin-bottom:1rem}.entries-section>div{height:3.5rem;padding-bottom:0.75rem;padding-top:0.75rem;border-bottom:0.14rem solid;border-color:#cdcdcd}.entries-section>div:last-child{padding-bottom:0.75rem;padding-top:0.75rem;border-bottom:0}.change-field-line{display:flex;justify-content:space-between}.change-field-div{width:max-content}.change-field-button{position:relative;cursor:pointer;height:2.73rem;font-size:1.15rem;font-family:var(--sans-serif,sans-serif);font-weight:500;text-align:right;padding-right:1.9rem;margin-top:-0.55rem;background-color:transparent;width:100%}h3{margin-bottom:0.5rem}span{font-family:var(--sans-serif,sans-serif);font-size:1.15rem}</style>`;
|
||||
|
||||
init(
|
||||
this,
|
||||
{
|
||||
target: this.shadowRoot,
|
||||
props: attribute_to_object(this.attributes),
|
||||
customElement: true
|
||||
},
|
||||
instance,
|
||||
create_fragment,
|
||||
safe_not_equal,
|
||||
{ groups: 16 },
|
||||
null,
|
||||
[-1, -1]
|
||||
);
|
||||
|
||||
if (options) {
|
||||
if (options.target) {
|
||||
insert_dev(options.target, this, options.anchor);
|
||||
}
|
||||
|
||||
if (options.props) {
|
||||
this.$set(options.props);
|
||||
flush();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static get observedAttributes() {
|
||||
return ["groups"];
|
||||
}
|
||||
|
||||
get groups() {
|
||||
return this.$$.ctx[16];
|
||||
}
|
||||
|
||||
set groups(groups) {
|
||||
this.$$set({ groups });
|
||||
flush();
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define("profile-groups", Profile_groups);
|
||||
|
||||
export { Profile_groups as default };
|
80
Server/public/js/components/profile-my-details.js
Normal file
80
Server/public/js/components/profile-my-details.js
Normal file
@@ -0,0 +1,80 @@
|
||||
|
||||
(function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
|
||||
import { S as SvelteElement, i as init, a as attribute_to_object, b as insert_dev, s as safe_not_equal, d as dispatch_dev, v as validate_slots, o as onMount, n as noop } from './index-6b4fe380.js';
|
||||
import * as AuthTools from '../../../../../../../../../js/libraries/authTools.js';
|
||||
|
||||
/* src\profile\profile-my-details.svelte generated by Svelte v3.52.0 */
|
||||
|
||||
function create_fragment(ctx) {
|
||||
const block = {
|
||||
c: function create() {
|
||||
this.c = noop;
|
||||
},
|
||||
l: function claim(nodes) {
|
||||
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
|
||||
},
|
||||
m: noop,
|
||||
p: noop,
|
||||
i: noop,
|
||||
o: noop,
|
||||
d: noop
|
||||
};
|
||||
|
||||
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('profile-my-details', slots, []);
|
||||
|
||||
onMount(() => {
|
||||
|
||||
});
|
||||
|
||||
const writable_props = [];
|
||||
|
||||
Object.keys($$props).forEach(key => {
|
||||
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(`<profile-my-details> was created with unknown prop '${key}'`);
|
||||
});
|
||||
|
||||
$$self.$capture_state = () => ({ onMount, AuthTools });
|
||||
return [];
|
||||
}
|
||||
|
||||
class Profile_my_details extends SvelteElement {
|
||||
constructor(options) {
|
||||
super();
|
||||
|
||||
init(
|
||||
this,
|
||||
{
|
||||
target: this.shadowRoot,
|
||||
props: attribute_to_object(this.attributes),
|
||||
customElement: true
|
||||
},
|
||||
instance,
|
||||
create_fragment,
|
||||
safe_not_equal,
|
||||
{},
|
||||
null
|
||||
);
|
||||
|
||||
if (options) {
|
||||
if (options.target) {
|
||||
insert_dev(options.target, this, options.anchor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define("profile-my-details", Profile_my_details);
|
||||
|
||||
export { Profile_my_details as default };
|
File diff suppressed because one or more lines are too long
603
Server/public/js/components/signup-component.js
Normal file
603
Server/public/js/components/signup-component.js
Normal file
@@ -0,0 +1,603 @@
|
||||
|
||||
(function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
|
||||
import { S as SvelteElement, i as init, a as attribute_to_object, b as insert_dev, t as flush, s as safe_not_equal, d as dispatch_dev, v as validate_slots, g as getContext, o as onMount, f as element, h as space, n as noop, k as attr_dev, j as add_location, u as src_url_equal, l as append_dev, m as listen_dev, p as detach_dev, r as run_all, q as binding_callbacks } from './index-998178c7.js';
|
||||
import * as AuthTools from '../../../../../../../../../js/libraries/authTools.js';
|
||||
|
||||
/* src\auth\signup-component.svelte generated by Svelte v3.52.0 */
|
||||
const file = "src\\auth\\signup-component.svelte";
|
||||
|
||||
function create_fragment(ctx) {
|
||||
let div3;
|
||||
let h20;
|
||||
let t1;
|
||||
let label0;
|
||||
let span0;
|
||||
let t3;
|
||||
let input0;
|
||||
let t4;
|
||||
let div0;
|
||||
let label1;
|
||||
let span1;
|
||||
let t6;
|
||||
let input1;
|
||||
let t7;
|
||||
let button0;
|
||||
let object;
|
||||
let t8;
|
||||
let div1;
|
||||
let input2;
|
||||
let label2;
|
||||
let t10;
|
||||
let button1;
|
||||
let t12;
|
||||
let p0;
|
||||
let t13;
|
||||
let hr;
|
||||
let t14;
|
||||
let div2;
|
||||
let button2;
|
||||
let img;
|
||||
let img_src_value;
|
||||
let t15;
|
||||
let div6;
|
||||
let button3;
|
||||
let t16;
|
||||
let div5;
|
||||
let h21;
|
||||
let t18;
|
||||
let p1;
|
||||
let t20;
|
||||
let p2;
|
||||
let t22;
|
||||
let div4;
|
||||
let input3;
|
||||
let t23;
|
||||
let button4;
|
||||
let t25;
|
||||
let button5;
|
||||
let mounted;
|
||||
let dispose;
|
||||
|
||||
const block = {
|
||||
c: function create() {
|
||||
div3 = element("div");
|
||||
h20 = element("h2");
|
||||
h20.textContent = "SIGN UP";
|
||||
t1 = space();
|
||||
label0 = element("label");
|
||||
label0.textContent = "Email ";
|
||||
span0 = element("span");
|
||||
t3 = space();
|
||||
input0 = element("input");
|
||||
t4 = space();
|
||||
div0 = element("div");
|
||||
label1 = element("label");
|
||||
label1.textContent = "Password ";
|
||||
span1 = element("span");
|
||||
t6 = space();
|
||||
input1 = element("input");
|
||||
t7 = space();
|
||||
button0 = element("button");
|
||||
object = element("object");
|
||||
t8 = space();
|
||||
div1 = element("div");
|
||||
input2 = element("input");
|
||||
label2 = element("label");
|
||||
label2.textContent = "remember me";
|
||||
t10 = space();
|
||||
button1 = element("button");
|
||||
button1.textContent = "Sign up";
|
||||
t12 = space();
|
||||
p0 = element("p");
|
||||
t13 = space();
|
||||
hr = element("hr");
|
||||
t14 = space();
|
||||
div2 = element("div");
|
||||
button2 = element("button");
|
||||
img = element("img");
|
||||
t15 = space();
|
||||
div6 = element("div");
|
||||
button3 = element("button");
|
||||
t16 = space();
|
||||
div5 = element("div");
|
||||
h21 = element("h2");
|
||||
h21.textContent = "Registration is closed";
|
||||
t18 = space();
|
||||
p1 = element("p");
|
||||
p1.textContent = "We are still in the process of opening.";
|
||||
t20 = space();
|
||||
p2 = element("p");
|
||||
p2.textContent = "Sign up for updates to know when it becomes available:";
|
||||
t22 = space();
|
||||
div4 = element("div");
|
||||
input3 = element("input");
|
||||
t23 = space();
|
||||
button4 = element("button");
|
||||
button4.textContent = "sign up";
|
||||
t25 = space();
|
||||
button5 = element("button");
|
||||
button5.textContent = "No thanks";
|
||||
this.c = noop;
|
||||
attr_dev(h20, "class", "auth-title");
|
||||
add_location(h20, file, 98, 4, 2351);
|
||||
attr_dev(label0, "class", "auth-label");
|
||||
attr_dev(label0, "for", "emailInput");
|
||||
add_location(label0, file, 99, 4, 2392);
|
||||
attr_dev(span0, "id", "email-msg");
|
||||
add_location(span0, file, 99, 66, 2454);
|
||||
attr_dev(input0, "id", "emailInput");
|
||||
attr_dev(input0, "class", "authEmailInput");
|
||||
attr_dev(input0, "type", "email");
|
||||
add_location(input0, file, 100, 4, 2547);
|
||||
attr_dev(label1, "class", "auth-label");
|
||||
attr_dev(label1, "for", "emailInput");
|
||||
add_location(label1, file, 102, 8, 2673);
|
||||
attr_dev(span1, "id", "password-msg");
|
||||
add_location(span1, file, 102, 73, 2738);
|
||||
attr_dev(input1, "id", "passwordInput");
|
||||
attr_dev(input1, "class", "authPasswordInput");
|
||||
attr_dev(input1, "type", "password");
|
||||
add_location(input1, file, 103, 8, 2803);
|
||||
attr_dev(object, "type", "image/svg+xml");
|
||||
attr_dev(object, "data", "/img/auth/eye_icon.svg");
|
||||
attr_dev(object, "title", "eye-icon");
|
||||
add_location(object, file, 105, 12, 3104);
|
||||
attr_dev(button0, "class", "eye-icon");
|
||||
add_location(button0, file, 104, 8, 2948);
|
||||
attr_dev(div0, "class", "password-field");
|
||||
add_location(div0, file, 101, 4, 2635);
|
||||
attr_dev(input2, "type", "checkbox");
|
||||
attr_dev(input2, "id", "remember-me-checkbox");
|
||||
add_location(input2, file, 109, 8, 3258);
|
||||
attr_dev(label2, "id", "remember-me-label");
|
||||
attr_dev(label2, "for", "passwordInput");
|
||||
add_location(label2, file, 109, 80, 3330);
|
||||
attr_dev(div1, "id", "remember-me");
|
||||
add_location(div1, file, 108, 4, 3226);
|
||||
attr_dev(button1, "class", "auth-button");
|
||||
add_location(button1, file, 111, 4, 3417);
|
||||
attr_dev(p0, "id", "forgot-password");
|
||||
add_location(p0, file, 112, 4, 3558);
|
||||
attr_dev(hr, "class", "auth-line");
|
||||
add_location(hr, file, 113, 4, 3592);
|
||||
if (!src_url_equal(img.src, img_src_value = "/img/auth/google_icon.svg")) attr_dev(img, "src", img_src_value);
|
||||
attr_dev(img, "id", "navbar-logo");
|
||||
attr_dev(img, "alt", "google icon");
|
||||
add_location(img, file, 116, 12, 3708);
|
||||
add_location(button2, file, 115, 8, 3662);
|
||||
attr_dev(div2, "class", "auth-methods-group");
|
||||
add_location(div2, file, 114, 4, 3620);
|
||||
attr_dev(div3, "id", "signup-group");
|
||||
attr_dev(div3, "class", "pane auth-pane");
|
||||
add_location(div3, file, 97, 0, 2275);
|
||||
attr_dev(button3, "id", "shadow");
|
||||
add_location(button3, file, 128, 4, 4146);
|
||||
add_location(h21, file, 130, 8, 4238);
|
||||
add_location(p1, file, 131, 8, 4279);
|
||||
add_location(p2, file, 132, 8, 4335);
|
||||
attr_dev(input3, "id", "newsletterEmailInput");
|
||||
attr_dev(input3, "type", "text");
|
||||
add_location(input3, file, 134, 12, 4451);
|
||||
attr_dev(button4, "id", "newsletterEmailButton");
|
||||
add_location(button4, file, 135, 12, 4557);
|
||||
attr_dev(div4, "id", "newsletter-container");
|
||||
add_location(div4, file, 133, 8, 4406);
|
||||
attr_dev(button5, "id", "no-button");
|
||||
add_location(button5, file, 137, 8, 4674);
|
||||
attr_dev(div5, "id", "wrapper");
|
||||
attr_dev(div5, "class", "pane");
|
||||
add_location(div5, file, 129, 4, 4197);
|
||||
attr_dev(div6, "id", "dialog");
|
||||
add_location(div6, file, 127, 0, 4104);
|
||||
},
|
||||
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, div3, anchor);
|
||||
append_dev(div3, h20);
|
||||
append_dev(div3, t1);
|
||||
append_dev(div3, label0);
|
||||
append_dev(div3, span0);
|
||||
/*span0_binding*/ ctx[15](span0);
|
||||
append_dev(div3, t3);
|
||||
append_dev(div3, input0);
|
||||
/*input0_binding*/ ctx[17](input0);
|
||||
append_dev(div3, t4);
|
||||
append_dev(div3, div0);
|
||||
append_dev(div0, label1);
|
||||
append_dev(div0, span1);
|
||||
/*span1_binding*/ ctx[18](span1);
|
||||
append_dev(div0, t6);
|
||||
append_dev(div0, input1);
|
||||
/*input1_binding*/ ctx[19](input1);
|
||||
append_dev(div0, t7);
|
||||
append_dev(div0, button0);
|
||||
append_dev(button0, object);
|
||||
/*button0_binding*/ ctx[21](button0);
|
||||
append_dev(div3, t8);
|
||||
append_dev(div3, div1);
|
||||
append_dev(div1, input2);
|
||||
/*input2_binding*/ ctx[23](input2);
|
||||
append_dev(div1, label2);
|
||||
append_dev(div3, t10);
|
||||
append_dev(div3, button1);
|
||||
append_dev(div3, t12);
|
||||
append_dev(div3, p0);
|
||||
append_dev(div3, t13);
|
||||
append_dev(div3, hr);
|
||||
append_dev(div3, t14);
|
||||
append_dev(div3, div2);
|
||||
append_dev(div2, button2);
|
||||
append_dev(button2, img);
|
||||
/*div3_binding*/ ctx[24](div3);
|
||||
insert_dev(target, t15, anchor);
|
||||
insert_dev(target, div6, anchor);
|
||||
append_dev(div6, button3);
|
||||
append_dev(div6, t16);
|
||||
append_dev(div6, div5);
|
||||
append_dev(div5, h21);
|
||||
append_dev(div5, t18);
|
||||
append_dev(div5, p1);
|
||||
append_dev(div5, t20);
|
||||
append_dev(div5, p2);
|
||||
append_dev(div5, t22);
|
||||
append_dev(div5, div4);
|
||||
append_dev(div4, input3);
|
||||
/*input3_binding*/ ctx[25](input3);
|
||||
append_dev(div4, t23);
|
||||
append_dev(div4, button4);
|
||||
/*button4_binding*/ ctx[26](button4);
|
||||
append_dev(div5, t25);
|
||||
append_dev(div5, button5);
|
||||
/*div6_binding*/ ctx[27](div6);
|
||||
|
||||
if (!mounted) {
|
||||
dispose = [
|
||||
listen_dev(span0, "change", /*change_handler*/ ctx[16], false, false, false),
|
||||
listen_dev(input1, "change", /*change_handler_1*/ ctx[20], false, false, false),
|
||||
listen_dev(button0, "click", /*click_handler*/ ctx[22], false, false, false),
|
||||
listen_dev(button1, "click", /*showDialog*/ ctx[10], false, false, false),
|
||||
listen_dev(button2, "click", /*showDialog*/ ctx[10], false, false, false),
|
||||
listen_dev(button3, "click", /*hide*/ ctx[11], false, false, false),
|
||||
listen_dev(input3, "click", /*clearField*/ ctx[13], false, false, false),
|
||||
listen_dev(button4, "click", /*sendEmail*/ ctx[12], false, false, false),
|
||||
listen_dev(button5, "click", /*hide*/ ctx[11], false, false, false)
|
||||
];
|
||||
|
||||
mounted = true;
|
||||
}
|
||||
},
|
||||
p: noop,
|
||||
i: noop,
|
||||
o: noop,
|
||||
d: function destroy(detaching) {
|
||||
if (detaching) detach_dev(div3);
|
||||
/*span0_binding*/ ctx[15](null);
|
||||
/*input0_binding*/ ctx[17](null);
|
||||
/*span1_binding*/ ctx[18](null);
|
||||
/*input1_binding*/ ctx[19](null);
|
||||
/*button0_binding*/ ctx[21](null);
|
||||
/*input2_binding*/ ctx[23](null);
|
||||
/*div3_binding*/ ctx[24](null);
|
||||
if (detaching) detach_dev(t15);
|
||||
if (detaching) detach_dev(div6);
|
||||
/*input3_binding*/ ctx[25](null);
|
||||
/*button4_binding*/ ctx[26](null);
|
||||
/*div6_binding*/ ctx[27](null);
|
||||
mounted = false;
|
||||
run_all(dispose);
|
||||
}
|
||||
};
|
||||
|
||||
dispatch_dev("SvelteRegisterBlock", {
|
||||
block,
|
||||
id: create_fragment.name,
|
||||
type: "component",
|
||||
source: "",
|
||||
ctx
|
||||
});
|
||||
|
||||
return block;
|
||||
}
|
||||
|
||||
function removeMsg(msg) {
|
||||
if (msg.innerHTML != "") {
|
||||
msg.innerHTML = "";
|
||||
}
|
||||
}
|
||||
|
||||
function instance($$self, $$props, $$invalidate) {
|
||||
let { $$slots: slots = {}, $$scope } = $$props;
|
||||
validate_slots('signup-component', slots, []);
|
||||
let { focused = false } = $$props;
|
||||
|
||||
// Main code
|
||||
let signupGroup;
|
||||
|
||||
let emailInput;
|
||||
let passwordInput;
|
||||
let passwordVisibilityButton;
|
||||
let inputs;
|
||||
let googleButton;
|
||||
let emailMsg;
|
||||
let passwordMsg;
|
||||
let msgs;
|
||||
let rememberMe;
|
||||
let dialog;
|
||||
let signUp;
|
||||
let signUpField;
|
||||
let parentProps = getContext("auth");
|
||||
|
||||
function showDialog() {
|
||||
$$invalidate(7, dialog.style.display = "block", dialog);
|
||||
}
|
||||
|
||||
function hide() {
|
||||
if (dialog != null) {
|
||||
$$invalidate(7, dialog.style.display = "none", dialog);
|
||||
}
|
||||
}
|
||||
|
||||
function sendEmail() {
|
||||
let email = signUpField.value;
|
||||
|
||||
if (email.includes("@")) {
|
||||
sendText("/get-email", email);
|
||||
$$invalidate(9, signUpField.value = "", signUpField);
|
||||
$$invalidate(9, signUpField.placeholder = "Subscribed!", signUpField);
|
||||
signUpField.style.setProperty("--c", "hsl(147, 33%, 60%)");
|
||||
} else {
|
||||
$$invalidate(9, signUpField.value = "", signUpField);
|
||||
$$invalidate(9, signUpField.placeholder = "must contain '@'", signUpField);
|
||||
signUpField.style.setProperty("--c", "hsl(0, 100%, 60%)");
|
||||
}
|
||||
}
|
||||
|
||||
function clearField() {
|
||||
$$invalidate(9, signUpField.placeholder = "", signUpField);
|
||||
}
|
||||
|
||||
function renderGoogle() {
|
||||
if (parentProps.googleInit) {
|
||||
google.accounts.id.renderButton(googleButton, { theme: 'outline', size: 'large' });
|
||||
} else {
|
||||
setTimeout(renderGoogle, 100);
|
||||
}
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
$$invalidate(6, rememberMe.checked = true, rememberMe);
|
||||
|
||||
inputs = {
|
||||
email: emailInput,
|
||||
password: passwordInput
|
||||
};
|
||||
|
||||
msgs = { email: emailMsg, password: passwordMsg };
|
||||
|
||||
document.addEventListener("keypress", function (event) {
|
||||
if (event.code == "Enter") {
|
||||
if (focused) {
|
||||
AuthTools.signup(msgs, inputs, toLandingPage);
|
||||
}
|
||||
}
|
||||
});
|
||||
}); //renderGoogle()
|
||||
|
||||
const writable_props = ['focused'];
|
||||
|
||||
Object.keys($$props).forEach(key => {
|
||||
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(`<signup-component> was created with unknown prop '${key}'`);
|
||||
});
|
||||
|
||||
function span0_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
emailMsg = $$value;
|
||||
$$invalidate(4, emailMsg);
|
||||
});
|
||||
}
|
||||
|
||||
const change_handler = () => removeMsg(emailMsg);
|
||||
|
||||
function input0_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
emailInput = $$value;
|
||||
$$invalidate(1, emailInput);
|
||||
});
|
||||
}
|
||||
|
||||
function span1_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
passwordMsg = $$value;
|
||||
$$invalidate(5, passwordMsg);
|
||||
});
|
||||
}
|
||||
|
||||
function input1_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
passwordInput = $$value;
|
||||
$$invalidate(2, passwordInput);
|
||||
});
|
||||
}
|
||||
|
||||
const change_handler_1 = () => removeMsg(passwordMsg);
|
||||
|
||||
function button0_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
passwordVisibilityButton = $$value;
|
||||
$$invalidate(3, passwordVisibilityButton);
|
||||
});
|
||||
}
|
||||
|
||||
const click_handler = () => AuthTools.changePasswordVisibility(passwordVisibilityButton);
|
||||
|
||||
function input2_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
rememberMe = $$value;
|
||||
$$invalidate(6, rememberMe);
|
||||
});
|
||||
}
|
||||
|
||||
function div3_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
signupGroup = $$value;
|
||||
$$invalidate(0, signupGroup);
|
||||
});
|
||||
}
|
||||
|
||||
function input3_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
signUpField = $$value;
|
||||
$$invalidate(9, signUpField);
|
||||
});
|
||||
}
|
||||
|
||||
function button4_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
signUp = $$value;
|
||||
$$invalidate(8, signUp);
|
||||
});
|
||||
}
|
||||
|
||||
function div6_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
dialog = $$value;
|
||||
$$invalidate(7, dialog);
|
||||
});
|
||||
}
|
||||
|
||||
$$self.$$set = $$props => {
|
||||
if ('focused' in $$props) $$invalidate(14, focused = $$props.focused);
|
||||
};
|
||||
|
||||
$$self.$capture_state = () => ({
|
||||
onMount,
|
||||
getContext,
|
||||
AuthTools,
|
||||
focused,
|
||||
signupGroup,
|
||||
emailInput,
|
||||
passwordInput,
|
||||
passwordVisibilityButton,
|
||||
inputs,
|
||||
googleButton,
|
||||
emailMsg,
|
||||
passwordMsg,
|
||||
msgs,
|
||||
rememberMe,
|
||||
dialog,
|
||||
signUp,
|
||||
signUpField,
|
||||
parentProps,
|
||||
removeMsg,
|
||||
showDialog,
|
||||
hide,
|
||||
sendEmail,
|
||||
clearField,
|
||||
renderGoogle
|
||||
});
|
||||
|
||||
$$self.$inject_state = $$props => {
|
||||
if ('focused' in $$props) $$invalidate(14, focused = $$props.focused);
|
||||
if ('signupGroup' in $$props) $$invalidate(0, signupGroup = $$props.signupGroup);
|
||||
if ('emailInput' in $$props) $$invalidate(1, emailInput = $$props.emailInput);
|
||||
if ('passwordInput' in $$props) $$invalidate(2, passwordInput = $$props.passwordInput);
|
||||
if ('passwordVisibilityButton' in $$props) $$invalidate(3, passwordVisibilityButton = $$props.passwordVisibilityButton);
|
||||
if ('inputs' in $$props) inputs = $$props.inputs;
|
||||
if ('googleButton' in $$props) googleButton = $$props.googleButton;
|
||||
if ('emailMsg' in $$props) $$invalidate(4, emailMsg = $$props.emailMsg);
|
||||
if ('passwordMsg' in $$props) $$invalidate(5, passwordMsg = $$props.passwordMsg);
|
||||
if ('msgs' in $$props) msgs = $$props.msgs;
|
||||
if ('rememberMe' in $$props) $$invalidate(6, rememberMe = $$props.rememberMe);
|
||||
if ('dialog' in $$props) $$invalidate(7, dialog = $$props.dialog);
|
||||
if ('signUp' in $$props) $$invalidate(8, signUp = $$props.signUp);
|
||||
if ('signUpField' in $$props) $$invalidate(9, signUpField = $$props.signUpField);
|
||||
if ('parentProps' in $$props) parentProps = $$props.parentProps;
|
||||
};
|
||||
|
||||
if ($$props && "$$inject" in $$props) {
|
||||
$$self.$inject_state($$props.$$inject);
|
||||
}
|
||||
|
||||
return [
|
||||
signupGroup,
|
||||
emailInput,
|
||||
passwordInput,
|
||||
passwordVisibilityButton,
|
||||
emailMsg,
|
||||
passwordMsg,
|
||||
rememberMe,
|
||||
dialog,
|
||||
signUp,
|
||||
signUpField,
|
||||
showDialog,
|
||||
hide,
|
||||
sendEmail,
|
||||
clearField,
|
||||
focused,
|
||||
span0_binding,
|
||||
change_handler,
|
||||
input0_binding,
|
||||
span1_binding,
|
||||
input1_binding,
|
||||
change_handler_1,
|
||||
button0_binding,
|
||||
click_handler,
|
||||
input2_binding,
|
||||
div3_binding,
|
||||
input3_binding,
|
||||
button4_binding,
|
||||
div6_binding
|
||||
];
|
||||
}
|
||||
|
||||
class Signup_component extends SvelteElement {
|
||||
constructor(options) {
|
||||
super();
|
||||
this.shadowRoot.innerHTML = `<style>@import '/css/common.css';@import '/css/auth.css';#dialog{display:none}#wrapper p{text-align:justify}#wrapper h2{text-align:center;margin-bottom:1rem}#shadow{position:fixed;cursor:default;top:50%;right:50%;transform:translate(50%,-50%);width:100vw;height:100vh;background:rgb(0, 0, 0, 0.2);z-index:999999}#newsletter-container{position:relative;height:3rem;width:100%;margin-top:1rem;display:flex;flex-direction:row}#newsletterEmailInput{height:2.5rem;border-radius:0.2rem 0 0 0.2rem;filter:drop-shadow( 0.07rem 0.14rem 0.07rem rgb(0 0 0 / 0.4));flex-grow:1}#newsletterEmailInput::placeholder{color:var(--c,gray);opacity:1}#newsletterEmailButton{width:6.8rem;height:2.5rem;background:var(--pink);color:#ffffff;font-family:var(--sans-serif,sans-serif);font-size:1.4rem;border-radius:0 0.2rem 0.2rem 0;filter:drop-shadow( 0.07rem 0.14rem 0.07rem rgb(0 0 0 / 0.4))}#newsletterEmailButton:active{background:var(--darker-pink)}#wrapper{top:50%;right:50%;transform:translate(50%,-50%);position:fixed;max-width:36rem;width:90vw;padding:2rem 4rem;z-index:1999999}#wrapper *{font-family:var(--sans-serif)}#no-button{position:relative;left:50%;transform:translateX(-50%);width:13rem;height:3rem;margin-top:2rem;margin-bottom:0.5rem;background:#ffffff;border:0.2rem solid var(--pink);font-family:var(--sans-serif,sans-serif);font-size:1.4rem;border-radius:0.5rem;filter:drop-shadow( 0.07rem 0.14rem 0.07rem rgb(0 0 0 / 0.4))}#no-button:active{background:hsl(343, 23%, 82%)}</style>`;
|
||||
|
||||
init(
|
||||
this,
|
||||
{
|
||||
target: this.shadowRoot,
|
||||
props: attribute_to_object(this.attributes),
|
||||
customElement: true
|
||||
},
|
||||
instance,
|
||||
create_fragment,
|
||||
safe_not_equal,
|
||||
{ focused: 14 },
|
||||
null,
|
||||
[-1, -1]
|
||||
);
|
||||
|
||||
if (options) {
|
||||
if (options.target) {
|
||||
insert_dev(options.target, this, options.anchor);
|
||||
}
|
||||
|
||||
if (options.props) {
|
||||
this.$set(options.props);
|
||||
flush();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static get observedAttributes() {
|
||||
return ["focused"];
|
||||
}
|
||||
|
||||
get focused() {
|
||||
return this.$$.ctx[14];
|
||||
}
|
||||
|
||||
set focused(focused) {
|
||||
this.$$set({ focused });
|
||||
flush();
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define("signup-component", Signup_component);
|
||||
|
||||
export { Signup_component as default };
|
@@ -1 +1,209 @@
|
||||
import{S as t,i as e,a as s,b as c,v as i,s as a,g as r,h as o,n as h,j as n,m as l,p as d,d as p,r as u,o as b}from"./index-8c09578c.js";import"../../../../../../../../../js/libraries/miscTools.js";function k(t){let e,s,i,a,b,k;return{c(){e=r("label"),s=r("input"),i=o(),a=r("span"),this.c=h,n(s,"type","checkbox"),n(a,"class","switch-span"),n(e,"class","switch")},m(r,o){c(r,e,o),l(e,s),s.checked=t[0],l(e,i),l(e,a),b||(k=[d(s,"change",t[4]),d(s,"click",t[1])],b=!0)},p(t,[e]){1&e&&(s.checked=t[0])},i:h,o:h,d(t){t&&p(e),b=!1,u(k)}}}function g(t,e,s){let{callback:c=null}=e,{checked:i=!1}=e;const a=()=>{setTimeout((()=>{null!=c?(s(0,i=!i),c()):a()}),100)};return b((()=>{})),t.$$set=t=>{"callback"in t&&s(2,c=t.callback),"checked"in t&&s(0,i=t.checked)},[i,function(){null!=c&&(s(0,i=!i),c())},c,a,function(){i=this.checked,s(0,i)}]}class m extends t{constructor(t){super(),this.shadowRoot.innerHTML="<style>@import '/css/common.css';.switch span{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#ccc;-webkit-transition:.4s;transition:.4s;border-radius:calc(2* 1.2rem)}.switch span:before{position:absolute;content:\"\";height:calc(var(--height) - 0.5rem);width:calc(var(--height) - 0.5rem);left:calc(0.3rem);bottom:0.25rem;background-color:white;-webkit-transition:.4s;transition:.4s;border-radius:50%}.switch input:checked+.switch-span{background-color:var(--pink)}.switch input:hover+.switch-span{box-shadow:0 0 0 var(--pink)}.switch input:checked+.switch-span:before{-webkit-transform:translateX(calc(var(--width) - var(--height)/2 - 2*0.6rem));-ms-transform:translateX(calc(var(--width) - var(--height)/2 - 2*0.6rem));transform:translateX(calc(var(--width) - var(--height)/2 - 2*0.6rem))}.switch{position:relative;display:inline-block;width:var(--width);height:var(--height)}.switch input{position:absolute;width:var(--width);height:var(--height);opacity:0}</style>",e(this,{target:this.shadowRoot,props:s(this.attributes),customElement:!0},g,k,a,{callback:2,checked:0,toggle:3},null),t&&(t.target&&c(t.target,this,t.anchor),t.props&&(this.$set(t.props),i()))}static get observedAttributes(){return["callback","checked","toggle"]}get callback(){return this.$$.ctx[2]}set callback(t){this.$$set({callback:t}),i()}get checked(){return this.$$.ctx[0]}set checked(t){this.$$set({checked:t}),i()}get toggle(){return this.$$.ctx[3]}}customElements.define("switch-component",m);export{m as default};
|
||||
|
||||
(function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
|
||||
import { S as SvelteElement, i as init, a as attribute_to_object, b as insert_dev, t as flush, s as safe_not_equal, d as dispatch_dev, v as validate_slots, o as onMount, f as element, h as space, n as noop, k as attr_dev, j as add_location, l as append_dev, m as listen_dev, p as detach_dev, r as run_all } from './index-998178c7.js';
|
||||
import { px2rem, getTextWidth, getCanvasFont } from '../../../../../../../../../js/libraries/miscTools.js';
|
||||
|
||||
/* src\components\switch-component.svelte generated by Svelte v3.52.0 */
|
||||
const file = "src\\components\\switch-component.svelte";
|
||||
|
||||
function create_fragment(ctx) {
|
||||
let label;
|
||||
let input;
|
||||
let t;
|
||||
let span;
|
||||
let mounted;
|
||||
let dispose;
|
||||
|
||||
const block = {
|
||||
c: function create() {
|
||||
label = element("label");
|
||||
input = element("input");
|
||||
t = space();
|
||||
span = element("span");
|
||||
this.c = noop;
|
||||
attr_dev(input, "type", "checkbox");
|
||||
add_location(input, file, 39, 4, 804);
|
||||
attr_dev(span, "class", "switch-span");
|
||||
add_location(span, file, 40, 4, 880);
|
||||
attr_dev(label, "class", "switch");
|
||||
add_location(label, file, 38, 0, 776);
|
||||
},
|
||||
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, label, anchor);
|
||||
append_dev(label, input);
|
||||
input.checked = /*checked*/ ctx[0];
|
||||
append_dev(label, t);
|
||||
append_dev(label, span);
|
||||
|
||||
if (!mounted) {
|
||||
dispose = [
|
||||
listen_dev(input, "change", /*input_change_handler*/ ctx[4]),
|
||||
listen_dev(input, "click", /*toggleClick*/ ctx[1], false, false, false)
|
||||
];
|
||||
|
||||
mounted = true;
|
||||
}
|
||||
},
|
||||
p: function update(ctx, [dirty]) {
|
||||
if (dirty & /*checked*/ 1) {
|
||||
input.checked = /*checked*/ ctx[0];
|
||||
}
|
||||
},
|
||||
i: noop,
|
||||
o: noop,
|
||||
d: function destroy(detaching) {
|
||||
if (detaching) detach_dev(label);
|
||||
mounted = false;
|
||||
run_all(dispose);
|
||||
}
|
||||
};
|
||||
|
||||
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('switch-component', slots, []);
|
||||
let { callback = null } = $$props;
|
||||
let { checked = false } = $$props;
|
||||
|
||||
const toggle = () => {
|
||||
let f = () => {
|
||||
if (callback != null) {
|
||||
$$invalidate(0, checked = !checked);
|
||||
callback();
|
||||
} else {
|
||||
toggle();
|
||||
}
|
||||
};
|
||||
|
||||
setTimeout(f, 100);
|
||||
};
|
||||
|
||||
function toggleClick() {
|
||||
if (callback != null) {
|
||||
$$invalidate(0, checked = !checked);
|
||||
callback();
|
||||
}
|
||||
}
|
||||
|
||||
// Main code
|
||||
onMount(() => {
|
||||
|
||||
});
|
||||
|
||||
const writable_props = ['callback', 'checked'];
|
||||
|
||||
Object.keys($$props).forEach(key => {
|
||||
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(`<switch-component> was created with unknown prop '${key}'`);
|
||||
});
|
||||
|
||||
function input_change_handler() {
|
||||
checked = this.checked;
|
||||
$$invalidate(0, checked);
|
||||
}
|
||||
|
||||
$$self.$$set = $$props => {
|
||||
if ('callback' in $$props) $$invalidate(2, callback = $$props.callback);
|
||||
if ('checked' in $$props) $$invalidate(0, checked = $$props.checked);
|
||||
};
|
||||
|
||||
$$self.$capture_state = () => ({
|
||||
onMount,
|
||||
px2rem,
|
||||
getTextWidth,
|
||||
getCanvasFont,
|
||||
callback,
|
||||
checked,
|
||||
toggle,
|
||||
toggleClick
|
||||
});
|
||||
|
||||
$$self.$inject_state = $$props => {
|
||||
if ('callback' in $$props) $$invalidate(2, callback = $$props.callback);
|
||||
if ('checked' in $$props) $$invalidate(0, checked = $$props.checked);
|
||||
};
|
||||
|
||||
if ($$props && "$$inject" in $$props) {
|
||||
$$self.$inject_state($$props.$$inject);
|
||||
}
|
||||
|
||||
return [checked, toggleClick, callback, toggle, input_change_handler];
|
||||
}
|
||||
|
||||
class Switch_component extends SvelteElement {
|
||||
constructor(options) {
|
||||
super();
|
||||
this.shadowRoot.innerHTML = `<style>@import '/css/common.css';.switch span{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#ccc;-webkit-transition:.4s;transition:.4s;border-radius:calc(2* 1.2rem)}.switch span:before{position:absolute;content:"";height:calc(var(--height) - 0.5rem);width:calc(var(--height) - 0.5rem);left:calc(0.3rem);bottom:0.25rem;background-color:white;-webkit-transition:.4s;transition:.4s;border-radius:50%}.switch input:checked+.switch-span{background-color:var(--pink)}.switch input:hover+.switch-span{box-shadow:0 0 0 var(--pink)}.switch input:checked+.switch-span:before{-webkit-transform:translateX(calc(var(--width) - var(--height)/2 - 2*0.6rem));-ms-transform:translateX(calc(var(--width) - var(--height)/2 - 2*0.6rem));transform:translateX(calc(var(--width) - var(--height)/2 - 2*0.6rem))}.switch{position:relative;display:inline-block;width:var(--width);height:var(--height)}.switch input{position:absolute;width:var(--width);height:var(--height);opacity:0}</style>`;
|
||||
|
||||
init(
|
||||
this,
|
||||
{
|
||||
target: this.shadowRoot,
|
||||
props: attribute_to_object(this.attributes),
|
||||
customElement: true
|
||||
},
|
||||
instance,
|
||||
create_fragment,
|
||||
safe_not_equal,
|
||||
{ callback: 2, checked: 0, toggle: 3 },
|
||||
null
|
||||
);
|
||||
|
||||
if (options) {
|
||||
if (options.target) {
|
||||
insert_dev(options.target, this, options.anchor);
|
||||
}
|
||||
|
||||
if (options.props) {
|
||||
this.$set(options.props);
|
||||
flush();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static get observedAttributes() {
|
||||
return ["callback", "checked", "toggle"];
|
||||
}
|
||||
|
||||
get callback() {
|
||||
return this.$$.ctx[2];
|
||||
}
|
||||
|
||||
set callback(callback) {
|
||||
this.$$set({ callback });
|
||||
flush();
|
||||
}
|
||||
|
||||
get checked() {
|
||||
return this.$$.ctx[0];
|
||||
}
|
||||
|
||||
set checked(checked) {
|
||||
this.$$set({ checked });
|
||||
flush();
|
||||
}
|
||||
|
||||
get toggle() {
|
||||
return this.$$.ctx[3];
|
||||
}
|
||||
|
||||
set toggle(value) {
|
||||
throw new Error("<switch-component>: Cannot set read-only property 'toggle'");
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define("switch-component", Switch_component);
|
||||
|
||||
export { Switch_component as default };
|
||||
|
Reference in New Issue
Block a user