From 57bd78ad900923373dc2a5033c905d3ccccfc356 Mon Sep 17 00:00:00 2001
From: Dmitry Borisenko <67171972+IoTManagerProject@users.noreply.github.com>
Date: Tue, 8 Feb 2022 00:38:54 +0100
Subject: [PATCH] =?UTF-8?q?=D0=BE=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5?=
=?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=B2=D0=B5=D0=B1=D0=B0,=20=D0=BD=D0=BE?=
=?UTF-8?q?=D1=80=D0=BC=D0=B0=D0=BB=D1=8C=D0=BD=D1=8B=D0=B9=20=D0=B1=D0=B0?=
=?UTF-8?q?=D0=BD=D0=B4=D0=BB?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
data_svelte/build/bundle.js | 9954 +----------------------------------
data_svelte/settings.json | 4 +-
2 files changed, 3 insertions(+), 9955 deletions(-)
diff --git a/data_svelte/build/bundle.js b/data_svelte/build/bundle.js
index ab7bcb1b..842f9075 100644
--- a/data_svelte/build/bundle.js
+++ b/data_svelte/build/bundle.js
@@ -1,9954 +1,2 @@
-
-(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);
-var app = (function () {
- 'use strict';
-
- function noop() { }
- function assign(tar, src) {
- // @ts-ignore
- for (const k in src)
- tar[k] = src[k];
- return tar;
- }
- function add_location(element, file, line, column, char) {
- element.__svelte_meta = {
- loc: { file, line, column, char }
- };
- }
- function run(fn) {
- return fn();
- }
- function blank_object() {
- return Object.create(null);
- }
- function run_all(fns) {
- fns.forEach(run);
- }
- function is_function(thing) {
- return typeof thing === 'function';
- }
- function safe_not_equal(a, b) {
- return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
- }
- function is_empty(obj) {
- return Object.keys(obj).length === 0;
- }
- function 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 create_slot(definition, ctx, $$scope, fn) {
- if (definition) {
- const slot_ctx = get_slot_context(definition, ctx, $$scope, fn);
- return definition[0](slot_ctx);
- }
- }
- function get_slot_context(definition, ctx, $$scope, fn) {
- return definition[1] && fn
- ? assign($$scope.ctx.slice(), definition[1](fn(ctx)))
- : $$scope.ctx;
- }
- function get_slot_changes(definition, $$scope, dirty, fn) {
- if (definition[2] && fn) {
- const lets = definition[2](fn(dirty));
- if ($$scope.dirty === undefined) {
- return lets;
- }
- if (typeof lets === 'object') {
- const merged = [];
- const len = Math.max($$scope.dirty.length, lets.length);
- for (let i = 0; i < len; i += 1) {
- merged[i] = $$scope.dirty[i] | lets[i];
- }
- return merged;
- }
- return $$scope.dirty | lets;
- }
- return $$scope.dirty;
- }
- function update_slot_base(slot, slot_definition, ctx, $$scope, slot_changes, get_slot_context_fn) {
- if (slot_changes) {
- const slot_context = get_slot_context(slot_definition, ctx, $$scope, get_slot_context_fn);
- slot.p(slot_context, slot_changes);
- }
- }
- function get_all_dirty_from_scope($$scope) {
- if ($$scope.ctx.length > 32) {
- const dirty = [];
- const length = $$scope.ctx.length / 32;
- for (let i = 0; i < length; i++) {
- dirty[i] = -1;
- }
- return dirty;
- }
- return -1;
- }
- 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 to_number(value) {
- return value === '' ? null : +value;
- }
- function children(element) {
- return Array.from(element.childNodes);
- }
- function set_input_value(input, value) {
- input.value = value == null ? '' : value;
- }
- function select_option(select, value) {
- for (let i = 0; i < select.options.length; i += 1) {
- const option = select.options[i];
- if (option.__value === value) {
- option.selected = true;
- return;
- }
- }
- select.selectedIndex = -1; // no option should be selected
- }
- function select_value(select) {
- const selected_option = select.querySelector(':checked') || select.options[0];
- return selected_option && selected_option.__value;
- }
- function custom_event(type, detail, bubbles = false) {
- const e = document.createEvent('CustomEvent');
- e.initCustomEvent(type, bubbles, false, detail);
- return e;
- }
-
- let current_component;
- function set_current_component(component) {
- current_component = component;
- }
- function get_current_component() {
- if (!current_component)
- throw new Error('Function called outside component initialization');
- return current_component;
- }
- function onMount(fn) {
- get_current_component().$$.on_mount.push(fn);
- }
- function onDestroy(fn) {
- get_current_component().$$.on_destroy.push(fn);
- }
- function setContext(key, context) {
- get_current_component().$$.context.set(key, context);
- }
- function getContext(key) {
- return get_current_component().$$.context.get(key);
- }
- // TODO figure out if we still want to support
- // shorthand events, or if we want to implement
- // a real bubbling mechanism
- function bubble(component, event) {
- const callbacks = component.$$.callbacks[event.type];
- if (callbacks) {
- // @ts-ignore
- callbacks.slice().forEach(fn => fn.call(this, event));
- }
- }
-
- const dirty_components = [];
- const binding_callbacks = [];
- const render_callbacks = [];
- const flush_callbacks = [];
- const resolved_promise = Promise.resolve();
- let update_scheduled = false;
- function schedule_update() {
- if (!update_scheduled) {
- update_scheduled = true;
- resolved_promise.then(flush);
- }
- }
- function tick() {
- schedule_update();
- return resolved_promise;
- }
- function add_render_callback(fn) {
- render_callbacks.push(fn);
- }
- function add_flush_callback(fn) {
- flush_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();
- let outros;
- function group_outros() {
- outros = {
- r: 0,
- c: [],
- p: outros // parent group
- };
- }
- function check_outros() {
- if (!outros.r) {
- run_all(outros.c);
- }
- outros = outros.p;
- }
- function transition_in(block, local) {
- if (block && block.i) {
- outroing.delete(block);
- block.i(local);
- }
- }
- function transition_out(block, local, detach, callback) {
- if (block && block.o) {
- if (outroing.has(block))
- return;
- outroing.add(block);
- outros.c.push(() => {
- outroing.delete(block);
- if (callback) {
- if (detach)
- block.d(1);
- callback();
- }
- });
- block.o(local);
- }
- }
-
- const globals = (typeof window !== 'undefined'
- ? window
- : typeof globalThis !== 'undefined'
- ? globalThis
- : global);
-
- function bind(component, name, callback) {
- const index = component.$$.props[name];
- if (index !== undefined) {
- component.$$.bound[index] = callback;
- callback(component.$$.ctx[index]);
- }
- }
- function create_component(block) {
- block && block.c();
- }
- function mount_component(component, target, anchor, customElement) {
- const { fragment, on_mount, on_destroy, after_update } = component.$$;
- fragment && fragment.m(target, anchor);
- if (!customElement) {
- // onMount happens before the initial afterUpdate
- add_render_callback(() => {
- const new_on_destroy = on_mount.map(run).filter(is_function);
- if (on_destroy) {
- on_destroy.push(...new_on_destroy);
- }
- else {
- // Edge case - component was destroyed immediately,
- // most likely as a result of a binding initialising
- run_all(new_on_destroy);
- }
- component.$$.on_mount = [];
- });
- }
- after_update.forEach(add_render_callback);
- }
- function destroy_component(component, detaching) {
- const $$ = component.$$;
- if ($$.fragment !== null) {
- run_all($$.on_destroy);
- $$.fragment && $$.fragment.d(detaching);
- // TODO null out other refs, including component.$$ (but need to
- // preserve final state?)
- $$.on_destroy = $$.fragment = null;
- $$.ctx = [];
- }
- }
- function make_dirty(component, i) {
- if (component.$$.dirty[0] === -1) {
- dirty_components.push(component);
- schedule_update();
- component.$$.dirty.fill(0);
- }
- component.$$.dirty[(i / 31) | 0] |= (1 << (i % 31));
- }
- function init(component, options, instance, create_fragment, not_equal, props, append_styles, dirty = [-1]) {
- const parent_component = current_component;
- set_current_component(component);
- const $$ = component.$$ = {
- fragment: null,
- ctx: null,
- // state
- props,
- update: noop,
- not_equal,
- bound: blank_object(),
- // lifecycle
- on_mount: [],
- on_destroy: [],
- on_disconnect: [],
- before_update: [],
- after_update: [],
- context: new Map(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);
- }
- /**
- * Base class for Svelte components. Used when dev=false.
- */
- class SvelteComponent {
- $destroy() {
- destroy_component(this, 1);
- this.$destroy = noop;
- }
- $on(type, callback) {
- const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = []));
- callbacks.push(callback);
- return () => {
- const index = callbacks.indexOf(callback);
- if (index !== -1)
- callbacks.splice(index, 1);
- };
- }
- $set($$props) {
- if (this.$$set && !is_empty($$props)) {
- this.$$.skip_bound = true;
- this.$$set($$props);
- this.$$.skip_bound = false;
- }
- }
- }
-
- function dispatch_dev(type, detail) {
- document.dispatchEvent(custom_event(type, Object.assign({ version: '3.46.4' }, detail), 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}".`);
- }
- }
- }
- /**
- * Base class for Svelte components with some minor dev-enhancements. Used when dev=true.
- */
- class SvelteComponentDev extends SvelteComponent {
- constructor(options) {
- if (!options || (!options.target && !options.$$inline)) {
- throw new Error("'target' is a required option");
- }
- super();
- }
- $destroy() {
- super.$destroy();
- this.$destroy = () => {
- console.warn('Component was already destroyed'); // eslint-disable-line no-console
- };
- }
- $capture_state() { }
- $inject_state() { }
- }
-
- 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 };
- }
-
- function d(e,n=!1){return e=e.slice(e.startsWith("/#")?2:0,e.endsWith("/*")?-2:void 0),e.startsWith("/")||(e="/"+e),e==="/"&&(e=""),n&&!e.endsWith("/")&&(e+="/"),e}function b(e,n){e=d(e,!0),n=d(n,!0);let a=[],r={},t=!0,o=e.split("/").map(i=>i.startsWith(":")?(a.push(i.slice(1)),"([^\\/]+)"):i).join("\\/"),c=n.match(new RegExp(`^${o}$`));return c||(t=!1,c=n.match(new RegExp(`^${o}`))),c?(a.forEach((i,w)=>r[i]=c[w+1]),{exact:t,params:r,part:c[0].slice(0,-1)}):null}function x(e,n,a){if(a==="")return e;if(a[0]==="/")return a;let r=c=>c.split("/").filter(i=>i!==""),t=r(e),o=n?r(n):[];return "/"+o.map((c,i)=>t[i]).join("/")+"/"+a}function h(e,n,a,r){let t=[n,"data-"+n].reduce((o,c)=>{let i=e.getAttribute(c);return a&&e.removeAttribute(c),i===null?o:i},!1);return !r&&t===""?!0:t||r||!1}function v(e){let n=e.split("&").map(a=>a.split("=")).reduce((a,r)=>{let t=r[0];if(!t)return a;let o=r.length>1?r[r.length-1]:!0;return typeof o=="string"&&o.includes(",")&&(o=o.split(",")),a[t]===void 0?a[t]=[o]:a[t].push(o),a},{});return Object.entries(n).reduce((a,r)=>(a[r[0]]=r[1].length>1?r[1]:r[1][0],a),{})}function S(e){throw new Error("[Tinro] "+e)}var k=1,y=2,M=3,j=4;function C(e,n,a,r){return e===k?n&&n():e===y?a&&a():r&&r()}function W(){return !window||window.location.pathname==="srcdoc"?M:k}var s={HISTORY:k,HASH:y,MEMORY:M,OFF:j,run:C,getDeafault:W};var O,R,l=z();function z(){let e=s.getDeafault(),n,a=o=>window.onhashchange=window.onpopstate=R=null,r=o=>n&&n(_(e));function t(o){o&&(e=o),a(),e!==s.OFF&&s.run(e,c=>window.onpopstate=r,c=>window.onhashchange=r)&&r();}return {mode:o=>t(o),get:o=>_(e),go(o,c){D(e,o,c),r();},start(o){n=o,t();},stop(){n=null,t(s.OFF);}}}function D(e,n,a){let r=t=>history[a?"replaceState":"pushState"]({},"",t);s.run(e,t=>r(n),t=>r(`#${n}`),t=>R=n);}function _(e){let n=O,a=O=s.run(e,t=>window.location.pathname+window.location.search,t=>String(window.location.hash.slice(1)||"/"),t=>R||"/"),r=a.match(/^([^?#]+)(?:\?([^#]+))?(?:\#(.+))?$/);return {url:a,from:n,path:r[1]||"",query:v(r[2]||""),hash:r[3]||""}}function $(e){let n=getContext("tinro");n&&(n.exact||n.fallback)&&S(`${e.fallback?"":``} can't be inside ${n.fallback?"":` with exact path`}`);let a=e.fallback?"fallbacks":"childs",r=writable({}),t={router:{},exact:!1,pattern:null,meta:{},parent:n,fallback:e.fallback,redirect:!1,firstmatch:!1,breadcrumb:null,matched:!1,childs:new Set,activeChilds:new Set,fallbacks:new Set,update(o){t.exact=!o.path.endsWith("/*"),t.pattern=d(`${t.parent&&t.parent.pattern||""}${o.path}`),t.redirect=o.redirect,t.firstmatch=o.firstmatch,t.breadcrumb=o.breadcrumb,t.match();},register:()=>{if(!!t.parent)return t.parent[a].add(t),()=>{t.parent[a].delete(t),t.router.un&&t.router.un();}},show:()=>{e.onShow(),!t.fallback&&t.parent&&t.parent.activeChilds.add(t);},hide:()=>{e.onHide(),!t.fallback&&t.parent&&t.parent.activeChilds.delete(t);},match:async()=>{t.matched=!1;let{path:o,url:c,from:i,query:w}=t.router,u=b(t.pattern,o);if(!t.fallback&&u&&t.redirect&&(!t.exact||t.exact&&u.exact)){await tick();let m=x(o,t.parent&&t.parent.pattern,t.redirect);return f.goto(m,!0)}if(t.meta=u&&{from:i,url:c,query:w,match:u.part,pattern:t.pattern,breadcrumbs:t.parent&&t.parent.meta&&t.parent.meta.breadcrumbs.slice()||[],params:u.params,subscribe:r.subscribe},t.breadcrumb&&t.meta&&t.meta.breadcrumbs.push({name:t.breadcrumb,path:u.part}),r.set(t.meta),u&&!t.fallback&&(!t.exact||t.exact&&u.exact)&&(!t.parent||!t.parent.firstmatch||!t.parent.matched)?(e.onMeta(t.meta),t.parent&&(t.parent.matched=!0),t.show()):t.hide(),await tick(),u&&!t.fallback&&(t.childs.size>0&&t.activeChilds.size==0||t.childs.size==0&&t.fallbacks.size>0)){let m=t;for(;m.fallbacks.size==0;)if(m=m.parent,!m)return;m&&m.fallbacks.forEach(p=>{if(p.redirect){let H=x("/",p.parent&&p.parent.pattern,p.redirect);f.goto(H,!0);}else p.show();});}}};return setContext("tinro",t),onMount(()=>t.register()),t.router.un=f.subscribe(o=>{t.router.path=o.path,t.router.url=o.url,t.router.query=o.query,t.router.from=o.from,t.pattern!==null&&t.match();}),t}function g(){return getContext("tinro").meta}var f=K();function K(){let{subscribe:e}=writable(l.get(),n=>{l.start(n);let a=T(l.go);return ()=>{l.stop(),a();}});return {subscribe:e,goto:l.go,params:I,meta:g,useHashNavigation:n=>l.mode(n?s.HASH:s.HISTORY),mode:{hash:()=>l.mode(s.HASH),history:()=>l.mode(s.HISTORY),memory:()=>l.mode(s.MEMORY)}}}function A(e){let n=h(e,"href"),a=h(e,"exact",!0),r=h(e,"active-class",!0,"active");return {destroy:f.subscribe(t=>{let o=b(n,t.path);o&&(o.exact&&a||!a)?e.classList.add(r):e.classList.remove(r);})}}function T(e){let n=a=>{let r=a.target.closest("a[href]"),t=r&&h(r,"target",!1,"_self"),o=r&&h(r,"tinro-ignore"),c=a.ctrlKey||a.metaKey||a.altKey||a.shiftKey;if(t=="_self"&&!o&&!c&&r){let i=r.getAttribute("href").replace(/^\/#/,"");/^\/\/|^[a-zA-Z]+:/.test(i)||(a.preventDefault(),e(i.startsWith("/")?i:r.href.replace(window.location.origin,"")));}};return addEventListener("click",n),()=>removeEventListener("click",n)}function I(){return getContext("tinro").meta.params}
-
- /* node_modules\tinro\cmp\Route.svelte generated by Svelte v3.46.4 */
-
- const get_default_slot_changes = dirty => ({
- params: dirty & /*params*/ 2,
- meta: dirty & /*meta*/ 4
- });
-
- const get_default_slot_context = ctx => ({
- params: /*params*/ ctx[1],
- meta: /*meta*/ ctx[2]
- });
-
- // (32:0) {#if showContent}
- function create_if_block$9(ctx) {
- let current;
- const default_slot_template = /*#slots*/ ctx[9].default;
- const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[8], get_default_slot_context);
-
- const block = {
- c: function create() {
- if (default_slot) default_slot.c();
- },
- m: function mount(target, anchor) {
- if (default_slot) {
- default_slot.m(target, anchor);
- }
-
- current = true;
- },
- p: function update(ctx, dirty) {
- if (default_slot) {
- if (default_slot.p && (!current || dirty & /*$$scope, params, meta*/ 262)) {
- update_slot_base(
- default_slot,
- default_slot_template,
- ctx,
- /*$$scope*/ ctx[8],
- !current
- ? get_all_dirty_from_scope(/*$$scope*/ ctx[8])
- : get_slot_changes(default_slot_template, /*$$scope*/ ctx[8], dirty, get_default_slot_changes),
- get_default_slot_context
- );
- }
- }
- },
- i: function intro(local) {
- if (current) return;
- transition_in(default_slot, local);
- current = true;
- },
- o: function outro(local) {
- transition_out(default_slot, local);
- current = false;
- },
- d: function destroy(detaching) {
- if (default_slot) default_slot.d(detaching);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_if_block$9.name,
- type: "if",
- source: "(32:0) {#if showContent}",
- ctx
- });
-
- return block;
- }
-
- function create_fragment$i(ctx) {
- let if_block_anchor;
- let current;
- let if_block = /*showContent*/ ctx[0] && create_if_block$9(ctx);
-
- const block = {
- c: function create() {
- if (if_block) if_block.c();
- if_block_anchor = empty();
- },
- 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);
- current = true;
- },
- p: function update(ctx, [dirty]) {
- if (/*showContent*/ ctx[0]) {
- if (if_block) {
- if_block.p(ctx, dirty);
-
- if (dirty & /*showContent*/ 1) {
- transition_in(if_block, 1);
- }
- } else {
- if_block = create_if_block$9(ctx);
- if_block.c();
- transition_in(if_block, 1);
- if_block.m(if_block_anchor.parentNode, if_block_anchor);
- }
- } else if (if_block) {
- group_outros();
-
- transition_out(if_block, 1, 1, () => {
- if_block = null;
- });
-
- check_outros();
- }
- },
- i: function intro(local) {
- if (current) return;
- transition_in(if_block);
- current = true;
- },
- o: function outro(local) {
- transition_out(if_block);
- current = false;
- },
- d: function destroy(detaching) {
- if (if_block) if_block.d(detaching);
- if (detaching) detach_dev(if_block_anchor);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_fragment$i.name,
- type: "component",
- source: "",
- ctx
- });
-
- return block;
- }
-
- function instance$i($$self, $$props, $$invalidate) {
- let { $$slots: slots = {}, $$scope } = $$props;
- validate_slots('Route', slots, ['default']);
- let { path = '/*' } = $$props;
- let { fallback = false } = $$props;
- let { redirect = false } = $$props;
- let { firstmatch = false } = $$props;
- let { breadcrumb = null } = $$props;
- let showContent = false;
- let params = {}; /* DEPRECATED */
- let meta = {};
-
- const route = $({
- fallback,
- onShow() {
- $$invalidate(0, showContent = true);
- },
- onHide() {
- $$invalidate(0, showContent = false);
- },
- onMeta(newmeta) {
- $$invalidate(2, meta = newmeta);
- $$invalidate(1, params = meta.params); /* DEPRECATED */
- }
- });
-
- const writable_props = ['path', 'fallback', 'redirect', 'firstmatch', 'breadcrumb'];
-
- Object.keys($$props).forEach(key => {
- if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(` was created with unknown prop '${key}'`);
- });
-
- $$self.$$set = $$props => {
- if ('path' in $$props) $$invalidate(3, path = $$props.path);
- if ('fallback' in $$props) $$invalidate(4, fallback = $$props.fallback);
- if ('redirect' in $$props) $$invalidate(5, redirect = $$props.redirect);
- if ('firstmatch' in $$props) $$invalidate(6, firstmatch = $$props.firstmatch);
- if ('breadcrumb' in $$props) $$invalidate(7, breadcrumb = $$props.breadcrumb);
- if ('$$scope' in $$props) $$invalidate(8, $$scope = $$props.$$scope);
- };
-
- $$self.$capture_state = () => ({
- createRouteObject: $,
- path,
- fallback,
- redirect,
- firstmatch,
- breadcrumb,
- showContent,
- params,
- meta,
- route
- });
-
- $$self.$inject_state = $$props => {
- if ('path' in $$props) $$invalidate(3, path = $$props.path);
- if ('fallback' in $$props) $$invalidate(4, fallback = $$props.fallback);
- if ('redirect' in $$props) $$invalidate(5, redirect = $$props.redirect);
- if ('firstmatch' in $$props) $$invalidate(6, firstmatch = $$props.firstmatch);
- if ('breadcrumb' in $$props) $$invalidate(7, breadcrumb = $$props.breadcrumb);
- if ('showContent' in $$props) $$invalidate(0, showContent = $$props.showContent);
- if ('params' in $$props) $$invalidate(1, params = $$props.params);
- if ('meta' in $$props) $$invalidate(2, meta = $$props.meta);
- };
-
- if ($$props && "$$inject" in $$props) {
- $$self.$inject_state($$props.$$inject);
- }
-
- $$self.$$.update = () => {
- if ($$self.$$.dirty & /*path, redirect, firstmatch, breadcrumb*/ 232) {
- route.update({ path, redirect, firstmatch, breadcrumb });
- }
- };
-
- return [
- showContent,
- params,
- meta,
- path,
- fallback,
- redirect,
- firstmatch,
- breadcrumb,
- $$scope,
- slots
- ];
- }
-
- class Route extends SvelteComponentDev {
- constructor(options) {
- super(options);
-
- init(this, options, instance$i, create_fragment$i, safe_not_equal, {
- path: 3,
- fallback: 4,
- redirect: 5,
- firstmatch: 6,
- breadcrumb: 7
- });
-
- dispatch_dev("SvelteRegisterComponent", {
- component: this,
- tagName: "Route",
- options,
- id: create_fragment$i.name
- });
- }
-
- get path() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set path(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
-
- get fallback() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set fallback(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
-
- get redirect() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set redirect(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
-
- get firstmatch() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set firstmatch(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
-
- get breadcrumb() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set breadcrumb(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
- }
-
- /* src\components\Alarm.svelte generated by Svelte v3.46.4 */
-
- const file$h = "src\\components\\Alarm.svelte";
-
- // (6:2) {#if title}
- function create_if_block$8(ctx) {
- let h1;
- let t;
-
- const block = {
- c: function create() {
- h1 = element("h1");
- t = text(/*title*/ ctx[0]);
- attr_dev(h1, "class", "alm-hdr");
- add_location(h1, file$h, 6, 4, 82);
- },
- m: function mount(target, anchor) {
- insert_dev(target, h1, anchor);
- append_dev(h1, t);
- },
- p: function update(ctx, dirty) {
- if (dirty & /*title*/ 1) set_data_dev(t, /*title*/ ctx[0]);
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(h1);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_if_block$8.name,
- type: "if",
- source: "(6:2) {#if title}",
- ctx
- });
-
- return block;
- }
-
- function create_fragment$h(ctx) {
- let div;
- let t;
- let current;
- let if_block = /*title*/ ctx[0] && create_if_block$8(ctx);
- const default_slot_template = /*#slots*/ ctx[2].default;
- const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[1], null);
-
- const block = {
- c: function create() {
- div = element("div");
- if (if_block) if_block.c();
- t = space();
- if (default_slot) default_slot.c();
- attr_dev(div, "class", "alm");
- add_location(div, file$h, 4, 0, 44);
- },
- 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);
- if (if_block) if_block.m(div, null);
- append_dev(div, t);
-
- if (default_slot) {
- default_slot.m(div, null);
- }
-
- current = true;
- },
- p: function update(ctx, [dirty]) {
- if (/*title*/ ctx[0]) {
- if (if_block) {
- if_block.p(ctx, dirty);
- } else {
- if_block = create_if_block$8(ctx);
- if_block.c();
- if_block.m(div, t);
- }
- } else if (if_block) {
- if_block.d(1);
- if_block = null;
- }
-
- if (default_slot) {
- if (default_slot.p && (!current || dirty & /*$$scope*/ 2)) {
- update_slot_base(
- default_slot,
- default_slot_template,
- ctx,
- /*$$scope*/ ctx[1],
- !current
- ? get_all_dirty_from_scope(/*$$scope*/ ctx[1])
- : get_slot_changes(default_slot_template, /*$$scope*/ ctx[1], dirty, null),
- null
- );
- }
- }
- },
- i: function intro(local) {
- if (current) return;
- transition_in(default_slot, local);
- current = true;
- },
- o: function outro(local) {
- transition_out(default_slot, local);
- current = false;
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(div);
- if (if_block) if_block.d();
- if (default_slot) default_slot.d(detaching);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_fragment$h.name,
- type: "component",
- source: "",
- ctx
- });
-
- return block;
- }
-
- function instance$h($$self, $$props, $$invalidate) {
- let { $$slots: slots = {}, $$scope } = $$props;
- validate_slots('Alarm', slots, ['default']);
- let { title } = $$props;
- const writable_props = ['title'];
-
- Object.keys($$props).forEach(key => {
- if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(` was created with unknown prop '${key}'`);
- });
-
- $$self.$$set = $$props => {
- if ('title' in $$props) $$invalidate(0, title = $$props.title);
- if ('$$scope' in $$props) $$invalidate(1, $$scope = $$props.$$scope);
- };
-
- $$self.$capture_state = () => ({ title });
-
- $$self.$inject_state = $$props => {
- if ('title' in $$props) $$invalidate(0, title = $$props.title);
- };
-
- if ($$props && "$$inject" in $$props) {
- $$self.$inject_state($$props.$$inject);
- }
-
- return [title, $$scope, slots];
- }
-
- class Alarm extends SvelteComponentDev {
- constructor(options) {
- super(options);
- init(this, options, instance$h, create_fragment$h, safe_not_equal, { title: 0 });
-
- dispatch_dev("SvelteRegisterComponent", {
- component: this,
- tagName: "Alarm",
- options,
- id: create_fragment$h.name
- });
-
- const { ctx } = this.$$;
- const props = options.props || {};
-
- if (/*title*/ ctx[0] === undefined && !('title' in props)) {
- console.warn(" was created without expected prop 'title'");
- }
- }
-
- get title() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set title(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
- }
-
- /* src\components\Modal.svelte generated by Svelte v3.46.4 */
-
- const file$g = "src\\components\\Modal.svelte";
-
- // (8:2) {#if show}
- function create_if_block$7(ctx) {
- let div8;
- let div7;
- let div0;
- let t0;
- let span;
- let t2;
- let div6;
- let div4;
- let div3;
- let div2;
- let h3;
- let t3;
- let t4;
- let div1;
- let p;
- let t5;
- let t6;
- let div5;
- let button0;
- let t8;
- let button1;
- let mounted;
- let dispose;
-
- const block = {
- c: function create() {
- div8 = element("div");
- div7 = element("div");
- div0 = element("div");
- t0 = space();
- span = element("span");
- span.textContent = "";
- t2 = space();
- div6 = element("div");
- div4 = element("div");
- div3 = element("div");
- div2 = element("div");
- h3 = element("h3");
- t3 = text(/*header*/ ctx[1]);
- t4 = space();
- div1 = element("div");
- p = element("p");
- t5 = text(/*text*/ ctx[2]);
- t6 = space();
- div5 = element("div");
- button0 = element("button");
- button0.textContent = "Deactivate";
- t8 = space();
- button1 = element("button");
- button1.textContent = "Cancel";
- attr_dev(div0, "class", "fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity");
- attr_dev(div0, "aria-hidden", "true");
- add_location(div0, file$g, 11, 8, 427);
- attr_dev(span, "class", "hidden sm:inline-block sm:align-middle sm:h-screen");
- attr_dev(span, "aria-hidden", "true");
- add_location(span, file$g, 13, 8, 620);
- attr_dev(h3, "class", "text-lg leading-6 font-medium text-gray-900");
- attr_dev(h3, "id", "modal-title");
- add_location(h3, file$g, 18, 16, 1101);
- attr_dev(p, "class", "text-sm text-gray-500");
- add_location(p, file$g, 20, 18, 1243);
- attr_dev(div1, "class", "mt-2");
- add_location(div1, file$g, 19, 16, 1205);
- attr_dev(div2, "class", "mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left");
- add_location(div2, file$g, 17, 14, 1024);
- attr_dev(div3, "class", "sm:flex sm:items-start");
- add_location(div3, file$g, 16, 12, 972);
- attr_dev(div4, "class", "bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4");
- add_location(div4, file$g, 15, 10, 906);
- attr_dev(button0, "type", "button");
- attr_dev(button0, "class", "w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm");
- add_location(button0, file$g, 26, 12, 1466);
- attr_dev(button1, "type", "button");
- attr_dev(button1, "class", "mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm");
- add_location(button1, file$g, 27, 12, 1783);
- attr_dev(div5, "class", "bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse");
- add_location(div5, file$g, 25, 10, 1382);
- attr_dev(div6, "class", "inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full");
- add_location(div6, file$g, 14, 8, 728);
- attr_dev(div7, "class", "flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0");
- add_location(div7, file$g, 10, 6, 317);
- attr_dev(div8, "class", "fixed z-10 inset-0 overflow-y-auto");
- attr_dev(div8, "aria-labelledby", "modal-title");
- attr_dev(div8, "role", "dialog");
- attr_dev(div8, "aria-modal", "true");
- add_location(div8, file$g, 9, 4, 199);
- },
- m: function mount(target, anchor) {
- insert_dev(target, div8, anchor);
- append_dev(div8, div7);
- append_dev(div7, div0);
- append_dev(div7, t0);
- append_dev(div7, span);
- append_dev(div7, t2);
- append_dev(div7, div6);
- append_dev(div6, div4);
- append_dev(div4, div3);
- append_dev(div3, div2);
- append_dev(div2, h3);
- append_dev(h3, t3);
- append_dev(div2, t4);
- append_dev(div2, div1);
- append_dev(div1, p);
- append_dev(p, t5);
- append_dev(div6, t6);
- append_dev(div6, div5);
- append_dev(div5, button0);
- append_dev(div5, t8);
- append_dev(div5, button1);
-
- if (!mounted) {
- dispose = listen_dev(button1, "click", /*click_handler*/ ctx[3], false, false, false);
- mounted = true;
- }
- },
- p: function update(ctx, dirty) {
- if (dirty & /*header*/ 2) set_data_dev(t3, /*header*/ ctx[1]);
- if (dirty & /*text*/ 4) set_data_dev(t5, /*text*/ ctx[2]);
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(div8);
- mounted = false;
- dispose();
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_if_block$7.name,
- type: "if",
- source: "(8:2) {#if show}",
- ctx
- });
-
- return block;
- }
-
- function create_fragment$g(ctx) {
- let div;
- let if_block = /*show*/ ctx[0] && create_if_block$7(ctx);
-
- const block = {
- c: function create() {
- div = element("div");
- if (if_block) if_block.c();
- attr_dev(div, "class", "modal");
- add_location(div, file$g, 6, 0, 105);
- },
- 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);
- if (if_block) if_block.m(div, null);
- },
- p: function update(ctx, [dirty]) {
- if (/*show*/ ctx[0]) {
- if (if_block) {
- if_block.p(ctx, dirty);
- } else {
- if_block = create_if_block$7(ctx);
- if_block.c();
- if_block.m(div, null);
- }
- } else if (if_block) {
- if_block.d(1);
- if_block = null;
- }
- },
- i: noop,
- o: noop,
- d: function destroy(detaching) {
- if (detaching) detach_dev(div);
- if (if_block) if_block.d();
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_fragment$g.name,
- type: "component",
- source: "",
- ctx
- });
-
- return block;
- }
-
- function instance$g($$self, $$props, $$invalidate) {
- let { $$slots: slots = {}, $$scope } = $$props;
- validate_slots('Modal', slots, []);
- let { show } = $$props;
- let { header = "header" } = $$props;
- let { text = "text" } = $$props;
- const writable_props = ['show', 'header', 'text'];
-
- Object.keys($$props).forEach(key => {
- if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(` was created with unknown prop '${key}'`);
- });
-
- const click_handler = () => $$invalidate(0, show = false);
-
- $$self.$$set = $$props => {
- if ('show' in $$props) $$invalidate(0, show = $$props.show);
- if ('header' in $$props) $$invalidate(1, header = $$props.header);
- if ('text' in $$props) $$invalidate(2, text = $$props.text);
- };
-
- $$self.$capture_state = () => ({ show, header, text });
-
- $$self.$inject_state = $$props => {
- if ('show' in $$props) $$invalidate(0, show = $$props.show);
- if ('header' in $$props) $$invalidate(1, header = $$props.header);
- if ('text' in $$props) $$invalidate(2, text = $$props.text);
- };
-
- if ($$props && "$$inject" in $$props) {
- $$self.$inject_state($$props.$$inject);
- }
-
- return [show, header, text, click_handler];
- }
-
- class Modal extends SvelteComponentDev {
- constructor(options) {
- super(options);
- init(this, options, instance$g, create_fragment$g, safe_not_equal, { show: 0, header: 1, text: 2 });
-
- dispatch_dev("SvelteRegisterComponent", {
- component: this,
- tagName: "Modal",
- options,
- id: create_fragment$g.name
- });
-
- const { ctx } = this.$$;
- const props = options.props || {};
-
- if (/*show*/ ctx[0] === undefined && !('show' in props)) {
- console.warn(" was created without expected prop 'show'");
- }
- }
-
- get show() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set show(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
-
- get header() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set header(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
-
- get text() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set text(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
- }
-
- /* src\components\Card.svelte generated by Svelte v3.46.4 */
-
- const file$f = "src\\components\\Card.svelte";
-
- // (6:2) {#if title}
- function create_if_block$6(ctx) {
- let h1;
- let t;
-
- const block = {
- c: function create() {
- h1 = element("h1");
- t = text(/*title*/ ctx[0]);
- attr_dev(h1, "class", "crd-hdr");
- add_location(h1, file$f, 6, 4, 82);
- },
- m: function mount(target, anchor) {
- insert_dev(target, h1, anchor);
- append_dev(h1, t);
- },
- p: function update(ctx, dirty) {
- if (dirty & /*title*/ 1) set_data_dev(t, /*title*/ ctx[0]);
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(h1);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_if_block$6.name,
- type: "if",
- source: "(6:2) {#if title}",
- ctx
- });
-
- return block;
- }
-
- function create_fragment$f(ctx) {
- let div;
- let t;
- let current;
- let if_block = /*title*/ ctx[0] && create_if_block$6(ctx);
- const default_slot_template = /*#slots*/ ctx[2].default;
- const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[1], null);
-
- const block = {
- c: function create() {
- div = element("div");
- if (if_block) if_block.c();
- t = space();
- if (default_slot) default_slot.c();
- attr_dev(div, "class", "crd");
- add_location(div, file$f, 4, 0, 44);
- },
- 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);
- if (if_block) if_block.m(div, null);
- append_dev(div, t);
-
- if (default_slot) {
- default_slot.m(div, null);
- }
-
- current = true;
- },
- p: function update(ctx, [dirty]) {
- if (/*title*/ ctx[0]) {
- if (if_block) {
- if_block.p(ctx, dirty);
- } else {
- if_block = create_if_block$6(ctx);
- if_block.c();
- if_block.m(div, t);
- }
- } else if (if_block) {
- if_block.d(1);
- if_block = null;
- }
-
- if (default_slot) {
- if (default_slot.p && (!current || dirty & /*$$scope*/ 2)) {
- update_slot_base(
- default_slot,
- default_slot_template,
- ctx,
- /*$$scope*/ ctx[1],
- !current
- ? get_all_dirty_from_scope(/*$$scope*/ ctx[1])
- : get_slot_changes(default_slot_template, /*$$scope*/ ctx[1], dirty, null),
- null
- );
- }
- }
- },
- i: function intro(local) {
- if (current) return;
- transition_in(default_slot, local);
- current = true;
- },
- o: function outro(local) {
- transition_out(default_slot, local);
- current = false;
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(div);
- if (if_block) if_block.d();
- if (default_slot) default_slot.d(detaching);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_fragment$f.name,
- type: "component",
- source: "",
- ctx
- });
-
- return block;
- }
-
- function instance$f($$self, $$props, $$invalidate) {
- let { $$slots: slots = {}, $$scope } = $$props;
- validate_slots('Card', slots, ['default']);
- let { title } = $$props;
- const writable_props = ['title'];
-
- Object.keys($$props).forEach(key => {
- if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(` was created with unknown prop '${key}'`);
- });
-
- $$self.$$set = $$props => {
- if ('title' in $$props) $$invalidate(0, title = $$props.title);
- if ('$$scope' in $$props) $$invalidate(1, $$scope = $$props.$$scope);
- };
-
- $$self.$capture_state = () => ({ title });
-
- $$self.$inject_state = $$props => {
- if ('title' in $$props) $$invalidate(0, title = $$props.title);
- };
-
- if ($$props && "$$inject" in $$props) {
- $$self.$inject_state($$props.$$inject);
- }
-
- return [title, $$scope, slots];
- }
-
- class Card extends SvelteComponentDev {
- constructor(options) {
- super(options);
- init(this, options, instance$f, create_fragment$f, safe_not_equal, { title: 0 });
-
- dispatch_dev("SvelteRegisterComponent", {
- component: this,
- tagName: "Card",
- options,
- id: create_fragment$f.name
- });
-
- const { ctx } = this.$$;
- const props = options.props || {};
-
- if (/*title*/ ctx[0] === undefined && !('title' in props)) {
- console.warn(" was created without expected prop 'title'");
- }
- }
-
- get title() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set title(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
- }
-
- /* src\widgets\Input.svelte generated by Svelte v3.46.4 */
-
- const file$e = "src\\widgets\\Input.svelte";
-
- // (14:4) {#if widget.type == "number"}
- function create_if_block_3$2(ctx) {
- let input;
- let input_class_value;
- let mounted;
- let dispose;
-
- const block = {
- c: function create() {
- input = element("input");
-
- attr_dev(input, "class", input_class_value = /*widget*/ ctx[0]["send"] == true
- ? "ipt-rnd text-right border-red-500"
- : "ipt-rnd text-right focus:border-indigo-500");
-
- attr_dev(input, "step", "0.1");
- attr_dev(input, "type", "number");
- add_location(input, file$e, 14, 6, 402);
- },
- m: function mount(target, anchor) {
- insert_dev(target, input, anchor);
- set_input_value(input, /*widget*/ ctx[0].status);
-
- if (!mounted) {
- dispose = [
- listen_dev(input, "change", /*change_handler*/ ctx[3], false, false, false),
- listen_dev(input, "input", /*input_input_handler*/ ctx[4])
- ];
-
- mounted = true;
- }
- },
- p: function update(ctx, dirty) {
- if (dirty & /*widget*/ 1 && input_class_value !== (input_class_value = /*widget*/ ctx[0]["send"] == true
- ? "ipt-rnd text-right border-red-500"
- : "ipt-rnd text-right focus:border-indigo-500")) {
- attr_dev(input, "class", input_class_value);
- }
-
- if (dirty & /*widget*/ 1 && to_number(input.value) !== /*widget*/ ctx[0].status) {
- set_input_value(input, /*widget*/ ctx[0].status);
- }
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(input);
- mounted = false;
- run_all(dispose);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_if_block_3$2.name,
- type: "if",
- source: "(14:4) {#if widget.type == \\\"number\\\"}",
- ctx
- });
-
- return block;
- }
-
- // (17:4) {#if widget.type == "text"}
- function create_if_block_2$2(ctx) {
- let input;
- let input_class_value;
- let mounted;
- let dispose;
-
- const block = {
- c: function create() {
- input = element("input");
-
- attr_dev(input, "class", input_class_value = /*widget*/ ctx[0]["send"] == true
- ? "ipt-rnd text-right border-red-500"
- : "ipt-rnd text-right focus:border-indigo-500");
-
- attr_dev(input, "type", "text");
- add_location(input, file$e, 17, 6, 723);
- },
- m: function mount(target, anchor) {
- insert_dev(target, input, anchor);
- set_input_value(input, /*widget*/ ctx[0].status);
-
- if (!mounted) {
- dispose = [
- listen_dev(input, "change", /*change_handler_1*/ ctx[5], false, false, false),
- listen_dev(input, "input", /*input_input_handler_1*/ ctx[6])
- ];
-
- mounted = true;
- }
- },
- p: function update(ctx, dirty) {
- if (dirty & /*widget*/ 1 && input_class_value !== (input_class_value = /*widget*/ ctx[0]["send"] == true
- ? "ipt-rnd text-right border-red-500"
- : "ipt-rnd text-right focus:border-indigo-500")) {
- attr_dev(input, "class", input_class_value);
- }
-
- if (dirty & /*widget*/ 1 && input.value !== /*widget*/ ctx[0].status) {
- set_input_value(input, /*widget*/ ctx[0].status);
- }
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(input);
- mounted = false;
- run_all(dispose);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_if_block_2$2.name,
- type: "if",
- source: "(17:4) {#if widget.type == \\\"text\\\"}",
- ctx
- });
-
- return block;
- }
-
- // (20:4) {#if widget.type == "date"}
- function create_if_block_1$2(ctx) {
- let input;
- let input_class_value;
- let mounted;
- let dispose;
-
- const block = {
- c: function create() {
- input = element("input");
-
- attr_dev(input, "class", input_class_value = /*widget*/ ctx[0]["send"] == true
- ? "ipt-rnd text-right border-red-500"
- : "ipt-rnd text-right focus:border-indigo-500");
-
- attr_dev(input, "type", "date");
- add_location(input, file$e, 20, 6, 1031);
- },
- m: function mount(target, anchor) {
- insert_dev(target, input, anchor);
- set_input_value(input, /*widget*/ ctx[0].status);
-
- if (!mounted) {
- dispose = [
- listen_dev(input, "change", /*change_handler_2*/ ctx[7], false, false, false),
- listen_dev(input, "input", /*input_input_handler_2*/ ctx[8])
- ];
-
- mounted = true;
- }
- },
- p: function update(ctx, dirty) {
- if (dirty & /*widget*/ 1 && input_class_value !== (input_class_value = /*widget*/ ctx[0]["send"] == true
- ? "ipt-rnd text-right border-red-500"
- : "ipt-rnd text-right focus:border-indigo-500")) {
- attr_dev(input, "class", input_class_value);
- }
-
- if (dirty & /*widget*/ 1) {
- set_input_value(input, /*widget*/ ctx[0].status);
- }
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(input);
- mounted = false;
- run_all(dispose);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_if_block_1$2.name,
- type: "if",
- source: "(20:4) {#if widget.type == \\\"date\\\"}",
- ctx
- });
-
- return block;
- }
-
- // (23:4) {#if widget.type == "time"}
- function create_if_block$5(ctx) {
- let input;
- let input_class_value;
- let mounted;
- let dispose;
-
- const block = {
- c: function create() {
- input = element("input");
-
- attr_dev(input, "class", input_class_value = /*widget*/ ctx[0]["send"] == true
- ? "ipt-rnd text-right border-red-500"
- : "ipt-rnd text-right focus:border-indigo-500");
-
- attr_dev(input, "type", "time");
- add_location(input, file$e, 23, 6, 1339);
- },
- m: function mount(target, anchor) {
- insert_dev(target, input, anchor);
- set_input_value(input, /*widget*/ ctx[0].status);
-
- if (!mounted) {
- dispose = [
- listen_dev(input, "change", /*change_handler_3*/ ctx[9], false, false, false),
- listen_dev(input, "input", /*input_input_handler_3*/ ctx[10])
- ];
-
- mounted = true;
- }
- },
- p: function update(ctx, dirty) {
- if (dirty & /*widget*/ 1 && input_class_value !== (input_class_value = /*widget*/ ctx[0]["send"] == true
- ? "ipt-rnd text-right border-red-500"
- : "ipt-rnd text-right focus:border-indigo-500")) {
- attr_dev(input, "class", input_class_value);
- }
-
- if (dirty & /*widget*/ 1) {
- set_input_value(input, /*widget*/ ctx[0].status);
- }
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(input);
- mounted = false;
- run_all(dispose);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_if_block$5.name,
- type: "if",
- source: "(23:4) {#if widget.type == \\\"time\\\"}",
- ctx
- });
-
- return block;
- }
-
- function create_fragment$e(ctx) {
- let div2;
- let div0;
- let label;
- let t0_value = (!/*widget*/ ctx[0].descr ? "" : /*widget*/ ctx[0].descr) + "";
- let t0;
- let t1;
- let div1;
- let t2;
- let t3;
- let t4;
- let if_block0 = /*widget*/ ctx[0].type == "number" && create_if_block_3$2(ctx);
- let if_block1 = /*widget*/ ctx[0].type == "text" && create_if_block_2$2(ctx);
- let if_block2 = /*widget*/ ctx[0].type == "date" && create_if_block_1$2(ctx);
- let if_block3 = /*widget*/ ctx[0].type == "time" && create_if_block$5(ctx);
-
- const block = {
- c: function create() {
- div2 = element("div");
- div0 = element("div");
- label = element("label");
- t0 = text(t0_value);
- t1 = space();
- div1 = element("div");
- if (if_block0) if_block0.c();
- t2 = space();
- if (if_block1) if_block1.c();
- t3 = space();
- if (if_block2) if_block2.c();
- t4 = space();
- if (if_block3) if_block3.c();
- attr_dev(label, "class", "wgt-dscr-stl");
- add_location(label, file$e, 10, 4, 255);
- attr_dev(div0, "class", "wgt-dscr-w");
- add_location(div0, file$e, 8, 2, 163);
- attr_dev(div1, "class", "wgt-w");
- add_location(div1, file$e, 12, 2, 340);
- attr_dev(div2, "class", "crd-itm-psn");
- add_location(div2, file$e, 7, 0, 134);
- },
- 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, label);
- append_dev(label, t0);
- append_dev(div2, t1);
- append_dev(div2, div1);
- if (if_block0) if_block0.m(div1, null);
- append_dev(div1, t2);
- if (if_block1) if_block1.m(div1, null);
- append_dev(div1, t3);
- if (if_block2) if_block2.m(div1, null);
- append_dev(div1, t4);
- if (if_block3) if_block3.m(div1, null);
- },
- p: function update(ctx, [dirty]) {
- if (dirty & /*widget*/ 1 && t0_value !== (t0_value = (!/*widget*/ ctx[0].descr ? "" : /*widget*/ ctx[0].descr) + "")) set_data_dev(t0, t0_value);
-
- if (/*widget*/ ctx[0].type == "number") {
- if (if_block0) {
- if_block0.p(ctx, dirty);
- } else {
- if_block0 = create_if_block_3$2(ctx);
- if_block0.c();
- if_block0.m(div1, t2);
- }
- } else if (if_block0) {
- if_block0.d(1);
- if_block0 = null;
- }
-
- if (/*widget*/ ctx[0].type == "text") {
- if (if_block1) {
- if_block1.p(ctx, dirty);
- } else {
- if_block1 = create_if_block_2$2(ctx);
- if_block1.c();
- if_block1.m(div1, t3);
- }
- } else if (if_block1) {
- if_block1.d(1);
- if_block1 = null;
- }
-
- if (/*widget*/ ctx[0].type == "date") {
- if (if_block2) {
- if_block2.p(ctx, dirty);
- } else {
- if_block2 = create_if_block_1$2(ctx);
- if_block2.c();
- if_block2.m(div1, t4);
- }
- } else if (if_block2) {
- if_block2.d(1);
- if_block2 = null;
- }
-
- if (/*widget*/ ctx[0].type == "time") {
- if (if_block3) {
- if_block3.p(ctx, dirty);
- } else {
- if_block3 = create_if_block$5(ctx);
- if_block3.c();
- if_block3.m(div1, null);
- }
- } else if (if_block3) {
- if_block3.d(1);
- if_block3 = null;
- }
- },
- i: noop,
- o: noop,
- d: function destroy(detaching) {
- if (detaching) detach_dev(div2);
- if (if_block0) if_block0.d();
- if (if_block1) if_block1.d();
- if (if_block2) if_block2.d();
- if (if_block3) if_block3.d();
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_fragment$e.name,
- type: "component",
- source: "",
- ctx
- });
-
- return block;
- }
-
- function instance$e($$self, $$props, $$invalidate) {
- let { $$slots: slots = {}, $$scope } = $$props;
- validate_slots('Input', slots, []);
- let { widget } = $$props;
-
- let { wsPush = (ws, topic, status) => {
-
- } } = $$props;
-
- let { value } = $$props;
- value = value;
- const writable_props = ['widget', 'wsPush', 'value'];
-
- Object.keys($$props).forEach(key => {
- if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(` was created with unknown prop '${key}'`);
- });
-
- const change_handler = () => ($$invalidate(0, widget["send"] = true, widget), wsPush(widget.ws, widget.topic, widget.status));
-
- function input_input_handler() {
- widget.status = to_number(this.value);
- $$invalidate(0, widget);
- }
-
- const change_handler_1 = () => ($$invalidate(0, widget["send"] = true, widget), wsPush(widget.ws, widget.topic, widget.status));
-
- function input_input_handler_1() {
- widget.status = this.value;
- $$invalidate(0, widget);
- }
-
- const change_handler_2 = () => ($$invalidate(0, widget["send"] = true, widget), wsPush(widget.ws, widget.topic, widget.status));
-
- function input_input_handler_2() {
- widget.status = this.value;
- $$invalidate(0, widget);
- }
-
- const change_handler_3 = () => ($$invalidate(0, widget["send"] = true, widget), wsPush(widget.ws, widget.topic, widget.status));
-
- function input_input_handler_3() {
- widget.status = this.value;
- $$invalidate(0, widget);
- }
-
- $$self.$$set = $$props => {
- if ('widget' in $$props) $$invalidate(0, widget = $$props.widget);
- if ('wsPush' in $$props) $$invalidate(1, wsPush = $$props.wsPush);
- if ('value' in $$props) $$invalidate(2, value = $$props.value);
- };
-
- $$self.$capture_state = () => ({ widget, wsPush, value });
-
- $$self.$inject_state = $$props => {
- if ('widget' in $$props) $$invalidate(0, widget = $$props.widget);
- if ('wsPush' in $$props) $$invalidate(1, wsPush = $$props.wsPush);
- if ('value' in $$props) $$invalidate(2, value = $$props.value);
- };
-
- if ($$props && "$$inject" in $$props) {
- $$self.$inject_state($$props.$$inject);
- }
-
- return [
- widget,
- wsPush,
- value,
- change_handler,
- input_input_handler,
- change_handler_1,
- input_input_handler_1,
- change_handler_2,
- input_input_handler_2,
- change_handler_3,
- input_input_handler_3
- ];
- }
-
- class Input extends SvelteComponentDev {
- constructor(options) {
- super(options);
- init(this, options, instance$e, create_fragment$e, safe_not_equal, { widget: 0, wsPush: 1, value: 2 });
-
- dispatch_dev("SvelteRegisterComponent", {
- component: this,
- tagName: "Input",
- options,
- id: create_fragment$e.name
- });
-
- const { ctx } = this.$$;
- const props = options.props || {};
-
- if (/*widget*/ ctx[0] === undefined && !('widget' in props)) {
- console.warn(" was created without expected prop 'widget'");
- }
-
- if (/*value*/ ctx[2] === undefined && !('value' in props)) {
- console.warn(" was created without expected prop 'value'");
- }
- }
-
- get widget() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set widget(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
-
- get wsPush() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set wsPush(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
-
- get value() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set value(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
- }
-
- /* src\widgets\Toggle.svelte generated by Svelte v3.46.4 */
-
- const file$d = "src\\widgets\\Toggle.svelte";
-
- function create_fragment$d(ctx) {
- let div5;
- let div0;
- let label0;
- let t0_value = (!/*widget*/ ctx[0].descr ? "" : /*widget*/ ctx[0].descr) + "";
- let t0;
- let t1;
- let div4;
- let label1;
- let div3;
- let input;
- let input_id_value;
- let t2;
- let div1;
- let t3;
- let div2;
- let div2_class_value;
- let label1_for_value;
- let mounted;
- let dispose;
-
- const block = {
- c: function create() {
- div5 = element("div");
- div0 = element("div");
- label0 = element("label");
- t0 = text(t0_value);
- t1 = space();
- div4 = element("div");
- label1 = element("label");
- div3 = element("div");
- input = element("input");
- t2 = space();
- div1 = element("div");
- t3 = space();
- div2 = element("div");
- attr_dev(label0, "class", "wgt-dscr-stl");
- add_location(label0, file$d, 10, 4, 255);
- attr_dev(div0, "class", "wgt-dscr-w");
- add_location(div0, file$d, 8, 2, 163);
- attr_dev(input, "id", input_id_value = /*widget*/ ctx[0].topic);
- attr_dev(input, "type", "checkbox");
- attr_dev(input, "class", "sr-only");
- add_location(input, file$d, 15, 8, 467);
- attr_dev(div1, "class", "block bg-gray-600 w-10 h-6 rounded-full");
- add_location(div1, file$d, 16, 8, 655);
-
- attr_dev(div2, "class", div2_class_value = "dot " + (/*widget*/ ctx[0]['send'] == true
- ? 'bg-red-400'
- : 'bg-white') + " absolute left-1 top-1 w-4 h-4 rounded-full transition");
-
- add_location(div2, file$d, 17, 8, 720);
- attr_dev(div3, "class", "relative");
- add_location(div3, file$d, 14, 6, 435);
- attr_dev(label1, "for", label1_for_value = /*widget*/ ctx[0].topic);
- attr_dev(label1, "class", "items-center cursor-pointer");
- add_location(label1, file$d, 13, 4, 365);
- attr_dev(div4, "class", "wgt-w");
- add_location(div4, file$d, 12, 2, 340);
- attr_dev(div5, "class", "crd-itm-psn");
- add_location(div5, file$d, 7, 0, 134);
- },
- 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, div0);
- append_dev(div0, label0);
- append_dev(label0, t0);
- append_dev(div5, t1);
- append_dev(div5, div4);
- append_dev(div4, label1);
- append_dev(label1, div3);
- append_dev(div3, input);
- set_input_value(input, /*widget*/ ctx[0].status);
- append_dev(div3, t2);
- append_dev(div3, div1);
- append_dev(div3, t3);
- append_dev(div3, div2);
-
- if (!mounted) {
- dispose = [
- listen_dev(input, "change", /*change_handler*/ ctx[3], false, false, false),
- listen_dev(input, "change", /*input_change_handler*/ ctx[4])
- ];
-
- mounted = true;
- }
- },
- p: function update(ctx, [dirty]) {
- if (dirty & /*widget*/ 1 && t0_value !== (t0_value = (!/*widget*/ ctx[0].descr ? "" : /*widget*/ ctx[0].descr) + "")) set_data_dev(t0, t0_value);
-
- if (dirty & /*widget*/ 1 && input_id_value !== (input_id_value = /*widget*/ ctx[0].topic)) {
- attr_dev(input, "id", input_id_value);
- }
-
- if (dirty & /*widget*/ 1) {
- set_input_value(input, /*widget*/ ctx[0].status);
- }
-
- if (dirty & /*widget*/ 1 && div2_class_value !== (div2_class_value = "dot " + (/*widget*/ ctx[0]['send'] == true
- ? 'bg-red-400'
- : 'bg-white') + " absolute left-1 top-1 w-4 h-4 rounded-full transition")) {
- attr_dev(div2, "class", div2_class_value);
- }
-
- if (dirty & /*widget*/ 1 && label1_for_value !== (label1_for_value = /*widget*/ ctx[0].topic)) {
- attr_dev(label1, "for", label1_for_value);
- }
- },
- i: noop,
- o: noop,
- d: function destroy(detaching) {
- if (detaching) detach_dev(div5);
- mounted = false;
- run_all(dispose);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_fragment$d.name,
- type: "component",
- source: "",
- ctx
- });
-
- return block;
- }
-
- function instance$d($$self, $$props, $$invalidate) {
- let { $$slots: slots = {}, $$scope } = $$props;
- validate_slots('Toggle', slots, []);
- let { widget } = $$props;
- let { value } = $$props;
- value = value;
-
- let { wsPush = (ws, topic, status) => {
-
- } } = $$props;
-
- const writable_props = ['widget', 'value', 'wsPush'];
-
- Object.keys($$props).forEach(key => {
- if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(` was created with unknown prop '${key}'`);
- });
-
- const change_handler = () => ($$invalidate(0, widget["send"] = true, widget), wsPush(widget.ws, widget.topic, widget.status));
-
- function input_change_handler() {
- widget.status = this.value;
- $$invalidate(0, widget);
- }
-
- $$self.$$set = $$props => {
- if ('widget' in $$props) $$invalidate(0, widget = $$props.widget);
- if ('value' in $$props) $$invalidate(2, value = $$props.value);
- if ('wsPush' in $$props) $$invalidate(1, wsPush = $$props.wsPush);
- };
-
- $$self.$capture_state = () => ({ widget, value, wsPush });
-
- $$self.$inject_state = $$props => {
- if ('widget' in $$props) $$invalidate(0, widget = $$props.widget);
- if ('value' in $$props) $$invalidate(2, value = $$props.value);
- if ('wsPush' in $$props) $$invalidate(1, wsPush = $$props.wsPush);
- };
-
- if ($$props && "$$inject" in $$props) {
- $$self.$inject_state($$props.$$inject);
- }
-
- return [widget, wsPush, value, change_handler, input_change_handler];
- }
-
- class Toggle extends SvelteComponentDev {
- constructor(options) {
- super(options);
- init(this, options, instance$d, create_fragment$d, safe_not_equal, { widget: 0, value: 2, wsPush: 1 });
-
- dispatch_dev("SvelteRegisterComponent", {
- component: this,
- tagName: "Toggle",
- options,
- id: create_fragment$d.name
- });
-
- const { ctx } = this.$$;
- const props = options.props || {};
-
- if (/*widget*/ ctx[0] === undefined && !('widget' in props)) {
- console.warn(" was created without expected prop 'widget'");
- }
-
- if (/*value*/ ctx[2] === undefined && !('value' in props)) {
- console.warn(" was created without expected prop 'value'");
- }
- }
-
- get widget() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set widget(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
-
- get value() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set value(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
-
- get wsPush() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set wsPush(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
- }
-
- /* src\widgets\Anydata.svelte generated by Svelte v3.46.4 */
-
- const file$c = "src\\widgets\\Anydata.svelte";
-
- function create_fragment$c(ctx) {
- let div2;
- let div0;
- let label0;
- let t0_value = (!/*widget*/ ctx[0].descr ? "" : /*widget*/ ctx[0].descr) + "";
- let t0;
- let t1;
- let div1;
- let label1;
-
- let t2_value = (!/*widget*/ ctx[0].status
- ? ""
- : /*widget*/ ctx[0].status) + "";
-
- let t2;
- let t3;
- let label2;
- let t4;
- let t5_value = (!/*widget*/ ctx[0].after ? "" : /*widget*/ ctx[0].after) + "";
- let t5;
-
- const block = {
- c: function create() {
- div2 = element("div");
- div0 = element("div");
- label0 = element("label");
- t0 = text(t0_value);
- t1 = space();
- div1 = element("div");
- label1 = element("label");
- t2 = text(t2_value);
- t3 = space();
- label2 = element("label");
- t4 = text(" ");
- t5 = text(t5_value);
- attr_dev(label0, "class", "wgt-dscr-stl");
- add_location(label0, file$c, 9, 4, 205);
- attr_dev(div0, "class", "wgt-dscr-w");
- add_location(div0, file$c, 7, 2, 113);
- attr_dev(label1, "class", "wgt-adt-stl");
- add_location(label1, file$c, 13, 4, 377);
- attr_dev(label2, "class", "wgt-adt-stl");
- add_location(label2, file$c, 15, 4, 517);
- attr_dev(div1, "class", "wgt-w");
- add_location(div1, file$c, 11, 2, 290);
- attr_dev(div2, "class", "crd-itm-psn");
- add_location(div2, file$c, 6, 0, 84);
- },
- 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, label0);
- append_dev(label0, t0);
- append_dev(div2, t1);
- append_dev(div2, div1);
- append_dev(div1, label1);
- append_dev(label1, t2);
- append_dev(div1, t3);
- append_dev(div1, label2);
- append_dev(label2, t4);
- append_dev(label2, t5);
- },
- p: function update(ctx, [dirty]) {
- if (dirty & /*widget*/ 1 && t0_value !== (t0_value = (!/*widget*/ ctx[0].descr ? "" : /*widget*/ ctx[0].descr) + "")) set_data_dev(t0, t0_value);
-
- if (dirty & /*widget*/ 1 && t2_value !== (t2_value = (!/*widget*/ ctx[0].status
- ? ""
- : /*widget*/ ctx[0].status) + "")) set_data_dev(t2, t2_value);
-
- if (dirty & /*widget*/ 1 && t5_value !== (t5_value = (!/*widget*/ ctx[0].after ? "" : /*widget*/ ctx[0].after) + "")) set_data_dev(t5, t5_value);
- },
- i: noop,
- o: noop,
- d: function destroy(detaching) {
- if (detaching) detach_dev(div2);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_fragment$c.name,
- type: "component",
- source: "",
- ctx
- });
-
- return block;
- }
-
- function instance$c($$self, $$props, $$invalidate) {
- let { $$slots: slots = {}, $$scope } = $$props;
- validate_slots('Anydata', slots, []);
- let { widget } = $$props;
- let { value } = $$props;
- value = value;
- const writable_props = ['widget', 'value'];
-
- Object.keys($$props).forEach(key => {
- if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(` was created with unknown prop '${key}'`);
- });
-
- $$self.$$set = $$props => {
- if ('widget' in $$props) $$invalidate(0, widget = $$props.widget);
- if ('value' in $$props) $$invalidate(1, value = $$props.value);
- };
-
- $$self.$capture_state = () => ({ widget, value });
-
- $$self.$inject_state = $$props => {
- if ('widget' in $$props) $$invalidate(0, widget = $$props.widget);
- if ('value' in $$props) $$invalidate(1, value = $$props.value);
- };
-
- if ($$props && "$$inject" in $$props) {
- $$self.$inject_state($$props.$$inject);
- }
-
- return [widget, value];
- }
-
- class Anydata extends SvelteComponentDev {
- constructor(options) {
- super(options);
- init(this, options, instance$c, create_fragment$c, safe_not_equal, { widget: 0, value: 1 });
-
- dispatch_dev("SvelteRegisterComponent", {
- component: this,
- tagName: "Anydata",
- options,
- id: create_fragment$c.name
- });
-
- const { ctx } = this.$$;
- const props = options.props || {};
-
- if (/*widget*/ ctx[0] === undefined && !('widget' in props)) {
- console.warn(" was created without expected prop 'widget'");
- }
-
- if (/*value*/ ctx[1] === undefined && !('value' in props)) {
- console.warn(" was created without expected prop 'value'");
- }
- }
-
- get widget() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set widget(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
-
- get value() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set value(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
- }
-
- /* src\pages\Dashboard.svelte generated by Svelte v3.46.4 */
- const file$b = "src\\pages\\Dashboard.svelte";
-
- function get_each_context$5(ctx, list, i) {
- const child_ctx = ctx.slice();
- child_ctx[8] = list[i];
- child_ctx[10] = i;
- return child_ctx;
- }
-
- function get_each_context_1$1(ctx, list, i) {
- const child_ctx = ctx.slice();
- child_ctx[11] = list[i];
- child_ctx[12] = list;
- child_ctx[10] = i;
- return child_ctx;
- }
-
- // (14:2) {#if layoutJson === []}
- function create_if_block_4(ctx) {
- let card;
- let current;
-
- card = new Card({
- props: {
- title: "Ваша панель управления пуста, вначале добавьте новые элементы в конфигураторе!"
- },
- $$inline: true
- });
-
- const block = {
- c: function create() {
- create_component(card.$$.fragment);
- },
- m: function mount(target, anchor) {
- mount_component(card, target, anchor);
- current = true;
- },
- i: function intro(local) {
- if (current) return;
- transition_in(card.$$.fragment, local);
- current = true;
- },
- o: function outro(local) {
- transition_out(card.$$.fragment, local);
- current = false;
- },
- d: function destroy(detaching) {
- destroy_component(card, detaching);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_if_block_4.name,
- type: "if",
- source: "(14:2) {#if layoutJson === []}",
- ctx
- });
-
- return block;
- }
-
- // (20:8) {#if widget.page === pagesName.page}
- function create_if_block$4(ctx) {
- let t0;
- let t1;
- let if_block2_anchor;
- let current;
- let if_block0 = /*widget*/ ctx[11].widget === "input" && create_if_block_3$1(ctx);
- let if_block1 = /*widget*/ ctx[11].widget === "toggle" && create_if_block_2$1(ctx);
- let if_block2 = /*widget*/ ctx[11].widget === "anydata" && create_if_block_1$1(ctx);
-
- const block = {
- c: function create() {
- if (if_block0) if_block0.c();
- t0 = space();
- if (if_block1) if_block1.c();
- t1 = space();
- if (if_block2) if_block2.c();
- if_block2_anchor = empty();
- },
- m: function mount(target, anchor) {
- if (if_block0) if_block0.m(target, anchor);
- insert_dev(target, t0, anchor);
- if (if_block1) if_block1.m(target, anchor);
- insert_dev(target, t1, anchor);
- if (if_block2) if_block2.m(target, anchor);
- insert_dev(target, if_block2_anchor, anchor);
- current = true;
- },
- p: function update(ctx, dirty) {
- if (/*widget*/ ctx[11].widget === "input") {
- if (if_block0) {
- if_block0.p(ctx, dirty);
-
- if (dirty & /*layoutJson*/ 1) {
- transition_in(if_block0, 1);
- }
- } else {
- if_block0 = create_if_block_3$1(ctx);
- if_block0.c();
- transition_in(if_block0, 1);
- if_block0.m(t0.parentNode, t0);
- }
- } else if (if_block0) {
- group_outros();
-
- transition_out(if_block0, 1, 1, () => {
- if_block0 = null;
- });
-
- check_outros();
- }
-
- if (/*widget*/ ctx[11].widget === "toggle") {
- if (if_block1) {
- if_block1.p(ctx, dirty);
-
- if (dirty & /*layoutJson*/ 1) {
- transition_in(if_block1, 1);
- }
- } else {
- if_block1 = create_if_block_2$1(ctx);
- if_block1.c();
- transition_in(if_block1, 1);
- if_block1.m(t1.parentNode, t1);
- }
- } else if (if_block1) {
- group_outros();
-
- transition_out(if_block1, 1, 1, () => {
- if_block1 = null;
- });
-
- check_outros();
- }
-
- if (/*widget*/ ctx[11].widget === "anydata") {
- if (if_block2) {
- if_block2.p(ctx, dirty);
-
- if (dirty & /*layoutJson*/ 1) {
- transition_in(if_block2, 1);
- }
- } else {
- if_block2 = create_if_block_1$1(ctx);
- if_block2.c();
- transition_in(if_block2, 1);
- if_block2.m(if_block2_anchor.parentNode, if_block2_anchor);
- }
- } else if (if_block2) {
- group_outros();
-
- transition_out(if_block2, 1, 1, () => {
- if_block2 = null;
- });
-
- check_outros();
- }
- },
- i: function intro(local) {
- if (current) return;
- transition_in(if_block0);
- transition_in(if_block1);
- transition_in(if_block2);
- current = true;
- },
- o: function outro(local) {
- transition_out(if_block0);
- transition_out(if_block1);
- transition_out(if_block2);
- current = false;
- },
- d: function destroy(detaching) {
- if (if_block0) if_block0.d(detaching);
- if (detaching) detach_dev(t0);
- if (if_block1) if_block1.d(detaching);
- if (detaching) detach_dev(t1);
- if (if_block2) if_block2.d(detaching);
- if (detaching) detach_dev(if_block2_anchor);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_if_block$4.name,
- type: "if",
- source: "(20:8) {#if widget.page === pagesName.page}",
- ctx
- });
-
- return block;
- }
-
- // (21:10) {#if widget.widget === "input"}
- function create_if_block_3$1(ctx) {
- let input;
- let updating_value;
- let current;
-
- function input_value_binding(value) {
- /*input_value_binding*/ ctx[4](value, /*widget*/ ctx[11]);
- }
-
- let input_props = {
- widget: /*widget*/ ctx[11],
- wsPush: /*func*/ ctx[3]
- };
-
- if (/*widget*/ ctx[11].status !== void 0) {
- input_props.value = /*widget*/ ctx[11].status;
- }
-
- input = new Input({ props: input_props, $$inline: true });
- binding_callbacks.push(() => bind(input, 'value', input_value_binding));
-
- const block = {
- c: function create() {
- create_component(input.$$.fragment);
- },
- m: function mount(target, anchor) {
- mount_component(input, target, anchor);
- current = true;
- },
- p: function update(new_ctx, dirty) {
- ctx = new_ctx;
- const input_changes = {};
- if (dirty & /*layoutJson*/ 1) input_changes.widget = /*widget*/ ctx[11];
- if (dirty & /*wsPush*/ 4) input_changes.wsPush = /*func*/ ctx[3];
-
- if (!updating_value && dirty & /*layoutJson*/ 1) {
- updating_value = true;
- input_changes.value = /*widget*/ ctx[11].status;
- add_flush_callback(() => updating_value = false);
- }
-
- input.$set(input_changes);
- },
- i: function intro(local) {
- if (current) return;
- transition_in(input.$$.fragment, local);
- current = true;
- },
- o: function outro(local) {
- transition_out(input.$$.fragment, local);
- current = false;
- },
- d: function destroy(detaching) {
- destroy_component(input, detaching);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_if_block_3$1.name,
- type: "if",
- source: "(21:10) {#if widget.widget === \\\"input\\\"}",
- ctx
- });
-
- return block;
- }
-
- // (24:10) {#if widget.widget === "toggle"}
- function create_if_block_2$1(ctx) {
- let toggle;
- let updating_value;
- let current;
-
- function toggle_value_binding(value) {
- /*toggle_value_binding*/ ctx[6](value, /*widget*/ ctx[11]);
- }
-
- let toggle_props = {
- widget: /*widget*/ ctx[11],
- wsPush: /*func_1*/ ctx[5]
- };
-
- if (/*widget*/ ctx[11].status !== void 0) {
- toggle_props.value = /*widget*/ ctx[11].status;
- }
-
- toggle = new Toggle({ props: toggle_props, $$inline: true });
- binding_callbacks.push(() => bind(toggle, 'value', toggle_value_binding));
-
- const block = {
- c: function create() {
- create_component(toggle.$$.fragment);
- },
- m: function mount(target, anchor) {
- mount_component(toggle, target, anchor);
- current = true;
- },
- p: function update(new_ctx, dirty) {
- ctx = new_ctx;
- const toggle_changes = {};
- if (dirty & /*layoutJson*/ 1) toggle_changes.widget = /*widget*/ ctx[11];
- if (dirty & /*wsPush*/ 4) toggle_changes.wsPush = /*func_1*/ ctx[5];
-
- if (!updating_value && dirty & /*layoutJson*/ 1) {
- updating_value = true;
- toggle_changes.value = /*widget*/ ctx[11].status;
- add_flush_callback(() => updating_value = false);
- }
-
- toggle.$set(toggle_changes);
- },
- i: function intro(local) {
- if (current) return;
- transition_in(toggle.$$.fragment, local);
- current = true;
- },
- o: function outro(local) {
- transition_out(toggle.$$.fragment, local);
- current = false;
- },
- d: function destroy(detaching) {
- destroy_component(toggle, detaching);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_if_block_2$1.name,
- type: "if",
- source: "(24:10) {#if widget.widget === \\\"toggle\\\"}",
- ctx
- });
-
- return block;
- }
-
- // (27:10) {#if widget.widget === "anydata"}
- function create_if_block_1$1(ctx) {
- let anydata;
- let updating_value;
- let current;
-
- function anydata_value_binding(value) {
- /*anydata_value_binding*/ ctx[7](value, /*widget*/ ctx[11]);
- }
-
- let anydata_props = { widget: /*widget*/ ctx[11] };
-
- if (/*widget*/ ctx[11].status !== void 0) {
- anydata_props.value = /*widget*/ ctx[11].status;
- }
-
- anydata = new Anydata({ props: anydata_props, $$inline: true });
- binding_callbacks.push(() => bind(anydata, 'value', anydata_value_binding));
-
- const block = {
- c: function create() {
- create_component(anydata.$$.fragment);
- },
- m: function mount(target, anchor) {
- mount_component(anydata, target, anchor);
- current = true;
- },
- p: function update(new_ctx, dirty) {
- ctx = new_ctx;
- const anydata_changes = {};
- if (dirty & /*layoutJson*/ 1) anydata_changes.widget = /*widget*/ ctx[11];
-
- if (!updating_value && dirty & /*layoutJson*/ 1) {
- updating_value = true;
- anydata_changes.value = /*widget*/ ctx[11].status;
- add_flush_callback(() => updating_value = false);
- }
-
- anydata.$set(anydata_changes);
- },
- i: function intro(local) {
- if (current) return;
- transition_in(anydata.$$.fragment, local);
- current = true;
- },
- o: function outro(local) {
- transition_out(anydata.$$.fragment, local);
- current = false;
- },
- d: function destroy(detaching) {
- destroy_component(anydata, detaching);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_if_block_1$1.name,
- type: "if",
- source: "(27:10) {#if widget.widget === \\\"anydata\\\"}",
- ctx
- });
-
- return block;
- }
-
- // (19:6) {#each layoutJson as widget, i}
- function create_each_block_1$1(ctx) {
- let if_block_anchor;
- let current;
- let if_block = /*widget*/ ctx[11].page === /*pagesName*/ ctx[8].page && create_if_block$4(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);
- current = true;
- },
- p: function update(ctx, dirty) {
- if (/*widget*/ ctx[11].page === /*pagesName*/ ctx[8].page) {
- if (if_block) {
- if_block.p(ctx, dirty);
-
- if (dirty & /*layoutJson, pages*/ 3) {
- transition_in(if_block, 1);
- }
- } else {
- if_block = create_if_block$4(ctx);
- if_block.c();
- transition_in(if_block, 1);
- if_block.m(if_block_anchor.parentNode, if_block_anchor);
- }
- } else if (if_block) {
- group_outros();
-
- transition_out(if_block, 1, 1, () => {
- if_block = null;
- });
-
- check_outros();
- }
- },
- i: function intro(local) {
- if (current) return;
- transition_in(if_block);
- current = true;
- },
- o: function outro(local) {
- transition_out(if_block);
- current = false;
- },
- d: function destroy(detaching) {
- if (if_block) if_block.d(detaching);
- if (detaching) detach_dev(if_block_anchor);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_each_block_1$1.name,
- type: "each",
- source: "(19:6) {#each layoutJson as widget, i}",
- ctx
- });
-
- return block;
- }
-
- // (18:4)
- function create_default_slot$7(ctx) {
- let t;
- let current;
- let each_value_1 = /*layoutJson*/ ctx[0];
- validate_each_argument(each_value_1);
- let each_blocks = [];
-
- for (let i = 0; i < each_value_1.length; i += 1) {
- each_blocks[i] = create_each_block_1$1(get_each_context_1$1(ctx, each_value_1, i));
- }
-
- const out = i => transition_out(each_blocks[i], 1, 1, () => {
- each_blocks[i] = null;
- });
-
- const block = {
- c: function create() {
- for (let i = 0; i < each_blocks.length; i += 1) {
- each_blocks[i].c();
- }
-
- t = space();
- },
- m: function mount(target, anchor) {
- for (let i = 0; i < each_blocks.length; i += 1) {
- each_blocks[i].m(target, anchor);
- }
-
- insert_dev(target, t, anchor);
- current = true;
- },
- p: function update(ctx, dirty) {
- if (dirty & /*layoutJson, wsPush, pages*/ 7) {
- each_value_1 = /*layoutJson*/ ctx[0];
- validate_each_argument(each_value_1);
- let i;
-
- for (i = 0; i < each_value_1.length; i += 1) {
- const child_ctx = get_each_context_1$1(ctx, each_value_1, i);
-
- if (each_blocks[i]) {
- each_blocks[i].p(child_ctx, dirty);
- transition_in(each_blocks[i], 1);
- } else {
- each_blocks[i] = create_each_block_1$1(child_ctx);
- each_blocks[i].c();
- transition_in(each_blocks[i], 1);
- each_blocks[i].m(t.parentNode, t);
- }
- }
-
- group_outros();
-
- for (i = each_value_1.length; i < each_blocks.length; i += 1) {
- out(i);
- }
-
- check_outros();
- }
- },
- i: function intro(local) {
- if (current) return;
-
- for (let i = 0; i < each_value_1.length; i += 1) {
- transition_in(each_blocks[i]);
- }
-
- current = true;
- },
- o: function outro(local) {
- each_blocks = each_blocks.filter(Boolean);
-
- for (let i = 0; i < each_blocks.length; i += 1) {
- transition_out(each_blocks[i]);
- }
-
- current = false;
- },
- d: function destroy(detaching) {
- destroy_each(each_blocks, detaching);
- if (detaching) detach_dev(t);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_default_slot$7.name,
- type: "slot",
- source: "(18:4) ",
- ctx
- });
-
- return block;
- }
-
- // (17:2) {#each pages as pagesName, i}
- function create_each_block$5(ctx) {
- let card;
- let current;
-
- card = new Card({
- props: {
- title: /*pagesName*/ ctx[8].page,
- $$slots: { default: [create_default_slot$7] },
- $$scope: { ctx }
- },
- $$inline: true
- });
-
- const block = {
- c: function create() {
- create_component(card.$$.fragment);
- },
- m: function mount(target, anchor) {
- mount_component(card, target, anchor);
- current = true;
- },
- p: function update(ctx, dirty) {
- const card_changes = {};
- if (dirty & /*pages*/ 2) card_changes.title = /*pagesName*/ ctx[8].page;
-
- if (dirty & /*$$scope, layoutJson, wsPush, pages*/ 8199) {
- card_changes.$$scope = { dirty, ctx };
- }
-
- card.$set(card_changes);
- },
- i: function intro(local) {
- if (current) return;
- transition_in(card.$$.fragment, local);
- current = true;
- },
- o: function outro(local) {
- transition_out(card.$$.fragment, local);
- current = false;
- },
- d: function destroy(detaching) {
- destroy_component(card, detaching);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_each_block$5.name,
- type: "each",
- source: "(17:2) {#each pages as pagesName, i}",
- ctx
- });
-
- return block;
- }
-
- function create_fragment$b(ctx) {
- let div;
- let t;
- let current;
- let if_block = /*layoutJson*/ ctx[0] === [] && create_if_block_4(ctx);
- let each_value = /*pages*/ ctx[1];
- validate_each_argument(each_value);
- let each_blocks = [];
-
- for (let i = 0; i < each_value.length; i += 1) {
- each_blocks[i] = create_each_block$5(get_each_context$5(ctx, each_value, i));
- }
-
- const out = i => transition_out(each_blocks[i], 1, 1, () => {
- each_blocks[i] = null;
- });
-
- const block = {
- c: function create() {
- div = element("div");
- if (if_block) if_block.c();
- t = space();
-
- for (let i = 0; i < each_blocks.length; i += 1) {
- each_blocks[i].c();
- }
-
- attr_dev(div, "class", "grd-3col1");
- add_location(div, file$b, 12, 0, 323);
- },
- 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);
- if (if_block) if_block.m(div, null);
- append_dev(div, t);
-
- for (let i = 0; i < each_blocks.length; i += 1) {
- each_blocks[i].m(div, null);
- }
-
- current = true;
- },
- p: function update(ctx, [dirty]) {
- if (/*layoutJson*/ ctx[0] === []) {
- if (if_block) {
- if (dirty & /*layoutJson*/ 1) {
- transition_in(if_block, 1);
- }
- } else {
- if_block = create_if_block_4(ctx);
- if_block.c();
- transition_in(if_block, 1);
- if_block.m(div, t);
- }
- } else if (if_block) {
- group_outros();
-
- transition_out(if_block, 1, 1, () => {
- if_block = null;
- });
-
- check_outros();
- }
-
- if (dirty & /*pages, layoutJson, wsPush*/ 7) {
- each_value = /*pages*/ ctx[1];
- validate_each_argument(each_value);
- let i;
-
- for (i = 0; i < each_value.length; i += 1) {
- const child_ctx = get_each_context$5(ctx, each_value, i);
-
- if (each_blocks[i]) {
- each_blocks[i].p(child_ctx, dirty);
- transition_in(each_blocks[i], 1);
- } else {
- each_blocks[i] = create_each_block$5(child_ctx);
- each_blocks[i].c();
- transition_in(each_blocks[i], 1);
- each_blocks[i].m(div, null);
- }
- }
-
- group_outros();
-
- for (i = each_value.length; i < each_blocks.length; i += 1) {
- out(i);
- }
-
- check_outros();
- }
- },
- i: function intro(local) {
- if (current) return;
- transition_in(if_block);
-
- for (let i = 0; i < each_value.length; i += 1) {
- transition_in(each_blocks[i]);
- }
-
- current = true;
- },
- o: function outro(local) {
- transition_out(if_block);
- each_blocks = each_blocks.filter(Boolean);
-
- for (let i = 0; i < each_blocks.length; i += 1) {
- transition_out(each_blocks[i]);
- }
-
- current = false;
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(div);
- if (if_block) if_block.d();
- destroy_each(each_blocks, detaching);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_fragment$b.name,
- type: "component",
- source: "",
- ctx
- });
-
- return block;
- }
-
- function instance$b($$self, $$props, $$invalidate) {
- let { $$slots: slots = {}, $$scope } = $$props;
- validate_slots('Dashboard', slots, []);
- let { layoutJson } = $$props;
- let { pages } = $$props;
-
- let { wsPush = (ws, topic, status) => {
-
- } } = $$props;
-
- const writable_props = ['layoutJson', 'pages', 'wsPush'];
-
- Object.keys($$props).forEach(key => {
- if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(` was created with unknown prop '${key}'`);
- });
-
- const func = (ws, topic, status) => wsPush(ws, topic, status);
-
- function input_value_binding(value, widget) {
- if ($$self.$$.not_equal(widget.status, value)) {
- widget.status = value;
- $$invalidate(0, layoutJson);
- }
- }
-
- const func_1 = (ws, topic, status) => wsPush(ws, topic, status);
-
- function toggle_value_binding(value, widget) {
- if ($$self.$$.not_equal(widget.status, value)) {
- widget.status = value;
- $$invalidate(0, layoutJson);
- }
- }
-
- function anydata_value_binding(value, widget) {
- if ($$self.$$.not_equal(widget.status, value)) {
- widget.status = value;
- $$invalidate(0, layoutJson);
- }
- }
-
- $$self.$$set = $$props => {
- if ('layoutJson' in $$props) $$invalidate(0, layoutJson = $$props.layoutJson);
- if ('pages' in $$props) $$invalidate(1, pages = $$props.pages);
- if ('wsPush' in $$props) $$invalidate(2, wsPush = $$props.wsPush);
- };
-
- $$self.$capture_state = () => ({
- Card,
- Input,
- Toggle,
- Anydata,
- layoutJson,
- pages,
- wsPush
- });
-
- $$self.$inject_state = $$props => {
- if ('layoutJson' in $$props) $$invalidate(0, layoutJson = $$props.layoutJson);
- if ('pages' in $$props) $$invalidate(1, pages = $$props.pages);
- if ('wsPush' in $$props) $$invalidate(2, wsPush = $$props.wsPush);
- };
-
- if ($$props && "$$inject" in $$props) {
- $$self.$inject_state($$props.$$inject);
- }
-
- return [
- layoutJson,
- pages,
- wsPush,
- func,
- input_value_binding,
- func_1,
- toggle_value_binding,
- anydata_value_binding
- ];
- }
-
- class Dashboard extends SvelteComponentDev {
- constructor(options) {
- super(options);
- init(this, options, instance$b, create_fragment$b, safe_not_equal, { layoutJson: 0, pages: 1, wsPush: 2 });
-
- dispatch_dev("SvelteRegisterComponent", {
- component: this,
- tagName: "Dashboard",
- options,
- id: create_fragment$b.name
- });
-
- const { ctx } = this.$$;
- const props = options.props || {};
-
- if (/*layoutJson*/ ctx[0] === undefined && !('layoutJson' in props)) {
- console.warn(" was created without expected prop 'layoutJson'");
- }
-
- if (/*pages*/ ctx[1] === undefined && !('pages' in props)) {
- console.warn(" was created without expected prop 'pages'");
- }
- }
-
- get layoutJson() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set layoutJson(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
-
- get pages() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set pages(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
-
- get wsPush() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set wsPush(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
- }
-
- /* src\svg\Cross.svelte generated by Svelte v3.46.4 */
-
- const file$a = "src\\svg\\Cross.svelte";
-
- function create_fragment$a(ctx) {
- let svg;
- let line0;
- let line1;
- let mounted;
- let dispose;
-
- const block = {
- c: function create() {
- svg = svg_element("svg");
- line0 = svg_element("line");
- line1 = svg_element("line");
- attr_dev(line0, "x1", "18");
- attr_dev(line0, "y1", "6");
- attr_dev(line0, "x2", "6");
- attr_dev(line0, "y2", "18");
- add_location(line0, file$a, 5, 188, 261);
- attr_dev(line1, "x1", "6");
- attr_dev(line1, "y1", "6");
- attr_dev(line1, "x2", "18");
- attr_dev(line1, "y2", "18");
- add_location(line1, file$a, 5, 227, 300);
- attr_dev(svg, "class", "h-6 w-6 text-red-400 cursor-pointer");
- attr_dev(svg, "viewBox", "0 0 24 24");
- attr_dev(svg, "fill", "none");
- attr_dev(svg, "stroke", "currentColor");
- attr_dev(svg, "stroke-width", "2");
- attr_dev(svg, "stroke-linecap", "round");
- attr_dev(svg, "stroke-linejoin", "round");
- add_location(svg, file$a, 5, 0, 73);
- },
- 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, svg, anchor);
- append_dev(svg, line0);
- append_dev(svg, line1);
-
- if (!mounted) {
- dispose = listen_dev(
- svg,
- "click",
- function () {
- if (is_function(/*click*/ ctx[1](/*i*/ ctx[0]))) /*click*/ ctx[1](/*i*/ ctx[0]).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(svg);
- mounted = false;
- dispose();
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_fragment$a.name,
- type: "component",
- source: "",
- ctx
- });
-
- return block;
- }
-
- function instance$a($$self, $$props, $$invalidate) {
- let { $$slots: slots = {}, $$scope } = $$props;
- validate_slots('Cross', slots, []);
- let { i } = $$props;
-
- let { click = i => {
-
- } } = $$props;
-
- const writable_props = ['i', 'click'];
-
- Object.keys($$props).forEach(key => {
- if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(` was created with unknown prop '${key}'`);
- });
-
- $$self.$$set = $$props => {
- if ('i' in $$props) $$invalidate(0, i = $$props.i);
- if ('click' in $$props) $$invalidate(1, click = $$props.click);
- };
-
- $$self.$capture_state = () => ({ i, click });
-
- $$self.$inject_state = $$props => {
- if ('i' in $$props) $$invalidate(0, i = $$props.i);
- if ('click' in $$props) $$invalidate(1, click = $$props.click);
- };
-
- if ($$props && "$$inject" in $$props) {
- $$self.$inject_state($$props.$$inject);
- }
-
- return [i, click];
- }
-
- class Cross extends SvelteComponentDev {
- constructor(options) {
- super(options);
- init(this, options, instance$a, create_fragment$a, safe_not_equal, { i: 0, click: 1 });
-
- dispatch_dev("SvelteRegisterComponent", {
- component: this,
- tagName: "Cross",
- options,
- id: create_fragment$a.name
- });
-
- const { ctx } = this.$$;
- const props = options.props || {};
-
- if (/*i*/ ctx[0] === undefined && !('i' in props)) {
- console.warn(" was created without expected prop 'i'");
- }
- }
-
- get i() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set i(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
-
- get click() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set click(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
- }
-
- /* src\svg\Open.svelte generated by Svelte v3.46.4 */
-
- const file$9 = "src\\svg\\Open.svelte";
-
- function create_fragment$9(ctx) {
- let svg;
- let path;
- let circle0;
- let circle1;
- let circle2;
- let mounted;
- let dispose;
-
- const block = {
- c: function create() {
- svg = svg_element("svg");
- path = svg_element("path");
- circle0 = svg_element("circle");
- circle1 = svg_element("circle");
- circle2 = svg_element("circle");
- attr_dev(path, "stroke", "none");
- attr_dev(path, "d", "M0 0h24v24H0z");
- add_location(path, file$9, 4, 212, 267);
- attr_dev(circle0, "cx", "5");
- attr_dev(circle0, "cy", "12");
- attr_dev(circle0, "r", "1");
- add_location(circle0, file$9, 4, 253, 308);
- attr_dev(circle1, "cx", "12");
- attr_dev(circle1, "cy", "12");
- attr_dev(circle1, "r", "1");
- add_location(circle1, file$9, 4, 285, 340);
- attr_dev(circle2, "cx", "19");
- attr_dev(circle2, "cy", "12");
- attr_dev(circle2, "r", "1");
- add_location(circle2, file$9, 4, 318, 373);
- attr_dev(svg, "class", "h-6 w-6 text-green-400 cursor-pointer");
- attr_dev(svg, "width", "24");
- attr_dev(svg, "height", "24");
- attr_dev(svg, "viewBox", "0 0 24 24");
- attr_dev(svg, "stroke-width", "2");
- attr_dev(svg, "stroke", "currentColor");
- attr_dev(svg, "fill", "none");
- attr_dev(svg, "stroke-linecap", "round");
- attr_dev(svg, "stroke-linejoin", "round");
- add_location(svg, file$9, 4, 0, 55);
- },
- 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, svg, anchor);
- append_dev(svg, path);
- append_dev(svg, circle0);
- append_dev(svg, circle1);
- append_dev(svg, circle2);
-
- if (!mounted) {
- dispose = listen_dev(
- svg,
- "click",
- function () {
- if (is_function(/*click*/ ctx[0]())) /*click*/ ctx[0]().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(svg);
- mounted = false;
- dispose();
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_fragment$9.name,
- type: "component",
- source: "",
- ctx
- });
-
- return block;
- }
-
- function instance$9($$self, $$props, $$invalidate) {
- let { $$slots: slots = {}, $$scope } = $$props;
- validate_slots('Open', slots, []);
-
- let { click = () => {
-
- } } = $$props;
-
- const writable_props = ['click'];
-
- Object.keys($$props).forEach(key => {
- if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(` was created with unknown prop '${key}'`);
- });
-
- $$self.$$set = $$props => {
- if ('click' in $$props) $$invalidate(0, click = $$props.click);
- };
-
- $$self.$capture_state = () => ({ click });
-
- $$self.$inject_state = $$props => {
- if ('click' in $$props) $$invalidate(0, click = $$props.click);
- };
-
- if ($$props && "$$inject" in $$props) {
- $$self.$inject_state($$props.$$inject);
- }
-
- return [click];
- }
-
- class Open extends SvelteComponentDev {
- constructor(options) {
- super(options);
- init(this, options, instance$9, create_fragment$9, safe_not_equal, { click: 0 });
-
- dispatch_dev("SvelteRegisterComponent", {
- component: this,
- tagName: "Open",
- options,
- id: create_fragment$9.name
- });
- }
-
- get click() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set click(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
- }
-
- /* src\pages\Config.svelte generated by Svelte v3.46.4 */
-
- const { Object: Object_1$2, console: console_1$3 } = globals;
- const file$8 = "src\\pages\\Config.svelte";
-
- function get_each_context$4(ctx, list, i) {
- const child_ctx = ctx.slice();
- child_ctx[19] = list[i];
- child_ctx[20] = list;
- child_ctx[21] = i;
- return child_ctx;
- }
-
- function get_each_context_1(ctx, list, i) {
- const child_ctx = ctx.slice();
- child_ctx[22] = list[i][0];
- child_ctx[23] = list[i][1];
- child_ctx[24] = list;
- child_ctx[25] = i;
- return child_ctx;
- }
-
- function get_each_context_2(ctx, list, i) {
- const child_ctx = ctx.slice();
- child_ctx[26] = list[i];
- return child_ctx;
- }
-
- function get_each_context_3(ctx, list, i) {
- const child_ctx = ctx.slice();
- child_ctx[29] = list[i];
- return child_ctx;
- }
-
- // (50:10) {#if item.header}
- function create_if_block_3(ctx) {
- let optgroup;
- let optgroup_label_value;
-
- const block = {
- c: function create() {
- optgroup = element("optgroup");
- attr_dev(optgroup, "label", optgroup_label_value = /*item*/ ctx[29].header);
- add_location(optgroup, file$8, 50, 12, 1426);
- },
- m: function mount(target, anchor) {
- insert_dev(target, optgroup, anchor);
- },
- p: function update(ctx, dirty) {
- if (dirty[0] & /*itemsJson*/ 4 && optgroup_label_value !== (optgroup_label_value = /*item*/ ctx[29].header)) {
- attr_dev(optgroup, "label", optgroup_label_value);
- }
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(optgroup);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_if_block_3.name,
- type: "if",
- source: "(50:10) {#if item.header}",
- ctx
- });
-
- return block;
- }
-
- // (53:10) {#if !item.header}
- function create_if_block_2(ctx) {
- let option;
- let t0_value = /*item*/ ctx[29].name + "";
- let t0;
- let t1;
- let option_value_value;
-
- const block = {
- c: function create() {
- option = element("option");
- t0 = text(t0_value);
- t1 = space();
- option.__value = option_value_value = /*item*/ ctx[29].num;
- option.value = option.__value;
- add_location(option, file$8, 53, 12, 1519);
- },
- m: function mount(target, anchor) {
- insert_dev(target, option, anchor);
- append_dev(option, t0);
- append_dev(option, t1);
- },
- p: function update(ctx, dirty) {
- if (dirty[0] & /*itemsJson*/ 4 && t0_value !== (t0_value = /*item*/ ctx[29].name + "")) set_data_dev(t0, t0_value);
-
- if (dirty[0] & /*itemsJson*/ 4 && option_value_value !== (option_value_value = /*item*/ ctx[29].num)) {
- prop_dev(option, "__value", option_value_value);
- option.value = option.__value;
- }
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(option);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_if_block_2.name,
- type: "if",
- source: "(53:10) {#if !item.header}",
- ctx
- });
-
- return block;
- }
-
- // (49:8) {#each itemsJson as item}
- function create_each_block_3(ctx) {
- let if_block0_anchor;
- let if_block1_anchor;
- let if_block0 = /*item*/ ctx[29].header && create_if_block_3(ctx);
- let if_block1 = !/*item*/ ctx[29].header && create_if_block_2(ctx);
-
- const block = {
- c: function create() {
- if (if_block0) if_block0.c();
- if_block0_anchor = empty();
- if (if_block1) if_block1.c();
- if_block1_anchor = empty();
- },
- m: function mount(target, anchor) {
- if (if_block0) if_block0.m(target, anchor);
- insert_dev(target, if_block0_anchor, anchor);
- if (if_block1) if_block1.m(target, anchor);
- insert_dev(target, if_block1_anchor, anchor);
- },
- p: function update(ctx, dirty) {
- if (/*item*/ ctx[29].header) {
- if (if_block0) {
- if_block0.p(ctx, dirty);
- } else {
- if_block0 = create_if_block_3(ctx);
- if_block0.c();
- if_block0.m(if_block0_anchor.parentNode, if_block0_anchor);
- }
- } else if (if_block0) {
- if_block0.d(1);
- if_block0 = null;
- }
-
- if (!/*item*/ ctx[29].header) {
- if (if_block1) {
- if_block1.p(ctx, dirty);
- } else {
- if_block1 = create_if_block_2(ctx);
- if_block1.c();
- if_block1.m(if_block1_anchor.parentNode, if_block1_anchor);
- }
- } else if (if_block1) {
- if_block1.d(1);
- if_block1 = null;
- }
- },
- d: function destroy(detaching) {
- if (if_block0) if_block0.d(detaching);
- if (detaching) detach_dev(if_block0_anchor);
- if (if_block1) if_block1.d(detaching);
- if (detaching) detach_dev(if_block1_anchor);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_each_block_3.name,
- type: "each",
- source: "(49:8) {#each itemsJson as item}",
- ctx
- });
-
- return block;
- }
-
- // (81:16) {#each widgetsJson as select}
- function create_each_block_2(ctx) {
- let option;
- let t0_value = /*select*/ ctx[26].label + "";
- let t0;
- let t1;
- let option_value_value;
-
- const block = {
- c: function create() {
- option = element("option");
- t0 = text(t0_value);
- t1 = space();
- option.__value = option_value_value = /*select*/ ctx[26].name;
- option.value = option.__value;
- add_location(option, file$8, 81, 18, 2614);
- },
- m: function mount(target, anchor) {
- insert_dev(target, option, anchor);
- append_dev(option, t0);
- append_dev(option, t1);
- },
- p: function update(ctx, dirty) {
- if (dirty[0] & /*widgetsJson*/ 2 && t0_value !== (t0_value = /*select*/ ctx[26].label + "")) set_data_dev(t0, t0_value);
-
- if (dirty[0] & /*widgetsJson*/ 2 && option_value_value !== (option_value_value = /*select*/ ctx[26].name)) {
- prop_dev(option, "__value", option_value_value);
- option.value = option.__value;
- }
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(option);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_each_block_2.name,
- type: "each",
- source: "(81:16) {#each widgetsJson as select}",
- ctx
- });
-
- return block;
- }
-
- // (92:10) {#if !hideAllSubParams}
- function create_if_block$3(ctx) {
- let t;
- let each_value_1 = Object.entries(/*element*/ ctx[19]);
- validate_each_argument(each_value_1);
- let each_blocks = [];
-
- for (let i = 0; i < each_value_1.length; i += 1) {
- each_blocks[i] = create_each_block_1(get_each_context_1(ctx, each_value_1, i));
- }
-
- const block = {
- c: function create() {
- for (let i = 0; i < each_blocks.length; i += 1) {
- each_blocks[i].c();
- }
-
- t = space();
- },
- m: function mount(target, anchor) {
- for (let i = 0; i < each_blocks.length; i += 1) {
- each_blocks[i].m(target, anchor);
- }
-
- insert_dev(target, t, anchor);
- },
- p: function update(ctx, dirty) {
- if (dirty[0] & /*configJson*/ 1) {
- each_value_1 = Object.entries(/*element*/ ctx[19]);
- validate_each_argument(each_value_1);
- let i;
-
- for (i = 0; i < each_value_1.length; i += 1) {
- const child_ctx = get_each_context_1(ctx, each_value_1, i);
-
- if (each_blocks[i]) {
- each_blocks[i].p(child_ctx, dirty);
- } else {
- each_blocks[i] = create_each_block_1(child_ctx);
- each_blocks[i].c();
- each_blocks[i].m(t.parentNode, t);
- }
- }
-
- for (; i < each_blocks.length; i += 1) {
- each_blocks[i].d(1);
- }
-
- each_blocks.length = each_value_1.length;
- }
- },
- d: function destroy(detaching) {
- destroy_each(each_blocks, detaching);
- if (detaching) detach_dev(t);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_if_block$3.name,
- type: "if",
- source: "(92:10) {#if !hideAllSubParams}",
- ctx
- });
-
- return block;
- }
-
- // (94:14) {#if key != "type" && key != "subtype" && key != "id" && key != "widget" && key != "page" && key != "descr"}
- function create_if_block_1(ctx) {
- let tr;
- let td0;
- let t0;
- let td1;
- let t1;
- let td2;
- let t2;
- let td3;
- let p;
- let t3_value = /*key*/ ctx[22] + "";
- let t3;
- let t4;
- let td4;
- let input;
- let mounted;
- let dispose;
-
- function input_input_handler() {
- /*input_input_handler*/ ctx[16].call(input, /*key*/ ctx[22], /*each_value*/ ctx[20], /*i*/ ctx[21]);
- }
-
- const block = {
- c: function create() {
- tr = element("tr");
- td0 = element("td");
- t0 = space();
- td1 = element("td");
- t1 = space();
- td2 = element("td");
- t2 = space();
- td3 = element("td");
- p = element("p");
- t3 = text(t3_value);
- t4 = space();
- td4 = element("td");
- input = element("input");
- add_location(td0, file$8, 95, 18, 3494);
- add_location(td1, file$8, 96, 18, 3520);
- add_location(td2, file$8, 97, 18, 3546);
- attr_dev(p, "class", "txt-ita");
- add_location(p, file$8, 99, 20, 3628);
- attr_dev(td3, "class", "tbl-bdy-sm text-right");
- add_location(td3, file$8, 98, 18, 3572);
- attr_dev(input, "class", "ipt-sm w-full");
- attr_dev(input, "type", "text");
- add_location(input, file$8, 102, 20, 3758);
- attr_dev(td4, "class", "tbl-bdy-sm text-center");
- add_location(td4, file$8, 101, 18, 3701);
- attr_dev(tr, "class", "txt-sz txt-pad");
- add_location(tr, file$8, 94, 16, 3447);
- },
- m: function mount(target, anchor) {
- insert_dev(target, tr, anchor);
- append_dev(tr, td0);
- append_dev(tr, t0);
- append_dev(tr, td1);
- append_dev(tr, t1);
- append_dev(tr, td2);
- append_dev(tr, t2);
- append_dev(tr, td3);
- append_dev(td3, p);
- append_dev(p, t3);
- append_dev(tr, t4);
- append_dev(tr, td4);
- append_dev(td4, input);
- set_input_value(input, /*element*/ ctx[19][/*key*/ ctx[22]]);
-
- if (!mounted) {
- dispose = listen_dev(input, "input", input_input_handler);
- mounted = true;
- }
- },
- p: function update(new_ctx, dirty) {
- ctx = new_ctx;
- if (dirty[0] & /*configJson*/ 1 && t3_value !== (t3_value = /*key*/ ctx[22] + "")) set_data_dev(t3, t3_value);
-
- if (dirty[0] & /*configJson, widgetsJson*/ 3 && input.value !== /*element*/ ctx[19][/*key*/ ctx[22]]) {
- set_input_value(input, /*element*/ ctx[19][/*key*/ ctx[22]]);
- }
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(tr);
- mounted = false;
- dispose();
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_if_block_1.name,
- type: "if",
- source: "(94:14) {#if key != \\\"type\\\" && key != \\\"subtype\\\" && key != \\\"id\\\" && key != \\\"widget\\\" && key != \\\"page\\\" && key != \\\"descr\\\"}",
- ctx
- });
-
- return block;
- }
-
- // (93:12) {#each Object.entries(element) as [key, param]}
- function create_each_block_1(ctx) {
- let if_block_anchor;
- let if_block = /*key*/ ctx[22] != "type" && /*key*/ ctx[22] != "subtype" && /*key*/ ctx[22] != "id" && /*key*/ ctx[22] != "widget" && /*key*/ ctx[22] != "page" && /*key*/ ctx[22] != "descr" && create_if_block_1(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 (/*key*/ ctx[22] != "type" && /*key*/ ctx[22] != "subtype" && /*key*/ ctx[22] != "id" && /*key*/ ctx[22] != "widget" && /*key*/ ctx[22] != "page" && /*key*/ ctx[22] != "descr") {
- if (if_block) {
- if_block.p(ctx, dirty);
- } else {
- if_block = create_if_block_1(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_each_block_1.name,
- type: "each",
- source: "(93:12) {#each Object.entries(element) as [key, param]}",
- ctx
- });
-
- return block;
- }
-
- // (75:8) {#each configJson as element, i}
- function create_each_block$4(ctx) {
- let tr;
- let td0;
- let t0_value = /*element*/ ctx[19].subtype + "";
- let t0;
- let t1;
- let td1;
- let input0;
- let t2;
- let td2;
- let select;
- let t3;
- let td3;
- let input1;
- let t4;
- let td4;
- let input2;
- let t5;
- let td5;
- let openicon;
- let t6;
- let td6;
- let crossicon;
- let t7;
- let if_block_anchor;
- let current;
- let mounted;
- let dispose;
-
- function input0_input_handler() {
- /*input0_input_handler*/ ctx[10].call(input0, /*each_value*/ ctx[20], /*i*/ ctx[21]);
- }
-
- let each_value_2 = /*widgetsJson*/ ctx[1];
- validate_each_argument(each_value_2);
- let each_blocks = [];
-
- for (let i = 0; i < each_value_2.length; i += 1) {
- each_blocks[i] = create_each_block_2(get_each_context_2(ctx, each_value_2, i));
- }
-
- function select_change_handler() {
- /*select_change_handler*/ ctx[11].call(select, /*each_value*/ ctx[20], /*i*/ ctx[21]);
- }
-
- function input1_input_handler() {
- /*input1_input_handler*/ ctx[12].call(input1, /*each_value*/ ctx[20], /*i*/ ctx[21]);
- }
-
- function input2_input_handler() {
- /*input2_input_handler*/ ctx[13].call(input2, /*each_value*/ ctx[20], /*i*/ ctx[21]);
- }
-
- openicon = new Open({
- props: { click: /*func*/ ctx[14] },
- $$inline: true
- });
-
- crossicon = new Cross({
- props: {
- i: /*i*/ ctx[21],
- click: /*func_1*/ ctx[15]
- },
- $$inline: true
- });
-
- let if_block = !/*hideAllSubParams*/ ctx[5] && create_if_block$3(ctx);
-
- const block = {
- c: function create() {
- tr = element("tr");
- td0 = element("td");
- t0 = text(t0_value);
- t1 = space();
- td1 = element("td");
- input0 = element("input");
- t2 = space();
- td2 = element("td");
- select = element("select");
-
- for (let i = 0; i < each_blocks.length; i += 1) {
- each_blocks[i].c();
- }
-
- t3 = space();
- td3 = element("td");
- input1 = element("input");
- t4 = space();
- td4 = element("td");
- input2 = element("input");
- t5 = space();
- td5 = element("td");
- create_component(openicon.$$.fragment);
- t6 = space();
- td6 = element("td");
- create_component(crossicon.$$.fragment);
- t7 = space();
- if (if_block) if_block.c();
- if_block_anchor = empty();
- attr_dev(td0, "class", "tbl-bdy-lg");
- add_location(td0, file$8, 76, 12, 2282);
- attr_dev(input0, "class", "ipt-lg w-full");
- attr_dev(input0, "type", "text");
- add_location(input0, file$8, 77, 35, 2364);
- attr_dev(td1, "class", "tbl-bdy-lg");
- add_location(td1, file$8, 77, 12, 2341);
- attr_dev(select, "class", "ipt-lg w-full");
- if (/*element*/ ctx[19].widget === void 0) add_render_callback(select_change_handler);
- add_location(select, file$8, 79, 15, 2489);
- attr_dev(td2, "class", "tbl-bdy-lg");
- add_location(td2, file$8, 78, 12, 2450);
- attr_dev(input1, "class", "ipt-lg w-full");
- attr_dev(input1, "type", "text");
- add_location(input1, file$8, 86, 35, 2799);
- attr_dev(td3, "class", "tbl-bdy-lg");
- add_location(td3, file$8, 86, 12, 2776);
- attr_dev(input2, "class", "ipt-lg w-full");
- attr_dev(input2, "type", "text");
- add_location(input2, file$8, 87, 35, 2910);
- attr_dev(td4, "class", "tbl-bdy-lg");
- add_location(td4, file$8, 87, 12, 2887);
- attr_dev(td5, "class", "tbl-bdy-lg");
- add_location(td5, file$8, 88, 12, 2999);
- attr_dev(td6, "class", "tbl-bdy-lg");
- add_location(td6, file$8, 89, 12, 3106);
- attr_dev(tr, "class", "txt-sz txt-pad align-middle");
- add_location(tr, file$8, 75, 10, 2228);
- },
- m: function mount(target, anchor) {
- insert_dev(target, tr, anchor);
- append_dev(tr, td0);
- append_dev(td0, t0);
- append_dev(tr, t1);
- append_dev(tr, td1);
- append_dev(td1, input0);
- set_input_value(input0, /*element*/ ctx[19].id);
- append_dev(tr, t2);
- append_dev(tr, td2);
- append_dev(td2, select);
-
- for (let i = 0; i < each_blocks.length; i += 1) {
- each_blocks[i].m(select, null);
- }
-
- select_option(select, /*element*/ ctx[19].widget);
- append_dev(tr, t3);
- append_dev(tr, td3);
- append_dev(td3, input1);
- set_input_value(input1, /*element*/ ctx[19].page);
- append_dev(tr, t4);
- append_dev(tr, td4);
- append_dev(td4, input2);
- set_input_value(input2, /*element*/ ctx[19].descr);
- append_dev(tr, t5);
- append_dev(tr, td5);
- mount_component(openicon, td5, null);
- append_dev(tr, t6);
- append_dev(tr, td6);
- mount_component(crossicon, td6, null);
- insert_dev(target, t7, anchor);
- if (if_block) if_block.m(target, anchor);
- insert_dev(target, if_block_anchor, anchor);
- current = true;
-
- if (!mounted) {
- dispose = [
- listen_dev(input0, "input", input0_input_handler),
- listen_dev(select, "change", select_change_handler),
- listen_dev(input1, "input", input1_input_handler),
- listen_dev(input2, "input", input2_input_handler)
- ];
-
- mounted = true;
- }
- },
- p: function update(new_ctx, dirty) {
- ctx = new_ctx;
- if ((!current || dirty[0] & /*configJson*/ 1) && t0_value !== (t0_value = /*element*/ ctx[19].subtype + "")) set_data_dev(t0, t0_value);
-
- if (dirty[0] & /*configJson, widgetsJson*/ 3 && input0.value !== /*element*/ ctx[19].id) {
- set_input_value(input0, /*element*/ ctx[19].id);
- }
-
- if (dirty[0] & /*widgetsJson*/ 2) {
- each_value_2 = /*widgetsJson*/ ctx[1];
- validate_each_argument(each_value_2);
- let i;
-
- for (i = 0; i < each_value_2.length; i += 1) {
- const child_ctx = get_each_context_2(ctx, each_value_2, i);
-
- if (each_blocks[i]) {
- each_blocks[i].p(child_ctx, dirty);
- } else {
- each_blocks[i] = create_each_block_2(child_ctx);
- each_blocks[i].c();
- each_blocks[i].m(select, null);
- }
- }
-
- for (; i < each_blocks.length; i += 1) {
- each_blocks[i].d(1);
- }
-
- each_blocks.length = each_value_2.length;
- }
-
- if (dirty[0] & /*configJson, widgetsJson*/ 3) {
- select_option(select, /*element*/ ctx[19].widget);
- }
-
- if (dirty[0] & /*configJson, widgetsJson*/ 3 && input1.value !== /*element*/ ctx[19].page) {
- set_input_value(input1, /*element*/ ctx[19].page);
- }
-
- if (dirty[0] & /*configJson, widgetsJson*/ 3 && input2.value !== /*element*/ ctx[19].descr) {
- set_input_value(input2, /*element*/ ctx[19].descr);
- }
-
- const openicon_changes = {};
- if (dirty[0] & /*hideAllSubParams*/ 32) openicon_changes.click = /*func*/ ctx[14];
- openicon.$set(openicon_changes);
-
- if (!/*hideAllSubParams*/ ctx[5]) {
- if (if_block) {
- if_block.p(ctx, dirty);
- } else {
- if_block = create_if_block$3(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: function intro(local) {
- if (current) return;
- transition_in(openicon.$$.fragment, local);
- transition_in(crossicon.$$.fragment, local);
- current = true;
- },
- o: function outro(local) {
- transition_out(openicon.$$.fragment, local);
- transition_out(crossicon.$$.fragment, local);
- current = false;
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(tr);
- destroy_each(each_blocks, detaching);
- destroy_component(openicon);
- destroy_component(crossicon);
- if (detaching) detach_dev(t7);
- if (if_block) if_block.d(detaching);
- if (detaching) detach_dev(if_block_anchor);
- mounted = false;
- run_all(dispose);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_each_block$4.name,
- type: "each",
- source: "(75:8) {#each configJson as element, i}",
- ctx
- });
-
- return block;
- }
-
- // (46:2)
- function create_default_slot$6(ctx) {
- let div;
- let select0;
- let t0;
- let select1;
- let option;
- let t2;
- let table;
- let thead;
- let tr;
- let th0;
- let t4;
- let th1;
- let t6;
- let th2;
- let t8;
- let th3;
- let t10;
- let th4;
- let t12;
- let th5;
- let t13;
- let th6;
- let t14;
- let tbody;
- let t15;
- let button;
- let current;
- let mounted;
- let dispose;
- let each_value_3 = /*itemsJson*/ ctx[2];
- validate_each_argument(each_value_3);
- let each_blocks_1 = [];
-
- for (let i = 0; i < each_value_3.length; i += 1) {
- each_blocks_1[i] = create_each_block_3(get_each_context_3(ctx, each_value_3, i));
- }
-
- let each_value = /*configJson*/ 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$4(get_each_context$4(ctx, each_value, i));
- }
-
- const out = i => transition_out(each_blocks[i], 1, 1, () => {
- each_blocks[i] = null;
- });
-
- const block = {
- c: function create() {
- div = element("div");
- select0 = element("select");
-
- for (let i = 0; i < each_blocks_1.length; i += 1) {
- each_blocks_1[i].c();
- }
-
- t0 = space();
- select1 = element("select");
- option = element("option");
- option.textContent = `${"Выберите пресет"}`;
- t2 = space();
- table = element("table");
- thead = element("thead");
- tr = element("tr");
- th0 = element("th");
- th0.textContent = "Тип";
- t4 = space();
- th1 = element("th");
- th1.textContent = "Id";
- t6 = space();
- th2 = element("th");
- th2.textContent = "Виджет";
- t8 = space();
- th3 = element("th");
- th3.textContent = "Вкладка";
- t10 = space();
- th4 = element("th");
- th4.textContent = "Название";
- t12 = space();
- th5 = element("th");
- t13 = space();
- th6 = element("th");
- t14 = space();
- tbody = element("tbody");
-
- for (let i = 0; i < each_blocks.length; i += 1) {
- each_blocks[i].c();
- }
-
- t15 = space();
- button = element("button");
- button.textContent = `${"Сохранить"}`;
- attr_dev(select0, "class", "slct-lg");
- if (/*itemsJsonBind*/ ctx[4] === void 0) add_render_callback(() => /*select0_change_handler*/ ctx[8].call(select0));
- add_location(select0, file$8, 47, 6, 1254);
- option.__value = "Выберите пресет";
- option.value = option.__value;
- add_location(option, file$8, 59, 30, 1677);
- attr_dev(select1, "class", "slct-lg");
- add_location(select1, file$8, 59, 6, 1653);
- attr_dev(div, "class", "grd-2col2");
- add_location(div, file$8, 46, 4, 1223);
- attr_dev(th0, "class", "tbl-hd");
- add_location(th0, file$8, 64, 10, 1843);
- attr_dev(th1, "class", "tbl-hd");
- add_location(th1, file$8, 65, 10, 1882);
- attr_dev(th2, "class", "tbl-hd");
- add_location(th2, file$8, 66, 10, 1920);
- attr_dev(th3, "class", "tbl-hd");
- add_location(th3, file$8, 67, 10, 1962);
- attr_dev(th4, "class", "tbl-hd");
- add_location(th4, file$8, 68, 10, 2005);
- attr_dev(th5, "class", "tbl-hd w-7");
- add_location(th5, file$8, 69, 10, 2049);
- attr_dev(th6, "class", "tbl-hd w-7");
- add_location(th6, file$8, 70, 10, 2086);
- attr_dev(tr, "class", "txt-sz txt-pad");
- add_location(tr, file$8, 63, 8, 1804);
- attr_dev(thead, "class", "bg-gray-100");
- add_location(thead, file$8, 62, 6, 1767);
- attr_dev(tbody, "class", "bg-white");
- add_location(tbody, file$8, 73, 6, 2150);
- attr_dev(table, "class", "tbl");
- add_location(table, file$8, 61, 4, 1740);
- attr_dev(button, "class", "btn-lg");
- add_location(button, file$8, 112, 4, 4014);
- },
- m: function mount(target, anchor) {
- insert_dev(target, div, anchor);
- append_dev(div, select0);
-
- for (let i = 0; i < each_blocks_1.length; i += 1) {
- each_blocks_1[i].m(select0, null);
- }
-
- select_option(select0, /*itemsJsonBind*/ ctx[4]);
- append_dev(div, t0);
- append_dev(div, select1);
- append_dev(select1, option);
- insert_dev(target, t2, anchor);
- insert_dev(target, table, anchor);
- append_dev(table, thead);
- append_dev(thead, tr);
- append_dev(tr, th0);
- append_dev(tr, t4);
- append_dev(tr, th1);
- append_dev(tr, t6);
- append_dev(tr, th2);
- append_dev(tr, t8);
- append_dev(tr, th3);
- append_dev(tr, t10);
- append_dev(tr, th4);
- append_dev(tr, t12);
- append_dev(tr, th5);
- append_dev(tr, t13);
- append_dev(tr, th6);
- append_dev(table, t14);
- append_dev(table, tbody);
-
- for (let i = 0; i < each_blocks.length; i += 1) {
- each_blocks[i].m(tbody, null);
- }
-
- insert_dev(target, t15, anchor);
- insert_dev(target, button, anchor);
- current = true;
-
- if (!mounted) {
- dispose = [
- listen_dev(select0, "change", /*select0_change_handler*/ ctx[8]),
- listen_dev(select0, "change", /*change_handler*/ ctx[9], false, false, false),
- listen_dev(button, "click", /*click_handler*/ ctx[17], false, false, false)
- ];
-
- mounted = true;
- }
- },
- p: function update(ctx, dirty) {
- if (dirty[0] & /*itemsJson*/ 4) {
- each_value_3 = /*itemsJson*/ ctx[2];
- validate_each_argument(each_value_3);
- let i;
-
- for (i = 0; i < each_value_3.length; i += 1) {
- const child_ctx = get_each_context_3(ctx, each_value_3, i);
-
- if (each_blocks_1[i]) {
- each_blocks_1[i].p(child_ctx, dirty);
- } else {
- each_blocks_1[i] = create_each_block_3(child_ctx);
- each_blocks_1[i].c();
- each_blocks_1[i].m(select0, null);
- }
- }
-
- for (; i < each_blocks_1.length; i += 1) {
- each_blocks_1[i].d(1);
- }
-
- each_blocks_1.length = each_value_3.length;
- }
-
- if (dirty[0] & /*itemsJsonBind, itemsJson*/ 20) {
- select_option(select0, /*itemsJsonBind*/ ctx[4]);
- }
-
- if (dirty[0] & /*configJson, hideAllSubParams, deleteLineFromConfig, widgetsJson*/ 163) {
- each_value = /*configJson*/ ctx[0];
- validate_each_argument(each_value);
- let i;
-
- for (i = 0; i < each_value.length; i += 1) {
- const child_ctx = get_each_context$4(ctx, each_value, i);
-
- if (each_blocks[i]) {
- each_blocks[i].p(child_ctx, dirty);
- transition_in(each_blocks[i], 1);
- } else {
- each_blocks[i] = create_each_block$4(child_ctx);
- each_blocks[i].c();
- transition_in(each_blocks[i], 1);
- each_blocks[i].m(tbody, null);
- }
- }
-
- group_outros();
-
- for (i = each_value.length; i < each_blocks.length; i += 1) {
- out(i);
- }
-
- check_outros();
- }
- },
- i: function intro(local) {
- if (current) return;
-
- for (let i = 0; i < each_value.length; i += 1) {
- transition_in(each_blocks[i]);
- }
-
- current = true;
- },
- o: function outro(local) {
- each_blocks = each_blocks.filter(Boolean);
-
- for (let i = 0; i < each_blocks.length; i += 1) {
- transition_out(each_blocks[i]);
- }
-
- current = false;
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(div);
- destroy_each(each_blocks_1, detaching);
- if (detaching) detach_dev(t2);
- if (detaching) detach_dev(table);
- destroy_each(each_blocks, detaching);
- if (detaching) detach_dev(t15);
- if (detaching) detach_dev(button);
- mounted = false;
- run_all(dispose);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_default_slot$6.name,
- type: "slot",
- source: "(46:2) ",
- ctx
- });
-
- return block;
- }
-
- function create_fragment$8(ctx) {
- let div;
- let card;
- let current;
-
- card = new Card({
- props: {
- $$slots: { default: [create_default_slot$6] },
- $$scope: { ctx }
- },
- $$inline: true
- });
-
- const block = {
- c: function create() {
- div = element("div");
- create_component(card.$$.fragment);
- attr_dev(div, "class", "grd-1col1");
- add_location(div, file$8, 44, 0, 1184);
- },
- 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);
- mount_component(card, div, null);
- current = true;
- },
- p: function update(ctx, dirty) {
- const card_changes = {};
-
- if (dirty[0] & /*saveConfig, configJson, hideAllSubParams, widgetsJson, itemsJsonBind, itemsJson*/ 63 | dirty[1] & /*$$scope*/ 2) {
- card_changes.$$scope = { dirty, ctx };
- }
-
- card.$set(card_changes);
- },
- i: function intro(local) {
- if (current) return;
- transition_in(card.$$.fragment, local);
- current = true;
- },
- o: function outro(local) {
- transition_out(card.$$.fragment, local);
- current = false;
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(div);
- destroy_component(card);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_fragment$8.name,
- type: "component",
- source: "",
- ctx
- });
-
- return block;
- }
-
- function instance$8($$self, $$props, $$invalidate) {
- let { $$slots: slots = {}, $$scope } = $$props;
- validate_slots('Config', slots, []);
- let { configJson } = $$props;
- let { widgetsJson } = $$props;
- let { itemsJson } = $$props;
- let itemsJsonBind = 0;
- let debug = true;
-
- let { saveConfig = () => {
-
- } } = $$props;
-
- let hideAllSubParams = true;
-
- function elementsDropdownChange() {
- for (let i = 0; i < itemsJson.length; i++) {
- let item = Object.assign({}, itemsJson[i]);
-
- if (itemsJsonBind === item.num) {
- delete item.num;
- delete item.name;
- configJson.push(item);
- $$invalidate(0, configJson);
- $$invalidate(4, itemsJsonBind = 0);
- if (debug) console.log("[i]", "item added");
- break;
- }
- }
- }
-
- function deleteLineFromConfig(num) {
- for (let i = 0; i < configJson.length; i++) {
- if (num === i) {
- configJson.splice(i, 1);
- $$invalidate(0, configJson);
- if (debug) console.log("[i]", "item " + num + " deleted from config");
- break;
- }
- }
- }
-
- const writable_props = ['configJson', 'widgetsJson', 'itemsJson', 'saveConfig'];
-
- Object_1$2.keys($$props).forEach(key => {
- if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console_1$3.warn(` was created with unknown prop '${key}'`);
- });
-
- function select0_change_handler() {
- itemsJsonBind = select_value(this);
- $$invalidate(4, itemsJsonBind);
- $$invalidate(2, itemsJson);
- }
-
- const change_handler = () => elementsDropdownChange();
-
- function input0_input_handler(each_value, i) {
- each_value[i].id = this.value;
- $$invalidate(0, configJson);
- $$invalidate(1, widgetsJson);
- }
-
- function select_change_handler(each_value, i) {
- each_value[i].widget = select_value(this);
- $$invalidate(0, configJson);
- $$invalidate(1, widgetsJson);
- }
-
- function input1_input_handler(each_value, i) {
- each_value[i].page = this.value;
- $$invalidate(0, configJson);
- $$invalidate(1, widgetsJson);
- }
-
- function input2_input_handler(each_value, i) {
- each_value[i].descr = this.value;
- $$invalidate(0, configJson);
- $$invalidate(1, widgetsJson);
- }
-
- const func = () => $$invalidate(5, hideAllSubParams = !hideAllSubParams);
- const func_1 = i => deleteLineFromConfig(i);
-
- function input_input_handler(key, each_value, i) {
- each_value[i][key] = this.value;
- $$invalidate(0, configJson);
- $$invalidate(1, widgetsJson);
- }
-
- const click_handler = () => saveConfig();
-
- $$self.$$set = $$props => {
- if ('configJson' in $$props) $$invalidate(0, configJson = $$props.configJson);
- if ('widgetsJson' in $$props) $$invalidate(1, widgetsJson = $$props.widgetsJson);
- if ('itemsJson' in $$props) $$invalidate(2, itemsJson = $$props.itemsJson);
- if ('saveConfig' in $$props) $$invalidate(3, saveConfig = $$props.saveConfig);
- };
-
- $$self.$capture_state = () => ({
- Card,
- CrossIcon: Cross,
- OpenIcon: Open,
- configJson,
- widgetsJson,
- itemsJson,
- itemsJsonBind,
- debug,
- saveConfig,
- hideAllSubParams,
- elementsDropdownChange,
- deleteLineFromConfig
- });
-
- $$self.$inject_state = $$props => {
- if ('configJson' in $$props) $$invalidate(0, configJson = $$props.configJson);
- if ('widgetsJson' in $$props) $$invalidate(1, widgetsJson = $$props.widgetsJson);
- if ('itemsJson' in $$props) $$invalidate(2, itemsJson = $$props.itemsJson);
- if ('itemsJsonBind' in $$props) $$invalidate(4, itemsJsonBind = $$props.itemsJsonBind);
- if ('debug' in $$props) debug = $$props.debug;
- if ('saveConfig' in $$props) $$invalidate(3, saveConfig = $$props.saveConfig);
- if ('hideAllSubParams' in $$props) $$invalidate(5, hideAllSubParams = $$props.hideAllSubParams);
- };
-
- if ($$props && "$$inject" in $$props) {
- $$self.$inject_state($$props.$$inject);
- }
-
- return [
- configJson,
- widgetsJson,
- itemsJson,
- saveConfig,
- itemsJsonBind,
- hideAllSubParams,
- elementsDropdownChange,
- deleteLineFromConfig,
- select0_change_handler,
- change_handler,
- input0_input_handler,
- select_change_handler,
- input1_input_handler,
- input2_input_handler,
- func,
- func_1,
- input_input_handler,
- click_handler
- ];
- }
-
- class Config extends SvelteComponentDev {
- constructor(options) {
- super(options);
-
- init(
- this,
- options,
- instance$8,
- create_fragment$8,
- safe_not_equal,
- {
- configJson: 0,
- widgetsJson: 1,
- itemsJson: 2,
- saveConfig: 3
- },
- null,
- [-1, -1]
- );
-
- dispatch_dev("SvelteRegisterComponent", {
- component: this,
- tagName: "Config",
- options,
- id: create_fragment$8.name
- });
-
- const { ctx } = this.$$;
- const props = options.props || {};
-
- if (/*configJson*/ ctx[0] === undefined && !('configJson' in props)) {
- console_1$3.warn(" was created without expected prop 'configJson'");
- }
-
- if (/*widgetsJson*/ ctx[1] === undefined && !('widgetsJson' in props)) {
- console_1$3.warn(" was created without expected prop 'widgetsJson'");
- }
-
- if (/*itemsJson*/ ctx[2] === undefined && !('itemsJson' in props)) {
- console_1$3.warn(" was created without expected prop 'itemsJson'");
- }
- }
-
- get configJson() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set configJson(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
-
- get widgetsJson() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set widgetsJson(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
-
- get itemsJson() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set itemsJson(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
-
- get saveConfig() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set saveConfig(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
- }
-
- /* src\pages\Connection.svelte generated by Svelte v3.46.4 */
-
- const { Object: Object_1$1 } = globals;
- const file$7 = "src\\pages\\Connection.svelte";
-
- function get_each_context$3(ctx, list, i) {
- const child_ctx = ctx.slice();
- child_ctx[17] = list[i][0];
- child_ctx[18] = list[i][1];
- return child_ctx;
- }
-
- // (43:10) {#each Object.entries(ssidJson) as [num, ssid]}
- function create_each_block$3(ctx) {
- let option;
- let t0_value = /*ssid*/ ctx[18] + "";
- let t0;
- let t1;
- let option_value_value;
-
- const block = {
- c: function create() {
- option = element("option");
- t0 = text(t0_value);
- t1 = space();
- option.__value = option_value_value = /*ssid*/ ctx[18];
- option.value = option.__value;
- add_location(option, file$7, 43, 12, 1599);
- },
- m: function mount(target, anchor) {
- insert_dev(target, option, anchor);
- append_dev(option, t0);
- append_dev(option, t1);
- },
- p: function update(ctx, dirty) {
- if (dirty & /*ssidJson*/ 2 && t0_value !== (t0_value = /*ssid*/ ctx[18] + "")) set_data_dev(t0, t0_value);
-
- if (dirty & /*ssidJson*/ 2 && option_value_value !== (option_value_value = /*ssid*/ ctx[18])) {
- prop_dev(option, "__value", option_value_value);
- option.value = option.__value;
- }
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(option);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_each_block$3.name,
- type: "each",
- source: "(43:10) {#each Object.entries(ssidJson) as [num, ssid]}",
- ctx
- });
-
- return block;
- }
-
- // (59:4) {#if settingsJson.pass_status === 1}
- function create_if_block$2(ctx) {
- let div;
- let alarm;
- let current;
-
- alarm = new Alarm({
- props: { title: "Введен неправильный пароль" },
- $$inline: true
- });
-
- const block = {
- c: function create() {
- div = element("div");
- create_component(alarm.$$.fragment);
- attr_dev(div, "class", "grd-1col1");
- add_location(div, file$7, 59, 6, 2071);
- },
- m: function mount(target, anchor) {
- insert_dev(target, div, anchor);
- mount_component(alarm, div, null);
- current = true;
- },
- i: function intro(local) {
- if (current) return;
- transition_in(alarm.$$.fragment, local);
- current = true;
- },
- o: function outro(local) {
- transition_out(alarm.$$.fragment, local);
- current = false;
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(div);
- destroy_component(alarm);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_if_block$2.name,
- type: "if",
- source: "(59:4) {#if settingsJson.pass_status === 1}",
- ctx
- });
-
- return block;
- }
-
- // (12:2)
- function create_default_slot_1$3(ctx) {
- let div2;
- let div0;
- let p0;
- let t1;
- let div1;
- let input0;
- let t2;
- let div5;
- let div3;
- let p1;
- let t4;
- let div4;
- let input1;
- let t5;
- let div8;
- let div6;
- let p2;
- let t7;
- let div7;
- let input2;
- let t8;
- let div11;
- let div9;
- let p3;
- let t10;
- let div10;
- let select;
- let t11;
- let div14;
- let div12;
- let p4;
- let t13;
- let div13;
- let input3;
- let t14;
- let t15;
- let button;
- let current;
- let mounted;
- let dispose;
- let each_value = Object.entries(/*ssidJson*/ ctx[1]);
- validate_each_argument(each_value);
- let each_blocks = [];
-
- for (let i = 0; i < each_value.length; i += 1) {
- each_blocks[i] = create_each_block$3(get_each_context$3(ctx, each_value, i));
- }
-
- let if_block = /*settingsJson*/ ctx[0].pass_status === 1 && create_if_block$2(ctx);
-
- const block = {
- c: function create() {
- div2 = element("div");
- div0 = element("div");
- p0 = element("p");
- p0.textContent = "Название устройства";
- t1 = space();
- div1 = element("div");
- input0 = element("input");
- t2 = space();
- div5 = element("div");
- div3 = element("div");
- p1 = element("p");
- p1.textContent = "Точка доступа";
- t4 = space();
- div4 = element("div");
- input1 = element("input");
- t5 = space();
- div8 = element("div");
- div6 = element("div");
- p2 = element("p");
- p2.textContent = "Пароль точки доступа";
- t7 = space();
- div7 = element("div");
- input2 = element("input");
- t8 = space();
- div11 = element("div");
- div9 = element("div");
- p3 = element("p");
- p3.textContent = "Название wifi сети";
- t10 = space();
- div10 = element("div");
- select = element("select");
-
- for (let i = 0; i < each_blocks.length; i += 1) {
- each_blocks[i].c();
- }
-
- t11 = space();
- div14 = element("div");
- div12 = element("div");
- p4 = element("p");
- p4.textContent = "Пароль";
- t13 = space();
- div13 = element("div");
- input3 = element("input");
- t14 = space();
- if (if_block) if_block.c();
- t15 = space();
- button = element("button");
- button.textContent = `${"Сохранить и перезагрузить"}`;
- attr_dev(p0, "class", "wgt-dscr-stl");
- add_location(p0, file$7, 14, 8, 401);
- attr_dev(div0, "class", "wgt-dscr-w");
- add_location(div0, file$7, 13, 6, 367);
- attr_dev(input0, "class", "ipt-rnd text-left focus:border-indigo-500");
- attr_dev(input0, "type", "text");
- add_location(input0, file$7, 17, 8, 499);
- attr_dev(div1, "class", "wgt-w");
- add_location(div1, file$7, 16, 6, 470);
- attr_dev(div2, "class", "crd-itm-psn");
- add_location(div2, file$7, 12, 4, 334);
- attr_dev(p1, "class", "wgt-dscr-stl");
- add_location(p1, file$7, 22, 8, 700);
- attr_dev(div3, "class", "wgt-dscr-w");
- add_location(div3, file$7, 21, 6, 666);
- attr_dev(input1, "class", "ipt-rnd text-left focus:border-indigo-500");
- attr_dev(input1, "type", "text");
- add_location(input1, file$7, 25, 8, 792);
- attr_dev(div4, "class", "wgt-w");
- add_location(div4, file$7, 24, 6, 763);
- attr_dev(div5, "class", "crd-itm-psn");
- add_location(div5, file$7, 20, 4, 633);
- attr_dev(p2, "class", "wgt-dscr-stl");
- add_location(p2, file$7, 30, 8, 995);
- attr_dev(div6, "class", "wgt-dscr-w");
- add_location(div6, file$7, 29, 6, 961);
- attr_dev(input2, "class", "ipt-rnd text-left focus:border-indigo-500");
- attr_dev(input2, "type", "text");
- add_location(input2, file$7, 33, 8, 1094);
- attr_dev(div7, "class", "wgt-w");
- add_location(div7, file$7, 32, 6, 1065);
- attr_dev(div8, "class", "crd-itm-psn");
- add_location(div8, file$7, 28, 4, 928);
- attr_dev(p3, "class", "wgt-dscr-stl");
- add_location(p3, file$7, 38, 8, 1297);
- attr_dev(div9, "class", "wgt-dscr-w");
- add_location(div9, file$7, 37, 6, 1263);
- attr_dev(select, "class", "ipt-rnd text-left focus:border-indigo-500");
- if (/*settingsJson*/ ctx[0].routerssid === void 0) add_render_callback(() => /*select_change_handler*/ ctx[7].call(select));
- add_location(select, file$7, 41, 8, 1394);
- attr_dev(div10, "class", "wgt-w");
- add_location(div10, file$7, 40, 6, 1365);
- attr_dev(div11, "class", "crd-itm-psn");
- add_location(div11, file$7, 36, 4, 1230);
- attr_dev(p4, "class", "wgt-dscr-stl");
- add_location(p4, file$7, 52, 8, 1802);
- attr_dev(div12, "class", "wgt-dscr-w");
- add_location(div12, file$7, 51, 6, 1768);
- attr_dev(input3, "class", "ipt-rnd text-left focus:border-indigo-500");
- attr_dev(input3, "type", "text");
- add_location(input3, file$7, 55, 8, 1887);
- attr_dev(div13, "class", "wgt-w");
- add_location(div13, file$7, 54, 6, 1858);
- attr_dev(div14, "class", "crd-itm-psn");
- add_location(div14, file$7, 50, 4, 1735);
- attr_dev(button, "class", "btn-lg");
- add_location(button, file$7, 63, 4, 2179);
- },
- m: function mount(target, anchor) {
- insert_dev(target, div2, anchor);
- append_dev(div2, div0);
- append_dev(div0, p0);
- append_dev(div2, t1);
- append_dev(div2, div1);
- append_dev(div1, input0);
- set_input_value(input0, /*settingsJson*/ ctx[0].name);
- insert_dev(target, t2, anchor);
- insert_dev(target, div5, anchor);
- append_dev(div5, div3);
- append_dev(div3, p1);
- append_dev(div5, t4);
- append_dev(div5, div4);
- append_dev(div4, input1);
- set_input_value(input1, /*settingsJson*/ ctx[0].apssid);
- insert_dev(target, t5, anchor);
- insert_dev(target, div8, anchor);
- append_dev(div8, div6);
- append_dev(div6, p2);
- append_dev(div8, t7);
- append_dev(div8, div7);
- append_dev(div7, input2);
- set_input_value(input2, /*settingsJson*/ ctx[0].appass);
- insert_dev(target, t8, anchor);
- insert_dev(target, div11, anchor);
- append_dev(div11, div9);
- append_dev(div9, p3);
- append_dev(div11, t10);
- append_dev(div11, div10);
- append_dev(div10, select);
-
- for (let i = 0; i < each_blocks.length; i += 1) {
- each_blocks[i].m(select, null);
- }
-
- select_option(select, /*settingsJson*/ ctx[0].routerssid);
- insert_dev(target, t11, anchor);
- insert_dev(target, div14, anchor);
- append_dev(div14, div12);
- append_dev(div12, p4);
- append_dev(div14, t13);
- append_dev(div14, div13);
- append_dev(div13, input3);
- set_input_value(input3, /*settingsJson*/ ctx[0].routerpass);
- insert_dev(target, t14, anchor);
- if (if_block) if_block.m(target, anchor);
- insert_dev(target, t15, anchor);
- insert_dev(target, button, anchor);
- current = true;
-
- if (!mounted) {
- dispose = [
- listen_dev(input0, "input", /*input0_input_handler*/ ctx[4]),
- listen_dev(input1, "input", /*input1_input_handler*/ ctx[5]),
- listen_dev(input2, "input", /*input2_input_handler*/ ctx[6]),
- listen_dev(select, "change", /*select_change_handler*/ ctx[7]),
- listen_dev(select, "click", /*click_handler*/ ctx[8], false, false, false),
- listen_dev(input3, "input", /*input3_input_handler*/ ctx[9]),
- listen_dev(button, "click", /*click_handler_1*/ ctx[10], false, false, false)
- ];
-
- mounted = true;
- }
- },
- p: function update(ctx, dirty) {
- if (dirty & /*settingsJson, Object, ssidJson*/ 3 && input0.value !== /*settingsJson*/ ctx[0].name) {
- set_input_value(input0, /*settingsJson*/ ctx[0].name);
- }
-
- if (dirty & /*settingsJson, Object, ssidJson*/ 3 && input1.value !== /*settingsJson*/ ctx[0].apssid) {
- set_input_value(input1, /*settingsJson*/ ctx[0].apssid);
- }
-
- if (dirty & /*settingsJson, Object, ssidJson*/ 3 && input2.value !== /*settingsJson*/ ctx[0].appass) {
- set_input_value(input2, /*settingsJson*/ ctx[0].appass);
- }
-
- if (dirty & /*Object, ssidJson*/ 2) {
- each_value = Object.entries(/*ssidJson*/ ctx[1]);
- validate_each_argument(each_value);
- let i;
-
- for (i = 0; i < each_value.length; i += 1) {
- const child_ctx = get_each_context$3(ctx, each_value, i);
-
- if (each_blocks[i]) {
- each_blocks[i].p(child_ctx, dirty);
- } else {
- each_blocks[i] = create_each_block$3(child_ctx);
- each_blocks[i].c();
- each_blocks[i].m(select, null);
- }
- }
-
- for (; i < each_blocks.length; i += 1) {
- each_blocks[i].d(1);
- }
-
- each_blocks.length = each_value.length;
- }
-
- if (dirty & /*settingsJson, Object, ssidJson*/ 3) {
- select_option(select, /*settingsJson*/ ctx[0].routerssid);
- }
-
- if (dirty & /*settingsJson, Object, ssidJson*/ 3 && input3.value !== /*settingsJson*/ ctx[0].routerpass) {
- set_input_value(input3, /*settingsJson*/ ctx[0].routerpass);
- }
-
- if (/*settingsJson*/ ctx[0].pass_status === 1) {
- if (if_block) {
- if (dirty & /*settingsJson*/ 1) {
- transition_in(if_block, 1);
- }
- } else {
- if_block = create_if_block$2(ctx);
- if_block.c();
- transition_in(if_block, 1);
- if_block.m(t15.parentNode, t15);
- }
- } else if (if_block) {
- group_outros();
-
- transition_out(if_block, 1, 1, () => {
- if_block = null;
- });
-
- check_outros();
- }
- },
- i: function intro(local) {
- if (current) return;
- transition_in(if_block);
- current = true;
- },
- o: function outro(local) {
- transition_out(if_block);
- current = false;
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(div2);
- if (detaching) detach_dev(t2);
- if (detaching) detach_dev(div5);
- if (detaching) detach_dev(t5);
- if (detaching) detach_dev(div8);
- if (detaching) detach_dev(t8);
- if (detaching) detach_dev(div11);
- destroy_each(each_blocks, detaching);
- if (detaching) detach_dev(t11);
- if (detaching) detach_dev(div14);
- if (detaching) detach_dev(t14);
- if (if_block) if_block.d(detaching);
- if (detaching) detach_dev(t15);
- if (detaching) detach_dev(button);
- mounted = false;
- run_all(dispose);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_default_slot_1$3.name,
- type: "slot",
- source: "(12:2) ",
- ctx
- });
-
- return block;
- }
-
- // (66:2)
- function create_default_slot$5(ctx) {
- let div2;
- let div0;
- let p0;
- let t1;
- let div1;
- let input0;
- let t2;
- let div5;
- let div3;
- let p1;
- let t4;
- let div4;
- let input1;
- let t5;
- let div8;
- let div6;
- let p2;
- let t7;
- let div7;
- let input2;
- let t8;
- let div11;
- let div9;
- let p3;
- let t10;
- let div10;
- let input3;
- let t11;
- let div14;
- let div12;
- let p4;
- let t13;
- let div13;
- let input4;
- let t14;
- let button;
- let mounted;
- let dispose;
-
- const block = {
- c: function create() {
- div2 = element("div");
- div0 = element("div");
- p0 = element("p");
- p0.textContent = "Название сервера";
- t1 = space();
- div1 = element("div");
- input0 = element("input");
- t2 = space();
- div5 = element("div");
- div3 = element("div");
- p1 = element("p");
- p1.textContent = "Порт";
- t4 = space();
- div4 = element("div");
- input1 = element("input");
- t5 = space();
- div8 = element("div");
- div6 = element("div");
- p2 = element("p");
- p2.textContent = "Префикс";
- t7 = space();
- div7 = element("div");
- input2 = element("input");
- t8 = space();
- div11 = element("div");
- div9 = element("div");
- p3 = element("p");
- p3.textContent = "Имя пользователя";
- t10 = space();
- div10 = element("div");
- input3 = element("input");
- t11 = space();
- div14 = element("div");
- div12 = element("div");
- p4 = element("p");
- p4.textContent = "Пароль";
- t13 = space();
- div13 = element("div");
- input4 = element("input");
- t14 = space();
- button = element("button");
- button.textContent = `${"Сохранить и проверить подключение"}`;
- attr_dev(p0, "class", "wgt-dscr-stl");
- add_location(p0, file$7, 68, 8, 2401);
- attr_dev(div0, "class", "wgt-dscr-w");
- add_location(div0, file$7, 67, 6, 2367);
- attr_dev(input0, "class", "ipt-rnd text-left focus:border-indigo-500");
- attr_dev(input0, "type", "text");
- add_location(input0, file$7, 71, 8, 2496);
- attr_dev(div1, "class", "wgt-w");
- add_location(div1, file$7, 70, 6, 2467);
- attr_dev(div2, "class", "crd-itm-psn");
- add_location(div2, file$7, 66, 4, 2334);
- attr_dev(p1, "class", "wgt-dscr-stl");
- add_location(p1, file$7, 76, 8, 2703);
- attr_dev(div3, "class", "wgt-dscr-w");
- add_location(div3, file$7, 75, 6, 2669);
- attr_dev(input1, "class", "ipt-rnd text-left focus:border-indigo-500");
- attr_dev(input1, "type", "text");
- add_location(input1, file$7, 79, 8, 2786);
- attr_dev(div4, "class", "wgt-w");
- add_location(div4, file$7, 78, 6, 2757);
- attr_dev(div5, "class", "crd-itm-psn");
- add_location(div5, file$7, 74, 4, 2636);
- attr_dev(p2, "class", "wgt-dscr-stl");
- add_location(p2, file$7, 84, 8, 2991);
- attr_dev(div6, "class", "wgt-dscr-w");
- add_location(div6, file$7, 83, 6, 2957);
- attr_dev(input2, "class", "ipt-rnd text-left focus:border-indigo-500");
- attr_dev(input2, "type", "text");
- add_location(input2, file$7, 87, 8, 3077);
- attr_dev(div7, "class", "wgt-w");
- add_location(div7, file$7, 86, 6, 3048);
- attr_dev(div8, "class", "crd-itm-psn");
- add_location(div8, file$7, 82, 4, 2924);
- attr_dev(p3, "class", "wgt-dscr-stl");
- add_location(p3, file$7, 92, 8, 3284);
- attr_dev(div9, "class", "wgt-dscr-w");
- add_location(div9, file$7, 91, 6, 3250);
- attr_dev(input3, "class", "ipt-rnd text-left focus:border-indigo-500");
- attr_dev(input3, "type", "text");
- add_location(input3, file$7, 95, 8, 3379);
- attr_dev(div10, "class", "wgt-w");
- add_location(div10, file$7, 94, 6, 3350);
- attr_dev(div11, "class", "crd-itm-psn");
- add_location(div11, file$7, 90, 4, 3217);
- attr_dev(p4, "class", "wgt-dscr-stl");
- add_location(p4, file$7, 100, 8, 3584);
- attr_dev(div12, "class", "wgt-dscr-w");
- add_location(div12, file$7, 99, 6, 3550);
- attr_dev(input4, "class", "ipt-rnd text-left focus:border-indigo-500");
- attr_dev(input4, "type", "text");
- add_location(input4, file$7, 103, 8, 3669);
- attr_dev(div13, "class", "wgt-w");
- add_location(div13, file$7, 102, 6, 3640);
- attr_dev(div14, "class", "crd-itm-psn");
- add_location(div14, file$7, 98, 4, 3517);
- attr_dev(button, "class", "btn-lg");
- add_location(button, file$7, 106, 4, 3807);
- },
- m: function mount(target, anchor) {
- insert_dev(target, div2, anchor);
- append_dev(div2, div0);
- append_dev(div0, p0);
- append_dev(div2, t1);
- append_dev(div2, div1);
- append_dev(div1, input0);
- set_input_value(input0, /*settingsJson*/ ctx[0].mqttServer);
- insert_dev(target, t2, anchor);
- insert_dev(target, div5, anchor);
- append_dev(div5, div3);
- append_dev(div3, p1);
- append_dev(div5, t4);
- append_dev(div5, div4);
- append_dev(div4, input1);
- set_input_value(input1, /*settingsJson*/ ctx[0].mqttPort);
- insert_dev(target, t5, anchor);
- insert_dev(target, div8, anchor);
- append_dev(div8, div6);
- append_dev(div6, p2);
- append_dev(div8, t7);
- append_dev(div8, div7);
- append_dev(div7, input2);
- set_input_value(input2, /*settingsJson*/ ctx[0].mqttPrefix);
- insert_dev(target, t8, anchor);
- insert_dev(target, div11, anchor);
- append_dev(div11, div9);
- append_dev(div9, p3);
- append_dev(div11, t10);
- append_dev(div11, div10);
- append_dev(div10, input3);
- set_input_value(input3, /*settingsJson*/ ctx[0].mqttUser);
- insert_dev(target, t11, anchor);
- insert_dev(target, div14, anchor);
- append_dev(div14, div12);
- append_dev(div12, p4);
- append_dev(div14, t13);
- append_dev(div14, div13);
- append_dev(div13, input4);
- set_input_value(input4, /*settingsJson*/ ctx[0].mqttPass);
- insert_dev(target, t14, anchor);
- insert_dev(target, button, anchor);
-
- if (!mounted) {
- dispose = [
- listen_dev(input0, "input", /*input0_input_handler_1*/ ctx[11]),
- listen_dev(input1, "input", /*input1_input_handler_1*/ ctx[12]),
- listen_dev(input2, "input", /*input2_input_handler_1*/ ctx[13]),
- listen_dev(input3, "input", /*input3_input_handler_1*/ ctx[14]),
- listen_dev(input4, "input", /*input4_input_handler*/ ctx[15]),
- listen_dev(button, "click", /*click_handler_2*/ ctx[16], false, false, false)
- ];
-
- mounted = true;
- }
- },
- p: function update(ctx, dirty) {
- if (dirty & /*settingsJson, Object, ssidJson*/ 3 && input0.value !== /*settingsJson*/ ctx[0].mqttServer) {
- set_input_value(input0, /*settingsJson*/ ctx[0].mqttServer);
- }
-
- if (dirty & /*settingsJson, Object, ssidJson*/ 3 && input1.value !== /*settingsJson*/ ctx[0].mqttPort) {
- set_input_value(input1, /*settingsJson*/ ctx[0].mqttPort);
- }
-
- if (dirty & /*settingsJson, Object, ssidJson*/ 3 && input2.value !== /*settingsJson*/ ctx[0].mqttPrefix) {
- set_input_value(input2, /*settingsJson*/ ctx[0].mqttPrefix);
- }
-
- if (dirty & /*settingsJson, Object, ssidJson*/ 3 && input3.value !== /*settingsJson*/ ctx[0].mqttUser) {
- set_input_value(input3, /*settingsJson*/ ctx[0].mqttUser);
- }
-
- if (dirty & /*settingsJson, Object, ssidJson*/ 3 && input4.value !== /*settingsJson*/ ctx[0].mqttPass) {
- set_input_value(input4, /*settingsJson*/ ctx[0].mqttPass);
- }
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(div2);
- if (detaching) detach_dev(t2);
- if (detaching) detach_dev(div5);
- if (detaching) detach_dev(t5);
- if (detaching) detach_dev(div8);
- if (detaching) detach_dev(t8);
- if (detaching) detach_dev(div11);
- if (detaching) detach_dev(t11);
- if (detaching) detach_dev(div14);
- if (detaching) detach_dev(t14);
- if (detaching) detach_dev(button);
- mounted = false;
- run_all(dispose);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_default_slot$5.name,
- type: "slot",
- source: "(66:2) ",
- ctx
- });
-
- return block;
- }
-
- function create_fragment$7(ctx) {
- let div;
- let card0;
- let t;
- let card1;
- let current;
-
- card0 = new Card({
- props: {
- title: "Подключение к WiFi роутеру",
- $$slots: { default: [create_default_slot_1$3] },
- $$scope: { ctx }
- },
- $$inline: true
- });
-
- card1 = new Card({
- props: {
- title: "Подключение к MQTT брокеру",
- $$slots: { default: [create_default_slot$5] },
- $$scope: { ctx }
- },
- $$inline: true
- });
-
- const block = {
- c: function create() {
- div = element("div");
- create_component(card0.$$.fragment);
- t = space();
- create_component(card1.$$.fragment);
- attr_dev(div, "class", "grd-2col1");
- add_location(div, file$7, 10, 0, 260);
- },
- 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);
- mount_component(card0, div, null);
- append_dev(div, t);
- mount_component(card1, div, null);
- current = true;
- },
- p: function update(ctx, [dirty]) {
- const card0_changes = {};
-
- if (dirty & /*$$scope, saveSettings, settingsJson, ssidDropdownClick, ssidJson*/ 2097167) {
- card0_changes.$$scope = { dirty, ctx };
- }
-
- card0.$set(card0_changes);
- const card1_changes = {};
-
- if (dirty & /*$$scope, saveSettings, settingsJson*/ 2097161) {
- card1_changes.$$scope = { dirty, ctx };
- }
-
- card1.$set(card1_changes);
- },
- i: function intro(local) {
- if (current) return;
- transition_in(card0.$$.fragment, local);
- transition_in(card1.$$.fragment, local);
- current = true;
- },
- o: function outro(local) {
- transition_out(card0.$$.fragment, local);
- transition_out(card1.$$.fragment, local);
- current = false;
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(div);
- destroy_component(card0);
- destroy_component(card1);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_fragment$7.name,
- type: "component",
- source: "",
- ctx
- });
-
- return block;
- }
-
- function instance$7($$self, $$props, $$invalidate) {
- let { $$slots: slots = {}, $$scope } = $$props;
- validate_slots('Connection', slots, []);
- let { settingsJson } = $$props;
- let { ssidJson } = $$props;
-
- let { ssidDropdownClick = () => {
-
- } } = $$props;
-
- let { saveSettings = () => {
-
- } } = $$props;
-
- const writable_props = ['settingsJson', 'ssidJson', 'ssidDropdownClick', 'saveSettings'];
-
- Object_1$1.keys($$props).forEach(key => {
- if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(` was created with unknown prop '${key}'`);
- });
-
- function input0_input_handler() {
- settingsJson.name = this.value;
- $$invalidate(0, settingsJson);
- $$invalidate(1, ssidJson);
- }
-
- function input1_input_handler() {
- settingsJson.apssid = this.value;
- $$invalidate(0, settingsJson);
- $$invalidate(1, ssidJson);
- }
-
- function input2_input_handler() {
- settingsJson.appass = this.value;
- $$invalidate(0, settingsJson);
- $$invalidate(1, ssidJson);
- }
-
- function select_change_handler() {
- settingsJson.routerssid = select_value(this);
- $$invalidate(0, settingsJson);
- $$invalidate(1, ssidJson);
- }
-
- const click_handler = () => ssidDropdownClick();
-
- function input3_input_handler() {
- settingsJson.routerpass = this.value;
- $$invalidate(0, settingsJson);
- $$invalidate(1, ssidJson);
- }
-
- const click_handler_1 = () => saveSettings();
-
- function input0_input_handler_1() {
- settingsJson.mqttServer = this.value;
- $$invalidate(0, settingsJson);
- $$invalidate(1, ssidJson);
- }
-
- function input1_input_handler_1() {
- settingsJson.mqttPort = this.value;
- $$invalidate(0, settingsJson);
- $$invalidate(1, ssidJson);
- }
-
- function input2_input_handler_1() {
- settingsJson.mqttPrefix = this.value;
- $$invalidate(0, settingsJson);
- $$invalidate(1, ssidJson);
- }
-
- function input3_input_handler_1() {
- settingsJson.mqttUser = this.value;
- $$invalidate(0, settingsJson);
- $$invalidate(1, ssidJson);
- }
-
- function input4_input_handler() {
- settingsJson.mqttPass = this.value;
- $$invalidate(0, settingsJson);
- $$invalidate(1, ssidJson);
- }
-
- const click_handler_2 = () => saveSettings();
-
- $$self.$$set = $$props => {
- if ('settingsJson' in $$props) $$invalidate(0, settingsJson = $$props.settingsJson);
- if ('ssidJson' in $$props) $$invalidate(1, ssidJson = $$props.ssidJson);
- if ('ssidDropdownClick' in $$props) $$invalidate(2, ssidDropdownClick = $$props.ssidDropdownClick);
- if ('saveSettings' in $$props) $$invalidate(3, saveSettings = $$props.saveSettings);
- };
-
- $$self.$capture_state = () => ({
- Card,
- Alarm,
- settingsJson,
- ssidJson,
- ssidDropdownClick,
- saveSettings
- });
-
- $$self.$inject_state = $$props => {
- if ('settingsJson' in $$props) $$invalidate(0, settingsJson = $$props.settingsJson);
- if ('ssidJson' in $$props) $$invalidate(1, ssidJson = $$props.ssidJson);
- if ('ssidDropdownClick' in $$props) $$invalidate(2, ssidDropdownClick = $$props.ssidDropdownClick);
- if ('saveSettings' in $$props) $$invalidate(3, saveSettings = $$props.saveSettings);
- };
-
- if ($$props && "$$inject" in $$props) {
- $$self.$inject_state($$props.$$inject);
- }
-
- return [
- settingsJson,
- ssidJson,
- ssidDropdownClick,
- saveSettings,
- input0_input_handler,
- input1_input_handler,
- input2_input_handler,
- select_change_handler,
- click_handler,
- input3_input_handler,
- click_handler_1,
- input0_input_handler_1,
- input1_input_handler_1,
- input2_input_handler_1,
- input3_input_handler_1,
- input4_input_handler,
- click_handler_2
- ];
- }
-
- class Connection extends SvelteComponentDev {
- constructor(options) {
- super(options);
-
- init(this, options, instance$7, create_fragment$7, safe_not_equal, {
- settingsJson: 0,
- ssidJson: 1,
- ssidDropdownClick: 2,
- saveSettings: 3
- });
-
- dispatch_dev("SvelteRegisterComponent", {
- component: this,
- tagName: "Connection",
- options,
- id: create_fragment$7.name
- });
-
- const { ctx } = this.$$;
- const props = options.props || {};
-
- if (/*settingsJson*/ ctx[0] === undefined && !('settingsJson' in props)) {
- console.warn(" was created without expected prop 'settingsJson'");
- }
-
- if (/*ssidJson*/ ctx[1] === undefined && !('ssidJson' in props)) {
- console.warn(" was created without expected prop 'ssidJson'");
- }
- }
-
- get settingsJson() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set settingsJson(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
-
- get ssidJson() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set ssidJson(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
-
- get ssidDropdownClick() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set ssidDropdownClick(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
-
- get saveSettings() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set saveSettings(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
- }
-
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
-
- function createCommonjsModule(fn) {
- var module = { exports: {} };
- return fn(module, module.exports), module.exports;
- }
-
- var frappeCharts_min_umd = createCommonjsModule(function (module, exports) {
- !function(t,e){module.exports=e();}(commonjsGlobal,function(){function t(t,e){return "string"==typeof t?(e||document).querySelector(t):t||null}function e(t){var e=t.getBoundingClientRect();return {top:e.top+(document.documentElement.scrollTop||document.body.scrollTop),left:e.left+(document.documentElement.scrollLeft||document.body.scrollLeft)}}function i(t){return null===t.offsetParent}function n(t){var e=t.getBoundingClientRect();return e.top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth)}function a(t){var e=window.getComputedStyle(t),i=parseFloat(e.paddingLeft)+parseFloat(e.paddingRight);return t.clientWidth-i}function s(t,e,i){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0);for(var a in i)n[a]=i[a];return t.dispatchEvent(n)}function r(t){return t.titleHeight+t.margins.top+t.paddings.top}function o(t){return t.margins.left+t.paddings.left}function l(t){return t.margins.top+t.margins.bottom+t.paddings.top+t.paddings.bottom+t.titleHeight+t.legendHeight}function u(t){return t.margins.left+t.margins.right+t.paddings.left+t.paddings.right}function h(t){return parseFloat(t.toFixed(2))}function c(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];i||(i=n?t[0]:t[t.length-1]);var a=new Array(Math.abs(e)).fill(i);return t=n?a.concat(t):t.concat(a)}function d(t,e){return (t+"").length*e}function p(t,e){return {x:Math.sin(t*Zt)*e,y:Math.cos(t*Zt)*e}}function f(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return !Number.isNaN(t)&&(void 0!==t&&(!!Number.isFinite(t)&&!(e&&t<0)))}function v(t){return Number(Math.round(t+"e4")+"e-4")}function g(t){var e=void 0,i=void 0,n=void 0;if(t instanceof Date)return new Date(t.getTime());if("object"!==(void 0===t?"undefined":Ft(t))||null===t)return t;e=Array.isArray(t)?[]:{};for(n in t)i=t[n],e[n]=g(i);return e}function m(t,e){var i=void 0,n=void 0;return t<=e?(i=e-t,n=t):(i=t-e,n=e),[i,n]}function y(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length-t.length;return i>0?t=c(t,i):e=c(e,i),[t,e]}function b(t,e){if(t)return t.length>e?t.slice(0,e-3)+"...":t}function x(t){var e=void 0;if("number"==typeof t)e=t;else if("string"==typeof t&&(e=Number(t),Number.isNaN(e)))return t;var i=Math.floor(Math.log10(Math.abs(e)));if(i<=2)return e;var n=Math.floor(i/3),a=Math.pow(10,i-3*n)*+(e/Math.pow(10,i)).toFixed(1);return Math.round(100*a)/100+" "+["","K","M","B","T"][n]}function k(t,e){for(var i=[],n=0;n255?255:t<0?0:t}function A(t,e){var i=ie(t),n=!1;"#"==i[0]&&(i=i.slice(1),n=!0);var a=parseInt(i,16),s=w((a>>16)+e),r=w((a>>8&255)+e),o=w((255&a)+e);return (n?"#":"")+(o|r<<8|s<<16).toString(16)}function P(t){var e=/(^\s*)(rgb|hsl)(a?)[(]\s*([\d.]+\s*%?)\s*,\s*([\d.]+\s*%?)\s*,\s*([\d.]+\s*%?)\s*(?:,\s*([\d.]+)\s*)?[)]$/i;return /(^\s*)(#)((?:[A-Fa-f0-9]{3}){1,2})$/i.test(t)||e.test(t)}function T(t,e){return "string"==typeof t?(e||document).querySelector(t):t||null}function L(t,e){var i=document.createElementNS("http://www.w3.org/2000/svg",t);for(var n in e){var a=e[n];if("inside"===n)T(a).appendChild(i);else if("around"===n){var s=T(a);s.parentNode.insertBefore(i,s),i.appendChild(s);}else "styles"===n?"object"===(void 0===a?"undefined":Ft(a))&&Object.keys(a).map(function(t){i.style[t]=a[t];}):("className"===n&&(n="class"),"innerHTML"===n?i.textContent=a:i.setAttribute(n,a));}return i}function O(t,e){return L("linearGradient",{inside:t,id:e,x1:0,x2:0,y1:0,y2:1})}function M(t,e,i,n){return L("stop",{inside:t,style:"stop-color: "+i,offset:e,"stop-opacity":n})}function C(t,e,i,n){return L("svg",{className:e,inside:t,width:i,height:n})}function D(t){return L("defs",{inside:t})}function N(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,n={className:t,transform:e};return i&&(n.inside=i),L("g",n)}function S(t){return L("path",{className:arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",d:t,styles:{stroke:arguments.length>2&&void 0!==arguments[2]?arguments[2]:"none",fill:arguments.length>3&&void 0!==arguments[3]?arguments[3]:"none","stroke-width":arguments.length>4&&void 0!==arguments[4]?arguments[4]:2}})}function E(t,e,i,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,r=i.x+t.x,o=i.y+t.y,l=i.x+e.x,u=i.y+e.y;return "M"+i.x+" "+i.y+"\n\t\tL"+r+" "+o+"\n\t\tA "+n+" "+n+" 0 "+s+" "+(a?1:0)+"\n\t\t"+l+" "+u+" z"}function _(t,e,i,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,r=i.x+t.x,o=i.y+t.y,l=i.x+e.x,u=2*i.y,h=i.y+e.y;return "M"+i.x+" "+i.y+"\n\t\tL"+r+" "+o+"\n\t\tA "+n+" "+n+" 0 "+s+" "+(a?1:0)+"\n\t\t"+l+" "+u+" z\n\t\tL"+r+" "+u+"\n\t\tA "+n+" "+n+" 0 "+s+" "+(a?1:0)+"\n\t\t"+l+" "+h+" z"}function z(t,e,i,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,r=i.x+t.x,o=i.y+t.y,l=i.x+e.x,u=i.y+e.y;return "M"+r+" "+o+"\n\t\tA "+n+" "+n+" 0 "+s+" "+(a?1:0)+"\n\t\t"+l+" "+u}function W(t,e,i,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,r=i.x+t.x,o=i.y+t.y,l=i.x+e.x,u=2*n+o,h=i.y+t.y;return "M"+r+" "+o+"\n\t\tA "+n+" "+n+" 0 "+s+" "+(a?1:0)+"\n\t\t"+l+" "+u+"\n\t\tM"+r+" "+u+"\n\t\tA "+n+" "+n+" 0 "+s+" "+(a?1:0)+"\n\t\t"+l+" "+h}function j(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n="path-fill-gradient-"+e+"-"+(i?"lighter":"default"),a=O(t,n),s=[1,.6,.2];return i&&(s=[.4,.2,0]),M(a,"0%",e,s[0]),M(a,"50%",e,s[1]),M(a,"100%",e,s[2]),n}function F(t,e,i,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Jt,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"none";return L("rect",{className:"percentage-bar",x:t,y:e,width:i,height:n,fill:s,styles:{stroke:A(s,-25),"stroke-dasharray":"0, "+(n+i)+", "+i+", "+n,"stroke-width":a}})}function H(t,e,i,n,a){var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"none",r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:{},o={className:t,x:e,y:i,width:n,height:n,rx:a,fill:s};return Object.keys(r).map(function(t){o[t]=r[t];}),L("rect",o)}function I(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"none",a=arguments[4];a=arguments.length>5&&void 0!==arguments[5]&&arguments[5]?b(a,se):a;var s={className:"legend-bar",x:0,y:0,width:i,height:"2px",fill:n},r=L("text",{className:"legend-dataset-text",x:0,y:0,dy:2*re+"px","font-size":1.2*re+"px","text-anchor":"start",fill:le,innerHTML:a}),o=L("g",{transform:"translate("+t+", "+e+")"});return o.appendChild(L("rect",s)),o.appendChild(r),o}function R(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"none",a=arguments[4];a=arguments.length>5&&void 0!==arguments[5]&&arguments[5]?b(a,se):a;var s={className:"legend-dot",cx:0,cy:0,r:i,fill:n},r=L("text",{className:"legend-dataset-text",x:0,y:0,dx:re+"px",dy:re/3+"px","font-size":1.2*re+"px","text-anchor":"start",fill:le,innerHTML:a}),o=L("g",{transform:"translate("+t+", "+e+")"});return o.appendChild(L("circle",s)),o.appendChild(r),o}function Y(t,e,i,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},s=a.fontSize||re;return L("text",{className:t,x:e,y:i,dy:(void 0!==a.dy?a.dy:s/2)+"px","font-size":s+"px",fill:a.fill||le,"text-anchor":a.textAnchor||"start",innerHTML:n})}function B(t,e,i,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};a.stroke||(a.stroke=oe);var s=L("line",{className:"line-vertical "+a.className,x1:0,x2:0,y1:i,y2:n,styles:{stroke:a.stroke}}),r=L("text",{x:0,y:i>n?i+ae:i-ae-re,dy:re+"px","font-size":re+"px","text-anchor":"middle",innerHTML:e+""}),o=L("g",{transform:"translate("+t+", 0)"});return o.appendChild(s),o.appendChild(r),o}function V(t,e,i,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};a.stroke||(a.stroke=oe),a.lineType||(a.lineType=""),a.shortenNumbers&&(e=x(e));var s=L("line",{className:"line-horizontal "+a.className+("dashed"===a.lineType?"dashed":""),x1:i,x2:n,y1:0,y2:0,styles:{stroke:a.stroke}}),r=L("text",{x:i3&&void 0!==arguments[3]?arguments[3]:{};f(t)||(t=0),n.pos||(n.pos="left"),n.offset||(n.offset=0),n.mode||(n.mode="span"),n.stroke||(n.stroke=oe),n.className||(n.className="");var a=-1*ne,s="span"===n.mode?i+ne:0;return "tick"===n.mode&&"right"===n.pos&&(a=i+ne,s=i),a+=n.offset,s+=n.offset,V(t,e,a,s,{stroke:n.stroke,className:n.className,lineType:n.lineType,shortenNumbers:n.shortenNumbers})}function G(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};f(t)||(t=0),n.pos||(n.pos="bottom"),n.offset||(n.offset=0),n.mode||(n.mode="span"),n.stroke||(n.stroke=oe),n.className||(n.className="");var a=i+ne,s="span"===n.mode?-1*ne:i;return "tick"===n.mode&&"top"===n.pos&&(a=-1*ne,s=0),B(t,e,a,s,{stroke:n.stroke,className:n.className,lineType:n.lineType})}function q(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};n.labelPos||(n.labelPos="right");var a=L("text",{className:"chart-label",x:"left"===n.labelPos?ae:i-d(e,5)-ae,y:0,dy:re/-2+"px","font-size":re+"px","text-anchor":"start",innerHTML:e+""}),s=V(t,"",0,i,{stroke:n.stroke||oe,className:n.className||"",lineType:n.lineType});return s.appendChild(a),s}function X(t,e,i,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},s=t-e,r=L("rect",{className:"bar mini",styles:{fill:"rgba(228, 234, 239, 0.49)",stroke:oe,"stroke-dasharray":i+", "+s},x:0,y:0,width:i,height:s});a.labelPos||(a.labelPos="right");var o=L("text",{className:"chart-label",x:"left"===a.labelPos?ae:i-d(n+"",4.5)-ae,y:0,dy:re/-2+"px","font-size":re+"px","text-anchor":"start",innerHTML:n+""}),l=L("g",{transform:"translate(0, "+e+")"});return l.appendChild(r),l.appendChild(o),l}function J(t,e,i,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:{},l=m(e,o.zeroLine),u=Vt(l,2),h=u[0],c=u[1];c-=r,0===h&&(h=o.minHeight,c-=o.minHeight),f(t)||(t=0),f(c)||(c=0),f(h,!0)||(h=0),f(i,!0)||(i=0);var d=L("rect",{className:"bar mini",style:"fill: "+n,"data-point-index":s,x:t,y:c,width:i,height:h});if((a+="")||a.length){d.setAttribute("y",0),d.setAttribute("x",0);var p=L("text",{className:"data-point-value",x:i/2,y:0,dy:re/2*-1+"px","font-size":re+"px","text-anchor":"middle",innerHTML:a}),v=L("g",{"data-point-index":s,transform:"translate("+t+", "+c+")"});return v.appendChild(d),v.appendChild(p),v}return d}function K(t,e,i,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,r=L("circle",{style:"fill: "+n,"data-point-index":s,cx:t,cy:e,r:i});if((a+="")||a.length){r.setAttribute("cy",0),r.setAttribute("cx",0);var o=L("text",{className:"data-point-value",x:0,y:0,dy:re/2*-1-i+"px","font-size":re+"px","text-anchor":"middle",innerHTML:a}),l=L("g",{"data-point-index":s,transform:"translate("+t+", "+e+")"});return l.appendChild(r),l.appendChild(o),l}return r}function $(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},s=e.map(function(e,i){return t[i]+","+e}).join("L");n.spline&&(s=k(t,e));var r=S("M"+s,"line-graph-path",i);if(n.heatline){var o=j(a.svgDefs,i);r.style.stroke="url(#"+o+")";}var l={path:r};if(n.regionFill){var u=j(a.svgDefs,i,!0),h="M"+t[0]+","+a.zeroLine+"L"+s+"L"+t.slice(-1)[0]+","+a.zeroLine;l.region=S(h,"region-fill","none","url(#"+u+")");}return l}function Q(t,e,i,n){var a="string"==typeof e?e:e.join(", ");return [t,{transform:i.join(", ")},n,ve,"translate",{transform:a}]}function Z(t,e,i){return Q(t,[i,0],[e,0],pe)}function tt(t,e,i){return Q(t,[0,i],[0,e],pe)}function et(t,e,i,n){var a=e-i,s=t.childNodes[0];return [[s,{height:a,"stroke-dasharray":s.getAttribute("width")+", "+a},pe,ve],Q(t,[0,n],[0,i],pe)]}function it(t,e,i,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=m(i,(arguments.length>5&&void 0!==arguments[5]?arguments[5]:{}).zeroLine),r=Vt(s,2),o=r[0],l=r[1];return l-=a,"rect"!==t.nodeName?[[t.childNodes[0],{width:n,height:o},ce,ve],Q(t,t.getAttribute("transform").split("(")[1].slice(0,-1),[e,l],pe)]:[[t,{width:n,height:o,x:e,y:l},ce,ve]]}function nt(t,e,i){return "circle"!==t.nodeName?[Q(t,t.getAttribute("transform").split("(")[1].slice(0,-1),[e,i],pe)]:[[t,{cx:e,cy:i},ce,ve]]}function at(t,e,i,n,a){var s=[],r=i.map(function(t,i){return e[i]+","+t}).join("L");a&&(r=k(e,i));var o=[t.path,{d:"M"+r},de,ve];if(s.push(o),t.region){var l=e[0]+","+n+"L",u="L"+e.slice(-1)[0]+", "+n,h=[t.region,{d:"M"+l+r+u},de,ve];s.push(h);}return s}function st(t,e){return [t,{d:e},ce,ve]}function rt(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"linear",a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},r=t.cloneNode(!0),o=t.cloneNode(!0);for(var l in e){var u=void 0;u="transform"===l?document.createElementNS("http://www.w3.org/2000/svg","animateTransform"):document.createElementNS("http://www.w3.org/2000/svg","animate");var h=s[l]||t.getAttribute(l),c=e[l],d={attributeName:l,from:h,to:c,begin:"0s",dur:i/1e3+"s",values:h+";"+c,keySplines:ge[n],keyTimes:"0;1",calcMode:"spline",fill:"freeze"};a&&(d.type=a);for(var p in d)u.setAttribute(p,d[p]);r.appendChild(u),a?o.setAttribute(l,"translate("+c+")"):o.setAttribute(l,c);}return [r,o]}function ot(t,e){t.style.transform=e,t.style.webkitTransform=e,t.style.msTransform=e,t.style.mozTransform=e,t.style.oTransform=e;}function lt(t,e){var i=[],n=[];e.map(function(t){var e=t[0],a=e.parentNode,s=void 0,r=void 0;t[0]=e;var o=rt.apply(void 0,Ut(t)),l=Vt(o,2);s=l[0],r=l[1],i.push(r),n.push([s,a]),a&&a.replaceChild(s,e);});var a=t.cloneNode(!0);return n.map(function(t,n){t[1]&&(t[1].replaceChild(i[n],t[0]),e[n][0]=i[n]);}),a}function ut(t,e,i){if(0!==i.length){var n=lt(e,i);e.parentNode==t&&(t.removeChild(e),t.appendChild(n)),setTimeout(function(){n.parentNode==t&&(t.removeChild(n),t.appendChild(e));},fe);}}function ht(t,e){var i=document.createElement("a");i.style="display: none";var n=new Blob(e,{type:"image/svg+xml; charset=utf-8"}),a=window.URL.createObjectURL(n);i.href=a,i.download=t,document.body.appendChild(i),i.click(),setTimeout(function(){document.body.removeChild(i),window.URL.revokeObjectURL(a);},300);}function ct(e){var i=e.cloneNode(!0);i.classList.add("chart-container"),i.setAttribute("xmlns","http://www.w3.org/2000/svg"),i.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink");var n=t.create("style",{innerHTML:me});i.insertBefore(n,i.firstChild);var a=t.create("div");return a.appendChild(i),a.innerHTML}function dt(t){var e=new Date(t);return e.setMinutes(e.getMinutes()-e.getTimezoneOffset()),e}function pt(t){var e=t.getDate(),i=t.getMonth()+1;return [t.getFullYear(),(i>9?"":"0")+i,(e>9?"":"0")+e].join("-")}function ft(t){return new Date(t.getTime())}function vt(t,e){var i=xt(t);return Math.ceil(gt(i,e)/xe)}function gt(t,e){var i=we*ke;return (dt(e)-dt(t))/i}function mt(t,e){return t.getMonth()===e.getMonth()&&t.getFullYear()===e.getFullYear()}function yt(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=Ae[t];return e?i.slice(0,3):i}function bt(t,e){return new Date(e,t+1,0)}function xt(t){var e=ft(t),i=e.getDay();return 0!==i&&kt(e,-1*i),e}function kt(t,e){t.setDate(t.getDate()+e);}function wt(t,e,i){var n=Object.keys(Le).filter(function(e){return t.includes(e)}),a=Le[n[0]];return Object.assign(a,{constants:e,getData:i}),new Te(a)}function At(t){if(0===t)return [0,0];if(isNaN(t))return {mantissa:-6755399441055744,exponent:972};var e=t>0?1:-1;if(!isFinite(t))return {mantissa:4503599627370496*e,exponent:972};t=Math.abs(t);var i=Math.floor(Math.log10(t));return [e*(t/Math.pow(10,i)),i]}function Pt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=Math.ceil(t),n=Math.floor(e),a=i-n,s=a,r=1;a>5&&(a%2!=0&&(a=++i-n),s=a/2,r=2),a<=2&&(r=a/(s=4)),0===a&&(s=5,r=1);for(var o=[],l=0;l<=s;l++)o.push(n+r*l);return o}function Tt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=At(t),n=Vt(i,2),a=n[0],s=n[1],r=e?e/Math.pow(10,s):0,o=Pt(a=a.toFixed(6),r);return o=o.map(function(t){return t*Math.pow(10,s)})}function Lt(t){function e(t,e){for(var i=Tt(t),n=i[1]-i[0],a=0,s=1;a1&&void 0!==arguments[1]&&arguments[1],n=Math.max.apply(Math,Ut(t)),a=Math.min.apply(Math,Ut(t)),s=[];if(n>=0&&a>=0)At(n)[1],s=i?Tt(n,a):Tt(n);else if(n>0&&a<0){var r=Math.abs(a);n>=r?(At(n)[1],s=e(n,r)):(At(r)[1],s=e(r,n).reverse().map(function(t){return -1*t}));}else if(n<=0&&a<=0){var o=Math.abs(a),l=Math.abs(n);At(o)[1],s=(s=i?Tt(o,l):Tt(o)).reverse().map(function(t){return -1*t});}return s}function Ot(t){var e=Mt(t);return t.indexOf(0)>=0?t.indexOf(0):t[0]>0?-1*t[0]/e:-1*t[t.length-1]/e+(t.length-1)}function Mt(t){return t[1]-t[0]}function Ct(t){return t[t.length-1]-t[0]}function Dt(t,e){return h(e.zeroLine-t*e.scaleMultiplier)}function Nt(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=e.reduce(function(e,i){return Math.abs(i-t)i?n.slice(0,i):c(n,i-n.length,0),t.values=n;}else t.values=a;t.chartType||(t.chartType=e);}),t.yRegions&&t.yRegions.map(function(t){if(t.end1&&void 0!==arguments[1]?arguments[1]:[],i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=t/e.length;n<=0&&(n=1);var a=n/Kt,s=void 0;if(i){var r=Math.max.apply(Math,Ut(e.map(function(t){return t.length})));s=Math.ceil(r/a);}return e.map(function(t,e){return (t+="").length>a&&(i?e%s!=0&&(t=""):t=a-3>0?t.slice(0,a-3)+" ...":t.slice(0,a)+".."),t})}function jt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"line",e=arguments[1],i=arguments[2];return "axis-mixed"===t?(i.type="line",new De(e,i)):Se[t]?new Se[t](e,i):void console.error("Undefined chart type: "+t)}!function(t,e){void 0===e&&(e={});var i=e.insertAt;if(t&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===i&&n.firstChild?n.insertBefore(a,n.firstChild):n.appendChild(a),a.styleSheet?a.styleSheet.cssText=t:a.appendChild(document.createTextNode(t));}}('.chart-container{position:relative;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif}.chart-container .axis,.chart-container .chart-label{fill:#555b51}.chart-container .axis line,.chart-container .chart-label line{stroke:#dadada}.chart-container .dataset-units circle{stroke:#fff;stroke-width:2}.chart-container .dataset-units path{fill:none;stroke-opacity:1;stroke-width:2px}.chart-container .dataset-path{stroke-width:2px}.chart-container .path-group path{fill:none;stroke-opacity:1;stroke-width:2px}.chart-container line.dashed{stroke-dasharray:5,3}.chart-container .axis-line .specific-value{text-anchor:start}.chart-container .axis-line .y-line{text-anchor:end}.chart-container .axis-line .x-line{text-anchor:middle}.chart-container .legend-dataset-text{fill:#6c7680;font-weight:600}.graph-svg-tip{position:absolute;z-index:99999;padding:10px;font-size:12px;color:#959da5;text-align:center;background:rgba(0,0,0,.8);border-radius:3px}.graph-svg-tip ol,.graph-svg-tip ul{padding-left:0;display:-webkit-box;display:-ms-flexbox;display:flex}.graph-svg-tip ul.data-point-list li{min-width:90px;-webkit-box-flex:1;-ms-flex:1;flex:1;font-weight:600}.graph-svg-tip strong{color:#dfe2e5;font-weight:600}.graph-svg-tip .svg-pointer{position:absolute;height:5px;margin:0 0 0 -5px;content:" ";border:5px solid transparent;border-top-color:rgba(0,0,0,.8)}.graph-svg-tip.comparison{padding:0;text-align:left;pointer-events:none}.graph-svg-tip.comparison .title{display:block;padding:10px;margin:0;font-weight:600;line-height:1;pointer-events:none}.graph-svg-tip.comparison ul{margin:0;white-space:nowrap;list-style:none}.graph-svg-tip.comparison li{display:inline-block;padding:5px 10px}');var Ft="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ht=(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}),It=function(){function t(t,e){for(var i=0;i\n\t\t\t\t\n\t\t\t\t'}),this.hideTip(),this.title=this.container.querySelector(".title"),this.dataPointList=this.container.querySelector(".data-point-list"),this.parent.addEventListener("mouseleave",function(){e.hideTip();});}},{key:"fill",value:function(){var e=this,i=void 0;this.index&&this.container.setAttribute("data-point-index",this.index),i=this.titleValueFirst?""+this.titleValue+""+this.titleName:this.titleName+""+this.titleValue+"",this.title.innerHTML=i,this.dataPointList.innerHTML="",this.listValues.map(function(i,n){var a=e.colors[n]||"black",s=0===i.formatted||i.formatted?i.formatted:i.value,r=t.create("li",{styles:{"border-top":"3px solid "+a},innerHTML:''+(0===s||s?s:"")+"\n\t\t\t\t\t"+(i.title?i.title:"")});e.dataPointList.appendChild(r);});}},{key:"calcPosition",value:function(){var t=this.container.offsetWidth;this.top=this.y-this.container.offsetHeight-5,this.left=this.x-t/2;var e=this.parent.offsetWidth-t,i=this.container.querySelector(".svg-pointer");if(this.left<0)i.style.left="calc(50% - "+-1*this.left+"px)",this.left=0;else if(this.left>e){var n="calc(50% + "+(this.left-e)+"px)";i.style.left=n,this.left=e;}else i.style.left="50%";}},{key:"setValues",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1;this.titleName=i.name,this.titleValue=i.value,this.listValues=n,this.x=t,this.y=e,this.titleValueFirst=i.valueFirst||0,this.index=a,this.refresh();}},{key:"hideTip",value:function(){this.container.style.top="0px",this.container.style.left="0px",this.container.style.opacity="0";}},{key:"showTip",value:function(){this.container.style.top=this.top+"px",this.container.style.left=this.left+"px",this.container.style.opacity="1";}}]),e}(),ee={"light-blue":"#7cd6fd",blue:"#5e64ff",violet:"#743ee2",red:"#ff5858",orange:"#ffa00a",yellow:"#feef72",green:"#28a745","light-green":"#98d85b",purple:"#b554ff",magenta:"#ffa3ef",black:"#36114C",grey:"#bdd3e6","light-grey":"#f0f4f7","dark-grey":"#b8c2cc"},ie=function(t){return /rgb[a]{0,1}\([\d, ]+\)/gim.test(t)?/\D+(\d*)\D+(\d*)\D+(\d*)/gim.exec(t).map(function(t,e){return 0!==e?Number(t).toString(16):"#"}).reduce(function(t,e){return ""+t+e}):ee[t]||t},ne=6,ae=4,se=15,re=10,oe="#dadada",le="#555b51",ue={bar:function(t){var e=void 0;"rect"!==t.nodeName&&(e=t.getAttribute("transform"),t=t.childNodes[0]);var i=t.cloneNode();return i.style.fill="#000000",i.style.opacity="0.4",e&&i.setAttribute("transform",e),i},dot:function(t){var e=void 0;"circle"!==t.nodeName&&(e=t.getAttribute("transform"),t=t.childNodes[0]);var i=t.cloneNode(),n=t.getAttribute("r"),a=t.getAttribute("fill");return i.setAttribute("r",parseInt(n)+4),i.setAttribute("fill",a),i.style.opacity="0.6",e&&i.setAttribute("transform",e),i},heat_square:function(t){var e=void 0;"circle"!==t.nodeName&&(e=t.getAttribute("transform"),t=t.childNodes[0]);var i=t.cloneNode(),n=t.getAttribute("r"),a=t.getAttribute("fill");return i.setAttribute("r",parseInt(n)+4),i.setAttribute("fill",a),i.style.opacity="0.6",e&&i.setAttribute("transform",e),i}},he={bar:function(t,e){var i=void 0;"rect"!==t.nodeName&&(i=t.getAttribute("transform"),t=t.childNodes[0]);var n=["x","y","width","height"];Object.values(t.attributes).filter(function(t){return n.includes(t.name)&&t.specified}).map(function(t){e.setAttribute(t.name,t.nodeValue);}),i&&e.setAttribute("transform",i);},dot:function(t,e){var i=void 0;"circle"!==t.nodeName&&(i=t.getAttribute("transform"),t=t.childNodes[0]);var n=["cx","cy"];Object.values(t.attributes).filter(function(t){return n.includes(t.name)&&t.specified}).map(function(t){e.setAttribute(t.name,t.nodeValue);}),i&&e.setAttribute("transform",i);},heat_square:function(t,e){var i=void 0;"circle"!==t.nodeName&&(i=t.getAttribute("transform"),t=t.childNodes[0]);var n=["cx","cy"];Object.values(t.attributes).filter(function(t){return n.includes(t.name)&&t.specified}).map(function(t){e.setAttribute(t.name,t.nodeValue);}),i&&e.setAttribute("transform",i);}},ce=350,de=350,pe=ce,fe=250,ve="easein",ge={ease:"0.25 0.1 0.25 1",linear:"0 0 1 1",easein:"0.1 0.8 0.2 1",easeout:"0 0 0.58 1",easeinout:"0.42 0 0.58 1"},me=".chart-container{position:relative;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Roboto','Oxygen','Ubuntu','Cantarell','Fira Sans','Droid Sans','Helvetica Neue',sans-serif}.chart-container .axis,.chart-container .chart-label{fill:#555b51}.chart-container .axis line,.chart-container .chart-label line{stroke:#dadada}.chart-container .dataset-units circle{stroke:#fff;stroke-width:2}.chart-container .dataset-units path{fill:none;stroke-opacity:1;stroke-width:2px}.chart-container .dataset-path{stroke-width:2px}.chart-container .path-group path{fill:none;stroke-opacity:1;stroke-width:2px}.chart-container line.dashed{stroke-dasharray:5,3}.chart-container .axis-line .specific-value{text-anchor:start}.chart-container .axis-line .y-line{text-anchor:end}.chart-container .axis-line .x-line{text-anchor:middle}.chart-container .legend-dataset-text{fill:#6c7680;font-weight:600}.graph-svg-tip{position:absolute;z-index:99999;padding:10px;font-size:12px;color:#959da5;text-align:center;background:rgba(0,0,0,.8);border-radius:3px}.graph-svg-tip ul{padding-left:0;display:flex}.graph-svg-tip ol{padding-left:0;display:flex}.graph-svg-tip ul.data-point-list li{min-width:90px;flex:1;font-weight:600}.graph-svg-tip strong{color:#dfe2e5;font-weight:600}.graph-svg-tip .svg-pointer{position:absolute;height:5px;margin:0 0 0 -5px;content:' ';border:5px solid transparent;border-top-color:rgba(0,0,0,.8)}.graph-svg-tip.comparison{padding:0;text-align:left;pointer-events:none}.graph-svg-tip.comparison .title{display:block;padding:10px;margin:0;font-weight:600;line-height:1;pointer-events:none}.graph-svg-tip.comparison ul{margin:0;white-space:nowrap;list-style:none}.graph-svg-tip.comparison li{display:inline-block;padding:5px 10px}",ye=function(){function e(t,i){if(Ht(this,e),i=g(i),this.parent="string"==typeof t?document.querySelector(t):t,!(this.parent instanceof HTMLElement))throw new Error("No `parent` element to render on was provided.");this.rawChartArgs=i,this.title=i.title||"",this.type=i.type||"",this.realData=this.prepareData(i.data),this.data=this.prepareFirstData(this.realData),this.colors=this.validateColors(i.colors,this.type),this.config={showTooltip:1,showLegend:1,isNavigable:i.isNavigable||0,animate:void 0!==i.animate?i.animate:1,truncateLegends:i.truncateLegends||1},this.measures=JSON.parse(JSON.stringify(Gt));var n=this.measures;this.setMeasures(i),this.title.length||(n.titleHeight=0),this.config.showLegend||(n.legendHeight=0),this.argHeight=i.height||n.baseHeight,this.state={},this.options={},this.initTimeout=qt,this.config.isNavigable&&(this.overlays=[]),this.configure(i);}return It(e,[{key:"prepareData",value:function(t){return t}},{key:"prepareFirstData",value:function(t){return t}},{key:"validateColors",value:function(t,e){var i=[];return (t=(t||[]).concat(Qt[e])).forEach(function(t){var e=ie(t);P(e)?i.push(e):console.warn('"'+t+'" is not a valid color.');}),i}},{key:"setMeasures",value:function(){}},{key:"configure",value:function(){var t=this,e=this.argHeight;this.baseHeight=e,this.height=e-l(this.measures),this.boundDrawFn=function(){return t.draw(!0)},ResizeObserver&&(this.resizeObserver=new ResizeObserver(this.boundDrawFn),this.resizeObserver.observe(this.parent)),window.addEventListener("resize",this.boundDrawFn),window.addEventListener("orientationchange",this.boundDrawFn);}},{key:"destroy",value:function(){this.resizeObserver&&this.resizeObserver.disconnect(),window.removeEventListener("resize",this.boundDrawFn),window.removeEventListener("orientationchange",this.boundDrawFn);}},{key:"setup",value:function(){this.makeContainer(),this.updateWidth(),this.makeTooltip(),this.draw(!1,!0);}},{key:"makeContainer",value:function(){this.parent.innerHTML="";var e={inside:this.parent,className:"chart-container"};this.independentWidth&&(e.styles={width:this.independentWidth+"px"}),this.container=t.create("div",e);}},{key:"makeTooltip",value:function(){this.tip=new te({parent:this.container,colors:this.colors}),this.bindTooltip();}},{key:"bindTooltip",value:function(){}},{key:"draw",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e&&i(this.parent)||(this.updateWidth(),this.calc(e),this.makeChartArea(),this.setupComponents(),this.components.forEach(function(e){return e.setup(t.drawArea)}),this.render(this.components,!1),n&&(this.data=this.realData,setTimeout(function(){t.update(t.data);},this.initTimeout)),this.renderLegend(),this.setupNavigation(n));}},{key:"calc",value:function(){}},{key:"updateWidth",value:function(){this.baseWidth=a(this.parent),this.width=this.baseWidth-u(this.measures);}},{key:"makeChartArea",value:function(){this.svg&&this.container.removeChild(this.svg);var t=this.measures;this.svg=C(this.container,"frappe-chart chart",this.baseWidth,this.baseHeight),this.svgDefs=D(this.svg),this.title.length&&(this.titleEL=Y("title",t.margins.left,t.margins.top,this.title,{fontSize:t.titleFontSize,fill:"#666666",dy:t.titleFontSize}));var e=r(t);this.drawArea=N(this.type+"-chart chart-draw-area","translate("+o(t)+", "+e+")"),this.config.showLegend&&(e+=this.height+t.paddings.bottom,this.legendArea=N("chart-legend","translate("+o(t)+", "+e+")")),this.title.length&&this.svg.appendChild(this.titleEL),this.svg.appendChild(this.drawArea),this.config.showLegend&&this.svg.appendChild(this.legendArea),this.updateTipOffset(o(t),r(t));}},{key:"updateTipOffset",value:function(t,e){this.tip.offset={x:t,y:e};}},{key:"setupComponents",value:function(){this.components=new Map;}},{key:"update",value:function(t){t||console.error("No data to update."),this.data=this.prepareData(t),this.calc(),this.render(this.components,this.config.animate),this.renderLegend();}},{key:"render",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.components,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.config.isNavigable&&this.overlays.map(function(t){return t.parentNode.removeChild(t)});var n=[];e.forEach(function(t){n=n.concat(t.update(i));}),n.length>0?(ut(this.container,this.svg,n),setTimeout(function(){e.forEach(function(t){return t.make()}),t.updateNav();},400)):(e.forEach(function(t){return t.make()}),this.updateNav());}},{key:"updateNav",value:function(){this.config.isNavigable&&(this.makeOverlay(),this.bindUnits());}},{key:"renderLegend",value:function(){}},{key:"setupNavigation",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.config.isNavigable&&e&&(this.bindOverlay(),this.keyActions={13:this.onEnterKey.bind(this),37:this.onLeftArrow.bind(this),38:this.onUpArrow.bind(this),39:this.onRightArrow.bind(this),40:this.onDownArrow.bind(this)},document.addEventListener("keydown",function(e){n(t.container)&&(e=e||window.event,t.keyActions[e.keyCode]&&t.keyActions[e.keyCode]());}));}},{key:"makeOverlay",value:function(){}},{key:"updateOverlay",value:function(){}},{key:"bindOverlay",value:function(){}},{key:"bindUnits",value:function(){}},{key:"onLeftArrow",value:function(){}},{key:"onRightArrow",value:function(){}},{key:"onUpArrow",value:function(){}},{key:"onDownArrow",value:function(){}},{key:"onEnterKey",value:function(){}},{key:"addDataPoint",value:function(){}},{key:"removeDataPoint",value:function(){}},{key:"getDataPoint",value:function(){}},{key:"setCurrentDataPoint",value:function(){}},{key:"updateDataset",value:function(){}},{key:"export",value:function(){var t=ct(this.svg);ht(this.title||"Chart",[t]);}}]),e}(),be=function(t){function e(t,i){return Ht(this,e),Bt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,i))}return Yt(e,t),It(e,[{key:"configure",value:function(t){Rt(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"configure",this).call(this,t),this.config.formatTooltipY=(t.tooltipOptions||{}).formatTooltipY,this.config.maxSlices=t.maxSlices||20,this.config.maxLegendPoints=t.maxLegendPoints||20;}},{key:"calc",value:function(){var t=this,e=this.state,i=this.config.maxSlices;e.sliceTotals=[];var n=this.data.labels.map(function(e,i){var n=0;return t.data.datasets.map(function(t){n+=t.values[i];}),[n,e]}).filter(function(t){return t[0]>=0}),a=n;if(n.length>i){n.sort(function(t,e){return e[0]-t[0]}),a=n.slice(0,i-1);var s=0;n.slice(i-1).map(function(t){s+=t[0];}),a.push([s,"Rest"]),this.colors[i-1]="grey";}e.labels=[],a.map(function(t){e.sliceTotals.push(v(t[0])),e.labels.push(t[1]);}),e.grandTotal=e.sliceTotals.reduce(function(t,e){return t+e},0),this.center={x:this.width/2,y:this.height/2};}},{key:"renderLegend",value:function(){var t=this,e=this.state;this.legendArea.textContent="",this.legendTotals=e.sliceTotals.slice(0,this.config.maxLegendPoints);var i=0,n=0;this.legendTotals.map(function(a,s){var r=150,o=Math.floor((t.width-u(t.measures))/r);t.legendTotals.lengtho&&(i=0,n+=20);var l=r*i+5,h=t.config.truncateLegends?b(e.labels[s],r/10):e.labels[s],c=t.config.formatTooltipY?t.config.formatTooltipY(a):a,d=R(l,n,5,t.colors[s],h+": "+c,!1);t.legendArea.appendChild(d),i++;});}}]),e}(ye),xe=7,ke=1e3,we=86400,Ae=["January","February","March","April","May","June","July","August","September","October","November","December"],Pe=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Te=function(){function t(e){var i=e.layerClass,n=void 0===i?"":i,a=e.layerTransform,s=void 0===a?"":a,r=e.constants,o=e.getData,l=e.makeElements,u=e.animateElements;Ht(this,t),this.layerTransform=s,this.constants=r,this.makeElements=l,this.getData=o,this.animateElements=u,this.store=[],this.labels=[],this.layerClass=n,this.layerClass="function"==typeof this.layerClass?this.layerClass():this.layerClass,this.refresh();}return It(t,[{key:"refresh",value:function(t){this.data=t||this.getData();}},{key:"setup",value:function(t){this.layer=N(this.layerClass,this.layerTransform,t);}},{key:"make",value:function(){this.render(this.data),this.oldData=this.data;}},{key:"render",value:function(t){var e=this;this.store=this.makeElements(t),this.layer.textContent="",this.store.forEach(function(t){e.layer.appendChild(t);}),this.labels.forEach(function(t){e.layer.appendChild(t);});}},{key:"update",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.refresh();var e=[];return t&&(e=this.animateElements(this.data)||[]),e}}]),t}(),Le={donutSlices:{layerClass:"donut-slices",makeElements:function(t){return t.sliceStrings.map(function(e,i){var n=S(e,"donut-path",t.colors[i],"none",t.strokeWidth);return n.style.transition="transform .3s;",n})},animateElements:function(t){return this.store.map(function(e,i){return st(e,t.sliceStrings[i])})}},pieSlices:{layerClass:"pie-slices",makeElements:function(t){return t.sliceStrings.map(function(e,i){var n=S(e,"pie-path","none",t.colors[i]);return n.style.transition="transform .3s;",n})},animateElements:function(t){return this.store.map(function(e,i){return st(e,t.sliceStrings[i])})}},percentageBars:{layerClass:"percentage-bars",makeElements:function(t){var e=this;return t.xPositions.map(function(i,n){return F(i,0,t.widths[n],e.constants.barHeight,e.constants.barDepth,t.colors[n])})},animateElements:function(t){if(t)return []}},yAxis:{layerClass:"y axis",makeElements:function(t){var e=this;return t.positions.map(function(i,n){return U(i,t.labels[n],e.constants.width,{mode:e.constants.mode,pos:e.constants.pos,shortenNumbers:e.constants.shortenNumbers})})},animateElements:function(t){var e=t.positions,i=t.labels,n=this.oldData.positions,a=this.oldData.labels,s=y(n,e),r=Vt(s,2);n=r[0],e=r[1];var o=y(a,i),l=Vt(o,2);return a=l[0],i=l[1],this.render({positions:n,labels:i}),this.store.map(function(t,i){return tt(t,e[i],n[i])})}},xAxis:{layerClass:"x axis",makeElements:function(t){var e=this;return t.positions.map(function(i,n){return G(i,t.calcLabels[n],e.constants.height,{mode:e.constants.mode,pos:e.constants.pos})})},animateElements:function(t){var e=t.positions,i=t.calcLabels,n=this.oldData.positions,a=this.oldData.calcLabels,s=y(n,e),r=Vt(s,2);n=r[0],e=r[1];var o=y(a,i),l=Vt(o,2);return a=l[0],i=l[1],this.render({positions:n,calcLabels:i}),this.store.map(function(t,i){return Z(t,e[i],n[i])})}},yMarkers:{layerClass:"y-markers",makeElements:function(t){var e=this;return t.map(function(t){return q(t.position,t.label,e.constants.width,{labelPos:t.options.labelPos,mode:"span",lineType:"dashed"})})},animateElements:function(t){var e=y(this.oldData,t),i=Vt(e,2);this.oldData=i[0];var n=(t=i[1]).map(function(t){return t.position}),a=t.map(function(t){return t.label}),s=t.map(function(t){return t.options}),r=this.oldData.map(function(t){return t.position});return this.render(r.map(function(t,e){return {position:r[e],label:a[e],options:s[e]}})),this.store.map(function(t,e){return tt(t,n[e],r[e])})}},yRegions:{layerClass:"y-regions",makeElements:function(t){var e=this;return t.map(function(t){return X(t.startPos,t.endPos,e.constants.width,t.label,{labelPos:t.options.labelPos})})},animateElements:function(t){var e=y(this.oldData,t),i=Vt(e,2);this.oldData=i[0];var n=(t=i[1]).map(function(t){return t.endPos}),a=t.map(function(t){return t.label}),s=t.map(function(t){return t.startPos}),r=t.map(function(t){return t.options}),o=this.oldData.map(function(t){return t.endPos}),l=this.oldData.map(function(t){return t.startPos});this.render(o.map(function(t,e){return {startPos:l[e],endPos:o[e],label:a[e],options:r[e]}}));var u=[];return this.store.map(function(t,e){u=u.concat(et(t,s[e],n[e],o[e]));}),u}},heatDomain:{layerClass:function(){return "heat-domain domain-"+this.constants.index},makeElements:function(t){var e=this,i=this.constants,n=i.index,a=i.colWidth,s=i.rowHeight,r=i.squareSize,o=i.radius,l=i.xTranslate,u=0;return this.serializedSubDomains=[],t.cols.map(function(t,i){1===i&&e.labels.push(Y("domain-name",l,-12,yt(n,!0).toUpperCase(),{fontSize:9})),t.map(function(t,i){if(t.fill){var n={"data-date":t.yyyyMmDd,"data-value":t.dataValue,"data-day":i},a=H("day",l,u,r,o,t.fill,n);e.serializedSubDomains.push(a);}u+=s;}),u=0,l+=a;}),this.serializedSubDomains},animateElements:function(t){if(t)return []}},barGraph:{layerClass:function(){return "dataset-units dataset-bars dataset-"+this.constants.index},makeElements:function(t){var e=this.constants;return this.unitType="bar",this.units=t.yPositions.map(function(i,n){return J(t.xPositions[n],i,t.barWidth,e.color,t.labels[n],n,t.offsets[n],{zeroLine:t.zeroLine,barsWidth:t.barsWidth,minHeight:e.minHeight})}),this.units},animateElements:function(t){var e=t.xPositions,i=t.yPositions,n=t.offsets,a=t.labels,s=this.oldData.xPositions,r=this.oldData.yPositions,o=this.oldData.offsets,l=this.oldData.labels,u=y(s,e),h=Vt(u,2);s=h[0],e=h[1];var c=y(r,i),d=Vt(c,2);r=d[0],i=d[1];var p=y(o,n),f=Vt(p,2);o=f[0],n=f[1];var v=y(l,a),g=Vt(v,2);l=g[0],a=g[1],this.render({xPositions:s,yPositions:r,offsets:o,labels:a,zeroLine:this.oldData.zeroLine,barsWidth:this.oldData.barsWidth,barWidth:this.oldData.barWidth});var m=[];return this.store.map(function(a,s){m=m.concat(it(a,e[s],i[s],t.barWidth,n[s],{zeroLine:t.zeroLine}));}),m}},lineGraph:{layerClass:function(){return "dataset-units dataset-line dataset-"+this.constants.index},makeElements:function(t){var e=this.constants;return this.unitType="dot",this.paths={},e.hideLine||(this.paths=$(t.xPositions,t.yPositions,e.color,{heatline:e.heatline,regionFill:e.regionFill,spline:e.spline},{svgDefs:e.svgDefs,zeroLine:t.zeroLine})),this.units=[],e.hideDots||(this.units=t.yPositions.map(function(i,n){return K(t.xPositions[n],i,t.radius,e.color,e.valuesOverPoints?t.values[n]:"",n)})),Object.values(this.paths).concat(this.units)},animateElements:function(t){var e=t.xPositions,i=t.yPositions,n=t.values,a=this.oldData.xPositions,s=this.oldData.yPositions,r=this.oldData.values,o=y(a,e),l=Vt(o,2);a=l[0],e=l[1];var u=y(s,i),h=Vt(u,2);s=h[0],i=h[1];var c=y(r,n),d=Vt(c,2);r=d[0],n=d[1],this.render({xPositions:a,yPositions:s,values:n,zeroLine:this.oldData.zeroLine,radius:this.oldData.radius});var p=[];return Object.keys(this.paths).length&&(p=p.concat(at(this.paths,e,i,t.zeroLine,this.constants.spline))),this.units.length&&this.units.map(function(t,n){p=p.concat(nt(t,e[n],i[n]));}),p}}},Oe=function(t){function i(t,e){Ht(this,i);var n=Bt(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,t,e));return n.type="percentage",n.setup(),n}return Yt(i,t),It(i,[{key:"setMeasures",value:function(t){var e=this.measures;this.barOptions=t.barOptions||{};var i=this.barOptions;i.height=i.height||20,i.depth=i.depth||Jt,e.paddings.right=30,e.legendHeight=60,e.baseHeight=8*(i.height+.5*i.depth);}},{key:"setupComponents",value:function(){var t=this.state,e=[["percentageBars",{barHeight:this.barOptions.height,barDepth:this.barOptions.depth},function(){return {xPositions:t.xPositions,widths:t.widths,colors:this.colors}}.bind(this)]];this.components=new Map(e.map(function(t){var e=wt.apply(void 0,Ut(t));return [t[0],e]}));}},{key:"calc",value:function(){var t=this;Rt(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"calc",this).call(this);var e=this.state;e.xPositions=[],e.widths=[];var n=0;e.sliceTotals.map(function(i){var a=t.width*i/e.grandTotal;e.widths.push(a),e.xPositions.push(n),n+=a;});}},{key:"makeDataByIndex",value:function(){}},{key:"bindTooltip",value:function(){var t=this,i=this.state;this.container.addEventListener("mousemove",function(n){var a=t.components.get("percentageBars").store,s=n.target;if(a.includes(s)){var r=a.indexOf(s),o=e(t.container),l=e(s),u=l.left-o.left+parseInt(s.getAttribute("width"))/2,h=l.top-o.top,c=(t.formattedLabels&&t.formattedLabels.length>0?t.formattedLabels[r]:t.state.labels[r])+": ",d=i.sliceTotals[r]/i.grandTotal;t.tip.setValues(u,h,{name:c,value:(100*d).toFixed(1)+"%"}),t.tip.showTip();}});}}]),i}(be),Me=function(t){function i(t,e){Ht(this,i);var n=Bt(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,t,e));return n.type="pie",n.initTimeout=0,n.init=1,n.setup(),n}return Yt(i,t),It(i,[{key:"configure",value:function(t){Rt(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"configure",this).call(this,t),this.mouseMove=this.mouseMove.bind(this),this.mouseLeave=this.mouseLeave.bind(this),this.hoverRadio=t.hoverRadio||.1,this.config.startAngle=t.startAngle||0,this.clockWise=t.clockWise||!1;}},{key:"calc",value:function(){var t=this;Rt(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"calc",this).call(this);var e=this.state;this.radius=this.height>this.width?this.center.x:this.center.y;var n=this.radius,a=this.clockWise,s=e.slicesProperties||[];e.sliceStrings=[],e.slicesProperties=[];var r=180-this.config.startAngle;e.sliceTotals.map(function(i,o){var l=r,u=i/e.grandTotal*360,h=u>180?1:0,c=a?-u:u,d=r+=c,f=p(l,n),v=p(d,n),g=t.init&&s[o],m=void 0,y=void 0;t.init?(m=g?g.startPosition:f,y=g?g.endPosition:f):(m=f,y=v);var b=360===u?_(m,y,t.center,t.radius,a,h):E(m,y,t.center,t.radius,a,h);e.sliceStrings.push(b),e.slicesProperties.push({startPosition:f,endPosition:v,value:i,total:e.grandTotal,startAngle:l,endAngle:d,angle:c});}),this.init=0;}},{key:"setupComponents",value:function(){var t=this.state,e=[["pieSlices",{},function(){return {sliceStrings:t.sliceStrings,colors:this.colors}}.bind(this)]];this.components=new Map(e.map(function(t){var e=wt.apply(void 0,Ut(t));return [t[0],e]}));}},{key:"calTranslateByAngle",value:function(t){var e=this.radius,i=this.hoverRadio,n=p(t.startAngle+t.angle/2,e);return "translate3d("+n.x*i+"px,"+n.y*i+"px,0)"}},{key:"hoverSlice",value:function(t,i,n,a){if(t){var s=this.colors[i];if(n){ot(t,this.calTranslateByAngle(this.state.slicesProperties[i])),t.style.fill=A(s,50);var r=e(this.svg),o=a.pageX-r.left+10,l=a.pageY-r.top-10,u=(this.formatted_labels&&this.formatted_labels.length>0?this.formatted_labels[i]:this.state.labels[i])+": ",h=(100*this.state.sliceTotals[i]/this.state.grandTotal).toFixed(1);this.tip.setValues(o,l,{name:u,value:h+"%"}),this.tip.showTip();}else ot(t,"translate3d(0,0,0)"),this.tip.hideTip(),t.style.fill=s;}}},{key:"bindTooltip",value:function(){this.container.addEventListener("mousemove",this.mouseMove),this.container.addEventListener("mouseleave",this.mouseLeave);}},{key:"mouseMove",value:function(t){var e=t.target,i=this.components.get("pieSlices").store,n=this.curActiveSliceIndex,a=this.curActiveSlice;if(i.includes(e)){var s=i.indexOf(e);this.hoverSlice(a,n,!1),this.curActiveSlice=e,this.curActiveSliceIndex=s,this.hoverSlice(e,s,!0,t);}else this.mouseLeave();}},{key:"mouseLeave",value:function(){this.hoverSlice(this.curActiveSlice,this.curActiveSliceIndex,!1);}}]),i}(be),Ce=function(t){function e(t,i){Ht(this,e);var n=Bt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,i));n.type="heatmap",n.countLabel=i.countLabel||"";var a=["Sunday","Monday"],s=a.includes(i.startSubDomain)?i.startSubDomain:"Sunday";return n.startSubDomainIndex=a.indexOf(s),n.setup(),n}return Yt(e,t),It(e,[{key:"setMeasures",value:function(t){var e=this.measures;this.discreteDomains=0===t.discreteDomains?0:1,e.paddings.top=36,e.paddings.bottom=0,e.legendHeight=24,e.baseHeight=12*xe+l(e);var i=this.data,n=this.discreteDomains?12:0;this.independentWidth=12*(vt(i.start,i.end)+n)+u(e);}},{key:"updateWidth",value:function(){var t=this.discreteDomains?12:0,e=this.state.noOfWeeks?this.state.noOfWeeks:52;this.baseWidth=12*(e+t)+u(this.measures);}},{key:"prepareData",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.data;if(t.start&&t.end&&t.start>t.end)throw new Error("Start date cannot be greater than end date.");if(t.start||(t.start=new Date,t.start.setFullYear(t.start.getFullYear()-1)),t.end||(t.end=new Date),t.dataPoints=t.dataPoints||{},parseInt(Object.keys(t.dataPoints)[0])>1e5){var e={};Object.keys(t.dataPoints).forEach(function(i){var n=new Date(i*ke);e[pt(n)]=t.dataPoints[i];}),t.dataPoints=e;}return t}},{key:"calc",value:function(){var t=this.state;t.start=ft(this.data.start),t.end=ft(this.data.end),t.firstWeekStart=ft(t.start),t.noOfWeeks=vt(t.start,t.end),t.distribution=St(Object.values(this.data.dataPoints),5),t.domainConfigs=this.getDomains();}},{key:"setupComponents",value:function(){var t=this,e=this.state,i=this.discreteDomains?0:1,n=e.domainConfigs.map(function(n,a){return ["heatDomain",{index:n.index,colWidth:12,rowHeight:12,squareSize:10,radius:t.rawChartArgs.radius||0,xTranslate:12*e.domainConfigs.filter(function(t,e){return e1&&void 0!==arguments[1]?arguments[1]:"",i=[t.getMonth(),t.getFullYear()],n=i[0],a=i[1],s=xt(t),r={index:n,cols:[]};kt(e=ft(e)||bt(n,a),1);for(var o=vt(s,e),l=[],u=void 0,h=0;h2&&void 0!==arguments[2]&&arguments[2],n=this.state,a=ft(t),s=[],r=0;r=n.start&&a<=n.end;i||a.getMonth()!==e||!l?o.yyyyMmDd=pt(a):o=this.getSubDomainConfig(a),s.push(o);}return s}},{key:"getSubDomainConfig",value:function(t){var e=pt(t),i=this.data.dataPoints[e];return {yyyyMmDd:e,dataValue:i||0,fill:this.colors[Et(i,this.state.distribution)]}}}]),e}(ye),De=function(t){function i(t,e){Ht(this,i);var n=Bt(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,t,e));return n.barOptions=e.barOptions||{},n.lineOptions=e.lineOptions||{},n.type=e.type||"line",n.init=1,n.setup(),n}return Yt(i,t),It(i,[{key:"setMeasures",value:function(){this.data.datasets.length<=1&&(this.config.showLegend=0,this.measures.paddings.bottom=30);}},{key:"configure",value:function(t){Rt(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"configure",this).call(this,t),t.axisOptions=t.axisOptions||{},t.tooltipOptions=t.tooltipOptions||{},this.config.xAxisMode=t.axisOptions.xAxisMode||"span",this.config.yAxisMode=t.axisOptions.yAxisMode||"span",this.config.xIsSeries=t.axisOptions.xIsSeries||0,this.config.shortenYAxisNumbers=t.axisOptions.shortenYAxisNumbers||0,this.config.formatTooltipX=t.tooltipOptions.formatTooltipX,this.config.formatTooltipY=t.tooltipOptions.formatTooltipY,this.config.valuesOverPoints=t.valuesOverPoints;}},{key:"prepareData",value:function(){return _t(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.data,this.type)}},{key:"prepareFirstData",value:function(){return zt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.data)}},{key:"calc",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.calcXPositions(),t||this.calcYAxisParameters(this.getAllYValues(),"line"===this.type),this.makeDataByIndex();}},{key:"calcXPositions",value:function(){var t=this.state,e=this.data.labels;t.datasetLength=e.length,t.unitWidth=this.width/t.datasetLength,t.xOffset=t.unitWidth/2,t.xAxis={labels:e,positions:e.map(function(e,i){return h(t.xOffset+i*t.unitWidth)})};}},{key:"calcYAxisParameters",value:function(t){var e=Lt(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"false"),i=this.height/Ct(e),n=Mt(e)*i,a=this.height-Ot(e)*n;this.state.yAxis={labels:e,positions:e.map(function(t){return a-t*i}),scaleMultiplier:i,zeroLine:a},this.calcDatasetPoints(),this.calcYExtremes(),this.calcYRegions();}},{key:"calcDatasetPoints",value:function(){var t=this.state,e=function(e){return e.map(function(e){return Dt(e,t.yAxis)})};t.datasets=this.data.datasets.map(function(t,i){var n=t.values,a=t.cumulativeYs||[];return {name:t.name&&t.name.replace(/<|>|&/g,function(t){return "&"==t?"&":"<"==t?"<":">"}),index:i,chartType:t.chartType,values:n,yPositions:e(n),cumulativeYs:a,cumulativeYPos:e(a)}});}},{key:"calcYExtremes",value:function(){var t=this.state;if(this.barOptions.stacked)return void(t.yExtremes=t.datasets[t.datasets.length-1].cumulativeYPos);t.yExtremes=new Array(t.datasetLength).fill(9999),t.datasets.map(function(e){e.yPositions.map(function(e,i){er(n)?t.mapTooltipXPosition(s):t.tip.hideTip();});}},{key:"mapTooltipXPosition",value:function(t){var e=this.state;if(e.yExtremes){var i=Nt(t,e.xAxis.positions,!0);if(i>=0){var n=this.dataByIndex[i];this.tip.setValues(n.xPos+this.tip.offset.x,n.yExtreme+this.tip.offset.y,{name:n.formattedLabel,value:""},n.values,i),this.tip.showTip();}}}},{key:"renderLegend",value:function(){var t=this,e=this.data;e.datasets.length>1&&(this.legendArea.textContent="",e.datasets.map(function(e,i){var n=I(100*i,"0",100,t.colors[i],e.name,t.config.truncateLegends);t.legendArea.appendChild(n);}));}},{key:"makeOverlay",value:function(){var t=this;if(this.init)return void(this.init=0);this.overlayGuides&&this.overlayGuides.forEach(function(t){var e=t.overlay;e.parentNode.removeChild(e);}),this.overlayGuides=this.dataUnitComponents.map(function(t){return {type:t.unitType,overlay:void 0,units:t.units}}),void 0===this.state.currentIndex&&(this.state.currentIndex=this.state.datasetLength-1),this.overlayGuides.map(function(e){var i=e.units[t.state.currentIndex];e.overlay=ue[e.type](i),t.drawArea.appendChild(e.overlay);});}},{key:"updateOverlayGuides",value:function(){this.overlayGuides&&this.overlayGuides.forEach(function(t){var e=t.overlay;e.parentNode.removeChild(e);});}},{key:"bindOverlay",value:function(){var t=this;this.parent.addEventListener("data-select",function(){t.updateOverlay();});}},{key:"bindUnits",value:function(){var t=this;this.dataUnitComponents.map(function(e){e.units.map(function(e){e.addEventListener("click",function(){var i=e.getAttribute("data-point-index");t.setCurrentDataPoint(i);});});}),this.tip.container.addEventListener("click",function(){var e=t.tip.container.getAttribute("data-point-index");t.setCurrentDataPoint(e);});}},{key:"updateOverlay",value:function(){var t=this;this.overlayGuides.map(function(e){var i=e.units[t.state.currentIndex];he[e.type](i,e.overlay);});}},{key:"onLeftArrow",value:function(){this.setCurrentDataPoint(this.state.currentIndex-1);}},{key:"onRightArrow",value:function(){this.setCurrentDataPoint(this.state.currentIndex+1);}},{key:"getDataPoint",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state.currentIndex,e=this.state;return {index:t,label:e.xAxis.labels[t],values:e.datasets.map(function(e){return e.values[t]})}}},{key:"setCurrentDataPoint",value:function(t){var e=this.state;(t=parseInt(t))<0&&(t=0),t>=e.xAxis.labels.length&&(t=e.xAxis.labels.length-1),t!==e.currentIndex&&(e.currentIndex=t,s(this.parent,"data-select",this.getDataPoint()));}},{key:"addDataPoint",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.state.datasetLength;Rt(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"addDataPoint",this).call(this,t,e,n),this.data.labels.splice(n,0,t),this.data.datasets.map(function(t,i){t.values.splice(n,0,e[i]);}),this.update(this.data);}},{key:"removeDataPoint",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state.datasetLength-1;this.data.labels.length<=1||(Rt(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"removeDataPoint",this).call(this,t),this.data.labels.splice(t,1),this.data.datasets.map(function(e){e.values.splice(t,1);}),this.update(this.data));}},{key:"updateDataset",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.data.datasets[e].values=t,this.update(this.data);}},{key:"updateDatasets",value:function(t){this.data.datasets.map(function(e,i){t[i]&&(e.values=t[i]);}),this.update(this.data);}}]),i}(ye),Ne=function(t){function i(t,e){Ht(this,i);var n=Bt(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,t,e));return n.type="donut",n.initTimeout=0,n.init=1,n.setup(),n}return Yt(i,t),It(i,[{key:"configure",value:function(t){Rt(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"configure",this).call(this,t),this.mouseMove=this.mouseMove.bind(this),this.mouseLeave=this.mouseLeave.bind(this),this.hoverRadio=t.hoverRadio||.1,this.config.startAngle=t.startAngle||0,this.clockWise=t.clockWise||!1,this.strokeWidth=t.strokeWidth||30;}},{key:"calc",value:function(){var t=this;Rt(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"calc",this).call(this);var e=this.state;this.radius=this.height>this.width?this.center.x-this.strokeWidth/2:this.center.y-this.strokeWidth/2;var n=this.radius,a=this.clockWise,s=e.slicesProperties||[];e.sliceStrings=[],e.slicesProperties=[];var r=180-this.config.startAngle;e.sliceTotals.map(function(i,o){var l=r,u=i/e.grandTotal*360,h=u>180?1:0,c=a?-u:u,d=r+=c,f=p(l,n),v=p(d,n),g=t.init&&s[o],m=void 0,y=void 0;t.init?(m=g?g.startPosition:f,y=g?g.endPosition:f):(m=f,y=v);var b=360===u?W(m,y,t.center,t.radius,t.clockWise,h):z(m,y,t.center,t.radius,t.clockWise,h);e.sliceStrings.push(b),e.slicesProperties.push({startPosition:f,endPosition:v,value:i,total:e.grandTotal,startAngle:l,endAngle:d,angle:c});}),this.init=0;}},{key:"setupComponents",value:function(){var t=this.state,e=[["donutSlices",{},function(){return {sliceStrings:t.sliceStrings,colors:this.colors,strokeWidth:this.strokeWidth}}.bind(this)]];this.components=new Map(e.map(function(t){var e=wt.apply(void 0,Ut(t));return [t[0],e]}));}},{key:"calTranslateByAngle",value:function(t){var e=this.radius,i=this.hoverRadio,n=p(t.startAngle+t.angle/2,e);return "translate3d("+n.x*i+"px,"+n.y*i+"px,0)"}},{key:"hoverSlice",value:function(t,i,n,a){if(t){var s=this.colors[i];if(n){ot(t,this.calTranslateByAngle(this.state.slicesProperties[i])),t.style.stroke=A(s,50);var r=e(this.svg),o=a.pageX-r.left+10,l=a.pageY-r.top-10,u=(this.formatted_labels&&this.formatted_labels.length>0?this.formatted_labels[i]:this.state.labels[i])+": ",h=(100*this.state.sliceTotals[i]/this.state.grandTotal).toFixed(1);this.tip.setValues(o,l,{name:u,value:h+"%"}),this.tip.showTip();}else ot(t,"translate3d(0,0,0)"),this.tip.hideTip(),t.style.stroke=s;}}},{key:"bindTooltip",value:function(){this.container.addEventListener("mousemove",this.mouseMove),this.container.addEventListener("mouseleave",this.mouseLeave);}},{key:"mouseMove",value:function(t){var e=t.target,i=this.components.get("donutSlices").store,n=this.curActiveSliceIndex,a=this.curActiveSlice;if(i.includes(e)){var s=i.indexOf(e);this.hoverSlice(a,n,!1),this.curActiveSlice=e,this.curActiveSliceIndex=s,this.hoverSlice(e,s,!0,t);}else this.mouseLeave();}},{key:"mouseLeave",value:function(){this.hoverSlice(this.curActiveSlice,this.curActiveSliceIndex,!1);}}]),i}(be),Se={bar:De,line:De,percentage:Oe,heatmap:Ce,pie:Me,donut:Ne},Ee=function t(e,i){return Ht(this,t),jt(i.type,e,i)},_e=Object.freeze({Chart:Ee,PercentageChart:Oe,PieChart:Me,Heatmap:Ce,AxisChart:De}),ze={};return ze.NAME="Frappe Charts",ze.VERSION="1.6.2",ze=Object.assign({},ze,_e)});
-
- });
-
- /* node_modules\svelte-frappe-charts\src\components\base.svelte generated by Svelte v3.46.4 */
- const file$6 = "node_modules\\svelte-frappe-charts\\src\\components\\base.svelte";
-
- function create_fragment$6(ctx) {
- let div;
- let mounted;
- let dispose;
-
- const block = {
- c: function create() {
- div = element("div");
- add_location(div, file$6, 89, 0, 2072);
- },
- 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[18](div);
-
- if (!mounted) {
- dispose = listen_dev(div, "data-select", /*data_select_handler*/ ctx[17], false, false, false);
- mounted = true;
- }
- },
- p: noop,
- i: noop,
- o: noop,
- d: function destroy(detaching) {
- if (detaching) detach_dev(div);
- /*div_binding*/ ctx[18](null);
- mounted = false;
- dispose();
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_fragment$6.name,
- type: "component",
- source: "",
- ctx
- });
-
- return block;
- }
-
- function instance$6($$self, $$props, $$invalidate) {
- let { $$slots: slots = {}, $$scope } = $$props;
- validate_slots('Base', slots, []);
-
- let { data = {
- labels: [],
- datasets: [{ values: [] }],
- yMarkers: {},
- yRegions: []
- } } = $$props;
-
- let { title = '' } = $$props;
- let { type = 'line' } = $$props;
- let { height = 300 } = $$props;
- let { animate = true } = $$props;
- let { axisOptions = {} } = $$props;
- let { barOptions = {} } = $$props;
- let { lineOptions = {} } = $$props;
- let { tooltipOptions = {} } = $$props;
- let { colors = [] } = $$props;
- let { valuesOverPoints = 0 } = $$props;
- let { isNavigable = false } = $$props;
- let { maxSlices = 3 } = $$props;
-
- /**
- * COMPONENT
- */
- // The Chart returned from frappe
- let chart = null;
-
- // DOM node for frappe to latch onto
- let chartRef;
-
- // Helper HOF for calling a fn only if chart exists
- function ifChartThen(fn) {
- return function ifChart(...args) {
- if (chart) {
- return fn(...args);
- }
- };
- }
-
- const addDataPoint = ifChartThen((label, valueFromEachDataset, index) => chart.addDataPoint(label, valueFromEachDataset, index));
- const removeDataPoint = ifChartThen(index => chart.removeDataPoint(index));
- const exportChart = ifChartThen(() => chart.export());
-
- // Update the chart when incoming data changes
- const updateChart = ifChartThen(newData => chart.update(newData));
-
- /**
- * Handle initializing the chart when this Svelte component mounts
- */
- onMount(() => {
- chart = new frappeCharts_min_umd.Chart(chartRef,
- {
- data,
- title,
- type,
- height,
- animate,
- colors,
- axisOptions,
- barOptions,
- lineOptions,
- tooltipOptions,
- valuesOverPoints,
- isNavigable,
- maxSlices
- });
- });
-
- // Mark Chart references for garbage collection when component is unmounted
- onDestroy(() => {
- chart = null;
- });
-
- const writable_props = [
- 'data',
- 'title',
- 'type',
- 'height',
- 'animate',
- 'axisOptions',
- 'barOptions',
- 'lineOptions',
- 'tooltipOptions',
- 'colors',
- 'valuesOverPoints',
- 'isNavigable',
- 'maxSlices'
- ];
-
- Object.keys($$props).forEach(key => {
- if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(` was created with unknown prop '${key}'`);
- });
-
- function data_select_handler(event) {
- bubble.call(this, $$self, event);
- }
-
- function div_binding($$value) {
- binding_callbacks[$$value ? 'unshift' : 'push'](() => {
- chartRef = $$value;
- $$invalidate(0, chartRef);
- });
- }
-
- $$self.$$set = $$props => {
- if ('data' in $$props) $$invalidate(1, data = $$props.data);
- if ('title' in $$props) $$invalidate(2, title = $$props.title);
- if ('type' in $$props) $$invalidate(3, type = $$props.type);
- if ('height' in $$props) $$invalidate(4, height = $$props.height);
- if ('animate' in $$props) $$invalidate(5, animate = $$props.animate);
- if ('axisOptions' in $$props) $$invalidate(6, axisOptions = $$props.axisOptions);
- if ('barOptions' in $$props) $$invalidate(7, barOptions = $$props.barOptions);
- if ('lineOptions' in $$props) $$invalidate(8, lineOptions = $$props.lineOptions);
- if ('tooltipOptions' in $$props) $$invalidate(9, tooltipOptions = $$props.tooltipOptions);
- if ('colors' in $$props) $$invalidate(10, colors = $$props.colors);
- if ('valuesOverPoints' in $$props) $$invalidate(11, valuesOverPoints = $$props.valuesOverPoints);
- if ('isNavigable' in $$props) $$invalidate(12, isNavigable = $$props.isNavigable);
- if ('maxSlices' in $$props) $$invalidate(13, maxSlices = $$props.maxSlices);
- };
-
- $$self.$capture_state = () => ({
- onMount,
- onDestroy,
- Chart: frappeCharts_min_umd.Chart,
- data,
- title,
- type,
- height,
- animate,
- axisOptions,
- barOptions,
- lineOptions,
- tooltipOptions,
- colors,
- valuesOverPoints,
- isNavigable,
- maxSlices,
- chart,
- chartRef,
- ifChartThen,
- addDataPoint,
- removeDataPoint,
- exportChart,
- updateChart
- });
-
- $$self.$inject_state = $$props => {
- if ('data' in $$props) $$invalidate(1, data = $$props.data);
- if ('title' in $$props) $$invalidate(2, title = $$props.title);
- if ('type' in $$props) $$invalidate(3, type = $$props.type);
- if ('height' in $$props) $$invalidate(4, height = $$props.height);
- if ('animate' in $$props) $$invalidate(5, animate = $$props.animate);
- if ('axisOptions' in $$props) $$invalidate(6, axisOptions = $$props.axisOptions);
- if ('barOptions' in $$props) $$invalidate(7, barOptions = $$props.barOptions);
- if ('lineOptions' in $$props) $$invalidate(8, lineOptions = $$props.lineOptions);
- if ('tooltipOptions' in $$props) $$invalidate(9, tooltipOptions = $$props.tooltipOptions);
- if ('colors' in $$props) $$invalidate(10, colors = $$props.colors);
- if ('valuesOverPoints' in $$props) $$invalidate(11, valuesOverPoints = $$props.valuesOverPoints);
- if ('isNavigable' in $$props) $$invalidate(12, isNavigable = $$props.isNavigable);
- if ('maxSlices' in $$props) $$invalidate(13, maxSlices = $$props.maxSlices);
- if ('chart' in $$props) chart = $$props.chart;
- if ('chartRef' in $$props) $$invalidate(0, chartRef = $$props.chartRef);
- };
-
- if ($$props && "$$inject" in $$props) {
- $$self.$inject_state($$props.$$inject);
- }
-
- $$self.$$.update = () => {
- if ($$self.$$.dirty & /*data*/ 2) {
- updateChart(data);
- }
- };
-
- return [
- chartRef,
- data,
- title,
- type,
- height,
- animate,
- axisOptions,
- barOptions,
- lineOptions,
- tooltipOptions,
- colors,
- valuesOverPoints,
- isNavigable,
- maxSlices,
- addDataPoint,
- removeDataPoint,
- exportChart,
- data_select_handler,
- div_binding
- ];
- }
-
- class Base extends SvelteComponentDev {
- constructor(options) {
- super(options);
-
- init(this, options, instance$6, create_fragment$6, safe_not_equal, {
- data: 1,
- title: 2,
- type: 3,
- height: 4,
- animate: 5,
- axisOptions: 6,
- barOptions: 7,
- lineOptions: 8,
- tooltipOptions: 9,
- colors: 10,
- valuesOverPoints: 11,
- isNavigable: 12,
- maxSlices: 13,
- addDataPoint: 14,
- removeDataPoint: 15,
- exportChart: 16
- });
-
- dispatch_dev("SvelteRegisterComponent", {
- component: this,
- tagName: "Base",
- options,
- id: create_fragment$6.name
- });
- }
-
- get data() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set data(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
-
- get title() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set title(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
-
- get type() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set type(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
-
- get height() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set height(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
-
- get animate() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set animate(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
-
- get axisOptions() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set axisOptions(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
-
- get barOptions() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set barOptions(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
-
- get lineOptions() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set lineOptions(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
-
- get tooltipOptions() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set tooltipOptions(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
-
- get colors() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set colors(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
-
- get valuesOverPoints() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set valuesOverPoints(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
-
- get isNavigable() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set isNavigable(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
-
- get maxSlices() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set maxSlices(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
-
- get addDataPoint() {
- return this.$$.ctx[14];
- }
-
- set addDataPoint(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
-
- get removeDataPoint() {
- return this.$$.ctx[15];
- }
-
- set removeDataPoint(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
-
- get exportChart() {
- return this.$$.ctx[16];
- }
-
- set exportChart(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
- }
-
- var Base$1 = Base;
-
- /* src\pages\Utilities.svelte generated by Svelte v3.46.4 */
-
- const { console: console_1$2 } = globals;
- const file$5 = "src\\pages\\Utilities.svelte";
-
- // (47:0)
- function create_default_slot_1$2(ctx) {
- let button;
- let mounted;
- let dispose;
-
- const block = {
- c: function create() {
- button = element("button");
- button.textContent = `${"Проверить"}`;
- attr_dev(button, "class", "btn-lg");
- add_location(button, file$5, 47, 2, 1370);
- },
- m: function mount(target, anchor) {
- insert_dev(target, button, anchor);
-
- if (!mounted) {
- dispose = listen_dev(button, "click", /*click_handler*/ ctx[3], false, false, false);
- mounted = true;
- }
- },
- p: noop,
- d: function destroy(detaching) {
- if (detaching) detach_dev(button);
- mounted = false;
- dispose();
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_default_slot_1$2.name,
- type: "slot",
- source: "(47:0) ",
- ctx
- });
-
- return block;
- }
-
- // (51:0)
- function create_default_slot$4(ctx) {
- let chart;
- let current;
-
- chart = new Base$1({
- props: { data: /*datachart*/ ctx[0], type: "line" },
- $$inline: true
- });
-
- const block = {
- c: function create() {
- create_component(chart.$$.fragment);
- },
- m: function mount(target, anchor) {
- mount_component(chart, target, anchor);
- current = true;
- },
- p: noop,
- i: function intro(local) {
- if (current) return;
- transition_in(chart.$$.fragment, local);
- current = true;
- },
- o: function outro(local) {
- transition_out(chart.$$.fragment, local);
- current = false;
- },
- d: function destroy(detaching) {
- destroy_component(chart, detaching);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_default_slot$4.name,
- type: "slot",
- source: "(51:0) ",
- ctx
- });
-
- return block;
- }
-
- function create_fragment$5(ctx) {
- let alarm0;
- let t;
- let alarm1;
- let current;
-
- alarm0 = new Alarm({
- props: {
- $$slots: { default: [create_default_slot_1$2] },
- $$scope: { ctx }
- },
- $$inline: true
- });
-
- alarm1 = new Alarm({
- props: {
- $$slots: { default: [create_default_slot$4] },
- $$scope: { ctx }
- },
- $$inline: true
- });
-
- const block = {
- c: function create() {
- create_component(alarm0.$$.fragment);
- t = space();
- create_component(alarm1.$$.fragment);
- },
- 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) {
- mount_component(alarm0, target, anchor);
- insert_dev(target, t, anchor);
- mount_component(alarm1, target, anchor);
- current = true;
- },
- p: function update(ctx, [dirty]) {
- const alarm0_changes = {};
-
- if (dirty & /*$$scope*/ 64) {
- alarm0_changes.$$scope = { dirty, ctx };
- }
-
- alarm0.$set(alarm0_changes);
- const alarm1_changes = {};
-
- if (dirty & /*$$scope*/ 64) {
- alarm1_changes.$$scope = { dirty, ctx };
- }
-
- alarm1.$set(alarm1_changes);
- },
- i: function intro(local) {
- if (current) return;
- transition_in(alarm0.$$.fragment, local);
- transition_in(alarm1.$$.fragment, local);
- current = true;
- },
- o: function outro(local) {
- transition_out(alarm0.$$.fragment, local);
- transition_out(alarm1.$$.fragment, local);
- current = false;
- },
- d: function destroy(detaching) {
- destroy_component(alarm0, detaching);
- if (detaching) detach_dev(t);
- destroy_component(alarm1, detaching);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_fragment$5.name,
- type: "component",
- source: "",
- ctx
- });
-
- return block;
- }
-
- function joinWithoutDupes(A, B) {
- let output = [];
- const a = new Set(A.map(x => x.item));
- const b = new Set(B.map(x => x.item));
- output = [...A.filter(x => !b.has(x.item)), ...B.filter(x => !a.has(x.item))];
- console.log(output);
- }
-
- function joinWithoutDupesAndRmooving(A, B) {
- var ids = new Set(A.map(d => d.ID));
- let output = [...A, ...B.filter(d => !ids.has(d.ID))];
- console.log(output);
- }
-
- function instance$5($$self, $$props, $$invalidate) {
- let { $$slots: slots = {}, $$scope } = $$props;
- validate_slots('Utilities', slots, []);
-
- let datachart = {
- labels: ["Sun", "Mon", "Tues", "Wed", "Thurs", "Fri", "Sat"],
- datasets: [{ values: [10, 12, 3, 9, 8, 15, 9] }]
- };
-
- //объединение двух массивов с удалением дубликатов полностью
- let a = [{ item: "1", description: "lorem" }, { item: "2", description: "impsum" }];
-
- let b = [{ item: "2", description: "dolor" }, { item: "4", description: "enum" }];
-
- //объединение двух массивов с удалением дубликатов, оставляя один из дубликатов
- let c = [{ ID: "1", description: "lorem" }, { ID: "2", description: "impsum" }];
-
- let d = [{ ID: "2", description: "dolor" }, { ID: "4", description: "enum" }];
- const writable_props = [];
-
- Object.keys($$props).forEach(key => {
- if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console_1$2.warn(` was created with unknown prop '${key}'`);
- });
-
- const click_handler = () => joinWithoutDupesAndRmooving(c, d);
-
- $$self.$capture_state = () => ({
- Card,
- Alarm,
- Chart: Base$1,
- datachart,
- a,
- b,
- joinWithoutDupes,
- c,
- d,
- joinWithoutDupesAndRmooving
- });
-
- $$self.$inject_state = $$props => {
- if ('datachart' in $$props) $$invalidate(0, datachart = $$props.datachart);
- if ('a' in $$props) a = $$props.a;
- if ('b' in $$props) b = $$props.b;
- if ('c' in $$props) $$invalidate(1, c = $$props.c);
- if ('d' in $$props) $$invalidate(2, d = $$props.d);
- };
-
- if ($$props && "$$inject" in $$props) {
- $$self.$inject_state($$props.$$inject);
- }
-
- return [datachart, c, d, click_handler];
- }
-
- class Utilities extends SvelteComponentDev {
- constructor(options) {
- super(options);
- init(this, options, instance$5, create_fragment$5, safe_not_equal, {});
-
- dispatch_dev("SvelteRegisterComponent", {
- component: this,
- tagName: "Utilities",
- options,
- id: create_fragment$5.name
- });
- }
- }
-
- /* src\pages\Log.svelte generated by Svelte v3.46.4 */
- const file$4 = "src\\pages\\Log.svelte";
-
- function get_each_context$2(ctx, list, i) {
- const child_ctx = ctx.slice();
- child_ctx[1] = list[i];
- child_ctx[3] = i;
- return child_ctx;
- }
-
- // (8:2) {#each coreMessages as message, i}
- function create_each_block$2(ctx) {
- let div;
- let t_value = /*message*/ ctx[1].msg + "";
- let t;
- let div_class_value;
-
- const block = {
- c: function create() {
- div = element("div");
- t = text(t_value);
-
- attr_dev(div, "class", div_class_value = /*message*/ ctx[1].msg.toString().includes("[E]")
- ? "text-red-500"
- : "text-black");
-
- add_location(div, file$4, 8, 4, 166);
- },
- m: function mount(target, anchor) {
- insert_dev(target, div, anchor);
- append_dev(div, t);
- },
- p: function update(ctx, dirty) {
- if (dirty & /*coreMessages*/ 1 && t_value !== (t_value = /*message*/ ctx[1].msg + "")) set_data_dev(t, t_value);
-
- if (dirty & /*coreMessages*/ 1 && div_class_value !== (div_class_value = /*message*/ ctx[1].msg.toString().includes("[E]")
- ? "text-red-500"
- : "text-black")) {
- attr_dev(div, "class", div_class_value);
- }
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(div);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_each_block$2.name,
- type: "each",
- source: "(8:2) {#each coreMessages as message, i}",
- ctx
- });
-
- return block;
- }
-
- // (7:0)
- function create_default_slot$3(ctx) {
- let each_1_anchor;
- let each_value = /*coreMessages*/ 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$2(get_each_context$2(ctx, each_value, i));
- }
-
- const block = {
- c: function create() {
- for (let i = 0; i < each_blocks.length; i += 1) {
- each_blocks[i].c();
- }
-
- each_1_anchor = empty();
- },
- m: function mount(target, anchor) {
- for (let i = 0; i < each_blocks.length; i += 1) {
- each_blocks[i].m(target, anchor);
- }
-
- insert_dev(target, each_1_anchor, anchor);
- },
- p: function update(ctx, dirty) {
- if (dirty & /*coreMessages*/ 1) {
- each_value = /*coreMessages*/ ctx[0];
- validate_each_argument(each_value);
- let i;
-
- for (i = 0; i < each_value.length; i += 1) {
- const child_ctx = get_each_context$2(ctx, each_value, i);
-
- if (each_blocks[i]) {
- each_blocks[i].p(child_ctx, dirty);
- } else {
- each_blocks[i] = create_each_block$2(child_ctx);
- each_blocks[i].c();
- each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor);
- }
- }
-
- for (; i < each_blocks.length; i += 1) {
- each_blocks[i].d(1);
- }
-
- each_blocks.length = each_value.length;
- }
- },
- d: function destroy(detaching) {
- destroy_each(each_blocks, detaching);
- if (detaching) detach_dev(each_1_anchor);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_default_slot$3.name,
- type: "slot",
- source: "(7:0) ",
- ctx
- });
-
- return block;
- }
-
- function create_fragment$4(ctx) {
- let card;
- let current;
-
- card = new Card({
- props: {
- title: "Лог",
- $$slots: { default: [create_default_slot$3] },
- $$scope: { ctx }
- },
- $$inline: true
- });
-
- const block = {
- c: function create() {
- create_component(card.$$.fragment);
- },
- 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) {
- mount_component(card, target, anchor);
- current = true;
- },
- p: function update(ctx, [dirty]) {
- const card_changes = {};
-
- if (dirty & /*$$scope, coreMessages*/ 17) {
- card_changes.$$scope = { dirty, ctx };
- }
-
- card.$set(card_changes);
- },
- i: function intro(local) {
- if (current) return;
- transition_in(card.$$.fragment, local);
- current = true;
- },
- o: function outro(local) {
- transition_out(card.$$.fragment, local);
- current = false;
- },
- d: function destroy(detaching) {
- destroy_component(card, detaching);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_fragment$4.name,
- type: "component",
- source: "",
- ctx
- });
-
- return block;
- }
-
- function instance$4($$self, $$props, $$invalidate) {
- let { $$slots: slots = {}, $$scope } = $$props;
- validate_slots('Log', slots, []);
- let { coreMessages } = $$props;
- const writable_props = ['coreMessages'];
-
- Object.keys($$props).forEach(key => {
- if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(` was created with unknown prop '${key}'`);
- });
-
- $$self.$$set = $$props => {
- if ('coreMessages' in $$props) $$invalidate(0, coreMessages = $$props.coreMessages);
- };
-
- $$self.$capture_state = () => ({ Card, coreMessages });
-
- $$self.$inject_state = $$props => {
- if ('coreMessages' in $$props) $$invalidate(0, coreMessages = $$props.coreMessages);
- };
-
- if ($$props && "$$inject" in $$props) {
- $$self.$inject_state($$props.$$inject);
- }
-
- return [coreMessages];
- }
-
- class Log extends SvelteComponentDev {
- constructor(options) {
- super(options);
- init(this, options, instance$4, create_fragment$4, safe_not_equal, { coreMessages: 0 });
-
- dispatch_dev("SvelteRegisterComponent", {
- component: this,
- tagName: "Log",
- options,
- id: create_fragment$4.name
- });
-
- const { ctx } = this.$$;
- const props = options.props || {};
-
- if (/*coreMessages*/ ctx[0] === undefined && !('coreMessages' in props)) {
- console.warn(" was created without expected prop 'coreMessages'");
- }
- }
-
- get coreMessages() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set coreMessages(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
- }
-
- /* src\pages\List.svelte generated by Svelte v3.46.4 */
-
- const { console: console_1$1 } = globals;
- const file$3 = "src\\pages\\List.svelte";
-
- function get_each_context$1(ctx, list, i) {
- const child_ctx = ctx.slice();
- child_ctx[11] = list[i];
- child_ctx[13] = i;
- return child_ctx;
- }
-
- // (41:8) {#each deviceList as device, i}
- function create_each_block$1(ctx) {
- let tr;
- let td0;
- let t0_value = /*device*/ ctx[11].name + "";
- let t0;
- let t1;
- let td1;
- let a;
- let t2_value = /*device*/ ctx[11].ip + "";
- let t2;
- let a_href_value;
- let t3;
- let td2;
- let t4_value = /*device*/ ctx[11].id + "";
- let t4;
- let t5;
- let td3;
- let t6_value = (/*device*/ ctx[11].status ? "online" : "offline") + "";
- let t6;
- let td3_class_value;
- let t7;
- let td4;
- let crossicon;
- let current;
-
- crossicon = new Cross({
- props: { i: /*i*/ ctx[13], click: /*func*/ ctx[5] },
- $$inline: true
- });
-
- const block = {
- c: function create() {
- tr = element("tr");
- td0 = element("td");
- t0 = text(t0_value);
- t1 = space();
- td1 = element("td");
- a = element("a");
- t2 = text(t2_value);
- t3 = space();
- td2 = element("td");
- t4 = text(t4_value);
- t5 = space();
- td3 = element("td");
- t6 = text(t6_value);
- t7 = space();
- td4 = element("td");
- create_component(crossicon.$$.fragment);
- attr_dev(td0, "class", "tbl-bdy-lg ipt-lg w-full");
- add_location(td0, file$3, 42, 12, 1214);
- attr_dev(a, "href", a_href_value = "http://" + /*device*/ ctx[11].ip);
- add_location(a, file$3, 43, 49, 1320);
- attr_dev(td1, "class", "tbl-bdy-lg ipt-lg w-full");
- add_location(td1, file$3, 43, 12, 1283);
- attr_dev(td2, "class", "tbl-bdy-lg ipt-lg w-full");
- add_location(td2, file$3, 44, 12, 1386);
- attr_dev(td3, "class", td3_class_value = "tbl-bdy-lg ipt-lg w-full " + (/*device*/ ctx[11].status ? 'bg-green-50' : 'bg-red-50'));
- add_location(td3, file$3, 45, 12, 1453);
- attr_dev(td4, "class", "tbl-bdy-lg");
- add_location(td4, file$3, 46, 12, 1593);
- attr_dev(tr, "class", "txt-sz txt-pad");
- add_location(tr, file$3, 41, 10, 1173);
- },
- m: function mount(target, anchor) {
- insert_dev(target, tr, anchor);
- append_dev(tr, td0);
- append_dev(td0, t0);
- append_dev(tr, t1);
- append_dev(tr, td1);
- append_dev(td1, a);
- append_dev(a, t2);
- append_dev(tr, t3);
- append_dev(tr, td2);
- append_dev(td2, t4);
- append_dev(tr, t5);
- append_dev(tr, td3);
- append_dev(td3, t6);
- append_dev(tr, t7);
- append_dev(tr, td4);
- mount_component(crossicon, td4, null);
- current = true;
- },
- p: function update(ctx, dirty) {
- if ((!current || dirty & /*deviceList*/ 1) && t0_value !== (t0_value = /*device*/ ctx[11].name + "")) set_data_dev(t0, t0_value);
- if ((!current || dirty & /*deviceList*/ 1) && t2_value !== (t2_value = /*device*/ ctx[11].ip + "")) set_data_dev(t2, t2_value);
-
- if (!current || dirty & /*deviceList*/ 1 && a_href_value !== (a_href_value = "http://" + /*device*/ ctx[11].ip)) {
- attr_dev(a, "href", a_href_value);
- }
-
- if ((!current || dirty & /*deviceList*/ 1) && t4_value !== (t4_value = /*device*/ ctx[11].id + "")) set_data_dev(t4, t4_value);
- if ((!current || dirty & /*deviceList*/ 1) && t6_value !== (t6_value = (/*device*/ ctx[11].status ? "online" : "offline") + "")) set_data_dev(t6, t6_value);
-
- if (!current || dirty & /*deviceList*/ 1 && td3_class_value !== (td3_class_value = "tbl-bdy-lg ipt-lg w-full " + (/*device*/ ctx[11].status ? 'bg-green-50' : 'bg-red-50'))) {
- attr_dev(td3, "class", td3_class_value);
- }
- },
- i: function intro(local) {
- if (current) return;
- transition_in(crossicon.$$.fragment, local);
- current = true;
- },
- o: function outro(local) {
- transition_out(crossicon.$$.fragment, local);
- current = false;
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(tr);
- destroy_component(crossicon);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_each_block$1.name,
- type: "each",
- source: "(41:8) {#each deviceList as device, i}",
- ctx
- });
-
- return block;
- }
-
- // (50:8) {#if showInput}
- function create_if_block$1(ctx) {
- let tr;
- let td0;
- let input0;
- let t0;
- let td1;
- let input1;
- let t1;
- let td2;
- let input2;
- let t2;
- let td3;
- let mounted;
- let dispose;
-
- const block = {
- c: function create() {
- tr = element("tr");
- td0 = element("td");
- input0 = element("input");
- t0 = space();
- td1 = element("td");
- input1 = element("input");
- t1 = space();
- td2 = element("td");
- input2 = element("input");
- t2 = space();
- td3 = element("td");
- attr_dev(input0, "class", "ipt-lg w-full");
- attr_dev(input0, "type", "text");
- add_location(input0, file$3, 51, 35, 1815);
- attr_dev(td0, "class", "tbl-bdy-lg");
- add_location(td0, file$3, 51, 12, 1792);
- attr_dev(input1, "class", "ipt-lg w-full");
- attr_dev(input1, "type", "text");
- add_location(input1, file$3, 52, 35, 1928);
- attr_dev(td1, "class", "tbl-bdy-lg");
- add_location(td1, file$3, 52, 12, 1905);
- attr_dev(input2, "class", "ipt-lg w-full");
- attr_dev(input2, "type", "text");
- add_location(input2, file$3, 53, 35, 2039);
- attr_dev(td2, "class", "tbl-bdy-lg");
- add_location(td2, file$3, 53, 12, 2016);
- attr_dev(td3, "class", "tbl-bdy-lg");
- add_location(td3, file$3, 54, 12, 2127);
- attr_dev(tr, "class", "txt-sz txt-pad");
- add_location(tr, file$3, 50, 10, 1751);
- },
- m: function mount(target, anchor) {
- insert_dev(target, tr, anchor);
- append_dev(tr, td0);
- append_dev(td0, input0);
- set_input_value(input0, /*newDevice*/ ctx[2].name);
- append_dev(tr, t0);
- append_dev(tr, td1);
- append_dev(td1, input1);
- set_input_value(input1, /*newDevice*/ ctx[2].ip);
- append_dev(tr, t1);
- append_dev(tr, td2);
- append_dev(td2, input2);
- set_input_value(input2, /*newDevice*/ ctx[2].id);
- append_dev(tr, t2);
- append_dev(tr, td3);
-
- if (!mounted) {
- dispose = [
- listen_dev(input0, "input", /*input0_input_handler*/ ctx[6]),
- listen_dev(input1, "input", /*input1_input_handler*/ ctx[7]),
- listen_dev(input2, "input", /*input2_input_handler*/ ctx[8])
- ];
-
- mounted = true;
- }
- },
- p: function update(ctx, dirty) {
- if (dirty & /*newDevice*/ 4 && input0.value !== /*newDevice*/ ctx[2].name) {
- set_input_value(input0, /*newDevice*/ ctx[2].name);
- }
-
- if (dirty & /*newDevice*/ 4 && input1.value !== /*newDevice*/ ctx[2].ip) {
- set_input_value(input1, /*newDevice*/ ctx[2].ip);
- }
-
- if (dirty & /*newDevice*/ 4 && input2.value !== /*newDevice*/ ctx[2].id) {
- set_input_value(input2, /*newDevice*/ ctx[2].id);
- }
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(tr);
- mounted = false;
- run_all(dispose);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_if_block$1.name,
- type: "if",
- source: "(50:8) {#if showInput}",
- ctx
- });
-
- return block;
- }
-
- // (29:2)
- function create_default_slot_1$1(ctx) {
- let table;
- let thead;
- let tr;
- let th0;
- let t1;
- let th1;
- let t3;
- let th2;
- let t5;
- let th3;
- let t7;
- let th4;
- let t8;
- let tbody;
- let t9;
- let t10;
- let button;
-
- let t11_value = (/*showInput*/ ctx[1]
- ? "Сохранить"
- : "Добавить устройство") + "";
-
- let t11;
- let current;
- let mounted;
- let dispose;
- let each_value = /*deviceList*/ 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$1(get_each_context$1(ctx, each_value, i));
- }
-
- const out = i => transition_out(each_blocks[i], 1, 1, () => {
- each_blocks[i] = null;
- });
-
- let if_block = /*showInput*/ ctx[1] && create_if_block$1(ctx);
-
- const block = {
- c: function create() {
- table = element("table");
- thead = element("thead");
- tr = element("tr");
- th0 = element("th");
- th0.textContent = "Название устройства";
- t1 = space();
- th1 = element("th");
- th1.textContent = "IP адрес";
- t3 = space();
- th2 = element("th");
- th2.textContent = "Идентификатор";
- t5 = space();
- th3 = element("th");
- th3.textContent = "Состояние";
- t7 = space();
- th4 = element("th");
- t8 = space();
- tbody = element("tbody");
-
- for (let i = 0; i < each_blocks.length; i += 1) {
- each_blocks[i].c();
- }
-
- t9 = space();
- if (if_block) if_block.c();
- t10 = space();
- button = element("button");
- t11 = text(t11_value);
- attr_dev(th0, "class", "tbl-hd");
- add_location(th0, file$3, 32, 10, 839);
- attr_dev(th1, "class", "tbl-hd");
- add_location(th1, file$3, 33, 10, 894);
- attr_dev(th2, "class", "tbl-hd");
- add_location(th2, file$3, 34, 10, 938);
- attr_dev(th3, "class", "tbl-hd");
- add_location(th3, file$3, 35, 10, 987);
- attr_dev(th4, "class", "tbl-hd w-7");
- add_location(th4, file$3, 36, 10, 1032);
- attr_dev(tr, "class", "txt-sz txt-pad");
- add_location(tr, file$3, 31, 8, 800);
- attr_dev(thead, "class", "bg-gray-100");
- add_location(thead, file$3, 30, 6, 763);
- attr_dev(tbody, "class", "bg-white");
- add_location(tbody, file$3, 39, 6, 1096);
- attr_dev(table, "class", "tbl");
- add_location(table, file$3, 29, 4, 736);
- attr_dev(button, "class", "btn-lg");
- add_location(button, file$3, 59, 4, 2220);
- },
- m: function mount(target, anchor) {
- insert_dev(target, table, anchor);
- append_dev(table, thead);
- append_dev(thead, tr);
- append_dev(tr, th0);
- append_dev(tr, t1);
- append_dev(tr, th1);
- append_dev(tr, t3);
- append_dev(tr, th2);
- append_dev(tr, t5);
- append_dev(tr, th3);
- append_dev(tr, t7);
- append_dev(tr, th4);
- append_dev(table, t8);
- append_dev(table, tbody);
-
- for (let i = 0; i < each_blocks.length; i += 1) {
- each_blocks[i].m(tbody, null);
- }
-
- append_dev(tbody, t9);
- if (if_block) if_block.m(tbody, null);
- insert_dev(target, t10, anchor);
- insert_dev(target, button, anchor);
- append_dev(button, t11);
- current = true;
-
- if (!mounted) {
- dispose = listen_dev(button, "click", /*click_handler*/ ctx[9], false, false, false);
- mounted = true;
- }
- },
- p: function update(ctx, dirty) {
- if (dirty & /*deleteLineFromDevlist, deviceList*/ 17) {
- each_value = /*deviceList*/ ctx[0];
- validate_each_argument(each_value);
- let i;
-
- for (i = 0; i < each_value.length; i += 1) {
- const child_ctx = get_each_context$1(ctx, each_value, i);
-
- if (each_blocks[i]) {
- each_blocks[i].p(child_ctx, dirty);
- transition_in(each_blocks[i], 1);
- } else {
- each_blocks[i] = create_each_block$1(child_ctx);
- each_blocks[i].c();
- transition_in(each_blocks[i], 1);
- each_blocks[i].m(tbody, t9);
- }
- }
-
- group_outros();
-
- for (i = each_value.length; i < each_blocks.length; i += 1) {
- out(i);
- }
-
- check_outros();
- }
-
- if (/*showInput*/ ctx[1]) {
- if (if_block) {
- if_block.p(ctx, dirty);
- } else {
- if_block = create_if_block$1(ctx);
- if_block.c();
- if_block.m(tbody, null);
- }
- } else if (if_block) {
- if_block.d(1);
- if_block = null;
- }
-
- if ((!current || dirty & /*showInput*/ 2) && t11_value !== (t11_value = (/*showInput*/ ctx[1]
- ? "Сохранить"
- : "Добавить устройство") + "")) set_data_dev(t11, t11_value);
- },
- i: function intro(local) {
- if (current) return;
-
- for (let i = 0; i < each_value.length; i += 1) {
- transition_in(each_blocks[i]);
- }
-
- current = true;
- },
- o: function outro(local) {
- each_blocks = each_blocks.filter(Boolean);
-
- for (let i = 0; i < each_blocks.length; i += 1) {
- transition_out(each_blocks[i]);
- }
-
- current = false;
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(table);
- destroy_each(each_blocks, detaching);
- if (if_block) if_block.d();
- if (detaching) detach_dev(t10);
- if (detaching) detach_dev(button);
- mounted = false;
- dispose();
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_default_slot_1$1.name,
- type: "slot",
- source: "(29:2) ",
- ctx
- });
-
- return block;
- }
-
- // (62:2)
- function create_default_slot$2(ctx) {
- let p;
-
- const block = {
- c: function create() {
- p = element("p");
- p.textContent = "Список устройств будет обновляться автоматически. Подключенные к одному роутеру устройства будут появляться в списке в течении двух минут. Ручное добавление сделано в целях проверки для разработчика.";
- add_location(p, file$3, 62, 4, 2388);
- },
- m: function mount(target, anchor) {
- insert_dev(target, p, anchor);
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(p);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_default_slot$2.name,
- type: "slot",
- source: "(62:2) ",
- ctx
- });
-
- return block;
- }
-
- function create_fragment$3(ctx) {
- let div;
- let card;
- let t;
- let alarm;
- let current;
-
- card = new Card({
- props: {
- title: "Список устройств",
- $$slots: { default: [create_default_slot_1$1] },
- $$scope: { ctx }
- },
- $$inline: true
- });
-
- alarm = new Alarm({
- props: {
- $$slots: { default: [create_default_slot$2] },
- $$scope: { ctx }
- },
- $$inline: true
- });
-
- const block = {
- c: function create() {
- div = element("div");
- create_component(card.$$.fragment);
- t = space();
- create_component(alarm.$$.fragment);
- attr_dev(div, "class", "grd-1col1");
- add_location(div, file$3, 27, 0, 670);
- },
- 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);
- mount_component(card, div, null);
- append_dev(div, t);
- mount_component(alarm, div, null);
- current = true;
- },
- p: function update(ctx, [dirty]) {
- const card_changes = {};
-
- if (dirty & /*$$scope, showInput, devListSave, newDevice, deviceList*/ 16399) {
- card_changes.$$scope = { dirty, ctx };
- }
-
- card.$set(card_changes);
- const alarm_changes = {};
-
- if (dirty & /*$$scope*/ 16384) {
- alarm_changes.$$scope = { dirty, ctx };
- }
-
- alarm.$set(alarm_changes);
- },
- i: function intro(local) {
- if (current) return;
- transition_in(card.$$.fragment, local);
- transition_in(alarm.$$.fragment, local);
- current = true;
- },
- o: function outro(local) {
- transition_out(card.$$.fragment, local);
- transition_out(alarm.$$.fragment, local);
- current = false;
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(div);
- destroy_component(card);
- destroy_component(alarm);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_fragment$3.name,
- type: "component",
- source: "",
- ctx
- });
-
- return block;
- }
-
- function instance$3($$self, $$props, $$invalidate) {
- let { $$slots: slots = {}, $$scope } = $$props;
- validate_slots('List', slots, []);
- let { deviceList } = $$props;
- let { showInput } = $$props;
- let { newDevice = {} } = $$props;
-
- let { devListSave = () => {
-
- } } = $$props;
-
- let debug = true;
-
- function deleteLineFromDevlist(num) {
- for (let i = 0; i < deviceList.length; i++) {
- if (num === i) {
- deviceList.splice(i, 1);
- $$invalidate(0, deviceList);
- if (debug) console.log("[i]", "item " + num + " deleted from dev list");
- break;
- }
- }
- }
-
- const writable_props = ['deviceList', 'showInput', 'newDevice', 'devListSave'];
-
- Object.keys($$props).forEach(key => {
- if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console_1$1.warn(` was created with unknown prop '${key}'`);
- });
-
- const func = i => deleteLineFromDevlist(i);
-
- function input0_input_handler() {
- newDevice.name = this.value;
- $$invalidate(2, newDevice);
- }
-
- function input1_input_handler() {
- newDevice.ip = this.value;
- $$invalidate(2, newDevice);
- }
-
- function input2_input_handler() {
- newDevice.id = this.value;
- $$invalidate(2, newDevice);
- }
-
- const click_handler = () => ($$invalidate(1, showInput = !showInput), devListSave());
-
- $$self.$$set = $$props => {
- if ('deviceList' in $$props) $$invalidate(0, deviceList = $$props.deviceList);
- if ('showInput' in $$props) $$invalidate(1, showInput = $$props.showInput);
- if ('newDevice' in $$props) $$invalidate(2, newDevice = $$props.newDevice);
- if ('devListSave' in $$props) $$invalidate(3, devListSave = $$props.devListSave);
- };
-
- $$self.$capture_state = () => ({
- Card,
- Alarm,
- CrossIcon: Cross,
- OpenIcon: Open,
- deviceList,
- showInput,
- newDevice,
- devListSave,
- debug,
- deleteLineFromDevlist
- });
-
- $$self.$inject_state = $$props => {
- if ('deviceList' in $$props) $$invalidate(0, deviceList = $$props.deviceList);
- if ('showInput' in $$props) $$invalidate(1, showInput = $$props.showInput);
- if ('newDevice' in $$props) $$invalidate(2, newDevice = $$props.newDevice);
- if ('devListSave' in $$props) $$invalidate(3, devListSave = $$props.devListSave);
- if ('debug' in $$props) debug = $$props.debug;
- };
-
- if ($$props && "$$inject" in $$props) {
- $$self.$inject_state($$props.$$inject);
- }
-
- return [
- deviceList,
- showInput,
- newDevice,
- devListSave,
- deleteLineFromDevlist,
- func,
- input0_input_handler,
- input1_input_handler,
- input2_input_handler,
- click_handler
- ];
- }
-
- class List extends SvelteComponentDev {
- constructor(options) {
- super(options);
-
- init(this, options, instance$3, create_fragment$3, safe_not_equal, {
- deviceList: 0,
- showInput: 1,
- newDevice: 2,
- devListSave: 3
- });
-
- dispatch_dev("SvelteRegisterComponent", {
- component: this,
- tagName: "List",
- options,
- id: create_fragment$3.name
- });
-
- const { ctx } = this.$$;
- const props = options.props || {};
-
- if (/*deviceList*/ ctx[0] === undefined && !('deviceList' in props)) {
- console_1$1.warn(" was created without expected prop 'deviceList'");
- }
-
- if (/*showInput*/ ctx[1] === undefined && !('showInput' in props)) {
- console_1$1.warn(" was created without expected prop 'showInput'");
- }
- }
-
- get deviceList() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set deviceList(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
-
- get showInput() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set showInput(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
-
- get newDevice() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set newDevice(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
-
- get devListSave() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set devListSave(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
- }
-
- /* src\pages\About.svelte generated by Svelte v3.46.4 */
- const file$2 = "src\\pages\\About.svelte";
-
- // (12:0)
- function create_default_slot$1(ctx) {
- let textarea;
- let textarea_value_value;
- let mounted;
- let dispose;
-
- const block = {
- c: function create() {
- textarea = element("textarea");
- attr_dev(textarea, "rows", "10");
- attr_dev(textarea, "class", "ipt-big w-full");
- attr_dev(textarea, "id", "text1");
- textarea.value = textarea_value_value = /*syntaxHighlight*/ ctx[3](JSON.stringify(/*layoutJson*/ ctx[1]));
- add_location(textarea, file$2, 12, 2, 320);
- },
- m: function mount(target, anchor) {
- insert_dev(target, textarea, anchor);
-
- if (!mounted) {
- dispose = listen_dev(
- textarea,
- "input",
- function () {
- if (is_function(/*wigetsUpdate*/ ctx[0])) /*wigetsUpdate*/ ctx[0].apply(this, arguments);
- },
- false,
- false,
- false
- );
-
- mounted = true;
- }
- },
- p: function update(new_ctx, dirty) {
- ctx = new_ctx;
-
- if (dirty & /*syntaxHighlight, layoutJson*/ 10 && textarea_value_value !== (textarea_value_value = /*syntaxHighlight*/ ctx[3](JSON.stringify(/*layoutJson*/ ctx[1])))) {
- prop_dev(textarea, "value", textarea_value_value);
- }
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(textarea);
- mounted = false;
- dispose();
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_default_slot$1.name,
- type: "slot",
- source: "(12:0) ",
- ctx
- });
-
- return block;
- }
-
- function create_fragment$2(ctx) {
- let button;
- let t1;
- let card;
- let current;
- let mounted;
- let dispose;
-
- card = new Card({
- props: {
- title: "Редактор JSON",
- $$slots: { default: [create_default_slot$1] },
- $$scope: { ctx }
- },
- $$inline: true
- });
-
- const block = {
- c: function create() {
- button = element("button");
- button.textContent = "Toggle modal";
- t1 = space();
- create_component(card.$$.fragment);
- attr_dev(button, "type", "button");
- add_location(button, file$2, 10, 0, 212);
- },
- 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, button, anchor);
- insert_dev(target, t1, anchor);
- mount_component(card, target, anchor);
- current = true;
-
- if (!mounted) {
- dispose = listen_dev(button, "click", /*click_handler*/ ctx[4], false, false, false);
- mounted = true;
- }
- },
- p: function update(ctx, [dirty]) {
- const card_changes = {};
-
- if (dirty & /*$$scope, syntaxHighlight, layoutJson, wigetsUpdate*/ 43) {
- card_changes.$$scope = { dirty, ctx };
- }
-
- card.$set(card_changes);
- },
- i: function intro(local) {
- if (current) return;
- transition_in(card.$$.fragment, local);
- current = true;
- },
- o: function outro(local) {
- transition_out(card.$$.fragment, local);
- current = false;
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(button);
- if (detaching) detach_dev(t1);
- destroy_component(card, detaching);
- mounted = false;
- dispose();
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_fragment$2.name,
- type: "component",
- source: "",
- ctx
- });
-
- return block;
- }
-
- function instance$2($$self, $$props, $$invalidate) {
- let { $$slots: slots = {}, $$scope } = $$props;
- validate_slots('About', slots, []);
- let { wigetsUpdate } = $$props;
- let { layoutJson } = $$props;
-
- let { showModal = () => {
-
- } } = $$props;
-
- let { syntaxHighlight = json => {
-
- } } = $$props;
-
- const writable_props = ['wigetsUpdate', 'layoutJson', 'showModal', 'syntaxHighlight'];
-
- Object.keys($$props).forEach(key => {
- if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(` was created with unknown prop '${key}'`);
- });
-
- const click_handler = () => showModal();
-
- $$self.$$set = $$props => {
- if ('wigetsUpdate' in $$props) $$invalidate(0, wigetsUpdate = $$props.wigetsUpdate);
- if ('layoutJson' in $$props) $$invalidate(1, layoutJson = $$props.layoutJson);
- if ('showModal' in $$props) $$invalidate(2, showModal = $$props.showModal);
- if ('syntaxHighlight' in $$props) $$invalidate(3, syntaxHighlight = $$props.syntaxHighlight);
- };
-
- $$self.$capture_state = () => ({
- Card,
- wigetsUpdate,
- layoutJson,
- showModal,
- syntaxHighlight
- });
-
- $$self.$inject_state = $$props => {
- if ('wigetsUpdate' in $$props) $$invalidate(0, wigetsUpdate = $$props.wigetsUpdate);
- if ('layoutJson' in $$props) $$invalidate(1, layoutJson = $$props.layoutJson);
- if ('showModal' in $$props) $$invalidate(2, showModal = $$props.showModal);
- if ('syntaxHighlight' in $$props) $$invalidate(3, syntaxHighlight = $$props.syntaxHighlight);
- };
-
- if ($$props && "$$inject" in $$props) {
- $$self.$inject_state($$props.$$inject);
- }
-
- return [wigetsUpdate, layoutJson, showModal, syntaxHighlight, click_handler];
- }
-
- class About extends SvelteComponentDev {
- constructor(options) {
- super(options);
-
- init(this, options, instance$2, create_fragment$2, safe_not_equal, {
- wigetsUpdate: 0,
- layoutJson: 1,
- showModal: 2,
- syntaxHighlight: 3
- });
-
- dispatch_dev("SvelteRegisterComponent", {
- component: this,
- tagName: "About",
- options,
- id: create_fragment$2.name
- });
-
- const { ctx } = this.$$;
- const props = options.props || {};
-
- if (/*wigetsUpdate*/ ctx[0] === undefined && !('wigetsUpdate' in props)) {
- console.warn(" was created without expected prop 'wigetsUpdate'");
- }
-
- if (/*layoutJson*/ ctx[1] === undefined && !('layoutJson' in props)) {
- console.warn(" was created without expected prop 'layoutJson'");
- }
- }
-
- get wigetsUpdate() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set wigetsUpdate(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
-
- get layoutJson() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set layoutJson(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
-
- get showModal() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set showModal(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
-
- get syntaxHighlight() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set syntaxHighlight(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
- }
-
- /* src\svg\Cloud.svelte generated by Svelte v3.46.4 */
-
- const file$1 = "src\\svg\\Cloud.svelte";
-
- function create_fragment$1(ctx) {
- let svg;
- let path0;
- let path1;
- let svg_class_value;
-
- const block = {
- c: function create() {
- svg = svg_element("svg");
- path0 = svg_element("path");
- path1 = svg_element("path");
- attr_dev(path0, "stroke", "none");
- attr_dev(path0, "d", "M0 0h24v24H0z");
- add_location(path0, file$1, 5, 2, 218);
- attr_dev(path1, "d", "M7 18a4.6 4.4 0 0 1 0 -9h0a5 4.5 0 0 1 11 2h1a3.5 3.5 0 0 1 0 7h-12");
- add_location(path1, file$1, 6, 2, 262);
- attr_dev(svg, "class", svg_class_value = "h-8 w-8 " + /*color*/ ctx[0]);
- attr_dev(svg, "width", "24");
- attr_dev(svg, "height", "24");
- attr_dev(svg, "viewBox", "0 0 24 24");
- attr_dev(svg, "stroke-width", "2");
- attr_dev(svg, "stroke", "currentColor");
- attr_dev(svg, "fill", "none");
- attr_dev(svg, "stroke-linecap", "round");
- attr_dev(svg, "stroke-linejoin", "round");
- add_location(svg, file$1, 4, 0, 44);
- },
- 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, svg, anchor);
- append_dev(svg, path0);
- append_dev(svg, path1);
- },
- p: function update(ctx, [dirty]) {
- if (dirty & /*color*/ 1 && svg_class_value !== (svg_class_value = "h-8 w-8 " + /*color*/ ctx[0])) {
- attr_dev(svg, "class", svg_class_value);
- }
- },
- i: noop,
- o: noop,
- d: function destroy(detaching) {
- if (detaching) detach_dev(svg);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_fragment$1.name,
- type: "component",
- source: "",
- ctx
- });
-
- return block;
- }
-
- function instance$1($$self, $$props, $$invalidate) {
- let { $$slots: slots = {}, $$scope } = $$props;
- validate_slots('Cloud', slots, []);
- let { color } = $$props;
- const writable_props = ['color'];
-
- Object.keys($$props).forEach(key => {
- if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(` was created with unknown prop '${key}'`);
- });
-
- $$self.$$set = $$props => {
- if ('color' in $$props) $$invalidate(0, color = $$props.color);
- };
-
- $$self.$capture_state = () => ({ color });
-
- $$self.$inject_state = $$props => {
- if ('color' in $$props) $$invalidate(0, color = $$props.color);
- };
-
- if ($$props && "$$inject" in $$props) {
- $$self.$inject_state($$props.$$inject);
- }
-
- return [color];
- }
-
- class Cloud extends SvelteComponentDev {
- constructor(options) {
- super(options);
- init(this, options, instance$1, create_fragment$1, safe_not_equal, { color: 0 });
-
- dispatch_dev("SvelteRegisterComponent", {
- component: this,
- tagName: "Cloud",
- options,
- id: create_fragment$1.name
- });
-
- const { ctx } = this.$$;
- const props = options.props || {};
-
- if (/*color*/ ctx[0] === undefined && !('color' in props)) {
- console.warn(" was created without expected prop 'color'");
- }
- }
-
- get color() {
- throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''");
- }
-
- set color(value) {
- throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''");
- }
- }
-
- /* src\App.svelte generated by Svelte v3.46.4 */
-
- const { Object: Object_1, console: console_1 } = globals;
- const file = "src\\App.svelte";
-
- function get_each_context(ctx, list, i) {
- const child_ctx = ctx.slice();
- child_ctx[90] = list[i];
- return child_ctx;
- }
-
- // (760:10) {#each deviceList as device}
- function create_each_block(ctx) {
- let option;
- let t0_value = /*device*/ ctx[90].name + "";
- let t0;
- let t1;
- let option_value_value;
-
- const block = {
- c: function create() {
- option = element("option");
- t0 = text(t0_value);
- t1 = space();
- option.__value = option_value_value = /*device*/ ctx[90].ws;
- option.value = option.__value;
- add_location(option, file, 760, 12, 24626);
- },
- m: function mount(target, anchor) {
- insert_dev(target, option, anchor);
- append_dev(option, t0);
- append_dev(option, t1);
- },
- p: function update(ctx, dirty) {
- if (dirty[0] & /*deviceList*/ 16384 && t0_value !== (t0_value = /*device*/ ctx[90].name + "")) set_data_dev(t0, t0_value);
-
- if (dirty[0] & /*deviceList*/ 16384 && option_value_value !== (option_value_value = /*device*/ ctx[90].ws)) {
- prop_dev(option, "__value", option_value_value);
- option.value = option.__value;
- }
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(option);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_each_block.name,
- type: "each",
- source: "(760:10) {#each deviceList as device}",
- ctx
- });
-
- return block;
- }
-
- // (809:8) {:else}
- function create_else_block(ctx) {
- let route0;
- let t0;
- let route1;
- let t1;
- let route2;
- let t2;
- let route3;
- let t3;
- let route4;
- let t4;
- let route5;
- let current;
-
- route0 = new Route({
- props: {
- path: "/",
- $$slots: { default: [create_default_slot_6] },
- $$scope: { ctx }
- },
- $$inline: true
- });
-
- route1 = new Route({
- props: {
- path: "/config",
- $$slots: { default: [create_default_slot_5] },
- $$scope: { ctx }
- },
- $$inline: true
- });
-
- route2 = new Route({
- props: {
- path: "/connection",
- $$slots: { default: [create_default_slot_4] },
- $$scope: { ctx }
- },
- $$inline: true
- });
-
- route3 = new Route({
- props: {
- path: "/utilities",
- $$slots: { default: [create_default_slot_3] },
- $$scope: { ctx }
- },
- $$inline: true
- });
-
- route4 = new Route({
- props: {
- path: "/log",
- $$slots: { default: [create_default_slot_2] },
- $$scope: { ctx }
- },
- $$inline: true
- });
-
- route5 = new Route({
- props: {
- path: "/about",
- $$slots: { default: [create_default_slot_1] },
- $$scope: { ctx }
- },
- $$inline: true
- });
-
- const block = {
- c: function create() {
- create_component(route0.$$.fragment);
- t0 = space();
- create_component(route1.$$.fragment);
- t1 = space();
- create_component(route2.$$.fragment);
- t2 = space();
- create_component(route3.$$.fragment);
- t3 = space();
- create_component(route4.$$.fragment);
- t4 = space();
- create_component(route5.$$.fragment);
- },
- m: function mount(target, anchor) {
- mount_component(route0, target, anchor);
- insert_dev(target, t0, anchor);
- mount_component(route1, target, anchor);
- insert_dev(target, t1, anchor);
- mount_component(route2, target, anchor);
- insert_dev(target, t2, anchor);
- mount_component(route3, target, anchor);
- insert_dev(target, t3, anchor);
- mount_component(route4, target, anchor);
- insert_dev(target, t4, anchor);
- mount_component(route5, target, anchor);
- current = true;
- },
- p: function update(ctx, dirty) {
- const route0_changes = {};
-
- if (dirty[0] & /*layoutJson, pages*/ 136 | dirty[3] & /*$$scope*/ 1) {
- route0_changes.$$scope = { dirty, ctx };
- }
-
- route0.$set(route0_changes);
- const route1_changes = {};
-
- if (dirty[0] & /*configJson, widgetsJson, itemsJson*/ 112 | dirty[3] & /*$$scope*/ 1) {
- route1_changes.$$scope = { dirty, ctx };
- }
-
- route1.$set(route1_changes);
- const route2_changes = {};
-
- if (dirty[0] & /*settingsJson, ssidJson*/ 768 | dirty[3] & /*$$scope*/ 1) {
- route2_changes.$$scope = { dirty, ctx };
- }
-
- route2.$set(route2_changes);
- const route3_changes = {};
-
- if (dirty[3] & /*$$scope*/ 1) {
- route3_changes.$$scope = { dirty, ctx };
- }
-
- route3.$set(route3_changes);
- const route4_changes = {};
-
- if (dirty[0] & /*coreMessages*/ 8192 | dirty[3] & /*$$scope*/ 1) {
- route4_changes.$$scope = { dirty, ctx };
- }
-
- route4.$set(route4_changes);
- const route5_changes = {};
-
- if (dirty[0] & /*layoutJson*/ 128 | dirty[3] & /*$$scope*/ 1) {
- route5_changes.$$scope = { dirty, ctx };
- }
-
- route5.$set(route5_changes);
- },
- i: function intro(local) {
- if (current) return;
- transition_in(route0.$$.fragment, local);
- transition_in(route1.$$.fragment, local);
- transition_in(route2.$$.fragment, local);
- transition_in(route3.$$.fragment, local);
- transition_in(route4.$$.fragment, local);
- transition_in(route5.$$.fragment, local);
- current = true;
- },
- o: function outro(local) {
- transition_out(route0.$$.fragment, local);
- transition_out(route1.$$.fragment, local);
- transition_out(route2.$$.fragment, local);
- transition_out(route3.$$.fragment, local);
- transition_out(route4.$$.fragment, local);
- transition_out(route5.$$.fragment, local);
- current = false;
- },
- d: function destroy(detaching) {
- destroy_component(route0, detaching);
- if (detaching) detach_dev(t0);
- destroy_component(route1, detaching);
- if (detaching) detach_dev(t1);
- destroy_component(route2, detaching);
- if (detaching) detach_dev(t2);
- destroy_component(route3, detaching);
- if (detaching) detach_dev(t3);
- destroy_component(route4, detaching);
- if (detaching) detach_dev(t4);
- destroy_component(route5, detaching);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_else_block.name,
- type: "else",
- source: "(809:8) {:else}",
- ctx
- });
-
- return block;
- }
-
- // (807:8) {#if !socketConnected}
- function create_if_block(ctx) {
- let alarm;
- let current;
-
- alarm = new Alarm({
- props: { title: "Нет соединения" },
- $$inline: true
- });
-
- const block = {
- c: function create() {
- create_component(alarm.$$.fragment);
- },
- m: function mount(target, anchor) {
- mount_component(alarm, target, anchor);
- current = true;
- },
- p: noop,
- i: function intro(local) {
- if (current) return;
- transition_in(alarm.$$.fragment, local);
- current = true;
- },
- o: function outro(local) {
- transition_out(alarm.$$.fragment, local);
- current = false;
- },
- d: function destroy(detaching) {
- destroy_component(alarm, detaching);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_if_block.name,
- type: "if",
- source: "(807:8) {#if !socketConnected}",
- ctx
- });
-
- return block;
- }
-
- // (810:10)
- function create_default_slot_6(ctx) {
- let dashboardpage;
- let current;
-
- dashboardpage = new Dashboard({
- props: {
- layoutJson: /*layoutJson*/ ctx[7],
- pages: /*pages*/ ctx[3],
- wsPush: /*func*/ ctx[30]
- },
- $$inline: true
- });
-
- const block = {
- c: function create() {
- create_component(dashboardpage.$$.fragment);
- },
- m: function mount(target, anchor) {
- mount_component(dashboardpage, target, anchor);
- current = true;
- },
- p: function update(ctx, dirty) {
- const dashboardpage_changes = {};
- if (dirty[0] & /*layoutJson*/ 128) dashboardpage_changes.layoutJson = /*layoutJson*/ ctx[7];
- if (dirty[0] & /*pages*/ 8) dashboardpage_changes.pages = /*pages*/ ctx[3];
- dashboardpage.$set(dashboardpage_changes);
- },
- i: function intro(local) {
- if (current) return;
- transition_in(dashboardpage.$$.fragment, local);
- current = true;
- },
- o: function outro(local) {
- transition_out(dashboardpage.$$.fragment, local);
- current = false;
- },
- d: function destroy(detaching) {
- destroy_component(dashboardpage, detaching);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_default_slot_6.name,
- type: "slot",
- source: "(810:10) ",
- ctx
- });
-
- return block;
- }
-
- // (813:10)
- function create_default_slot_5(ctx) {
- let configpage;
- let current;
-
- configpage = new Config({
- props: {
- configJson: /*configJson*/ ctx[4],
- widgetsJson: /*widgetsJson*/ ctx[5],
- itemsJson: /*itemsJson*/ ctx[6],
- saveConfig: /*func_1*/ ctx[31]
- },
- $$inline: true
- });
-
- const block = {
- c: function create() {
- create_component(configpage.$$.fragment);
- },
- m: function mount(target, anchor) {
- mount_component(configpage, target, anchor);
- current = true;
- },
- p: function update(ctx, dirty) {
- const configpage_changes = {};
- if (dirty[0] & /*configJson*/ 16) configpage_changes.configJson = /*configJson*/ ctx[4];
- if (dirty[0] & /*widgetsJson*/ 32) configpage_changes.widgetsJson = /*widgetsJson*/ ctx[5];
- if (dirty[0] & /*itemsJson*/ 64) configpage_changes.itemsJson = /*itemsJson*/ ctx[6];
- configpage.$set(configpage_changes);
- },
- i: function intro(local) {
- if (current) return;
- transition_in(configpage.$$.fragment, local);
- current = true;
- },
- o: function outro(local) {
- transition_out(configpage.$$.fragment, local);
- current = false;
- },
- d: function destroy(detaching) {
- destroy_component(configpage, detaching);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_default_slot_5.name,
- type: "slot",
- source: "(813:10) ",
- ctx
- });
-
- return block;
- }
-
- // (816:10)
- function create_default_slot_4(ctx) {
- let connectionpage;
- let current;
-
- connectionpage = new Connection({
- props: {
- settingsJson: /*settingsJson*/ ctx[8],
- ssidJson: /*ssidJson*/ ctx[9],
- ssidDropdownClick: /*func_2*/ ctx[32],
- saveSettings: /*func_3*/ ctx[33]
- },
- $$inline: true
- });
-
- const block = {
- c: function create() {
- create_component(connectionpage.$$.fragment);
- },
- m: function mount(target, anchor) {
- mount_component(connectionpage, target, anchor);
- current = true;
- },
- p: function update(ctx, dirty) {
- const connectionpage_changes = {};
- if (dirty[0] & /*settingsJson*/ 256) connectionpage_changes.settingsJson = /*settingsJson*/ ctx[8];
- if (dirty[0] & /*ssidJson*/ 512) connectionpage_changes.ssidJson = /*ssidJson*/ ctx[9];
- connectionpage.$set(connectionpage_changes);
- },
- i: function intro(local) {
- if (current) return;
- transition_in(connectionpage.$$.fragment, local);
- current = true;
- },
- o: function outro(local) {
- transition_out(connectionpage.$$.fragment, local);
- current = false;
- },
- d: function destroy(detaching) {
- destroy_component(connectionpage, detaching);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_default_slot_4.name,
- type: "slot",
- source: "(816:10) ",
- ctx
- });
-
- return block;
- }
-
- // (819:10)
- function create_default_slot_3(ctx) {
- let utilitiespage;
- let current;
- utilitiespage = new Utilities({ $$inline: true });
-
- const block = {
- c: function create() {
- create_component(utilitiespage.$$.fragment);
- },
- m: function mount(target, anchor) {
- mount_component(utilitiespage, target, anchor);
- current = true;
- },
- i: function intro(local) {
- if (current) return;
- transition_in(utilitiespage.$$.fragment, local);
- current = true;
- },
- o: function outro(local) {
- transition_out(utilitiespage.$$.fragment, local);
- current = false;
- },
- d: function destroy(detaching) {
- destroy_component(utilitiespage, detaching);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_default_slot_3.name,
- type: "slot",
- source: "(819:10) ",
- ctx
- });
-
- return block;
- }
-
- // (822:10)
- function create_default_slot_2(ctx) {
- let logpage;
- let current;
-
- logpage = new Log({
- props: { coreMessages: /*coreMessages*/ ctx[13] },
- $$inline: true
- });
-
- const block = {
- c: function create() {
- create_component(logpage.$$.fragment);
- },
- m: function mount(target, anchor) {
- mount_component(logpage, target, anchor);
- current = true;
- },
- p: function update(ctx, dirty) {
- const logpage_changes = {};
- if (dirty[0] & /*coreMessages*/ 8192) logpage_changes.coreMessages = /*coreMessages*/ ctx[13];
- logpage.$set(logpage_changes);
- },
- i: function intro(local) {
- if (current) return;
- transition_in(logpage.$$.fragment, local);
- current = true;
- },
- o: function outro(local) {
- transition_out(logpage.$$.fragment, local);
- current = false;
- },
- d: function destroy(detaching) {
- destroy_component(logpage, detaching);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_default_slot_2.name,
- type: "slot",
- source: "(822:10) ",
- ctx
- });
-
- return block;
- }
-
- // (825:10)
- function create_default_slot_1(ctx) {
- let aboutpage;
- let current;
-
- aboutpage = new About({
- props: {
- wigetsUpdate: /*wigetsUpdate*/ ctx[19],
- layoutJson: /*layoutJson*/ ctx[7],
- showModal: /*func_4*/ ctx[34],
- syntaxHighlight: /*func_5*/ ctx[35]
- },
- $$inline: true
- });
-
- const block = {
- c: function create() {
- create_component(aboutpage.$$.fragment);
- },
- m: function mount(target, anchor) {
- mount_component(aboutpage, target, anchor);
- current = true;
- },
- p: function update(ctx, dirty) {
- const aboutpage_changes = {};
- if (dirty[0] & /*layoutJson*/ 128) aboutpage_changes.layoutJson = /*layoutJson*/ ctx[7];
- aboutpage.$set(aboutpage_changes);
- },
- i: function intro(local) {
- if (current) return;
- transition_in(aboutpage.$$.fragment, local);
- current = true;
- },
- o: function outro(local) {
- transition_out(aboutpage.$$.fragment, local);
- current = false;
- },
- d: function destroy(detaching) {
- destroy_component(aboutpage, detaching);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_default_slot_1.name,
- type: "slot",
- source: "(825:10) ",
- ctx
- });
-
- return block;
- }
-
- // (829:8)
- function create_default_slot(ctx) {
- let listpage;
- let current;
-
- listpage = new List({
- props: {
- deviceList: /*deviceList*/ ctx[14],
- showInput: /*showInput*/ ctx[15],
- devListSave: /*func_6*/ ctx[36],
- newDevice: /*newDevice*/ ctx[12]
- },
- $$inline: true
- });
-
- const block = {
- c: function create() {
- create_component(listpage.$$.fragment);
- },
- m: function mount(target, anchor) {
- mount_component(listpage, target, anchor);
- current = true;
- },
- p: function update(ctx, dirty) {
- const listpage_changes = {};
- if (dirty[0] & /*deviceList*/ 16384) listpage_changes.deviceList = /*deviceList*/ ctx[14];
- if (dirty[0] & /*newDevice*/ 4096) listpage_changes.newDevice = /*newDevice*/ ctx[12];
- listpage.$set(listpage_changes);
- },
- i: function intro(local) {
- if (current) return;
- transition_in(listpage.$$.fragment, local);
- current = true;
- },
- o: function outro(local) {
- transition_out(listpage.$$.fragment, local);
- current = false;
- },
- d: function destroy(detaching) {
- destroy_component(listpage, detaching);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_default_slot.name,
- type: "slot",
- source: "(829:8) ",
- ctx
- });
-
- return block;
- }
-
- function create_fragment(ctx) {
- let div5;
- let modal;
- let t0;
- let header;
- let div2;
- let div0;
- let select;
- let t1;
- let div1;
- let cloudicon;
- let t2;
- let nav;
- let input;
- let t3;
- let label;
- let span;
- let t4;
- let ul0;
- let li0;
- let a0;
- let t6;
- let li1;
- let a1;
- let t8;
- let li2;
- let a2;
- let t10;
- let li3;
- let a3;
- let t12;
- let li4;
- let a4;
- let t14;
- let li5;
- let a5;
- let t16;
- let li6;
- let a6;
- let t18;
- let main;
- let ul1;
- let div3;
- let current_block_type_index;
- let if_block;
- let t19;
- let route;
- let main_class_value;
- let t20;
- let footer;
- let div4;
- let current;
- let mounted;
- let dispose;
-
- modal = new Modal({
- props: { show: /*showModalFlag*/ ctx[2] },
- $$inline: true
- });
-
- let each_value = /*deviceList*/ ctx[14];
- 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));
- }
-
- cloudicon = new Cloud({
- props: {
- color: /*socketConnected*/ ctx[10] === true
- ? "text-green-500"
- : "text-red-500"
- },
- $$inline: true
- });
-
- const if_block_creators = [create_if_block, create_else_block];
- const if_blocks = [];
-
- function select_block_type(ctx, dirty) {
- if (!/*socketConnected*/ ctx[10]) return 0;
- return 1;
- }
-
- current_block_type_index = select_block_type(ctx);
- if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
-
- route = new Route({
- props: {
- path: "/list",
- $$slots: { default: [create_default_slot] },
- $$scope: { ctx }
- },
- $$inline: true
- });
-
- const block = {
- c: function create() {
- div5 = element("div");
- create_component(modal.$$.fragment);
- t0 = space();
- header = element("header");
- div2 = element("div");
- div0 = element("div");
- select = element("select");
-
- for (let i = 0; i < each_blocks.length; i += 1) {
- each_blocks[i].c();
- }
-
- t1 = space();
- div1 = element("div");
- create_component(cloudicon.$$.fragment);
- t2 = space();
- nav = element("nav");
- input = element("input");
- t3 = space();
- label = element("label");
- span = element("span");
- t4 = space();
- ul0 = element("ul");
- li0 = element("li");
- a0 = element("a");
- a0.textContent = `${"Управление"}`;
- t6 = space();
- li1 = element("li");
- a1 = element("a");
- a1.textContent = `${"Конфигуратор"}`;
- t8 = space();
- li2 = element("li");
- a2 = element("a");
- a2.textContent = `${"Подключение"}`;
- t10 = space();
- li3 = element("li");
- a3 = element("a");
- a3.textContent = `${"Утилиты"}`;
- t12 = space();
- li4 = element("li");
- a4 = element("a");
- a4.textContent = `${"Лог"}`;
- t14 = space();
- li5 = element("li");
- a5 = element("a");
- a5.textContent = `${"Устройства"}`;
- t16 = space();
- li6 = element("li");
- a6 = element("a");
- a6.textContent = `${"О проекте"}`;
- t18 = space();
- main = element("main");
- ul1 = element("ul");
- div3 = element("div");
- if_block.c();
- t19 = space();
- create_component(route.$$.fragment);
- t20 = space();
- footer = element("footer");
- div4 = element("div");
- div4.textContent = "Developed by Dmitry Borisenko";
- attr_dev(select, "class", "border border-indigo-500 border-4");
- if (/*selectedWs*/ ctx[11] === void 0) add_render_callback(() => /*select_change_handler*/ ctx[26].call(select));
- add_location(select, file, 758, 8, 24456);
- attr_dev(div0, "class", "px-15 py-1 z-50 ");
- add_location(div0, file, 757, 6, 24416);
- attr_dev(div1, "class", "pl-4 pr-4 py-1");
- add_location(div1, file, 766, 6, 24764);
- attr_dev(div2, "class", "flex content-center items-center justify-end");
- add_location(div2, file, 756, 4, 24350);
- attr_dev(header, "class", "h-10 w-full bg-gray-100 overflow-auto shadow-md");
- add_location(header, file, 755, 2, 24280);
- attr_dev(input, "id", "menu__toggle");
- attr_dev(input, "type", "checkbox");
- add_location(input, file, 773, 4, 24953);
- add_location(span, file, 775, 6, 25104);
- attr_dev(label, "class", "menu__btn");
- attr_dev(label, "for", "menu__toggle");
- add_location(label, file, 774, 4, 25052);
- attr_dev(a0, "class", "menu__item");
- attr_dev(a0, "href", "/");
- add_location(a0, file, 780, 8, 25178);
- add_location(li0, file, 779, 6, 25164);
- attr_dev(a1, "class", "menu__item");
- attr_dev(a1, "href", "/config");
- add_location(a1, file, 783, 8, 25262);
- add_location(li1, file, 782, 6, 25248);
- attr_dev(a2, "class", "menu__item");
- attr_dev(a2, "href", "/connection");
- add_location(a2, file, 786, 8, 25354);
- add_location(li2, file, 785, 6, 25340);
- attr_dev(a3, "class", "menu__item");
- attr_dev(a3, "href", "/utilities");
- add_location(a3, file, 789, 8, 25449);
- add_location(li3, file, 788, 6, 25435);
- attr_dev(a4, "class", "menu__item");
- attr_dev(a4, "href", "/log");
- add_location(a4, file, 792, 8, 25539);
- add_location(li4, file, 791, 6, 25525);
- attr_dev(a5, "class", "menu__item");
- attr_dev(a5, "href", "/list");
- add_location(a5, file, 795, 8, 25619);
- add_location(li5, file, 794, 6, 25605);
- attr_dev(a6, "class", "menu__item");
- attr_dev(a6, "href", "/about");
- add_location(a6, file, 798, 8, 25707);
- add_location(li6, file, 797, 6, 25693);
- attr_dev(ul0, "class", "menu__box");
- add_location(ul0, file, 778, 4, 25134);
- attr_dev(nav, "class", "flex");
- add_location(nav, file, 772, 2, 24929);
- attr_dev(div3, "class", "bg-cover pt-0 px-4");
- add_location(div3, file, 805, 6, 25931);
- attr_dev(ul1, "class", "menu__main");
- add_location(ul1, file, 804, 4, 25900);
-
- attr_dev(main, "class", main_class_value = "flex-1 overflow-y-auto p-0 " + (/*opened*/ ctx[0] === true && !/*preventMove*/ ctx[1]
- ? 'ml-36'
- : 'ml-0'));
-
- add_location(main, file, 803, 2, 25800);
- attr_dev(div4, "class", "flex justify-center content-center text-xxs text-gray-500");
- add_location(div4, file, 836, 4, 27336);
- attr_dev(footer, "class", "h-4 bg-gray-100 border-gray-200 shadow-lg");
- add_location(footer, file, 835, 2, 27272);
- attr_dev(div5, "class", "flex flex-col h-screen bg-gray-50");
- add_location(div5, file, 752, 0, 24193);
- },
- 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);
- mount_component(modal, div5, null);
- append_dev(div5, t0);
- append_dev(div5, header);
- append_dev(header, div2);
- append_dev(div2, div0);
- append_dev(div0, select);
-
- for (let i = 0; i < each_blocks.length; i += 1) {
- each_blocks[i].m(select, null);
- }
-
- select_option(select, /*selectedWs*/ ctx[11]);
- append_dev(div2, t1);
- append_dev(div2, div1);
- mount_component(cloudicon, div1, null);
- append_dev(div5, t2);
- append_dev(div5, nav);
- append_dev(nav, input);
- input.checked = /*opened*/ ctx[0];
- append_dev(nav, t3);
- append_dev(nav, label);
- append_dev(label, span);
- append_dev(nav, t4);
- append_dev(nav, ul0);
- append_dev(ul0, li0);
- append_dev(li0, a0);
- append_dev(ul0, t6);
- append_dev(ul0, li1);
- append_dev(li1, a1);
- append_dev(ul0, t8);
- append_dev(ul0, li2);
- append_dev(li2, a2);
- append_dev(ul0, t10);
- append_dev(ul0, li3);
- append_dev(li3, a3);
- append_dev(ul0, t12);
- append_dev(ul0, li4);
- append_dev(li4, a4);
- append_dev(ul0, t14);
- append_dev(ul0, li5);
- append_dev(li5, a5);
- append_dev(ul0, t16);
- append_dev(ul0, li6);
- append_dev(li6, a6);
- append_dev(div5, t18);
- append_dev(div5, main);
- append_dev(main, ul1);
- append_dev(ul1, div3);
- if_blocks[current_block_type_index].m(div3, null);
- append_dev(div3, t19);
- mount_component(route, div3, null);
- append_dev(div5, t20);
- append_dev(div5, footer);
- append_dev(footer, div4);
- current = true;
-
- if (!mounted) {
- dispose = [
- listen_dev(select, "change", /*select_change_handler*/ ctx[26]),
- listen_dev(select, "change", /*change_handler*/ ctx[27], false, false, false),
- listen_dev(input, "change", /*input_change_handler*/ ctx[28]),
- listen_dev(input, "change", /*change_handler_1*/ ctx[29], false, false, false)
- ];
-
- mounted = true;
- }
- },
- p: function update(ctx, dirty) {
- const modal_changes = {};
- if (dirty[0] & /*showModalFlag*/ 4) modal_changes.show = /*showModalFlag*/ ctx[2];
- modal.$set(modal_changes);
-
- if (dirty[0] & /*deviceList*/ 16384) {
- each_value = /*deviceList*/ ctx[14];
- 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(select, null);
- }
- }
-
- for (; i < each_blocks.length; i += 1) {
- each_blocks[i].d(1);
- }
-
- each_blocks.length = each_value.length;
- }
-
- if (dirty[0] & /*selectedWs, deviceList*/ 18432) {
- select_option(select, /*selectedWs*/ ctx[11]);
- }
-
- const cloudicon_changes = {};
-
- if (dirty[0] & /*socketConnected*/ 1024) cloudicon_changes.color = /*socketConnected*/ ctx[10] === true
- ? "text-green-500"
- : "text-red-500";
-
- cloudicon.$set(cloudicon_changes);
-
- if (dirty[0] & /*opened*/ 1) {
- input.checked = /*opened*/ ctx[0];
- }
-
- let previous_block_index = current_block_type_index;
- current_block_type_index = select_block_type(ctx);
-
- if (current_block_type_index === previous_block_index) {
- if_blocks[current_block_type_index].p(ctx, dirty);
- } else {
- group_outros();
-
- transition_out(if_blocks[previous_block_index], 1, 1, () => {
- if_blocks[previous_block_index] = null;
- });
-
- check_outros();
- if_block = if_blocks[current_block_type_index];
-
- if (!if_block) {
- if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
- if_block.c();
- } else {
- if_block.p(ctx, dirty);
- }
-
- transition_in(if_block, 1);
- if_block.m(div3, t19);
- }
-
- const route_changes = {};
-
- if (dirty[0] & /*deviceList, newDevice*/ 20480 | dirty[3] & /*$$scope*/ 1) {
- route_changes.$$scope = { dirty, ctx };
- }
-
- route.$set(route_changes);
-
- if (!current || dirty[0] & /*opened, preventMove*/ 3 && main_class_value !== (main_class_value = "flex-1 overflow-y-auto p-0 " + (/*opened*/ ctx[0] === true && !/*preventMove*/ ctx[1]
- ? 'ml-36'
- : 'ml-0'))) {
- attr_dev(main, "class", main_class_value);
- }
- },
- i: function intro(local) {
- if (current) return;
- transition_in(modal.$$.fragment, local);
- transition_in(cloudicon.$$.fragment, local);
- transition_in(if_block);
- transition_in(route.$$.fragment, local);
- current = true;
- },
- o: function outro(local) {
- transition_out(modal.$$.fragment, local);
- transition_out(cloudicon.$$.fragment, local);
- transition_out(if_block);
- transition_out(route.$$.fragment, local);
- current = false;
- },
- d: function destroy(detaching) {
- if (detaching) detach_dev(div5);
- destroy_component(modal);
- destroy_each(each_blocks, detaching);
- destroy_component(cloudicon);
- if_blocks[current_block_type_index].d();
- destroy_component(route);
- mounted = false;
- run_all(dispose);
- }
- };
-
- dispatch_dev("SvelteRegisterBlock", {
- block,
- id: create_fragment.name,
- type: "component",
- source: "",
- ctx
- });
-
- return block;
- }
-
- function combineArrays(A, B) {
- var ids = new Set(A.map(d => d.ip));
- let output = [...A, ...B.filter(d => !ids.has(d.ip))];
- return output;
- }
-
- //****************************************************************json******************************************************************/
- function getJsonObject(array, number) {
- let num = 0;
- let out = {};
-
- array.forEach(object => {
- if (num === number) {
- out = object;
- }
-
- num++;
- });
-
- return out;
- }
-
- async function handleSubmit(url) {
- try {
- console.log(url);
- let res = await fetch(url, { mode: "no-cors", method: "GET" });
-
- if (res.ok) {
- console.log("OK", res.status);
- } else {
- console.log("error", res.status); //console.log(url);
- } //console.log(url);
- } catch(e) {
- console.log(e);
- }
- }
-
- async function getRequestJson(url) {
- let res = await fetch(url, { mode: "no-cors", method: "GET" });
-
- if (res.ok) {
- configSetupJson = await res.json();
- } else {
- console.log("error", res.status);
- }
- }
-
- function instance($$self, $$props, $$invalidate) {
- let $router;
- validate_store(f, 'router');
- component_subscribe($$self, f, $$value => $$invalidate(57, $router = $$value));
- let { $$slots: slots = {}, $$scope } = $$props;
- validate_slots('App', slots, []);
- f.mode.hash();
-
- //****************************************************constants section*********************************************************/
- //******************************************************************************************************************************/
- let debug = true;
-
- let LOG_MAX_MESSAGES = 10;
- let reconnectTimeout = 60000;
- let opened = false;
- let preventMove = false;
-
- //****************************************************variable section**********************************************************/
- //******************************************************************************************************************************/
- let myip = document.location.hostname;
-
- //let myip = "192.168.88.235";
- //Flags
- let showInput = false;
-
- let showModalFlag = false;
- let additionalParams = false;
-
- //dashboard
- let pages = [];
-
- //configuration
- let configJson = [];
-
- let configJsonFlag = false;
- let configJsonParced = false;
- let widgetsJson = [];
- let widgetsJsonFlag = false;
- let widgetsJsonParced = false;
- let itemsJson = [];
- let itemsJsonFlag = false;
- let itemsJsonParced = false;
- let layoutJson = [];
- let layoutJsonFlag = false;
- let layoutJsonParced = false;
- let settingsJson = {};
- let settingsJsonFlag = false;
- let settingsJsonParced = false;
- let ssidJson = {};
- let ssidJsonParced = false;
-
- //web sockets
- let socket = [];
-
- let socketConnected = false;
- let selectedDeviceData = undefined;
- let selectedWs = 0;
- let flag = true;
- let newDevice = {};
- let coreMessages = [];
- let oneOfJsonPackageError = false;
- let deviceList = [];
-
- deviceList = [
- {
- name: "--",
- id: "--",
- ip: myip,
- status: false
- }
- ];
-
- let incDeviceList = [];
- let incDeviceListParced = false;
-
- //***********************************************************blob**************************************************************/
- var MyBlobBuilder = function () {
- this.parts = [];
- };
-
- MyBlobBuilder.prototype.append = function (part) {
- this.parts.push(part);
- this.blob = undefined; // Invalidate the blob
- };
-
- MyBlobBuilder.prototype.getBlob = function () {
- if (!this.blob) {
- this.blob = new Blob(this.parts, { type: "binary" });
- }
-
- return this.blob;
- };
-
- MyBlobBuilder.prototype.clear = function () {
- this.parts = [];
- };
-
- //***********************************************************navigation********************************************************/
- let currentPageName = undefined;
-
- var configJsonBlob = new MyBlobBuilder();
- var widgetsJsonBlob = new MyBlobBuilder();
- var itemsJsonBlob = new MyBlobBuilder();
- var layoutJsonBlob = new MyBlobBuilder();
- var settingsJsonBlob = new MyBlobBuilder();
- f.subscribe(handleNavigation);
-
- function handleNavigation() {
- clearData();
- currentPageName = $router.path.toString();
- console.log("[i]", "user on page:", currentPageName);
- sendCurrentPageName();
- }
-
- function sendCurrentPageName() {
- if (selectedWs !== undefined) {
- wsSendMsg(selectedWs, currentPageName);
- }
- }
-
- //****************************************************web sockets section******************************************************/
- function connectToAllDevices() {
- //closeAllConnection();
- //socket = [];
- getSelectedDeviceData(selectedWs);
-
- let ws = 0;
-
- deviceList.forEach(device => {
- //if (debug) console.log("[i]", device.name, ws, device.ip, device.id);
- device.ws = ws;
-
- if (!device.status) {
- wsConnect(ws);
- wsEventAdd(ws);
- }
-
- ws++;
- });
-
- $$invalidate(14, deviceList);
- } //socketConnected = selectedDeviceData.status;
-
- function closeAllConnection() {
- let s;
-
- for (s in socket) {
- socket[s].close();
- }
- }
-
- function markDeviceStatus(ws, status) {
- deviceList.forEach(device => {
- if (device.ws === ws) {
- device.status = status;
-
- if (debug) {
- if (device.status) {
- console.log("[i]", device.ip, "status online");
- } else {
- console.log("[i]", device.ip, "status offline");
- }
- }
- }
- });
-
- $$invalidate(14, deviceList);
- getSelectedDeviceData(selectedWs);
- $$invalidate(10, socketConnected = selectedDeviceData.status);
- }
-
- function getDeviceStatus(ws) {
- let ret = false;
-
- deviceList.forEach(device => {
- if (ws === device.ws) {
- ret = device.status;
- }
- });
-
- return ret;
- }
-
- function wsConnect(ws) {
- let ip = getIP(ws);
-
- if (ip === "error") {
- if (debug) console.log("[e]", "device list wrong");
- } else {
- socket[ws] = new WebSocket("ws://" + ip + ":81");
- socket.binaryType = "blob";
-
- //socket[ws] = new WebSocket("ws://" + ip + "/ws");
- if (debug) console.log("[i]", ip, "started connecting...");
- }
- }
-
- function getIP(ws) {
- let ret = "error";
-
- deviceList.forEach(device => {
- if (ws === device.ws) {
- ret = device.ip;
- }
- });
-
- return ret;
- }
-
- function wsEventAdd(ws) {
- if (socket[ws]) {
- let ip = getIP(ws);
- if (debug) console.log("[i]", ip, "web socket events added");
-
- socket[ws].addEventListener("open", function (event) {
- if (debug) console.log("[i]", ip, "completed connecting");
- markDeviceStatus(ws, true);
- sendCurrentPageName();
- }); //socket[ws].send("HELLO");
-
- socket[ws].addEventListener("message", function (event) {
- if (typeof event.data === "string") {
- let data = event.data;
-
- //if (debug) console.log("[i]", getIP(ws), "msg received", data); //
- //сборщик statusJson сообщений======================================
- if (data.includes("status")) {
- if (IsJsonParse(data)) {
- let statusJson = JSON.parse(data);
- udatelayoutJson(statusJson);
- wigetsUpdate();
- if (debug) console.log("[i]", "status json parced: ", statusJson);
- }
- }
-
- //сборщик ssidJson сообщений======================================
- if (data.includes("ssid")) {
- if (IsJsonParse(data)) {
- $$invalidate(9, ssidJson = JSON.parse(data));
- delete ssidJson.ssid;
- $$invalidate(9, ssidJson);
- ssidJsonParced = true;
- if (debug) console.log("[i]", "ssid json parced");
- }
- }
-
- //сборщик deviceList сообщений======================================
- if (data.includes("devicelist")) {
- if (IsJsonParse(data)) {
- incDeviceList = JSON.parse(data);
- delete incDeviceList.devicelist;
- incDeviceList = incDeviceList;
- incDeviceListParced = true;
- $$invalidate(14, deviceList = combineArrays(deviceList, incDeviceList));
- $$invalidate(14, deviceList);
- whenDeviceListWasUpdated();
- connectToAllDevices();
- if (debug) console.log("[i]", "incDeviceList json parced", incDeviceList);
- }
- }
-
- //сборщик configJson пакетов========================================
- if (data === "/st/config.json") {
- //if (debug) console.log("[i]", "configJson start!");
- configJsonFlag = true;
- }
-
- if (data === "/end/config.json") {
- //if (debug) console.log("[i]", "configJson end!");
- configJsonFlag = false;
-
- var bb = configJsonBlob.getBlob();
- let configJsonReader = new FileReader();
- configJsonReader.readAsText(bb);
-
- configJsonReader.onload = () => {
- let configJsonResult = configJsonReader.result;
-
- if (IsJsonParse(configJsonResult)) {
- $$invalidate(4, configJson = JSON.parse(configJsonResult));
- $$invalidate(4, configJson);
- configJsonParced = true;
- if (debug) console.log("[ii]", "configJson parced!");
- }
- };
- }
-
- //сборщик widgetsJson пакетов========================================
- if (data === "/st/widgets.json") {
- //if (debug) console.log("[i]", "widgetsJson start!");
- widgetsJsonFlag = true;
- }
-
- if (data === "/end/widgets.json") {
- //if (debug) console.log("[i]", "widgetsJson end!");
- widgetsJsonFlag = false;
-
- var bb = widgetsJsonBlob.getBlob();
- let widgetsJsonReader = new FileReader();
- widgetsJsonReader.readAsText(bb);
-
- widgetsJsonReader.onload = () => {
- let widgetsJsonResult = widgetsJsonReader.result;
-
- if (IsJsonParse(widgetsJsonResult)) {
- $$invalidate(5, widgetsJson = JSON.parse(widgetsJsonResult));
- $$invalidate(5, widgetsJson);
- widgetsJsonParced = true;
- if (debug) console.log("[ii]", "widgetsJson parced!");
- }
- };
- }
-
- //сборщик itemsJson пакетов========================================
- if (data === "/st/items.json") {
- //if (debug) console.log("[i]", "itemsJson start!");
- itemsJsonFlag = true;
- }
-
- if (data === "/end/items.json") {
- //if (debug) console.log("[i]", "itemsJson end!");
- itemsJsonFlag = false;
-
- var bb = itemsJsonBlob.getBlob();
- let itemsJsonReader = new FileReader();
- itemsJsonReader.readAsText(bb);
-
- itemsJsonReader.onload = () => {
- let itemsJsonResult = itemsJsonReader.result;
-
- if (IsJsonParse(itemsJsonResult)) {
- $$invalidate(6, itemsJson = JSON.parse(itemsJsonResult));
- $$invalidate(6, itemsJson);
- itemsJsonParced = true;
- if (debug) console.log("[ii]", "itemsJson parced!");
- }
- };
- }
-
- //сборщик layoutJson пакетов========================================
- if (data === "/st/layout.json") {
- //if (debug) console.log("[i]", "layoutJson start!");
- layoutJsonFlag = true;
- }
-
- if (data === "/end/layout.json") {
- //if (debug) console.log("[i]", "layoutJson end!");
- layoutJsonFlag = false;
-
- var bb = layoutJsonBlob.getBlob();
- let layoutJsonReader = new FileReader();
- layoutJsonReader.readAsText(bb);
-
- layoutJsonReader.onload = () => {
- let layoutJsonResult = layoutJsonReader.result;
-
- if (IsJsonParse(layoutJsonResult)) {
- $$invalidate(7, layoutJson = JSON.parse(layoutJsonResult));
- $$invalidate(7, layoutJson);
- wigetsUpdate();
- layoutJsonParced = true;
- if (debug) console.log("[ii]", "layoutJson parced!");
- }
- };
- }
-
- //сборщик settingsJson пакетов========================================
- if (data === "/st/settings.json") {
- //if (debug) console.log("[i]", "settingsJson start!");
- settingsJsonFlag = true;
- }
-
- if (data === "/end/settings.json") {
- //if (debug) console.log("[i]", "settingsJson end!");
- settingsJsonFlag = false;
-
- var bb = settingsJsonBlob.getBlob();
- let settingsJsonReader = new FileReader();
- settingsJsonReader.readAsText(bb);
-
- settingsJsonReader.onload = () => {
- let settingsJsonResult = settingsJsonReader.result;
-
- if (IsJsonParse(settingsJsonResult)) {
- $$invalidate(8, settingsJson = JSON.parse(settingsJsonResult));
- $$invalidate(8, settingsJson);
- wigetsUpdate();
- settingsJsonParced = true;
- updateThisDeviceInList();
- if (debug) console.log("[ii]", "settingsJson parced!");
- }
- };
- }
- }
-
- if (event.data instanceof Blob) {
- if (configJsonFlag) configJsonBlob.append(event.data);
- if (widgetsJsonFlag) widgetsJsonBlob.append(event.data);
- if (itemsJsonFlag) itemsJsonBlob.append(event.data);
- if (layoutJsonFlag) layoutJsonBlob.append(event.data);
- if (settingsJsonFlag) settingsJsonBlob.append(event.data);
- }
- });
-
- socket[ws].addEventListener("close", event => {
- if (debug) console.log("[e]", ip, "connection closed");
- markDeviceStatus(ws, false);
- });
-
- socket[ws].addEventListener("error", function (event) {
- if (debug) console.log("[e]", ip, "connection error");
- markDeviceStatus(ws, false);
- });
- } else {
- if (debug) console.log("[e]", "socket not exist");
- }
- }
-
- function saveConfig() {
- wsSendMsg(selectedWs, "/tuoyal" + JSON.stringify(generateLayout()));
- wsSendMsg(selectedWs, "/gifnoc" + JSON.stringify(configJson));
- clearData();
- sendCurrentPageName();
- }
-
- function saveSettings() {
- wsSendMsg(selectedWs, "/cennoc" + JSON.stringify(settingsJson));
- clearData();
- sendCurrentPageName();
- }
-
- function generateLayout() {
- let layout = [];
-
- for (let i = 0; i < configJson.length; i++) {
- let config = Object.assign({}, configJson[i]);
- let setWidget = config.widget;
- let error = true;
-
- for (let w = 0; w < widgetsJson.length; w++) {
- if (setWidget === widgetsJson[w].name) {
- let widget = Object.assign({}, widgetsJson[w]);
- widget.page = config.page;
- widget.descr = config.descr;
-
- //widget.id = config.id;
- //widget.ws = selectedWs;
- widget.topic = settingsJson.root + "/" + config.id;
-
- layout.push(widget);
- error = false;
- break;
- } else {
- error = true;
- }
- }
-
- if (error) console.log("[e]", "error, widget not found: " + setWidget);
- }
-
- if (debug) console.log("[i] layout:", JSON.stringify(layout));
- return layout;
- }
-
- function udatelayoutJson(newStatusJson) {
- for (let i = 0; i < layoutJson.length; i++) {
- let topic = layoutJson[i].topic;
-
- if (topic === newStatusJson.topic) {
- $$invalidate(7, layoutJson[i].status = newStatusJson.status, layoutJson);
- break;
- }
- }
- }
-
- function clearData() {
- $$invalidate(4, configJson = []);
- configJsonBlob.clear();
- $$invalidate(5, widgetsJson = []);
- widgetsJsonBlob.clear();
- $$invalidate(6, itemsJson = []);
- itemsJsonBlob.clear();
- $$invalidate(7, layoutJson = []);
- layoutJsonBlob.clear();
- $$invalidate(8, settingsJson = {});
- settingsJsonBlob.clear();
- configJsonParced = false;
- widgetsJsonParced = false;
- itemsJsonParced = false;
- layoutJsonParced = false;
- settingsJsonParced = false;
- ssidJsonParced = false;
- if (debug) console.log("[i]", "all app data cleared");
- }
-
- function wsPush(ws, topic, status) {
- let msg = topic + " " + status;
- if (debug) console.log("[i]", "send to ws msg:", msg);
- wsSendMsg(ws, msg);
- }
-
- function wsTestMsgTask() {
- setTimeout(wsTestMsgTask, reconnectTimeout);
- if (debug) console.log("[i]", "----timer tick----");
-
- if (!flag) {
- deviceList.forEach(device => {
- if (!getDeviceStatus(device.ws)) {
- wsConnect(device.ws);
- wsEventAdd(device.ws);
- } else {
- wsSendMsg(device.ws, "tst");
- }
- });
- }
-
- flag = false;
- }
-
- function wsSendMsg(ws, msg) {
- if (socket[ws] && socket[ws].readyState === 1) {
- socket[ws].send(msg);
- if (debug) console.log("[i]", getIP(ws), "msg send success", msg);
- } else {
- if (debug) console.log("[e]", getIP(ws), "msg not send", msg);
- }
- }
-
- //***********************************************************dashboard***************************************************************/
- function findNewPage() {
- $$invalidate(3, pages = []);
- const newPage = Array.from(new Set(Array.from(layoutJson, ({ page }) => page)));
-
- newPage.forEach(function (item, i, arr) {
- $$invalidate(3, pages = [...pages, JSON.parse(JSON.stringify({ page: item }))]);
- });
-
- pages.sort(function (a, b) {
- if (a.page < b.page) {
- return -1;
- }
-
- if (a.page > b.page) {
- return 1;
- }
-
- return 0;
- });
- }
-
- function wigetsUpdate() {
- findNewPage();
- }
-
- //***********************************************************logging******************************************************************/
- const addCoreMsg = msg => {
- if (coreMessages.length > Number(LOG_MAX_MESSAGES)) {
- $$invalidate(13, coreMessages = coreMessages.slice(0));
- }
-
- const time = new Date().getTime();
- $$invalidate(13, coreMessages = [...coreMessages, { time, msg }]);
-
- coreMessages.sort(function (a, b) {
- if (a.time > b.time) {
- return -1;
- }
-
- if (a.time < b.time) {
- return 1;
- }
-
- return 0;
- });
- };
-
- function whenDeviceListWasUpdated() {
- getSelectedDeviceData(selectedWs);
- $$invalidate(10, socketConnected = selectedDeviceData.status);
- }
-
- function devicesDropdownChange() {
- whenDeviceListWasUpdated();
- clearData();
- sendCurrentPageName();
- if (debug) console.log("[i]", "user selected device:", selectedDeviceData.name);
-
- if (selectedDeviceData.ip === myip) {
- if (debug) console.log("[i]", "user selected original device", selectedDeviceData.name);
- }
- }
-
- function getSelectedDeviceData(ws) {
- for (let i = 0; i < deviceList.length; i++) {
- let device = deviceList[i];
-
- if (device.ws === ws) {
- selectedDeviceData = device;
- break;
- }
- }
- }
-
- function devListSave() {
- //createDefaultDevice();
- if (!showInput) {
- if (newDevice.name !== undefined && newDevice.ip !== undefined && newDevice.id !== undefined) {
- $$invalidate(12, newDevice.status = false, newDevice);
- deviceList.push(newDevice);
- $$invalidate(14, deviceList);
- $$invalidate(12, newDevice = {});
- whenDeviceListWasUpdated();
- connectToAllDevices();
- if (debug) console.log("[i]", "selected device:", selectedDeviceData);
- } else {
- if (debug) console.log("[e]", "wrong data");
- }
- }
- }
-
- function updateThisDeviceInList() {
- for (let i = 0; i < deviceList.length; i++) {
- let device = deviceList[i];
-
- if (device.ip === myip) {
- device.name = settingsJson.name;
- device.id = settingsJson.id;
- $$invalidate(8, settingsJson);
- break;
- }
- }
- }
-
- const syntaxHighlight = json => {
- try {
- json = JSON.stringify(JSON.parse(json), null, 4);
- } catch(e) {
- return json;
- }
-
- json = json.replace(/&/g, "&").replace(//g, ">");
-
- json = json.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g, function (match) {
- return match;
- });
-
- return json;
- };
-
- function IsJsonParse(str) {
- try {
- JSON.parse(str);
- } catch(e) {
- oneOfJsonPackageError = true;
- if (debug) console.log("[e]", "json error");
- return false;
- }
-
- oneOfJsonPackageError = false;
- return true;
- }
-
- //пример как формировать массив json
- function createWidgetsDropdown() {
- let widgetsDropdown = [];
-
- widgetsJson.forEach(widget => {
- widgetsDropdown.push({ id: widget.name, val: widget.rus });
- });
-
- widgetsDropdown = widgetsDropdown;
- if (debug) console.log("[i]", widgetsDropdown);
- }
-
- //**********************************************************post and get*****************************************************************/
- //editRequest("192.168.88.235", "data data data data", "file.json")
- function editRequest(url, data, filename) {
- if (debug) console.log("[i]", "request for edit file");
- var xmlHttp = new XMLHttpRequest();
- var formData = new FormData();
- formData.append("data", new Blob([data], { type: "text/json" }), "/" + filename);
- xmlHttp.open("POST", "http://" + url + "/edit");
-
- xmlHttp.onload = function () {
-
- }; //во время загрузки
-
- xmlHttp.send(formData);
- }
-
- function showAdditionalParams(id) {
- additionalParams = true;
- if (debug) console.log("[i]", "user open add params ", id);
- }
-
- //**********************************************************modal*************************************************************************/
- function showModal() {
- $$invalidate(2, showModalFlag = !showModalFlag);
- }
-
- function onCheck() {
- let width = screen.width;
- console.log("width", width);
-
- if (width < 900) {
- $$invalidate(1, preventMove = true);
- } else {
- $$invalidate(1, preventMove = false);
- }
- }
-
- //************************************************elements and presets dropdown************************************************************/
- function ssidDropdownClick() {
- wsSendMsg(selectedWs, "/scan");
- }
-
- //*******************************************************initialisation********************************************************************/
- onMount(async () => {
- console.log("[i]", "mounted");
- connectToAllDevices();
- wsTestMsgTask();
- whenDeviceListWasUpdated();
- findNewPage();
- });
-
- const writable_props = [];
-
- Object_1.keys($$props).forEach(key => {
- if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console_1.warn(` was created with unknown prop '${key}'`);
- });
-
- function select_change_handler() {
- selectedWs = select_value(this);
- $$invalidate(11, selectedWs);
- $$invalidate(14, deviceList);
- }
-
- const change_handler = () => devicesDropdownChange();
-
- function input_change_handler() {
- opened = this.checked;
- $$invalidate(0, opened);
- }
-
- const change_handler_1 = () => onCheck();
- const func = (ws, topic, status) => wsPush(ws, topic, status);
- const func_1 = () => saveConfig();
- const func_2 = () => ssidDropdownClick();
- const func_3 = () => saveSettings();
- const func_4 = () => showModal();
- const func_5 = json => syntaxHighlight(json);
- const func_6 = () => devListSave();
-
- $$self.$capture_state = () => ({
- onMount,
- Route,
- router: f,
- active: A,
- Alarm,
- Modal,
- DashboardPage: Dashboard,
- ConfigPage: Config,
- ConnectionPage: Connection,
- UtilitiesPage: Utilities,
- LogPage: Log,
- ListPage: List,
- AboutPage: About,
- CloudIcon: Cloud,
- debug,
- LOG_MAX_MESSAGES,
- reconnectTimeout,
- opened,
- preventMove,
- myip,
- showInput,
- showModalFlag,
- additionalParams,
- pages,
- configJson,
- configJsonFlag,
- configJsonParced,
- widgetsJson,
- widgetsJsonFlag,
- widgetsJsonParced,
- itemsJson,
- itemsJsonFlag,
- itemsJsonParced,
- layoutJson,
- layoutJsonFlag,
- layoutJsonParced,
- settingsJson,
- settingsJsonFlag,
- settingsJsonParced,
- ssidJson,
- ssidJsonParced,
- socket,
- socketConnected,
- selectedDeviceData,
- selectedWs,
- flag,
- newDevice,
- coreMessages,
- oneOfJsonPackageError,
- deviceList,
- incDeviceList,
- incDeviceListParced,
- MyBlobBuilder,
- currentPageName,
- configJsonBlob,
- widgetsJsonBlob,
- itemsJsonBlob,
- layoutJsonBlob,
- settingsJsonBlob,
- handleNavigation,
- sendCurrentPageName,
- connectToAllDevices,
- closeAllConnection,
- markDeviceStatus,
- getDeviceStatus,
- wsConnect,
- getIP,
- wsEventAdd,
- saveConfig,
- saveSettings,
- generateLayout,
- udatelayoutJson,
- clearData,
- wsPush,
- wsTestMsgTask,
- wsSendMsg,
- findNewPage,
- wigetsUpdate,
- addCoreMsg,
- combineArrays,
- whenDeviceListWasUpdated,
- devicesDropdownChange,
- getSelectedDeviceData,
- devListSave,
- updateThisDeviceInList,
- getJsonObject,
- syntaxHighlight,
- IsJsonParse,
- createWidgetsDropdown,
- editRequest,
- handleSubmit,
- getRequestJson,
- showAdditionalParams,
- showModal,
- onCheck,
- ssidDropdownClick,
- $router
- });
-
- $$self.$inject_state = $$props => {
- if ('debug' in $$props) debug = $$props.debug;
- if ('LOG_MAX_MESSAGES' in $$props) LOG_MAX_MESSAGES = $$props.LOG_MAX_MESSAGES;
- if ('reconnectTimeout' in $$props) reconnectTimeout = $$props.reconnectTimeout;
- if ('opened' in $$props) $$invalidate(0, opened = $$props.opened);
- if ('preventMove' in $$props) $$invalidate(1, preventMove = $$props.preventMove);
- if ('myip' in $$props) myip = $$props.myip;
- if ('showInput' in $$props) $$invalidate(15, showInput = $$props.showInput);
- if ('showModalFlag' in $$props) $$invalidate(2, showModalFlag = $$props.showModalFlag);
- if ('additionalParams' in $$props) additionalParams = $$props.additionalParams;
- if ('pages' in $$props) $$invalidate(3, pages = $$props.pages);
- if ('configJson' in $$props) $$invalidate(4, configJson = $$props.configJson);
- if ('configJsonFlag' in $$props) configJsonFlag = $$props.configJsonFlag;
- if ('configJsonParced' in $$props) configJsonParced = $$props.configJsonParced;
- if ('widgetsJson' in $$props) $$invalidate(5, widgetsJson = $$props.widgetsJson);
- if ('widgetsJsonFlag' in $$props) widgetsJsonFlag = $$props.widgetsJsonFlag;
- if ('widgetsJsonParced' in $$props) widgetsJsonParced = $$props.widgetsJsonParced;
- if ('itemsJson' in $$props) $$invalidate(6, itemsJson = $$props.itemsJson);
- if ('itemsJsonFlag' in $$props) itemsJsonFlag = $$props.itemsJsonFlag;
- if ('itemsJsonParced' in $$props) itemsJsonParced = $$props.itemsJsonParced;
- if ('layoutJson' in $$props) $$invalidate(7, layoutJson = $$props.layoutJson);
- if ('layoutJsonFlag' in $$props) layoutJsonFlag = $$props.layoutJsonFlag;
- if ('layoutJsonParced' in $$props) layoutJsonParced = $$props.layoutJsonParced;
- if ('settingsJson' in $$props) $$invalidate(8, settingsJson = $$props.settingsJson);
- if ('settingsJsonFlag' in $$props) settingsJsonFlag = $$props.settingsJsonFlag;
- if ('settingsJsonParced' in $$props) settingsJsonParced = $$props.settingsJsonParced;
- if ('ssidJson' in $$props) $$invalidate(9, ssidJson = $$props.ssidJson);
- if ('ssidJsonParced' in $$props) ssidJsonParced = $$props.ssidJsonParced;
- if ('socket' in $$props) socket = $$props.socket;
- if ('socketConnected' in $$props) $$invalidate(10, socketConnected = $$props.socketConnected);
- if ('selectedDeviceData' in $$props) selectedDeviceData = $$props.selectedDeviceData;
- if ('selectedWs' in $$props) $$invalidate(11, selectedWs = $$props.selectedWs);
- if ('flag' in $$props) flag = $$props.flag;
- if ('newDevice' in $$props) $$invalidate(12, newDevice = $$props.newDevice);
- if ('coreMessages' in $$props) $$invalidate(13, coreMessages = $$props.coreMessages);
- if ('oneOfJsonPackageError' in $$props) oneOfJsonPackageError = $$props.oneOfJsonPackageError;
- if ('deviceList' in $$props) $$invalidate(14, deviceList = $$props.deviceList);
- if ('incDeviceList' in $$props) incDeviceList = $$props.incDeviceList;
- if ('incDeviceListParced' in $$props) incDeviceListParced = $$props.incDeviceListParced;
- if ('MyBlobBuilder' in $$props) MyBlobBuilder = $$props.MyBlobBuilder;
- if ('currentPageName' in $$props) currentPageName = $$props.currentPageName;
- if ('configJsonBlob' in $$props) configJsonBlob = $$props.configJsonBlob;
- if ('widgetsJsonBlob' in $$props) widgetsJsonBlob = $$props.widgetsJsonBlob;
- if ('itemsJsonBlob' in $$props) itemsJsonBlob = $$props.itemsJsonBlob;
- if ('layoutJsonBlob' in $$props) layoutJsonBlob = $$props.layoutJsonBlob;
- if ('settingsJsonBlob' in $$props) settingsJsonBlob = $$props.settingsJsonBlob;
- };
-
- if ($$props && "$$inject" in $$props) {
- $$self.$inject_state($$props.$$inject);
- }
-
- return [
- opened,
- preventMove,
- showModalFlag,
- pages,
- configJson,
- widgetsJson,
- itemsJson,
- layoutJson,
- settingsJson,
- ssidJson,
- socketConnected,
- selectedWs,
- newDevice,
- coreMessages,
- deviceList,
- showInput,
- saveConfig,
- saveSettings,
- wsPush,
- wigetsUpdate,
- devicesDropdownChange,
- devListSave,
- syntaxHighlight,
- showModal,
- onCheck,
- ssidDropdownClick,
- select_change_handler,
- change_handler,
- input_change_handler,
- change_handler_1,
- func,
- func_1,
- func_2,
- func_3,
- func_4,
- func_5,
- func_6
- ];
- }
-
- class App extends SvelteComponentDev {
- constructor(options) {
- super(options);
- init(this, options, instance, create_fragment, safe_not_equal, {}, null, [-1, -1, -1, -1]);
-
- dispatch_dev("SvelteRegisterComponent", {
- component: this,
- tagName: "App",
- options,
- id: create_fragment.name
- });
- }
- }
-
- const app = new App({
- target: document.body,
- props: {
- name: 'world'
- }
- });
-
- return app;
-
-})();
+var app=function(){"use strict";function t(){}function e(t){return t()}function n(){return Object.create(null)}function i(t){t.forEach(e)}function s(t){return"function"==typeof t}function a(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function r(e,n,i){e.$$.on_destroy.push(function(e,...n){if(null==e)return t;const i=e.subscribe(...n);return i.unsubscribe?()=>i.unsubscribe():i}(n,i))}function o(t,e,n,i){if(t){const s=l(t,e,n,i);return t[0](s)}}function l(t,e,n,i){return t[1]&&i?function(t,e){for(const n in e)t[n]=e[n];return t}(n.ctx.slice(),t[1](i(e))):n.ctx}function c(t,e,n,i){if(t[2]&&i){const s=t[2](i(n));if(void 0===e.dirty)return s;if("object"==typeof s){const t=[],n=Math.max(e.dirty.length,s.length);for(let i=0;i32){const e=[],n=t.ctx.length/32;for(let t=0;tt.removeEventListener(e,n,i)}function $(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function k(t){return""===t?null:+t}function O(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function A(t,e){t.value=null==e?"":e}function P(t,e){for(let n=0;nt.call(this,e)))}const D=[],E=[],z=[],H=[],j=Promise.resolve();let J=!1;function F(){J||(J=!0,j.then(q))}function W(){return F(),j}function R(t){z.push(t)}function I(t){H.push(t)}const B=new Set;let Y=0;function q(){const t=T;do{for(;Y{V.delete(t),i&&(n&&t.d(1),i())})),t.o(e)}}function tt(t,e,n){const i=t.$$.props[e];void 0!==i&&(t.$$.bound[i]=n,n(t.$$.ctx[i]))}function et(t){t&&t.c()}function nt(t,n,a,r){const{fragment:o,on_mount:l,on_destroy:c,after_update:u}=t.$$;o&&o.m(n,a),r||R((()=>{const n=l.map(e).filter(s);c?c.push(...n):i(n),t.$$.on_mount=[]})),u.forEach(R)}function it(t,e){const n=t.$$;null!==n.fragment&&(i(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function st(e,s,a,r,o,l,c,u=[-1]){const d=T;M(e);const h=e.$$={fragment:null,ctx:null,props:l,update:t,not_equal:o,bound:n(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(s.context||(d?d.$$.context:[])),callbacks:n(),dirty:u,skip_bound:!1,root:s.target||d.$$.root};c&&c(h.root);let p=!1;if(h.ctx=a?a(e,s.props||{},((t,n,...i)=>{const s=i.length?i[0]:n;return h.ctx&&o(h.ctx[t],h.ctx[t]=s)&&(!h.skip_bound&&h.bound[t]&&h.bound[t](s),p&&function(t,e){-1===t.$$.dirty[0]&&(D.push(t),F(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const rt=[];function ot(e,n=t){let i;const s=new Set;function r(t){if(a(e,t)&&(e=t,i)){const t=!rt.length;for(const t of s)t[1](),rt.push(t,e);if(t){for(let t=0;t{s.delete(l),0===s.size&&(i(),i=null)}}}}function lt(t,e=!1){return(t=t.slice(t.startsWith("/#")?2:0,t.endsWith("/*")?-2:void 0)).startsWith("/")||(t="/"+t),"/"===t&&(t=""),e&&!t.endsWith("/")&&(t+="/"),t}function ct(t,e,n){if(""===n)return t;if("/"===n[0])return n;let i=t=>t.split("/").filter((t=>""!==t)),s=i(t);return"/"+(e?i(e):[]).map(((t,e)=>s[e])).join("/")+"/"+n}function ut(t,e,n,i){let s=[e,"data-"+e].reduce(((e,i)=>{let s=t.getAttribute(i);return n&&t.removeAttribute(i),null===s?e:s}),!1);return!i&&""===s||(s||i||!1)}function dt(t){let e=t.split("&").map((t=>t.split("="))).reduce(((t,e)=>{let n=e[0];if(!n)return t;let i=!(e.length>1)||e[e.length-1];return"string"==typeof i&&i.includes(",")&&(i=i.split(",")),void 0===t[n]?t[n]=[i]:t[n].push(i),t}),{});return Object.entries(e).reduce(((t,e)=>(t[e[0]]=e[1].length>1?e[1]:e[1][0],t)),{})}var ht,pt,ft={HISTORY:1,HASH:2,MEMORY:3,OFF:4,run:function(t,e,n,i){return 1===t?e&&e():2===t?n&&n():i&&i()},getDeafault:function(){return window&&"srcdoc"!==window.location.pathname?1:3}},gt=function(){let t,e=ft.getDeafault(),n=n=>t&&t(mt(e));function i(t){t&&(e=t),window.onhashchange=window.onpopstate=pt=null,e!==ft.OFF&&ft.run(e,(t=>window.onpopstate=n),(t=>window.onhashchange=n))&&n()}return{mode:t=>i(t),get:t=>mt(e),go(t,i){(function(t,e,n){let i=t=>history[n?"replaceState":"pushState"]({},"",t);ft.run(t,(t=>i(e)),(t=>i(`#${e}`)),(t=>pt=e))})(e,t,i),n()},start(e){t=e,i()},stop(){t=null,i(ft.OFF)}}}();function mt(t){let e=ht,n=ht=ft.run(t,(t=>window.location.pathname+window.location.search),(t=>String(window.location.hash.slice(1)||"/")),(t=>pt||"/")),i=n.match(/^([^?#]+)(?:\?([^#]+))?(?:\#(.+))?$/);return{url:n,from:e,path:i[1]||"",query:dt(i[2]||""),hash:i[3]||""}}function vt(t){let e=_("tinro");e&&(e.exact||e.fallback)&&function(t){throw new Error("[Tinro] "+t)}(`${t.fallback?"":``} can't be inside ${e.fallback?"":` with exact path`}`);let n=t.fallback?"fallbacks":"childs",i=ot({}),s={router:{},exact:!1,pattern:null,meta:{},parent:e,fallback:t.fallback,redirect:!1,firstmatch:!1,breadcrumb:null,matched:!1,childs:new Set,activeChilds:new Set,fallbacks:new Set,update(t){s.exact=!t.path.endsWith("/*"),s.pattern=lt(`${s.parent&&s.parent.pattern||""}${t.path}`),s.redirect=t.redirect,s.firstmatch=t.firstmatch,s.breadcrumb=t.breadcrumb,s.match()},register:()=>{if(s.parent)return s.parent[n].add(s),()=>{s.parent[n].delete(s),s.router.un&&s.router.un()}},show:()=>{t.onShow(),!s.fallback&&s.parent&&s.parent.activeChilds.add(s)},hide:()=>{t.onHide(),!s.fallback&&s.parent&&s.parent.activeChilds.delete(s)},match:async()=>{s.matched=!1;let{path:e,url:n,from:a,query:r}=s.router,o=function(t,e){t=lt(t,!0),e=lt(e,!0);let n=[],i={},s=!0,a=t.split("/").map((t=>t.startsWith(":")?(n.push(t.slice(1)),"([^\\/]+)"):t)).join("\\/"),r=e.match(new RegExp(`^${a}$`));return r||(s=!1,r=e.match(new RegExp(`^${a}`))),r?(n.forEach(((t,e)=>i[t]=r[e+1])),{exact:s,params:i,part:r[0].slice(0,-1)}):null}(s.pattern,e);if(!s.fallback&&o&&s.redirect&&(!s.exact||s.exact&&o.exact)){await W();let t=ct(e,s.parent&&s.parent.pattern,s.redirect);return bt.goto(t,!0)}if(s.meta=o&&{from:a,url:n,query:r,match:o.part,pattern:s.pattern,breadcrumbs:s.parent&&s.parent.meta&&s.parent.meta.breadcrumbs.slice()||[],params:o.params,subscribe:i.subscribe},s.breadcrumb&&s.meta&&s.meta.breadcrumbs.push({name:s.breadcrumb,path:o.part}),i.set(s.meta),!o||s.fallback||!(!s.exact||s.exact&&o.exact)||s.parent&&s.parent.firstmatch&&s.parent.matched?s.hide():(t.onMeta(s.meta),s.parent&&(s.parent.matched=!0),s.show()),await W(),o&&!s.fallback&&(s.childs.size>0&&0==s.activeChilds.size||0==s.childs.size&&s.fallbacks.size>0)){let t=s;for(;0==t.fallbacks.size;)if(t=t.parent,!t)return;t&&t.fallbacks.forEach((t=>{if(t.redirect){let e=ct("/",t.parent&&t.parent.pattern,t.redirect);bt.goto(e,!0)}else t.show()}))}}};return a="tinro",r=s,L().$$.context.set(a,r),C((()=>s.register())),s.router.un=bt.subscribe((t=>{s.router.path=t.path,s.router.url=t.url,s.router.query=t.query,s.router.from=t.from,null!==s.pattern&&s.match()})),s;var a,r}function yt(){return _("tinro").meta}var bt=function(){let{subscribe:t}=ot(gt.get(),(t=>{gt.start(t);let e=function(t){let e=e=>{let n=e.target.closest("a[href]"),i=n&&ut(n,"target",!1,"_self"),s=n&&ut(n,"tinro-ignore"),a=e.ctrlKey||e.metaKey||e.altKey||e.shiftKey;if("_self"==i&&!s&&!a&&n){let i=n.getAttribute("href").replace(/^\/#/,"");/^\/\/|^[a-zA-Z]+:/.test(i)||(e.preventDefault(),t(i.startsWith("/")?i:n.href.replace(window.location.origin,"")))}};return addEventListener("click",e),()=>removeEventListener("click",e)}(gt.go);return()=>{gt.stop(),e()}}));return{subscribe:t,goto:gt.go,params:xt,meta:yt,useHashNavigation:t=>gt.mode(t?ft.HASH:ft.HISTORY),mode:{hash:()=>gt.mode(ft.HASH),history:()=>gt.mode(ft.HISTORY),memory:()=>gt.mode(ft.MEMORY)}}}();function xt(){return _("tinro").meta.params}const wt=t=>({params:2&t,meta:4&t}),$t=t=>({params:t[1],meta:t[2]});function kt(t){let e;const n=t[9].default,i=o(n,t,t[8],$t);return{c(){i&&i.c()},m(t,n){i&&i.m(t,n),e=!0},p(t,s){i&&i.p&&(!e||262&s)&&u(i,n,t,t[8],e?c(n,t[8],s,wt):d(t[8]),$t)},i(t){e||(Z(i,t),e=!0)},o(t){Q(i,t),e=!1},d(t){i&&i.d(t)}}}function Ot(t){let e,n,i=t[0]&&kt(t);return{c(){i&&i.c(),e=x()},m(t,s){i&&i.m(t,s),p(t,e,s),n=!0},p(t,[n]){t[0]?i?(i.p(t,n),1&n&&Z(i,1)):(i=kt(t),i.c(),Z(i,1),i.m(e.parentNode,e)):i&&(X(),Q(i,1,1,(()=>{i=null})),K())},i(t){n||(Z(i),n=!0)},o(t){Q(i),n=!1},d(t){i&&i.d(t),t&&f(e)}}}function At(t,e,n){let{$$slots:i={},$$scope:s}=e,{path:a="/*"}=e,{fallback:r=!1}=e,{redirect:o=!1}=e,{firstmatch:l=!1}=e,{breadcrumb:c=null}=e,u=!1,d={},h={};const p=vt({fallback:r,onShow(){n(0,u=!0)},onHide(){n(0,u=!1)},onMeta(t){n(2,h=t),n(1,d=h.params)}});return t.$$set=t=>{"path"in t&&n(3,a=t.path),"fallback"in t&&n(4,r=t.fallback),"redirect"in t&&n(5,o=t.redirect),"firstmatch"in t&&n(6,l=t.firstmatch),"breadcrumb"in t&&n(7,c=t.breadcrumb),"$$scope"in t&&n(8,s=t.$$scope)},t.$$.update=()=>{232&t.$$.dirty&&p.update({path:a,redirect:o,firstmatch:l,breadcrumb:c})},[u,d,h,a,r,o,l,c,s,i]}class Pt extends at{constructor(t){super(),st(this,t,At,Ot,a,{path:3,fallback:4,redirect:5,firstmatch:6,breadcrumb:7})}}function St(t){let e,n;return{c(){e=m("h1"),n=y(t[0]),$(e,"class","alm-hdr")},m(t,i){p(t,e,i),h(e,n)},p(t,e){1&e&&O(n,t[0])},d(t){t&&f(e)}}}function Tt(t){let e,n,i,s=t[0]&&St(t);const a=t[2].default,r=o(a,t,t[1],null);return{c(){e=m("div"),s&&s.c(),n=b(),r&&r.c(),$(e,"class","alm")},m(t,a){p(t,e,a),s&&s.m(e,null),h(e,n),r&&r.m(e,null),i=!0},p(t,[o]){t[0]?s?s.p(t,o):(s=St(t),s.c(),s.m(e,n)):s&&(s.d(1),s=null),r&&r.p&&(!i||2&o)&&u(r,a,t,t[1],i?c(a,t[1],o,null):d(t[1]),null)},i(t){i||(Z(r,t),i=!0)},o(t){Q(r,t),i=!1},d(t){t&&f(e),s&&s.d(),r&&r.d(t)}}}function Mt(t,e,n){let{$$slots:i={},$$scope:s}=e,{title:a}=e;return t.$$set=t=>{"title"in t&&n(0,a=t.title),"$$scope"in t&&n(1,s=t.$$scope)},[a,s,i]}class Lt extends at{constructor(t){super(),st(this,t,Mt,Tt,a,{title:0})}}function Ct(t){let e,n,i,s,a,r,o,l,c,u,d,g,v,x,k,A,P,S,T,M,L,C,_;return{c(){e=m("div"),n=m("div"),i=m("div"),s=b(),a=m("span"),a.textContent="",r=b(),o=m("div"),l=m("div"),c=m("div"),u=m("div"),d=m("h3"),g=y(t[1]),v=b(),x=m("div"),k=m("p"),A=y(t[2]),P=b(),S=m("div"),T=m("button"),T.textContent="Deactivate",M=b(),L=m("button"),L.textContent="Cancel",$(i,"class","fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"),$(i,"aria-hidden","true"),$(a,"class","hidden sm:inline-block sm:align-middle sm:h-screen"),$(a,"aria-hidden","true"),$(d,"class","text-lg leading-6 font-medium text-gray-900"),$(d,"id","modal-title"),$(k,"class","text-sm text-gray-500"),$(x,"class","mt-2"),$(u,"class","mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left"),$(c,"class","sm:flex sm:items-start"),$(l,"class","bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4"),$(T,"type","button"),$(T,"class","w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"),$(L,"type","button"),$(L,"class","mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"),$(S,"class","bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse"),$(o,"class","inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full"),$(n,"class","flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0"),$(e,"class","fixed z-10 inset-0 overflow-y-auto"),$(e,"aria-labelledby","modal-title"),$(e,"role","dialog"),$(e,"aria-modal","true")},m(f,m){p(f,e,m),h(e,n),h(n,i),h(n,s),h(n,a),h(n,r),h(n,o),h(o,l),h(l,c),h(c,u),h(u,d),h(d,g),h(u,v),h(u,x),h(x,k),h(k,A),h(o,P),h(o,S),h(S,T),h(S,M),h(S,L),C||(_=w(L,"click",t[3]),C=!0)},p(t,e){2&e&&O(g,t[1]),4&e&&O(A,t[2])},d(t){t&&f(e),C=!1,_()}}}function _t(e){let n,i=e[0]&&Ct(e);return{c(){n=m("div"),i&&i.c(),$(n,"class","modal")},m(t,e){p(t,n,e),i&&i.m(n,null)},p(t,[e]){t[0]?i?i.p(t,e):(i=Ct(t),i.c(),i.m(n,null)):i&&(i.d(1),i=null)},i:t,o:t,d(t){t&&f(n),i&&i.d()}}}function Nt(t,e,n){let{show:i}=e,{header:s="header"}=e,{text:a="text"}=e;return t.$$set=t=>{"show"in t&&n(0,i=t.show),"header"in t&&n(1,s=t.header),"text"in t&&n(2,a=t.text)},[i,s,a,()=>n(0,i=!1)]}class Dt extends at{constructor(t){super(),st(this,t,Nt,_t,a,{show:0,header:1,text:2})}}function Et(t){let e,n;return{c(){e=m("h1"),n=y(t[0]),$(e,"class","crd-hdr")},m(t,i){p(t,e,i),h(e,n)},p(t,e){1&e&&O(n,t[0])},d(t){t&&f(e)}}}function zt(t){let e,n,i,s=t[0]&&Et(t);const a=t[2].default,r=o(a,t,t[1],null);return{c(){e=m("div"),s&&s.c(),n=b(),r&&r.c(),$(e,"class","crd")},m(t,a){p(t,e,a),s&&s.m(e,null),h(e,n),r&&r.m(e,null),i=!0},p(t,[o]){t[0]?s?s.p(t,o):(s=Et(t),s.c(),s.m(e,n)):s&&(s.d(1),s=null),r&&r.p&&(!i||2&o)&&u(r,a,t,t[1],i?c(a,t[1],o,null):d(t[1]),null)},i(t){i||(Z(r,t),i=!0)},o(t){Q(r,t),i=!1},d(t){t&&f(e),s&&s.d(),r&&r.d(t)}}}function Ht(t,e,n){let{$$slots:i={},$$scope:s}=e,{title:a}=e;return t.$$set=t=>{"title"in t&&n(0,a=t.title),"$$scope"in t&&n(1,s=t.$$scope)},[a,s,i]}class jt extends at{constructor(t){super(),st(this,t,Ht,zt,a,{title:0})}}function Jt(t){let e,n,s,a;return{c(){e=m("input"),$(e,"class",n=1==t[0].send?"ipt-rnd text-right border-red-500":"ipt-rnd text-right focus:border-indigo-500"),$(e,"step","0.1"),$(e,"type","number")},m(n,i){p(n,e,i),A(e,t[0].status),s||(a=[w(e,"change",t[3]),w(e,"input",t[4])],s=!0)},p(t,i){1&i&&n!==(n=1==t[0].send?"ipt-rnd text-right border-red-500":"ipt-rnd text-right focus:border-indigo-500")&&$(e,"class",n),1&i&&k(e.value)!==t[0].status&&A(e,t[0].status)},d(t){t&&f(e),s=!1,i(a)}}}function Ft(t){let e,n,s,a;return{c(){e=m("input"),$(e,"class",n=1==t[0].send?"ipt-rnd text-right border-red-500":"ipt-rnd text-right focus:border-indigo-500"),$(e,"type","text")},m(n,i){p(n,e,i),A(e,t[0].status),s||(a=[w(e,"change",t[5]),w(e,"input",t[6])],s=!0)},p(t,i){1&i&&n!==(n=1==t[0].send?"ipt-rnd text-right border-red-500":"ipt-rnd text-right focus:border-indigo-500")&&$(e,"class",n),1&i&&e.value!==t[0].status&&A(e,t[0].status)},d(t){t&&f(e),s=!1,i(a)}}}function Wt(t){let e,n,s,a;return{c(){e=m("input"),$(e,"class",n=1==t[0].send?"ipt-rnd text-right border-red-500":"ipt-rnd text-right focus:border-indigo-500"),$(e,"type","date")},m(n,i){p(n,e,i),A(e,t[0].status),s||(a=[w(e,"change",t[7]),w(e,"input",t[8])],s=!0)},p(t,i){1&i&&n!==(n=1==t[0].send?"ipt-rnd text-right border-red-500":"ipt-rnd text-right focus:border-indigo-500")&&$(e,"class",n),1&i&&A(e,t[0].status)},d(t){t&&f(e),s=!1,i(a)}}}function Rt(t){let e,n,s,a;return{c(){e=m("input"),$(e,"class",n=1==t[0].send?"ipt-rnd text-right border-red-500":"ipt-rnd text-right focus:border-indigo-500"),$(e,"type","time")},m(n,i){p(n,e,i),A(e,t[0].status),s||(a=[w(e,"change",t[9]),w(e,"input",t[10])],s=!0)},p(t,i){1&i&&n!==(n=1==t[0].send?"ipt-rnd text-right border-red-500":"ipt-rnd text-right focus:border-indigo-500")&&$(e,"class",n),1&i&&A(e,t[0].status)},d(t){t&&f(e),s=!1,i(a)}}}function It(e){let n,i,s,a,r,o,l,c,u,d=(e[0].descr?e[0].descr:"")+"",g="number"==e[0].type&&Jt(e),v="text"==e[0].type&&Ft(e),x="date"==e[0].type&&Wt(e),w="time"==e[0].type&&Rt(e);return{c(){n=m("div"),i=m("div"),s=m("label"),a=y(d),r=b(),o=m("div"),g&&g.c(),l=b(),v&&v.c(),c=b(),x&&x.c(),u=b(),w&&w.c(),$(s,"class","wgt-dscr-stl"),$(i,"class","wgt-dscr-w"),$(o,"class","wgt-w"),$(n,"class","crd-itm-psn")},m(t,e){p(t,n,e),h(n,i),h(i,s),h(s,a),h(n,r),h(n,o),g&&g.m(o,null),h(o,l),v&&v.m(o,null),h(o,c),x&&x.m(o,null),h(o,u),w&&w.m(o,null)},p(t,[e]){1&e&&d!==(d=(t[0].descr?t[0].descr:"")+"")&&O(a,d),"number"==t[0].type?g?g.p(t,e):(g=Jt(t),g.c(),g.m(o,l)):g&&(g.d(1),g=null),"text"==t[0].type?v?v.p(t,e):(v=Ft(t),v.c(),v.m(o,c)):v&&(v.d(1),v=null),"date"==t[0].type?x?x.p(t,e):(x=Wt(t),x.c(),x.m(o,u)):x&&(x.d(1),x=null),"time"==t[0].type?w?w.p(t,e):(w=Rt(t),w.c(),w.m(o,null)):w&&(w.d(1),w=null)},i:t,o:t,d(t){t&&f(n),g&&g.d(),v&&v.d(),x&&x.d(),w&&w.d()}}}function Bt(t,e,n){let{widget:i}=e,{wsPush:s=((t,e,n)=>{})}=e,{value:a}=e;a=a;return t.$$set=t=>{"widget"in t&&n(0,i=t.widget),"wsPush"in t&&n(1,s=t.wsPush),"value"in t&&n(2,a=t.value)},[i,s,a,()=>(n(0,i.send=!0,i),s(i.ws,i.topic,i.status)),function(){i.status=k(this.value),n(0,i)},()=>(n(0,i.send=!0,i),s(i.ws,i.topic,i.status)),function(){i.status=this.value,n(0,i)},()=>(n(0,i.send=!0,i),s(i.ws,i.topic,i.status)),function(){i.status=this.value,n(0,i)},()=>(n(0,i.send=!0,i),s(i.ws,i.topic,i.status)),function(){i.status=this.value,n(0,i)}]}class Yt extends at{constructor(t){super(),st(this,t,Bt,It,a,{widget:0,wsPush:1,value:2})}}function qt(e){let n,s,a,r,o,l,c,u,d,g,v,x,k,P,S,T,M,L,C=(e[0].descr?e[0].descr:"")+"";return{c(){n=m("div"),s=m("div"),a=m("label"),r=y(C),o=b(),l=m("div"),c=m("label"),u=m("div"),d=m("input"),v=b(),x=m("div"),k=b(),P=m("div"),$(a,"class","wgt-dscr-stl"),$(s,"class","wgt-dscr-w"),$(d,"id",g=e[0].topic),$(d,"type","checkbox"),$(d,"class","sr-only"),$(x,"class","block bg-gray-600 w-10 h-6 rounded-full"),$(P,"class",S="dot "+(1==e[0].send?"bg-red-400":"bg-white")+" absolute left-1 top-1 w-4 h-4 rounded-full transition"),$(u,"class","relative"),$(c,"for",T=e[0].topic),$(c,"class","items-center cursor-pointer"),$(l,"class","wgt-w"),$(n,"class","crd-itm-psn")},m(t,i){p(t,n,i),h(n,s),h(s,a),h(a,r),h(n,o),h(n,l),h(l,c),h(c,u),h(u,d),A(d,e[0].status),h(u,v),h(u,x),h(u,k),h(u,P),M||(L=[w(d,"change",e[3]),w(d,"change",e[4])],M=!0)},p(t,[e]){1&e&&C!==(C=(t[0].descr?t[0].descr:"")+"")&&O(r,C),1&e&&g!==(g=t[0].topic)&&$(d,"id",g),1&e&&A(d,t[0].status),1&e&&S!==(S="dot "+(1==t[0].send?"bg-red-400":"bg-white")+" absolute left-1 top-1 w-4 h-4 rounded-full transition")&&$(P,"class",S),1&e&&T!==(T=t[0].topic)&&$(c,"for",T)},i:t,o:t,d(t){t&&f(n),M=!1,i(L)}}}function Ut(t,e,n){let{widget:i}=e,{value:s}=e;s=s;let{wsPush:a=((t,e,n)=>{})}=e;return t.$$set=t=>{"widget"in t&&n(0,i=t.widget),"value"in t&&n(2,s=t.value),"wsPush"in t&&n(1,a=t.wsPush)},[i,a,s,()=>(n(0,i.send=!0,i),a(i.ws,i.topic,i.status)),function(){i.status=this.value,n(0,i)}]}class Vt extends at{constructor(t){super(),st(this,t,Ut,qt,a,{widget:0,value:2,wsPush:1})}}function Gt(e){let n,i,s,a,r,o,l,c,u,d,g,v,x=(e[0].descr?e[0].descr:"")+"",w=(e[0].status?e[0].status:"")+"",k=(e[0].after?e[0].after:"")+"";return{c(){n=m("div"),i=m("div"),s=m("label"),a=y(x),r=b(),o=m("div"),l=m("label"),c=y(w),u=b(),d=m("label"),g=y(" "),v=y(k),$(s,"class","wgt-dscr-stl"),$(i,"class","wgt-dscr-w"),$(l,"class","wgt-adt-stl"),$(d,"class","wgt-adt-stl"),$(o,"class","wgt-w"),$(n,"class","crd-itm-psn")},m(t,e){p(t,n,e),h(n,i),h(i,s),h(s,a),h(n,r),h(n,o),h(o,l),h(l,c),h(o,u),h(o,d),h(d,g),h(d,v)},p(t,[e]){1&e&&x!==(x=(t[0].descr?t[0].descr:"")+"")&&O(a,x),1&e&&w!==(w=(t[0].status?t[0].status:"")+"")&&O(c,w),1&e&&k!==(k=(t[0].after?t[0].after:"")+"")&&O(v,k)},i:t,o:t,d(t){t&&f(n)}}}function Xt(t,e,n){let{widget:i}=e,{value:s}=e;return s=s,t.$$set=t=>{"widget"in t&&n(0,i=t.widget),"value"in t&&n(1,s=t.value)},[i,s]}class Kt extends at{constructor(t){super(),st(this,t,Xt,Gt,a,{widget:0,value:1})}}function Zt(t,e,n){const i=t.slice();return i[8]=e[n],i[10]=n,i}function Qt(t,e,n){const i=t.slice();return i[11]=e[n],i[12]=e,i[10]=n,i}function te(t){let e,n;return e=new jt({props:{title:"Ваша панель управления пуста, вначале добавьте новые элементы в конфигураторе!"}}),{c(){et(e.$$.fragment)},m(t,i){nt(e,t,i),n=!0},i(t){n||(Z(e.$$.fragment,t),n=!0)},o(t){Q(e.$$.fragment,t),n=!1},d(t){it(e,t)}}}function ee(t){let e,n,i,s,a="input"===t[11].widget&&ne(t),r="toggle"===t[11].widget&&ie(t),o="anydata"===t[11].widget&&se(t);return{c(){a&&a.c(),e=b(),r&&r.c(),n=b(),o&&o.c(),i=x()},m(t,l){a&&a.m(t,l),p(t,e,l),r&&r.m(t,l),p(t,n,l),o&&o.m(t,l),p(t,i,l),s=!0},p(t,s){"input"===t[11].widget?a?(a.p(t,s),1&s&&Z(a,1)):(a=ne(t),a.c(),Z(a,1),a.m(e.parentNode,e)):a&&(X(),Q(a,1,1,(()=>{a=null})),K()),"toggle"===t[11].widget?r?(r.p(t,s),1&s&&Z(r,1)):(r=ie(t),r.c(),Z(r,1),r.m(n.parentNode,n)):r&&(X(),Q(r,1,1,(()=>{r=null})),K()),"anydata"===t[11].widget?o?(o.p(t,s),1&s&&Z(o,1)):(o=se(t),o.c(),Z(o,1),o.m(i.parentNode,i)):o&&(X(),Q(o,1,1,(()=>{o=null})),K())},i(t){s||(Z(a),Z(r),Z(o),s=!0)},o(t){Q(a),Q(r),Q(o),s=!1},d(t){a&&a.d(t),t&&f(e),r&&r.d(t),t&&f(n),o&&o.d(t),t&&f(i)}}}function ne(t){let e,n,i;function s(e){t[4](e,t[11])}let a={widget:t[11],wsPush:t[3]};return void 0!==t[11].status&&(a.value=t[11].status),e=new Yt({props:a}),E.push((()=>tt(e,"value",s))),{c(){et(e.$$.fragment)},m(t,n){nt(e,t,n),i=!0},p(i,s){t=i;const a={};1&s&&(a.widget=t[11]),4&s&&(a.wsPush=t[3]),!n&&1&s&&(n=!0,a.value=t[11].status,I((()=>n=!1))),e.$set(a)},i(t){i||(Z(e.$$.fragment,t),i=!0)},o(t){Q(e.$$.fragment,t),i=!1},d(t){it(e,t)}}}function ie(t){let e,n,i;function s(e){t[6](e,t[11])}let a={widget:t[11],wsPush:t[5]};return void 0!==t[11].status&&(a.value=t[11].status),e=new Vt({props:a}),E.push((()=>tt(e,"value",s))),{c(){et(e.$$.fragment)},m(t,n){nt(e,t,n),i=!0},p(i,s){t=i;const a={};1&s&&(a.widget=t[11]),4&s&&(a.wsPush=t[5]),!n&&1&s&&(n=!0,a.value=t[11].status,I((()=>n=!1))),e.$set(a)},i(t){i||(Z(e.$$.fragment,t),i=!0)},o(t){Q(e.$$.fragment,t),i=!1},d(t){it(e,t)}}}function se(t){let e,n,i;function s(e){t[7](e,t[11])}let a={widget:t[11]};return void 0!==t[11].status&&(a.value=t[11].status),e=new Kt({props:a}),E.push((()=>tt(e,"value",s))),{c(){et(e.$$.fragment)},m(t,n){nt(e,t,n),i=!0},p(i,s){t=i;const a={};1&s&&(a.widget=t[11]),!n&&1&s&&(n=!0,a.value=t[11].status,I((()=>n=!1))),e.$set(a)},i(t){i||(Z(e.$$.fragment,t),i=!0)},o(t){Q(e.$$.fragment,t),i=!1},d(t){it(e,t)}}}function ae(t){let e,n,i=t[11].page===t[8].page&&ee(t);return{c(){i&&i.c(),e=x()},m(t,s){i&&i.m(t,s),p(t,e,s),n=!0},p(t,n){t[11].page===t[8].page?i?(i.p(t,n),3&n&&Z(i,1)):(i=ee(t),i.c(),Z(i,1),i.m(e.parentNode,e)):i&&(X(),Q(i,1,1,(()=>{i=null})),K())},i(t){n||(Z(i),n=!0)},o(t){Q(i),n=!1},d(t){i&&i.d(t),t&&f(e)}}}function re(t){let e,n,i=t[0],s=[];for(let e=0;eQ(s[t],1,1,(()=>{s[t]=null}));return{c(){for(let t=0;tQ(r[t],1,1,(()=>{r[t]=null}));return{c(){e=m("div"),s&&s.c(),n=b();for(let t=0;t{s=null})),K()),7&i){let n;for(a=t[1],n=0;n{})}=e;return t.$$set=t=>{"layoutJson"in t&&n(0,i=t.layoutJson),"pages"in t&&n(1,s=t.pages),"wsPush"in t&&n(2,a=t.wsPush)},[i,s,a,(t,e,n)=>a(t,e,n),function(e,s){t.$$.not_equal(s.status,e)&&(s.status=e,n(0,i))},(t,e,n)=>a(t,e,n),function(e,s){t.$$.not_equal(s.status,e)&&(s.status=e,n(0,i))},function(e,s){t.$$.not_equal(s.status,e)&&(s.status=e,n(0,i))}]}class ue extends at{constructor(t){super(),st(this,t,ce,le,a,{layoutJson:0,pages:1,wsPush:2})}}function de(e){let n,i,a,r,o;return{c(){n=v("svg"),i=v("line"),a=v("line"),$(i,"x1","18"),$(i,"y1","6"),$(i,"x2","6"),$(i,"y2","18"),$(a,"x1","6"),$(a,"y1","6"),$(a,"x2","18"),$(a,"y2","18"),$(n,"class","h-6 w-6 text-red-400 cursor-pointer"),$(n,"viewBox","0 0 24 24"),$(n,"fill","none"),$(n,"stroke","currentColor"),$(n,"stroke-width","2"),$(n,"stroke-linecap","round"),$(n,"stroke-linejoin","round")},m(t,l){p(t,n,l),h(n,i),h(n,a),r||(o=w(n,"click",(function(){s(e[1](e[0]))&&e[1](e[0]).apply(this,arguments)})),r=!0)},p(t,[n]){e=t},i:t,o:t,d(t){t&&f(n),r=!1,o()}}}function he(t,e,n){let{i:i}=e,{click:s=(t=>{})}=e;return t.$$set=t=>{"i"in t&&n(0,i=t.i),"click"in t&&n(1,s=t.click)},[i,s]}class pe extends at{constructor(t){super(),st(this,t,he,de,a,{i:0,click:1})}}function fe(e){let n,i,a,r,o,l,c;return{c(){n=v("svg"),i=v("path"),a=v("circle"),r=v("circle"),o=v("circle"),$(i,"stroke","none"),$(i,"d","M0 0h24v24H0z"),$(a,"cx","5"),$(a,"cy","12"),$(a,"r","1"),$(r,"cx","12"),$(r,"cy","12"),$(r,"r","1"),$(o,"cx","19"),$(o,"cy","12"),$(o,"r","1"),$(n,"class","h-6 w-6 text-green-400 cursor-pointer"),$(n,"width","24"),$(n,"height","24"),$(n,"viewBox","0 0 24 24"),$(n,"stroke-width","2"),$(n,"stroke","currentColor"),$(n,"fill","none"),$(n,"stroke-linecap","round"),$(n,"stroke-linejoin","round")},m(t,u){p(t,n,u),h(n,i),h(n,a),h(n,r),h(n,o),l||(c=w(n,"click",(function(){s(e[0]())&&e[0]().apply(this,arguments)})),l=!0)},p(t,[n]){e=t},i:t,o:t,d(t){t&&f(n),l=!1,c()}}}function ge(t,e,n){let{click:i=(()=>{})}=e;return t.$$set=t=>{"click"in t&&n(0,i=t.click)},[i]}class me extends at{constructor(t){super(),st(this,t,ge,fe,a,{click:0})}}function ve(t,e,n){const i=t.slice();return i[18]=e[n],i[19]=e,i[20]=n,i}function ye(t,e,n){const i=t.slice();return i[21]=e[n][0],i[22]=e[n][1],i[23]=e,i[24]=n,i}function be(t,e,n){const i=t.slice();return i[25]=e[n],i}function xe(t,e,n){const i=t.slice();return i[28]=e[n],i}function we(t){let e,n;return{c(){e=m("optgroup"),$(e,"label",n=t[28].header)},m(t,n){p(t,e,n)},p(t,i){4&i[0]&&n!==(n=t[28].header)&&$(e,"label",n)},d(t){t&&f(e)}}}function $e(t){let e,n,i,s,a=t[28].name+"";return{c(){e=m("option"),n=y(a),i=b(),e.__value=s=t[28].num,e.value=e.__value},m(t,s){p(t,e,s),h(e,n),h(e,i)},p(t,i){4&i[0]&&a!==(a=t[28].name+"")&&O(n,a),4&i[0]&&s!==(s=t[28].num)&&(e.__value=s,e.value=e.__value)},d(t){t&&f(e)}}}function ke(t){let e,n,i=t[28].header&&we(t),s=!t[28].header&&$e(t);return{c(){i&&i.c(),e=x(),s&&s.c(),n=x()},m(t,a){i&&i.m(t,a),p(t,e,a),s&&s.m(t,a),p(t,n,a)},p(t,a){t[28].header?i?i.p(t,a):(i=we(t),i.c(),i.m(e.parentNode,e)):i&&(i.d(1),i=null),t[28].header?s&&(s.d(1),s=null):s?s.p(t,a):(s=$e(t),s.c(),s.m(n.parentNode,n))},d(t){i&&i.d(t),t&&f(e),s&&s.d(t),t&&f(n)}}}function Oe(t){let e,n,i,s,a=t[25].label+"";return{c(){e=m("option"),n=y(a),i=b(),e.__value=s=t[25].name,e.value=e.__value},m(t,s){p(t,e,s),h(e,n),h(e,i)},p(t,i){2&i[0]&&a!==(a=t[25].label+"")&&O(n,a),2&i[0]&&s!==(s=t[25].name)&&(e.__value=s,e.value=e.__value)},d(t){t&&f(e)}}}function Ae(t){let e,n=Object.entries(t[18]),i=[];for(let e=0;eQ(M[t],1,1,(()=>{M[t]=null}));return{c(){e=m("div"),n=m("select");for(let t=0;t| Тип | \n Id | \n Виджет | \n Вкладка | \n Название | \n | \n | ',u=b(),d=m("tbody");for(let t=0;tt[8].call(n))),r.__value="Выберите пресет",r.value=r.__value,$(a,"class","slct-lg"),$(e,"class","grd-2col2"),$(c,"class","bg-gray-100"),$(d,"class","bg-white"),$(l,"class","tbl"),$(y,"class","btn-lg")},m(i,f){p(i,e,f),h(e,n);for(let t=0;t{})}=e,l=!0;function c(){for(let t=0;t{"configJson"in t&&n(0,i=t.configJson),"widgetsJson"in t&&n(1,s=t.widgetsJson),"itemsJson"in t&&n(2,a=t.itemsJson),"saveConfig"in t&&n(3,o=t.saveConfig)},[i,s,a,o,r,l,c,u,function(){r=S(this),n(4,r),n(2,a)},()=>c(),function(t,e){t[e].id=this.value,n(0,i),n(1,s)},function(t,e){t[e].widget=S(this),n(0,i),n(1,s)},function(t,e){t[e].page=this.value,n(0,i),n(1,s)},function(t,e){t[e].descr=this.value,n(0,i),n(1,s)},()=>n(5,l=!l),t=>u(t),function(t,e,a){e[a][t]=this.value,n(0,i),n(1,s)},()=>o()]}class _e extends at{constructor(t){super(),st(this,t,Ce,Le,a,{configJson:0,widgetsJson:1,itemsJson:2,saveConfig:3},null,[-1,-1])}}function Ne(t,e,n){const i=t.slice();return i[17]=e[n][0],i[18]=e[n][1],i}function De(t){let e,n,i,s,a=t[18]+"";return{c(){e=m("option"),n=y(a),i=b(),e.__value=s=t[18],e.value=e.__value},m(t,s){p(t,e,s),h(e,n),h(e,i)},p(t,i){2&i&&a!==(a=t[18]+"")&&O(n,a),2&i&&s!==(s=t[18])&&(e.__value=s,e.value=e.__value)},d(t){t&&f(e)}}}function Ee(t){let e,n,i;return n=new Lt({props:{title:"Введен неправильный пароль"}}),{c(){e=m("div"),et(n.$$.fragment),$(e,"class","grd-1col1")},m(t,s){p(t,e,s),nt(n,e,null),i=!0},i(t){i||(Z(n.$$.fragment,t),i=!0)},o(t){Q(n.$$.fragment,t),i=!1},d(t){t&&f(e),it(n)}}}function ze(t){let e,n,s,a,r,o,l,c,u,d,v,y,x,k,O,S,T,M,L,C,_,N,D,E,z,H,j,J,F,W,I,B,Y,q,U,V=Object.entries(t[1]),G=[];for(let e=0;eНазвание устройства
',s=b(),a=m("div"),r=m("input"),o=b(),l=m("div"),c=m("div"),c.innerHTML='Точка доступа
',u=b(),d=m("div"),v=m("input"),y=b(),x=m("div"),k=m("div"),k.innerHTML='Пароль точки доступа
',O=b(),S=m("div"),T=m("input"),M=b(),L=m("div"),C=m("div"),C.innerHTML='Название wifi сети
',_=b(),N=m("div"),D=m("select");for(let t=0;tПароль',j=b(),J=m("div"),F=m("input"),W=b(),tt&&tt.c(),I=b(),B=m("button"),B.textContent="Сохранить и перезагрузить",$(n,"class","wgt-dscr-w"),$(r,"class","ipt-rnd text-left focus:border-indigo-500"),$(r,"type","text"),$(a,"class","wgt-w"),$(e,"class","crd-itm-psn"),$(c,"class","wgt-dscr-w"),$(v,"class","ipt-rnd text-left focus:border-indigo-500"),$(v,"type","text"),$(d,"class","wgt-w"),$(l,"class","crd-itm-psn"),$(k,"class","wgt-dscr-w"),$(T,"class","ipt-rnd text-left focus:border-indigo-500"),$(T,"type","text"),$(S,"class","wgt-w"),$(x,"class","crd-itm-psn"),$(C,"class","wgt-dscr-w"),$(D,"class","ipt-rnd text-left focus:border-indigo-500"),void 0===t[0].routerssid&&R((()=>t[7].call(D))),$(N,"class","wgt-w"),$(L,"class","crd-itm-psn"),$(H,"class","wgt-dscr-w"),$(F,"class","ipt-rnd text-left focus:border-indigo-500"),$(F,"type","text"),$(J,"class","wgt-w"),$(z,"class","crd-itm-psn"),$(B,"class","btn-lg")},m(i,f){p(i,e,f),h(e,n),h(e,s),h(e,a),h(a,r),A(r,t[0].name),p(i,o,f),p(i,l,f),h(l,c),h(l,u),h(l,d),h(d,v),A(v,t[0].apssid),p(i,y,f),p(i,x,f),h(x,k),h(x,O),h(x,S),h(S,T),A(T,t[0].appass),p(i,M,f),p(i,L,f),h(L,C),h(L,_),h(L,N),h(N,D);for(let t=0;t{tt=null})),K())},i(t){Y||(Z(tt),Y=!0)},o(t){Q(tt),Y=!1},d(t){t&&f(e),t&&f(o),t&&f(l),t&&f(y),t&&f(x),t&&f(M),t&&f(L),g(G,t),t&&f(E),t&&f(z),t&&f(W),tt&&tt.d(t),t&&f(I),t&&f(B),q=!1,i(U)}}}function He(t){let e,n,s,a,r,o,l,c,u,d,g,v,y,x,k,O,P,S,T,M,L,C,_,N,D,E,z,H,j,J,F,W,R;return{c(){e=m("div"),n=m("div"),n.innerHTML='Название сервера
',s=b(),a=m("div"),r=m("input"),o=b(),l=m("div"),c=m("div"),c.innerHTML='Порт
',u=b(),d=m("div"),g=m("input"),v=b(),y=m("div"),x=m("div"),x.innerHTML='Префикс
',k=b(),O=m("div"),P=m("input"),S=b(),T=m("div"),M=m("div"),M.innerHTML='Имя пользователя
',L=b(),C=m("div"),_=m("input"),N=b(),D=m("div"),E=m("div"),E.innerHTML='Пароль
',z=b(),H=m("div"),j=m("input"),J=b(),F=m("button"),F.textContent="Сохранить и проверить подключение",$(n,"class","wgt-dscr-w"),$(r,"class","ipt-rnd text-left focus:border-indigo-500"),$(r,"type","text"),$(a,"class","wgt-w"),$(e,"class","crd-itm-psn"),$(c,"class","wgt-dscr-w"),$(g,"class","ipt-rnd text-left focus:border-indigo-500"),$(g,"type","text"),$(d,"class","wgt-w"),$(l,"class","crd-itm-psn"),$(x,"class","wgt-dscr-w"),$(P,"class","ipt-rnd text-left focus:border-indigo-500"),$(P,"type","text"),$(O,"class","wgt-w"),$(y,"class","crd-itm-psn"),$(M,"class","wgt-dscr-w"),$(_,"class","ipt-rnd text-left focus:border-indigo-500"),$(_,"type","text"),$(C,"class","wgt-w"),$(T,"class","crd-itm-psn"),$(E,"class","wgt-dscr-w"),$(j,"class","ipt-rnd text-left focus:border-indigo-500"),$(j,"type","text"),$(H,"class","wgt-w"),$(D,"class","crd-itm-psn"),$(F,"class","btn-lg")},m(i,f){p(i,e,f),h(e,n),h(e,s),h(e,a),h(a,r),A(r,t[0].mqttServer),p(i,o,f),p(i,l,f),h(l,c),h(l,u),h(l,d),h(d,g),A(g,t[0].mqttPort),p(i,v,f),p(i,y,f),h(y,x),h(y,k),h(y,O),h(O,P),A(P,t[0].mqttPrefix),p(i,S,f),p(i,T,f),h(T,M),h(T,L),h(T,C),h(C,_),A(_,t[0].mqttUser),p(i,N,f),p(i,D,f),h(D,E),h(D,z),h(D,H),h(H,j),A(j,t[0].mqttPass),p(i,J,f),p(i,F,f),W||(R=[w(r,"input",t[11]),w(g,"input",t[12]),w(P,"input",t[13]),w(_,"input",t[14]),w(j,"input",t[15]),w(F,"click",t[16])],W=!0)},p(t,e){3&e&&r.value!==t[0].mqttServer&&A(r,t[0].mqttServer),3&e&&g.value!==t[0].mqttPort&&A(g,t[0].mqttPort),3&e&&P.value!==t[0].mqttPrefix&&A(P,t[0].mqttPrefix),3&e&&_.value!==t[0].mqttUser&&A(_,t[0].mqttUser),3&e&&j.value!==t[0].mqttPass&&A(j,t[0].mqttPass)},d(t){t&&f(e),t&&f(o),t&&f(l),t&&f(v),t&&f(y),t&&f(S),t&&f(T),t&&f(N),t&&f(D),t&&f(J),t&&f(F),W=!1,i(R)}}}function je(t){let e,n,i,s,a;return n=new jt({props:{title:"Подключение к WiFi роутеру",$$slots:{default:[ze]},$$scope:{ctx:t}}}),s=new jt({props:{title:"Подключение к MQTT брокеру",$$slots:{default:[He]},$$scope:{ctx:t}}}),{c(){e=m("div"),et(n.$$.fragment),i=b(),et(s.$$.fragment),$(e,"class","grd-2col1")},m(t,r){p(t,e,r),nt(n,e,null),h(e,i),nt(s,e,null),a=!0},p(t,[e]){const i={};2097167&e&&(i.$$scope={dirty:e,ctx:t}),n.$set(i);const a={};2097161&e&&(a.$$scope={dirty:e,ctx:t}),s.$set(a)},i(t){a||(Z(n.$$.fragment,t),Z(s.$$.fragment,t),a=!0)},o(t){Q(n.$$.fragment,t),Q(s.$$.fragment,t),a=!1},d(t){t&&f(e),it(n),it(s)}}}function Je(t,e,n){let{settingsJson:i}=e,{ssidJson:s}=e,{ssidDropdownClick:a=(()=>{})}=e,{saveSettings:r=(()=>{})}=e;return t.$$set=t=>{"settingsJson"in t&&n(0,i=t.settingsJson),"ssidJson"in t&&n(1,s=t.ssidJson),"ssidDropdownClick"in t&&n(2,a=t.ssidDropdownClick),"saveSettings"in t&&n(3,r=t.saveSettings)},[i,s,a,r,function(){i.name=this.value,n(0,i),n(1,s)},function(){i.apssid=this.value,n(0,i),n(1,s)},function(){i.appass=this.value,n(0,i),n(1,s)},function(){i.routerssid=S(this),n(0,i),n(1,s)},()=>a(),function(){i.routerpass=this.value,n(0,i),n(1,s)},()=>r(),function(){i.mqttServer=this.value,n(0,i),n(1,s)},function(){i.mqttPort=this.value,n(0,i),n(1,s)},function(){i.mqttPrefix=this.value,n(0,i),n(1,s)},function(){i.mqttUser=this.value,n(0,i),n(1,s)},function(){i.mqttPass=this.value,n(0,i),n(1,s)},()=>r()]}class Fe extends at{constructor(t){super(),st(this,t,Je,je,a,{settingsJson:0,ssidJson:1,ssidDropdownClick:2,saveSettings:3})}}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var We,Re=(function(t,e){t.exports=function(){function t(t,e){return"string"==typeof t?(e||document).querySelector(t):t||null}function e(t){var e=t.getBoundingClientRect();return{top:e.top+(document.documentElement.scrollTop||document.body.scrollTop),left:e.left+(document.documentElement.scrollLeft||document.body.scrollLeft)}}function n(t){return null===t.offsetParent}function i(t){var e=t.getBoundingClientRect();return e.top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth)}function s(t){var e=window.getComputedStyle(t),n=parseFloat(e.paddingLeft)+parseFloat(e.paddingRight);return t.clientWidth-n}function a(t,e,n){var i=document.createEvent("HTMLEvents");for(var s in i.initEvent(e,!0,!0),n)i[s]=n[s];return t.dispatchEvent(i)}function r(t){return t.titleHeight+t.margins.top+t.paddings.top}function o(t){return t.margins.left+t.paddings.left}function l(t){return t.margins.top+t.margins.bottom+t.paddings.top+t.paddings.bottom+t.titleHeight+t.legendHeight}function c(t){return t.margins.left+t.margins.right+t.paddings.left+t.paddings.right}function u(t){return parseFloat(t.toFixed(2))}function d(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];n||(n=i?t[0]:t[t.length-1]);var s=new Array(Math.abs(e)).fill(n);return i?s.concat(t):t.concat(s)}function h(t,e){return(t+"").length*e}function p(t,e){return{x:Math.sin(t*Zt)*e,y:Math.cos(t*Zt)*e}}function f(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!(Number.isNaN(t)||void 0===t||!Number.isFinite(t)||e&&t<0)}function g(t){return Number(Math.round(t+"e4")+"e-4")}function m(t){var e=void 0,n=void 0,i=void 0;if(t instanceof Date)return new Date(t.getTime());if("object"!==(void 0===t?"undefined":jt(t))||null===t)return t;for(i in e=Array.isArray(t)?[]:{},t)n=t[i],e[i]=m(n);return e}function v(t,e){var n=void 0,i=void 0;return t<=e?(n=e-t,i=t):(n=t-e,i=e),[n,i]}function y(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length-t.length;return n>0?t=d(t,n):e=d(e,n),[t,e]}function b(t,e){if(t)return t.length>e?t.slice(0,e-3)+"...":t}function x(t){var e=void 0;if("number"==typeof t)e=t;else if("string"==typeof t&&(e=Number(t),Number.isNaN(e)))return t;var n=Math.floor(Math.log10(Math.abs(e)));if(n<=2)return e;var i=Math.floor(n/3),s=Math.pow(10,n-3*i)*+(e/Math.pow(10,n)).toFixed(1);return Math.round(100*s)/100+" "+["","K","M","B","T"][i]}function w(t,e){for(var n=[],i=0;i255?255:t<0?0:t}function k(t,e){var n=ee(t),i=!1;"#"==n[0]&&(n=n.slice(1),i=!0);var s=parseInt(n,16),a=$((s>>16)+e),r=$((s>>8&255)+e);return(i?"#":"")+($((255&s)+e)|r<<8|a<<16).toString(16)}function O(t){var e=/(^\s*)(rgb|hsl)(a?)[(]\s*([\d.]+\s*%?)\s*,\s*([\d.]+\s*%?)\s*,\s*([\d.]+\s*%?)\s*(?:,\s*([\d.]+)\s*)?[)]$/i;return/(^\s*)(#)((?:[A-Fa-f0-9]{3}){1,2})$/i.test(t)||e.test(t)}function A(t,e){return"string"==typeof t?(e||document).querySelector(t):t||null}function P(t,e){var n=document.createElementNS("http://www.w3.org/2000/svg",t);for(var i in e){var s=e[i];if("inside"===i)A(s).appendChild(n);else if("around"===i){var a=A(s);a.parentNode.insertBefore(n,a),n.appendChild(a)}else"styles"===i?"object"===(void 0===s?"undefined":jt(s))&&Object.keys(s).map((function(t){n.style[t]=s[t]})):("className"===i&&(i="class"),"innerHTML"===i?n.textContent=s:n.setAttribute(i,s))}return n}function S(t,e){return P("linearGradient",{inside:t,id:e,x1:0,x2:0,y1:0,y2:1})}function T(t,e,n,i){return P("stop",{inside:t,style:"stop-color: "+n,offset:e,"stop-opacity":i})}function M(t,e,n,i){return P("svg",{className:e,inside:t,width:n,height:i})}function L(t){return P("defs",{inside:t})}function C(t){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,n={className:t,transform:arguments.length>1&&void 0!==arguments[1]?arguments[1]:""};return e&&(n.inside=e),P("g",n)}function _(t){return P("path",{className:arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",d:t,styles:{stroke:arguments.length>2&&void 0!==arguments[2]?arguments[2]:"none",fill:arguments.length>3&&void 0!==arguments[3]?arguments[3]:"none","stroke-width":arguments.length>4&&void 0!==arguments[4]?arguments[4]:2}})}function N(t,e,n,i){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,r=n.x+t.x,o=n.y+t.y,l=n.x+e.x,c=n.y+e.y;return"M"+n.x+" "+n.y+"\n\t\tL"+r+" "+o+"\n\t\tA "+i+" "+i+" 0 "+a+" "+(s?1:0)+"\n\t\t"+l+" "+c+" z"}function D(t,e,n,i){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,r=n.x+t.x,o=n.y+t.y,l=n.x+e.x,c=2*n.y,u=n.y+e.y;return"M"+n.x+" "+n.y+"\n\t\tL"+r+" "+o+"\n\t\tA "+i+" "+i+" 0 "+a+" "+(s?1:0)+"\n\t\t"+l+" "+c+" z\n\t\tL"+r+" "+c+"\n\t\tA "+i+" "+i+" 0 "+a+" "+(s?1:0)+"\n\t\t"+l+" "+u+" z"}function E(t,e,n,i){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;return"M"+(n.x+t.x)+" "+(n.y+t.y)+"\n\t\tA "+i+" "+i+" 0 "+a+" "+(s?1:0)+"\n\t\t"+(n.x+e.x)+" "+(n.y+e.y)}function z(t,e,n,i){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,r=n.x+t.x,o=n.y+t.y,l=n.x+e.x,c=2*i+o;return"M"+r+" "+o+"\n\t\tA "+i+" "+i+" 0 "+a+" "+(s?1:0)+"\n\t\t"+l+" "+c+"\n\t\tM"+r+" "+c+"\n\t\tA "+i+" "+i+" 0 "+a+" "+(s?1:0)+"\n\t\t"+l+" "+(n.y+t.y)}function H(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i="path-fill-gradient-"+e+"-"+(n?"lighter":"default"),s=S(t,i),a=[1,.6,.2];return n&&(a=[.4,.2,0]),T(s,"0%",e,a[0]),T(s,"50%",e,a[1]),T(s,"100%",e,a[2]),i}function j(t,e,n,i){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Vt,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"none";return P("rect",{className:"percentage-bar",x:t,y:e,width:n,height:i,fill:a,styles:{stroke:k(a,-25),"stroke-dasharray":"0, "+(i+n)+", "+n+", "+i,"stroke-width":s}})}function J(t,e,n,i,s){var a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:{},r={className:t,x:e,y:n,width:i,height:i,rx:s,fill:arguments.length>5&&void 0!==arguments[5]?arguments[5]:"none"};return Object.keys(a).map((function(t){r[t]=a[t]})),P("rect",r)}function F(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"none",s=arguments[4];s=arguments.length>5&&void 0!==arguments[5]&&arguments[5]?b(s,se):s;var a={className:"legend-bar",x:0,y:0,width:n,height:"2px",fill:i},r=P("text",{className:"legend-dataset-text",x:0,y:0,dy:2*ae+"px","font-size":1.2*ae+"px","text-anchor":"start",fill:oe,innerHTML:s}),o=P("g",{transform:"translate("+t+", "+e+")"});return o.appendChild(P("rect",a)),o.appendChild(r),o}function W(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"none",s=arguments[4];s=arguments.length>5&&void 0!==arguments[5]&&arguments[5]?b(s,se):s;var a={className:"legend-dot",cx:0,cy:0,r:n,fill:i},r=P("text",{className:"legend-dataset-text",x:0,y:0,dx:ae+"px",dy:ae/3+"px","font-size":1.2*ae+"px","text-anchor":"start",fill:oe,innerHTML:s}),o=P("g",{transform:"translate("+t+", "+e+")"});return o.appendChild(P("circle",a)),o.appendChild(r),o}function R(t,e,n,i){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a=s.fontSize||ae;return P("text",{className:t,x:e,y:n,dy:(void 0!==s.dy?s.dy:a/2)+"px","font-size":a+"px",fill:s.fill||oe,"text-anchor":s.textAnchor||"start",innerHTML:i})}function I(t,e,n,i){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};s.stroke||(s.stroke=re);var a=P("line",{className:"line-vertical "+s.className,x1:0,x2:0,y1:n,y2:i,styles:{stroke:s.stroke}}),r=P("text",{x:0,y:n>i?n+ie:n-ie-ae,dy:ae+"px","font-size":ae+"px","text-anchor":"middle",innerHTML:e+""}),o=P("g",{transform:"translate("+t+", 0)"});return o.appendChild(a),o.appendChild(r),o}function B(t,e,n,i){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};s.stroke||(s.stroke=re),s.lineType||(s.lineType=""),s.shortenNumbers&&(e=x(e));var a=P("line",{className:"line-horizontal "+s.className+("dashed"===s.lineType?"dashed":""),x1:n,x2:i,y1:0,y2:0,styles:{stroke:s.stroke}}),r=P("text",{x:n3&&void 0!==arguments[3]?arguments[3]:{};f(t)||(t=0),i.pos||(i.pos="left"),i.offset||(i.offset=0),i.mode||(i.mode="span"),i.stroke||(i.stroke=re),i.className||(i.className="");var s=-1*ne,a="span"===i.mode?n+ne:0;return"tick"===i.mode&&"right"===i.pos&&(s=n+ne,a=n),B(t,e,s+=i.offset,a+=i.offset,{stroke:i.stroke,className:i.className,lineType:i.lineType,shortenNumbers:i.shortenNumbers})}function q(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};f(t)||(t=0),i.pos||(i.pos="bottom"),i.offset||(i.offset=0),i.mode||(i.mode="span"),i.stroke||(i.stroke=re),i.className||(i.className="");var s=n+ne,a="span"===i.mode?-1*ne:n;return"tick"===i.mode&&"top"===i.pos&&(s=-1*ne,a=0),I(t,e,s,a,{stroke:i.stroke,className:i.className,lineType:i.lineType})}function U(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};i.labelPos||(i.labelPos="right");var s=P("text",{className:"chart-label",x:"left"===i.labelPos?ie:n-h(e,5)-ie,y:0,dy:ae/-2+"px","font-size":ae+"px","text-anchor":"start",innerHTML:e+""}),a=B(t,"",0,n,{stroke:i.stroke||re,className:i.className||"",lineType:i.lineType});return a.appendChild(s),a}function V(t,e,n,i){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a=t-e,r=P("rect",{className:"bar mini",styles:{fill:"rgba(228, 234, 239, 0.49)",stroke:re,"stroke-dasharray":n+", "+a},x:0,y:0,width:n,height:a});s.labelPos||(s.labelPos="right");var o=P("text",{className:"chart-label",x:"left"===s.labelPos?ie:n-h(i+"",4.5)-ie,y:0,dy:ae/-2+"px","font-size":ae+"px","text-anchor":"start",innerHTML:i+""}),l=P("g",{transform:"translate(0, "+e+")"});return l.appendChild(r),l.appendChild(o),l}function G(t,e,n,i){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:{},l=v(e,o.zeroLine),c=Bt(l,2),u=c[0],d=c[1];d-=r,0===u&&(u=o.minHeight,d-=o.minHeight),f(t)||(t=0),f(d)||(d=0),f(u,!0)||(u=0),f(n,!0)||(n=0);var h=P("rect",{className:"bar mini",style:"fill: "+i,"data-point-index":a,x:t,y:d,width:n,height:u});if((s+="")||s.length){h.setAttribute("y",0),h.setAttribute("x",0);var p=P("text",{className:"data-point-value",x:n/2,y:0,dy:ae/2*-1+"px","font-size":ae+"px","text-anchor":"middle",innerHTML:s}),g=P("g",{"data-point-index":a,transform:"translate("+t+", "+d+")"});return g.appendChild(h),g.appendChild(p),g}return h}function X(t,e,n,i){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,r=P("circle",{style:"fill: "+i,"data-point-index":a,cx:t,cy:e,r:n});if((s+="")||s.length){r.setAttribute("cy",0),r.setAttribute("cx",0);var o=P("text",{className:"data-point-value",x:0,y:0,dy:ae/2*-1-n+"px","font-size":ae+"px","text-anchor":"middle",innerHTML:s}),l=P("g",{"data-point-index":a,transform:"translate("+t+", "+e+")"});return l.appendChild(r),l.appendChild(o),l}return r}function K(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a=e.map((function(e,n){return t[n]+","+e})).join("L");i.spline&&(a=w(t,e));var r=_("M"+a,"line-graph-path",n);if(i.heatline){var o=H(s.svgDefs,n);r.style.stroke="url(#"+o+")"}var l={path:r};if(i.regionFill){var c=H(s.svgDefs,n,!0),u="M"+t[0]+","+s.zeroLine+"L"+a+"L"+t.slice(-1)[0]+","+s.zeroLine;l.region=_(u,"region-fill","none","url(#"+c+")")}return l}function Z(t,e,n,i){var s="string"==typeof e?e:e.join(", ");return[t,{transform:n.join(", ")},i,fe,"translate",{transform:s}]}function Q(t,e,n){return Z(t,[n,0],[e,0],he)}function tt(t,e,n){return Z(t,[0,n],[0,e],he)}function et(t,e,n,i){var s=e-n,a=t.childNodes[0];return[[a,{height:s,"stroke-dasharray":a.getAttribute("width")+", "+s},he,fe],Z(t,[0,i],[0,n],he)]}function nt(t,e,n,i){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=v(n,(arguments.length>5&&void 0!==arguments[5]?arguments[5]:{}).zeroLine),r=Bt(a,2),o=r[0],l=r[1];return l-=s,"rect"!==t.nodeName?[[t.childNodes[0],{width:i,height:o},ue,fe],Z(t,t.getAttribute("transform").split("(")[1].slice(0,-1),[e,l],he)]:[[t,{width:i,height:o,x:e,y:l},ue,fe]]}function it(t,e,n){return"circle"!==t.nodeName?[Z(t,t.getAttribute("transform").split("(")[1].slice(0,-1),[e,n],he)]:[[t,{cx:e,cy:n},ue,fe]]}function st(t,e,n,i,s){var a=[],r=n.map((function(t,n){return e[n]+","+t})).join("L");s&&(r=w(e,n));var o=[t.path,{d:"M"+r},de,fe];if(a.push(o),t.region){var l=e[0]+","+i+"L",c="L"+e.slice(-1)[0]+", "+i,u=[t.region,{d:"M"+l+r+c},de,fe];a.push(u)}return a}function at(t,e){return[t,{d:e},ue,fe]}function rt(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"linear",s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},r=t.cloneNode(!0),o=t.cloneNode(!0);for(var l in e){var c=void 0;c="transform"===l?document.createElementNS("http://www.w3.org/2000/svg","animateTransform"):document.createElementNS("http://www.w3.org/2000/svg","animate");var u=a[l]||t.getAttribute(l),d=e[l],h={attributeName:l,from:u,to:d,begin:"0s",dur:n/1e3+"s",values:u+";"+d,keySplines:ge[i],keyTimes:"0;1",calcMode:"spline",fill:"freeze"};for(var p in s&&(h.type=s),h)c.setAttribute(p,h[p]);r.appendChild(c),s?o.setAttribute(l,"translate("+d+")"):o.setAttribute(l,d)}return[r,o]}function ot(t,e){t.style.transform=e,t.style.webkitTransform=e,t.style.msTransform=e,t.style.mozTransform=e,t.style.oTransform=e}function lt(t,e){var n=[],i=[];e.map((function(t){var e=t[0],s=e.parentNode,a=void 0,r=void 0;t[0]=e;var o=rt.apply(void 0,Yt(t)),l=Bt(o,2);a=l[0],r=l[1],n.push(r),i.push([a,s]),s&&s.replaceChild(a,e)}));var s=t.cloneNode(!0);return i.map((function(t,i){t[1]&&(t[1].replaceChild(n[i],t[0]),e[i][0]=n[i])})),s}function ct(t,e,n){if(0!==n.length){var i=lt(e,n);e.parentNode==t&&(t.removeChild(e),t.appendChild(i)),setTimeout((function(){i.parentNode==t&&(t.removeChild(i),t.appendChild(e))}),pe)}}function ut(t,e){var n=document.createElement("a");n.style="display: none";var i=new Blob(e,{type:"image/svg+xml; charset=utf-8"}),s=window.URL.createObjectURL(i);n.href=s,n.download=t,document.body.appendChild(n),n.click(),setTimeout((function(){document.body.removeChild(n),window.URL.revokeObjectURL(s)}),300)}function dt(e){var n=e.cloneNode(!0);n.classList.add("chart-container"),n.setAttribute("xmlns","http://www.w3.org/2000/svg"),n.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink");var i=t.create("style",{innerHTML:me});n.insertBefore(i,n.firstChild);var s=t.create("div");return s.appendChild(n),s.innerHTML}function ht(t){var e=new Date(t);return e.setMinutes(e.getMinutes()-e.getTimezoneOffset()),e}function pt(t){var e=t.getDate(),n=t.getMonth()+1;return[t.getFullYear(),(n>9?"":"0")+n,(e>9?"":"0")+e].join("-")}function ft(t){return new Date(t.getTime())}function gt(t,e){var n=xt(t);return Math.ceil(mt(n,e)/be)}function mt(t,e){var n=we*xe;return(ht(e)-ht(t))/n}function vt(t,e){return t.getMonth()===e.getMonth()&&t.getFullYear()===e.getFullYear()}function yt(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=$e[t];return e?n.slice(0,3):n}function bt(t,e){return new Date(e,t+1,0)}function xt(t){var e=ft(t),n=e.getDay();return 0!==n&&wt(e,-1*n),e}function wt(t,e){t.setDate(t.getDate()+e)}function $t(t,e,n){var i=Object.keys(Ae).filter((function(e){return t.includes(e)})),s=Ae[i[0]];return Object.assign(s,{constants:e,getData:n}),new Oe(s)}function kt(t){if(0===t)return[0,0];if(isNaN(t))return{mantissa:-6755399441055744,exponent:972};var e=t>0?1:-1;if(!isFinite(t))return{mantissa:4503599627370496*e,exponent:972};t=Math.abs(t);var n=Math.floor(Math.log10(t));return[e*(t/Math.pow(10,n)),n]}function Ot(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=Math.ceil(t),i=Math.floor(e),s=n-i,a=s,r=1;s>5&&(s%2!=0&&(s=++n-i),a=s/2,r=2),s<=2&&(r=s/(a=4)),0===s&&(a=5,r=1);for(var o=[],l=0;l<=a;l++)o.push(i+r*l);return o}function At(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=kt(t),i=Bt(n,2),s=i[0],a=i[1],r=e?e/Math.pow(10,a):0,o=Ot(s=s.toFixed(6),r);return o.map((function(t){return t*Math.pow(10,a)}))}function Pt(t){function e(t,e){for(var n=At(t),i=n[1]-n[0],s=0,a=1;s1&&void 0!==arguments[1]&&arguments[1],i=Math.max.apply(Math,Yt(t)),s=Math.min.apply(Math,Yt(t)),a=[];if(i>=0&&s>=0)kt(i)[1],a=n?At(i,s):At(i);else if(i>0&&s<0){var r=Math.abs(s);i>=r?(kt(i)[1],a=e(i,r)):(kt(r)[1],a=e(r,i).reverse().map((function(t){return-1*t})))}else if(i<=0&&s<=0){var o=Math.abs(s),l=Math.abs(i);kt(o)[1],a=(a=n?At(o,l):At(o)).reverse().map((function(t){return-1*t}))}return a}function St(t){var e=Tt(t);return t.indexOf(0)>=0?t.indexOf(0):t[0]>0?-1*t[0]/e:-1*t[t.length-1]/e+(t.length-1)}function Tt(t){return t[1]-t[0]}function Mt(t){return t[t.length-1]-t[0]}function Lt(t,e){return u(e.zeroLine-t*e.scaleMultiplier)}function Ct(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=e.reduce((function(e,n){return Math.abs(n-t)n?i.slice(0,n):d(i,n-i.length,0),t.values=i}else t.values=s;t.chartType||(t.chartType=e)})),t.yRegions&&t.yRegions.map((function(t){if(t.end1&&void 0!==arguments[1]?arguments[1]:[],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=t/e.length;i<=0&&(i=1);var s=i/Gt,a=void 0;if(n){var r=Math.max.apply(Math,Yt(e.map((function(t){return t.length}))));a=Math.ceil(r/s)}return e.map((function(t,e){return(t+="").length>s&&(n?e%a!=0&&(t=""):t=s-3>0?t.slice(0,s-3)+" ...":t.slice(0,s)+".."),t}))}function Ht(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"line",e=arguments[1],n=arguments[2];return"axis-mixed"===t?(n.type="line",new Me(e,n)):Ce[t]?new Ce[t](e,n):void console.error("Undefined chart type: "+t)}!function(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css","top"===n&&i.firstChild?i.insertBefore(s,i.firstChild):i.appendChild(s),s.styleSheet?s.styleSheet.cssText=t:s.appendChild(document.createTextNode(t))}}('.chart-container{position:relative;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif}.chart-container .axis,.chart-container .chart-label{fill:#555b51}.chart-container .axis line,.chart-container .chart-label line{stroke:#dadada}.chart-container .dataset-units circle{stroke:#fff;stroke-width:2}.chart-container .dataset-units path{fill:none;stroke-opacity:1;stroke-width:2px}.chart-container .dataset-path{stroke-width:2px}.chart-container .path-group path{fill:none;stroke-opacity:1;stroke-width:2px}.chart-container line.dashed{stroke-dasharray:5,3}.chart-container .axis-line .specific-value{text-anchor:start}.chart-container .axis-line .y-line{text-anchor:end}.chart-container .axis-line .x-line{text-anchor:middle}.chart-container .legend-dataset-text{fill:#6c7680;font-weight:600}.graph-svg-tip{position:absolute;z-index:99999;padding:10px;font-size:12px;color:#959da5;text-align:center;background:rgba(0,0,0,.8);border-radius:3px}.graph-svg-tip ol,.graph-svg-tip ul{padding-left:0;display:-webkit-box;display:-ms-flexbox;display:flex}.graph-svg-tip ul.data-point-list li{min-width:90px;-webkit-box-flex:1;-ms-flex:1;flex:1;font-weight:600}.graph-svg-tip strong{color:#dfe2e5;font-weight:600}.graph-svg-tip .svg-pointer{position:absolute;height:5px;margin:0 0 0 -5px;content:" ";border:5px solid transparent;border-top-color:rgba(0,0,0,.8)}.graph-svg-tip.comparison{padding:0;text-align:left;pointer-events:none}.graph-svg-tip.comparison .title{display:block;padding:10px;margin:0;font-weight:600;line-height:1;pointer-events:none}.graph-svg-tip.comparison ul{margin:0;white-space:nowrap;list-style:none}.graph-svg-tip.comparison li{display:inline-block;padding:5px 10px}');var jt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jt=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},Ft=function(){function t(t,e){for(var n=0;n\n\t\t\t\t\n\t\t\t\t'}),this.hideTip(),this.title=this.container.querySelector(".title"),this.dataPointList=this.container.querySelector(".data-point-list"),this.parent.addEventListener("mouseleave",(function(){e.hideTip()}))}},{key:"fill",value:function(){var e=this,n=void 0;this.index&&this.container.setAttribute("data-point-index",this.index),n=this.titleValueFirst?""+this.titleValue+""+this.titleName:this.titleName+""+this.titleValue+"",this.title.innerHTML=n,this.dataPointList.innerHTML="",this.listValues.map((function(n,i){var s=e.colors[i]||"black",a=0===n.formatted||n.formatted?n.formatted:n.value,r=t.create("li",{styles:{"border-top":"3px solid "+s},innerHTML:''+(0===a||a?a:"")+"\n\t\t\t\t\t"+(n.title?n.title:"")});e.dataPointList.appendChild(r)}))}},{key:"calcPosition",value:function(){var t=this.container.offsetWidth;this.top=this.y-this.container.offsetHeight-5,this.left=this.x-t/2;var e=this.parent.offsetWidth-t,n=this.container.querySelector(".svg-pointer");if(this.left<0)n.style.left="calc(50% - "+-1*this.left+"px)",this.left=0;else if(this.left>e){var i="calc(50% + "+(this.left-e)+"px)";n.style.left=i,this.left=e}else n.style.left="50%"}},{key:"setValues",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1;this.titleName=n.name,this.titleValue=n.value,this.listValues=i,this.x=t,this.y=e,this.titleValueFirst=n.valueFirst||0,this.index=s,this.refresh()}},{key:"hideTip",value:function(){this.container.style.top="0px",this.container.style.left="0px",this.container.style.opacity="0"}},{key:"showTip",value:function(){this.container.style.top=this.top+"px",this.container.style.left=this.left+"px",this.container.style.opacity="1"}}]),e}(),te={"light-blue":"#7cd6fd",blue:"#5e64ff",violet:"#743ee2",red:"#ff5858",orange:"#ffa00a",yellow:"#feef72",green:"#28a745","light-green":"#98d85b",purple:"#b554ff",magenta:"#ffa3ef",black:"#36114C",grey:"#bdd3e6","light-grey":"#f0f4f7","dark-grey":"#b8c2cc"},ee=function(t){return/rgb[a]{0,1}\([\d, ]+\)/gim.test(t)?/\D+(\d*)\D+(\d*)\D+(\d*)/gim.exec(t).map((function(t,e){return 0!==e?Number(t).toString(16):"#"})).reduce((function(t,e){return""+t+e})):te[t]||t},ne=6,ie=4,se=15,ae=10,re="#dadada",oe="#555b51",le={bar:function(t){var e=void 0;"rect"!==t.nodeName&&(e=t.getAttribute("transform"),t=t.childNodes[0]);var n=t.cloneNode();return n.style.fill="#000000",n.style.opacity="0.4",e&&n.setAttribute("transform",e),n},dot:function(t){var e=void 0;"circle"!==t.nodeName&&(e=t.getAttribute("transform"),t=t.childNodes[0]);var n=t.cloneNode(),i=t.getAttribute("r"),s=t.getAttribute("fill");return n.setAttribute("r",parseInt(i)+4),n.setAttribute("fill",s),n.style.opacity="0.6",e&&n.setAttribute("transform",e),n},heat_square:function(t){var e=void 0;"circle"!==t.nodeName&&(e=t.getAttribute("transform"),t=t.childNodes[0]);var n=t.cloneNode(),i=t.getAttribute("r"),s=t.getAttribute("fill");return n.setAttribute("r",parseInt(i)+4),n.setAttribute("fill",s),n.style.opacity="0.6",e&&n.setAttribute("transform",e),n}},ce={bar:function(t,e){var n=void 0;"rect"!==t.nodeName&&(n=t.getAttribute("transform"),t=t.childNodes[0]);var i=["x","y","width","height"];Object.values(t.attributes).filter((function(t){return i.includes(t.name)&&t.specified})).map((function(t){e.setAttribute(t.name,t.nodeValue)})),n&&e.setAttribute("transform",n)},dot:function(t,e){var n=void 0;"circle"!==t.nodeName&&(n=t.getAttribute("transform"),t=t.childNodes[0]);var i=["cx","cy"];Object.values(t.attributes).filter((function(t){return i.includes(t.name)&&t.specified})).map((function(t){e.setAttribute(t.name,t.nodeValue)})),n&&e.setAttribute("transform",n)},heat_square:function(t,e){var n=void 0;"circle"!==t.nodeName&&(n=t.getAttribute("transform"),t=t.childNodes[0]);var i=["cx","cy"];Object.values(t.attributes).filter((function(t){return i.includes(t.name)&&t.specified})).map((function(t){e.setAttribute(t.name,t.nodeValue)})),n&&e.setAttribute("transform",n)}},ue=350,de=350,he=ue,pe=250,fe="easein",ge={ease:"0.25 0.1 0.25 1",linear:"0 0 1 1",easein:"0.1 0.8 0.2 1",easeout:"0 0 0.58 1",easeinout:"0.42 0 0.58 1"},me=".chart-container{position:relative;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Roboto','Oxygen','Ubuntu','Cantarell','Fira Sans','Droid Sans','Helvetica Neue',sans-serif}.chart-container .axis,.chart-container .chart-label{fill:#555b51}.chart-container .axis line,.chart-container .chart-label line{stroke:#dadada}.chart-container .dataset-units circle{stroke:#fff;stroke-width:2}.chart-container .dataset-units path{fill:none;stroke-opacity:1;stroke-width:2px}.chart-container .dataset-path{stroke-width:2px}.chart-container .path-group path{fill:none;stroke-opacity:1;stroke-width:2px}.chart-container line.dashed{stroke-dasharray:5,3}.chart-container .axis-line .specific-value{text-anchor:start}.chart-container .axis-line .y-line{text-anchor:end}.chart-container .axis-line .x-line{text-anchor:middle}.chart-container .legend-dataset-text{fill:#6c7680;font-weight:600}.graph-svg-tip{position:absolute;z-index:99999;padding:10px;font-size:12px;color:#959da5;text-align:center;background:rgba(0,0,0,.8);border-radius:3px}.graph-svg-tip ul{padding-left:0;display:flex}.graph-svg-tip ol{padding-left:0;display:flex}.graph-svg-tip ul.data-point-list li{min-width:90px;flex:1;font-weight:600}.graph-svg-tip strong{color:#dfe2e5;font-weight:600}.graph-svg-tip .svg-pointer{position:absolute;height:5px;margin:0 0 0 -5px;content:' ';border:5px solid transparent;border-top-color:rgba(0,0,0,.8)}.graph-svg-tip.comparison{padding:0;text-align:left;pointer-events:none}.graph-svg-tip.comparison .title{display:block;padding:10px;margin:0;font-weight:600;line-height:1;pointer-events:none}.graph-svg-tip.comparison ul{margin:0;white-space:nowrap;list-style:none}.graph-svg-tip.comparison li{display:inline-block;padding:5px 10px}",ve=function(){function e(t,n){if(Jt(this,e),n=m(n),this.parent="string"==typeof t?document.querySelector(t):t,!(this.parent instanceof HTMLElement))throw new Error("No `parent` element to render on was provided.");this.rawChartArgs=n,this.title=n.title||"",this.type=n.type||"",this.realData=this.prepareData(n.data),this.data=this.prepareFirstData(this.realData),this.colors=this.validateColors(n.colors,this.type),this.config={showTooltip:1,showLegend:1,isNavigable:n.isNavigable||0,animate:void 0!==n.animate?n.animate:1,truncateLegends:n.truncateLegends||1},this.measures=JSON.parse(JSON.stringify(qt));var i=this.measures;this.setMeasures(n),this.title.length||(i.titleHeight=0),this.config.showLegend||(i.legendHeight=0),this.argHeight=n.height||i.baseHeight,this.state={},this.options={},this.initTimeout=Ut,this.config.isNavigable&&(this.overlays=[]),this.configure(n)}return Ft(e,[{key:"prepareData",value:function(t){return t}},{key:"prepareFirstData",value:function(t){return t}},{key:"validateColors",value:function(t,e){var n=[];return(t=(t||[]).concat(Kt[e])).forEach((function(t){var e=ee(t);O(e)?n.push(e):console.warn('"'+t+'" is not a valid color.')})),n}},{key:"setMeasures",value:function(){}},{key:"configure",value:function(){var t=this,e=this.argHeight;this.baseHeight=e,this.height=e-l(this.measures),this.boundDrawFn=function(){return t.draw(!0)},ResizeObserver&&(this.resizeObserver=new ResizeObserver(this.boundDrawFn),this.resizeObserver.observe(this.parent)),window.addEventListener("resize",this.boundDrawFn),window.addEventListener("orientationchange",this.boundDrawFn)}},{key:"destroy",value:function(){this.resizeObserver&&this.resizeObserver.disconnect(),window.removeEventListener("resize",this.boundDrawFn),window.removeEventListener("orientationchange",this.boundDrawFn)}},{key:"setup",value:function(){this.makeContainer(),this.updateWidth(),this.makeTooltip(),this.draw(!1,!0)}},{key:"makeContainer",value:function(){this.parent.innerHTML="";var e={inside:this.parent,className:"chart-container"};this.independentWidth&&(e.styles={width:this.independentWidth+"px"}),this.container=t.create("div",e)}},{key:"makeTooltip",value:function(){this.tip=new Qt({parent:this.container,colors:this.colors}),this.bindTooltip()}},{key:"bindTooltip",value:function(){}},{key:"draw",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e&&n(this.parent)||(this.updateWidth(),this.calc(e),this.makeChartArea(),this.setupComponents(),this.components.forEach((function(e){return e.setup(t.drawArea)})),this.render(this.components,!1),i&&(this.data=this.realData,setTimeout((function(){t.update(t.data)}),this.initTimeout)),this.renderLegend(),this.setupNavigation(i))}},{key:"calc",value:function(){}},{key:"updateWidth",value:function(){this.baseWidth=s(this.parent),this.width=this.baseWidth-c(this.measures)}},{key:"makeChartArea",value:function(){this.svg&&this.container.removeChild(this.svg);var t=this.measures;this.svg=M(this.container,"frappe-chart chart",this.baseWidth,this.baseHeight),this.svgDefs=L(this.svg),this.title.length&&(this.titleEL=R("title",t.margins.left,t.margins.top,this.title,{fontSize:t.titleFontSize,fill:"#666666",dy:t.titleFontSize}));var e=r(t);this.drawArea=C(this.type+"-chart chart-draw-area","translate("+o(t)+", "+e+")"),this.config.showLegend&&(e+=this.height+t.paddings.bottom,this.legendArea=C("chart-legend","translate("+o(t)+", "+e+")")),this.title.length&&this.svg.appendChild(this.titleEL),this.svg.appendChild(this.drawArea),this.config.showLegend&&this.svg.appendChild(this.legendArea),this.updateTipOffset(o(t),r(t))}},{key:"updateTipOffset",value:function(t,e){this.tip.offset={x:t,y:e}}},{key:"setupComponents",value:function(){this.components=new Map}},{key:"update",value:function(t){t||console.error("No data to update."),this.data=this.prepareData(t),this.calc(),this.render(this.components,this.config.animate),this.renderLegend()}},{key:"render",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.components,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.config.isNavigable&&this.overlays.map((function(t){return t.parentNode.removeChild(t)}));var i=[];e.forEach((function(t){i=i.concat(t.update(n))})),i.length>0?(ct(this.container,this.svg,i),setTimeout((function(){e.forEach((function(t){return t.make()})),t.updateNav()}),400)):(e.forEach((function(t){return t.make()})),this.updateNav())}},{key:"updateNav",value:function(){this.config.isNavigable&&(this.makeOverlay(),this.bindUnits())}},{key:"renderLegend",value:function(){}},{key:"setupNavigation",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.config.isNavigable&&e&&(this.bindOverlay(),this.keyActions={13:this.onEnterKey.bind(this),37:this.onLeftArrow.bind(this),38:this.onUpArrow.bind(this),39:this.onRightArrow.bind(this),40:this.onDownArrow.bind(this)},document.addEventListener("keydown",(function(e){i(t.container)&&(e=e||window.event,t.keyActions[e.keyCode]&&t.keyActions[e.keyCode]())})))}},{key:"makeOverlay",value:function(){}},{key:"updateOverlay",value:function(){}},{key:"bindOverlay",value:function(){}},{key:"bindUnits",value:function(){}},{key:"onLeftArrow",value:function(){}},{key:"onRightArrow",value:function(){}},{key:"onUpArrow",value:function(){}},{key:"onDownArrow",value:function(){}},{key:"onEnterKey",value:function(){}},{key:"addDataPoint",value:function(){}},{key:"removeDataPoint",value:function(){}},{key:"getDataPoint",value:function(){}},{key:"setCurrentDataPoint",value:function(){}},{key:"updateDataset",value:function(){}},{key:"export",value:function(){var t=dt(this.svg);ut(this.title||"Chart",[t])}}]),e}(),ye=function(t){function e(t,n){return Jt(this,e),It(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return Rt(e,t),Ft(e,[{key:"configure",value:function(t){Wt(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"configure",this).call(this,t),this.config.formatTooltipY=(t.tooltipOptions||{}).formatTooltipY,this.config.maxSlices=t.maxSlices||20,this.config.maxLegendPoints=t.maxLegendPoints||20}},{key:"calc",value:function(){var t=this,e=this.state,n=this.config.maxSlices;e.sliceTotals=[];var i=this.data.labels.map((function(e,n){var i=0;return t.data.datasets.map((function(t){i+=t.values[n]})),[i,e]})).filter((function(t){return t[0]>=0})),s=i;if(i.length>n){i.sort((function(t,e){return e[0]-t[0]})),s=i.slice(0,n-1);var a=0;i.slice(n-1).map((function(t){a+=t[0]})),s.push([a,"Rest"]),this.colors[n-1]="grey"}e.labels=[],s.map((function(t){e.sliceTotals.push(g(t[0])),e.labels.push(t[1])})),e.grandTotal=e.sliceTotals.reduce((function(t,e){return t+e}),0),this.center={x:this.width/2,y:this.height/2}}},{key:"renderLegend",value:function(){var t=this,e=this.state;this.legendArea.textContent="",this.legendTotals=e.sliceTotals.slice(0,this.config.maxLegendPoints);var n=0,i=0;this.legendTotals.map((function(s,a){var r=150,o=Math.floor((t.width-c(t.measures))/r);t.legendTotals.lengtho&&(n=0,i+=20);var l=r*n+5,u=t.config.truncateLegends?b(e.labels[a],r/10):e.labels[a],d=t.config.formatTooltipY?t.config.formatTooltipY(s):s,h=W(l,i,5,t.colors[a],u+": "+d,!1);t.legendArea.appendChild(h),n++}))}}]),e}(ve),be=7,xe=1e3,we=86400,$e=["January","February","March","April","May","June","July","August","September","October","November","December"],ke=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Oe=function(){function t(e){var n=e.layerClass,i=void 0===n?"":n,s=e.layerTransform,a=void 0===s?"":s,r=e.constants,o=e.getData,l=e.makeElements,c=e.animateElements;Jt(this,t),this.layerTransform=a,this.constants=r,this.makeElements=l,this.getData=o,this.animateElements=c,this.store=[],this.labels=[],this.layerClass=i,this.layerClass="function"==typeof this.layerClass?this.layerClass():this.layerClass,this.refresh()}return Ft(t,[{key:"refresh",value:function(t){this.data=t||this.getData()}},{key:"setup",value:function(t){this.layer=C(this.layerClass,this.layerTransform,t)}},{key:"make",value:function(){this.render(this.data),this.oldData=this.data}},{key:"render",value:function(t){var e=this;this.store=this.makeElements(t),this.layer.textContent="",this.store.forEach((function(t){e.layer.appendChild(t)})),this.labels.forEach((function(t){e.layer.appendChild(t)}))}},{key:"update",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.refresh();var e=[];return t&&(e=this.animateElements(this.data)||[]),e}}]),t}(),Ae={donutSlices:{layerClass:"donut-slices",makeElements:function(t){return t.sliceStrings.map((function(e,n){var i=_(e,"donut-path",t.colors[n],"none",t.strokeWidth);return i.style.transition="transform .3s;",i}))},animateElements:function(t){return this.store.map((function(e,n){return at(e,t.sliceStrings[n])}))}},pieSlices:{layerClass:"pie-slices",makeElements:function(t){return t.sliceStrings.map((function(e,n){var i=_(e,"pie-path","none",t.colors[n]);return i.style.transition="transform .3s;",i}))},animateElements:function(t){return this.store.map((function(e,n){return at(e,t.sliceStrings[n])}))}},percentageBars:{layerClass:"percentage-bars",makeElements:function(t){var e=this;return t.xPositions.map((function(n,i){return j(n,0,t.widths[i],e.constants.barHeight,e.constants.barDepth,t.colors[i])}))},animateElements:function(t){if(t)return[]}},yAxis:{layerClass:"y axis",makeElements:function(t){var e=this;return t.positions.map((function(n,i){return Y(n,t.labels[i],e.constants.width,{mode:e.constants.mode,pos:e.constants.pos,shortenNumbers:e.constants.shortenNumbers})}))},animateElements:function(t){var e=t.positions,n=t.labels,i=this.oldData.positions,s=this.oldData.labels,a=y(i,e),r=Bt(a,2);i=r[0],e=r[1];var o=y(s,n),l=Bt(o,2);return s=l[0],n=l[1],this.render({positions:i,labels:n}),this.store.map((function(t,n){return tt(t,e[n],i[n])}))}},xAxis:{layerClass:"x axis",makeElements:function(t){var e=this;return t.positions.map((function(n,i){return q(n,t.calcLabels[i],e.constants.height,{mode:e.constants.mode,pos:e.constants.pos})}))},animateElements:function(t){var e=t.positions,n=t.calcLabels,i=this.oldData.positions,s=this.oldData.calcLabels,a=y(i,e),r=Bt(a,2);i=r[0],e=r[1];var o=y(s,n),l=Bt(o,2);return s=l[0],n=l[1],this.render({positions:i,calcLabels:n}),this.store.map((function(t,n){return Q(t,e[n],i[n])}))}},yMarkers:{layerClass:"y-markers",makeElements:function(t){var e=this;return t.map((function(t){return U(t.position,t.label,e.constants.width,{labelPos:t.options.labelPos,mode:"span",lineType:"dashed"})}))},animateElements:function(t){var e=y(this.oldData,t),n=Bt(e,2);this.oldData=n[0];var i=(t=n[1]).map((function(t){return t.position})),s=t.map((function(t){return t.label})),a=t.map((function(t){return t.options})),r=this.oldData.map((function(t){return t.position}));return this.render(r.map((function(t,e){return{position:r[e],label:s[e],options:a[e]}}))),this.store.map((function(t,e){return tt(t,i[e],r[e])}))}},yRegions:{layerClass:"y-regions",makeElements:function(t){var e=this;return t.map((function(t){return V(t.startPos,t.endPos,e.constants.width,t.label,{labelPos:t.options.labelPos})}))},animateElements:function(t){var e=y(this.oldData,t),n=Bt(e,2);this.oldData=n[0];var i=(t=n[1]).map((function(t){return t.endPos})),s=t.map((function(t){return t.label})),a=t.map((function(t){return t.startPos})),r=t.map((function(t){return t.options})),o=this.oldData.map((function(t){return t.endPos})),l=this.oldData.map((function(t){return t.startPos}));this.render(o.map((function(t,e){return{startPos:l[e],endPos:o[e],label:s[e],options:r[e]}})));var c=[];return this.store.map((function(t,e){c=c.concat(et(t,a[e],i[e],o[e]))})),c}},heatDomain:{layerClass:function(){return"heat-domain domain-"+this.constants.index},makeElements:function(t){var e=this,n=this.constants,i=n.index,s=n.colWidth,a=n.rowHeight,r=n.squareSize,o=n.radius,l=n.xTranslate,c=0;return this.serializedSubDomains=[],t.cols.map((function(t,n){1===n&&e.labels.push(R("domain-name",l,-12,yt(i,!0).toUpperCase(),{fontSize:9})),t.map((function(t,n){if(t.fill){var i={"data-date":t.yyyyMmDd,"data-value":t.dataValue,"data-day":n},s=J("day",l,c,r,o,t.fill,i);e.serializedSubDomains.push(s)}c+=a})),c=0,l+=s})),this.serializedSubDomains},animateElements:function(t){if(t)return[]}},barGraph:{layerClass:function(){return"dataset-units dataset-bars dataset-"+this.constants.index},makeElements:function(t){var e=this.constants;return this.unitType="bar",this.units=t.yPositions.map((function(n,i){return G(t.xPositions[i],n,t.barWidth,e.color,t.labels[i],i,t.offsets[i],{zeroLine:t.zeroLine,barsWidth:t.barsWidth,minHeight:e.minHeight})})),this.units},animateElements:function(t){var e=t.xPositions,n=t.yPositions,i=t.offsets,s=t.labels,a=this.oldData.xPositions,r=this.oldData.yPositions,o=this.oldData.offsets,l=this.oldData.labels,c=y(a,e),u=Bt(c,2);a=u[0],e=u[1];var d=y(r,n),h=Bt(d,2);r=h[0],n=h[1];var p=y(o,i),f=Bt(p,2);o=f[0],i=f[1];var g=y(l,s),m=Bt(g,2);l=m[0],s=m[1],this.render({xPositions:a,yPositions:r,offsets:o,labels:s,zeroLine:this.oldData.zeroLine,barsWidth:this.oldData.barsWidth,barWidth:this.oldData.barWidth});var v=[];return this.store.map((function(s,a){v=v.concat(nt(s,e[a],n[a],t.barWidth,i[a],{zeroLine:t.zeroLine}))})),v}},lineGraph:{layerClass:function(){return"dataset-units dataset-line dataset-"+this.constants.index},makeElements:function(t){var e=this.constants;return this.unitType="dot",this.paths={},e.hideLine||(this.paths=K(t.xPositions,t.yPositions,e.color,{heatline:e.heatline,regionFill:e.regionFill,spline:e.spline},{svgDefs:e.svgDefs,zeroLine:t.zeroLine})),this.units=[],e.hideDots||(this.units=t.yPositions.map((function(n,i){return X(t.xPositions[i],n,t.radius,e.color,e.valuesOverPoints?t.values[i]:"",i)}))),Object.values(this.paths).concat(this.units)},animateElements:function(t){var e=t.xPositions,n=t.yPositions,i=t.values,s=this.oldData.xPositions,a=this.oldData.yPositions,r=this.oldData.values,o=y(s,e),l=Bt(o,2);s=l[0],e=l[1];var c=y(a,n),u=Bt(c,2);a=u[0],n=u[1];var d=y(r,i),h=Bt(d,2);r=h[0],i=h[1],this.render({xPositions:s,yPositions:a,values:i,zeroLine:this.oldData.zeroLine,radius:this.oldData.radius});var p=[];return Object.keys(this.paths).length&&(p=p.concat(st(this.paths,e,n,t.zeroLine,this.constants.spline))),this.units.length&&this.units.map((function(t,i){p=p.concat(it(t,e[i],n[i]))})),p}}},Pe=function(t){function n(t,e){Jt(this,n);var i=It(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,t,e));return i.type="percentage",i.setup(),i}return Rt(n,t),Ft(n,[{key:"setMeasures",value:function(t){var e=this.measures;this.barOptions=t.barOptions||{};var n=this.barOptions;n.height=n.height||20,n.depth=n.depth||Vt,e.paddings.right=30,e.legendHeight=60,e.baseHeight=8*(n.height+.5*n.depth)}},{key:"setupComponents",value:function(){var t=this.state,e=[["percentageBars",{barHeight:this.barOptions.height,barDepth:this.barOptions.depth},function(){return{xPositions:t.xPositions,widths:t.widths,colors:this.colors}}.bind(this)]];this.components=new Map(e.map((function(t){var e=$t.apply(void 0,Yt(t));return[t[0],e]})))}},{key:"calc",value:function(){var t=this;Wt(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"calc",this).call(this);var e=this.state;e.xPositions=[],e.widths=[];var i=0;e.sliceTotals.map((function(n){var s=t.width*n/e.grandTotal;e.widths.push(s),e.xPositions.push(i),i+=s}))}},{key:"makeDataByIndex",value:function(){}},{key:"bindTooltip",value:function(){var t=this,n=this.state;this.container.addEventListener("mousemove",(function(i){var s=t.components.get("percentageBars").store,a=i.target;if(s.includes(a)){var r=s.indexOf(a),o=e(t.container),l=e(a),c=l.left-o.left+parseInt(a.getAttribute("width"))/2,u=l.top-o.top,d=(t.formattedLabels&&t.formattedLabels.length>0?t.formattedLabels[r]:t.state.labels[r])+": ",h=n.sliceTotals[r]/n.grandTotal;t.tip.setValues(c,u,{name:d,value:(100*h).toFixed(1)+"%"}),t.tip.showTip()}}))}}]),n}(ye),Se=function(t){function n(t,e){Jt(this,n);var i=It(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,t,e));return i.type="pie",i.initTimeout=0,i.init=1,i.setup(),i}return Rt(n,t),Ft(n,[{key:"configure",value:function(t){Wt(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"configure",this).call(this,t),this.mouseMove=this.mouseMove.bind(this),this.mouseLeave=this.mouseLeave.bind(this),this.hoverRadio=t.hoverRadio||.1,this.config.startAngle=t.startAngle||0,this.clockWise=t.clockWise||!1}},{key:"calc",value:function(){var t=this;Wt(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"calc",this).call(this);var e=this.state;this.radius=this.height>this.width?this.center.x:this.center.y;var i=this.radius,s=this.clockWise,a=e.slicesProperties||[];e.sliceStrings=[],e.slicesProperties=[];var r=180-this.config.startAngle;e.sliceTotals.map((function(n,o){var l=r,c=n/e.grandTotal*360,u=c>180?1:0,d=s?-c:c,h=r+=d,f=p(l,i),g=p(h,i),m=t.init&&a[o],v=void 0,y=void 0;t.init?(v=m?m.startPosition:f,y=m?m.endPosition:f):(v=f,y=g);var b=360===c?D(v,y,t.center,t.radius,s,u):N(v,y,t.center,t.radius,s,u);e.sliceStrings.push(b),e.slicesProperties.push({startPosition:f,endPosition:g,value:n,total:e.grandTotal,startAngle:l,endAngle:h,angle:d})})),this.init=0}},{key:"setupComponents",value:function(){var t=this.state,e=[["pieSlices",{},function(){return{sliceStrings:t.sliceStrings,colors:this.colors}}.bind(this)]];this.components=new Map(e.map((function(t){var e=$t.apply(void 0,Yt(t));return[t[0],e]})))}},{key:"calTranslateByAngle",value:function(t){var e=this.radius,n=this.hoverRadio,i=p(t.startAngle+t.angle/2,e);return"translate3d("+i.x*n+"px,"+i.y*n+"px,0)"}},{key:"hoverSlice",value:function(t,n,i,s){if(t){var a=this.colors[n];if(i){ot(t,this.calTranslateByAngle(this.state.slicesProperties[n])),t.style.fill=k(a,50);var r=e(this.svg),o=s.pageX-r.left+10,l=s.pageY-r.top-10,c=(this.formatted_labels&&this.formatted_labels.length>0?this.formatted_labels[n]:this.state.labels[n])+": ",u=(100*this.state.sliceTotals[n]/this.state.grandTotal).toFixed(1);this.tip.setValues(o,l,{name:c,value:u+"%"}),this.tip.showTip()}else ot(t,"translate3d(0,0,0)"),this.tip.hideTip(),t.style.fill=a}}},{key:"bindTooltip",value:function(){this.container.addEventListener("mousemove",this.mouseMove),this.container.addEventListener("mouseleave",this.mouseLeave)}},{key:"mouseMove",value:function(t){var e=t.target,n=this.components.get("pieSlices").store,i=this.curActiveSliceIndex,s=this.curActiveSlice;if(n.includes(e)){var a=n.indexOf(e);this.hoverSlice(s,i,!1),this.curActiveSlice=e,this.curActiveSliceIndex=a,this.hoverSlice(e,a,!0,t)}else this.mouseLeave()}},{key:"mouseLeave",value:function(){this.hoverSlice(this.curActiveSlice,this.curActiveSliceIndex,!1)}}]),n}(ye),Te=function(t){function e(t,n){Jt(this,e);var i=It(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));i.type="heatmap",i.countLabel=n.countLabel||"";var s=["Sunday","Monday"],a=s.includes(n.startSubDomain)?n.startSubDomain:"Sunday";return i.startSubDomainIndex=s.indexOf(a),i.setup(),i}return Rt(e,t),Ft(e,[{key:"setMeasures",value:function(t){var e=this.measures;this.discreteDomains=0===t.discreteDomains?0:1,e.paddings.top=36,e.paddings.bottom=0,e.legendHeight=24,e.baseHeight=12*be+l(e);var n=this.data,i=this.discreteDomains?12:0;this.independentWidth=12*(gt(n.start,n.end)+i)+c(e)}},{key:"updateWidth",value:function(){var t=this.discreteDomains?12:0,e=this.state.noOfWeeks?this.state.noOfWeeks:52;this.baseWidth=12*(e+t)+c(this.measures)}},{key:"prepareData",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.data;if(t.start&&t.end&&t.start>t.end)throw new Error("Start date cannot be greater than end date.");if(t.start||(t.start=new Date,t.start.setFullYear(t.start.getFullYear()-1)),t.end||(t.end=new Date),t.dataPoints=t.dataPoints||{},parseInt(Object.keys(t.dataPoints)[0])>1e5){var e={};Object.keys(t.dataPoints).forEach((function(n){var i=new Date(n*xe);e[pt(i)]=t.dataPoints[n]})),t.dataPoints=e}return t}},{key:"calc",value:function(){var t=this.state;t.start=ft(this.data.start),t.end=ft(this.data.end),t.firstWeekStart=ft(t.start),t.noOfWeeks=gt(t.start,t.end),t.distribution=_t(Object.values(this.data.dataPoints),5),t.domainConfigs=this.getDomains()}},{key:"setupComponents",value:function(){var t=this,e=this.state,n=this.discreteDomains?0:1,i=e.domainConfigs.map((function(i,s){return["heatDomain",{index:i.index,colWidth:12,rowHeight:12,squareSize:10,radius:t.rawChartArgs.radius||0,xTranslate:12*e.domainConfigs.filter((function(t,e){return e1&&void 0!==arguments[1]?arguments[1]:"",n=[t.getMonth(),t.getFullYear()],i=n[0],s=n[1],a=xt(t),r={index:i,cols:[]};wt(e=ft(e)||bt(i,s),1);for(var o=gt(a,e),l=[],c=void 0,u=0;u2&&void 0!==arguments[2]&&arguments[2],i=this.state,s=ft(t),a=[],r=0;r=i.start&&s<=i.end;n||s.getMonth()!==e||!l?o.yyyyMmDd=pt(s):o=this.getSubDomainConfig(s),a.push(o)}return a}},{key:"getSubDomainConfig",value:function(t){var e=pt(t),n=this.data.dataPoints[e];return{yyyyMmDd:e,dataValue:n||0,fill:this.colors[Nt(n,this.state.distribution)]}}}]),e}(ve),Me=function(t){function n(t,e){Jt(this,n);var i=It(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,t,e));return i.barOptions=e.barOptions||{},i.lineOptions=e.lineOptions||{},i.type=e.type||"line",i.init=1,i.setup(),i}return Rt(n,t),Ft(n,[{key:"setMeasures",value:function(){this.data.datasets.length<=1&&(this.config.showLegend=0,this.measures.paddings.bottom=30)}},{key:"configure",value:function(t){Wt(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"configure",this).call(this,t),t.axisOptions=t.axisOptions||{},t.tooltipOptions=t.tooltipOptions||{},this.config.xAxisMode=t.axisOptions.xAxisMode||"span",this.config.yAxisMode=t.axisOptions.yAxisMode||"span",this.config.xIsSeries=t.axisOptions.xIsSeries||0,this.config.shortenYAxisNumbers=t.axisOptions.shortenYAxisNumbers||0,this.config.formatTooltipX=t.tooltipOptions.formatTooltipX,this.config.formatTooltipY=t.tooltipOptions.formatTooltipY,this.config.valuesOverPoints=t.valuesOverPoints}},{key:"prepareData",value:function(){return Dt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.data,this.type)}},{key:"prepareFirstData",value:function(){return Et(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.data)}},{key:"calc",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.calcXPositions(),t||this.calcYAxisParameters(this.getAllYValues(),"line"===this.type),this.makeDataByIndex()}},{key:"calcXPositions",value:function(){var t=this.state,e=this.data.labels;t.datasetLength=e.length,t.unitWidth=this.width/t.datasetLength,t.xOffset=t.unitWidth/2,t.xAxis={labels:e,positions:e.map((function(e,n){return u(t.xOffset+n*t.unitWidth)}))}}},{key:"calcYAxisParameters",value:function(t){var e=Pt(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"false"),n=this.height/Mt(e),i=Tt(e)*n,s=this.height-St(e)*i;this.state.yAxis={labels:e,positions:e.map((function(t){return s-t*n})),scaleMultiplier:n,zeroLine:s},this.calcDatasetPoints(),this.calcYExtremes(),this.calcYRegions()}},{key:"calcDatasetPoints",value:function(){var t=this.state,e=function(e){return e.map((function(e){return Lt(e,t.yAxis)}))};t.datasets=this.data.datasets.map((function(t,n){var i=t.values,s=t.cumulativeYs||[];return{name:t.name&&t.name.replace(/<|>|&/g,(function(t){return"&"==t?"&":"<"==t?"<":">"})),index:n,chartType:t.chartType,values:i,yPositions:e(i),cumulativeYs:s,cumulativeYPos:e(s)}}))}},{key:"calcYExtremes",value:function(){var t=this.state;this.barOptions.stacked?t.yExtremes=t.datasets[t.datasets.length-1].cumulativeYPos:(t.yExtremes=new Array(t.datasetLength).fill(9999),t.datasets.map((function(e){e.yPositions.map((function(e,n){er(i)?t.mapTooltipXPosition(a):t.tip.hideTip()}))}},{key:"mapTooltipXPosition",value:function(t){var e=this.state;if(e.yExtremes){var n=Ct(t,e.xAxis.positions,!0);if(n>=0){var i=this.dataByIndex[n];this.tip.setValues(i.xPos+this.tip.offset.x,i.yExtreme+this.tip.offset.y,{name:i.formattedLabel,value:""},i.values,n),this.tip.showTip()}}}},{key:"renderLegend",value:function(){var t=this,e=this.data;e.datasets.length>1&&(this.legendArea.textContent="",e.datasets.map((function(e,n){var i=F(100*n,"0",100,t.colors[n],e.name,t.config.truncateLegends);t.legendArea.appendChild(i)})))}},{key:"makeOverlay",value:function(){var t=this;this.init?this.init=0:(this.overlayGuides&&this.overlayGuides.forEach((function(t){var e=t.overlay;e.parentNode.removeChild(e)})),this.overlayGuides=this.dataUnitComponents.map((function(t){return{type:t.unitType,overlay:void 0,units:t.units}})),void 0===this.state.currentIndex&&(this.state.currentIndex=this.state.datasetLength-1),this.overlayGuides.map((function(e){var n=e.units[t.state.currentIndex];e.overlay=le[e.type](n),t.drawArea.appendChild(e.overlay)})))}},{key:"updateOverlayGuides",value:function(){this.overlayGuides&&this.overlayGuides.forEach((function(t){var e=t.overlay;e.parentNode.removeChild(e)}))}},{key:"bindOverlay",value:function(){var t=this;this.parent.addEventListener("data-select",(function(){t.updateOverlay()}))}},{key:"bindUnits",value:function(){var t=this;this.dataUnitComponents.map((function(e){e.units.map((function(e){e.addEventListener("click",(function(){var n=e.getAttribute("data-point-index");t.setCurrentDataPoint(n)}))}))})),this.tip.container.addEventListener("click",(function(){var e=t.tip.container.getAttribute("data-point-index");t.setCurrentDataPoint(e)}))}},{key:"updateOverlay",value:function(){var t=this;this.overlayGuides.map((function(e){var n=e.units[t.state.currentIndex];ce[e.type](n,e.overlay)}))}},{key:"onLeftArrow",value:function(){this.setCurrentDataPoint(this.state.currentIndex-1)}},{key:"onRightArrow",value:function(){this.setCurrentDataPoint(this.state.currentIndex+1)}},{key:"getDataPoint",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state.currentIndex,e=this.state;return{index:t,label:e.xAxis.labels[t],values:e.datasets.map((function(e){return e.values[t]}))}}},{key:"setCurrentDataPoint",value:function(t){var e=this.state;(t=parseInt(t))<0&&(t=0),t>=e.xAxis.labels.length&&(t=e.xAxis.labels.length-1),t!==e.currentIndex&&(e.currentIndex=t,a(this.parent,"data-select",this.getDataPoint()))}},{key:"addDataPoint",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.state.datasetLength;Wt(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"addDataPoint",this).call(this,t,e,i),this.data.labels.splice(i,0,t),this.data.datasets.map((function(t,n){t.values.splice(i,0,e[n])})),this.update(this.data)}},{key:"removeDataPoint",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state.datasetLength-1;this.data.labels.length<=1||(Wt(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"removeDataPoint",this).call(this,t),this.data.labels.splice(t,1),this.data.datasets.map((function(e){e.values.splice(t,1)})),this.update(this.data))}},{key:"updateDataset",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.data.datasets[e].values=t,this.update(this.data)}},{key:"updateDatasets",value:function(t){this.data.datasets.map((function(e,n){t[n]&&(e.values=t[n])})),this.update(this.data)}}]),n}(ve),Le=function(t){function n(t,e){Jt(this,n);var i=It(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,t,e));return i.type="donut",i.initTimeout=0,i.init=1,i.setup(),i}return Rt(n,t),Ft(n,[{key:"configure",value:function(t){Wt(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"configure",this).call(this,t),this.mouseMove=this.mouseMove.bind(this),this.mouseLeave=this.mouseLeave.bind(this),this.hoverRadio=t.hoverRadio||.1,this.config.startAngle=t.startAngle||0,this.clockWise=t.clockWise||!1,this.strokeWidth=t.strokeWidth||30}},{key:"calc",value:function(){var t=this;Wt(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"calc",this).call(this);var e=this.state;this.radius=this.height>this.width?this.center.x-this.strokeWidth/2:this.center.y-this.strokeWidth/2;var i=this.radius,s=this.clockWise,a=e.slicesProperties||[];e.sliceStrings=[],e.slicesProperties=[];var r=180-this.config.startAngle;e.sliceTotals.map((function(n,o){var l=r,c=n/e.grandTotal*360,u=c>180?1:0,d=s?-c:c,h=r+=d,f=p(l,i),g=p(h,i),m=t.init&&a[o],v=void 0,y=void 0;t.init?(v=m?m.startPosition:f,y=m?m.endPosition:f):(v=f,y=g);var b=360===c?z(v,y,t.center,t.radius,t.clockWise,u):E(v,y,t.center,t.radius,t.clockWise,u);e.sliceStrings.push(b),e.slicesProperties.push({startPosition:f,endPosition:g,value:n,total:e.grandTotal,startAngle:l,endAngle:h,angle:d})})),this.init=0}},{key:"setupComponents",value:function(){var t=this.state,e=[["donutSlices",{},function(){return{sliceStrings:t.sliceStrings,colors:this.colors,strokeWidth:this.strokeWidth}}.bind(this)]];this.components=new Map(e.map((function(t){var e=$t.apply(void 0,Yt(t));return[t[0],e]})))}},{key:"calTranslateByAngle",value:function(t){var e=this.radius,n=this.hoverRadio,i=p(t.startAngle+t.angle/2,e);return"translate3d("+i.x*n+"px,"+i.y*n+"px,0)"}},{key:"hoverSlice",value:function(t,n,i,s){if(t){var a=this.colors[n];if(i){ot(t,this.calTranslateByAngle(this.state.slicesProperties[n])),t.style.stroke=k(a,50);var r=e(this.svg),o=s.pageX-r.left+10,l=s.pageY-r.top-10,c=(this.formatted_labels&&this.formatted_labels.length>0?this.formatted_labels[n]:this.state.labels[n])+": ",u=(100*this.state.sliceTotals[n]/this.state.grandTotal).toFixed(1);this.tip.setValues(o,l,{name:c,value:u+"%"}),this.tip.showTip()}else ot(t,"translate3d(0,0,0)"),this.tip.hideTip(),t.style.stroke=a}}},{key:"bindTooltip",value:function(){this.container.addEventListener("mousemove",this.mouseMove),this.container.addEventListener("mouseleave",this.mouseLeave)}},{key:"mouseMove",value:function(t){var e=t.target,n=this.components.get("donutSlices").store,i=this.curActiveSliceIndex,s=this.curActiveSlice;if(n.includes(e)){var a=n.indexOf(e);this.hoverSlice(s,i,!1),this.curActiveSlice=e,this.curActiveSliceIndex=a,this.hoverSlice(e,a,!0,t)}else this.mouseLeave()}},{key:"mouseLeave",value:function(){this.hoverSlice(this.curActiveSlice,this.curActiveSliceIndex,!1)}}]),n}(ye),Ce={bar:Me,line:Me,percentage:Pe,heatmap:Te,pie:Se,donut:Le},_e=function t(e,n){return Jt(this,t),Ht(n.type,e,n)},Ne=Object.freeze({Chart:_e,PercentageChart:Pe,PieChart:Se,Heatmap:Te,AxisChart:Me}),De={NAME:"Frappe Charts",VERSION:"1.6.2"};return Object.assign({},De,Ne)}()}(We={exports:{}},We.exports),We.exports);function Ie(e){let n,i,s;return{c(){n=m("div")},m(t,a){p(t,n,a),e[18](n),i||(s=w(n,"data-select",e[17]),i=!0)},p:t,i:t,o:t,d(t){t&&f(n),e[18](null),i=!1,s()}}}function Be(t,e,n){let i,{data:s={labels:[],datasets:[{values:[]}],yMarkers:{},yRegions:[]}}=e,{title:a=""}=e,{type:r="line"}=e,{height:o=300}=e,{animate:l=!0}=e,{axisOptions:c={}}=e,{barOptions:u={}}=e,{lineOptions:d={}}=e,{tooltipOptions:h={}}=e,{colors:p=[]}=e,{valuesOverPoints:f=0}=e,{isNavigable:g=!1}=e,{maxSlices:m=3}=e,v=null;function y(t){return function(...e){if(v)return t(...e)}}const b=y(((t,e,n)=>v.addDataPoint(t,e,n))),x=y((t=>v.removeDataPoint(t))),w=y((()=>v.export())),$=y((t=>v.update(t)));return C((()=>{v=new Re.Chart(i,{data:s,title:a,type:r,height:o,animate:l,colors:p,axisOptions:c,barOptions:u,lineOptions:d,tooltipOptions:h,valuesOverPoints:f,isNavigable:g,maxSlices:m})})),function(t){L().$$.on_destroy.push(t)}((()=>{v=null})),t.$$set=t=>{"data"in t&&n(1,s=t.data),"title"in t&&n(2,a=t.title),"type"in t&&n(3,r=t.type),"height"in t&&n(4,o=t.height),"animate"in t&&n(5,l=t.animate),"axisOptions"in t&&n(6,c=t.axisOptions),"barOptions"in t&&n(7,u=t.barOptions),"lineOptions"in t&&n(8,d=t.lineOptions),"tooltipOptions"in t&&n(9,h=t.tooltipOptions),"colors"in t&&n(10,p=t.colors),"valuesOverPoints"in t&&n(11,f=t.valuesOverPoints),"isNavigable"in t&&n(12,g=t.isNavigable),"maxSlices"in t&&n(13,m=t.maxSlices)},t.$$.update=()=>{2&t.$$.dirty&&$(s)},[i,s,a,r,o,l,c,u,d,h,p,f,g,m,b,x,w,function(e){N.call(this,t,e)},function(t){E[t?"unshift":"push"]((()=>{i=t,n(0,i)}))}]}var Ye=class extends at{constructor(t){super(),st(this,t,Be,Ie,a,{data:1,title:2,type:3,height:4,animate:5,axisOptions:6,barOptions:7,lineOptions:8,tooltipOptions:9,colors:10,valuesOverPoints:11,isNavigable:12,maxSlices:13,addDataPoint:14,removeDataPoint:15,exportChart:16})}get addDataPoint(){return this.$$.ctx[14]}get removeDataPoint(){return this.$$.ctx[15]}get exportChart(){return this.$$.ctx[16]}};function qe(e){let n,i,s;return{c(){n=m("button"),n.textContent="Проверить",$(n,"class","btn-lg")},m(t,a){p(t,n,a),i||(s=w(n,"click",e[3]),i=!0)},p:t,d(t){t&&f(n),i=!1,s()}}}function Ue(e){let n,i;return n=new Ye({props:{data:e[0],type:"line"}}),{c(){et(n.$$.fragment)},m(t,e){nt(n,t,e),i=!0},p:t,i(t){i||(Z(n.$$.fragment,t),i=!0)},o(t){Q(n.$$.fragment,t),i=!1},d(t){it(n,t)}}}function Ve(t){let e,n,i,s;return e=new Lt({props:{$$slots:{default:[qe]},$$scope:{ctx:t}}}),i=new Lt({props:{$$slots:{default:[Ue]},$$scope:{ctx:t}}}),{c(){et(e.$$.fragment),n=b(),et(i.$$.fragment)},m(t,a){nt(e,t,a),p(t,n,a),nt(i,t,a),s=!0},p(t,[n]){const s={};64&n&&(s.$$scope={dirty:n,ctx:t}),e.$set(s);const a={};64&n&&(a.$$scope={dirty:n,ctx:t}),i.$set(a)},i(t){s||(Z(e.$$.fragment,t),Z(i.$$.fragment,t),s=!0)},o(t){Q(e.$$.fragment,t),Q(i.$$.fragment,t),s=!1},d(t){it(e,t),t&&f(n),it(i,t)}}}function Ge(t){let e=[{ID:"1",description:"lorem"},{ID:"2",description:"impsum"}],n=[{ID:"2",description:"dolor"},{ID:"4",description:"enum"}];return[{labels:["Sun","Mon","Tues","Wed","Thurs","Fri","Sat"],datasets:[{values:[10,12,3,9,8,15,9]}]},e,n,()=>function(t,e){var n=new Set(t.map((t=>t.ID)));let i=[...t,...e.filter((t=>!n.has(t.ID)))];console.log(i)}(e,n)]}class Xe extends at{constructor(t){super(),st(this,t,Ge,Ve,a,{})}}function Ke(t,e,n){const i=t.slice();return i[1]=e[n],i[3]=n,i}function Ze(t){let e,n,i,s=t[1].msg+"";return{c(){e=m("div"),n=y(s),$(e,"class",i=t[1].msg.toString().includes("[E]")?"text-red-500":"text-black")},m(t,i){p(t,e,i),h(e,n)},p(t,a){1&a&&s!==(s=t[1].msg+"")&&O(n,s),1&a&&i!==(i=t[1].msg.toString().includes("[E]")?"text-red-500":"text-black")&&$(e,"class",i)},d(t){t&&f(e)}}}function Qe(t){let e,n=t[0],i=[];for(let e=0;e{"coreMessages"in t&&n(0,i=t.coreMessages)},[i]}class nn extends at{constructor(t){super(),st(this,t,en,tn,a,{coreMessages:0})}}function sn(t,e,n){const i=t.slice();return i[10]=e[n],i[12]=n,i}function an(t){let e,n,i,s,a,r,o,l,c,u,d,g,v,x,w,k,A,P,S,T=t[10].name+"",M=t[10].ip+"",L=t[10].id+"",C=t[10].status?"online":"offline";return P=new pe({props:{i:t[12],click:t[5]}}),{c(){e=m("tr"),n=m("td"),i=y(T),s=b(),a=m("td"),r=m("a"),o=y(M),c=b(),u=m("td"),d=y(L),g=b(),v=m("td"),x=y(C),k=b(),A=m("td"),et(P.$$.fragment),$(n,"class","tbl-bdy-lg ipt-lg w-full"),$(r,"href",l="http://"+t[10].ip),$(a,"class","tbl-bdy-lg ipt-lg w-full"),$(u,"class","tbl-bdy-lg ipt-lg w-full"),$(v,"class",w="tbl-bdy-lg ipt-lg w-full "+(t[10].status?"bg-green-50":"bg-red-50")),$(A,"class","tbl-bdy-lg"),$(e,"class","txt-sz txt-pad")},m(t,l){p(t,e,l),h(e,n),h(n,i),h(e,s),h(e,a),h(a,r),h(r,o),h(e,c),h(e,u),h(u,d),h(e,g),h(e,v),h(v,x),h(e,k),h(e,A),nt(P,A,null),S=!0},p(t,e){(!S||1&e)&&T!==(T=t[10].name+"")&&O(i,T),(!S||1&e)&&M!==(M=t[10].ip+"")&&O(o,M),(!S||1&e&&l!==(l="http://"+t[10].ip))&&$(r,"href",l),(!S||1&e)&&L!==(L=t[10].id+"")&&O(d,L),(!S||1&e)&&C!==(C=t[10].status?"online":"offline")&&O(x,C),(!S||1&e&&w!==(w="tbl-bdy-lg ipt-lg w-full "+(t[10].status?"bg-green-50":"bg-red-50")))&&$(v,"class",w)},i(t){S||(Z(P.$$.fragment,t),S=!0)},o(t){Q(P.$$.fragment,t),S=!1},d(t){t&&f(e),it(P)}}}function rn(t){let e,n,s,a,r,o,l,c,u,d,g,v,y;return{c(){e=m("tr"),n=m("td"),s=m("input"),a=b(),r=m("td"),o=m("input"),l=b(),c=m("td"),u=m("input"),d=b(),g=m("td"),$(s,"class","ipt-lg w-full"),$(s,"type","text"),$(n,"class","tbl-bdy-lg"),$(o,"class","ipt-lg w-full"),$(o,"type","text"),$(r,"class","tbl-bdy-lg"),$(u,"class","ipt-lg w-full"),$(u,"type","text"),$(c,"class","tbl-bdy-lg"),$(g,"class","tbl-bdy-lg"),$(e,"class","txt-sz txt-pad")},m(i,f){p(i,e,f),h(e,n),h(n,s),A(s,t[2].name),h(e,a),h(e,r),h(r,o),A(o,t[2].ip),h(e,l),h(e,c),h(c,u),A(u,t[2].id),h(e,d),h(e,g),v||(y=[w(s,"input",t[6]),w(o,"input",t[7]),w(u,"input",t[8])],v=!0)},p(t,e){4&e&&s.value!==t[2].name&&A(s,t[2].name),4&e&&o.value!==t[2].ip&&A(o,t[2].ip),4&e&&u.value!==t[2].id&&A(u,t[2].id)},d(t){t&&f(e),v=!1,i(y)}}}function on(t){let e,n,i,s,a,r,o,l,c,u,d,v=t[1]?"Сохранить":"Добавить устройство",x=t[0],k=[];for(let e=0;eQ(k[t],1,1,(()=>{k[t]=null}));let P=t[1]&&rn(t);return{c(){e=m("table"),n=m("thead"),n.innerHTML='| Название устройства | \n IP адрес | \n Идентификатор | \n Состояние | \n |
',i=b(),s=m("tbody");for(let t=0;t{})}=e;function o(t){for(let e=0;e{"deviceList"in t&&n(0,i=t.deviceList),"showInput"in t&&n(1,s=t.showInput),"newDevice"in t&&n(2,a=t.newDevice),"devListSave"in t&&n(3,r=t.devListSave)},[i,s,a,r,o,t=>o(t),function(){a.name=this.value,n(2,a)},function(){a.ip=this.value,n(2,a)},function(){a.id=this.value,n(2,a)},()=>(n(1,s=!s),r())]}class dn extends at{constructor(t){super(),st(this,t,un,cn,a,{deviceList:0,showInput:1,newDevice:2,devListSave:3})}}function hn(t){let e,n,i,a;return{c(){e=m("textarea"),$(e,"rows","10"),$(e,"class","ipt-big w-full"),$(e,"id","text1"),e.value=n=t[3](JSON.stringify(t[1]))},m(n,r){p(n,e,r),i||(a=w(e,"input",(function(){s(t[0])&&t[0].apply(this,arguments)})),i=!0)},p(i,s){t=i,10&s&&n!==(n=t[3](JSON.stringify(t[1])))&&(e.value=n)},d(t){t&&f(e),i=!1,a()}}}function pn(t){let e,n,i,s,a,r;return i=new jt({props:{title:"Редактор JSON",$$slots:{default:[hn]},$$scope:{ctx:t}}}),{c(){e=m("button"),e.textContent="Toggle modal",n=b(),et(i.$$.fragment),$(e,"type","button")},m(o,l){p(o,e,l),p(o,n,l),nt(i,o,l),s=!0,a||(r=w(e,"click",t[4]),a=!0)},p(t,[e]){const n={};43&e&&(n.$$scope={dirty:e,ctx:t}),i.$set(n)},i(t){s||(Z(i.$$.fragment,t),s=!0)},o(t){Q(i.$$.fragment,t),s=!1},d(t){t&&f(e),t&&f(n),it(i,t),a=!1,r()}}}function fn(t,e,n){let{wigetsUpdate:i}=e,{layoutJson:s}=e,{showModal:a=(()=>{})}=e,{syntaxHighlight:r=(t=>{})}=e;return t.$$set=t=>{"wigetsUpdate"in t&&n(0,i=t.wigetsUpdate),"layoutJson"in t&&n(1,s=t.layoutJson),"showModal"in t&&n(2,a=t.showModal),"syntaxHighlight"in t&&n(3,r=t.syntaxHighlight)},[i,s,a,r,()=>a()]}class gn extends at{constructor(t){super(),st(this,t,fn,pn,a,{wigetsUpdate:0,layoutJson:1,showModal:2,syntaxHighlight:3})}}function mn(e){let n,i,s,a;return{c(){n=v("svg"),i=v("path"),s=v("path"),$(i,"stroke","none"),$(i,"d","M0 0h24v24H0z"),$(s,"d","M7 18a4.6 4.4 0 0 1 0 -9h0a5 4.5 0 0 1 11 2h1a3.5 3.5 0 0 1 0 7h-12"),$(n,"class",a="h-8 w-8 "+e[0]),$(n,"width","24"),$(n,"height","24"),$(n,"viewBox","0 0 24 24"),$(n,"stroke-width","2"),$(n,"stroke","currentColor"),$(n,"fill","none"),$(n,"stroke-linecap","round"),$(n,"stroke-linejoin","round")},m(t,e){p(t,n,e),h(n,i),h(n,s)},p(t,[e]){1&e&&a!==(a="h-8 w-8 "+t[0])&&$(n,"class",a)},i:t,o:t,d(t){t&&f(n)}}}function vn(t,e,n){let{color:i}=e;return t.$$set=t=>{"color"in t&&n(0,i=t.color)},[i]}class yn extends at{constructor(t){super(),st(this,t,vn,mn,a,{color:0})}}function bn(t,e,n){const i=t.slice();return i[85]=e[n],i}function xn(t){let e,n,i,s,a=t[85].name+"";return{c(){e=m("option"),n=y(a),i=b(),e.__value=s=t[85].ws,e.value=e.__value},m(t,s){p(t,e,s),h(e,n),h(e,i)},p(t,i){16384&i[0]&&a!==(a=t[85].name+"")&&O(n,a),16384&i[0]&&s!==(s=t[85].ws)&&(e.__value=s,e.value=e.__value)},d(t){t&&f(e)}}}function wn(t){let e,n,i,s,a,r,o,l,c,u,d,h;return e=new Pt({props:{path:"/",$$slots:{default:[kn]},$$scope:{ctx:t}}}),i=new Pt({props:{path:"/config",$$slots:{default:[On]},$$scope:{ctx:t}}}),a=new Pt({props:{path:"/connection",$$slots:{default:[An]},$$scope:{ctx:t}}}),o=new Pt({props:{path:"/utilities",$$slots:{default:[Pn]},$$scope:{ctx:t}}}),c=new Pt({props:{path:"/log",$$slots:{default:[Sn]},$$scope:{ctx:t}}}),d=new Pt({props:{path:"/about",$$slots:{default:[Tn]},$$scope:{ctx:t}}}),{c(){et(e.$$.fragment),n=b(),et(i.$$.fragment),s=b(),et(a.$$.fragment),r=b(),et(o.$$.fragment),l=b(),et(c.$$.fragment),u=b(),et(d.$$.fragment)},m(t,f){nt(e,t,f),p(t,n,f),nt(i,t,f),p(t,s,f),nt(a,t,f),p(t,r,f),nt(o,t,f),p(t,l,f),nt(c,t,f),p(t,u,f),nt(d,t,f),h=!0},p(t,n){const s={};136&n[0]|67108864&n[2]&&(s.$$scope={dirty:n,ctx:t}),e.$set(s);const r={};112&n[0]|67108864&n[2]&&(r.$$scope={dirty:n,ctx:t}),i.$set(r);const l={};768&n[0]|67108864&n[2]&&(l.$$scope={dirty:n,ctx:t}),a.$set(l);const u={};67108864&n[2]&&(u.$$scope={dirty:n,ctx:t}),o.$set(u);const h={};8192&n[0]|67108864&n[2]&&(h.$$scope={dirty:n,ctx:t}),c.$set(h);const p={};128&n[0]|67108864&n[2]&&(p.$$scope={dirty:n,ctx:t}),d.$set(p)},i(t){h||(Z(e.$$.fragment,t),Z(i.$$.fragment,t),Z(a.$$.fragment,t),Z(o.$$.fragment,t),Z(c.$$.fragment,t),Z(d.$$.fragment,t),h=!0)},o(t){Q(e.$$.fragment,t),Q(i.$$.fragment,t),Q(a.$$.fragment,t),Q(o.$$.fragment,t),Q(c.$$.fragment,t),Q(d.$$.fragment,t),h=!1},d(t){it(e,t),t&&f(n),it(i,t),t&&f(s),it(a,t),t&&f(r),it(o,t),t&&f(l),it(c,t),t&&f(u),it(d,t)}}}function $n(e){let n,i;return n=new Lt({props:{title:"Нет соединения"}}),{c(){et(n.$$.fragment)},m(t,e){nt(n,t,e),i=!0},p:t,i(t){i||(Z(n.$$.fragment,t),i=!0)},o(t){Q(n.$$.fragment,t),i=!1},d(t){it(n,t)}}}function kn(t){let e,n;return e=new ue({props:{layoutJson:t[7],pages:t[3],wsPush:t[29]}}),{c(){et(e.$$.fragment)},m(t,i){nt(e,t,i),n=!0},p(t,n){const i={};128&n[0]&&(i.layoutJson=t[7]),8&n[0]&&(i.pages=t[3]),e.$set(i)},i(t){n||(Z(e.$$.fragment,t),n=!0)},o(t){Q(e.$$.fragment,t),n=!1},d(t){it(e,t)}}}function On(t){let e,n;return e=new _e({props:{configJson:t[4],widgetsJson:t[5],itemsJson:t[6],saveConfig:t[30]}}),{c(){et(e.$$.fragment)},m(t,i){nt(e,t,i),n=!0},p(t,n){const i={};16&n[0]&&(i.configJson=t[4]),32&n[0]&&(i.widgetsJson=t[5]),64&n[0]&&(i.itemsJson=t[6]),e.$set(i)},i(t){n||(Z(e.$$.fragment,t),n=!0)},o(t){Q(e.$$.fragment,t),n=!1},d(t){it(e,t)}}}function An(t){let e,n;return e=new Fe({props:{settingsJson:t[8],ssidJson:t[9],ssidDropdownClick:t[31],saveSettings:t[32]}}),{c(){et(e.$$.fragment)},m(t,i){nt(e,t,i),n=!0},p(t,n){const i={};256&n[0]&&(i.settingsJson=t[8]),512&n[0]&&(i.ssidJson=t[9]),e.$set(i)},i(t){n||(Z(e.$$.fragment,t),n=!0)},o(t){Q(e.$$.fragment,t),n=!1},d(t){it(e,t)}}}function Pn(t){let e,n;return e=new Xe({}),{c(){et(e.$$.fragment)},m(t,i){nt(e,t,i),n=!0},i(t){n||(Z(e.$$.fragment,t),n=!0)},o(t){Q(e.$$.fragment,t),n=!1},d(t){it(e,t)}}}function Sn(t){let e,n;return e=new nn({props:{coreMessages:t[13]}}),{c(){et(e.$$.fragment)},m(t,i){nt(e,t,i),n=!0},p(t,n){const i={};8192&n[0]&&(i.coreMessages=t[13]),e.$set(i)},i(t){n||(Z(e.$$.fragment,t),n=!0)},o(t){Q(e.$$.fragment,t),n=!1},d(t){it(e,t)}}}function Tn(t){let e,n;return e=new gn({props:{wigetsUpdate:t[18],layoutJson:t[7],showModal:t[33],syntaxHighlight:t[34]}}),{c(){et(e.$$.fragment)},m(t,i){nt(e,t,i),n=!0},p(t,n){const i={};128&n[0]&&(i.layoutJson=t[7]),e.$set(i)},i(t){n||(Z(e.$$.fragment,t),n=!0)},o(t){Q(e.$$.fragment,t),n=!1},d(t){it(e,t)}}}function Mn(t){let e,n;return e=new dn({props:{deviceList:t[14],showInput:Cn,devListSave:t[35],newDevice:t[12]}}),{c(){et(e.$$.fragment)},m(t,i){nt(e,t,i),n=!0},p(t,n){const i={};16384&n[0]&&(i.deviceList=t[14]),4096&n[0]&&(i.newDevice=t[12]),e.$set(i)},i(t){n||(Z(e.$$.fragment,t),n=!0)},o(t){Q(e.$$.fragment,t),n=!1},d(t){it(e,t)}}}function Ln(t){let e,n,s,a,r,o,l,c,u,d,v,y,x,k,O,A,S,T,M,L,C,_,N,D,E,z,H,j,J,F,W,I,B,Y,q,U,V,G,tt,st,at,rt,ot,lt,ct,ut,dt,ht,pt,ft,gt;n=new Dt({props:{show:t[2]}});let mt=t[14],vt=[];for(let e=0;e",A=b(),S=m("ul"),T=m("li"),M=m("a"),M.textContent="Управление",L=b(),C=m("li"),_=m("a"),_.textContent="Конфигуратор",N=b(),D=m("li"),E=m("a"),E.textContent="Подключение",z=b(),H=m("li"),j=m("a"),j.textContent="Утилиты",J=b(),F=m("li"),W=m("a"),W.textContent="Лог",I=b(),B=m("li"),Y=m("a"),Y.textContent="Устройства",q=b(),U=m("li"),V=m("a"),V.textContent="О проекте",G=b(),tt=m("main"),st=m("ul"),at=m("div"),ot.c(),lt=b(),et(ct.$$.fragment),dt=b(),ht=m("footer"),ht.innerHTML='Developed by Dmitry Borisenko
',$(l,"class","border border-indigo-500 border-4"),void 0===t[11]&&R((()=>t[25].call(l))),$(o,"class","px-15 py-1 z-50 "),$(u,"class","pl-4 pr-4 py-1"),$(r,"class","flex content-center items-center justify-end"),$(a,"class","h-10 w-full bg-gray-100 overflow-auto shadow-md"),$(x,"id","menu__toggle"),$(x,"type","checkbox"),$(O,"class","menu__btn"),$(O,"for","menu__toggle"),$(M,"class","menu__item"),$(M,"href","/"),$(_,"class","menu__item"),$(_,"href","/config"),$(E,"class","menu__item"),$(E,"href","/connection"),$(j,"class","menu__item"),$(j,"href","/utilities"),$(W,"class","menu__item"),$(W,"href","/log"),$(Y,"class","menu__item"),$(Y,"href","/list"),$(V,"class","menu__item"),$(V,"href","/about"),$(S,"class","menu__box"),$(y,"class","flex"),$(at,"class","bg-cover pt-0 px-4"),$(st,"class","menu__main"),$(tt,"class",ut="flex-1 overflow-y-auto p-0 "+(!0!==t[0]||t[1]?"ml-0":"ml-36")),$(ht,"class","h-4 bg-gray-100 border-gray-200 shadow-lg"),$(e,"class","flex flex-col h-screen bg-gray-50")},m(i,f){p(i,e,f),nt(n,e,null),h(e,s),h(e,a),h(a,r),h(r,o),h(o,l);for(let t=0;t{bt[a]=null})),K(),ot=bt[rt],ot?ot.p(t,e):(ot=bt[rt]=yt[rt](t),ot.c()),Z(ot,1),ot.m(at,lt));const r={};20480&e[0]|67108864&e[2]&&(r.$$scope={dirty:e,ctx:t}),ct.$set(r),(!pt||3&e[0]&&ut!==(ut="flex-1 overflow-y-auto p-0 "+(!0!==t[0]||t[1]?"ml-0":"ml-36")))&&$(tt,"class",ut)},i(t){pt||(Z(n.$$.fragment,t),Z(d.$$.fragment,t),Z(ot),Z(ct.$$.fragment,t),pt=!0)},o(t){Q(n.$$.fragment,t),Q(d.$$.fragment,t),Q(ot),Q(ct.$$.fragment,t),pt=!1},d(t){t&&f(e),it(n),g(vt,t),it(d),bt[rt].d(),it(ct),ft=!1,i(gt)}}}let Cn=!1;function _n(t,e,n){let i;r(t,bt,(t=>n(56,i=t))),bt.mode.hash();let s,a=!1,o=!1,l=document.location.hostname,c=!1,u=[],d=[],h=!1,p=[],f=!1,g=[],m=!1,v=[],y=!1,b={},x=!1,w={},$=[],k=!1,O=0,A=!0,P={},T=[];T=[{name:"--",id:"--",ip:l,status:!1}];let M=[];var L=function(){this.parts=[]};let _;L.prototype.append=function(t){this.parts.push(t),this.blob=void 0},L.prototype.getBlob=function(){return this.blob||(this.blob=new Blob(this.parts,{type:"binary"})),this.blob},L.prototype.clear=function(){this.parts=[]};var N=new L,D=new L,E=new L,z=new L,H=new L;function j(){void 0!==O&&G(O,_)}function J(){tt(O);let t=0;T.forEach((e=>{e.ws=t,e.status||(W(t),I(t)),t++})),n(14,T)}function F(t,e){T.forEach((n=>{n.ws===t&&(n.status=e,n.status?console.log("[i]",n.ip,"status online"):console.log("[i]",n.ip,"status offline"))})),n(14,T),tt(O),n(10,k=s.status)}function W(t){let e=R(t);"error"===e?console.log("[e]","device list wrong"):($[t]=new WebSocket("ws://"+e+":81"),$.binaryType="blob",console.log("[i]",e,"started connecting..."))}function R(t){let e="error";return T.forEach((n=>{t===n.ws&&(e=n.ip)})),e}function I(t){if($[t]){let e=R(t);console.log("[i]",e,"web socket events added"),$[t].addEventListener("open",(function(n){console.log("[i]",e,"completed connecting"),F(t,!0),j()})),$[t].addEventListener("message",(function(t){if("string"==typeof t.data){let r=t.data;if(r.includes("status")&&it(r)){let t=JSON.parse(r);!function(t){for(let e=0;et.ip))),T=[...i,...s.filter((t=>!a.has(t.ip)))])),n(14,T),Z(),J(),console.log("[i]","incDeviceList json parced",M)),"/st/config.json"===r&&(h=!0),"/end/config.json"===r){h=!1;var e=N.getBlob();let t=new FileReader;t.readAsText(e),t.onload=()=>{let e=t.result;it(e)&&(n(4,d=JSON.parse(e)),n(4,d),console.log("[ii]","configJson parced!"))}}if("/st/widgets.json"===r&&(f=!0),"/end/widgets.json"===r){f=!1;e=D.getBlob();let t=new FileReader;t.readAsText(e),t.onload=()=>{let e=t.result;it(e)&&(n(5,p=JSON.parse(e)),n(5,p),console.log("[ii]","widgetsJson parced!"))}}if("/st/items.json"===r&&(m=!0),"/end/items.json"===r){m=!1;e=E.getBlob();let t=new FileReader;t.readAsText(e),t.onload=()=>{let e=t.result;it(e)&&(n(6,g=JSON.parse(e)),n(6,g),console.log("[ii]","itemsJson parced!"))}}if("/st/layout.json"===r&&(y=!0),"/end/layout.json"===r){y=!1;e=z.getBlob();let t=new FileReader;t.readAsText(e),t.onload=()=>{let e=t.result;it(e)&&(n(7,v=JSON.parse(e)),n(7,v),K(),console.log("[ii]","layoutJson parced!"))}}if("/st/settings.json"===r&&(x=!0),"/end/settings.json"===r){x=!1;e=H.getBlob();let t=new FileReader;t.readAsText(e),t.onload=()=>{let e=t.result;it(e)&&(n(8,b=JSON.parse(e)),n(8,b),K(),function(){for(let t=0;t{console.log("[e]",e,"connection closed"),F(t,!1)})),$[t].addEventListener("error",(function(n){console.log("[e]",e,"connection error"),F(t,!1)}))}else console.log("[e]","socket not exist")}function B(){G(O,"/tuoyal"+JSON.stringify(function(){let t=[];for(let e=0;e{!function(t){let e=!1;return T.forEach((n=>{t===n.ws&&(e=n.status)})),e}(t.ws)?(W(t.ws),I(t.ws)):G(t.ws,"tst")})),A=!1}function G(t,e){$[t]&&1===$[t].readyState?($[t].send(e),console.log("[i]",R(t),"msg send success",e)):console.log("[e]",R(t),"msg not send",e)}function X(){n(3,u=[]);Array.from(new Set(Array.from(v,(({page:t})=>t)))).forEach((function(t,e,i){n(3,u=[...u,JSON.parse(JSON.stringify({page:t}))])})),u.sort((function(t,e){return t.pagee.page?1:0}))}function K(){X()}function Z(){tt(O),n(10,k=s.status)}function Q(){Z(),q(),j(),console.log("[i]","user selected device:",s.name),s.ip===l&&console.log("[i]","user selected original device",s.name)}function tt(t){for(let e=0;e{try{t=JSON.stringify(JSON.parse(t),null,4)}catch(e){return t}return t=(t=t.replace(/&/g,"&").replace(//g,">")).replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g,(function(t){return t}))};function it(t){try{JSON.parse(t)}catch(t){return console.log("[e]","json error"),!1}return!0}function st(){n(2,c=!c)}function at(){let t=screen.width;console.log("width",t),n(1,o=t<900)}function rt(){G(O,"/scan")}C((async()=>{console.log("[i]","mounted"),J(),V(),Z(),X()}));return[a,o,c,u,d,p,g,v,b,w,k,O,P,[],T,B,Y,U,K,Q,et,nt,st,at,rt,function(){O=S(this),n(11,O),n(14,T)},()=>Q(),function(){a=this.checked,n(0,a)},()=>at(),(t,e,n)=>U(t,e,n),()=>B(),()=>rt(),()=>Y(),()=>st(),t=>nt(t),()=>et()]}return new class extends at{constructor(t){super(),st(this,t,_n,Ln,a,{},null,[-1,-1,-1])}}({target:document.body,props:{name:"world"}})}();
//# sourceMappingURL=bundle.js.map
diff --git a/data_svelte/settings.json b/data_svelte/settings.json
index b6a318bb..65c632a3 100644
--- a/data_svelte/settings.json
+++ b/data_svelte/settings.json
@@ -2,8 +2,8 @@
"name": "IoTmanager",
"apssid": "IoTmanager",
"appass": "",
- "routerssid": "WLAN1-Y1GYEF",
- "routerpass": "2egY69YTA8DDR7En",
+ "routerssid": "rise",
+ "routerpass": "hostel3333",
"timezone": 1,
"ntp": "pool.ntp.org",
"weblogin": "admin",