copious-mail 0.0.0-stage → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +504 -0
- package/README.md +143 -2
- package/bin/index.js +345 -0
- package/client/copiousLogo.svg +123 -0
- package/client/hosted.html +5259 -0
- package/client/mail_styles.css +40 -0
- package/client/mikado.bundle.debug.js +1406 -0
- package/client/mikado.bundle.min.js +68 -0
- package/client/mikado.bundle.module.debug.js +1401 -0
- package/client/mikado.bundle.module.min.js +67 -0
- package/client/mikado.bundle.profiler.debug.js +1490 -0
- package/client/mikado.es5.debug.js +1995 -0
- package/client/mikado.es5.min.js +85 -0
- package/client/mikado.light.debug.js +535 -0
- package/client/mikado.light.min.js +29 -0
- package/client/mikado.light.module.debug.js +530 -0
- package/data/user_list.db +14 -0
- package/index.html +7242 -0
- package/index.js +5 -0
- package/jsconfig.json +32 -0
- package/lib/mail_repo_bridge_ops.js +1177 -0
- package/lib/utils.js +70 -0
- package/lib/websocket_con.js +249 -0
- package/mail_bridge.conf +10 -0
- package/package.json +41 -5
- package/svelte-src/App.svelte +2513 -0
- package/svelte-src/ContactGrid.svelte +98 -0
- package/svelte-src/FloatWindow.svelte +181 -0
- package/svelte-src/MessageDisplay.svelte +230 -0
- package/svelte-src/MessageEditor.svelte +664 -0
- package/svelte-src/MessageListEditor.svelte +133 -0
- package/svelte-src/Thing.svelte +190 -0
- package/svelte-src/ThingFull.svelte +117 -0
- package/svelte-src/ipfs_profile_proxy.js +923 -0
- package/svelte-src/main.js +10 -0
- package/svelte-src/search_box.js +69 -0
- package/svelte-src/utilities.js +180 -0
- package/test/c +28 -0
- package/test/copiousLogo.svg +123 -0
- package/test/index.html +4408 -0
- package/test/index.js +244 -0
- package/test/mail_styles.css +40 -0
- package/test/mikado.bundle.debug.js +1406 -0
- package/test/mikado.bundle.min.js +68 -0
- package/test/mikado.bundle.module.debug.js +1401 -0
- package/test/mikado.bundle.module.min.js +67 -0
- package/test/mikado.bundle.profiler.debug.js +1490 -0
- package/test/mikado.es5.debug.js +1995 -0
- package/test/mikado.es5.min.js +85 -0
- package/test/mikado.light.debug.js +535 -0
- package/test/mikado.light.min.js +29 -0
- package/test/mikado.light.module.debug.js +530 -0
- package/test/tpl/partial/attachment_edit.es5.js +1 -0
- package/test/tpl/partial/attachment_edit.html +5 -0
- package/test/tpl/partial/attachment_edit.js +1 -0
- package/test/tpl/partial/attachment_view.es5.js +1 -0
- package/test/tpl/partial/attachment_view.html +1 -0
- package/test/tpl/partial/attachment_view.js +1 -0
- package/test/tpl/partial/contact_list.es5.js +1 -0
- package/test/tpl/partial/contact_list.html +9 -0
- package/test/tpl/partial/contact_list.js +1 -0
- package/test/tpl/partial/draft_list.es5.js +1 -0
- package/test/tpl/partial/draft_list.html +8 -0
- package/test/tpl/partial/draft_list.js +1 -0
- package/test/tpl/partial/inbox_list.es5.js +1 -0
- package/test/tpl/partial/inbox_list.html +7 -0
- package/test/tpl/partial/inbox_list.js +1 -0
- package/test/tpl/partial/notify_list.es5.js +1 -0
- package/test/tpl/partial/notify_list.html +8 -0
- package/test/tpl/partial/notify_list.js +1 -0
- package/test/tpl/partial/sent_list.es5.js +1 -0
- package/test/tpl/partial/sent_list.html +7 -0
- package/test/tpl/partial/sent_list.js +1 -0
- package/test/tpl/partial/spam_list.es5.js +1 -0
- package/test/tpl/partial/spam_list.html +8 -0
- package/test/tpl/partial/spam_list.js +1 -0
- package/test/tpl/partial/trash_list.es5.js +1 -0
- package/test/tpl/partial/trash_list.html +7 -0
- package/test/tpl/partial/trash_list.js +1 -0
- package/test/tpl/partial/user.es5.js +1 -0
- package/test/tpl/partial/user.html +18 -0
- package/test/tpl/partial/user.js +1 -0
- package/tools/jsdoc.conf +47 -0
- package/tools/templates/docdash/publish.js +843 -0
- package/tools/templates/docdash/static/fonts/Montserrat/Montserrat-Bold.eot +0 -0
- package/tools/templates/docdash/static/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
- package/tools/templates/docdash/static/fonts/Montserrat/Montserrat-Bold.woff +0 -0
- package/tools/templates/docdash/static/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
- package/tools/templates/docdash/static/fonts/Montserrat/Montserrat-Regular.eot +0 -0
- package/tools/templates/docdash/static/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
- package/tools/templates/docdash/static/fonts/Montserrat/Montserrat-Regular.woff +0 -0
- package/tools/templates/docdash/static/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
- package/tools/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
- package/tools/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +978 -0
- package/tools/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
- package/tools/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
- package/tools/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
- package/tools/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
- package/tools/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +1049 -0
- package/tools/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
- package/tools/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
- package/tools/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
- package/tools/templates/docdash/static/scripts/collapse.js +67 -0
- package/tools/templates/docdash/static/scripts/commonNav.js +28 -0
- package/tools/templates/docdash/static/scripts/linenumber.js +25 -0
- package/tools/templates/docdash/static/scripts/nav.js +12 -0
- package/tools/templates/docdash/static/scripts/polyfill.js +4 -0
- package/tools/templates/docdash/static/scripts/prettify/Apache-License-2.0.txt +202 -0
- package/tools/templates/docdash/static/scripts/prettify/lang-css.js +2 -0
- package/tools/templates/docdash/static/scripts/prettify/prettify.js +28 -0
- package/tools/templates/docdash/static/scripts/search.js +99 -0
- package/tools/templates/docdash/static/styles/jsdoc.css +803 -0
- package/tools/templates/docdash/static/styles/prettify.css +80 -0
- package/tools/templates/docdash/tmpl/augments.tmpl +10 -0
- package/tools/templates/docdash/tmpl/container.tmpl +203 -0
- package/tools/templates/docdash/tmpl/details.tmpl +152 -0
- package/tools/templates/docdash/tmpl/example.tmpl +2 -0
- package/tools/templates/docdash/tmpl/examples.tmpl +13 -0
- package/tools/templates/docdash/tmpl/exceptions.tmpl +32 -0
- package/tools/templates/docdash/tmpl/layout.tmpl +102 -0
- package/tools/templates/docdash/tmpl/mainpage.tmpl +15 -0
- package/tools/templates/docdash/tmpl/members.tmpl +38 -0
- package/tools/templates/docdash/tmpl/method.tmpl +132 -0
- package/tools/templates/docdash/tmpl/modifies.tmpl +14 -0
- package/tools/templates/docdash/tmpl/namespace.tmpl +133 -0
- package/tools/templates/docdash/tmpl/params.tmpl +132 -0
- package/tools/templates/docdash/tmpl/properties.tmpl +107 -0
- package/tools/templates/docdash/tmpl/returns.tmpl +19 -0
- package/tools/templates/docdash/tmpl/source.tmpl +8 -0
- package/tools/templates/docdash/tmpl/tutorial.tmpl +19 -0
- package/tools/templates/docdash/tmpl/type.tmpl +26 -0
- package/tools/templates/templates/docdash/publish.js +843 -0
- package/tools/templates/templates/docdash/static/fonts/Montserrat/Montserrat-Bold.eot +0 -0
- package/tools/templates/templates/docdash/static/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
- package/tools/templates/templates/docdash/static/fonts/Montserrat/Montserrat-Bold.woff +0 -0
- package/tools/templates/templates/docdash/static/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
- package/tools/templates/templates/docdash/static/fonts/Montserrat/Montserrat-Regular.eot +0 -0
- package/tools/templates/templates/docdash/static/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
- package/tools/templates/templates/docdash/static/fonts/Montserrat/Montserrat-Regular.woff +0 -0
- package/tools/templates/templates/docdash/static/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
- package/tools/templates/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
- package/tools/templates/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +978 -0
- package/tools/templates/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
- package/tools/templates/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
- package/tools/templates/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
- package/tools/templates/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
- package/tools/templates/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +1049 -0
- package/tools/templates/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
- package/tools/templates/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
- package/tools/templates/templates/docdash/static/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
- package/tools/templates/templates/docdash/static/scripts/collapse.js +67 -0
- package/tools/templates/templates/docdash/static/scripts/commonNav.js +28 -0
- package/tools/templates/templates/docdash/static/scripts/linenumber.js +25 -0
- package/tools/templates/templates/docdash/static/scripts/nav.js +12 -0
- package/tools/templates/templates/docdash/static/scripts/polyfill.js +4 -0
- package/tools/templates/templates/docdash/static/scripts/prettify/Apache-License-2.0.txt +202 -0
- package/tools/templates/templates/docdash/static/scripts/prettify/lang-css.js +2 -0
- package/tools/templates/templates/docdash/static/scripts/prettify/prettify.js +28 -0
- package/tools/templates/templates/docdash/static/scripts/search.js +99 -0
- package/tools/templates/templates/docdash/static/styles/jsdoc.css +803 -0
- package/tools/templates/templates/docdash/static/styles/prettify.css +80 -0
- package/tools/templates/templates/docdash/tmpl/augments.tmpl +10 -0
- package/tools/templates/templates/docdash/tmpl/container.tmpl +203 -0
- package/tools/templates/templates/docdash/tmpl/details.tmpl +152 -0
- package/tools/templates/templates/docdash/tmpl/example.tmpl +2 -0
- package/tools/templates/templates/docdash/tmpl/examples.tmpl +13 -0
- package/tools/templates/templates/docdash/tmpl/exceptions.tmpl +32 -0
- package/tools/templates/templates/docdash/tmpl/layout.tmpl +102 -0
- package/tools/templates/templates/docdash/tmpl/mainpage.tmpl +15 -0
- package/tools/templates/templates/docdash/tmpl/members.tmpl +38 -0
- package/tools/templates/templates/docdash/tmpl/method.tmpl +132 -0
- package/tools/templates/templates/docdash/tmpl/modifies.tmpl +14 -0
- package/tools/templates/templates/docdash/tmpl/namespace.tmpl +133 -0
- package/tools/templates/templates/docdash/tmpl/params.tmpl +132 -0
- package/tools/templates/templates/docdash/tmpl/properties.tmpl +107 -0
- package/tools/templates/templates/docdash/tmpl/returns.tmpl +19 -0
- package/tools/templates/templates/docdash/tmpl/source.tmpl +8 -0
- package/tools/templates/templates/docdash/tmpl/tutorial.tmpl +19 -0
- package/tools/templates/templates/docdash/tmpl/type.tmpl +26 -0
- package/tpl/partial/user.es5.js +1 -0
- package/tpl/partial/user.html +10 -0
- package/tpl/partial/user.js +1 -0
|
@@ -0,0 +1,1406 @@
|
|
|
1
|
+
/**!
|
|
2
|
+
* Mikado.js v0.8.400 (Bundle/Debug)
|
|
3
|
+
* Copyright 2019-2024 Nextapps GmbH
|
|
4
|
+
* Author: Thomas Wilkerling
|
|
5
|
+
* Licence: Apache-2.0
|
|
6
|
+
* https://github.com/nextapps-de/mikado
|
|
7
|
+
*/
|
|
8
|
+
(function(){'use strict';
|
|
9
|
+
var n;
|
|
10
|
+
const p = {}, w = {}, y = Object.create(null), z = Object.create(null), B = document.documentElement || document.body.parentNode, C = "ontouchstart" in window, D = !C && window.PointerEvent && navigator.maxTouchPoints;
|
|
11
|
+
let aa;
|
|
12
|
+
function E(a, b) {
|
|
13
|
+
const c = a.target;
|
|
14
|
+
if (c !== window && c !== B) {
|
|
15
|
+
b || (b = a.type);
|
|
16
|
+
var d = c["_mke" + b];
|
|
17
|
+
if ("undefined" === typeof d) {
|
|
18
|
+
for (var e = c; e && e !== B;) {
|
|
19
|
+
var f = void 0;
|
|
20
|
+
"click" === b && aa && (f = e.getAttribute("tap"));
|
|
21
|
+
f || (f = e.getAttribute(b));
|
|
22
|
+
if (f) {
|
|
23
|
+
if ("$" === f[0]) {
|
|
24
|
+
var h = e === c;
|
|
25
|
+
f = f.substring(1);
|
|
26
|
+
}
|
|
27
|
+
var k = f.indexOf(":"), g = e, l = void 0;
|
|
28
|
+
if (-1 < k) {
|
|
29
|
+
l = f.endsWith(":*");
|
|
30
|
+
const m = f.substring(0, k);
|
|
31
|
+
k = f.substring(k + 1, f.length - (l ? 2 : 0));
|
|
32
|
+
for (f = ""; (g = g.parentElement) !== B;) {
|
|
33
|
+
if ("root" === k ? g._mkr : g.hasAttribute(k)) {
|
|
34
|
+
f = m;
|
|
35
|
+
break;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
f || console.warn("Event root '" + k + "' was not found for the event: '" + m + "'.");
|
|
39
|
+
}
|
|
40
|
+
if (f && (d || (d = [], h && (c["_mke" + b] = d)), d.push([f, g]), g = z[f], !l || g && (g.stop || g.cancel))) {
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
e = e.parentElement;
|
|
45
|
+
}
|
|
46
|
+
h && (d || (c["_mke" + b] = null));
|
|
47
|
+
}
|
|
48
|
+
if (d) {
|
|
49
|
+
for (let m = 0, q; m < d.length; m++) {
|
|
50
|
+
if (q = d[m], e = q[0], f = y[e]) {
|
|
51
|
+
l = q[1];
|
|
52
|
+
if (g = z[e]) {
|
|
53
|
+
g.prevent && a.preventDefault(), g.stop && a.stopImmediatePropagation(), g.once && (y[e] = null, h && (c["_mke" + b] = null));
|
|
54
|
+
}
|
|
55
|
+
f(l, a);
|
|
56
|
+
} else {
|
|
57
|
+
console.warn("The route '" + e + "' is not defined for the event '" + b + "'.");
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
function ba(a, b, c) {
|
|
64
|
+
if (!a) {
|
|
65
|
+
throw Error("Missing route name.");
|
|
66
|
+
}
|
|
67
|
+
if (!y[a]) {
|
|
68
|
+
throw Error("Undefined route '" + a + "'.");
|
|
69
|
+
}
|
|
70
|
+
y[a](b || this, c || window.event);
|
|
71
|
+
return this;
|
|
72
|
+
}
|
|
73
|
+
function ca(a, b) {
|
|
74
|
+
p[a] || (F(1, a, E, b), p[a] = 1, w[a] = b || null);
|
|
75
|
+
return this;
|
|
76
|
+
}
|
|
77
|
+
let H, I, da;
|
|
78
|
+
if (C || D) {
|
|
79
|
+
function a(d) {
|
|
80
|
+
var e = d;
|
|
81
|
+
(d = d.touches) && (e = d[0]);
|
|
82
|
+
H = e.clientX;
|
|
83
|
+
I = e.clientY;
|
|
84
|
+
}
|
|
85
|
+
function b(d) {
|
|
86
|
+
const e = H, f = I;
|
|
87
|
+
var h = d, k = d.changedTouches;
|
|
88
|
+
k && (h = k[0]);
|
|
89
|
+
H = h.clientX;
|
|
90
|
+
I = h.clientY;
|
|
91
|
+
15 > Math.abs(H - e) && 15 > Math.abs(I - f) && E(d, "tap");
|
|
92
|
+
}
|
|
93
|
+
const c = {passive:!1, capture:!0};
|
|
94
|
+
da = function(d) {
|
|
95
|
+
F(d, D ? "pointerdown" : "touchstart", a, c);
|
|
96
|
+
F(d, D ? "pointerup" : "touchend", b, c);
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
function F(a, b, c, d) {
|
|
100
|
+
if ("tap" === b) {
|
|
101
|
+
if (C || D) {
|
|
102
|
+
da(a);
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
aa = !0;
|
|
106
|
+
b = "click";
|
|
107
|
+
}
|
|
108
|
+
window[(a ? "add" : "remove") + "EventListener"](b, c, d || !1 === d ? d : !0);
|
|
109
|
+
}
|
|
110
|
+
;function K(a, b, c) {
|
|
111
|
+
let d;
|
|
112
|
+
c && (d = a._mkc) && (a._mkc = null);
|
|
113
|
+
const e = b.length, f = [], h = {};
|
|
114
|
+
for (let l = 0, m, q, t, r, v = null; l < e; l++) {
|
|
115
|
+
m = b[l];
|
|
116
|
+
if (q = m.v) {
|
|
117
|
+
if (r = t = h[q], !r) {
|
|
118
|
+
a: {
|
|
119
|
+
var k = a, g = q;
|
|
120
|
+
for (let u = 0, J = g.length, A = ""; u < J; u++) {
|
|
121
|
+
const x = g[u];
|
|
122
|
+
A += x;
|
|
123
|
+
if (h[A]) {
|
|
124
|
+
k = h[A];
|
|
125
|
+
} else {
|
|
126
|
+
if (">" === x) {
|
|
127
|
+
k = k.firstChild;
|
|
128
|
+
} else {
|
|
129
|
+
if ("|" === x) {
|
|
130
|
+
t = [k.firstChild, k];
|
|
131
|
+
break a;
|
|
132
|
+
}
|
|
133
|
+
if ("@" === x) {
|
|
134
|
+
t = [k.style, k];
|
|
135
|
+
break a;
|
|
136
|
+
}
|
|
137
|
+
k = k.nextSibling;
|
|
138
|
+
}
|
|
139
|
+
h[A] = k;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
t = [k];
|
|
143
|
+
}
|
|
144
|
+
r = t[0];
|
|
145
|
+
t = t[1] || r;
|
|
146
|
+
}
|
|
147
|
+
} else {
|
|
148
|
+
r = t = a;
|
|
149
|
+
}
|
|
150
|
+
c && (v = d ? d[l] : {}, t._mkc = v);
|
|
151
|
+
f[l] = new L(v, r, "");
|
|
152
|
+
}
|
|
153
|
+
return a._mkp = f;
|
|
154
|
+
}
|
|
155
|
+
function M(a, b, c, d, e, f) {
|
|
156
|
+
f || (a.i = 1);
|
|
157
|
+
const h = e || (b.tag ? b.svg ? document.createElementNS("http://www.w3.org/2000/svg", b.tag) : document.createElement(b.tag) : document.createTextNode(b.text));
|
|
158
|
+
let k, g;
|
|
159
|
+
if (g = b.class) {
|
|
160
|
+
"object" === typeof g ? (c.push(new L(k = {_c:""}, h, d)), (g = g[0]) ? N(a, g, {fn:"_c", index:c.length - 1}) : a.i = 0) : e || (h.className = g);
|
|
161
|
+
}
|
|
162
|
+
if (g = b.attr) {
|
|
163
|
+
for (const m in g) {
|
|
164
|
+
let q = g[m];
|
|
165
|
+
"object" === typeof q ? (k || c.push(new L(k = {}, h, d)), k["_a" + m] = !1, (q = q[0]) ? N(a, q, {fn:"_a", index:c.length - 1, key:m}) : a.i = 0) : e || h.setAttribute(m, q);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
if (g = b.event) {
|
|
169
|
+
for (let m in g) {
|
|
170
|
+
let q;
|
|
171
|
+
if (!e) {
|
|
172
|
+
if ("load" === m || "error" === m) {
|
|
173
|
+
window.dispatch = ba, g["on" + m] = "dispatch('" + g[m] + "', this)", m = "on" + m, q = 1;
|
|
174
|
+
}
|
|
175
|
+
h.setAttribute(m, g[m]);
|
|
176
|
+
}
|
|
177
|
+
q || ca(m);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
if (g = b.style) {
|
|
181
|
+
"object" === typeof g ? (c.push(new L(k || (k = {}), h.style, d + "@")), k._s = "", (g = g[0]) ? N(a, g, {fn:"_s", index:c.length - 1}) : a.i = 0) : e || (h.style.cssText = g);
|
|
182
|
+
}
|
|
183
|
+
if (g = b.text) {
|
|
184
|
+
if ("object" === typeof g) {
|
|
185
|
+
var l = h;
|
|
186
|
+
g = g[0];
|
|
187
|
+
b.tag ? (d += "|", l = !e && h.firstChild, l || (l = document.createTextNode(g), h.appendChild(l))) : k = {};
|
|
188
|
+
(k || (k = {}))._t = g;
|
|
189
|
+
c.push(new L(k, l, d));
|
|
190
|
+
g ? N(a, g, {fn:"_t", index:c.length - 1}) : a.i = 0;
|
|
191
|
+
} else {
|
|
192
|
+
e || (b.tag ? h.textContent = g : h.nodeValue = g);
|
|
193
|
+
}
|
|
194
|
+
} else if (g = b.child) {
|
|
195
|
+
if (e && (e = e.firstChild, !e)) {
|
|
196
|
+
return console.warn("Hydration failed of template '" + a.name + "' because the existing DOM structure was incompatible. Falls back to factory construction instead."), null;
|
|
197
|
+
}
|
|
198
|
+
g.constructor !== Array && (g = [g]);
|
|
199
|
+
for (let m = 0, q, t = g.length; m < t; m++) {
|
|
200
|
+
if (q = g[m], d = m ? d + "+" : d + ">", b = M(a, q, c, d, e, 1), e) {
|
|
201
|
+
if (m < t - 1 && (e = e.nextSibling, !e)) {
|
|
202
|
+
return console.warn("Hydration failed of template '" + a.name + "' because the existing DOM structure was incompatible. Falls back to factory construction instead."), null;
|
|
203
|
+
}
|
|
204
|
+
} else {
|
|
205
|
+
h.appendChild(b);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
} else if (g = b.html) {
|
|
209
|
+
"object" === typeof g ? (k || c.push(new L(k = {}, h, d)), k._h = "", (g = g[0]) ? N(a, g, {fn:"_h", index:c.length - 1}) : a.i = 0) : e || (h.innerHTML = g);
|
|
210
|
+
} else if (g = b.inc) {
|
|
211
|
+
k || c.push(new L(null, h, d));
|
|
212
|
+
if ("string" === typeof g) {
|
|
213
|
+
l = O[g];
|
|
214
|
+
if (!l) {
|
|
215
|
+
throw Error("The partial template '" + g + "' which is included by the root template '" + a.name + "' was not registered. When using named includes make sure you register all your includes by Mikado.register(tpl) before instantiating the Mikado view instance.");
|
|
216
|
+
}
|
|
217
|
+
if (!(l instanceof P)) {
|
|
218
|
+
d = l[0];
|
|
219
|
+
if (b = l[1]) {
|
|
220
|
+
b.async = !1, e && (b.root = e, b.hydrate = !0);
|
|
221
|
+
}
|
|
222
|
+
O[g] = l = new P(d, b);
|
|
223
|
+
}
|
|
224
|
+
} else if (1 !== g) {
|
|
225
|
+
d = a.inc.length;
|
|
226
|
+
if (!a.tpl.fn.length) {
|
|
227
|
+
throw Error("The template '" + a.name + "|" + d + "' has conflicts. It should provide a handler entry, but wasn't found.");
|
|
228
|
+
}
|
|
229
|
+
l = new P({name:a.name + "|" + d, tpl:g, key:g.key, cache:g.cache, fn:a.tpl.fn}, {recycle:a.recycle, cache:a.cache, pool:!!a.pool, state:a.state, mount:h, hydrate:!!e});
|
|
230
|
+
}
|
|
231
|
+
1 !== g && a.inc.push(l);
|
|
232
|
+
}
|
|
233
|
+
k && (h._mkc = k);
|
|
234
|
+
f || (h._mkp = c);
|
|
235
|
+
return h;
|
|
236
|
+
}
|
|
237
|
+
function N(a, b, c) {
|
|
238
|
+
a.proxy || (a.proxy = {});
|
|
239
|
+
(a.proxy[b] || (a.proxy[b] = [])).push(c);
|
|
240
|
+
}
|
|
241
|
+
const Q = {checked:1, selected:1, hidden:1};
|
|
242
|
+
function L(a, b, c) {
|
|
243
|
+
this.c = a;
|
|
244
|
+
this.n = b;
|
|
245
|
+
this.v = c;
|
|
246
|
+
}
|
|
247
|
+
n = L.prototype;
|
|
248
|
+
n._a = function(a, b, c, d, e) {
|
|
249
|
+
if (this.c) {
|
|
250
|
+
if (d) {
|
|
251
|
+
if (e || 0 === e) {
|
|
252
|
+
d = d[e] || (d[e] = {});
|
|
253
|
+
}
|
|
254
|
+
d["_a" + a] = b;
|
|
255
|
+
}
|
|
256
|
+
if (this.c["_a" + a] === b) {
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
this.c["_a" + a] = b;
|
|
260
|
+
}
|
|
261
|
+
!Q[a] || c && "selected" === a ? !1 === b ? this.n.removeAttribute(a) : this.n.setAttribute(a, b) : this.n[a] = b;
|
|
262
|
+
};
|
|
263
|
+
n._t = function(a, b, c) {
|
|
264
|
+
if (this.c) {
|
|
265
|
+
if (b) {
|
|
266
|
+
if (c || 0 === c) {
|
|
267
|
+
b = b[c] || (b[c] = {});
|
|
268
|
+
}
|
|
269
|
+
b._t = a;
|
|
270
|
+
}
|
|
271
|
+
if (this.c._t === a) {
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
this.c._t = a;
|
|
275
|
+
}
|
|
276
|
+
this.n.nodeValue = a;
|
|
277
|
+
};
|
|
278
|
+
n._c = function(a, b, c) {
|
|
279
|
+
if (this.c) {
|
|
280
|
+
if (b) {
|
|
281
|
+
if (c || 0 === c) {
|
|
282
|
+
b = b[c] || (b[c] = {});
|
|
283
|
+
}
|
|
284
|
+
b._c = a;
|
|
285
|
+
}
|
|
286
|
+
if (this.c._c === a) {
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
this.c._c = a;
|
|
290
|
+
}
|
|
291
|
+
this.n.className = a;
|
|
292
|
+
};
|
|
293
|
+
n._s = function(a, b, c) {
|
|
294
|
+
if (this.c) {
|
|
295
|
+
if (b) {
|
|
296
|
+
if (c || 0 === c) {
|
|
297
|
+
b = b[c] || (b[c] = {});
|
|
298
|
+
}
|
|
299
|
+
b._s = a;
|
|
300
|
+
}
|
|
301
|
+
if (this.c._s === a) {
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
304
|
+
this.c._s = a;
|
|
305
|
+
}
|
|
306
|
+
this.n.cssText = a;
|
|
307
|
+
};
|
|
308
|
+
n._h = function(a, b, c) {
|
|
309
|
+
if (this.c) {
|
|
310
|
+
if (b) {
|
|
311
|
+
if (c || 0 === c) {
|
|
312
|
+
b = b[c] || (b[c] = {});
|
|
313
|
+
}
|
|
314
|
+
b._h = a;
|
|
315
|
+
}
|
|
316
|
+
if (this.c._h === a) {
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
this.c._h = a;
|
|
320
|
+
}
|
|
321
|
+
this.n.innerHTML = a;
|
|
322
|
+
};
|
|
323
|
+
const fa = window.Proxy || function() {
|
|
324
|
+
function a(b, c) {
|
|
325
|
+
this.path = c.path;
|
|
326
|
+
this.fn = c.fn;
|
|
327
|
+
for (const d in b) {
|
|
328
|
+
this.h(b, d, b[d]);
|
|
329
|
+
}
|
|
330
|
+
b._mkx = this;
|
|
331
|
+
return b;
|
|
332
|
+
}
|
|
333
|
+
a.prototype.h = function(b, c, d) {
|
|
334
|
+
const e = this;
|
|
335
|
+
Object.defineProperty(b, c, {get:function() {
|
|
336
|
+
return d;
|
|
337
|
+
}, set:function(f) {
|
|
338
|
+
ea(e, d = f, c);
|
|
339
|
+
}});
|
|
340
|
+
};
|
|
341
|
+
return a;
|
|
342
|
+
}();
|
|
343
|
+
function ha(a, b) {
|
|
344
|
+
return "_mkx" === b ? this : a[b];
|
|
345
|
+
}
|
|
346
|
+
function ia(a, b, c) {
|
|
347
|
+
ea(this, c, b);
|
|
348
|
+
a[b] = c;
|
|
349
|
+
return !0;
|
|
350
|
+
}
|
|
351
|
+
function ea(a, b, c) {
|
|
352
|
+
if (c = a.fn[c]) {
|
|
353
|
+
for (let e = 0; e < c.length; e++) {
|
|
354
|
+
var d = c[e];
|
|
355
|
+
const f = d.fn, h = a.path[d.index];
|
|
356
|
+
d = d.key || "";
|
|
357
|
+
h.c && h.c[f + d] === b || (d ? h[f](d, b) : h[f](b));
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
;const O = Object.create(null);
|
|
362
|
+
function P(a, b = {}) {
|
|
363
|
+
if (!(this instanceof P)) {
|
|
364
|
+
return new P(a, b);
|
|
365
|
+
}
|
|
366
|
+
if ("string" === typeof a) {
|
|
367
|
+
var c = O[a];
|
|
368
|
+
if (!c) {
|
|
369
|
+
throw Error("The template '" + a + "' is not registered.");
|
|
370
|
+
}
|
|
371
|
+
if (c instanceof P) {
|
|
372
|
+
return c;
|
|
373
|
+
}
|
|
374
|
+
a = c[0];
|
|
375
|
+
b || (b = c[1]);
|
|
376
|
+
}
|
|
377
|
+
if (!a) {
|
|
378
|
+
throw Error("Initialization Error: Template is not defined.");
|
|
379
|
+
}
|
|
380
|
+
if (!a.tpl) {
|
|
381
|
+
throw Error("Initialization Error: Template isn't supported.");
|
|
382
|
+
}
|
|
383
|
+
this.g = [];
|
|
384
|
+
this.length = 0;
|
|
385
|
+
this.root = b.root || b.mount || null;
|
|
386
|
+
this.recycle = !!b.recycle;
|
|
387
|
+
this.state = b.state || {};
|
|
388
|
+
this.shadow = b.shadow || !!a.cmp;
|
|
389
|
+
this.key = a.key || "";
|
|
390
|
+
this.o = {};
|
|
391
|
+
c = a.fn;
|
|
392
|
+
a.B || c && (a.B = c.slice());
|
|
393
|
+
this.apply = c && c.pop();
|
|
394
|
+
this.tpl = a;
|
|
395
|
+
this.name = a.name;
|
|
396
|
+
this.inc = [];
|
|
397
|
+
this.pool = (c = this.recycle || !!this.key) && b.pool ? 1 : 0;
|
|
398
|
+
this.A = [];
|
|
399
|
+
this.j = new Map();
|
|
400
|
+
this.cache = c && (a.cache || !!b.cache);
|
|
401
|
+
this.async = !!b.async;
|
|
402
|
+
this.s = 0;
|
|
403
|
+
this.on = b.on || null;
|
|
404
|
+
this.proxy = null;
|
|
405
|
+
this.i = 0;
|
|
406
|
+
(a = b.observe) && (new R(a)).mount(this);
|
|
407
|
+
this.root ? this.mount(this.root, b.hydrate) : this.m = null;
|
|
408
|
+
}
|
|
409
|
+
n = P.prototype;
|
|
410
|
+
n.mount = function(a, b) {
|
|
411
|
+
if (!a) {
|
|
412
|
+
throw Error("No target was passed to .mount()");
|
|
413
|
+
}
|
|
414
|
+
this.s && this.cancel();
|
|
415
|
+
if (this.shadow) {
|
|
416
|
+
var c = this.tpl.cmp;
|
|
417
|
+
a = a.shadowRoot || a.attachShadow({mode:"open"});
|
|
418
|
+
if (c && c.length) {
|
|
419
|
+
var d = a.lastElementChild;
|
|
420
|
+
if (d) {
|
|
421
|
+
a = d;
|
|
422
|
+
} else {
|
|
423
|
+
c.push({tag:"root"});
|
|
424
|
+
for (let f = 0, h; f < c.length; f++) {
|
|
425
|
+
h = M(this, c[f], [], ""), a.append(h), f === c.length - 1 && (a = h);
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
c = a._mki;
|
|
431
|
+
d = this.root !== a;
|
|
432
|
+
if (c === this) {
|
|
433
|
+
if (!d) {
|
|
434
|
+
return this;
|
|
435
|
+
}
|
|
436
|
+
this.g = a._mkd;
|
|
437
|
+
this.length = this.g.length;
|
|
438
|
+
} else if (c) {
|
|
439
|
+
c.clear();
|
|
440
|
+
a._mkd = this.g = [];
|
|
441
|
+
this.length = 0;
|
|
442
|
+
a.firstChild && (a.textContent = "");
|
|
443
|
+
var e = this.on && this.on.unmount;
|
|
444
|
+
e && e(a, c);
|
|
445
|
+
} else {
|
|
446
|
+
if (b) {
|
|
447
|
+
e = a.children;
|
|
448
|
+
const f = e.length, h = Array(f);
|
|
449
|
+
for (let k = 0; k < f; k++) {
|
|
450
|
+
h[k] = e[k];
|
|
451
|
+
}
|
|
452
|
+
this.g = h;
|
|
453
|
+
this.length = this.g.length;
|
|
454
|
+
} else {
|
|
455
|
+
this.g = [], this.length = 0, a.firstChild && (a.textContent = "");
|
|
456
|
+
}
|
|
457
|
+
a._mkd = this.g;
|
|
458
|
+
}
|
|
459
|
+
if (this.key) {
|
|
460
|
+
if (d && this.root && (this.root._mkl = this.o), c === this) {
|
|
461
|
+
this.o = a._mkl;
|
|
462
|
+
} else {
|
|
463
|
+
d = {};
|
|
464
|
+
if (!c && b && this.length) {
|
|
465
|
+
for (let f = 0, h, k; f < this.length; f++) {
|
|
466
|
+
h = this.g[f], (k = h.getAttribute("key")) || console.warn("The template '" + this.name + "' runs in keyed mode, but the hydrated component don't have the attribute 'key' exported."), h._mkk = k, d[k] = h;
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
a._mkl = this.o = d;
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
a._mki = this;
|
|
473
|
+
this.root = a;
|
|
474
|
+
this.m || (b && this.length && (this.m = this.g[0].cloneNode(!0), M(this, this.tpl.tpl, [], "", this.m) && ja(this)), this.tpl && (this.m = M(this, this.tpl.tpl, [], ""), ja(this)));
|
|
475
|
+
(b = this.on && this.on.mount) && b(a, this);
|
|
476
|
+
return this;
|
|
477
|
+
};
|
|
478
|
+
function ja(a) {
|
|
479
|
+
a.tpl.B && (a.tpl.fn = a.tpl.B, a.tpl.B = null);
|
|
480
|
+
a.tpl = null;
|
|
481
|
+
}
|
|
482
|
+
function ka(a, b, c, d, e) {
|
|
483
|
+
if (!a) {
|
|
484
|
+
throw Error("Root element is not defined.");
|
|
485
|
+
}
|
|
486
|
+
if (!b) {
|
|
487
|
+
throw Error("Template is not defined.");
|
|
488
|
+
}
|
|
489
|
+
var f;
|
|
490
|
+
if ("function" === typeof c || !0 === c) {
|
|
491
|
+
e = c, c = null;
|
|
492
|
+
} else if ("function" === typeof d || !0 === d) {
|
|
493
|
+
e = d, d = null;
|
|
494
|
+
}
|
|
495
|
+
if (e) {
|
|
496
|
+
return new Promise(function(k) {
|
|
497
|
+
requestAnimationFrame(function() {
|
|
498
|
+
ka(a, b, c, d);
|
|
499
|
+
"function" === typeof e && e();
|
|
500
|
+
k();
|
|
501
|
+
});
|
|
502
|
+
});
|
|
503
|
+
}
|
|
504
|
+
var h = (f = b.cmp) && f.length;
|
|
505
|
+
f && !h && (a = a.shadowRoot || a.attachShadow({mode:"open"}));
|
|
506
|
+
if (c || h || b.fn) {
|
|
507
|
+
f = new P(b);
|
|
508
|
+
h && (a = f.mount(a).root);
|
|
509
|
+
if (c && Array.isArray(c)) {
|
|
510
|
+
for (h = 0; h < c.length; h++) {
|
|
511
|
+
a.append(f.create(c[h], d, h));
|
|
512
|
+
}
|
|
513
|
+
} else {
|
|
514
|
+
a.append(f.create(c, d));
|
|
515
|
+
}
|
|
516
|
+
f.destroy();
|
|
517
|
+
} else {
|
|
518
|
+
f = M({}, b.tpl, [], "", null, 1), a.append(f);
|
|
519
|
+
}
|
|
520
|
+
return P;
|
|
521
|
+
}
|
|
522
|
+
n.render = function(a, b, c, d) {
|
|
523
|
+
if (!this.root) {
|
|
524
|
+
throw Error("Template was not mounted or root was not found.");
|
|
525
|
+
}
|
|
526
|
+
if (this.root._mki !== this) {
|
|
527
|
+
throw Error("Another template is already assigned to this root. Please use '.mount(root_element)' before calling '.render()' to switch the context of a template.");
|
|
528
|
+
}
|
|
529
|
+
if (!d) {
|
|
530
|
+
var e;
|
|
531
|
+
if (b && (e = "function" === typeof b) || !0 === b) {
|
|
532
|
+
c = b, b = null;
|
|
533
|
+
}
|
|
534
|
+
this.s && this.cancel();
|
|
535
|
+
if (this.async || c) {
|
|
536
|
+
const l = this;
|
|
537
|
+
e || (e = "function" === typeof c);
|
|
538
|
+
l.s = requestAnimationFrame(function() {
|
|
539
|
+
l.s = 0;
|
|
540
|
+
l.render(a, b, null, 1);
|
|
541
|
+
c();
|
|
542
|
+
});
|
|
543
|
+
return e ? this : new Promise(function(m) {
|
|
544
|
+
c = m;
|
|
545
|
+
});
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
var f = this.length;
|
|
549
|
+
if (!a && !this.apply) {
|
|
550
|
+
return this.g[0] || this.add(), this;
|
|
551
|
+
}
|
|
552
|
+
if (Array.isArray(a) || a instanceof R) {
|
|
553
|
+
if (d = a.length, !d) {
|
|
554
|
+
return this.remove(0, f);
|
|
555
|
+
}
|
|
556
|
+
} else {
|
|
557
|
+
if (this.proxy) {
|
|
558
|
+
throw Error("When a template is using data bindings by an expression like {{= ... }} you will need to pass an array to the render() function, also when just one single item should be rendered. Because the array you will pass in is getting proxified after calling .render(arr), after then you can trigger bindings via arr[0].prop = 'value'.");
|
|
559
|
+
}
|
|
560
|
+
a = [a];
|
|
561
|
+
d = 1;
|
|
562
|
+
}
|
|
563
|
+
var h = this.key;
|
|
564
|
+
e = this.proxy;
|
|
565
|
+
!f || h || this.recycle || (this.remove(0, f), f = 0);
|
|
566
|
+
let k = f < d ? f : d, g = 0;
|
|
567
|
+
if (g < k) {
|
|
568
|
+
for (let l, m; g < k; g++) {
|
|
569
|
+
l = this.g[g];
|
|
570
|
+
m = a[g];
|
|
571
|
+
if (h && l._mkk !== m[h]) {
|
|
572
|
+
return la(this, a, b, g);
|
|
573
|
+
}
|
|
574
|
+
this.update(l, m, b, g);
|
|
575
|
+
e && !m._mkx && (a[g] = S(this, l, m));
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
if (g < d) {
|
|
579
|
+
for (f = h || this.recycle; g < d; g++) {
|
|
580
|
+
h = a[g], this.add(h, b), !e || f && h._mkx || (a[g] = S(this, this.g[g], h));
|
|
581
|
+
}
|
|
582
|
+
} else {
|
|
583
|
+
d < f && this.remove(d, f - d);
|
|
584
|
+
}
|
|
585
|
+
return this;
|
|
586
|
+
};
|
|
587
|
+
n.replace = function(a, b, c, d) {
|
|
588
|
+
"undefined" === typeof d && ("number" === typeof a ? (d = 0 > a ? this.length + a : a, a = this.g[d]) : d = this.index(a));
|
|
589
|
+
var e;
|
|
590
|
+
if (this.key) {
|
|
591
|
+
var f = b[this.key];
|
|
592
|
+
if (e = this.o[f]) {
|
|
593
|
+
if (e !== a) {
|
|
594
|
+
f = this.index(e);
|
|
595
|
+
const h = f < d ? e : a, k = f < d ? a : e;
|
|
596
|
+
let g = this.g[f < d ? f + 1 : d + 1];
|
|
597
|
+
this.g[d] = e;
|
|
598
|
+
this.g[f] = a;
|
|
599
|
+
g !== k ? this.root.insertBefore(h, k) : g = h;
|
|
600
|
+
this.root.insertBefore(k, g);
|
|
601
|
+
}
|
|
602
|
+
} else {
|
|
603
|
+
this.pool && (e = this.j.get(f)) && (this.j.delete(f), ma(this, a), this.g[d] = e, a.replaceWith(e));
|
|
604
|
+
}
|
|
605
|
+
} else {
|
|
606
|
+
this.recycle && (e = a);
|
|
607
|
+
}
|
|
608
|
+
e ? this.apply && (this.i && b._mkx || this.apply(b, c || this.state, d, e._mkp || K(e, this.m._mkp, this.cache))) : (b = this.create(b, c, d, 1), (this.key || this.pool) && ma(this, a), this.g[d] = b, a.replaceWith(b));
|
|
609
|
+
(d = this.on && this.on.replace) && d(a, this);
|
|
610
|
+
return this;
|
|
611
|
+
};
|
|
612
|
+
n.update = function(a, b, c, d) {
|
|
613
|
+
if (!this.apply) {
|
|
614
|
+
return "number" !== typeof d && console.warn("The template '" + this.name + "' is a static template and should not be updated. Alternatively you can use .replace() to switch contents."), this;
|
|
615
|
+
}
|
|
616
|
+
if (this.i && b._mkx) {
|
|
617
|
+
return this;
|
|
618
|
+
}
|
|
619
|
+
"undefined" === typeof d && ("number" === typeof a ? (d = 0 > a ? this.length + a - 1 : a, a = this.g[d]) : d = this.index(a));
|
|
620
|
+
this.apply(b, c || this.state, d, a._mkp || K(a, this.m._mkp, this.cache));
|
|
621
|
+
(b = this.on && this.on.update) && b(a, this);
|
|
622
|
+
return this;
|
|
623
|
+
};
|
|
624
|
+
n.cancel = function() {
|
|
625
|
+
cancelAnimationFrame(this.s);
|
|
626
|
+
this.s = 0;
|
|
627
|
+
return this;
|
|
628
|
+
};
|
|
629
|
+
n.create = function(a, b, c, d) {
|
|
630
|
+
const e = this.key, f = e && a[e];
|
|
631
|
+
let h;
|
|
632
|
+
var k;
|
|
633
|
+
let g, l;
|
|
634
|
+
this.pool && (e ? (k = this.j) && (h = k.get(f)) && (k.delete(f), l = 1) : (k = this.A) && k.length && (h = k.pop()));
|
|
635
|
+
h || (h = g = this.m, g || (this.m = h = g = M(this, this.tpl.tpl, [], ""), ja(this)));
|
|
636
|
+
let m;
|
|
637
|
+
this.apply && (k = h._mkp || K(h, this.m._mkp, !!g || this.cache), m = g && this.cache && Array(k.length), this.apply(a, b || this.state, c, k, !!g, m));
|
|
638
|
+
g && (h = g.cloneNode(!0), m && !0 !== m && (h._mkc = m), h._mkr = 1);
|
|
639
|
+
e && (l || (h._mkk = f), d && (this.o[f] = h));
|
|
640
|
+
(a = this.on && this.on[g ? "create" : "recycle"]) && a(h, this);
|
|
641
|
+
return h;
|
|
642
|
+
};
|
|
643
|
+
n.add = function(a, b, c) {
|
|
644
|
+
let d;
|
|
645
|
+
"number" === typeof b ? (c = 0 > b ? this.length + b : b, b = null, d = c < this.length) : "number" === typeof c ? (0 > c && (c += this.length), d = c < this.length) : c = this.length;
|
|
646
|
+
a = this.create(a, b, c, 1);
|
|
647
|
+
d ? (this.root.insertBefore(a, this.g[c]), na(this.g, this.length - 1, c, a), this.length++) : (this.root.appendChild(a), this.g[this.length++] = a);
|
|
648
|
+
this.key && this.pool && this.pool < this.length && (this.pool = this.length);
|
|
649
|
+
(c = this.on && this.on.insert) && c(a, this);
|
|
650
|
+
return this;
|
|
651
|
+
};
|
|
652
|
+
function S(a, b, c) {
|
|
653
|
+
{
|
|
654
|
+
b = b._mkp || K(b, a.m._mkp, a.cache);
|
|
655
|
+
a = a.proxy;
|
|
656
|
+
const d = c._mkx;
|
|
657
|
+
d ? d.path = b : c = new fa(c, {path:b, fn:a, get:ha, set:ia});
|
|
658
|
+
}
|
|
659
|
+
return c;
|
|
660
|
+
}
|
|
661
|
+
function la(a, b, c, d) {
|
|
662
|
+
const e = a.g, f = a.o, h = a.key;
|
|
663
|
+
let k = b.length, g = e.length, l = g > k ? g : k, m = 0;
|
|
664
|
+
for (d || (d = 0); d < l; d++) {
|
|
665
|
+
var q = void 0;
|
|
666
|
+
if (d < k) {
|
|
667
|
+
var t = b[d], r = d >= g;
|
|
668
|
+
let v, u, J, A;
|
|
669
|
+
a.proxy && (t._mkx ? A = a.i : b[d] = S(a, e[d], t));
|
|
670
|
+
if (!r && (v = e[d], u = t[h], J = v._mkk, J === u)) {
|
|
671
|
+
A || a.update(v, t, c, d);
|
|
672
|
+
continue;
|
|
673
|
+
}
|
|
674
|
+
if (r || !f[u]) {
|
|
675
|
+
r || !a.pool ? (g++, l = g > k ? g : k, a.add(t, c, d)) : a.replace(v, t, c, d);
|
|
676
|
+
continue;
|
|
677
|
+
}
|
|
678
|
+
let x, G;
|
|
679
|
+
for (r = d + 1; r < l; r++) {
|
|
680
|
+
if (!x && r < g && e[r]._mkk === u && (x = r + 1), !G && r < k && b[r][h] === J && (G = r + 1), x && G) {
|
|
681
|
+
x >= G + m ? (q = e[x - 1], a.root.insertBefore(q, v), A || a.update(q, t, c, d), x === G ? (1 < r - d && a.root.insertBefore(v, e[x]), e[d] = e[r], (e[r] = v) || console.error("reconcile.error 1")) : (x - 1 === d && console.error("reconcile.error 2"), na(e, x - 1, d), m++)) : (t = G - 1 + m, a.root.insertBefore(v, e[t] || null), (t > g ? g : t) - 1 === d && console.error("reconcile.error 3"), na(e, d, (t > g ? g : t) - 1), m--, d--);
|
|
682
|
+
q = 1;
|
|
683
|
+
break;
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
q || (a.remove(d), g--, l = g > k ? g : k, d--);
|
|
688
|
+
}
|
|
689
|
+
return a;
|
|
690
|
+
}
|
|
691
|
+
function na(a, b, c, d) {
|
|
692
|
+
const e = d || a[b];
|
|
693
|
+
d && b++;
|
|
694
|
+
if (b < c) {
|
|
695
|
+
for (; b < c; b++) {
|
|
696
|
+
a[b] = a[b + 1];
|
|
697
|
+
}
|
|
698
|
+
} else {
|
|
699
|
+
for (; b > c; b--) {
|
|
700
|
+
a[b] = a[b - 1];
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
a[c] = e;
|
|
704
|
+
}
|
|
705
|
+
n.append = function(a, b, c) {
|
|
706
|
+
let d;
|
|
707
|
+
"number" === typeof b ? (c = 0 > b ? this.length + b : b, b = null, d = 1) : "number" === typeof c && (0 > c && (c += this.length), d = 1);
|
|
708
|
+
const e = a.length;
|
|
709
|
+
for (let f = 0; f < e; f++) {
|
|
710
|
+
this.add(a[f], b, d ? c++ : null);
|
|
711
|
+
}
|
|
712
|
+
return this;
|
|
713
|
+
};
|
|
714
|
+
n.clear = function() {
|
|
715
|
+
this.length && this.remove(0, this.length);
|
|
716
|
+
return this;
|
|
717
|
+
};
|
|
718
|
+
n.remove = function(a, b) {
|
|
719
|
+
let c = this.length;
|
|
720
|
+
c && a && ("number" !== typeof a ? a = this.index(a) : 0 > a && (a = c + a));
|
|
721
|
+
if (!c || a >= c) {
|
|
722
|
+
return this;
|
|
723
|
+
}
|
|
724
|
+
b ? 0 > b && (a -= b + 1, 0 > a && (a = 0), b *= -1) : b = 1;
|
|
725
|
+
let d;
|
|
726
|
+
!a && b >= c ? (d = this.g, b = d.length, this.root.textContent = "", this.root._mkd = this.g = [], c = 0) : (d = this.g.splice(a, b), c -= b);
|
|
727
|
+
const e = this.pool && !this.key, f = this.key || this.pool, h = this.on && this.on.remove;
|
|
728
|
+
(a = this.key && this.pool) && b >= a && (this.j = new Map(), a = 0);
|
|
729
|
+
for (let k = 0, g; k < b; k++) {
|
|
730
|
+
g = d[e ? b - k - 1 : k], c && g.remove(), f && ma(this, g, 1), h && h(g, this);
|
|
731
|
+
}
|
|
732
|
+
if (a && 0 < (a = this.j.size - a)) {
|
|
733
|
+
for (b = this.j.keys(); a--;) {
|
|
734
|
+
this.j.delete(b.next().value);
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
this.length = c;
|
|
738
|
+
return this;
|
|
739
|
+
};
|
|
740
|
+
n.index = function(a) {
|
|
741
|
+
return a ? this.g.indexOf(a) : -1;
|
|
742
|
+
};
|
|
743
|
+
n.node = function(a) {
|
|
744
|
+
return this.g[a];
|
|
745
|
+
};
|
|
746
|
+
function ma(a, b, c) {
|
|
747
|
+
let d;
|
|
748
|
+
a.key && (d = b._mkk, a.o[d] = null);
|
|
749
|
+
a.pool && (d ? (a.j.set(d, b), !c && a.j.size > a.pool && a.j.delete(a.j.keys().next().value)) : a.A[a.A.length] = b);
|
|
750
|
+
}
|
|
751
|
+
n.flush = function() {
|
|
752
|
+
this.A = [];
|
|
753
|
+
this.j = new Map();
|
|
754
|
+
return this;
|
|
755
|
+
};
|
|
756
|
+
n.destroy = function() {
|
|
757
|
+
for (let a = 0, b; a < this.inc.length; a++) {
|
|
758
|
+
b = this.inc[a], O[b.name] || b.destroy();
|
|
759
|
+
}
|
|
760
|
+
this.key && (this.root && (this.root._mkl = null), this.o = null);
|
|
761
|
+
this.root && (this.root._mkd = this.root._mki = null);
|
|
762
|
+
this.proxy = this.on = this.j = this.A = this.g = this.root = this.tpl = this.apply = this.inc = this.state = this.m = null;
|
|
763
|
+
};
|
|
764
|
+
const T = Array.prototype, oa = window.Proxy;
|
|
765
|
+
let U = !1;
|
|
766
|
+
function V(a) {
|
|
767
|
+
if (!a) {
|
|
768
|
+
throw Error("The observable array was not assigned to a Mikado instance. You need to pass in the observable array when initiating a Mikado instance.");
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
function R(a) {
|
|
772
|
+
if (a instanceof R) {
|
|
773
|
+
return a;
|
|
774
|
+
}
|
|
775
|
+
if (!(this instanceof R)) {
|
|
776
|
+
return new R(a);
|
|
777
|
+
}
|
|
778
|
+
this.h = null;
|
|
779
|
+
const b = a ? a.length : 0;
|
|
780
|
+
if (oa) {
|
|
781
|
+
if (b) {
|
|
782
|
+
for (let c = 0; c < b; c++) {
|
|
783
|
+
this[c] = a[c];
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
this.length = b;
|
|
787
|
+
this.l = {splice:T.splice.bind(this), pop:T.pop.bind(this), shift:T.shift.bind(this), unshift:T.unshift.bind(this), push:T.push.bind(this)};
|
|
788
|
+
return new Proxy(this, pa);
|
|
789
|
+
}
|
|
790
|
+
this.l = a || [];
|
|
791
|
+
for (a = 0; a <= b; a++) {
|
|
792
|
+
qa(this, a);
|
|
793
|
+
}
|
|
794
|
+
qa(this, "length");
|
|
795
|
+
}
|
|
796
|
+
R.prototype.mount = function(a) {
|
|
797
|
+
this.h !== a && (this.h && a.mount(this.h.root), this.h = a);
|
|
798
|
+
return this;
|
|
799
|
+
};
|
|
800
|
+
function qa(a, b) {
|
|
801
|
+
Object.defineProperty(a, b, {get:function() {
|
|
802
|
+
return this.l[b];
|
|
803
|
+
}, set:function(c) {
|
|
804
|
+
"number" === typeof b && (b === this.length && qa(this, b + 1), pa.set(this, b, c));
|
|
805
|
+
}});
|
|
806
|
+
}
|
|
807
|
+
const pa = {set:function(a, b, c) {
|
|
808
|
+
let d;
|
|
809
|
+
"number" === typeof b ? d = !0 : b === "" + parseInt(b, 10) && (d = !0);
|
|
810
|
+
const e = a.h;
|
|
811
|
+
if (!U) {
|
|
812
|
+
U = !0;
|
|
813
|
+
if (e) {
|
|
814
|
+
var f = a.length;
|
|
815
|
+
if (d) {
|
|
816
|
+
V(e);
|
|
817
|
+
const h = e.length;
|
|
818
|
+
f !== h && (a.length = h);
|
|
819
|
+
b >= h ? (e.add(c), a.length++) : b < h && (f = e.g[b], e.recycle || e.key && f._mkk === c[e.key] ? e.update(f, c, null, b) : e.replace(f, c, null, b));
|
|
820
|
+
} else {
|
|
821
|
+
"length" === b && c < f && e.remove(c, f - c);
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
U = !1;
|
|
825
|
+
}
|
|
826
|
+
e && (f = e.recycle || e.key, !d || !e.proxy || f && c._mkx || (c = S(e, e.g[b], c)));
|
|
827
|
+
(oa ? a : a.l)[b] = c;
|
|
828
|
+
return !0;
|
|
829
|
+
}};
|
|
830
|
+
n = R.prototype;
|
|
831
|
+
n.set = function(a) {
|
|
832
|
+
const b = this.h;
|
|
833
|
+
b.recycle || b.key ? (U = !0, b.render(a), U = !1, this.length > a.length && this.splice(a.length)) : (this.splice(), this.concat(a));
|
|
834
|
+
return this;
|
|
835
|
+
};
|
|
836
|
+
n.splice = function(a, b, c) {
|
|
837
|
+
V(this.h);
|
|
838
|
+
U = !0;
|
|
839
|
+
a || (a = 0);
|
|
840
|
+
"undefined" === typeof b && (b = this.length - a, 0 > b && (b = 0));
|
|
841
|
+
b && this.h.remove(a, b);
|
|
842
|
+
b = c ? this.l.splice(a, b, c) : this.l.splice(a, b);
|
|
843
|
+
c && this.h.add(c, a);
|
|
844
|
+
U = !1;
|
|
845
|
+
return b;
|
|
846
|
+
};
|
|
847
|
+
n.push = function(a) {
|
|
848
|
+
V(this.h);
|
|
849
|
+
U = !0;
|
|
850
|
+
this.h.add(a);
|
|
851
|
+
this[this.length] = a;
|
|
852
|
+
oa && this.length++;
|
|
853
|
+
U = !1;
|
|
854
|
+
};
|
|
855
|
+
n.unshift = function(a) {
|
|
856
|
+
V(this.h);
|
|
857
|
+
U = !0;
|
|
858
|
+
this.h.add(a, 0);
|
|
859
|
+
this.l.unshift(a);
|
|
860
|
+
U = !1;
|
|
861
|
+
};
|
|
862
|
+
n.pop = function() {
|
|
863
|
+
V(this.h);
|
|
864
|
+
U = !0;
|
|
865
|
+
this.h.remove(this.length - 1);
|
|
866
|
+
const a = this.l.pop();
|
|
867
|
+
U = !1;
|
|
868
|
+
return a;
|
|
869
|
+
};
|
|
870
|
+
n.shift = function() {
|
|
871
|
+
V(this.h);
|
|
872
|
+
U = !0;
|
|
873
|
+
this.h.remove(0);
|
|
874
|
+
const a = this.l.shift();
|
|
875
|
+
U = !1;
|
|
876
|
+
return a;
|
|
877
|
+
};
|
|
878
|
+
n.concat = function(a) {
|
|
879
|
+
const b = a.length;
|
|
880
|
+
for (let c = 0; c < b; c++) {
|
|
881
|
+
this.push(a[c]);
|
|
882
|
+
}
|
|
883
|
+
return this;
|
|
884
|
+
};
|
|
885
|
+
n.sort = T.sort;
|
|
886
|
+
n.reverse = T.reverse;
|
|
887
|
+
n.slice = T.slice;
|
|
888
|
+
n.map = function(a, b) {
|
|
889
|
+
b && (a = a.bind(this));
|
|
890
|
+
for (let c = 0, d = this.length; c < d; c++) {
|
|
891
|
+
this[c] = a(this[c]);
|
|
892
|
+
}
|
|
893
|
+
return this;
|
|
894
|
+
};
|
|
895
|
+
n.filter = function(a, b) {
|
|
896
|
+
b && (a = a.bind(this));
|
|
897
|
+
let c, d;
|
|
898
|
+
for (let e = 0, f = this.length; e < f; e++) {
|
|
899
|
+
a(this[e]) ? d && (this.splice(c, d), f -= d, e -= d, d = 0) : d ? d++ : (c = e, d = 1);
|
|
900
|
+
}
|
|
901
|
+
d && this.splice(c, d);
|
|
902
|
+
return this;
|
|
903
|
+
};
|
|
904
|
+
n.indexOf = function(a) {
|
|
905
|
+
for (let b = 0, c = this.length; b < c; b++) {
|
|
906
|
+
if (this[b] === a) {
|
|
907
|
+
return b;
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
return -1;
|
|
911
|
+
};
|
|
912
|
+
n.lastIndexOf = function(a) {
|
|
913
|
+
for (let b = this.length - 1; 0 <= b; b--) {
|
|
914
|
+
if (this[b] === a) {
|
|
915
|
+
return b;
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
return -1;
|
|
919
|
+
};
|
|
920
|
+
n.includes = T.includes;
|
|
921
|
+
n.forEach = function(a) {
|
|
922
|
+
for (let b = 0, c = this.length; b < c; b++) {
|
|
923
|
+
a(this[b]);
|
|
924
|
+
}
|
|
925
|
+
return this;
|
|
926
|
+
};
|
|
927
|
+
n.swap = function(a, b) {
|
|
928
|
+
const c = this[b];
|
|
929
|
+
this[b] = this[a];
|
|
930
|
+
this[a] = c;
|
|
931
|
+
return this;
|
|
932
|
+
};
|
|
933
|
+
n.transaction = function(a) {
|
|
934
|
+
V(this.h);
|
|
935
|
+
U = !0;
|
|
936
|
+
a();
|
|
937
|
+
U = !1;
|
|
938
|
+
const b = this.h, c = b.i;
|
|
939
|
+
b.i = 0;
|
|
940
|
+
b.async ? b.render(this).then(function() {
|
|
941
|
+
b.i = c;
|
|
942
|
+
}) : (b.render(this), b.i = c);
|
|
943
|
+
};
|
|
944
|
+
const W = document.createElement("div"), ra = document.createTextNode(""), X = document.createElement("div");
|
|
945
|
+
W.appendChild(ra);
|
|
946
|
+
n = P.prototype;
|
|
947
|
+
n.move = P.prototype.moveTo = function(a, b) {
|
|
948
|
+
let c;
|
|
949
|
+
"number" === typeof a ? (c = a, a = this.g[c]) : c = this.index(a);
|
|
950
|
+
0 > b && (b = this.length + b - 1);
|
|
951
|
+
c !== b && this.shift(a, b - c);
|
|
952
|
+
return this;
|
|
953
|
+
};
|
|
954
|
+
n.shift = function(a, b) {
|
|
955
|
+
if (!b) {
|
|
956
|
+
return this;
|
|
957
|
+
}
|
|
958
|
+
if ("number" === typeof a) {
|
|
959
|
+
var c = a;
|
|
960
|
+
a = this.g[a];
|
|
961
|
+
} else {
|
|
962
|
+
c = this.index(a);
|
|
963
|
+
}
|
|
964
|
+
const d = 0 > b;
|
|
965
|
+
if (d && c || !d && c < this.length - 1) {
|
|
966
|
+
b = d ? Math.max(c + b, 0) : Math.min(c + b, this.length - 1);
|
|
967
|
+
const e = this.g[b], f = d && 1 < c - b || !d && 1 < b - c;
|
|
968
|
+
this.root.insertBefore(a, d ? e : this.g[b + 1] || null);
|
|
969
|
+
if (f) {
|
|
970
|
+
a = this.g[c];
|
|
971
|
+
if (d) {
|
|
972
|
+
for (; c > b; c--) {
|
|
973
|
+
this.g[c] = this.g[c - 1];
|
|
974
|
+
}
|
|
975
|
+
} else {
|
|
976
|
+
for (; c < b; c++) {
|
|
977
|
+
this.g[c] = this.g[c + 1];
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
this.g[b] = a;
|
|
981
|
+
} else {
|
|
982
|
+
this.g[c] = e, this.g[b] = a;
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
return this;
|
|
986
|
+
};
|
|
987
|
+
n.up = function(a, b) {
|
|
988
|
+
(!b || 0 < b) && this.shift(a, -(b || 1));
|
|
989
|
+
return this;
|
|
990
|
+
};
|
|
991
|
+
n.down = function(a, b) {
|
|
992
|
+
(!b || 0 < b) && this.shift(a, b || 1);
|
|
993
|
+
return this;
|
|
994
|
+
};
|
|
995
|
+
n.first = function(a) {
|
|
996
|
+
return this.shift(a, -this.length);
|
|
997
|
+
};
|
|
998
|
+
n.last = function(a) {
|
|
999
|
+
return this.shift(a, this.length);
|
|
1000
|
+
};
|
|
1001
|
+
n.before = function(a, b) {
|
|
1002
|
+
"number" !== typeof a && (a = this.index(a));
|
|
1003
|
+
"number" !== typeof b && (b = this.index(b));
|
|
1004
|
+
b !== a + 1 && (0 > b && (b = this.length + b, 0 > a && b--), 0 > a && (a = this.length + a - 1), this.shift(a, b - a - 1));
|
|
1005
|
+
return this;
|
|
1006
|
+
};
|
|
1007
|
+
n.after = function(a, b) {
|
|
1008
|
+
"number" !== typeof a && (a = this.index(a));
|
|
1009
|
+
"number" !== typeof b && (b = this.index(b));
|
|
1010
|
+
b !== a - 1 && (0 > b && (b = this.length + b - 2, 0 > a && b++), 0 > a && (a = this.length + a - 1), this.shift(a, b - a + 1));
|
|
1011
|
+
return this;
|
|
1012
|
+
};
|
|
1013
|
+
n.swap = function(a, b) {
|
|
1014
|
+
if (a !== b) {
|
|
1015
|
+
let c, d;
|
|
1016
|
+
"number" === typeof a ? (c = 0 > a ? this.length + a : a, a = this.g[c]) : c = this.index(a);
|
|
1017
|
+
"number" === typeof b ? (d = 0 > b ? this.length + b : b, b = this.g[d]) : d = this.index(b);
|
|
1018
|
+
const e = c + 1 !== d;
|
|
1019
|
+
this.root.insertBefore(e ? a : b, e ? b : a);
|
|
1020
|
+
e && d + 1 !== c && this.root.insertBefore(b, this.g[c + 1] || null);
|
|
1021
|
+
this.g[c] = b;
|
|
1022
|
+
this.g[d] = a;
|
|
1023
|
+
}
|
|
1024
|
+
return this;
|
|
1025
|
+
};
|
|
1026
|
+
const sa = {tap:1, change:1, click:1, dblclick:1, input:1, keydown:1, keypress:1, keyup:1, mousedown:1, mouseover:1, mouseout:1, mousemove:1, mouseup:1, mousewheel:1, touchstart:1, touchmove:1, touchend:1, touchcancel:1, reset:1, select:1, submit:1, toggle:1, focusin:1, focusout:1, resize:1, scroll:1, error:1, load:1}, ta = {blur:"focusout", focus:"focusin", mouseleave:"mouseout", mouseenter:"mouseover"};
|
|
1027
|
+
let ua = 0, va = 0;
|
|
1028
|
+
function wa(a, b, c, d, e, f) {
|
|
1029
|
+
ua || (ua = 1, console.info("If this page has set a Content-Security-Policy (CSP) header field, using the inline compiler has disadvantage when not configure \"script-src 'unsafe-eval'\". It is recommended to use the Mikado native compiler, which is CSP-friendly and also can optimize your templates more powerful."));
|
|
1030
|
+
if (b) {
|
|
1031
|
+
return new Promise(function(v) {
|
|
1032
|
+
const u = wa(a);
|
|
1033
|
+
"function" === typeof b && b(u);
|
|
1034
|
+
v(u);
|
|
1035
|
+
});
|
|
1036
|
+
}
|
|
1037
|
+
e || (d = [], c = [d], d.index = e = {current:-1, count:0, last:-1, inc:0, u:!1});
|
|
1038
|
+
const h = f ? {} : {tpl:{}}, k = f ? h : h.tpl;
|
|
1039
|
+
if (!f) {
|
|
1040
|
+
if ("string" === typeof a) {
|
|
1041
|
+
if (/<.*>/.test(a)) {
|
|
1042
|
+
var g = document.createElement("div");
|
|
1043
|
+
g.innerHTML = a;
|
|
1044
|
+
a = g.firstElementChild;
|
|
1045
|
+
} else {
|
|
1046
|
+
h.name = a, a = document.getElementById(a);
|
|
1047
|
+
}
|
|
1048
|
+
if (!a) {
|
|
1049
|
+
throw Error("The template was not found.");
|
|
1050
|
+
}
|
|
1051
|
+
}
|
|
1052
|
+
a.content && (h.name || (h.name = a.id || a.getAttribute("name")), a = a.content.firstElementChild);
|
|
1053
|
+
}
|
|
1054
|
+
g = a.tagName;
|
|
1055
|
+
if (!g || "SCRIPT" === g) {
|
|
1056
|
+
var l;
|
|
1057
|
+
if ((l = (g ? a.firstChild : a).nodeValue) && l && l.trim()) {
|
|
1058
|
+
if (l.includes("{{@")) {
|
|
1059
|
+
var m = l.replace(/{{@([\s\S]+)}}/g, "$1").trim();
|
|
1060
|
+
l = /{{[\s\S]+}}/.test(m) ? m.replace(/{{([\s\S]+)}}/g, "{{$1}}") : "";
|
|
1061
|
+
m && (m = m.replace(/{{([\s\S]+)}}/g, ""));
|
|
1062
|
+
m && d.push(m);
|
|
1063
|
+
if ("SCRIPT" === g) {
|
|
1064
|
+
return l.trim() && (k.text = l, k.tag = g), k;
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
l && l.trim() && (l.includes("{{#") ? xa(k, "html", l, !1, null, e, d) : (e.count++, xa(k, "text", l, !1, null, e, d)));
|
|
1068
|
+
}
|
|
1069
|
+
if (!g) {
|
|
1070
|
+
return l && l.trim() ? k : null;
|
|
1071
|
+
}
|
|
1072
|
+
}
|
|
1073
|
+
g && (k.tag = g);
|
|
1074
|
+
if ((l = a.attributes) && l.length) {
|
|
1075
|
+
g = {};
|
|
1076
|
+
for (m = 0; m < l.length; m++) {
|
|
1077
|
+
let v = l[m].nodeName, u = a.getAttribute(v);
|
|
1078
|
+
"include" === v && (v = "inc");
|
|
1079
|
+
g[v] = u;
|
|
1080
|
+
}
|
|
1081
|
+
l = g;
|
|
1082
|
+
for (var q in l) {
|
|
1083
|
+
g = l[q];
|
|
1084
|
+
var t = void 0, r = void 0;
|
|
1085
|
+
switch(q) {
|
|
1086
|
+
case "class":
|
|
1087
|
+
case "style":
|
|
1088
|
+
t = q;
|
|
1089
|
+
break;
|
|
1090
|
+
case "include":
|
|
1091
|
+
q = "inc";
|
|
1092
|
+
case "inc":
|
|
1093
|
+
t = q;
|
|
1094
|
+
break;
|
|
1095
|
+
case "if":
|
|
1096
|
+
t = q;
|
|
1097
|
+
break;
|
|
1098
|
+
case "foreach":
|
|
1099
|
+
t = q = "for";
|
|
1100
|
+
break;
|
|
1101
|
+
case "js":
|
|
1102
|
+
break;
|
|
1103
|
+
case "key":
|
|
1104
|
+
h.key = g.replace(/({{|}})/g, "").trim().replace("data.", "");
|
|
1105
|
+
break;
|
|
1106
|
+
case "cache":
|
|
1107
|
+
break;
|
|
1108
|
+
default:
|
|
1109
|
+
ta[q] ? (r = k.event || (k.event = {}), console.info("The assigned event '" + q + "' was replaced by the event '" + ta[q] + "'."), q = ta[q]) : sa[q] ? r = k.event || (k.event = {}) : (f || "id" !== q && "name" !== q || h.name || /{{[\s\S]+}}/.test(g) || (h.name = g), r = k.attr || (k.attr = {})), t = q;
|
|
1110
|
+
}
|
|
1111
|
+
t && xa(r || k, t, g, !!r, l, e, d);
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
q = (a.content || a).childNodes;
|
|
1115
|
+
t = q.length;
|
|
1116
|
+
e.u && (e.u = !1, e.inc++, d = [], (k.for || k.if) && c.unshift(d), k.child || (k.child = k.text ? {text:k.text} : k.html ? {html:k.html} : null), t ? (d.root = k, d.inc = k.child || (k.child = []), d.index = e = {current:-1, count:0, last:-1, inc:0, u:!1}) : d.inc = k.inc, delete k.for, delete k.if, delete k.text, delete k.html);
|
|
1117
|
+
if (t) {
|
|
1118
|
+
for (let v = 0, u; v < t; v++) {
|
|
1119
|
+
if (u = q[v], 8 !== u.nodeType && (e.count++, r = wa(u, null, c, d, e, 1))) {
|
|
1120
|
+
1 !== t || 3 !== u.nodeType && r.text || k.js && r.js ? (r.text || r.tag) && (k.child || (k.child = [])).push(r) : (r.js && (k.js = r.js), r.html && (k.html = r.html), r.text && (k.text = r.text));
|
|
1121
|
+
}
|
|
1122
|
+
}
|
|
1123
|
+
k.child && 1 === k.child.length && (k.child = k.child[0]);
|
|
1124
|
+
}
|
|
1125
|
+
if (!f) {
|
|
1126
|
+
h.name || (h.name = "tpl-" + va++);
|
|
1127
|
+
if ("COMPONENT" === k.tag) {
|
|
1128
|
+
d = k.child;
|
|
1129
|
+
e = [];
|
|
1130
|
+
for (let v = 0, u; v < d.length; v++) {
|
|
1131
|
+
u = d[v], "TEMPLATE" === u.tag ? (d = f = u.child.length ? u.child[0] : u.child, u.name && (f.name = u.name), u.id && (f.id = u.id), u.key && (f.key = u.key), u.cache && (f.cache = u.cache)) : e.push(u);
|
|
1132
|
+
}
|
|
1133
|
+
h.tpl = d;
|
|
1134
|
+
h.cmp = e;
|
|
1135
|
+
}
|
|
1136
|
+
if (1 === c.length && 0 === c[0].length) {
|
|
1137
|
+
h.fn = null;
|
|
1138
|
+
} else {
|
|
1139
|
+
for (d = 0; d < c.length; d++) {
|
|
1140
|
+
c[d].root && (c[d].root.inc = c[d].inc[0], delete c[d].root.child), c[d] = c[d].length ? Function("data", "state", "index", "_p", "_f", "_x", '"use strict";let _o,_v,_c;' + c[d].join(";")) : null;
|
|
1141
|
+
}
|
|
1142
|
+
h.fn = c.length ? c : null;
|
|
1143
|
+
}
|
|
1144
|
+
}
|
|
1145
|
+
return h;
|
|
1146
|
+
}
|
|
1147
|
+
function xa(a, b, c, d, e, f, h) {
|
|
1148
|
+
if (/{{[\s\S]+}}/.test(c)) {
|
|
1149
|
+
let k = /{{([!?#]+)?=/.test(c), g = /{{!?\?/.test(c), l = /{{\??!/.test(c);
|
|
1150
|
+
if (k) {
|
|
1151
|
+
if (g || l) {
|
|
1152
|
+
c = c.replace(/{{[!?]+/g, "{{");
|
|
1153
|
+
}
|
|
1154
|
+
k = c.replace(/{{#?=+(.*)?}}/ig, "$1").trim().replace(/^data\./, "").replace(/^data\[['"](.*)['"]]/, "$1");
|
|
1155
|
+
}
|
|
1156
|
+
c = c.replace(/{{[!?#=]+/g, "{{").replace(/"(\s+)?{{(\s+)?/g, "(").replace(/(\s+)?}}(\s+)?"/g, ")").replace(/{{(\s+)?/g, "'+(").replace(/(\s+)?}}/g, ")+'").replace(/\s+/g, " ");
|
|
1157
|
+
c = ("'" + c + "'").replace(/^""\+/g, "").replace(/^''\+/g, "").replace(/\+''$/g, "").replace(/\+""$/g, "").replace(/"\)\+''\+\("/g, "").replace(/'\)\+''\+\('/g, "").replace(/\+''\+/g, "+").replace(/'(\s+)?\+(\s+)?'/g, "").replace(/"(\s+)?\+(\s+)?"/g, "").replace(/^\(([^ ]+)\)$/g, "$1").trim();
|
|
1158
|
+
g && (c = "(" + (c + "||" + c + "===0?" + c + ":'')"));
|
|
1159
|
+
"text" !== b && "style" !== b || !a.tag || f.count++;
|
|
1160
|
+
f.count !== f.last && (f.current++, f.last = f.count, h.push("_o=_p[" + f.current + "]"), h.push("_x&&(_x[" + f.current + "]=_c={})"));
|
|
1161
|
+
h.push("_v=" + c);
|
|
1162
|
+
d ? h.push('_c&&(_c["_a' + b + '"]=_v);if(!_o.c||_o.c["_a' + b + '"]!==_v){_o.c&&(_o.c["_a' + b + '"]=_v);' + (Q[b] ? "selected" === b ? '_f?_o.n[_v===false?"removeAttribute":"setAttribute"]("' + b + '",_v):_o.n.' + b + "=_v" : "_o.n." + b + "=_v" : '_o.n[_v===false?"removeAttribute":"setAttribute"]("' + b + '",_v)') + "}") : "class" === b ? h.push("_c&&(_c._c=_v);if(!_o.c||_o.c._c!==_v){_o.c&&(_o.c._c=_v);_o.n.className=_v}") : "style" === b ? h.push("_c&&(_c._s=_v);if(!_o.c||_o.c._s!==_v){_o.c&&(_o.c._s=_v);_o.n.cssText=_v}") :
|
|
1163
|
+
"html" === b ? h.push("_c&&(_c._h=_v);if(!_o.c||_o.c._h!==_v){_o.c&&(_o.c._h=_v);_o.n.innerHTML=_v}") : "text" === b && h.push("_c&&(_c._t=_v);if(!_o.c||_o.c._t!==_v){_o.c&&(_o.c._t=_v);_o.n.nodeValue=_v}");
|
|
1164
|
+
a[b] = k ? [k] : [];
|
|
1165
|
+
} else {
|
|
1166
|
+
a[b] = c;
|
|
1167
|
+
}
|
|
1168
|
+
"for" !== b && "if" !== b && "inc" !== b || d || f.u || (f.count !== f.last && (f.current++, f.last = f.count, h.push("_o=_p[" + f.current + "]")), a = e.foreach ? e.foreach.trim() : "data", b = f.inc, e.if ? h.push("this.inc[" + b + "].mount(_o.n)[" + e.if.trim() + '?"render":"clear"](' + a + ",state)") : e.foreach ? h.push("this.inc[" + b + "].mount(_o.n).render(" + a + ",state)") : h.push("this.inc[" + b + "].mount(_o.n).render(data,state)"), f.u = !0);
|
|
1169
|
+
}
|
|
1170
|
+
;const ya = /[^;:]+/g, za = / +/;
|
|
1171
|
+
function Aa(a, b, c, d) {
|
|
1172
|
+
d["_a" + b] !== c && (d["_a" + b] = c, Q[b] ? a[b] = c : !1 === c ? a.removeAttribute(b) : a.setAttribute(b, c));
|
|
1173
|
+
}
|
|
1174
|
+
function Ba(a, b, c) {
|
|
1175
|
+
!1 !== c["_a" + b] && (c["_a" + b] = !1, Q[b] ? a[b] = !1 : a.removeAttribute(b));
|
|
1176
|
+
}
|
|
1177
|
+
function Ca(a, b) {
|
|
1178
|
+
let c = a._mkc, d;
|
|
1179
|
+
c ? d = c["_a" + b] : a._mkc = c = {};
|
|
1180
|
+
"string" !== typeof d && (Q[b] ? d = a[b] : d = a.getAttribute(b), c["_a" + b] = d);
|
|
1181
|
+
return d;
|
|
1182
|
+
}
|
|
1183
|
+
function Y(a) {
|
|
1184
|
+
let b = a._mkc, c;
|
|
1185
|
+
b ? c = b._c : a._mkc = b = {};
|
|
1186
|
+
if (!c) {
|
|
1187
|
+
return b._c = {};
|
|
1188
|
+
}
|
|
1189
|
+
if ("string" === typeof c) {
|
|
1190
|
+
a = c.trim().split(za);
|
|
1191
|
+
b._c = c = {};
|
|
1192
|
+
for (let d = 0, e; d < a.length; d++) {
|
|
1193
|
+
(e = a[d]) && (c[a[d]] = 1);
|
|
1194
|
+
}
|
|
1195
|
+
}
|
|
1196
|
+
return c;
|
|
1197
|
+
}
|
|
1198
|
+
function Da(a, b, c, d) {
|
|
1199
|
+
let e = !!d[b];
|
|
1200
|
+
c = "undefined" === typeof c ? !e : !!c;
|
|
1201
|
+
e !== c && (d[b] = c ? 1 : 0, c ? a.classList.add(b) : a.classList.remove(b));
|
|
1202
|
+
}
|
|
1203
|
+
function Ea(a) {
|
|
1204
|
+
var b = a._mkc;
|
|
1205
|
+
let c;
|
|
1206
|
+
b ? c = b._s : a._mkc = b = {};
|
|
1207
|
+
if (!c) {
|
|
1208
|
+
return b._s = {};
|
|
1209
|
+
}
|
|
1210
|
+
if ("string" === typeof c) {
|
|
1211
|
+
for (a = c.match(ya), b._s = c = {}, b = 0; b < a.length; b += 2) {
|
|
1212
|
+
c[a[b].trim()] = a[b + 1].trim();
|
|
1213
|
+
}
|
|
1214
|
+
}
|
|
1215
|
+
return c;
|
|
1216
|
+
}
|
|
1217
|
+
;P.once = ka;
|
|
1218
|
+
P.register = function(a, b) {
|
|
1219
|
+
let c, d;
|
|
1220
|
+
if ("string" === typeof a) {
|
|
1221
|
+
if (c = d = a, a = O[c], a instanceof P || (a = a[0]), !a) {
|
|
1222
|
+
throw Error("The template '" + c + "' was not found.");
|
|
1223
|
+
}
|
|
1224
|
+
} else {
|
|
1225
|
+
c = a.name;
|
|
1226
|
+
}
|
|
1227
|
+
O[c] && (d ? console.info("The template '" + c + "' was replaced by a new definition.") : console.warn("The template '" + c + "' was already registered and is getting overwritten. When this isn't your intention, then please check your template names about uniqueness and collision!"));
|
|
1228
|
+
O[c] = [a, b];
|
|
1229
|
+
return P;
|
|
1230
|
+
};
|
|
1231
|
+
P.unregister = function(a) {
|
|
1232
|
+
"object" === typeof a && (a = a.name);
|
|
1233
|
+
const b = O[a];
|
|
1234
|
+
b && (b instanceof P && b.destroy(), O[a] = null);
|
|
1235
|
+
return P;
|
|
1236
|
+
};
|
|
1237
|
+
P.compile = wa;
|
|
1238
|
+
P.setText = function(a, b) {
|
|
1239
|
+
var c = a._mkc;
|
|
1240
|
+
let d;
|
|
1241
|
+
c ? d = c._t : a._mkc = c = {};
|
|
1242
|
+
d !== b && (c._t = b, c._h = null, (c = a.firstChild) ? c.nodeValue = b : a.appendChild(document.createTextNode(b)));
|
|
1243
|
+
};
|
|
1244
|
+
P.getText = function(a) {
|
|
1245
|
+
let b = a._mkc, c;
|
|
1246
|
+
b ? c = b._t : a._mkc = b = {};
|
|
1247
|
+
"string" !== typeof c && (a = a.firstChild, b._t = c = a ? a.nodeValue : "");
|
|
1248
|
+
return c;
|
|
1249
|
+
};
|
|
1250
|
+
P.setHtml = function(a, b) {
|
|
1251
|
+
let c = a._mkc, d;
|
|
1252
|
+
c ? d = c._h : a._mkc = c = {};
|
|
1253
|
+
d !== b && (a.innerHTML = b, c._h = b, c._t = null);
|
|
1254
|
+
};
|
|
1255
|
+
P.getHtml = function(a) {
|
|
1256
|
+
let b = a._mkc, c;
|
|
1257
|
+
b ? c = b._h || b._t : a._mkc = b = {};
|
|
1258
|
+
"string" !== typeof c && (b._h = c = a.innerHTML);
|
|
1259
|
+
return c;
|
|
1260
|
+
};
|
|
1261
|
+
P.setClass = function(a, b) {
|
|
1262
|
+
let c = a._mkc, d;
|
|
1263
|
+
c ? d = c._c : a._mkc = c = {};
|
|
1264
|
+
"object" === typeof b && (b = b.join(" "));
|
|
1265
|
+
d !== b && (c._c = b, a.className = b);
|
|
1266
|
+
};
|
|
1267
|
+
P.getClass = function(a) {
|
|
1268
|
+
let b = a._mkc, c;
|
|
1269
|
+
b ? c = b._c : a._mkc = b = {};
|
|
1270
|
+
"string" !== typeof c && (b._c = c = a.className);
|
|
1271
|
+
c = c.split(za);
|
|
1272
|
+
return "" === c[0] ? [] : c;
|
|
1273
|
+
};
|
|
1274
|
+
P.hasClass = function(a, b) {
|
|
1275
|
+
const c = Y(a);
|
|
1276
|
+
let d = c[b];
|
|
1277
|
+
"number" !== typeof d && (c[b] = d = a.classList.contains(b) ? 1 : 0);
|
|
1278
|
+
return !!d;
|
|
1279
|
+
};
|
|
1280
|
+
P.toggleClass = function(a, b, c) {
|
|
1281
|
+
const d = Y(a);
|
|
1282
|
+
if ("object" === typeof b) {
|
|
1283
|
+
if (b.constructor === Array) {
|
|
1284
|
+
for (var e = 0; e < b.length; e++) {
|
|
1285
|
+
Da(a, b[e], c, d);
|
|
1286
|
+
}
|
|
1287
|
+
} else {
|
|
1288
|
+
for (e in b) {
|
|
1289
|
+
Da(a, e, b[e], d);
|
|
1290
|
+
}
|
|
1291
|
+
}
|
|
1292
|
+
} else {
|
|
1293
|
+
Da(a, b, c, d);
|
|
1294
|
+
}
|
|
1295
|
+
};
|
|
1296
|
+
P.removeClass = function(a, b) {
|
|
1297
|
+
const c = Y(a);
|
|
1298
|
+
if ("object" === typeof b) {
|
|
1299
|
+
for (let f = 0; f < b.length; f++) {
|
|
1300
|
+
var d = a, e = b[f];
|
|
1301
|
+
0 !== c[e] && (c[e] = 0, d.classList.remove(e));
|
|
1302
|
+
}
|
|
1303
|
+
} else {
|
|
1304
|
+
0 !== c[b] && (c[b] = 0, a.classList.remove(b));
|
|
1305
|
+
}
|
|
1306
|
+
};
|
|
1307
|
+
P.addClass = function(a, b) {
|
|
1308
|
+
const c = Y(a);
|
|
1309
|
+
if ("object" === typeof b) {
|
|
1310
|
+
for (let f = 0; f < b.length; f++) {
|
|
1311
|
+
var d = a, e = b[f];
|
|
1312
|
+
c[e] || (c[e] = 1, d.classList.add(e));
|
|
1313
|
+
}
|
|
1314
|
+
} else {
|
|
1315
|
+
c[b] || (c[b] = 1, a.classList.add(b));
|
|
1316
|
+
}
|
|
1317
|
+
};
|
|
1318
|
+
P.setAttribute = function(a, b, c) {
|
|
1319
|
+
let d = a._mkc;
|
|
1320
|
+
d || (a._mkc = d = {});
|
|
1321
|
+
if ("object" === typeof b) {
|
|
1322
|
+
for (let e in b) {
|
|
1323
|
+
Aa(a, e, b[e], d);
|
|
1324
|
+
}
|
|
1325
|
+
} else {
|
|
1326
|
+
Aa(a, b, c, d);
|
|
1327
|
+
}
|
|
1328
|
+
};
|
|
1329
|
+
P.getAttribute = Ca;
|
|
1330
|
+
P.hasAttribute = function(a, b) {
|
|
1331
|
+
a = Ca(a, b);
|
|
1332
|
+
return !(!a && "" !== a);
|
|
1333
|
+
};
|
|
1334
|
+
P.removeAttribute = function(a, b) {
|
|
1335
|
+
let c = a._mkc;
|
|
1336
|
+
c || (a._mkc = c = {});
|
|
1337
|
+
if ("object" === typeof b) {
|
|
1338
|
+
for (let d = 0; d < b.length; d++) {
|
|
1339
|
+
Ba(a, b[d], c);
|
|
1340
|
+
}
|
|
1341
|
+
} else {
|
|
1342
|
+
Ba(a, b, c);
|
|
1343
|
+
}
|
|
1344
|
+
};
|
|
1345
|
+
P.setCss = function(a, b) {
|
|
1346
|
+
let c = a._mkc, d;
|
|
1347
|
+
c ? d = c._s : a._mkc = c = {};
|
|
1348
|
+
d !== b && (c._s = b, a.style.cssText = b);
|
|
1349
|
+
};
|
|
1350
|
+
P.getCss = function(a) {
|
|
1351
|
+
let b = a._mkc, c;
|
|
1352
|
+
b ? c = b._s : a._mkc = b = {};
|
|
1353
|
+
"string" !== typeof c && (b._s = c = a.style.cssText);
|
|
1354
|
+
return c;
|
|
1355
|
+
};
|
|
1356
|
+
P.getStyle = function(a, b) {
|
|
1357
|
+
const c = Ea(a);
|
|
1358
|
+
let d = c[b];
|
|
1359
|
+
"string" !== typeof d && (c[b] = d = a.style.getPropertyValue(b));
|
|
1360
|
+
return d;
|
|
1361
|
+
};
|
|
1362
|
+
P.setStyle = function(a, b, c) {
|
|
1363
|
+
const d = Ea(a), e = a.style;
|
|
1364
|
+
if ("object" === typeof b) {
|
|
1365
|
+
for (const h in b) {
|
|
1366
|
+
c = a;
|
|
1367
|
+
var f = b[h];
|
|
1368
|
+
d[h] !== f && (d[h] = f, (e || c.style).setProperty(h, f));
|
|
1369
|
+
}
|
|
1370
|
+
} else {
|
|
1371
|
+
d[b] !== c && (d[b] = c, (e || a.style).setProperty(b, c));
|
|
1372
|
+
}
|
|
1373
|
+
};
|
|
1374
|
+
P.escape = function(a) {
|
|
1375
|
+
W.l !== a && (ra.nodeValue = a, W.h = W.innerHTML, W.l = a);
|
|
1376
|
+
return W.h;
|
|
1377
|
+
};
|
|
1378
|
+
P.sanitize = function(a) {
|
|
1379
|
+
X.h !== a && (X.innerHTML = a, X.h = a, X.l = X.textContent);
|
|
1380
|
+
return X.l;
|
|
1381
|
+
};
|
|
1382
|
+
P.prototype.route = P.route = function(a, b, c) {
|
|
1383
|
+
if (!a) {
|
|
1384
|
+
throw Error("Missing route name.");
|
|
1385
|
+
}
|
|
1386
|
+
if (!b) {
|
|
1387
|
+
throw Error("The route '" + a + "' has no function assigned to it.");
|
|
1388
|
+
}
|
|
1389
|
+
y[a] && console.info("A new handler was re-assigned to the route '" + a + "'.");
|
|
1390
|
+
y[a] = b;
|
|
1391
|
+
z[a] = c || null;
|
|
1392
|
+
return this;
|
|
1393
|
+
};
|
|
1394
|
+
P.prototype.dispatch = P.dispatch = ba;
|
|
1395
|
+
P.prototype.listen = P.listen = ca;
|
|
1396
|
+
P.prototype.unlisten = P.unlisten = function(a) {
|
|
1397
|
+
p[a] && (F(0, a, E, w[a]), p[a] = 0, w[a] = null);
|
|
1398
|
+
return this;
|
|
1399
|
+
};
|
|
1400
|
+
P.Array = R;
|
|
1401
|
+
const Z = window;
|
|
1402
|
+
let Fa;
|
|
1403
|
+
(Fa = Z.define) && Fa.amd ? Fa([], function() {
|
|
1404
|
+
return P;
|
|
1405
|
+
}) : "object" === typeof Z.exports ? Z.exports = P : Z.Mikado = P;
|
|
1406
|
+
}).call(this);
|